@almadar/ui 5.70.0 → 5.71.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.
Files changed (55) hide show
  1. package/dist/avl/index.cjs +1953 -1802
  2. package/dist/avl/index.d.cts +93 -56
  3. package/dist/avl/index.js +677 -526
  4. package/dist/components/avl/molecules/AvlEventWireEdge.d.ts +2 -1
  5. package/dist/components/avl/molecules/AvlTransitionEdge.d.ts +2 -1
  6. package/dist/components/avl/molecules/avl-behavior-compose-converter.d.ts +7 -5
  7. package/dist/components/avl/molecules/avl-behavior-compose-types.d.ts +41 -21
  8. package/dist/components/avl/molecules/avl-canvas-types.d.ts +10 -7
  9. package/dist/components/avl/molecules/avl-preview-converter.d.ts +5 -5
  10. package/dist/components/avl/molecules/avl-preview-types.d.ts +15 -4
  11. package/dist/components/avl/organisms/FlowCanvas.d.ts +2 -2
  12. package/dist/components/avl/organisms/avl-schema-parser.d.ts +18 -16
  13. package/dist/components/core/atoms/Button.d.ts +2 -0
  14. package/dist/components/core/atoms/ConditionalWrapper.d.ts +5 -4
  15. package/dist/components/core/molecules/Carousel.d.ts +2 -2
  16. package/dist/components/core/molecules/OrbitalVisualization.d.ts +4 -3
  17. package/dist/components/core/molecules/PageHeader.d.ts +3 -3
  18. package/dist/components/core/molecules/RepeatableFormSection.d.ts +4 -3
  19. package/dist/components/core/molecules/ViolationAlert.d.ts +2 -0
  20. package/dist/components/core/molecules/WizardContainer.d.ts +23 -22
  21. package/dist/components/core/organisms/CardGrid.d.ts +2 -2
  22. package/dist/components/core/organisms/CustomPattern.d.ts +3 -4
  23. package/dist/components/core/organisms/DataTable.d.ts +2 -2
  24. package/dist/components/core/organisms/DetailPanel.d.ts +1 -1
  25. package/dist/components/core/organisms/Form.d.ts +11 -11
  26. package/dist/components/core/organisms/List.d.ts +3 -5
  27. package/dist/components/core/organisms/StatCard.d.ts +2 -2
  28. package/dist/components/core/organisms/book/types.d.ts +1 -1
  29. package/dist/components/core/organisms/debug/RuntimeDebugger.d.ts +2 -1
  30. package/dist/components/core/organisms/debug/tabs/EventDispatcherTab.d.ts +2 -1
  31. package/dist/components/core/organisms/layout/DashboardGrid.d.ts +0 -2
  32. package/dist/components/core/organisms/types.d.ts +3 -2
  33. package/dist/components/game/atoms/ScoreDisplay.d.ts +3 -1
  34. package/dist/components/game/molecules/three/hooks/useSceneGraph.d.ts +2 -1
  35. package/dist/components/game/molecules/three/index.cjs +37 -24
  36. package/dist/components/game/molecules/three/index.js +37 -24
  37. package/dist/components/game/organisms/PinballBoard.d.ts +4 -4
  38. package/dist/components/game/organisms/boardEntity.d.ts +6 -6
  39. package/dist/components/game/organisms/puzzles/debugger/DebuggerBoard.d.ts +16 -2
  40. package/dist/components/game/organisms/puzzles/event-handler/puzzleObject.d.ts +21 -10
  41. package/dist/components/game/organisms/puzzles/state-architect/StateJsonView.d.ts +2 -1
  42. package/dist/components/index.cjs +1690 -1562
  43. package/dist/components/index.js +569 -441
  44. package/dist/docs/index.cjs +107 -104
  45. package/dist/docs/index.d.cts +2 -0
  46. package/dist/docs/index.js +38 -35
  47. package/dist/lib/getNestedValue.d.ts +2 -13
  48. package/dist/marketing/index.cjs +97 -98
  49. package/dist/marketing/index.d.cts +2 -0
  50. package/dist/marketing/index.js +54 -55
  51. package/dist/providers/index.cjs +1663 -1535
  52. package/dist/providers/index.js +554 -426
  53. package/dist/runtime/index.cjs +1721 -1593
  54. package/dist/runtime/index.js +560 -432
  55. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import * as React86 from 'react';
2
- import React86__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useLayoutEffect, lazy, useId, useSyncExternalStore, forwardRef, useImperativeHandle, Component } from 'react';
1
+ import * as React90 from 'react';
2
+ import React90__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useLayoutEffect, lazy, useId, useSyncExternalStore, forwardRef, useImperativeHandle, Component } from 'react';
3
3
  import { EventBusContext, useTraitScope, TraitScopeProvider } from '@almadar/ui/providers';
4
4
  import { createLogger, isLogLevelEnabled } from '@almadar/logger';
