@tabler/core 1.6.0 → 1.6.1

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 (115) hide show
  1. package/dist/css/tabler-flags.css +1 -1
  2. package/dist/css/tabler-flags.css.map +1 -1
  3. package/dist/css/tabler-flags.min.css +1 -1
  4. package/dist/css/tabler-flags.min.css.map +1 -1
  5. package/dist/css/tabler-flags.rtl.css +1 -1
  6. package/dist/css/tabler-flags.rtl.css.map +1 -1
  7. package/dist/css/tabler-flags.rtl.min.css +1 -1
  8. package/dist/css/tabler-flags.rtl.min.css.map +1 -1
  9. package/dist/css/tabler-marketing.css +1 -1
  10. package/dist/css/tabler-marketing.css.map +1 -1
  11. package/dist/css/tabler-marketing.min.css +1 -1
  12. package/dist/css/tabler-marketing.min.css.map +1 -1
  13. package/dist/css/tabler-marketing.rtl.css +1 -1
  14. package/dist/css/tabler-marketing.rtl.css.map +1 -1
  15. package/dist/css/tabler-marketing.rtl.min.css +1 -1
  16. package/dist/css/tabler-marketing.rtl.min.css.map +1 -1
  17. package/dist/css/tabler-payments.css +1 -1
  18. package/dist/css/tabler-payments.css.map +1 -1
  19. package/dist/css/tabler-payments.min.css +1 -1
  20. package/dist/css/tabler-payments.min.css.map +1 -1
  21. package/dist/css/tabler-payments.rtl.css +1 -1
  22. package/dist/css/tabler-payments.rtl.css.map +1 -1
  23. package/dist/css/tabler-payments.rtl.min.css +1 -1
  24. package/dist/css/tabler-payments.rtl.min.css.map +1 -1
  25. package/dist/css/tabler-props.css +1 -1
  26. package/dist/css/tabler-props.css.map +1 -1
  27. package/dist/css/tabler-props.min.css +1 -1
  28. package/dist/css/tabler-props.min.css.map +1 -1
  29. package/dist/css/tabler-props.rtl.css +1 -1
  30. package/dist/css/tabler-props.rtl.css.map +1 -1
  31. package/dist/css/tabler-props.rtl.min.css +1 -1
  32. package/dist/css/tabler-props.rtl.min.css.map +1 -1
  33. package/dist/css/tabler-socials.css +1 -1
  34. package/dist/css/tabler-socials.css.map +1 -1
  35. package/dist/css/tabler-socials.min.css +1 -1
  36. package/dist/css/tabler-socials.min.css.map +1 -1
  37. package/dist/css/tabler-socials.rtl.css +1 -1
  38. package/dist/css/tabler-socials.rtl.css.map +1 -1
  39. package/dist/css/tabler-socials.rtl.min.css +1 -1
  40. package/dist/css/tabler-socials.rtl.min.css.map +1 -1
  41. package/dist/css/tabler-themes.css +1 -1
  42. package/dist/css/tabler-themes.css.map +1 -1
  43. package/dist/css/tabler-themes.min.css +1 -1
  44. package/dist/css/tabler-themes.min.css.map +1 -1
  45. package/dist/css/tabler-themes.rtl.css +1 -1
  46. package/dist/css/tabler-themes.rtl.css.map +1 -1
  47. package/dist/css/tabler-themes.rtl.min.css +1 -1
  48. package/dist/css/tabler-themes.rtl.min.css.map +1 -1
  49. package/dist/css/tabler-vendors.css +1 -1
  50. package/dist/css/tabler-vendors.css.map +1 -1
  51. package/dist/css/tabler-vendors.min.css +1 -1
  52. package/dist/css/tabler-vendors.min.css.map +1 -1
  53. package/dist/css/tabler-vendors.rtl.css +1 -1
  54. package/dist/css/tabler-vendors.rtl.css.map +1 -1
  55. package/dist/css/tabler-vendors.rtl.min.css +1 -1
  56. package/dist/css/tabler-vendors.rtl.min.css.map +1 -1
  57. package/dist/css/tabler.css +12 -2
  58. package/dist/css/tabler.css.map +1 -1
  59. package/dist/css/tabler.min.css +2 -2
  60. package/dist/css/tabler.min.css.map +1 -1
  61. package/dist/css/tabler.rtl.css +12 -2
  62. package/dist/css/tabler.rtl.css.map +1 -1
  63. package/dist/css/tabler.rtl.min.css +2 -2
  64. package/dist/css/tabler.rtl.min.css.map +1 -1
  65. package/dist/js/tabler-theme.esm.js +21 -6
  66. package/dist/js/tabler-theme.esm.js.map +1 -1
  67. package/dist/js/tabler-theme.esm.min.js +2 -2
  68. package/dist/js/tabler-theme.esm.min.js.map +1 -1
  69. package/dist/js/tabler-theme.js +21 -6
  70. package/dist/js/tabler-theme.js.map +1 -1
  71. package/dist/js/tabler-theme.min.js +2 -2
  72. package/dist/js/tabler-theme.min.js.map +1 -1
  73. package/dist/js/tabler.esm.js +332 -131
  74. package/dist/js/tabler.esm.js.map +1 -1
  75. package/dist/js/tabler.esm.min.js +2 -2
  76. package/dist/js/tabler.esm.min.js.map +1 -1
  77. package/dist/js/tabler.js +332 -131
  78. package/dist/js/tabler.js.map +1 -1
  79. package/dist/js/tabler.min.js +2 -2
  80. package/dist/js/tabler.min.js.map +1 -1
  81. package/dist/libs/vanilla-calendar-pro/index.js +2 -2
  82. package/dist/types/src/clipboard.d.ts +3 -0
  83. package/dist/types/src/confetti.d.ts +2 -0
  84. package/dist/types/src/countup.d.ts +2 -0
  85. package/dist/types/src/datepicker.d.ts +24 -6
  86. package/dist/types/src/input-mask.d.ts +2 -1
  87. package/dist/types/src/otp-input.d.ts +6 -2
  88. package/dist/types/src/strength.d.ts +1 -0
  89. package/dist/types/src/switch-icon.d.ts +1 -0
  90. package/js/src/autosize.ts +8 -3
  91. package/js/src/bootstrap/base-component.ts +12 -2
  92. package/js/src/bootstrap/dom/manipulator.ts +1 -1
  93. package/js/src/bootstrap/dropdown.ts +3 -1
  94. package/js/src/bootstrap/util/index.ts +14 -1
  95. package/js/src/clipboard.ts +26 -2
  96. package/js/src/confetti.ts +42 -7
  97. package/js/src/countup.ts +30 -12
  98. package/js/src/datepicker.ts +147 -27
  99. package/js/src/dropdown.ts +12 -5
  100. package/js/src/global.d.ts +4 -2
  101. package/js/src/input-mask.ts +7 -7
  102. package/js/src/otp-input.ts +99 -12
  103. package/js/src/popover.ts +13 -7
  104. package/js/src/sidebar.ts +14 -6
  105. package/js/src/sortable.ts +5 -1
  106. package/js/src/sparkline.ts +15 -6
  107. package/js/src/strength.ts +17 -4
  108. package/js/src/switch-icon.ts +15 -0
  109. package/js/src/tab.ts +17 -7
  110. package/js/src/toast.ts +19 -11
  111. package/js/src/tooltip.ts +16 -7
  112. package/js/tabler-theme.ts +28 -4
  113. package/package.json +2 -2
  114. package/scss/layout/_navbar.scss +1 -2
  115. package/scss/ui/_cards.scss +14 -2
