@codbex/harmonia 1.4.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2210,10 +2210,10 @@ function accordion_default(Alpine) {
2210
2210
  }) : { single: false };
2211
2211
  el.setAttribute("data-slot", "accordion");
2212
2212
  });
2213
- Alpine.directive("h-accordion-item", (el, { original, expression, modifiers }, { effect, Alpine: Alpine2 }) => {
2213
+ Alpine.directive("h-accordion-item", (el, { original: original2, expression, modifiers }, { effect, Alpine: Alpine2 }) => {
2214
2214
  const accordion = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_accordion"));
2215
2215
  if (!accordion) {
2216
- throw new Error(`${original} must be inside an accordion`);
2216
+ throw new Error(`${original2} must be inside an accordion`);
2217
2217
  }
2218
2218
  el.classList.add("border-b", "last:border-b-0", "[[data-variant=header]_&]:data-[state=closed]:border-b-0");
2219
2219
  el.setAttribute("data-slot", "accordion-item");
@@ -2241,14 +2241,14 @@ function accordion_default(Alpine) {
2241
2241
  setAttributes();
2242
2242
  effect(setAttributes);
2243
2243
  });
2244
- Alpine.directive("h-accordion-trigger", (el, { original, expression }, { effect, evaluateLater, Alpine: Alpine2, cleanup }) => {
2244
+ Alpine.directive("h-accordion-trigger", (el, { original: original2, expression }, { effect, evaluateLater, Alpine: Alpine2, cleanup }) => {
2245
2245
  if (el.tagName.length !== 2 && !el.tagName.startsWith("H")) {
2246
- throw new Error(`${original} must be a header element`);
2246
+ throw new Error(`${original2} must be a header element`);
2247
2247
  }
2248
2248
  const accordion = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_accordion"));
2249
2249
  const accordionItem = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_accordionItem"));
2250
2250
  if (!accordionItem || !accordion) {
2251
- throw new Error(`${original} must have an accordion and accordion item parent elements`);
2251
+ throw new Error(`${original2} must have an accordion and accordion item parent elements`);
2252
2252
  }
2253
2253
  el.classList.add(
2254
2254
  "flex",
@@ -2433,10 +2433,10 @@ function avatar_default(Alpine) {
2433
2433
  el.classList.add("cursor-pointer", "hover:bg-secondary-hover", "active:bg-secondary-active");
2434
2434
  }
2435
2435
  });
2436
- Alpine.directive("h-avatar-image", (el, { original }, { cleanup }) => {
2436
+ Alpine.directive("h-avatar-image", (el, { original: original2 }, { cleanup }) => {
2437
2437
  const avatar = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_avatar"));
2438
2438
  if (!avatar) {
2439
- throw new Error(`${original} must be inside an avatar element`);
2439
+ throw new Error(`${original2} must be inside an avatar element`);
2440
2440
  }
2441
2441
  el.classList.add("aspect-square", "size-full");
2442
2442
  el.setAttribute("data-slot", "avatar-image");
@@ -2467,10 +2467,10 @@ function avatar_default(Alpine) {
2467
2467
  observer.disconnect();
2468
2468
  });
2469
2469
  });
2470
- Alpine.directive("h-avatar-fallback", (el, { original }, { effect }) => {
2470
+ Alpine.directive("h-avatar-fallback", (el, { original: original2 }, { effect }) => {
2471
2471
  const avatar = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_avatar"));
2472
2472
  if (!avatar) {
2473
- throw new Error(`${original} must be inside an avatar element`);
2473
+ throw new Error(`${original2} must be inside an avatar element`);
2474
2474
  }
2475
2475
  el.classList.add("hidden", "bg-muted", "flex", "size-full", "items-center", "justify-center");
2476
2476
  el.setAttribute("data-slot", "avatar-fallback");
@@ -2679,7 +2679,7 @@ var getButtonSize = (size3, isAddon = false) => {
2679
2679
  }
2680
2680
  };
2681
2681
  function button_default(Alpine) {
2682
- Alpine.directive("h-button", (el, { original, modifiers }, { cleanup }) => {
2682
+ Alpine.directive("h-button", (el, { original: original2, modifiers }, { cleanup }) => {
2683
2683
  setButtonClasses(el);
2684
2684
  if (!el.hasAttribute("data-slot")) {
2685
2685
  el.setAttribute("data-slot", "button");
@@ -2696,7 +2696,7 @@ function button_default(Alpine) {
2696
2696
  el.classList.remove(...getButtonSize(lastSize, isAddon));
2697
2697
  el.classList.add(...getButtonSize(size3, isAddon));
2698
2698
  if (size3.startsWith("icon") && !el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
2699
- console.error(`${original}: Icon-only buttons must have an "aria-label" or "aria-labelledby" attribute`, el);
2699
+ console.error(`${original2}: Icon-only buttons must have an "aria-label" or "aria-labelledby" attribute`, el);
2700
2700
  }
2701
2701
  lastSize = size3;
2702
2702
  }
@@ -2775,10 +2775,6 @@ var oppositeSideMap = {
2775
2775
  bottom: "top",
2776
2776
  top: "bottom"
2777
2777
  };
2778
- var oppositeAlignmentMap = {
2779
- start: "end",
2780
- end: "start"
2781
- };
2782
2778
  function clamp(start, value, end2) {
2783
2779
  return max(start, min(value, end2));
2784
2780
  }
@@ -2797,9 +2793,9 @@ function getOppositeAxis(axis) {
2797
2793
  function getAxisLength(axis) {
2798
2794
  return axis === "y" ? "height" : "width";
2799
2795
  }
2800
- var yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]);
2801
2796
  function getSideAxis(placement) {
2802
- return yAxisSides.has(getSide(placement)) ? "y" : "x";
2797
+ const firstChar = placement[0];
2798
+ return firstChar === "t" || firstChar === "b" ? "y" : "x";
2803
2799
  }
2804
2800
  function getAlignmentAxis(placement) {
2805
2801
  return getOppositeAxis(getSideAxis(placement));
@@ -2822,7 +2818,7 @@ function getExpandedPlacements(placement) {
2822
2818
  return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
2823
2819
  }
2824
2820
  function getOppositeAlignmentPlacement(placement) {
2825
- return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
2821
+ return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start");
2826
2822
  }
2827
2823
  var lrPlacement = ["left", "right"];
2828
2824
  var rlPlacement = ["right", "left"];
@@ -2853,7 +2849,8 @@ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
2853
2849
  return list;
2854
2850
  }
2855
2851
  function getOppositePlacement(placement) {
2856
- return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
2852
+ const side = getSide(placement);
2853
+ return oppositeSideMap[side] + placement.slice(side.length);
2857
2854
  }
2858
2855
  function expandPaddingObject(padding) {
2859
2856
  return {
@@ -3003,6 +3000,7 @@ async function detectOverflow(state, options) {
3003
3000
  right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
3004
3001
  };
3005
3002
  }
3003
+ var MAX_RESET_COUNT = 50;
3006
3004
  var computePosition = async (reference, floating, config) => {
3007
3005
  const {
3008
3006
  placement = "bottom",
@@ -3010,7 +3008,10 @@ var computePosition = async (reference, floating, config) => {
3010
3008
  middleware = [],
3011
3009
  platform: platform2
3012
3010
  } = config;
3013
- const validMiddleware = middleware.filter(Boolean);
3011
+ const platformWithDetectOverflow = platform2.detectOverflow ? platform2 : {
3012
+ ...platform2,
3013
+ detectOverflow
3014
+ };
3014
3015
  const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
3015
3016
  let rects = await platform2.getElementRects({
3016
3017
  reference,
@@ -3022,14 +3023,17 @@ var computePosition = async (reference, floating, config) => {
3022
3023
  y
3023
3024
  } = computeCoordsFromPlacement(rects, placement, rtl);
3024
3025
  let statefulPlacement = placement;
3025
- let middlewareData = {};
3026
3026
  let resetCount = 0;
3027
- for (let i = 0; i < validMiddleware.length; i++) {
3028
- var _platform$detectOverf;
3027
+ const middlewareData = {};
3028
+ for (let i = 0; i < middleware.length; i++) {
3029
+ const currentMiddleware = middleware[i];
3030
+ if (!currentMiddleware) {
3031
+ continue;
3032
+ }
3029
3033
  const {
3030
3034
  name,
3031
3035
  fn
3032
- } = validMiddleware[i];
3036
+ } = currentMiddleware;
3033
3037
  const {
3034
3038
  x: nextX,
3035
3039
  y: nextY,
@@ -3043,10 +3047,7 @@ var computePosition = async (reference, floating, config) => {
3043
3047
  strategy,
3044
3048
  middlewareData,
3045
3049
  rects,
3046
- platform: {
3047
- ...platform2,
3048
- detectOverflow: (_platform$detectOverf = platform2.detectOverflow) != null ? _platform$detectOverf : detectOverflow
3049
- },
3050
+ platform: platformWithDetectOverflow,
3050
3051
  elements: {
3051
3052
  reference,
3052
3053
  floating
@@ -3054,14 +3055,11 @@ var computePosition = async (reference, floating, config) => {
3054
3055
  });
3055
3056
  x = nextX != null ? nextX : x;
3056
3057
  y = nextY != null ? nextY : y;
3057
- middlewareData = {
3058
- ...middlewareData,
3059
- [name]: {
3060
- ...middlewareData[name],
3061
- ...data
3062
- }
3058
+ middlewareData[name] = {
3059
+ ...middlewareData[name],
3060
+ ...data
3063
3061
  };
3064
- if (reset && resetCount <= 50) {
3062
+ if (reset && resetCount < MAX_RESET_COUNT) {
3065
3063
  resetCount++;
3066
3064
  if (typeof reset === "object") {
3067
3065
  if (reset.placement) {
@@ -3523,7 +3521,6 @@ function isShadowRoot(value) {
3523
3521
  }
3524
3522
  return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
3525
3523
  }
3526
- var invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
3527
3524
  function isOverflowElement(element) {
3528
3525
  const {
3529
3526
  overflow,
@@ -3531,29 +3528,31 @@ function isOverflowElement(element) {
3531
3528
  overflowY,
3532
3529
  display
3533
3530
  } = getComputedStyle2(element);
3534
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
3531
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents";
3535
3532
  }
3536
- var tableElements = /* @__PURE__ */ new Set(["table", "td", "th"]);
3537
3533
  function isTableElement(element) {
3538
- return tableElements.has(getNodeName(element));
3534
+ return /^(table|td|th)$/.test(getNodeName(element));
3539
3535
  }
3540
- var topLayerSelectors = [":popover-open", ":modal"];
3541
3536
  function isTopLayer(element) {
3542
- return topLayerSelectors.some((selector) => {
3543
- try {
3544
- return element.matches(selector);
3545
- } catch (_e) {
3546
- return false;
3537
+ try {
3538
+ if (element.matches(":popover-open")) {
3539
+ return true;
3547
3540
  }
3548
- });
3541
+ } catch (_e) {
3542
+ }
3543
+ try {
3544
+ return element.matches(":modal");
3545
+ } catch (_e) {
3546
+ return false;
3547
+ }
3549
3548
  }
3550
- var transformProperties = ["transform", "translate", "scale", "rotate", "perspective"];
3551
- var willChangeValues = ["transform", "translate", "scale", "rotate", "perspective", "filter"];
3552
- var containValues = ["paint", "layout", "strict", "content"];
3549
+ var willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
3550
+ var containRe = /paint|layout|strict|content/;
3551
+ var isNotNone = (value) => !!value && value !== "none";
3552
+ var isWebKitValue;
3553
3553
  function isContainingBlock(elementOrCss) {
3554
- const webkit = isWebKit();
3555
3554
  const css = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss;
3556
- return transformProperties.some((value) => css[value] ? css[value] !== "none" : false) || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || willChangeValues.some((value) => (css.willChange || "").includes(value)) || containValues.some((value) => (css.contain || "").includes(value));
3555
+ return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || "") || containRe.test(css.contain || "");
3557
3556
  }
3558
3557
  function getContainingBlock(element) {
3559
3558
  let currentNode = getParentNode(element);
@@ -3568,12 +3567,13 @@ function getContainingBlock(element) {
3568
3567
  return null;
3569
3568
  }
3570
3569
  function isWebKit() {
3571
- if (typeof CSS === "undefined" || !CSS.supports) return false;
3572
- return CSS.supports("-webkit-backdrop-filter", "none");
3570
+ if (isWebKitValue == null) {
3571
+ isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none");
3572
+ }
3573
+ return isWebKitValue;
3573
3574
  }
3574
- var lastTraversableNodeNames = /* @__PURE__ */ new Set(["html", "body", "#document"]);
3575
3575
  function isLastTraversableNode(node) {
3576
- return lastTraversableNodeNames.has(getNodeName(node));
3576
+ return /^(html|body|#document)$/.test(getNodeName(node));
3577
3577
  }
3578
3578
  function getComputedStyle2(element) {
3579
3579
  return getWindow(element).getComputedStyle(element);
@@ -3627,8 +3627,9 @@ function getOverflowAncestors(node, list, traverseIframes) {
3627
3627
  if (isBody) {
3628
3628
  const frameElement = getFrameElement(win);
3629
3629
  return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
3630
+ } else {
3631
+ return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
3630
3632
  }
3631
- return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
3632
3633
  }
3633
3634
  function getFrameElement(win) {
3634
3635
  return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
@@ -3792,7 +3793,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
3792
3793
  if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
3793
3794
  scroll = getNodeScroll(offsetParent);
3794
3795
  }
3795
- if (isHTMLElement(offsetParent)) {
3796
+ if (isOffsetParentAnElement) {
3796
3797
  const offsetRect = getBoundingClientRect(offsetParent);
3797
3798
  scale = getScale(offsetParent);
3798
3799
  offsets.x = offsetRect.x + offsetParent.clientLeft;
@@ -3866,7 +3867,6 @@ function getViewportRect(element, strategy) {
3866
3867
  y
3867
3868
  };
3868
3869
  }
3869
- var absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
3870
3870
  function getInnerBoundingClientRect(element, strategy) {
3871
3871
  const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
3872
3872
  const top2 = clientRect.top + element.clientTop;
@@ -3924,7 +3924,7 @@ function getClippingElementAncestors(element, cache) {
3924
3924
  if (!currentNodeIsContaining && computedStyle.position === "fixed") {
3925
3925
  currentContainingBlockComputedStyle = null;
3926
3926
  }
3927
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
3927
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === "absolute" || currentContainingBlockComputedStyle.position === "fixed") || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
3928
3928
  if (shouldDropCurrentNode) {
3929
3929
  result = result.filter((ancestor) => ancestor !== currentNode);
3930
3930
  } else {
@@ -3944,20 +3944,23 @@ function getClippingRect(_ref) {
3944
3944
  } = _ref;
3945
3945
  const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
3946
3946
  const clippingAncestors = [...elementClippingAncestors, rootBoundary];
3947
- const firstClippingAncestor = clippingAncestors[0];
3948
- const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
3949
- const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
3950
- accRect.top = max(rect.top, accRect.top);
3951
- accRect.right = min(rect.right, accRect.right);
3952
- accRect.bottom = min(rect.bottom, accRect.bottom);
3953
- accRect.left = max(rect.left, accRect.left);
3954
- return accRect;
3955
- }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
3947
+ const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);
3948
+ let top2 = firstRect.top;
3949
+ let right = firstRect.right;
3950
+ let bottom = firstRect.bottom;
3951
+ let left = firstRect.left;
3952
+ for (let i = 1; i < clippingAncestors.length; i++) {
3953
+ const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);
3954
+ top2 = max(rect.top, top2);
3955
+ right = min(rect.right, right);
3956
+ bottom = min(rect.bottom, bottom);
3957
+ left = max(rect.left, left);
3958
+ }
3956
3959
  return {
3957
- width: clippingRect.right - clippingRect.left,
3958
- height: clippingRect.bottom - clippingRect.top,
3959
- x: clippingRect.left,
3960
- y: clippingRect.top
3960
+ width: right - left,
3961
+ height: bottom - top2,
3962
+ x: left,
3963
+ y: top2
3961
3964
  };
3962
3965
  }
3963
3966
  function getDimensions(element) {
@@ -4166,7 +4169,7 @@ function autoUpdate(reference, floating, update, options) {
4166
4169
  animationFrame = false
4167
4170
  } = options;
4168
4171
  const referenceEl = unwrapElement(reference);
4169
- const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
4172
+ const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : [];
4170
4173
  ancestors.forEach((ancestor) => {
4171
4174
  ancestorScroll && ancestor.addEventListener("scroll", update, {
4172
4175
  passive: true
@@ -4179,7 +4182,7 @@ function autoUpdate(reference, floating, update, options) {
4179
4182
  if (elementResize) {
4180
4183
  resizeObserver = new ResizeObserver((_ref) => {
4181
4184
  let [firstEntry] = _ref;
4182
- if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
4185
+ if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {
4183
4186
  resizeObserver.unobserve(floating);
4184
4187
  cancelAnimationFrame(reobserveFrame);
4185
4188
  reobserveFrame = requestAnimationFrame(() => {
@@ -4192,7 +4195,9 @@ function autoUpdate(reference, floating, update, options) {
4192
4195
  if (referenceEl && !animationFrame) {
4193
4196
  resizeObserver.observe(referenceEl);
4194
4197
  }
4195
- resizeObserver.observe(floating);
4198
+ if (floating) {
4199
+ resizeObserver.observe(floating);
4200
+ }
4196
4201
  }
4197
4202
  let frameId;
4198
4203
  let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
@@ -4245,7 +4250,7 @@ var computePosition2 = (reference, floating, options) => {
4245
4250
 
4246
4251
  // src/components/calendar.js
4247
4252
  function calendar_default(Alpine) {
4248
- Alpine.directive("h-calendar", (el, { original, expression }, { effect, evaluateLater, cleanup, Alpine: Alpine2 }) => {
4253
+ Alpine.directive("h-calendar", (el, { original: original2, expression }, { effect, evaluateLater, cleanup, Alpine: Alpine2 }) => {
4249
4254
  const datepicker = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_datepicker"));
4250
4255
  el.classList.add("border", "rounded-control", "gap-2", "p-2");
4251
4256
  el.setAttribute("tabindex", "-1");
@@ -4289,7 +4294,7 @@ function calendar_default(Alpine) {
4289
4294
  const onInputChange = () => {
4290
4295
  const newValue = new Date(datepicker._h_datepicker.input.value);
4291
4296
  if (isNaN(newValue)) {
4292
- console.error(`${original}: input value is not a valid date - ${datepicker._h_datepicker.input.value}`);
4297
+ console.error(`${original2}: input value is not a valid date - ${datepicker._h_datepicker.input.value}`);
4293
4298
  datepicker._h_datepicker.input.setCustomValidity("Input value is not a valid date.");
4294
4299
  return;
4295
4300
  } else if (selected.getTime() !== newValue.getTime()) {
@@ -4306,7 +4311,7 @@ function calendar_default(Alpine) {
4306
4311
  if (el.hasOwnProperty("_x_model") && el._x_model.get()) {
4307
4312
  selected = new Date(el._x_model.get());
4308
4313
  if (isNaN(selected)) {
4309
- console.error(`${original}: input value is not a valid date - ${el._x_model.get()}`);
4314
+ console.error(`${original2}: input value is not a valid date - ${el._x_model.get()}`);
4310
4315
  if (datepicker) datepicker._h_datepicker.input.setCustomValidity("Input value is not a valid date.");
4311
4316
  else el.setAttribute("data-invalid", "true");
4312
4317
  } else if (datepicker) {
@@ -4815,10 +4820,10 @@ function collapsible_default(Alpine) {
4815
4820
  });
4816
4821
  }
4817
4822
  });
4818
- Alpine.directive("h-collapsible-trigger", (el, { original, modifiers }, { effect, Alpine: Alpine2, cleanup }) => {
4823
+ Alpine.directive("h-collapsible-trigger", (el, { original: original2, modifiers }, { effect, Alpine: Alpine2, cleanup }) => {
4819
4824
  const collapsible = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_collapsible"));
4820
4825
  if (!collapsible) {
4821
- throw new Error(`${original} must be inside a collapsible element`);
4826
+ throw new Error(`${original2} must be inside a collapsible element`);
4822
4827
  }
4823
4828
  if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "collapsible-trigger");
4824
4829
  if (modifiers.includes("chevron")) {
@@ -4837,10 +4842,10 @@ function collapsible_default(Alpine) {
4837
4842
  el.removeEventListener("click", handler);
4838
4843
  });
4839
4844
  });
4840
- Alpine.directive("h-collapsible-content", (el, { original }, { effect, Alpine: Alpine2 }) => {
4845
+ Alpine.directive("h-collapsible-content", (el, { original: original2 }, { effect, Alpine: Alpine2 }) => {
4841
4846
  const collapsible = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_collapsible"));
4842
4847
  if (!collapsible) {
4843
- throw new Error(`${original} must be inside an h-collapsible element`);
4848
+ throw new Error(`${original2} must be inside an h-collapsible element`);
4844
4849
  }
4845
4850
  if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "collapsible-content");
4846
4851
  el.classList.add("data-[state=closed]:!hidden");
@@ -4871,7 +4876,7 @@ function sizeObserver(el) {
4871
4876
 
4872
4877
  // src/components/datepicker.js
4873
4878
  function datepicker_default(Alpine) {
4874
- Alpine.directive("h-date-picker", (el, { original, modifiers }, { Alpine: Alpine2, cleanup }) => {
4879
+ Alpine.directive("h-date-picker", (el, { original: original2, modifiers }, { Alpine: Alpine2, cleanup }) => {
4875
4880
  const state = Alpine2.reactive({
4876
4881
  expanded: false
4877
4882
  });
@@ -4884,7 +4889,7 @@ function datepicker_default(Alpine) {
4884
4889
  };
4885
4890
  el._h_datepicker.input = el.querySelector("input");
4886
4891
  if (!el._h_datepicker.input || el._h_datepicker.input.tagName !== "INPUT") {
4887
- throw new Error(`${original} must contain an input`);
4892
+ throw new Error(`${original2} must contain an input`);
4888
4893
  } else if (el._h_datepicker.input.hasAttribute("id")) {
4889
4894
  el._h_datepicker.id = el._h_datepicker.input.getAttribute("id");
4890
4895
  } else {
@@ -4961,16 +4966,16 @@ function datepicker_default(Alpine) {
4961
4966
  observer.disconnect();
4962
4967
  });
4963
4968
  });
4964
- Alpine.directive("h-date-picker-trigger", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
4969
+ Alpine.directive("h-date-picker-trigger", (el, { original: original2 }, { effect, cleanup, Alpine: Alpine2 }) => {
4965
4970
  if (el.tagName !== "BUTTON") {
4966
- throw new Error(`${original} must be a button`);
4971
+ throw new Error(`${original2} must be a button`);
4967
4972
  }
4968
4973
  if (!el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
4969
- throw new Error(`${original}: must have an "aria-label" or "aria-labelledby" attribute`);
4974
+ throw new Error(`${original2}: must have an "aria-label" or "aria-labelledby" attribute`);
4970
4975
  }
4971
4976
  const datepicker = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_datepicker"));
4972
4977
  if (!datepicker) {
4973
- throw new Error(`${original} must be inside an date-picker element`);
4978
+ throw new Error(`${original2} must be inside an date-picker element`);
4974
4979
  }
4975
4980
  el.classList.add("cursor-pointer", "inline-flex", "items-center", "justify-center", "h-full", "aspect-square", "bg-transparent", "hover:bg-secondary", "active:bg-secondary-active", "outline-none");
4976
4981
  if (datepicker._h_datepicker.inTable) {
@@ -5250,13 +5255,13 @@ function fieldset_default(Alpine) {
5250
5255
 
5251
5256
  // src/components/icon.js
5252
5257
  function icon_default(Alpine) {
5253
- Alpine.directive("h-icon", (el, { original, modifiers }) => {
5258
+ Alpine.directive("h-icon", (el, { original: original2, modifiers }) => {
5254
5259
  if (el.tagName.toLowerCase() !== "svg") {
5255
- throw new Error(`${original} works only on svg elements`);
5260
+ throw new Error(`${original2} works only on svg elements`);
5256
5261
  } else if (!el.hasAttribute("role")) {
5257
- throw new Error(`${original} must have a role`);
5262
+ throw new Error(`${original2} must have a role`);
5258
5263
  } else if (el.getAttribute("role") === "img" && !el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
5259
- throw new Error(`${original}: svg images with the role of img must have an "aria-label" or "aria-labelledby" attribute`);
5264
+ throw new Error(`${original2}: svg images with the role of img must have an "aria-label" or "aria-labelledby" attribute`);
5260
5265
  }
5261
5266
  el.classList.add("fill-current");
5262
5267
  el.setAttribute("data-slot", "icon");
@@ -5473,7 +5478,7 @@ function input_default(Alpine) {
5473
5478
  el.classList.add("text-muted-foreground", "flex", "items-center", "gap-2", "text-sm", "[&_svg]:pointer-events-none", "[&_svg:not([class*='size-'])]:size-4");
5474
5479
  el.setAttribute("data-slot", "label");
5475
5480
  });
5476
- Alpine.directive("h-input-number", (el, { original }, { cleanup }) => {
5481
+ Alpine.directive("h-input-number", (el, { original: original2 }, { cleanup }) => {
5477
5482
  el.classList.add(
5478
5483
  "overflow-hidden",
5479
5484
  "group/input-number",
@@ -5506,7 +5511,7 @@ function input_default(Alpine) {
5506
5511
  el.setAttribute("data-slot", "input-number");
5507
5512
  const input = el.querySelector("input");
5508
5513
  if (!input || input.getAttribute("type") !== "number") {
5509
- throw new Error(`${original} must contain an input of type 'number'`);
5514
+ throw new Error(`${original2} must contain an input of type 'number'`);
5510
5515
  }
5511
5516
  if (!input.hasAttribute("type")) input.setAttribute("type", "number");
5512
5517
  if (!input.hasAttribute("inputmode")) input.setAttribute("inputmode", "numeric");
@@ -5752,13 +5757,13 @@ function list_default(Alpine) {
5752
5757
  el.setAttribute("data-slot", "list");
5753
5758
  el.setAttribute("role", "group");
5754
5759
  });
5755
- Alpine.directive("h-list-header", (el, { original }, { Alpine: Alpine2 }) => {
5760
+ Alpine.directive("h-list-header", (el, { original: original2 }, { Alpine: Alpine2 }) => {
5756
5761
  el.classList.add("font-medium", "flex", "items-center", "p-2", "gap-2", "align-middle", "bg-table-header", "text-table-header-foreground");
5757
5762
  el.setAttribute("role", "presentation");
5758
5763
  el.setAttribute("data-slot", "list-header");
5759
5764
  const list = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "list");
5760
5765
  if (!list) {
5761
- throw new Error(`${original} must be placed inside a list element`);
5766
+ throw new Error(`${original2} must be placed inside a list element`);
5762
5767
  }
5763
5768
  if (!el.hasAttribute("id")) {
5764
5769
  const id = `lbh${v4_default()}`;
@@ -5810,9 +5815,9 @@ function menu_default(Alpine) {
5810
5815
  };
5811
5816
  el.setAttribute("data-state", "closed");
5812
5817
  });
5813
- Alpine.directive("h-menu", (el, { original, modifiers }, { cleanup, Alpine: Alpine2 }) => {
5818
+ Alpine.directive("h-menu", (el, { original: original2, modifiers }, { cleanup, Alpine: Alpine2 }) => {
5814
5819
  if (el.tagName !== "UL") {
5815
- throw new Error(`${original} must be an ul element`);
5820
+ throw new Error(`${original2} must be an ul element`);
5816
5821
  }
5817
5822
  el.classList.add("hidden", "fixed", "bg-popover", "text-popover-foreground", "font-normal", "z-50", "min-w-[8rem]", "overflow-x-hidden", "overflow-y-auto", "rounded-md", "p-1", "shadow-md", "border", "outline-none");
5818
5823
  el.setAttribute("role", "menu");
@@ -5820,7 +5825,7 @@ function menu_default(Alpine) {
5820
5825
  el.setAttribute("tabindex", "-1");
5821
5826
  el.setAttribute("data-slot", "menu");
5822
5827
  if (!el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
5823
- throw new Error(`${original} must have an "aria-label" or "aria-labelledby" attribute`);
5828
+ throw new Error(`${original2} must have an "aria-label" or "aria-labelledby" attribute`);
5824
5829
  }
5825
5830
  const isSubmenu = modifiers.includes("sub");
5826
5831
  const menuTrigger = (() => {
@@ -5832,7 +5837,7 @@ function menu_default(Alpine) {
5832
5837
  return sibling;
5833
5838
  })();
5834
5839
  if (!isSubmenu && !menuTrigger) {
5835
- throw new Error(`${original} menu must be placed after a menu trigger element`);
5840
+ throw new Error(`${original2} menu must be placed after a menu trigger element`);
5836
5841
  }
5837
5842
  let menuSubItem;
5838
5843
  if (isSubmenu) menuSubItem = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "menu-sub");
@@ -6051,9 +6056,9 @@ function menu_default(Alpine) {
6051
6056
  el.removeEventListener("keydown", onKeyDown);
6052
6057
  });
6053
6058
  });
6054
- Alpine.directive("h-menu-item", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
6059
+ Alpine.directive("h-menu-item", (el, { original: original2 }, { cleanup, Alpine: Alpine2 }) => {
6055
6060
  if (el.tagName !== "LI") {
6056
- throw new Error(`${original} must be a li element`);
6061
+ throw new Error(`${original2} must be a li element`);
6057
6062
  }
6058
6063
  el.classList.add(
6059
6064
  "focus:bg-secondary-hover",
@@ -6107,7 +6112,7 @@ function menu_default(Alpine) {
6107
6112
  el.removeEventListener("mouseleave", focusOut);
6108
6113
  });
6109
6114
  });
6110
- Alpine.directive("h-menu-sub", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
6115
+ Alpine.directive("h-menu-sub", (el, { original: original2 }, { cleanup, Alpine: Alpine2 }) => {
6111
6116
  el.classList.add(
6112
6117
  "focus:bg-secondary-hover",
6113
6118
  "hover:bg-secondary-hover",
@@ -6139,7 +6144,7 @@ function menu_default(Alpine) {
6139
6144
  const chevronRight = createSvg({ icon: ChevronRight, classes: "size-4 ml-auto", attrs: { "aria-hidden": true, role: "presentation" } });
6140
6145
  el.appendChild(chevronRight);
6141
6146
  const parentMenu = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("role") === "menu");
6142
- if (!parentMenu) throw new Error(`${original} must have a parent`);
6147
+ if (!parentMenu) throw new Error(`${original2} must have a parent`);
6143
6148
  el._menu_sub = {
6144
6149
  open: void 0,
6145
6150
  close: void 0,
@@ -6233,9 +6238,9 @@ function menu_default(Alpine) {
6233
6238
  el.classList.add("text-foreground", "px-2", "py-1.5", "text-sm", "font-semibold", "text-left", "data-[inset=true]:pl-8");
6234
6239
  el.setAttribute("data-slot", "menu-label");
6235
6240
  });
6236
- Alpine.directive("h-menu-checkbox-item", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
6241
+ Alpine.directive("h-menu-checkbox-item", (el, { original: original2 }, { cleanup, Alpine: Alpine2 }) => {
6237
6242
  if (el.tagName !== "LI" && el.tagName !== "DIV") {
6238
- throw new Error(`${original} must be a li or div element`);
6243
+ throw new Error(`${original2} must be a li or div element`);
6239
6244
  }
6240
6245
  el.classList.add(
6241
6246
  "focus:bg-secondary-hover",
@@ -6301,9 +6306,9 @@ function menu_default(Alpine) {
6301
6306
  el.removeEventListener("mouseleave", focusOut);
6302
6307
  });
6303
6308
  });
6304
- Alpine.directive("h-menu-radio-item", (el, { original, expression }, { effect, evaluateLater, cleanup, Alpine: Alpine2 }) => {
6309
+ Alpine.directive("h-menu-radio-item", (el, { original: original2, expression }, { effect, evaluateLater, cleanup, Alpine: Alpine2 }) => {
6305
6310
  if (el.tagName !== "LI" && el.tagName !== "DIV") {
6306
- throw new Error(`${original} must be a li or div element`);
6311
+ throw new Error(`${original2} must be a li or div element`);
6307
6312
  }
6308
6313
  el.classList.add(
6309
6314
  "focus:bg-secondary-hover",
@@ -6532,7 +6537,7 @@ function popover_default(Alpine) {
6532
6537
  });
6533
6538
  }
6534
6539
  });
6535
- Alpine.directive("h-popover", (el, { original, modifiers }, { effect }) => {
6540
+ Alpine.directive("h-popover", (el, { original: original2, modifiers }, { effect }) => {
6536
6541
  const popover = (() => {
6537
6542
  let sibling = el.previousElementSibling;
6538
6543
  while (sibling && !sibling.hasOwnProperty("_popover")) {
@@ -6541,7 +6546,7 @@ function popover_default(Alpine) {
6541
6546
  return sibling;
6542
6547
  })();
6543
6548
  if (!popover) {
6544
- throw new Error(`${original} must be placed after a popover element`);
6549
+ throw new Error(`${original2} must be placed after a popover element`);
6545
6550
  }
6546
6551
  el.classList.add("absolute", "bg-popover", "text-popover-foreground", "data-[state=closed]:hidden", "top-0", "left-0", "z-50", "min-w-[1rem]", "rounded-md", "border", "shadow-md", "outline-hidden", "overflow-auto");
6547
6552
  el.setAttribute("data-slot", "popover");
@@ -6744,9 +6749,9 @@ function select_default(Alpine) {
6744
6749
  });
6745
6750
  }
6746
6751
  });
6747
- Alpine.directive("h-select-input", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
6752
+ Alpine.directive("h-select-input", (el, { original: original2 }, { effect, cleanup, Alpine: Alpine2 }) => {
6748
6753
  if (el.tagName !== "INPUT") {
6749
- throw new Error(`${original} must be an input of type "text"`);
6754
+ throw new Error(`${original2} must be an input of type "text"`);
6750
6755
  }
6751
6756
  const select = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_select"));
6752
6757
  const label = (() => {
@@ -6757,7 +6762,7 @@ function select_default(Alpine) {
6757
6762
  return;
6758
6763
  })();
6759
6764
  if (!select) {
6760
- throw new Error(`${original} must be inside a select element`);
6765
+ throw new Error(`${original2} must be inside a select element`);
6761
6766
  } else if (el.hasOwnProperty("_x_model")) {
6762
6767
  select._h_select.multiple = Array.isArray(el._x_model.get());
6763
6768
  select._h_model.set = (value) => {
@@ -6777,6 +6782,7 @@ function select_default(Alpine) {
6777
6782
  } else {
6778
6783
  el._x_model.set("");
6779
6784
  }
6785
+ el.dispatchEvent(new Event("change", { bubbles: true }));
6780
6786
  };
6781
6787
  select._h_model.get = el._x_model.get;
6782
6788
  } else {
@@ -7017,10 +7023,10 @@ function select_default(Alpine) {
7017
7023
  }
7018
7024
  });
7019
7025
  });
7020
- Alpine.directive("h-select-content", (el, { original }, { effect, Alpine: Alpine2 }) => {
7026
+ Alpine.directive("h-select-content", (el, { original: original2 }, { effect, Alpine: Alpine2 }) => {
7021
7027
  const select = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_select"));
7022
7028
  if (!select) {
7023
- throw new Error(`${original} must be inside a select element`);
7029
+ throw new Error(`${original2} must be inside a select element`);
7024
7030
  }
7025
7031
  el.classList.add("absolute", "bg-popover", "text-popover-foreground", "data-[state=closed]:hidden", "p-1", "top-0", "left-0", "z-50", "min-w-[1rem]", "overflow-x-hidden", "overflow-y-auto", "rounded-md", "border", "shadow-md");
7026
7032
  el.setAttribute("data-slot", "select-content");
@@ -7029,7 +7035,7 @@ function select_default(Alpine) {
7029
7035
  el.setAttribute("tabindex", "-1");
7030
7036
  el.setAttribute("data-state", select._h_select.expanded ? "open" : "closed");
7031
7037
  if (!select._h_select.trigger) {
7032
- throw new Error(`${original}: trigger not found`);
7038
+ throw new Error(`${original2}: trigger not found`);
7033
7039
  }
7034
7040
  let autoUpdateCleanup;
7035
7041
  function updatePosition() {
@@ -7071,10 +7077,10 @@ function select_default(Alpine) {
7071
7077
  }
7072
7078
  });
7073
7079
  });
7074
- Alpine.directive("h-select-search", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
7080
+ Alpine.directive("h-select-search", (el, { original: original2 }, { effect, cleanup, Alpine: Alpine2 }) => {
7075
7081
  const select = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_select"));
7076
7082
  if (!select) {
7077
- throw new Error(`${original} must be inside an h-select element`);
7083
+ throw new Error(`${original2} must be inside an h-select element`);
7078
7084
  } else {
7079
7085
  select._h_select.filterType = FilterType[el.getAttribute("data-filter")] ?? FilterType["starts-with"];
7080
7086
  }
@@ -7146,10 +7152,10 @@ function select_default(Alpine) {
7146
7152
  selectGroup._h_selectGroup.labelledby = id;
7147
7153
  }
7148
7154
  });
7149
- Alpine.directive("h-select-option", (el, { original, expression }, { effect, evaluateLater, cleanup }) => {
7155
+ Alpine.directive("h-select-option", (el, { original: original2, expression }, { effect, evaluateLater, cleanup }) => {
7150
7156
  const select = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_select"));
7151
7157
  if (!select) {
7152
- throw new Error(`${original} must be inside an h-select element`);
7158
+ throw new Error(`${original2} must be inside an h-select element`);
7153
7159
  }
7154
7160
  el.classList.add(
7155
7161
  "focus:bg-primary",
@@ -7403,10 +7409,10 @@ function sidebar_default(Alpine) {
7403
7409
  });
7404
7410
  }
7405
7411
  });
7406
- Alpine.directive("h-sidebar-group-label", (el, { original }, { cleanup }) => {
7412
+ Alpine.directive("h-sidebar-group-label", (el, { original: original2 }, { cleanup }) => {
7407
7413
  const group = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_sidebar_group"));
7408
7414
  if (!group) {
7409
- throw new Error(`${original} must be placed inside a sidebar group`);
7415
+ throw new Error(`${original2} must be placed inside a sidebar group`);
7410
7416
  }
7411
7417
  el.classList.add(
7412
7418
  "ring-sidebar-ring",
@@ -7493,10 +7499,10 @@ function sidebar_default(Alpine) {
7493
7499
  }
7494
7500
  el.setAttribute("data-slot", "sidebar-group-action");
7495
7501
  });
7496
- Alpine.directive("h-sidebar-group-content", (el, { original }, { effect }) => {
7502
+ Alpine.directive("h-sidebar-group-content", (el, { original: original2 }, { effect }) => {
7497
7503
  const group = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_sidebar_group"));
7498
7504
  if (!group) {
7499
- throw new Error(`${original} must be placed inside a sidebar group`);
7505
+ throw new Error(`${original2} must be placed inside a sidebar group`);
7500
7506
  }
7501
7507
  el.classList.add("w-full", "text-sm", "data-[collapsed=true]:hidden", "group-data-[collapsed=true]/sidebar:!block");
7502
7508
  el.setAttribute("data-slot", "sidebar-group-content");
@@ -7509,16 +7515,16 @@ function sidebar_default(Alpine) {
7509
7515
  });
7510
7516
  }
7511
7517
  });
7512
- Alpine.directive("h-sidebar-menu", (el, { original }) => {
7518
+ Alpine.directive("h-sidebar-menu", (el, { original: original2 }) => {
7513
7519
  if (el.tagName !== "UL") {
7514
- throw new Error(`${original} must be an ul element`);
7520
+ throw new Error(`${original2} must be an ul element`);
7515
7521
  }
7516
7522
  el.classList.add("vbox", "w-full", "min-w-0", "gap-1");
7517
7523
  el.setAttribute("data-slot", "sidebar-menu");
7518
7524
  });
7519
- Alpine.directive("h-sidebar-menu-item", (el, { original, expression, modifiers }, { effect, evaluate: evaluate2, evaluateLater, Alpine: Alpine2 }) => {
7525
+ Alpine.directive("h-sidebar-menu-item", (el, { original: original2, expression, modifiers }, { effect, evaluate: evaluate2, evaluateLater, Alpine: Alpine2 }) => {
7520
7526
  if (el.tagName !== "LI") {
7521
- throw new Error(`${original} must be a li element`);
7527
+ throw new Error(`${original2} must be a li element`);
7522
7528
  }
7523
7529
  el._h_sidebar_menu_item = {
7524
7530
  isSub: false,
@@ -7554,9 +7560,9 @@ function sidebar_default(Alpine) {
7554
7560
  });
7555
7561
  }
7556
7562
  });
7557
- Alpine.directive("h-sidebar-menu-button", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
7563
+ Alpine.directive("h-sidebar-menu-button", (el, { original: original2 }, { cleanup, Alpine: Alpine2 }) => {
7558
7564
  if (el.tagName !== "BUTTON" && el.tagName !== "A") {
7559
- throw new Error(`${original} must be a button or a link`);
7565
+ throw new Error(`${original2} must be a button or a link`);
7560
7566
  } else if (el.tagName === "BUTTON") {
7561
7567
  el.setAttribute("type", "button");
7562
7568
  }
@@ -7692,9 +7698,9 @@ function sidebar_default(Alpine) {
7692
7698
  }
7693
7699
  el.setAttribute("data-slot", "sidebar-menu-action");
7694
7700
  });
7695
- Alpine.directive("h-sidebar-menu-badge", (el, { original }) => {
7701
+ Alpine.directive("h-sidebar-menu-badge", (el, { original: original2 }) => {
7696
7702
  if (el.tagName !== "SPAN") {
7697
- throw new Error(`${original} must be a span element`);
7703
+ throw new Error(`${original2} must be a span element`);
7698
7704
  }
7699
7705
  el.classList.add("flex-1", "pointer-events-none", "flex", "h-full", "min-w-min", "items-center", "justify-end", "text-xs", "font-medium", "tabular-nums", "select-none", "group-data-[collapsed=true]/sidebar:hidden");
7700
7706
  el.setAttribute("data-slot", "sidebar-menu-badge");
@@ -7720,13 +7726,13 @@ function sidebar_default(Alpine) {
7720
7726
  el.setAttribute("data-slot", "sidebar-separator");
7721
7727
  el.setAttribute("role", "none");
7722
7728
  });
7723
- Alpine.directive("h-sidebar-menu-sub", (el, { original }, { effect, Alpine: Alpine2 }) => {
7729
+ Alpine.directive("h-sidebar-menu-sub", (el, { original: original2 }, { effect, Alpine: Alpine2 }) => {
7724
7730
  if (el.tagName !== "UL") {
7725
- throw new Error(`${original} must be an ul element`);
7731
+ throw new Error(`${original2} must be an ul element`);
7726
7732
  }
7727
7733
  const menuItem = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_sidebar_menu_item"));
7728
7734
  if (!menuItem) {
7729
- throw new Error(`${original} must be placed inside a sidebar menu item`);
7735
+ throw new Error(`${original2} must be placed inside a sidebar menu item`);
7730
7736
  }
7731
7737
  el.classList.add("vbox", "min-w-0", "translate-x-px", "gap-1", "pl-2.5", "py-0.5", "ml-3.5", "data-[collapsed=true]:!hidden", "group-data-[collapsed=true]/sidebar:!hidden");
7732
7738
  if (el.getAttribute("data-line") !== "false") {
@@ -7961,6 +7967,10 @@ function split_default(Alpine) {
7961
7967
  refreshGutters();
7962
7968
  queueLayout();
7963
7969
  },
7970
+ gutterHidden() {
7971
+ refreshGutters();
7972
+ queueLayout();
7973
+ },
7964
7974
  panelChange() {
7965
7975
  queueLayout();
7966
7976
  },
@@ -7991,14 +8001,15 @@ function split_default(Alpine) {
7991
8001
  observer.disconnect();
7992
8002
  });
7993
8003
  });
7994
- Alpine.directive("h-split-panel", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
8004
+ Alpine.directive("h-split-panel", (el, { original: original2 }, { effect, cleanup, Alpine: Alpine2 }) => {
7995
8005
  const split = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_split"));
7996
8006
  if (!split) {
7997
- throw new Error(`${original} must be inside an split element`);
8007
+ throw new Error(`${original2} must be inside an split element`);
7998
8008
  }
7999
8009
  el.classList.add("flex", "shrink", "grow-0", "box-border", "min-w-0", "min-h-0", "overflow-visible");
8000
8010
  el.setAttribute("tabindex", "-1");
8001
8011
  el.setAttribute("data-slot", "split-panel");
8012
+ let gutterless = el.getAttribute("data-gutterless") === "true";
8002
8013
  const gutter = document.createElement("span");
8003
8014
  gutter.setAttribute("data-slot", "split-gutter");
8004
8015
  gutter.setAttribute("aria-disabled", el.getAttribute("data-locked") === "true");
@@ -8120,7 +8131,7 @@ function split_default(Alpine) {
8120
8131
  }
8121
8132
  },
8122
8133
  setGutter(last) {
8123
- if (this.hidden || last) {
8134
+ if (this.hidden || gutterless || last) {
8124
8135
  gutter.remove();
8125
8136
  } else if (!gutter.parentElement) {
8126
8137
  el.after(gutter);
@@ -8234,7 +8245,10 @@ function split_default(Alpine) {
8234
8245
  };
8235
8246
  const observer = new MutationObserver((mutations) => {
8236
8247
  mutations.forEach((mutation) => {
8237
- if (mutation.attributeName === "data-hidden") {
8248
+ if (mutation.attributeName === "data-gutterless") {
8249
+ gutterless = el.getAttribute("data-gutterless") === "true";
8250
+ split._h_split.gutterHidden();
8251
+ } else if (mutation.attributeName === "data-hidden") {
8238
8252
  panel.hidden = el.getAttribute("data-hidden") === "true";
8239
8253
  if (panel.hidden) {
8240
8254
  el.classList.add("hidden");
@@ -8253,7 +8267,7 @@ function split_default(Alpine) {
8253
8267
  }
8254
8268
  });
8255
8269
  });
8256
- observer.observe(el, { attributes: true, attributeFilter: ["data-hidden", "data-locked", "data-collapse"] });
8270
+ observer.observe(el, { attributes: true, attributeFilter: ["data-hidden", "data-locked", "data-collapse", "data-gutterless"] });
8257
8271
  cleanup(() => {
8258
8272
  gutter.remove();
8259
8273
  gutter.removeEventListener("pointerdown", drag);
@@ -8514,7 +8528,7 @@ function tabs_default(Alpine) {
8514
8528
  el.setAttribute("role", "tablist");
8515
8529
  el.setAttribute("data-slot", "tab-list");
8516
8530
  });
8517
- Alpine.directive("h-tab", (el, { original }) => {
8531
+ Alpine.directive("h-tab", (el, { original: original2 }) => {
8518
8532
  el.classList.add(
8519
8533
  "cursor-pointer",
8520
8534
  "focus-visible:border-ring",
@@ -8561,8 +8575,8 @@ function tabs_default(Alpine) {
8561
8575
  );
8562
8576
  el.setAttribute("role", "tab");
8563
8577
  el.setAttribute("data-slot", "tab");
8564
- if (!el.hasAttribute("id")) throw new Error(`${original}: Tabs must have an id`);
8565
- if (!el.hasAttribute("aria-controls")) throw new Error(`${original}: aria-controls must be set to the tab-content id.`);
8578
+ if (!el.hasAttribute("id")) throw new Error(`${original2}: Tabs must have an id`);
8579
+ if (!el.hasAttribute("aria-controls")) throw new Error(`${original2}: aria-controls must be set to the tab-content id.`);
8566
8580
  });
8567
8581
  Alpine.directive("h-tab-action", (el) => {
8568
8582
  el.classList.add("cursor-pointer", "ml-auto", "rounded-md", "text-foreground", "hover:bg-secondary", "hover:text-secondary-foreground", "active:bg-secondary-active");
@@ -8596,13 +8610,13 @@ function tabs_default(Alpine) {
8596
8610
  el.setAttribute("role", "button");
8597
8611
  el.setAttribute("data-slot", "tab-list-action");
8598
8612
  });
8599
- Alpine.directive("h-tabs-content", (el, { original }) => {
8613
+ Alpine.directive("h-tabs-content", (el, { original: original2 }) => {
8600
8614
  el.classList.add("flex-1", "outline-none");
8601
8615
  el.setAttribute("role", "tabpanel");
8602
8616
  el.setAttribute("tabindex", "0");
8603
8617
  el.setAttribute("data-slot", "tabs-content");
8604
- if (!el.hasAttribute("id")) throw new Error(`${original}: Tab content must have an id`);
8605
- if (!el.hasAttribute("aria-labelledby")) throw new Error(`${original}: aria-labelledby must be set to the tab id.`);
8618
+ if (!el.hasAttribute("id")) throw new Error(`${original2}: Tab content must have an id`);
8619
+ if (!el.hasAttribute("aria-labelledby")) throw new Error(`${original2}: aria-labelledby must be set to the tab id.`);
8606
8620
  });
8607
8621
  }
8608
8622
 
@@ -8995,13 +9009,13 @@ function timepicker_default(Alpine) {
8995
9009
  top.removeEventListener("click", el._h_timepicker.close);
8996
9010
  });
8997
9011
  });
8998
- Alpine.directive("h-time-picker-input", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
9012
+ Alpine.directive("h-time-picker-input", (el, { original: original2 }, { effect, cleanup, Alpine: Alpine2 }) => {
8999
9013
  if (el.tagName !== "INPUT") {
9000
- throw new Error(`${original} must be a readonly input of type "text"`);
9014
+ throw new Error(`${original2} must be a readonly input of type "text"`);
9001
9015
  }
9002
9016
  const timepicker = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_timepicker"));
9003
9017
  if (!timepicker) {
9004
- throw new Error(`${original} must be inside a time-picker element`);
9018
+ throw new Error(`${original2} must be inside a time-picker element`);
9005
9019
  }
9006
9020
  timepicker._h_timepicker.focusInput = () => {
9007
9021
  el.focus();
@@ -9611,7 +9625,7 @@ function toolbar_default(Alpine) {
9611
9625
  el.setAttribute("data-slot", "toolbar-image");
9612
9626
  });
9613
9627
  Alpine.directive("h-toolbar-title", (el) => {
9614
- el.classList.add("text", "[[data-size=sm]_&]:text-sm", "[[data-size=md]_&]:text-sm", "first:pl-2", "font-medium", "whitespace-nowrap", "text-ellipsis", "overflow-hidden");
9628
+ el.classList.add("text", "[[data-size=sm]_&]:text-sm", "[[data-size=md]_&]:text-sm", "first-of-type:pl-2", "font-medium", "whitespace-nowrap", "text-ellipsis", "overflow-hidden");
9615
9629
  el.setAttribute("data-slot", "toolbar-title");
9616
9630
  });
9617
9631
  Alpine.directive("h-toolbar-spacer", (el) => {
@@ -9650,7 +9664,7 @@ function tooltip_default(Alpine) {
9650
9664
  el.removeEventListener("pointerleave", handler);
9651
9665
  });
9652
9666
  });
9653
- Alpine.directive("h-tooltip", (el, { original }, { effect }) => {
9667
+ Alpine.directive("h-tooltip", (el, { original: original2 }, { effect }) => {
9654
9668
  const tooltip = (() => {
9655
9669
  let sibling = el.previousElementSibling;
9656
9670
  while (sibling && !sibling.hasOwnProperty("_tooltip")) {
@@ -9659,7 +9673,7 @@ function tooltip_default(Alpine) {
9659
9673
  return sibling;
9660
9674
  })();
9661
9675
  if (!tooltip) {
9662
- throw new Error(`${original} must be placed after a tooltip trigger element`);
9676
+ throw new Error(`${original2} must be placed after a tooltip trigger element`);
9663
9677
  }
9664
9678
  el.classList.add("absolute", "bg-foreground", "text-background", "z-50", "w-fit", "rounded-md", "px-3", "py-1.5", "text-xs", "text-balance");
9665
9679
  el.setAttribute("data-slot", "tooltip");
@@ -9865,9 +9879,9 @@ function tree_default(Alpine) {
9865
9879
  });
9866
9880
  }
9867
9881
  });
9868
- Alpine.directive("h-tree-button", (el, { original }, { effect }) => {
9882
+ Alpine.directive("h-tree-button", (el, { original: original2 }, { effect }) => {
9869
9883
  const treeItem = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_tree_item"));
9870
- if (!treeItem) throw new Error(`${original} must be inside a tree item`);
9884
+ if (!treeItem) throw new Error(`${original2} must be inside a tree item`);
9871
9885
  el.classList.add(
9872
9886
  "flex",
9873
9887
  "w-full",
@@ -9930,7 +9944,7 @@ function tree_default(Alpine) {
9930
9944
  }
9931
9945
 
9932
9946
  // package.json
9933
- var version = "1.4.1";
9947
+ var version = "1.5.0";
9934
9948
 
9935
9949
  // src/utils/breakpoint-listener.js
9936
9950
  function getBreakpointListener(handler, breakpoint = 768) {
@@ -10010,6 +10024,12 @@ var getColorScheme = () => {
10010
10024
  }
10011
10025
  return "light";
10012
10026
  };
10027
+ var getSystemColorScheme = () => {
10028
+ if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
10029
+ return "dark";
10030
+ }
10031
+ return "light";
10032
+ };
10013
10033
  var addColorSchemeListener = (callback) => {
10014
10034
  callbacks.push(callback);
10015
10035
  };
@@ -10035,9 +10055,53 @@ function focus_default(Alpine) {
10035
10055
  });
10036
10056
  }
10037
10057
 
10058
+ // src/utils/include.js
10059
+ function include_default(Alpine) {
10060
+ Alpine.directive("h-include", (el, { modifiers, expression }, { evaluateLater, effect }) => {
10061
+ const getUrl = evaluateLater(expression);
10062
+ function getHtml(url) {
10063
+ const parsed = new URL(url, window.location.origin);
10064
+ if (parsed.origin === window.location.origin) {
10065
+ fetch(url).then((response) => {
10066
+ if (response.status === 200) return response.text();
10067
+ throw response;
10068
+ }).then((content) => {
10069
+ if (modifiers.includes("js")) {
10070
+ const container = document.createElement("div");
10071
+ container.innerHTML = content;
10072
+ let staticScript = container.querySelector("script");
10073
+ const script = document.createElement("script");
10074
+ for (let a = 0; a < staticScript.attributes.length; a++) {
10075
+ script.setAttribute(staticScript.attributes[a].name, staticScript.attributes[a].value);
10076
+ }
10077
+ script.appendChild(document.createTextNode(staticScript.innerHTML));
10078
+ staticScript.remove();
10079
+ while (container.childNodes.length > 0) {
10080
+ el.appendChild(container.childNodes[0]);
10081
+ }
10082
+ el.appendChild(script);
10083
+ } else {
10084
+ el.innerHTML = content;
10085
+ }
10086
+ }).catch((response) => {
10087
+ console.error(response);
10088
+ });
10089
+ } else {
10090
+ throw new Error(`${original}: external requests not allowed`);
10091
+ }
10092
+ }
10093
+ effect(() => {
10094
+ getUrl((url) => {
10095
+ if (url) getHtml(url);
10096
+ else el.innerHTML = "";
10097
+ });
10098
+ });
10099
+ }).before("bind");
10100
+ }
10101
+
10038
10102
  // src/utils/template.js
10039
10103
  function template_default(Alpine) {
10040
- Alpine.directive("h-template", (el, { original, expression }, { evaluate: evaluate2, Alpine: Alpine2, cleanup }) => {
10104
+ Alpine.directive("h-template", (el, { original: original2, expression }, { evaluate: evaluate2, Alpine: Alpine2, cleanup }) => {
10041
10105
  if (el.hasAttribute(Alpine2.prefixed("data"))) {
10042
10106
  const template = evaluate2(expression);
10043
10107
  const clone = template.content.cloneNode(true).firstElementChild;
@@ -10051,7 +10115,7 @@ function template_default(Alpine) {
10051
10115
  clone.remove();
10052
10116
  });
10053
10117
  } else {
10054
- console.error(`${original}: ${Alpine2.prefixed("data")} directive is missing`);
10118
+ console.error(`${original2}: ${Alpine2.prefixed("data")} directive is missing`);
10055
10119
  }
10056
10120
  });
10057
10121
  }
@@ -10072,6 +10136,7 @@ var registerComponents = (registerPlugin) => {
10072
10136
  registerPlugin(fieldset_default);
10073
10137
  registerPlugin(focus_default);
10074
10138
  registerPlugin(icon_default);
10139
+ registerPlugin(include_default);
10075
10140
  registerPlugin(info_page_default);
10076
10141
  registerPlugin(input_default);
10077
10142
  registerPlugin(label_default);
@@ -10118,6 +10183,7 @@ export {
10118
10183
  fieldset_default as Fieldset,
10119
10184
  focus_default as Focus,
10120
10185
  icon_default as Icon,
10186
+ include_default as Include,
10121
10187
  info_page_default as InfoPage,
10122
10188
  input_default as Input,
10123
10189
  label_default as Label,
@@ -10151,6 +10217,7 @@ export {
10151
10217
  module_default as default,
10152
10218
  getBreakpointListener,
10153
10219
  getColorScheme,
10220
+ getSystemColorScheme,
10154
10221
  registerComponents,
10155
10222
  removeColorSchemeListener,
10156
10223
  setColorScheme,