@almadar/ui 2.42.0 → 2.45.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.
package/dist/avl/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
2
  import { OrbitControls, Grid as Grid$1, Stars, Sparkles, Html, RoundedBox } from '@react-three/drei';
3
- import * as React124 from 'react';
4
- import React124__default, { createContext, useState, useRef, useCallback, useEffect, useLayoutEffect, lazy, useContext, useMemo, Suspense, useSyncExternalStore, useId, forwardRef, useImperativeHandle, useReducer, Component } from 'react';
3
+ import * as React125 from 'react';
4
+ import React125__default, { createContext, useState, useRef, useCallback, useEffect, useMemo, useLayoutEffect, lazy, useContext, Suspense, useSyncExternalStore, useId, forwardRef, useImperativeHandle, useReducer, Component } from 'react';
5
5
  import { useThree, useFrame, Canvas } from '@react-three/fiber';
6
6
  import * as THREE6 from 'three';
7
7
  import { MathUtils, Vector3, Quaternion, QuadraticBezierCurve3 } from 'three';
@@ -44,7 +44,7 @@ import langDiff from 'react-syntax-highlighter/dist/esm/languages/prism/diff';
44
44
  import langToml from 'react-syntax-highlighter/dist/esm/languages/prism/toml';
45
45
  import langGo from 'react-syntax-highlighter/dist/esm/languages/prism/go';
46
46
  import langGraphql from 'react-syntax-highlighter/dist/esm/languages/prism/graphql';
47
- import { schemaToIR, getPage, isCircuitEvent } from '@almadar/core';
47
+ import { FieldTypeSchema, schemaToIR, getPage, isCircuitEvent } from '@almadar/core';
48
48
  import '@tanstack/react-query';
49
49
  import { StateMachineManager, createContextFromBindings, interpolateValue, EffectExecutor } from '@almadar/runtime';
50
50
 
@@ -2914,7 +2914,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
2914
2914
  }
2915
2915
  };
2916
2916
  }, [debug2]);