package/dist/js/tabler.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Tabler v1.6.0 (https://tabler.io)
2
+ * Tabler v1.6.1 (https://tabler.io)
3
3
  * Copyright 2018-2026 The Tabler Authors
4
4
  * Copyright 2018-2026 codecalm.net Paweł Kuna
5
5
  * Licensed under MIT (https://github.com/tabler/tabler/blob/master/LICENSE)
@@ -79,11 +79,17 @@
79
79
  var triggerTransitionEnd = (element) => {
80
80
  element.dispatchEvent(new Event(TRANSITION_END));
81
81
  };
82
+ var unwrapJQuery = (object) => {
83
+ if (object && typeof object === "object" && typeof object.jquery !== "undefined") return object[0];
84
+ return object;
85
+ };
82
86
  var isElement$1 = (object) => {
87
+ object = unwrapJQuery(object);
83
88
  if (!object || typeof object !== "object") return false;
84
89
  return typeof object.nodeType !== "undefined";
85
90
  };
86
91
  var getElement = (object) => {
92
+ object = unwrapJQuery(object);
87
93
  if (isElement$1(object)) return object;
88
94
  if (typeof object === "string" && object.length > 0) return document.querySelector(parseSelector(object));
89
95
  return null;
@@ -127,7 +133,7 @@
127
133
  };
128
134
  var isRTL = () => document.documentElement.dir === "rtl";
129
135
  var getjQuery = () => {
130
- if (window.jQuery && !document.body.hasAttribute("data-bs-no-jquery")) return window.jQuery;
136
+ if (window.jQuery && !document.body.hasAttribute("data-bs-no-jquery") && !document.body.hasAttribute("data-tblr-no-jquery")) return window.jQuery;
131
137
  return null;
132
138
  };
133
139
  var DOMContentLoadedCallbacks = [];
@@ -414,7 +420,7 @@
414
420
  var PREFIXES = ["tblr", "bs"];
415
421
  var Manipulator = {
416
422
  setDataAttribute(element, key, value) {
417
- element.setAttribute(`data-tblr-${normalizeDataKey(key)}`, value);
423
+ element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value);
418
424
  },
419
425
  removeDataAttribute(element, key) {
420
426
  for (const prefix of PREFIXES) element.removeAttribute(`data-${prefix}-${normalizeDataKey(key)}`);
@@ -554,12 +560,14 @@
554
560
  var VERSION = "5.3.8";
555
561
  var BaseComponent = class extends Config {
556
562
  constructor(element, config) {
563
+ var _Data$get;
557
564
  super();
558
565
  const resolved = getElement(element);
559
566
  if (!resolved) return;
567
+ const ctor = this.constructor;
568
+ (_Data$get = Data.get(resolved, ctor.DATA_KEY)) === null || _Data$get === void 0 || _Data$get.dispose();
560
569
  this._element = resolved;
561
570
  this._config = this._getConfig(config);
562
- const ctor = this.constructor;
563
571
  Data.set(this._element, ctor.DATA_KEY, this);
564
572
  }
565
573
  dispose() {
@@ -569,7 +577,9 @@
569
577
  for (const propertyName of Object.getOwnPropertyNames(this)) this[propertyName] = null;
570
578
  }
571
579
  _queueCallback(callback, element, isAnimated = true) {
572
- executeAfterTransition(callback, element, isAnimated);
580
+ executeAfterTransition(() => {
581
+ if (this._element) callback();
582
+ }, element, isAnimated);
573
583
  }
574
584
  _getConfig(config) {
575
585
  config = this._mergeConfigObj(config, this._element);
@@ -771,13 +781,14 @@
771
781
  }
772
782
  update() {
773
783
  const element = this._element;
774
- if (!element.isConnected || element.offsetParent === null) return;
784
+ if (!element.isConnected || element.getClientRects().length === 0) return;
775
785
  const { scrollTop } = document.documentElement;
776
786
  const style = getComputedStyle(element);
777
- const border = style.boxSizing === "border-box" ? Number.parseFloat(style.borderTopWidth) + Number.parseFloat(style.borderBottomWidth) : 0;
787
+ const extra = style.boxSizing === "border-box" ? Number.parseFloat(style.borderTopWidth) + Number.parseFloat(style.borderBottomWidth) : -(Number.parseFloat(style.paddingTop) + Number.parseFloat(style.paddingBottom));
778
788
  const before = element.style.height;
789
+ element.style.overflowY = "hidden";
779
790
  element.style.height = "auto";
780
- const height = `${element.scrollHeight + border}px`;
791
+ const height = `${element.scrollHeight + extra}px`;
781
792
  element.style.height = height;
782
793
  element.style.overflowY = element.scrollHeight > element.clientHeight ? "auto" : "hidden";
783
794
  document.documentElement.scrollTop = scrollTop;
@@ -841,6 +852,8 @@
841
852
  var SELECTOR_DATA_TOGGLE$11 = `[data-bs-toggle="${NAME$25}"], [data-tblr-toggle="${NAME$25}"]`;
842
853
  var SELECTOR_LABEL = `.${NAME$25}-label`;
843
854
  var SELECTOR_FEEDBACK = `.${NAME$25}-feedback`;
855
+ var ATTRIBUTE_TEXT = "data-bs-text";
856
+ var ATTRIBUTE_TEXT_ALIAS = "data-tblr-text";
844
857
  var Default$22 = {
845
858
  target: null,
846
859
  text: null,
@@ -900,9 +913,10 @@
900
913
  var _source$textContent;
901
914
  const { text, target } = this._config;
902
915
  if (text !== null && text !== "") return String(text);
903
- const source = target ? SelectorEngine.findOne(target) : null;
916
+ const source = target ? getElement(target) : null;
904
917
  if (!source) return "";
905
- return source instanceof HTMLInputElement || source instanceof HTMLTextAreaElement ? source.value : ((_source$textContent = source.textContent) !== null && _source$textContent !== void 0 ? _source$textContent : "").trim();
918
+ if (source instanceof HTMLInputElement || source instanceof HTMLTextAreaElement) return source.value;
919
+ return (source instanceof HTMLElement ? source.innerText : (_source$textContent = source.textContent) !== null && _source$textContent !== void 0 ? _source$textContent : "").trim();
906
920
  }
907
921
  copy() {
908
922
  var _this = this;
@@ -922,10 +936,21 @@
922
936
  EventHandler.trigger(_this._element, EVENT_COPIED);
923
937
  })();
924
938
  }
939
+ /** Ends the copied state, for a `delay` of 0 or an early reset. */
940
+ reset() {
941
+ window.clearTimeout(this._timeout);
942
+ this._toggleCopied(false);
943
+ }
925
944
  dispose() {
926
945
  window.clearTimeout(this._timeout);
927
946
  super.dispose();
928
947
  }
948
+ _mergeConfigObj(config, element) {
949
+ var _element$getAttribute;
950
+ const raw = (_element$getAttribute = element === null || element === void 0 ? void 0 : element.getAttribute(ATTRIBUTE_TEXT)) !== null && _element$getAttribute !== void 0 ? _element$getAttribute : element === null || element === void 0 ? void 0 : element.getAttribute(ATTRIBUTE_TEXT_ALIAS);
951
+ const dataOptions = raw === null || raw === void 0 ? {} : { text: raw };
952
+ return super._mergeConfigObj(_objectSpread2(_objectSpread2({}, dataOptions), config), element);
953
+ }
929
954
  _showCopied() {
930
955
  window.clearTimeout(this._timeout);
931
956
  this._toggleCopied(true);
@@ -1007,12 +1032,14 @@
1007
1032
  frame: 0,
1008
1033
  lastTick: 0,
1009
1034
  add(emitter) {
1010
- this.emitters.push(emitter);
1011
1035
  this._mount();
1036
+ if (!this.context) return false;
1037
+ this.emitters.push(emitter);
1012
1038
  if (!this.frame) {
1013
1039
  this.lastTick = performance.now();
1014
1040
  this.frame = requestAnimationFrame((now) => this._tick(now));
1015
1041
  }
1042
+ return true;
1016
1043
  },
1017
1044
  _mount() {
1018
1045
  if (this.canvas) return;
@@ -1028,9 +1055,11 @@
1028
1055
  pointerEvents: "none",
1029
1056
  display: "block"
1030
1057
  });
1058
+ const context = canvas.getContext("2d");
1059
+ if (!context) return;
1031
1060
  document.body.append(canvas);
1032
1061
  this.canvas = canvas;
1033
- this.context = canvas.getContext("2d");
1062
+ this.context = context;
1034
1063
  this._resize();
1035
1064
  window.addEventListener("resize", this._onResize);
1036
1065
  },
@@ -1051,7 +1080,7 @@
1051
1080
  _resize() {
1052
1081
  if (!this.canvas || !this.context) return;
1053
1082
  const dpr = Math.min(window.devicePixelRatio || 1, MAX_DPR);
1054
- this.canvas.width = window.innerWidth * dpr;
1083
+ this.canvas.width = document.documentElement.clientWidth * dpr;
1055
1084
  this.canvas.height = window.innerHeight * dpr;
1056
1085
  this.context.setTransform(dpr, 0, 0, dpr, 0, 0);
1057
1086
  },
@@ -1135,7 +1164,7 @@
1135
1164
  if (pouring || airborne) continue;
1136
1165
  this.emitters.splice(i, 1);
1137
1166
  emitter.done = true;
1138
- EventHandler.trigger(emitter.element, EVENT_END);
1167
+ if (!emitter.detached) EventHandler.trigger(emitter.element, EVENT_END);
1139
1168
  }
1140
1169
  }
1141
1170
  };
@@ -1175,15 +1204,20 @@
1175
1204
  startedAt: performance.now(),
1176
1205
  emitted: 0,
1177
1206
  stopped: false,
1178
- done: false
1207
+ done: false,
1208
+ detached: false
1179
1209
  };
1180
- stage.add(this._emitter);
1210
+ if (!stage.add(this._emitter)) {
1211
+ this._emitter = null;
1212
+ EventHandler.trigger(this._element, EVENT_END);
1213
+ }
1181
1214
  }
1182
1215
  stop() {
1183
1216
  if (this._emitter && !this._emitter.done) this._emitter.stopped = true;
1184
1217
  this._emitter = null;
1185
1218
  }
1186
1219
  dispose() {
1220
+ if (this._emitter) this._emitter.detached = true;
1187
1221
  this.stop();
1188
1222
  super.dispose();
1189
1223
  }
