@almadar/ui 5.141.0 → 5.142.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 React86 from 'react';
2
- import React86__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
1
+ import * as React87 from 'react';
2
+ import React87__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
3
3
  import { EventBusContext, useTraitScopeChain, useEntitySchemaOptional, useEntityBindingSnapshot, useTraitScope, TraitScopeProvider, useCurrentPagePath, useGameAudioContextOptional } from '@almadar/ui/providers';
4
4
  import { createLogger, isLogLevelEnabled } from '@almadar/logger';
5
5
  import { createContextFromBindings, interpolateValue } from '@almadar/runtime';
@@ -281,7 +281,7 @@ function resolveMarkerExpression(expression, entity, config, state) {
281
281
  function isPlainObject(value) {
282
282
  if (value === null || value === void 0 || typeof value !== "object") return false;
283
283
  if (Array.isArray(value)) return false;
284
- if (React86__default.isValidElement(value)) return false;
284
+ if (React87__default.isValidElement(value)) return false;
285
285
  if (value instanceof Date) return false;
286
286
  if (typeof value === "function") return false;
287
287
  return true;
@@ -501,7 +501,7 @@ var init_Box = __esm({
501
501
  fixed: "fixed",
502
502
  sticky: "sticky"
503
503
  };
504
- Box = React86__default.forwardRef(
504
+ Box = React87__default.forwardRef(
505
505
  ({
506
506
  padding,
507
507
  paddingX,
@@ -566,7 +566,7 @@ var init_Box = __esm({
566
566
  onPointerDown?.(e);
567
567
  }, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
568
568
  const isClickable = action || onClick;
569
- return React86__default.createElement(
569
+ return React87__default.createElement(
570
570
  Component,
571
571
  {
572
572
  ref,
@@ -783,7 +783,7 @@ var init_Icon = __esm({
783
783
  const effectiveName = typeof icon === "string" && icon !== "" ? icon : name;
784
784
  const effectiveStrokeWidth = strokeWidth != null && strokeWidth > 0 ? strokeWidth : void 0;
785
785
  const family = useIconFamily();
786
- const RenderedComponent = React86__default.useMemo(() => {
786
+ const RenderedComponent = React87__default.useMemo(() => {
787
787
  if (directIcon) return null;
788
788
  return effectiveName ? resolveIconForFamily(effectiveName) : null;
789
789
  }, [directIcon, effectiveName, family]);
@@ -907,7 +907,7 @@ var init_atlasSlice = __esm({
907
907
  }
908
908
  });
909
909
  function useAtlasSliceDataUrl(asset) {
910
- const [, bump] = React86.useReducer((x) => x + 1, 0);
910
+ const [, bump] = React87.useReducer((x) => x + 1, 0);
911
911
  if (!isAtlasAsset(asset)) return void 0;
912
912
  const key = `${asset.atlas}#${asset.sprite}`;
913
913
  const cached = sliceDataUrlCache.get(key);
@@ -970,13 +970,13 @@ function AtlasImage({
970
970
  style,
971
971
  "aria-hidden": ariaHidden
972
972
  }) {
973
- const [, bump] = React86.useReducer((x) => x + 1, 0);
974
- const canvasRef = React86.useRef(null);
973
+ const [, bump] = React87.useReducer((x) => x + 1, 0);
974
+ const canvasRef = React87.useRef(null);
975
975
  const sliced = isAtlasAsset(asset);
976
976
  const atlas = sliced ? getAtlas(asset.atlas, bump) : void 0;
977
977
  const img = sliced && asset?.url ? getSheetImage(asset.url, bump) : null;
978
978
  const rect = sliced && atlas ? subRectFor(atlas, asset.sprite) : null;
979
- React86.useEffect(() => {
979
+ React87.useEffect(() => {
980
980
  const canvas = canvasRef.current;
981
981
  if (!canvas || !img || !rect) return;
982
982
  canvas.width = rect.sw;
@@ -1052,7 +1052,7 @@ function resolveIconProp(value, sizeClass) {
1052
1052
  const IconComp = value;
1053
1053
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
1054
1054
  }
1055
- if (React86__default.isValidElement(value)) {
1055
+ if (React87__default.isValidElement(value)) {
1056
1056
  return value;
1057
1057
  }
1058
1058
  if (typeof value === "object" && value !== null && isIconLike(value)) {
@@ -1129,7 +1129,7 @@ var init_Button = __esm({
1129
1129
  md: "h-icon-default w-icon-default",
1130
1130
  lg: "h-icon-default w-icon-default"
1131
1131
  };
1132
- Button = React86__default.forwardRef(
1132
+ Button = React87__default.forwardRef(
1133
1133
  ({
1134
1134
  className,
1135
1135
  variant = "primary",
@@ -1199,7 +1199,7 @@ var Dialog;
1199
1199
  var init_Dialog = __esm({
1200
1200
  "components/core/atoms/Dialog.tsx"() {
1201
1201
  init_cn();
1202
- Dialog = React86__default.forwardRef(
1202
+ Dialog = React87__default.forwardRef(
1203
1203
  ({
1204
1204
  role = "dialog",
1205
1205
  "aria-modal": ariaModal = true,
@@ -1410,7 +1410,7 @@ var init_Typography = __esm({
1410
1410
  if (format !== void 0 && format !== "none" && (typeof body === "string" || typeof body === "number" || body instanceof Date)) {
1411
1411
  body = formatValue(body, format);
1412
1412
  }
1413
- return React86__default.createElement(
1413
+ return React87__default.createElement(
1414
1414
  Component,
1415
1415
  {
1416
1416
  id,
@@ -1973,7 +1973,7 @@ var init_Badge = __esm({
1973
1973
  md: "px-2.5 py-1 text-sm",
1974
1974
  lg: "px-3 py-1.5 text-base"
1975
1975
  };
1976
- Badge = React86__default.forwardRef(
1976
+ Badge = React87__default.forwardRef(
1977
1977
  ({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
1978
1978
  const iconSizes3 = {
1979
1979
  sm: "h-icon-default w-icon-default",
@@ -2323,7 +2323,7 @@ var init_SvgFlow = __esm({
2323
2323
  width = 100,
2324
2324
  height = 100
2325
2325
  }) => {
2326
- const markerId = React86__default.useMemo(() => {
2326
+ const markerId = React87__default.useMemo(() => {
2327
2327
  flowIdCounter += 1;
2328
2328
  return `almadar-flow-arrow-${flowIdCounter}`;
2329
2329
  }, []);
@@ -2916,7 +2916,7 @@ var init_SvgRing = __esm({
2916
2916
  width = 100,
2917
2917
  height = 100
2918
2918
  }) => {
2919
- const gradientId = React86__default.useMemo(() => {
2919
+ const gradientId = React87__default.useMemo(() => {
2920
2920
  ringIdCounter += 1;
2921
2921
  return `almadar-ring-glow-${ringIdCounter}`;
2922
2922
  }, []);
@@ -3097,7 +3097,7 @@ var init_Input = __esm({
3097
3097
  init_cn();
3098
3098
  init_Icon();
3099
3099
  init_useEventBus();
3100
- Input = React86__default.forwardRef(
3100
+ Input = React87__default.forwardRef(
3101
3101
  ({
3102
3102
  className,
3103
3103
  inputType,
@@ -3121,9 +3121,9 @@ var init_Input = __esm({
3121
3121
  const eventBus = useEventBus();
3122
3122
  const type = inputType || htmlType || "text";
3123
3123
  const isDeclarative = typeof onChange === "string";
3124
- const [localValue, setLocalValue] = React86__default.useState(value);
3125
- const pendingEchoRef = React86__default.useRef(/* @__PURE__ */ new Set());
3126
- React86__default.useEffect(() => {
3124
+ const [localValue, setLocalValue] = React87__default.useState(value);
3125
+ const pendingEchoRef = React87__default.useRef(/* @__PURE__ */ new Set());
3126
+ React87__default.useEffect(() => {
3127
3127
  if (!isDeclarative) return;
3128
3128
  const incoming = value == null ? "" : String(value);
3129
3129
  if (pendingEchoRef.current.has(incoming)) {
@@ -3283,7 +3283,7 @@ var Label;
3283
3283
  var init_Label = __esm({
3284
3284
  "components/core/atoms/Label.tsx"() {
3285
3285
  init_cn();
3286
- Label = React86__default.forwardRef(
3286
+ Label = React87__default.forwardRef(
3287
3287
  ({ className, required, children, ...props }, ref) => {
3288
3288
  return /* @__PURE__ */ jsxs(
3289
3289
  "label",
@@ -3310,7 +3310,7 @@ var init_Textarea = __esm({
3310
3310
  "components/core/atoms/Textarea.tsx"() {
3311
3311
  init_cn();
3312
3312
  init_useEventBus();
3313
- Textarea = React86__default.forwardRef(
3313
+ Textarea = React87__default.forwardRef(
3314
3314
  ({ className, error, onChange, ...props }, ref) => {
3315
3315
  const eventBus = useEventBus();
3316
3316
  const handleChange = (e) => {
@@ -3549,7 +3549,7 @@ var init_Select = __esm({
3549
3549
  init_cn();
3550
3550
  init_Icon();
3551
3551
  init_useEventBus();
3552
- Select = React86__default.forwardRef(
3552
+ Select = React87__default.forwardRef(
3553
3553
  (props, _ref) => {
3554
3554
  const { multiple, searchable, clearable } = props;
3555
3555
  if (multiple || searchable || clearable) {
@@ -3566,7 +3566,7 @@ var init_Checkbox = __esm({
3566
3566
  "components/core/atoms/Checkbox.tsx"() {
3567
3567
  init_cn();
3568
3568
  init_useEventBus();
3569
- Checkbox = React86__default.forwardRef(
3569
+ Checkbox = React87__default.forwardRef(
3570
3570
  ({ className, label, id, onChange, ...props }, ref) => {
3571
3571
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
3572
3572
  const eventBus = useEventBus();
@@ -3620,7 +3620,7 @@ var init_Spinner = __esm({
3620
3620
  md: "h-6 w-6",
3621
3621
  lg: "h-8 w-8"
3622
3622
  };
3623
- Spinner = React86__default.forwardRef(
3623
+ Spinner = React87__default.forwardRef(
3624
3624
  ({ className, size = "md", overlay, ...props }, ref) => {
3625
3625
  if (overlay) {
3626
3626
  return /* @__PURE__ */ jsx(
@@ -3710,7 +3710,7 @@ var init_Card = __esm({
3710
3710
  chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
3711
3711
  "tile-image-first": "p-0 overflow-hidden"
3712
3712
  };
3713
- Card = React86__default.forwardRef(
3713
+ Card = React87__default.forwardRef(
3714
3714
  ({
3715
3715
  className,
3716
3716
  variant = "bordered",
@@ -3759,9 +3759,9 @@ var init_Card = __esm({
3759
3759
  }
3760
3760
  );
3761
3761
  Card.displayName = "Card";
3762
- CardHeader = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
3762
+ CardHeader = React87__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
3763
3763
  CardHeader.displayName = "CardHeader";
3764
- CardTitle = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3764
+ CardTitle = React87__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3765
3765
  "h3",
3766
3766
  {
3767
3767
  ref,
@@ -3774,11 +3774,11 @@ var init_Card = __esm({
3774
3774
  }
3775
3775
  ));
3776
3776
  CardTitle.displayName = "CardTitle";
3777
- CardContent = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
3777
+ CardContent = React87__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
3778
3778
  CardContent.displayName = "CardContent";
3779
3779
  CardBody = CardContent;
3780
3780
  CardBody.displayName = "CardBody";
3781
- CardFooter = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3781
+ CardFooter = React87__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3782
3782
  "div",
3783
3783
  {
3784
3784
  ref,
@@ -3865,7 +3865,7 @@ var init_FilterPill = __esm({
3865
3865
  md: "w-3.5 h-3.5",
3866
3866
  lg: "w-4 h-4"
3867
3867
  };
3868
- FilterPill = React86__default.forwardRef(
3868
+ FilterPill = React87__default.forwardRef(
3869
3869
  ({
3870
3870
  className,
3871
3871
  variant = "default",
@@ -3994,8 +3994,8 @@ var init_Avatar = __esm({
3994
3994
  actionPayload
3995
3995
  }) => {
3996
3996
  const eventBus = useEventBus();
3997
- const [imgFailed, setImgFailed] = React86__default.useState(false);
3998
- React86__default.useEffect(() => {
3997
+ const [imgFailed, setImgFailed] = React87__default.useState(false);
3998
+ React87__default.useEffect(() => {
3999
3999
  setImgFailed(false);
4000
4000
  }, [src]);
4001
4001
  const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
@@ -4108,7 +4108,7 @@ var init_Center = __esm({
4108
4108
  as: Component = "div"
4109
4109
  }) => {
4110
4110
  const mergedStyle = minHeight ? { minHeight, ...style } : style;
4111
- return React86__default.createElement(Component, {
4111
+ return React87__default.createElement(Component, {
4112
4112
  className: cn(
4113
4113
  inline ? "inline-flex" : "flex",
4114
4114
  horizontal && "justify-center",
@@ -4376,7 +4376,7 @@ var init_Radio = __esm({
4376
4376
  md: "w-2.5 h-2.5",
4377
4377
  lg: "w-3 h-3"
4378
4378
  };
4379
- Radio = React86__default.forwardRef(
4379
+ Radio = React87__default.forwardRef(
4380
4380
  ({
4381
4381
  label,
4382
4382
  helperText,
@@ -4393,12 +4393,12 @@ var init_Radio = __esm({
4393
4393
  onChange,
4394
4394
  ...props
4395
4395
  }, ref) => {
4396
- const reactId = React86__default.useId();
4396
+ const reactId = React87__default.useId();
4397
4397
  const baseId = id || `radio-${reactId}`;
4398
4398
  const hasError = !!error;
4399
4399
  const eventBus = useEventBus();
4400
- const [selected, setSelected] = React86__default.useState(value);
4401
- React86__default.useEffect(() => {
4400
+ const [selected, setSelected] = React87__default.useState(value);
4401
+ React87__default.useEffect(() => {
4402
4402
  if (value !== void 0) setSelected(value);
4403
4403
  }, [value]);
4404
4404
  const pick = (next, e) => {
@@ -4580,7 +4580,7 @@ var init_Switch = __esm({
4580
4580
  "components/core/atoms/Switch.tsx"() {
4581
4581
  "use client";
4582
4582
  init_cn();
4583
- Switch = React86.forwardRef(
4583
+ Switch = React87.forwardRef(
4584
4584
  ({
4585
4585
  checked,
4586
4586
  defaultChecked = false,
@@ -4591,10 +4591,10 @@ var init_Switch = __esm({
4591
4591
  name,
4592
4592
  className
4593
4593
  }, ref) => {
4594
- const [isChecked, setIsChecked] = React86.useState(
4594
+ const [isChecked, setIsChecked] = React87.useState(
4595
4595
  checked !== void 0 ? checked : defaultChecked
4596
4596
  );
4597
- React86.useEffect(() => {
4597
+ React87.useEffect(() => {
4598
4598
  if (checked !== void 0) {
4599
4599
  setIsChecked(checked);
4600
4600
  }
@@ -4757,7 +4757,7 @@ var init_Stack = __esm({
4757
4757
  };
4758
4758
  const isHorizontal = direction === "horizontal";
4759
4759
  const directionClass = responsive && isHorizontal ? reverse ? "flex-col-reverse md:flex-row-reverse" : "flex-col md:flex-row" : isHorizontal ? reverse ? "flex-row-reverse" : "flex-row" : reverse ? "flex-col-reverse" : "flex-col";
4760
- return React86__default.createElement(
4760
+ return React87__default.createElement(
4761
4761
  Component,
4762
4762
  {
4763
4763
  className: cn(
@@ -4957,7 +4957,7 @@ var Aside;
4957
4957
  var init_Aside = __esm({
4958
4958
  "components/core/atoms/Aside.tsx"() {
4959
4959
  init_cn();
4960
- Aside = React86__default.forwardRef(
4960
+ Aside = React87__default.forwardRef(
4961
4961
  ({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
4962
4962
  );
4963
4963
  Aside.displayName = "Aside";
@@ -5036,9 +5036,9 @@ var init_LawReferenceTooltip = __esm({
5036
5036
  className
5037
5037
  }) => {
5038
5038
  const { t } = useTranslate();
5039
- const [isVisible, setIsVisible] = React86__default.useState(false);
5040
- const timeoutRef = React86__default.useRef(null);
5041
- const triggerRef = React86__default.useRef(null);
5039
+ const [isVisible, setIsVisible] = React87__default.useState(false);
5040
+ const timeoutRef = React87__default.useRef(null);
5041
+ const triggerRef = React87__default.useRef(null);
5042
5042
  const handleMouseEnter = () => {
5043
5043
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
5044
5044
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -5049,7 +5049,7 @@ var init_LawReferenceTooltip = __esm({
5049
5049
  };
5050
5050
  const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
5051
5051
  const open = isVisible || revealed;
5052
- React86__default.useEffect(() => {
5052
+ React87__default.useEffect(() => {
5053
5053
  return () => {
5054
5054
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
5055
5055
  };
@@ -5259,7 +5259,7 @@ var init_StatusDot = __esm({
5259
5259
  md: "w-2.5 h-2.5",
5260
5260
  lg: "w-3 h-3"
5261
5261
  };
5262
- StatusDot = React86__default.forwardRef(
5262
+ StatusDot = React87__default.forwardRef(
5263
5263
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
5264
5264
  return /* @__PURE__ */ jsx(
5265
5265
  "span",
@@ -5313,7 +5313,7 @@ var init_TrendIndicator = __esm({
5313
5313
  down: "trending-down",
5314
5314
  flat: "arrow-right"
5315
5315
  };
5316
- TrendIndicator = React86__default.forwardRef(
5316
+ TrendIndicator = React87__default.forwardRef(
5317
5317
  ({
5318
5318
  className,
5319
5319
  value,
@@ -5382,7 +5382,7 @@ var init_RangeSlider = __esm({
5382
5382
  md: "w-4 h-4",
5383
5383
  lg: "w-5 h-5"
5384
5384
  };
5385
- RangeSlider = React86__default.forwardRef(
5385
+ RangeSlider = React87__default.forwardRef(
5386
5386
  ({
5387
5387
  className,
5388
5388
  min = 0,
@@ -5993,7 +5993,7 @@ var init_ContentSection = __esm({
5993
5993
  md: "py-16",
5994
5994
  lg: "py-24"
5995
5995
  };
5996
- ContentSection = React86__default.forwardRef(
5996
+ ContentSection = React87__default.forwardRef(
5997
5997
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
5998
5998
  return /* @__PURE__ */ jsx(
5999
5999
  Box,
@@ -6527,7 +6527,7 @@ var init_AnimatedReveal = __esm({
6527
6527
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
6528
6528
  "none": {}
6529
6529
  };
6530
- AnimatedReveal = React86__default.forwardRef(
6530
+ AnimatedReveal = React87__default.forwardRef(
6531
6531
  ({
6532
6532
  trigger = "scroll",
6533
6533
  animation = "fade-up",
@@ -6687,7 +6687,7 @@ var init_AnimatedGraphic = __esm({
6687
6687
  "components/marketing/atoms/AnimatedGraphic.tsx"() {
6688
6688
  "use client";
6689
6689
  init_cn();
6690
- AnimatedGraphic = React86__default.forwardRef(
6690
+ AnimatedGraphic = React87__default.forwardRef(
6691
6691
  ({
6692
6692
  src,
6693
6693
  svgContent,
@@ -6710,7 +6710,7 @@ var init_AnimatedGraphic = __esm({
6710
6710
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
6711
6711
  const resolvedSvg = svgContent ?? fetchedSvg;
6712
6712
  const prevAnimateRef = useRef(animate);
6713
- const setRef = React86__default.useCallback(
6713
+ const setRef = React87__default.useCallback(
6714
6714
  (node) => {
6715
6715
  containerRef.current = node;
6716
6716
  if (typeof ref === "function") ref(node);
@@ -7438,9 +7438,9 @@ function ControlButton({
7438
7438
  className
7439
7439
  }) {
7440
7440
  const eventBus = useEventBus();
7441
- const [isPressed, setIsPressed] = React86.useState(false);
7441
+ const [isPressed, setIsPressed] = React87.useState(false);
7442
7442
  const actualPressed = pressed ?? isPressed;
7443
- const handlePointerDown = React86.useCallback(
7443
+ const handlePointerDown = React87.useCallback(
7444
7444
  (e) => {
7445
7445
  e.preventDefault();
7446
7446
  if (disabled) return;
@@ -7450,7 +7450,7 @@ function ControlButton({
7450
7450
  },
7451
7451
  [disabled, pressEvent, eventBus, onPress]
7452
7452
  );
7453
- const handlePointerUp = React86.useCallback(
7453
+ const handlePointerUp = React87.useCallback(
7454
7454
  (e) => {
7455
7455
  e.preventDefault();
7456
7456
  if (disabled) return;
@@ -7460,7 +7460,7 @@ function ControlButton({
7460
7460
  },
7461
7461
  [disabled, releaseEvent, eventBus, onRelease]
7462
7462
  );
7463
- const handlePointerLeave = React86.useCallback(
7463
+ const handlePointerLeave = React87.useCallback(
7464
7464
  (e) => {
7465
7465
  if (isPressed) {
7466
7466
  setIsPressed(false);
@@ -7718,8 +7718,8 @@ function ControlGrid({
7718
7718
  className
7719
7719
  }) {
7720
7720
  const eventBus = useEventBus();
7721
- const [active, setActive] = React86.useState(/* @__PURE__ */ new Set());
7722
- const handlePress = React86.useCallback(
7721
+ const [active, setActive] = React87.useState(/* @__PURE__ */ new Set());
7722
+ const handlePress = React87.useCallback(
7723
7723
  (id) => {
7724
7724
  setActive((prev) => new Set(prev).add(id));
7725
7725
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -7733,7 +7733,7 @@ function ControlGrid({
7733
7733
  },
7734
7734
  [kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
7735
7735
  );
7736
- const handleRelease = React86.useCallback(
7736
+ const handleRelease = React87.useCallback(
7737
7737
  (id) => {
7738
7738
  setActive((prev) => {
7739
7739
  const next = new Set(prev);
@@ -8091,7 +8091,7 @@ function GameMenu({
8091
8091
  }) {
8092
8092
  const resolvedOptions = (options?.length ? options : void 0) ?? (menuItems?.length ? menuItems : void 0) ?? DEFAULT_MENU_OPTIONS;
8093
8093
  const eventBus = useEventBus();
8094
- const handleOptionClick = React86.useCallback(
8094
+ const handleOptionClick = React87.useCallback(
8095
8095
  (option) => {
8096
8096
  if (option.event) {
8097
8097
  eventBus.emit(`UI:${option.event}`, { option });
@@ -8327,7 +8327,7 @@ function StateGraph({
8327
8327
  }) {
8328
8328
  const eventBus = useEventBus();
8329
8329
  const nodes = states ?? [];
8330
- const positions = React86.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
8330
+ const positions = React87.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
8331
8331
  return /* @__PURE__ */ jsxs(
8332
8332
  Box,
8333
8333
  {
@@ -8398,8 +8398,8 @@ function MiniMap({
8398
8398
  tileAssets,
8399
8399
  unitAssets
8400
8400
  }) {
8401
- const canvasRef = React86.useRef(null);
8402
- const imgCacheRef = React86.useRef(/* @__PURE__ */ new Map());
8401
+ const canvasRef = React87.useRef(null);
8402
+ const imgCacheRef = React87.useRef(/* @__PURE__ */ new Map());
8403
8403
  function loadImg(url) {
8404
8404
  const cached = imgCacheRef.current.get(url);
8405
8405
  if (cached) return cached.complete ? cached : null;
@@ -8415,7 +8415,7 @@ function MiniMap({
8415
8415
  imgCacheRef.current.set(url, img);
8416
8416
  return null;
8417
8417
  }
8418
- React86.useEffect(() => {
8418
+ React87.useEffect(() => {
8419
8419
  const canvas = canvasRef.current;
8420
8420
  if (!canvas) return;
8421
8421
  const ctx = canvas.getContext("2d");
@@ -9596,7 +9596,7 @@ function Canvas2D({
9596
9596
  const registerChildDrawable = useCallback((node) => {
9597
9597
  childDrawablesRef.current.push(node);
9598
9598
  }, []);
9599
- const hasJsxChildren = React86.Children.count(children) > 0;
9599
+ const hasJsxChildren = React87.Children.count(children) > 0;
9600
9600
  function isDrawableLayer(node) {
9601
9601
  return node.type === "draw-sprite-layer" || node.type === "draw-shape-layer" || node.type === "draw-text-layer";
9602
9602
  }
@@ -10125,6 +10125,8 @@ function Canvas({
10125
10125
  showCoordinates,
10126
10126
  showTileInfo,
10127
10127
  fogOfWar,
10128
+ lighting,
10129
+ post,
10128
10130
  tileClickEvent,
10129
10131
  unitClickEvent,
10130
10132
  tileHoverEvent,
@@ -10136,10 +10138,25 @@ function Canvas({
10136
10138
  }) {
10137
10139
  canvasLog.debug("Canvas render", { mode, drawablesCount: drawables?.length, projection, camera: camera ? JSON.stringify(camera) : void 0 });
10138
10140
  const zoom = camera?.zoom;
10141
+ const childDrawablesRef = useRef([]);
10142
+ if (mode === "3d") childDrawablesRef.current = [];
10143
+ const registerChildDrawable = useCallback((node) => {
10144
+ childDrawablesRef.current.push(node);
10145
+ }, []);
10146
+ const [childDrawables, setChildDrawables] = useState([]);
10147
+ useEffect(() => {
10148
+ if (mode !== "3d") return;
10149
+ const next = childDrawablesRef.current;
10150
+ canvasLog.debug("children:adopt", { registered: next.length, adopted: childDrawables.length });
10151
+ if (next.length === 0 && React87.Children.count(children) > 0) return;
10152
+ setChildDrawables(
10153
+ (prev) => prev.length === next.length && JSON.stringify(prev) === JSON.stringify(next) ? prev : [...next]
10154
+ );
10155
+ });
10139
10156
  if (mode === "3d") {
10140
10157
  const props3d = {
10141
10158
  className,
10142
- drawables,
10159
+ drawables: [...drawables ?? [], ...childDrawables],
10143
10160
  isLoading,
10144
10161
  cameraMode: to3DCameraMode(camera?.mode),
10145
10162
  ...zoom !== void 0 ? { scale: zoom } : {},
@@ -10155,6 +10172,8 @@ function Canvas({
10155
10172
  showCoordinates,
10156
10173
  showTileInfo,
10157
10174
  fogOfWar,
10175
+ lighting,
10176
+ post,
10158
10177
  tileClickEvent,
10159
10178
  unitClickEvent,
10160
10179
  tileHoverEvent,
@@ -10163,7 +10182,10 @@ function Canvas({
10163
10182
  keyMap,
10164
10183
  keyUpMap
10165
10184
  };
10166
- return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(Canvas3DHost, { ...props3d }) });
10185
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
10186
+ /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(Canvas3DHost, { ...props3d }) }),
10187
+ React87.Children.count(children) > 0 && /* @__PURE__ */ jsx(DrawableRegistryContext.Provider, { value: registerChildDrawable, children: /* @__PURE__ */ jsx("div", { "aria-hidden": "true", style: { position: "absolute", width: 0, height: 0, overflow: "hidden" }, children }) })
10188
+ ] });
10167
10189
  }
10168
10190
  return /* @__PURE__ */ jsx(
10169
10191
  Canvas2D,
@@ -10195,6 +10217,7 @@ var Canvas3DHost, canvasLog;
10195
10217
  var init_Canvas = __esm({
10196
10218
  "components/game/molecules/Canvas.tsx"() {
10197
10219
  "use client";
10220
+ init_registry();
10198
10221
  init_Canvas2D();
10199
10222
  Canvas3DHost = lazy(
10200
10223
  () => import('@almadar/ui/components/molecules/game/three').then((m) => ({ default: m.Canvas3DHost }))
@@ -10586,7 +10609,7 @@ function LinearView({
10586
10609
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
10587
10610
  const isDone = i < currentIdx;
10588
10611
  const isCurrent = i === currentIdx;
10589
- return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
10612
+ return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
10590
10613
  i > 0 && /* @__PURE__ */ jsx(
10591
10614
  Typography,
10592
10615
  {
@@ -11121,7 +11144,7 @@ function SequenceBar({
11121
11144
  else onSlotRemove?.(index);
11122
11145
  }, [emit, slotRemoveEvent, onSlotRemove, playing]);
11123
11146
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
11124
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
11147
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
11125
11148
  i > 0 && /* @__PURE__ */ jsx(
11126
11149
  Typography,
11127
11150
  {
@@ -11770,7 +11793,7 @@ var init_ErrorBoundary = __esm({
11770
11793
  }
11771
11794
  );
11772
11795
  };
11773
- ErrorBoundary = class extends React86__default.Component {
11796
+ ErrorBoundary = class extends React87__default.Component {
11774
11797
  constructor(props) {
11775
11798
  super(props);
11776
11799
  __publicField(this, "reset", () => {
@@ -12422,7 +12445,7 @@ var init_Container = __esm({
12422
12445
  as: Component = "div"
12423
12446
  }) => {
12424
12447
  const resolvedSize = maxWidth ?? size ?? "lg";
12425
- return React86__default.createElement(
12448
+ return React87__default.createElement(
12426
12449
  Component,
12427
12450
  {
12428
12451
  className: cn(
@@ -15387,7 +15410,7 @@ var init_CodeBlock = __esm({
15387
15410
  DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
15388
15411
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
15389
15412
  HIDDEN_LINE_NUMBERS = { display: "none" };
15390
- CodeBlock = React86__default.memo(
15413
+ CodeBlock = React87__default.memo(
15391
15414
  ({
15392
15415
  code: rawCode,
15393
15416
  language = "text",
@@ -15975,7 +15998,7 @@ var init_MarkdownContent = __esm({
15975
15998
  init_Box();
15976
15999
  init_CodeBlock();
15977
16000
  init_cn();
15978
- MarkdownContent = React86__default.memo(
16001
+ MarkdownContent = React87__default.memo(
15979
16002
  ({ content, direction = "ltr", className }) => {
15980
16003
  const { t: _t } = useTranslate();
15981
16004
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -17302,7 +17325,7 @@ var init_StateMachineView = __esm({
17302
17325
  style: { top: title ? 30 : 0 },
17303
17326
  children: [
17304
17327
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
17305
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React86__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
17328
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React87__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
17306
17329
  StateNode2,
17307
17330
  {
17308
17331
  state,
@@ -23124,8 +23147,8 @@ var init_Menu = __esm({
23124
23147
  "bottom-end": "bottom-start"
23125
23148
  };
23126
23149
  const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
23127
- const triggerChild = React86__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
23128
- const triggerElement = React86__default.cloneElement(
23150
+ const triggerChild = React87__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
23151
+ const triggerElement = React87__default.cloneElement(
23129
23152
  triggerChild,
23130
23153
  {
23131
23154
  ref: triggerRef,
@@ -23220,14 +23243,14 @@ function useDataDnd(args) {
23220
23243
  const isZone = Boolean(dragGroup || accepts || sortable);
23221
23244
  const enabled = isZone || Boolean(dndRoot);
23222
23245
  const eventBus = useEventBus();
23223
- const parentRoot = React86__default.useContext(RootCtx);
23246
+ const parentRoot = React87__default.useContext(RootCtx);
23224
23247
  const isRoot = enabled && parentRoot === null;
23225
- const zoneId = React86__default.useId();
23248
+ const zoneId = React87__default.useId();
23226
23249
  const ownGroup = dragGroup ?? accepts ?? zoneId;
23227
- const [optimisticOrders, setOptimisticOrders] = React86__default.useState(() => /* @__PURE__ */ new Map());
23228
- const optimisticOrdersRef = React86__default.useRef(optimisticOrders);
23250
+ const [optimisticOrders, setOptimisticOrders] = React87__default.useState(() => /* @__PURE__ */ new Map());
23251
+ const optimisticOrdersRef = React87__default.useRef(optimisticOrders);
23229
23252
  optimisticOrdersRef.current = optimisticOrders;
23230
- const clearOptimisticOrder = React86__default.useCallback((group) => {
23253
+ const clearOptimisticOrder = React87__default.useCallback((group) => {
23231
23254
  setOptimisticOrders((prev) => {
23232
23255
  if (!prev.has(group)) return prev;
23233
23256
  const next = new Map(prev);
@@ -23252,7 +23275,7 @@ function useDataDnd(args) {
23252
23275
  const raw = it[dndItemIdField];
23253
23276
  return raw != null ? String(raw) : `__idx_${idx}`;
23254
23277
  }).join("|");
23255
- const itemIds = React86__default.useMemo(
23278
+ const itemIds = React87__default.useMemo(
23256
23279
  () => orderedItems.map((it, idx) => {
23257
23280
  const raw = it[dndItemIdField];
23258
23281
  return raw != null ? String(raw) : `__idx_${idx}`;
@@ -23263,7 +23286,7 @@ function useDataDnd(args) {
23263
23286
  const raw = it[dndItemIdField];
23264
23287
  return raw != null ? String(raw) : `__${idx}`;
23265
23288
  }).join("|");
23266
- React86__default.useEffect(() => {
23289
+ React87__default.useEffect(() => {
23267
23290
  const root = isRoot ? null : parentRoot;
23268
23291
  if (root) {
23269
23292
  root.clearOptimisticOrder(ownGroup);
@@ -23271,20 +23294,20 @@ function useDataDnd(args) {
23271
23294
  clearOptimisticOrder(ownGroup);
23272
23295
  }
23273
23296
  }, [itemsContentSig, ownGroup]);
23274
- const zonesRef = React86__default.useRef(/* @__PURE__ */ new Map());
23275
- const registerZone = React86__default.useCallback((zoneId2, meta2) => {
23297
+ const zonesRef = React87__default.useRef(/* @__PURE__ */ new Map());
23298
+ const registerZone = React87__default.useCallback((zoneId2, meta2) => {
23276
23299
  zonesRef.current.set(zoneId2, meta2);
23277
23300
  }, []);
23278
- const unregisterZone = React86__default.useCallback((zoneId2) => {
23301
+ const unregisterZone = React87__default.useCallback((zoneId2) => {
23279
23302
  zonesRef.current.delete(zoneId2);
23280
23303
  }, []);
23281
- const [activeDrag, setActiveDrag] = React86__default.useState(null);
23282
- const [overZoneGroup, setOverZoneGroup] = React86__default.useState(null);
23283
- const meta = React86__default.useMemo(
23304
+ const [activeDrag, setActiveDrag] = React87__default.useState(null);
23305
+ const [overZoneGroup, setOverZoneGroup] = React87__default.useState(null);
23306
+ const meta = React87__default.useMemo(
23284
23307
  () => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
23285
23308
  [ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
23286
23309
  );
23287
- React86__default.useEffect(() => {
23310
+ React87__default.useEffect(() => {
23288
23311
  const target = isRoot ? null : parentRoot;
23289
23312
  if (!target) {
23290
23313
  zonesRef.current.set(zoneId, meta);
@@ -23303,7 +23326,7 @@ function useDataDnd(args) {
23303
23326
  }, [parentRoot, isRoot, zoneId, meta]);
23304
23327
  const sensors = useAlmadarDndSensors(true);
23305
23328
  const collisionDetection = almadarDndCollisionDetection;
23306
- const findZoneByItem = React86__default.useCallback(
23329
+ const findZoneByItem = React87__default.useCallback(
23307
23330
  (id) => {
23308
23331
  for (const z of zonesRef.current.values()) {
23309
23332
  if (z.itemIds.includes(id)) return z;
@@ -23312,7 +23335,7 @@ function useDataDnd(args) {
23312
23335
  },
23313
23336
  []
23314
23337
  );
23315
- React86__default.useCallback(
23338
+ React87__default.useCallback(
23316
23339
  (group) => {
23317
23340
  for (const z of zonesRef.current.values()) {
23318
23341
  if (z.group === group) return z;
@@ -23321,7 +23344,7 @@ function useDataDnd(args) {
23321
23344
  },
23322
23345
  []
23323
23346
  );
23324
- const handleDragEnd = React86__default.useCallback(
23347
+ const handleDragEnd = React87__default.useCallback(
23325
23348
  (event) => {
23326
23349
  const { active, over } = event;
23327
23350
  const activeIdStr = String(active.id);
@@ -23412,8 +23435,8 @@ function useDataDnd(args) {
23412
23435
  },
23413
23436
  [eventBus]
23414
23437
  );
23415
- const sortableData = React86__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
23416
- const SortableItem = React86__default.useCallback(
23438
+ const sortableData = React87__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
23439
+ const SortableItem = React87__default.useCallback(
23417
23440
  ({ id, children }) => {
23418
23441
  const {
23419
23442
  attributes,
@@ -23453,7 +23476,7 @@ function useDataDnd(args) {
23453
23476
  id: droppableId,
23454
23477
  data: sortableData
23455
23478
  });
23456
- const ctx = React86__default.useContext(RootCtx);
23479
+ const ctx = React87__default.useContext(RootCtx);
23457
23480
  const activeDrag2 = ctx?.activeDrag ?? null;
23458
23481
  const overZoneGroup2 = ctx?.overZoneGroup ?? null;
23459
23482
  const isThisZoneOver = overZoneGroup2 === ownGroup;
@@ -23468,7 +23491,7 @@ function useDataDnd(args) {
23468
23491
  showForeignPlaceholder,
23469
23492
  ctxAvailable: ctx != null
23470
23493
  });
23471
- React86__default.useEffect(() => {
23494
+ React87__default.useEffect(() => {
23472
23495
  dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
23473
23496
  }, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
23474
23497
  return /* @__PURE__ */ jsx(
@@ -23482,11 +23505,11 @@ function useDataDnd(args) {
23482
23505
  }
23483
23506
  );
23484
23507
  };
23485
- const rootContextValue = React86__default.useMemo(
23508
+ const rootContextValue = React87__default.useMemo(
23486
23509
  () => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
23487
23510
  [registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
23488
23511
  );
23489
- const handleDragStart = React86__default.useCallback((event) => {
23512
+ const handleDragStart = React87__default.useCallback((event) => {
23490
23513
  const sourceZone = findZoneByItem(event.active.id);
23491
23514
  const rect = event.active.rect.current.initial;
23492
23515
  const height = rect?.height && rect.height > 0 ? rect.height : 64;
@@ -23505,7 +23528,7 @@ function useDataDnd(args) {
23505
23528
  isRoot
23506
23529
  });
23507
23530
  }, [findZoneByItem, isRoot, zoneId]);
23508
- const handleDragOver = React86__default.useCallback((event) => {
23531
+ const handleDragOver = React87__default.useCallback((event) => {
23509
23532
  const { active, over } = event;
23510
23533
  const overData = over?.data?.current;
23511
23534
  const overGroup = overData?.dndGroup ?? null;
@@ -23575,7 +23598,7 @@ function useDataDnd(args) {
23575
23598
  return next;
23576
23599
  });
23577
23600
  }, []);
23578
- const handleDragCancel = React86__default.useCallback((event) => {
23601
+ const handleDragCancel = React87__default.useCallback((event) => {
23579
23602
  setActiveDrag(null);
23580
23603
  setOverZoneGroup(null);
23581
23604
  dndLog.warn("dragCancel", {
@@ -23583,12 +23606,12 @@ function useDataDnd(args) {
23583
23606
  reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
23584
23607
  });
23585
23608
  }, []);
23586
- const handleDragEndWithCleanup = React86__default.useCallback((event) => {
23609
+ const handleDragEndWithCleanup = React87__default.useCallback((event) => {
23587
23610
  handleDragEnd(event);
23588
23611
  setActiveDrag(null);
23589
23612
  setOverZoneGroup(null);
23590
23613
  }, [handleDragEnd]);
23591
- const wrapContainer = React86__default.useCallback(
23614
+ const wrapContainer = React87__default.useCallback(
23592
23615
  (children) => {
23593
23616
  if (!enabled) return children;
23594
23617
  const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
@@ -23642,7 +23665,7 @@ var init_useDataDnd = __esm({
23642
23665
  init_useAlmadarDndCollision();
23643
23666
  init_Box();
23644
23667
  dndLog = createLogger("almadar:ui:dnd");
23645
- RootCtx = React86__default.createContext(null);
23668
+ RootCtx = React87__default.createContext(null);
23646
23669
  }
23647
23670
  });
23648
23671
  function renderIconInput(icon, props) {
@@ -24184,7 +24207,7 @@ function DataList({
24184
24207
  }) {
24185
24208
  const eventBus = useEventBus();
24186
24209
  const { t } = useTranslate();
24187
- const [visibleCount, setVisibleCount] = React86__default.useState(pageSize || Infinity);
24210
+ const [visibleCount, setVisibleCount] = React87__default.useState(pageSize || Infinity);
24188
24211
  const fieldDefs = fields ?? columns ?? [];
24189
24212
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
24190
24213
  const dnd = useDataDnd({
@@ -24200,14 +24223,14 @@ function DataList({
24200
24223
  dndRoot
24201
24224
  });
24202
24225
  const orderedData = dnd.orderedItems;
24203
- const allData = React86__default.useMemo(
24226
+ const allData = React87__default.useMemo(
24204
24227
  () => sortRows(orderedData, sortBy, sortDirection),
24205
24228
  [orderedData, sortBy, sortDirection]
24206
24229
  );
24207
24230
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
24208
24231
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
24209
24232
  const hasRenderProp = typeof children === "function";
24210
- React86__default.useEffect(() => {
24233
+ React87__default.useEffect(() => {
24211
24234
  const renderItemTypeOf = typeof schemaRenderItem;
24212
24235
  const childrenTypeOf = typeof children;
24213
24236
  if (data.length > 0 && !hasRenderProp) {
@@ -24322,7 +24345,7 @@ function DataList({
24322
24345
  return v === void 0 || v === null || v === "" ? raw : String(v);
24323
24346
  };
24324
24347
  return /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: cn("py-2", className), children: [
24325
- groups2.map((group, gi) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
24348
+ groups2.map((group, gi) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
24326
24349
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
24327
24350
  group.items.map((itemData, index) => {
24328
24351
  const id = itemData.id || `${gi}-${index}`;
@@ -24521,7 +24544,7 @@ function DataList({
24521
24544
  className
24522
24545
  ),
24523
24546
  children: [
24524
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
24547
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
24525
24548
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
24526
24549
  group.items.map(
24527
24550
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -24608,7 +24631,7 @@ var init_FormSection = __esm({
24608
24631
  columns = 1,
24609
24632
  className
24610
24633
  }) => {
24611
- const [collapsed, setCollapsed] = React86__default.useState(defaultCollapsed);
24634
+ const [collapsed, setCollapsed] = React87__default.useState(defaultCollapsed);
24612
24635
  const { t } = useTranslate();
24613
24636
  const eventBus = useEventBus();
24614
24637
  const gridClass = {
@@ -24616,7 +24639,7 @@ var init_FormSection = __esm({
24616
24639
  2: "grid-cols-1 md:grid-cols-2",
24617
24640
  3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
24618
24641
  }[columns];
24619
- React86__default.useCallback(() => {
24642
+ React87__default.useCallback(() => {
24620
24643
  if (collapsible) {
24621
24644
  setCollapsed((prev) => !prev);
24622
24645
  eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
@@ -25661,7 +25684,7 @@ var init_Flex = __esm({
25661
25684
  flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
25662
25685
  }
25663
25686
  }
25664
- return React86__default.createElement(Component, {
25687
+ return React87__default.createElement(Component, {
25665
25688
  className: cn(
25666
25689
  inline ? "inline-flex" : "flex",
25667
25690
  directionStyles[direction],
@@ -25780,7 +25803,7 @@ var init_Grid = __esm({
25780
25803
  as: Component = "div"
25781
25804
  }) => {
25782
25805
  const mergedStyle = rows ? { gridTemplateRows: `repeat(${rows}, minmax(0, 1fr))`, ...style } : style;
25783
- return React86__default.createElement(
25806
+ return React87__default.createElement(
25784
25807
  Component,
25785
25808
  {
25786
25809
  className: cn(
@@ -26012,9 +26035,9 @@ var init_Popover = __esm({
26012
26035
  onMouseLeave: handleClose,
26013
26036
  onPointerDown: tapTriggerProps.onPointerDown
26014
26037
  };
26015
- const childElement = React86__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
26038
+ const childElement = React87__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
26016
26039
  const childPointerDown = childElement.props.onPointerDown;
26017
- const triggerElement = React86__default.cloneElement(
26040
+ const triggerElement = React87__default.cloneElement(
26018
26041
  childElement,
26019
26042
  {
26020
26043
  ref: triggerRef,
@@ -26623,9 +26646,9 @@ var init_Tooltip = __esm({
26623
26646
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
26624
26647
  };
26625
26648
  }, []);
26626
- const triggerElement = React86__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
26649
+ const triggerElement = React87__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
26627
26650
  const childPointerDown = triggerElement.props.onPointerDown;
26628
- const trigger = React86__default.cloneElement(triggerElement, {
26651
+ const trigger = React87__default.cloneElement(triggerElement, {
26629
26652
  ref: triggerRef,
26630
26653
  onMouseEnter: handleMouseEnter,
26631
26654
  onMouseLeave: handleMouseLeave,
@@ -26715,7 +26738,7 @@ var init_WizardProgress = __esm({
26715
26738
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
26716
26739
  const isActive = index === currentStep;
26717
26740
  const isCompleted = index < currentStep;
26718
- return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
26741
+ return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
26719
26742
  /* @__PURE__ */ jsx(
26720
26743
  "button",
26721
26744
  {
@@ -28350,13 +28373,13 @@ var init_MapView = __esm({
28350
28373
  shadowSize: [41, 41]
28351
28374
  });
28352
28375
  L.Marker.prototype.options.icon = defaultIcon;
28353
- const { useEffect: useEffect62, useRef: useRef61, useCallback: useCallback95, useState: useState93 } = React86__default;
28376
+ const { useEffect: useEffect63, useRef: useRef62, useCallback: useCallback96, useState: useState94 } = React87__default;
28354
28377
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
28355
28378
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
28356
28379
  function MapUpdater({ centerLat, centerLng, zoom }) {
28357
28380
  const map = useMap();
28358
- const prevRef = useRef61({ centerLat, centerLng, zoom });
28359
- useEffect62(() => {
28381
+ const prevRef = useRef62({ centerLat, centerLng, zoom });
28382
+ useEffect63(() => {
28360
28383
  const prev = prevRef.current;
28361
28384
  if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
28362
28385
  map.setView([centerLat, centerLng], zoom);
@@ -28367,7 +28390,7 @@ var init_MapView = __esm({
28367
28390
  }
28368
28391
  function MapClickHandler({ onMapClick }) {
28369
28392
  const map = useMap();
28370
- useEffect62(() => {
28393
+ useEffect63(() => {
28371
28394
  if (!onMapClick) return;
28372
28395
  const handler = (e) => {
28373
28396
  onMapClick(e.latlng.lat, e.latlng.lng);
@@ -28395,8 +28418,8 @@ var init_MapView = __esm({
28395
28418
  showAttribution = true
28396
28419
  }) {
28397
28420
  const eventBus = useEventBus2();
28398
- const [clickedPosition, setClickedPosition] = useState93(null);
28399
- const handleMapClick = useCallback95((lat, lng) => {
28421
+ const [clickedPosition, setClickedPosition] = useState94(null);
28422
+ const handleMapClick = useCallback96((lat, lng) => {
28400
28423
  if (showClickedPin) {
28401
28424
  setClickedPosition({ lat, lng });
28402
28425
  }
@@ -28405,7 +28428,7 @@ var init_MapView = __esm({
28405
28428
  eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
28406
28429
  }
28407
28430
  }, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
28408
- const handleMarkerClick = useCallback95((marker) => {
28431
+ const handleMarkerClick = useCallback96((marker) => {
28409
28432
  onMarkerClick?.(marker);
28410
28433
  if (markerClickEvent) {
28411
28434
  eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
@@ -29268,8 +29291,8 @@ function TableView({
29268
29291
  }) {
29269
29292
  const eventBus = useEventBus();
29270
29293
  const { t } = useTranslate();
29271
- const [visibleCount, setVisibleCount] = React86__default.useState(pageSize > 0 ? pageSize : Infinity);
29272
- const [localSelected, setLocalSelected] = React86__default.useState(/* @__PURE__ */ new Set());
29294
+ const [visibleCount, setVisibleCount] = React87__default.useState(pageSize > 0 ? pageSize : Infinity);
29295
+ const [localSelected, setLocalSelected] = React87__default.useState(/* @__PURE__ */ new Set());
29273
29296
  const colDefs = (Array.isArray(columns) ? columns : void 0) ?? (Array.isArray(fields) ? fields : void 0) ?? [];
29274
29297
  const actionDefs = Array.isArray(itemActions) ? itemActions : [];
29275
29298
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
@@ -29291,7 +29314,7 @@ function TableView({
29291
29314
  const hasRenderProp = typeof children === "function";
29292
29315
  const idField = dndItemIdField ?? "id";
29293
29316
  const isCoarsePointer = useMediaQuery("(pointer: coarse)");
29294
- React86__default.useEffect(() => {
29317
+ React87__default.useEffect(() => {
29295
29318
  tableViewLog.debug("render", {
29296
29319
  rowCount: data.length,
29297
29320
  colCount: colDefs.length,
@@ -29348,7 +29371,7 @@ function TableView({
29348
29371
  };
29349
29372
  eventBus.emit(`UI:${itemClickEvent}`, payload);
29350
29373
  };
29351
- const colFloors = React86__default.useMemo(
29374
+ const colFloors = React87__default.useMemo(
29352
29375
  () => colDefs.map((col) => {
29353
29376
  const longest = data.reduce((widest, row) => {
29354
29377
  const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
@@ -29510,12 +29533,12 @@ function TableView({
29510
29533
  ]
29511
29534
  }
29512
29535
  );
29513
- return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React86__default.Fragment, { children: rowInner }, id);
29536
+ return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React87__default.Fragment, { children: rowInner }, id);
29514
29537
  };
29515
29538
  const items = Array.from(data);
29516
29539
  const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
29517
29540
  let runningIndex = 0;
29518
- const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
29541
+ const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
29519
29542
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
29520
29543
  group.items.map((row) => renderRow(row, runningIndex++))
29521
29544
  ] }, gi)) });
@@ -30878,7 +30901,7 @@ var init_StepFlow = __esm({
30878
30901
  className
30879
30902
  }) => {
30880
30903
  if (orientation === "vertical") {
30881
- return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React86__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
30904
+ return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React87__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
30882
30905
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
30883
30906
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
30884
30907
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -30889,7 +30912,7 @@ var init_StepFlow = __esm({
30889
30912
  ] })
30890
30913
  ] }) }, index)) });
30891
30914
  }
30892
- return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
30915
+ return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
30893
30916
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
30894
30917
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
30895
30918
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -31879,7 +31902,7 @@ var init_LikertScale = __esm({
31879
31902
  md: "text-base",
31880
31903
  lg: "text-lg"
31881
31904
  };
31882
- LikertScale = React86__default.forwardRef(
31905
+ LikertScale = React87__default.forwardRef(
31883
31906
  ({
31884
31907
  question,
31885
31908
  options = DEFAULT_LIKERT_OPTIONS,
@@ -31891,7 +31914,7 @@ var init_LikertScale = __esm({
31891
31914
  variant = "radios",
31892
31915
  className
31893
31916
  }, ref) => {
31894
- const groupId = React86__default.useId();
31917
+ const groupId = React87__default.useId();
31895
31918
  const eventBus = useEventBus();
31896
31919
  const handleSelect = useCallback(
31897
31920
  (next) => {
@@ -34180,7 +34203,7 @@ var init_DocBreadcrumb = __esm({
34180
34203
  "aria-label": t("aria.breadcrumb"),
34181
34204
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
34182
34205
  const isLast = idx === items.length - 1;
34183
- return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
34206
+ return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
34184
34207
  idx > 0 && /* @__PURE__ */ jsx(
34185
34208
  Icon,
34186
34209
  {
@@ -35049,7 +35072,7 @@ var init_MiniStateMachine = __esm({
35049
35072
  const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
35050
35073
  const tc = transitionCounts[s.name] ?? 0;
35051
35074
  const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
35052
- return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
35075
+ return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
35053
35076
  /* @__PURE__ */ jsx(
35054
35077
  AvlState,
35055
35078
  {
@@ -35253,7 +35276,7 @@ var init_PageHeader = __esm({
35253
35276
  info: "bg-info/10 text-info"
35254
35277
  };
35255
35278
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
35256
- 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(React86__default.Fragment, { children: [
35279
+ 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(React87__default.Fragment, { children: [
35257
35280
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
35258
35281
  crumb.href ? /* @__PURE__ */ jsx(
35259
35282
  "a",
@@ -35611,7 +35634,7 @@ var init_Section = __esm({
35611
35634
  as: Component = "section"
35612
35635
  }) => {
35613
35636
  const hasHeader = title || description || action;
35614
- return React86__default.createElement(
35637
+ return React87__default.createElement(
35615
35638
  Component,
35616
35639
  {
35617
35640
  className: cn(
@@ -35985,7 +36008,7 @@ var init_WizardContainer = __esm({
35985
36008
  const isCompleted = index < currentStep;
35986
36009
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
35987
36010
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
35988
- return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
36011
+ return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
35989
36012
  /* @__PURE__ */ jsx(
35990
36013
  Button,
35991
36014
  {
@@ -37772,7 +37795,7 @@ var init_ImportPreviewTree = __esm({
37772
37795
  const renderUnit = (unit, childrenByParent, depth) => {
37773
37796
  const summary = fieldSummary(unit);
37774
37797
  const children = childrenByParent.get(unit.ref) ?? [];
37775
- return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
37798
+ return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
37776
37799
  /* @__PURE__ */ jsxs(
37777
37800
  Box,
37778
37801
  {
@@ -37869,7 +37892,7 @@ var init_ImportProgress = __esm({
37869
37892
  PIPELINE.map((key, index) => {
37870
37893
  const isComplete = index < currentIndex;
37871
37894
  const isActive = index === currentIndex;
37872
- return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
37895
+ return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
37873
37896
  index > 0 ? /* @__PURE__ */ jsx(Box, { className: "h-px w-4 bg-border" }) : null,
37874
37897
  /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-1", "data-testid": `import-progress-step-${key}`, children: [
37875
37898
  /* @__PURE__ */ jsx(
@@ -38994,7 +39017,7 @@ var init_DrawMesh = __esm({
38994
39017
  }
38995
39018
  });
38996
39019
  function extractTitle(children) {
38997
- if (!React86__default.isValidElement(children)) return void 0;
39020
+ if (!React87__default.isValidElement(children)) return void 0;
38998
39021
  const props = children.props;
38999
39022
  if (typeof props.title === "string") {
39000
39023
  return props.title;
@@ -39344,12 +39367,12 @@ var init_Form = __esm({
39344
39367
  const isSchemaEntity = isOrbitalEntitySchema(entity);
39345
39368
  const resolvedEntity = isSchemaEntity ? entity : void 0;
39346
39369
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
39347
- const normalizedInitialData = React86__default.useMemo(() => {
39370
+ const normalizedInitialData = React87__default.useMemo(() => {
39348
39371
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
39349
39372
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
39350
39373
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
39351
39374
  }, [entity, initialData]);
39352
- const entityDerivedFields = React86__default.useMemo(() => {
39375
+ const entityDerivedFields = React87__default.useMemo(() => {
39353
39376
  if (fields && fields.length > 0) return void 0;
39354
39377
  if (!resolvedEntity) return void 0;
39355
39378
  return resolvedEntity.fields.map(
@@ -39370,16 +39393,16 @@ var init_Form = __esm({
39370
39393
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
39371
39394
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
39372
39395
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
39373
- const [formData, setFormData] = React86__default.useState(
39396
+ const [formData, setFormData] = React87__default.useState(
39374
39397
  normalizedInitialData
39375
39398
  );
39376
- const [collapsedSections, setCollapsedSections] = React86__default.useState(
39399
+ const [collapsedSections, setCollapsedSections] = React87__default.useState(
39377
39400
  /* @__PURE__ */ new Set()
39378
39401
  );
39379
- const [submitError, setSubmitError] = React86__default.useState(null);
39380
- const formRef = React86__default.useRef(null);
39402
+ const [submitError, setSubmitError] = React87__default.useState(null);
39403
+ const formRef = React87__default.useRef(null);
39381
39404
  const formMode = props.mode;
39382
- const mountedRef = React86__default.useRef(false);
39405
+ const mountedRef = React87__default.useRef(false);
39383
39406
  if (!mountedRef.current) {
39384
39407
  mountedRef.current = true;
39385
39408
  debug("forms", "mount", {
@@ -39392,7 +39415,7 @@ var init_Form = __esm({
39392
39415
  });
39393
39416
  }
39394
39417
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
39395
- const evalContext = React86__default.useMemo(
39418
+ const evalContext = React87__default.useMemo(
39396
39419
  () => ({
39397
39420
  formValues: formData,
39398
39421
  globalVariables: externalContext?.globalVariables ?? {},
@@ -39401,7 +39424,7 @@ var init_Form = __esm({
39401
39424
  }),
39402
39425
  [formData, externalContext]
39403
39426
  );
39404
- React86__default.useEffect(() => {
39427
+ React87__default.useEffect(() => {
39405
39428
  debug("forms", "initialData-sync", {
39406
39429
  mode: formMode,
39407
39430
  normalizedInitialData,
@@ -39412,7 +39435,7 @@ var init_Form = __esm({
39412
39435
  setFormData(normalizedInitialData);
39413
39436
  }
39414
39437
  }, [normalizedInitialData]);
39415
- const processCalculations = React86__default.useCallback(
39438
+ const processCalculations = React87__default.useCallback(
39416
39439
  (changedFieldId, newFormData) => {
39417
39440
  if (!hiddenCalculations.length) return;
39418
39441
  const context = {
@@ -39437,7 +39460,7 @@ var init_Form = __esm({
39437
39460
  },
39438
39461
  [hiddenCalculations, externalContext, eventBus]
39439
39462
  );
39440
- const checkViolations = React86__default.useCallback(
39463
+ const checkViolations = React87__default.useCallback(
39441
39464
  (changedFieldId, newFormData) => {
39442
39465
  if (!violationTriggers.length) return;
39443
39466
  const context = {
@@ -39475,7 +39498,7 @@ var init_Form = __esm({
39475
39498
  processCalculations(name, newFormData);
39476
39499
  checkViolations(name, newFormData);
39477
39500
  };
39478
- const isFieldVisible = React86__default.useCallback(
39501
+ const isFieldVisible = React87__default.useCallback(
39479
39502
  (fieldName) => {
39480
39503
  const condition = conditionalFields[fieldName];
39481
39504
  if (!condition) return true;
@@ -39483,7 +39506,7 @@ var init_Form = __esm({
39483
39506
  },
39484
39507
  [conditionalFields, evalContext]
39485
39508
  );
39486
- const isSectionVisible = React86__default.useCallback(
39509
+ const isSectionVisible = React87__default.useCallback(
39487
39510
  (section) => {
39488
39511
  if (!section.condition) return true;
39489
39512
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -39559,7 +39582,7 @@ var init_Form = __esm({
39559
39582
  eventBus.emit(`UI:${onCancel}`);
39560
39583
  }
39561
39584
  };
39562
- const renderField = React86__default.useCallback(
39585
+ const renderField = React87__default.useCallback(
39563
39586
  (field) => {
39564
39587
  const fieldName = field.name || field.field;
39565
39588
  if (!fieldName) return null;
@@ -39580,7 +39603,7 @@ var init_Form = __esm({
39580
39603
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
39581
39604
  );
39582
39605
  const effectiveFields = entityDerivedFields ?? fields;
39583
- const normalizedFields = React86__default.useMemo(() => {
39606
+ const normalizedFields = React87__default.useMemo(() => {
39584
39607
  if (!effectiveFields || effectiveFields.length === 0) return [];
39585
39608
  return effectiveFields.map((field) => {
39586
39609
  if (typeof field === "string") {
@@ -39604,7 +39627,7 @@ var init_Form = __esm({
39604
39627
  return field;
39605
39628
  });
39606
39629
  }, [effectiveFields, resolvedEntity]);
39607
- const schemaFields = React86__default.useMemo(() => {
39630
+ const schemaFields = React87__default.useMemo(() => {
39608
39631
  if (normalizedFields.length === 0) return null;
39609
39632
  if (isDebugEnabled()) {
39610
39633
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -39614,7 +39637,7 @@ var init_Form = __esm({
39614
39637
  }
39615
39638
  return normalizedFields.map(renderField).filter(Boolean);
39616
39639
  }, [normalizedFields, renderField, entityName, conditionalFields]);
39617
- const sectionElements = React86__default.useMemo(() => {
39640
+ const sectionElements = React87__default.useMemo(() => {
39618
39641
  if (!sections || sections.length === 0) return null;
39619
39642
  return sections.map((section) => {
39620
39643
  if (!isSectionVisible(section)) {
@@ -40340,7 +40363,7 @@ var init_List = __esm({
40340
40363
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
40341
40364
  return [];
40342
40365
  }, [entity]);
40343
- const getItemActions = React86__default.useCallback(
40366
+ const getItemActions = React87__default.useCallback(
40344
40367
  (item) => {
40345
40368
  if (!itemActions) return [];
40346
40369
  if (typeof itemActions === "function") {
@@ -40821,7 +40844,7 @@ var init_MediaGallery = __esm({
40821
40844
  [selectable, selectedItems, selectionEvent, eventBus]
40822
40845
  );
40823
40846
  const entityData = Array.isArray(entity) ? entity : [];
40824
- const items = React86__default.useMemo(() => {
40847
+ const items = React87__default.useMemo(() => {
40825
40848
  if (propItems && propItems.length > 0) return propItems;
40826
40849
  if (entityData.length === 0) return [];
40827
40850
  return entityData.map((record, idx) => {
@@ -40986,7 +41009,7 @@ var init_MediaGallery = __esm({
40986
41009
  }
40987
41010
  });
40988
41011
  function extractTitle2(children) {
40989
- if (!React86__default.isValidElement(children)) return void 0;
41012
+ if (!React87__default.isValidElement(children)) return void 0;
40990
41013
  const props = children.props;
40991
41014
  if (typeof props.title === "string") {
40992
41015
  return props.title;
@@ -41241,7 +41264,7 @@ var init_debugRegistry = __esm({
41241
41264
  }
41242
41265
  });
41243
41266
  function useDebugData() {
41244
- const [data, setData] = React86.useState(() => ({
41267
+ const [data, setData] = React87.useState(() => ({
41245
41268
  traits: [],
41246
41269
  ticks: [],
41247
41270
  guards: [],
@@ -41255,7 +41278,7 @@ function useDebugData() {
41255
41278
  },
41256
41279
  lastUpdate: Date.now()
41257
41280
  }));
41258
- React86.useEffect(() => {
41281
+ React87.useEffect(() => {
41259
41282
  const updateData = () => {
41260
41283
  setData({
41261
41284
  traits: getAllTraits(),
@@ -41364,12 +41387,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
41364
41387
  return positions;
41365
41388
  }
41366
41389
  function WalkMinimap() {
41367
- const [walkStep, setWalkStep] = React86.useState(null);
41368
- const [traits2, setTraits] = React86.useState([]);
41369
- const [coveredEdges, setCoveredEdges] = React86.useState([]);
41370
- const [completedTraits, setCompletedTraits] = React86.useState(/* @__PURE__ */ new Set());
41371
- const prevTraitRef = React86.useRef(null);
41372
- React86.useEffect(() => {
41390
+ const [walkStep, setWalkStep] = React87.useState(null);
41391
+ const [traits2, setTraits] = React87.useState([]);
41392
+ const [coveredEdges, setCoveredEdges] = React87.useState([]);
41393
+ const [completedTraits, setCompletedTraits] = React87.useState(/* @__PURE__ */ new Set());
41394
+ const prevTraitRef = React87.useRef(null);
41395
+ React87.useEffect(() => {
41373
41396
  const interval = setInterval(() => {
41374
41397
  const w = window;
41375
41398
  const step = w.__orbitalWalkStep;
@@ -41805,15 +41828,15 @@ var init_EntitiesTab = __esm({
41805
41828
  });
41806
41829
  function EventFlowTab({ events: events2 }) {
41807
41830
  const { t } = useTranslate();
41808
- const [filter, setFilter] = React86.useState("all");
41809
- const containerRef = React86.useRef(null);
41810
- const [autoScroll, setAutoScroll] = React86.useState(true);
41811
- React86.useEffect(() => {
41831
+ const [filter, setFilter] = React87.useState("all");
41832
+ const containerRef = React87.useRef(null);
41833
+ const [autoScroll, setAutoScroll] = React87.useState(true);
41834
+ React87.useEffect(() => {
41812
41835
  if (autoScroll && containerRef.current) {
41813
41836
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
41814
41837
  }
41815
41838
  }, [events2.length, autoScroll]);
41816
- const filteredEvents = React86.useMemo(() => {
41839
+ const filteredEvents = React87.useMemo(() => {
41817
41840
  if (filter === "all") return events2;
41818
41841
  return events2.filter((e) => e.type === filter);
41819
41842
  }, [events2, filter]);
@@ -41929,7 +41952,7 @@ var init_EventFlowTab = __esm({
41929
41952
  });
41930
41953
  function GuardsPanel({ guards }) {
41931
41954
  const { t } = useTranslate();
41932
- const [filter, setFilter] = React86.useState("all");
41955
+ const [filter, setFilter] = React87.useState("all");
41933
41956
  if (guards.length === 0) {
41934
41957
  return /* @__PURE__ */ jsx(
41935
41958
  EmptyState,
@@ -41942,7 +41965,7 @@ function GuardsPanel({ guards }) {
41942
41965
  }
41943
41966
  const passedCount = guards.filter((g) => g.result).length;
41944
41967
  const failedCount = guards.length - passedCount;
41945
- const filteredGuards = React86.useMemo(() => {
41968
+ const filteredGuards = React87.useMemo(() => {
41946
41969
  if (filter === "all") return guards;
41947
41970
  if (filter === "passed") return guards.filter((g) => g.result);
41948
41971
  return guards.filter((g) => !g.result);
@@ -42105,10 +42128,10 @@ function EffectBadge({ effect }) {
42105
42128
  }
42106
42129
  function TransitionTimeline({ transitions }) {
42107
42130
  const { t } = useTranslate();
42108
- const containerRef = React86.useRef(null);
42109
- const [autoScroll, setAutoScroll] = React86.useState(true);
42110
- const [expandedId, setExpandedId] = React86.useState(null);
42111
- React86.useEffect(() => {
42131
+ const containerRef = React87.useRef(null);
42132
+ const [autoScroll, setAutoScroll] = React87.useState(true);
42133
+ const [expandedId, setExpandedId] = React87.useState(null);
42134
+ React87.useEffect(() => {
42112
42135
  if (autoScroll && containerRef.current) {
42113
42136
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
42114
42137
  }
@@ -42388,9 +42411,9 @@ function getAllEvents(traits2) {
42388
42411
  function EventDispatcherTab({ traits: traits2, schema }) {
42389
42412
  const eventBus = useEventBus();
42390
42413
  const { t } = useTranslate();
42391
- const [log13, setLog] = React86.useState([]);
42392
- const prevStatesRef = React86.useRef(/* @__PURE__ */ new Map());
42393
- React86.useEffect(() => {
42414
+ const [log13, setLog] = React87.useState([]);
42415
+ const prevStatesRef = React87.useRef(/* @__PURE__ */ new Map());
42416
+ React87.useEffect(() => {
42394
42417
  for (const trait of traits2) {
42395
42418
  const prev = prevStatesRef.current.get(trait.id);
42396
42419
  if (prev && prev !== trait.currentState) {
@@ -42559,10 +42582,10 @@ function VerifyModePanel({
42559
42582
  localCount
42560
42583
  }) {
42561
42584
  const { t } = useTranslate();
42562
- const [expanded, setExpanded] = React86.useState(true);
42563
- const scrollRef = React86.useRef(null);
42564
- const prevCountRef = React86.useRef(0);
42565
- React86.useEffect(() => {
42585
+ const [expanded, setExpanded] = React87.useState(true);
42586
+ const scrollRef = React87.useRef(null);
42587
+ const prevCountRef = React87.useRef(0);
42588
+ React87.useEffect(() => {
42566
42589
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
42567
42590
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
42568
42591
  }
@@ -42619,10 +42642,10 @@ function RuntimeDebugger({
42619
42642
  schema
42620
42643
  }) {
42621
42644
  const { t } = useTranslate();
42622
- const [isCollapsed, setIsCollapsed] = React86.useState(mode === "verify" ? true : defaultCollapsed);
42623
- const [isVisible, setIsVisible] = React86.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
42645
+ const [isCollapsed, setIsCollapsed] = React87.useState(mode === "verify" ? true : defaultCollapsed);
42646
+ const [isVisible, setIsVisible] = React87.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
42624
42647
  const debugData = useDebugData();
42625
- React86.useEffect(() => {
42648
+ React87.useEffect(() => {
42626
42649
  if (mode === "inline") return;
42627
42650
  return onDebugToggle((enabled) => {
42628
42651
  setIsVisible(enabled);
@@ -42631,7 +42654,7 @@ function RuntimeDebugger({
42631
42654
  }
42632
42655
  });
42633
42656
  }, [mode]);
42634
- React86.useEffect(() => {
42657
+ React87.useEffect(() => {
42635
42658
  if (mode === "inline") return;
42636
42659
  const handleKeyDown = (e) => {
42637
42660
  if (e.key === "`" && isVisible) {
@@ -43151,7 +43174,7 @@ var init_StatCard = __esm({
43151
43174
  const labelToUse = propLabel ?? propTitle;
43152
43175
  const eventBus = useEventBus();
43153
43176
  const { t } = useTranslate();
43154
- const handleActionClick = React86__default.useCallback(() => {
43177
+ const handleActionClick = React87__default.useCallback(() => {
43155
43178
  if (action?.event) {
43156
43179
  eventBus.emit(`UI:${action.event}`, {});
43157
43180
  }
@@ -43162,7 +43185,7 @@ var init_StatCard = __esm({
43162
43185
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
43163
43186
  const isLoading = externalLoading ?? false;
43164
43187
  const error = externalError;
43165
- const computeMetricValue = React86__default.useCallback(
43188
+ const computeMetricValue = React87__default.useCallback(
43166
43189
  (metric, items) => {
43167
43190
  if (metric.value !== void 0) {
43168
43191
  return metric.value;
@@ -43201,7 +43224,7 @@ var init_StatCard = __esm({
43201
43224
  },
43202
43225
  []
43203
43226
  );
43204
- const schemaStats = React86__default.useMemo(() => {
43227
+ const schemaStats = React87__default.useMemo(() => {
43205
43228
  if (!metrics || metrics.length === 0) return null;
43206
43229
  return metrics.map((metric) => ({
43207
43230
  label: metric.label,
@@ -43209,7 +43232,7 @@ var init_StatCard = __esm({
43209
43232
  format: metric.format
43210
43233
  }));
43211
43234
  }, [metrics, data, computeMetricValue]);
43212
- const calculatedTrend = React86__default.useMemo(() => {
43235
+ const calculatedTrend = React87__default.useMemo(() => {
43213
43236
  if (manualTrend !== void 0) return manualTrend;
43214
43237
  if (previousValue === void 0 || currentValue === void 0)
43215
43238
  return void 0;
@@ -43849,8 +43872,8 @@ var init_SubagentTracePanel = __esm({
43849
43872
  ] });
43850
43873
  };
43851
43874
  InlineActivityStream = ({ activities, autoScroll = true, className }) => {
43852
- const endRef = React86__default.useRef(null);
43853
- React86__default.useEffect(() => {
43875
+ const endRef = React87__default.useRef(null);
43876
+ React87__default.useEffect(() => {
43854
43877
  if (!autoScroll) return;
43855
43878
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
43856
43879
  }, [activities.length, autoScroll]);
@@ -43944,7 +43967,7 @@ var init_SubagentTracePanel = __esm({
43944
43967
  };
43945
43968
  SubagentRichCard = ({ subagent }) => {
43946
43969
  const { t } = useTranslate();
43947
- const activities = React86__default.useMemo(
43970
+ const activities = React87__default.useMemo(
43948
43971
  () => subagentMessagesToActivities(subagent.messages),
43949
43972
  [subagent.messages]
43950
43973
  );
@@ -44021,8 +44044,8 @@ var init_SubagentTracePanel = __esm({
44021
44044
  ] });
44022
44045
  };
44023
44046
  CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
44024
- const endRef = React86__default.useRef(null);
44025
- React86__default.useEffect(() => {
44047
+ const endRef = React87__default.useRef(null);
44048
+ React87__default.useEffect(() => {
44026
44049
  if (!autoScroll) return;
44027
44050
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
44028
44051
  }, [messages.length, autoScroll]);
@@ -44457,7 +44480,7 @@ var init_Timeline = __esm({
44457
44480
  }) => {
44458
44481
  const { t } = useTranslate();
44459
44482
  const entityData = entity ?? [];
44460
- const items = React86__default.useMemo(() => {
44483
+ const items = React87__default.useMemo(() => {
44461
44484
  if (propItems) return propItems;
44462
44485
  if (entityData.length === 0) return [];
44463
44486
  return entityData.map((record, idx) => {
@@ -44559,7 +44582,7 @@ var init_Timeline = __esm({
44559
44582
  }
44560
44583
  });
44561
44584
  function extractToastProps(children) {
44562
- if (!React86__default.isValidElement(children)) {
44585
+ if (!React87__default.isValidElement(children)) {
44563
44586
  if (typeof children === "string") {
44564
44587
  return { message: children };
44565
44588
  }
@@ -44601,7 +44624,7 @@ var init_ToastSlot = __esm({
44601
44624
  eventBus.emit(`${prefix}CLOSE`);
44602
44625
  };
44603
44626
  if (!isVisible) return null;
44604
- const isCustomContent = React86__default.isValidElement(children) && !message;
44627
+ const isCustomContent = React87__default.isValidElement(children) && !message;
44605
44628
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
44606
44629
  Toast,
44607
44630
  {
@@ -45176,7 +45199,7 @@ function SuspenseConfigProvider({
45176
45199
  config,
45177
45200
  children
45178
45201
  }) {
45179
- return React86__default.createElement(
45202
+ return React87__default.createElement(
45180
45203
  SuspenseConfigContext.Provider,
45181
45204
  { value: config },
45182
45205
  children
@@ -45218,7 +45241,7 @@ function enrichFormFields(fields, entityDef) {
45218
45241
  }
45219
45242
  return { name: field, label: humanizeFieldName(field) };
45220
45243
  }
45221
- if (field && typeof field === "object" && !Array.isArray(field) && !React86__default.isValidElement(field) && !(field instanceof Date)) {
45244
+ if (field && typeof field === "object" && !Array.isArray(field) && !React87__default.isValidElement(field) && !(field instanceof Date)) {
45222
45245
  const obj = field;
45223
45246
  const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
45224
45247
  if (!fieldName) return field;
@@ -45690,7 +45713,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
45690
45713
  const key = `${parentId}-${index}-trait:${traitName}`;
45691
45714
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
45692
45715
  }
45693
- return /* @__PURE__ */ jsx(React86__default.Fragment, { children: child }, `${parentId}-${index}`);
45716
+ return /* @__PURE__ */ jsx(React87__default.Fragment, { children: child }, `${parentId}-${index}`);
45694
45717
  }
45695
45718
  if (!child || typeof child !== "object") return null;
45696
45719
  const childId = `${parentId}-${index}`;
@@ -45747,14 +45770,14 @@ function isPatternConfig(value) {
45747
45770
  if (value === null || value === void 0) return false;
45748
45771
  if (typeof value !== "object") return false;
45749
45772
  if (Array.isArray(value)) return false;
45750
- if (React86__default.isValidElement(value)) return false;
45773
+ if (React87__default.isValidElement(value)) return false;
45751
45774
  if (value instanceof Date) return false;
45752
45775
  if (typeof value === "function") return false;
45753
45776
  const record = value;
45754
45777
  return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
45755
45778
  }
45756
45779
  function isPlainConfigObject(value) {
45757
- if (React86__default.isValidElement(value)) return false;
45780
+ if (React87__default.isValidElement(value)) return false;
45758
45781
  if (value instanceof Date) return false;
45759
45782
  const proto = Object.getPrototypeOf(value);
45760
45783
  return proto === Object.prototype || proto === null;
@@ -45895,7 +45918,7 @@ function SlotContentRenderer({
45895
45918
  for (const slotKey of CONTENT_NODE_SLOTS) {
45896
45919
  const slotVal = restProps[slotKey];
45897
45920
  if (slotVal === void 0 || slotVal === null) continue;
45898
- if (React86__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
45921
+ if (React87__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
45899
45922
  const typelessChildren = !Array.isArray(slotVal) && typeof slotVal === "object" && !("type" in slotVal) && Array.isArray(slotVal.children) ? slotVal.children : void 0;
45900
45923
  if (typelessChildren !== void 0 || Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
45901
45924
  nodeSlotOverrides[slotKey] = renderPatternChildren(
@@ -45949,7 +45972,7 @@ function SlotContentRenderer({
45949
45972
  const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
45950
45973
  if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
45951
45974
  const sample = resolvedItems[0];
45952
- if (sample && typeof sample === "object" && !Array.isArray(sample) && !React86__default.isValidElement(sample) && !(sample instanceof Date)) {
45975
+ if (sample && typeof sample === "object" && !Array.isArray(sample) && !React87__default.isValidElement(sample) && !(sample instanceof Date)) {
45953
45976
  const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
45954
45977
  finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
45955
45978
  }