@almadar/ui 4.34.0 → 4.35.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.
@@ -1,5 +1,5 @@
1
- import * as React105 from 'react';
2
- import React105__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useLayoutEffect, lazy, useId } from 'react';
1
+ import * as React106 from 'react';
2
+ import React106__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useLayoutEffect, lazy, useId } from 'react';
3
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
4
  import { EventBusContext, useTraitScope, TraitScopeProvider } from '@almadar/ui/providers';
5
5
  import { clsx } from 'clsx';
@@ -729,7 +729,7 @@ var init_Box = __esm({
729
729
  fixed: "fixed",
730
730
  sticky: "sticky"
731
731
  };
732
- Box = React105__default.forwardRef(
732
+ Box = React106__default.forwardRef(
733
733
  ({
734
734
  padding,
735
735
  paddingX,
@@ -1428,7 +1428,7 @@ function resolveIconProp(value, sizeClass) {
1428
1428
  const IconComp = value;
1429
1429
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
1430
1430
  }
1431
- if (React105__default.isValidElement(value)) {
1431
+ if (React106__default.isValidElement(value)) {
1432
1432
  return value;
1433
1433
  }
1434
1434
  if (typeof value === "object" && value !== null && "render" in value) {
@@ -1504,7 +1504,7 @@ var init_Button = __esm({
1504
1504
  md: "h-4 w-4",
1505
1505
  lg: "h-5 w-5"
1506
1506
  };
1507
- Button = React105__default.forwardRef(
1507
+ Button = React106__default.forwardRef(
1508
1508
  ({
1509
1509
  className,
1510
1510
  variant = "primary",
@@ -1607,7 +1607,7 @@ var init_Badge = __esm({
1607
1607
  md: "px-2.5 py-1 text-sm",
1608
1608
  lg: "px-3 py-1.5 text-base"
1609
1609
  };
1610
- Badge = React105__default.forwardRef(
1610
+ Badge = React106__default.forwardRef(
1611
1611
  ({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
1612
1612
  const iconSizes2 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
1613
1613
  const resolvedIcon = typeof icon === "string" ? (() => {
@@ -1767,7 +1767,7 @@ var Input;
1767
1767
  var init_Input = __esm({
1768
1768
  "components/atoms/Input.tsx"() {
1769
1769
  init_cn();
1770
- Input = React105__default.forwardRef(
1770
+ Input = React106__default.forwardRef(
1771
1771
  ({
1772
1772
  className,
1773
1773
  inputType,
@@ -1885,7 +1885,7 @@ var Label;
1885
1885
  var init_Label = __esm({
1886
1886
  "components/atoms/Label.tsx"() {
1887
1887
  init_cn();
1888
- Label = React105__default.forwardRef(
1888
+ Label = React106__default.forwardRef(
1889
1889
  ({ className, required, children, ...props }, ref) => {
1890
1890
  return /* @__PURE__ */ jsxs(
1891
1891
  "label",
@@ -1911,7 +1911,7 @@ var Textarea;
1911
1911
  var init_Textarea = __esm({
1912
1912
  "components/atoms/Textarea.tsx"() {
1913
1913
  init_cn();
1914
- Textarea = React105__default.forwardRef(
1914
+ Textarea = React106__default.forwardRef(
1915
1915
  ({ className, error, ...props }, ref) => {
1916
1916
  return /* @__PURE__ */ jsx(
1917
1917
  "textarea",
@@ -1940,7 +1940,7 @@ var Select;
1940
1940
  var init_Select = __esm({
1941
1941
  "components/atoms/Select.tsx"() {
1942
1942
  init_cn();
1943
- Select = React105__default.forwardRef(
1943
+ Select = React106__default.forwardRef(
1944
1944
  ({ className, options, placeholder, error, ...props }, ref) => {
1945
1945
  return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
1946
1946
  /* @__PURE__ */ jsxs(
@@ -1982,7 +1982,7 @@ var Checkbox;
1982
1982
  var init_Checkbox = __esm({
1983
1983
  "components/atoms/Checkbox.tsx"() {
1984
1984
  init_cn();
1985
- Checkbox = React105__default.forwardRef(
1985
+ Checkbox = React106__default.forwardRef(
1986
1986
  ({ className, label, id, ...props }, ref) => {
1987
1987
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
1988
1988
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
@@ -2064,7 +2064,7 @@ var init_Card = __esm({
2064
2064
  md: "shadow",
2065
2065
  lg: "shadow-lg"
2066
2066
  };
2067
- Card = React105__default.forwardRef(
2067
+ Card = React106__default.forwardRef(
2068
2068
  ({
2069
2069
  className,
2070
2070
  variant = "bordered",
@@ -2100,9 +2100,9 @@ var init_Card = __esm({
2100
2100
  }
2101
2101
  );
2102
2102
  Card.displayName = "Card";
2103
- CardHeader = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
2103
+ CardHeader = React106__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
2104
2104
  CardHeader.displayName = "CardHeader";
2105
- CardTitle = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2105
+ CardTitle = React106__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2106
2106
  "h3",
2107
2107
  {
2108
2108
  ref,
@@ -2115,11 +2115,11 @@ var init_Card = __esm({
2115
2115
  }
2116
2116
  ));
2117
2117
  CardTitle.displayName = "CardTitle";
2118
- CardContent = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
2118
+ CardContent = React106__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
2119
2119
  CardContent.displayName = "CardContent";
2120
2120
  CardBody = CardContent;
2121
2121
  CardBody.displayName = "CardBody";
2122
- CardFooter = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2122
+ CardFooter = React106__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2123
2123
  "div",
2124
2124
  {
2125
2125
  ref,
@@ -2140,7 +2140,7 @@ var init_Spinner = __esm({
2140
2140
  md: "h-6 w-6",
2141
2141
  lg: "h-8 w-8"
2142
2142
  };
2143
- Spinner = React105__default.forwardRef(
2143
+ Spinner = React106__default.forwardRef(
2144
2144
  ({ className, size = "md", ...props }, ref) => {
2145
2145
  return /* @__PURE__ */ jsx(
2146
2146
  "div",
@@ -2588,7 +2588,7 @@ var Radio;
2588
2588
  var init_Radio = __esm({
2589
2589
  "components/atoms/Radio.tsx"() {
2590
2590
  init_cn();
2591
- Radio = React105__default.forwardRef(
2591
+ Radio = React106__default.forwardRef(
2592
2592
  ({
2593
2593
  label,
2594
2594
  helperText,
@@ -2699,7 +2699,7 @@ var init_Switch = __esm({
2699
2699
  "components/atoms/Switch.tsx"() {
2700
2700
  "use client";
2701
2701
  init_cn();
2702
- Switch = React105.forwardRef(
2702
+ Switch = React106.forwardRef(
2703
2703
  ({
2704
2704
  checked,
2705
2705
  defaultChecked = false,
@@ -2710,10 +2710,10 @@ var init_Switch = __esm({
2710
2710
  name,
2711
2711
  className
2712
2712
  }, ref) => {
2713
- const [isChecked, setIsChecked] = React105.useState(
2713
+ const [isChecked, setIsChecked] = React106.useState(
2714
2714
  checked !== void 0 ? checked : defaultChecked
2715
2715
  );
2716
- React105.useEffect(() => {
2716
+ React106.useEffect(() => {
2717
2717
  if (checked !== void 0) {
2718
2718
  setIsChecked(checked);
2719
2719
  }
@@ -3133,8 +3133,8 @@ var init_LawReferenceTooltip = __esm({
3133
3133
  position = "top",
3134
3134
  className
3135
3135
  }) => {
3136
- const [isVisible, setIsVisible] = React105__default.useState(false);
3137
- const timeoutRef = React105__default.useRef(null);
3136
+ const [isVisible, setIsVisible] = React106__default.useState(false);
3137
+ const timeoutRef = React106__default.useRef(null);
3138
3138
  const handleMouseEnter = () => {
3139
3139
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
3140
3140
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -3143,7 +3143,7 @@ var init_LawReferenceTooltip = __esm({
3143
3143
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
3144
3144
  setIsVisible(false);
3145
3145
  };
3146
- React105__default.useEffect(() => {
3146
+ React106__default.useEffect(() => {
3147
3147
  return () => {
3148
3148
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
3149
3149
  };
@@ -3353,7 +3353,7 @@ var init_StatusDot = __esm({
3353
3353
  md: "w-2.5 h-2.5",
3354
3354
  lg: "w-3 h-3"
3355
3355
  };
3356
- StatusDot = React105__default.forwardRef(
3356
+ StatusDot = React106__default.forwardRef(
3357
3357
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
3358
3358
  return /* @__PURE__ */ jsx(
3359
3359
  "span",
@@ -3406,7 +3406,7 @@ var init_TrendIndicator = __esm({
3406
3406
  down: TrendingDown,
3407
3407
  flat: ArrowRight
3408
3408
  };
3409
- TrendIndicator = React105__default.forwardRef(
3409
+ TrendIndicator = React106__default.forwardRef(
3410
3410
  ({
3411
3411
  className,
3412
3412
  value,
@@ -3473,7 +3473,7 @@ var init_RangeSlider = __esm({
3473
3473
  md: "w-4 h-4",
3474
3474
  lg: "w-5 h-5"
3475
3475
  };
3476
- RangeSlider = React105__default.forwardRef(
3476
+ RangeSlider = React106__default.forwardRef(
3477
3477
  ({
3478
3478
  className,
3479
3479
  min = 0,
@@ -4118,9 +4118,9 @@ function ScoreDisplay({
4118
4118
  ...rest
4119
4119
  }) {
4120
4120
  const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
4121
- const [displayValue, setDisplayValue] = React105.useState(resolvedValue);
4122
- const [isAnimating, setIsAnimating] = React105.useState(false);
4123
- React105.useEffect(() => {
4121
+ const [displayValue, setDisplayValue] = React106.useState(resolvedValue);
4122
+ const [isAnimating, setIsAnimating] = React106.useState(false);
4123
+ React106.useEffect(() => {
4124
4124
  if (!animated || displayValue === resolvedValue) {
4125
4125
  setDisplayValue(resolvedValue);
4126
4126
  return;
@@ -4190,9 +4190,9 @@ function ControlButton({
4190
4190
  className
4191
4191
  }) {
4192
4192
  const eventBus = useEventBus();
4193
- const [isPressed, setIsPressed] = React105.useState(false);
4193
+ const [isPressed, setIsPressed] = React106.useState(false);
4194
4194
  const actualPressed = pressed ?? isPressed;
4195
- const handlePointerDown = React105.useCallback(
4195
+ const handlePointerDown = React106.useCallback(
4196
4196
  (e) => {
4197
4197
  e.preventDefault();
4198
4198
  if (disabled) return;
@@ -4202,7 +4202,7 @@ function ControlButton({
4202
4202
  },
4203
4203
  [disabled, pressEvent, eventBus, onPress]
4204
4204
  );
4205
- const handlePointerUp = React105.useCallback(
4205
+ const handlePointerUp = React106.useCallback(
4206
4206
  (e) => {
4207
4207
  e.preventDefault();
4208
4208
  if (disabled) return;
@@ -4212,7 +4212,7 @@ function ControlButton({
4212
4212
  },
4213
4213
  [disabled, releaseEvent, eventBus, onRelease]
4214
4214
  );
4215
- const handlePointerLeave = React105.useCallback(
4215
+ const handlePointerLeave = React106.useCallback(
4216
4216
  (e) => {
4217
4217
  if (isPressed) {
4218
4218
  setIsPressed(false);
@@ -5110,9 +5110,9 @@ function MiniMap({
5110
5110
  viewportRect,
5111
5111
  className
5112
5112
  }) {
5113
- const canvasRef = React105.useRef(null);
5114
- const frameRef = React105.useRef(0);
5115
- React105.useEffect(() => {
5113
+ const canvasRef = React106.useRef(null);
5114
+ const frameRef = React106.useRef(0);
5115
+ React106.useEffect(() => {
5116
5116
  const canvas = canvasRef.current;
5117
5117
  if (!canvas) return;
5118
5118
  const ctx = canvas.getContext("2d");
@@ -5405,7 +5405,7 @@ var init_ErrorBoundary = __esm({
5405
5405
  "use client";
5406
5406
  init_cn();
5407
5407
  init_ErrorState();
5408
- ErrorBoundary = class extends React105__default.Component {
5408
+ ErrorBoundary = class extends React106__default.Component {
5409
5409
  constructor(props) {
5410
5410
  super(props);
5411
5411
  __publicField(this, "reset", () => {
@@ -6209,8 +6209,8 @@ var init_Tooltip = __esm({
6209
6209
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
6210
6210
  };
6211
6211
  }, []);
6212
- const triggerElement = React105__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
6213
- const trigger = React105__default.cloneElement(triggerElement, {
6212
+ const triggerElement = React106__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
6213
+ const trigger = React106__default.cloneElement(triggerElement, {
6214
6214
  ref: triggerRef,
6215
6215
  onMouseEnter: handleMouseEnter,
6216
6216
  onMouseLeave: handleMouseLeave,
@@ -6331,8 +6331,8 @@ var init_Popover = __esm({
6331
6331
  onMouseEnter: handleOpen,
6332
6332
  onMouseLeave: handleClose
6333
6333
  };
6334
- const childElement = React105__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
6335
- const triggerElement = React105__default.cloneElement(
6334
+ const childElement = React106__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
6335
+ const triggerElement = React106__default.cloneElement(
6336
6336
  childElement,
6337
6337
  {
6338
6338
  ref: triggerRef,
@@ -6449,8 +6449,8 @@ var init_Menu = __esm({
6449
6449
  "bottom-start": "top-full left-0 mt-2",
6450
6450
  "bottom-end": "top-full right-0 mt-2"
6451
6451
  };
6452
- const triggerChild = React105__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
6453
- const triggerElement = React105__default.cloneElement(
6452
+ const triggerChild = React106__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
6453
+ const triggerElement = React106__default.cloneElement(
6454
6454
  triggerChild,
6455
6455
  {
6456
6456
  ref: triggerRef,
@@ -6957,7 +6957,7 @@ var init_MapView = __esm({
6957
6957
  import('leaflet')
6958
6958
  ]);
6959
6959
  await import('leaflet/dist/leaflet.css');
6960
- const { MapContainer, TileLayer, Marker, Popup, useMap } = reactLeaflet;
6960
+ const { MapContainer, TileLayer, Marker, Polyline, Popup, useMap } = reactLeaflet;
6961
6961
  const L = leafletMod.default;
6962
6962
  const defaultIcon = L.icon({
6963
6963
  iconUrl: "https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png",
@@ -6969,7 +6969,7 @@ var init_MapView = __esm({
6969
6969
  shadowSize: [41, 41]
6970
6970
  });
6971
6971
  L.Marker.prototype.options.icon = defaultIcon;
6972
- const { useEffect: useEffect60, useRef: useRef59, useCallback: useCallback88, useState: useState80 } = React105__default;
6972
+ const { useEffect: useEffect60, useRef: useRef59, useCallback: useCallback88, useState: useState80 } = React106__default;
6973
6973
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
6974
6974
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
6975
6975
  function MapUpdater({ centerLat, centerLng, zoom }) {
@@ -7000,6 +7000,7 @@ var init_MapView = __esm({
7000
7000
  }
7001
7001
  function MapViewInner({
7002
7002
  markers = [],
7003
+ routes = [],
7003
7004
  centerLat = 51.505,
7004
7005
  centerLng = -0.09,
7005
7006
  zoom = 13,
@@ -7068,6 +7069,20 @@ var init_MapView = __esm({
7068
7069
  ] }) : null
7069
7070
  },
7070
7071
  marker.id
7072
+ )),
7073
+ routes.map((route) => /* @__PURE__ */ jsx(
7074
+ Polyline,
7075
+ {
7076
+ positions: route.waypoints.map((wp) => [wp.lat, wp.lng]),
7077
+ pathOptions: {
7078
+ color: route.color ?? "var(--primary, #2563eb)",
7079
+ weight: route.weight ?? 4,
7080
+ opacity: route.opacity ?? 0.8,
7081
+ dashArray: route.dashArray
7082
+ },
7083
+ children: route.label ? /* @__PURE__ */ jsx(Popup, { children: /* @__PURE__ */ jsx(Typography2, { variant: "body2", children: route.label }) }) : null
7084
+ },
7085
+ route.id
7071
7086
  ))
7072
7087
  ]
7073
7088
  },
@@ -7200,7 +7215,7 @@ function InputPattern({
7200
7215
  fieldName
7201
7216
  }) {
7202
7217
  const { emit } = useEventBus();
7203
- const [localValue, setLocalValue] = React105__default.useState(value);
7218
+ const [localValue, setLocalValue] = React106__default.useState(value);
7204
7219
  const handleChange = (e) => {
7205
7220
  setLocalValue(e.target.value);
7206
7221
  if (onChange) {
@@ -7238,7 +7253,7 @@ function TextareaPattern({
7238
7253
  fieldName
7239
7254
  }) {
7240
7255
  const { emit } = useEventBus();
7241
- const [localValue, setLocalValue] = React105__default.useState(value);
7256
+ const [localValue, setLocalValue] = React106__default.useState(value);
7242
7257
  const handleChange = (e) => {
7243
7258
  setLocalValue(e.target.value);
7244
7259
  if (onChange) {
@@ -7270,7 +7285,7 @@ function SelectPattern({
7270
7285
  fieldName
7271
7286
  }) {
7272
7287
  const { emit } = useEventBus();
7273
- const [localValue, setLocalValue] = React105__default.useState(value);
7288
+ const [localValue, setLocalValue] = React106__default.useState(value);
7274
7289
  const handleChange = (e) => {
7275
7290
  setLocalValue(e.target.value);
7276
7291
  if (onChange) {
@@ -7299,7 +7314,7 @@ function CheckboxPattern({
7299
7314
  className
7300
7315
  }) {
7301
7316
  const { emit } = useEventBus();
7302
- const [localChecked, setLocalChecked] = React105__default.useState(checked);
7317
+ const [localChecked, setLocalChecked] = React106__default.useState(checked);
7303
7318
  const handleChange = (e) => {
7304
7319
  setLocalChecked(e.target.checked);
7305
7320
  if (onChange) {
@@ -7530,8 +7545,8 @@ function ActionButtons({
7530
7545
  disabled
7531
7546
  }) {
7532
7547
  const eventBus = useEventBus();
7533
- const [activeButtons, setActiveButtons] = React105.useState(/* @__PURE__ */ new Set());
7534
- const handlePress = React105.useCallback(
7548
+ const [activeButtons, setActiveButtons] = React106.useState(/* @__PURE__ */ new Set());
7549
+ const handlePress = React106.useCallback(
7535
7550
  (id) => {
7536
7551
  setActiveButtons((prev) => new Set(prev).add(id));
7537
7552
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -7539,7 +7554,7 @@ function ActionButtons({
7539
7554
  },
7540
7555
  [actionEvent, eventBus, onAction]
7541
7556
  );
7542
- const handleRelease = React105.useCallback(
7557
+ const handleRelease = React106.useCallback(
7543
7558
  (id) => {
7544
7559
  setActiveButtons((prev) => {
7545
7560
  const next = new Set(prev);
@@ -9562,7 +9577,7 @@ var init_MarkdownContent = __esm({
9562
9577
  init_Box();
9563
9578
  init_useTranslate();
9564
9579
  init_cn();
9565
- MarkdownContent = React105__default.memo(
9580
+ MarkdownContent = React106__default.memo(
9566
9581
  ({ content, direction, className }) => {
9567
9582
  const { t: _t } = useTranslate();
9568
9583
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -9779,7 +9794,7 @@ var init_CodeBlock = __esm({
9779
9794
  loloStyle = { ...dark, ...loloStyleOverrides };
9780
9795
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
9781
9796
  HIDDEN_LINE_NUMBERS = { display: "none" };
9782
- CodeBlock = React105__default.memo(
9797
+ CodeBlock = React106__default.memo(
9783
9798
  ({
9784
9799
  code: rawCode,
9785
9800
  language = "text",
@@ -11088,7 +11103,7 @@ var init_StateMachineView = __esm({
11088
11103
  style: { top: title ? 30 : 0 },
11089
11104
  children: [
11090
11105
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
11091
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React105__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
11106
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React106__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
11092
11107
  StateNode,
11093
11108
  {
11094
11109
  state,
@@ -16875,7 +16890,7 @@ function CraftingRecipe({
16875
16890
  className
16876
16891
  }) {
16877
16892
  const eventBus = useEventBus();
16878
- const handleCraft = React105.useCallback(() => {
16893
+ const handleCraft = React106.useCallback(() => {
16879
16894
  onCraft?.();
16880
16895
  if (craftEvent) {
16881
16896
  eventBus.emit(craftEvent, { output: output.label });
@@ -16892,7 +16907,7 @@ function CraftingRecipe({
16892
16907
  children: [
16893
16908
  /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
16894
16909
  const hasSufficient = ingredient.available >= ingredient.required;
16895
- return /* @__PURE__ */ jsxs(React105.Fragment, { children: [
16910
+ return /* @__PURE__ */ jsxs(React106.Fragment, { children: [
16896
16911
  /* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
16897
16912
  ItemSlot,
16898
16913
  {
@@ -17186,8 +17201,8 @@ function DPad({
17186
17201
  }) {
17187
17202
  const eventBus = useEventBus();
17188
17203
  const sizes = sizeMap15[size];
17189
- const [activeDirections, setActiveDirections] = React105.useState(/* @__PURE__ */ new Set());
17190
- const handlePress = React105.useCallback(
17204
+ const [activeDirections, setActiveDirections] = React106.useState(/* @__PURE__ */ new Set());
17205
+ const handlePress = React106.useCallback(
17191
17206
  (direction) => {
17192
17207
  setActiveDirections((prev) => new Set(prev).add(direction));
17193
17208
  if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
@@ -17195,7 +17210,7 @@ function DPad({
17195
17210
  },
17196
17211
  [directionEvent, eventBus, onDirection]
17197
17212
  );
17198
- const handleRelease = React105.useCallback(
17213
+ const handleRelease = React106.useCallback(
17199
17214
  (direction) => {
17200
17215
  setActiveDirections((prev) => {
17201
17216
  const next = new Set(prev);
@@ -17327,6 +17342,19 @@ var init_useAuthContext = __esm({
17327
17342
  "hooks/useAuthContext.ts"() {
17328
17343
  }
17329
17344
  });
17345
+ var CurrentPagePathContext, CurrentPagePathProvider, useCurrentPagePath;
17346
+ var init_CurrentPagePathContext = __esm({
17347
+ "context/CurrentPagePathContext.tsx"() {
17348
+ "use client";
17349
+ CurrentPagePathContext = createContext(void 0);
17350
+ CurrentPagePathProvider = ({
17351
+ value,
17352
+ children
17353
+ }) => /* @__PURE__ */ jsx(CurrentPagePathContext.Provider, { value, children });
17354
+ CurrentPagePathProvider.displayName = "CurrentPagePathProvider";
17355
+ useCurrentPagePath = () => useContext(CurrentPagePathContext);
17356
+ }
17357
+ });
17330
17358
  var DashboardLayout, NavLink;
17331
17359
  var init_DashboardLayout = __esm({
17332
17360
  "components/templates/DashboardLayout.tsx"() {
@@ -17340,6 +17368,7 @@ var init_DashboardLayout = __esm({
17340
17368
  init_useAuthContext();
17341
17369
  init_useEventBus();
17342
17370
  init_useTranslate();
17371
+ init_CurrentPagePathContext();
17343
17372
  DashboardLayout = ({
17344
17373
  appName = "{{APP_TITLE}}",
17345
17374
  logo,
@@ -17356,6 +17385,7 @@ var init_DashboardLayout = __esm({
17356
17385
  showThemeToggle = true,
17357
17386
  sidebarFooter,
17358
17387
  onSignOut: onSignOutProp,
17388
+ currentPath,
17359
17389
  children
17360
17390
  }) => {
17361
17391
  const eventBus = useEventBus();
@@ -17376,259 +17406,271 @@ var init_DashboardLayout = __esm({
17376
17406
  const [sidebarOpen, setSidebarOpen] = useState(false);
17377
17407
  const [userMenuOpen, setUserMenuOpen] = useState(false);
17378
17408
  const location = useLocation();
17409
+ const ctxPagePath = useCurrentPagePath();
17410
+ const activePath = currentPath ?? ctxPagePath ?? location.pathname;
17379
17411
  const { signOut: authSignOut } = useAuthContext();
17380
17412
  const user = userProp || (null);
17381
17413
  const { t } = useTranslate();
17382
17414
  const handleSignOut = onSignOutProp || authSignOut;
17383
- return /* @__PURE__ */ jsxs(Box, { className: "min-h-screen bg-background dark:bg-background", children: [
17384
- sidebarOpen && /* @__PURE__ */ jsx(
17385
- Box,
17386
- {
17387
- className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 lg:hidden",
17388
- onClick: () => setSidebarOpen(false)
17389
- }
17390
- ),
17391
- /* @__PURE__ */ jsxs(
17392
- Box,
17393
- {
17394
- as: "aside",
17395
- className: cn(
17396
- "fixed inset-y-0 left-0 z-30 w-64 bg-card dark:bg-card border-r border-border dark:border-border",
17397
- "transform transition-transform duration-200 ease-in-out lg:translate-x-0",
17398
- sidebarOpen ? "translate-x-0" : "-translate-x-full"
17415
+ return /* @__PURE__ */ jsxs(
17416
+ HStack,
17417
+ {
17418
+ gap: "none",
17419
+ className: "min-h-screen w-full bg-background dark:bg-background items-stretch",
17420
+ children: [
17421
+ sidebarOpen && /* @__PURE__ */ jsx(
17422
+ Box,
17423
+ {
17424
+ className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 lg:hidden",
17425
+ onClick: () => setSidebarOpen(false)
17426
+ }
17399
17427
  ),
17400
- children: [
17401
- /* @__PURE__ */ jsxs(
17402
- HStack,
17403
- {
17404
- align: "center",
17405
- justify: "between",
17406
- className: "h-16 px-4 border-b border-border dark:border-border",
17407
- children: [
17408
- /* @__PURE__ */ jsxs(Link, { to: "/", className: "flex items-center gap-2", children: [
17409
- logo || /* @__PURE__ */ jsx(Box, { className: "w-8 h-8 bg-primary-600 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx(
17410
- Typography,
17411
- {
17412
- variant: "small",
17413
- className: "text-white font-bold text-sm",
17414
- as: "span",
17415
- children: appName.charAt(0).toUpperCase()
17416
- }
17417
- ) }),
17418
- /* @__PURE__ */ jsx(
17419
- Typography,
17420
- {
17421
- variant: "label",
17422
- className: "font-semibold text-foreground dark:text-foreground",
17423
- as: "span",
17424
- children: appName
17425
- }
17426
- )
17427
- ] }),
17428
- /* @__PURE__ */ jsx(
17429
- Button,
17430
- {
17431
- variant: "ghost",
17432
- className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
17433
- onClick: () => setSidebarOpen(false),
17434
- children: /* @__PURE__ */ jsx(X, { className: "h-5 w-5" })
17435
- }
17436
- )
17437
- ]
17438
- }
17439
- ),
17440
- /* @__PURE__ */ jsx(
17441
- VStack,
17442
- {
17443
- as: "nav",
17444
- gap: "none",
17445
- className: "flex-1 px-3 py-4 space-y-1 overflow-y-auto",
17446
- children: navItems.map((item) => /* @__PURE__ */ jsx(
17447
- NavLink,
17428
+ /* @__PURE__ */ jsxs(
17429
+ Box,
17430
+ {
17431
+ as: "aside",
17432
+ className: cn(
17433
+ "z-30 w-64 flex-shrink-0 bg-card dark:bg-card border-r border-border dark:border-border",
17434
+ "fixed inset-y-0 left-0 lg:static lg:translate-x-0 lg:h-auto",
17435
+ "transform transition-transform duration-200 ease-in-out",
17436
+ "flex flex-col",
17437
+ sidebarOpen ? "translate-x-0" : "-translate-x-full"
17438
+ ),
17439
+ children: [
17440
+ /* @__PURE__ */ jsxs(
17441
+ HStack,
17448
17442
  {
17449
- item,
17450
- currentPath: location.pathname
17451
- },
17452
- item.href
17453
- ))
17454
- }
17455
- ),
17456
- sidebarFooter && /* @__PURE__ */ jsx(Box, { className: "p-4 border-t border-border dark:border-border", children: sidebarFooter })
17457
- ]
17458
- }
17459
- ),
17460
- /* @__PURE__ */ jsxs(Box, { className: "lg:pl-64", children: [
17461
- /* @__PURE__ */ jsx(
17462
- Box,
17463
- {
17464
- as: "header",
17465
- className: "sticky top-0 z-20 h-16 bg-card dark:bg-card border-b border-border dark:border-border",
17466
- children: /* @__PURE__ */ jsxs(
17467
- HStack,
17468
- {
17469
- align: "center",
17470
- justify: "between",
17471
- className: "h-full px-4 gap-4",
17472
- children: [
17473
- /* @__PURE__ */ jsx(
17474
- Button,
17475
- {
17476
- variant: "ghost",
17477
- className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground touch-manipulation min-h-[44px] min-w-[44px] flex items-center justify-center",
17478
- onClick: () => setSidebarOpen(true),
17479
- "aria-label": "Open sidebar",
17480
- children: /* @__PURE__ */ jsx(Menu$1, { className: "h-5 w-5" })
17481
- }
17482
- ),
17483
- searchEnabled && /* @__PURE__ */ jsx(Box, { className: "hidden sm:block flex-1 max-w-md", children: /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
17484
- /* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground dark:text-muted-foreground" }),
17485
- /* @__PURE__ */ jsx(
17486
- Input,
17487
- {
17488
- type: "search",
17489
- placeholder: t("common.search"),
17490
- className: "pl-10 w-full",
17491
- onKeyDown: (e) => {
17492
- if (e.key === "Enter") {
17493
- handleSearchSubmit(e.target.value);
17443
+ align: "center",
17444
+ justify: "between",
17445
+ className: "h-16 px-4 border-b border-border dark:border-border",
17446
+ children: [
17447
+ /* @__PURE__ */ jsxs(Link, { to: "/", className: "flex items-center gap-2", children: [
17448
+ logo || /* @__PURE__ */ jsx(Box, { className: "w-8 h-8 bg-primary-600 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx(
17449
+ Typography,
17450
+ {
17451
+ variant: "small",
17452
+ className: "text-white font-bold text-sm",
17453
+ as: "span",
17454
+ children: appName.charAt(0).toUpperCase()
17494
17455
  }
17456
+ ) }),
17457
+ /* @__PURE__ */ jsx(
17458
+ Typography,
17459
+ {
17460
+ variant: "label",
17461
+ className: "font-semibold text-foreground dark:text-foreground",
17462
+ as: "span",
17463
+ children: appName
17464
+ }
17465
+ )
17466
+ ] }),
17467
+ /* @__PURE__ */ jsx(
17468
+ Button,
17469
+ {
17470
+ variant: "ghost",
17471
+ className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
17472
+ onClick: () => setSidebarOpen(false),
17473
+ children: /* @__PURE__ */ jsx(X, { className: "h-5 w-5" })
17495
17474
  }
17496
- }
17497
- )
17498
- ] }) }),
17499
- /* @__PURE__ */ jsxs(HStack, { align: "center", gap: "xs", children: [
17500
- headerActions,
17501
- showThemeToggle && /* @__PURE__ */ jsx(ThemeToggle, {}),
17502
- topBarActions.map((action, idx) => /* @__PURE__ */ jsxs(
17503
- Button,
17475
+ )
17476
+ ]
17477
+ }
17478
+ ),
17479
+ /* @__PURE__ */ jsx(
17480
+ VStack,
17481
+ {
17482
+ as: "nav",
17483
+ gap: "none",
17484
+ className: "flex-1 px-3 py-4 space-y-1 overflow-y-auto",
17485
+ children: navItems.map((item) => /* @__PURE__ */ jsx(
17486
+ NavLink,
17504
17487
  {
17505
- variant: "ghost",
17506
- className: "relative p-2 rounded-full hover:bg-muted dark:hover:bg-muted",
17507
- onClick: () => handleTopBarActionClick(action.event),
17508
- "aria-label": action.label ?? action.icon,
17509
- children: [
17510
- /* @__PURE__ */ jsx(Icon, { name: action.icon, className: "h-5 w-5 text-muted-foreground dark:text-muted-foreground" }),
17511
- action.badge !== void 0 && action.badge !== null && action.badge !== 0 && action.badge !== "" && /* @__PURE__ */ jsx(
17512
- Box,
17513
- {
17514
- as: "span",
17515
- className: cn(
17516
- "absolute -top-0.5 -right-0.5 min-w-[18px] h-[18px] px-1 rounded-full text-[10px] font-semibold text-white flex items-center justify-center",
17517
- action.variant === "danger" ? "bg-error" : action.variant === "primary" ? "bg-primary" : "bg-foreground"
17518
- ),
17519
- children: action.badge
17520
- }
17521
- )
17522
- ]
17488
+ item,
17489
+ currentPath: activePath
17523
17490
  },
17524
- `${action.event}-${idx}`
17525
- )),
17526
- notificationsEnabled && /* @__PURE__ */ jsxs(
17527
- Button,
17528
- {
17529
- variant: "ghost",
17530
- className: "relative p-2 rounded-full hover:bg-muted dark:hover:bg-muted",
17531
- onClick: handleNotificationClick,
17532
- "aria-label": t("common.notifications"),
17533
- children: [
17534
- /* @__PURE__ */ jsx(Bell, { className: "h-5 w-5 text-muted-foreground dark:text-muted-foreground" }),
17535
- unreadCount > 0 && /* @__PURE__ */ jsx(
17536
- Box,
17537
- {
17538
- as: "span",
17539
- className: "absolute -top-0.5 -right-0.5 min-w-[18px] h-[18px] px-1 bg-error rounded-full text-[10px] font-semibold text-white flex items-center justify-center",
17540
- children: unreadCount > 99 ? "99+" : unreadCount
17541
- }
17542
- )
17543
- ]
17544
- }
17545
- ),
17546
- user && /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
17547
- /* @__PURE__ */ jsxs(
17491
+ item.href
17492
+ ))
17493
+ }
17494
+ ),
17495
+ sidebarFooter && /* @__PURE__ */ jsx(Box, { className: "p-4 border-t border-border dark:border-border", children: sidebarFooter })
17496
+ ]
17497
+ }
17498
+ ),
17499
+ /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "flex-1 min-w-0 min-h-screen", children: [
17500
+ /* @__PURE__ */ jsx(
17501
+ Box,
17502
+ {
17503
+ as: "header",
17504
+ className: "sticky top-0 z-20 h-16 bg-card dark:bg-card border-b border-border dark:border-border",
17505
+ children: /* @__PURE__ */ jsxs(
17506
+ HStack,
17507
+ {
17508
+ align: "center",
17509
+ justify: "between",
17510
+ className: "h-full px-3 sm:px-4 gap-2 sm:gap-4",
17511
+ children: [
17512
+ /* @__PURE__ */ jsx(
17548
17513
  Button,
17549
17514
  {
17550
17515
  variant: "ghost",
17551
- className: "flex items-center gap-2 p-2 rounded-lg hover:bg-muted dark:hover:bg-muted",
17552
- onClick: () => setUserMenuOpen(!userMenuOpen),
17553
- children: [
17554
- /* @__PURE__ */ jsx(
17555
- Avatar,
17556
- {
17557
- src: user.avatar,
17558
- alt: user.name,
17559
- initials: user.name.split(" ").map((n) => n[0]).join("").substring(0, 2),
17560
- size: "sm"
17561
- }
17562
- ),
17563
- /* @__PURE__ */ jsx(
17564
- Typography,
17565
- {
17566
- variant: "small",
17567
- className: "hidden sm:block text-sm font-medium text-foreground dark:text-foreground",
17568
- as: "span",
17569
- children: user.name
17570
- }
17571
- ),
17572
- /* @__PURE__ */ jsx(ChevronDown, { className: "hidden sm:block h-4 w-4 text-muted-foreground dark:text-muted-foreground" })
17573
- ]
17516
+ className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground touch-manipulation min-h-[44px] min-w-[44px] flex items-center justify-center",
17517
+ onClick: () => setSidebarOpen(true),
17518
+ "aria-label": "Open sidebar",
17519
+ children: /* @__PURE__ */ jsx(Menu$1, { className: "h-5 w-5" })
17574
17520
  }
17575
17521
  ),
17576
- userMenuOpen && /* @__PURE__ */ jsxs(Fragment, { children: [
17522
+ searchEnabled && /* @__PURE__ */ jsx(Box, { className: "hidden sm:block flex-1 min-w-0 xl:max-w-md", children: /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
17523
+ /* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground dark:text-muted-foreground" }),
17577
17524
  /* @__PURE__ */ jsx(
17578
- Box,
17525
+ Input,
17579
17526
  {
17580
- className: "fixed inset-0 z-20",
17581
- onClick: () => setUserMenuOpen(false)
17527
+ type: "search",
17528
+ placeholder: t("common.search"),
17529
+ className: "pl-10 w-full",
17530
+ onKeyDown: (e) => {
17531
+ if (e.key === "Enter") {
17532
+ handleSearchSubmit(e.target.value);
17533
+ }
17534
+ }
17535
+ }
17536
+ )
17537
+ ] }) }),
17538
+ !searchEnabled && /* @__PURE__ */ jsx(Box, { className: "flex-1" }),
17539
+ /* @__PURE__ */ jsxs(HStack, { align: "center", gap: "xs", children: [
17540
+ headerActions,
17541
+ showThemeToggle && /* @__PURE__ */ jsx(ThemeToggle, {}),
17542
+ topBarActions.map((action, idx) => /* @__PURE__ */ jsxs(
17543
+ Button,
17544
+ {
17545
+ variant: "ghost",
17546
+ className: "relative p-2 rounded-full hover:bg-muted dark:hover:bg-muted",
17547
+ onClick: () => handleTopBarActionClick(action.event),
17548
+ "aria-label": action.label ?? action.icon,
17549
+ children: [
17550
+ /* @__PURE__ */ jsx(Icon, { name: action.icon, className: "h-5 w-5 text-muted-foreground dark:text-muted-foreground" }),
17551
+ action.badge !== void 0 && action.badge !== null && action.badge !== 0 && action.badge !== "" && /* @__PURE__ */ jsx(
17552
+ Box,
17553
+ {
17554
+ as: "span",
17555
+ className: cn(
17556
+ "absolute -top-0.5 -right-0.5 min-w-[18px] h-[18px] px-1 rounded-full text-[10px] font-semibold text-white flex items-center justify-center",
17557
+ action.variant === "danger" ? "bg-error" : action.variant === "primary" ? "bg-primary" : "bg-foreground"
17558
+ ),
17559
+ children: action.badge
17560
+ }
17561
+ )
17562
+ ]
17563
+ },
17564
+ `${action.event}-${idx}`
17565
+ )),
17566
+ notificationsEnabled && /* @__PURE__ */ jsxs(
17567
+ Button,
17568
+ {
17569
+ variant: "ghost",
17570
+ className: "relative p-2 rounded-full hover:bg-muted dark:hover:bg-muted",
17571
+ onClick: handleNotificationClick,
17572
+ "aria-label": t("common.notifications"),
17573
+ children: [
17574
+ /* @__PURE__ */ jsx(Bell, { className: "h-5 w-5 text-muted-foreground dark:text-muted-foreground" }),
17575
+ unreadCount > 0 && /* @__PURE__ */ jsx(
17576
+ Box,
17577
+ {
17578
+ as: "span",
17579
+ className: "absolute -top-0.5 -right-0.5 min-w-[18px] h-[18px] px-1 bg-error rounded-full text-[10px] font-semibold text-white flex items-center justify-center",
17580
+ children: unreadCount > 99 ? "99+" : unreadCount
17581
+ }
17582
+ )
17583
+ ]
17582
17584
  }
17583
17585
  ),
17584
- /* @__PURE__ */ jsxs(Box, { className: "absolute right-0 mt-2 w-48 bg-card dark:bg-card rounded-lg shadow-lg border border-border dark:border-border py-1 z-30", children: [
17585
- /* @__PURE__ */ jsxs(Box, { className: "px-4 py-2 border-b border-border dark:border-border", children: [
17586
- /* @__PURE__ */ jsx(
17587
- Typography,
17588
- {
17589
- variant: "small",
17590
- className: "text-sm font-medium text-foreground dark:text-foreground",
17591
- as: "p",
17592
- children: user.name
17593
- }
17594
- ),
17595
- /* @__PURE__ */ jsx(
17596
- Typography,
17597
- {
17598
- variant: "caption",
17599
- className: "text-xs text-muted-foreground dark:text-muted-foreground",
17600
- as: "p",
17601
- children: user.email
17602
- }
17603
- )
17604
- ] }),
17586
+ user && /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
17605
17587
  /* @__PURE__ */ jsxs(
17606
17588
  Button,
17607
17589
  {
17608
17590
  variant: "ghost",
17609
- onClick: () => {
17610
- setUserMenuOpen(false);
17611
- handleSignOut?.();
17612
- },
17613
- className: "w-full flex items-center gap-2 px-4 py-2 text-sm text-error dark:text-error hover:bg-error/10 dark:hover:bg-error/20",
17591
+ className: "flex items-center gap-2 p-2 rounded-lg hover:bg-muted dark:hover:bg-muted",
17592
+ onClick: () => setUserMenuOpen(!userMenuOpen),
17614
17593
  children: [
17615
- /* @__PURE__ */ jsx(LogOut, { className: "h-4 w-4" }),
17616
- t("auth.signOut")
17594
+ /* @__PURE__ */ jsx(
17595
+ Avatar,
17596
+ {
17597
+ src: user.avatar,
17598
+ alt: user.name,
17599
+ initials: user.name.split(" ").map((n) => n[0]).join("").substring(0, 2),
17600
+ size: "sm"
17601
+ }
17602
+ ),
17603
+ /* @__PURE__ */ jsx(
17604
+ Typography,
17605
+ {
17606
+ variant: "small",
17607
+ className: "hidden sm:block text-sm font-medium text-foreground dark:text-foreground",
17608
+ as: "span",
17609
+ children: user.name
17610
+ }
17611
+ ),
17612
+ /* @__PURE__ */ jsx(ChevronDown, { className: "hidden sm:block h-4 w-4 text-muted-foreground dark:text-muted-foreground" })
17617
17613
  ]
17618
17614
  }
17619
- )
17615
+ ),
17616
+ userMenuOpen && /* @__PURE__ */ jsxs(Fragment, { children: [
17617
+ /* @__PURE__ */ jsx(
17618
+ Box,
17619
+ {
17620
+ className: "fixed inset-0 z-20",
17621
+ onClick: () => setUserMenuOpen(false)
17622
+ }
17623
+ ),
17624
+ /* @__PURE__ */ jsxs(Box, { className: "absolute right-0 mt-2 w-48 bg-card dark:bg-card rounded-lg shadow-lg border border-border dark:border-border py-1 z-30", children: [
17625
+ /* @__PURE__ */ jsxs(Box, { className: "px-4 py-2 border-b border-border dark:border-border", children: [
17626
+ /* @__PURE__ */ jsx(
17627
+ Typography,
17628
+ {
17629
+ variant: "small",
17630
+ className: "text-sm font-medium text-foreground dark:text-foreground",
17631
+ as: "p",
17632
+ children: user.name
17633
+ }
17634
+ ),
17635
+ /* @__PURE__ */ jsx(
17636
+ Typography,
17637
+ {
17638
+ variant: "caption",
17639
+ className: "text-xs text-muted-foreground dark:text-muted-foreground",
17640
+ as: "p",
17641
+ children: user.email
17642
+ }
17643
+ )
17644
+ ] }),
17645
+ /* @__PURE__ */ jsxs(
17646
+ Button,
17647
+ {
17648
+ variant: "ghost",
17649
+ onClick: () => {
17650
+ setUserMenuOpen(false);
17651
+ handleSignOut?.();
17652
+ },
17653
+ className: "w-full flex items-center gap-2 px-4 py-2 text-sm text-error dark:text-error hover:bg-error/10 dark:hover:bg-error/20",
17654
+ children: [
17655
+ /* @__PURE__ */ jsx(LogOut, { className: "h-4 w-4" }),
17656
+ t("auth.signOut")
17657
+ ]
17658
+ }
17659
+ )
17660
+ ] })
17661
+ ] })
17620
17662
  ] })
17621
17663
  ] })
17622
- ] })
17623
- ] })
17624
- ]
17664
+ ]
17665
+ }
17666
+ )
17625
17667
  }
17626
- )
17627
- }
17628
- ),
17629
- /* @__PURE__ */ jsx(Box, { as: "main", className: "p-4 sm:p-6", children })
17630
- ] })
17631
- ] });
17668
+ ),
17669
+ /* @__PURE__ */ jsx(Box, { as: "main", className: "flex-1 p-3 sm:p-4 md:p-6", children })
17670
+ ] })
17671
+ ]
17672
+ }
17673
+ );
17632
17674
  };
17633
17675
  DashboardLayout.displayName = "DashboardLayout";
17634
17676
  NavLink = ({
@@ -18122,13 +18164,13 @@ function DataList({
18122
18164
  }) {
18123
18165
  const eventBus = useEventBus();
18124
18166
  const { t } = useTranslate();
18125
- const [visibleCount, setVisibleCount] = React105__default.useState(pageSize || Infinity);
18167
+ const [visibleCount, setVisibleCount] = React106__default.useState(pageSize || Infinity);
18126
18168
  const fieldDefs = fields ?? columns ?? [];
18127
18169
  const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
18128
18170
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
18129
18171
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
18130
18172
  const hasRenderProp = typeof children === "function";
18131
- React105__default.useEffect(() => {
18173
+ React106__default.useEffect(() => {
18132
18174
  const renderItemTypeOf = typeof schemaRenderItem;
18133
18175
  const childrenTypeOf = typeof children;
18134
18176
  if (data.length > 0 && !hasRenderProp) {
@@ -18184,7 +18226,7 @@ function DataList({
18184
18226
  const items2 = data.map((item) => item);
18185
18227
  const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
18186
18228
  const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
18187
- return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
18229
+ return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React106__default.Fragment, { children: [
18188
18230
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
18189
18231
  group.items.map((itemData, index) => {
18190
18232
  const id = itemData.id || `${gi}-${index}`;
@@ -18375,7 +18417,7 @@ function DataList({
18375
18417
  className
18376
18418
  ),
18377
18419
  children: [
18378
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
18420
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React106__default.Fragment, { children: [
18379
18421
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
18380
18422
  group.items.map(
18381
18423
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -19522,7 +19564,7 @@ var init_WizardProgress = __esm({
19522
19564
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
19523
19565
  const isActive = index === currentStep;
19524
19566
  const isCompleted = index < currentStep;
19525
- return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
19567
+ return /* @__PURE__ */ jsxs(React106__default.Fragment, { children: [
19526
19568
  /* @__PURE__ */ jsx(
19527
19569
  "button",
19528
19570
  {
@@ -20433,7 +20475,7 @@ function InventoryGrid({
20433
20475
  const eventBus = useEventBus();
20434
20476
  const slotCount = totalSlots ?? items.length;
20435
20477
  const emptySlotCount = Math.max(0, slotCount - items.length);
20436
- const handleSelect = React105.useCallback(
20478
+ const handleSelect = React106.useCallback(
20437
20479
  (id) => {
20438
20480
  onSelect?.(id);
20439
20481
  if (selectEvent) {
@@ -20646,15 +20688,15 @@ function GameCanvas2D({
20646
20688
  fps = 60,
20647
20689
  className
20648
20690
  }) {
20649
- const canvasRef = React105.useRef(null);
20650
- const rafRef = React105.useRef(0);
20651
- const frameRef = React105.useRef(0);
20652
- const lastTimeRef = React105.useRef(0);
20653
- const onDrawRef = React105.useRef(onDraw);
20691
+ const canvasRef = React106.useRef(null);
20692
+ const rafRef = React106.useRef(0);
20693
+ const frameRef = React106.useRef(0);
20694
+ const lastTimeRef = React106.useRef(0);
20695
+ const onDrawRef = React106.useRef(onDraw);
20654
20696
  onDrawRef.current = onDraw;
20655
- const onTickRef = React105.useRef(onTick);
20697
+ const onTickRef = React106.useRef(onTick);
20656
20698
  onTickRef.current = onTick;
20657
- React105.useEffect(() => {
20699
+ React106.useEffect(() => {
20658
20700
  const canvas = canvasRef.current;
20659
20701
  if (!canvas) return;
20660
20702
  const ctx = canvas.getContext("2d");
@@ -20943,7 +20985,7 @@ function TurnPanel({
20943
20985
  className
20944
20986
  }) {
20945
20987
  const eventBus = useEventBus();
20946
- const handleAction = React105.useCallback(
20988
+ const handleAction = React106.useCallback(
20947
20989
  (event) => {
20948
20990
  if (event) {
20949
20991
  eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
@@ -21089,7 +21131,7 @@ function UnitCommandBar({
21089
21131
  className
21090
21132
  }) {
21091
21133
  const eventBus = useEventBus();
21092
- const handleCommand = React105.useCallback(
21134
+ const handleCommand = React106.useCallback(
21093
21135
  (event) => {
21094
21136
  if (event) {
21095
21137
  eventBus.emit(event, { unitId: selectedUnitId });
@@ -21574,7 +21616,7 @@ function GameMenu({
21574
21616
  } catch {
21575
21617
  }
21576
21618
  const eventBus = eventBusProp || eventBusFromHook;
21577
- const handleOptionClick = React105.useCallback(
21619
+ const handleOptionClick = React106.useCallback(
21578
21620
  (option) => {
21579
21621
  if (option.event && eventBus) {
21580
21622
  eventBus.emit(`UI:${option.event}`, { option });
@@ -21688,7 +21730,7 @@ function GameOverScreen({
21688
21730
  } catch {
21689
21731
  }
21690
21732
  const eventBus = eventBusProp || eventBusFromHook;
21691
- const handleActionClick = React105.useCallback(
21733
+ const handleActionClick = React106.useCallback(
21692
21734
  (action) => {
21693
21735
  if (action.event && eventBus) {
21694
21736
  eventBus.emit(`UI:${action.event}`, { action });
@@ -25177,7 +25219,7 @@ var init_DocumentViewer = __esm({
25177
25219
  }
25178
25220
  });
25179
25221
  function extractTitle(children) {
25180
- if (!React105__default.isValidElement(children)) return void 0;
25222
+ if (!React106__default.isValidElement(children)) return void 0;
25181
25223
  const props = children.props;
25182
25224
  if (typeof props.title === "string") {
25183
25225
  return props.title;
@@ -25232,7 +25274,7 @@ function LinearView({
25232
25274
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
25233
25275
  const isDone = i < currentIdx;
25234
25276
  const isCurrent = i === currentIdx;
25235
- return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
25277
+ return /* @__PURE__ */ jsxs(React106__default.Fragment, { children: [
25236
25278
  i > 0 && /* @__PURE__ */ jsx(
25237
25279
  Typography,
25238
25280
  {
@@ -26016,12 +26058,12 @@ var init_Form = __esm({
26016
26058
  const isSchemaEntity = isOrbitalEntitySchema(entity);
26017
26059
  const resolvedEntity = isSchemaEntity ? entity : void 0;
26018
26060
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
26019
- const normalizedInitialData = React105__default.useMemo(() => {
26061
+ const normalizedInitialData = React106__default.useMemo(() => {
26020
26062
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
26021
26063
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
26022
26064
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
26023
26065
  }, [entity, initialData]);
26024
- const entityDerivedFields = React105__default.useMemo(() => {
26066
+ const entityDerivedFields = React106__default.useMemo(() => {
26025
26067
  if (fields && fields.length > 0) return void 0;
26026
26068
  if (!resolvedEntity) return void 0;
26027
26069
  return resolvedEntity.fields.map(
@@ -26040,16 +26082,16 @@ var init_Form = __esm({
26040
26082
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
26041
26083
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
26042
26084
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
26043
- const [formData, setFormData] = React105__default.useState(
26085
+ const [formData, setFormData] = React106__default.useState(
26044
26086
  normalizedInitialData
26045
26087
  );
26046
- const [collapsedSections, setCollapsedSections] = React105__default.useState(
26088
+ const [collapsedSections, setCollapsedSections] = React106__default.useState(
26047
26089
  /* @__PURE__ */ new Set()
26048
26090
  );
26049
- const [submitError, setSubmitError] = React105__default.useState(null);
26050
- const formRef = React105__default.useRef(null);
26091
+ const [submitError, setSubmitError] = React106__default.useState(null);
26092
+ const formRef = React106__default.useRef(null);
26051
26093
  const formMode = props.mode;
26052
- const mountedRef = React105__default.useRef(false);
26094
+ const mountedRef = React106__default.useRef(false);
26053
26095
  if (!mountedRef.current) {
26054
26096
  mountedRef.current = true;
26055
26097
  debug("forms", "mount", {
@@ -26062,7 +26104,7 @@ var init_Form = __esm({
26062
26104
  });
26063
26105
  }
26064
26106
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
26065
- const evalContext = React105__default.useMemo(
26107
+ const evalContext = React106__default.useMemo(
26066
26108
  () => ({
26067
26109
  formValues: formData,
26068
26110
  globalVariables: externalContext?.globalVariables ?? {},
@@ -26071,7 +26113,7 @@ var init_Form = __esm({
26071
26113
  }),
26072
26114
  [formData, externalContext]
26073
26115
  );
26074
- React105__default.useEffect(() => {
26116
+ React106__default.useEffect(() => {
26075
26117
  debug("forms", "initialData-sync", {
26076
26118
  mode: formMode,
26077
26119
  normalizedInitialData,
@@ -26082,7 +26124,7 @@ var init_Form = __esm({
26082
26124
  setFormData(normalizedInitialData);
26083
26125
  }
26084
26126
  }, [normalizedInitialData]);
26085
- const processCalculations = React105__default.useCallback(
26127
+ const processCalculations = React106__default.useCallback(
26086
26128
  (changedFieldId, newFormData) => {
26087
26129
  if (!hiddenCalculations.length) return;
26088
26130
  const context = {
@@ -26107,7 +26149,7 @@ var init_Form = __esm({
26107
26149
  },
26108
26150
  [hiddenCalculations, externalContext, eventBus]
26109
26151
  );
26110
- const checkViolations = React105__default.useCallback(
26152
+ const checkViolations = React106__default.useCallback(
26111
26153
  (changedFieldId, newFormData) => {
26112
26154
  if (!violationTriggers.length) return;
26113
26155
  const context = {
@@ -26145,7 +26187,7 @@ var init_Form = __esm({
26145
26187
  processCalculations(name, newFormData);
26146
26188
  checkViolations(name, newFormData);
26147
26189
  };
26148
- const isFieldVisible = React105__default.useCallback(
26190
+ const isFieldVisible = React106__default.useCallback(
26149
26191
  (fieldName) => {
26150
26192
  const condition = conditionalFields[fieldName];
26151
26193
  if (!condition) return true;
@@ -26153,7 +26195,7 @@ var init_Form = __esm({
26153
26195
  },
26154
26196
  [conditionalFields, evalContext]
26155
26197
  );
26156
- const isSectionVisible = React105__default.useCallback(
26198
+ const isSectionVisible = React106__default.useCallback(
26157
26199
  (section) => {
26158
26200
  if (!section.condition) return true;
26159
26201
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -26229,7 +26271,7 @@ var init_Form = __esm({
26229
26271
  eventBus.emit(`UI:${onCancel}`);
26230
26272
  }
26231
26273
  };
26232
- const renderField = React105__default.useCallback(
26274
+ const renderField = React106__default.useCallback(
26233
26275
  (field) => {
26234
26276
  const fieldName = field.name || field.field;
26235
26277
  if (!fieldName) return null;
@@ -26250,7 +26292,7 @@ var init_Form = __esm({
26250
26292
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
26251
26293
  );
26252
26294
  const effectiveFields = entityDerivedFields ?? fields;
26253
- const normalizedFields = React105__default.useMemo(() => {
26295
+ const normalizedFields = React106__default.useMemo(() => {
26254
26296
  if (!effectiveFields || effectiveFields.length === 0) return [];
26255
26297
  return effectiveFields.map((field) => {
26256
26298
  if (typeof field === "string") {
@@ -26272,7 +26314,7 @@ var init_Form = __esm({
26272
26314
  return field;
26273
26315
  });
26274
26316
  }, [effectiveFields, resolvedEntity]);
26275
- const schemaFields = React105__default.useMemo(() => {
26317
+ const schemaFields = React106__default.useMemo(() => {
26276
26318
  if (normalizedFields.length === 0) return null;
26277
26319
  if (isDebugEnabled()) {
26278
26320
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -26282,7 +26324,7 @@ var init_Form = __esm({
26282
26324
  }
26283
26325
  return normalizedFields.map(renderField).filter(Boolean);
26284
26326
  }, [normalizedFields, renderField, entityName, conditionalFields]);
26285
- const sectionElements = React105__default.useMemo(() => {
26327
+ const sectionElements = React106__default.useMemo(() => {
26286
26328
  if (!sections || sections.length === 0) return null;
26287
26329
  return sections.map((section) => {
26288
26330
  if (!isSectionVisible(section)) {
@@ -27814,7 +27856,7 @@ var init_List = __esm({
27814
27856
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
27815
27857
  return [];
27816
27858
  }, [entity]);
27817
- const getItemActions = React105__default.useCallback(
27859
+ const getItemActions = React106__default.useCallback(
27818
27860
  (item) => {
27819
27861
  if (!itemActions) return [];
27820
27862
  if (typeof itemActions === "function") {
@@ -28251,7 +28293,7 @@ var init_MediaGallery = __esm({
28251
28293
  [selectable, selectedItems, selectionEvent, eventBus]
28252
28294
  );
28253
28295
  const entityData = Array.isArray(entity) ? entity : [];
28254
- const items = React105__default.useMemo(() => {
28296
+ const items = React106__default.useMemo(() => {
28255
28297
  if (propItems) return propItems;
28256
28298
  if (entityData.length === 0) return [];
28257
28299
  return entityData.map((record, idx) => ({
@@ -28415,7 +28457,7 @@ var init_MediaGallery = __esm({
28415
28457
  }
28416
28458
  });
28417
28459
  function extractTitle2(children) {
28418
- if (!React105__default.isValidElement(children)) return void 0;
28460
+ if (!React106__default.isValidElement(children)) return void 0;
28419
28461
  const props = children.props;
28420
28462
  if (typeof props.title === "string") {
28421
28463
  return props.title;
@@ -29128,7 +29170,7 @@ var init_PageHeader = __esm({
29128
29170
  info: "bg-info/10 text-info"
29129
29171
  };
29130
29172
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
29131
- breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
29173
+ breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React106__default.Fragment, { children: [
29132
29174
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
29133
29175
  crumb.href ? /* @__PURE__ */ jsx(
29134
29176
  "a",
@@ -29302,7 +29344,7 @@ var init_debugRegistry = __esm({
29302
29344
  }
29303
29345
  });
29304
29346
  function useDebugData() {
29305
- const [data, setData] = React105.useState(() => ({
29347
+ const [data, setData] = React106.useState(() => ({
29306
29348
  traits: [],
29307
29349
  ticks: [],
29308
29350
  guards: [],
@@ -29316,7 +29358,7 @@ function useDebugData() {
29316
29358
  },
29317
29359
  lastUpdate: Date.now()
29318
29360
  }));
29319
- React105.useEffect(() => {
29361
+ React106.useEffect(() => {
29320
29362
  const updateData = () => {
29321
29363
  setData({
29322
29364
  traits: getAllTraits(),
@@ -29425,12 +29467,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
29425
29467
  return positions;
29426
29468
  }
29427
29469
  function WalkMinimap() {
29428
- const [walkStep, setWalkStep] = React105.useState(null);
29429
- const [traits2, setTraits] = React105.useState([]);
29430
- const [coveredEdges, setCoveredEdges] = React105.useState([]);
29431
- const [completedTraits, setCompletedTraits] = React105.useState(/* @__PURE__ */ new Set());
29432
- const prevTraitRef = React105.useRef(null);
29433
- React105.useEffect(() => {
29470
+ const [walkStep, setWalkStep] = React106.useState(null);
29471
+ const [traits2, setTraits] = React106.useState([]);
29472
+ const [coveredEdges, setCoveredEdges] = React106.useState([]);
29473
+ const [completedTraits, setCompletedTraits] = React106.useState(/* @__PURE__ */ new Set());
29474
+ const prevTraitRef = React106.useRef(null);
29475
+ React106.useEffect(() => {
29434
29476
  const interval = setInterval(() => {
29435
29477
  const w = window;
29436
29478
  const step = w.__orbitalWalkStep;
@@ -29877,15 +29919,15 @@ var init_EntitiesTab = __esm({
29877
29919
  }
29878
29920
  });
29879
29921
  function EventFlowTab({ events: events2 }) {
29880
- const [filter, setFilter] = React105.useState("all");
29881
- const containerRef = React105.useRef(null);
29882
- const [autoScroll, setAutoScroll] = React105.useState(true);
29883
- React105.useEffect(() => {
29922
+ const [filter, setFilter] = React106.useState("all");
29923
+ const containerRef = React106.useRef(null);
29924
+ const [autoScroll, setAutoScroll] = React106.useState(true);
29925
+ React106.useEffect(() => {
29884
29926
  if (autoScroll && containerRef.current) {
29885
29927
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
29886
29928
  }
29887
29929
  }, [events2.length, autoScroll]);
29888
- const filteredEvents = React105.useMemo(() => {
29930
+ const filteredEvents = React106.useMemo(() => {
29889
29931
  if (filter === "all") return events2;
29890
29932
  return events2.filter((e) => e.type === filter);
29891
29933
  }, [events2, filter]);
@@ -30004,7 +30046,7 @@ var init_EventFlowTab = __esm({
30004
30046
  }
30005
30047
  });
30006
30048
  function GuardsPanel({ guards }) {
30007
- const [filter, setFilter] = React105.useState("all");
30049
+ const [filter, setFilter] = React106.useState("all");
30008
30050
  if (guards.length === 0) {
30009
30051
  return /* @__PURE__ */ jsx(
30010
30052
  EmptyState,
@@ -30017,7 +30059,7 @@ function GuardsPanel({ guards }) {
30017
30059
  }
30018
30060
  const passedCount = guards.filter((g) => g.result).length;
30019
30061
  const failedCount = guards.length - passedCount;
30020
- const filteredGuards = React105.useMemo(() => {
30062
+ const filteredGuards = React106.useMemo(() => {
30021
30063
  if (filter === "all") return guards;
30022
30064
  if (filter === "passed") return guards.filter((g) => g.result);
30023
30065
  return guards.filter((g) => !g.result);
@@ -30178,10 +30220,10 @@ function EffectBadge({ effect }) {
30178
30220
  ] });
30179
30221
  }
30180
30222
  function TransitionTimeline({ transitions }) {
30181
- const containerRef = React105.useRef(null);
30182
- const [autoScroll, setAutoScroll] = React105.useState(true);
30183
- const [expandedId, setExpandedId] = React105.useState(null);
30184
- React105.useEffect(() => {
30223
+ const containerRef = React106.useRef(null);
30224
+ const [autoScroll, setAutoScroll] = React106.useState(true);
30225
+ const [expandedId, setExpandedId] = React106.useState(null);
30226
+ React106.useEffect(() => {
30185
30227
  if (autoScroll && containerRef.current) {
30186
30228
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
30187
30229
  }
@@ -30467,9 +30509,9 @@ function getAllEvents(traits2) {
30467
30509
  }
30468
30510
  function EventDispatcherTab({ traits: traits2, schema }) {
30469
30511
  const eventBus = useEventBus();
30470
- const [log4, setLog] = React105.useState([]);
30471
- const prevStatesRef = React105.useRef(/* @__PURE__ */ new Map());
30472
- React105.useEffect(() => {
30512
+ const [log4, setLog] = React106.useState([]);
30513
+ const prevStatesRef = React106.useRef(/* @__PURE__ */ new Map());
30514
+ React106.useEffect(() => {
30473
30515
  for (const trait of traits2) {
30474
30516
  const prev = prevStatesRef.current.get(trait.id);
30475
30517
  if (prev && prev !== trait.currentState) {
@@ -30639,10 +30681,10 @@ function VerifyModePanel({
30639
30681
  serverCount,
30640
30682
  localCount
30641
30683
  }) {
30642
- const [expanded, setExpanded] = React105.useState(true);
30643
- const scrollRef = React105.useRef(null);
30644
- const prevCountRef = React105.useRef(0);
30645
- React105.useEffect(() => {
30684
+ const [expanded, setExpanded] = React106.useState(true);
30685
+ const scrollRef = React106.useRef(null);
30686
+ const prevCountRef = React106.useRef(0);
30687
+ React106.useEffect(() => {
30646
30688
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
30647
30689
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
30648
30690
  }
@@ -30708,10 +30750,10 @@ function RuntimeDebugger({
30708
30750
  defaultTab,
30709
30751
  schema
30710
30752
  }) {
30711
- const [isCollapsed, setIsCollapsed] = React105.useState(mode === "verify" ? true : defaultCollapsed);
30712
- const [isVisible, setIsVisible] = React105.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
30753
+ const [isCollapsed, setIsCollapsed] = React106.useState(mode === "verify" ? true : defaultCollapsed);
30754
+ const [isVisible, setIsVisible] = React106.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
30713
30755
  const debugData = useDebugData();
30714
- React105.useEffect(() => {
30756
+ React106.useEffect(() => {
30715
30757
  if (mode === "inline") return;
30716
30758
  return onDebugToggle((enabled) => {
30717
30759
  setIsVisible(enabled);
@@ -30720,7 +30762,7 @@ function RuntimeDebugger({
30720
30762
  }
30721
30763
  });
30722
30764
  }, [mode]);
30723
- React105.useEffect(() => {
30765
+ React106.useEffect(() => {
30724
30766
  if (mode === "inline") return;
30725
30767
  const handleKeyDown = (e) => {
30726
30768
  if (e.key === "`" && isVisible) {
@@ -31269,7 +31311,7 @@ function SequenceBar({
31269
31311
  onSlotRemove(index);
31270
31312
  }, [onSlotRemove, playing]);
31271
31313
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
31272
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
31314
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React106__default.Fragment, { children: [
31273
31315
  i > 0 && /* @__PURE__ */ jsx(
31274
31316
  Typography,
31275
31317
  {
@@ -32614,7 +32656,7 @@ var init_StatCard = __esm({
32614
32656
  const labelToUse = propLabel ?? propTitle;
32615
32657
  const eventBus = useEventBus();
32616
32658
  const { t } = useTranslate();
32617
- const handleActionClick = React105__default.useCallback(() => {
32659
+ const handleActionClick = React106__default.useCallback(() => {
32618
32660
  if (action?.event) {
32619
32661
  eventBus.emit(`UI:${action.event}`, {});
32620
32662
  }
@@ -32625,7 +32667,7 @@ var init_StatCard = __esm({
32625
32667
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
32626
32668
  const isLoading = externalLoading ?? false;
32627
32669
  const error = externalError;
32628
- const computeMetricValue = React105__default.useCallback(
32670
+ const computeMetricValue = React106__default.useCallback(
32629
32671
  (metric, items) => {
32630
32672
  if (metric.value !== void 0) {
32631
32673
  return metric.value;
@@ -32664,7 +32706,7 @@ var init_StatCard = __esm({
32664
32706
  },
32665
32707
  []
32666
32708
  );
32667
- const schemaStats = React105__default.useMemo(() => {
32709
+ const schemaStats = React106__default.useMemo(() => {
32668
32710
  if (!metrics || metrics.length === 0) return null;
32669
32711
  return metrics.map((metric) => ({
32670
32712
  label: metric.label,
@@ -32672,7 +32714,7 @@ var init_StatCard = __esm({
32672
32714
  format: metric.format
32673
32715
  }));
32674
32716
  }, [metrics, data, computeMetricValue]);
32675
- const calculatedTrend = React105__default.useMemo(() => {
32717
+ const calculatedTrend = React106__default.useMemo(() => {
32676
32718
  if (manualTrend !== void 0) return manualTrend;
32677
32719
  if (previousValue === void 0 || currentValue === void 0)
32678
32720
  return void 0;
@@ -33656,7 +33698,7 @@ var init_Timeline = __esm({
33656
33698
  }) => {
33657
33699
  const { t } = useTranslate();
33658
33700
  const entityData = Array.isArray(entity) ? entity : [];
33659
- const items = React105__default.useMemo(() => {
33701
+ const items = React106__default.useMemo(() => {
33660
33702
  if (propItems) return propItems;
33661
33703
  if (entityData.length === 0) return [];
33662
33704
  return entityData.map((record, idx) => {
@@ -33763,7 +33805,7 @@ var init_Timeline = __esm({
33763
33805
  }
33764
33806
  });
33765
33807
  function extractToastProps(children) {
33766
- if (!React105__default.isValidElement(children)) {
33808
+ if (!React106__default.isValidElement(children)) {
33767
33809
  if (typeof children === "string") {
33768
33810
  return { message: children };
33769
33811
  }
@@ -33801,7 +33843,7 @@ var init_ToastSlot = __esm({
33801
33843
  eventBus.emit("UI:CLOSE");
33802
33844
  };
33803
33845
  if (!isVisible) return null;
33804
- const isCustomContent = React105__default.isValidElement(children) && !message;
33846
+ const isCustomContent = React106__default.isValidElement(children) && !message;
33805
33847
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
33806
33848
  Toast,
33807
33849
  {
@@ -34070,7 +34112,7 @@ var init_WizardContainer = __esm({
34070
34112
  const isCompleted = index < currentStep;
34071
34113
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
34072
34114
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
34073
- return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
34115
+ return /* @__PURE__ */ jsxs(React106__default.Fragment, { children: [
34074
34116
  /* @__PURE__ */ jsx(
34075
34117
  Button,
34076
34118
  {
@@ -34452,12 +34494,12 @@ var init_WorldMapTemplate = __esm({
34452
34494
  }
34453
34495
  });
34454
34496
  function lazyThree(name, loader) {
34455
- const Lazy = React105__default.lazy(() => loader().then((m) => ({ default: m[name] })));
34497
+ const Lazy = React106__default.lazy(() => loader().then((m) => ({ default: m[name] })));
34456
34498
  function ThreeWrapper(props) {
34457
- return React105__default.createElement(
34458
- React105__default.Suspense,
34499
+ return React106__default.createElement(
34500
+ React106__default.Suspense,
34459
34501
  { fallback: null },
34460
- React105__default.createElement(Lazy, props)
34502
+ React106__default.createElement(Lazy, props)
34461
34503
  );
34462
34504
  }
34463
34505
  ThreeWrapper.displayName = `Lazy(${name})`;
@@ -34945,7 +34987,7 @@ function SuspenseConfigProvider({
34945
34987
  config,
34946
34988
  children
34947
34989
  }) {
34948
- return React105__default.createElement(
34990
+ return React106__default.createElement(
34949
34991
  SuspenseConfigContext.Provider,
34950
34992
  { value: config },
34951
34993
  children
@@ -35428,7 +35470,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
35428
35470
  const key = `${parentId}-${index}-trait:${traitName}`;
35429
35471
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
35430
35472
  }
35431
- return /* @__PURE__ */ jsx(React105__default.Fragment, { children: child }, `${parentId}-${index}`);
35473
+ return /* @__PURE__ */ jsx(React106__default.Fragment, { children: child }, `${parentId}-${index}`);
35432
35474
  }
35433
35475
  if (!child || typeof child !== "object") return null;
35434
35476
  const childId = `${parentId}-${index}`;
@@ -35465,14 +35507,14 @@ function isPatternConfig(value) {
35465
35507
  if (value === null || value === void 0) return false;
35466
35508
  if (typeof value !== "object") return false;
35467
35509
  if (Array.isArray(value)) return false;
35468
- if (React105__default.isValidElement(value)) return false;
35510
+ if (React106__default.isValidElement(value)) return false;
35469
35511
  if (value instanceof Date) return false;
35470
35512
  if (typeof value === "function") return false;
35471
35513
  const record = value;
35472
35514
  return "type" in record && typeof record.type === "string";
35473
35515
  }
35474
35516
  function isPlainConfigObject(value) {
35475
- if (React105__default.isValidElement(value)) return false;
35517
+ if (React106__default.isValidElement(value)) return false;
35476
35518
  if (value instanceof Date) return false;
35477
35519
  const proto = Object.getPrototypeOf(value);
35478
35520
  return proto === Object.prototype || proto === null;