5
5
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -403,7 +403,7 @@ var init_Box = __esm({
403
403
  fixed: "fixed",
404
404
  sticky: "sticky"
405
405
  };
406
- Box = React86__default.forwardRef(
406
+ Box = React90__default.forwardRef(
407
407
  ({
408
408
  padding,
409
409
  paddingX,
@@ -468,7 +468,7 @@ var init_Box = __esm({
468
468
  onPointerDown?.(e);
469
469
  }, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
470
470
  const isClickable = action || onClick;
471
- return React86__default.createElement(
471
+ return React90__default.createElement(
472
472
  Component2,
473
473
  {
474
474
  ref,
@@ -564,7 +564,7 @@ function loadLib(key, importer) {
564
564
  return p2;
565
565
  }
566
566
  function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
567
- const Lazy = React86__default.lazy(async () => {
567
+ const Lazy = React90__default.lazy(async () => {
568
568
  const lib = await loadLib(libKey, importer);
569
569
  const Comp = pick(lib);
570
570
  if (!Comp) {
@@ -574,7 +574,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
574
574
  return { default: Comp };
575
575
  });
576
576
  const Wrapped = (props) => /* @__PURE__ */ jsx(
577
- React86__default.Suspense,
577
+ React90__default.Suspense,
578
578
  {
579
579
  fallback: /* @__PURE__ */ jsx(
580
580
  "span",
@@ -1242,9 +1242,10 @@ function resolveIcon(name) {
1242
1242
  function doResolve(name) {
1243
1243
  if (iconAliases[name]) return iconAliases[name];
1244
1244
  const pascalName = kebabToPascal2(name);
1245
- const directLookup = LucideIcons2[pascalName];
1245
+ const lucideMap = LucideIcons2;
1246
+ const directLookup = lucideMap[pascalName];
1246
1247
  if (directLookup && typeof directLookup === "object") return directLookup;
1247
- const asIs = LucideIcons2[name];
1248
+ const asIs = lucideMap[name];
1248
1249
  if (asIs && typeof asIs === "object") return asIs;
1249
1250
  return LucideIcons2.HelpCircle;
1250
1251
  }
@@ -1300,7 +1301,7 @@ var init_Icon = __esm({
1300
1301
  const directIcon = typeof icon === "string" ? void 0 : icon;
1301
1302
  const effectiveName = typeof icon === "string" ? icon : name;
1302
1303
  const family = useIconFamily();
1303
- const RenderedComponent = React86__default.useMemo(() => {
1304
+ const RenderedComponent = React90__default.useMemo(() => {
1304
1305
  if (directIcon) return null;
1305
1306
  return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
1306
1307
  }, [directIcon, effectiveName, family]);
@@ -1350,6 +1351,9 @@ var init_Icon = __esm({
1350
1351
  Icon.displayName = "Icon";
1351
1352
  }
1352
1353
  });
1354
+ function isIconLike(v) {
1355
+ return typeof v.render === "function";
1356
+ }
1353
1357
  function resolveIconProp(value, sizeClass) {
1354
1358
  if (!value) return null;
1355
1359
  if (typeof value === "string") {
@@ -1359,10 +1363,10 @@ function resolveIconProp(value, sizeClass) {
1359
1363
  const IconComp = value;
1360
1364
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
1361
1365
  }
1362
- if (React86__default.isValidElement(value)) {
1366
+ if (React90__default.isValidElement(value)) {
1363
1367
  return value;
1364
1368
  }
1365
- if (typeof value === "object" && value !== null && "render" in value) {
1369
+ if (typeof value === "object" && value !== null && isIconLike(value)) {
1366
1370
  const IconComp = value;
1367
1371
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
1368
1372
  }
@@ -1435,7 +1439,7 @@ var init_Button = __esm({
1435
1439
  md: "h-icon-default w-icon-default",
1436
1440
  lg: "h-icon-default w-icon-default"
1437
1441
  };
1438
- Button = React86__default.forwardRef(
1442
+ Button = React90__default.forwardRef(
1439
1443
  ({
1440
1444
  className,
1441
1445
  variant = "primary",
@@ -1451,6 +1455,7 @@ var init_Button = __esm({
1451
1455
  label,
1452
1456
  children,
1453
1457
  onClick,
1458
+ "data-testid": dataTestId,
1454
1459
  ...props
1455
1460
  }, ref) => {
1456
1461
  const eventBus = useEventBus();
@@ -1483,7 +1488,7 @@ var init_Button = __esm({
1483
1488
  ),
1484
1489
  onClick: handleClick,
1485
1490
  ...props,
1486
- "data-testid": props["data-testid"] ?? (action ? `action-${action}` : void 0),
1491
+ "data-testid": dataTestId ?? (action ? `action-${action}` : void 0),
1487
1492
  children: [
1488
1493
  isLoading ? /* @__PURE__ */ jsx(Loader2, { className: "h-icon-default w-icon-default animate-spin" }) : resolvedLeftIcon && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: resolvedLeftIcon }),
1489
1494
  children || label,
@@ -1500,7 +1505,7 @@ var Dialog;
1500
1505
  var init_Dialog = __esm({
1501
1506
  "components/core/atoms/Dialog.tsx"() {
1502
1507
  init_cn();
1503
- Dialog = React86__default.forwardRef(
1508
+ Dialog = React90__default.forwardRef(
1504
1509
  ({
1505
1510
  role = "dialog",
1506
1511
  "aria-modal": ariaModal = true,
@@ -1618,9 +1623,8 @@ var init_Typography = __esm({
1618
1623
  }) => {
1619
1624
  const variant = variantProp ?? (level ? `h${level}` : "body1");
1620
1625
  const Component2 = as || defaultElements[variant];
1621
- const Comp = Component2;
1622
- return /* @__PURE__ */ jsx(
1623
- Comp,
1626
+ return React90__default.createElement(
1627
+ Component2,
1624
1628
  {
1625
1629
  id,
1626
1630
  className: cn(
@@ -1633,9 +1637,9 @@ var init_Typography = __esm({
1633
1637
  overflow && overflowStyles2[overflow],
1634
1638
  className
1635
1639
  ),
1636
- style,
1637
- children: children ?? content
1638
- }
1640
+ style
1641
+ },
1642
+ children ?? content
1639
1643
  );
1640
1644
  };
1641
1645
  Typography.displayName = "Typography";
@@ -2114,7 +2118,7 @@ var init_Badge = __esm({
2114
2118
  md: "px-2.5 py-1 text-sm",
2115
2119
  lg: "px-3 py-1.5 text-base"
2116
2120
  };
2117
- Badge = React86__default.forwardRef(
2121
+ Badge = React90__default.forwardRef(
2118
2122
  ({ className, variant = "default", size = "sm", amount, label, icon, children, onRemove, removeLabel, ...props }, ref) => {
2119
2123
  const iconSizes3 = {
2120
2124
  sm: "h-icon-default w-icon-default",
@@ -2450,7 +2454,7 @@ var init_SvgFlow = __esm({
2450
2454
  width = 100,
2451
2455
  height = 100
2452
2456
  }) => {
2453
- const markerId = React86__default.useMemo(() => {
2457
+ const markerId = React90__default.useMemo(() => {
2454
2458
  flowIdCounter += 1;
2455
2459
  return `almadar-flow-arrow-${flowIdCounter}`;
2456
2460
  }, []);
@@ -3043,7 +3047,7 @@ var init_SvgRing = __esm({
3043
3047
  width = 100,
3044
3048
  height = 100
3045
3049
  }) => {
3046
- const gradientId = React86__default.useMemo(() => {
3050
+ const gradientId = React90__default.useMemo(() => {
3047
3051
  ringIdCounter += 1;
3048
3052
  return `almadar-ring-glow-${ringIdCounter}`;
3049
3053
  }, []);
@@ -3224,7 +3228,7 @@ var init_Input = __esm({
3224
3228
  init_cn();
3225
3229
  init_Icon();
3226
3230
  init_useEventBus();
3227
- Input = React86__default.forwardRef(
3231
+ Input = React90__default.forwardRef(
3228
3232
  ({
3229
3233
  className,
3230
3234
  inputType,
@@ -3384,7 +3388,7 @@ var Label;
3384
3388
  var init_Label = __esm({
3385
3389
  "components/core/atoms/Label.tsx"() {
3386
3390
  init_cn();
3387
- Label = React86__default.forwardRef(
3391
+ Label = React90__default.forwardRef(
3388
3392
  ({ className, required, children, ...props }, ref) => {
3389
3393
  return /* @__PURE__ */ jsxs(
3390
3394
  "label",
@@ -3411,7 +3415,7 @@ var init_Textarea = __esm({
3411
3415
  "components/core/atoms/Textarea.tsx"() {
3412
3416
  init_cn();
3413
3417
  init_useEventBus();
3414
- Textarea = React86__default.forwardRef(
3418
+ Textarea = React90__default.forwardRef(
3415
3419
  ({ className, error, onChange, ...props }, ref) => {
3416
3420
  const eventBus = useEventBus();
3417
3421
  const handleChange = (e) => {
@@ -3650,7 +3654,7 @@ var init_Select = __esm({
3650
3654
  init_cn();
3651
3655
  init_Icon();
3652
3656
  init_useEventBus();
3653
- Select = React86__default.forwardRef(
3657
+ Select = React90__default.forwardRef(
3654
3658
  (props, _ref) => {
3655
3659
  const { multiple, searchable, clearable } = props;
3656
3660
  if (multiple || searchable || clearable) {
@@ -3667,7 +3671,7 @@ var init_Checkbox = __esm({
3667
3671
  "components/core/atoms/Checkbox.tsx"() {
3668
3672
  init_cn();
3669
3673
  init_useEventBus();
3670
- Checkbox = React86__default.forwardRef(
3674
+ Checkbox = React90__default.forwardRef(
3671
3675
  ({ className, label, id, onChange, ...props }, ref) => {
3672
3676
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
3673
3677
  const eventBus = useEventBus();
@@ -3721,7 +3725,7 @@ var init_Spinner = __esm({
3721
3725
  md: "h-6 w-6",
3722
3726
  lg: "h-8 w-8"
3723
3727
  };
3724
- Spinner = React86__default.forwardRef(
3728
+ Spinner = React90__default.forwardRef(
3725
3729
  ({ className, size = "md", overlay, ...props }, ref) => {
3726
3730
  if (overlay) {
3727
3731
  return /* @__PURE__ */ jsx(
@@ -3811,7 +3815,7 @@ var init_Card = __esm({
3811
3815
  chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
3812
3816
  "tile-image-first": "p-0 overflow-hidden"
3813
3817
  };
3814
- Card = React86__default.forwardRef(
3818
+ Card = React90__default.forwardRef(
3815
3819
  ({
3816
3820
  className,
3817
3821
  variant = "bordered",
@@ -3859,9 +3863,9 @@ var init_Card = __esm({
3859
3863
  }
3860
3864
  );
3861
3865
  Card.displayName = "Card";
3862
- CardHeader = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
3866
+ CardHeader = React90__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
3863
3867
  CardHeader.displayName = "CardHeader";
3864
- CardTitle = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3868
+ CardTitle = React90__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3865
3869
  "h3",
3866
3870
  {
3867
3871
  ref,
@@ -3874,11 +3878,11 @@ var init_Card = __esm({
3874
3878
  }
3875
3879
  ));
3876
3880
  CardTitle.displayName = "CardTitle";
3877
- CardContent = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
3881
+ CardContent = React90__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
3878
3882
  CardContent.displayName = "CardContent";
3879
3883
  CardBody = CardContent;
3880
3884
  CardBody.displayName = "CardBody";
3881
- CardFooter = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3885
+ CardFooter = React90__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3882
3886
  "div",
3883
3887
  {
3884
3888
  ref,
@@ -3933,7 +3937,7 @@ var init_FilterPill = __esm({
3933
3937
  md: "w-3.5 h-3.5",
3934
3938
  lg: "w-4 h-4"
3935
3939
  };
3936
- FilterPill = React86__default.forwardRef(
3940
+ FilterPill = React90__default.forwardRef(
3937
3941
  ({
3938
3942
  className,
3939
3943
  variant = "default",
@@ -4062,8 +4066,8 @@ var init_Avatar = __esm({
4062
4066
  actionPayload
4063
4067
  }) => {
4064
4068
  const eventBus = useEventBus();
4065
- const [imgFailed, setImgFailed] = React86__default.useState(false);
4066
- React86__default.useEffect(() => {
4069
+ const [imgFailed, setImgFailed] = React90__default.useState(false);
4070
+ React90__default.useEffect(() => {
4067
4071
  setImgFailed(false);
4068
4072
  }, [src]);
4069
4073
  const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
@@ -4176,22 +4180,18 @@ var init_Center = __esm({
4176
4180
  as: Component2 = "div"
4177
4181
  }) => {
4178
4182
  const mergedStyle = minHeight ? { minHeight, ...style } : style;
4179
- const Comp = Component2;
4180
- return /* @__PURE__ */ jsx(
4181
- Comp,
4182
- {
4183
- className: cn(
4184
- inline ? "inline-flex" : "flex",
4185
- horizontal && "justify-center",
4186
- vertical && "items-center",
4187
- fullHeight && "h-full",
4188
- fullWidth && "w-full",
4189
- className
4190
- ),
4191
- style: mergedStyle,
4192
- children
4193
- }
4194
- );
4183
+ return React90__default.createElement(Component2, {
4184
+ className: cn(
4185
+ inline ? "inline-flex" : "flex",
4186
+ horizontal && "justify-center",
4187
+ vertical && "items-center",
4188
+ fullHeight && "h-full",
4189
+ fullWidth && "w-full",
4190
+ className
4191
+ ),
4192
+ style: mergedStyle,
4193
+ children
4194
+ });
4195
4195
  };
4196
4196
  }
4197
4197
  });
@@ -4448,7 +4448,7 @@ var init_Radio = __esm({
4448
4448
  md: "w-2.5 h-2.5",
4449
4449
  lg: "w-3 h-3"
4450
4450
  };
4451
- Radio = React86__default.forwardRef(
4451
+ Radio = React90__default.forwardRef(
4452
4452
  ({
4453
4453
  label,
4454
4454
  helperText,
@@ -4465,12 +4465,12 @@ var init_Radio = __esm({
4465
4465
  onChange,
4466
4466
  ...props
4467
4467
  }, ref) => {
4468
- const reactId = React86__default.useId();
4468
+ const reactId = React90__default.useId();
4469
4469
  const baseId = id || `radio-${reactId}`;
4470
4470
  const hasError = !!error;
4471
4471
  const eventBus = useEventBus();
4472
- const [selected, setSelected] = React86__default.useState(value);
4473
- React86__default.useEffect(() => {
4472
+ const [selected, setSelected] = React90__default.useState(value);
4473
+ React90__default.useEffect(() => {
4474
4474
  if (value !== void 0) setSelected(value);
4475
4475
  }, [value]);
4476
4476
  const pick = (next, e) => {
@@ -4652,7 +4652,7 @@ var init_Switch = __esm({
4652
4652
  "components/core/atoms/Switch.tsx"() {
4653
4653
  "use client";
4654
4654
  init_cn();
4655
- Switch = React86.forwardRef(
4655
+ Switch = React90.forwardRef(
4656
4656
  ({
4657
4657
  checked,
4658
4658
  defaultChecked = false,
@@ -4663,10 +4663,10 @@ var init_Switch = __esm({
4663
4663
  name,
4664
4664
  className
4665
4665
  }, ref) => {
4666
- const [isChecked, setIsChecked] = React86.useState(
4666
+ const [isChecked, setIsChecked] = React90.useState(
4667
4667
  checked !== void 0 ? checked : defaultChecked
4668
4668
  );
4669
- React86.useEffect(() => {
4669
+ React90.useEffect(() => {
4670
4670
  if (checked !== void 0) {
4671
4671
  setIsChecked(checked);
4672
4672
  }
@@ -4825,9 +4825,8 @@ var init_Stack = __esm({
4825
4825
  };
4826
4826
  const isHorizontal = direction === "horizontal";
4827
4827
  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";
4828
- const Comp = Component2;
4829
- return /* @__PURE__ */ jsx(
4830
- Comp,
4828
+ return React90__default.createElement(
4829
+ Component2,
4831
4830
  {
4832
4831
  className: cn(
4833
4832
  "flex",
@@ -4843,9 +4842,9 @@ var init_Stack = __esm({
4843
4842
  onClick: action || onClick ? handleClick : void 0,
4844
4843
  onKeyDown,
4845
4844
  role,
4846
- tabIndex,
4847
- children
4848
- }
4845
+ tabIndex
4846
+ },
4847
+ children
4849
4848
  );
4850
4849
  };
4851
4850
  VStack = (props) => /* @__PURE__ */ jsx(Stack, { direction: "vertical", ...props });
@@ -5026,7 +5025,7 @@ var Aside;
5026
5025
  var init_Aside = __esm({
5027
5026
  "components/core/atoms/Aside.tsx"() {
5028
5027
  init_cn();
5029
- Aside = React86__default.forwardRef(
5028
+ Aside = React90__default.forwardRef(
5030
5029
  ({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
5031
5030
  );
5032
5031
  Aside.displayName = "Aside";
@@ -5105,9 +5104,9 @@ var init_LawReferenceTooltip = __esm({
5105
5104
  className
5106
5105
  }) => {
5107
5106
  const { t } = useTranslate();
5108
- const [isVisible, setIsVisible] = React86__default.useState(false);
5109
- const timeoutRef = React86__default.useRef(null);
5110
- const triggerRef = React86__default.useRef(null);
5107
+ const [isVisible, setIsVisible] = React90__default.useState(false);
5108
+ const timeoutRef = React90__default.useRef(null);
5109
+ const triggerRef = React90__default.useRef(null);
5111
5110
  const handleMouseEnter = () => {
5112
5111
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
5113
5112
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -5118,7 +5117,7 @@ var init_LawReferenceTooltip = __esm({
5118
5117
  };
5119
5118
  const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
5120
5119
  const open = isVisible || revealed;
5121
- React86__default.useEffect(() => {
5120
+ React90__default.useEffect(() => {
5122
5121
  return () => {
5123
5122
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
5124
5123
  };
@@ -5330,7 +5329,7 @@ var init_StatusDot = __esm({
5330
5329
  md: "w-2.5 h-2.5",
5331
5330
  lg: "w-3 h-3"
5332
5331
  };
5333
- StatusDot = React86__default.forwardRef(
5332
+ StatusDot = React90__default.forwardRef(
5334
5333
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
5335
5334
  return /* @__PURE__ */ jsx(
5336
5335
  "span",
@@ -5384,7 +5383,7 @@ var init_TrendIndicator = __esm({
5384
5383
  down: "trending-down",
5385
5384
  flat: "arrow-right"
5386
5385
  };
5387
- TrendIndicator = React86__default.forwardRef(
5386
+ TrendIndicator = React90__default.forwardRef(
5388
5387
  ({
5389
5388
  className,
5390
5389
  value,
@@ -5451,7 +5450,7 @@ var init_RangeSlider = __esm({
5451
5450
  md: "w-4 h-4",
5452
5451
  lg: "w-5 h-5"
5453
5452
  };
5454
- RangeSlider = React86__default.forwardRef(
5453
+ RangeSlider = React90__default.forwardRef(
5455
5454
  ({
5456
5455
  className,
5457
5456
  min = 0,
@@ -5959,7 +5958,7 @@ var init_ContentSection = __esm({
5959
5958
  md: "py-16",
5960
5959
  lg: "py-24"
5961
5960
  };
5962
- ContentSection = React86__default.forwardRef(
5961
+ ContentSection = React90__default.forwardRef(
5963
5962
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
5964
5963
  return /* @__PURE__ */ jsx(
5965
5964
  Box,
@@ -6493,7 +6492,7 @@ var init_AnimatedReveal = __esm({
6493
6492
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
6494
6493
  "none": {}
6495
6494
  };
6496
- AnimatedReveal = React86__default.forwardRef(
6495
+ AnimatedReveal = React90__default.forwardRef(
6497
6496
  ({
6498
6497
  trigger = "scroll",
6499
6498
  animation = "fade-up",
@@ -6653,7 +6652,7 @@ var init_AnimatedGraphic = __esm({
6653
6652
  "components/marketing/atoms/AnimatedGraphic.tsx"() {
6654
6653
  "use client";
6655
6654
  init_cn();
6656
- AnimatedGraphic = React86__default.forwardRef(
6655
+ AnimatedGraphic = React90__default.forwardRef(
6657
6656
  ({
6658
6657
  src,
6659
6658
  svgContent,
@@ -6676,7 +6675,7 @@ var init_AnimatedGraphic = __esm({
6676
6675
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
6677
6676
  const resolvedSvg = svgContent ?? fetchedSvg;
6678
6677
  const prevAnimateRef = useRef(animate);
6679
- const setRef = React86__default.useCallback(
6678
+ const setRef = React90__default.useCallback(
6680
6679
  (node) => {
6681
6680
  containerRef.current = node;
6682
6681
  if (typeof ref === "function") ref(node);
@@ -6893,18 +6892,18 @@ var init_HealthBar = __esm({
6893
6892
  function ScoreDisplay({
6894
6893
  assetUrl = DEFAULT_ASSET_URL,
6895
6894
  value,
6895
+ score,
6896
6896
  label,
6897
6897
  icon,
6898
6898
  size = "md",
6899
6899
  className,
6900
6900
  animated = true,
6901
- locale = "en-US",
6902
- ...rest
6901
+ locale = "en-US"
6903
6902
  }) {
6904
- const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
6905
- const [displayValue, setDisplayValue] = React86.useState(resolvedValue);
6906
- const [isAnimating, setIsAnimating] = React86.useState(false);
6907
- React86.useEffect(() => {
6903
+ const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof score === "number" && !Number.isNaN(score) ? score : 0;
6904
+ const [displayValue, setDisplayValue] = React90.useState(resolvedValue);
6905
+ const [isAnimating, setIsAnimating] = React90.useState(false);
6906
+ React90.useEffect(() => {
6908
6907
  if (!animated || displayValue === resolvedValue) {
6909
6908
  setDisplayValue(resolvedValue);
6910
6909
  return;
@@ -6987,9 +6986,9 @@ function ControlButton({
6987
6986
  className
6988
6987
  }) {
6989
6988
  const eventBus = useEventBus();
6990
- const [isPressed, setIsPressed] = React86.useState(false);
6989
+ const [isPressed, setIsPressed] = React90.useState(false);
6991
6990
  const actualPressed = pressed ?? isPressed;
6992
- const handlePointerDown = React86.useCallback(
6991
+ const handlePointerDown = React90.useCallback(
6993
6992
  (e) => {
6994
6993
  e.preventDefault();
6995
6994
  if (disabled) return;
@@ -6999,7 +6998,7 @@ function ControlButton({
6999
6998
  },
7000
6999
  [disabled, pressEvent, eventBus, onPress]
7001
7000
  );
7002
- const handlePointerUp = React86.useCallback(
7001
+ const handlePointerUp = React90.useCallback(
7003
7002
  (e) => {
7004
7003
  e.preventDefault();
7005
7004
  if (disabled) return;
@@ -7009,7 +7008,7 @@ function ControlButton({
7009
7008
  },
7010
7009
  [disabled, releaseEvent, eventBus, onRelease]
7011
7010
  );
7012
- const handlePointerLeave = React86.useCallback(
7011
+ const handlePointerLeave = React90.useCallback(
7013
7012
  (e) => {
7014
7013
  if (isPressed) {
7015
7014
  setIsPressed(false);
@@ -7638,8 +7637,8 @@ function XPBar({
7638
7637
  }) {
7639
7638
  const sizes = sizeMap9[size];
7640
7639
  const percentage = max > 0 ? Math.max(0, Math.min(100, current / max * 100)) : 0;
7641
- const [fillWidth, setFillWidth] = React86.useState(animated ? 0 : percentage);
7642
- React86.useEffect(() => {
7640
+ const [fillWidth, setFillWidth] = React90.useState(animated ? 0 : percentage);
7641
+ React90.useEffect(() => {
7643
7642
  if (!animated) {
7644
7643
  setFillWidth(percentage);
7645
7644
  return;
@@ -8147,9 +8146,9 @@ function MiniMap({
8147
8146
  viewportRect = DEFAULT_VIEWPORT,
8148
8147
  className
8149
8148
  }) {
8150
- const canvasRef = React86.useRef(null);
8151
- const frameRef = React86.useRef(0);
8152
- React86.useEffect(() => {
8149
+ const canvasRef = React90.useRef(null);
8150
+ const frameRef = React90.useRef(0);
8151
+ React90.useEffect(() => {
8153
8152
  const canvas = canvasRef.current;
8154
8153
  if (!canvas) return;
8155
8154
  const ctx = canvas.getContext("2d");
@@ -8338,7 +8337,7 @@ var init_ErrorBoundary = __esm({
8338
8337
  }
8339
8338
  );
8340
8339
  };
8341
- ErrorBoundary = class extends React86__default.Component {
8340
+ ErrorBoundary = class extends React90__default.Component {
8342
8341
  constructor(props) {
8343
8342
  super(props);
8344
8343
  __publicField(this, "reset", () => {
@@ -9005,9 +9004,8 @@ var init_Container = __esm({
9005
9004
  as: Component2 = "div"
9006
9005
  }) => {
9007
9006
  const resolvedSize = maxWidth ?? size ?? "lg";
9008
- const Comp = Component2;
9009
- return /* @__PURE__ */ jsx(
9010
- Comp,
9007
+ return React90__default.createElement(
9008
+ Component2,
9011
9009
  {
9012
9010
  className: cn(
9013
9011
  "w-full",
@@ -9015,9 +9013,9 @@ var init_Container = __esm({
9015
9013
  paddingStyles3[padding],
9016
9014
  center && "mx-auto",
9017
9015
  className
9018
- ),
9019
- children
9020
- }
9016
+ )
9017
+ },
9018
+ children
9021
9019
  );
9022
9020
  };
9023
9021
  Container.displayName = "Container";
@@ -9729,8 +9727,8 @@ function ActionButtons({
9729
9727
  disabled
9730
9728
  }) {
9731
9729
  const eventBus = useEventBus();
9732
- const [activeButtons, setActiveButtons] = React86.useState(/* @__PURE__ */ new Set());
9733
- const handlePress = React86.useCallback(
9730
+ const [activeButtons, setActiveButtons] = React90.useState(/* @__PURE__ */ new Set());
9731
+ const handlePress = React90.useCallback(
9734
9732
  (id) => {
9735
9733
  setActiveButtons((prev) => new Set(prev).add(id));
9736
9734
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -9738,7 +9736,7 @@ function ActionButtons({
9738
9736
  },
9739
9737
  [actionEvent, eventBus, onAction]
9740
9738
  );
9741
- const handleRelease = React86.useCallback(
9739
+ const handleRelease = React90.useCallback(
9742
9740
  (id) => {
9743
9741
  setActiveButtons((prev) => {
9744
9742
  const next = new Set(prev);
@@ -12225,9 +12223,37 @@ function BattleBoard({
12225
12223
  className
12226
12224
  }) {
12227
12225
  const board = boardEntity(entity) ?? {};
12228
- const rawTiles = propTiles ?? (Array.isArray(board.tiles) ? board.tiles : []);
12226
+ function asFieldObj(v) {
12227
+ if (v === null || typeof v !== "object" || Array.isArray(v) || v instanceof Date) return null;
12228
+ return v;
12229
+ }
12230
+ const rawTiles = propTiles ?? (Array.isArray(board.tiles) ? board.tiles.flatMap((v) => {
12231
+ const o = asFieldObj(v);
12232
+ if (o === null || typeof o.x !== "number" || typeof o.y !== "number") return [];
12233
+ const tile = { x: o.x, y: o.y };
12234
+ if (typeof o.terrain === "string") tile.terrain = o.terrain;
12235
+ if (typeof o.terrainSprite === "string") tile.terrainSprite = o.terrainSprite;
12236
+ if (typeof o.passable === "boolean") tile.passable = o.passable;
12237
+ if (typeof o.movementCost === "number") tile.movementCost = o.movementCost;
12238
+ if (typeof o.elevation === "number") tile.elevation = o.elevation;
12239
+ if (typeof o.type === "string") tile.type = o.type;
12240
+ if (typeof o.tileType === "string") tile.tileType = o.tileType;
12241
+ if (typeof o.id === "string") tile.id = o.id;
12242
+ if (typeof o.modelUrl === "string") tile.modelUrl = o.modelUrl;
12243
+ return [tile];
12244
+ }) : []);
12229
12245
  const tiles = rawTiles.length === 0 ? DEFAULT_BATTLE_TILES : rawTiles;
12230
- const features = propFeatures ?? (Array.isArray(board.features) ? board.features : []);
12246
+ const features = propFeatures ?? (Array.isArray(board.features) ? board.features.flatMap((v) => {
12247
+ const o = asFieldObj(v);
12248
+ if (o === null || typeof o.type !== "string" || typeof o.x !== "number" || typeof o.y !== "number") return [];
12249
+ const feat = { type: o.type, x: o.x, y: o.y };
12250
+ if (typeof o.id === "string") feat.id = o.id;
12251
+ if (typeof o.sprite === "string") feat.sprite = o.sprite;
12252
+ if (typeof o.color === "string") feat.color = o.color;
12253
+ if (typeof o.elevation === "number") feat.elevation = o.elevation;
12254
+ if (typeof o.assetUrl === "string") feat.assetUrl = o.assetUrl;
12255
+ return [feat];
12256
+ }) : []);
12231
12257
  const boardWidth = num(board.gridWidth ?? board.boardWidth, BATTLE_GRID_W);
12232
12258
  const boardHeight = num(board.gridHeight ?? board.boardHeight, BATTLE_GRID_H);
12233
12259
  const assetManifest = propAssetManifest ?? board.assetManifest;
@@ -12326,7 +12352,12 @@ function BattleBoard({
12326
12352
  return units.filter((u) => unitHealth(u) > 0).map((unit) => {
12327
12353
  const id = str(unit.id);
12328
12354
  const pos = movingPositions.get(id) ?? unitPosition(unit);
12329
- const unitTraits = Array.isArray(unit.traits) ? unit.traits : void 0;
12355
+ const unitTraits = Array.isArray(unit.traits) ? unit.traits.flatMap((v) => {
12356
+ const o = asFieldObj(v);
12357
+ if (o === null || typeof o.name !== "string" || typeof o.currentState !== "string" || !Array.isArray(o.states)) return [];
12358
+ const stateNames = Array.from(o.states).flatMap((s) => typeof s === "string" ? [s] : []);
12359
+ return [{ name: o.name, currentState: o.currentState, states: stateNames, cooldown: typeof o.cooldown === "number" ? o.cooldown : void 0 }];
12360
+ }) : void 0;
12330
12361
  return {
12331
12362
  id,
12332
12363
  position: pos,
@@ -13322,9 +13353,9 @@ async function computeTraitLayout(data) {
13322
13353
  y: n.y ?? 0,
13323
13354
  width: n.width ?? 110,
13324
13355
  height: n.height ?? STATE_H,
13325
- isInitial: stateInfo?.isInitial,
13326
- isTerminal: stateInfo?.isTerminal,
13327
- role: getStateRole(name, stateInfo?.isInitial, stateInfo?.isTerminal, tc, maxTC),
13356
+ isInitial: stateInfo?.isInitial ?? void 0,
13357
+ isTerminal: stateInfo?.isTerminal ?? void 0,
13358
+ role: getStateRole(name, stateInfo?.isInitial ?? void 0, stateInfo?.isTerminal ?? void 0, tc, maxTC),
13328
13359
  transitionCount: tc
13329
13360
  };
13330
13361
  });
@@ -13335,12 +13366,10 @@ async function computeTraitLayout(data) {
13335
13366
  const sections = e.sections ?? [];
13336
13367
  const points = [];
13337
13368
  for (const section of sections) {
13338
- const startPoint = section.startPoint;
13339
- const endPoint = section.endPoint;
13340
13369
  const bendPoints = section.bendPoints ?? [];
13341
- points.push({ x: startPoint.x, y: startPoint.y });
13370
+ points.push({ x: section.startPoint.x, y: section.startPoint.y });
13342
13371
  for (const bp of bendPoints) points.push({ x: bp.x, y: bp.y });
13343
- points.push({ x: endPoint.x, y: endPoint.y });
13372
+ points.push({ x: section.endPoint.x, y: section.endPoint.y });
13344
13373
  }
13345
13374
  const isSelf = t.from === t.to;
13346
13375
  const isBackward = !isSelf && (nodeXMap[t.to] ?? 0) <= (nodeXMap[t.from] ?? 0);
@@ -13938,7 +13967,7 @@ var init_CodeBlock = __esm({
13938
13967
  };
13939
13968
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
13940
13969
  HIDDEN_LINE_NUMBERS = { display: "none" };
13941
- CodeBlock = React86__default.memo(
13970
+ CodeBlock = React90__default.memo(
13942
13971
  ({
13943
13972
  code: rawCode,
13944
13973
  language = "text",
@@ -14525,7 +14554,7 @@ var init_MarkdownContent = __esm({
14525
14554
  init_Box();
14526
14555
  init_CodeBlock();
14527
14556
  init_cn();
14528
- MarkdownContent = React86__default.memo(
14557
+ MarkdownContent = React90__default.memo(
14529
14558
  ({ content, direction = "ltr", className }) => {
14530
14559
  const { t: _t } = useTranslate();
14531
14560
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -15894,7 +15923,7 @@ var init_StateMachineView = __esm({
15894
15923
  style: { top: title ? 30 : 0 },
15895
15924
  children: [
15896
15925
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
15897
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React86__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
15926
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React90__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
15898
15927
  StateNode,
15899
15928
  {
15900
15929
  state,
@@ -16713,12 +16742,13 @@ var init_ContentRenderer = __esm({
16713
16742
  );
16714
16743
  case "orbital": {
16715
16744
  const parsed = segment.schema;
16745
+ const isFullSchema = (v) => Array.isArray(v.orbitals);
16716
16746
  const inlineTrait = {
16717
16747
  name: "inline",
16718
16748
  scope: "instance",
16719
16749
  stateMachine: parsed
16720
16750
  };
16721
- const schema = Array.isArray(parsed.orbitals) ? parsed : {
16751
+ const schema = isFullSchema(parsed) ? parsed : {
16722
16752
  name: "inline",
16723
16753
  orbitals: [{
16724
16754
  name: "inline",
@@ -17944,8 +17974,21 @@ function BuilderBoard({
17944
17974
  const resolved = boardEntity(entity);
17945
17975
  const [headerError, setHeaderError] = useState(false);
17946
17976
  const [selectedComponent, setSelectedComponent] = useState(null);
17947
- const components = Array.isArray(resolved?.components) ? resolved.components : [];
17948
- const slots = Array.isArray(resolved?.slots) ? resolved.slots : [];
17977
+ const components = rows(resolved?.components).map((r) => ({
17978
+ id: str(r.id),
17979
+ label: str(r.label),
17980
+ description: str(r.description) || void 0,
17981
+ iconEmoji: str(r.iconEmoji) || void 0,
17982
+ iconUrl: str(r.iconUrl) || void 0,
17983
+ category: str(r.category) || void 0
17984
+ }));
17985
+ const slots = rows(resolved?.slots).map((r) => ({
17986
+ id: str(r.id),
17987
+ label: str(r.label) || void 0,
17988
+ description: str(r.description) || void 0,
17989
+ requiredComponentId: str(r.requiredComponentId),
17990
+ placedComponentId: str(r.placedComponentId) || void 0
17991
+ }));
17949
17992
  const placements = {};
17950
17993
  for (const slot of slots) {
17951
17994
  if (slot.placedComponentId) placements[slot.id] = slot.placedComponentId;
@@ -19849,7 +19892,7 @@ function CardHand({
19849
19892
  className
19850
19893
  }) {
19851
19894
  const eventBus = useEventBus();
19852
- const handleClick = React86.useCallback(
19895
+ const handleClick = React90.useCallback(
19853
19896
  (card) => {
19854
19897
  if (card.disabled) return;
19855
19898
  onCardClick?.(card.id);
@@ -20596,14 +20639,15 @@ var init_CardGrid = __esm({
20596
20639
  bodyFields.length > 0 && /* @__PURE__ */ jsx(Box, { className: "px-4 py-3 flex-1", children: /* @__PURE__ */ jsx(VStack, { gap: "xs", children: bodyFields.map((field) => {
20597
20640
  const value = getNestedValue(itemData, field);
20598
20641
  if (value === void 0 || value === null || value === "") return null;
20599
- const boolVal = asBooleanValue(value);
20642
+ const fieldValue = value;
20643
+ const boolVal = asBooleanValue(fieldValue);
20600
20644
  if (boolVal !== null) {
20601
20645
  return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-between", children: [
20602
20646
  /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: fieldLabel(field) }),
20603
20647
  boolVal ? /* @__PURE__ */ jsx(Badge, { variant: "success", children: t("common.yes") || "Yes" }) : /* @__PURE__ */ jsx(Badge, { variant: "neutral", children: t("common.no") || "No" })
20604
20648
  ] }, field);
20605
20649
  }
20606
- const displayValue = isDateField(field) ? formatDate(value) : STATUS_FIELDS.has(field.toLowerCase()) ? void 0 : String(value);
20650
+ const displayValue = isDateField(field) ? formatDate(fieldValue) : STATUS_FIELDS.has(field.toLowerCase()) ? void 0 : String(value);
20607
20651
  if (!displayValue) return null;
20608
20652
  return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-between", children: [
20609
20653
  /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: fieldLabel(field) }),
@@ -20988,9 +21032,9 @@ function CastleBoard({
20988
21032
  const eventBus = useEventBus();
20989
21033
  const { t } = useTranslate();
20990
21034
  const resolved = boardEntity(entity);
20991
- const tiles = propTiles ?? (Array.isArray(resolved?.tiles) ? resolved.tiles : []);
20992
- const features = propFeatures ?? (Array.isArray(resolved?.features) ? resolved.features : []);
20993
- const units = propUnits ?? (Array.isArray(resolved?.units) ? resolved.units : []);
21035
+ const tiles = propTiles ?? (resolved?.tiles ?? []);
21036
+ const features = propFeatures ?? (resolved?.features ?? []);
21037
+ const units = propUnits ?? (resolved?.units ?? []);
20994
21038
  const assetManifest = propAssetManifest ?? resolved?.assetManifest;
20995
21039
  const backgroundImage = resolved?.backgroundImage;
20996
21040
  const gold = num(resolved?.gold);
@@ -22525,8 +22569,8 @@ function ClassifierBoard({
22525
22569
  const { t } = useTranslate();
22526
22570
  const resolved = boardEntity(entity);
22527
22571
  const [headerError, setHeaderError] = useState(false);
22528
- const items = Array.isArray(resolved?.items) ? resolved.items : [];
22529
- const categories = Array.isArray(resolved?.categories) ? resolved.categories : [];
22572
+ const items = rows(resolved?.items);
22573
+ const categories = rows(resolved?.categories);
22530
22574
  const result = str(resolved?.result);
22531
22575
  const submitted = result === "win";
22532
22576
  const attempts = num(resolved?.attempts);
@@ -23327,7 +23371,7 @@ function CraftingRecipe({
23327
23371
  className
23328
23372
  }) {
23329
23373
  const eventBus = useEventBus();
23330
- const handleCraft = React86.useCallback(() => {
23374
+ const handleCraft = React90.useCallback(() => {
23331
23375
  onCraft?.();
23332
23376
  if (craftEvent) {
23333
23377
  eventBus.emit(craftEvent, { output: output.label });
@@ -23344,7 +23388,7 @@ function CraftingRecipe({
23344
23388
  children: [
23345
23389
  /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
23346
23390
  const hasSufficient = ingredient.available >= ingredient.required;
23347
- return /* @__PURE__ */ jsxs(React86.Fragment, { children: [
23391
+ return /* @__PURE__ */ jsxs(React90.Fragment, { children: [
23348
23392
  /* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
23349
23393
  ItemSlot,
23350
23394
  {
@@ -23416,8 +23460,8 @@ function DPad({
23416
23460
  }) {
23417
23461
  const eventBus = useEventBus();
23418
23462
  const sizes = sizeMap15[size];
23419
- const [activeDirections, setActiveDirections] = React86.useState(/* @__PURE__ */ new Set());
23420
- const handlePress = React86.useCallback(
23463
+ const [activeDirections, setActiveDirections] = React90.useState(/* @__PURE__ */ new Set());
23464
+ const handlePress = React90.useCallback(
23421
23465
  (direction) => {
23422
23466
  setActiveDirections((prev) => new Set(prev).add(direction));
23423
23467
  if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
@@ -23425,7 +23469,7 @@ function DPad({
23425
23469
  },
23426
23470
  [directionEvent, eventBus, onDirection]
23427
23471
  );
23428
- const handleRelease = React86.useCallback(
23472
+ const handleRelease = React90.useCallback(
23429
23473
  (direction) => {
23430
23474
  setActiveDirections((prev) => {
23431
23475
  const next = new Set(prev);
@@ -24310,8 +24354,8 @@ var init_Menu = __esm({
24310
24354
  "bottom-end": "bottom-start"
24311
24355
  };
24312
24356
  const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
24313
- const triggerChild = React86__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
24314
- const triggerElement = React86__default.cloneElement(
24357
+ const triggerChild = React90__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
24358
+ const triggerElement = React90__default.cloneElement(
24315
24359
  triggerChild,
24316
24360
  {
24317
24361
  ref: triggerRef,
@@ -24406,14 +24450,14 @@ function useDataDnd(args) {
24406
24450
  const isZone = Boolean(dragGroup || accepts || sortable);
24407
24451
  const enabled = isZone || Boolean(dndRoot);
24408
24452
  const eventBus = useEventBus();
24409
- const parentRoot = React86__default.useContext(RootCtx);
24453
+ const parentRoot = React90__default.useContext(RootCtx);
24410
24454
  const isRoot = enabled && parentRoot === null;
24411
- const zoneId = React86__default.useId();
24455
+ const zoneId = React90__default.useId();
24412
24456
  const ownGroup = dragGroup ?? accepts ?? zoneId;
24413
- const [optimisticOrders, setOptimisticOrders] = React86__default.useState(() => /* @__PURE__ */ new Map());
24414
- const optimisticOrdersRef = React86__default.useRef(optimisticOrders);
24457
+ const [optimisticOrders, setOptimisticOrders] = React90__default.useState(() => /* @__PURE__ */ new Map());
24458
+ const optimisticOrdersRef = React90__default.useRef(optimisticOrders);
24415
24459
  optimisticOrdersRef.current = optimisticOrders;
24416
- const clearOptimisticOrder = React86__default.useCallback((group) => {
24460
+ const clearOptimisticOrder = React90__default.useCallback((group) => {
24417
24461
  setOptimisticOrders((prev) => {
24418
24462
  if (!prev.has(group)) return prev;
24419
24463
  const next = new Map(prev);
@@ -24436,17 +24480,20 @@ function useDataDnd(args) {
24436
24480
  }
24437
24481
  const itemIdsSignature = orderedItems.map((it, idx) => {
24438
24482
  const raw = it[dndItemIdField];
24439
- return String(raw ?? `__idx_${idx}`);
24483
+ return raw != null ? String(raw) : `__idx_${idx}`;
24440
24484
  }).join("|");
24441
- const itemIds = React86__default.useMemo(
24485
+ const itemIds = React90__default.useMemo(
24442
24486
  () => orderedItems.map((it, idx) => {
24443
24487
  const raw = it[dndItemIdField];
24444
- return raw ?? `__idx_${idx}`;
24488
+ return raw != null ? String(raw) : `__idx_${idx}`;
24445
24489
  }),
24446
24490
  [itemIdsSignature]
24447
24491
  );
24448
- const itemsContentSig = items.map((it, idx) => String(it[dndItemIdField] ?? `__${idx}`)).join("|");
24449
- React86__default.useEffect(() => {
24492
+ const itemsContentSig = items.map((it, idx) => {
24493
+ const raw = it[dndItemIdField];
24494
+ return raw != null ? String(raw) : `__${idx}`;
24495
+ }).join("|");
24496
+ React90__default.useEffect(() => {
24450
24497
  const root = isRoot ? null : parentRoot;
24451
24498
  if (root) {
24452
24499
  root.clearOptimisticOrder(ownGroup);
@@ -24454,20 +24501,20 @@ function useDataDnd(args) {
24454
24501
  clearOptimisticOrder(ownGroup);
24455
24502
  }
24456
24503
  }, [itemsContentSig, ownGroup]);
24457
- const zonesRef = React86__default.useRef(/* @__PURE__ */ new Map());
24458
- const registerZone = React86__default.useCallback((zoneId2, meta2) => {
24504
+ const zonesRef = React90__default.useRef(/* @__PURE__ */ new Map());
24505
+ const registerZone = React90__default.useCallback((zoneId2, meta2) => {
24459
24506
  zonesRef.current.set(zoneId2, meta2);
24460
24507
  }, []);
24461
- const unregisterZone = React86__default.useCallback((zoneId2) => {
24508
+ const unregisterZone = React90__default.useCallback((zoneId2) => {
24462
24509
  zonesRef.current.delete(zoneId2);
24463
24510
  }, []);
24464
- const [activeDrag, setActiveDrag] = React86__default.useState(null);
24465
- const [overZoneGroup, setOverZoneGroup] = React86__default.useState(null);
24466
- const meta = React86__default.useMemo(
24511
+ const [activeDrag, setActiveDrag] = React90__default.useState(null);
24512
+ const [overZoneGroup, setOverZoneGroup] = React90__default.useState(null);
24513
+ const meta = React90__default.useMemo(
24467
24514
  () => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
24468
24515
  [ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
24469
24516
  );
24470
- React86__default.useEffect(() => {
24517
+ React90__default.useEffect(() => {
24471
24518
  const target = isRoot ? null : parentRoot;
24472
24519
  if (!target) {
24473
24520
  zonesRef.current.set(zoneId, meta);
@@ -24486,7 +24533,7 @@ function useDataDnd(args) {
24486
24533
  }, [parentRoot, isRoot, zoneId, meta]);
24487
24534
  const sensors = useAlmadarDndSensors(true);
24488
24535
  const collisionDetection = almadarDndCollisionDetection;
24489
- const findZoneByItem = React86__default.useCallback(
24536
+ const findZoneByItem = React90__default.useCallback(
24490
24537
  (id) => {
24491
24538
  for (const z of zonesRef.current.values()) {
24492
24539
  if (z.itemIds.includes(id)) return z;
@@ -24495,7 +24542,7 @@ function useDataDnd(args) {
24495
24542
  },
24496
24543
  []
24497
24544
  );
24498
- React86__default.useCallback(
24545
+ React90__default.useCallback(
24499
24546
  (group) => {
24500
24547
  for (const z of zonesRef.current.values()) {
24501
24548
  if (z.group === group) return z;
@@ -24504,7 +24551,7 @@ function useDataDnd(args) {
24504
24551
  },
24505
24552
  []
24506
24553
  );
24507
- const handleDragEnd = React86__default.useCallback(
24554
+ const handleDragEnd = React90__default.useCallback(
24508
24555
  (event) => {
24509
24556
  const { active, over } = event;
24510
24557
  const activeIdStr = String(active.id);
@@ -24595,8 +24642,8 @@ function useDataDnd(args) {
24595
24642
  },
24596
24643
  [eventBus]
24597
24644
  );
24598
- const sortableData = React86__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
24599
- const SortableItem = React86__default.useCallback(
24645
+ const sortableData = React90__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
24646
+ const SortableItem = React90__default.useCallback(
24600
24647
  ({ id, children }) => {
24601
24648
  const {
24602
24649
  attributes,
@@ -24636,7 +24683,7 @@ function useDataDnd(args) {
24636
24683
  id: droppableId,
24637
24684
  data: sortableData
24638
24685
  });
24639
- const ctx = React86__default.useContext(RootCtx);
24686
+ const ctx = React90__default.useContext(RootCtx);
24640
24687
  const activeDrag2 = ctx?.activeDrag ?? null;
24641
24688
  const overZoneGroup2 = ctx?.overZoneGroup ?? null;
24642
24689
  const isThisZoneOver = overZoneGroup2 === ownGroup;
@@ -24651,7 +24698,7 @@ function useDataDnd(args) {
24651
24698
  showForeignPlaceholder,
24652
24699
  ctxAvailable: ctx != null
24653
24700
  });
24654
- React86__default.useEffect(() => {
24701
+ React90__default.useEffect(() => {
24655
24702
  dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
24656
24703
  }, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
24657
24704
  return /* @__PURE__ */ jsx(
@@ -24665,11 +24712,11 @@ function useDataDnd(args) {
24665
24712
  }
24666
24713
  );
24667
24714
  };
24668
- const rootContextValue = React86__default.useMemo(
24715
+ const rootContextValue = React90__default.useMemo(
24669
24716
  () => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
24670
24717
  [registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
24671
24718
  );
24672
- const handleDragStart = React86__default.useCallback((event) => {
24719
+ const handleDragStart = React90__default.useCallback((event) => {
24673
24720
  const sourceZone = findZoneByItem(event.active.id);
24674
24721
  const rect = event.active.rect.current.initial;
24675
24722
  const height = rect?.height && rect.height > 0 ? rect.height : 64;
@@ -24688,7 +24735,7 @@ function useDataDnd(args) {
24688
24735
  isRoot
24689
24736
  });
24690
24737
  }, [findZoneByItem, isRoot, zoneId]);
24691
- const handleDragOver = React86__default.useCallback((event) => {
24738
+ const handleDragOver = React90__default.useCallback((event) => {
24692
24739
  const { active, over } = event;
24693
24740
  const overData = over?.data?.current;
24694
24741
  const overGroup = overData?.dndGroup ?? null;
@@ -24758,7 +24805,7 @@ function useDataDnd(args) {
24758
24805
  return next;
24759
24806
  });
24760
24807
  }, []);
24761
- const handleDragCancel = React86__default.useCallback((event) => {
24808
+ const handleDragCancel = React90__default.useCallback((event) => {
24762
24809
  setActiveDrag(null);
24763
24810
  setOverZoneGroup(null);
24764
24811
  dndLog.warn("dragCancel", {
@@ -24766,12 +24813,12 @@ function useDataDnd(args) {
24766
24813
  reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
24767
24814
  });
24768
24815
  }, []);
24769
- const handleDragEndWithCleanup = React86__default.useCallback((event) => {
24816
+ const handleDragEndWithCleanup = React90__default.useCallback((event) => {
24770
24817
  handleDragEnd(event);
24771
24818
  setActiveDrag(null);
24772
24819
  setOverZoneGroup(null);
24773
24820
  }, [handleDragEnd]);
24774
- const wrapContainer = React86__default.useCallback(
24821
+ const wrapContainer = React90__default.useCallback(
24775
24822
  (children) => {
24776
24823
  if (!enabled) return children;
24777
24824
  const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
@@ -24825,7 +24872,7 @@ var init_useDataDnd = __esm({
24825
24872
  init_useAlmadarDndCollision();
24826
24873
  init_Box();
24827
24874
  dndLog = createLogger("almadar:ui:dnd");
24828
- RootCtx = React86__default.createContext(null);
24875
+ RootCtx = React90__default.createContext(null);
24829
24876
  }
24830
24877
  });
24831
24878
  function renderIconInput(icon, props) {
@@ -24968,8 +25015,8 @@ function DataGrid({
24968
25015
  const hasRenderProp = typeof children === "function";
24969
25016
  useEffect(() => {
24970
25017
  if (data.length > 0 && !hasRenderProp && fieldDefs.length === 0) {
24971
- const renderItemRaw = schemaRenderItem;
24972
- const isFnLambda = Array.isArray(renderItemRaw) && renderItemRaw.length >= 3 && (renderItemRaw[0] === "fn" || renderItemRaw[0] === "lambda");
25018
+ const schemaArr = Array.isArray(schemaRenderItem) ? schemaRenderItem : null;
25019
+ const isFnLambda = schemaArr !== null && schemaArr.length >= 3 && (schemaArr[0] === "fn" || schemaArr[0] === "lambda");
24973
25020
  dataGridLog.warn("renderItem-unresolved", {
24974
25021
  rowCount: data.length,
24975
25022
  renderItemIsFnLambda: isFnLambda
@@ -25351,7 +25398,7 @@ function DataList({
25351
25398
  }) {
25352
25399
  const eventBus = useEventBus();
25353
25400
  const { t } = useTranslate();
25354
- const [visibleCount, setVisibleCount] = React86__default.useState(pageSize || Infinity);
25401
+ const [visibleCount, setVisibleCount] = React90__default.useState(pageSize || Infinity);
25355
25402
  const fieldDefs = fields ?? columns ?? [];
25356
25403
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
25357
25404
  const dnd = useDataDnd({
@@ -25370,21 +25417,20 @@ function DataList({
25370
25417
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
25371
25418
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
25372
25419
  const hasRenderProp = typeof children === "function";
25373
- React86__default.useEffect(() => {
25420
+ React90__default.useEffect(() => {
25374
25421
  const renderItemTypeOf = typeof schemaRenderItem;
25375
25422
  const childrenTypeOf = typeof children;
25376
25423
  if (data.length > 0 && !hasRenderProp) {
25377
25424
  const firstRow = data[0];
25378
25425
  const sampleKeys = firstRow ? Object.keys(firstRow).slice(0, 6) : [];
25379
- const renderItemRaw = schemaRenderItem;
25380
- const isFnLambda = Array.isArray(renderItemRaw) && renderItemRaw.length >= 3 && (renderItemRaw[0] === "fn" || renderItemRaw[0] === "lambda");
25426
+ const isFnLambda = Array.isArray(schemaRenderItem) && schemaRenderItem.length >= 3 && (schemaRenderItem[0] === "fn" || schemaRenderItem[0] === "lambda");
25381
25427
  dataListLog.warn("renderItem-unresolved", {
25382
25428
  rowCount: data.length,
25383
25429
  fieldsCount: fieldDefs.length,
25384
25430
  renderItemTypeOf,
25385
- renderItemIsArray: Array.isArray(renderItemRaw),
25431
+ renderItemIsArray: Array.isArray(schemaRenderItem),
25386
25432
  renderItemIsFnLambda: isFnLambda,
25387
- renderItemHead: Array.isArray(renderItemRaw) ? String(renderItemRaw[0]) : void 0,
25433
+ renderItemHead: Array.isArray(schemaRenderItem) ? String(schemaRenderItem[0]) : void 0,
25388
25434
  childrenTypeOf,
25389
25435
  sampleRowKeys: sampleKeys
25390
25436
  });
@@ -25472,10 +25518,10 @@ function DataList({
25472
25518
  const isCompact = variant === "compact";
25473
25519
  const isMessage = variant === "message";
25474
25520
  if (isMessage) {
25475
- const items2 = data.map((item) => item);
25521
+ const items2 = [...data];
25476
25522
  const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
25477
25523
  const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
25478
- return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
25524
+ return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
25479
25525
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
25480
25526
  group.items.map((itemData, index) => {
25481
25527
  const id = itemData.id || `${gi}-${index}`;
@@ -25521,7 +25567,7 @@ function DataList({
25521
25567
  })
25522
25568
  ] }, gi)) });
25523
25569
  }
25524
- const items = data.map((item) => item);
25570
+ const items = [...data];
25525
25571
  const groups = groupBy ? groupData(items, groupBy) : [{ label: "", items }];
25526
25572
  const idFieldName = dndItemIdField ?? "id";
25527
25573
  const renderItem = (itemData, index, isLast) => {
@@ -25616,7 +25662,7 @@ function DataList({
25616
25662
  className
25617
25663
  ),
25618
25664
  children: [
25619
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
25665
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
25620
25666
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
25621
25667
  group.items.map(
25622
25668
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -26409,23 +26455,19 @@ var init_Flex = __esm({
26409
26455
  flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
26410
26456
  }
26411
26457
  }
26412
- const Comp = Component2;
26413
- return /* @__PURE__ */ jsx(
26414
- Comp,
26415
- {
26416
- className: cn(
26417
- inline ? "inline-flex" : "flex",
26418
- directionStyles[direction],
26419
- wrapStyles[wrap],
26420
- alignStyles3[align],
26421
- justifyStyles2[justify],
26422
- gapStyles6[gap],
26423
- className
26424
- ),
26425
- style: Object.keys(flexStyle).length > 0 ? flexStyle : void 0,
26426
- children
26427
- }
26428
- );
26458
+ return React90__default.createElement(Component2, {
26459
+ className: cn(
26460
+ inline ? "inline-flex" : "flex",
26461
+ directionStyles[direction],
26462
+ wrapStyles[wrap],
26463
+ alignStyles3[align],
26464
+ justifyStyles2[justify],
26465
+ gapStyles6[gap],
26466
+ className
26467
+ ),
26468
+ style: Object.keys(flexStyle).length > 0 ? flexStyle : void 0,
26469
+ children
26470
+ });
26429
26471
  };
26430
26472
  Flex.displayName = "Flex";
26431
26473
  }
@@ -26532,7 +26574,7 @@ var init_Grid = __esm({
26532
26574
  as: Component2 = "div"
26533
26575
  }) => {
26534
26576
  const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
26535
- return React86__default.createElement(
26577
+ return React90__default.createElement(
26536
26578
  Component2,
26537
26579
  {
26538
26580
  className: cn(
@@ -26728,9 +26770,9 @@ var init_Popover = __esm({
26728
26770
  onMouseLeave: handleClose,
26729
26771
  onPointerDown: tapTriggerProps.onPointerDown
26730
26772
  };
26731
- const childElement = React86__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
26773
+ const childElement = React90__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
26732
26774
  const childPointerDown = childElement.props.onPointerDown;
26733
- const triggerElement = React86__default.cloneElement(
26775
+ const triggerElement = React90__default.cloneElement(
26734
26776
  childElement,
26735
26777
  {
26736
26778
  ref: triggerRef,
@@ -27332,9 +27374,9 @@ var init_Tooltip = __esm({
27332
27374
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
27333
27375
  };
27334
27376
  }, []);
27335
- const triggerElement = React86__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
27377
+ const triggerElement = React90__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
27336
27378
  const childPointerDown = triggerElement.props.onPointerDown;
27337
- const trigger = React86__default.cloneElement(triggerElement, {
27379
+ const trigger = React90__default.cloneElement(triggerElement, {
27338
27380
  ref: triggerRef,
27339
27381
  onMouseEnter: handleMouseEnter,
27340
27382
  onMouseLeave: handleMouseLeave,
@@ -27424,7 +27466,7 @@ var init_WizardProgress = __esm({
27424
27466
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
27425
27467
  const isActive = index === currentStep;
27426
27468
  const isCompleted = index < currentStep;
27427
- return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
27469
+ return /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
27428
27470
  /* @__PURE__ */ jsx(
27429
27471
  "button",
27430
27472
  {
@@ -27736,13 +27778,14 @@ var init_ViolationAlert = __esm({
27736
27778
  onNavigateToField,
27737
27779
  compact = false,
27738
27780
  className,
27739
- ...flatProps
27781
+ message
27740
27782
  }) => {
27741
27783
  const { t } = useTranslate();
27784
+ const fallbackMessage = message ?? t("violationAlert.fallbackMessage");
27742
27785
  const resolvedViolation = violation ?? {
27743
27786
  law: "",
27744
27787
  article: "",
27745
- message: flatProps.message ?? t("violationAlert.fallbackMessage"),
27788
+ message: fallbackMessage,
27746
27789
  actionType: "measure"
27747
27790
  };
27748
27791
  const effectiveSeverity = severity ?? (resolvedViolation.actionType === "measure" ? "warning" : "error");
@@ -28487,7 +28530,7 @@ function InventoryGrid({
28487
28530
  const eventBus = useEventBus();
28488
28531
  const slotCount = totalSlots ?? items.length;
28489
28532
  const emptySlotCount = Math.max(0, slotCount - items.length);
28490
- const handleSelect = React86.useCallback(
28533
+ const handleSelect = React90.useCallback(
28491
28534
  (id) => {
28492
28535
  onSelect?.(id);
28493
28536
  if (selectEvent) {
@@ -28722,31 +28765,31 @@ function GameCanvas2D({
28722
28765
  assetBaseUrl,
28723
28766
  className
28724
28767
  }) {
28725
- const canvasRef = React86.useRef(null);
28726
- const rafRef = React86.useRef(0);
28727
- const frameRef = React86.useRef(0);
28728
- const lastTimeRef = React86.useRef(0);
28729
- const imageCache = React86.useRef(/* @__PURE__ */ new Map());
28768
+ const canvasRef = React90.useRef(null);
28769
+ const rafRef = React90.useRef(0);
28770
+ const frameRef = React90.useRef(0);
28771
+ const lastTimeRef = React90.useRef(0);
28772
+ const imageCache = React90.useRef(/* @__PURE__ */ new Map());
28730
28773
  const emit = useEmitEvent();
28731
- const onDrawRef = React86.useRef(onDraw);
28774
+ const onDrawRef = React90.useRef(onDraw);
28732
28775
  onDrawRef.current = onDraw;
28733
- const onTickRef = React86.useRef(onTick);
28776
+ const onTickRef = React90.useRef(onTick);
28734
28777
  onTickRef.current = onTick;
28735
- const tickEventRef = React86.useRef(tickEvent);
28778
+ const tickEventRef = React90.useRef(tickEvent);
28736
28779
  tickEventRef.current = tickEvent;
28737
- const drawEventRef = React86.useRef(drawEvent);
28780
+ const drawEventRef = React90.useRef(drawEvent);
28738
28781
  drawEventRef.current = drawEvent;
28739
- const emitRef = React86.useRef(emit);
28782
+ const emitRef = React90.useRef(emit);
28740
28783
  emitRef.current = emit;
28741
- const assetBaseUrlRef = React86.useRef(assetBaseUrl);
28784
+ const assetBaseUrlRef = React90.useRef(assetBaseUrl);
28742
28785
  assetBaseUrlRef.current = assetBaseUrl;
28743
- const backgroundImageRef = React86.useRef(backgroundImage);
28786
+ const backgroundImageRef = React90.useRef(backgroundImage);
28744
28787
  backgroundImageRef.current = backgroundImage;
28745
- const widthRef = React86.useRef(width);
28788
+ const widthRef = React90.useRef(width);
28746
28789
  widthRef.current = width;
28747
- const heightRef = React86.useRef(height);
28790
+ const heightRef = React90.useRef(height);
28748
28791
  heightRef.current = height;
28749
- const loadImage = React86.useCallback((url) => {
28792
+ const loadImage = React90.useCallback((url) => {
28750
28793
  const base = assetBaseUrlRef.current;
28751
28794
  if (!url.startsWith("http") && !base) return null;
28752
28795
  const fullUrl = url.startsWith("http") ? url : `${base}${url}`;
@@ -28760,7 +28803,7 @@ function GameCanvas2D({
28760
28803
  }
28761
28804
  return null;
28762
28805
  }, []);
28763
- React86.useEffect(() => {
28806
+ React90.useEffect(() => {
28764
28807
  const canvas = canvasRef.current;
28765
28808
  if (!canvas) return;
28766
28809
  const ctx = canvas.getContext("2d");
@@ -29085,7 +29128,7 @@ function TurnPanel({
29085
29128
  className
29086
29129
  }) {
29087
29130
  const eventBus = useEventBus();
29088
- const handleAction = React86.useCallback(
29131
+ const handleAction = React90.useCallback(
29089
29132
  (event) => {
29090
29133
  if (event) {
29091
29134
  eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
@@ -29266,7 +29309,7 @@ function UnitCommandBar({
29266
29309
  className
29267
29310
  }) {
29268
29311
  const eventBus = useEventBus();
29269
- const handleCommand = React86.useCallback(
29312
+ const handleCommand = React90.useCallback(
29270
29313
  (event) => {
29271
29314
  if (event) {
29272
29315
  eventBus.emit(event, { unitId: selectedUnitId });
@@ -29817,7 +29860,7 @@ function GameMenu({
29817
29860
  } catch {
29818
29861
  }
29819
29862
  const eventBus = eventBusProp || eventBusFromHook;
29820
- const handleOptionClick = React86.useCallback(
29863
+ const handleOptionClick = React90.useCallback(
29821
29864
  (option) => {
29822
29865
  if (option.event && eventBus) {
29823
29866
  eventBus.emit(`UI:${option.event}`, { option });
@@ -29936,7 +29979,7 @@ function GameOverScreen({
29936
29979
  } catch {
29937
29980
  }
29938
29981
  const eventBus = eventBusProp || eventBusFromHook;
29939
- const handleActionClick = React86.useCallback(
29982
+ const handleActionClick = React90.useCallback(
29940
29983
  (action) => {
29941
29984
  if (action.event && eventBus) {
29942
29985
  eventBus.emit(`UI:${action.event}`, { action });
@@ -30868,7 +30911,7 @@ var init_MapView = __esm({
30868
30911
  shadowSize: [41, 41]
30869
30912
  });
30870
30913
  L.Marker.prototype.options.icon = defaultIcon;
30871
- const { useEffect: useEffect83, useRef: useRef80, useCallback: useCallback126, useState: useState113 } = React86__default;
30914
+ const { useEffect: useEffect83, useRef: useRef80, useCallback: useCallback126, useState: useState113 } = React90__default;
30872
30915
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
30873
30916
  const { useEventBus: useEventBus3 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
30874
30917
  function MapUpdater({ centerLat, centerLng, zoom }) {
@@ -31704,6 +31747,15 @@ function renderIconInput3(icon, props) {
31704
31747
  function columnLabel(col) {
31705
31748
  return col.header ?? col.label ?? col.key.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
31706
31749
  }
31750
+ function asFieldValue(v) {
31751
+ if (v === void 0 || v === null) return v;
31752
+ const t = typeof v;
31753
+ if (t === "string" || t === "number" || t === "boolean") return v;
31754
+ if (v instanceof Date) return v;
31755
+ if (Array.isArray(v)) return v;
31756
+ if (t === "object") return v;
31757
+ return void 0;
31758
+ }
31707
31759
  function statusVariant4(value) {
31708
31760
  const v = value.toLowerCase();
31709
31761
  if (["active", "completed", "done", "approved", "published", "resolved", "open", "online", "ok"].includes(v)) return "success";
@@ -31774,8 +31826,8 @@ function TableView({
31774
31826
  }) {
31775
31827
  const eventBus = useEventBus();
31776
31828
  const { t } = useTranslate();
31777
- const [visibleCount, setVisibleCount] = React86__default.useState(pageSize > 0 ? pageSize : Infinity);
31778
- const [localSelected, setLocalSelected] = React86__default.useState(/* @__PURE__ */ new Set());
31829
+ const [visibleCount, setVisibleCount] = React90__default.useState(pageSize > 0 ? pageSize : Infinity);
31830
+ const [localSelected, setLocalSelected] = React90__default.useState(/* @__PURE__ */ new Set());
31779
31831
  const colDefs = columns ?? fields ?? [];
31780
31832
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
31781
31833
  const dnd = useDataDnd({
@@ -31920,7 +31972,7 @@ function TableView({
31920
31972
  }
31921
31973
  ) }),
31922
31974
  hasRenderProp ? /* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0", children: children(row, index) }) : colDefs.map((col) => {
31923
- const raw = getNestedValue(row, col.field ?? col.key);
31975
+ const raw = asFieldValue(getNestedValue(row, col.field ?? col.key));
31924
31976
  const cellBase = cn(
31925
31977
  "flex items-center min-w-0",
31926
31978
  alignClass[col.align ?? "left"],
@@ -31970,12 +32022,12 @@ function TableView({
31970
32022
  ]
31971
32023
  }
31972
32024
  );
31973
- return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React86__default.Fragment, { children: rowInner }, id);
32025
+ return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React90__default.Fragment, { children: rowInner }, id);
31974
32026
  };
31975
- const items = data.map((row) => row);
32027
+ const items = Array.from(data);
31976
32028
  const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
31977
32029
  let runningIndex = 0;
31978
- const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
32030
+ const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
31979
32031
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
31980
32032
  group.items.map((row) => renderRow(row, runningIndex++))
31981
32033
  ] }, gi)) });
@@ -33332,7 +33384,7 @@ var init_StepFlow = __esm({
33332
33384
  className
33333
33385
  }) => {
33334
33386
  if (orientation === "vertical") {
33335
- 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: [
33387
+ return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React90__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
33336
33388
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
33337
33389
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
33338
33390
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -33343,7 +33395,7 @@ var init_StepFlow = __esm({
33343
33395
  ] })
33344
33396
  ] }) }, index)) });
33345
33397
  }
33346
- 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: [
33398
+ 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(React90__default.Fragment, { children: [
33347
33399
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
33348
33400
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
33349
33401
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -34328,7 +34380,7 @@ var init_LikertScale = __esm({
34328
34380
  md: "text-base",
34329
34381
  lg: "text-lg"
34330
34382
  };
34331
- LikertScale = React86__default.forwardRef(
34383
+ LikertScale = React90__default.forwardRef(
34332
34384
  ({
34333
34385
  question,
34334
34386
  options = DEFAULT_LIKERT_OPTIONS,
@@ -34340,7 +34392,7 @@ var init_LikertScale = __esm({
34340
34392
  variant = "radios",
34341
34393
  className
34342
34394
  }, ref) => {
34343
- const groupId = React86__default.useId();
34395
+ const groupId = React90__default.useId();
34344
34396
  const eventBus = useEventBus();
34345
34397
  const handleSelect = useCallback(
34346
34398
  (next) => {
@@ -35235,11 +35287,11 @@ function nextBlockId(prefix = "blk") {
35235
35287
  function normalizeBlocks(raw) {
35236
35288
  if (!Array.isArray(raw) || raw.length === 0) return [createBlock("paragraph")];
35237
35289
  return raw.map((row) => {
35238
- const r = row;
35239
- const rawType = r.type;
35290
+ const entity = row;
35291
+ const rawType = entity.type;
35240
35292
  const type = typeof rawType === "string" && BLOCK_TYPES.has(rawType) ? rawType : "paragraph";
35241
- const id = typeof r.id === "string" && r.id ? r.id : nextBlockId(type);
35242
- return { ...r, id, type };
35293
+ const id = typeof entity.id === "string" && entity.id ? entity.id : nextBlockId(type);
35294
+ return { ...entity, id, type };
35243
35295
  });
35244
35296
  }
35245
35297
  function createBlock(type) {
@@ -36622,7 +36674,7 @@ var init_DocBreadcrumb = __esm({
36622
36674
  "aria-label": t("aria.breadcrumb"),
36623
36675
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
36624
36676
  const isLast = idx === items.length - 1;
36625
- return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
36677
+ return /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
36626
36678
  idx > 0 && /* @__PURE__ */ jsx(
36627
36679
  Icon,
36628
36680
  {
@@ -37490,8 +37542,8 @@ var init_MiniStateMachine = __esm({
37490
37542
  states.map((s, i) => {
37491
37543
  const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
37492
37544
  const tc = transitionCounts[s.name] ?? 0;
37493
- const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
37494
- return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
37545
+ const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
37546
+ return /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
37495
37547
  /* @__PURE__ */ jsx(
37496
37548
  AvlState,
37497
37549
  {
@@ -37501,8 +37553,8 @@ var init_MiniStateMachine = __esm({
37501
37553
  height: NODE_H,
37502
37554
  name: "",
37503
37555
  role,
37504
- isInitial: s.isInitial,
37505
- isTerminal: s.isTerminal
37556
+ isInitial: s.isInitial ?? void 0,
37557
+ isTerminal: s.isTerminal ?? void 0
37506
37558
  }
37507
37559
  ),
37508
37560
  i < states.length - 1 && /* @__PURE__ */ jsxs("g", { children: [
@@ -37695,7 +37747,7 @@ var init_PageHeader = __esm({
37695
37747
  info: "bg-info/10 text-info"
37696
37748
  };
37697
37749
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
37698
- 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: [
37750
+ 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(React90__default.Fragment, { children: [
37699
37751
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
37700
37752
  crumb.href ? /* @__PURE__ */ jsx(
37701
37753
  "a",
@@ -38053,52 +38105,49 @@ var init_Section = __esm({
38053
38105
  as: Component2 = "section"
38054
38106
  }) => {
38055
38107
  const hasHeader = title || description || action;
38056
- const Comp = Component2;
38057
- return /* @__PURE__ */ jsxs(
38058
- Comp,
38108
+ return React90__default.createElement(
38109
+ Component2,
38059
38110
  {
38060
38111
  className: cn(
38061
38112
  paddingStyles4[padding],
38062
38113
  variantStyles9[variant],
38063
38114
  className
38064
- ),
38065
- children: [
38066
- hasHeader && /* @__PURE__ */ jsxs(
38067
- Box,
38068
- {
38069
- className: cn(
38070
- "flex flex-col sm:flex-row sm:items-start sm:justify-between gap-2 sm:gap-4",
38071
- divider && "pb-4 mb-4 border-b-[length:var(--border-width)] border-border",
38072
- !divider && "mb-4",
38073
- headerClassName
38074
- ),
38075
- children: [
38076
- /* @__PURE__ */ jsxs(Box, { className: "flex-1 min-w-0", children: [
38077
- title && /* @__PURE__ */ jsx(
38078
- Typography,
38079
- {
38080
- variant: "h4",
38081
- className: "text-foreground font-semibold",
38082
- children: title
38083
- }
38084
- ),
38085
- description && /* @__PURE__ */ jsx(
38086
- Typography,
38087
- {
38088
- variant: "body",
38089
- color: "muted",
38090
- className: "mt-1",
38091
- children: description
38092
- }
38093
- )
38094
- ] }),
38095
- action && /* @__PURE__ */ jsx(Box, { className: "flex-shrink-0 flex items-center gap-2", children: action })
38096
- ]
38097
- }
38115
+ )
38116
+ },
38117
+ hasHeader && /* @__PURE__ */ jsxs(
38118
+ Box,
38119
+ {
38120
+ className: cn(
38121
+ "flex flex-col sm:flex-row sm:items-start sm:justify-between gap-2 sm:gap-4",
38122
+ divider && "pb-4 mb-4 border-b-[length:var(--border-width)] border-border",
38123
+ !divider && "mb-4",
38124
+ headerClassName
38098
38125
  ),
38099
- /* @__PURE__ */ jsx(Box, { className: contentClassName, children })
38100
- ]
38101
- }
38126
+ children: [
38127
+ /* @__PURE__ */ jsxs(Box, { className: "flex-1 min-w-0", children: [
38128
+ title && /* @__PURE__ */ jsx(
38129
+ Typography,
38130
+ {
38131
+ variant: "h4",
38132
+ className: "text-foreground font-semibold",
38133
+ children: title
38134
+ }
38135
+ ),
38136
+ description && /* @__PURE__ */ jsx(
38137
+ Typography,
38138
+ {
38139
+ variant: "body",
38140
+ color: "muted",
38141
+ className: "mt-1",
38142
+ children: description
38143
+ }
38144
+ )
38145
+ ] }),
38146
+ action && /* @__PURE__ */ jsx(Box, { className: "flex-shrink-0 flex items-center gap-2", children: action })
38147
+ ]
38148
+ }
38149
+ ),
38150
+ /* @__PURE__ */ jsx(Box, { className: contentClassName, children })
38102
38151
  );
38103
38152
  };
38104
38153
  Section.displayName = "Section";
@@ -38424,7 +38473,7 @@ var init_WizardContainer = __esm({
38424
38473
  const isCompleted = index < currentStep;
38425
38474
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
38426
38475
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
38427
- return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
38476
+ return /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
38428
38477
  /* @__PURE__ */ jsx(
38429
38478
  Button,
38430
38479
  {
@@ -40367,6 +40416,22 @@ var init_DataTable = __esm({
40367
40416
  DataTable.displayName = "DataTable";
40368
40417
  }
40369
40418
  });
40419
+ function toDebuggerLine(v) {
40420
+ if (v === null || typeof v !== "object" || Array.isArray(v) || v instanceof Date) return null;
40421
+ const id = v["id"];
40422
+ const content = v["content"];
40423
+ const isBug = v["isBug"];
40424
+ if (typeof id !== "string" || typeof content !== "string" || typeof isBug !== "boolean") return null;
40425
+ const isFlagged = v["isFlagged"];
40426
+ const explanation = v["explanation"];
40427
+ return {
40428
+ id,
40429
+ content,
40430
+ isBug,
40431
+ isFlagged: typeof isFlagged === "boolean" ? isFlagged : void 0,
40432
+ explanation: typeof explanation === "string" ? explanation : void 0
40433
+ };
40434
+ }
40370
40435
  function DebuggerBoard({
40371
40436
  entity,
40372
40437
  completeEvent = "PUZZLE_COMPLETE",
@@ -40379,7 +40444,10 @@ function DebuggerBoard({
40379
40444
  const { t } = useTranslate();
40380
40445
  const resolved = boardEntity(entity);
40381
40446
  const [headerError, setHeaderError] = useState(false);
40382
- const lines = Array.isArray(resolved?.lines) ? resolved.lines : [];
40447
+ const lines = Array.isArray(resolved?.lines) ? resolved.lines.flatMap((v) => {
40448
+ const l = toDebuggerLine(v);
40449
+ return l ? [l] : [];
40450
+ }) : [];
40383
40451
  const result = str(resolved?.result) || "none";
40384
40452
  const attempts = num(resolved?.attempts);
40385
40453
  const submitted = result === "win";
@@ -40984,7 +41052,7 @@ var init_DetailPanel = __esm({
40984
41052
  }
40985
41053
  });
40986
41054
  function extractTitle(children) {
40987
- if (!React86__default.isValidElement(children)) return void 0;
41055
+ if (!React90__default.isValidElement(children)) return void 0;
40988
41056
  const props = children.props;
40989
41057
  if (typeof props.title === "string") {
40990
41058
  return props.title;
@@ -41039,7 +41107,7 @@ function LinearView({
41039
41107
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
41040
41108
  const isDone = i < currentIdx;
41041
41109
  const isCurrent = i === currentIdx;
41042
- return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
41110
+ return /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
41043
41111
  i > 0 && /* @__PURE__ */ jsx(
41044
41112
  Typography,
41045
41113
  {
@@ -41861,12 +41929,12 @@ function evaluateFormExpression(expr, formCtx) {
41861
41929
  return evaluate(expr, ctx);
41862
41930
  }
41863
41931
  function isOrbitalEntitySchema(value) {
41864
- if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
41932
+ if (value === null || value === void 0 || typeof value !== "object" || Array.isArray(value)) return false;
41865
41933
  const fields = value.fields;
41866
41934
  return Array.isArray(fields);
41867
41935
  }
41868
41936
  function isPlainEntityRow(value) {
41869
- if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
41937
+ if (value === null || value === void 0 || typeof value !== "object" || Array.isArray(value)) return false;
41870
41938
  const fields = value.fields;
41871
41939
  return !Array.isArray(fields);
41872
41940
  }
@@ -42025,12 +42093,12 @@ var init_Form = __esm({
42025
42093
  const isSchemaEntity = isOrbitalEntitySchema(entity);
42026
42094
  const resolvedEntity = isSchemaEntity ? entity : void 0;
42027
42095
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
42028
- const normalizedInitialData = React86__default.useMemo(() => {
42096
+ const normalizedInitialData = React90__default.useMemo(() => {
42029
42097
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
42030
42098
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
42031
42099
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
42032
42100
  }, [entity, initialData]);
42033
- const entityDerivedFields = React86__default.useMemo(() => {
42101
+ const entityDerivedFields = React90__default.useMemo(() => {
42034
42102
  if (fields && fields.length > 0) return void 0;
42035
42103
  if (!resolvedEntity) return void 0;
42036
42104
  return resolvedEntity.fields.map(
@@ -42038,6 +42106,7 @@ var init_Form = __esm({
42038
42106
  name: f3.name,
42039
42107
  type: f3.type,
42040
42108
  required: f3.required,
42109
+ // EntityField.default is typed `unknown` upstream — safe cast: schema defaults are always FieldValues.
42041
42110
  defaultValue: f3.default,
42042
42111
  // EntityField is a discriminated union — `values` lives on Scalar/Enum, `relation` lives on Relation.
42043
42112
  values: "values" in f3 ? f3.values : void 0,
@@ -42050,16 +42119,16 @@ var init_Form = __esm({
42050
42119
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
42051
42120
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
42052
42121
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
42053
- const [formData, setFormData] = React86__default.useState(
42122
+ const [formData, setFormData] = React90__default.useState(
42054
42123
  normalizedInitialData
42055
42124
  );
42056
- const [collapsedSections, setCollapsedSections] = React86__default.useState(
42125
+ const [collapsedSections, setCollapsedSections] = React90__default.useState(
42057
42126
  /* @__PURE__ */ new Set()
42058
42127
  );
42059
- const [submitError, setSubmitError] = React86__default.useState(null);
42060
- const formRef = React86__default.useRef(null);
42128
+ const [submitError, setSubmitError] = React90__default.useState(null);
42129
+ const formRef = React90__default.useRef(null);
42061
42130
  const formMode = props.mode;
42062
- const mountedRef = React86__default.useRef(false);
42131
+ const mountedRef = React90__default.useRef(false);
42063
42132
  if (!mountedRef.current) {
42064
42133
  mountedRef.current = true;
42065
42134
  debug("forms", "mount", {
@@ -42072,7 +42141,7 @@ var init_Form = __esm({
42072
42141
  });
42073
42142
  }
42074
42143
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
42075
- const evalContext = React86__default.useMemo(
42144
+ const evalContext = React90__default.useMemo(
42076
42145
  () => ({
42077
42146
  formValues: formData,
42078
42147
  globalVariables: externalContext?.globalVariables ?? {},
@@ -42081,7 +42150,7 @@ var init_Form = __esm({
42081
42150
  }),
42082
42151
  [formData, externalContext]
42083
42152
  );
42084
- React86__default.useEffect(() => {
42153
+ React90__default.useEffect(() => {
42085
42154
  debug("forms", "initialData-sync", {
42086
42155
  mode: formMode,
42087
42156
  normalizedInitialData,
@@ -42092,7 +42161,7 @@ var init_Form = __esm({
42092
42161
  setFormData(normalizedInitialData);
42093
42162
  }
42094
42163
  }, [normalizedInitialData]);
42095
- const processCalculations = React86__default.useCallback(
42164
+ const processCalculations = React90__default.useCallback(
42096
42165
  (changedFieldId, newFormData) => {
42097
42166
  if (!hiddenCalculations.length) return;
42098
42167
  const context = {
@@ -42117,7 +42186,7 @@ var init_Form = __esm({
42117
42186
  },
42118
42187
  [hiddenCalculations, externalContext, eventBus]
42119
42188
  );
42120
- const checkViolations = React86__default.useCallback(
42189
+ const checkViolations = React90__default.useCallback(
42121
42190
  (changedFieldId, newFormData) => {
42122
42191
  if (!violationTriggers.length) return;
42123
42192
  const context = {
@@ -42155,7 +42224,7 @@ var init_Form = __esm({
42155
42224
  processCalculations(name, newFormData);
42156
42225
  checkViolations(name, newFormData);
42157
42226
  };
42158
- const isFieldVisible = React86__default.useCallback(
42227
+ const isFieldVisible = React90__default.useCallback(
42159
42228
  (fieldName) => {
42160
42229
  const condition = conditionalFields[fieldName];
42161
42230
  if (!condition) return true;
@@ -42163,7 +42232,7 @@ var init_Form = __esm({
42163
42232
  },
42164
42233
  [conditionalFields, evalContext]
42165
42234
  );
42166
- const isSectionVisible = React86__default.useCallback(
42235
+ const isSectionVisible = React90__default.useCallback(
42167
42236
  (section) => {
42168
42237
  if (!section.condition) return true;
42169
42238
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -42239,7 +42308,7 @@ var init_Form = __esm({
42239
42308
  eventBus.emit(`UI:${onCancel}`);
42240
42309
  }
42241
42310
  };
42242
- const renderField = React86__default.useCallback(
42311
+ const renderField = React90__default.useCallback(
42243
42312
  (field) => {
42244
42313
  const fieldName = field.name || field.field;
42245
42314
  if (!fieldName) return null;
@@ -42260,7 +42329,7 @@ var init_Form = __esm({
42260
42329
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
42261
42330
  );
42262
42331
  const effectiveFields = entityDerivedFields ?? fields;
42263
- const normalizedFields = React86__default.useMemo(() => {
42332
+ const normalizedFields = React90__default.useMemo(() => {
42264
42333
  if (!effectiveFields || effectiveFields.length === 0) return [];
42265
42334
  return effectiveFields.map((field) => {
42266
42335
  if (typeof field === "string") {
@@ -42270,6 +42339,7 @@ var init_Form = __esm({
42270
42339
  name: field,
42271
42340
  type: entityField.type,
42272
42341
  required: entityField.required,
42342
+ // EntityField.default is typed `unknown` upstream — safe cast: schema defaults are always FieldValues.
42273
42343
  defaultValue: entityField.default,
42274
42344
  // EntityField is a discriminated union — `values` lives on Scalar/Enum, `relation` lives on Relation.
42275
42345
  values: "values" in entityField ? entityField.values : void 0,
@@ -42283,7 +42353,7 @@ var init_Form = __esm({
42283
42353
  return field;
42284
42354
  });
42285
42355
  }, [effectiveFields, resolvedEntity]);
42286
- const schemaFields = React86__default.useMemo(() => {
42356
+ const schemaFields = React90__default.useMemo(() => {
42287
42357
  if (normalizedFields.length === 0) return null;
42288
42358
  if (isDebugEnabled()) {
42289
42359
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -42293,7 +42363,7 @@ var init_Form = __esm({
42293
42363
  }
42294
42364
  return normalizedFields.map(renderField).filter(Boolean);
42295
42365
  }, [normalizedFields, renderField, entityName, conditionalFields]);
42296
- const sectionElements = React86__default.useMemo(() => {
42366
+ const sectionElements = React90__default.useMemo(() => {
42297
42367
  if (!sections || sections.length === 0) return null;
42298
42368
  return sections.map((section) => {
42299
42369
  if (!isSectionVisible(section)) {
@@ -44549,6 +44619,14 @@ var init_GameBoard3D = __esm({
44549
44619
  GameBoard3D.displayName = "GameBoard3D";
44550
44620
  }
44551
44621
  });
44622
+ function asDescriptor(v) {
44623
+ if (Array.isArray(v) || React90__default.isValidElement(v)) return null;
44624
+ const o = v;
44625
+ if (typeof o.type !== "string") return null;
44626
+ const props = o.props !== void 0 && typeof o.props === "object" && !Array.isArray(o.props) && o.props !== null ? o.props : void 0;
44627
+ const _id = typeof o._id === "string" ? o._id : void 0;
44628
+ return { type: o.type, props, _id };
44629
+ }
44552
44630
  function getSlotContentRenderer2() {
44553
44631
  if (_scr) return _scr;
44554
44632
  const mod = (init_UISlotRenderer(), __toCommonJS(UISlotRenderer_exports));
@@ -44557,17 +44635,16 @@ function getSlotContentRenderer2() {
44557
44635
  }
44558
44636
  function resolveDescriptor(value, idPrefix) {
44559
44637
  if (value === null || value === void 0) return value;
44560
- if (React86__default.isValidElement(value)) return value;
44638
+ if (React90__default.isValidElement(value)) return value;
44561
44639
  if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
44562
44640
  if (Array.isArray(value)) {
44563
- return value.map((item, i) => /* @__PURE__ */ jsx(React86__default.Fragment, { children: resolveDescriptor(item, `${idPrefix}-${i}`) }, i));
44641
+ return value.map((item, i) => /* @__PURE__ */ jsx(React90__default.Fragment, { children: resolveDescriptor(item, `${idPrefix}-${i}`) }, i));
44564
44642
  }
44565
- if (typeof value === "object") {
44566
- const rec = value;
44567
- if (typeof rec.type === "string" && getComponentForPattern(rec.type) !== null) {
44568
- const { type, props: nestedProps, _id, ...flatProps } = rec;
44569
- const resolvedProps = nestedProps !== void 0 ? nestedProps : flatProps;
44570
- const content = { id: _id ?? idPrefix, pattern: type, props: resolvedProps, priority: 0 };
44643
+ if (typeof value === "object" && value !== null) {
44644
+ const desc = asDescriptor(value);
44645
+ if (desc !== null && getComponentForPattern(desc.type) !== null) {
44646
+ const resolvedProps = desc.props ?? {};
44647
+ const content = { id: desc._id ?? idPrefix, pattern: desc.type, props: resolvedProps, priority: 0 };
44571
44648
  const SCR = getSlotContentRenderer2();
44572
44649
  return /* @__PURE__ */ jsx(SCR, { content, onDismiss: () => void 0 });
44573
44650
  }
@@ -44661,16 +44738,19 @@ function getSlotContentRenderer3() {
44661
44738
  }
44662
44739
  function resolveDescriptor2(value, idPrefix) {
44663
44740
  if (value === null || value === void 0) return value;
44664
- if (React86__default.isValidElement(value)) return value;
44741
+ if (React90__default.isValidElement(value)) return value;
44665
44742
  if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
44666
44743
  if (Array.isArray(value)) {
44667
- return value.map((item, i) => /* @__PURE__ */ jsx(React86__default.Fragment, { children: resolveDescriptor2(item, `${idPrefix}-${i}`) }, i));
44744
+ return value.map((item, i) => /* @__PURE__ */ jsx(React90__default.Fragment, { children: resolveDescriptor2(item, `${idPrefix}-${i}`) }, i));
44668
44745
  }
44669
44746
  if (typeof value === "object") {
44670
44747
  const rec = value;
44671
44748
  if (typeof rec.type === "string" && getComponentForPattern(rec.type) !== null) {
44672
- const { type, props: nestedProps, _id, ...flatProps } = rec;
44673
- const resolvedProps = nestedProps !== void 0 ? nestedProps : flatProps;
44749
+ const type = rec.type;
44750
+ const _id = typeof rec._id === "string" ? rec._id : void 0;
44751
+ const nestedProps = rec.props !== void 0 && typeof rec.props === "object" && !Array.isArray(rec.props) && rec.props !== null ? rec.props : void 0;
44752
+ const { type: _t, props: _p, _id: _d, ...flatRest } = rec;
44753
+ const resolvedProps = nestedProps !== void 0 ? nestedProps : flatRest;
44674
44754
  const content = { id: _id ?? idPrefix, pattern: type, props: resolvedProps, priority: 0 };
44675
44755
  const SCR = getSlotContentRenderer3();
44676
44756
  return /* @__PURE__ */ jsx(SCR, { content, onDismiss: () => void 0 });
@@ -45374,7 +45454,7 @@ var init_List = __esm({
45374
45454
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
45375
45455
  return [];
45376
45456
  }, [entity]);
45377
- const getItemActions = React86__default.useCallback(
45457
+ const getItemActions = React90__default.useCallback(
45378
45458
  (item) => {
45379
45459
  if (!itemActions) return [];
45380
45460
  if (typeof itemActions === "function") {
@@ -45431,15 +45511,14 @@ var init_List = __esm({
45431
45511
  };
45432
45512
  if (effectiveFieldNames && effectiveFieldNames.length > 0) {
45433
45513
  const firstField = effectiveFieldNames[0];
45434
- const itemRecord = item;
45435
- if (!normalizedItem.title && getNestedValue(itemRecord, firstField)) {
45514
+ if (!normalizedItem.title && getNestedValue(item, firstField)) {
45436
45515
  normalizedItem.title = String(
45437
- getNestedValue(itemRecord, firstField)
45516
+ getNestedValue(item, firstField)
45438
45517
  );
45439
45518
  }
45440
45519
  normalizedItem._fields = effectiveFieldNames.reduce(
45441
45520
  (acc, field) => {
45442
- const value = getNestedValue(itemRecord, field);
45521
+ const value = getNestedValue(item, field);
45443
45522
  if (value !== void 0 && value !== null) {
45444
45523
  acc[field] = value;
45445
45524
  }
@@ -45892,16 +45971,18 @@ var init_MediaGallery = __esm({
45892
45971
  [selectable, selectedItems, selectionEvent, eventBus]
45893
45972
  );
45894
45973
  const entityData = Array.isArray(entity) ? entity : [];
45895
- const items = React86__default.useMemo(() => {
45974
+ const items = React90__default.useMemo(() => {
45896
45975
  if (propItems) return propItems;
45897
45976
  if (entityData.length === 0) return [];
45898
- return entityData.map((record, idx) => ({
45899
- id: String(record.id ?? idx),
45900
- src: String(record.src ?? record.url ?? record.image ?? ""),
45901
- alt: record.alt ? String(record.alt) : void 0,
45902
- thumbnail: record.thumbnail ? String(record.thumbnail) : void 0,
45903
- caption: record.caption ? String(record.caption) : record.title ? String(record.title) : void 0
45904
- }));
45977
+ return entityData.map((record, idx) => {
45978
+ return {
45979
+ id: String(record.id ?? idx),
45980
+ src: String(record.src ?? ("url" in record ? record.url : "") ?? ("image" in record ? record.image : "") ?? ""),
45981
+ alt: record.alt ? String(record.alt) : void 0,
45982
+ thumbnail: record.thumbnail ? String(record.thumbnail) : void 0,
45983
+ caption: record.caption ? String(record.caption) : "title" in record ? String(record.title) : void 0
45984
+ };
45985
+ });
45905
45986
  }, [propItems, entityData]);
45906
45987
  if (isLoading) {
45907
45988
  return /* @__PURE__ */ jsx(LoadingState, { message: t("common.loading"), className });
@@ -46095,7 +46176,7 @@ var init_MinigolfBoard = __esm({
46095
46176
  }
46096
46177
  });
46097
46178
  function extractTitle2(children) {
46098
- if (!React86__default.isValidElement(children)) return void 0;
46179
+ if (!React90__default.isValidElement(children)) return void 0;
46099
46180
  const props = children.props;
46100
46181
  if (typeof props.title === "string") {
46101
46182
  return props.title;
@@ -46161,8 +46242,16 @@ function NegotiatorBoard({
46161
46242
  const lastPlayerAction = str(resolved?.lastPlayerAction);
46162
46243
  const lastOpponentAction = str(resolved?.lastOpponentAction);
46163
46244
  const lastPayoff = num(resolved?.lastPayoff);
46164
- const actions = Array.isArray(resolved?.actions) ? resolved.actions : [];
46165
- const payoffMatrix = Array.isArray(resolved?.payoffMatrix) ? resolved.payoffMatrix : [];
46245
+ const actions = Array.isArray(resolved?.actions) ? resolved.actions.flatMap((item) => {
46246
+ if (item !== null && typeof item === "object" && !Array.isArray(item) && !(item instanceof Date) && typeof item.id === "string" && typeof item.label === "string")
46247
+ return [{ id: item.id, label: item.label, description: typeof item.description === "string" ? item.description : void 0 }];
46248
+ return [];
46249
+ }) : [];
46250
+ const payoffMatrix = Array.isArray(resolved?.payoffMatrix) ? resolved.payoffMatrix.flatMap((item) => {
46251
+ if (item !== null && typeof item === "object" && !Array.isArray(item) && !(item instanceof Date) && typeof item.playerAction === "string" && typeof item.opponentAction === "string")
46252
+ return [{ playerAction: item.playerAction, opponentAction: item.opponentAction, playerPayoff: typeof item.playerPayoff === "number" ? item.playerPayoff : 0, opponentPayoff: typeof item.opponentPayoff === "number" ? item.opponentPayoff : 0 }];
46253
+ return [];
46254
+ }) : [];
46166
46255
  const prevRoundRef = useRef(currentRound);
46167
46256
  useEffect(() => {
46168
46257
  if (currentRound > prevRoundRef.current && lastPlayerAction) {
@@ -47269,7 +47358,7 @@ var init_debugRegistry = __esm({
47269
47358
  }
47270
47359
  });
47271
47360
  function useDebugData() {
47272
- const [data, setData] = React86.useState(() => ({
47361
+ const [data, setData] = React90.useState(() => ({
47273
47362
  traits: [],
47274
47363
  ticks: [],
47275
47364
  guards: [],
@@ -47283,7 +47372,7 @@ function useDebugData() {
47283
47372
  },
47284
47373
  lastUpdate: Date.now()
47285
47374
  }));
47286
- React86.useEffect(() => {
47375
+ React90.useEffect(() => {
47287
47376
  const updateData = () => {
47288
47377
  setData({
47289
47378
  traits: getAllTraits(),
@@ -47392,12 +47481,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
47392
47481
  return positions;
47393
47482
  }
47394
47483
  function WalkMinimap() {
47395
- const [walkStep, setWalkStep] = React86.useState(null);
47396
- const [traits2, setTraits] = React86.useState([]);
47397
- const [coveredEdges, setCoveredEdges] = React86.useState([]);
47398
- const [completedTraits, setCompletedTraits] = React86.useState(/* @__PURE__ */ new Set());
47399
- const prevTraitRef = React86.useRef(null);
47400
- React86.useEffect(() => {
47484
+ const [walkStep, setWalkStep] = React90.useState(null);
47485
+ const [traits2, setTraits] = React90.useState([]);
47486
+ const [coveredEdges, setCoveredEdges] = React90.useState([]);
47487
+ const [completedTraits, setCompletedTraits] = React90.useState(/* @__PURE__ */ new Set());
47488
+ const prevTraitRef = React90.useRef(null);
47489
+ React90.useEffect(() => {
47401
47490
  const interval = setInterval(() => {
47402
47491
  const w = window;
47403
47492
  const step = w.__orbitalWalkStep;
@@ -47833,15 +47922,15 @@ var init_EntitiesTab = __esm({
47833
47922
  });
47834
47923
  function EventFlowTab({ events: events2 }) {
47835
47924
  const { t } = useTranslate();
47836
- const [filter, setFilter] = React86.useState("all");
47837
- const containerRef = React86.useRef(null);
47838
- const [autoScroll, setAutoScroll] = React86.useState(true);
47839
- React86.useEffect(() => {
47925
+ const [filter, setFilter] = React90.useState("all");
47926
+ const containerRef = React90.useRef(null);
47927
+ const [autoScroll, setAutoScroll] = React90.useState(true);
47928
+ React90.useEffect(() => {
47840
47929
  if (autoScroll && containerRef.current) {
47841
47930
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
47842
47931
  }
47843
47932
  }, [events2.length, autoScroll]);
47844
- const filteredEvents = React86.useMemo(() => {
47933
+ const filteredEvents = React90.useMemo(() => {
47845
47934
  if (filter === "all") return events2;
47846
47935
  return events2.filter((e) => e.type === filter);
47847
47936
  }, [events2, filter]);
@@ -47957,7 +48046,7 @@ var init_EventFlowTab = __esm({
47957
48046
  });
47958
48047
  function GuardsPanel({ guards }) {
47959
48048
  const { t } = useTranslate();
47960
- const [filter, setFilter] = React86.useState("all");
48049
+ const [filter, setFilter] = React90.useState("all");
47961
48050
  if (guards.length === 0) {
47962
48051
  return /* @__PURE__ */ jsx(
47963
48052
  EmptyState,
@@ -47970,7 +48059,7 @@ function GuardsPanel({ guards }) {
47970
48059
  }
47971
48060
  const passedCount = guards.filter((g) => g.result).length;
47972
48061
  const failedCount = guards.length - passedCount;
47973
- const filteredGuards = React86.useMemo(() => {
48062
+ const filteredGuards = React90.useMemo(() => {
47974
48063
  if (filter === "all") return guards;
47975
48064
  if (filter === "passed") return guards.filter((g) => g.result);
47976
48065
  return guards.filter((g) => !g.result);
@@ -48133,10 +48222,10 @@ function EffectBadge({ effect }) {
48133
48222
  }
48134
48223
  function TransitionTimeline({ transitions }) {
48135
48224
  const { t } = useTranslate();
48136
- const containerRef = React86.useRef(null);
48137
- const [autoScroll, setAutoScroll] = React86.useState(true);
48138
- const [expandedId, setExpandedId] = React86.useState(null);
48139
- React86.useEffect(() => {
48225
+ const containerRef = React90.useRef(null);
48226
+ const [autoScroll, setAutoScroll] = React90.useState(true);
48227
+ const [expandedId, setExpandedId] = React90.useState(null);
48228
+ React90.useEffect(() => {
48140
48229
  if (autoScroll && containerRef.current) {
48141
48230
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
48142
48231
  }
@@ -48342,18 +48431,18 @@ var init_ServerBridgeTab = __esm({
48342
48431
  });
48343
48432
  function extractPayloadFields(schema, eventName) {
48344
48433
  if (!schema) return [];
48345
- const orbitals = schema.orbitals;
48346
- if (!orbitals) return [];
48347
- for (const orbital of orbitals) {
48348
- const traits2 = orbital.traits ?? [];
48349
- for (const trait of traits2) {
48350
- const sm = trait.stateMachine;
48434
+ for (const orbital of schema.orbitals) {
48435
+ const traitRefs = orbital.traits ?? [];
48436
+ for (const traitRef of traitRefs) {
48437
+ if (!isInlineTrait(traitRef)) continue;
48438
+ const inlineTrait = traitRef;
48439
+ const sm = inlineTrait.stateMachine;
48351
48440
  if (!sm) continue;
48352
48441
  const events2 = sm.events ?? [];
48353
48442
  for (const evt of events2) {
48354
48443
  if (evt.name !== eventName) continue;
48355
- const payload = evt.payload ?? [];
48356
- return payload.map((f3) => ({
48444
+ const payloadFields = evt.payloadSchema ?? [];
48445
+ return payloadFields.map((f3) => ({
48357
48446
  name: f3.name,
48358
48447
  type: f3.type ?? "string"
48359
48448
  }));
@@ -48416,9 +48505,9 @@ function getAllEvents(traits2) {
48416
48505
  function EventDispatcherTab({ traits: traits2, schema }) {
48417
48506
  const eventBus = useEventBus();
48418
48507
  const { t } = useTranslate();
48419
- const [log13, setLog] = React86.useState([]);
48420
- const prevStatesRef = React86.useRef(/* @__PURE__ */ new Map());
48421
- React86.useEffect(() => {
48508
+ const [log13, setLog] = React90.useState([]);
48509
+ const prevStatesRef = React90.useRef(/* @__PURE__ */ new Map());
48510
+ React90.useEffect(() => {
48422
48511
  for (const trait of traits2) {
48423
48512
  const prev = prevStatesRef.current.get(trait.id);
48424
48513
  if (prev && prev !== trait.currentState) {
@@ -48587,10 +48676,10 @@ function VerifyModePanel({
48587
48676
  localCount
48588
48677
  }) {
48589
48678
  const { t } = useTranslate();
48590
- const [expanded, setExpanded] = React86.useState(true);
48591
- const scrollRef = React86.useRef(null);
48592
- const prevCountRef = React86.useRef(0);
48593
- React86.useEffect(() => {
48679
+ const [expanded, setExpanded] = React90.useState(true);
48680
+ const scrollRef = React90.useRef(null);
48681
+ const prevCountRef = React90.useRef(0);
48682
+ React90.useEffect(() => {
48594
48683
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
48595
48684
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
48596
48685
  }
@@ -48647,10 +48736,10 @@ function RuntimeDebugger({
48647
48736
  schema
48648
48737
  }) {
48649
48738
  const { t } = useTranslate();
48650
- const [isCollapsed, setIsCollapsed] = React86.useState(mode === "verify" ? true : defaultCollapsed);
48651
- const [isVisible, setIsVisible] = React86.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
48739
+ const [isCollapsed, setIsCollapsed] = React90.useState(mode === "verify" ? true : defaultCollapsed);
48740
+ const [isVisible, setIsVisible] = React90.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
48652
48741
  const debugData = useDebugData();
48653
- React86.useEffect(() => {
48742
+ React90.useEffect(() => {
48654
48743
  if (mode === "inline") return;
48655
48744
  return onDebugToggle((enabled) => {
48656
48745
  setIsVisible(enabled);
@@ -48659,7 +48748,7 @@ function RuntimeDebugger({
48659
48748
  }
48660
48749
  });
48661
48750
  }, [mode]);
48662
- React86.useEffect(() => {
48751
+ React90.useEffect(() => {
48663
48752
  if (mode === "inline") return;
48664
48753
  const handleKeyDown = (e) => {
48665
48754
  if (e.key === "`" && isVisible) {
@@ -49219,7 +49308,7 @@ function SequenceBar({
49219
49308
  onSlotRemove(index);
49220
49309
  }, [onSlotRemove, playing]);
49221
49310
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
49222
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
49311
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
49223
49312
  i > 0 && /* @__PURE__ */ jsx(
49224
49313
  Typography,
49225
49314
  {
@@ -49834,6 +49923,29 @@ var init_SimulationCanvas = __esm({
49834
49923
  SimulationCanvas.displayName = "SimulationCanvas";
49835
49924
  }
49836
49925
  });
49926
+ function readSimulatorParameters(v) {
49927
+ if (!Array.isArray(v)) return [];
49928
+ const result = [];
49929
+ for (const item of v) {
49930
+ if (typeof item === "object" && item !== null && !Array.isArray(item) && !(item instanceof Date)) {
49931
+ const param = item;
49932
+ if ("id" in item && "label" in item && "unit" in item && "min" in item && "max" in item && "step" in item) {
49933
+ result.push({
49934
+ id: str(param.id),
49935
+ label: str(param.label),
49936
+ unit: str(param.unit),
49937
+ min: num(param.min),
49938
+ max: num(param.max),
49939
+ step: num(param.step),
49940
+ initial: num(param.initial),
49941
+ correct: num(param.correct),
49942
+ tolerance: num(param.tolerance)
49943
+ });
49944
+ }
49945
+ }
49946
+ }
49947
+ return result;
49948
+ }
49837
49949
  function SimulatorBoard({
49838
49950
  entity,
49839
49951
  completeEvent = "PUZZLE_COMPLETE",
@@ -49846,7 +49958,7 @@ function SimulatorBoard({
49846
49958
  const { emit } = useEventBus();
49847
49959
  const { t } = useTranslate();
49848
49960
  const resolved = boardEntity(entity);
49849
- const parameters = Array.isArray(resolved?.parameters) ? resolved.parameters : [];
49961
+ const parameters = readSimulatorParameters(resolved?.parameters);
49850
49962
  const [headerError, setHeaderError] = useState(false);
49851
49963
  if (!resolved) return null;
49852
49964
  const paramA = num(resolved.paramA);
@@ -49873,8 +49985,14 @@ function SimulatorBoard({
49873
49985
  const handlePlayAgain = () => {
49874
49986
  if (playAgainEvent) emit(`UI:${playAgainEvent}`, {});
49875
49987
  };
49876
- const theme = resolved.theme ?? void 0;
49877
- const themeBackground = theme?.background;
49988
+ const themeBackground = (() => {
49989
+ const t2 = resolved.theme;
49990
+ if (typeof t2 === "object" && t2 !== null && !Array.isArray(t2) && !(t2 instanceof Date)) {
49991
+ const bg = t2.background;
49992
+ return str(bg);
49993
+ }
49994
+ return "";
49995
+ })();
49878
49996
  const headerImage = str(resolved.headerImage);
49879
49997
  const hint = str(resolved.hint);
49880
49998
  const showHint = isComplete && !isWin && attempts >= 2 && Boolean(hint);
@@ -50279,7 +50397,7 @@ var init_StatCard = __esm({
50279
50397
  const labelToUse = propLabel ?? propTitle;
50280
50398
  const eventBus = useEventBus();
50281
50399
  const { t } = useTranslate();
50282
- const handleActionClick = React86__default.useCallback(() => {
50400
+ const handleActionClick = React90__default.useCallback(() => {
50283
50401
  if (action?.event) {
50284
50402
  eventBus.emit(`UI:${action.event}`, {});
50285
50403
  }
@@ -50290,7 +50408,7 @@ var init_StatCard = __esm({
50290
50408
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
50291
50409
  const isLoading = externalLoading ?? false;
50292
50410
  const error = externalError;
50293
- const computeMetricValue = React86__default.useCallback(
50411
+ const computeMetricValue = React90__default.useCallback(
50294
50412
  (metric, items) => {
50295
50413
  if (metric.value !== void 0) {
50296
50414
  return metric.value;
@@ -50329,7 +50447,7 @@ var init_StatCard = __esm({
50329
50447
  },
50330
50448
  []
50331
50449
  );
50332
- const schemaStats = React86__default.useMemo(() => {
50450
+ const schemaStats = React90__default.useMemo(() => {
50333
50451
  if (!metrics || metrics.length === 0) return null;
50334
50452
  return metrics.map((metric) => ({
50335
50453
  label: metric.label,
@@ -50337,7 +50455,7 @@ var init_StatCard = __esm({
50337
50455
  format: metric.format
50338
50456
  }));
50339
50457
  }, [metrics, data, computeMetricValue]);
50340
- const calculatedTrend = React86__default.useMemo(() => {
50458
+ const calculatedTrend = React90__default.useMemo(() => {
50341
50459
  if (manualTrend !== void 0) return manualTrend;
50342
50460
  if (previousValue === void 0 || currentValue === void 0)
50343
50461
  return void 0;
@@ -50680,8 +50798,25 @@ function StateArchitectBoard({
50680
50798
  const initialState = str(resolved?.initialState);
50681
50799
  const entityName = str(resolved?.entityName);
50682
50800
  const availableEvents = Array.isArray(resolved?.availableEvents) ? resolved.availableEvents : [];
50683
- const testCases = Array.isArray(resolved?.testCases) ? resolved.testCases : [];
50684
- const entityTransitions = Array.isArray(resolved?.transitions) ? resolved.transitions : [];
50801
+ const testCases = (Array.isArray(resolved?.testCases) ? resolved.testCases : []).map((item) => {
50802
+ const o = typeof item === "object" && item !== null && !Array.isArray(item) ? item : {};
50803
+ const eventsField = o["events"];
50804
+ return {
50805
+ events: Array.isArray(eventsField) ? eventsField : [],
50806
+ expectedState: str(o["expectedState"]),
50807
+ label: str(o["label"])
50808
+ };
50809
+ });
50810
+ const entityTransitions = (Array.isArray(resolved?.transitions) ? resolved.transitions : []).map((item) => {
50811
+ const o = typeof item === "object" && item !== null && !Array.isArray(item) ? item : {};
50812
+ return {
50813
+ id: str(o["id"]),
50814
+ from: str(o["from"]),
50815
+ to: str(o["to"]),
50816
+ event: str(o["event"]),
50817
+ ...o["guardHint"] ? { guardHint: str(o["guardHint"]) } : {}
50818
+ };
50819
+ });
50685
50820
  const entityVariables = rows(resolved?.variables);
50686
50821
  const transitions = entityTransitions;
50687
50822
  const attempts = typeof resolved?.attempts === "number" ? resolved.attempts : 0;
@@ -51526,8 +51661,8 @@ var init_SubagentTracePanel = __esm({
51526
51661
  ] });
51527
51662
  };
51528
51663
  InlineActivityStream = ({ activities, autoScroll = true, className }) => {
51529
- const endRef = React86__default.useRef(null);
51530
- React86__default.useEffect(() => {
51664
+ const endRef = React90__default.useRef(null);
51665
+ React90__default.useEffect(() => {
51531
51666
  if (!autoScroll) return;
51532
51667
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
51533
51668
  }, [activities.length, autoScroll]);
@@ -51621,7 +51756,7 @@ var init_SubagentTracePanel = __esm({
51621
51756
  };
51622
51757
  SubagentRichCard = ({ subagent }) => {
51623
51758
  const { t } = useTranslate();
51624
- const activities = React86__default.useMemo(
51759
+ const activities = React90__default.useMemo(
51625
51760
  () => subagentMessagesToActivities(subagent.messages),
51626
51761
  [subagent.messages]
51627
51762
  );
@@ -51698,8 +51833,8 @@ var init_SubagentTracePanel = __esm({
51698
51833
  ] });
51699
51834
  };
51700
51835
  CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
51701
- const endRef = React86__default.useRef(null);
51702
- React86__default.useEffect(() => {
51836
+ const endRef = React90__default.useRef(null);
51837
+ React90__default.useEffect(() => {
51703
51838
  if (!autoScroll) return;
51704
51839
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
51705
51840
  }, [messages.length, autoScroll]);
@@ -52170,17 +52305,12 @@ var init_Timeline = __esm({
52170
52305
  look = "vertical-spacious"
52171
52306
  }) => {
52172
52307
  const { t } = useTranslate();
52173
- const entityData = Array.isArray(entity) ? entity : [];
52174
- const items = React86__default.useMemo(() => {
52308
+ const entityData = entity ?? [];
52309
+ const items = React90__default.useMemo(() => {
52175
52310
  if (propItems) return propItems;
52176
52311
  if (entityData.length === 0) return [];
52177
52312
  return entityData.map((record, idx) => {
52178
- const resolveField = (f3) => {
52179
- if (typeof f3 === "string") return f3;
52180
- if (f3 && typeof f3 === "object" && "name" in f3) return String(f3.name);
52181
- return "";
52182
- };
52183
- const resolvedFields = fields?.map(resolveField) ?? [];
52313
+ const resolvedFields = fields ?? [];
52184
52314
  const titleField = resolvedFields[0] || "title";
52185
52315
  const descField = resolvedFields[1] || "description";
52186
52316
  const dateField = resolvedFields.find(
@@ -52278,7 +52408,7 @@ var init_Timeline = __esm({
52278
52408
  }
52279
52409
  });
52280
52410
  function extractToastProps(children) {
52281
- if (!React86__default.isValidElement(children)) {
52411
+ if (!React90__default.isValidElement(children)) {
52282
52412
  if (typeof children === "string") {
52283
52413
  return { message: children };
52284
52414
  }
@@ -52316,7 +52446,7 @@ var init_ToastSlot = __esm({
52316
52446
  eventBus.emit("UI:CLOSE");
52317
52447
  };
52318
52448
  if (!isVisible) return null;
52319
- const isCustomContent = React86__default.isValidElement(children) && !message;
52449
+ const isCustomContent = React90__default.isValidElement(children) && !message;
52320
52450
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
52321
52451
  Toast,
52322
52452
  {
@@ -53588,7 +53718,7 @@ function WorldMapBoard({
53588
53718
  const resolved = boardEntity(entity);
53589
53719
  const entityUnits = rows(resolved?.units);
53590
53720
  const entityTiles = rows(resolved?.tiles);
53591
- const features = propFeatures ?? (Array.isArray(resolved?.features) ? resolved.features : []);
53721
+ const features = propFeatures ?? rows(resolved?.features);
53592
53722
  const selectedHeroId = resolved?.selectedHeroId ?? null;
53593
53723
  const assetManifest = propAssetManifest ?? resolved?.assetManifest;
53594
53724
  const backgroundImage = resolved?.backgroundImage;
@@ -53721,7 +53851,8 @@ function WorldMapBoard({
53721
53851
  if (heroMoveEvent) {
53722
53852
  eventBus.emit(`UI:${heroMoveEvent}`, { heroId, toX: x, toY: y });
53723
53853
  }
53724
- const feature = tile ? str(tile.feature) : "";
53854
+ const tileWithFeature = tile;
53855
+ const feature = tileWithFeature ? str(tileWithFeature.feature) : "";
53725
53856
  if (feature && feature !== "none") {
53726
53857
  const tileRow = tile;
53727
53858
  onFeatureEnter?.(heroId, tileRow);
@@ -53932,7 +54063,7 @@ var init_WorldMapTemplate = __esm({
53932
54063
  }
53933
54064
  });
53934
54065
  function lazyThree(name, loader) {
53935
- const Lazy = React86__default.lazy(
54066
+ const Lazy = React90__default.lazy(
53936
54067
  () => loader().then((m) => {
53937
54068
  const Resolved = m[name];
53938
54069
  if (!Resolved) {
@@ -53944,13 +54075,13 @@ function lazyThree(name, loader) {
53944
54075
  })
53945
54076
  );
53946
54077
  function ThreeWrapper(props) {
53947
- return React86__default.createElement(
54078
+ return React90__default.createElement(
53948
54079
  ThreeBoundary,
53949
54080
  { name },
53950
- React86__default.createElement(
53951
- React86__default.Suspense,
54081
+ React90__default.createElement(
54082
+ React90__default.Suspense,
53952
54083
  { fallback: null },
53953
- React86__default.createElement(Lazy, props)
54084
+ React90__default.createElement(Lazy, props)
53954
54085
  )
53955
54086
  );
53956
54087
  }
@@ -54273,7 +54404,7 @@ var init_component_registry_generated = __esm({
54273
54404
  init_WorldMapBoard();
54274
54405
  init_WorldMapTemplate();
54275
54406
  init_XPBar();
54276
- ThreeBoundary = class extends React86__default.Component {
54407
+ ThreeBoundary = class extends React90__default.Component {
54277
54408
  constructor() {
54278
54409
  super(...arguments);
54279
54410
  __publicField(this, "state", { failed: false });
@@ -54283,7 +54414,7 @@ var init_component_registry_generated = __esm({
54283
54414
  }
54284
54415
  render() {
54285
54416
  if (this.state.failed) {
54286
- return React86__default.createElement(
54417
+ return React90__default.createElement(
54287
54418
  "div",
54288
54419
  {
54289
54420
  "data-testid": "three-unavailable",
@@ -54649,7 +54780,7 @@ function SuspenseConfigProvider({
54649
54780
  config,
54650
54781
  children
54651
54782
  }) {
54652
- return React86__default.createElement(
54783
+ return React90__default.createElement(
54653
54784
  SuspenseConfigContext.Provider,
54654
54785
  { value: config },
54655
54786
  children
@@ -54665,9 +54796,7 @@ function getComponentForPattern3(patternType) {
54665
54796
  if (!mapping) {
54666
54797
  return null;
54667
54798
  }
54668
- const name = typeof mapping === "string" ? mapping : mapping.component;
54669
- if (!name) return null;
54670
- return COMPONENT_REGISTRY[name] ?? null;
54799
+ return COMPONENT_REGISTRY[mapping] ?? null;
54671
54800
  }
54672
54801
  function enrichFormFields(fields, entityDef) {
54673
54802
  const fieldMap = new Map(entityDef.fields.map((f3) => [f3.name, f3]));
@@ -54679,7 +54808,7 @@ function enrichFormFields(fields, entityDef) {
54679
54808
  name: field,
54680
54809
  label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()),
54681
54810
  type: entityField.type,
54682
- required: entityField.required
54811
+ required: entityField.required ?? false
54683
54812
  };
54684
54813
  if (entityField.values && entityField.values.length > 0) {
54685
54814
  enriched.values = entityField.values;
@@ -54687,15 +54816,15 @@ function enrichFormFields(fields, entityDef) {
54687
54816
  enriched.values = entityField.enumValues;
54688
54817
  }
54689
54818
  if (entityField.relation) {
54690
- enriched.relation = entityField.relation;
54819
+ enriched.relation = entityField.relation.entity;
54691
54820
  }
54692
54821
  return enriched;
54693
54822
  }
54694
54823
  return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
54695
54824
  }
54696
- if (field && typeof field === "object" && !Array.isArray(field)) {
54825
+ if (field && typeof field === "object" && !Array.isArray(field) && !React90__default.isValidElement(field) && !(field instanceof Date)) {
54697
54826
  const obj = field;
54698
- const fieldName = obj.name ?? obj.field;
54827
+ const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
54699
54828
  if (!fieldName) return field;
54700
54829
  if (obj.type || obj.inputType) return field;
54701
54830
  const entityField = fieldMap.get(fieldName);
@@ -54712,7 +54841,7 @@ function enrichFormFields(fields, entityDef) {
54712
54841
  }
54713
54842
  }
54714
54843
  if (!obj.relation && entityField.relation) {
54715
- enriched.relation = entityField.relation;
54844
+ enriched.relation = entityField.relation.entity;
54716
54845
  }
54717
54846
  return enriched;
54718
54847
  }
@@ -55139,7 +55268,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
55139
55268
  const key = `${parentId}-${index}-trait:${traitName}`;
55140
55269
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
55141
55270
  }
55142
- return /* @__PURE__ */ jsx(React86__default.Fragment, { children: child }, `${parentId}-${index}`);
55271
+ return /* @__PURE__ */ jsx(React90__default.Fragment, { children: child }, `${parentId}-${index}`);
55143
55272
  }
55144
55273
  if (!child || typeof child !== "object") return null;
55145
55274
  const childId = `${parentId}-${index}`;
@@ -55179,14 +55308,14 @@ function isPatternConfig(value) {
55179
55308
  if (value === null || value === void 0) return false;
55180
55309
  if (typeof value !== "object") return false;
55181
55310
  if (Array.isArray(value)) return false;
55182
- if (React86__default.isValidElement(value)) return false;
55311
+ if (React90__default.isValidElement(value)) return false;
55183
55312
  if (value instanceof Date) return false;
55184
55313
  if (typeof value === "function") return false;
55185
55314
  const record = value;
55186
55315
  return "type" in record && typeof record.type === "string" && getComponentForPattern(record.type) !== null;
55187
55316
  }
55188
55317
  function isPlainConfigObject(value) {
55189
- if (React86__default.isValidElement(value)) return false;
55318
+ if (React90__default.isValidElement(value)) return false;
55190
55319
  if (value instanceof Date) return false;
55191
55320
  const proto = Object.getPrototypeOf(value);
55192
55321
  return proto === Object.prototype || proto === null;
@@ -55312,7 +55441,7 @@ function SlotContentRenderer({
55312
55441
  for (const slotKey of CONTENT_NODE_SLOTS) {
55313
55442
  const slotVal = restProps[slotKey];
55314
55443
  if (slotVal === void 0 || slotVal === null) continue;
55315
- if (React86__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
55444
+ if (React90__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
55316
55445
  if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
55317
55446
  nodeSlotOverrides[slotKey] = renderPatternChildren(
55318
55447
  slotVal,
@@ -55357,19 +55486,18 @@ function SlotContentRenderer({
55357
55486
  for (const [k, v] of Object.entries(nodeSlotOverrides)) {
55358
55487
  finalProps[k] = v;
55359
55488
  }
55360
- const resolvedItems = Array.isArray(
55361
- finalProps.entity
55362
- ) ? finalProps.entity : null;
55489
+ const entityVal = finalProps.entity;
55490
+ const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
55363
55491
  if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
55364
55492
  const sample = resolvedItems[0];
55365
- if (sample && typeof sample === "object") {
55493
+ if (sample && typeof sample === "object" && !Array.isArray(sample) && !React90__default.isValidElement(sample) && !(sample instanceof Date)) {
55366
55494
  const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
55367
55495
  finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
55368
55496
  }
55369
55497
  }
55370
55498
  const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
55371
- if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
55372
- finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
55499
+ if (isFormPattern && entityDef && Array.isArray(finalProps.fields) && finalProps.fields[0] !== "fn") {
55500
+ finalProps.fields = enrichFormFields([...finalProps.fields], entityDef);
55373
55501
  }
55374
55502
  const acceptsChildren = PATTERNS_WITH_CHILDREN.has(content.pattern);
55375
55503
  return /* @__PURE__ */ jsx(