@almadar/ui 5.79.2 → 5.80.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 (80) hide show
  1. package/dist/avl/index.cjs +1673 -1590
  2. package/dist/avl/index.css +3 -3
  3. package/dist/avl/index.js +464 -381
  4. package/dist/components/core/atoms/FlipContainer.d.ts +1 -1
  5. package/dist/components/core/molecules/Card.d.ts +1 -1
  6. package/dist/components/core/molecules/DataGrid.d.ts +1 -1
  7. package/dist/components/core/molecules/DataList.d.ts +1 -1
  8. package/dist/components/core/molecules/DocPagination.d.ts +1 -8
  9. package/dist/components/core/molecules/DocSearch.d.ts +1 -8
  10. package/dist/components/core/molecules/FlipCard.d.ts +1 -1
  11. package/dist/components/core/molecules/MapView.d.ts +1 -18
  12. package/dist/components/core/molecules/SortableList.d.ts +1 -1
  13. package/dist/components/core/molecules/TableView.d.ts +1 -1
  14. package/dist/components/core/molecules/WizardContainer.d.ts +7 -1
  15. package/dist/components/core/organisms/DataTable.d.ts +1 -1
  16. package/dist/components/core/organisms/DrawerSlot.d.ts +2 -0
  17. package/dist/components/core/organisms/ModalSlot.d.ts +2 -0
  18. package/dist/components/core/organisms/ToastSlot.d.ts +2 -0
  19. package/dist/components/core/organisms/debug/RuntimeDebugger.d.ts +1 -10
  20. package/dist/components/core/organisms/debug/tabs/EntitiesTab.d.ts +1 -2
  21. package/dist/components/core/organisms/debug/tabs/EventDispatcherTab.d.ts +1 -2
  22. package/dist/components/core/organisms/debug/tabs/EventFlowTab.d.ts +1 -6
  23. package/dist/components/core/organisms/debug/tabs/GuardsPanel.d.ts +1 -6
  24. package/dist/components/core/organisms/debug/tabs/ServerBridgeTab.d.ts +1 -12
  25. package/dist/components/core/organisms/debug/tabs/TicksTab.d.ts +1 -2
  26. package/dist/components/core/organisms/debug/tabs/TraitsTab.d.ts +1 -2
  27. package/dist/components/core/organisms/debug/tabs/TransitionTimeline.d.ts +1 -11
  28. package/dist/components/core/organisms/debug/tabs/VerificationTab.d.ts +1 -8
  29. package/dist/components/core/templates/CounterTemplate.d.ts +7 -0
  30. package/dist/components/game/2d/atoms/ActionButton.d.ts +4 -3
  31. package/dist/components/game/2d/atoms/ChoiceButton.d.ts +4 -3
  32. package/dist/components/game/2d/atoms/ComboCounter.d.ts +1 -2
  33. package/dist/components/game/2d/atoms/ControlButton.d.ts +1 -2
  34. package/dist/components/game/2d/atoms/DamageNumber.d.ts +1 -2
  35. package/dist/components/game/2d/atoms/DialogueBubble.d.ts +1 -2
  36. package/dist/components/game/2d/atoms/GameAudioToggle.d.ts +6 -1
  37. package/dist/components/game/2d/atoms/GameIcon.d.ts +1 -2
  38. package/dist/components/game/2d/atoms/HealthBar.d.ts +6 -2
  39. package/dist/components/game/2d/atoms/ItemSlot.d.ts +4 -3
  40. package/dist/components/game/2d/atoms/MiniMap.d.ts +6 -2
  41. package/dist/components/game/2d/atoms/ResourceCounter.d.ts +1 -2
  42. package/dist/components/game/2d/atoms/ScoreDisplay.d.ts +1 -2
  43. package/dist/components/game/2d/atoms/StatusEffect.d.ts +1 -2
  44. package/dist/components/game/2d/atoms/TimerDisplay.d.ts +4 -2
  45. package/dist/components/game/2d/atoms/TurnIndicator.d.ts +1 -2
  46. package/dist/components/game/2d/atoms/WaypointMarker.d.ts +1 -2
  47. package/dist/components/game/2d/molecules/ControlGrid.d.ts +3 -1
  48. package/dist/components/game/2d/molecules/GameHud.d.ts +1 -2
  49. package/dist/components/game/2d/molecules/GameMenu.d.ts +4 -8
  50. package/dist/components/game/2d/molecules/InventoryGrid.d.ts +1 -2
  51. package/dist/components/game/2d/molecules/ResourceBar.d.ts +1 -2
  52. package/dist/components/game/2d/molecules/StatBadge.d.ts +1 -2
  53. package/dist/components/game/2d/organisms/CityBuilderBoard.d.ts +2 -0
  54. package/dist/components/game/2d/organisms/PlatformerBoard.d.ts +3 -1
  55. package/dist/components/game/2d/organisms/RoguelikeBoard.d.ts +2 -0
  56. package/dist/components/game/2d/organisms/SequencerBoard.d.ts +5 -1
  57. package/dist/components/game/2d/organisms/SimulationControls.d.ts +25 -8
  58. package/dist/components/game/2d/organisms/TanksBoard.d.ts +4 -2
  59. package/dist/components/game/2d/organisms/TopDownShooterBoard.d.ts +2 -0
  60. package/dist/components/game/2d/organisms/TowerDefenseBoard.d.ts +2 -0
  61. package/dist/components/game/2d/organisms/TraitSlot.d.ts +5 -5
  62. package/dist/components/game/2d/templates/GameShell.d.ts +5 -0
  63. package/dist/components/game/2d/templates/GameTemplate.d.ts +3 -0
  64. package/dist/components/game/shared/lib/editorUtils.d.ts +8 -8
  65. package/dist/components/index.cjs +270 -155
  66. package/dist/components/index.css +3 -3
  67. package/dist/components/index.js +272 -157
  68. package/dist/hooks/useGitHub.d.ts +7 -7
  69. package/dist/marketing/index.cjs +2 -2
  70. package/dist/marketing/index.js +2 -2
  71. package/dist/providers/EventBusProvider.d.ts +1 -1
  72. package/dist/providers/SelectionProvider.d.ts +1 -1
  73. package/dist/providers/ServerBridge.d.ts +1 -1
  74. package/dist/providers/index.cjs +1536 -1453
  75. package/dist/providers/index.css +3 -3
  76. package/dist/providers/index.js +436 -353
  77. package/dist/runtime/index.cjs +1530 -1447
  78. package/dist/runtime/index.css +3 -3
  79. package/dist/runtime/index.js +440 -357
  80. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import * as React105 from 'react';