2917
- const contextValue = useMemo(
2917
+ const contextValue2 = useMemo(
2918
2918
  () => ({
2919
2919
  emit,
2920
2920
  on,
@@ -2927,12 +2927,12 @@ function EventBusProvider({ children, debug: debug2 = false }) {
2927
2927
  [emit, on, once, hasListeners, onAny, getSelectedEntity, clearSelectedEntity]
2928
2928
  );
2929
2929
  useEffect(() => {
2930
- setGlobalEventBus(contextValue);
2930
+ setGlobalEventBus(contextValue2);
2931
2931
  return () => {
2932
2932
  setGlobalEventBus(null);
2933
2933
  };
2934
- }, [contextValue]);
2935
- return /* @__PURE__ */ jsx(EventBusContext.Provider, { value: contextValue, children });
2934
+ }, [contextValue2]);
2935
+ return /* @__PURE__ */ jsx(EventBusContext.Provider, { value: contextValue2, children });
2936
2936
  }
2937
2937
  var EventBusContext;
2938
2938
  var init_EventBusProvider = __esm({
@@ -3155,7 +3155,7 @@ var init_Box = __esm({
3155
3155
  fixed: "fixed",
3156
3156
  sticky: "sticky"
3157
3157
  };
3158
- Box = React124__default.forwardRef(
3158
+ Box = React125__default.forwardRef(
3159
3159
  ({
3160
3160
  padding,
3161
3161
  paddingX,
@@ -5495,7 +5495,7 @@ function UnitRenderer({
5495
5495
  onAnimationStateChange,
5496
5496
  animationSpeed = 1
5497
5497
  }) {
5498
- const handleUnitClick = React124__default.useCallback(
5498
+ const handleUnitClick = React125__default.useCallback(
5499
5499
  (unit) => {
5500
5500
  onUnitClick?.(unit);
5501
5501
  },
@@ -8689,7 +8689,7 @@ var init_Avl3DViewer = __esm({
8689
8689
  const handleTraitClick = useCallback((name) => {
8690
8690
  dispatch({ type: "ZOOM_INTO_TRAIT", trait: name, targetPosition: { x: 0, y: 0 } });
8691
8691
  }, []);
8692
- const [highlightedTrait, setHighlightedTrait] = React124__default.useState(null);
8692
+ const [highlightedTrait, setHighlightedTrait] = React125__default.useState(null);
8693
8693
  const handleTransitionClick = useCallback((index) => {
8694
8694
  dispatch({ type: "ZOOM_INTO_TRANSITION", transitionIndex: index, targetPosition: { x: 0, y: 0 } });
8695
8695
  }, []);
@@ -8776,7 +8776,7 @@ var init_Avl3DViewer = __esm({
8776
8776
  gap: "xs",
8777
8777
  align: "center",
8778
8778
  className: "absolute top-2 left-2 z-10 bg-surface/80 backdrop-blur rounded-md px-3 py-1.5",
8779
- children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React124__default.Fragment, { children: [
8779
+ children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React125__default.Fragment, { children: [
8780
8780
  i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "mx-1", children: "/" }),
8781
8781
  i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
8782
8782
  Box,
@@ -9527,7 +9527,7 @@ var AvlTransition = ({
9527
9527
  opacity = 1,
9528
9528
  className
9529
9529
  }) => {
9530
- const ids = React124__default.useMemo(() => {
9530
+ const ids = React125__default.useMemo(() => {
9531
9531
  avlTransitionId += 1;
9532
9532
  return { arrow: `avl-tr-${avlTransitionId}-arrow` };
9533
9533
  }, []);
@@ -10292,7 +10292,7 @@ var AvlStateMachine = ({
10292
10292
  color = "var(--color-primary)",
10293
10293
  animated = false
10294
10294
  }) => {
10295
- const ids = React124__default.useMemo(() => {
10295
+ const ids = React125__default.useMemo(() => {
10296
10296
  avlSmId += 1;
10297
10297
  const base = `avl-sm-${avlSmId}`;
10298
10298
  return { glow: `${base}-glow`, grad: `${base}-grad` };
@@ -10487,7 +10487,7 @@ var AvlOrbitalUnit = ({
10487
10487
  color = "var(--color-primary)",
10488
10488
  animated = false
10489
10489
  }) => {
10490
- const ids = React124__default.useMemo(() => {
10490
+ const ids = React125__default.useMemo(() => {
10491
10491
  avlOuId += 1;
10492
10492
  const base = `avl-ou-${avlOuId}`;
10493
10493
  return { glow: `${base}-glow`, grad: `${base}-grad` };
@@ -10579,7 +10579,7 @@ var AvlClosedCircuit = ({
10579
10579
  color = "var(--color-primary)",
10580
10580
  animated = false
10581
10581
  }) => {
10582
- const ids = React124__default.useMemo(() => {
10582
+ const ids = React125__default.useMemo(() => {
10583
10583
  avlCcId += 1;
10584
10584
  const base = `avl-cc-${avlCcId}`;
10585
10585
  return { glow: `${base}-glow`, grad: `${base}-grad`, arrow: `${base}-arrow` };
@@ -10732,7 +10732,7 @@ var AvlEmitListen = ({
10732
10732
  color = "var(--color-primary)",
10733
10733
  animated = false
10734
10734
  }) => {
10735
- const ids = React124__default.useMemo(() => {
10735
+ const ids = React125__default.useMemo(() => {
10736
10736
  avlElId += 1;
10737
10737
  const base = `avl-el-${avlElId}`;
10738
10738
  return { arrow: `${base}-arrow`, grad: `${base}-grad` };
@@ -11005,7 +11005,7 @@ function renderNode(node, color, glowId) {
11005
11005
  const baseR = node.type === "operator" ? 20 : 16;
11006
11006
  const r2 = Math.max(baseR, labelLen * 3.5 + 6);
11007
11007
  const nc = nodeColor(node.type, color);
11008
- return /* @__PURE__ */ jsxs(React124__default.Fragment, { children: [
11008
+ return /* @__PURE__ */ jsxs(React125__default.Fragment, { children: [
11009
11009
  node.children.map((child, i) => {
11010
11010
  const childR = Math.max(
11011
11011
  child.type === "operator" ? 20 : 16,
@@ -11062,7 +11062,7 @@ var AvlExprTree = ({
11062
11062
  className,
11063
11063
  color = "var(--color-primary)"
11064
11064
  }) => {
11065
- const ids = React124__default.useMemo(() => {
11065
+ const ids = React125__default.useMemo(() => {
11066
11066
  avlEtId += 1;
11067
11067
  return { glow: `avl-et-${avlEtId}-glow` };
11068
11068
  }, []);
@@ -12036,7 +12036,7 @@ var SystemNode = ({ data }) => {
12036
12036
  stateChain.length > 0 && /* @__PURE__ */ jsx("svg", { width: stateChain.length * 14 + 2, height: 10, viewBox: `0 0 ${stateChain.length * 14 + 2} 10`, children: stateChain.map((s, i) => {
12037
12037
  const tc = transitionCounts[s.name] ?? 0;
12038
12038
  const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
12039
- return /* @__PURE__ */ jsxs(React124__default.Fragment, { children: [
12039
+ return /* @__PURE__ */ jsxs(React125__default.Fragment, { children: [
12040
12040
  /* @__PURE__ */ jsx(AvlState, { x: i * 14 + 1, y: 1, width: 10, height: 8, name: "", role, isInitial: s.isInitial, isTerminal: s.isTerminal }),
12041
12041
  i < stateChain.length - 1 && /* @__PURE__ */ jsx("line", { x1: i * 14 + 12, y1: 5, x2: i * 14 + 15, y2: 5, stroke: "var(--color-border)", strokeWidth: 0.5 })
12042
12042
  ] }, s.name);
@@ -12076,7 +12076,7 @@ var MiniStateMachine = ({ data, className }) => {
12076
12076
  const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
12077
12077
  const tc = transitionCounts[s.name] ?? 0;
12078
12078
  const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
12079
- return /* @__PURE__ */ jsxs(React124__default.Fragment, { children: [
12079
+ return /* @__PURE__ */ jsxs(React125__default.Fragment, { children: [
12080
12080
  /* @__PURE__ */ jsx(
12081
12081
  AvlState,
12082
12082
  {
@@ -13229,7 +13229,7 @@ var ThemeProvider = ({
13229
13229
  const newMode = resolvedMode === "dark" ? "light" : "dark";
13230
13230
  setMode(newMode);
13231
13231
  }, [resolvedMode, setMode]);
13232
- const contextValue = useMemo(
13232
+ const contextValue2 = useMemo(
13233
13233
  () => ({
13234
13234
  theme,
13235
13235
  mode,
@@ -13251,7 +13251,7 @@ var ThemeProvider = ({
13251
13251
  appliedTheme
13252
13252
  ]
13253
13253
  );
13254
- return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: contextValue, children });
13254
+ return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: contextValue2, children });
13255
13255
  };
13256
13256
  function useTheme() {
13257
13257
  const context = useContext(ThemeContext);
@@ -13275,25 +13275,92 @@ function useTheme() {
13275
13275
  var store = /* @__PURE__ */ new Map();
13276
13276
  var storeListeners = /* @__PURE__ */ new Set();
13277
13277
  var watchCallbacks = /* @__PURE__ */ new Map();
13278
- function advance(entityType, data) {
13279
- const prev = store.get(entityType);
13280
- const oldData = prev?.data ?? [];
13281
- store.set(entityType, { data, version: (prev?.version ?? 0) + 1 });
13278
+ function extractId(record) {
13279
+ const r2 = record;
13280
+ return String(r2.id ?? r2._id ?? r2.key ?? "");
13281
+ }
13282
+ function materialize(snap) {
13283
+ return snap.ids.map((id) => snap.entities.get(id));
13284
+ }
13285
+ function notifyListeners(entityType, prev) {
13282
13286
  for (const listener of storeListeners) {
13283
13287
  listener();
13284
13288
  }
13285
13289
  const cbs = watchCallbacks.get(entityType);
13286
13290
  if (cbs) {
13291
+ const oldData = prev ? materialize(prev) : [];
13292
+ const cur = store.get(entityType);
13293
+ const newData = cur ? materialize(cur) : [];
13287
13294
  for (const cb of cbs) {
13288
13295
  try {
13289
- cb(oldData, data);
13296
+ cb(oldData, newData);
13290
13297
  } catch {
13291
13298
  }
13292
13299
  }
13293
13300
  }
13294
13301
  }
13302
+ function setAll(entityType, records) {
13303
+ const entities = /* @__PURE__ */ new Map();
13304
+ const ids = [];
13305
+ for (const r2 of records) {
13306
+ const rec = r2;
13307
+ const id = extractId(rec);
13308
+ if (id) {
13309
+ entities.set(id, rec);
13310
+ ids.push(id);
13311
+ }
13312
+ }
13313
+ const prev = store.get(entityType);
13314
+ store.set(entityType, { entities, ids, version: (prev?.version ?? 0) + 1 });
13315
+ notifyListeners(entityType, prev);
13316
+ }
13317
+ function upsertOne(entityType, record) {
13318
+ const id = extractId(record);
13319
+ if (!id) return;
13320
+ const prev = store.get(entityType);
13321
+ const snapshot = prev ? { entities: new Map(prev.entities), ids: [...prev.ids], version: prev.version } : { entities: /* @__PURE__ */ new Map(), ids: [], version: 0 };
13322
+ snapshot.entities.set(id, record);
13323
+ if (!snapshot.ids.includes(id)) snapshot.ids.push(id);
13324
+ snapshot.version++;
13325
+ store.set(entityType, snapshot);
13326
+ notifyListeners(entityType, prev);
13327
+ }
13328
+ function addOne(entityType, record) {
13329
+ upsertOne(entityType, record);
13330
+ }
13331
+ function updateOne(entityType, id, changes) {
13332
+ const prev = store.get(entityType);
13333
+ if (!prev?.entities.has(id)) return;
13334
+ const snapshot = {
13335
+ entities: new Map(prev.entities),
13336
+ ids: [...prev.ids],
13337
+ version: prev.version
13338
+ };
13339
+ snapshot.entities.set(id, { ...snapshot.entities.get(id), ...changes });
13340
+ snapshot.version++;
13341
+ store.set(entityType, snapshot);
13342
+ notifyListeners(entityType, prev);
13343
+ }
13344
+ function removeOne(entityType, id) {
13345
+ const prev = store.get(entityType);
13346
+ if (!prev) return;
13347
+ const snapshot = {
13348
+ entities: new Map(prev.entities),
13349
+ ids: prev.ids.filter((i) => i !== id),
13350
+ version: prev.version
13351
+ };
13352
+ snapshot.entities.delete(id);
13353
+ snapshot.version++;
13354
+ store.set(entityType, snapshot);
13355
+ notifyListeners(entityType, prev);
13356
+ }
13295
13357
  function getSnapshot(entityType) {
13296
- return store.get(entityType)?.data ?? [];
13358
+ const snap = store.get(entityType);
13359
+ if (!snap) return [];
13360
+ return materialize(snap);
13361
+ }
13362
+ function getById(entityType, id) {
13363
+ return store.get(entityType)?.entities.get(id) ?? null;
13297
13364
  }
13298
13365
  function getVersion(entityType) {
13299
13366
  return store.get(entityType)?.version ?? 0;
@@ -13307,7 +13374,7 @@ function subscribeToStore(listener) {
13307
13374
  function useEntityRef(entityType) {
13308
13375
  const versionRef = useRef(0);
13309
13376
  const dataRef = useRef([]);
13310
- const getSnapshotStable = React124__default.useCallback(() => {
13377
+ const getSnapshotStable = React125__default.useCallback(() => {
13311
13378
  const currentVersion = getVersion(entityType);
13312
13379
  if (currentVersion !== versionRef.current) {
13313
13380
  versionRef.current = currentVersion;
@@ -13317,15 +13384,21 @@ function useEntityRef(entityType) {
13317
13384
  }, [entityType]);
13318
13385
  return useSyncExternalStore(subscribeToStore, getSnapshotStable, () => []);
13319
13386
  }
13320
- var EntityStoreContext = createContext({
13321
- advance,
13322
- getSnapshot
13323
- });
13387
+ var contextValue = {
13388
+ setAll,
13389
+ upsertOne,
13390
+ addOne,
13391
+ updateOne,
13392
+ removeOne,
13393
+ getSnapshot,
13394
+ getById
13395
+ };
13396
+ var EntityStoreContext = createContext(contextValue);
13324
13397
  function useEntityStore() {
13325
13398
  return useContext(EntityStoreContext);
13326
13399
  }
13327
13400
  function EntityStoreProvider({ children }) {
13328
- return /* @__PURE__ */ jsx(EntityStoreContext.Provider, { value: { advance, getSnapshot }, children });
13401
+ return /* @__PURE__ */ jsx(EntityStoreContext.Provider, { value: contextValue, children });
13329
13402
  }
13330
13403
 
13331
13404
  // providers/OrbitalProvider.tsx
@@ -13401,13 +13474,43 @@ function SelectionProvider({
13401
13474
  unsubCancel();
13402
13475
  };
13403
13476
  }, [eventBus, setSelected, clearSelection, debug2]);
13404
- const contextValue = {
13477
+ const contextValue2 = {
13405
13478
  selected,
13406
13479
  setSelected,
13407
13480
  clearSelection,
13408
13481
  isSelected
13409
13482
  };
13410
- return /* @__PURE__ */ jsx(SelectionContext.Provider, { value: contextValue, children });
13483
+ return /* @__PURE__ */ jsx(SelectionContext.Provider, { value: contextValue2, children });
13484
+ }
13485
+ var EntitySchemaContext = createContext(null);
13486
+ function EntitySchemaProvider({
13487
+ entities,
13488
+ children
13489
+ }) {
13490
+ const entitiesMap = useMemo(() => {
13491
+ const map = /* @__PURE__ */ new Map();
13492
+ for (const entity of entities) {
13493
+ map.set(entity.name, entity);
13494
+ }
13495
+ return map;
13496
+ }, [entities]);
13497
+ const contextValue2 = useMemo(
13498
+ () => ({
13499
+ entities: entitiesMap
13500
+ }),
13501
+ [entitiesMap]
13502
+ );
13503
+ return /* @__PURE__ */ jsx(EntitySchemaContext.Provider, { value: contextValue2, children });
13504
+ }
13505
+ function useEntitySchema() {
13506
+ const context = useContext(EntitySchemaContext);
13507
+ if (!context) {
13508
+ throw new Error("useEntitySchema must be used within an EntitySchemaProvider");
13509
+ }
13510
+ return context;
13511
+ }
13512
+ function useEntitySchemaOptional() {
13513
+ return useContext(EntitySchemaContext);
13411
13514
  }
13412
13515
  var DEFAULT_SLOTS = {
13413
13516
  main: null,
@@ -13556,8 +13659,8 @@ function useUISlotManager() {
13556
13659
  var UISlotContext = createContext(null);
13557
13660
  function UISlotProvider({ children }) {
13558
13661
  const slotManager = useUISlotManager();
13559
- const contextValue = useMemo(() => slotManager, [slotManager]);
13560
- return /* @__PURE__ */ jsx(UISlotContext.Provider, { value: contextValue, children });
13662
+ const contextValue2 = useMemo(() => slotManager, [slotManager]);
13663
+ return /* @__PURE__ */ jsx(UISlotContext.Provider, { value: contextValue2, children });
13561
13664
  }
13562
13665
  function useUISlots() {
13563
13666
  const context = useContext(UISlotContext);
@@ -14138,7 +14241,7 @@ function resolveIconProp(value, sizeClass) {
14138
14241
  const IconComp = value;
14139
14242
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
14140
14243
  }
14141
- if (React124__default.isValidElement(value)) {
14244
+ if (React125__default.isValidElement(value)) {
14142
14245
  return value;
14143
14246
  }
14144
14247
  if (typeof value === "object" && value !== null && "render" in value) {
@@ -14147,7 +14250,7 @@ function resolveIconProp(value, sizeClass) {
14147
14250
  }
14148
14251
  return value;
14149
14252
  }
14150
- var Button = React124__default.forwardRef(
14253
+ var Button = React125__default.forwardRef(
14151
14254
  ({
14152
14255
  className,
14153
14256
  variant = "primary",
@@ -14246,7 +14349,7 @@ var sizeStyles3 = {
14246
14349
  md: "px-2.5 py-1 text-sm",
14247
14350
  lg: "px-3 py-1.5 text-base"
14248
14351
  };
14249
- var Badge = React124__default.forwardRef(
14352
+ var Badge = React125__default.forwardRef(
14250
14353
  ({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
14251
14354
  const iconSizes2 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
14252
14355
  const resolvedIcon = typeof icon === "string" ? (() => {
@@ -14387,7 +14490,7 @@ init_cn();
14387
14490
 
14388
14491
  // components/atoms/Input.tsx
14389
14492
  init_cn();
14390
- var Input = React124__default.forwardRef(
14493
+ var Input = React125__default.forwardRef(
14391
14494
  ({
14392
14495
  className,
14393
14496
  inputType,
@@ -14502,7 +14605,7 @@ Input.displayName = "Input";
14502
14605
 
14503
14606
  // components/atoms/Label.tsx
14504
14607
  init_cn();
14505
- var Label = React124__default.forwardRef(
14608
+ var Label = React125__default.forwardRef(
14506
14609
  ({ className, required, children, ...props }, ref) => {
14507
14610
  return /* @__PURE__ */ jsxs(
14508
14611
  "label",
@@ -14525,7 +14628,7 @@ Label.displayName = "Label";
14525
14628
 
14526
14629
  // components/atoms/Textarea.tsx
14527
14630
  init_cn();
14528
- var Textarea = React124__default.forwardRef(
14631
+ var Textarea = React125__default.forwardRef(
14529
14632
  ({ className, error, ...props }, ref) => {
14530
14633
  return /* @__PURE__ */ jsx(
14531
14634
  "textarea",
@@ -14551,7 +14654,7 @@ Textarea.displayName = "Textarea";
14551
14654
 
14552
14655
  // components/atoms/Select.tsx
14553
14656
  init_cn();
14554
- var Select = React124__default.forwardRef(
14657
+ var Select = React125__default.forwardRef(
14555
14658
  ({ className, options, placeholder, error, ...props }, ref) => {
14556
14659
  return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
14557
14660
  /* @__PURE__ */ jsxs(
@@ -14590,7 +14693,7 @@ Select.displayName = "Select";
14590
14693
 
14591
14694
  // components/atoms/Checkbox.tsx
14592
14695
  init_cn();
14593
- var Checkbox = React124__default.forwardRef(
14696
+ var Checkbox = React125__default.forwardRef(
14594
14697
  ({ className, label, id, ...props }, ref) => {
14595
14698
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
14596
14699
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
@@ -14669,7 +14772,7 @@ var shadowStyles2 = {
14669
14772
  md: "shadow",
14670
14773
  lg: "shadow-lg"
14671
14774
  };
14672
- var Card = React124__default.forwardRef(
14775
+ var Card = React125__default.forwardRef(
14673
14776
  ({
14674
14777
  className,
14675
14778
  variant = "bordered",
@@ -14705,9 +14808,9 @@ var Card = React124__default.forwardRef(
14705
14808
  }
14706
14809
  );
14707
14810
  Card.displayName = "Card";
14708
- var CardHeader = React124__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
14811
+ var CardHeader = React125__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
14709
14812
  CardHeader.displayName = "CardHeader";
14710
- var CardTitle = React124__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
14813
+ var CardTitle = React125__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
14711
14814
  "h3",
14712
14815
  {
14713
14816
  ref,
@@ -14720,11 +14823,11 @@ var CardTitle = React124__default.forwardRef(({ className, ...props }, ref) => /
14720
14823
  }
14721
14824
  ));
14722
14825
  CardTitle.displayName = "CardTitle";
14723
- var CardContent = React124__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
14826
+ var CardContent = React125__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
14724
14827
  CardContent.displayName = "CardContent";
14725
14828
  var CardBody = CardContent;
14726
14829
  CardBody.displayName = "CardBody";
14727
- var CardFooter = React124__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
14830
+ var CardFooter = React125__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
14728
14831
  "div",
14729
14832
  {
14730
14833
  ref,
@@ -14742,7 +14845,7 @@ var sizeStyles4 = {
14742
14845
  md: "h-6 w-6",
14743
14846
  lg: "h-8 w-8"
14744
14847
  };
14745
- var Spinner = React124__default.forwardRef(
14848
+ var Spinner = React125__default.forwardRef(
14746
14849
  ({ className, size = "md", ...props }, ref) => {
14747
14850
  return /* @__PURE__ */ jsx(
14748
14851
  "div",
@@ -15177,7 +15280,7 @@ ProgressBar.displayName = "ProgressBar";
15177
15280
 
15178
15281
  // components/atoms/Radio.tsx
15179
15282
  init_cn();
15180
- var Radio = React124__default.forwardRef(
15283
+ var Radio = React125__default.forwardRef(
15181
15284
  ({
15182
15285
  label,
15183
15286
  helperText,
@@ -15284,7 +15387,7 @@ Radio.displayName = "Radio";
15284
15387
 
15285
15388
  // components/atoms/Switch.tsx
15286
15389
  init_cn();
15287
- var Switch = React124.forwardRef(
15390
+ var Switch = React125.forwardRef(
15288
15391
  ({
15289
15392
  checked,
15290
15393
  defaultChecked = false,
@@ -15295,10 +15398,10 @@ var Switch = React124.forwardRef(
15295
15398
  name,
15296
15399
  className
15297
15400
  }, ref) => {
15298
- const [isChecked, setIsChecked] = React124.useState(
15401
+ const [isChecked, setIsChecked] = React125.useState(
15299
15402
  checked !== void 0 ? checked : defaultChecked
15300
15403
  );
15301
- React124.useEffect(() => {
15404
+ React125.useEffect(() => {
15302
15405
  if (checked !== void 0) {
15303
15406
  setIsChecked(checked);
15304
15407
  }
@@ -15614,8 +15717,8 @@ var LawReferenceTooltip = ({
15614
15717
  position = "top",
15615
15718
  className
15616
15719
  }) => {
15617
- const [isVisible, setIsVisible] = React124__default.useState(false);
15618
- const timeoutRef = React124__default.useRef(null);
15720
+ const [isVisible, setIsVisible] = React125__default.useState(false);
15721
+ const timeoutRef = React125__default.useRef(null);
15619
15722
  const handleMouseEnter = () => {
15620
15723
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
15621
15724
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -15624,7 +15727,7 @@ var LawReferenceTooltip = ({
15624
15727
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
15625
15728
  setIsVisible(false);
15626
15729
  };
15627
- React124__default.useEffect(() => {
15730
+ React125__default.useEffect(() => {
15628
15731
  return () => {
15629
15732
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
15630
15733
  };
@@ -15824,7 +15927,7 @@ var sizeStyles5 = {
15824
15927
  md: "w-2.5 h-2.5",
15825
15928
  lg: "w-3 h-3"
15826
15929
  };
15827
- var StatusDot = React124__default.forwardRef(
15930
+ var StatusDot = React125__default.forwardRef(
15828
15931
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
15829
15932
  return /* @__PURE__ */ jsx(
15830
15933
  "span",
@@ -15874,7 +15977,7 @@ var iconMap2 = {
15874
15977
  down: TrendingDown,
15875
15978
  flat: ArrowRight
15876
15979
  };
15877
- var TrendIndicator = React124__default.forwardRef(
15980
+ var TrendIndicator = React125__default.forwardRef(
15878
15981
  ({
15879
15982
  className,
15880
15983
  value,
@@ -15937,7 +16040,7 @@ var thumbSizes = {
15937
16040
  md: "w-4 h-4",
15938
16041
  lg: "w-5 h-5"
15939
16042
  };
15940
- var RangeSlider = React124__default.forwardRef(
16043
+ var RangeSlider = React125__default.forwardRef(
15941
16044
  ({
15942
16045
  className,
15943
16046
  min = 0,
@@ -16451,7 +16554,7 @@ var paddingClasses = {
16451
16554
  md: "py-16",
16452
16555
  lg: "py-24"
16453
16556
  };
16454
- var ContentSection = React124__default.forwardRef(
16557
+ var ContentSection = React125__default.forwardRef(
16455
16558
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
16456
16559
  return /* @__PURE__ */ jsx(
16457
16560
  Box,
@@ -16493,7 +16596,7 @@ var animatedStyles = {
16493
16596
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
16494
16597
  "none": {}
16495
16598
  };
16496
- var AnimatedReveal = React124__default.forwardRef(
16599
+ var AnimatedReveal = React125__default.forwardRef(
16497
16600
  ({
16498
16601
  trigger = "scroll",
16499
16602
  animation = "fade-up",
@@ -16649,7 +16752,7 @@ function applyMorphAnimation(container, animate, duration, delay, easing) {
16649
16752
  el.style.opacity = animate ? "1" : "0";
16650
16753
  });
16651
16754
  }
16652
- var AnimatedGraphic = React124__default.forwardRef(
16755
+ var AnimatedGraphic = React125__default.forwardRef(
16653
16756
  ({
16654
16757
  src,
16655
16758
  svgContent,
@@ -16672,7 +16775,7 @@ var AnimatedGraphic = React124__default.forwardRef(
16672
16775
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
16673
16776
  const resolvedSvg = svgContent ?? fetchedSvg;
16674
16777
  const prevAnimateRef = useRef(animate);
16675
- const setRef = React124__default.useCallback(
16778
+ const setRef = React125__default.useCallback(
16676
16779
  (node) => {
16677
16780
  containerRef.current = node;
16678
16781
  if (typeof ref === "function") ref(node);
@@ -16849,9 +16952,9 @@ function ScoreDisplay({
16849
16952
  ...rest
16850
16953
  }) {
16851
16954
  const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
16852
- const [displayValue, setDisplayValue] = React124.useState(resolvedValue);
16853
- const [isAnimating, setIsAnimating] = React124.useState(false);
16854
- React124.useEffect(() => {
16955
+ const [displayValue, setDisplayValue] = React125.useState(resolvedValue);
16956
+ const [isAnimating, setIsAnimating] = React125.useState(false);
16957
+ React125.useEffect(() => {
16855
16958
  if (!animated || displayValue === resolvedValue) {
16856
16959
  setDisplayValue(resolvedValue);
16857
16960
  return;
@@ -16909,9 +17012,9 @@ var shapeMap = {
16909
17012
  square: "rounded-md"
16910
17013
  };
16911
17014
  var variantMap = {
16912
- primary: "bg-blue-600 text-white border-blue-400 hover:bg-blue-500",
16913
- secondary: "bg-gray-700 text-white border-gray-500 hover:bg-gray-600",
16914
- ghost: "bg-transparent text-white border-white/30 hover:bg-white/10"
17015
+ primary: "bg-blue-600 text-[var(--color-foreground)] border-blue-400 hover:bg-blue-500",
17016
+ secondary: "bg-[var(--color-surface,#374151)] text-[var(--color-foreground)] border-gray-500 hover:bg-gray-600",
17017
+ ghost: "bg-transparent text-[var(--color-foreground)] border-white/30 hover:bg-white/10"
16915
17018
  };
16916
17019
  function ControlButton({
16917
17020
  label,
@@ -16928,9 +17031,9 @@ function ControlButton({
16928
17031
  className
16929
17032
  }) {
16930
17033
  const eventBus = useEventBus();
16931
- const [isPressed, setIsPressed] = React124.useState(false);
17034
+ const [isPressed, setIsPressed] = React125.useState(false);
16932
17035
  const actualPressed = pressed ?? isPressed;
16933
- const handlePointerDown = React124.useCallback(
17036
+ const handlePointerDown = React125.useCallback(
16934
17037
  (e) => {
16935
17038
  e.preventDefault();
16936
17039
  if (disabled) return;
@@ -16940,7 +17043,7 @@ function ControlButton({
16940
17043
  },
16941
17044
  [disabled, pressEvent, eventBus, onPress]
16942
17045
  );
16943
- const handlePointerUp = React124.useCallback(
17046
+ const handlePointerUp = React125.useCallback(
16944
17047
  (e) => {
16945
17048
  e.preventDefault();
16946
17049
  if (disabled) return;
@@ -16950,7 +17053,7 @@ function ControlButton({
16950
17053
  },
16951
17054
  [disabled, releaseEvent, eventBus, onRelease]
16952
17055
  );
16953
- const handlePointerLeave = React124.useCallback(
17056
+ const handlePointerLeave = React125.useCallback(
16954
17057
  (e) => {
16955
17058
  if (isPressed) {
16956
17059
  setIsPressed(false);
@@ -17150,11 +17253,11 @@ function TimerDisplay({
17150
17253
  {
17151
17254
  className: cn(
17152
17255
  "inline-flex items-center justify-center rounded-lg",
17153
- "bg-gray-800/80 border border-gray-600 font-mono font-bold tabular-nums",
17256
+ "bg-[var(--color-card)]/80 border border-gray-600 font-mono font-bold tabular-nums",
17154
17257
  sizeMap4[size],
17155
17258
  running && "border-green-500/50",
17156
17259
  isLow && "text-red-400 border-red-500/50 animate-pulse",
17157
- !isLow && "text-white",
17260
+ !isLow && "text-[var(--color-foreground)]",
17158
17261
  className
17159
17262
  ),
17160
17263
  children: formatTime(seconds, format)
@@ -17185,7 +17288,7 @@ function ResourceCounter({
17185
17288
  {
17186
17289
  className: cn(
17187
17290
  "inline-flex items-center rounded-md",
17188
- "bg-gray-800/80 border border-gray-600 font-medium text-white",
17291
+ "bg-[var(--color-card)]/80 border border-gray-600 font-medium text-[var(--color-foreground)]",
17189
17292
  sizes.wrapper,
17190
17293
  className
17191
17294
  ),
@@ -17247,9 +17350,9 @@ function ItemSlot({
17247
17350
  title: label,
17248
17351
  className: cn(
17249
17352
  "relative flex items-center justify-center rounded-lg border-2",
17250
- "bg-gray-800/80 transition-all duration-150",
17353
+ "bg-[var(--color-card)]/80 transition-all duration-150",
17251
17354
  sizeMap6[size],
17252
- empty ? "border-gray-700 bg-gray-900/50" : rarityBorderMap[rarity],
17355
+ empty ? "border-gray-700 bg-[var(--color-card)]/50" : rarityBorderMap[rarity],
17253
17356
  !empty && rarityGlowMap[rarity],
17254
17357
  selected && "ring-2 ring-white ring-offset-1 ring-offset-gray-900",
17255
17358
  isClickable && !empty && "hover:brightness-125 cursor-pointer",
@@ -17265,7 +17368,7 @@ function ItemSlot({
17265
17368
  className: cn(
17266
17369
  "absolute -bottom-1 -right-1 flex items-center justify-center",
17267
17370
  "min-w-[18px] h-[18px] rounded-full px-1",
17268
- "bg-gray-700 border border-gray-500 text-[10px] font-bold text-white"
17371
+ "bg-[var(--color-surface,#374151)] border border-gray-500 text-[10px] font-bold text-[var(--color-foreground)]"
17269
17372
  ),
17270
17373
  children: quantity
17271
17374
  }
@@ -17297,7 +17400,7 @@ function TurnIndicator({
17297
17400
  {
17298
17401
  className: cn(
17299
17402
  "inline-flex items-center rounded-lg",
17300
- "bg-gray-800/80 border border-gray-600 font-medium text-white",
17403
+ "bg-[var(--color-card)]/80 border border-gray-600 font-medium text-[var(--color-foreground)]",
17301
17404
  sizes.wrapper,
17302
17405
  className
17303
17406
  ),
@@ -17336,7 +17439,7 @@ function getComboIntensity(combo) {
17336
17439
  if (combo >= 10) return "text-red-400 animate-pulse";
17337
17440
  if (combo >= 7) return "text-orange-400";
17338
17441
  if (combo >= 4) return "text-yellow-400";
17339
- return "text-white";
17442
+ return "text-[var(--color-foreground)]";
17340
17443
  }
17341
17444
  function getComboScale(combo) {
17342
17445
  if (combo >= 10) return "scale-110";
@@ -17357,7 +17460,7 @@ function ComboCounter({
17357
17460
  {
17358
17461
  className: cn(
17359
17462
  "inline-flex flex-col items-center justify-center",
17360
- "rounded-xl bg-gray-800/80 border border-gray-600 px-3 py-1.5",
17463
+ "rounded-xl bg-[var(--color-card)]/80 border border-gray-600 px-3 py-1.5",
17361
17464
  "transition-transform duration-200",
17362
17465
  getComboScale(combo),
17363
17466
  className
@@ -17567,7 +17670,7 @@ function StatusEffect({
17567
17670
  "span",
17568
17671
  {
17569
17672
  className: cn(
17570
- "absolute flex items-center justify-center rounded-full bg-white text-black font-bold leading-none",
17673
+ "absolute flex items-center justify-center rounded-full bg-[var(--color-card)] text-[var(--color-foreground)] font-bold leading-none",
17571
17674
  sizes.badge
17572
17675
  ),
17573
17676
  children: stacks
@@ -17652,7 +17755,7 @@ function DialogueBubble({
17652
17755
  ) }),
17653
17756
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 min-w-0", children: [
17654
17757
  speaker && /* @__PURE__ */ jsx("span", { className: "text-sm font-bold text-yellow-400", children: speaker }),
17655
- /* @__PURE__ */ jsx("span", { className: "text-sm text-white leading-relaxed", children: text })
17758
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-[var(--color-foreground)] leading-relaxed", children: text })
17656
17759
  ] })
17657
17760
  ]
17658
17761
  }
@@ -17679,7 +17782,7 @@ function ChoiceButton({
17679
17782
  className: cn(
17680
17783
  "w-full text-left px-4 py-2.5 rounded-md border transition-all duration-150",
17681
17784
  "flex items-center gap-2",
17682
- selected ? "bg-yellow-500/20 border-yellow-400 text-yellow-300" : "bg-white/5 border-white/10 text-white hover:bg-white/10 hover:border-white/30",
17785
+ selected ? "bg-yellow-500/20 border-yellow-400 text-yellow-300" : "bg-white/5 border-white/10 text-[var(--color-foreground)] hover:bg-white/10 hover:border-white/30",
17683
17786
  disabled && "opacity-40 cursor-not-allowed hover:bg-white/5 hover:border-white/10",
17684
17787
  className
17685
17788
  ),
@@ -17738,7 +17841,7 @@ function ActionButton({
17738
17841
  disabled: isDisabled,
17739
17842
  onClick,
17740
17843
  className: cn(
17741
- "relative inline-flex items-center gap-1.5 rounded-md border font-medium text-white overflow-hidden transition-colors duration-150",
17844
+ "relative inline-flex items-center gap-1.5 rounded-md border font-medium text-[var(--color-foreground)] overflow-hidden transition-colors duration-150",
17742
17845
  sizes.button,
17743
17846
  variantStyles7[variant],
17744
17847
  isDisabled && "opacity-60 cursor-not-allowed",
@@ -17786,9 +17889,9 @@ function MiniMap({
17786
17889
  viewportRect,
17787
17890
  className
17788
17891
  }) {
17789
- const canvasRef = React124.useRef(null);
17790
- const frameRef = React124.useRef(0);
17791
- React124.useEffect(() => {
17892
+ const canvasRef = React125.useRef(null);
17893
+ const frameRef = React125.useRef(0);
17894
+ React125.useEffect(() => {
17792
17895
  const canvas = canvasRef.current;
17793
17896
  if (!canvas) return;
17794
17897
  const ctx = canvas.getContext("2d");
@@ -18024,7 +18127,7 @@ var ErrorState = ({
18024
18127
  );
18025
18128
  };
18026
18129
  ErrorState.displayName = "ErrorState";
18027
- var ErrorBoundary = class extends React124__default.Component {
18130
+ var ErrorBoundary = class extends React125__default.Component {
18028
18131
  constructor(props) {
18029
18132
  super(props);
18030
18133
  __publicField(this, "reset", () => {
@@ -18427,8 +18530,8 @@ var Tooltip = ({
18427
18530
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
18428
18531
  };
18429
18532
  }, []);
18430
- const triggerElement = React124__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
18431
- const trigger = React124__default.cloneElement(triggerElement, {
18533
+ const triggerElement = React125__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
18534
+ const trigger = React125__default.cloneElement(triggerElement, {
18432
18535
  ref: triggerRef,
18433
18536
  onMouseEnter: handleMouseEnter,
18434
18537
  onMouseLeave: handleMouseLeave,
@@ -18545,8 +18648,8 @@ var Popover = ({
18545
18648
  onMouseEnter: handleOpen,
18546
18649
  onMouseLeave: handleClose
18547
18650
  };
18548
- const childElement = React124__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
18549
- const triggerElement = React124__default.cloneElement(
18651
+ const childElement = React125__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
18652
+ const triggerElement = React125__default.cloneElement(
18550
18653
  childElement,
18551
18654
  {
18552
18655
  ref: triggerRef,
@@ -18653,8 +18756,8 @@ var Menu = ({
18653
18756
  "bottom-start": "top-full left-0 mt-2",
18654
18757
  "bottom-end": "top-full right-0 mt-2"
18655
18758
  };
18656
- const triggerChild = React124__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
18657
- const triggerElement = React124__default.cloneElement(
18759
+ const triggerChild = React125__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
18760
+ const triggerElement = React125__default.cloneElement(
18658
18761
  triggerChild,
18659
18762
  {
18660
18763
  ref: triggerRef,
@@ -19374,7 +19477,7 @@ function InputPattern({
19374
19477
  className
19375
19478
  }) {
19376
19479
  const { emit } = useEventBus();
19377
- const [localValue, setLocalValue] = React124__default.useState(value);
19480
+ const [localValue, setLocalValue] = React125__default.useState(value);
19378
19481
  const handleChange = (e) => {
19379
19482
  setLocalValue(e.target.value);
19380
19483
  if (onChange) {
@@ -19411,7 +19514,7 @@ function TextareaPattern({
19411
19514
  className
19412
19515
  }) {
19413
19516
  const { emit } = useEventBus();
19414
- const [localValue, setLocalValue] = React124__default.useState(value);
19517
+ const [localValue, setLocalValue] = React125__default.useState(value);
19415
19518
  const handleChange = (e) => {
19416
19519
  setLocalValue(e.target.value);
19417
19520
  if (onChange) {
@@ -19442,7 +19545,7 @@ function SelectPattern({
19442
19545
  className
19443
19546
  }) {
19444
19547
  const { emit } = useEventBus();
19445
- const [localValue, setLocalValue] = React124__default.useState(value);
19548
+ const [localValue, setLocalValue] = React125__default.useState(value);
19446
19549
  const handleChange = (e) => {
19447
19550
  setLocalValue(e.target.value);
19448
19551
  if (onChange) {
@@ -19471,7 +19574,7 @@ function CheckboxPattern({
19471
19574
  className
19472
19575
  }) {
19473
19576
  const { emit } = useEventBus();
19474
- const [localChecked, setLocalChecked] = React124__default.useState(checked);
19577
+ const [localChecked, setLocalChecked] = React125__default.useState(checked);
19475
19578
  const handleChange = (e) => {
19476
19579
  setLocalChecked(e.target.checked);
19477
19580
  if (onChange) {
@@ -19676,8 +19779,8 @@ function ActionButtons({
19676
19779
  disabled
19677
19780
  }) {
19678
19781
  const eventBus = useEventBus();
19679
- const [activeButtons, setActiveButtons] = React124.useState(/* @__PURE__ */ new Set());
19680
- const handlePress = React124.useCallback(
19782
+ const [activeButtons, setActiveButtons] = React125.useState(/* @__PURE__ */ new Set());
19783
+ const handlePress = React125.useCallback(
19681
19784
  (id) => {
19682
19785
  setActiveButtons((prev) => new Set(prev).add(id));
19683
19786
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -19685,7 +19788,7 @@ function ActionButtons({
19685
19788
  },
19686
19789
  [actionEvent, eventBus, onAction]
19687
19790
  );
19688
- const handleRelease = React124.useCallback(
19791
+ const handleRelease = React125.useCallback(
19689
19792
  (id) => {
19690
19793
  setActiveButtons((prev) => {
19691
19794
  const next = new Set(prev);
@@ -19882,11 +19985,11 @@ var AuthLayout = ({
19882
19985
  children: [
19883
19986
  /* @__PURE__ */ jsx(Box, { className: "absolute inset-0 bg-gradient-to-br from-primary-600/90 to-primary-800/90" }),
19884
19987
  /* @__PURE__ */ jsx(Box, { className: "relative z-10", children: /* @__PURE__ */ jsxs(Link, { to: "/", className: "flex items-center gap-3", children: [
19885
- logo || /* @__PURE__ */ jsx(Box, { className: "w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center backdrop-blur", children: /* @__PURE__ */ jsx(
19988
+ logo || /* @__PURE__ */ jsx(Box, { className: "w-10 h-10 bg-[var(--color-card)]/20 rounded-xl flex items-center justify-center backdrop-blur", children: /* @__PURE__ */ jsx(
19886
19989
  Typography,
19887
19990
  {
19888
19991
  variant: "body1",
19889
- className: "text-white font-bold text-lg",
19992
+ className: "text-[var(--color-foreground)] font-bold text-lg",
19890
19993
  children: appName.charAt(0).toUpperCase()
19891
19994
  }
19892
19995
  ) }),
@@ -19894,7 +19997,7 @@ var AuthLayout = ({
19894
19997
  Typography,
19895
19998
  {
19896
19999
  variant: "body1",
19897
- className: "text-2xl font-bold text-white",
20000
+ className: "text-2xl font-bold text-[var(--color-foreground)]",
19898
20001
  children: appName
19899
20002
  }
19900
20003
  )
@@ -19904,7 +20007,7 @@ var AuthLayout = ({
19904
20007
  Typography,
19905
20008
  {
19906
20009
  variant: "h1",
19907
- className: "text-4xl font-bold text-white leading-tight",
20010
+ className: "text-4xl font-bold text-[var(--color-foreground)] leading-tight",
19908
20011
  children: [
19909
20012
  "Welcome to ",
19910
20013
  appName
@@ -19915,27 +20018,27 @@ var AuthLayout = ({
19915
20018
  Typography,
19916
20019
  {
19917
20020
  variant: "body1",
19918
- className: "text-lg text-white/80 max-w-md",
20021
+ className: "text-lg text-[var(--color-foreground)]/80 max-w-md",
19919
20022
  children: "Sign in to access your dashboard and manage your account."
19920
20023
  }
19921
20024
  ),
19922
- /* @__PURE__ */ jsxs(Box, { className: "mt-12 p-6 bg-white/10 rounded-xl backdrop-blur", children: [
20025
+ /* @__PURE__ */ jsxs(Box, { className: "mt-12 p-6 bg-[var(--color-card)]/10 rounded-xl backdrop-blur", children: [
19923
20026
  /* @__PURE__ */ jsx(
19924
20027
  Typography,
19925
20028
  {
19926
20029
  variant: "body1",
19927
- className: "text-white/90 italic",
20030
+ className: "text-[var(--color-foreground)]/90 italic",
19928
20031
  children: '"This platform has transformed how we work. Highly recommended!"'
19929
20032
  }
19930
20033
  ),
19931
20034
  /* @__PURE__ */ jsxs(HStack, { className: "mt-4", gap: "sm", align: "center", children: [
19932
- /* @__PURE__ */ jsx(Box, { className: "w-10 h-10 bg-white/20 rounded-full" }),
20035
+ /* @__PURE__ */ jsx(Box, { className: "w-10 h-10 bg-[var(--color-card)]/20 rounded-full" }),
19933
20036
  /* @__PURE__ */ jsxs(VStack, { gap: "none", children: [
19934
20037
  /* @__PURE__ */ jsx(
19935
20038
  Typography,
19936
20039
  {
19937
20040
  variant: "body1",
19938
- className: "text-white font-medium",
20041
+ className: "text-[var(--color-foreground)] font-medium",
19939
20042
  children: "Jane Doe"
19940
20043
  }
19941
20044
  ),
@@ -19943,7 +20046,7 @@ var AuthLayout = ({
19943
20046
  Typography,
19944
20047
  {
19945
20048
  variant: "body1",
19946
- className: "text-white/60 text-sm",
20049
+ className: "text-[var(--color-foreground)]/60 text-sm",
19947
20050
  children: "CEO, Example Co."
19948
20051
  }
19949
20052
  )
@@ -19951,8 +20054,8 @@ var AuthLayout = ({
19951
20054
  ] })
19952
20055
  ] })
19953
20056
  ] }) }),
19954
- /* @__PURE__ */ jsx(Box, { className: "absolute -bottom-32 -right-32 w-96 h-96 bg-white/5 rounded-full" }),
19955
- /* @__PURE__ */ jsx(Box, { className: "absolute -top-16 -right-16 w-64 h-64 bg-white/5 rounded-full" })
20057
+ /* @__PURE__ */ jsx(Box, { className: "absolute -bottom-32 -right-32 w-96 h-96 bg-[var(--color-card)]/5 rounded-full" }),
20058
+ /* @__PURE__ */ jsx(Box, { className: "absolute -top-16 -right-16 w-64 h-64 bg-[var(--color-card)]/5 rounded-full" })
19956
20059
  ]
19957
20060
  }
19958
20061
  ),
@@ -19969,7 +20072,7 @@ var AuthLayout = ({
19969
20072
  Typography,
19970
20073
  {
19971
20074
  variant: "body1",
19972
- className: "text-white font-bold text-xl",
20075
+ className: "text-[var(--color-foreground)] font-bold text-xl",
19973
20076
  children: appName.charAt(0).toUpperCase()
19974
20077
  }
19975
20078
  ) }),
@@ -20060,13 +20163,13 @@ function getState() {
20060
20163
  }
20061
20164
  return { checks: /* @__PURE__ */ new Map(), transitions: [], bridgeHealth: null, listeners: /* @__PURE__ */ new Set() };
20062
20165
  }
20063
- function notifyListeners() {
20166
+ function notifyListeners2() {
20064
20167
  getState().listeners.forEach((l) => l());
20065
20168
  exposeOnWindow();
20066
20169
  }
20067
20170
  function registerCheck(id, label, status = "pending", details) {
20068
20171
  getState().checks.set(id, { id, label, status, details, updatedAt: Date.now() });
20069
- notifyListeners();
20172
+ notifyListeners2();
20070
20173
  }
20071
20174
  function getAllChecks() {
20072
20175
  return Array.from(getState().checks.values());
@@ -20110,7 +20213,7 @@ function recordTransition(trace) {
20110
20213
  failedEffects.map((e) => `${e.type}: ${e.error}`).join("; ")
20111
20214
  );
20112
20215
  }
20113
- notifyListeners();
20216
+ notifyListeners2();
20114
20217
  }
20115
20218
  function getTransitions2() {
20116
20219
  return [...getState().transitions];
@@ -20143,7 +20246,7 @@ function recordServerResponse(orbitalName, event, response) {
20143
20246
  response.error
20144
20247
  );
20145
20248
  }
20146
- notifyListeners();
20249
+ notifyListeners2();
20147
20250
  }
20148
20251
  function getBridgeHealth() {
20149
20252
  const bh = getState().bridgeHealth;
@@ -21075,7 +21178,7 @@ function IsometricCanvas({
21075
21178
  className: cn("relative w-full overflow-hidden rounded-lg", className),
21076
21179
  style: { height: viewportSize.height },
21077
21180
  "data-testid": "game-canvas-empty",
21078
- children: /* @__PURE__ */ jsx(Box, { className: "flex items-center justify-center h-full bg-slate-800 rounded-lg", children: /* @__PURE__ */ jsxs(Stack, { direction: "vertical", gap: "md", align: "center", children: [
21181
+ children: /* @__PURE__ */ jsx(Box, { className: "flex items-center justify-center h-full bg-[var(--color-card)] rounded-lg", children: /* @__PURE__ */ jsxs(Stack, { direction: "vertical", gap: "md", align: "center", children: [
21079
21182
  /* @__PURE__ */ jsx(Icon, { name: "map", size: "xl" }),
21080
21183
  /* @__PURE__ */ jsx(Typography, { variant: "body", className: "text-slate-400", children: t("canvas.emptyMessage") || "No map data loaded" })
21081
21184
  ] }) })
@@ -21607,7 +21710,7 @@ ScaledDiagram.displayName = "ScaledDiagram";
21607
21710
  init_Stack();
21608
21711
  init_Box();
21609
21712
  init_cn();
21610
- var MarkdownContent = React124__default.memo(
21713
+ var MarkdownContent = React125__default.memo(
21611
21714
  ({ content, direction, className }) => {
21612
21715
  const { t: _t } = useTranslate();
21613
21716
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -21673,7 +21776,7 @@ var MarkdownContent = React124__default.memo(
21673
21776
  "th",
21674
21777
  {
21675
21778
  ...props,
21676
- className: "border border-gray-300 dark:border-gray-600 bg-gray-100 dark:bg-gray-800 px-4 py-2 text-left font-semibold",
21779
+ className: "border border-gray-300 dark:border-gray-600 bg-[var(--color-muted)] px-4 py-2 text-left font-semibold",
21677
21780
  children
21678
21781
  }
21679
21782
  );
@@ -21759,13 +21862,50 @@ var orbStyleOverrides = {
21759
21862
  "orb-op-async": { color: ORB_COLORS.dark.async }
21760
21863
  };
21761
21864
  var orbStyle = { ...dark, ...orbStyleOverrides };
21762
- var CodeBlock = React124__default.memo(
21865
+ function computeFoldRegions(code) {
21866
+ const lines = code.split("\n");
21867
+ const regions = [];
21868
+ const stack = [];
21869
+ for (let i = 0; i < lines.length; i++) {
21870
+ const line = lines[i];
21871
+ let inString = false;
21872
+ for (let j = 0; j < line.length; j++) {
21873
+ const ch = line[j];
21874
+ if (ch === "\\" && inString) {
21875
+ j++;
21876
+ continue;
21877
+ }
21878
+ if (ch === '"') {
21879
+ inString = !inString;
21880
+ continue;
21881
+ }
21882
+ if (inString) continue;
21883
+ if (ch === "{" || ch === "[") {
21884
+ stack.push({ line: i, bracket: ch });
21885
+ } else if (ch === "}" || ch === "]") {
21886
+ const open = stack.pop();
21887
+ if (open && open.line < i) {
21888
+ regions.push({
21889
+ start: open.line,
21890
+ end: i,
21891
+ closeBracket: ch
21892
+ });
21893
+ }
21894
+ }
21895
+ }
21896
+ }
21897
+ return regions.sort((a, b) => a.start - b.start);
21898
+ }
21899
+ var LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
21900
+ var HIDDEN_LINE_NUMBERS = { display: "none" };
21901
+ var CodeBlock = React125__default.memo(
21763
21902
  ({
21764
21903
  code: rawCode,
21765
21904
  language = "text",
21766
21905
  showCopyButton = true,
21767
21906
  showLanguageBadge = true,
21768
21907
  maxHeight = "60vh",
21908
+ foldable: foldableProp,
21769
21909
  className
21770
21910
  }) => {
21771
21911
  const code = typeof rawCode === "string" ? rawCode : String(rawCode ?? "");
@@ -21774,8 +21914,114 @@ var CodeBlock = React124__default.memo(
21774
21914
  const eventBus = useEventBus();
21775
21915
  const { t: _t } = useTranslate();
21776
21916
  const scrollRef = useRef(null);
21917
+ const codeRef = useRef(null);
21777
21918
  const savedScrollLeftRef = useRef(0);
21778
21919
  const [copied, setCopied] = useState(false);
21920
+ const isFoldable = foldableProp ?? (language === "orb" || language === "json");
21921
+ const [collapsed, setCollapsed] = useState(() => /* @__PURE__ */ new Set());
21922
+ const foldRegions = useMemo(
21923
+ () => isFoldable ? computeFoldRegions(code) : [],
21924
+ [code, isFoldable]
21925
+ );
21926
+ const foldStartMap = useMemo(() => {
21927
+ const m = /* @__PURE__ */ new Map();
21928
+ for (const r2 of foldRegions) m.set(r2.start, r2);
21929
+ return m;
21930
+ }, [foldRegions]);
21931
+ const hiddenLines = useMemo(() => {
21932
+ const h = /* @__PURE__ */ new Set();
21933
+ for (const r2 of foldRegions) {
21934
+ if (!collapsed.has(r2.start)) continue;
21935
+ for (let i = r2.start + 1; i <= r2.end; i++) h.add(i);
21936
+ }
21937
+ return h;
21938
+ }, [foldRegions, collapsed]);
21939
+ const collapsedRef = useRef(collapsed);
21940
+ collapsedRef.current = collapsed;
21941
+ const foldStartMapRef = useRef(foldStartMap);
21942
+ foldStartMapRef.current = foldStartMap;
21943
+ const toggleFold = useCallback((lineNum) => {
21944
+ setCollapsed((prev) => {
21945
+ const next = new Set(prev);
21946
+ if (next.has(lineNum)) next.delete(lineNum);
21947
+ else next.add(lineNum);
21948
+ return next;
21949
+ });
21950
+ }, []);
21951
+ const toggleFoldRef = useRef(toggleFold);
21952
+ toggleFoldRef.current = toggleFold;
21953
+ useEffect(() => {
21954
+ setCollapsed(/* @__PURE__ */ new Set());
21955
+ }, [code]);
21956
+ const highlightedElement = useMemo(
21957
+ () => /* @__PURE__ */ jsx(
21958
+ SyntaxHighlighter,
21959
+ {
21960
+ PreTag: "div",
21961
+ language,
21962
+ style: activeStyle,
21963
+ wrapLines: true,
21964
+ showLineNumbers: true,
21965
+ showInlineLineNumbers: false,
21966
+ lineNumberContainerStyle: HIDDEN_LINE_NUMBERS,
21967
+ lineProps: LINE_PROPS_FN,
21968
+ customStyle: {
21969
+ backgroundColor: "transparent",
21970
+ borderRadius: 0,
21971
+ padding: 0,
21972
+ margin: 0,
21973
+ whiteSpace: "pre",
21974
+ minWidth: "100%"
21975
+ },
21976
+ children: code
21977
+ }
21978
+ ),
21979
+ [code, language, activeStyle]
21980
+ );
21981
+ useLayoutEffect(() => {
21982
+ const container = codeRef.current;
21983
+ if (!container) return;
21984
+ container.querySelectorAll(".fold-toggle, .fold-summary").forEach((el) => el.remove());
21985
+ const lineEls = container.querySelectorAll("[data-line]");
21986
+ if (!isFoldable || foldRegions.length === 0) {
21987
+ lineEls.forEach((el) => {
21988
+ el.style.display = "";
21989
+ el.style.position = "";
21990
+ el.style.paddingLeft = "";
21991
+ });
21992
+ return;
21993
+ }
21994
+ lineEls.forEach((el) => {
21995
+ const num = parseInt(el.getAttribute("data-line") ?? "-1", 10);
21996
+ if (hiddenLines.has(num)) {
21997
+ el.style.display = "none";
21998
+ return;
21999
+ }
22000
+ el.style.display = "";
22001
+ el.style.position = "relative";
22002
+ el.style.paddingLeft = "1.2em";
22003
+ const region = foldStartMap.get(num);
22004
+ if (!region) return;
22005
+ const isCollapsed = collapsed.has(num);
22006
+ const toggle = document.createElement("span");
22007
+ toggle.className = "fold-toggle";
22008
+ toggle.textContent = isCollapsed ? "\u25B6" : "\u25BC";
22009
+ toggle.style.cssText = "position:absolute;left:0;top:0;width:1.2em;text-align:center;cursor:pointer;color:#858585;font-size:10px;user-select:none;line-height:inherit;height:100%";
22010
+ toggle.addEventListener("click", (e) => {
22011
+ e.stopPropagation();
22012
+ toggleFoldRef.current(num);
22013
+ });
22014
+ el.insertBefore(toggle, el.firstChild);
22015
+ if (isCollapsed) {
22016
+ const summary = document.createElement("span");
22017
+ summary.className = "fold-summary";
22018
+ summary.style.cssText = "color:#858585;font-style:italic";
22019
+ const count = region.end - region.start - 1;
22020
+ summary.textContent = ` ... ${count} line${count !== 1 ? "s" : ""} ${region.closeBracket}`;
22021
+ el.appendChild(summary);
22022
+ }
22023
+ });
22024
+ }, [collapsed, hiddenLines, foldStartMap, foldRegions, isFoldable]);
21779
22025
  useLayoutEffect(() => {
21780
22026
  const el = scrollRef.current;
21781
22027
  return () => {
@@ -21806,13 +22052,14 @@ var CodeBlock = React124__default.memo(
21806
22052
  eventBus.emit("UI:COPY_CODE", { language, success: false });
21807
22053
  }
21808
22054
  };
22055
+ const hasHeader = showLanguageBadge || showCopyButton;
21809
22056
  return /* @__PURE__ */ jsxs(Box, { className: `relative group ${className || ""}`, children: [
21810
- (showLanguageBadge || showCopyButton) && /* @__PURE__ */ jsxs(
22057
+ hasHeader && /* @__PURE__ */ jsxs(
21811
22058
  HStack,
21812
22059
  {
21813
22060
  justify: "between",
21814
22061
  align: "center",
21815
- className: "px-3 py-2 bg-gray-800 rounded-t-lg border-b border-gray-700",
22062
+ className: "px-3 py-2 bg-[var(--color-card)] rounded-t-lg border-b border-gray-700",
21816
22063
  children: [
21817
22064
  showLanguageBadge && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: language }),
21818
22065
  showCopyButton && /* @__PURE__ */ jsx(
@@ -21842,31 +22089,14 @@ var CodeBlock = React124__default.memo(
21842
22089
  touchAction: "pan-x pan-y",
21843
22090
  contain: "paint",
21844
22091
  backgroundColor: "#1e1e1e",
21845
- borderRadius: showLanguageBadge || showCopyButton ? "0 0 0.5rem 0.5rem" : "0.5rem",
21846
- padding: "1rem"
22092
+ borderRadius: hasHeader ? "0 0 0.5rem 0.5rem" : "0.5rem"
21847
22093
  },
21848
- children: /* @__PURE__ */ jsx(
21849
- SyntaxHighlighter,
21850
- {
21851
- PreTag: "div",
21852
- language,
21853
- style: activeStyle,
21854
- customStyle: {
21855
- backgroundColor: "transparent",
21856
- borderRadius: 0,
21857
- padding: 0,
21858
- margin: 0,
21859
- whiteSpace: "pre",
21860
- minWidth: "100%"
21861
- },
21862
- children: code
21863
- }
21864
- )
22094
+ children: /* @__PURE__ */ jsx("div", { ref: codeRef, style: { padding: "1rem" }, children: highlightedElement })
21865
22095
  }
21866
22096
  )
21867
22097
  ] });
21868
22098
  },
21869
- (prev, next) => prev.language === next.language && prev.code === next.code && prev.showCopyButton === next.showCopyButton && prev.maxHeight === next.maxHeight
22099
+ (prev, next) => prev.language === next.language && prev.code === next.code && prev.showCopyButton === next.showCopyButton && prev.maxHeight === next.maxHeight && prev.foldable === next.foldable
21870
22100
  );
21871
22101
  CodeBlock.displayName = "CodeBlock";
21872
22102
 
@@ -22787,7 +23017,7 @@ var StateMachineView = ({
22787
23017
  style: { top: title ? 30 : 0 },
22788
23018
  children: [
22789
23019
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
22790
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React124__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
23020
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React125__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
22791
23021
  StateNode,
22792
23022
  {
22793
23023
  state,
@@ -28313,7 +28543,7 @@ function CraftingRecipe({
28313
28543
  className
28314
28544
  }) {
28315
28545
  const eventBus = useEventBus();
28316
- const handleCraft = React124.useCallback(() => {
28546
+ const handleCraft = React125.useCallback(() => {
28317
28547
  onCraft?.();
28318
28548
  if (craftEvent) {
28319
28549
  eventBus.emit(craftEvent, { output: output.label });
@@ -28330,7 +28560,7 @@ function CraftingRecipe({
28330
28560
  children: [
28331
28561
  /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
28332
28562
  const hasSufficient = ingredient.available >= ingredient.required;
28333
- return /* @__PURE__ */ jsxs(React124.Fragment, { children: [
28563
+ return /* @__PURE__ */ jsxs(React125.Fragment, { children: [
28334
28564
  /* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
28335
28565
  ItemSlot,
28336
28566
  {
@@ -28619,8 +28849,8 @@ function DPad({
28619
28849
  }) {
28620
28850
  const eventBus = useEventBus();
28621
28851
  const sizes = sizeMap15[size];
28622
- const [activeDirections, setActiveDirections] = React124.useState(/* @__PURE__ */ new Set());
28623
- const handlePress = React124.useCallback(
28852
+ const [activeDirections, setActiveDirections] = React125.useState(/* @__PURE__ */ new Set());
28853
+ const handlePress = React125.useCallback(
28624
28854
  (direction) => {
28625
28855
  setActiveDirections((prev) => new Set(prev).add(direction));
28626
28856
  if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
@@ -28628,7 +28858,7 @@ function DPad({
28628
28858
  },
28629
28859
  [directionEvent, eventBus, onDirection]
28630
28860
  );
28631
- const handleRelease = React124.useCallback(
28861
+ const handleRelease = React125.useCallback(
28632
28862
  (direction) => {
28633
28863
  setActiveDirections((prev) => {
28634
28864
  const next = new Set(prev);
@@ -29439,7 +29669,7 @@ var DataList = ({
29439
29669
  }) => {
29440
29670
  const eventBus = useEventBus();
29441
29671
  const { t } = useTranslate();
29442
- const [visibleCount, setVisibleCount] = React124__default.useState(pageSize || Infinity);
29672
+ const [visibleCount, setVisibleCount] = React125__default.useState(pageSize || Infinity);
29443
29673
  const fields = fieldsProp ?? columnsProp ?? [];
29444
29674
  const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
29445
29675
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
@@ -29476,7 +29706,7 @@ var DataList = ({
29476
29706
  const items2 = data.map((item) => item);
29477
29707
  const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
29478
29708
  const contentField = titleField?.name ?? fields[0]?.name ?? "";
29479
- return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React124__default.Fragment, { children: [
29709
+ return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React125__default.Fragment, { children: [
29480
29710
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
29481
29711
  group.items.map((itemData, index) => {
29482
29712
  const id = itemData.id || `${gi}-${index}`;
@@ -29679,7 +29909,7 @@ var DataList = ({
29679
29909
  className
29680
29910
  ),
29681
29911
  children: [
29682
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React124__default.Fragment, { children: [
29912
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React125__default.Fragment, { children: [
29683
29913
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
29684
29914
  group.items.map(
29685
29915
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -29770,27 +30000,27 @@ function useQuerySingleton(query) {
29770
30000
  store2.listeners.delete(listener);
29771
30001
  };
29772
30002
  }, [store2]);
29773
- const notifyListeners3 = useCallback(() => {
30003
+ const notifyListeners4 = useCallback(() => {
29774
30004
  store2.listeners.forEach((listener) => listener());
29775
30005
  }, [store2]);
29776
30006
  const setSearch = useCallback((value) => {
29777
30007
  store2.search = value;
29778
- notifyListeners3();
29779
- }, [store2, notifyListeners3]);
30008
+ notifyListeners4();
30009
+ }, [store2, notifyListeners4]);
29780
30010
  const setFilter = useCallback((key, value) => {
29781
30011
  store2.filters = { ...store2.filters, [key]: value };
29782
- notifyListeners3();
29783
- }, [store2, notifyListeners3]);
30012
+ notifyListeners4();
30013
+ }, [store2, notifyListeners4]);
29784
30014
  const clearFilters = useCallback(() => {
29785
30015
  store2.filters = {};
29786
30016
  store2.search = "";
29787
- notifyListeners3();
29788
- }, [store2, notifyListeners3]);
30017
+ notifyListeners4();
30018
+ }, [store2, notifyListeners4]);
29789
30019
  const setSort = useCallback((field, direction) => {
29790
30020
  store2.sortField = field;
29791
30021
  store2.sortDirection = direction;
29792
- notifyListeners3();
29793
- }, [store2, notifyListeners3]);
30022
+ notifyListeners4();
30023
+ }, [store2, notifyListeners4]);
29794
30024
  return {
29795
30025
  search: store2.search,
29796
30026
  setSearch,
@@ -30746,7 +30976,7 @@ var WizardProgress = ({
30746
30976
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: steps.map((step, index) => {
30747
30977
  const isActive = index === currentStep;
30748
30978
  const isCompleted = index < currentStep;
30749
- return /* @__PURE__ */ jsxs(React124__default.Fragment, { children: [
30979
+ return /* @__PURE__ */ jsxs(React125__default.Fragment, { children: [
30750
30980
  /* @__PURE__ */ jsx(
30751
30981
  "button",
30752
30982
  {
@@ -31522,7 +31752,7 @@ var sizeMap17 = {
31522
31752
  lg: "text-base px-4 py-2"
31523
31753
  };
31524
31754
  var variantMap2 = {
31525
- default: "bg-gray-800/80 border-gray-700",
31755
+ default: "bg-[var(--color-card)]/80 border-gray-700",
31526
31756
  primary: "bg-blue-900/80 border-blue-700",
31527
31757
  success: "bg-green-900/80 border-green-700",
31528
31758
  warning: "bg-yellow-900/80 border-yellow-700",
@@ -31583,7 +31813,7 @@ function StatBadge({
31583
31813
  animated: true
31584
31814
  }
31585
31815
  ),
31586
- format === "text" && /* @__PURE__ */ jsx("span", { className: "font-bold text-white", children: value })
31816
+ format === "text" && /* @__PURE__ */ jsx("span", { className: "font-bold text-[var(--color-foreground)]", children: value })
31587
31817
  ]
31588
31818
  }
31589
31819
  );
@@ -31616,7 +31846,7 @@ function InventoryGrid({
31616
31846
  const eventBus = useEventBus();
31617
31847
  const slotCount = totalSlots ?? items.length;
31618
31848
  const emptySlotCount = Math.max(0, slotCount - items.length);
31619
- const handleSelect = React124.useCallback(
31849
+ const handleSelect = React125.useCallback(
31620
31850
  (id) => {
31621
31851
  onSelect?.(id);
31622
31852
  if (selectEvent) {
@@ -31805,15 +32035,15 @@ function GameCanvas2D({
31805
32035
  fps = 60,
31806
32036
  className
31807
32037
  }) {
31808
- const canvasRef = React124.useRef(null);
31809
- const rafRef = React124.useRef(0);
31810
- const frameRef = React124.useRef(0);
31811
- const lastTimeRef = React124.useRef(0);
31812
- const onDrawRef = React124.useRef(onDraw);
32038
+ const canvasRef = React125.useRef(null);
32039
+ const rafRef = React125.useRef(0);
32040
+ const frameRef = React125.useRef(0);
32041
+ const lastTimeRef = React125.useRef(0);
32042
+ const onDrawRef = React125.useRef(onDraw);
31813
32043
  onDrawRef.current = onDraw;
31814
- const onTickRef = React124.useRef(onTick);
32044
+ const onTickRef = React125.useRef(onTick);
31815
32045
  onTickRef.current = onTick;
31816
- React124.useEffect(() => {
32046
+ React125.useEffect(() => {
31817
32047
  const canvas = canvasRef.current;
31818
32048
  if (!canvas) return;
31819
32049
  const ctx = canvas.getContext("2d");
@@ -31882,7 +32112,7 @@ function HealthPanel({
31882
32112
  Box,
31883
32113
  {
31884
32114
  className: cn(
31885
- "rounded-lg bg-gray-900/90 border border-gray-700 backdrop-blur-sm",
32115
+ "rounded-lg bg-[var(--color-card)]/90 border border-gray-700 backdrop-blur-sm",
31886
32116
  sizes.padding,
31887
32117
  className
31888
32118
  ),
@@ -31988,7 +32218,7 @@ function ScoreBoard({
31988
32218
  Card,
31989
32219
  {
31990
32220
  className: cn(
31991
- "bg-gray-900/90 border-gray-700 backdrop-blur-sm",
32221
+ "bg-[var(--color-card)]/90 border-gray-700 backdrop-blur-sm",
31992
32222
  className
31993
32223
  ),
31994
32224
  children: /* @__PURE__ */ jsx(CardContent, { className: "p-3", children: /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-3 flex-wrap", children: [
@@ -32084,7 +32314,7 @@ function TurnPanel({
32084
32314
  className
32085
32315
  }) {
32086
32316
  const eventBus = useEventBus();
32087
- const handleAction = React124.useCallback(
32317
+ const handleAction = React125.useCallback(
32088
32318
  (event) => {
32089
32319
  if (event) {
32090
32320
  eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
@@ -32096,7 +32326,7 @@ function TurnPanel({
32096
32326
  Box,
32097
32327
  {
32098
32328
  className: cn(
32099
- "flex items-center gap-3 rounded-lg bg-gray-900/90 border border-gray-700 backdrop-blur-sm px-3 py-2",
32329
+ "flex items-center gap-3 rounded-lg bg-[var(--color-card)]/90 border border-gray-700 backdrop-blur-sm px-3 py-2",
32100
32330
  className
32101
32331
  ),
32102
32332
  children: [
@@ -32148,7 +32378,7 @@ function EnemyPlate({
32148
32378
  Box,
32149
32379
  {
32150
32380
  className: cn(
32151
- "inline-flex flex-col gap-1 rounded-lg bg-gray-900/90 border border-gray-700 backdrop-blur-sm px-3 py-1.5",
32381
+ "inline-flex flex-col gap-1 rounded-lg bg-[var(--color-card)]/90 border border-gray-700 backdrop-blur-sm px-3 py-1.5",
32152
32382
  "min-w-[120px]",
32153
32383
  className
32154
32384
  ),
@@ -32159,7 +32389,7 @@ function EnemyPlate({
32159
32389
  {
32160
32390
  variant: "caption",
32161
32391
  weight: "bold",
32162
- className: "text-white truncate",
32392
+ className: "text-[var(--color-foreground)] truncate",
32163
32393
  children: name
32164
32394
  }
32165
32395
  ),
@@ -32220,7 +32450,7 @@ function UnitCommandBar({
32220
32450
  className
32221
32451
  }) {
32222
32452
  const eventBus = useEventBus();
32223
- const handleCommand = React124.useCallback(
32453
+ const handleCommand = React125.useCallback(
32224
32454
  (event) => {
32225
32455
  if (event) {
32226
32456
  eventBus.emit(event, { unitId: selectedUnitId });
@@ -32232,7 +32462,7 @@ function UnitCommandBar({
32232
32462
  Box,
32233
32463
  {
32234
32464
  className: cn(
32235
- "flex items-center gap-1.5 rounded-lg bg-gray-900/90 border border-gray-700 backdrop-blur-sm px-2 py-1.5",
32465
+ "flex items-center gap-1.5 rounded-lg bg-[var(--color-card)]/90 border border-gray-700 backdrop-blur-sm px-2 py-1.5",
32236
32466
  className
32237
32467
  ),
32238
32468
  children: commands.map((command, i) => /* @__PURE__ */ jsxs(Box, { className: "flex flex-col items-center gap-0.5", children: [
@@ -32466,7 +32696,7 @@ function DialogueBox({
32466
32696
  tabIndex: 0,
32467
32697
  role: "dialog",
32468
32698
  "aria-label": "Dialogue",
32469
- children: /* @__PURE__ */ jsx("div", { className: "mx-4 my-4 bg-gray-900 bg-opacity-95 border-2 border-gray-600 rounded-lg overflow-hidden", children: /* @__PURE__ */ jsxs("div", { className: "flex", children: [
32699
+ children: /* @__PURE__ */ jsx("div", { className: "mx-4 my-4 bg-[var(--color-card)] bg-opacity-95 border-2 border-gray-600 rounded-lg overflow-hidden", children: /* @__PURE__ */ jsxs("div", { className: "flex", children: [
32470
32700
  dialogue.portrait && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 p-4 border-r border-gray-700", children: /* @__PURE__ */ jsx(
32471
32701
  "img",
32472
32702
  {
@@ -32478,7 +32708,7 @@ function DialogueBox({
32478
32708
  ) }),
32479
32709
  /* @__PURE__ */ jsxs("div", { className: "flex-1 p-4", children: [
32480
32710
  /* @__PURE__ */ jsx("div", { className: "text-yellow-400 font-bold mb-2", children: dialogue.speaker }),
32481
- /* @__PURE__ */ jsxs("div", { className: "text-white text-lg leading-relaxed min-h-[60px]", children: [
32711
+ /* @__PURE__ */ jsxs("div", { className: "text-[var(--color-foreground)] text-lg leading-relaxed min-h-[60px]", children: [
32482
32712
  displayedText,
32483
32713
  isTyping && /* @__PURE__ */ jsx("span", { className: "animate-pulse", children: "\u258C" })
32484
32714
  ] }),
@@ -32488,8 +32718,8 @@ function DialogueBox({
32488
32718
  type: "button",
32489
32719
  className: cn(
32490
32720
  "block w-full text-left px-4 py-2 rounded transition-colors",
32491
- "hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-yellow-400",
32492
- selectedChoice === index ? "bg-gray-700 text-yellow-400" : "bg-gray-800 text-white"
32721
+ "hover:bg-[var(--color-surface,#374151)] focus:outline-none focus:ring-2 focus:ring-yellow-400",
32722
+ selectedChoice === index ? "bg-[var(--color-surface,#374151)] text-yellow-400" : "bg-[var(--color-card)] text-[var(--color-foreground)]"
32493
32723
  ),
32494
32724
  onClick: (e) => {
32495
32725
  e.stopPropagation();
@@ -32606,7 +32836,7 @@ function InventoryPanel({
32606
32836
  /* @__PURE__ */ jsx(
32607
32837
  "div",
32608
32838
  {
32609
- className: "grid gap-1 bg-gray-900 p-2 rounded-lg border border-gray-700",
32839
+ className: "grid gap-1 bg-[var(--color-card)] p-2 rounded-lg border border-gray-700",
32610
32840
  style: {
32611
32841
  gridTemplateColumns: `repeat(${safeColumns}, ${slotSize}px)`,
32612
32842
  gridTemplateRows: `repeat(${rows}, ${slotSize}px)`
@@ -32617,9 +32847,9 @@ function InventoryPanel({
32617
32847
  type: "button",
32618
32848
  className: cn(
32619
32849
  "relative flex items-center justify-center",
32620
- "bg-gray-800 border rounded transition-colors",
32621
- "hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500",
32622
- selectedSlot === index ? "border-yellow-400 bg-gray-700" : "border-gray-600"
32850
+ "bg-[var(--color-card)] border rounded transition-colors",
32851
+ "hover:bg-[var(--color-surface,#374151)] focus:outline-none focus:ring-2 focus:ring-blue-500",
32852
+ selectedSlot === index ? "border-yellow-400 bg-[var(--color-surface,#374151)]" : "border-gray-600"
32623
32853
  ),
32624
32854
  style: { width: slotSize, height: slotSize },
32625
32855
  onClick: () => handleSlotClick(index),
@@ -32649,14 +32879,14 @@ function InventoryPanel({
32649
32879
  showTooltips && hoveredItem && /* @__PURE__ */ jsxs(
32650
32880
  "div",
32651
32881
  {
32652
- className: "fixed z-50 bg-gray-900 border border-gray-600 rounded-lg p-2 shadow-lg pointer-events-none",
32882
+ className: "fixed z-50 bg-[var(--color-card)] border border-gray-600 rounded-lg p-2 shadow-lg pointer-events-none",
32653
32883
  style: {
32654
32884
  left: tooltipPosition.x,
32655
32885
  top: tooltipPosition.y,
32656
32886
  maxWidth: 200
32657
32887
  },
32658
32888
  children: [
32659
- /* @__PURE__ */ jsx("div", { className: "font-semibold text-white", children: hoveredItem.name || hoveredItem.type }),
32889
+ /* @__PURE__ */ jsx("div", { className: "font-semibold text-[var(--color-foreground)]", children: hoveredItem.name || hoveredItem.type }),
32660
32890
  hoveredItem.description && /* @__PURE__ */ jsx("div", { className: "text-sm text-gray-400 mt-1", children: hoveredItem.description }),
32661
32891
  /* @__PURE__ */ jsxs("div", { className: "text-xs text-gray-500 mt-1", children: [
32662
32892
  "Quantity: ",
@@ -32672,9 +32902,9 @@ function InventoryPanel({
32672
32902
  init_cn();
32673
32903
  init_useEventBus();
32674
32904
  var variantMap3 = {
32675
- primary: "bg-blue-600 hover:bg-blue-500 text-white border-blue-400 shadow-lg shadow-blue-500/25",
32676
- secondary: "bg-gray-700 hover:bg-gray-600 text-white border-gray-500",
32677
- ghost: "bg-transparent hover:bg-white/10 text-white border-white/20"
32905
+ primary: "bg-[var(--color-primary)] hover:bg-blue-500 text-[var(--color-primary-foreground)] border-blue-400 shadow-lg shadow-blue-500/25",
32906
+ secondary: "bg-[var(--color-surface,#374151)] hover:bg-gray-600 text-[var(--color-foreground)] border-gray-500",
32907
+ ghost: "bg-transparent hover:bg-white/10 text-[var(--color-foreground)] border-white/20"
32678
32908
  };
32679
32909
  function GameMenu({
32680
32910
  title,
@@ -32694,7 +32924,7 @@ function GameMenu({
32694
32924
  } catch {
32695
32925
  }
32696
32926
  const eventBus = eventBusProp || eventBusFromHook;
32697
- const handleOptionClick = React124.useCallback(
32927
+ const handleOptionClick = React125.useCallback(
32698
32928
  (option) => {
32699
32929
  if (option.event && eventBus) {
32700
32930
  eventBus.emit(`UI:${option.event}`, { option });
@@ -32731,7 +32961,7 @@ function GameMenu({
32731
32961
  /* @__PURE__ */ jsx(
32732
32962
  "h1",
32733
32963
  {
32734
- className: "text-5xl md:text-7xl font-bold text-white tracking-tight",
32964
+ className: "text-5xl md:text-7xl font-bold text-[var(--color-foreground)] tracking-tight",
32735
32965
  style: {
32736
32966
  textShadow: "0 4px 12px rgba(0,0,0,0.5)"
32737
32967
  },
@@ -32791,9 +33021,9 @@ var variantColors = {
32791
33021
  }
32792
33022
  };
32793
33023
  var buttonVariants = {
32794
- primary: "bg-blue-600 hover:bg-blue-500 text-white border-blue-400",
32795
- secondary: "bg-gray-700 hover:bg-gray-600 text-white border-gray-500",
32796
- ghost: "bg-transparent hover:bg-white/10 text-white border-white/20"
33024
+ primary: "bg-[var(--color-primary)] hover:bg-blue-500 text-[var(--color-primary-foreground)] border-blue-400",
33025
+ secondary: "bg-[var(--color-surface,#374151)] hover:bg-gray-600 text-[var(--color-foreground)] border-gray-500",
33026
+ ghost: "bg-transparent hover:bg-white/10 text-[var(--color-foreground)] border-white/20"
32797
33027
  };
32798
33028
  function formatTime3(ms) {
32799
33029
  const seconds = Math.floor(ms / 1e3);
@@ -32821,7 +33051,7 @@ function GameOverScreen({
32821
33051
  } catch {
32822
33052
  }
32823
33053
  const eventBus = eventBusProp || eventBusFromHook;
32824
- const handleActionClick = React124.useCallback(
33054
+ const handleActionClick = React125.useCallback(
32825
33055
  (action) => {
32826
33056
  if (action.event && eventBus) {
32827
33057
  eventBus.emit(`UI:${action.event}`, { action });
@@ -32874,7 +33104,7 @@ function GameOverScreen({
32874
33104
  }
32875
33105
  return /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
32876
33106
  /* @__PURE__ */ jsx("div", { className: "text-gray-400 text-sm mb-1", children: stat.label }),
32877
- /* @__PURE__ */ jsxs("div", { className: "text-white text-2xl font-bold flex items-center justify-center gap-2", children: [
33107
+ /* @__PURE__ */ jsxs("div", { className: "text-[var(--color-foreground)] text-2xl font-bold flex items-center justify-center gap-2", children: [
32878
33108
  stat.icon && /* @__PURE__ */ jsx("span", { children: stat.icon }),
32879
33109
  /* @__PURE__ */ jsx("span", { className: "tabular-nums", children: displayValue })
32880
33110
  ] })
@@ -34069,7 +34299,7 @@ var Lightbox = ({
34069
34299
  className: cn(
34070
34300
  "absolute top-4 right-4 z-10",
34071
34301
  "p-2 rounded-full",
34072
- "text-white bg-black bg-opacity-50",
34302
+ "text-[var(--color-foreground)] bg-[var(--color-card)]",
34073
34303
  "hover:bg-opacity-70 transition-opacity",
34074
34304
  "focus:outline-none focus:ring-2 focus:ring-white"
34075
34305
  ),
@@ -34088,7 +34318,7 @@ var Lightbox = ({
34088
34318
  className: cn(
34089
34319
  "absolute left-4 z-10",
34090
34320
  "p-2 rounded-full",
34091
- "text-white bg-black bg-opacity-50",
34321
+ "text-[var(--color-foreground)] bg-[var(--color-card)]",
34092
34322
  "hover:bg-opacity-70 transition-opacity",
34093
34323
  "focus:outline-none focus:ring-2 focus:ring-white"
34094
34324
  ),
@@ -34125,7 +34355,7 @@ var Lightbox = ({
34125
34355
  className: cn(
34126
34356
  "absolute right-4 z-10",
34127
34357
  "p-2 rounded-full",
34128
- "text-white bg-black bg-opacity-50",
34358
+ "text-[var(--color-foreground)] bg-[var(--color-card)]",
34129
34359
  "hover:bg-opacity-70 transition-opacity",
34130
34360
  "focus:outline-none focus:ring-2 focus:ring-white"
34131
34361
  ),
@@ -34134,12 +34364,12 @@ var Lightbox = ({
34134
34364
  }
34135
34365
  ),
34136
34366
  /* @__PURE__ */ jsxs("div", { className: "absolute bottom-4 left-0 right-0 text-center", children: [
34137
- showCounter && safeImages.length > 1 && /* @__PURE__ */ jsxs("div", { className: "text-white text-sm mb-1", children: [
34367
+ showCounter && safeImages.length > 1 && /* @__PURE__ */ jsxs("div", { className: "text-[var(--color-foreground)] text-sm mb-1", children: [
34138
34368
  index + 1,
34139
34369
  " of ",
34140
34370
  safeImages.length
34141
34371
  ] }),
34142
- currentImage?.caption && /* @__PURE__ */ jsx("div", { className: "text-white text-sm opacity-80 px-8", children: currentImage.caption })
34372
+ currentImage?.caption && /* @__PURE__ */ jsx("div", { className: "text-[var(--color-foreground)] text-sm opacity-80 px-8", children: currentImage.caption })
34143
34373
  ] })
34144
34374
  ]
34145
34375
  }
@@ -36226,7 +36456,7 @@ var DocumentViewer = ({
36226
36456
  DocumentViewer.displayName = "DocumentViewer";
36227
36457
  init_useEventBus();
36228
36458
  function extractTitle(children) {
36229
- if (!React124__default.isValidElement(children)) return void 0;
36459
+ if (!React125__default.isValidElement(children)) return void 0;
36230
36460
  const props = children.props;
36231
36461
  if (typeof props.title === "string") {
36232
36462
  return props.title;
@@ -36286,7 +36516,7 @@ function LinearView({
36286
36516
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
36287
36517
  const isDone = i < currentIdx;
36288
36518
  const isCurrent = i === currentIdx;
36289
- return /* @__PURE__ */ jsxs(React124__default.Fragment, { children: [
36519
+ return /* @__PURE__ */ jsxs(React125__default.Fragment, { children: [
36290
36520
  i > 0 && /* @__PURE__ */ jsx(
36291
36521
  Typography,
36292
36522
  {
@@ -36962,7 +37192,7 @@ var Form = ({
36962
37192
  const normalizedInitialData = initialData ?? {};
36963
37193
  const resolvedEntity = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
36964
37194
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
36965
- const entityDerivedFields = React124__default.useMemo(() => {
37195
+ const entityDerivedFields = React125__default.useMemo(() => {
36966
37196
  if (fields && fields.length > 0) return void 0;
36967
37197
  if (!resolvedEntity) return void 0;
36968
37198
  return resolvedEntity.fields.map(
@@ -36981,14 +37211,14 @@ var Form = ({
36981
37211
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
36982
37212
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
36983
37213
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
36984
- const [formData, setFormData] = React124__default.useState(
37214
+ const [formData, setFormData] = React125__default.useState(
36985
37215
  normalizedInitialData
36986
37216
  );
36987
- const [collapsedSections, setCollapsedSections] = React124__default.useState(
37217
+ const [collapsedSections, setCollapsedSections] = React125__default.useState(
36988
37218
  /* @__PURE__ */ new Set()
36989
37219
  );
36990
37220
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
36991
- const evalContext = React124__default.useMemo(
37221
+ const evalContext = React125__default.useMemo(
36992
37222
  () => ({
36993
37223
  formValues: formData,
36994
37224
  globalVariables: externalContext?.globalVariables ?? {},
@@ -36997,13 +37227,13 @@ var Form = ({
36997
37227
  }),
36998
37228
  [formData, externalContext]
36999
37229
  );
37000
- React124__default.useEffect(() => {
37230
+ React125__default.useEffect(() => {
37001
37231
  const data = initialData;
37002
37232
  if (data && Object.keys(data).length > 0) {
37003
37233
  setFormData(data);
37004
37234
  }
37005
37235
  }, [initialData]);
37006
- const processCalculations = React124__default.useCallback(
37236
+ const processCalculations = React125__default.useCallback(
37007
37237
  (changedFieldId, newFormData) => {
37008
37238
  if (!hiddenCalculations.length) return;
37009
37239
  const context = {
@@ -37028,7 +37258,7 @@ var Form = ({
37028
37258
  },
37029
37259
  [hiddenCalculations, externalContext, eventBus]
37030
37260
  );
37031
- const checkViolations = React124__default.useCallback(
37261
+ const checkViolations = React125__default.useCallback(
37032
37262
  (changedFieldId, newFormData) => {
37033
37263
  if (!violationTriggers.length) return;
37034
37264
  const context = {
@@ -37065,7 +37295,7 @@ var Form = ({
37065
37295
  processCalculations(name, newFormData);
37066
37296
  checkViolations(name, newFormData);
37067
37297
  };
37068
- const isFieldVisible = React124__default.useCallback(
37298
+ const isFieldVisible = React125__default.useCallback(
37069
37299
  (fieldName) => {
37070
37300
  const condition = conditionalFields[fieldName];
37071
37301
  if (!condition) return true;
@@ -37073,7 +37303,7 @@ var Form = ({
37073
37303
  },
37074
37304
  [conditionalFields, evalContext]
37075
37305
  );
37076
- const isSectionVisible = React124__default.useCallback(
37306
+ const isSectionVisible = React125__default.useCallback(
37077
37307
  (section) => {
37078
37308
  if (!section.condition) return true;
37079
37309
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -37105,7 +37335,7 @@ var Form = ({
37105
37335
  eventBus.emit(`UI:${onCancel}`);
37106
37336
  }
37107
37337
  };
37108
- const renderField = React124__default.useCallback(
37338
+ const renderField = React125__default.useCallback(
37109
37339
  (field) => {
37110
37340
  const fieldName = field.name || field.field;
37111
37341
  if (!fieldName) return null;
@@ -37126,7 +37356,7 @@ var Form = ({
37126
37356
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
37127
37357
  );
37128
37358
  const effectiveFields = entityDerivedFields ?? fields;
37129
- const normalizedFields = React124__default.useMemo(() => {
37359
+ const normalizedFields = React125__default.useMemo(() => {
37130
37360
  if (!effectiveFields || effectiveFields.length === 0) return [];
37131
37361
  return effectiveFields.map((field) => {
37132
37362
  if (typeof field === "string") {
@@ -37148,7 +37378,7 @@ var Form = ({
37148
37378
  return field;
37149
37379
  });
37150
37380
  }, [effectiveFields, resolvedEntity]);
37151
- const schemaFields = React124__default.useMemo(() => {
37381
+ const schemaFields = React125__default.useMemo(() => {
37152
37382
  if (normalizedFields.length === 0) return null;
37153
37383
  if (isDebugEnabled()) {
37154
37384
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -37158,7 +37388,7 @@ var Form = ({
37158
37388
  }
37159
37389
  return normalizedFields.map(renderField).filter(Boolean);
37160
37390
  }, [normalizedFields, renderField, entityName, conditionalFields]);
37161
- const sectionElements = React124__default.useMemo(() => {
37391
+ const sectionElements = React125__default.useMemo(() => {
37162
37392
  if (!sections || sections.length === 0) return null;
37163
37393
  return sections.map((section) => {
37164
37394
  if (!isSectionVisible(section)) {
@@ -38596,7 +38826,7 @@ var List2 = ({
38596
38826
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
38597
38827
  return [];
38598
38828
  }, [entity]);
38599
- const getItemActions = React124__default.useCallback(
38829
+ const getItemActions = React125__default.useCallback(
38600
38830
  (item) => {
38601
38831
  if (!itemActions) return [];
38602
38832
  if (typeof itemActions === "function") {
@@ -39031,7 +39261,7 @@ var MediaGallery = ({
39031
39261
  [selectable, selectedItems, selectionEvent, eventBus]
39032
39262
  );
39033
39263
  const entityData = Array.isArray(entity) ? entity : [];
39034
- const items = React124__default.useMemo(() => {
39264
+ const items = React125__default.useMemo(() => {
39035
39265
  if (propItems) return propItems;
39036
39266
  if (entityData.length === 0) return [];
39037
39267
  return entityData.map((record, idx) => ({
@@ -39194,7 +39424,7 @@ var MediaGallery = ({
39194
39424
  MediaGallery.displayName = "MediaGallery";
39195
39425
  init_useEventBus();
39196
39426
  function extractTitle2(children) {
39197
- if (!React124__default.isValidElement(children)) return void 0;
39427
+ if (!React125__default.isValidElement(children)) return void 0;
39198
39428
  const props = children.props;
39199
39429
  if (typeof props.title === "string") {
39200
39430
  return props.title;
@@ -39880,7 +40110,7 @@ var PageHeader = ({
39880
40110
  info: "bg-info/10 text-info"
39881
40111
  };
39882
40112
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
39883
- 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(React124__default.Fragment, { children: [
40113
+ 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(React125__default.Fragment, { children: [
39884
40114
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
39885
40115
  crumb.href ? /* @__PURE__ */ jsx(
39886
40116
  "a",
@@ -39972,24 +40202,24 @@ init_cn();
39972
40202
  // lib/traitRegistry.ts
39973
40203
  var traits = /* @__PURE__ */ new Map();
39974
40204
  var listeners = /* @__PURE__ */ new Set();
39975
- function notifyListeners2() {
40205
+ function notifyListeners3() {
39976
40206
  listeners.forEach((listener) => listener());
39977
40207
  }
39978
40208
  function registerTrait(info) {
39979
40209
  traits.set(info.id, info);
39980
- notifyListeners2();
40210
+ notifyListeners3();
39981
40211
  }
39982
40212
  function updateTraitState(id, newState) {
39983
40213
  const trait = traits.get(id);
39984
40214
  if (trait) {
39985
40215
  trait.currentState = newState;
39986
40216
  trait.transitionCount++;
39987
- notifyListeners2();
40217
+ notifyListeners3();
39988
40218
  }
39989
40219
  }
39990
40220
  function unregisterTrait(id) {
39991
40221
  traits.delete(id);
39992
- notifyListeners2();
40222
+ notifyListeners3();
39993
40223
  }
39994
40224
  function getAllTraits() {
39995
40225
  return Array.from(traits.values());
@@ -40039,7 +40269,7 @@ function subscribeToDebugEvents(listener) {
40039
40269
 
40040
40270
  // components/organisms/debug/hooks/useDebugData.ts
40041
40271
  function useDebugData() {
40042
- const [data, setData] = React124.useState(() => ({
40272
+ const [data, setData] = React125.useState(() => ({
40043
40273
  traits: [],
40044
40274
  ticks: [],
40045
40275
  guards: [],
@@ -40053,7 +40283,7 @@ function useDebugData() {
40053
40283
  },
40054
40284
  lastUpdate: Date.now()
40055
40285
  }));
40056
- React124.useEffect(() => {
40286
+ React125.useEffect(() => {
40057
40287
  const updateData = () => {
40058
40288
  setData({
40059
40289
  traits: getAllTraits(),
@@ -40110,6 +40340,259 @@ function onDebugToggle(listener) {
40110
40340
  // components/organisms/debug/RuntimeDebugger.tsx
40111
40341
  init_Typography();
40112
40342
 
40343
+ // components/organisms/debug/WalkMinimap.tsx
40344
+ init_Box();
40345
+ init_Stack();
40346
+ init_Typography();
40347
+ function layoutGraph(states, transitions, initialState, width, height) {
40348
+ if (states.length === 0) return [];
40349
+ const layers = /* @__PURE__ */ new Map();
40350
+ const queue = [initialState];
40351
+ layers.set(initialState, 0);
40352
+ while (queue.length > 0) {
40353
+ const current = queue.shift();
40354
+ const layer = layers.get(current);
40355
+ for (const tr of transitions) {
40356
+ if (tr.from === current && !layers.has(tr.to)) {
40357
+ layers.set(tr.to, layer + 1);
40358
+ queue.push(tr.to);
40359
+ }
40360
+ }
40361
+ }
40362
+ for (const s of states) {
40363
+ if (!layers.has(s)) layers.set(s, layers.size > 0 ? Math.max(...layers.values()) + 1 : 0);
40364
+ }
40365
+ const layerGroups = /* @__PURE__ */ new Map();
40366
+ for (const [state, layer] of layers) {
40367
+ const group = layerGroups.get(layer) ?? [];
40368
+ group.push(state);
40369
+ layerGroups.set(layer, group);
40370
+ }
40371
+ const maxLayer = Math.max(...layerGroups.keys(), 0);
40372
+ const padX = 24;
40373
+ const padY = 20;
40374
+ const usableW = width - padX * 2;
40375
+ const usableH = height - padY * 2;
40376
+ const positions = [];
40377
+ for (const [layer, group] of layerGroups) {
40378
+ const y = maxLayer === 0 ? usableH / 2 + padY : padY + layer / maxLayer * usableH;
40379
+ for (let i = 0; i < group.length; i++) {
40380
+ const x = group.length === 1 ? width / 2 : padX + i / (group.length - 1) * usableW;
40381
+ positions.push({ x, y, state: group[i] });
40382
+ }
40383
+ }
40384
+ return positions;
40385
+ }
40386
+ function WalkMinimap() {
40387
+ const [walkStep, setWalkStep] = React125.useState(null);
40388
+ const [traits2, setTraits] = React125.useState([]);
40389
+ const [coveredEdges, setCoveredEdges] = React125.useState([]);
40390
+ const [completedTraits, setCompletedTraits] = React125.useState(/* @__PURE__ */ new Set());
40391
+ const prevTraitRef = React125.useRef(null);
40392
+ React125.useEffect(() => {
40393
+ const interval = setInterval(() => {
40394
+ const w = window;
40395
+ const step = w.__orbitalWalkStep;
40396
+ const traitConfigs = w.__orbitalWalkTraits;
40397
+ const edges = w.__orbitalCoveredEdges;
40398
+ if (step) setWalkStep(step);
40399
+ if (traitConfigs) setTraits(traitConfigs);
40400
+ if (edges) setCoveredEdges(edges);
40401
+ if (step && prevTraitRef.current && prevTraitRef.current !== step.traitName) {
40402
+ setCompletedTraits((prev) => new Set(prev).add(prevTraitRef.current));
40403
+ }
40404
+ if (step) prevTraitRef.current = step.traitName;
40405
+ }, 250);
40406
+ return () => clearInterval(interval);
40407
+ }, []);
40408
+ if (!walkStep || traits2.length === 0) return null;
40409
+ const activeTrait = traits2.find((t) => t.name === walkStep.traitName);
40410
+ const engineCount = coveredEdges.filter((e) => e.phase === "engine").length;
40411
+ const domCount = coveredEdges.filter((e) => e.phase === "dom").length;
40412
+ const totalTransitions = traits2.reduce((sum, t) => sum + t.transitions.length, 0);
40413
+ const activeEdgeKeys = new Set(
40414
+ coveredEdges.filter((e) => e.trait === walkStep.traitName).map((e) => `${e.from}+${e.event}->${e.to}`)
40415
+ );
40416
+ const activeEdgePhases = new Map(
40417
+ coveredEdges.filter((e) => e.trait === walkStep.traitName).map((e) => [`${e.from}+${e.event}->${e.to}`, e.phase])
40418
+ );
40419
+ const currentEdgeKey = `${walkStep.from}+${walkStep.event}->${walkStep.to}`;
40420
+ const graphW = 260;
40421
+ const graphH = 120;
40422
+ const nodeR = 10;
40423
+ const positions = activeTrait ? layoutGraph(activeTrait.states, activeTrait.transitions, activeTrait.initialState, graphW, graphH) : [];
40424
+ const posMap = new Map(positions.map((p2) => [p2.state, p2]));
40425
+ const visitedStates = new Set(
40426
+ coveredEdges.filter((e) => e.trait === walkStep.traitName).flatMap((e) => [e.from, e.to])
40427
+ );
40428
+ return /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "w-64 flex-shrink-0 border-l border-border bg-[var(--color-card)] overflow-hidden", children: [
40429
+ /* @__PURE__ */ jsx(Box, { className: "px-2 py-1.5 border-b border-border overflow-x-auto", children: /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-nowrap", children: traits2.map((t) => {
40430
+ const isDone = completedTraits.has(t.name);
40431
+ const isActive = t.name === walkStep.traitName;
40432
+ const variant = isDone ? "success" : isActive ? "info" : "neutral";
40433
+ const shortName = t.name.replace(/^[A-Z][a-z]+/, "");
40434
+ return /* @__PURE__ */ jsxs(
40435
+ Badge,
40436
+ {
40437
+ variant,
40438
+ size: "sm",
40439
+ className: `flex-shrink-0 text-[9px] ${isActive ? "ring-1 ring-cyan-400" : ""}`,
40440
+ children: [
40441
+ isDone ? "\u2713" : isActive ? "\u25CF" : "\u25CB",
40442
+ " ",
40443
+ shortName || t.name
40444
+ ]
40445
+ },
40446
+ t.name
40447
+ );
40448
+ }) }) }),
40449
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 flex items-center justify-center px-1 py-1", children: activeTrait && /* @__PURE__ */ jsxs("svg", { width: graphW, height: graphH, viewBox: `0 0 ${graphW} ${graphH}`, children: [
40450
+ /* @__PURE__ */ jsxs("defs", { children: [
40451
+ /* @__PURE__ */ jsx("marker", { id: "mm-arrow", markerWidth: "6", markerHeight: "4", refX: "6", refY: "2", orient: "auto", children: /* @__PURE__ */ jsx("path", { d: "M0,0 L6,2 L0,4", fill: "#888" }) }),
40452
+ /* @__PURE__ */ jsx("marker", { id: "mm-arrow-green", markerWidth: "6", markerHeight: "4", refX: "6", refY: "2", orient: "auto", children: /* @__PURE__ */ jsx("path", { d: "M0,0 L6,2 L0,4", fill: "#22c55e" }) }),
40453
+ /* @__PURE__ */ jsx("marker", { id: "mm-arrow-cyan", markerWidth: "6", markerHeight: "4", refX: "6", refY: "2", orient: "auto", children: /* @__PURE__ */ jsx("path", { d: "M0,0 L6,2 L0,4", fill: "#06b6d4" }) }),
40454
+ /* @__PURE__ */ jsx("marker", { id: "mm-arrow-yellow", markerWidth: "6", markerHeight: "4", refX: "6", refY: "2", orient: "auto", children: /* @__PURE__ */ jsx("path", { d: "M0,0 L6,2 L0,4", fill: "#eab308" }) })
40455
+ ] }),
40456
+ activeTrait.transitions.map((tr, i) => {
40457
+ const fromPos = posMap.get(tr.from);
40458
+ const toPos = posMap.get(tr.to);
40459
+ if (!fromPos || !toPos) return null;
40460
+ const key = `${tr.from}+${tr.event}->${tr.to}`;
40461
+ const isCurrent = key === currentEdgeKey && !walkStep.isRepositioning;
40462
+ const isCovered = activeEdgeKeys.has(key);
40463
+ const phase = activeEdgePhases.get(key);
40464
+ let stroke = "#555";
40465
+ let markerEnd = "url(#mm-arrow)";
40466
+ let strokeWidth = 1;
40467
+ let opacity = 0.4;
40468
+ if (isCurrent) {
40469
+ stroke = "#eab308";
40470
+ markerEnd = "url(#mm-arrow-yellow)";
40471
+ strokeWidth = 2.5;
40472
+ opacity = 1;
40473
+ } else if (isCovered && phase === "dom") {
40474
+ stroke = "#06b6d4";
40475
+ markerEnd = "url(#mm-arrow-cyan)";
40476
+ strokeWidth = 1.5;
40477
+ opacity = 0.9;
40478
+ } else if (isCovered) {
40479
+ stroke = "#22c55e";
40480
+ markerEnd = "url(#mm-arrow-green)";
40481
+ strokeWidth = 1.5;
40482
+ opacity = 0.9;
40483
+ }
40484
+ if (tr.from === tr.to) {
40485
+ const cx = fromPos.x;
40486
+ const cy = fromPos.y - nodeR - 8;
40487
+ return /* @__PURE__ */ jsxs("g", { children: [
40488
+ /* @__PURE__ */ jsx(
40489
+ "path",
40490
+ {
40491
+ d: `M${cx - 5},${fromPos.y - nodeR} C${cx - 18},${cy - 14} ${cx + 18},${cy - 14} ${cx + 5},${fromPos.y - nodeR}`,
40492
+ fill: "none",
40493
+ stroke,
40494
+ strokeWidth,
40495
+ opacity,
40496
+ markerEnd
40497
+ }
40498
+ ),
40499
+ /* @__PURE__ */ jsx("text", { x: cx, y: cy - 12, textAnchor: "middle", fontSize: "7", fill: stroke, opacity, children: tr.event.length > 10 ? tr.event.slice(0, 8) + ".." : tr.event })
40500
+ ] }, `e-${i}`);
40501
+ }
40502
+ const dx = toPos.x - fromPos.x;
40503
+ const dy = toPos.y - fromPos.y;
40504
+ const len = Math.sqrt(dx * dx + dy * dy) || 1;
40505
+ const nx = -dy / len;
40506
+ const ny = dx / len;
40507
+ const hasReverse = activeTrait.transitions.some(
40508
+ (t2) => t2.from === tr.to && t2.to === tr.from
40509
+ );
40510
+ const offset = hasReverse ? 4 : 0;
40511
+ const x1 = fromPos.x + dx / len * nodeR + nx * offset;
40512
+ const y1 = fromPos.y + dy / len * nodeR + ny * offset;
40513
+ const x2 = toPos.x - dx / len * (nodeR + 6) + nx * offset;
40514
+ const y2 = toPos.y - dy / len * (nodeR + 6) + ny * offset;
40515
+ const mx = (x1 + x2) / 2 + nx * 8;
40516
+ const my = (y1 + y2) / 2 + ny * 8;
40517
+ return /* @__PURE__ */ jsxs("g", { children: [
40518
+ /* @__PURE__ */ jsx(
40519
+ "line",
40520
+ {
40521
+ x1,
40522
+ y1,
40523
+ x2,
40524
+ y2,
40525
+ stroke,
40526
+ strokeWidth,
40527
+ opacity,
40528
+ markerEnd,
40529
+ children: isCurrent && /* @__PURE__ */ jsx("animate", { attributeName: "opacity", values: "1;0.4;1", dur: "0.8s", repeatCount: "indefinite" })
40530
+ }
40531
+ ),
40532
+ /* @__PURE__ */ jsx("text", { x: mx, y: my, textAnchor: "middle", fontSize: "7", fill: stroke, opacity: Math.min(opacity + 0.2, 1), children: tr.event.length > 12 ? tr.event.slice(0, 10) + ".." : tr.event })
40533
+ ] }, `e-${i}`);
40534
+ }),
40535
+ positions.map((pos) => {
40536
+ const isCurrentState = pos.state === walkStep.from || pos.state === walkStep.to;
40537
+ const isVisited = visitedStates.has(pos.state);
40538
+ const isInitial = pos.state === activeTrait.initialState;
40539
+ let fill = "#333";
40540
+ let strokeColor = "#555";
40541
+ let sw = 1;
40542
+ if (isCurrentState) {
40543
+ fill = "#1e40af";
40544
+ strokeColor = "#3b82f6";
40545
+ sw = 2;
40546
+ } else if (isVisited) {
40547
+ fill = "#166534";
40548
+ strokeColor = "#22c55e";
40549
+ sw = 1.5;
40550
+ }
40551
+ return /* @__PURE__ */ jsxs("g", { children: [
40552
+ isInitial && /* @__PURE__ */ jsx("circle", { cx: pos.x, cy: pos.y, r: nodeR + 3, fill: "none", stroke: "#3b82f6", strokeWidth: 1, opacity: 0.4 }),
40553
+ /* @__PURE__ */ jsx(
40554
+ "circle",
40555
+ {
40556
+ cx: pos.x,
40557
+ cy: pos.y,
40558
+ r: nodeR,
40559
+ fill,
40560
+ stroke: strokeColor,
40561
+ strokeWidth: sw,
40562
+ children: isCurrentState && /* @__PURE__ */ jsx("animate", { attributeName: "r", values: `${nodeR};${nodeR + 2};${nodeR}`, dur: "1s", repeatCount: "indefinite" })
40563
+ }
40564
+ ),
40565
+ /* @__PURE__ */ jsx(
40566
+ "text",
40567
+ {
40568
+ x: pos.x,
40569
+ y: pos.y + nodeR + 10,
40570
+ textAnchor: "middle",
40571
+ fontSize: "8",
40572
+ fill: "#aaa",
40573
+ children: pos.state.length > 10 ? pos.state.slice(0, 8) + ".." : pos.state
40574
+ }
40575
+ )
40576
+ ] }, pos.state);
40577
+ })
40578
+ ] }) }),
40579
+ /* @__PURE__ */ jsx(Box, { className: "px-2 py-1 border-t border-border", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center justify-between", children: [
40580
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-[10px] font-mono text-green-500", children: [
40581
+ "Engine: ",
40582
+ engineCount,
40583
+ "/",
40584
+ totalTransitions
40585
+ ] }),
40586
+ domCount > 0 && /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-[10px] font-mono text-cyan-500", children: [
40587
+ "DOM: ",
40588
+ domCount
40589
+ ] }),
40590
+ /* @__PURE__ */ jsx(Badge, { variant: walkStep.phase === "engine" ? "info" : "warning", size: "sm", className: "text-[9px]", children: walkStep.phase === "engine" ? "Engine" : "DOM" })
40591
+ ] }) })
40592
+ ] });
40593
+ }
40594
+ WalkMinimap.displayName = "WalkMinimap";
40595
+
40113
40596
  // components/organisms/debug/tabs/TraitsTab.tsx
40114
40597
  init_Typography();
40115
40598
  init_Stack();
@@ -40338,15 +40821,15 @@ var TYPE_BADGES = {
40338
40821
  state: { variant: "danger", icon: "\u{1F4CA}" }
40339
40822
  };
40340
40823
  function EventFlowTab({ events: events2 }) {
40341
- const [filter, setFilter] = React124.useState("all");
40342
- const containerRef = React124.useRef(null);
40343
- const [autoScroll, setAutoScroll] = React124.useState(true);
40344
- React124.useEffect(() => {
40824
+ const [filter, setFilter] = React125.useState("all");
40825
+ const containerRef = React125.useRef(null);
40826
+ const [autoScroll, setAutoScroll] = React125.useState(true);
40827
+ React125.useEffect(() => {
40345
40828
  if (autoScroll && containerRef.current) {
40346
40829
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
40347
40830
  }
40348
40831
  }, [events2.length, autoScroll]);
40349
- const filteredEvents = React124.useMemo(() => {
40832
+ const filteredEvents = React125.useMemo(() => {
40350
40833
  if (filter === "all") return events2;
40351
40834
  return events2.filter((e) => e.type === filter);
40352
40835
  }, [events2, filter]);
@@ -40447,7 +40930,7 @@ EventFlowTab.displayName = "EventFlowTab";
40447
40930
  init_Typography();
40448
40931
  init_Stack();
40449
40932
  function GuardsPanel({ guards }) {
40450
- const [filter, setFilter] = React124.useState("all");
40933
+ const [filter, setFilter] = React125.useState("all");
40451
40934
  if (guards.length === 0) {
40452
40935
  return /* @__PURE__ */ jsx(
40453
40936
  EmptyState,
@@ -40460,7 +40943,7 @@ function GuardsPanel({ guards }) {
40460
40943
  }
40461
40944
  const passedCount = guards.filter((g) => g.result).length;
40462
40945
  const failedCount = guards.length - passedCount;
40463
- const filteredGuards = React124.useMemo(() => {
40946
+ const filteredGuards = React125.useMemo(() => {
40464
40947
  if (filter === "all") return guards;
40465
40948
  if (filter === "passed") return guards.filter((g) => g.result);
40466
40949
  return guards.filter((g) => !g.result);
@@ -40609,10 +41092,10 @@ function EffectBadge({ effect }) {
40609
41092
  ] });
40610
41093
  }
40611
41094
  function TransitionTimeline({ transitions }) {
40612
- const containerRef = React124.useRef(null);
40613
- const [autoScroll, setAutoScroll] = React124.useState(true);
40614
- const [expandedId, setExpandedId] = React124.useState(null);
40615
- React124.useEffect(() => {
41095
+ const containerRef = React125.useRef(null);
41096
+ const [autoScroll, setAutoScroll] = React125.useState(true);
41097
+ const [expandedId, setExpandedId] = React125.useState(null);
41098
+ React125.useEffect(() => {
40616
41099
  if (autoScroll && containerRef.current) {
40617
41100
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
40618
41101
  }
@@ -40880,9 +41363,9 @@ function getAllEvents(traits2) {
40880
41363
  }
40881
41364
  function EventDispatcherTab({ traits: traits2, schema }) {
40882
41365
  const eventBus = useEventBus();
40883
- const [log, setLog] = React124.useState([]);
40884
- const prevStatesRef = React124.useRef(/* @__PURE__ */ new Map());
40885
- React124.useEffect(() => {
41366
+ const [log, setLog] = React125.useState([]);
41367
+ const prevStatesRef = React125.useRef(/* @__PURE__ */ new Map());
41368
+ React125.useEffect(() => {
40886
41369
  for (const trait of traits2) {
40887
41370
  const prev = prevStatesRef.current.get(trait.id);
40888
41371
  if (prev && prev !== trait.currentState) {
@@ -40959,25 +41442,25 @@ function EventDispatcherTab({ traits: traits2, schema }) {
40959
41442
  EventDispatcherTab.displayName = "EventDispatcherTab";
40960
41443
  function ServerResponseRow({ sr }) {
40961
41444
  const entityEntries = Object.entries(sr.dataEntities);
40962
- return /* @__PURE__ */ jsxs("div", { className: "ml-4 pl-2 border-l border-purple-700/50 py-0.5 text-[10px] font-mono", children: [
41445
+ return /* @__PURE__ */ jsxs("div", { className: "ml-4 pl-2 border-l border-purple-500/30 py-0.5 text-[10px] font-mono", children: [
40963
41446
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
40964
- /* @__PURE__ */ jsxs("span", { className: sr.success ? "text-green-400" : "text-red-400", children: [
41447
+ /* @__PURE__ */ jsxs("span", { className: sr.success ? "text-green-600 dark:text-green-400" : "text-red-600 dark:text-red-400", children: [
40965
41448
  sr.success ? "\u2713" : "\u2717",
40966
41449
  " server"
40967
41450
  ] }),
40968
- /* @__PURE__ */ jsx("span", { className: "text-purple-300", children: sr.orbitalName }),
40969
- sr.clientEffects > 0 && /* @__PURE__ */ jsxs("span", { className: "px-1 rounded bg-purple-900/50 text-purple-300", children: [
41451
+ /* @__PURE__ */ jsx("span", { className: "text-purple-600 dark:text-purple-300", children: sr.orbitalName }),
41452
+ sr.clientEffects > 0 && /* @__PURE__ */ jsxs("span", { className: "px-1 rounded bg-purple-500/15 text-purple-600 dark:text-purple-300", children: [
40970
41453
  sr.clientEffects,
40971
41454
  " clientEffect",
40972
41455
  sr.clientEffects !== 1 ? "s" : ""
40973
41456
  ] }),
40974
- sr.emittedEvents.length > 0 && /* @__PURE__ */ jsxs("span", { className: "px-1 rounded bg-blue-900/50 text-blue-300", children: [
41457
+ sr.emittedEvents.length > 0 && /* @__PURE__ */ jsxs("span", { className: "px-1 rounded bg-blue-500/15 text-blue-300", children: [
40975
41458
  "emit: ",
40976
41459
  sr.emittedEvents.join(", ")
40977
41460
  ] }),
40978
- sr.error && /* @__PURE__ */ jsx("span", { className: "px-1 rounded bg-red-900/50 text-red-400 truncate max-w-[300px]", children: sr.error })
41461
+ sr.error && /* @__PURE__ */ jsx("span", { className: "px-1 rounded bg-red-500/15 text-red-600 dark:text-red-400 truncate max-w-[300px]", children: sr.error })
40979
41462
  ] }),
40980
- entityEntries.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 mt-0.5", children: entityEntries.map(([name, count]) => /* @__PURE__ */ jsxs("span", { className: "px-1 rounded bg-gray-800 text-gray-300", children: [
41463
+ entityEntries.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 mt-0.5", children: entityEntries.map(([name, count]) => /* @__PURE__ */ jsxs("span", { className: "px-1 rounded bg-[var(--color-card)] text-foreground", children: [
40981
41464
  name,
40982
41465
  ": ",
40983
41466
  count,
@@ -40990,24 +41473,24 @@ function TransitionRow({ trace }) {
40990
41473
  const isServerEntry = !!trace.serverResponse && trace.traitName.startsWith("server:");
40991
41474
  const hasFailedEffects = trace.effects.some((e) => e.status === "failed");
40992
41475
  if (isServerEntry && trace.serverResponse) {
40993
- return /* @__PURE__ */ jsxs("div", { className: "py-0.5 border-b border-gray-800 last:border-0", children: [
41476
+ return /* @__PURE__ */ jsxs("div", { className: "py-0.5 border-b border-border last:border-0", children: [
40994
41477
  /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 text-xs font-mono", children: [
40995
41478
  /* @__PURE__ */ jsx("span", { className: "mt-1.5 w-1.5 h-1.5 rounded-full flex-shrink-0 bg-purple-500" }),
40996
41479
  /* @__PURE__ */ jsx(Badge, { variant: "warning", size: "sm", className: "flex-shrink-0", children: trace.event }),
40997
- /* @__PURE__ */ jsx("span", { className: "text-purple-400 flex-shrink-0", children: "server response" })
41480
+ /* @__PURE__ */ jsx("span", { className: "text-purple-600 dark:text-purple-400 flex-shrink-0", children: "server response" })
40998
41481
  ] }),
40999
41482
  /* @__PURE__ */ jsx(ServerResponseRow, { sr: trace.serverResponse })
41000
41483
  ] });
41001
41484
  }
41002
- return /* @__PURE__ */ jsxs("div", { className: "py-0.5 border-b border-gray-800 last:border-0", children: [
41485
+ return /* @__PURE__ */ jsxs("div", { className: "py-0.5 border-b border-border last:border-0", children: [
41003
41486
  /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 text-xs font-mono", children: [
41004
41487
  /* @__PURE__ */ jsx("span", { className: cn(
41005
41488
  "mt-1.5 w-1.5 h-1.5 rounded-full flex-shrink-0",
41006
41489
  hasFailedEffects ? "bg-red-500" : "bg-green-500"
41007
41490
  ) }),
41008
41491
  /* @__PURE__ */ jsx(Badge, { variant: "info", size: "sm", className: "flex-shrink-0", children: trace.event }),
41009
- /* @__PURE__ */ jsx("span", { className: "text-gray-300 flex-shrink-0", children: trace.traitName }),
41010
- /* @__PURE__ */ jsxs("span", { className: "text-gray-400 flex-shrink-0", children: [
41492
+ /* @__PURE__ */ jsx("span", { className: "text-foreground flex-shrink-0", children: trace.traitName }),
41493
+ /* @__PURE__ */ jsxs("span", { className: "text-foreground/70 flex-shrink-0", children: [
41011
41494
  trace.from,
41012
41495
  " ",
41013
41496
  "\u2192",
@@ -41017,12 +41500,12 @@ function TransitionRow({ trace }) {
41017
41500
  ] }),
41018
41501
  trace.effects.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 ml-6 mt-0.5", children: trace.effects.map((eff, i) => /* @__PURE__ */ jsxs("span", { className: cn(
41019
41502
  "px-1 rounded text-[10px]",
41020
- eff.status === "executed" ? "bg-green-900/50 text-green-400" : eff.status === "failed" ? "bg-red-900/50 text-red-400" : "bg-yellow-900/50 text-yellow-400"
41503
+ eff.status === "executed" ? "bg-green-500/15 text-green-600 dark:text-green-400" : eff.status === "failed" ? "bg-red-500/15 text-red-600 dark:text-red-400" : "bg-yellow-500/15 text-yellow-600 dark:text-yellow-400"
41021
41504
  ), children: [
41022
41505
  eff.status === "executed" ? "\u2713" : eff.status === "failed" ? "\u2717" : "-",
41023
41506
  " ",
41024
41507
  eff.type,
41025
- eff.args.length > 0 && /* @__PURE__ */ jsx("span", { className: "text-gray-500 ml-0.5", children: JSON.stringify(eff.args).slice(0, 40) })
41508
+ eff.args.length > 0 && /* @__PURE__ */ jsx("span", { className: "text-foreground/50 ml-0.5", children: JSON.stringify(eff.args).slice(0, 40) })
41026
41509
  ] }, i)) }),
41027
41510
  trace.serverResponse && /* @__PURE__ */ jsx(ServerResponseRow, { sr: trace.serverResponse })
41028
41511
  ] });
@@ -41035,18 +41518,9 @@ function VerifyModePanel({
41035
41518
  serverCount,
41036
41519
  localCount
41037
41520
  }) {
41038
- const scrollRef = React124.useRef(null);
41039
- const prevCountRef = React124.useRef(0);
41040
- const [walkStep, setWalkStep] = React124.useState(null);
41041
- React124.useEffect(() => {
41042
- const interval = setInterval(() => {
41043
- const w = window;
41044
- const step = w.__orbitalWalkStep;
41045
- if (step) setWalkStep(step);
41046
- }, 300);
41047
- return () => clearInterval(interval);
41048
- }, []);
41049
- React124.useEffect(() => {
41521
+ const scrollRef = React125.useRef(null);
41522
+ const prevCountRef = React125.useRef(0);
41523
+ React125.useEffect(() => {
41050
41524
  if (transitions.length > prevCountRef.current && scrollRef.current) {
41051
41525
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
41052
41526
  }
@@ -41058,49 +41532,28 @@ function VerifyModePanel({
41058
41532
  {
41059
41533
  className: cn(
41060
41534
  "runtime-debugger runtime-debugger--verify",
41061
- "flex flex-col bg-gray-900 text-white border-t-2 border-cyan-500",
41535
+ "flex flex-col bg-[var(--color-card)] text-[var(--color-foreground)] border-t-2 border-cyan-500",
41062
41536
  hudBottom ? "" : "fixed bottom-0 left-0 right-0",
41063
41537
  className
41064
41538
  ),
41065
41539
  "data-testid": "debugger-verify",
41066
41540
  style: { height: "25vh", zIndex: hudBottom ? void 0 : 40 },
41067
41541
  children: [
41068
- /* @__PURE__ */ jsxs("div", { className: "px-3 py-1.5 flex items-center gap-3 text-xs font-mono border-b border-gray-700 flex-shrink-0", children: [
41542
+ /* @__PURE__ */ jsxs("div", { className: "px-3 py-1.5 flex items-center gap-3 text-xs font-mono border-b border-border flex-shrink-0", children: [
41069
41543
  /* @__PURE__ */ jsx(Badge, { variant: failedChecks > 0 ? "danger" : "success", size: "sm", children: failedChecks > 0 ? `${failedChecks} fail` : "OK" }),
41070
- /* @__PURE__ */ jsxs("span", { className: "text-gray-400", children: [
41544
+ /* @__PURE__ */ jsxs("span", { className: "text-foreground/70", children: [
41071
41545
  localCount,
41072
41546
  " local"
41073
41547
  ] }),
41074
- /* @__PURE__ */ jsxs("span", { className: "text-purple-400", children: [
41548
+ /* @__PURE__ */ jsxs("span", { className: "text-purple-600 dark:text-purple-400", children: [
41075
41549
  serverCount,
41076
41550
  " server"
41077
41551
  ] }),
41078
- traitStates && /* @__PURE__ */ jsx("span", { className: "text-cyan-400 truncate max-w-[400px]", children: traitStates })
41552
+ traitStates && /* @__PURE__ */ jsx("span", { className: "text-cyan-600 dark:text-cyan-400 truncate max-w-[400px]", children: traitStates })
41079
41553
  ] }),
41080
41554
  /* @__PURE__ */ jsxs("div", { className: "flex-1 flex overflow-hidden", children: [
41081
- /* @__PURE__ */ jsx("div", { ref: scrollRef, className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsx("div", { className: "px-2 py-1", children: transitions.length === 0 ? /* @__PURE__ */ jsx("div", { className: "text-gray-500 text-xs font-mono py-2 text-center", children: "Waiting for transitions..." }) : /* @__PURE__ */ jsx("div", { className: "space-y-0.5", children: transitions.map((trace) => /* @__PURE__ */ jsx(TransitionRow, { trace }, trace.id)) }) }) }),
41082
- walkStep && /* @__PURE__ */ jsxs("div", { className: "w-56 flex-shrink-0 border-l border-gray-700 px-2 py-1 text-xs font-mono overflow-y-auto", children: [
41083
- /* @__PURE__ */ jsxs("div", { className: "text-cyan-400 font-bold mb-1", children: [
41084
- "Walk Step ",
41085
- walkStep.stepIndex,
41086
- "/",
41087
- walkStep.stepTotal
41088
- ] }),
41089
- /* @__PURE__ */ jsx("div", { className: "text-gray-300 mb-1", children: walkStep.traitName }),
41090
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 mb-1", children: [
41091
- /* @__PURE__ */ jsx("span", { className: "text-yellow-300", children: walkStep.from }),
41092
- /* @__PURE__ */ jsx("span", { className: "text-gray-500", children: "--" }),
41093
- /* @__PURE__ */ jsx("span", { className: "text-green-300", children: walkStep.event }),
41094
- /* @__PURE__ */ jsx("span", { className: "text-gray-500", children: "-->" }),
41095
- /* @__PURE__ */ jsx("span", { className: "text-yellow-300", children: walkStep.to })
41096
- ] }),
41097
- walkStep.guardCase && /* @__PURE__ */ jsxs("div", { className: walkStep.guardCase === "pass" ? "text-green-400" : "text-red-400", children: [
41098
- "guard: ",
41099
- walkStep.guardCase
41100
- ] }),
41101
- walkStep.isRepositioning && /* @__PURE__ */ jsx("div", { className: "text-gray-500 italic", children: "repositioning" }),
41102
- /* @__PURE__ */ jsx("div", { className: walkStep.accepted ? "text-green-400 mt-1" : "text-red-400 mt-1", children: walkStep.accepted ? "\u2713 accepted" : "\u2717 rejected" })
41103
- ] })
41555
+ /* @__PURE__ */ jsx("div", { ref: scrollRef, className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsx("div", { className: "px-2 py-1", children: transitions.length === 0 ? /* @__PURE__ */ jsx("div", { className: "text-foreground/50 text-xs font-mono py-2 text-center", children: "Waiting for transitions..." }) : /* @__PURE__ */ jsx("div", { className: "space-y-0.5", children: transitions.map((trace) => /* @__PURE__ */ jsx(TransitionRow, { trace }, trace.id)) }) }) }),
41556
+ /* @__PURE__ */ jsx(WalkMinimap, {})
41104
41557
  ] })
41105
41558
  ]
41106
41559
  }
@@ -41115,10 +41568,10 @@ function RuntimeDebugger({
41115
41568
  defaultTab,
41116
41569
  schema
41117
41570
  }) {
41118
- const [isCollapsed, setIsCollapsed] = React124.useState(mode === "verify" ? true : defaultCollapsed);
41119
- const [isVisible, setIsVisible] = React124.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
41571
+ const [isCollapsed, setIsCollapsed] = React125.useState(mode === "verify" ? true : defaultCollapsed);
41572
+ const [isVisible, setIsVisible] = React125.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
41120
41573
  const debugData = useDebugData();
41121
- React124.useEffect(() => {
41574
+ React125.useEffect(() => {
41122
41575
  if (mode === "inline") return;
41123
41576
  return onDebugToggle((enabled) => {
41124
41577
  setIsVisible(enabled);
@@ -41127,7 +41580,7 @@ function RuntimeDebugger({
41127
41580
  }
41128
41581
  });
41129
41582
  }, [mode]);
41130
- React124.useEffect(() => {
41583
+ React125.useEffect(() => {
41131
41584
  if (mode === "inline") return;
41132
41585
  const handleKeyDown = (e) => {
41133
41586
  if (e.key === "`" && isVisible) {
@@ -41325,7 +41778,7 @@ function RuntimeDebugger({
41325
41778
  className: "runtime-debugger__tabs"
41326
41779
  }
41327
41780
  ) }),
41328
- /* @__PURE__ */ jsx("div", { className: "runtime-debugger__footer", children: /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500", children: "Press ` to toggle | window.__orbitalVerification for automation" }) })
41781
+ /* @__PURE__ */ jsx("div", { className: "runtime-debugger__footer", children: /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-foreground/50", children: "Press ` to toggle | window.__orbitalVerification for automation" }) })
41329
41782
  ] })
41330
41783
  }
41331
41784
  );
@@ -41645,7 +42098,7 @@ function SequenceBar({
41645
42098
  onSlotRemove(index);
41646
42099
  }, [onSlotRemove, playing]);
41647
42100
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
41648
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React124__default.Fragment, { children: [
42101
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React125__default.Fragment, { children: [
41649
42102
  i > 0 && /* @__PURE__ */ jsx(
41650
42103
  Typography,
41651
42104
  {
@@ -41768,7 +42221,7 @@ function SequencerBoard({
41768
42221
  setPlayState("playing");
41769
42222
  setCurrentStep(0);
41770
42223
  let step = 0;
41771
- const advance2 = () => {
42224
+ const advance = () => {
41772
42225
  step++;
41773
42226
  if (step >= entity.maxSlots) {
41774
42227
  const playerSeq = slots.map((s) => s?.id);
@@ -41799,10 +42252,10 @@ function SequencerBoard({
41799
42252
  }
41800
42253
  } else {
41801
42254
  setCurrentStep(step);
41802
- timerRef.current = setTimeout(advance2, stepDurationMs);
42255
+ timerRef.current = setTimeout(advance, stepDurationMs);
41803
42256
  }
41804
42257
  };
41805
- timerRef.current = setTimeout(advance2, stepDurationMs);
42258
+ timerRef.current = setTimeout(advance, stepDurationMs);
41806
42259
  }, [canPlay, slots, entity.maxSlots, entity.solutions, stepDurationMs, playEvent, completeEvent, emit]);
41807
42260
  const machine = {
41808
42261
  name: entity.title,
@@ -42914,7 +43367,7 @@ var StatCard = ({
42914
43367
  const labelToUse = propLabel ?? propTitle;
42915
43368
  const eventBus = useEventBus();
42916
43369
  const { t } = useTranslate();
42917
- const handleActionClick = React124__default.useCallback(() => {
43370
+ const handleActionClick = React125__default.useCallback(() => {
42918
43371
  if (action?.event) {
42919
43372
  eventBus.emit(`UI:${action.event}`, {});
42920
43373
  }
@@ -42925,7 +43378,7 @@ var StatCard = ({
42925
43378
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
42926
43379
  const isLoading = externalLoading ?? false;
42927
43380
  const error = externalError;
42928
- const computeMetricValue = React124__default.useCallback(
43381
+ const computeMetricValue = React125__default.useCallback(
42929
43382
  (metric, items) => {
42930
43383
  if (metric.value !== void 0) {
42931
43384
  return metric.value;
@@ -42964,7 +43417,7 @@ var StatCard = ({
42964
43417
  },
42965
43418
  []
42966
43419
  );
42967
- const schemaStats = React124__default.useMemo(() => {
43420
+ const schemaStats = React125__default.useMemo(() => {
42968
43421
  if (!metrics || metrics.length === 0) return null;
42969
43422
  return metrics.map((metric) => ({
42970
43423
  label: metric.label,
@@ -42972,7 +43425,7 @@ var StatCard = ({
42972
43425
  format: metric.format
42973
43426
  }));
42974
43427
  }, [metrics, data, computeMetricValue]);
42975
- const calculatedTrend = React124__default.useMemo(() => {
43428
+ const calculatedTrend = React125__default.useMemo(() => {
42976
43429
  if (manualTrend !== void 0) return manualTrend;
42977
43430
  if (previousValue === void 0 || currentValue === void 0)
42978
43431
  return void 0;
@@ -43907,7 +44360,7 @@ var Timeline = ({
43907
44360
  }) => {
43908
44361
  const { t } = useTranslate();
43909
44362
  const entityData = Array.isArray(entity) ? entity : [];
43910
- const items = React124__default.useMemo(() => {
44363
+ const items = React125__default.useMemo(() => {
43911
44364
  if (propItems) return propItems;
43912
44365
  if (entityData.length === 0) return [];
43913
44366
  return entityData.map((record, idx) => {
@@ -44011,7 +44464,7 @@ Timeline.displayName = "Timeline";
44011
44464
  init_Box();
44012
44465
  init_useEventBus();
44013
44466
  function extractToastProps(children) {
44014
- if (!React124__default.isValidElement(children)) {
44467
+ if (!React125__default.isValidElement(children)) {
44015
44468
  if (typeof children === "string") {
44016
44469
  return { message: children };
44017
44470
  }
@@ -44042,7 +44495,7 @@ var ToastSlot = ({
44042
44495
  eventBus.emit("UI:CLOSE");
44043
44496
  };
44044
44497
  if (!isVisible) return null;
44045
- const isCustomContent = React124__default.isValidElement(children) && !message;
44498
+ const isCustomContent = React125__default.isValidElement(children) && !message;
44046
44499
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
44047
44500
  Toast,
44048
44501
  {
@@ -44296,7 +44749,7 @@ var WizardContainer = ({
44296
44749
  const isCompleted = index < currentStep;
44297
44750
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
44298
44751
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
44299
- return /* @__PURE__ */ jsxs(React124__default.Fragment, { children: [
44752
+ return /* @__PURE__ */ jsxs(React125__default.Fragment, { children: [
44300
44753
  /* @__PURE__ */ jsx(
44301
44754
  Button,
44302
44755
  {
@@ -44667,12 +45120,12 @@ WorldMapTemplate.displayName = "WorldMapTemplate";
44667
45120
 
44668
45121
  // components/organisms/component-registry.generated.ts
44669
45122
  function lazyThree(name, loader) {
44670
- const Lazy = React124__default.lazy(() => loader().then((m) => ({ default: m[name] })));
45123
+ const Lazy = React125__default.lazy(() => loader().then((m) => ({ default: m[name] })));
44671
45124
  function ThreeWrapper(props) {
44672
- return React124__default.createElement(
44673
- React124__default.Suspense,
45125
+ return React125__default.createElement(
45126
+ React125__default.Suspense,
44674
45127
  { fallback: null },
44675
- React124__default.createElement(Lazy, props)
45128
+ React125__default.createElement(Lazy, props)
44676
45129
  );
44677
45130
  }
44678
45131
  ThreeWrapper.displayName = `Lazy(${name})`;
@@ -44960,7 +45413,7 @@ function SuspenseConfigProvider({
44960
45413
  config,
44961
45414
  children
44962
45415
  }) {
44963
- return React124__default.createElement(
45416
+ return React125__default.createElement(
44964
45417
  SuspenseConfigContext.Provider,
44965
45418
  { value: config },
44966
45419
  children
@@ -44987,6 +45440,62 @@ function getComponentForPattern(patternType) {
44987
45440
  if (!name) return null;
44988
45441
  return COMPONENT_REGISTRY[name] ?? null;
44989
45442
  }
45443
+ var FORM_PATTERNS = /* @__PURE__ */ new Set([
45444
+ "form",
45445
+ "form-section",
45446
+ "inline-edit-form",
45447
+ "wizard-step"
45448
+ ]);
45449
+ function enrichFormFields(fields, entityDef) {
45450
+ const fieldMap = new Map(entityDef.fields.map((f3) => [f3.name, f3]));
45451
+ return fields.map((field) => {
45452
+ if (typeof field === "string") {
45453
+ const entityField = fieldMap.get(field);
45454
+ if (entityField) {
45455
+ const enriched = {
45456
+ name: field,
45457
+ label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()),
45458
+ type: entityField.type,
45459
+ required: entityField.required
45460
+ };
45461
+ if (entityField.values && entityField.values.length > 0) {
45462
+ enriched.values = entityField.values;
45463
+ } else if (entityField.enumValues && entityField.enumValues.length > 0) {
45464
+ enriched.values = entityField.enumValues;
45465
+ }
45466
+ if (entityField.relation) {
45467
+ enriched.relation = entityField.relation;
45468
+ }
45469
+ return enriched;
45470
+ }
45471
+ return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
45472
+ }
45473
+ if (field && typeof field === "object" && !Array.isArray(field)) {
45474
+ const obj = field;
45475
+ const fieldName = obj.name ?? obj.field;
45476
+ if (!fieldName) return field;
45477
+ if (obj.type || obj.inputType) return field;
45478
+ const entityField = fieldMap.get(fieldName);
45479
+ if (!entityField) return field;
45480
+ const enriched = { ...obj, type: entityField.type };
45481
+ if (entityField.required && !("required" in obj)) {
45482
+ enriched.required = true;
45483
+ }
45484
+ if (!obj.values && !obj.options) {
45485
+ if (entityField.values && entityField.values.length > 0) {
45486
+ enriched.values = entityField.values;
45487
+ } else if (entityField.enumValues && entityField.enumValues.length > 0) {
45488
+ enriched.values = entityField.enumValues;
45489
+ }
45490
+ }
45491
+ if (!obj.relation && entityField.relation) {
45492
+ enriched.relation = entityField.relation;
45493
+ }
45494
+ return enriched;
45495
+ }
45496
+ return field;
45497
+ });
45498
+ }
44990
45499
  var PATTERNS_WITH_CHILDREN = /* @__PURE__ */ new Set([
44991
45500
  "stack",
44992
45501
  "vstack",
@@ -45362,13 +45871,14 @@ function getToastPosition(position) {
45362
45871
  return "top-4 right-4";
45363
45872
  }
45364
45873
  }
45365
- function renderPatternChildren(children, onDismiss, parentId = "root") {
45874
+ function renderPatternChildren(children, onDismiss, parentId = "root", parentPath = "root") {
45366
45875
  if (!children || !Array.isArray(children) || children.length === 0) {
45367
45876
  return null;
45368
45877
  }
45369
45878
  return children.map((child, index) => {
45370
45879
  if (!child || typeof child !== "object") return null;
45371
45880
  const childId = `${parentId}-${index}`;
45881
+ const childPath = parentPath === "root" ? `root.children.${index}` : `${parentPath}.children.${index}`;
45372
45882
  const childContent = {
45373
45883
  id: childId,
45374
45884
  pattern: child.type,
@@ -45380,7 +45890,8 @@ function renderPatternChildren(children, onDismiss, parentId = "root") {
45380
45890
  SlotContentRenderer,
45381
45891
  {
45382
45892
  content: childContent,
45383
- onDismiss
45893
+ onDismiss,
45894
+ patternPath: childPath
45384
45895
  },
45385
45896
  childId
45386
45897
  );
@@ -45412,16 +45923,20 @@ function renderPatternProps(props, onDismiss) {
45412
45923
  }
45413
45924
  function SlotContentRenderer({
45414
45925
  content,
45415
- onDismiss
45926
+ onDismiss,
45927
+ patternPath
45416
45928
  }) {
45417
45929
  const entityProp = content.props.entity;
45418
45930
  const entityType = typeof entityProp === "string" ? entityProp : "";
45419
45931
  const storeData = useEntityRef(entityType);
45932
+ const schemaCtx = useEntitySchemaOptional();
45933
+ const entityDef = entityType && schemaCtx ? schemaCtx.entities.get(entityType) : void 0;
45420
45934
  const PatternComponent = getComponentForPattern(content.pattern);
45421
45935
  if (PatternComponent) {
45422
45936
  const childrenConfig = content.props.children;
45423
45937
  const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0;
45424
- const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id) : void 0;
45938
+ const myPath = patternPath ?? "root";
45939
+ const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath) : void 0;
45425
45940
  const { children: _childrenConfig, ...restProps } = content.props;
45426
45941
  const renderedProps = renderPatternProps(restProps, onDismiss);
45427
45942
  let finalProps;
@@ -45437,6 +45952,14 @@ function SlotContentRenderer({
45437
45952
  } else {
45438
45953
  finalProps = renderedProps;
45439
45954
  }
45955
+ const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
45956
+ if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
45957
+ finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
45958
+ if (finalProps.mode === "edit" && !finalProps.initialData && storeData.length > 0) {
45959
+ finalProps.initialData = storeData[0];
45960
+ }
45961
+ }
45962
+ const acceptsChildren = PATTERNS_WITH_CHILDREN.has(content.pattern);
45440
45963
  return /* @__PURE__ */ jsx(
45441
45964
  Box,
45442
45965
  {
@@ -45445,6 +45968,9 @@ function SlotContentRenderer({
45445
45968
  "data-id": content.id,
45446
45969
  "data-node-id": content.nodeId,
45447
45970
  "data-source-trait": content.sourceTrait,
45971
+ "data-pattern-path": myPath,
45972
+ "data-pattern-type": content.pattern,
45973
+ "data-accepts-children": acceptsChildren ? "true" : void 0,
45448
45974
  children: /* @__PURE__ */ jsx(PatternComponent, { ...finalProps, children: renderedChildren })
45449
45975
  }
45450
45976
  );
@@ -45797,6 +46323,13 @@ createContext(null);
45797
46323
 
45798
46324
  // lib/api-client.ts
45799
46325
  typeof process !== "undefined" && process.env?.VITE_API_URL ? process.env.VITE_API_URL : "/api";
46326
+
46327
+ // hooks/useDraggable.ts
46328
+ init_useEventBus();
46329
+ var ALMADAR_DND_MIME = "application/x-almadar-dnd";
46330
+
46331
+ // hooks/useDropZone.ts
46332
+ init_useEventBus();
45800
46333
  typeof process !== "undefined" && process.env?.VITE_API_URL ? process.env.VITE_API_URL : "http://localhost:3000";
45801
46334
 
45802
46335
  // runtime/createClientEffectHandlers.ts
@@ -45832,33 +46365,6 @@ function createClientEffectHandlers(options) {
45832
46365
  })
45833
46366
  };
45834
46367
  }
45835
- var EntitySchemaContext = createContext(null);
45836
- function EntitySchemaProvider({
45837
- entities,
45838
- children
45839
- }) {
45840
- const entitiesMap = useMemo(() => {
45841
- const map = /* @__PURE__ */ new Map();
45842
- for (const entity of entities) {
45843
- map.set(entity.name, entity);
45844
- }
45845
- return map;
45846
- }, [entities]);
45847
- const contextValue = useMemo(
45848
- () => ({
45849
- entities: entitiesMap
45850
- }),
45851
- [entitiesMap]
45852
- );
45853
- return /* @__PURE__ */ jsx(EntitySchemaContext.Provider, { value: contextValue, children });
45854
- }
45855
- function useEntitySchema() {
45856
- const context = useContext(EntitySchemaContext);
45857
- if (!context) {
45858
- throw new Error("useEntitySchema must be used within an EntitySchemaProvider");
45859
- }
45860
- return context;
45861
- }
45862
46368
 
45863
46369
  // runtime/useTraitStateMachine.ts
45864
46370
  function toTraitDefinition(binding) {
@@ -46449,7 +46955,7 @@ function TraitInitializer({ traits: traits2, orbitalNames, onNavigate }) {
46449
46955
  if (responseData) {
46450
46956
  for (const [entityType, records] of Object.entries(responseData)) {
46451
46957
  if (Array.isArray(records)) {
46452
- entityStore.advance(entityType, records);
46958
+ entityStore.setAll(entityType, records);
46453
46959
  }
46454
46960
  }
46455
46961
  }
@@ -46508,7 +47014,7 @@ function TraitInitializer({ traits: traits2, orbitalNames, onNavigate }) {
46508
47014
  if (initResponseData) {
46509
47015
  for (const [entityType, records] of Object.entries(initResponseData)) {
46510
47016
  if (Array.isArray(records)) {
46511
- entityStore.advance(entityType, records);
47017
+ entityStore.setAll(entityType, records);
46512
47018
  }
46513
47019
  }
46514
47020
  }
@@ -46557,7 +47063,7 @@ function SchemaRunner({ schema, serverUrl, mockData, pageName, onNavigate }) {
46557
47063
  if (!serverUrl && mockData) {
46558
47064
  for (const [entityType, records] of Object.entries(mockData)) {
46559
47065
  if (Array.isArray(records)) {
46560
- entityStore.advance(entityType, records);
47066
+ entityStore.setAll(entityType, records);
46561
47067
  }
46562
47068
  }
46563
47069
  }
@@ -46638,6 +47144,9 @@ function OrbPreview({
46638
47144
  );
46639
47145
  }
46640
47146
  OrbPreview.displayName = "OrbPreview";
47147
+
47148
+ // components/molecules/avl/OrbPreviewNode.tsx
47149
+ init_useEventBus();
46641
47150
  var ScreenSizeContext = createContext("tablet");
46642
47151
  var PatternSelectionContext = createContext({ selected: null, select: () => {
46643
47152
  } });
@@ -46665,12 +47174,12 @@ function eventHandleStyle(source) {
46665
47174
  };
46666
47175
  }
46667
47176
  function buildOrbitalSchema(fullSchema, orbitalName) {
46668
- const orbital = fullSchema.orbitals?.find((o) => o.name === orbitalName);
47177
+ const orbital = (fullSchema.orbitals ?? []).find((o) => o.name === orbitalName);
46669
47178
  if (!orbital) return fullSchema;
46670
47179
  return { ...fullSchema, name: `${fullSchema.name}__${orbitalName}`, orbitals: [orbital] };
46671
47180
  }
46672
47181
  function buildTransitionSchema(fullSchema, orbitalName, traitName, transitionEvent, fromState, toState) {
46673
- const orbital = fullSchema.orbitals?.find((o) => o.name === orbitalName);
47182
+ const orbital = (fullSchema.orbitals ?? []).find((o) => o.name === orbitalName);
46674
47183
  if (!orbital) return fullSchema;
46675
47184
  const clonedOrbital = JSON.parse(JSON.stringify(orbital));
46676
47185
  const traits2 = clonedOrbital.traits ?? [];
@@ -46703,7 +47212,9 @@ function buildTransitionSchema(fullSchema, orbitalName, traitName, transitionEve
46703
47212
  }
46704
47213
  const targetTrait = traits2.find((t) => {
46705
47214
  if (typeof t === "string") return t === traitName;
46706
- return t.name === traitName;
47215
+ if ("name" in t) return t.name === traitName;
47216
+ if ("ref" in t) return t.ref === traitName;
47217
+ return false;
46707
47218
  });
46708
47219
  if (targetTrait) {
46709
47220
  clonedOrbital.traits = [targetTrait];
@@ -46720,6 +47231,21 @@ var SELECTION_STYLES = `
46720
47231
  outline: 2px solid var(--color-primary);
46721
47232
  outline-offset: 1px;
46722
47233
  }
47234
+ .orb-preview-live.drag-active [data-accepts-children="true"] {
47235
+ outline: 2px dashed var(--color-primary);
47236
+ outline-offset: -2px;
47237
+ transition: outline-color 0.15s, background-color 0.15s;
47238
+ }
47239
+ .orb-preview-live.drag-active [data-accepts-children="true"].drag-hover {
47240
+ outline-color: var(--color-primary);
47241
+ background-color: color-mix(in srgb, var(--color-primary) 5%, transparent);
47242
+ }
47243
+ .orb-preview-live .drop-indicator {
47244
+ height: 2px;
47245
+ background: var(--color-primary);
47246
+ border-radius: 1px;
47247
+ pointer-events: none;
47248
+ }
46723
47249
  `;
46724
47250
  var OrbPreviewNodeInner = (props) => {
46725
47251
  const data = props.data;
@@ -46779,6 +47305,88 @@ var OrbPreviewNodeInner = (props) => {
46779
47305
  select(null);
46780
47306
  }
46781
47307
  }, [data, select]);
47308
+ const eventBus = useEventBus();
47309
+ const [dragActive, setDragActive] = useState(false);
47310
+ useEffect(() => {
47311
+ const unsub1 = eventBus.on("UI:DRAG_START", (e) => {
47312
+ const kind = e.payload?.kind;
47313
+ if (kind === "pattern") setDragActive(true);
47314
+ });
47315
+ const unsub2 = eventBus.on("UI:DRAG_END", () => setDragActive(false));
47316
+ return () => {
47317
+ unsub1();
47318
+ unsub2();
47319
+ };
47320
+ }, [eventBus]);
47321
+ const handlePreviewDrop = useCallback((e) => {
47322
+ e.preventDefault();
47323
+ e.stopPropagation();
47324
+ setDragActive(false);
47325
+ contentRef.current?.querySelectorAll(".drag-hover, .drop-indicator").forEach((el2) => {
47326
+ el2.classList.remove("drag-hover");
47327
+ if (el2.classList.contains("drop-indicator")) el2.remove();
47328
+ });
47329
+ const raw = e.dataTransfer.getData(ALMADAR_DND_MIME);
47330
+ if (!raw) return;
47331
+ let payload;
47332
+ try {
47333
+ payload = JSON.parse(raw);
47334
+ } catch {
47335
+ return;
47336
+ }
47337
+ if (payload.kind !== "pattern") return;
47338
+ let el = e.target;
47339
+ while (el && el.dataset.acceptsChildren !== "true") {
47340
+ el = el.parentElement;
47341
+ if (!el || el === contentRef.current) break;
47342
+ }
47343
+ const containerPath = el?.dataset?.patternPath;
47344
+ if (!containerPath) {
47345
+ eventBus.emit("UI:PATTERN_INSERT", {
47346
+ parentPath: "root",
47347
+ patternType: payload.data.type,
47348
+ index: 0
47349
+ });
47350
+ return;
47351
+ }
47352
+ const pathChildren = el.querySelectorAll(":scope > [data-pattern-path]");
47353
+ let insertIndex = pathChildren.length;
47354
+ for (let i = 0; i < pathChildren.length; i++) {
47355
+ const rect = pathChildren[i].getBoundingClientRect();
47356
+ const style = el.firstElementChild ? getComputedStyle(el.firstElementChild) : null;
47357
+ const isVertical = style?.flexDirection !== "row";
47358
+ const mid = isVertical ? rect.top + rect.height / 2 : rect.left + rect.width / 2;
47359
+ const cursor = isVertical ? e.clientY : e.clientX;
47360
+ if (cursor < mid) {
47361
+ insertIndex = i;
47362
+ break;
47363
+ }
47364
+ }
47365
+ eventBus.emit("UI:PATTERN_INSERT", {
47366
+ parentPath: containerPath,
47367
+ patternType: payload.data.type,
47368
+ index: insertIndex
47369
+ });
47370
+ }, [eventBus]);
47371
+ const handlePreviewDragOver = useCallback((e) => {
47372
+ if (!e.dataTransfer.types.includes(ALMADAR_DND_MIME)) return;
47373
+ e.preventDefault();
47374
+ e.stopPropagation();
47375
+ e.dataTransfer.dropEffect = "copy";
47376
+ if (!dragActive) setDragActive(true);
47377
+ let el = e.target;
47378
+ while (el && el.dataset.acceptsChildren !== "true") {
47379
+ el = el.parentElement;
47380
+ if (!el || el === contentRef.current) break;
47381
+ }
47382
+ contentRef.current?.querySelectorAll(".drag-hover").forEach((c) => c.classList.remove("drag-hover"));
47383
+ if (el?.dataset?.acceptsChildren === "true") {
47384
+ el.classList.add("drag-hover");
47385
+ }
47386
+ }, [dragActive]);
47387
+ const handlePreviewDragLeave = useCallback((e) => {
47388
+ contentRef.current?.querySelectorAll(".drag-hover").forEach((c) => c.classList.remove("drag-hover"));
47389
+ }, []);
46782
47390
  return /* @__PURE__ */ jsxs(
46783
47391
  Box,
46784
47392
  {
@@ -46823,8 +47431,11 @@ var OrbPreviewNodeInner = (props) => {
46823
47431
  Box,
46824
47432
  {
46825
47433
  ref: contentRef,
46826
- className: "orb-preview-live nodrag",
47434
+ className: `orb-preview-live nodrag${dragActive ? " drag-active" : ""}`,
46827
47435
  onClick: handleContentClick,
47436
+ onDrop: handlePreviewDrop,
47437
+ onDragOver: handlePreviewDragOver,
47438
+ onDragLeave: handlePreviewDragLeave,
46828
47439
  children: orbitalSchema ? /* @__PURE__ */ jsx(Box, { style: { minHeight: preset.minHeight }, children: /* @__PURE__ */ jsx(
46829
47440
  OrbPreview,
46830
47441
  {
@@ -46852,7 +47463,7 @@ var OrbPreviewNodeInner = (props) => {
46852
47463
  }
46853
47464
  );
46854
47465
  };
46855
- var OrbPreviewNode = React124__default.memo(OrbPreviewNodeInner);
47466
+ var OrbPreviewNode = React125__default.memo(OrbPreviewNodeInner);
46856
47467
  OrbPreviewNode.displayName = "OrbPreviewNode";
46857
47468
  var EventFlowEdgeInner = (props) => {
46858
47469
  const {
@@ -46929,7 +47540,7 @@ var EventFlowEdgeInner = (props) => {
46929
47540
  ) })
46930
47541
  ] });
46931
47542
  };
46932
- var EventFlowEdge = React124__default.memo(EventFlowEdgeInner);
47543
+ var EventFlowEdge = React125__default.memo(EventFlowEdgeInner);
46933
47544
  EventFlowEdge.displayName = "EventFlowEdge";
46934
47545
 
46935
47546
  // components/molecules/avl/index.ts
@@ -46943,7 +47554,9 @@ init_Avl3DExprTree();
46943
47554
  // components/organisms/avl/OrbInspector.tsx
46944
47555
  init_Box();
46945
47556
  init_Typography();
47557
+ init_Stack();
46946
47558
  init_types();
47559
+ init_useEventBus();
46947
47560
  function formatExpression(expr) {
46948
47561
  if (!expr) return "";
46949
47562
  if (typeof expr === "string") return expr;
@@ -46978,7 +47591,7 @@ var FIELD_TYPE_MAP = {
46978
47591
  array: "array"
46979
47592
  };
46980
47593
  function findEntity(schema, orbitalName) {
46981
- const orbital = schema.orbitals?.find((o) => o.name === orbitalName);
47594
+ const orbital = (schema.orbitals ?? []).find((o) => o.name === orbitalName);
46982
47595
  if (!orbital || typeof orbital.entity === "string") return null;
46983
47596
  const e = orbital.entity;
46984
47597
  const fields = (e.fields ?? []).map((f3) => ({
@@ -46989,7 +47602,7 @@ function findEntity(schema, orbitalName) {
46989
47602
  return { name: e.name ?? orbitalName, persistence: e.persistence ?? "runtime", fields };
46990
47603
  }
46991
47604
  function findTransition(schema, orbitalName, traitName, event) {
46992
- const orbital = schema.orbitals?.find((o) => o.name === orbitalName);
47605
+ const orbital = (schema.orbitals ?? []).find((o) => o.name === orbitalName);
46993
47606
  if (!orbital) return null;
46994
47607
  const traits2 = orbital.traits ?? [];
46995
47608
  const trait = traits2.find((t) => typeof t !== "string" && t.name === traitName);
@@ -46999,16 +47612,39 @@ function findTransition(schema, orbitalName, traitName, event) {
46999
47612
  return sm.transitions?.find((t) => t.event === event) ?? null;
47000
47613
  }
47001
47614
  function findTraits(schema, orbitalName) {
47002
- const orbital = schema.orbitals?.find((o) => o.name === orbitalName);
47615
+ const orbital = (schema.orbitals ?? []).find((o) => o.name === orbitalName);
47003
47616
  if (!orbital) return [];
47004
47617
  return (orbital.traits ?? []).filter((t) => typeof t !== "string").map((t) => ({
47005
47618
  name: t.name,
47006
47619
  stateCount: t.stateMachine?.states?.length ?? 0
47007
47620
  }));
47008
47621
  }
47622
+ function findPatternInTree(root, path) {
47623
+ if (!path || path === "root") return root;
47624
+ const parts = path.split(".");
47625
+ let current = root;
47626
+ for (const part of parts) {
47627
+ if (current === null || current === void 0 || typeof current !== "object") return null;
47628
+ const record = current;
47629
+ if (part === "children" && Array.isArray(record.children)) {
47630
+ current = record.children;
47631
+ } else if (Array.isArray(current)) {
47632
+ const idx = parseInt(part, 10);
47633
+ if (isNaN(idx) || idx < 0 || idx >= current.length) return null;
47634
+ current = current[idx];
47635
+ } else {
47636
+ current = record[part];
47637
+ }
47638
+ }
47639
+ return typeof current === "object" && current !== null ? current : null;
47640
+ }
47641
+ var FIELD_TYPE_OPTIONS = FieldTypeSchema.options.map((v) => ({ value: v, label: v }));
47642
+ var EFFECT_TYPE_OPTIONS = Object.keys(EFFECT_TYPE_TO_CATEGORY).map((v) => ({ value: v, label: v }));
47009
47643
  function OrbInspector({ node, schema, editable = false, onSchemaChange, onClose }) {
47010
47644
  const { selected: selectedPattern } = useContext(PatternSelectionContext);
47011
47645
  const [activeTab, setActiveTab] = useState("inspector");
47646
+ const eventBus = useEventBus();
47647
+ const { t } = useTranslate();
47012
47648
  const orbitalName = node.orbitalName ?? "";
47013
47649
  const traitName = node.traitName ?? "";
47014
47650
  const transitionEvent = node.transitionEvent ?? "";
@@ -47028,25 +47664,56 @@ function OrbInspector({ node, schema, editable = false, onSchemaChange, onClose
47028
47664
  return findTransition(schema, orbitalName, traitName, transitionEvent);
47029
47665
  }, [schema, orbitalName, traitName, transitionEvent]);
47030
47666
  const traits2 = useMemo(() => findTraits(schema, orbitalName), [schema, orbitalName]);
47667
+ const patternConfig = useMemo(() => {
47668
+ if (!selectedPattern || !transition) return null;
47669
+ const patternId = selectedPattern.patternId ?? "root";
47670
+ for (const eff of transition.effects ?? []) {
47671
+ if (Array.isArray(eff) && eff[0] === "render-ui" && eff[2]) {
47672
+ const found = findPatternInTree(eff[2], patternId);
47673
+ if (found) return found;
47674
+ }
47675
+ }
47676
+ return null;
47677
+ }, [selectedPattern, transition]);
47031
47678
  const orbCode = useMemo(() => {
47032
- const orbital = schema.orbitals?.find((o) => o.name === orbitalName);
47679
+ const orbital = (schema.orbitals ?? []).find((o) => o.name === orbitalName);
47033
47680
  if (!orbital) return "{}";
47034
47681
  if (isExpanded && traitName) {
47035
- const traits3 = orbital.traits ?? [];
47036
- const trait = traits3.find((t) => typeof t !== "string" && t.name === traitName);
47682
+ const traitList = orbital.traits ?? [];
47683
+ const trait = traitList.find((tr) => typeof tr !== "string" && tr.name === traitName);
47037
47684
  if (trait && typeof trait !== "string" && trait.stateMachine) {
47038
47685
  if (transitionEvent) {
47039
- const t = trait.stateMachine.transitions?.find((tx) => tx.event === transitionEvent);
47040
- if (t) return JSON.stringify(t, null, 2);
47686
+ const tx = trait.stateMachine.transitions?.find((txn) => txn.event === transitionEvent);
47687
+ if (tx) return JSON.stringify(tx, null, 2);
47041
47688
  }
47042
47689
  return JSON.stringify({ name: trait.name, stateMachine: trait.stateMachine }, null, 2);
47043
47690
  }
47044
47691
  }
47045
47692
  return JSON.stringify(orbital, null, 2);
47046
47693
  }, [schema, orbitalName, traitName, transitionEvent, isExpanded]);
47047
- const handlePropChange = useCallback((prop, value) => {
47048
- if (!editable || !onSchemaChange) return;
47049
- }, [editable, onSchemaChange]);
47694
+ const handlePropChange = useCallback((propName, value) => {
47695
+ if (!editable) return;
47696
+ eventBus.emit("UI:PROP_CHANGE", { propName, value });
47697
+ }, [editable, eventBus]);
47698
+ const handleAddField = useCallback(() => {
47699
+ eventBus.emit("UI:ADD_FIELD", {});
47700
+ }, [eventBus]);
47701
+ const handleUpdateField = useCallback((fieldName, updates) => {
47702
+ eventBus.emit("UI:UPDATE_FIELD", { fieldName, updates });
47703
+ }, [eventBus]);
47704
+ const handleRemoveField = useCallback((fieldName) => {
47705
+ eventBus.emit("UI:REMOVE_FIELD", { fieldName });
47706
+ }, [eventBus]);
47707
+ const handleGuardChange = useCallback((guardExpr) => {
47708
+ if (!editable) return;
47709
+ eventBus.emit("UI:GUARD_CHANGE", { guard: guardExpr || null });
47710
+ }, [editable, eventBus]);
47711
+ const handleAddEffect = useCallback((effectType) => {
47712
+ eventBus.emit("UI:ADD_EFFECT", { effectType });
47713
+ }, [eventBus]);
47714
+ const handleRemoveEffect = useCallback((effectIndex) => {
47715
+ eventBus.emit("UI:REMOVE_EFFECT", { effectIndex });
47716
+ }, [eventBus]);
47050
47717
  const headerTitle = selectedPattern ? selectedPattern.patternType : isExpanded ? transitionEvent || "Transition" : orbitalName;
47051
47718
  return /* @__PURE__ */ jsxs(Box, { className: "flex flex-col bg-card border-l border-border h-full", style: { width: 340 }, children: [
47052
47719
  /* @__PURE__ */ jsxs(Box, { className: "shrink-0 border-b border-border", children: [
@@ -47104,48 +47771,98 @@ function OrbInspector({ node, schema, editable = false, onSchemaChange, onClose
47104
47771
  /* ── Inspector Tab ── */
47105
47772
  /* @__PURE__ */ jsxs(Fragment, { children: [
47106
47773
  selectedPattern && patternDef?.propsSchema && /* @__PURE__ */ jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
47107
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: "Props" }),
47108
- /* @__PURE__ */ jsx(Box, { className: "flex flex-col gap-1.5", children: Object.entries(patternDef.propsSchema).slice(0, 8).map(([propName, propSchema]) => {
47774
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: t("Props") }),
47775
+ /* @__PURE__ */ jsx(Box, { className: "flex flex-col gap-1.5", children: Object.entries(patternDef.propsSchema).slice(0, 12).map(([propName, propSchema]) => {
47109
47776
  const ps = propSchema;
47777
+ const currentValue = patternConfig ? patternConfig[propName] : void 0;
47778
+ const displayValue = currentValue !== void 0 ? typeof currentValue === "object" ? JSON.stringify(currentValue) : String(currentValue) : "";
47110
47779
  return /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-2", children: [
47111
47780
  /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-[11px] w-20 shrink-0 font-mono", children: propName }),
47112
47781
  editable ? /* @__PURE__ */ jsx(
47113
47782
  Input,
47114
47783
  {
47784
+ defaultValue: displayValue,
47115
47785
  placeholder: ps.types?.join(" | ") ?? "string",
47116
47786
  className: "flex-1 text-[11px] h-6",
47117
- onChange: (e) => handlePropChange(propName, e.target.value)
47787
+ onBlur: (e) => handlePropChange(propName, e.target.value)
47118
47788
  }
47119
47789
  ) : /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-[11px] text-muted-foreground", children: [
47120
- ps.types?.join(" | ") ?? "string",
47790
+ displayValue || (ps.types?.join(" | ") ?? "string"),
47121
47791
  ps.required ? " *" : ""
47122
47792
  ] })
47123
47793
  ] }, propName);
47124
47794
  }) })
47125
47795
  ] }),
47126
47796
  (selectedPattern && isEntityPattern || !selectedPattern && !isExpanded) && entity && /* @__PURE__ */ jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
47127
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: "Entity" }),
47797
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: t("Entity") }),
47128
47798
  /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-2 mb-2", children: [
47129
47799
  /* @__PURE__ */ jsx("svg", { width: 14, height: 14, children: /* @__PURE__ */ jsx("circle", { cx: 7, cy: 7, r: 5, fill: "var(--color-primary)" }) }),
47130
47800
  /* @__PURE__ */ jsx(Typography, { variant: "small", className: "font-semibold text-[12px]", children: entity.name }),
47131
47801
  /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px]", children: entity.persistence })
47132
47802
  ] }),
47133
- /* @__PURE__ */ jsx(Box, { className: "flex flex-col gap-1", children: entity.fields.map((f3) => /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-2", children: [
47803
+ /* @__PURE__ */ jsx(Box, { className: "flex flex-col gap-1", children: entity.fields.map((f3) => /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
47134
47804
  /* @__PURE__ */ jsx("svg", { width: 12, height: 12, children: /* @__PURE__ */ jsx(AvlFieldType, { x: 6, y: 6, kind: FIELD_TYPE_MAP[f3.type] ?? "string", size: 4 }) }),
47135
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-[11px] font-mono flex-1", children: f3.name }),
47136
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px]", children: f3.type }),
47137
- f3.required && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-primary text-[9px]", children: "req" })
47138
- ] }, f3.name)) })
47805
+ editable ? /* @__PURE__ */ jsxs(Fragment, { children: [
47806
+ /* @__PURE__ */ jsx(
47807
+ Input,
47808
+ {
47809
+ defaultValue: f3.name,
47810
+ className: "flex-1 text-[11px] font-mono h-6",
47811
+ onBlur: (e) => {
47812
+ if (e.target.value !== f3.name) {
47813
+ handleUpdateField(f3.name, { name: e.target.value });
47814
+ }
47815
+ }
47816
+ }
47817
+ ),
47818
+ /* @__PURE__ */ jsx(
47819
+ Select,
47820
+ {
47821
+ value: f3.type,
47822
+ options: FIELD_TYPE_OPTIONS,
47823
+ onChange: (e) => handleUpdateField(f3.name, { type: e.target.value }),
47824
+ className: "w-20 text-[10px] h-6"
47825
+ }
47826
+ ),
47827
+ /* @__PURE__ */ jsx(
47828
+ Button,
47829
+ {
47830
+ variant: "ghost",
47831
+ size: "sm",
47832
+ onClick: () => handleRemoveField(f3.name),
47833
+ className: "shrink-0 p-0.5 h-6 w-6",
47834
+ children: /* @__PURE__ */ jsx(Icon, { name: "x", size: "xs" })
47835
+ }
47836
+ )
47837
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
47838
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-[11px] font-mono flex-1", children: f3.name }),
47839
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px]", children: f3.type }),
47840
+ f3.required && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-primary text-[9px]", children: t("req") })
47841
+ ] })
47842
+ ] }, f3.name)) }),
47843
+ editable && /* @__PURE__ */ jsxs(
47844
+ Button,
47845
+ {
47846
+ variant: "ghost",
47847
+ size: "sm",
47848
+ onClick: handleAddField,
47849
+ className: "mt-2 text-[11px] w-full",
47850
+ children: [
47851
+ /* @__PURE__ */ jsx(Icon, { name: "plus", size: "xs", className: "mr-1" }),
47852
+ t("Add Field")
47853
+ ]
47854
+ }
47855
+ )
47139
47856
  ] }),
47140
47857
  !selectedPattern && !isExpanded && traits2.length > 0 && /* @__PURE__ */ jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
47141
47858
  /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: "Traits" }),
47142
- /* @__PURE__ */ jsx(Box, { className: "flex flex-col gap-1", children: traits2.map((t) => /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-2", children: [
47143
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-[11px] font-semibold", children: t.name }),
47859
+ /* @__PURE__ */ jsx(Box, { className: "flex flex-col gap-1", children: traits2.map((t2) => /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-2", children: [
47860
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-[11px] font-semibold", children: t2.name }),
47144
47861
  /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-muted-foreground text-[10px]", children: [
47145
- t.stateCount,
47862
+ t2.stateCount,
47146
47863
  " states"
47147
47864
  ] })
47148
- ] }, t.name)) })
47865
+ ] }, t2.name)) })
47149
47866
  ] }),
47150
47867
  isExpanded && fromState && toState && /* @__PURE__ */ jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
47151
47868
  /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: "Transition" }),
@@ -47164,19 +47881,22 @@ function OrbInspector({ node, schema, editable = false, onSchemaChange, onClose
47164
47881
  /* @__PURE__ */ jsx("svg", { width: 16, height: 16, children: /* @__PURE__ */ jsx(AvlEvent, { x: 8, y: 8, size: 12 }) }),
47165
47882
  /* @__PURE__ */ jsx(Typography, { variant: "small", className: "font-semibold text-[12px]", children: transitionEvent })
47166
47883
  ] }) }),
47167
- (transition?.guard ?? guard) && /* @__PURE__ */ jsx(Box, { className: "px-4 py-2 border-b border-border/40", children: /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-2", children: [
47884
+ (transition?.guard ?? guard ?? editable) && isExpanded && /* @__PURE__ */ jsx(Box, { className: "px-4 py-2 border-b border-border/40", children: /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
47168
47885
  /* @__PURE__ */ jsx("svg", { width: 16, height: 16, children: /* @__PURE__ */ jsx(AvlGuard, { x: 8, y: 8, size: 12 }) }),
47169
47886
  editable ? /* @__PURE__ */ jsx(
47170
47887
  Input,
47171
47888
  {
47172
47889
  defaultValue: formatExpression(transition?.guard ?? guard),
47173
- className: "flex-1 text-[11px] font-mono h-6"
47890
+ placeholder: t("Guard expression"),
47891
+ className: "flex-1 text-[11px] font-mono h-6",
47892
+ onBlur: (e) => handleGuardChange(e.target.value)
47174
47893
  }
47175
47894
  ) : /* @__PURE__ */ jsx(Typography, { variant: "small", className: "font-mono text-[11px] text-muted-foreground", children: formatExpression(transition?.guard ?? guard) })
47176
47895
  ] }) }),
47177
- effectTypes.length > 0 && /* @__PURE__ */ jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
47896
+ (effectTypes.length > 0 || editable) && isExpanded && /* @__PURE__ */ jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
47178
47897
  /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: [
47179
- "Effects (",
47898
+ t("Effects"),
47899
+ " (",
47180
47900
  effectTypes.length,
47181
47901
  ")"
47182
47902
  ] }),
@@ -47184,15 +47904,26 @@ function OrbInspector({ node, schema, editable = false, onSchemaChange, onClose
47184
47904
  const isKnown = KNOWN_EFFECTS.has(type);
47185
47905
  const category = EFFECT_TYPE_TO_CATEGORY[type];
47186
47906
  const catColor = category ? EFFECT_CATEGORY_COLORS[category] : void 0;
47187
- return /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-2", children: [
47907
+ return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
47188
47908
  /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-muted-foreground text-[11px] w-4 text-right shrink-0", children: [
47189
47909
  i + 1,
47190
47910
  "."
47191
47911
  ] }),
47192
47912
  isKnown && /* @__PURE__ */ jsx("svg", { width: 16, height: 16, children: /* @__PURE__ */ jsx(AvlEffect, { x: 8, y: 8, effectType: type, size: 6, showBackground: true }) }),
47193
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-[11px]", style: { color: catColor?.color }, children: effectSummary(type) })
47913
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-[11px] flex-1", style: { color: catColor?.color }, children: effectSummary(type) }),
47914
+ editable && /* @__PURE__ */ jsx(
47915
+ Button,
47916
+ {
47917
+ variant: "ghost",
47918
+ size: "sm",
47919
+ onClick: () => handleRemoveEffect(i),
47920
+ className: "shrink-0 p-0.5 h-6 w-6",
47921
+ children: /* @__PURE__ */ jsx(Icon, { name: "x", size: "xs" })
47922
+ }
47923
+ )
47194
47924
  ] }, i);
47195
- }) })
47925
+ }) }),
47926
+ editable && /* @__PURE__ */ jsx(AddEffectButton, { onAdd: handleAddEffect })
47196
47927
  ] }),
47197
47928
  patterns.length > 0 && !selectedPattern && /* @__PURE__ */ jsxs(Box, { className: "px-4 py-3", children: [
47198
47929
  /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: "render-ui" }),
@@ -47208,6 +47939,40 @@ function OrbInspector({ node, schema, editable = false, onSchemaChange, onClose
47208
47939
  ) })
47209
47940
  ] });
47210
47941
  }
47942
+ function AddEffectButton({ onAdd }) {
47943
+ const [open, setOpen] = useState(false);
47944
+ const { t } = useTranslate();
47945
+ return /* @__PURE__ */ jsxs(Box, { className: "relative mt-2", children: [
47946
+ /* @__PURE__ */ jsxs(
47947
+ Button,
47948
+ {
47949
+ variant: "ghost",
47950
+ size: "sm",
47951
+ onClick: () => setOpen((prev) => !prev),
47952
+ className: "text-[11px] w-full",
47953
+ children: [
47954
+ /* @__PURE__ */ jsx(Icon, { name: "plus", size: "xs", className: "mr-1" }),
47955
+ t("Add Effect")
47956
+ ]
47957
+ }
47958
+ ),
47959
+ open && /* @__PURE__ */ jsx(Box, { className: "absolute z-20 top-full left-0 right-0 mt-1 bg-card border border-border rounded-md shadow-lg overflow-hidden", children: EFFECT_TYPE_OPTIONS.map((opt) => /* @__PURE__ */ jsxs(
47960
+ Box,
47961
+ {
47962
+ className: "px-3 py-1.5 text-[11px] cursor-pointer hover:bg-muted/50 flex items-center gap-2",
47963
+ onClick: () => {
47964
+ onAdd(opt.value);
47965
+ setOpen(false);
47966
+ },
47967
+ children: [
47968
+ KNOWN_EFFECTS.has(opt.value) && /* @__PURE__ */ jsx("svg", { width: 14, height: 14, children: /* @__PURE__ */ jsx(AvlEffect, { x: 7, y: 7, effectType: opt.value, size: 5, showBackground: true }) }),
47969
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-[11px]", children: opt.label })
47970
+ ]
47971
+ },
47972
+ opt.value
47973
+ )) })
47974
+ ] });
47975
+ }
47211
47976
  function OrbPatternTree({ config, depth }) {
47212
47977
  if (!config || typeof config !== "object") return null;
47213
47978
  const { type, children, ...props } = config;
@@ -47255,19 +48020,25 @@ function FlowCanvasInner({
47255
48020
  onNodeClick,
47256
48021
  onLevelChange,
47257
48022
  initialOrbital,
48023
+ initialLevel,
48024
+ initialSelectedNode,
47258
48025
  editable,
47259
- onSchemaChange
48026
+ onSchemaChange,
48027
+ onPatternDelete,
48028
+ onEventWire
47260
48029
  }) {
47261
48030
  const parsedSchema = useMemo(() => {
47262
48031
  if (typeof schemaProp === "string") return JSON.parse(schemaProp);
47263
48032
  return schemaProp;
47264
48033
  }, [schemaProp]);
47265
- const [level, setLevel] = useState("overview");
48034
+ const [level, setLevel] = useState(
48035
+ initialLevel ?? (initialOrbital ? "expanded" : "overview")
48036
+ );
47266
48037
  const [expandedOrbital, setExpandedOrbital] = useState(
47267
48038
  initialOrbital
47268
48039
  );
47269
48040
  const [screenSize, setScreenSize] = useState("tablet");
47270
- const [selectedNode, setSelectedNode] = useState(null);
48041
+ const [selectedNode, setSelectedNode] = useState(initialSelectedNode ?? null);
47271
48042
  const [selectedPattern, setSelectedPattern] = useState(null);
47272
48043
  const patternSelectionValue = useMemo(() => ({
47273
48044
  selected: selectedPattern,
@@ -47335,8 +48106,15 @@ function FlowCanvasInner({
47335
48106
  setExpandedOrbital(void 0);
47336
48107
  onLevelChange?.("overview");
47337
48108
  }
48109
+ } else if (e.key === "Delete" || e.key === "Backspace") {
48110
+ const target = e.target;
48111
+ if (target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.isContentEditable) return;
48112
+ if (selectedPattern && selectedPattern.nodeData) {
48113
+ onPatternDelete?.({ patternId: selectedPattern.patternId ?? "", nodeData: selectedPattern.nodeData });
48114
+ setSelectedPattern(null);
48115
+ }
47338
48116
  }
47339
- }, [level, onLevelChange, selectedNode]);
48117
+ }, [level, onLevelChange, selectedNode, selectedPattern, onPatternDelete]);
47340
48118
  useEffect(() => {
47341
48119
  document.addEventListener("keydown", handleKeyDown);
47342
48120
  return () => document.removeEventListener("keydown", handleKeyDown);
@@ -47351,6 +48129,22 @@ function FlowCanvasInner({
47351
48129
  onLevelChange?.("overview");
47352
48130
  }
47353
48131
  }, [level, onLevelChange, selectedNode]);
48132
+ const handleConnect = useCallback((connection) => {
48133
+ if (!connection.sourceHandle?.startsWith("event-") || !onEventWire) return;
48134
+ const eventName = connection.sourceHandle.replace("event-", "");
48135
+ const sourceNode = nodes.find((n) => n.id === connection.source);
48136
+ const targetNode = nodes.find((n) => n.id === connection.target);
48137
+ if (!sourceNode || !targetNode) return;
48138
+ const srcData = sourceNode.data;
48139
+ const tgtData = targetNode.data;
48140
+ onEventWire({
48141
+ eventName,
48142
+ sourceOrbital: srcData.orbitalName ?? "",
48143
+ targetOrbital: tgtData.orbitalName ?? "",
48144
+ sourceTraitName: srcData.traitName,
48145
+ targetTraitName: tgtData.traitName
48146
+ });
48147
+ }, [nodes, onEventWire]);
47354
48148
  const screenSizeKeys = ["mobile", "tablet", "desktop"];
47355
48149
  return /* @__PURE__ */ jsx(ScreenSizeContext.Provider, { value: screenSize, children: /* @__PURE__ */ jsx(PatternSelectionContext.Provider, { value: patternSelectionValue, children: /* @__PURE__ */ jsxs(
47356
48150
  Box,
@@ -47371,6 +48165,7 @@ function FlowCanvasInner({
47371
48165
  onEdgesChange,
47372
48166
  onNodeDoubleClick: handleNodeDoubleClick,
47373
48167
  onNodeClick: handleNodeClick,
48168
+ onConnect: handleConnect,
47374
48169
  minZoom: 0.1,
47375
48170
  maxZoom: 2,
47376
48171
  fitView: true,
@@ -47508,7 +48303,7 @@ var ZoomBreadcrumb = ({
47508
48303
  if (eventName && band === "detail") {
47509
48304
  segments.push({ icon: "\u26A1", label: eventName });
47510
48305
  }
47511
- return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-[var(--color-card)]/90 border border-[var(--color-border)] text-[11px] text-[var(--color-muted-foreground)] backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(React124__default.Fragment, { children: [
48306
+ return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-[11px] text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(React125__default.Fragment, { children: [
47512
48307
  i > 0 && /* @__PURE__ */ jsx("span", { className: "opacity-40", children: ">" }),
47513
48308
  /* @__PURE__ */ jsx("span", { className: "opacity-60", children: seg.icon }),
47514
48309
  /* @__PURE__ */ jsx("span", { children: seg.label })
@@ -47560,11 +48355,11 @@ var ZoomLegend = ({ band }) => {
47560
48355
  "button",
47561
48356
  {
47562
48357
  onClick: () => setCollapsed(!collapsed),
47563
- className: "px-2 py-1 text-[10px] rounded-md bg-[var(--color-card)]/90 border border-[var(--color-border)] text-[var(--color-muted-foreground)] backdrop-blur-sm cursor-pointer hover:bg-[var(--color-card)]",
48358
+ className: "px-2 py-1 text-[10px] rounded-md bg-card/90 border border-border text-muted-foreground backdrop-blur-sm cursor-pointer hover:bg-card",
47564
48359
  children: collapsed ? "Legend" : "Hide"
47565
48360
  }
47566
48361
  ),
47567
- !collapsed && /* @__PURE__ */ jsx("div", { className: "mt-1 px-2 py-1.5 rounded-md bg-[var(--color-card)]/95 border border-[var(--color-border)] backdrop-blur-sm space-y-0.5", children: items.map((item, i) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 text-[10px] text-[var(--color-muted-foreground)]", children: [
48362
+ !collapsed && /* @__PURE__ */ jsx("div", { className: "mt-1 px-2 py-1.5 rounded-md bg-card/95 border border-border backdrop-blur-sm space-y-0.5", children: items.map((item, i) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 text-[10px] text-muted-foreground", children: [
47568
48363
  /* @__PURE__ */ jsx("span", { className: "opacity-70 w-6 text-center", children: item.icon }),
47569
48364
  /* @__PURE__ */ jsx("span", { children: item.label })
47570
48365
  ] }, i)) })