@@ -1208,7 +1242,10 @@
1208
1242
  if (["A", "AREA"].includes(this.tagName)) event.preventDefault();
1209
1243
  if (isDisabled(this)) return;
1210
1244
  const target = SelectorEngine.getElementFromSelector(this) || this;
1211
- Confetti.getOrCreateInstance(target).burst();
1245
+ const config = Manipulator.getDataAttributes(this);
1246
+ const instance = Confetti.getOrCreateInstance(target, config);
1247
+ if (target !== this) instance._config = instance._getConfig(config);
1248
+ instance.burst();
1212
1249
  });
1213
1250
  //#endregion
1214
1251
  //#region js/src/countup.ts
@@ -1298,6 +1335,7 @@
1298
1335
  this._elapsed = 0;
1299
1336
  this._running = false;
1300
1337
  this._paused = false;
1338
+ this._started = false;
1301
1339
  if (!this._element) return;
1302
1340
  const value = parseValue((_this$_element$textCo = this._element.textContent) !== null && _this$_element$textCo !== void 0 ? _this$_element$textCo : "", this._config.format);
1303
1341
  if (Number.isNaN(value)) return;
@@ -1312,14 +1350,7 @@
1312
1350
  this.start();
1313
1351
  return;
1314
1352
  }
1315
- this._observer = new IntersectionObserver((entries) => {
1316
- if (entries.some((entry) => entry.isIntersecting)) {
1317
- var _this$_observer;
1318
- (_this$_observer = this._observer) === null || _this$_observer === void 0 || _this$_observer.disconnect();
1319
- this._observer = null;
1320
- this.start();
1321
- }
1322
- });
1353
+ this._observer = new IntersectionObserver((entries) => this._observerCallback(entries));
1323
1354
  this._observer.observe(this._element);
1324
1355
  }
1325
1356
  static get Default() {
@@ -1336,6 +1367,7 @@
1336
1367
  }
1337
1368
  reset() {
1338
1369
  this._stop();
1370
+ this._started = false;
1339
1371
  this._value = this._config.startVal;
1340
1372
  this._print(this._value);
1341
1373
  }
@@ -1355,9 +1387,9 @@
1355
1387
  }
1356
1388
  }
1357
1389
  dispose() {
1358
- var _this$_observer2;
1390
+ var _this$_observer;
1359
1391
  this._stop();
1360
- (_this$_observer2 = this._observer) === null || _this$_observer2 === void 0 || _this$_observer2.disconnect();
1392
+ (_this$_observer = this._observer) === null || _this$_observer === void 0 || _this$_observer.disconnect();
1361
1393
  super.dispose();
1362
1394
  }
1363
1395
  _mergeConfigObj(config, element) {
@@ -1365,12 +1397,22 @@
1365
1397
  let dataOptions = {};
1366
1398
  const raw = (_element$getAttribute = element === null || element === void 0 ? void 0 : element.getAttribute(DATA_ATTRIBUTE$1)) !== null && _element$getAttribute !== void 0 ? _element$getAttribute : element === null || element === void 0 ? void 0 : element.getAttribute(DATA_ATTRIBUTE_ALIAS);
1367
1399
  if (raw) try {
1368
- dataOptions = JSON.parse(raw);
1400
+ const parsed = JSON.parse(raw);
1401
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) dataOptions = parsed;
1369
1402
  } catch (_unused) {}
1370
1403
  return super._mergeConfigObj(_objectSpread2(_objectSpread2({}, coerceOptions(dataOptions)), config), element);
1371
1404
  }
1405
+ _observerCallback(entries) {
1406
+ if (entries.some((entry) => entry.isIntersecting)) {
1407
+ var _this$_observer2;
1408
+ (_this$_observer2 = this._observer) === null || _this$_observer2 === void 0 || _this$_observer2.disconnect();
1409
+ this._observer = null;
1410
+ if (!this._started) this.start();
1411
+ }
1412
+ }
1372
1413
  _animate(from, to) {
1373
1414
  this._stop();
1415
+ this._started = true;
1374
1416
  if (from === to || this._config.duration <= 0 || reducedMotion()) {
1375
1417
  this._finish(to);
1376
1418
  return;
@@ -1415,12 +1457,14 @@
1415
1457
  const { decimalPlaces, useGrouping, separator, decimal, prefix, suffix, format, formatter } = this._config;
1416
1458
  if (formatter) return formatter(value);
1417
1459
  if (format === "time") {
1418
- const minutes = Math.round(Math.abs(value));
1419
- return `${value < 0 ? "-" : ""}${prefix}${Math.floor(minutes / 60)}:${String(minutes % 60).padStart(2, "0")}${suffix}`;
1460
+ const rounded = Math.sign(value) * Math.round(Math.abs(value));
1461
+ const minutes = Math.abs(rounded);
1462
+ return `${rounded < 0 ? "-" : ""}${prefix}${Math.floor(minutes / 60)}:${String(minutes % 60).padStart(2, "0")}${suffix}`;
1420
1463
  }
1421
- const [integer, fraction] = Math.abs(value).toFixed(decimalPlaces).split(".");
1464
+ const fixed = value.toFixed(decimalPlaces);
1465
+ const [integer, fraction] = fixed.replace("-", "").split(".");
1422
1466
  const grouped = useGrouping ? integer.replace(/\B(?=(\d{3})+(?!\d))/g, separator) : integer;
1423
- return `${value < 0 ? "-" : ""}${prefix}${grouped}${fraction ? decimal + fraction : ""}${suffix}`;
1467
+ return `${Number(fixed) < 0 ? "-" : ""}${prefix}${grouped}${fraction ? decimal + fraction : ""}${suffix}`;
1424
1468
  }
1425
1469
  };
1426
1470
  /**
@@ -1449,6 +1493,14 @@
1449
1493
  var SELECTOR_BOUND_INPUT = "input[type=\"hidden\"], input[name]";
1450
1494
  var HIDE_DELAY = 100;
1451
1495
  var DATE_PATTERN = /^(\d{4})-(\d{2})-(\d{2})$/;
1496
+ var EXTENSION_NAMES = [
1497
+ "annotations",
1498
+ "months",
1499
+ "motion",
1500
+ "time",
1501
+ "weeks"
1502
+ ];
1503
+ var writtenSelections = /* @__PURE__ */ new WeakMap();
1452
1504
  var Default$19 = {
1453
1505
  datepickerTheme: null,
1454
1506
  dateMin: null,
@@ -1467,8 +1519,8 @@
1467
1519
  };
1468
1520
  var DefaultType$19 = {
1469
1521
  datepickerTheme: "(null|string)",
1470
- dateMin: "(null|string|number|object)",
1471
- dateMax: "(null|string|number|object)",
1522
+ dateMin: "(null|string|number|object|date)",
1523
+ dateMax: "(null|string|number|object|date)",
1472
1524
  dateFormat: "(null|object|function)",
1473
1525
  displayElement: "(null|string|element|boolean)",
1474
1526
  displayMonthsCount: "number",
@@ -1502,6 +1554,7 @@
1502
1554
  this._isSilent = false;
1503
1555
  this._skipPluginShow = false;
1504
1556
  this._resolveShown = null;
1557
+ this._hideTimeout = 0;
1505
1558
  this._isInput = false;
1506
1559
  this._isInline = false;
1507
1560
  this._boundInput = null;
@@ -1509,6 +1562,7 @@
1509
1562
  this._displayElement = null;
1510
1563
  this._themeObserver = null;
1511
1564
  this._onFocusIn = null;
1565
+ this._onResize = () => this._alignToPositionElement();
1512
1566
  this._selectedDates = [];
1513
1567
  if (!this._element || !window.VanillaCalendarPro) return;
1514
1568
  this._initCalendar();
@@ -1565,21 +1619,35 @@
1565
1619
  })();
1566
1620
  }
1567
1621
  dispose() {
1568
- var _this$_themeObserver, _this$_calendar;
1622
+ var _this$_themeObserver;
1623
+ window.clearTimeout(this._hideTimeout);
1569
1624
  (_this$_themeObserver = this._themeObserver) === null || _this$_themeObserver === void 0 || _this$_themeObserver.disconnect();
1625
+ window.removeEventListener("resize", this._onResize);
1570
1626
  if (this._onFocusIn) EventHandler.off(document, EVENT_FOCUSIN$3, this._onFocusIn);
1571
- (_this$_calendar = this._calendar) === null || _this$_calendar === void 0 || _this$_calendar.destroy();
1627
+ if (this._calendar) {
1628
+ this._calendar.destroy();
1629
+ const clone = this._calendar.context.mainElement;
1630
+ if (clone && clone !== this._element && clone.isConnected) {
1631
+ if (this._isInput) clone.replaceWith(this._element);
1632
+ else if (this._boundInput) {
1633
+ const copy = SelectorEngine.findOne(SELECTOR_BOUND_INPUT, clone);
1634
+ if (copy) copy.replaceWith(this._boundInput);
1635
+ else clone.append(this._boundInput);
1636
+ }
1637
+ }
1638
+ }
1572
1639
  super.dispose();
1573
1640
  }