2
- import React105__default, { useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, createContext, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
1
+ import * as React103 from 'react';
2
+ import React103__default, { useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, createContext, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
3
3
  import { EventBusContext, useTraitScope, useEntitySchemaOptional, useEntitySchema, getAllPages, OrbitalProvider, TraitScopeProvider, ServerBridgeProvider, useCurrentPagePath, VerificationProvider, EntitySchemaProvider, OrbitalThemeProvider, useServerBridge } from '@almadar/ui/providers';
4
4
  export { EntitySchemaProvider, ServerBridgeProvider, TraitContext, TraitProvider, useEntitySchema, useEntitySchemaOptional, useServerBridge, useTrait, useTraitContext } from '@almadar/ui/providers';
5
5
  import { createLogger, isLogLevelEnabled } from '@almadar/logger';
@@ -12,7 +12,6 @@ import { createPortal } from 'react-dom';
12
12
  import { useTranslate } from '@almadar/ui/hooks';
13
13
  import { useUISlots, UISlotProvider, useTheme } from '@almadar/ui/context';
14
14
  import { evaluateGuard, evaluate, createMinimalContext } from '@almadar/evaluator';
15
- import { getPatternDefinition, getComponentForPattern } from '@almadar/patterns';
16
15
  import { Link, Outlet, useLocation } from 'react-router-dom';
17
16
  import ELK from 'elkjs/lib/elk.bundled.js';
18
17
  import SyntaxHighlighter from 'react-syntax-highlighter/dist/esm/prism-light.js';
@@ -43,6 +42,7 @@ import { DndContext, pointerWithin, rectIntersection, closestCorners, useSensors
43
42
  import { useSortable, arrayMove, sortableKeyboardCoordinates, SortableContext, rectSortingStrategy, verticalListSortingStrategy } from '@dnd-kit/sortable';
44
43
  import { CSS } from '@dnd-kit/utilities';
45
44
  import { useNodeId, ReactFlowProvider, Handle, Position } from '@xyflow/react';
45
+ import { getPatternDefinition, getComponentForPattern as getComponentForPattern$1 } from '@almadar/patterns';
46
46
  import { StateMachineManager, collectDeclaredConfigDefaults, createServerEffectHandlers, EffectExecutor, createContextFromBindings, InMemoryPersistence } from '@almadar/runtime';
47
47
  import { OrbitalServerRuntime } from '@almadar/runtime/OrbitalServerRuntime';
48
48
 
@@ -937,7 +937,7 @@ var init_Box = __esm({
937
937
  fixed: "fixed",
938
938
  sticky: "sticky"
939
939
  };
940
- Box = React105__default.forwardRef(
940
+ Box = React103__default.forwardRef(
941
941
  ({
942
942
  padding,
943
943
  paddingX,
@@ -1002,7 +1002,7 @@ var init_Box = __esm({
1002
1002
  onPointerDown?.(e);
1003
1003
  }, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
1004
1004
  const isClickable = action || onClick;
1005
- return React105__default.createElement(
1005
+ return React103__default.createElement(
1006
1006
  Component,
1007
1007
  {
1008
1008
  ref,
@@ -1098,7 +1098,7 @@ function loadLib(key, importer) {
1098
1098
  return p2;
1099
1099
  }
1100
1100
  function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
1101
- const Lazy = React105__default.lazy(async () => {
1101
+ const Lazy = React103__default.lazy(async () => {
1102
1102
  const lib = await loadLib(libKey, importer);
1103
1103
  const Comp = pick(lib);
1104
1104
  if (!Comp) {
@@ -1108,7 +1108,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
1108
1108
  return { default: Comp };
1109
1109
  });
1110
1110
  const Wrapped = (props) => /* @__PURE__ */ jsx(
1111
- React105__default.Suspense,
1111
+ React103__default.Suspense,
1112
1112
  {
1113
1113
  fallback: /* @__PURE__ */ jsx(
1114
1114
  "span",
@@ -1839,7 +1839,7 @@ var init_Icon = __esm({
1839
1839
  const directIcon = typeof icon === "string" ? void 0 : icon;
1840
1840
  const effectiveName = typeof icon === "string" ? icon : name;
1841
1841
  const family = useIconFamily();
1842
- const RenderedComponent = React105__default.useMemo(() => {
1842
+ const RenderedComponent = React103__default.useMemo(() => {
1843
1843
  if (directIcon) return null;
1844
1844
  return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
1845
1845
  }, [directIcon, effectiveName, family]);
@@ -1901,7 +1901,7 @@ function resolveIconProp(value, sizeClass) {
1901
1901
  const IconComp = value;
1902
1902
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
1903
1903
  }
1904
- if (React105__default.isValidElement(value)) {
1904
+ if (React103__default.isValidElement(value)) {
1905
1905
  return value;
1906
1906
  }
1907
1907
  if (typeof value === "object" && value !== null && isIconLike(value)) {
@@ -1977,7 +1977,7 @@ var init_Button = __esm({
1977
1977
  md: "h-icon-default w-icon-default",
1978
1978
  lg: "h-icon-default w-icon-default"
1979
1979
  };
1980
- Button = React105__default.forwardRef(
1980
+ Button = React103__default.forwardRef(
1981
1981
  ({
1982
1982
  className,
1983
1983
  variant = "primary",
@@ -2043,7 +2043,7 @@ var Dialog;
2043
2043
  var init_Dialog = __esm({
2044
2044
  "components/core/atoms/Dialog.tsx"() {
2045
2045
  init_cn();
2046
- Dialog = React105__default.forwardRef(
2046
+ Dialog = React103__default.forwardRef(
2047
2047
  ({
2048
2048
  role = "dialog",
2049
2049
  "aria-modal": ariaModal = true,
@@ -2161,7 +2161,7 @@ var init_Typography = __esm({
2161
2161
  }) => {
2162
2162
  const variant = variantProp ?? (level ? `h${level}` : "body1");
2163
2163
  const Component = as || defaultElements[variant];
2164
- return React105__default.createElement(
2164
+ return React103__default.createElement(
2165
2165
  Component,
2166
2166
  {
2167
2167
  id,
@@ -2656,7 +2656,7 @@ var init_Badge = __esm({
2656
2656
  md: "px-2.5 py-1 text-sm",
2657
2657
  lg: "px-3 py-1.5 text-base"
2658
2658
  };
2659
- Badge = React105__default.forwardRef(
2659
+ Badge = React103__default.forwardRef(
2660
2660
  ({ className, variant = "default", size = "sm", amount, label, icon, children, onRemove, removeLabel, ...props }, ref) => {
2661
2661
  const iconSizes3 = {
2662
2662
  sm: "h-icon-default w-icon-default",
@@ -2992,7 +2992,7 @@ var init_SvgFlow = __esm({
2992
2992
  width = 100,
2993
2993
  height = 100
2994
2994
  }) => {
2995
- const markerId = React105__default.useMemo(() => {
2995
+ const markerId = React103__default.useMemo(() => {
2996
2996
  flowIdCounter += 1;
2997
2997
  return `almadar-flow-arrow-${flowIdCounter}`;
2998
2998
  }, []);
@@ -3585,7 +3585,7 @@ var init_SvgRing = __esm({
3585
3585
  width = 100,
3586
3586
  height = 100
3587
3587
  }) => {
3588
- const gradientId = React105__default.useMemo(() => {
3588
+ const gradientId = React103__default.useMemo(() => {
3589
3589
  ringIdCounter += 1;
3590
3590
  return `almadar-ring-glow-${ringIdCounter}`;
3591
3591
  }, []);
@@ -3766,7 +3766,7 @@ var init_Input = __esm({
3766
3766
  init_cn();
3767
3767
  init_Icon();
3768
3768
  init_useEventBus();
3769
- Input = React105__default.forwardRef(
3769
+ Input = React103__default.forwardRef(
3770
3770
  ({
3771
3771
  className,
3772
3772
  inputType,
@@ -3926,7 +3926,7 @@ var Label;
3926
3926
  var init_Label = __esm({
3927
3927
  "components/core/atoms/Label.tsx"() {
3928
3928
  init_cn();
3929
- Label = React105__default.forwardRef(
3929
+ Label = React103__default.forwardRef(
3930
3930
  ({ className, required, children, ...props }, ref) => {
3931
3931
  return /* @__PURE__ */ jsxs(
3932
3932
  "label",
@@ -3953,7 +3953,7 @@ var init_Textarea = __esm({
3953
3953
  "components/core/atoms/Textarea.tsx"() {
3954
3954
  init_cn();
3955
3955
  init_useEventBus();
3956
- Textarea = React105__default.forwardRef(
3956
+ Textarea = React103__default.forwardRef(
3957
3957
  ({ className, error, onChange, ...props }, ref) => {
3958
3958
  const eventBus = useEventBus();
3959
3959
  const handleChange = (e) => {
@@ -4192,7 +4192,7 @@ var init_Select = __esm({
4192
4192
  init_cn();
4193
4193
  init_Icon();
4194
4194
  init_useEventBus();
4195
- Select = React105__default.forwardRef(
4195
+ Select = React103__default.forwardRef(
4196
4196
  (props, _ref) => {
4197
4197
  const { multiple, searchable, clearable } = props;
4198
4198
  if (multiple || searchable || clearable) {
@@ -4209,7 +4209,7 @@ var init_Checkbox = __esm({
4209
4209
  "components/core/atoms/Checkbox.tsx"() {
4210
4210
  init_cn();
4211
4211
  init_useEventBus();
4212
- Checkbox = React105__default.forwardRef(
4212
+ Checkbox = React103__default.forwardRef(
4213
4213
  ({ className, label, id, onChange, ...props }, ref) => {
4214
4214
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
4215
4215
  const eventBus = useEventBus();
@@ -4263,7 +4263,7 @@ var init_Spinner = __esm({
4263
4263
  md: "h-6 w-6",
4264
4264
  lg: "h-8 w-8"
4265
4265
  };
4266
- Spinner = React105__default.forwardRef(
4266
+ Spinner = React103__default.forwardRef(
4267
4267
  ({ className, size = "md", overlay, ...props }, ref) => {
4268
4268
  if (overlay) {
4269
4269
  return /* @__PURE__ */ jsx(
@@ -4353,7 +4353,7 @@ var init_Card = __esm({
4353
4353
  chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
4354
4354
  "tile-image-first": "p-0 overflow-hidden"
4355
4355
  };
4356
- Card = React105__default.forwardRef(
4356
+ Card = React103__default.forwardRef(
4357
4357
  ({
4358
4358
  className,
4359
4359
  variant = "bordered",
@@ -4401,9 +4401,9 @@ var init_Card = __esm({
4401
4401
  }
4402
4402
  );
4403
4403
  Card.displayName = "Card";
4404
- CardHeader = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
4404
+ CardHeader = React103__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
4405
4405
  CardHeader.displayName = "CardHeader";
4406
- CardTitle = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
4406
+ CardTitle = React103__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
4407
4407
  "h3",
4408
4408
  {
4409
4409
  ref,
@@ -4416,11 +4416,11 @@ var init_Card = __esm({
4416
4416
  }
4417
4417
  ));
4418
4418
  CardTitle.displayName = "CardTitle";
4419
- CardContent = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
4419
+ CardContent = React103__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
4420
4420
  CardContent.displayName = "CardContent";
4421
4421
  CardBody = CardContent;
4422
4422
  CardBody.displayName = "CardBody";
4423
- CardFooter = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
4423
+ CardFooter = React103__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
4424
4424
  "div",
4425
4425
  {
4426
4426
  ref,
@@ -4475,7 +4475,7 @@ var init_FilterPill = __esm({
4475
4475
  md: "w-3.5 h-3.5",
4476
4476
  lg: "w-4 h-4"
4477
4477
  };
4478
- FilterPill = React105__default.forwardRef(
4478
+ FilterPill = React103__default.forwardRef(
4479
4479
  ({
4480
4480
  className,
4481
4481
  variant = "default",
@@ -4604,8 +4604,8 @@ var init_Avatar = __esm({
4604
4604
  actionPayload
4605
4605
  }) => {
4606
4606
  const eventBus = useEventBus();
4607
- const [imgFailed, setImgFailed] = React105__default.useState(false);
4608
- React105__default.useEffect(() => {
4607
+ const [imgFailed, setImgFailed] = React103__default.useState(false);
4608
+ React103__default.useEffect(() => {
4609
4609
  setImgFailed(false);
4610
4610
  }, [src]);
4611
4611
  const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
@@ -4718,7 +4718,7 @@ var init_Center = __esm({
4718
4718
  as: Component = "div"
4719
4719
  }) => {
4720
4720
  const mergedStyle = minHeight ? { minHeight, ...style } : style;
4721
- return React105__default.createElement(Component, {
4721
+ return React103__default.createElement(Component, {
4722
4722
  className: cn(
4723
4723
  inline ? "inline-flex" : "flex",
4724
4724
  horizontal && "justify-center",
@@ -4986,7 +4986,7 @@ var init_Radio = __esm({
4986
4986
  md: "w-2.5 h-2.5",
4987
4987
  lg: "w-3 h-3"
4988
4988
  };
4989
- Radio = React105__default.forwardRef(
4989
+ Radio = React103__default.forwardRef(
4990
4990
  ({
4991
4991
  label,
4992
4992
  helperText,
@@ -5003,12 +5003,12 @@ var init_Radio = __esm({
5003
5003
  onChange,
5004
5004
  ...props
5005
5005
  }, ref) => {
5006
- const reactId = React105__default.useId();
5006
+ const reactId = React103__default.useId();
5007
5007
  const baseId = id || `radio-${reactId}`;
5008
5008
  const hasError = !!error;
5009
5009
  const eventBus = useEventBus();
5010
- const [selected, setSelected] = React105__default.useState(value);
5011
- React105__default.useEffect(() => {
5010
+ const [selected, setSelected] = React103__default.useState(value);
5011
+ React103__default.useEffect(() => {
5012
5012
  if (value !== void 0) setSelected(value);
5013
5013
  }, [value]);
5014
5014
  const pick = (next, e) => {
@@ -5190,7 +5190,7 @@ var init_Switch = __esm({
5190
5190
  "components/core/atoms/Switch.tsx"() {
5191
5191
  "use client";
5192
5192
  init_cn();
5193
- Switch = React105.forwardRef(
5193
+ Switch = React103.forwardRef(
5194
5194
  ({
5195
5195
  checked,
5196
5196
  defaultChecked = false,
@@ -5201,10 +5201,10 @@ var init_Switch = __esm({
5201
5201
  name,
5202
5202
  className
5203
5203
  }, ref) => {
5204
- const [isChecked, setIsChecked] = React105.useState(
5204
+ const [isChecked, setIsChecked] = React103.useState(
5205
5205
  checked !== void 0 ? checked : defaultChecked
5206
5206
  );
5207
- React105.useEffect(() => {
5207
+ React103.useEffect(() => {
5208
5208
  if (checked !== void 0) {
5209
5209
  setIsChecked(checked);
5210
5210
  }
@@ -5367,7 +5367,7 @@ var init_Stack = __esm({
5367
5367
  };
5368
5368
  const isHorizontal = direction === "horizontal";
5369
5369
  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";
5370
- return React105__default.createElement(
5370
+ return React103__default.createElement(
5371
5371
  Component,
5372
5372
  {
5373
5373
  className: cn(
@@ -5567,7 +5567,7 @@ var Aside;
5567
5567
  var init_Aside = __esm({
5568
5568
  "components/core/atoms/Aside.tsx"() {
5569
5569
  init_cn();
5570
- Aside = React105__default.forwardRef(
5570
+ Aside = React103__default.forwardRef(
5571
5571
  ({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
5572
5572
  );
5573
5573
  Aside.displayName = "Aside";
@@ -5646,9 +5646,9 @@ var init_LawReferenceTooltip = __esm({
5646
5646
  className
5647
5647
  }) => {
5648
5648
  const { t } = useTranslate();
5649
- const [isVisible, setIsVisible] = React105__default.useState(false);
5650
- const timeoutRef = React105__default.useRef(null);
5651
- const triggerRef = React105__default.useRef(null);
5649
+ const [isVisible, setIsVisible] = React103__default.useState(false);
5650
+ const timeoutRef = React103__default.useRef(null);
5651
+ const triggerRef = React103__default.useRef(null);
5652
5652
  const handleMouseEnter = () => {
5653
5653
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
5654
5654
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -5659,7 +5659,7 @@ var init_LawReferenceTooltip = __esm({
5659
5659
  };
5660
5660
  const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
5661
5661
  const open = isVisible || revealed;
5662
- React105__default.useEffect(() => {
5662
+ React103__default.useEffect(() => {
5663
5663
  return () => {
5664
5664
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
5665
5665
  };
@@ -5869,7 +5869,7 @@ var init_StatusDot = __esm({
5869
5869
  md: "w-2.5 h-2.5",
5870
5870
  lg: "w-3 h-3"
5871
5871
  };
5872
- StatusDot = React105__default.forwardRef(
5872
+ StatusDot = React103__default.forwardRef(
5873
5873
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
5874
5874
  return /* @__PURE__ */ jsx(
5875
5875
  "span",
@@ -5923,7 +5923,7 @@ var init_TrendIndicator = __esm({
5923
5923
  down: "trending-down",
5924
5924
  flat: "arrow-right"
5925
5925
  };
5926
- TrendIndicator = React105__default.forwardRef(
5926
+ TrendIndicator = React103__default.forwardRef(
5927
5927
  ({
5928
5928
  className,
5929
5929
  value,
@@ -5990,7 +5990,7 @@ var init_RangeSlider = __esm({
5990
5990
  md: "w-4 h-4",
5991
5991
  lg: "w-5 h-5"
5992
5992
  };
5993
- RangeSlider = React105__default.forwardRef(
5993
+ RangeSlider = React103__default.forwardRef(
5994
5994
  ({
5995
5995
  className,
5996
5996
  min = 0,
@@ -6549,7 +6549,7 @@ var init_ContentSection = __esm({
6549
6549
  md: "py-16",
6550
6550
  lg: "py-24"
6551
6551
  };
6552
- ContentSection = React105__default.forwardRef(
6552
+ ContentSection = React103__default.forwardRef(
6553
6553
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
6554
6554
  return /* @__PURE__ */ jsx(
6555
6555
  Box,
@@ -7083,7 +7083,7 @@ var init_AnimatedReveal = __esm({
7083
7083
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
7084
7084
  "none": {}
7085
7085
  };
7086
- AnimatedReveal = React105__default.forwardRef(
7086
+ AnimatedReveal = React103__default.forwardRef(
7087
7087
  ({
7088
7088
  trigger = "scroll",
7089
7089
  animation = "fade-up",
@@ -7243,7 +7243,7 @@ var init_AnimatedGraphic = __esm({
7243
7243
  "components/marketing/atoms/AnimatedGraphic.tsx"() {
7244
7244
  "use client";
7245
7245
  init_cn();
7246
- AnimatedGraphic = React105__default.forwardRef(
7246
+ AnimatedGraphic = React103__default.forwardRef(
7247
7247
  ({
7248
7248
  src,
7249
7249
  svgContent,
@@ -7266,7 +7266,7 @@ var init_AnimatedGraphic = __esm({
7266
7266
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
7267
7267
  const resolvedSvg = svgContent ?? fetchedSvg;
7268
7268
  const prevAnimateRef = useRef(animate);
7269
- const setRef = React105__default.useCallback(
7269
+ const setRef = React103__default.useCallback(
7270
7270
  (node) => {
7271
7271
  containerRef.current = node;
7272
7272
  if (typeof ref === "function") ref(node);
@@ -8898,7 +8898,7 @@ function GameCard({
8898
8898
  className
8899
8899
  }) {
8900
8900
  const eventBus = useEventBus();
8901
- const handleClick = React105.useCallback(() => {
8901
+ const handleClick = React103.useCallback(() => {
8902
8902
  if (disabled) return;
8903
8903
  onClick?.(id);
8904
8904
  if (clickEvent) eventBus.emit(`UI:${clickEvent}`, { cardId: id });
@@ -8984,7 +8984,9 @@ function HealthBar({
8984
8984
  labelSuffix,
8985
8985
  size = "md",
8986
8986
  className,
8987
- animated = true
8987
+ animated = true,
8988
+ frameAsset,
8989
+ fillAsset
8988
8990
  }) {
8989
8991
  const sizes = sizeMap[size];
8990
8992
  const percentage = max > 0 ? Math.max(0, Math.min(100, current / max * 100)) : 0;
@@ -9003,20 +9005,25 @@ function HealthBar({
9003
9005
  "div",
9004
9006
  {
9005
9007
  className: cn(
9006
- "relative overflow-hidden rounded-full bg-muted",
9008
+ "relative overflow-hidden rounded-full",
9009
+ !frameAsset && "bg-muted",
9007
9010
  sizes.bar,
9008
9011
  "w-24",
9009
9012
  className
9010
9013
  ),
9014
+ style: frameAsset ? { backgroundImage: `url(${frameAsset.url})`, backgroundSize: "100% 100%" } : void 0,
9011
9015
  children: /* @__PURE__ */ jsx(
9012
9016
  "div",
9013
9017
  {
9014
9018
  className: cn(
9015
9019
  "absolute inset-y-0 left-0 rounded-full",
9016
- percentage > 66 ? "bg-success" : percentage > 33 ? "bg-warning" : "bg-error",
9020
+ !fillAsset && (percentage > 66 ? "bg-success" : percentage > 33 ? "bg-warning" : "bg-error"),
9017
9021
  animated && "transition-all duration-300"
9018
9022
  ),
9019
- style: { width: `${percentage}%` }
9023
+ style: {
9024
+ width: `${percentage}%`,
9025
+ ...fillAsset ? { backgroundImage: `url(${fillAsset.url})`, backgroundSize: "auto 100%" } : {}
9026
+ }
9020
9027
  }
9021
9028
  )
9022
9029
  }
@@ -9043,18 +9050,23 @@ function HealthBar({
9043
9050
  "div",
9044
9051
  {
9045
9052
  className: cn(
9046
- "relative w-full overflow-hidden rounded-full bg-muted border border-muted",
9053
+ "relative w-full overflow-hidden rounded-full",
9054
+ !frameAsset && "bg-muted border border-muted",
9047
9055
  sizes.bar
9048
9056
  ),
9057
+ style: frameAsset ? { backgroundImage: `url(${frameAsset.url})`, backgroundSize: "100% 100%" } : void 0,
9049
9058
  children: /* @__PURE__ */ jsx(
9050
9059
  "div",
9051
9060
  {
9052
9061
  className: cn(
9053
9062
  "absolute inset-y-0 left-0 rounded-full",
9054
- "bg-gradient-to-r from-accent to-info",
9063
+ !fillAsset && "bg-gradient-to-r from-accent to-info",
9055
9064
  animated && "transition-all duration-500 ease-out"
9056
9065
  ),
9057
- style: { width: `${percentage}%` }
9066
+ style: {
9067
+ width: `${percentage}%`,
9068
+ ...fillAsset ? { backgroundImage: `url(${fillAsset.url})`, backgroundSize: "auto 100%" } : {}
9069
+ }
9058
9070
  }
9059
9071
  )
9060
9072
  }
@@ -9170,9 +9182,9 @@ function ControlButton({
9170
9182
  className
9171
9183
  }) {
9172
9184
  const eventBus = useEventBus();
9173
- const [isPressed, setIsPressed] = React105.useState(false);
9185
+ const [isPressed, setIsPressed] = React103.useState(false);
9174
9186
  const actualPressed = pressed ?? isPressed;
9175
- const handlePointerDown = React105.useCallback(
9187
+ const handlePointerDown = React103.useCallback(
9176
9188
  (e) => {
9177
9189
  e.preventDefault();
9178
9190
  if (disabled) return;
@@ -9182,7 +9194,7 @@ function ControlButton({
9182
9194
  },
9183
9195
  [disabled, pressEvent, eventBus, onPress]
9184
9196
  );
9185
- const handlePointerUp = React105.useCallback(
9197
+ const handlePointerUp = React103.useCallback(
9186
9198
  (e) => {
9187
9199
  e.preventDefault();
9188
9200
  if (disabled) return;
@@ -9192,7 +9204,7 @@ function ControlButton({
9192
9204
  },
9193
9205
  [disabled, releaseEvent, eventBus, onRelease]
9194
9206
  );
9195
- const handlePointerLeave = React105.useCallback(
9207
+ const handlePointerLeave = React103.useCallback(
9196
9208
  (e) => {
9197
9209
  if (isPressed) {
9198
9210
  setIsPressed(false);
@@ -9452,14 +9464,15 @@ function TimerDisplay({
9452
9464
  format = "mm:ss",
9453
9465
  size = "md",
9454
9466
  className,
9455
- lowThreshold
9467
+ lowThreshold,
9468
+ iconAsset
9456
9469
  }) {
9457
9470
  const isLow = lowThreshold != null && seconds <= lowThreshold && seconds > 0;
9458
- return /* @__PURE__ */ jsx(
9471
+ return /* @__PURE__ */ jsxs(
9459
9472
  "div",
9460
9473
  {
9461
9474
  className: cn(
9462
- "inline-flex items-center justify-center rounded-container",
9475
+ "inline-flex items-center gap-1 justify-center rounded-container",
9463
9476
  "bg-card/80 border border-muted font-mono font-bold tabular-nums",
9464
9477
  sizeMap4[size],
9465
9478
  running && "border-success/50",
@@ -9467,7 +9480,10 @@ function TimerDisplay({
9467
9480
  !isLow && "text-foreground",
9468
9481
  className
9469
9482
  ),
9470
- children: formatTime(seconds, format)
9483
+ children: [
9484
+ iconAsset && /* @__PURE__ */ jsx("img", { src: iconAsset.url, alt: "", className: "w-4 h-4 object-contain flex-shrink-0" }),
9485
+ formatTime(seconds, format)
9486
+ ]
9471
9487
  }
9472
9488
  );
9473
9489
  }
@@ -9563,15 +9579,20 @@ function ItemSlot({
9563
9579
  size = "md",
9564
9580
  selected,
9565
9581
  onClick,
9582
+ action,
9566
9583
  className
9567
9584
  }) {
9568
- const isClickable = onClick != null;
9585
+ const eventBus = useEventBus();
9586
+ const isClickable = onClick != null || action != null;
9569
9587
  const px = assetSizeMap[size];
9570
9588
  return /* @__PURE__ */ jsx(
9571
9589
  "button",
9572
9590
  {
9573
9591
  type: "button",
9574
- onClick,
9592
+ onClick: () => {
9593
+ if (action) eventBus.emit(`UI:${action}`, {});
9594
+ onClick?.();
9595
+ },
9575
9596
  disabled: !isClickable,
9576
9597
  title: label,
9577
9598
  className: cn(
@@ -9619,6 +9640,7 @@ var init_ItemSlot = __esm({
9619
9640
  "use client";
9620
9641
  init_cn();
9621
9642
  init_Icon();
9643
+ init_useEventBus();
9622
9644
  sizeMap6 = {
9623
9645
  sm: "w-10 h-10 text-lg",
9624
9646
  md: "w-14 h-14 text-2xl",
@@ -10087,14 +10109,19 @@ function ChoiceButton({
10087
10109
  disabled = false,
10088
10110
  selected = false,
10089
10111
  onClick,
10112
+ action,
10090
10113
  className
10091
10114
  }) {
10115
+ const eventBus = useEventBus();
10092
10116
  return /* @__PURE__ */ jsxs(
10093
10117
  "button",
10094
10118
  {
10095
10119
  type: "button",
10096
10120
  disabled,
10097
- onClick,
10121
+ onClick: (e) => {
10122
+ if (action) eventBus.emit(`UI:${action}`, {});
10123
+ onClick?.();
10124
+ },
10098
10125
  className: cn(
10099
10126
  "w-full text-left px-4 py-2.5 rounded-interactive border transition-all duration-150",
10100
10127
  "flex items-center gap-2",
@@ -10142,6 +10169,7 @@ var init_ChoiceButton = __esm({
10142
10169
  "components/game/2d/atoms/ChoiceButton.tsx"() {
10143
10170
  init_cn();
10144
10171
  init_Icon();
10172
+ init_useEventBus();
10145
10173
  ChoiceButton.displayName = "ChoiceButton";
10146
10174
  }
10147
10175
  });
@@ -10155,8 +10183,10 @@ function ActionButton({
10155
10183
  size = "md",
10156
10184
  variant = "primary",
10157
10185
  onClick,
10186
+ action,
10158
10187
  className
10159
10188
  }) {
10189
+ const eventBus = useEventBus();
10160
10190
  const sizes = sizeMap12[size];
10161
10191
  const onCooldown = cooldown > 0;
10162
10192
  const isDisabled = disabled || onCooldown;
@@ -10166,7 +10196,10 @@ function ActionButton({
10166
10196
  {
10167
10197
  type: "button",
10168
10198
  disabled: isDisabled,
10169
- onClick,
10199
+ onClick: (e) => {
10200
+ if (action) eventBus.emit(`UI:${action}`, {});
10201
+ onClick?.();
10202
+ },
10170
10203
  className: cn(
10171
10204
  "relative inline-flex items-center gap-1.5 rounded-interactive border font-medium overflow-hidden transition-colors duration-150",
10172
10205
  sizes.button,
@@ -10223,6 +10256,7 @@ var init_ActionButton = __esm({
10223
10256
  "components/game/2d/atoms/ActionButton.tsx"() {
10224
10257
  init_cn();
10225
10258
  init_Icon();
10259
+ init_useEventBus();
10226
10260
  sizeMap12 = {
10227
10261
  sm: { button: "h-button-sm px-3 text-xs", hotkey: "text-[9px] px-1", icon: "text-xs" },
10228
10262
  md: { button: "h-button-md px-4 text-sm", hotkey: "text-xs px-1.5", icon: "text-sm" },
@@ -10249,10 +10283,27 @@ function MiniMap({
10249
10283
  mapWidth = 100,
10250
10284
  mapHeight = 100,
10251
10285
  viewportRect = DEFAULT_VIEWPORT,
10252
- className
10286
+ className,
10287
+ tileAssets,
10288
+ unitAssets
10253
10289
  }) {
10254
- const canvasRef = React105.useRef(null);
10255
- React105.useEffect(() => {
10290
+ const canvasRef = React103.useRef(null);
10291
+ const imgCacheRef = React103.useRef(/* @__PURE__ */ new Map());
10292
+ function loadImg(url) {
10293
+ const cached = imgCacheRef.current.get(url);
10294
+ if (cached) return cached.complete ? cached : null;
10295
+ const img = new Image();
10296
+ img.src = url;
10297
+ img.onload = () => {
10298
+ const canvas = canvasRef.current;
10299
+ if (!canvas) return;
10300
+ const ctx = canvas.getContext("2d");
10301
+ if (ctx) ctx.clearRect(0, 0, 0, 0);
10302
+ };
10303
+ imgCacheRef.current.set(url, img);
10304
+ return null;
10305
+ }
10306
+ React103.useEffect(() => {
10256
10307
  const canvas = canvasRef.current;
10257
10308
  if (!canvas) return;
10258
10309
  const ctx = canvas.getContext("2d");
@@ -10263,20 +10314,31 @@ function MiniMap({
10263
10314
  ctx.fillStyle = "#111";
10264
10315
  ctx.fillRect(0, 0, width, height);
10265
10316
  for (const tile of tiles) {
10266
- ctx.fillStyle = tile.color;
10267
- ctx.fillRect(
10268
- Math.floor(tile.x * scaleX2),
10269
- Math.floor(tile.y * scaleY2),
10270
- Math.max(1, Math.ceil(scaleX2)),
10271
- Math.max(1, Math.ceil(scaleY2))
10272
- );
10317
+ const tileAsset = tileAssets?.[tile.color] ?? tileAssets?.["default"];
10318
+ const tileImg = tileAsset ? loadImg(tileAsset.url) : null;
10319
+ const tx = Math.floor(tile.x * scaleX2);
10320
+ const ty = Math.floor(tile.y * scaleY2);
10321
+ const tw = Math.max(1, Math.ceil(scaleX2));
10322
+ const th = Math.max(1, Math.ceil(scaleY2));
10323
+ if (tileImg) {
10324
+ ctx.drawImage(tileImg, tx, ty, tw, th);
10325
+ } else {
10326
+ ctx.fillStyle = tile.color;
10327
+ ctx.fillRect(tx, ty, tw, th);
10328
+ }
10273
10329
  }
10274
10330
  for (const unit of units) {
10275
10331
  if (unit.isPlayer) continue;
10276
- ctx.fillStyle = unit.color;
10332
+ const unitAsset = unitAssets?.[unit.color] ?? unitAssets?.["default"];
10333
+ const unitImg = unitAsset ? loadImg(unitAsset.url) : null;
10277
10334
  const ux = Math.floor(unit.x * scaleX2) - 1;
10278
10335
  const uy = Math.floor(unit.y * scaleY2) - 1;
10279
- ctx.fillRect(ux, uy, 3, 3);
10336
+ if (unitImg) {
10337
+ ctx.drawImage(unitImg, ux, uy, 5, 5);
10338
+ } else {
10339
+ ctx.fillStyle = unit.color;
10340
+ ctx.fillRect(ux, uy, 3, 3);
10341
+ }
10280
10342
  }
10281
10343
  if (viewportRect) {
10282
10344
  ctx.strokeStyle = "#ffffff";
@@ -10288,7 +10350,7 @@ function MiniMap({
10288
10350
  Math.floor(viewportRect.h * scaleY2)
10289
10351
  );
10290
10352
  }
10291
- }, [tiles, units, width, height, mapWidth, mapHeight, viewportRect]);
10353
+ }, [tiles, units, width, height, mapWidth, mapHeight, viewportRect, tileAssets, unitAssets]);
10292
10354
  const scaleX = width / mapWidth;
10293
10355
  const scaleY = height / mapHeight;
10294
10356
  const playerUnit = units.find((u) => u.isPlayer);
@@ -10397,13 +10459,14 @@ function ControlGrid({
10397
10459
  actionEvent,
10398
10460
  onDirection,
10399
10461
  directionEvent,
10462
+ directionAssets,
10400
10463
  size = "md",
10401
10464
  disabled,
10402
10465
  className
10403
10466
  }) {
10404
10467
  const eventBus = useEventBus();
10405
- const [active, setActive] = React105.useState(/* @__PURE__ */ new Set());
10406
- const handlePress = React105.useCallback(
10468
+ const [active, setActive] = React103.useState(/* @__PURE__ */ new Set());
10469
+ const handlePress = React103.useCallback(
10407
10470
  (id) => {
10408
10471
  setActive((prev) => new Set(prev).add(id));
10409
10472
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -10415,7 +10478,7 @@ function ControlGrid({
10415
10478
  },
10416
10479
  [kind, actionEvent, directionEvent, eventBus, onAction, onDirection]
10417
10480
  );
10418
- const handleRelease = React105.useCallback(
10481
+ const handleRelease = React103.useCallback(
10419
10482
  (id) => {
10420
10483
  setActive((prev) => {
10421
10484
  const next = new Set(prev);
@@ -10436,7 +10499,8 @@ function ControlGrid({
10436
10499
  const dir = (d) => /* @__PURE__ */ jsx(
10437
10500
  ControlButton,
10438
10501
  {
10439
- icon: arrowIcons[d],
10502
+ icon: directionAssets?.[d] ? void 0 : arrowIcons[d],
10503
+ assetUrl: directionAssets?.[d],
10440
10504
  size: sizeKey[size],
10441
10505
  variant: "secondary",
10442
10506
  pressed: active.has(d),
@@ -10676,11 +10740,11 @@ function InventoryGrid({
10676
10740
  const eventBus = useEventBus();
10677
10741
  const slotCount = totalSlots ?? items.length;
10678
10742
  const emptySlotCount = Math.max(0, slotCount - items.length);
10679
- const handleSelect = React105.useCallback(
10743
+ const handleSelect = React103.useCallback(
10680
10744
  (id) => {
10681
10745
  onSelect?.(id);
10682
10746
  if (selectEvent) {
10683
- eventBus.emit(selectEvent, { id });
10747
+ eventBus.emit(`UI:${selectEvent}`, { id });
10684
10748
  }
10685
10749
  },
10686
10750
  [onSelect, selectEvent, eventBus]
@@ -10885,27 +10949,21 @@ function GameMenu({
10885
10949
  options,
10886
10950
  menuItems,
10887
10951
  onSelect,
10888
- eventBus: eventBusProp,
10889
10952
  background,
10890
- logo = "",
10953
+ logo,
10891
10954
  className
10892
10955
  }) {
10893
10956
  const resolvedOptions = options ?? menuItems ?? DEFAULT_MENU_OPTIONS;
10894
- let eventBusFromHook = null;
10895
- try {
10896
- eventBusFromHook = useEventBus();
10897
- } catch {
10898
- }
10899
- const eventBus = eventBusProp || eventBusFromHook;
10900
- const handleOptionClick = React105.useCallback(
10957
+ const eventBus = useEventBus();
10958
+ const handleOptionClick = React103.useCallback(
10901
10959
  (option) => {
10902
- if (option.event && eventBus) {
10960
+ if (option.event) {
10903
10961
  eventBus.emit(`UI:${option.event}`, { option });
10904
10962
  }
10905
10963
  if (onSelect) {
10906
10964
  onSelect(option);
10907
10965
  }
10908
- if (option.navigatesTo && eventBus) {
10966
+ if (option.navigatesTo) {
10909
10967
  eventBus.emit("UI:NAVIGATE", { url: option.navigatesTo, option });
10910
10968
  }
10911
10969
  },
@@ -10926,7 +10984,7 @@ function GameMenu({
10926
10984
  logo && /* @__PURE__ */ jsx(
10927
10985
  "img",
10928
10986
  {
10929
- src: logo,
10987
+ src: logo.url,
10930
10988
  alt: title,
10931
10989
  className: "h-24 w-auto mx-auto mb-6 drop-shadow-2xl"
10932
10990
  }
@@ -12581,7 +12639,9 @@ var init_GameAudioProvider = __esm({
12581
12639
  });
12582
12640
  function GameAudioToggle({
12583
12641
  size = "sm",
12584
- className
12642
+ className,
12643
+ onAsset,
12644
+ offAsset
12585
12645
  }) {
12586
12646
  const ctx = useGameAudioContextOptional();
12587
12647
  const [localMuted, setLocalMuted] = useState(false);
@@ -12590,6 +12650,7 @@ function GameAudioToggle({
12590
12650
  const handleToggle = useCallback(() => {
12591
12651
  setMuted(!muted);
12592
12652
  }, [muted, setMuted]);
12653
+ const activeAsset = muted ? offAsset : onAsset;
12593
12654
  return /* @__PURE__ */ jsx(
12594
12655
  Button,
12595
12656
  {
@@ -12598,7 +12659,7 @@ function GameAudioToggle({
12598
12659
  onClick: handleToggle,
12599
12660
  className: cn("text-lg leading-none px-2", className),
12600
12661
  "aria-pressed": muted,
12601
- children: muted ? "\u{1F507}" : "\u{1F50A}"
12662
+ children: activeAsset ? /* @__PURE__ */ jsx("img", { src: activeAsset.url, alt: muted ? "Muted" : "Sound on", className: "w-5 h-5 object-contain" }) : muted ? "\u{1F507}" : "\u{1F50A}"
12602
12663
  }
12603
12664
  );
12604
12665
  }
@@ -13890,6 +13951,7 @@ function PlatformerBoard({
13890
13951
  canvasHeight: _canvasHeight = 400,
13891
13952
  playerSprite,
13892
13953
  tileSprites,
13954
+ ui: _ui,
13893
13955
  bgColor: _bgColor,
13894
13956
  keyEvent = "KEY",
13895
13957
  playAgainEvent = "PLAY_AGAIN",
@@ -15748,6 +15810,7 @@ function TanksBoard({
15748
15810
  features,
15749
15811
  assetManifest,
15750
15812
  assetBaseUrl,
15813
+ ui: _ui,
15751
15814
  scale = 0.45,
15752
15815
  showMinimap = true,
15753
15816
  enableCamera = true,
@@ -16275,7 +16338,7 @@ function LinearView({
16275
16338
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
16276
16339
  const isDone = i < currentIdx;
16277
16340
  const isCurrent = i === currentIdx;
16278
- return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
16341
+ return /* @__PURE__ */ jsxs(React103__default.Fragment, { children: [
16279
16342
  i > 0 && /* @__PURE__ */ jsx(
16280
16343
  Typography,
16281
16344
  {
@@ -16496,7 +16559,7 @@ function TraitSlot({
16496
16559
  size = "md",
16497
16560
  showTooltip = true,
16498
16561
  categoryColors,
16499
- tooltipFrameUrl = "",
16562
+ tooltipFrameUrl,
16500
16563
  className,
16501
16564
  feedback,
16502
16565
  onItemDrop,
@@ -16626,7 +16689,7 @@ function TraitSlot({
16626
16689
  as: "img",
16627
16690
  className: "object-contain",
16628
16691
  style: { width: config.icon, height: config.icon },
16629
- ...{ src: equippedItem.iconUrl, alt: equippedItem.name }
16692
+ ...{ src: equippedItem.iconUrl.url, alt: equippedItem.name }
16630
16693
  }
16631
16694
  ) : /* @__PURE__ */ jsx(Typography, { variant: "body1", className: "text-center leading-none", style: { fontSize: config.icon }, children: equippedItem.iconEmoji || "\u2726" }),
16632
16695
  (onRemove || removeEvent) && /* @__PURE__ */ jsx(
@@ -16655,7 +16718,7 @@ function TraitSlot({
16655
16718
  ...getTooltipStyle(),
16656
16719
  minWidth: 200,
16657
16720
  ...tooltipFrameUrl ? {
16658
- borderImage: `url(${tooltipFrameUrl}) 60 fill / 15px / 0 stretch`,
16721
+ borderImage: `url(${tooltipFrameUrl.url}) 60 fill / 15px / 0 stretch`,
16659
16722
  border: "none"
16660
16723
  } : {}
16661
16724
  },
@@ -16730,7 +16793,7 @@ function ActionTile({
16730
16793
  draggable: !disabled,
16731
16794
  onDragStart: handleDragStart,
16732
16795
  children: [
16733
- action.iconUrl ? /* @__PURE__ */ jsx("img", { src: action.iconUrl, alt: "", className: "w-8 h-8 object-contain" }) : /* @__PURE__ */ jsx(Typography, { variant: "body1", className: cn(config.icon, "leading-none"), children: action.iconEmoji || "\u2726" }),
16796
+ action.iconUrl ? /* @__PURE__ */ jsx("img", { src: action.iconUrl.url, alt: "", className: "w-8 h-8 object-contain" }) : /* @__PURE__ */ jsx(Typography, { variant: "body1", className: cn(config.icon, "leading-none"), children: action.iconEmoji || "\u2726" }),
16734
16797
  /* @__PURE__ */ jsx(Typography, { variant: "caption", className: cn(config.text, "text-foreground font-medium whitespace-nowrap"), children: action.name })
16735
16798
  ]
16736
16799
  }
@@ -16803,7 +16866,7 @@ function SequenceBar({
16803
16866
  onSlotRemove(index);
16804
16867
  }, [onSlotRemove, playing]);
16805
16868
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
16806
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
16869
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React103__default.Fragment, { children: [
16807
16870
  i > 0 && /* @__PURE__ */ jsx(
16808
16871
  Typography,
16809
16872
  {
@@ -16854,6 +16917,42 @@ function computeSlotFeedback(playerSeq, solutions) {
16854
16917
  (id, i) => id !== void 0 && id === bestSolution[i] ? "correct" : "wrong"
16855
16918
  );
16856
16919
  }
16920
+ function isFieldRecord(v) {
16921
+ return typeof v === "object" && v !== null && !Array.isArray(v) && !(v instanceof Date);
16922
+ }
16923
+ function assetFromField(v) {
16924
+ if (!isFieldRecord(v)) return void 0;
16925
+ const url = typeof v.url === "string" ? v.url : void 0;
16926
+ const role = typeof v.role === "string" ? v.role : void 0;
16927
+ const category = typeof v.category === "string" ? v.category : "";
16928
+ if (!url || !role) return void 0;
16929
+ return {
16930
+ url,
16931
+ role,
16932
+ category,
16933
+ name: typeof v.name === "string" ? v.name : void 0,
16934
+ thumbnailUrl: typeof v.thumbnailUrl === "string" ? v.thumbnailUrl : void 0,
16935
+ style: typeof v.style === "string" ? v.style : void 0,
16936
+ variant: typeof v.variant === "string" ? v.variant : void 0,
16937
+ dimension: typeof v.dimension === "string" ? v.dimension : void 0,
16938
+ aspect: typeof v.aspect === "string" ? v.aspect : void 0
16939
+ };
16940
+ }
16941
+ function slotItemFromField(fv) {
16942
+ if (!isFieldRecord(fv)) return void 0;
16943
+ const id = typeof fv.id === "string" ? fv.id : void 0;
16944
+ const name = typeof fv.name === "string" ? fv.name : void 0;
16945
+ const category = typeof fv.category === "string" ? fv.category : void 0;
16946
+ if (!id || !name || !category) return void 0;
16947
+ return {
16948
+ id,
16949
+ name,
16950
+ category,
16951
+ description: typeof fv.description === "string" ? fv.description : void 0,
16952
+ iconEmoji: typeof fv.iconEmoji === "string" ? fv.iconEmoji : void 0,
16953
+ iconUrl: assetFromField(fv.iconUrl)
16954
+ };
16955
+ }
16857
16956
  function SequencerBoard({
16858
16957
  entity,
16859
16958
  categoryColors,
@@ -16864,6 +16963,7 @@ function SequencerBoard({
16864
16963
  removeEvent,
16865
16964
  checkEvent,
16866
16965
  playAgainEvent,
16966
+ stepEvent,
16867
16967
  className
16868
16968
  }) {
16869
16969
  const { emit } = useEventBus();
@@ -16871,7 +16971,11 @@ function SequencerBoard({
16871
16971
  const resolved = boardEntity(entity);
16872
16972
  const maxSlots = num(resolved?.maxSlots) || 3;
16873
16973
  const solutions = Array.isArray(resolved?.solutions) ? resolved.solutions : [];
16874
- const availableActions = Array.isArray(resolved?.availableActions) ? resolved.availableActions : [];
16974
+ const availableActions = (Array.isArray(resolved?.availableActions) ? resolved.availableActions : []).reduce((acc, fv) => {
16975
+ const item = slotItemFromField(fv);
16976
+ if (item) acc.push(item);
16977
+ return acc;
16978
+ }, []);
16875
16979
  const allowDuplicates = resolved?.allowDuplicates !== false;
16876
16980
  const entitySlots = Array.isArray(resolved?.slots) ? resolved.slots : [];
16877
16981
  const entityResult = str(resolved?.result);
@@ -16929,7 +17033,7 @@ function SequencerBoard({
16929
17033
  let step = 0;
16930
17034
  const advance = () => {
16931
17035
  step++;
16932
- emit("UI:STEP", { step });
17036
+ if (stepEvent) emit(`UI:${stepEvent}`, { step });
16933
17037
  if (step >= maxSlots) {
16934
17038
  if (checkEvent) emit(`UI:${checkEvent}`, { sequence: playerIds });
16935
17039
  const playerSeq = slots.map((s) => s?.id);
@@ -19154,35 +19258,7 @@ var init_SimulationCanvas = __esm({
19154
19258
  SimulationCanvas.displayName = "SimulationCanvas";
19155
19259
  }
19156
19260
  });
19157
- function getSlotContentRenderer2() {
19158
- if (_scr) return _scr;
19159
- const mod = (init_UISlotRenderer(), __toCommonJS(UISlotRenderer_exports));
19160
- _scr = mod.SlotContentRenderer;
19161
- return _scr;
19162
- }
19163
- function resolveDescriptor(value, idPrefix) {
19164
- if (value === null || value === void 0) return value;
19165
- if (React105__default.isValidElement(value)) return value;
19166
- if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
19167
- if (Array.isArray(value)) {
19168
- return value.map((item, i) => /* @__PURE__ */ jsx(React105__default.Fragment, { children: resolveDescriptor(item, `${idPrefix}-${i}`) }, i));
19169
- }
19170
- if (typeof value === "object") {
19171
- const rec = value;
19172
- if (typeof rec.type === "string" && getComponentForPattern(rec.type) !== null) {
19173
- const type = rec.type;
19174
- const _id = typeof rec._id === "string" ? rec._id : void 0;
19175
- const nestedProps = rec.props !== void 0 && typeof rec.props === "object" && !Array.isArray(rec.props) && rec.props !== null ? rec.props : void 0;
19176
- const { type: _t, props: _p, _id: _d, ...flatRest } = rec;
19177
- const resolvedProps = nestedProps !== void 0 ? nestedProps : flatRest;
19178
- const content = { id: _id ?? idPrefix, pattern: type, props: resolvedProps, priority: 0 };
19179
- const SCR = getSlotContentRenderer2();
19180
- return /* @__PURE__ */ jsx(SCR, { content, onDismiss: () => void 0 });
19181
- }
19182
- }
19183
- return null;
19184
- }
19185
- var _scr, GameTemplate;
19261
+ var GameTemplate;
19186
19262
  var init_GameTemplate = __esm({
19187
19263
  "components/game/2d/templates/GameTemplate.tsx"() {
19188
19264
  init_cn();
@@ -19190,7 +19266,6 @@ var init_GameTemplate = __esm({
19190
19266
  init_Stack();
19191
19267
  init_Typography();
19192
19268
  init_Button();
19193
- _scr = null;
19194
19269
  GameTemplate = ({
19195
19270
  entity,
19196
19271
  title = "Game",
@@ -19199,7 +19274,8 @@ var init_GameTemplate = __esm({
19199
19274
  debugPanel,
19200
19275
  showDebugPanel = false,
19201
19276
  controls,
19202
- className
19277
+ className,
19278
+ backgroundAsset
19203
19279
  }) => {
19204
19280
  return /* @__PURE__ */ jsxs(
19205
19281
  Box,
@@ -19256,15 +19332,16 @@ var init_GameTemplate = __esm({
19256
19332
  {
19257
19333
  position: "relative",
19258
19334
  fullWidth: true,
19259
- className: "flex-1 bg-muted",
19335
+ className: backgroundAsset ? "flex-1" : "flex-1 bg-muted",
19336
+ style: backgroundAsset ? { backgroundImage: `url(${backgroundAsset.url})`, backgroundSize: "cover", backgroundPosition: "center" } : void 0,
19260
19337
  children: [
19261
- resolveDescriptor(children, "gt-children"),
19338
+ children,
19262
19339
  hud && /* @__PURE__ */ jsx(
19263
19340
  Box,
19264
19341
  {
19265
19342
  position: "absolute",
19266
19343
  className: "top-0 left-0 right-0 pointer-events-none",
19267
- children: /* @__PURE__ */ jsx(Box, { padding: "md", className: "pointer-events-auto w-fit", children: resolveDescriptor(hud, "gt-hud") })
19344
+ children: /* @__PURE__ */ jsx(Box, { padding: "md", className: "pointer-events-auto w-fit", children: hud })
19268
19345
  }
19269
19346
  )
19270
19347
  ]
@@ -19289,7 +19366,7 @@ var init_GameTemplate = __esm({
19289
19366
  children: /* @__PURE__ */ jsx(Typography, { variant: "h6", children: "Debug Panel" })
19290
19367
  }
19291
19368
  ),
19292
- /* @__PURE__ */ jsx(Box, { padding: "md", children: resolveDescriptor(debugPanel, "gt-debug") })
19369
+ /* @__PURE__ */ jsx(Box, { padding: "md", children: debugPanel })
19293
19370
  ]
19294
19371
  }
19295
19372
  )
@@ -19300,59 +19377,21 @@ var init_GameTemplate = __esm({
19300
19377
  GameTemplate.displayName = "GameTemplate";
19301
19378
  }
19302
19379
  });
19303
- function asDescriptor(v) {
19304
- if (Array.isArray(v) || React105__default.isValidElement(v)) return null;
19305
- const o = v;
19306
- if (typeof o.type !== "string") return null;
19307
- const props = o.props !== void 0 && typeof o.props === "object" && !Array.isArray(o.props) && o.props !== null ? o.props : void 0;
19308
- const _id = typeof o._id === "string" ? o._id : void 0;
19309
- const sourceTrait = typeof o.sourceTrait === "string" ? o.sourceTrait : void 0;
19310
- return { type: o.type, props, _id, sourceTrait };
19311
- }
19312
- function getSlotContentRenderer3() {
19313
- if (_scr2) return _scr2;
19314
- const mod = (init_UISlotRenderer(), __toCommonJS(UISlotRenderer_exports));
19315
- _scr2 = mod.SlotContentRenderer;
19316
- return _scr2;
19317
- }
19318
- function resolveDescriptor2(value, idPrefix) {
19319
- if (value === null || value === void 0) return value;
19320
- if (React105__default.isValidElement(value)) return value;
19321
- if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
19322
- if (Array.isArray(value)) {
19323
- return value.map((item, i) => /* @__PURE__ */ jsx(React105__default.Fragment, { children: resolveDescriptor2(item, `${idPrefix}-${i}`) }, i));
19324
- }
19325
- if (typeof value === "object" && value !== null) {
19326
- const desc = asDescriptor(value);
19327
- if (desc !== null && getComponentForPattern(desc.type) !== null) {
19328
- const resolvedProps = desc.props ?? {};
19329
- const content = {
19330
- id: desc._id ?? idPrefix,
19331
- pattern: desc.type,
19332
- props: resolvedProps,
19333
- priority: 0,
19334
- ...desc.sourceTrait !== void 0 && { sourceTrait: desc.sourceTrait }
19335
- };
19336
- const SCR = getSlotContentRenderer3();
19337
- return /* @__PURE__ */ jsx(SCR, { content, onDismiss: () => void 0 }, content.id);
19338
- }
19339
- }
19340
- return null;
19341
- }
19342
- var _scr2, GameShell;
19380
+ var GameShell;
19343
19381
  var init_GameShell = __esm({
19344
19382
  "components/game/2d/templates/GameShell.tsx"() {
19345
19383
  init_cn();
19346
19384
  init_Box();
19347
19385
  init_Stack();
19348
19386
  init_Typography();
19349
- _scr2 = null;
19350
19387
  GameShell = ({
19351
19388
  appName = "Game",
19352
19389
  hud,
19353
19390
  className,
19354
19391
  showTopBar = true,
19355
- children
19392
+ children,
19393
+ backgroundAsset,
19394
+ hudBackgroundAsset
19356
19395
  }) => {
19357
19396
  return /* @__PURE__ */ jsxs(
19358
19397
  Box,
@@ -19367,7 +19406,7 @@ var init_GameShell = __esm({
19367
19406
  width: "100vw",
19368
19407
  height: "100vh",
19369
19408
  overflow: "hidden",
19370
- background: "var(--color-background, #0a0a0f)",
19409
+ background: backgroundAsset ? `url(${backgroundAsset.url}) center/cover no-repeat` : "var(--color-background, #0a0a0f)",
19371
19410
  color: "var(--color-text, #e0e0e0)"
19372
19411
  },
19373
19412
  children: [
@@ -19377,7 +19416,7 @@ var init_GameShell = __esm({
19377
19416
  className: "game-shell__header",
19378
19417
  style: {
19379
19418
  flexShrink: 0,
19380
- background: "var(--color-surface, #12121f)",
19419
+ background: hudBackgroundAsset ? `url(${hudBackgroundAsset.url}) center/cover no-repeat` : "var(--color-surface, #12121f)",
19381
19420
  borderBottom: "1px solid var(--color-border, #2a2a3a)"
19382
19421
  },
19383
19422
  children: [
@@ -19400,7 +19439,7 @@ var init_GameShell = __esm({
19400
19439
  )
19401
19440
  }
19402
19441
  ),
19403
- hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud", style: { width: "100%" }, children: resolveDescriptor2(hud, "gs-hud") })
19442
+ hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud", style: { width: "100%" }, children: hud })
19404
19443
  ]
19405
19444
  }
19406
19445
  ),
@@ -19413,7 +19452,7 @@ var init_GameShell = __esm({
19413
19452
  overflow: "hidden",
19414
19453
  position: "relative"
19415
19454
  },
19416
- children: resolveDescriptor2(children, "gs-children")
19455
+ children
19417
19456
  }
19418
19457
  )
19419
19458
  ]
@@ -20620,7 +20659,7 @@ var init_ErrorBoundary = __esm({
20620
20659
  }
20621
20660
  );
20622
20661
  };
20623
- ErrorBoundary = class extends React105__default.Component {
20662
+ ErrorBoundary = class extends React103__default.Component {
20624
20663
  constructor(props) {
20625
20664
  super(props);
20626
20665
  __publicField(this, "reset", () => {
@@ -20902,7 +20941,7 @@ var init_Container = __esm({
20902
20941
  as: Component = "div"
20903
20942
  }) => {
20904
20943
  const resolvedSize = maxWidth ?? size ?? "lg";
20905
- return React105__default.createElement(
20944
+ return React103__default.createElement(
20906
20945
  Component,
20907
20946
  {
20908
20947
  className: cn(
@@ -23084,9 +23123,9 @@ var init_BiologyCanvas = __esm({
23084
23123
  }
23085
23124
  });
23086
23125
 
23087
- // node_modules/.pnpm/katex@0.16.47/node_modules/katex/dist/katex.min.css
23126
+ // node_modules/katex/dist/katex.min.css
23088
23127
  var init_katex_min = __esm({
23089
- "node_modules/.pnpm/katex@0.16.47/node_modules/katex/dist/katex.min.css"() {
23128
+ "node_modules/katex/dist/katex.min.css"() {
23090
23129
  }
23091
23130
  });
23092
23131
  var Tabs;
@@ -23526,7 +23565,7 @@ var init_CodeBlock = __esm({
23526
23565
  DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
23527
23566
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
23528
23567
  HIDDEN_LINE_NUMBERS = { display: "none" };
23529
- CodeBlock = React105__default.memo(
23568
+ CodeBlock = React103__default.memo(
23530
23569
  ({
23531
23570
  code: rawCode,
23532
23571
  language = "text",
@@ -24113,7 +24152,7 @@ var init_MarkdownContent = __esm({
24113
24152
  init_Box();
24114
24153
  init_CodeBlock();
24115
24154
  init_cn();
24116
- MarkdownContent = React105__default.memo(
24155
+ MarkdownContent = React103__default.memo(
24117
24156
  ({ content, direction = "ltr", className }) => {
24118
24157
  const { t: _t } = useTranslate();
24119
24158
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -25390,7 +25429,7 @@ var init_StateMachineView = __esm({
25390
25429
  style: { top: title ? 30 : 0 },
25391
25430
  children: [
25392
25431
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
25393
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React105__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
25432
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React103__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
25394
25433
  StateNode2,
25395
25434
  {
25396
25435
  state,
@@ -29926,6 +29965,8 @@ function CounterMinimal({
29926
29965
  size = "md",
29927
29966
  onDecrement,
29928
29967
  onIncrement,
29968
+ decrementEvent,
29969
+ incrementEvent,
29929
29970
  className
29930
29971
  }) {
29931
29972
  const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
@@ -29936,6 +29977,7 @@ function CounterMinimal({
29936
29977
  {
29937
29978
  variant: "secondary",
29938
29979
  size: sizeStyles8[size].button,
29980
+ action: decrementEvent,
29939
29981
  onClick: onDecrement,
29940
29982
  disabled: resolved.decrementDisabled,
29941
29983
  icon: "minus",
@@ -29958,6 +30000,7 @@ function CounterMinimal({
29958
30000
  {
29959
30001
  variant: "secondary",
29960
30002
  size: sizeStyles8[size].button,
30003
+ action: incrementEvent,
29961
30004
  onClick: onIncrement,
29962
30005
  disabled: resolved.incrementDisabled,
29963
30006
  icon: "plus",
@@ -29974,6 +30017,9 @@ function CounterStandard({
29974
30017
  onDecrement,
29975
30018
  onIncrement,
29976
30019
  onReset,
30020
+ decrementEvent,
30021
+ incrementEvent,
30022
+ resetEvent,
29977
30023
  className
29978
30024
  }) {
29979
30025
  const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
@@ -30004,6 +30050,7 @@ function CounterStandard({
30004
30050
  {
30005
30051
  variant: "secondary",
30006
30052
  size: sizeStyles8[size].button,
30053
+ action: decrementEvent,
30007
30054
  onClick: onDecrement,
30008
30055
  disabled: resolved.decrementDisabled,
30009
30056
  icon: "minus"
@@ -30014,6 +30061,7 @@ function CounterStandard({
30014
30061
  {
30015
30062
  variant: "primary",
30016
30063
  size: sizeStyles8[size].button,
30064
+ action: incrementEvent,
30017
30065
  onClick: onIncrement,
30018
30066
  disabled: resolved.incrementDisabled,
30019
30067
  icon: "plus"
@@ -30025,6 +30073,7 @@ function CounterStandard({
30025
30073
  {
30026
30074
  variant: "ghost",
30027
30075
  size: "sm",
30076
+ action: resetEvent,
30028
30077
  onClick: onReset,
30029
30078
  icon: "rotate-ccw",
30030
30079
  children: "Reset"
@@ -30040,6 +30089,9 @@ function CounterFull({
30040
30089
  onDecrement,
30041
30090
  onIncrement,
30042
30091
  onReset,
30092
+ decrementEvent,
30093
+ incrementEvent,
30094
+ resetEvent,
30043
30095
  className
30044
30096
  }) {
30045
30097
  const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
@@ -30073,6 +30125,7 @@ function CounterFull({
30073
30125
  {
30074
30126
  variant: "secondary",
30075
30127
  size: sizeStyles8[size].button,
30128
+ action: decrementEvent,
30076
30129
  onClick: onDecrement,
30077
30130
  disabled: resolved.decrementDisabled,
30078
30131
  icon: "minus",
@@ -30084,6 +30137,7 @@ function CounterFull({
30084
30137
  {
30085
30138
  variant: "primary",
30086
30139
  size: sizeStyles8[size].button,
30140
+ action: incrementEvent,
30087
30141
  onClick: onIncrement,
30088
30142
  disabled: resolved.incrementDisabled,
30089
30143
  icon: "plus",
@@ -30096,6 +30150,7 @@ function CounterFull({
30096
30150
  {
30097
30151
  variant: "ghost",
30098
30152
  size: "sm",
30153
+ action: resetEvent,
30099
30154
  onClick: onReset,
30100
30155
  icon: "rotate-ccw",
30101
30156
  children: "Reset to 0"
@@ -30931,8 +30986,8 @@ var init_Menu = __esm({
30931
30986
  "bottom-end": "bottom-start"
30932
30987
  };
30933
30988
  const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
30934
- const triggerChild = React105__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
30935
- const triggerElement = React105__default.cloneElement(
30989
+ const triggerChild = React103__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
30990
+ const triggerElement = React103__default.cloneElement(
30936
30991
  triggerChild,
30937
30992
  {
30938
30993
  ref: triggerRef,
@@ -31027,14 +31082,14 @@ function useDataDnd(args) {
31027
31082
  const isZone = Boolean(dragGroup || accepts || sortable);
31028
31083
  const enabled = isZone || Boolean(dndRoot);
31029
31084
  const eventBus = useEventBus();
31030
- const parentRoot = React105__default.useContext(RootCtx);
31085
+ const parentRoot = React103__default.useContext(RootCtx);
31031
31086
  const isRoot = enabled && parentRoot === null;
31032
- const zoneId = React105__default.useId();
31087
+ const zoneId = React103__default.useId();
31033
31088
  const ownGroup = dragGroup ?? accepts ?? zoneId;
31034
- const [optimisticOrders, setOptimisticOrders] = React105__default.useState(() => /* @__PURE__ */ new Map());
31035
- const optimisticOrdersRef = React105__default.useRef(optimisticOrders);
31089
+ const [optimisticOrders, setOptimisticOrders] = React103__default.useState(() => /* @__PURE__ */ new Map());
31090
+ const optimisticOrdersRef = React103__default.useRef(optimisticOrders);
31036
31091
  optimisticOrdersRef.current = optimisticOrders;
31037
- const clearOptimisticOrder = React105__default.useCallback((group) => {
31092
+ const clearOptimisticOrder = React103__default.useCallback((group) => {
31038
31093
  setOptimisticOrders((prev) => {
31039
31094
  if (!prev.has(group)) return prev;
31040
31095
  const next = new Map(prev);
@@ -31059,7 +31114,7 @@ function useDataDnd(args) {
31059
31114
  const raw = it[dndItemIdField];
31060
31115
  return raw != null ? String(raw) : `__idx_${idx}`;
31061
31116
  }).join("|");
31062
- const itemIds = React105__default.useMemo(
31117
+ const itemIds = React103__default.useMemo(
31063
31118
  () => orderedItems.map((it, idx) => {
31064
31119
  const raw = it[dndItemIdField];
31065
31120
  return raw != null ? String(raw) : `__idx_${idx}`;
@@ -31070,7 +31125,7 @@ function useDataDnd(args) {
31070
31125
  const raw = it[dndItemIdField];
31071
31126
  return raw != null ? String(raw) : `__${idx}`;
31072
31127
  }).join("|");
31073
- React105__default.useEffect(() => {
31128
+ React103__default.useEffect(() => {
31074
31129
  const root = isRoot ? null : parentRoot;
31075
31130
  if (root) {
31076
31131
  root.clearOptimisticOrder(ownGroup);
@@ -31078,20 +31133,20 @@ function useDataDnd(args) {
31078
31133
  clearOptimisticOrder(ownGroup);
31079
31134
  }
31080
31135
  }, [itemsContentSig, ownGroup]);
31081
- const zonesRef = React105__default.useRef(/* @__PURE__ */ new Map());
31082
- const registerZone = React105__default.useCallback((zoneId2, meta2) => {
31136
+ const zonesRef = React103__default.useRef(/* @__PURE__ */ new Map());
31137
+ const registerZone = React103__default.useCallback((zoneId2, meta2) => {
31083
31138
  zonesRef.current.set(zoneId2, meta2);
31084
31139
  }, []);
31085
- const unregisterZone = React105__default.useCallback((zoneId2) => {
31140
+ const unregisterZone = React103__default.useCallback((zoneId2) => {
31086
31141
  zonesRef.current.delete(zoneId2);
31087
31142
  }, []);
31088
- const [activeDrag, setActiveDrag] = React105__default.useState(null);
31089
- const [overZoneGroup, setOverZoneGroup] = React105__default.useState(null);
31090
- const meta = React105__default.useMemo(
31143
+ const [activeDrag, setActiveDrag] = React103__default.useState(null);
31144
+ const [overZoneGroup, setOverZoneGroup] = React103__default.useState(null);
31145
+ const meta = React103__default.useMemo(
31091
31146
  () => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
31092
31147
  [ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
31093
31148
  );
31094
- React105__default.useEffect(() => {
31149
+ React103__default.useEffect(() => {
31095
31150
  const target = isRoot ? null : parentRoot;
31096
31151
  if (!target) {
31097
31152
  zonesRef.current.set(zoneId, meta);
@@ -31110,7 +31165,7 @@ function useDataDnd(args) {
31110
31165
  }, [parentRoot, isRoot, zoneId, meta]);
31111
31166
  const sensors = useAlmadarDndSensors(true);
31112
31167
  const collisionDetection = almadarDndCollisionDetection;
31113
- const findZoneByItem = React105__default.useCallback(
31168
+ const findZoneByItem = React103__default.useCallback(
31114
31169
  (id) => {
31115
31170
  for (const z of zonesRef.current.values()) {
31116
31171
  if (z.itemIds.includes(id)) return z;
@@ -31119,7 +31174,7 @@ function useDataDnd(args) {
31119
31174
  },
31120
31175
  []
31121
31176
  );
31122
- React105__default.useCallback(
31177
+ React103__default.useCallback(
31123
31178
  (group) => {
31124
31179
  for (const z of zonesRef.current.values()) {
31125
31180
  if (z.group === group) return z;
@@ -31128,7 +31183,7 @@ function useDataDnd(args) {
31128
31183
  },
31129
31184
  []
31130
31185
  );
31131
- const handleDragEnd = React105__default.useCallback(
31186
+ const handleDragEnd = React103__default.useCallback(
31132
31187
  (event) => {
31133
31188
  const { active, over } = event;
31134
31189
  const activeIdStr = String(active.id);
@@ -31219,8 +31274,8 @@ function useDataDnd(args) {
31219
31274
  },
31220
31275
  [eventBus]
31221
31276
  );
31222
- const sortableData = React105__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
31223
- const SortableItem = React105__default.useCallback(
31277
+ const sortableData = React103__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
31278
+ const SortableItem = React103__default.useCallback(
31224
31279
  ({ id, children }) => {
31225
31280
  const {
31226
31281
  attributes,
@@ -31260,7 +31315,7 @@ function useDataDnd(args) {
31260
31315
  id: droppableId,
31261
31316
  data: sortableData
31262
31317
  });
31263
- const ctx = React105__default.useContext(RootCtx);
31318
+ const ctx = React103__default.useContext(RootCtx);
31264
31319
  const activeDrag2 = ctx?.activeDrag ?? null;
31265
31320
  const overZoneGroup2 = ctx?.overZoneGroup ?? null;
31266
31321
  const isThisZoneOver = overZoneGroup2 === ownGroup;
@@ -31275,7 +31330,7 @@ function useDataDnd(args) {
31275
31330
  showForeignPlaceholder,
31276
31331
  ctxAvailable: ctx != null
31277
31332
  });
31278
- React105__default.useEffect(() => {
31333
+ React103__default.useEffect(() => {
31279
31334
  dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
31280
31335
  }, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
31281
31336
  return /* @__PURE__ */ jsx(
@@ -31289,11 +31344,11 @@ function useDataDnd(args) {
31289
31344
  }
31290
31345
  );
31291
31346
  };
31292
- const rootContextValue = React105__default.useMemo(
31347
+ const rootContextValue = React103__default.useMemo(
31293
31348
  () => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
31294
31349
  [registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
31295
31350
  );
31296
- const handleDragStart = React105__default.useCallback((event) => {
31351
+ const handleDragStart = React103__default.useCallback((event) => {
31297
31352
  const sourceZone = findZoneByItem(event.active.id);
31298
31353
  const rect = event.active.rect.current.initial;
31299
31354
  const height = rect?.height && rect.height > 0 ? rect.height : 64;
@@ -31312,7 +31367,7 @@ function useDataDnd(args) {
31312
31367
  isRoot
31313
31368
  });
31314
31369
  }, [findZoneByItem, isRoot, zoneId]);
31315
- const handleDragOver = React105__default.useCallback((event) => {
31370
+ const handleDragOver = React103__default.useCallback((event) => {
31316
31371
  const { active, over } = event;
31317
31372
  const overData = over?.data?.current;
31318
31373
  const overGroup = overData?.dndGroup ?? null;
@@ -31382,7 +31437,7 @@ function useDataDnd(args) {
31382
31437
  return next;
31383
31438
  });
31384
31439
  }, []);
31385
- const handleDragCancel = React105__default.useCallback((event) => {
31440
+ const handleDragCancel = React103__default.useCallback((event) => {
31386
31441
  setActiveDrag(null);
31387
31442
  setOverZoneGroup(null);
31388
31443
  dndLog.warn("dragCancel", {
@@ -31390,12 +31445,12 @@ function useDataDnd(args) {
31390
31445
  reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
31391
31446
  });
31392
31447
  }, []);
31393
- const handleDragEndWithCleanup = React105__default.useCallback((event) => {
31448
+ const handleDragEndWithCleanup = React103__default.useCallback((event) => {
31394
31449
  handleDragEnd(event);
31395
31450
  setActiveDrag(null);
31396
31451
  setOverZoneGroup(null);
31397
31452
  }, [handleDragEnd]);
31398
- const wrapContainer = React105__default.useCallback(
31453
+ const wrapContainer = React103__default.useCallback(
31399
31454
  (children) => {
31400
31455
  if (!enabled) return children;
31401
31456
  const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
@@ -31449,7 +31504,7 @@ var init_useDataDnd = __esm({
31449
31504
  init_useAlmadarDndCollision();
31450
31505
  init_Box();
31451
31506
  dndLog = createLogger("almadar:ui:dnd");
31452
- RootCtx = React105__default.createContext(null);
31507
+ RootCtx = React103__default.createContext(null);
31453
31508
  }
31454
31509
  });
31455
31510
  function renderIconInput(icon, props) {
@@ -31975,7 +32030,7 @@ function DataList({
31975
32030
  }) {
31976
32031
  const eventBus = useEventBus();
31977
32032
  const { t } = useTranslate();
31978
- const [visibleCount, setVisibleCount] = React105__default.useState(pageSize || Infinity);
32033
+ const [visibleCount, setVisibleCount] = React103__default.useState(pageSize || Infinity);
31979
32034
  const fieldDefs = fields ?? columns ?? [];
31980
32035
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
31981
32036
  const dnd = useDataDnd({
@@ -31994,7 +32049,7 @@ function DataList({
31994
32049
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
31995
32050
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
31996
32051
  const hasRenderProp = typeof children === "function";
31997
- React105__default.useEffect(() => {
32052
+ React103__default.useEffect(() => {
31998
32053
  const renderItemTypeOf = typeof schemaRenderItem;
31999
32054
  const childrenTypeOf = typeof children;
32000
32055
  if (data.length > 0 && !hasRenderProp) {
@@ -32098,7 +32153,7 @@ function DataList({
32098
32153
  const items2 = [...data];
32099
32154
  const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
32100
32155
  const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
32101
- return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
32156
+ return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React103__default.Fragment, { children: [
32102
32157
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
32103
32158
  group.items.map((itemData, index) => {
32104
32159
  const id = itemData.id || `${gi}-${index}`;
@@ -32239,7 +32294,7 @@ function DataList({
32239
32294
  className
32240
32295
  ),
32241
32296
  children: [
32242
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
32297
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React103__default.Fragment, { children: [
32243
32298
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
32244
32299
  group.items.map(
32245
32300
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -32324,7 +32379,7 @@ var init_FormSection = __esm({
32324
32379
  columns = 1,
32325
32380
  className
32326
32381
  }) => {
32327
- const [collapsed, setCollapsed] = React105__default.useState(defaultCollapsed);
32382
+ const [collapsed, setCollapsed] = React103__default.useState(defaultCollapsed);
32328
32383
  const { t } = useTranslate();
32329
32384
  const eventBus = useEventBus();
32330
32385
  const gridClass = {
@@ -32332,7 +32387,7 @@ var init_FormSection = __esm({
32332
32387
  2: "grid-cols-1 md:grid-cols-2",
32333
32388
  3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
32334
32389
  }[columns];
32335
- React105__default.useCallback(() => {
32390
+ React103__default.useCallback(() => {
32336
32391
  if (collapsible) {
32337
32392
  setCollapsed((prev) => !prev);
32338
32393
  eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
@@ -33218,7 +33273,7 @@ var init_Flex = __esm({
33218
33273
  flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
33219
33274
  }
33220
33275
  }
33221
- return React105__default.createElement(Component, {
33276
+ return React103__default.createElement(Component, {
33222
33277
  className: cn(
33223
33278
  inline ? "inline-flex" : "flex",
33224
33279
  directionStyles[direction],
@@ -33337,7 +33392,7 @@ var init_Grid = __esm({
33337
33392
  as: Component = "div"
33338
33393
  }) => {
33339
33394
  const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
33340
- return React105__default.createElement(
33395
+ return React103__default.createElement(
33341
33396
  Component,
33342
33397
  {
33343
33398
  className: cn(
@@ -33533,9 +33588,9 @@ var init_Popover = __esm({
33533
33588
  onMouseLeave: handleClose,
33534
33589
  onPointerDown: tapTriggerProps.onPointerDown
33535
33590
  };
33536
- const childElement = React105__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
33591
+ const childElement = React103__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
33537
33592
  const childPointerDown = childElement.props.onPointerDown;
33538
- const triggerElement = React105__default.cloneElement(
33593
+ const triggerElement = React103__default.cloneElement(
33539
33594
  childElement,
33540
33595
  {
33541
33596
  ref: triggerRef,
@@ -34137,9 +34192,9 @@ var init_Tooltip = __esm({
34137
34192
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
34138
34193
  };
34139
34194
  }, []);
34140
- const triggerElement = React105__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
34195
+ const triggerElement = React103__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
34141
34196
  const childPointerDown = triggerElement.props.onPointerDown;
34142
- const trigger = React105__default.cloneElement(triggerElement, {
34197
+ const trigger = React103__default.cloneElement(triggerElement, {
34143
34198
  ref: triggerRef,
34144
34199
  onMouseEnter: handleMouseEnter,
34145
34200
  onMouseLeave: handleMouseLeave,
@@ -34229,7 +34284,7 @@ var init_WizardProgress = __esm({
34229
34284
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
34230
34285
  const isActive = index === currentStep;
34231
34286
  const isCompleted = index < currentStep;
34232
- return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
34287
+ return /* @__PURE__ */ jsxs(React103__default.Fragment, { children: [
34233
34288
  /* @__PURE__ */ jsx(
34234
34289
  "button",
34235
34290
  {
@@ -35789,7 +35844,7 @@ var init_MapView = __esm({
35789
35844
  shadowSize: [41, 41]
35790
35845
  });
35791
35846
  L.Marker.prototype.options.icon = defaultIcon;
35792
- const { useEffect: useEffect75, useRef: useRef77, useCallback: useCallback112, useState: useState107 } = React105__default;
35847
+ const { useEffect: useEffect75, useRef: useRef77, useCallback: useCallback112, useState: useState107 } = React103__default;
35793
35848
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
35794
35849
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
35795
35850
  function MapUpdater({ centerLat, centerLng, zoom }) {
@@ -36704,8 +36759,8 @@ function TableView({
36704
36759
  }) {
36705
36760
  const eventBus = useEventBus();
36706
36761
  const { t } = useTranslate();
36707
- const [visibleCount, setVisibleCount] = React105__default.useState(pageSize > 0 ? pageSize : Infinity);
36708
- const [localSelected, setLocalSelected] = React105__default.useState(/* @__PURE__ */ new Set());
36762
+ const [visibleCount, setVisibleCount] = React103__default.useState(pageSize > 0 ? pageSize : Infinity);
36763
+ const [localSelected, setLocalSelected] = React103__default.useState(/* @__PURE__ */ new Set());
36709
36764
  const colDefs = columns ?? fields ?? [];
36710
36765
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
36711
36766
  const dnd = useDataDnd({
@@ -36900,12 +36955,12 @@ function TableView({
36900
36955
  ]
36901
36956
  }
36902
36957
  );
36903
- return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React105__default.Fragment, { children: rowInner }, id);
36958
+ return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React103__default.Fragment, { children: rowInner }, id);
36904
36959
  };
36905
36960
  const items = Array.from(data);
36906
36961
  const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
36907
36962
  let runningIndex = 0;
36908
- const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
36963
+ const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React103__default.Fragment, { children: [
36909
36964
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
36910
36965
  group.items.map((row) => renderRow(row, runningIndex++))
36911
36966
  ] }, gi)) });
@@ -38124,7 +38179,7 @@ var init_StepFlow = __esm({
38124
38179
  className
38125
38180
  }) => {
38126
38181
  if (orientation === "vertical") {
38127
- return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React105__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
38182
+ return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React103__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
38128
38183
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
38129
38184
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
38130
38185
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -38135,7 +38190,7 @@ var init_StepFlow = __esm({
38135
38190
  ] })
38136
38191
  ] }) }, index)) });
38137
38192
  }
38138
- 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(React105__default.Fragment, { children: [
38193
+ 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(React103__default.Fragment, { children: [
38139
38194
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
38140
38195
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
38141
38196
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -39120,7 +39175,7 @@ var init_LikertScale = __esm({
39120
39175
  md: "text-base",
39121
39176
  lg: "text-lg"
39122
39177
  };
39123
- LikertScale = React105__default.forwardRef(
39178
+ LikertScale = React103__default.forwardRef(
39124
39179
  ({
39125
39180
  question,
39126
39181
  options = DEFAULT_LIKERT_OPTIONS,
@@ -39132,7 +39187,7 @@ var init_LikertScale = __esm({
39132
39187
  variant = "radios",
39133
39188
  className
39134
39189
  }, ref) => {
39135
- const groupId = React105__default.useId();
39190
+ const groupId = React103__default.useId();
39136
39191
  const eventBus = useEventBus();
39137
39192
  const handleSelect = useCallback(
39138
39193
  (next) => {
@@ -41414,7 +41469,7 @@ var init_DocBreadcrumb = __esm({
41414
41469
  "aria-label": t("aria.breadcrumb"),
41415
41470
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
41416
41471
  const isLast = idx === items.length - 1;
41417
- return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
41472
+ return /* @__PURE__ */ jsxs(React103__default.Fragment, { children: [
41418
41473
  idx > 0 && /* @__PURE__ */ jsx(
41419
41474
  Icon,
41420
41475
  {
@@ -42283,7 +42338,7 @@ var init_MiniStateMachine = __esm({
42283
42338
  const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
42284
42339
  const tc = transitionCounts[s.name] ?? 0;
42285
42340
  const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
42286
- return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
42341
+ return /* @__PURE__ */ jsxs(React103__default.Fragment, { children: [
42287
42342
  /* @__PURE__ */ jsx(
42288
42343
  AvlState,
42289
42344
  {
@@ -42487,7 +42542,7 @@ var init_PageHeader = __esm({
42487
42542
  info: "bg-info/10 text-info"
42488
42543
  };
42489
42544
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
42490
- breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
42545
+ 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(React103__default.Fragment, { children: [
42491
42546
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
42492
42547
  crumb.href ? /* @__PURE__ */ jsx(
42493
42548
  "a",
@@ -42845,7 +42900,7 @@ var init_Section = __esm({
42845
42900
  as: Component = "section"
42846
42901
  }) => {
42847
42902
  const hasHeader = title || description || action;
42848
- return React105__default.createElement(
42903
+ return React103__default.createElement(
42849
42904
  Component,
42850
42905
  {
42851
42906
  className: cn(
@@ -43147,6 +43202,7 @@ var init_WizardContainer = __esm({
43147
43202
  init_Stack();
43148
43203
  init_Icon();
43149
43204
  init_cn();
43205
+ init_useEventBus();
43150
43206
  WizardContainer = ({
43151
43207
  steps,
43152
43208
  currentStep: controlledStep,
@@ -43155,9 +43211,13 @@ var init_WizardContainer = __esm({
43155
43211
  showProgress = true,
43156
43212
  allowBack = true,
43157
43213
  compact = false,
43158
- className
43214
+ className,
43215
+ nextEvent,
43216
+ backEvent,
43217
+ completeEvent
43159
43218
  }) => {
43160
43219
  const { t } = useTranslate();
43220
+ const eventBus = useEventBus();
43161
43221
  const [internalStep, setInternalStep] = useState(0);
43162
43222
  const normalizedControlledStep = (() => {
43163
43223
  if (controlledStep === void 0 || controlledStep === null)
@@ -43187,13 +43247,16 @@ var init_WizardContainer = __esm({
43187
43247
  return;
43188
43248
  }
43189
43249
  if (isLastStep) {
43250
+ if (completeEvent) eventBus.emit(`UI:${completeEvent}`, { step: currentStep });
43190
43251
  onComplete?.();
43191
43252
  } else {
43253
+ if (nextEvent) eventBus.emit(`UI:${nextEvent}`, { step: currentStep + 1 });
43192
43254
  goToStep(currentStep + 1);
43193
43255
  }
43194
43256
  };
43195
43257
  const handleBack = () => {
43196
43258
  if (!isFirstStep && allowBack) {
43259
+ if (backEvent) eventBus.emit(`UI:${backEvent}`, { step: currentStep - 1 });
43197
43260
  goToStep(currentStep - 1);
43198
43261
  }
43199
43262
  };
@@ -43211,7 +43274,7 @@ var init_WizardContainer = __esm({
43211
43274
  const isCompleted = index < currentStep;
43212
43275
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
43213
43276
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
43214
- return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
43277
+ return /* @__PURE__ */ jsxs(React103__default.Fragment, { children: [
43215
43278
  /* @__PURE__ */ jsx(
43216
43279
  Button,
43217
43280
  {
@@ -45644,7 +45707,7 @@ var init_DetailPanel = __esm({
45644
45707
  }
45645
45708
  });
45646
45709
  function extractTitle(children) {
45647
- if (!React105__default.isValidElement(children)) return void 0;
45710
+ if (!React103__default.isValidElement(children)) return void 0;
45648
45711
  const props = children.props;
45649
45712
  if (typeof props.title === "string") {
45650
45713
  return props.title;
@@ -45662,14 +45725,18 @@ var init_DrawerSlot = __esm({
45662
45725
  title: overrideTitle,
45663
45726
  position = "right",
45664
45727
  size = "md",
45665
- className
45728
+ className,
45729
+ sourceTrait
45666
45730
  }) => {
45667
45731
  const eventBus = useEventBus();
45732
+ const schemaCtx = useEntitySchemaOptional();
45668
45733
  const isOpen = Boolean(children);
45669
45734
  const title = overrideTitle || extractTitle(children);
45670
45735
  const handleClose = () => {
45671
- eventBus.emit("UI:CLOSE");
45672
- eventBus.emit("UI:CANCEL");
45736
+ const orbital = sourceTrait !== void 0 && schemaCtx !== null ? schemaCtx.orbitalsByTrait.get(sourceTrait) : void 0;
45737
+ const prefix = orbital !== void 0 && sourceTrait !== void 0 ? `UI:${orbital}.${sourceTrait}.` : "UI:";
45738
+ eventBus.emit(`${prefix}CLOSE`);
45739
+ eventBus.emit(`${prefix}CANCEL`);
45673
45740
  };
45674
45741
  if (!isOpen) return null;
45675
45742
  return /* @__PURE__ */ jsx(
@@ -45990,12 +46057,12 @@ var init_Form = __esm({
45990
46057
  const isSchemaEntity = isOrbitalEntitySchema(entity);
45991
46058
  const resolvedEntity = isSchemaEntity ? entity : void 0;
45992
46059
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
45993
- const normalizedInitialData = React105__default.useMemo(() => {
46060
+ const normalizedInitialData = React103__default.useMemo(() => {
45994
46061
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
45995
46062
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
45996
46063
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
45997
46064
  }, [entity, initialData]);
45998
- const entityDerivedFields = React105__default.useMemo(() => {
46065
+ const entityDerivedFields = React103__default.useMemo(() => {
45999
46066
  if (fields && fields.length > 0) return void 0;
46000
46067
  if (!resolvedEntity) return void 0;
46001
46068
  return resolvedEntity.fields.map(
@@ -46016,16 +46083,16 @@ var init_Form = __esm({
46016
46083
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
46017
46084
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
46018
46085
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
46019
- const [formData, setFormData] = React105__default.useState(
46086
+ const [formData, setFormData] = React103__default.useState(
46020
46087
  normalizedInitialData
46021
46088
  );
46022
- const [collapsedSections, setCollapsedSections] = React105__default.useState(
46089
+ const [collapsedSections, setCollapsedSections] = React103__default.useState(
46023
46090
  /* @__PURE__ */ new Set()
46024
46091
  );
46025
- const [submitError, setSubmitError] = React105__default.useState(null);
46026
- const formRef = React105__default.useRef(null);
46092
+ const [submitError, setSubmitError] = React103__default.useState(null);
46093
+ const formRef = React103__default.useRef(null);
46027
46094
  const formMode = props.mode;
46028
- const mountedRef = React105__default.useRef(false);
46095
+ const mountedRef = React103__default.useRef(false);
46029
46096
  if (!mountedRef.current) {
46030
46097
  mountedRef.current = true;
46031
46098
  debug("forms", "mount", {
@@ -46038,7 +46105,7 @@ var init_Form = __esm({
46038
46105
  });
46039
46106
  }
46040
46107
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
46041
- const evalContext = React105__default.useMemo(
46108
+ const evalContext = React103__default.useMemo(
46042
46109
  () => ({
46043
46110
  formValues: formData,
46044
46111
  globalVariables: externalContext?.globalVariables ?? {},
@@ -46047,7 +46114,7 @@ var init_Form = __esm({
46047
46114
  }),
46048
46115
  [formData, externalContext]
46049
46116
  );
46050
- React105__default.useEffect(() => {
46117
+ React103__default.useEffect(() => {
46051
46118
  debug("forms", "initialData-sync", {
46052
46119
  mode: formMode,
46053
46120
  normalizedInitialData,
@@ -46058,7 +46125,7 @@ var init_Form = __esm({
46058
46125
  setFormData(normalizedInitialData);
46059
46126
  }
46060
46127
  }, [normalizedInitialData]);
46061
- const processCalculations = React105__default.useCallback(
46128
+ const processCalculations = React103__default.useCallback(
46062
46129
  (changedFieldId, newFormData) => {
46063
46130
  if (!hiddenCalculations.length) return;
46064
46131
  const context = {
@@ -46083,7 +46150,7 @@ var init_Form = __esm({
46083
46150
  },
46084
46151
  [hiddenCalculations, externalContext, eventBus]
46085
46152
  );
46086
- const checkViolations = React105__default.useCallback(
46153
+ const checkViolations = React103__default.useCallback(
46087
46154
  (changedFieldId, newFormData) => {
46088
46155
  if (!violationTriggers.length) return;
46089
46156
  const context = {
@@ -46121,7 +46188,7 @@ var init_Form = __esm({
46121
46188
  processCalculations(name, newFormData);
46122
46189
  checkViolations(name, newFormData);
46123
46190
  };
46124
- const isFieldVisible = React105__default.useCallback(
46191
+ const isFieldVisible = React103__default.useCallback(
46125
46192
  (fieldName) => {
46126
46193
  const condition = conditionalFields[fieldName];
46127
46194
  if (!condition) return true;
@@ -46129,7 +46196,7 @@ var init_Form = __esm({
46129
46196
  },
46130
46197
  [conditionalFields, evalContext]
46131
46198
  );
46132
- const isSectionVisible = React105__default.useCallback(
46199
+ const isSectionVisible = React103__default.useCallback(
46133
46200
  (section) => {
46134
46201
  if (!section.condition) return true;
46135
46202
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -46205,7 +46272,7 @@ var init_Form = __esm({
46205
46272
  eventBus.emit(`UI:${onCancel}`);
46206
46273
  }
46207
46274
  };
46208
- const renderField = React105__default.useCallback(
46275
+ const renderField = React103__default.useCallback(
46209
46276
  (field) => {
46210
46277
  const fieldName = field.name || field.field;
46211
46278
  if (!fieldName) return null;
@@ -46226,7 +46293,7 @@ var init_Form = __esm({
46226
46293
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
46227
46294
  );
46228
46295
  const effectiveFields = entityDerivedFields ?? fields;
46229
- const normalizedFields = React105__default.useMemo(() => {
46296
+ const normalizedFields = React103__default.useMemo(() => {
46230
46297
  if (!effectiveFields || effectiveFields.length === 0) return [];
46231
46298
  return effectiveFields.map((field) => {
46232
46299
  if (typeof field === "string") {
@@ -46250,7 +46317,7 @@ var init_Form = __esm({
46250
46317
  return field;
46251
46318
  });
46252
46319
  }, [effectiveFields, resolvedEntity]);
46253
- const schemaFields = React105__default.useMemo(() => {
46320
+ const schemaFields = React103__default.useMemo(() => {
46254
46321
  if (normalizedFields.length === 0) return null;
46255
46322
  if (isDebugEnabled()) {
46256
46323
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -46260,7 +46327,7 @@ var init_Form = __esm({
46260
46327
  }
46261
46328
  return normalizedFields.map(renderField).filter(Boolean);
46262
46329
  }, [normalizedFields, renderField, entityName, conditionalFields]);
46263
- const sectionElements = React105__default.useMemo(() => {
46330
+ const sectionElements = React103__default.useMemo(() => {
46264
46331
  if (!sections || sections.length === 0) return null;
46265
46332
  return sections.map((section) => {
46266
46333
  if (!isSectionVisible(section)) {
@@ -46985,7 +47052,7 @@ var init_List = __esm({
46985
47052
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
46986
47053
  return [];
46987
47054
  }, [entity]);
46988
- const getItemActions = React105__default.useCallback(
47055
+ const getItemActions = React103__default.useCallback(
46989
47056
  (item) => {
46990
47057
  if (!itemActions) return [];
46991
47058
  if (typeof itemActions === "function") {
@@ -47460,7 +47527,7 @@ var init_MediaGallery = __esm({
47460
47527
  [selectable, selectedItems, selectionEvent, eventBus]
47461
47528
  );
47462
47529
  const entityData = Array.isArray(entity) ? entity : [];
47463
- const items = React105__default.useMemo(() => {
47530
+ const items = React103__default.useMemo(() => {
47464
47531
  if (propItems) return propItems;
47465
47532
  if (entityData.length === 0) return [];
47466
47533
  return entityData.map((record, idx) => {
@@ -47623,7 +47690,7 @@ var init_MediaGallery = __esm({
47623
47690
  }
47624
47691
  });
47625
47692
  function extractTitle2(children) {
47626
- if (!React105__default.isValidElement(children)) return void 0;
47693
+ if (!React103__default.isValidElement(children)) return void 0;
47627
47694
  const props = children.props;
47628
47695
  if (typeof props.title === "string") {
47629
47696
  return props.title;
@@ -47640,14 +47707,18 @@ var init_ModalSlot = __esm({
47640
47707
  children,
47641
47708
  title: overrideTitle,
47642
47709
  size = "md",
47643
- className
47710
+ className,
47711
+ sourceTrait
47644
47712
  }) => {
47645
47713
  const eventBus = useEventBus();
47714
+ const schemaCtx = useEntitySchemaOptional();
47646
47715
  const isOpen = Boolean(children);
47647
47716
  const title = overrideTitle || extractTitle2(children);
47648
47717
  const handleClose = () => {
47649
- eventBus.emit("UI:CLOSE");
47650
- eventBus.emit("UI:CANCEL");
47718
+ const orbital = sourceTrait !== void 0 && schemaCtx !== null ? schemaCtx.orbitalsByTrait.get(sourceTrait) : void 0;
47719
+ const prefix = orbital !== void 0 && sourceTrait !== void 0 ? `UI:${orbital}.${sourceTrait}.` : "UI:";
47720
+ eventBus.emit(`${prefix}CLOSE`);
47721
+ eventBus.emit(`${prefix}CANCEL`);
47651
47722
  };
47652
47723
  if (!isOpen) return null;
47653
47724
  return /* @__PURE__ */ jsx(
@@ -47893,7 +47964,7 @@ var init_debugRegistry = __esm({
47893
47964
  }
47894
47965
  });
47895
47966
  function useDebugData() {
47896
- const [data, setData] = React105.useState(() => ({
47967
+ const [data, setData] = React103.useState(() => ({
47897
47968
  traits: [],
47898
47969
  ticks: [],
47899
47970
  guards: [],
@@ -47907,7 +47978,7 @@ function useDebugData() {
47907
47978
  },
47908
47979
  lastUpdate: Date.now()
47909
47980
  }));
47910
- React105.useEffect(() => {
47981
+ React103.useEffect(() => {
47911
47982
  const updateData = () => {
47912
47983
  setData({
47913
47984
  traits: getAllTraits(),
@@ -48016,12 +48087,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
48016
48087
  return positions;
48017
48088
  }
48018
48089
  function WalkMinimap() {
48019
- const [walkStep, setWalkStep] = React105.useState(null);
48020
- const [traits2, setTraits] = React105.useState([]);
48021
- const [coveredEdges, setCoveredEdges] = React105.useState([]);
48022
- const [completedTraits, setCompletedTraits] = React105.useState(/* @__PURE__ */ new Set());
48023
- const prevTraitRef = React105.useRef(null);
48024
- React105.useEffect(() => {
48090
+ const [walkStep, setWalkStep] = React103.useState(null);
48091
+ const [traits2, setTraits] = React103.useState([]);
48092
+ const [coveredEdges, setCoveredEdges] = React103.useState([]);
48093
+ const [completedTraits, setCompletedTraits] = React103.useState(/* @__PURE__ */ new Set());
48094
+ const prevTraitRef = React103.useRef(null);
48095
+ React103.useEffect(() => {
48025
48096
  const interval = setInterval(() => {
48026
48097
  const w = window;
48027
48098
  const step = w.__orbitalWalkStep;
@@ -48457,15 +48528,15 @@ var init_EntitiesTab = __esm({
48457
48528
  });
48458
48529
  function EventFlowTab({ events: events2 }) {
48459
48530
  const { t } = useTranslate();
48460
- const [filter, setFilter] = React105.useState("all");
48461
- const containerRef = React105.useRef(null);
48462
- const [autoScroll, setAutoScroll] = React105.useState(true);
48463
- React105.useEffect(() => {
48531
+ const [filter, setFilter] = React103.useState("all");
48532
+ const containerRef = React103.useRef(null);
48533
+ const [autoScroll, setAutoScroll] = React103.useState(true);
48534
+ React103.useEffect(() => {
48464
48535
  if (autoScroll && containerRef.current) {
48465
48536
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
48466
48537
  }
48467
48538
  }, [events2.length, autoScroll]);
48468
- const filteredEvents = React105.useMemo(() => {
48539
+ const filteredEvents = React103.useMemo(() => {
48469
48540
  if (filter === "all") return events2;
48470
48541
  return events2.filter((e) => e.type === filter);
48471
48542
  }, [events2, filter]);
@@ -48581,7 +48652,7 @@ var init_EventFlowTab = __esm({
48581
48652
  });
48582
48653
  function GuardsPanel({ guards }) {
48583
48654
  const { t } = useTranslate();
48584
- const [filter, setFilter] = React105.useState("all");
48655
+ const [filter, setFilter] = React103.useState("all");
48585
48656
  if (guards.length === 0) {
48586
48657
  return /* @__PURE__ */ jsx(
48587
48658
  EmptyState,
@@ -48594,7 +48665,7 @@ function GuardsPanel({ guards }) {
48594
48665
  }
48595
48666
  const passedCount = guards.filter((g) => g.result).length;
48596
48667
  const failedCount = guards.length - passedCount;
48597
- const filteredGuards = React105.useMemo(() => {
48668
+ const filteredGuards = React103.useMemo(() => {
48598
48669
  if (filter === "all") return guards;
48599
48670
  if (filter === "passed") return guards.filter((g) => g.result);
48600
48671
  return guards.filter((g) => !g.result);
@@ -48757,10 +48828,10 @@ function EffectBadge({ effect }) {
48757
48828
  }
48758
48829
  function TransitionTimeline({ transitions }) {
48759
48830
  const { t } = useTranslate();
48760
- const containerRef = React105.useRef(null);
48761
- const [autoScroll, setAutoScroll] = React105.useState(true);
48762
- const [expandedId, setExpandedId] = React105.useState(null);
48763
- React105.useEffect(() => {
48831
+ const containerRef = React103.useRef(null);
48832
+ const [autoScroll, setAutoScroll] = React103.useState(true);
48833
+ const [expandedId, setExpandedId] = React103.useState(null);
48834
+ React103.useEffect(() => {
48764
48835
  if (autoScroll && containerRef.current) {
48765
48836
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
48766
48837
  }
@@ -49040,9 +49111,9 @@ function getAllEvents(traits2) {
49040
49111
  function EventDispatcherTab({ traits: traits2, schema }) {
49041
49112
  const eventBus = useEventBus();
49042
49113
  const { t } = useTranslate();
49043
- const [log9, setLog] = React105.useState([]);
49044
- const prevStatesRef = React105.useRef(/* @__PURE__ */ new Map());
49045
- React105.useEffect(() => {
49114
+ const [log9, setLog] = React103.useState([]);
49115
+ const prevStatesRef = React103.useRef(/* @__PURE__ */ new Map());
49116
+ React103.useEffect(() => {
49046
49117
  for (const trait of traits2) {
49047
49118
  const prev = prevStatesRef.current.get(trait.id);
49048
49119
  if (prev && prev !== trait.currentState) {
@@ -49211,10 +49282,10 @@ function VerifyModePanel({
49211
49282
  localCount
49212
49283
  }) {
49213
49284
  const { t } = useTranslate();
49214
- const [expanded, setExpanded] = React105.useState(true);
49215
- const scrollRef = React105.useRef(null);
49216
- const prevCountRef = React105.useRef(0);
49217
- React105.useEffect(() => {
49285
+ const [expanded, setExpanded] = React103.useState(true);
49286
+ const scrollRef = React103.useRef(null);
49287
+ const prevCountRef = React103.useRef(0);
49288
+ React103.useEffect(() => {
49218
49289
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
49219
49290
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
49220
49291
  }
@@ -49271,10 +49342,10 @@ function RuntimeDebugger({
49271
49342
  schema
49272
49343
  }) {
49273
49344
  const { t } = useTranslate();
49274
- const [isCollapsed, setIsCollapsed] = React105.useState(mode === "verify" ? true : defaultCollapsed);
49275
- const [isVisible, setIsVisible] = React105.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
49345
+ const [isCollapsed, setIsCollapsed] = React103.useState(mode === "verify" ? true : defaultCollapsed);
49346
+ const [isVisible, setIsVisible] = React103.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
49276
49347
  const debugData = useDebugData();
49277
- React105.useEffect(() => {
49348
+ React103.useEffect(() => {
49278
49349
  if (mode === "inline") return;
49279
49350
  return onDebugToggle((enabled) => {
49280
49351
  setIsVisible(enabled);
@@ -49283,7 +49354,7 @@ function RuntimeDebugger({
49283
49354
  }
49284
49355
  });
49285
49356
  }, [mode]);
49286
- React105.useEffect(() => {
49357
+ React103.useEffect(() => {
49287
49358
  if (mode === "inline") return;
49288
49359
  const handleKeyDown = (e) => {
49289
49360
  if (e.key === "`" && isVisible) {
@@ -49803,7 +49874,7 @@ var init_StatCard = __esm({
49803
49874
  const labelToUse = propLabel ?? propTitle;
49804
49875
  const eventBus = useEventBus();
49805
49876
  const { t } = useTranslate();
49806
- const handleActionClick = React105__default.useCallback(() => {
49877
+ const handleActionClick = React103__default.useCallback(() => {
49807
49878
  if (action?.event) {
49808
49879
  eventBus.emit(`UI:${action.event}`, {});
49809
49880
  }
@@ -49814,7 +49885,7 @@ var init_StatCard = __esm({
49814
49885
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
49815
49886
  const isLoading = externalLoading ?? false;
49816
49887
  const error = externalError;
49817
- const computeMetricValue = React105__default.useCallback(
49888
+ const computeMetricValue = React103__default.useCallback(
49818
49889
  (metric, items) => {
49819
49890
  if (metric.value !== void 0) {
49820
49891
  return metric.value;
@@ -49853,7 +49924,7 @@ var init_StatCard = __esm({
49853
49924
  },
49854
49925
  []
49855
49926
  );
49856
- const schemaStats = React105__default.useMemo(() => {
49927
+ const schemaStats = React103__default.useMemo(() => {
49857
49928
  if (!metrics || metrics.length === 0) return null;
49858
49929
  return metrics.map((metric) => ({
49859
49930
  label: metric.label,
@@ -49861,7 +49932,7 @@ var init_StatCard = __esm({
49861
49932
  format: metric.format
49862
49933
  }));
49863
49934
  }, [metrics, data, computeMetricValue]);
49864
- const calculatedTrend = React105__default.useMemo(() => {
49935
+ const calculatedTrend = React103__default.useMemo(() => {
49865
49936
  if (manualTrend !== void 0) return manualTrend;
49866
49937
  if (previousValue === void 0 || currentValue === void 0)
49867
49938
  return void 0;
@@ -50501,8 +50572,8 @@ var init_SubagentTracePanel = __esm({
50501
50572
  ] });
50502
50573
  };
50503
50574
  InlineActivityStream = ({ activities, autoScroll = true, className }) => {
50504
- const endRef = React105__default.useRef(null);
50505
- React105__default.useEffect(() => {
50575
+ const endRef = React103__default.useRef(null);
50576
+ React103__default.useEffect(() => {
50506
50577
  if (!autoScroll) return;
50507
50578
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
50508
50579
  }, [activities.length, autoScroll]);
@@ -50596,7 +50667,7 @@ var init_SubagentTracePanel = __esm({
50596
50667
  };
50597
50668
  SubagentRichCard = ({ subagent }) => {
50598
50669
  const { t } = useTranslate();
50599
- const activities = React105__default.useMemo(
50670
+ const activities = React103__default.useMemo(
50600
50671
  () => subagentMessagesToActivities(subagent.messages),
50601
50672
  [subagent.messages]
50602
50673
  );
@@ -50673,8 +50744,8 @@ var init_SubagentTracePanel = __esm({
50673
50744
  ] });
50674
50745
  };
50675
50746
  CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
50676
- const endRef = React105__default.useRef(null);
50677
- React105__default.useEffect(() => {
50747
+ const endRef = React103__default.useRef(null);
50748
+ React103__default.useEffect(() => {
50678
50749
  if (!autoScroll) return;
50679
50750
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
50680
50751
  }, [messages.length, autoScroll]);
@@ -51104,7 +51175,7 @@ var init_Timeline = __esm({
51104
51175
  }) => {
51105
51176
  const { t } = useTranslate();
51106
51177
  const entityData = entity ?? [];
51107
- const items = React105__default.useMemo(() => {
51178
+ const items = React103__default.useMemo(() => {
51108
51179
  if (propItems) return propItems;
51109
51180
  if (entityData.length === 0) return [];
51110
51181
  return entityData.map((record, idx) => {
@@ -51206,7 +51277,7 @@ var init_Timeline = __esm({
51206
51277
  }
51207
51278
  });
51208
51279
  function extractToastProps(children) {
51209
- if (!React105__default.isValidElement(children)) {
51280
+ if (!React103__default.isValidElement(children)) {
51210
51281
  if (typeof children === "string") {
51211
51282
  return { message: children };
51212
51283
  }
@@ -51231,20 +51302,24 @@ var init_ToastSlot = __esm({
51231
51302
  variant: overrideVariant,
51232
51303
  title: overrideTitle,
51233
51304
  duration = 5e3,
51234
- className
51305
+ className,
51306
+ sourceTrait
51235
51307
  }) => {
51236
51308
  const eventBus = useEventBus();
51309
+ const schemaCtx = useEntitySchemaOptional();
51237
51310
  const isVisible = Boolean(children);
51238
51311
  const extracted = extractToastProps(children);
51239
51312
  const variant = overrideVariant || extracted.variant || "info";
51240
51313
  const title = overrideTitle || extracted.title;
51241
51314
  const message = extracted.message || (typeof children === "string" ? children : "");
51242
51315
  const handleDismiss = () => {
51243
- eventBus.emit("UI:DISMISS");
51244
- eventBus.emit("UI:CLOSE");
51316
+ const orbital = sourceTrait !== void 0 && schemaCtx !== null ? schemaCtx.orbitalsByTrait.get(sourceTrait) : void 0;
51317
+ const prefix = orbital !== void 0 && sourceTrait !== void 0 ? `UI:${orbital}.${sourceTrait}.` : "UI:";
51318
+ eventBus.emit(`${prefix}DISMISS`);
51319
+ eventBus.emit(`${prefix}CLOSE`);
51245
51320
  };
51246
51321
  if (!isVisible) return null;
51247
- const isCustomContent = React105__default.isValidElement(children) && !message;
51322
+ const isCustomContent = React103__default.isValidElement(children) && !message;
51248
51323
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
51249
51324
  Toast,
51250
51325
  {
@@ -51261,7 +51336,7 @@ var init_ToastSlot = __esm({
51261
51336
  }
51262
51337
  });
51263
51338
  function lazyThree(name, loader) {
51264
- const Lazy = React105__default.lazy(
51339
+ const Lazy = React103__default.lazy(
51265
51340
  () => loader().then((m) => {
51266
51341
  const Resolved = m[name];
51267
51342
  if (!Resolved) {
@@ -51273,13 +51348,13 @@ function lazyThree(name, loader) {
51273
51348
  })
51274
51349
  );
51275
51350
  function ThreeWrapper(props) {
51276
- return React105__default.createElement(
51351
+ return React103__default.createElement(
51277
51352
  ThreeBoundary,
51278
51353
  { name },
51279
- React105__default.createElement(
51280
- React105__default.Suspense,
51354
+ React103__default.createElement(
51355
+ React103__default.Suspense,
51281
51356
  { fallback: null },
51282
- React105__default.createElement(Lazy, props)
51357
+ React103__default.createElement(Lazy, props)
51283
51358
  )
51284
51359
  );
51285
51360
  }
@@ -51591,7 +51666,7 @@ var init_component_registry_generated = __esm({
51591
51666
  init_WizardProgress();
51592
51667
  init_WorldMapBoard();
51593
51668
  init_WorldMapTemplate();
51594
- ThreeBoundary = class extends React105__default.Component {
51669
+ ThreeBoundary = class extends React103__default.Component {
51595
51670
  constructor() {
51596
51671
  super(...arguments);
51597
51672
  __publicField(this, "state", { failed: false });
@@ -51601,7 +51676,7 @@ var init_component_registry_generated = __esm({
51601
51676
  }
51602
51677
  render() {
51603
51678
  if (this.state.failed) {
51604
- return React105__default.createElement(
51679
+ return React103__default.createElement(
51605
51680
  "div",
51606
51681
  {
51607
51682
  "data-testid": "three-unavailable",
@@ -51957,7 +52032,7 @@ function SuspenseConfigProvider({
51957
52032
  config,
51958
52033
  children
51959
52034
  }) {
51960
- return React105__default.createElement(
52035
+ return React103__default.createElement(
51961
52036
  SuspenseConfigContext.Provider,
51962
52037
  { value: config },
51963
52038
  children
@@ -51968,8 +52043,8 @@ function getSlotFallback(slot, config) {
51968
52043
  const variant = SLOT_SKELETON_MAP[slot] ?? "text";
51969
52044
  return /* @__PURE__ */ jsx(Skeleton, { variant });
51970
52045
  }
51971
- function getComponentForPattern3(patternType) {
51972
- const mapping = getComponentForPattern(patternType);
52046
+ function getComponentForPattern(patternType) {
52047
+ const mapping = getComponentForPattern$1(patternType);
51973
52048
  if (!mapping) {
51974
52049
  return null;
51975
52050
  }
@@ -51999,7 +52074,7 @@ function enrichFormFields(fields, entityDef) {
51999
52074
  }
52000
52075
  return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
52001
52076
  }
52002
- if (field && typeof field === "object" && !Array.isArray(field) && !React105__default.isValidElement(field) && !(field instanceof Date)) {
52077
+ if (field && typeof field === "object" && !Array.isArray(field) && !React103__default.isValidElement(field) && !(field instanceof Date)) {
52003
52078
  const obj = field;
52004
52079
  const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
52005
52080
  if (!fieldName) return field;
@@ -52177,6 +52252,7 @@ function UISlotComponent({
52177
52252
  const { t } = useTranslate();
52178
52253
  const suspenseConfig = useContext(SuspenseConfigContext);
52179
52254
  const contained = useContext(SlotContainedContext);
52255
+ const schemaCtx = useEntitySchemaOptional();
52180
52256
  const content = slots[slot];
52181
52257
  if (children !== void 0) {
52182
52258
  if (pattern === "clear") {
@@ -52222,8 +52298,11 @@ function UISlotComponent({
52222
52298
  }
52223
52299
  const handleDismiss = () => {
52224
52300
  if (slot === "modal" || slot === "drawer") {
52225
- eventBus.emit("UI:CLOSE");
52226
- eventBus.emit("UI:CANCEL");
52301
+ const trait = content?.sourceTrait;
52302
+ const orbital = trait !== void 0 && schemaCtx !== null ? schemaCtx.orbitalsByTrait.get(trait) : void 0;
52303
+ const prefix = orbital !== void 0 && trait !== void 0 ? `UI:${orbital}.${trait}.` : "UI:";
52304
+ eventBus.emit(`${prefix}CLOSE`);
52305
+ eventBus.emit(`${prefix}CANCEL`);
52227
52306
  }
52228
52307
  clear(slot);
52229
52308
  };
@@ -52277,6 +52356,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
52277
52356
  const slotsBus = useUISlots();
52278
52357
  const eventBus = useEventBus();
52279
52358
  const { t } = useTranslate();
52359
+ const compiledPortalSchemaCtx = useEntitySchemaOptional();
52280
52360
  useEffect(() => {
52281
52361
  setPortalRoot(getOrCreatePortalRoot());
52282
52362
  }, []);
@@ -52285,8 +52365,10 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
52285
52365
  });
52286
52366
  const handleDismiss = () => {
52287
52367
  if (slot === "modal" || slot === "drawer") {
52288
- eventBus.emit("UI:CLOSE");
52289
- eventBus.emit("UI:CANCEL");
52368
+ const orbital = sourceTrait !== void 0 && compiledPortalSchemaCtx !== null ? compiledPortalSchemaCtx.orbitalsByTrait.get(sourceTrait) : void 0;
52369
+ const prefix = orbital !== void 0 && sourceTrait !== void 0 ? `UI:${orbital}.${sourceTrait}.` : "UI:";
52370
+ eventBus.emit(`${prefix}CLOSE`);
52371
+ eventBus.emit(`${prefix}CANCEL`);
52290
52372
  }
52291
52373
  slotsBus.clear(slot);
52292
52374
  };
@@ -52445,7 +52527,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
52445
52527
  const key = `${parentId}-${index}-trait:${traitName}`;
52446
52528
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
52447
52529
  }
52448
- return /* @__PURE__ */ jsx(React105__default.Fragment, { children: child }, `${parentId}-${index}`);
52530
+ return /* @__PURE__ */ jsx(React103__default.Fragment, { children: child }, `${parentId}-${index}`);
52449
52531
  }
52450
52532
  if (!child || typeof child !== "object") return null;
52451
52533
  const childId = `${parentId}-${index}`;
@@ -52485,14 +52567,14 @@ function isPatternConfig(value) {
52485
52567
  if (value === null || value === void 0) return false;
52486
52568
  if (typeof value !== "object") return false;
52487
52569
  if (Array.isArray(value)) return false;
52488
- if (React105__default.isValidElement(value)) return false;
52570
+ if (React103__default.isValidElement(value)) return false;
52489
52571
  if (value instanceof Date) return false;
52490
52572
  if (typeof value === "function") return false;
52491
52573
  const record = value;
52492
- return "type" in record && typeof record.type === "string" && getComponentForPattern(record.type) !== null;
52574
+ return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
52493
52575
  }
52494
52576
  function isPlainConfigObject(value) {
52495
- if (React105__default.isValidElement(value)) return false;
52577
+ if (React103__default.isValidElement(value)) return false;
52496
52578
  if (value instanceof Date) return false;
52497
52579
  const proto = Object.getPrototypeOf(value);
52498
52580
  return proto === Object.prototype || proto === null;
@@ -52598,7 +52680,7 @@ function SlotContentRenderer({
52598
52680
  }
52599
52681
  }
52600
52682
  const orbitalName = schemaCtx && content.sourceTrait !== void 0 ? schemaCtx.orbitalsByTrait.get(content.sourceTrait) : void 0;
52601
- const PatternComponent = getComponentForPattern3(content.pattern);
52683
+ const PatternComponent = getComponentForPattern(content.pattern);
52602
52684
  if (PatternComponent) {
52603
52685
  const childrenConfig = content.props.children;
52604
52686
  const isSingleChild = typeof childrenConfig === "string" || typeof childrenConfig === "object" && childrenConfig !== null && !Array.isArray(childrenConfig) && "type" in childrenConfig;
@@ -52618,7 +52700,7 @@ function SlotContentRenderer({
52618
52700
  for (const slotKey of CONTENT_NODE_SLOTS) {
52619
52701
  const slotVal = restProps[slotKey];
52620
52702
  if (slotVal === void 0 || slotVal === null) continue;
52621
- if (React105__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
52703
+ if (React103__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
52622
52704
  if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
52623
52705
  nodeSlotOverrides[slotKey] = renderPatternChildren(
52624
52706
  slotVal,
@@ -52667,7 +52749,7 @@ function SlotContentRenderer({
52667
52749
  const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
52668
52750
  if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
52669
52751
  const sample = resolvedItems[0];
52670
- if (sample && typeof sample === "object" && !Array.isArray(sample) && !React105__default.isValidElement(sample) && !(sample instanceof Date)) {
52752
+ if (sample && typeof sample === "object" && !Array.isArray(sample) && !React103__default.isValidElement(sample) && !(sample instanceof Date)) {
52671
52753
  const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
52672
52754
  finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
52673
52755
  }
@@ -52845,6 +52927,7 @@ var init_UISlotRenderer = __esm({
52845
52927
  "custom",
52846
52928
  "dashboard-layout",
52847
52929
  "game-shell",
52930
+ "game-template",
52848
52931
  "scaled-diagram",
52849
52932
  "master-detail",
52850
52933
  "form-field",
@@ -52958,7 +53041,7 @@ function resolveLambdaBindings(body, params, item, index) {
52958
53041
  if (Array.isArray(body)) {
52959
53042
  return body.map((b) => recur(b));
52960
53043
  }
52961
- if (body !== null && typeof body === "object" && !React105__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
53044
+ if (body !== null && typeof body === "object" && !React103__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
52962
53045
  const out = {};
52963
53046
  for (const [k, v] of Object.entries(body)) {
52964
53047
  out[k] = recur(v);
@@ -52968,7 +53051,7 @@ function resolveLambdaBindings(body, params, item, index) {
52968
53051
  return body;
52969
53052
  }
52970
53053
  var _slotContentRenderer2 = null;
52971
- function getSlotContentRenderer4() {
53054
+ function getSlotContentRenderer2() {
52972
53055
  if (_slotContentRenderer2) return _slotContentRenderer2;
52973
53056
  const mod = (init_UISlotRenderer(), __toCommonJS(UISlotRenderer_exports));
52974
53057
  _slotContentRenderer2 = mod.SlotContentRenderer;
@@ -52977,14 +53060,14 @@ function getSlotContentRenderer4() {
52977
53060
  function makeLambdaFn(params, lambdaBody, callerKey) {
52978
53061
  return (item, index) => {
52979
53062
  const resolvedBody = resolveLambdaBindings(lambdaBody, params, item, index);
52980
- if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React105__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
53063
+ if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React103__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
52981
53064
  return null;
52982
53065
  }
52983
53066
  const record = resolvedBody;
52984
53067
  if (typeof record.type !== "string") {
52985
53068
  return null;
52986
53069
  }
52987
- const SlotContentRenderer2 = getSlotContentRenderer4();
53070
+ const SlotContentRenderer2 = getSlotContentRenderer2();
52988
53071
  const rawChildProps = {};
52989
53072
  for (const [k, v] of Object.entries(record)) {
52990
53073
  if (k !== "type") rawChildProps[k] = v;
@@ -52996,7 +53079,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
52996
53079
  props: childProps,
52997
53080
  priority: 0
52998
53081
  };
52999
- return React105__default.createElement(SlotContentRenderer2, { content: childContent });
53082
+ return React103__default.createElement(SlotContentRenderer2, { content: childContent });
53000
53083
  };
53001
53084
  }
53002
53085
  function convertNode(node, callerKey) {
@@ -53015,7 +53098,7 @@ function convertNode(node, callerKey) {
53015
53098
  });
53016
53099
  return anyChanged ? mapped : node;
53017
53100
  }
53018
- if (typeof node === "object" && !React105__default.isValidElement(node) && !(node instanceof Date)) {
53101
+ if (typeof node === "object" && !React103__default.isValidElement(node) && !(node instanceof Date)) {
53019
53102
  return convertObjectProps(node);
53020
53103
  }
53021
53104
  return node;