1574
1641
  getSelectedDates() {
1575
- var _this$_calendar2;
1576
- const dates = (_this$_calendar2 = this._calendar) === null || _this$_calendar2 === void 0 || (_this$_calendar2 = _this$_calendar2.context) === null || _this$_calendar2 === void 0 ? void 0 : _this$_calendar2.selectedDates;
1642
+ var _this$_calendar;
1643
+ const dates = (_this$_calendar = this._calendar) === null || _this$_calendar === void 0 || (_this$_calendar = _this$_calendar.context) === null || _this$_calendar === void 0 ? void 0 : _this$_calendar.selectedDates;
1577
1644
  return dates && dates.length > 0 ? [...dates] : [...this._selectedDates];
1578
1645
  }
1579
1646
  setSelectedDates(dates) {
1580
- var _this$_calendar3;
1581
- this._selectedDates = dates.map(String);
1582
- (_this$_calendar3 = this._calendar) === null || _this$_calendar3 === void 0 || _this$_calendar3.set({ selectedDates: dates });
1647
+ var _this$_calendar2;
1648
+ this._selectedDates = dates.map((date) => this._toIsoDate(date));
1649
+ (_this$_calendar2 = this._calendar) === null || _this$_calendar2 === void 0 || _this$_calendar2.set(_objectSpread2({ selectedDates: this._selectedDates }, this._monthOf(this._selectedDates[0])));
1650
+ this._writeSelection(this._selectedDates);
1583
1651
  }
1584
1652
  _initCalendar() {
1585
1653
  this._isInput = this._element.tagName === "INPUT";
@@ -1597,31 +1665,36 @@
1597
1665
  this._updateDisplayWithSelectedDates();
1598
1666
  }
1599
1667
  _updateDisplayWithSelectedDates() {
1600
- const { selectedDates } = this._config;
1601
- if (!selectedDates || selectedDates.length === 0) return;
1602
- this._writeSelection(selectedDates);
1668
+ if (this._selectedDates.length === 0) return;
1669
+ this._writeSelection(this._selectedDates);
1603
1670
  }
1604
1671
  _writeSelection(selectedDates) {
1605
1672
  const formattedDate = this._formatDateForInput(selectedDates);
1606
- if (this._isInput) this._element.value = formattedDate;
1673
+ if (this._isInput) {
1674
+ this._element.value = formattedDate;
1675
+ writtenSelections.set(this._element, {
1676
+ text: formattedDate,
1677
+ dates: [...selectedDates]
1678
+ });
1679
+ }
1607
1680
  if (this._boundInput) this._boundInput.value = selectedDates.join(",");
1608
1681
  if (this._displayElement) this._displayElement.textContent = formattedDate;
1609
1682
  }
1610
1683
  _resolvePositionElement() {
1611
1684
  let { positionElement } = this._config;
1612
- if (typeof positionElement === "string") positionElement = SelectorEngine.findOne(positionElement);
1685
+ if (typeof positionElement === "string") positionElement = getElement(positionElement);
1613
1686
  if (!positionElement && this._isInput && !this._isInline) positionElement = this._element.closest(SELECTOR_INPUT_WRAPPER);
1614
1687
  return positionElement || this._element;
1615
1688
  }
1616
1689
  _resolveDisplayElement() {
1617
1690
  const { displayElement } = this._config;
1618
- if (typeof displayElement === "string") return SelectorEngine.findOne(displayElement);
1691
+ if (typeof displayElement === "string") return getElement(displayElement);
1619
1692
  if (displayElement === true || displayElement === null && !this._isInput && !this._isInline) return SelectorEngine.findOne(SELECTOR_DISPLAY, this._element) || this._element;
1620
1693
  return displayElement;
1621
1694
  }
1622
1695
  _alignToPositionElement() {
1623
- var _this$_calendar4;
1624
- const mainElement = (_this$_calendar4 = this._calendar) === null || _this$_calendar4 === void 0 || (_this$_calendar4 = _this$_calendar4.context) === null || _this$_calendar4 === void 0 ? void 0 : _this$_calendar4.mainElement;
1696
+ var _this$_calendar3;
1697
+ const mainElement = (_this$_calendar3 = this._calendar) === null || _this$_calendar3 === void 0 || (_this$_calendar3 = _this$_calendar3.context) === null || _this$_calendar3 === void 0 ? void 0 : _this$_calendar3.mainElement;
1625
1698
  if (!mainElement || this._isInline || !this._positionElement || this._positionElement === this._element) return;
1626
1699
  const anchor = this._positionElement.getBoundingClientRect();
1627
1700
  const popup = mainElement.getBoundingClientRect();
@@ -1649,8 +1722,8 @@
1649
1722
  const ancestor = this._getThemeAncestor();
1650
1723
  if (!ancestor || this._config.datepickerTheme) return;
1651
1724
  this._themeObserver = new MutationObserver(() => {
1652
- var _this$_calendar5;
1653
- this._syncThemeAttribute((_this$_calendar5 = this._calendar) === null || _this$_calendar5 === void 0 || (_this$_calendar5 = _this$_calendar5.context) === null || _this$_calendar5 === void 0 ? void 0 : _this$_calendar5.mainElement);
1725
+ var _this$_calendar4;
1726
+ this._syncThemeAttribute((_this$_calendar4 = this._calendar) === null || _this$_calendar4 === void 0 || (_this$_calendar4 = _this$_calendar4.context) === null || _this$_calendar4 === void 0 ? void 0 : _this$_calendar4.mainElement);
1654
1727
  });
1655
1728
  this._themeObserver.observe(ancestor, {
1656
1729
  attributes: true,
@@ -1660,10 +1733,10 @@
1660
1733
  _setupDismissOnFocus() {
1661
1734
  if (this._isInline) return;
1662
1735
  this._onFocusIn = (event) => {
1663
- var _this$_calendar6;
1736
+ var _this$_calendar5;
1664
1737
  if (!this._isShown) return;
1665
1738
  const { target } = event;
1666
- const mainElement = (_this$_calendar6 = this._calendar) === null || _this$_calendar6 === void 0 || (_this$_calendar6 = _this$_calendar6.context) === null || _this$_calendar6 === void 0 ? void 0 : _this$_calendar6.mainElement;
1739
+ const mainElement = (_this$_calendar5 = this._calendar) === null || _this$_calendar5 === void 0 || (_this$_calendar5 = _this$_calendar5.context) === null || _this$_calendar5 === void 0 ? void 0 : _this$_calendar5.mainElement;
1667
1740
  if (target instanceof Node && (this._element.contains(target) || (mainElement === null || mainElement === void 0 ? void 0 : mainElement.contains(target)))) return;
1668
1741
  this.hide();
1669
1742
  };
@@ -1689,6 +1762,8 @@
1689
1762
  this._isShown = true;
1690
1763
  this._syncThemeAttribute(calendar.context.mainElement);
1691
1764
  this._alignToPositionElement();
1765
+ window.removeEventListener("resize", this._onResize);
1766
+ window.addEventListener("resize", this._onResize);
1692
1767
  if (!wasShown) EventHandler.trigger(this._element, EVENT_SHOWN$7);
1693
1768
  (_this$_resolveShown = this._resolveShown) === null || _this$_resolveShown === void 0 || _this$_resolveShown.call(this);
1694
1769
  }
@@ -1701,12 +1776,26 @@
1701
1776
  return;
1702
1777
  }
1703
1778
  this._isShown = false;
1779
+ window.removeEventListener("resize", this._onResize);
1704
1780
  EventHandler.trigger(this._element, EVENT_HIDDEN$7);
1705
1781
  }
1782
+ /** @internal */
1783
+ _calendarExtensions(own = []) {
1784
+ const library = window.VanillaCalendarPro;
1785
+ const extensions = [...own];
1786
+ for (const name of EXTENSION_NAMES) {
1787
+ const extension = library === null || library === void 0 ? void 0 : library[name];
1788
+ if (extension && typeof extension === "object" && !extensions.includes(extension)) extensions.push(extension);
1789
+ }
1790
+ return extensions;
1791
+ }
1792
+ /** @internal */
1706
1793
  _buildCalendarOptions() {
1707
1794
  const theme = this._getEffectiveTheme();
1708
1795
  const vcpTheme = !theme || theme === "auto" ? "system" : theme;
1709
- const calendarOptions = _objectSpread2(_objectSpread2({}, this._config.vcpOptions), {}, {
1796
+ const vcpOptions = this._config.vcpOptions;
1797
+ const extensions = this._calendarExtensions(vcpOptions.extensions);
1798
+ const calendarOptions = _objectSpread2(_objectSpread2(_objectSpread2({}, vcpOptions), extensions.length > 0 ? { extensions } : {}), {}, {
1710
1799
  inputMode: !this._isInline,
1711
1800
  positionToInput: this._config.placement,
1712
1801
  firstWeekday: this._config.firstWeekday,
@@ -1734,10 +1823,11 @@
1734
1823
  if (this._config.dateMax) calendarOptions.dateMax = this._config.dateMax;
1735
1824
  return calendarOptions;
1736
1825
  }
1826
+ /** @internal */
1737
1827
  _handleDateClick(self, event) {
1738
1828
  const selectedDates = [...self.context.selectedDates];
1739
1829
  this._selectedDates = selectedDates;
1740
- if (selectedDates.length > 0) this._writeSelection(selectedDates);
1830
+ this._writeSelection(selectedDates);
1741
1831
  const args = {
1742
1832
  dates: selectedDates,
1743
1833
  event
@@ -1747,7 +1837,10 @@
1747
1837
  }
1748
1838
  _maybeHideAfterSelection(selectedDates) {
1749
1839
  if (this._isInline) return;
1750
- if (this._config.selectionMode === "single" && selectedDates.length > 0 || this._config.selectionMode === "multiple-ranged" && selectedDates.length >= 2) setTimeout(() => this.hide(), HIDE_DELAY);
1840
+ if (this._config.selectionMode === "single" && selectedDates.length > 0 || this._config.selectionMode === "multiple-ranged" && selectedDates.length >= 2) {
1841
+ window.clearTimeout(this._hideTimeout);
1842
+ this._hideTimeout = window.setTimeout(() => this.hide(), HIDE_DELAY);
1843
+ }
1751
1844
  }
1752
1845
  _parseDate(dateStr) {
1753
1846
  const [year = 0, month = 1, day = 1] = dateStr.split("-").map(Number);
@@ -1771,13 +1864,32 @@
1771
1864
  var _this$_calendar7;
1772
1865
  const value = this._element.value.trim();
1773
1866
  if (!value) return;
1867
+ const written = writtenSelections.get(this._element);
1868
+ if (written && written.text.trim() === value) {
1869
+ var _this$_calendar6;
1870
+ this._selectedDates = [...written.dates];
1871
+ (_this$_calendar6 = this._calendar) === null || _this$_calendar6 === void 0 || _this$_calendar6.set(_objectSpread2({ selectedDates: this._selectedDates }, this._monthOf(this._selectedDates[0])));
1872
+ return;
1873
+ }
1774
1874
  const date = DATE_PATTERN.test(value) ? this._parseDate(value) : new Date(value);
1775
1875
  if (Number.isNaN(date.getTime())) return;
1776
- const year = date.getFullYear();
1777
- const month = String(date.getMonth() + 1).padStart(2, "0");
1778
- const day = String(date.getDate()).padStart(2, "0");
1779
- this._selectedDates = [`${year}-${month}-${day}`];
1780
- (_this$_calendar7 = this._calendar) === null || _this$_calendar7 === void 0 || _this$_calendar7.set({ selectedDates: this._selectedDates });
1876
+ this._selectedDates = [this._toIsoDate(date)];
1877
+ (_this$_calendar7 = this._calendar) === null || _this$_calendar7 === void 0 || _this$_calendar7.set(_objectSpread2({ selectedDates: this._selectedDates }, this._monthOf(this._selectedDates[0])));
1878
+ }
1879
+ _toIsoDate(value) {
1880
+ if (typeof value === "string" && DATE_PATTERN.test(value)) return value;
1881
+ const date = value instanceof Date ? value : typeof value === "string" && DATE_PATTERN.test(value) ? this._parseDate(value) : new Date(value);
1882
+ if (Number.isNaN(date.getTime())) return String(value);
1883
+ return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
1884
+ }
1885
+ /** @internal */
1886
+ _monthOf(value) {
1887
+ if (!value || !DATE_PATTERN.test(value)) return {};
1888
+ const date = this._parseDate(value);
1889
+ return {
1890
+ selectedMonth: date.getMonth(),
1891
+ selectedYear: date.getFullYear()
1892
+ };
1781
1893
  }
1782
1894
  };
1783
1895
  /**
@@ -1816,7 +1928,7 @@
1816
1928
  lazy: true
1817
1929
  };
1818
1930
  var DefaultType$18 = {
1819
- mask: "string",
1931
+ mask: "(string|function|regexp|object|array)",
1820
1932
  lazy: "boolean"
1821
1933
  };
1822
1934
  /**
@@ -1830,10 +1942,7 @@
1830
1942
  super(element, config);
1831
1943
  this._mask = null;
1832
1944
  if (!this._element || !this._config.mask || !window.IMask) return;
1833
- this._mask = new window.IMask(this._element, {
1834
- mask: this._config.mask,
1835
- lazy: this._config.lazy
1836
- });
1945
+ this._mask = new window.IMask(this._element, _objectSpread2({}, this._config));
1837
1946
  }
1838
1947
  static get Default() {
1839
1948
  return Default$18;
@@ -1861,7 +1970,7 @@
1861
1970
  const dataOptions = {};
1862
1971
  const mask = element === null || element === void 0 ? void 0 : element.getAttribute(ATTRIBUTE_MASK);
1863
1972
  if (mask) dataOptions.mask = mask;
1864
- if (element === null || element === void 0 ? void 0 : element.hasAttribute(ATTRIBUTE_VISIBLE)) dataOptions.lazy = element.getAttribute(ATTRIBUTE_VISIBLE) !== "true";
1973
+ if (element === null || element === void 0 ? void 0 : element.hasAttribute(ATTRIBUTE_VISIBLE)) dataOptions.lazy = element.getAttribute(ATTRIBUTE_VISIBLE) === "false";
1865
1974
  return super._mergeConfigObj(_objectSpread2(_objectSpread2({}, dataOptions), config), element);
1866
1975
  }
1867
1976
  };
@@ -3852,7 +3961,7 @@
3852
3961
  var CLASS_NAME_DROPUP_CENTER = "dropup-center";
3853
3962
  var CLASS_NAME_DROPDOWN_CENTER = "dropdown-center";
3854
3963
  var SELECTOR_DATA_TOGGLE$6 = "[data-bs-toggle=\"dropdown\"]:not(.disabled):not(:disabled), [data-tblr-toggle=\"dropdown\"]:not(.disabled):not(:disabled)";
3855
- var SELECTOR_DATA_TOGGLE_SHOWN = `.${CLASS_NAME_SHOW$6}[data-bs-toggle="dropdown"], .${CLASS_NAME_SHOW$6}[data-tblr-toggle="dropdown"]`;
3964
+ var SELECTOR_DATA_TOGGLE_SHOWN = SELECTOR_DATA_TOGGLE$6.split(", ").map((selector) => `${selector}.${CLASS_NAME_SHOW$6}`).join(", ");
3856
3965
  var SELECTOR_MENU = ".dropdown-menu";
3857
3966
  var SELECTOR_NAVBAR = ".navbar";
3858
3967
  var SELECTOR_NAVBAR_NAV = ".navbar-nav";
@@ -5843,13 +5952,18 @@
5843
5952
  };
5844
5953
  //#endregion
5845
5954
  //#region js/src/dropdown.ts
5846
- [].slice.call(document.querySelectorAll("[data-bs-toggle=\"dropdown\"]")).map(function(dropdownTriggerEl) {
5847
- return new Dropdown(dropdownTriggerEl, { boundary: dropdownTriggerEl.getAttribute("data-bs-boundary") === "viewport" ? document.documentElement : "clippingParents" });
5955
+ onDOMContentLoaded(() => {
5956
+ for (const dropdownTriggerEl of document.querySelectorAll("[data-bs-toggle=\"dropdown\"], [data-tblr-toggle=\"dropdown\"]")) try {
5957
+ const options = { boundary: Manipulator.getDataAttribute(dropdownTriggerEl, "boundary") === "viewport" ? document.documentElement : "clippingParents" };
5958
+ Dropdown.getOrCreateInstance(dropdownTriggerEl, options);
5959
+ } catch (error) {
5960
+ console.error(error);
5961
+ }
5848
5962
  });
5849
5963
  //#endregion
5850
5964
  //#region js/src/sidebar.ts
5851
5965
  var syncSidebarToggles = (folded) => {
5852
- for (const toggle of document.querySelectorAll("[data-bs-toggle=\"sidebar-folded\"]")) toggle.setAttribute("aria-pressed", String(folded));
5966
+ for (const toggle of document.querySelectorAll("[data-bs-toggle=\"sidebar-folded\"], [data-tblr-toggle=\"sidebar-folded\"]")) toggle.setAttribute("aria-pressed", String(folded));
5853
5967
  };
5854
5968
  var sidebarIsFolded = () => {
5855
5969
  var _document$documentEle;
@@ -5864,7 +5978,7 @@
5864
5978
  document.addEventListener("click", (event) => {
5865
5979
  if (!sidebarIsFolded()) return;
5866
5980
  const target = event.target;
5867
- if (target.closest(".navbar-vertical .dropdown-menu")) return;
5981
+ if (!(target instanceof Element) || target.closest(".navbar-vertical .dropdown-menu")) return;
5868
5982
  hideSidebarDropdowns(target.closest(".navbar-vertical [data-bs-toggle=\"dropdown\"]"));
5869
5983
  });
5870
5984
  document.addEventListener("mouseleave", (event) => {
@@ -5872,7 +5986,7 @@
5872
5986
  if (!(target instanceof Element) || !target.matches(".navbar-vertical")) return;
5873
5987
  if (document.documentElement.getAttribute("data-bs-sidebar") === "folded-hover" || target.classList.contains("navbar-folded-hover")) hideSidebarDropdowns();
5874
5988
  }, true);
5875
- document.addEventListener("DOMContentLoaded", () => {
5989
+ onDOMContentLoaded(() => {
5876
5990
  var _document$documentEle2;
5877
5991
  const folded = ((_document$documentEle2 = document.documentElement.getAttribute("data-bs-sidebar")) !== null && _document$documentEle2 !== void 0 ? _document$documentEle2 : "").startsWith("folded");
5878
5992
  syncSidebarToggles(folded);
@@ -5884,41 +5998,51 @@
5884
5998
  });
5885
5999
  document.addEventListener("click", (event) => {
5886
6000
  var _html$getAttribute;
5887
- if (!event.target.closest("[data-bs-toggle=\"sidebar-folded\"]")) return;
6001
+ if (!(event.target instanceof Element ? event.target.closest("[data-bs-toggle=\"sidebar-folded\"], [data-tblr-toggle=\"sidebar-folded\"]") : null)) return;
5888
6002
  const html = document.documentElement;
5889
6003
  const willFold = !((_html$getAttribute = html.getAttribute("data-bs-sidebar")) !== null && _html$getAttribute !== void 0 ? _html$getAttribute : "").startsWith("folded");
5890
6004
  if (willFold) html.setAttribute("data-bs-sidebar", "folded-hover");
5891
6005
  else html.removeAttribute("data-bs-sidebar");
5892
- localStorage.setItem("tabler-sidebar", willFold ? "folded-hover" : "default");
6006
+ try {
6007
+ localStorage.setItem("tabler-sidebar", willFold ? "folded-hover" : "default");
6008
+ } catch (_unused) {}
5893
6009
  syncSidebarToggles(willFold);
5894
6010
  hideSidebarDropdowns();
5895
6011
  document.dispatchEvent(new CustomEvent("tabler:sidebar-folded", { detail: { folded: willFold } }));
5896
6012
  });
5897
6013
  //#endregion
5898
6014
  //#region js/src/tooltip.ts
5899
- [].slice.call(document.querySelectorAll("[data-bs-toggle=\"tooltip\"]")).map(function(tooltipTriggerEl) {
5900
- var _tooltipTriggerEl$get;
5901
- return new Tooltip(tooltipTriggerEl, {
5902
- delay: {
5903
- show: 50,
5904
- hide: 50
5905
- },
5906
- html: tooltipTriggerEl.getAttribute("data-bs-html") === "true",
5907
- placement: (_tooltipTriggerEl$get = tooltipTriggerEl.getAttribute("data-bs-placement")) !== null && _tooltipTriggerEl$get !== void 0 ? _tooltipTriggerEl$get : "auto"
5908
- });
6015
+ onDOMContentLoaded(() => {
6016
+ for (const tooltipTriggerEl of document.querySelectorAll("[data-bs-toggle=\"tooltip\"], [data-tblr-toggle=\"tooltip\"]")) try {
6017
+ var _Manipulator$getDataA, _Manipulator$getDataA2;
6018
+ const options = {
6019
+ delay: (_Manipulator$getDataA = Manipulator.getDataAttribute(tooltipTriggerEl, "delay")) !== null && _Manipulator$getDataA !== void 0 ? _Manipulator$getDataA : {
6020
+ show: 50,
6021
+ hide: 50
6022
+ },
6023
+ placement: (_Manipulator$getDataA2 = Manipulator.getDataAttribute(tooltipTriggerEl, "placement")) !== null && _Manipulator$getDataA2 !== void 0 ? _Manipulator$getDataA2 : "auto"
6024
+ };
6025
+ Tooltip.getOrCreateInstance(tooltipTriggerEl, options);
6026
+ } catch (error) {
6027
+ console.error(error);
6028
+ }
5909
6029
  });
5910
6030
  //#endregion
5911
6031
  //#region js/src/popover.ts
5912
- [].slice.call(document.querySelectorAll("[data-bs-toggle=\"popover\"]")).map(function(popoverTriggerEl) {
5913
- var _popoverTriggerEl$get;
5914
- return new Popover(popoverTriggerEl, {
5915
- delay: {
5916
- show: 50,
5917
- hide: 50
5918
- },
5919
- html: popoverTriggerEl.getAttribute("data-bs-html") === "true",
5920
- placement: (_popoverTriggerEl$get = popoverTriggerEl.getAttribute("data-bs-placement")) !== null && _popoverTriggerEl$get !== void 0 ? _popoverTriggerEl$get : "auto"
5921
- });
6032
+ onDOMContentLoaded(() => {
6033
+ for (const popoverTriggerEl of document.querySelectorAll("[data-bs-toggle=\"popover\"], [data-tblr-toggle=\"popover\"]")) try {
6034
+ var _Manipulator$getDataA, _Manipulator$getDataA2;
6035
+ const options = {
6036
+ delay: (_Manipulator$getDataA = Manipulator.getDataAttribute(popoverTriggerEl, "delay")) !== null && _Manipulator$getDataA !== void 0 ? _Manipulator$getDataA : {
6037
+ show: 50,
6038
+ hide: 50
6039
+ },
6040
+ placement: (_Manipulator$getDataA2 = Manipulator.getDataAttribute(popoverTriggerEl, "placement")) !== null && _Manipulator$getDataA2 !== void 0 ? _Manipulator$getDataA2 : "auto"
6041
+ };
6042
+ Popover.getOrCreateInstance(popoverTriggerEl, options);
6043
+ } catch (error) {
6044
+ console.error(error);
6045
+ }
5922
6046
  });
5923
6047
  //#endregion
5924
6048
  //#region \0@oxc-project+runtime@0.147.0/helpers/esm/checkPrivateRedeclaration.js
@@ -6032,13 +6156,19 @@
6032
6156
  _assertClassBrand(_SwitchIcon_brand, this, _setLoading).call(this, true);
6033
6157
  pending.then(() => _assertClassBrand(_SwitchIcon_brand, this, _setActive).call(this, active), () => void 0).finally(() => _assertClassBrand(_SwitchIcon_brand, this, _setLoading).call(this, false));
6034
6158
  }
6159
+ dispose() {
6160
+ _assertClassBrand(_SwitchIcon_brand, this, _setLoading).call(this, false);
6161
+ super.dispose();
6162
+ }
6035
6163
  };
6036
6164
  function _setActive(active) {
6165
+ if (!this._element) return;
6037
6166
  _classPrivateFieldGet2(_iconElement, this).classList.toggle(CLASS_NAME_ACTIVE$1, active);
6038
6167
  this._element.setAttribute("aria-pressed", String(active));
6039
6168
  EventHandler.trigger(this._element, EVENT_CHANGE$1, { active });
6040
6169
  }
6041
6170
  function _setLoading(loading) {
6171
+ if (!this._element) return;
6042
6172
  _classPrivateFieldGet2(_iconElement, this).classList.toggle(CLASS_NAME_LOADING, loading);
6043
6173
  if (loading) this._element.setAttribute("aria-busy", "true");
6044
6174
  else this._element.removeAttribute("aria-busy");
@@ -6051,20 +6181,30 @@
6051
6181
  //#region js/src/tab.ts
6052
6182
  var EnableActivationTabsFromLocationHash = () => {
6053
6183
  const locationHash = window.location.hash;
6054
- if (locationHash) [].slice.call(document.querySelectorAll("[data-bs-toggle=\"tab\"]")).filter((tab) => tab.hash === locationHash).map((tab) => {
6055
- new Tab(tab).show();
6056
- });
6184
+ if (!locationHash) return;
6185
+ for (const tab of document.querySelectorAll("[data-bs-toggle=\"tab\"], [data-tblr-toggle=\"tab\"]")) {
6186
+ if (tab.hash !== locationHash) continue;
6187
+ try {
6188
+ Tab.getOrCreateInstance(tab).show();
6189
+ } catch (error) {
6190
+ console.error(error);
6191
+ }
6192
+ }
6057
6193
  };
6058
- EnableActivationTabsFromLocationHash();
6194
+ onDOMContentLoaded(EnableActivationTabsFromLocationHash);
6059
6195
  //#endregion
6060
6196
  //#region js/src/toast.ts
6061
- [].slice.call(document.querySelectorAll("[data-bs-toggle=\"toast\"]")).map(function(toastTriggerEl) {
6062
- const target = toastTriggerEl.getAttribute("data-bs-target");
6063
- if (target === null) return;
6064
- const toastEl = new Toast(target);
6065
- toastTriggerEl.addEventListener("click", () => {
6066
- toastEl.show();
6067
- });
6197
+ onDOMContentLoaded(() => {
6198
+ for (const toastTriggerEl of document.querySelectorAll("[data-bs-toggle=\"toast\"], [data-tblr-toggle=\"toast\"]")) try {
6199
+ const toastEl = SelectorEngine.getElementFromSelector(toastTriggerEl);
6200
+ if (!toastEl) continue;
6201
+ const toast = Toast.getOrCreateInstance(toastEl);
6202
+ toastTriggerEl.addEventListener("click", () => {
6203
+ toast.show();
6204
+ });
6205
+ } catch (error) {
6206
+ console.error(error);
6207
+ }
6068
6208
  });
6069
6209
  //#endregion
6070
6210
  //#region js/src/sortable.ts
@@ -6127,7 +6267,8 @@
6127
6267
  let dataOptions = {};
6128
6268
  const raw = element === null || element === void 0 ? void 0 : element.getAttribute(DATA_ATTRIBUTE);
6129
6269
  if (raw) try {
6130
- dataOptions = JSON.parse(raw);
6270
+ const parsed = JSON.parse(raw);
6271
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) dataOptions = parsed;
6131
6272
  } catch (_unused) {}
6132
6273
  return super._mergeConfigObj(_objectSpread2(_objectSpread2({}, dataOptions), config), element);
6133
6274
  }
@@ -6165,6 +6306,7 @@
6165
6306
  "keyup",
6166
6307
  "select"
6167
6308
  ];
6309
+ var POINTER_END_EVENTS = ["click", "pointercancel"];
6168
6310
  var MASK_CHARACTER = "•";
6169
6311
  var TYPES = {
6170
6312
  numeric: {
@@ -6183,6 +6325,7 @@
6183
6325
  filter: /[^A-Za-z]/g
6184
6326
  }
6185
6327
  };
6328
+ var MAX_LENGTH = 32;
6186
6329
  var Default$2 = {
6187
6330
  groups: null,
6188
6331
  length: null,
@@ -6209,14 +6352,29 @@
6209
6352
  var _TYPES$this$_config$t;
6210
6353
  super(element, config);
6211
6354
  this._length = 0;
6355
+ this._wasComplete = false;
6212
6356
  this._slots = [];
6213
6357
  this._slotsContainer = null;
6214
6358
  this._pointerActive = false;
6215
6359
  this._pointerIndex = 0;
6216
- this._onInput = () => this._handleInput();
6360
+ this._composedValue = null;
6361
+ this._onInput = (event) => {
6362
+ if (event.isComposing) return;
6363
+ const composed = this._composedValue;
6364
+ this._composedValue = null;
6365
+ if (composed !== null && composed === this._input.value) return;
6366
+ this._handleInput();
6367
+ };
6368
+ this._onCompositionEnd = () => {
6369
+ this._handleInput();
6370
+ this._composedValue = this._input.value;
6371
+ };
6217
6372
  this._onBeforeInput = (event) => this._handleBeforeInput(event);
6218
6373
  this._onFocus = () => this._handleFocus();
6219
6374
  this._onPointerDown = (event) => this._handlePointerDown(event);
6375
+ this._onPointerEnd = () => {
6376
+ this._pointerActive = false;
6377
+ };
6220
6378
  this._onSync = () => this._render();
6221
6379
  this._onSelectionChange = () => {
6222
6380
  if (document.activeElement === this._input) this._render();
@@ -6231,6 +6389,7 @@
6231
6389
  this._renderSlots();
6232
6390
  this._addEventListeners();
6233
6391
  this._render();
6392
+ this._wasComplete = this._input.value.length === this._length;
6234
6393
  }
6235
6394
  static get Default() {
6236
6395
  return Default$2;
@@ -6255,6 +6414,7 @@
6255
6414
  this._input.focus();
6256
6415
  }
6257
6416
  focus() {
6417
+ this._pointerActive = false;
6258
6418
  this._input.focus();
6259
6419
  this._selectSlot(this._firstEmptyIndex());
6260
6420
  this._render();
@@ -6269,6 +6429,8 @@
6269
6429
  this._input.removeEventListener("beforeinput", this._onBeforeInput);
6270
6430
  this._input.removeEventListener("focus", this._onFocus);
6271
6431
  this._input.removeEventListener("pointerdown", this._onPointerDown);
6432
+ this._input.removeEventListener("compositionend", this._onCompositionEnd);
6433
+ for (const type of POINTER_END_EVENTS) this._input.removeEventListener(type, this._onPointerEnd);
6272
6434
  for (const type of SYNC_EVENTS) this._input.removeEventListener(type, this._onSync);
6273
6435
  document.removeEventListener("selectionchange", this._onSelectionChange);
6274
6436
  (_this$_slotsContainer = this._slotsContainer) === null || _this$_slotsContainer === void 0 || _this$_slotsContainer.remove();
@@ -6277,13 +6439,15 @@
6277
6439
  }
6278
6440
  _resolveLength() {
6279
6441
  var _this$_input$getAttri;
6280
- if (this._config.length) return this._config.length;
6281
- const maxLength = Number.parseInt((_this$_input$getAttri = this._input.getAttribute("maxlength")) !== null && _this$_input$getAttri !== void 0 ? _this$_input$getAttri : "", 10);
6282
- return Number.isNaN(maxLength) || maxLength < 1 ? 6 : maxLength;
6442
+ const candidates = [this._config.length, Number.parseInt((_this$_input$getAttri = this._input.getAttribute("maxlength")) !== null && _this$_input$getAttri !== void 0 ? _this$_input$getAttri : "", 10)];
6443
+ const { groups } = this._config;
6444
+ if (Array.isArray(groups) && groups.length > 0) candidates.push(groups.reduce((sum, group) => sum + Number(group), 0));
6445
+ for (const candidate of candidates) if (typeof candidate === "number" && Number.isInteger(candidate) && candidate > 0) return Math.min(candidate, MAX_LENGTH);
6446
+ return 6;
6283
6447
  }
6284
6448
  _setupInput() {
6285
6449
  const input = this._input;
6286
- if (input.type === "number" || input.type === "password") input.type = "text";
6450
+ if (input.type !== "text" && input.type !== "tel") input.type = "text";
6287
6451
  input.classList.add(CLASS_NAME_INPUT);
6288
6452
  input.setAttribute("maxlength", String(this._length));
6289
6453
  input.setAttribute("inputmode", this._type.inputmode);
@@ -6324,6 +6488,8 @@
6324
6488
  this._input.addEventListener("beforeinput", this._onBeforeInput);
6325
6489
  this._input.addEventListener("focus", this._onFocus);
6326
6490
  this._input.addEventListener("pointerdown", this._onPointerDown);
6491
+ this._input.addEventListener("compositionend", this._onCompositionEnd);
6492
+ for (const type of POINTER_END_EVENTS) this._input.addEventListener(type, this._onPointerEnd);
6327
6493
  document.addEventListener("selectionchange", this._onSelectionChange);
6328
6494
  for (const type of SYNC_EVENTS) this._input.addEventListener(type, this._onSync);
6329
6495
  }
@@ -6346,23 +6512,25 @@
6346
6512
  _handleBeforeInput(event) {
6347
6513
  const { inputType, data } = event;
6348
6514
  if (inputType === "insertText" && data && data.length === 1) {
6349
- var _this$_input$selectio;
6515
+ var _this$_input$selectio, _this$_input$selectio2;
6350
6516
  event.preventDefault();
6351
6517
  const char = this._sanitize(data);
6352
6518
  if (!char) return;
6353
6519
  const index = Math.min((_this$_input$selectio = this._input.selectionStart) !== null && _this$_input$selectio !== void 0 ? _this$_input$selectio : 0, this._length - 1);
6520
+ const end = Math.max((_this$_input$selectio2 = this._input.selectionEnd) !== null && _this$_input$selectio2 !== void 0 ? _this$_input$selectio2 : index, index + 1);
6354
6521
  const chars = [...this._input.value];
6355
- chars[index] = char;
6522
+ chars.splice(index, end - index, char);
6356
6523
  this._input.value = chars.join("").slice(0, this._length);
6357
6524
  this._selectSlot(index + 1);
6358
6525
  this._afterValueChange();
6359
6526
  return;
6360
6527
  }
6361
6528
  if (inputType === "deleteContentBackward") {
6362
- var _this$_input$selectio2, _this$_input$selectio3;
6529
+ var _this$_input$selectio3, _this$_input$selectio4;
6363
6530
  event.preventDefault();
6364
- const start = (_this$_input$selectio2 = this._input.selectionStart) !== null && _this$_input$selectio2 !== void 0 ? _this$_input$selectio2 : 0;
6365
- const end = (_this$_input$selectio3 = this._input.selectionEnd) !== null && _this$_input$selectio3 !== void 0 ? _this$_input$selectio3 : start;
6531
+ const before = this._input.value;
6532
+ const start = (_this$_input$selectio3 = this._input.selectionStart) !== null && _this$_input$selectio3 !== void 0 ? _this$_input$selectio3 : 0;
6533
+ const end = (_this$_input$selectio4 = this._input.selectionEnd) !== null && _this$_input$selectio4 !== void 0 ? _this$_input$selectio4 : start;
6366
6534
  const chars = [...this._input.value];
6367
6535
  if (end > start) {
6368
6536
  chars.splice(start, end - start);
@@ -6373,7 +6541,25 @@
6373
6541
  this._input.value = chars.join("");
6374
6542
  this._selectSlot(start - 1);
6375
6543
  }
6376
- this._afterValueChange();
6544
+ this._afterValueChange(before);
6545
+ return;
6546
+ }
6547
+ if (inputType === "deleteContentForward") {
6548
+ var _this$_input$selectio5, _this$_input$selectio6;
6549
+ event.preventDefault();
6550
+ const before = this._input.value;
6551
+ const start = (_this$_input$selectio5 = this._input.selectionStart) !== null && _this$_input$selectio5 !== void 0 ? _this$_input$selectio5 : 0;
6552
+ const end = (_this$_input$selectio6 = this._input.selectionEnd) !== null && _this$_input$selectio6 !== void 0 ? _this$_input$selectio6 : start;
6553
+ const chars = [...this._input.value];
6554
+ if (end > start) {
6555
+ chars.splice(start, end - start);
6556
+ this._input.value = chars.join("");
6557
+ } else if (start < chars.length) {
6558
+ chars.splice(start, 1);
6559
+ this._input.value = chars.join("");
6560
+ }
6561
+ this._selectSlot(start);
6562
+ this._afterValueChange(before);
6377
6563
  }
6378
6564
  }
6379
6565
  _handlePointerDown(event) {
@@ -6397,8 +6583,9 @@
6397
6583
  }
6398
6584
  return null;
6399
6585
  }
6400
- _afterValueChange() {
6586
+ _afterValueChange(before) {
6401
6587
  this._render();
6588
+ if (before !== void 0 && before === this._input.value) return;
6402
6589
  EventHandler.trigger(this._element, EVENT_INPUT, { value: this._input.value });
6403
6590
  this._checkComplete();
6404
6591
  }
@@ -6414,10 +6601,10 @@
6414
6601
  return value.replace(this._type.filter, "").slice(0, this._length);
6415
6602
  }
6416
6603
  _render() {
6417
- var _this$_input$selectio4;
6604
+ var _this$_input$selectio7;
6418
6605
  const { value } = this._input;
6419
6606
  const isFocused = document.activeElement === this._input;
6420
- const caret = Math.min((_this$_input$selectio4 = this._input.selectionStart) !== null && _this$_input$selectio4 !== void 0 ? _this$_input$selectio4 : value.length, this._length - 1);
6607
+ const caret = Math.min((_this$_input$selectio7 = this._input.selectionStart) !== null && _this$_input$selectio7 !== void 0 ? _this$_input$selectio7 : value.length, this._length - 1);
6421
6608
  for (const [index, slot] of this._slots.entries()) {
6422
6609
  var _value$index;
6423
6610
  const char = (_value$index = value[index]) !== null && _value$index !== void 0 ? _value$index : "";
@@ -6428,7 +6615,9 @@
6428
6615
  }
6429
6616
  _checkComplete() {
6430
6617
  const { value } = this._input;
6431
- if (value.length === this._length) EventHandler.trigger(this._element, EVENT_COMPLETE, { value });
6618
+ const complete = value.length === this._length;
6619
+ if (complete && !this._wasComplete) EventHandler.trigger(this._element, EVENT_COMPLETE, { value });
6620
+ this._wasComplete = complete;
6432
6621
  }
6433
6622
  };
6434
6623
  /**
@@ -6591,7 +6780,9 @@
6591
6780
  const previous = this._element.querySelector("svg");
6592
6781
  (_this$_element$queryS = this._element.querySelector(`.${CLASS_NAME_LABEL}`)) === null || _this$_element$queryS === void 0 || _this$_element$queryS.remove();
6593
6782
  if (this._config.values.length === 0) {
6594
- this._element.innerHTML = "";
6783
+ cancelAnimationFrame(this._frame);
6784
+ previous === null || previous === void 0 || previous.remove();
6785
+ EventHandler.trigger(this._element, EVENT_RENDERED);
6595
6786
  return;
6596
6787
  }
6597
6788
  let svg;
@@ -6623,8 +6814,10 @@
6623
6814
  EventHandler.trigger(this._element, EVENT_RENDERED);
6624
6815
  }
6625
6816
  dispose() {
6817
+ var _this$_element$queryS2, _this$_element$queryS3;
6626
6818
  cancelAnimationFrame(this._frame);
6627
- this._element.innerHTML = "";
6819
+ (_this$_element$queryS2 = this._element.querySelector("svg")) === null || _this$_element$queryS2 === void 0 || _this$_element$queryS2.remove();
6820
+ (_this$_element$queryS3 = this._element.querySelector(`.${CLASS_NAME_LABEL}`)) === null || _this$_element$queryS3 === void 0 || _this$_element$queryS3.remove();
6628
6821
  super.dispose();
6629
6822
  }
6630
6823
  _configAfterMerge(config) {
@@ -6656,6 +6849,7 @@
6656
6849
  const pairs = Array.from(to.children).map((target, i) => {
6657
6850
  const source = from.children[i];
6658
6851
  const tweens = [];
6852
+ for (const { name } of Array.from(source.attributes)) if (!target.hasAttribute(name)) source.removeAttribute(name);
6659
6853
  for (const { name, value } of Array.from(target.attributes)) {
6660
6854
  const start = source.getAttribute(name);
6661
6855
  if (start === null || start === value) source.setAttribute(name, value);
@@ -6711,8 +6905,8 @@
6711
6905
  const svg = this._createSvg();
6712
6906
  const { min, span } = rangeOf(cfg.values, cfg.min, cfg.max, ...cfg.threshold === null ? [] : [cfg.threshold]);
6713
6907
  const yOf = (value) => cfg.pad + (1 - (value - min) / span) * (cfg.height - cfg.pad * 2);
6714
- const ys = cfg.values.map(yOf);
6715
- const step = ys.length > 1 ? cfg.width / (ys.length - 1) : cfg.width;
6908
+ const ys = cfg.values.length === 1 ? [yOf(cfg.values[0]), yOf(cfg.values[0])] : cfg.values.map(yOf);
6909
+ const step = cfg.width / (ys.length - 1);
6716
6910
  if (cfg.threshold !== null) this._hairline(svg, yOf(cfg.threshold), "threshold", true);
6717
6911
  if (cfg.fill === "auto") {
6718
6912
  const area = svgEl("path");
@@ -6737,7 +6931,7 @@
6737
6931
  if (spotIndex >= 0) {
6738
6932
  const spot = svgEl("circle");
6739
6933
  setAttr(spot, {
6740
- cx: spotIndex * step,
6934
+ cx: cfg.values.length === 1 ? cfg.width / 2 : spotIndex * step,
6741
6935
  cy: ys[spotIndex],
6742
6936
  r: getCssNumber(this._element, "spot-size", 2),
6743
6937
  fill: cssVar("spot")
@@ -6815,7 +7009,7 @@
6815
7009
  _renderCircle() {
6816
7010
  const cfg = this._config;
6817
7011
  const svg = this._createSvg();
6818
- const strokeWidth = getCssNumber(this._element, "stroke-width", 3);
7012
+ const strokeWidth = getCssNumber(this._element, "stroke-width", 2);
6819
7013
  const radius = Math.max(0, Math.min(cfg.width, cfg.height) / 2 - strokeWidth / 2);
6820
7014
  const cx = cfg.width / 2;
6821
7015
  const cy = cfg.height / 2;
@@ -6967,13 +7161,20 @@
6967
7161
  (_this$_input = this._input) === null || _this$_input === void 0 || _this$_input.removeEventListener("input", this._onInput);
6968
7162
  super.dispose();
6969
7163
  }
7164
+ _configAfterMerge(config) {
7165
+ return _objectSpread2(_objectSpread2({}, config), {}, {
7166
+ messages: _objectSpread2(_objectSpread2({}, Default.messages), config.messages),
7167
+ weights: _objectSpread2(_objectSpread2({}, Default.weights), config.weights)
7168
+ });
7169
+ }
6970
7170
  _getInput() {
6971
- var _fields;
7171
+ var _ref, _precedingFields;
6972
7172
  const { input } = this._config;
6973
- if (input) return SelectorEngine.findOne(input);
7173
+ if (input) return getElement(input);
6974
7174
  const parent = this._element.parentElement;
6975
7175
  const fields = parent ? SelectorEngine.find(SELECTOR_PASSWORD, parent) : [];
6976
- return (_fields = fields[fields.length - 1]) !== null && _fields !== void 0 ? _fields : null;
7176
+ const precedingFields = fields.filter((field) => Boolean(field.compareDocumentPosition(this._element) & Node.DOCUMENT_POSITION_FOLLOWING));
7177
+ return (_ref = (_precedingFields = precedingFields[precedingFields.length - 1]) !== null && _precedingFields !== void 0 ? _precedingFields : fields[0]) !== null && _ref !== void 0 ? _ref : null;
6977
7178
  }
6978
7179
  _getText() {
6979
7180
  const parent = this._element.parentElement;