@almadar/ui 5.67.0 → 5.69.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,6 +1,6 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import * as React93 from 'react';
3
- import React93__default, { createContext, useState, useMemo, useRef, useEffect, useContext, useCallback, Suspense, useLayoutEffect, Profiler, useReducer, useSyncExternalStore, lazy, useId, forwardRef, useImperativeHandle, Component } from 'react';
2
+ import * as React94 from 'react';
3
+ import React94__default, { createContext, useState, useMemo, useRef, useEffect, useContext, useCallback, Suspense, useLayoutEffect, Profiler, useReducer, useSyncExternalStore, lazy, useId, forwardRef, useImperativeHandle, Component } from 'react';
4
4
  import { OrbitalProvider, EventBusContext, useTraitScope, VerificationProvider, TraitScopeProvider } from '@almadar/ui/providers';
5
5
  import { createLogger, isLogLevelEnabled } from '@almadar/logger';
6
6
  import ELK from 'elkjs/lib/elk.bundled.js';
@@ -3519,7 +3519,7 @@ var init_Box = __esm({
3519
3519
  fixed: "fixed",
3520
3520
  sticky: "sticky"
3521
3521
  };
3522
- Box = React93__default.forwardRef(
3522
+ Box = React94__default.forwardRef(
3523
3523
  ({
3524
3524
  padding,
3525
3525
  paddingX,
@@ -3584,7 +3584,7 @@ var init_Box = __esm({
3584
3584
  onPointerDown?.(e);
3585
3585
  }, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
3586
3586
  const isClickable = action || onClick;
3587
- return React93__default.createElement(
3587
+ return React94__default.createElement(
3588
3588
  Component2,
3589
3589
  {
3590
3590
  ref,
@@ -4175,7 +4175,7 @@ var init_MiniStateMachine = __esm({
4175
4175
  const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
4176
4176
  const tc = transitionCounts[s.name] ?? 0;
4177
4177
  const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
4178
- return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
4178
+ return /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
4179
4179
  /* @__PURE__ */ jsx(
4180
4180
  AvlState,
4181
4181
  {
@@ -4550,7 +4550,7 @@ function loadLib(key, importer) {
4550
4550
  return p2;
4551
4551
  }
4552
4552
  function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
4553
- const Lazy = React93__default.lazy(async () => {
4553
+ const Lazy = React94__default.lazy(async () => {
4554
4554
  const lib = await loadLib(libKey, importer);
4555
4555
  const Comp = pick(lib);
4556
4556
  if (!Comp) {
@@ -4560,7 +4560,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
4560
4560
  return { default: Comp };
4561
4561
  });
4562
4562
  const Wrapped = (props) => /* @__PURE__ */ jsx(
4563
- React93__default.Suspense,
4563
+ React94__default.Suspense,
4564
4564
  {
4565
4565
  fallback: /* @__PURE__ */ jsx(
4566
4566
  "span",
@@ -5286,7 +5286,7 @@ var init_Icon = __esm({
5286
5286
  const directIcon = typeof icon === "string" ? void 0 : icon;
5287
5287
  const effectiveName = typeof icon === "string" ? icon : name;
5288
5288
  const family = useIconFamily();
5289
- const RenderedComponent = React93__default.useMemo(() => {
5289
+ const RenderedComponent = React94__default.useMemo(() => {
5290
5290
  if (directIcon) return null;
5291
5291
  return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
5292
5292
  }, [directIcon, effectiveName, family]);
@@ -5345,7 +5345,7 @@ function resolveIconProp(value, sizeClass) {
5345
5345
  const IconComp = value;
5346
5346
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
5347
5347
  }
5348
- if (React93__default.isValidElement(value)) {
5348
+ if (React94__default.isValidElement(value)) {
5349
5349
  return value;
5350
5350
  }
5351
5351
  if (typeof value === "object" && value !== null && "render" in value) {
@@ -5421,7 +5421,7 @@ var init_Button = __esm({
5421
5421
  md: "h-icon-default w-icon-default",
5422
5422
  lg: "h-icon-default w-icon-default"
5423
5423
  };
5424
- Button = React93__default.forwardRef(
5424
+ Button = React94__default.forwardRef(
5425
5425
  ({
5426
5426
  className,
5427
5427
  variant = "primary",
@@ -5486,7 +5486,7 @@ var Dialog;
5486
5486
  var init_Dialog = __esm({
5487
5487
  "components/core/atoms/Dialog.tsx"() {
5488
5488
  init_cn();
5489
- Dialog = React93__default.forwardRef(
5489
+ Dialog = React94__default.forwardRef(
5490
5490
  ({
5491
5491
  role = "dialog",
5492
5492
  "aria-modal": ariaModal = true,
@@ -5981,7 +5981,7 @@ var init_Badge = __esm({
5981
5981
  md: "px-2.5 py-1 text-sm",
5982
5982
  lg: "px-3 py-1.5 text-base"
5983
5983
  };
5984
- Badge = React93__default.forwardRef(
5984
+ Badge = React94__default.forwardRef(
5985
5985
  ({ className, variant = "default", size = "sm", amount, label, icon, children, onRemove, removeLabel, ...props }, ref) => {
5986
5986
  const iconSizes3 = {
5987
5987
  sm: "h-icon-default w-icon-default",
@@ -6317,7 +6317,7 @@ var init_SvgFlow = __esm({
6317
6317
  width = 100,
6318
6318
  height = 100
6319
6319
  }) => {
6320
- const markerId = React93__default.useMemo(() => {
6320
+ const markerId = React94__default.useMemo(() => {
6321
6321
  flowIdCounter += 1;
6322
6322
  return `almadar-flow-arrow-${flowIdCounter}`;
6323
6323
  }, []);
@@ -6910,7 +6910,7 @@ var init_SvgRing = __esm({
6910
6910
  width = 100,
6911
6911
  height = 100
6912
6912
  }) => {
6913
- const gradientId = React93__default.useMemo(() => {
6913
+ const gradientId = React94__default.useMemo(() => {
6914
6914
  ringIdCounter += 1;
6915
6915
  return `almadar-ring-glow-${ringIdCounter}`;
6916
6916
  }, []);
@@ -7091,7 +7091,7 @@ var init_Input = __esm({
7091
7091
  init_cn();
7092
7092
  init_Icon();
7093
7093
  init_useEventBus();
7094
- Input = React93__default.forwardRef(
7094
+ Input = React94__default.forwardRef(
7095
7095
  ({
7096
7096
  className,
7097
7097
  inputType,
@@ -7251,7 +7251,7 @@ var Label;
7251
7251
  var init_Label = __esm({
7252
7252
  "components/core/atoms/Label.tsx"() {
7253
7253
  init_cn();
7254
- Label = React93__default.forwardRef(
7254
+ Label = React94__default.forwardRef(
7255
7255
  ({ className, required, children, ...props }, ref) => {
7256
7256
  return /* @__PURE__ */ jsxs(
7257
7257
  "label",
@@ -7278,7 +7278,7 @@ var init_Textarea = __esm({
7278
7278
  "components/core/atoms/Textarea.tsx"() {
7279
7279
  init_cn();
7280
7280
  init_useEventBus();
7281
- Textarea = React93__default.forwardRef(
7281
+ Textarea = React94__default.forwardRef(
7282
7282
  ({ className, error, onChange, ...props }, ref) => {
7283
7283
  const eventBus = useEventBus();
7284
7284
  const handleChange = (e) => {
@@ -7517,7 +7517,7 @@ var init_Select = __esm({
7517
7517
  init_cn();
7518
7518
  init_Icon();
7519
7519
  init_useEventBus();
7520
- Select = React93__default.forwardRef(
7520
+ Select = React94__default.forwardRef(
7521
7521
  (props, _ref) => {
7522
7522
  const { multiple, searchable, clearable } = props;
7523
7523
  if (multiple || searchable || clearable) {
@@ -7534,7 +7534,7 @@ var init_Checkbox = __esm({
7534
7534
  "components/core/atoms/Checkbox.tsx"() {
7535
7535
  init_cn();
7536
7536
  init_useEventBus();
7537
- Checkbox = React93__default.forwardRef(
7537
+ Checkbox = React94__default.forwardRef(
7538
7538
  ({ className, label, id, onChange, ...props }, ref) => {
7539
7539
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
7540
7540
  const eventBus = useEventBus();
@@ -7588,7 +7588,7 @@ var init_Spinner = __esm({
7588
7588
  md: "h-6 w-6",
7589
7589
  lg: "h-8 w-8"
7590
7590
  };
7591
- Spinner = React93__default.forwardRef(
7591
+ Spinner = React94__default.forwardRef(
7592
7592
  ({ className, size = "md", overlay, ...props }, ref) => {
7593
7593
  if (overlay) {
7594
7594
  return /* @__PURE__ */ jsx(
@@ -7678,7 +7678,7 @@ var init_Card = __esm({
7678
7678
  chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
7679
7679
  "tile-image-first": "p-0 overflow-hidden"
7680
7680
  };
7681
- Card = React93__default.forwardRef(
7681
+ Card = React94__default.forwardRef(
7682
7682
  ({
7683
7683
  className,
7684
7684
  variant = "bordered",
@@ -7726,9 +7726,9 @@ var init_Card = __esm({
7726
7726
  }
7727
7727
  );
7728
7728
  Card.displayName = "Card";
7729
- CardHeader = React93__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
7729
+ CardHeader = React94__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
7730
7730
  CardHeader.displayName = "CardHeader";
7731
- CardTitle = React93__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7731
+ CardTitle = React94__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7732
7732
  "h3",
7733
7733
  {
7734
7734
  ref,
@@ -7741,11 +7741,11 @@ var init_Card = __esm({
7741
7741
  }
7742
7742
  ));
7743
7743
  CardTitle.displayName = "CardTitle";
7744
- CardContent = React93__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
7744
+ CardContent = React94__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
7745
7745
  CardContent.displayName = "CardContent";
7746
7746
  CardBody = CardContent;
7747
7747
  CardBody.displayName = "CardBody";
7748
- CardFooter = React93__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7748
+ CardFooter = React94__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7749
7749
  "div",
7750
7750
  {
7751
7751
  ref,
@@ -7800,7 +7800,7 @@ var init_FilterPill = __esm({
7800
7800
  md: "w-3.5 h-3.5",
7801
7801
  lg: "w-4 h-4"
7802
7802
  };
7803
- FilterPill = React93__default.forwardRef(
7803
+ FilterPill = React94__default.forwardRef(
7804
7804
  ({
7805
7805
  className,
7806
7806
  variant = "default",
@@ -7929,8 +7929,8 @@ var init_Avatar = __esm({
7929
7929
  actionPayload
7930
7930
  }) => {
7931
7931
  const eventBus = useEventBus();
7932
- const [imgFailed, setImgFailed] = React93__default.useState(false);
7933
- React93__default.useEffect(() => {
7932
+ const [imgFailed, setImgFailed] = React94__default.useState(false);
7933
+ React94__default.useEffect(() => {
7934
7934
  setImgFailed(false);
7935
7935
  }, [src]);
7936
7936
  const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
@@ -8315,7 +8315,7 @@ var init_Radio = __esm({
8315
8315
  md: "w-2.5 h-2.5",
8316
8316
  lg: "w-3 h-3"
8317
8317
  };
8318
- Radio = React93__default.forwardRef(
8318
+ Radio = React94__default.forwardRef(
8319
8319
  ({
8320
8320
  label,
8321
8321
  helperText,
@@ -8332,12 +8332,12 @@ var init_Radio = __esm({
8332
8332
  onChange,
8333
8333
  ...props
8334
8334
  }, ref) => {
8335
- const reactId = React93__default.useId();
8335
+ const reactId = React94__default.useId();
8336
8336
  const baseId = id || `radio-${reactId}`;
8337
8337
  const hasError = !!error;
8338
8338
  const eventBus = useEventBus();
8339
- const [selected, setSelected] = React93__default.useState(value);
8340
- React93__default.useEffect(() => {
8339
+ const [selected, setSelected] = React94__default.useState(value);
8340
+ React94__default.useEffect(() => {
8341
8341
  if (value !== void 0) setSelected(value);
8342
8342
  }, [value]);
8343
8343
  const pick = (next, e) => {
@@ -8519,7 +8519,7 @@ var init_Switch = __esm({
8519
8519
  "components/core/atoms/Switch.tsx"() {
8520
8520
  "use client";
8521
8521
  init_cn();
8522
- Switch = React93.forwardRef(
8522
+ Switch = React94.forwardRef(
8523
8523
  ({
8524
8524
  checked,
8525
8525
  defaultChecked = false,
@@ -8530,10 +8530,10 @@ var init_Switch = __esm({
8530
8530
  name,
8531
8531
  className
8532
8532
  }, ref) => {
8533
- const [isChecked, setIsChecked] = React93.useState(
8533
+ const [isChecked, setIsChecked] = React94.useState(
8534
8534
  checked !== void 0 ? checked : defaultChecked
8535
8535
  );
8536
- React93.useEffect(() => {
8536
+ React94.useEffect(() => {
8537
8537
  if (checked !== void 0) {
8538
8538
  setIsChecked(checked);
8539
8539
  }
@@ -8807,7 +8807,7 @@ var Aside;
8807
8807
  var init_Aside = __esm({
8808
8808
  "components/core/atoms/Aside.tsx"() {
8809
8809
  init_cn();
8810
- Aside = React93__default.forwardRef(
8810
+ Aside = React94__default.forwardRef(
8811
8811
  ({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
8812
8812
  );
8813
8813
  Aside.displayName = "Aside";
@@ -8886,9 +8886,9 @@ var init_LawReferenceTooltip = __esm({
8886
8886
  className
8887
8887
  }) => {
8888
8888
  const { t } = useTranslate();
8889
- const [isVisible, setIsVisible] = React93__default.useState(false);
8890
- const timeoutRef = React93__default.useRef(null);
8891
- const triggerRef = React93__default.useRef(null);
8889
+ const [isVisible, setIsVisible] = React94__default.useState(false);
8890
+ const timeoutRef = React94__default.useRef(null);
8891
+ const triggerRef = React94__default.useRef(null);
8892
8892
  const handleMouseEnter = () => {
8893
8893
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
8894
8894
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -8899,7 +8899,7 @@ var init_LawReferenceTooltip = __esm({
8899
8899
  };
8900
8900
  const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
8901
8901
  const open = isVisible || revealed;
8902
- React93__default.useEffect(() => {
8902
+ React94__default.useEffect(() => {
8903
8903
  return () => {
8904
8904
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
8905
8905
  };
@@ -9111,7 +9111,7 @@ var init_StatusDot = __esm({
9111
9111
  md: "w-2.5 h-2.5",
9112
9112
  lg: "w-3 h-3"
9113
9113
  };
9114
- StatusDot = React93__default.forwardRef(
9114
+ StatusDot = React94__default.forwardRef(
9115
9115
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
9116
9116
  return /* @__PURE__ */ jsx(
9117
9117
  "span",
@@ -9165,7 +9165,7 @@ var init_TrendIndicator = __esm({
9165
9165
  down: "trending-down",
9166
9166
  flat: "arrow-right"
9167
9167
  };
9168
- TrendIndicator = React93__default.forwardRef(
9168
+ TrendIndicator = React94__default.forwardRef(
9169
9169
  ({
9170
9170
  className,
9171
9171
  value,
@@ -9232,7 +9232,7 @@ var init_RangeSlider = __esm({
9232
9232
  md: "w-4 h-4",
9233
9233
  lg: "w-5 h-5"
9234
9234
  };
9235
- RangeSlider = React93__default.forwardRef(
9235
+ RangeSlider = React94__default.forwardRef(
9236
9236
  ({
9237
9237
  className,
9238
9238
  min = 0,
@@ -9740,7 +9740,7 @@ var init_ContentSection = __esm({
9740
9740
  md: "py-16",
9741
9741
  lg: "py-24"
9742
9742
  };
9743
- ContentSection = React93__default.forwardRef(
9743
+ ContentSection = React94__default.forwardRef(
9744
9744
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
9745
9745
  return /* @__PURE__ */ jsx(
9746
9746
  Box,
@@ -10274,7 +10274,7 @@ var init_AnimatedReveal = __esm({
10274
10274
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
10275
10275
  "none": {}
10276
10276
  };
10277
- AnimatedReveal = React93__default.forwardRef(
10277
+ AnimatedReveal = React94__default.forwardRef(
10278
10278
  ({
10279
10279
  trigger = "scroll",
10280
10280
  animation = "fade-up",
@@ -10434,7 +10434,7 @@ var init_AnimatedGraphic = __esm({
10434
10434
  "components/marketing/atoms/AnimatedGraphic.tsx"() {
10435
10435
  "use client";
10436
10436
  init_cn();
10437
- AnimatedGraphic = React93__default.forwardRef(
10437
+ AnimatedGraphic = React94__default.forwardRef(
10438
10438
  ({
10439
10439
  src,
10440
10440
  svgContent,
@@ -10457,7 +10457,7 @@ var init_AnimatedGraphic = __esm({
10457
10457
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
10458
10458
  const resolvedSvg = svgContent ?? fetchedSvg;
10459
10459
  const prevAnimateRef = useRef(animate);
10460
- const setRef = React93__default.useCallback(
10460
+ const setRef = React94__default.useCallback(
10461
10461
  (node) => {
10462
10462
  containerRef.current = node;
10463
10463
  if (typeof ref === "function") ref(node);
@@ -10683,9 +10683,9 @@ function ScoreDisplay({
10683
10683
  ...rest
10684
10684
  }) {
10685
10685
  const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
10686
- const [displayValue, setDisplayValue] = React93.useState(resolvedValue);
10687
- const [isAnimating, setIsAnimating] = React93.useState(false);
10688
- React93.useEffect(() => {
10686
+ const [displayValue, setDisplayValue] = React94.useState(resolvedValue);
10687
+ const [isAnimating, setIsAnimating] = React94.useState(false);
10688
+ React94.useEffect(() => {
10689
10689
  if (!animated || displayValue === resolvedValue) {
10690
10690
  setDisplayValue(resolvedValue);
10691
10691
  return;
@@ -10768,9 +10768,9 @@ function ControlButton({
10768
10768
  className
10769
10769
  }) {
10770
10770
  const eventBus = useEventBus();
10771
- const [isPressed, setIsPressed] = React93.useState(false);
10771
+ const [isPressed, setIsPressed] = React94.useState(false);
10772
10772
  const actualPressed = pressed ?? isPressed;
10773
- const handlePointerDown = React93.useCallback(
10773
+ const handlePointerDown = React94.useCallback(
10774
10774
  (e) => {
10775
10775
  e.preventDefault();
10776
10776
  if (disabled) return;
@@ -10780,7 +10780,7 @@ function ControlButton({
10780
10780
  },
10781
10781
  [disabled, pressEvent, eventBus, onPress]
10782
10782
  );
10783
- const handlePointerUp = React93.useCallback(
10783
+ const handlePointerUp = React94.useCallback(
10784
10784
  (e) => {
10785
10785
  e.preventDefault();
10786
10786
  if (disabled) return;
@@ -10790,7 +10790,7 @@ function ControlButton({
10790
10790
  },
10791
10791
  [disabled, releaseEvent, eventBus, onRelease]
10792
10792
  );
10793
- const handlePointerLeave = React93.useCallback(
10793
+ const handlePointerLeave = React94.useCallback(
10794
10794
  (e) => {
10795
10795
  if (isPressed) {
10796
10796
  setIsPressed(false);
@@ -10869,6 +10869,14 @@ var init_ControlButton = __esm({
10869
10869
  }
10870
10870
  });
10871
10871
 
10872
+ // components/game/organisms/utils/spriteSheetConstants.ts
10873
+ var SHEET_COLUMNS;
10874
+ var init_spriteSheetConstants = __esm({
10875
+ "components/game/organisms/utils/spriteSheetConstants.ts"() {
10876
+ SHEET_COLUMNS = 8;
10877
+ }
10878
+ });
10879
+
10872
10880
  // components/game/organisms/utils/spriteAnimation.ts
10873
10881
  function inferDirection(dx, dy) {
10874
10882
  if (dx === 0 && dy === 0) return "se";
@@ -11411,8 +11419,8 @@ function XPBar({
11411
11419
  }) {
11412
11420
  const sizes = sizeMap9[size];
11413
11421
  const percentage = max > 0 ? Math.max(0, Math.min(100, current / max * 100)) : 0;
11414
- const [fillWidth, setFillWidth] = React93.useState(animated ? 0 : percentage);
11415
- React93.useEffect(() => {
11422
+ const [fillWidth, setFillWidth] = React94.useState(animated ? 0 : percentage);
11423
+ React94.useEffect(() => {
11416
11424
  if (!animated) {
11417
11425
  setFillWidth(percentage);
11418
11426
  return;
@@ -11920,9 +11928,9 @@ function MiniMap({
11920
11928
  viewportRect = DEFAULT_VIEWPORT,
11921
11929
  className
11922
11930
  }) {
11923
- const canvasRef = React93.useRef(null);
11924
- const frameRef = React93.useRef(0);
11925
- React93.useEffect(() => {
11931
+ const canvasRef = React94.useRef(null);
11932
+ const frameRef = React94.useRef(0);
11933
+ React94.useEffect(() => {
11926
11934
  const canvas = canvasRef.current;
11927
11935
  if (!canvas) return;
11928
11936
  const ctx = canvas.getContext("2d");
@@ -12111,7 +12119,7 @@ var init_ErrorBoundary = __esm({
12111
12119
  }
12112
12120
  );
12113
12121
  };
12114
- ErrorBoundary = class extends React93__default.Component {
12122
+ ErrorBoundary = class extends React94__default.Component {
12115
12123
  constructor(props) {
12116
12124
  super(props);
12117
12125
  __publicField(this, "reset", () => {
@@ -13146,8 +13154,8 @@ function ActionButtons({
13146
13154
  disabled
13147
13155
  }) {
13148
13156
  const eventBus = useEventBus();
13149
- const [activeButtons, setActiveButtons] = React93.useState(/* @__PURE__ */ new Set());
13150
- const handlePress = React93.useCallback(
13157
+ const [activeButtons, setActiveButtons] = React94.useState(/* @__PURE__ */ new Set());
13158
+ const handlePress = React94.useCallback(
13151
13159
  (id) => {
13152
13160
  setActiveButtons((prev) => new Set(prev).add(id));
13153
13161
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -13155,7 +13163,7 @@ function ActionButtons({
13155
13163
  },
13156
13164
  [actionEvent, eventBus, onAction]
13157
13165
  );
13158
- const handleRelease = React93.useCallback(
13166
+ const handleRelease = React94.useCallback(
13159
13167
  (id) => {
13160
13168
  setActiveButtons((prev) => {
13161
13169
  const next = new Set(prev);
@@ -14704,6 +14712,11 @@ function isoToScreen(tileX, tileY, scale, baseOffsetX, layout = "isometric") {
14704
14712
  const screenY2 = tileY * (scaledFloorHeight * 0.75);
14705
14713
  return { x: screenX2, y: screenY2 };
14706
14714
  }
14715
+ if (layout === "flat") {
14716
+ const screenX2 = tileX * scaledTileWidth + baseOffsetX;
14717
+ const screenY2 = tileY * scaledFloorHeight;
14718
+ return { x: screenX2, y: screenY2 };
14719
+ }
14707
14720
  const screenX = (tileX - tileY) * (scaledTileWidth / 2) + baseOffsetX;
14708
14721
  const screenY = (tileX + tileY) * (scaledFloorHeight / 2);
14709
14722
  return { x: screenX, y: screenY };
@@ -14716,6 +14729,11 @@ function screenToIso(screenX, screenY, scale, baseOffsetX, layout = "isometric")
14716
14729
  const col = Math.round((screenX - (row & 1) * (scaledTileWidth / 2) - baseOffsetX) / scaledTileWidth);
14717
14730
  return { x: col, y: row };
14718
14731
  }
14732
+ if (layout === "flat") {
14733
+ const col = Math.round((screenX - baseOffsetX) / scaledTileWidth);
14734
+ const row = Math.round(screenY / scaledFloorHeight);
14735
+ return { x: col, y: row };
14736
+ }
14719
14737
  const adjustedX = screenX - baseOffsetX;
14720
14738
  const tileX = (adjustedX / (scaledTileWidth / 2) + screenY / (scaledFloorHeight / 2)) / 2;
14721
14739
  const tileY = (screenY / (scaledFloorHeight / 2) - adjustedX / (scaledTileWidth / 2)) / 2;
@@ -14835,7 +14853,7 @@ function IsometricCanvas({
14835
14853
  );
14836
14854
  const sortedTiles = useMemo(() => {
14837
14855
  const tiles = [...tilesProp];
14838
- if (tileLayout === "hex") {
14856
+ if (tileLayout === "hex" || tileLayout === "flat") {
14839
14857
  tiles.sort((a, b) => a.y !== b.y ? a.y - b.y : a.x - b.x);
14840
14858
  } else {
14841
14859
  tiles.sort((a, b) => {
@@ -14963,7 +14981,7 @@ function IsometricCanvas({
14963
14981
  const minX = Math.min(...allScreenPos.map((p2) => p2.x));
14964
14982
  const maxX = Math.max(...allScreenPos.map((p2) => p2.x + scaledTileWidth));
14965
14983
  const minY = Math.min(...allScreenPos.map((p2) => p2.y));
14966
- const tileBottomExtent = tileLayout === "hex" ? scaledTileWidth : scaledTileHeight;
14984
+ const tileBottomExtent = tileLayout === "hex" || tileLayout === "flat" ? scaledTileWidth : scaledTileHeight;
14967
14985
  const maxY = Math.max(...allScreenPos.map((p2) => p2.y + tileBottomExtent));
14968
14986
  const worldW = maxX - minX;
14969
14987
  const worldH = maxY - minY;
@@ -15056,7 +15074,7 @@ function IsometricCanvas({
15056
15074
  const drawW = scaledTileWidth;
15057
15075
  const drawH = scaledTileWidth * (img.naturalHeight / img.naturalWidth);
15058
15076
  const drawX = pos.x;
15059
- const drawY = tileLayout === "hex" ? pos.y : pos.y + scaledTileHeight - drawH;
15077
+ const drawY = tileLayout === "hex" || tileLayout === "flat" ? pos.y : pos.y + scaledTileHeight - drawH;
15060
15078
  ctx.drawImage(img, drawX, drawY, drawW, drawH);
15061
15079
  }
15062
15080
  } else {
@@ -15123,7 +15141,7 @@ function IsometricCanvas({
15123
15141
  }
15124
15142
  }
15125
15143
  const sortedFeatures = [...features].sort((a, b) => {
15126
- if (tileLayout === "hex") return a.y !== b.y ? a.y - b.y : a.x - b.x;
15144
+ if (tileLayout === "hex" || tileLayout === "flat") return a.y !== b.y ? a.y - b.y : a.x - b.x;
15127
15145
  const depthA = a.x + a.y;
15128
15146
  const depthB = b.x + b.y;
15129
15147
  return depthA !== depthB ? depthA - depthB : a.y - b.y;
@@ -15164,7 +15182,7 @@ function IsometricCanvas({
15164
15182
  }
15165
15183
  const unitsWithPosition = units.filter((u) => !!u.position);
15166
15184
  const sortedUnits = [...unitsWithPosition].sort((a, b) => {
15167
- if (tileLayout === "hex") return a.position.y !== b.position.y ? a.position.y - b.position.y : a.position.x - b.position.x;
15185
+ if (tileLayout === "hex" || tileLayout === "flat") return a.position.y !== b.position.y ? a.position.y - b.position.y : a.position.x - b.position.x;
15168
15186
  const depthA = a.position.x + a.position.y;
15169
15187
  const depthB = b.position.x + b.position.y;
15170
15188
  return depthA !== depthB ? depthA - depthB : a.position.y - b.position.y;
@@ -15182,7 +15200,13 @@ function IsometricCanvas({
15182
15200
  const img = unitSpriteUrl ? getImage(unitSpriteUrl) : null;
15183
15201
  const unitDrawH = scaledFloorHeight * spriteHeightRatio * unitScale;
15184
15202
  const maxUnitW = scaledTileWidth * spriteMaxWidthRatio * unitScale;
15185
- const ar = img ? img.naturalWidth / img.naturalHeight : 0.5;
15203
+ const SHEET_ROWS = 5;
15204
+ const sheetFrameW = img ? img.naturalWidth / SHEET_COLUMNS : 0;
15205
+ const sheetFrameH = img ? img.naturalHeight / SHEET_ROWS : 0;
15206
+ const imgIsSheet = img ? img.naturalWidth % SHEET_COLUMNS === 0 && img.naturalHeight % SHEET_ROWS === 0 && Math.abs(sheetFrameW - sheetFrameH) < 2 : false;
15207
+ const frameW = imgIsSheet ? sheetFrameW : img?.naturalWidth ?? 1;
15208
+ const frameH = imgIsSheet ? sheetFrameH : img?.naturalHeight ?? 1;
15209
+ const ar = frameW / (frameH || 1);
15186
15210
  let drawH = unitDrawH;
15187
15211
  let drawW = unitDrawH * ar;
15188
15212
  if (drawW > maxUnitW) {
@@ -15196,7 +15220,11 @@ function IsometricCanvas({
15196
15220
  ctx.save();
15197
15221
  ctx.globalAlpha = 0.25;
15198
15222
  if (img) {
15199
- ctx.drawImage(img, ghostCenterX - drawW / 2, ghostGroundY - drawH, drawW, drawH);
15223
+ if (imgIsSheet) {
15224
+ ctx.drawImage(img, 0, 0, sheetFrameW, sheetFrameH, ghostCenterX - drawW / 2, ghostGroundY - drawH, drawW, drawH);
15225
+ } else {
15226
+ ctx.drawImage(img, ghostCenterX - drawW / 2, ghostGroundY - drawH, drawW, drawH);
15227
+ }
15200
15228
  } else {
15201
15229
  const color = unit.team === "player" ? "#3b82f6" : unit.team === "enemy" ? "#ef4444" : "#6b7280";
15202
15230
  ctx.beginPath();
@@ -15240,14 +15268,21 @@ function IsometricCanvas({
15240
15268
  ctx.restore();
15241
15269
  } else if (img) {
15242
15270
  const spriteY = groundY - drawH - breatheOffset;
15271
+ const drawUnit = (x) => {
15272
+ if (imgIsSheet) {
15273
+ ctx.drawImage(img, 0, 0, sheetFrameW, sheetFrameH, x, spriteY, drawW, drawH);
15274
+ } else {
15275
+ ctx.drawImage(img, x, spriteY, drawW, drawH);
15276
+ }
15277
+ };
15243
15278
  if (unit.team) {
15244
15279
  ctx.save();
15245
15280
  ctx.shadowColor = unit.team === "player" ? "rgba(0, 150, 255, 0.6)" : "rgba(255, 50, 50, 0.6)";
15246
15281
  ctx.shadowBlur = 12 * scale;
15247
- ctx.drawImage(img, centerX - drawW / 2, spriteY, drawW, drawH);
15282
+ drawUnit(centerX - drawW / 2);
15248
15283
  ctx.restore();
15249
15284
  } else {
15250
- ctx.drawImage(img, centerX - drawW / 2, spriteY, drawW, drawH);
15285
+ drawUnit(centerX - drawW / 2);
15251
15286
  }
15252
15287
  } else {
15253
15288
  const color = unit.team === "player" ? "#3b82f6" : unit.team === "enemy" ? "#ef4444" : "#6b7280";
@@ -15540,6 +15575,7 @@ var init_IsometricCanvas = __esm({
15540
15575
  init_useUnitSpriteAtlas();
15541
15576
  init_verificationRegistry();
15542
15577
  init_isometric();
15578
+ init_spriteSheetConstants();
15543
15579
  IsometricCanvas.displayName = "IsometricCanvas";
15544
15580
  IsometricCanvas_default = IsometricCanvas;
15545
15581
  }
@@ -16510,7 +16546,7 @@ var init_CodeBlock = __esm({
16510
16546
  };
16511
16547
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
16512
16548
  HIDDEN_LINE_NUMBERS = { display: "none" };
16513
- CodeBlock = React93__default.memo(
16549
+ CodeBlock = React94__default.memo(
16514
16550
  ({
16515
16551
  code: rawCode,
16516
16552
  language = "text",
@@ -17097,7 +17133,7 @@ var init_MarkdownContent = __esm({
17097
17133
  init_Box();
17098
17134
  init_CodeBlock();
17099
17135
  init_cn();
17100
- MarkdownContent = React93__default.memo(
17136
+ MarkdownContent = React94__default.memo(
17101
17137
  ({ content, direction = "ltr", className }) => {
17102
17138
  const { t: _t } = useTranslate();
17103
17139
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -17387,6 +17423,48 @@ var init_BloomQuizBlock = __esm({
17387
17423
  BloomQuizBlock.displayName = "BloomQuizBlock";
17388
17424
  }
17389
17425
  });
17426
+ function BoardgameBoard({
17427
+ tiles,
17428
+ units,
17429
+ features,
17430
+ assetManifest,
17431
+ assetBaseUrl,
17432
+ scale = 0.45,
17433
+ showMinimap = false,
17434
+ enableCamera = true,
17435
+ tileClickEvent,
17436
+ unitClickEvent,
17437
+ isLoading,
17438
+ error,
17439
+ className
17440
+ }) {
17441
+ return /* @__PURE__ */ jsx("div", { className: cn("boardgame-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
17442
+ IsometricCanvas_default,
17443
+ {
17444
+ tileLayout: "flat",
17445
+ tiles,
17446
+ units,
17447
+ features,
17448
+ assetManifest,
17449
+ assetBaseUrl,
17450
+ scale,
17451
+ showMinimap,
17452
+ enableCamera,
17453
+ tileClickEvent,
17454
+ unitClickEvent,
17455
+ isLoading,
17456
+ error
17457
+ }
17458
+ ) });
17459
+ }
17460
+ var init_BoardgameBoard = __esm({
17461
+ "components/game/organisms/BoardgameBoard.tsx"() {
17462
+ "use client";
17463
+ init_cn();
17464
+ init_IsometricCanvas();
17465
+ BoardgameBoard.displayName = "BoardgameBoard";
17466
+ }
17467
+ });
17390
17468
  var MIN_DIAGRAM_WIDTH, ScaledDiagram;
17391
17469
  var init_ScaledDiagram = __esm({
17392
17470
  "components/core/molecules/ScaledDiagram.tsx"() {
@@ -18424,7 +18502,7 @@ var init_StateMachineView = __esm({
18424
18502
  style: { top: title ? 30 : 0 },
18425
18503
  children: [
18426
18504
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
18427
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React93__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
18505
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React94__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
18428
18506
  StateNode,
18429
18507
  {
18430
18508
  state,
@@ -22379,7 +22457,7 @@ function CardHand({
22379
22457
  className
22380
22458
  }) {
22381
22459
  const eventBus = useEventBus();
22382
- const handleClick = React93.useCallback(
22460
+ const handleClick = React94.useCallback(
22383
22461
  (card) => {
22384
22462
  if (card.disabled) return;
22385
22463
  onCardClick?.(card.id);
@@ -24525,6 +24603,215 @@ var init_ChartLegend = __esm({
24525
24603
  ChartLegend.displayName = "ChartLegend";
24526
24604
  }
24527
24605
  });
24606
+
24607
+ // components/core/organisms/trace-edit-focus.ts
24608
+ function asString(v) {
24609
+ return typeof v === "string" ? v : void 0;
24610
+ }
24611
+ function asLevel(v) {
24612
+ if (typeof v === "string" && EDIT_FOCUS_LEVELS.has(v)) {
24613
+ return v;
24614
+ }
24615
+ return "node";
24616
+ }
24617
+ function isEventPayload(v) {
24618
+ return v !== null && v !== void 0 && typeof v === "object" && !Array.isArray(v) && !(v instanceof Date);
24619
+ }
24620
+ function parseEditFocus(value) {
24621
+ if (!isEventPayload(value)) return null;
24622
+ const payload = value;
24623
+ const orbital = asString(payload.orbital);
24624
+ if (orbital === void 0 || orbital.length === 0) return null;
24625
+ const focus = {
24626
+ level: asLevel(payload.level),
24627
+ orbital,
24628
+ label: asString(payload.label) ?? orbital
24629
+ };
24630
+ const trait = asString(payload.trait);
24631
+ if (trait !== void 0) focus.trait = trait;
24632
+ const transition = asString(payload.transition);
24633
+ if (transition !== void 0) focus.transition = transition;
24634
+ const state = asString(payload.state);
24635
+ if (state !== void 0) focus.state = state;
24636
+ const slot = asString(payload.slot);
24637
+ if (slot !== void 0) focus.slot = slot;
24638
+ const path = asString(payload.path);
24639
+ if (path !== void 0) focus.path = path;
24640
+ const patternType = asString(payload.patternType);
24641
+ if (patternType !== void 0) focus.patternType = patternType;
24642
+ const entity = asString(payload.entity);
24643
+ if (entity !== void 0) focus.entity = entity;
24644
+ const source = asString(payload.source);
24645
+ if (source !== void 0) focus.source = source;
24646
+ return focus;
24647
+ }
24648
+ var ELEMENT_SELECTED_EVENT, EDIT_FOCUS_LEVELS;
24649
+ var init_trace_edit_focus = __esm({
24650
+ "components/core/organisms/trace-edit-focus.ts"() {
24651
+ ELEMENT_SELECTED_EVENT = "UI:ELEMENT_SELECTED";
24652
+ EDIT_FOCUS_LEVELS = /* @__PURE__ */ new Set([
24653
+ "node",
24654
+ "slot",
24655
+ "field",
24656
+ "effect",
24657
+ "trait",
24658
+ "page",
24659
+ "orbital"
24660
+ ]);
24661
+ }
24662
+ });
24663
+ function getJepaBadgeVariant(probability) {
24664
+ if (probability >= 0.9) return "success";
24665
+ if (probability >= 0.5) return "warning";
24666
+ return "danger";
24667
+ }
24668
+ function ChatBar({
24669
+ status = "idle",
24670
+ activeGate,
24671
+ jepaValidity,
24672
+ placeholder,
24673
+ context,
24674
+ className
24675
+ }) {
24676
+ const { t } = useTranslate();
24677
+ const eventBus = useEventBus();
24678
+ const [inputValue, setInputValue] = useState("");
24679
+ const [focus, setFocus] = useState(null);
24680
+ const clearFocus = useCallback(() => {
24681
+ setFocus(null);
24682
+ eventBus.emit(ELEMENT_SELECTED_EVENT, { focus: null });
24683
+ }, [eventBus]);
24684
+ const handleKeyDown = useCallback((e) => {
24685
+ if (e.key !== "Enter" || e.shiftKey) return;
24686
+ const trimmed = inputValue.trim();
24687
+ if (!trimmed) return;
24688
+ e.preventDefault();
24689
+ eventBus.emit("UI:CHAT_SEND", { message: trimmed });
24690
+ }, [inputValue, eventBus]);
24691
+ useEffect(() => {
24692
+ const unsubSend = eventBus.on("UI:CHAT_SEND", () => {
24693
+ setInputValue("");
24694
+ setFocus(null);
24695
+ });
24696
+ const unsubSelect = eventBus.on(ELEMENT_SELECTED_EVENT, (e) => {
24697
+ setFocus(parseEditFocus(e.payload?.focus));
24698
+ });
24699
+ return () => {
24700
+ unsubSend();
24701
+ unsubSelect();
24702
+ };
24703
+ }, [eventBus]);
24704
+ const trailingAction = status === "error" ? /* @__PURE__ */ jsxs(Button, { variant: "secondary", size: "sm", action: "RETRY_GENERATION", className: "rounded-none flex-shrink-0 h-auto", children: [
24705
+ /* @__PURE__ */ jsx(Icon, { name: "refresh-cw", size: "xs" }),
24706
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", children: t("openFile.retry") })
24707
+ ] }) : status === "running" ? /* @__PURE__ */ jsxs(Fragment, { children: [
24708
+ /* @__PURE__ */ jsx(
24709
+ Button,
24710
+ {
24711
+ variant: "ghost",
24712
+ size: "sm",
24713
+ action: "PAUSE",
24714
+ title: t("chatBar.pauseTheAgentYouCanEdit"),
24715
+ className: "rounded-none flex-shrink-0 h-auto",
24716
+ children: /* @__PURE__ */ jsx(Icon, { name: "pause", size: "xs" })
24717
+ }
24718
+ ),
24719
+ /* @__PURE__ */ jsx(
24720
+ Button,
24721
+ {
24722
+ variant: "ghost",
24723
+ size: "sm",
24724
+ action: "STOP",
24725
+ title: t("chatBar.cancelGeneration"),
24726
+ className: "rounded-none flex-shrink-0 h-auto border-l border-[var(--color-border)]",
24727
+ children: /* @__PURE__ */ jsx(Icon, { name: "square", size: "xs" })
24728
+ }
24729
+ )
24730
+ ] }) : status === "paused" ? /* @__PURE__ */ jsxs(
24731
+ Button,
24732
+ {
24733
+ variant: "primary",
24734
+ size: "sm",
24735
+ action: "RESUME",
24736
+ title: t("chatBar.resumeTheAgentYourCanvasEdits"),
24737
+ className: "rounded-none flex-shrink-0 h-auto",
24738
+ children: [
24739
+ /* @__PURE__ */ jsx(Icon, { name: "play", size: "xs" }),
24740
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", children: t("chatBar.resume") })
24741
+ ]
24742
+ }
24743
+ ) : /* @__PURE__ */ jsx(
24744
+ Button,
24745
+ {
24746
+ variant: "primary",
24747
+ size: "sm",
24748
+ action: "CHAT_SEND",
24749
+ actionPayload: { message: inputValue.trim() },
24750
+ disabled: !inputValue.trim(),
24751
+ "aria-label": t("chatBar.sendMessage"),
24752
+ className: "rounded-none flex-shrink-0 h-auto",
24753
+ children: /* @__PURE__ */ jsx(Icon, { name: "send", size: "xs" })
24754
+ }
24755
+ );
24756
+ return /* @__PURE__ */ jsxs(Box, { className: `border-t border-[var(--color-border)] bg-[var(--color-card)] ${className ?? ""}`, children: [
24757
+ focus && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "items-center px-4 pt-2", children: /* @__PURE__ */ jsxs(Badge, { variant: "secondary", size: "sm", className: "flex items-center gap-1 max-w-full", children: [
24758
+ /* @__PURE__ */ jsx(Icon, { name: "mouse-pointer-2", size: "xs" }),
24759
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-inherit truncate", children: [
24760
+ t("chatBar.editing"),
24761
+ ": ",
24762
+ focus.label
24763
+ ] }),
24764
+ /* @__PURE__ */ jsx(
24765
+ Box,
24766
+ {
24767
+ onClick: clearFocus,
24768
+ title: t("chatBar.clearSelection"),
24769
+ className: "cursor-pointer flex items-center ml-1 hover:opacity-70",
24770
+ children: /* @__PURE__ */ jsx(Icon, { name: "x", size: "xs" })
24771
+ }
24772
+ )
24773
+ ] }) }),
24774
+ /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center px-4 py-2", children: [
24775
+ context && /* @__PURE__ */ jsx(Badge, { variant: "primary", size: "sm", className: "whitespace-nowrap flex-shrink-0", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-inherit", children: context }) }),
24776
+ /* @__PURE__ */ jsxs(Box, { className: "flex-1 min-w-0 flex items-stretch rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-background)] focus-within:border-[var(--color-primary)] overflow-hidden", children: [
24777
+ /* @__PURE__ */ jsx(
24778
+ Textarea,
24779
+ {
24780
+ value: inputValue,
24781
+ placeholder: placeholder ?? t("chatBar.askTheAgentAnything"),
24782
+ onChange: (e) => setInputValue(e.target.value),
24783
+ onKeyDown: handleKeyDown,
24784
+ rows: 1,
24785
+ className: "flex-1 min-w-0 min-h-0 text-sm border-0 rounded-none shadow-none bg-transparent resize-none focus:ring-0"
24786
+ }
24787
+ ),
24788
+ trailingAction
24789
+ ] }),
24790
+ (activeGate || jepaValidity !== void 0) && /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center flex-shrink-0", children: [
24791
+ activeGate && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "whitespace-nowrap", children: activeGate }),
24792
+ jepaValidity !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: getJepaBadgeVariant(jepaValidity), size: "sm", children: /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-inherit", children: [
24793
+ (jepaValidity * 100).toFixed(1),
24794
+ "%"
24795
+ ] }) })
24796
+ ] })
24797
+ ] })
24798
+ ] });
24799
+ }
24800
+ var init_ChatBar = __esm({
24801
+ "components/core/organisms/ChatBar.tsx"() {
24802
+ "use client";
24803
+ init_Box();
24804
+ init_Stack();
24805
+ init_Typography();
24806
+ init_Button();
24807
+ init_Badge();
24808
+ init_Icon();
24809
+ init_Textarea();
24810
+ init_useEventBus();
24811
+ init_trace_edit_focus();
24812
+ ChatBar.displayName = "ChatBar";
24813
+ }
24814
+ });
24528
24815
  function resolveManifestUrl2(manifest, relative) {
24529
24816
  if (relative == null) return void 0;
24530
24817
  if (/^https?:\/\//.test(relative)) return relative;
@@ -25648,7 +25935,7 @@ function CraftingRecipe({
25648
25935
  className
25649
25936
  }) {
25650
25937
  const eventBus = useEventBus();
25651
- const handleCraft = React93.useCallback(() => {
25938
+ const handleCraft = React94.useCallback(() => {
25652
25939
  onCraft?.();
25653
25940
  if (craftEvent) {
25654
25941
  eventBus.emit(craftEvent, { output: output.label });
@@ -25665,7 +25952,7 @@ function CraftingRecipe({
25665
25952
  children: [
25666
25953
  /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
25667
25954
  const hasSufficient = ingredient.available >= ingredient.required;
25668
- return /* @__PURE__ */ jsxs(React93.Fragment, { children: [
25955
+ return /* @__PURE__ */ jsxs(React94.Fragment, { children: [
25669
25956
  /* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
25670
25957
  ItemSlot,
25671
25958
  {
@@ -25737,8 +26024,8 @@ function DPad({
25737
26024
  }) {
25738
26025
  const eventBus = useEventBus();
25739
26026
  const sizes = sizeMap15[size];
25740
- const [activeDirections, setActiveDirections] = React93.useState(/* @__PURE__ */ new Set());
25741
- const handlePress = React93.useCallback(
26027
+ const [activeDirections, setActiveDirections] = React94.useState(/* @__PURE__ */ new Set());
26028
+ const handlePress = React94.useCallback(
25742
26029
  (direction) => {
25743
26030
  setActiveDirections((prev) => new Set(prev).add(direction));
25744
26031
  if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
@@ -25746,7 +26033,7 @@ function DPad({
25746
26033
  },
25747
26034
  [directionEvent, eventBus, onDirection]
25748
26035
  );
25749
- const handleRelease = React93.useCallback(
26036
+ const handleRelease = React94.useCallback(
25750
26037
  (direction) => {
25751
26038
  setActiveDirections((prev) => {
25752
26039
  const next = new Set(prev);
@@ -26631,8 +26918,8 @@ var init_Menu = __esm({
26631
26918
  "bottom-end": "bottom-start"
26632
26919
  };
26633
26920
  const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
26634
- const triggerChild = React93__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
26635
- const triggerElement = React93__default.cloneElement(
26921
+ const triggerChild = React94__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
26922
+ const triggerElement = React94__default.cloneElement(
26636
26923
  triggerChild,
26637
26924
  {
26638
26925
  ref: triggerRef,
@@ -26727,14 +27014,14 @@ function useDataDnd(args) {
26727
27014
  const isZone = Boolean(dragGroup || accepts || sortable);
26728
27015
  const enabled = isZone || Boolean(dndRoot);
26729
27016
  const eventBus = useEventBus();
26730
- const parentRoot = React93__default.useContext(RootCtx);
27017
+ const parentRoot = React94__default.useContext(RootCtx);
26731
27018
  const isRoot = enabled && parentRoot === null;
26732
- const zoneId = React93__default.useId();
27019
+ const zoneId = React94__default.useId();
26733
27020
  const ownGroup = dragGroup ?? accepts ?? zoneId;
26734
- const [optimisticOrders, setOptimisticOrders] = React93__default.useState(() => /* @__PURE__ */ new Map());
26735
- const optimisticOrdersRef = React93__default.useRef(optimisticOrders);
27021
+ const [optimisticOrders, setOptimisticOrders] = React94__default.useState(() => /* @__PURE__ */ new Map());
27022
+ const optimisticOrdersRef = React94__default.useRef(optimisticOrders);
26736
27023
  optimisticOrdersRef.current = optimisticOrders;
26737
- const clearOptimisticOrder = React93__default.useCallback((group) => {
27024
+ const clearOptimisticOrder = React94__default.useCallback((group) => {
26738
27025
  setOptimisticOrders((prev) => {
26739
27026
  if (!prev.has(group)) return prev;
26740
27027
  const next = new Map(prev);
@@ -26759,7 +27046,7 @@ function useDataDnd(args) {
26759
27046
  const raw = it[dndItemIdField];
26760
27047
  return String(raw ?? `__idx_${idx}`);
26761
27048
  }).join("|");
26762
- const itemIds = React93__default.useMemo(
27049
+ const itemIds = React94__default.useMemo(
26763
27050
  () => orderedItems.map((it, idx) => {
26764
27051
  const raw = it[dndItemIdField];
26765
27052
  return raw ?? `__idx_${idx}`;
@@ -26767,7 +27054,7 @@ function useDataDnd(args) {
26767
27054
  [itemIdsSignature]
26768
27055
  );
26769
27056
  const itemsContentSig = items.map((it, idx) => String(it[dndItemIdField] ?? `__${idx}`)).join("|");
26770
- React93__default.useEffect(() => {
27057
+ React94__default.useEffect(() => {
26771
27058
  const root = isRoot ? null : parentRoot;
26772
27059
  if (root) {
26773
27060
  root.clearOptimisticOrder(ownGroup);
@@ -26775,20 +27062,20 @@ function useDataDnd(args) {
26775
27062
  clearOptimisticOrder(ownGroup);
26776
27063
  }
26777
27064
  }, [itemsContentSig, ownGroup]);
26778
- const zonesRef = React93__default.useRef(/* @__PURE__ */ new Map());
26779
- const registerZone = React93__default.useCallback((zoneId2, meta2) => {
27065
+ const zonesRef = React94__default.useRef(/* @__PURE__ */ new Map());
27066
+ const registerZone = React94__default.useCallback((zoneId2, meta2) => {
26780
27067
  zonesRef.current.set(zoneId2, meta2);
26781
27068
  }, []);
26782
- const unregisterZone = React93__default.useCallback((zoneId2) => {
27069
+ const unregisterZone = React94__default.useCallback((zoneId2) => {
26783
27070
  zonesRef.current.delete(zoneId2);
26784
27071
  }, []);
26785
- const [activeDrag, setActiveDrag] = React93__default.useState(null);
26786
- const [overZoneGroup, setOverZoneGroup] = React93__default.useState(null);
26787
- const meta = React93__default.useMemo(
27072
+ const [activeDrag, setActiveDrag] = React94__default.useState(null);
27073
+ const [overZoneGroup, setOverZoneGroup] = React94__default.useState(null);
27074
+ const meta = React94__default.useMemo(
26788
27075
  () => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
26789
27076
  [ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
26790
27077
  );
26791
- React93__default.useEffect(() => {
27078
+ React94__default.useEffect(() => {
26792
27079
  const target = isRoot ? null : parentRoot;
26793
27080
  if (!target) {
26794
27081
  zonesRef.current.set(zoneId, meta);
@@ -26807,7 +27094,7 @@ function useDataDnd(args) {
26807
27094
  }, [parentRoot, isRoot, zoneId, meta]);
26808
27095
  const sensors = useAlmadarDndSensors(true);
26809
27096
  const collisionDetection = almadarDndCollisionDetection;
26810
- const findZoneByItem = React93__default.useCallback(
27097
+ const findZoneByItem = React94__default.useCallback(
26811
27098
  (id) => {
26812
27099
  for (const z of zonesRef.current.values()) {
26813
27100
  if (z.itemIds.includes(id)) return z;
@@ -26816,7 +27103,7 @@ function useDataDnd(args) {
26816
27103
  },
26817
27104
  []
26818
27105
  );
26819
- React93__default.useCallback(
27106
+ React94__default.useCallback(
26820
27107
  (group) => {
26821
27108
  for (const z of zonesRef.current.values()) {
26822
27109
  if (z.group === group) return z;
@@ -26825,7 +27112,7 @@ function useDataDnd(args) {
26825
27112
  },
26826
27113
  []
26827
27114
  );
26828
- const handleDragEnd = React93__default.useCallback(
27115
+ const handleDragEnd = React94__default.useCallback(
26829
27116
  (event) => {
26830
27117
  const { active, over } = event;
26831
27118
  const activeIdStr = String(active.id);
@@ -26916,8 +27203,8 @@ function useDataDnd(args) {
26916
27203
  },
26917
27204
  [eventBus]
26918
27205
  );
26919
- const sortableData = React93__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
26920
- const SortableItem = React93__default.useCallback(
27206
+ const sortableData = React94__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
27207
+ const SortableItem = React94__default.useCallback(
26921
27208
  ({ id, children }) => {
26922
27209
  const {
26923
27210
  attributes,
@@ -26957,7 +27244,7 @@ function useDataDnd(args) {
26957
27244
  id: droppableId,
26958
27245
  data: sortableData
26959
27246
  });
26960
- const ctx = React93__default.useContext(RootCtx);
27247
+ const ctx = React94__default.useContext(RootCtx);
26961
27248
  const activeDrag2 = ctx?.activeDrag ?? null;
26962
27249
  const overZoneGroup2 = ctx?.overZoneGroup ?? null;
26963
27250
  const isThisZoneOver = overZoneGroup2 === ownGroup;
@@ -26972,7 +27259,7 @@ function useDataDnd(args) {
26972
27259
  showForeignPlaceholder,
26973
27260
  ctxAvailable: ctx != null
26974
27261
  });
26975
- React93__default.useEffect(() => {
27262
+ React94__default.useEffect(() => {
26976
27263
  dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
26977
27264
  }, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
26978
27265
  return /* @__PURE__ */ jsx(
@@ -26986,11 +27273,11 @@ function useDataDnd(args) {
26986
27273
  }
26987
27274
  );
26988
27275
  };
26989
- const rootContextValue = React93__default.useMemo(
27276
+ const rootContextValue = React94__default.useMemo(
26990
27277
  () => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
26991
27278
  [registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
26992
27279
  );
26993
- const handleDragStart = React93__default.useCallback((event) => {
27280
+ const handleDragStart = React94__default.useCallback((event) => {
26994
27281
  const sourceZone = findZoneByItem(event.active.id);
26995
27282
  const rect = event.active.rect.current.initial;
26996
27283
  const height = rect?.height && rect.height > 0 ? rect.height : 64;
@@ -27009,7 +27296,7 @@ function useDataDnd(args) {
27009
27296
  isRoot
27010
27297
  });
27011
27298
  }, [findZoneByItem, isRoot, zoneId]);
27012
- const handleDragOver = React93__default.useCallback((event) => {
27299
+ const handleDragOver = React94__default.useCallback((event) => {
27013
27300
  const { active, over } = event;
27014
27301
  const overData = over?.data?.current;
27015
27302
  const overGroup = overData?.dndGroup ?? null;
@@ -27079,7 +27366,7 @@ function useDataDnd(args) {
27079
27366
  return next;
27080
27367
  });
27081
27368
  }, []);
27082
- const handleDragCancel = React93__default.useCallback((event) => {
27369
+ const handleDragCancel = React94__default.useCallback((event) => {
27083
27370
  setActiveDrag(null);
27084
27371
  setOverZoneGroup(null);
27085
27372
  dndLog.warn("dragCancel", {
@@ -27087,12 +27374,12 @@ function useDataDnd(args) {
27087
27374
  reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
27088
27375
  });
27089
27376
  }, []);
27090
- const handleDragEndWithCleanup = React93__default.useCallback((event) => {
27377
+ const handleDragEndWithCleanup = React94__default.useCallback((event) => {
27091
27378
  handleDragEnd(event);
27092
27379
  setActiveDrag(null);
27093
27380
  setOverZoneGroup(null);
27094
27381
  }, [handleDragEnd]);
27095
- const wrapContainer = React93__default.useCallback(
27382
+ const wrapContainer = React94__default.useCallback(
27096
27383
  (children) => {
27097
27384
  if (!enabled) return children;
27098
27385
  const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
@@ -27146,7 +27433,7 @@ var init_useDataDnd = __esm({
27146
27433
  init_useAlmadarDndCollision();
27147
27434
  init_Box();
27148
27435
  dndLog = createLogger("almadar:ui:dnd");
27149
- RootCtx = React93__default.createContext(null);
27436
+ RootCtx = React94__default.createContext(null);
27150
27437
  }
27151
27438
  });
27152
27439
  function renderIconInput(icon, props) {
@@ -27672,7 +27959,7 @@ function DataList({
27672
27959
  }) {
27673
27960
  const eventBus = useEventBus();
27674
27961
  const { t } = useTranslate();
27675
- const [visibleCount, setVisibleCount] = React93__default.useState(pageSize || Infinity);
27962
+ const [visibleCount, setVisibleCount] = React94__default.useState(pageSize || Infinity);
27676
27963
  const fieldDefs = fields ?? columns ?? [];
27677
27964
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
27678
27965
  const dnd = useDataDnd({
@@ -27691,7 +27978,7 @@ function DataList({
27691
27978
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
27692
27979
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
27693
27980
  const hasRenderProp = typeof children === "function";
27694
- React93__default.useEffect(() => {
27981
+ React94__default.useEffect(() => {
27695
27982
  const renderItemTypeOf = typeof schemaRenderItem;
27696
27983
  const childrenTypeOf = typeof children;
27697
27984
  if (data.length > 0 && !hasRenderProp) {
@@ -27796,7 +28083,7 @@ function DataList({
27796
28083
  const items2 = data.map((item) => item);
27797
28084
  const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
27798
28085
  const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
27799
- return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
28086
+ return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
27800
28087
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
27801
28088
  group.items.map((itemData, index) => {
27802
28089
  const id = itemData.id || `${gi}-${index}`;
@@ -27937,7 +28224,7 @@ function DataList({
27937
28224
  className
27938
28225
  ),
27939
28226
  children: [
27940
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
28227
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
27941
28228
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
27942
28229
  group.items.map(
27943
28230
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -28853,7 +29140,7 @@ var init_Grid = __esm({
28853
29140
  as: Component2 = "div"
28854
29141
  }) => {
28855
29142
  const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
28856
- return React93__default.createElement(
29143
+ return React94__default.createElement(
28857
29144
  Component2,
28858
29145
  {
28859
29146
  className: cn(
@@ -29049,9 +29336,9 @@ var init_Popover = __esm({
29049
29336
  onMouseLeave: handleClose,
29050
29337
  onPointerDown: tapTriggerProps.onPointerDown
29051
29338
  };
29052
- const childElement = React93__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
29339
+ const childElement = React94__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
29053
29340
  const childPointerDown = childElement.props.onPointerDown;
29054
- const triggerElement = React93__default.cloneElement(
29341
+ const triggerElement = React94__default.cloneElement(
29055
29342
  childElement,
29056
29343
  {
29057
29344
  ref: triggerRef,
@@ -29653,9 +29940,9 @@ var init_Tooltip = __esm({
29653
29940
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
29654
29941
  };
29655
29942
  }, []);
29656
- const triggerElement = React93__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
29943
+ const triggerElement = React94__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
29657
29944
  const childPointerDown = triggerElement.props.onPointerDown;
29658
- const trigger = React93__default.cloneElement(triggerElement, {
29945
+ const trigger = React94__default.cloneElement(triggerElement, {
29659
29946
  ref: triggerRef,
29660
29947
  onMouseEnter: handleMouseEnter,
29661
29948
  onMouseLeave: handleMouseLeave,
@@ -29745,7 +30032,7 @@ var init_WizardProgress = __esm({
29745
30032
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
29746
30033
  const isActive = index === currentStep;
29747
30034
  const isCompleted = index < currentStep;
29748
- return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
30035
+ return /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
29749
30036
  /* @__PURE__ */ jsx(
29750
30037
  "button",
29751
30038
  {
@@ -30808,7 +31095,7 @@ function InventoryGrid({
30808
31095
  const eventBus = useEventBus();
30809
31096
  const slotCount = totalSlots ?? items.length;
30810
31097
  const emptySlotCount = Math.max(0, slotCount - items.length);
30811
- const handleSelect = React93.useCallback(
31098
+ const handleSelect = React94.useCallback(
30812
31099
  (id) => {
30813
31100
  onSelect?.(id);
30814
31101
  if (selectEvent) {
@@ -31043,31 +31330,31 @@ function GameCanvas2D({
31043
31330
  assetBaseUrl,
31044
31331
  className
31045
31332
  }) {
31046
- const canvasRef = React93.useRef(null);
31047
- const rafRef = React93.useRef(0);
31048
- const frameRef = React93.useRef(0);
31049
- const lastTimeRef = React93.useRef(0);
31050
- const imageCache = React93.useRef(/* @__PURE__ */ new Map());
31333
+ const canvasRef = React94.useRef(null);
31334
+ const rafRef = React94.useRef(0);
31335
+ const frameRef = React94.useRef(0);
31336
+ const lastTimeRef = React94.useRef(0);
31337
+ const imageCache = React94.useRef(/* @__PURE__ */ new Map());
31051
31338
  const emit = useEmitEvent();
31052
- const onDrawRef = React93.useRef(onDraw);
31339
+ const onDrawRef = React94.useRef(onDraw);
31053
31340
  onDrawRef.current = onDraw;
31054
- const onTickRef = React93.useRef(onTick);
31341
+ const onTickRef = React94.useRef(onTick);
31055
31342
  onTickRef.current = onTick;
31056
- const tickEventRef = React93.useRef(tickEvent);
31343
+ const tickEventRef = React94.useRef(tickEvent);
31057
31344
  tickEventRef.current = tickEvent;
31058
- const drawEventRef = React93.useRef(drawEvent);
31345
+ const drawEventRef = React94.useRef(drawEvent);
31059
31346
  drawEventRef.current = drawEvent;
31060
- const emitRef = React93.useRef(emit);
31347
+ const emitRef = React94.useRef(emit);
31061
31348
  emitRef.current = emit;
31062
- const assetBaseUrlRef = React93.useRef(assetBaseUrl);
31349
+ const assetBaseUrlRef = React94.useRef(assetBaseUrl);
31063
31350
  assetBaseUrlRef.current = assetBaseUrl;
31064
- const backgroundImageRef = React93.useRef(backgroundImage);
31351
+ const backgroundImageRef = React94.useRef(backgroundImage);
31065
31352
  backgroundImageRef.current = backgroundImage;
31066
- const widthRef = React93.useRef(width);
31353
+ const widthRef = React94.useRef(width);
31067
31354
  widthRef.current = width;
31068
- const heightRef = React93.useRef(height);
31355
+ const heightRef = React94.useRef(height);
31069
31356
  heightRef.current = height;
31070
- const loadImage = React93.useCallback((url) => {
31357
+ const loadImage = React94.useCallback((url) => {
31071
31358
  const base = assetBaseUrlRef.current;
31072
31359
  if (!url.startsWith("http") && !base) return null;
31073
31360
  const fullUrl = url.startsWith("http") ? url : `${base}${url}`;
@@ -31081,7 +31368,7 @@ function GameCanvas2D({
31081
31368
  }
31082
31369
  return null;
31083
31370
  }, []);
31084
- React93.useEffect(() => {
31371
+ React94.useEffect(() => {
31085
31372
  const canvas = canvasRef.current;
31086
31373
  if (!canvas) return;
31087
31374
  const ctx = canvas.getContext("2d");
@@ -31406,7 +31693,7 @@ function TurnPanel({
31406
31693
  className
31407
31694
  }) {
31408
31695
  const eventBus = useEventBus();
31409
- const handleAction = React93.useCallback(
31696
+ const handleAction = React94.useCallback(
31410
31697
  (event) => {
31411
31698
  if (event) {
31412
31699
  eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
@@ -31587,7 +31874,7 @@ function UnitCommandBar({
31587
31874
  className
31588
31875
  }) {
31589
31876
  const eventBus = useEventBus();
31590
- const handleCommand = React93.useCallback(
31877
+ const handleCommand = React94.useCallback(
31591
31878
  (event) => {
31592
31879
  if (event) {
31593
31880
  eventBus.emit(event, { unitId: selectedUnitId });
@@ -32138,7 +32425,7 @@ function GameMenu({
32138
32425
  } catch {
32139
32426
  }
32140
32427
  const eventBus = eventBusProp || eventBusFromHook;
32141
- const handleOptionClick = React93.useCallback(
32428
+ const handleOptionClick = React94.useCallback(
32142
32429
  (option) => {
32143
32430
  if (option.event && eventBus) {
32144
32431
  eventBus.emit(`UI:${option.event}`, { option });
@@ -32257,7 +32544,7 @@ function GameOverScreen({
32257
32544
  } catch {
32258
32545
  }
32259
32546
  const eventBus = eventBusProp || eventBusFromHook;
32260
- const handleActionClick = React93.useCallback(
32547
+ const handleActionClick = React94.useCallback(
32261
32548
  (action) => {
32262
32549
  if (action.event && eventBus) {
32263
32550
  eventBus.emit(`UI:${action.event}`, { action });
@@ -33189,13 +33476,13 @@ var init_MapView = __esm({
33189
33476
  shadowSize: [41, 41]
33190
33477
  });
33191
33478
  L.Marker.prototype.options.icon = defaultIcon;
33192
- const { useEffect: useEffect88, useRef: useRef82, useCallback: useCallback132, useState: useState123 } = React93__default;
33479
+ const { useEffect: useEffect89, useRef: useRef82, useCallback: useCallback133, useState: useState125 } = React94__default;
33193
33480
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
33194
33481
  const { useEventBus: useEventBus4 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
33195
33482
  function MapUpdater({ centerLat, centerLng, zoom }) {
33196
33483
  const map = useMap();
33197
33484
  const prevRef = useRef82({ centerLat, centerLng, zoom });
33198
- useEffect88(() => {
33485
+ useEffect89(() => {
33199
33486
  const prev = prevRef.current;
33200
33487
  if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
33201
33488
  map.setView([centerLat, centerLng], zoom);
@@ -33206,7 +33493,7 @@ var init_MapView = __esm({
33206
33493
  }
33207
33494
  function MapClickHandler({ onMapClick }) {
33208
33495
  const map = useMap();
33209
- useEffect88(() => {
33496
+ useEffect89(() => {
33210
33497
  if (!onMapClick) return;
33211
33498
  const handler = (e) => {
33212
33499
  onMapClick(e.latlng.lat, e.latlng.lng);
@@ -33234,8 +33521,8 @@ var init_MapView = __esm({
33234
33521
  showAttribution = true
33235
33522
  }) {
33236
33523
  const eventBus = useEventBus4();
33237
- const [clickedPosition, setClickedPosition] = useState123(null);
33238
- const handleMapClick = useCallback132((lat, lng) => {
33524
+ const [clickedPosition, setClickedPosition] = useState125(null);
33525
+ const handleMapClick = useCallback133((lat, lng) => {
33239
33526
  if (showClickedPin) {
33240
33527
  setClickedPosition({ lat, lng });
33241
33528
  }
@@ -33244,7 +33531,7 @@ var init_MapView = __esm({
33244
33531
  eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
33245
33532
  }
33246
33533
  }, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
33247
- const handleMarkerClick = useCallback132((marker) => {
33534
+ const handleMarkerClick = useCallback133((marker) => {
33248
33535
  onMarkerClick?.(marker);
33249
33536
  if (markerClickEvent) {
33250
33537
  eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
@@ -34095,8 +34382,8 @@ function TableView({
34095
34382
  }) {
34096
34383
  const eventBus = useEventBus();
34097
34384
  const { t } = useTranslate();
34098
- const [visibleCount, setVisibleCount] = React93__default.useState(pageSize > 0 ? pageSize : Infinity);
34099
- const [localSelected, setLocalSelected] = React93__default.useState(/* @__PURE__ */ new Set());
34385
+ const [visibleCount, setVisibleCount] = React94__default.useState(pageSize > 0 ? pageSize : Infinity);
34386
+ const [localSelected, setLocalSelected] = React94__default.useState(/* @__PURE__ */ new Set());
34100
34387
  const colDefs = columns ?? fields ?? [];
34101
34388
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
34102
34389
  const dnd = useDataDnd({
@@ -34291,12 +34578,12 @@ function TableView({
34291
34578
  ]
34292
34579
  }
34293
34580
  );
34294
- return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React93__default.Fragment, { children: rowInner }, id);
34581
+ return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React94__default.Fragment, { children: rowInner }, id);
34295
34582
  };
34296
34583
  const items = data.map((row) => row);
34297
34584
  const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
34298
34585
  let runningIndex = 0;
34299
- const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
34586
+ const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
34300
34587
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
34301
34588
  group.items.map((row) => renderRow(row, runningIndex++))
34302
34589
  ] }, gi)) });
@@ -35653,7 +35940,7 @@ var init_StepFlow = __esm({
35653
35940
  className
35654
35941
  }) => {
35655
35942
  if (orientation === "vertical") {
35656
- return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React93__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
35943
+ return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React94__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
35657
35944
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
35658
35945
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
35659
35946
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -35664,7 +35951,7 @@ var init_StepFlow = __esm({
35664
35951
  ] })
35665
35952
  ] }) }, index)) });
35666
35953
  }
35667
- return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
35954
+ return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
35668
35955
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
35669
35956
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
35670
35957
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -36649,7 +36936,7 @@ var init_LikertScale = __esm({
36649
36936
  md: "text-base",
36650
36937
  lg: "text-lg"
36651
36938
  };
36652
- LikertScale = React93__default.forwardRef(
36939
+ LikertScale = React94__default.forwardRef(
36653
36940
  ({
36654
36941
  question,
36655
36942
  options = DEFAULT_LIKERT_OPTIONS,
@@ -36661,7 +36948,7 @@ var init_LikertScale = __esm({
36661
36948
  variant = "radios",
36662
36949
  className
36663
36950
  }, ref) => {
36664
- const groupId = React93__default.useId();
36951
+ const groupId = React94__default.useId();
36665
36952
  const eventBus = useEventBus();
36666
36953
  const handleSelect = useCallback(
36667
36954
  (next) => {
@@ -38943,7 +39230,7 @@ var init_DocBreadcrumb = __esm({
38943
39230
  "aria-label": t("aria.breadcrumb"),
38944
39231
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
38945
39232
  const isLast = idx === items.length - 1;
38946
- return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
39233
+ return /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
38947
39234
  idx > 0 && /* @__PURE__ */ jsx(
38948
39235
  Icon,
38949
39236
  {
@@ -39607,7 +39894,7 @@ var init_PageHeader = __esm({
39607
39894
  info: "bg-info/10 text-info"
39608
39895
  };
39609
39896
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
39610
- 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(React93__default.Fragment, { children: [
39897
+ 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(React94__default.Fragment, { children: [
39611
39898
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
39612
39899
  crumb.href ? /* @__PURE__ */ jsx(
39613
39900
  "a",
@@ -40336,7 +40623,7 @@ var init_WizardContainer = __esm({
40336
40623
  const isCompleted = index < currentStep;
40337
40624
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
40338
40625
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
40339
- return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
40626
+ return /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
40340
40627
  /* @__PURE__ */ jsx(
40341
40628
  Button,
40342
40629
  {
@@ -42896,7 +43183,7 @@ var init_DetailPanel = __esm({
42896
43183
  }
42897
43184
  });
42898
43185
  function extractTitle(children) {
42899
- if (!React93__default.isValidElement(children)) return void 0;
43186
+ if (!React94__default.isValidElement(children)) return void 0;
42900
43187
  const props = children.props;
42901
43188
  if (typeof props.title === "string") {
42902
43189
  return props.title;
@@ -42951,7 +43238,7 @@ function LinearView({
42951
43238
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
42952
43239
  const isDone = i < currentIdx;
42953
43240
  const isCurrent = i === currentIdx;
42954
- return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
43241
+ return /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
42955
43242
  i > 0 && /* @__PURE__ */ jsx(
42956
43243
  Typography,
42957
43244
  {
@@ -43720,6 +44007,42 @@ var init_FeatureGridOrganism = __esm({
43720
44007
  FeatureGridOrganism.displayName = "FeatureGridOrganism";
43721
44008
  }
43722
44009
  });
44010
+ function FishingBoard({
44011
+ backgroundImage,
44012
+ assetBaseUrl,
44013
+ scale = 1,
44014
+ showMinimap = false,
44015
+ enableCamera = true,
44016
+ width = 800,
44017
+ height = 600,
44018
+ isLoading,
44019
+ error,
44020
+ className
44021
+ }) {
44022
+ return /* @__PURE__ */ jsxs("div", { className: cn("fishing-board relative w-full h-full", className), children: [
44023
+ isLoading && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-black/40 z-10", children: /* @__PURE__ */ jsx("span", { className: "text-white text-sm", children: "Loading\u2026" }) }),
44024
+ error && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-black/40 z-10", children: /* @__PURE__ */ jsx("span", { className: "text-red-400 text-sm", children: error.message }) }),
44025
+ /* @__PURE__ */ jsx(
44026
+ GameCanvas2D,
44027
+ {
44028
+ width,
44029
+ height,
44030
+ backgroundImage: backgroundImage ?? "",
44031
+ assetBaseUrl,
44032
+ fps: 60,
44033
+ className: "w-full h-full"
44034
+ }
44035
+ )
44036
+ ] });
44037
+ }
44038
+ var init_FishingBoard = __esm({
44039
+ "components/game/organisms/FishingBoard.tsx"() {
44040
+ "use client";
44041
+ init_cn();
44042
+ init_GameCanvas2D();
44043
+ FishingBoard.displayName = "FishingBoard";
44044
+ }
44045
+ });
43723
44046
  function toSharedContext2(formCtx) {
43724
44047
  return createMinimalContext(
43725
44048
  {
@@ -43901,12 +44224,12 @@ var init_Form = __esm({
43901
44224
  const isSchemaEntity = isOrbitalEntitySchema(entity);
43902
44225
  const resolvedEntity = isSchemaEntity ? entity : void 0;
43903
44226
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
43904
- const normalizedInitialData = React93__default.useMemo(() => {
44227
+ const normalizedInitialData = React94__default.useMemo(() => {
43905
44228
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
43906
44229
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
43907
44230
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
43908
44231
  }, [entity, initialData]);
43909
- const entityDerivedFields = React93__default.useMemo(() => {
44232
+ const entityDerivedFields = React94__default.useMemo(() => {
43910
44233
  if (fields && fields.length > 0) return void 0;
43911
44234
  if (!resolvedEntity) return void 0;
43912
44235
  return resolvedEntity.fields.map(
@@ -43926,16 +44249,16 @@ var init_Form = __esm({
43926
44249
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
43927
44250
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
43928
44251
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
43929
- const [formData, setFormData] = React93__default.useState(
44252
+ const [formData, setFormData] = React94__default.useState(
43930
44253
  normalizedInitialData
43931
44254
  );
43932
- const [collapsedSections, setCollapsedSections] = React93__default.useState(
44255
+ const [collapsedSections, setCollapsedSections] = React94__default.useState(
43933
44256
  /* @__PURE__ */ new Set()
43934
44257
  );
43935
- const [submitError, setSubmitError] = React93__default.useState(null);
43936
- const formRef = React93__default.useRef(null);
44258
+ const [submitError, setSubmitError] = React94__default.useState(null);
44259
+ const formRef = React94__default.useRef(null);
43937
44260
  const formMode = props.mode;
43938
- const mountedRef = React93__default.useRef(false);
44261
+ const mountedRef = React94__default.useRef(false);
43939
44262
  if (!mountedRef.current) {
43940
44263
  mountedRef.current = true;
43941
44264
  debug("forms", "mount", {
@@ -43948,7 +44271,7 @@ var init_Form = __esm({
43948
44271
  });
43949
44272
  }
43950
44273
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
43951
- const evalContext = React93__default.useMemo(
44274
+ const evalContext = React94__default.useMemo(
43952
44275
  () => ({
43953
44276
  formValues: formData,
43954
44277
  globalVariables: externalContext?.globalVariables ?? {},
@@ -43957,7 +44280,7 @@ var init_Form = __esm({
43957
44280
  }),
43958
44281
  [formData, externalContext]
43959
44282
  );
43960
- React93__default.useEffect(() => {
44283
+ React94__default.useEffect(() => {
43961
44284
  debug("forms", "initialData-sync", {
43962
44285
  mode: formMode,
43963
44286
  normalizedInitialData,
@@ -43968,7 +44291,7 @@ var init_Form = __esm({
43968
44291
  setFormData(normalizedInitialData);
43969
44292
  }
43970
44293
  }, [normalizedInitialData]);
43971
- const processCalculations = React93__default.useCallback(
44294
+ const processCalculations = React94__default.useCallback(
43972
44295
  (changedFieldId, newFormData) => {
43973
44296
  if (!hiddenCalculations.length) return;
43974
44297
  const context = {
@@ -43993,7 +44316,7 @@ var init_Form = __esm({
43993
44316
  },
43994
44317
  [hiddenCalculations, externalContext, eventBus]
43995
44318
  );
43996
- const checkViolations = React93__default.useCallback(
44319
+ const checkViolations = React94__default.useCallback(
43997
44320
  (changedFieldId, newFormData) => {
43998
44321
  if (!violationTriggers.length) return;
43999
44322
  const context = {
@@ -44031,7 +44354,7 @@ var init_Form = __esm({
44031
44354
  processCalculations(name, newFormData);
44032
44355
  checkViolations(name, newFormData);
44033
44356
  };
44034
- const isFieldVisible = React93__default.useCallback(
44357
+ const isFieldVisible = React94__default.useCallback(
44035
44358
  (fieldName) => {
44036
44359
  const condition = conditionalFields[fieldName];
44037
44360
  if (!condition) return true;
@@ -44039,7 +44362,7 @@ var init_Form = __esm({
44039
44362
  },
44040
44363
  [conditionalFields, evalContext]
44041
44364
  );
44042
- const isSectionVisible = React93__default.useCallback(
44365
+ const isSectionVisible = React94__default.useCallback(
44043
44366
  (section) => {
44044
44367
  if (!section.condition) return true;
44045
44368
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -44115,7 +44438,7 @@ var init_Form = __esm({
44115
44438
  eventBus.emit(`UI:${onCancel}`);
44116
44439
  }
44117
44440
  };
44118
- const renderField = React93__default.useCallback(
44441
+ const renderField = React94__default.useCallback(
44119
44442
  (field) => {
44120
44443
  const fieldName = field.name || field.field;
44121
44444
  if (!fieldName) return null;
@@ -44136,7 +44459,7 @@ var init_Form = __esm({
44136
44459
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
44137
44460
  );
44138
44461
  const effectiveFields = entityDerivedFields ?? fields;
44139
- const normalizedFields = React93__default.useMemo(() => {
44462
+ const normalizedFields = React94__default.useMemo(() => {
44140
44463
  if (!effectiveFields || effectiveFields.length === 0) return [];
44141
44464
  return effectiveFields.map((field) => {
44142
44465
  if (typeof field === "string") {
@@ -44159,7 +44482,7 @@ var init_Form = __esm({
44159
44482
  return field;
44160
44483
  });
44161
44484
  }, [effectiveFields, resolvedEntity]);
44162
- const schemaFields = React93__default.useMemo(() => {
44485
+ const schemaFields = React94__default.useMemo(() => {
44163
44486
  if (normalizedFields.length === 0) return null;
44164
44487
  if (isDebugEnabled()) {
44165
44488
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -44169,7 +44492,7 @@ var init_Form = __esm({
44169
44492
  }
44170
44493
  return normalizedFields.map(renderField).filter(Boolean);
44171
44494
  }, [normalizedFields, renderField, entityName, conditionalFields]);
44172
- const sectionElements = React93__default.useMemo(() => {
44495
+ const sectionElements = React94__default.useMemo(() => {
44173
44496
  if (!sections || sections.length === 0) return null;
44174
44497
  return sections.map((section) => {
44175
44498
  if (!isSectionVisible(section)) {
@@ -46433,10 +46756,10 @@ function getSlotContentRenderer2() {
46433
46756
  }
46434
46757
  function resolveDescriptor(value, idPrefix) {
46435
46758
  if (value === null || value === void 0) return value;
46436
- if (React93__default.isValidElement(value)) return value;
46759
+ if (React94__default.isValidElement(value)) return value;
46437
46760
  if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
46438
46761
  if (Array.isArray(value)) {
46439
- return value.map((item, i) => /* @__PURE__ */ jsx(React93__default.Fragment, { children: resolveDescriptor(item, `${idPrefix}-${i}`) }, i));
46762
+ return value.map((item, i) => /* @__PURE__ */ jsx(React94__default.Fragment, { children: resolveDescriptor(item, `${idPrefix}-${i}`) }, i));
46440
46763
  }
46441
46764
  if (typeof value === "object") {
46442
46765
  const rec = value;
@@ -46537,10 +46860,10 @@ function getSlotContentRenderer3() {
46537
46860
  }
46538
46861
  function resolveDescriptor2(value, idPrefix) {
46539
46862
  if (value === null || value === void 0) return value;
46540
- if (React93__default.isValidElement(value)) return value;
46863
+ if (React94__default.isValidElement(value)) return value;
46541
46864
  if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
46542
46865
  if (Array.isArray(value)) {
46543
- return value.map((item, i) => /* @__PURE__ */ jsx(React93__default.Fragment, { children: resolveDescriptor2(item, `${idPrefix}-${i}`) }, i));
46866
+ return value.map((item, i) => /* @__PURE__ */ jsx(React94__default.Fragment, { children: resolveDescriptor2(item, `${idPrefix}-${i}`) }, i));
46544
46867
  }
46545
46868
  if (typeof value === "object") {
46546
46869
  const rec = value;
@@ -46873,6 +47196,39 @@ var init_HexStrategyBoard = __esm({
46873
47196
  HexStrategyBoard.displayName = "HexStrategyBoard";
46874
47197
  }
46875
47198
  });
47199
+ function HolidayRunnerBoard({
47200
+ backgroundImage,
47201
+ assetBaseUrl,
47202
+ width = 800,
47203
+ height = 400,
47204
+ fps = 60,
47205
+ isLoading,
47206
+ error,
47207
+ className
47208
+ }) {
47209
+ return /* @__PURE__ */ jsxs("div", { className: cn("holiday-runner-board relative w-full h-full", className), children: [
47210
+ isLoading && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-black/40 z-10", children: /* @__PURE__ */ jsx("span", { className: "text-white text-sm", children: "Loading\u2026" }) }),
47211
+ error && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-black/60 z-10", children: /* @__PURE__ */ jsx("span", { className: "text-red-400 text-sm", children: error.message }) }),
47212
+ /* @__PURE__ */ jsx(
47213
+ GameCanvas2D,
47214
+ {
47215
+ width,
47216
+ height,
47217
+ fps,
47218
+ backgroundImage: backgroundImage ?? "",
47219
+ assetBaseUrl
47220
+ }
47221
+ )
47222
+ ] });
47223
+ }
47224
+ var init_HolidayRunnerBoard = __esm({
47225
+ "components/game/organisms/HolidayRunnerBoard.tsx"() {
47226
+ "use client";
47227
+ init_cn();
47228
+ init_GameCanvas2D();
47229
+ HolidayRunnerBoard.displayName = "HolidayRunnerBoard";
47230
+ }
47231
+ });
46876
47232
  var LandingPageTemplate;
46877
47233
  var init_LandingPageTemplate = __esm({
46878
47234
  "components/marketing/templates/LandingPageTemplate.tsx"() {
@@ -47208,7 +47564,7 @@ var init_List = __esm({
47208
47564
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
47209
47565
  return [];
47210
47566
  }, [entity]);
47211
- const getItemActions = React93__default.useCallback(
47567
+ const getItemActions = React94__default.useCallback(
47212
47568
  (item) => {
47213
47569
  if (!itemActions) return [];
47214
47570
  if (typeof itemActions === "function") {
@@ -47627,6 +47983,48 @@ var init_MasterDetailLayout = __esm({
47627
47983
  MasterDetailLayout.displayName = "MasterDetailLayout";
47628
47984
  }
47629
47985
  });
47986
+ function MatchPuzzleBoard({
47987
+ tiles,
47988
+ units,
47989
+ features,
47990
+ assetManifest,
47991
+ assetBaseUrl,
47992
+ scale = 0.45,
47993
+ showMinimap = false,
47994
+ enableCamera = false,
47995
+ tileClickEvent,
47996
+ unitClickEvent,
47997
+ isLoading,
47998
+ error,
47999
+ className
48000
+ }) {
48001
+ return /* @__PURE__ */ jsx("div", { className: cn("match-puzzle-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
48002
+ IsometricCanvas_default,
48003
+ {
48004
+ tileLayout: "flat",
48005
+ tiles,
48006
+ units,
48007
+ features,
48008
+ assetManifest,
48009
+ assetBaseUrl,
48010
+ scale,
48011
+ showMinimap,
48012
+ enableCamera,
48013
+ tileClickEvent,
48014
+ unitClickEvent,
48015
+ isLoading,
48016
+ error
48017
+ }
48018
+ ) });
48019
+ }
48020
+ var init_MatchPuzzleBoard = __esm({
48021
+ "components/game/organisms/MatchPuzzleBoard.tsx"() {
48022
+ "use client";
48023
+ init_cn();
48024
+ init_IsometricCanvas();
48025
+ MatchPuzzleBoard.displayName = "MatchPuzzleBoard";
48026
+ }
48027
+ });
47630
48028
  var COLUMN_CLASSES, ASPECT_CLASSES, MediaGallery;
47631
48029
  var init_MediaGallery = __esm({
47632
48030
  "components/core/organisms/MediaGallery.tsx"() {
@@ -47684,7 +48082,7 @@ var init_MediaGallery = __esm({
47684
48082
  [selectable, selectedItems, selectionEvent, eventBus]
47685
48083
  );
47686
48084
  const entityData = Array.isArray(entity) ? entity : [];
47687
- const items = React93__default.useMemo(() => {
48085
+ const items = React94__default.useMemo(() => {
47688
48086
  if (propItems) return propItems;
47689
48087
  if (entityData.length === 0) return [];
47690
48088
  return entityData.map((record, idx) => ({
@@ -47844,8 +48242,50 @@ var init_MediaGallery = __esm({
47844
48242
  MediaGallery.displayName = "MediaGallery";
47845
48243
  }
47846
48244
  });
48245
+ function MinigolfBoard({
48246
+ tiles,
48247
+ units,
48248
+ features,
48249
+ assetManifest,
48250
+ assetBaseUrl,
48251
+ scale = 0.45,
48252
+ showMinimap = true,
48253
+ enableCamera = true,
48254
+ tileClickEvent,
48255
+ unitClickEvent,
48256
+ isLoading,
48257
+ error,
48258
+ className
48259
+ }) {
48260
+ return /* @__PURE__ */ jsx("div", { className: cn("minigolf-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
48261
+ IsometricCanvas_default,
48262
+ {
48263
+ tileLayout: "isometric",
48264
+ tiles,
48265
+ units,
48266
+ features,
48267
+ assetManifest,
48268
+ assetBaseUrl,
48269
+ scale,
48270
+ showMinimap,
48271
+ enableCamera,
48272
+ tileClickEvent,
48273
+ unitClickEvent,
48274
+ isLoading,
48275
+ error
48276
+ }
48277
+ ) });
48278
+ }
48279
+ var init_MinigolfBoard = __esm({
48280
+ "components/game/organisms/MinigolfBoard.tsx"() {
48281
+ "use client";
48282
+ init_cn();
48283
+ init_IsometricCanvas();
48284
+ MinigolfBoard.displayName = "MinigolfBoard";
48285
+ }
48286
+ });
47847
48287
  function extractTitle2(children) {
47848
- if (!React93__default.isValidElement(children)) return void 0;
48288
+ if (!React94__default.isValidElement(children)) return void 0;
47849
48289
  const props = children.props;
47850
48290
  if (typeof props.title === "string") {
47851
48291
  return props.title;
@@ -48061,6 +48501,87 @@ var init_NegotiatorBoard = __esm({
48061
48501
  NegotiatorBoard.displayName = "NegotiatorBoard";
48062
48502
  }
48063
48503
  });
48504
+ function PinballBoard({
48505
+ tiles: _tiles,
48506
+ units: _units,
48507
+ features: _features,
48508
+ assetManifest: _assetManifest,
48509
+ assetBaseUrl,
48510
+ scale = 1,
48511
+ showMinimap: _showMinimap = false,
48512
+ enableCamera: _enableCamera = false,
48513
+ tileClickEvent: _tileClickEvent,
48514
+ unitClickEvent: _unitClickEvent,
48515
+ isLoading,
48516
+ error,
48517
+ className
48518
+ }) {
48519
+ if (isLoading) {
48520
+ return /* @__PURE__ */ jsx("div", { className: cn("pinball-board relative w-full h-full flex items-center justify-center", className), children: /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: "Loading..." }) });
48521
+ }
48522
+ if (error) {
48523
+ return /* @__PURE__ */ jsx("div", { className: cn("pinball-board relative w-full h-full flex items-center justify-center", className), children: /* @__PURE__ */ jsx("span", { className: "text-sm text-destructive", children: error.message }) });
48524
+ }
48525
+ return /* @__PURE__ */ jsx("div", { className: cn("pinball-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
48526
+ GameCanvas2D,
48527
+ {
48528
+ width: Math.round(400 * scale),
48529
+ height: Math.round(800 * scale),
48530
+ assetBaseUrl,
48531
+ fps: 60
48532
+ }
48533
+ ) });
48534
+ }
48535
+ var init_PinballBoard = __esm({
48536
+ "components/game/organisms/PinballBoard.tsx"() {
48537
+ "use client";
48538
+ init_cn();
48539
+ init_GameCanvas2D();
48540
+ PinballBoard.displayName = "PinballBoard";
48541
+ }
48542
+ });
48543
+ function PirateBoard({
48544
+ tiles,
48545
+ units,
48546
+ features,
48547
+ assetManifest,
48548
+ assetBaseUrl,
48549
+ scale = 0.45,
48550
+ showMinimap = true,
48551
+ enableCamera = true,
48552
+ tileClickEvent,
48553
+ unitClickEvent,
48554
+ isLoading,
48555
+ error,
48556
+ className
48557
+ }) {
48558
+ return /* @__PURE__ */ jsx("div", { className: cn("pirate-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
48559
+ IsometricCanvas_default,
48560
+ {
48561
+ tileLayout: "flat",
48562
+ tiles,
48563
+ units,
48564
+ features,
48565
+ assetManifest,
48566
+ assetBaseUrl,
48567
+ scale,
48568
+ showMinimap,
48569
+ enableCamera,
48570
+ tileClickEvent,
48571
+ unitClickEvent,
48572
+ isLoading,
48573
+ error
48574
+ }
48575
+ ) });
48576
+ }
48577
+ var init_PirateBoard = __esm({
48578
+ "components/game/organisms/PirateBoard.tsx"() {
48579
+ "use client";
48580
+ init_cn();
48581
+ init_IsometricCanvas();
48582
+ PirateBoard.displayName = "PirateBoard";
48583
+ }
48584
+ });
48064
48585
  function resolveEntity(entity) {
48065
48586
  if (!entity) return {};
48066
48587
  if (Array.isArray(entity)) return entity[0] ?? {};
@@ -48421,6 +48942,37 @@ var init_PricingPageTemplate = __esm({
48421
48942
  PricingPageTemplate.displayName = "PricingPageTemplate";
48422
48943
  }
48423
48944
  });
48945
+ function RacingBoard({
48946
+ backgroundImage,
48947
+ assetBaseUrl,
48948
+ width = 800,
48949
+ height = 600,
48950
+ fps = 60,
48951
+ tickEvent,
48952
+ drawEvent,
48953
+ className
48954
+ }) {
48955
+ return /* @__PURE__ */ jsx("div", { className: cn("racing-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
48956
+ GameCanvas2D,
48957
+ {
48958
+ backgroundImage,
48959
+ assetBaseUrl,
48960
+ width,
48961
+ height,
48962
+ fps,
48963
+ tickEvent: typeof tickEvent === "string" ? tickEvent : void 0,
48964
+ drawEvent: typeof drawEvent === "string" ? drawEvent : void 0
48965
+ }
48966
+ ) });
48967
+ }
48968
+ var init_RacingBoard = __esm({
48969
+ "components/game/organisms/RacingBoard.tsx"() {
48970
+ "use client";
48971
+ init_cn();
48972
+ init_GameCanvas2D();
48973
+ RacingBoard.displayName = "RacingBoard";
48974
+ }
48975
+ });
48424
48976
  function resolveManifestUrl3(manifest, relative) {
48425
48977
  if (relative == null) return void 0;
48426
48978
  if (/^https?:\/\//.test(relative)) return relative;
@@ -48915,7 +49467,7 @@ var init_debugRegistry = __esm({
48915
49467
  }
48916
49468
  });
48917
49469
  function useDebugData() {
48918
- const [data, setData] = React93.useState(() => ({
49470
+ const [data, setData] = React94.useState(() => ({
48919
49471
  traits: [],
48920
49472
  ticks: [],
48921
49473
  guards: [],
@@ -48929,7 +49481,7 @@ function useDebugData() {
48929
49481
  },
48930
49482
  lastUpdate: Date.now()
48931
49483
  }));
48932
- React93.useEffect(() => {
49484
+ React94.useEffect(() => {
48933
49485
  const updateData = () => {
48934
49486
  setData({
48935
49487
  traits: getAllTraits(),
@@ -49038,12 +49590,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
49038
49590
  return positions;
49039
49591
  }
49040
49592
  function WalkMinimap() {
49041
- const [walkStep, setWalkStep] = React93.useState(null);
49042
- const [traits2, setTraits] = React93.useState([]);
49043
- const [coveredEdges, setCoveredEdges] = React93.useState([]);
49044
- const [completedTraits, setCompletedTraits] = React93.useState(/* @__PURE__ */ new Set());
49045
- const prevTraitRef = React93.useRef(null);
49046
- React93.useEffect(() => {
49593
+ const [walkStep, setWalkStep] = React94.useState(null);
49594
+ const [traits2, setTraits] = React94.useState([]);
49595
+ const [coveredEdges, setCoveredEdges] = React94.useState([]);
49596
+ const [completedTraits, setCompletedTraits] = React94.useState(/* @__PURE__ */ new Set());
49597
+ const prevTraitRef = React94.useRef(null);
49598
+ React94.useEffect(() => {
49047
49599
  const interval = setInterval(() => {
49048
49600
  const w = window;
49049
49601
  const step = w.__orbitalWalkStep;
@@ -49479,15 +50031,15 @@ var init_EntitiesTab = __esm({
49479
50031
  });
49480
50032
  function EventFlowTab({ events: events2 }) {
49481
50033
  const { t } = useTranslate();
49482
- const [filter, setFilter] = React93.useState("all");
49483
- const containerRef = React93.useRef(null);
49484
- const [autoScroll, setAutoScroll] = React93.useState(true);
49485
- React93.useEffect(() => {
50034
+ const [filter, setFilter] = React94.useState("all");
50035
+ const containerRef = React94.useRef(null);
50036
+ const [autoScroll, setAutoScroll] = React94.useState(true);
50037
+ React94.useEffect(() => {
49486
50038
  if (autoScroll && containerRef.current) {
49487
50039
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
49488
50040
  }
49489
50041
  }, [events2.length, autoScroll]);
49490
- const filteredEvents = React93.useMemo(() => {
50042
+ const filteredEvents = React94.useMemo(() => {
49491
50043
  if (filter === "all") return events2;
49492
50044
  return events2.filter((e) => e.type === filter);
49493
50045
  }, [events2, filter]);
@@ -49603,7 +50155,7 @@ var init_EventFlowTab = __esm({
49603
50155
  });
49604
50156
  function GuardsPanel({ guards }) {
49605
50157
  const { t } = useTranslate();
49606
- const [filter, setFilter] = React93.useState("all");
50158
+ const [filter, setFilter] = React94.useState("all");
49607
50159
  if (guards.length === 0) {
49608
50160
  return /* @__PURE__ */ jsx(
49609
50161
  EmptyState,
@@ -49616,7 +50168,7 @@ function GuardsPanel({ guards }) {
49616
50168
  }
49617
50169
  const passedCount = guards.filter((g) => g.result).length;
49618
50170
  const failedCount = guards.length - passedCount;
49619
- const filteredGuards = React93.useMemo(() => {
50171
+ const filteredGuards = React94.useMemo(() => {
49620
50172
  if (filter === "all") return guards;
49621
50173
  if (filter === "passed") return guards.filter((g) => g.result);
49622
50174
  return guards.filter((g) => !g.result);
@@ -49779,10 +50331,10 @@ function EffectBadge({ effect }) {
49779
50331
  }
49780
50332
  function TransitionTimeline({ transitions }) {
49781
50333
  const { t } = useTranslate();
49782
- const containerRef = React93.useRef(null);
49783
- const [autoScroll, setAutoScroll] = React93.useState(true);
49784
- const [expandedId, setExpandedId] = React93.useState(null);
49785
- React93.useEffect(() => {
50334
+ const containerRef = React94.useRef(null);
50335
+ const [autoScroll, setAutoScroll] = React94.useState(true);
50336
+ const [expandedId, setExpandedId] = React94.useState(null);
50337
+ React94.useEffect(() => {
49786
50338
  if (autoScroll && containerRef.current) {
49787
50339
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
49788
50340
  }
@@ -50062,9 +50614,9 @@ function getAllEvents(traits2) {
50062
50614
  function EventDispatcherTab({ traits: traits2, schema }) {
50063
50615
  const eventBus = useEventBus();
50064
50616
  const { t } = useTranslate();
50065
- const [log15, setLog] = React93.useState([]);
50066
- const prevStatesRef = React93.useRef(/* @__PURE__ */ new Map());
50067
- React93.useEffect(() => {
50617
+ const [log15, setLog] = React94.useState([]);
50618
+ const prevStatesRef = React94.useRef(/* @__PURE__ */ new Map());
50619
+ React94.useEffect(() => {
50068
50620
  for (const trait of traits2) {
50069
50621
  const prev = prevStatesRef.current.get(trait.id);
50070
50622
  if (prev && prev !== trait.currentState) {
@@ -50233,10 +50785,10 @@ function VerifyModePanel({
50233
50785
  localCount
50234
50786
  }) {
50235
50787
  const { t } = useTranslate();
50236
- const [expanded, setExpanded] = React93.useState(true);
50237
- const scrollRef = React93.useRef(null);
50238
- const prevCountRef = React93.useRef(0);
50239
- React93.useEffect(() => {
50788
+ const [expanded, setExpanded] = React94.useState(true);
50789
+ const scrollRef = React94.useRef(null);
50790
+ const prevCountRef = React94.useRef(0);
50791
+ React94.useEffect(() => {
50240
50792
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
50241
50793
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
50242
50794
  }
@@ -50293,10 +50845,10 @@ function RuntimeDebugger({
50293
50845
  schema
50294
50846
  }) {
50295
50847
  const { t } = useTranslate();
50296
- const [isCollapsed, setIsCollapsed] = React93.useState(mode === "verify" ? true : defaultCollapsed);
50297
- const [isVisible, setIsVisible] = React93.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
50848
+ const [isCollapsed, setIsCollapsed] = React94.useState(mode === "verify" ? true : defaultCollapsed);
50849
+ const [isVisible, setIsVisible] = React94.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
50298
50850
  const debugData = useDebugData();
50299
- React93.useEffect(() => {
50851
+ React94.useEffect(() => {
50300
50852
  if (mode === "inline") return;
50301
50853
  return onDebugToggle((enabled) => {
50302
50854
  setIsVisible(enabled);
@@ -50305,7 +50857,7 @@ function RuntimeDebugger({
50305
50857
  }
50306
50858
  });
50307
50859
  }, [mode]);
50308
- React93.useEffect(() => {
50860
+ React94.useEffect(() => {
50309
50861
  if (mode === "inline") return;
50310
50862
  const handleKeyDown = (e) => {
50311
50863
  if (e.key === "`" && isVisible) {
@@ -50865,7 +51417,7 @@ function SequenceBar({
50865
51417
  onSlotRemove(index);
50866
51418
  }, [onSlotRemove, playing]);
50867
51419
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
50868
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
51420
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
50869
51421
  i > 0 && /* @__PURE__ */ jsx(
50870
51422
  Typography,
50871
51423
  {
@@ -51626,6 +52178,123 @@ var init_SimulatorBoard = __esm({
51626
52178
  SimulatorBoard.displayName = "SimulatorBoard";
51627
52179
  }
51628
52180
  });
52181
+ function SokobanBoard({
52182
+ tiles,
52183
+ units,
52184
+ features,
52185
+ assetManifest,
52186
+ assetBaseUrl,
52187
+ scale = 0.45,
52188
+ showMinimap = false,
52189
+ enableCamera = false,
52190
+ tileClickEvent,
52191
+ unitClickEvent,
52192
+ isLoading,
52193
+ error,
52194
+ className
52195
+ }) {
52196
+ return /* @__PURE__ */ jsx("div", { className: cn("sokoban-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
52197
+ IsometricCanvas_default,
52198
+ {
52199
+ tileLayout: "flat",
52200
+ tiles,
52201
+ units,
52202
+ features,
52203
+ assetManifest,
52204
+ assetBaseUrl,
52205
+ scale,
52206
+ showMinimap,
52207
+ enableCamera,
52208
+ tileClickEvent,
52209
+ unitClickEvent,
52210
+ isLoading,
52211
+ error
52212
+ }
52213
+ ) });
52214
+ }
52215
+ var init_SokobanBoard = __esm({
52216
+ "components/game/organisms/SokobanBoard.tsx"() {
52217
+ "use client";
52218
+ init_cn();
52219
+ init_IsometricCanvas();
52220
+ SokobanBoard.displayName = "SokobanBoard";
52221
+ }
52222
+ });
52223
+ function SpaceShmupBoard({
52224
+ backgroundImage,
52225
+ assetBaseUrl,
52226
+ width = 800,
52227
+ height = 600,
52228
+ fps = 60,
52229
+ isLoading,
52230
+ error,
52231
+ className
52232
+ }) {
52233
+ return /* @__PURE__ */ jsxs("div", { className: cn("space-shmup-board relative w-full h-full", className), children: [
52234
+ isLoading && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-black/60 z-10", children: /* @__PURE__ */ jsx("span", { className: "text-white text-sm", children: "Loading\u2026" }) }),
52235
+ error && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-red-900/60 z-10", children: /* @__PURE__ */ jsx("span", { className: "text-white text-sm", children: error.message }) }),
52236
+ /* @__PURE__ */ jsx(
52237
+ GameCanvas2D,
52238
+ {
52239
+ backgroundImage,
52240
+ assetBaseUrl,
52241
+ width,
52242
+ height,
52243
+ fps
52244
+ }
52245
+ )
52246
+ ] });
52247
+ }
52248
+ var init_SpaceShmupBoard = __esm({
52249
+ "components/game/organisms/SpaceShmupBoard.tsx"() {
52250
+ "use client";
52251
+ init_cn();
52252
+ init_GameCanvas2D();
52253
+ SpaceShmupBoard.displayName = "SpaceShmupBoard";
52254
+ }
52255
+ });
52256
+ function SpaceStationBoard({
52257
+ tiles,
52258
+ units,
52259
+ features,
52260
+ assetManifest,
52261
+ assetBaseUrl,
52262
+ scale = 0.45,
52263
+ showMinimap = true,
52264
+ enableCamera = true,
52265
+ tileClickEvent,
52266
+ unitClickEvent,
52267
+ isLoading,
52268
+ error,
52269
+ className
52270
+ }) {
52271
+ return /* @__PURE__ */ jsx("div", { className: cn("space-station-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
52272
+ IsometricCanvas_default,
52273
+ {
52274
+ tileLayout: "isometric",
52275
+ tiles,
52276
+ units,
52277
+ features,
52278
+ assetManifest,
52279
+ assetBaseUrl,
52280
+ scale,
52281
+ showMinimap,
52282
+ enableCamera,
52283
+ tileClickEvent,
52284
+ unitClickEvent,
52285
+ isLoading,
52286
+ error
52287
+ }
52288
+ ) });
52289
+ }
52290
+ var init_SpaceStationBoard = __esm({
52291
+ "components/game/organisms/SpaceStationBoard.tsx"() {
52292
+ "use client";
52293
+ init_cn();
52294
+ init_IsometricCanvas();
52295
+ SpaceStationBoard.displayName = "SpaceStationBoard";
52296
+ }
52297
+ });
51629
52298
  var SplitPane;
51630
52299
  var init_SplitPane = __esm({
51631
52300
  "components/core/organisms/layout/SplitPane.tsx"() {
@@ -51719,6 +52388,48 @@ var init_SplitPane = __esm({
51719
52388
  SplitPane.displayName = "SplitPane";
51720
52389
  }
51721
52390
  });
52391
+ function SportsBoard({
52392
+ tiles,
52393
+ units,
52394
+ features,
52395
+ assetManifest,
52396
+ assetBaseUrl,
52397
+ scale = 0.45,
52398
+ showMinimap = false,
52399
+ enableCamera = true,
52400
+ tileClickEvent,
52401
+ unitClickEvent,
52402
+ isLoading,
52403
+ error,
52404
+ className
52405
+ }) {
52406
+ return /* @__PURE__ */ jsx("div", { className: cn("sports-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
52407
+ IsometricCanvas_default,
52408
+ {
52409
+ tileLayout: "flat",
52410
+ tiles,
52411
+ units,
52412
+ features,
52413
+ assetManifest,
52414
+ assetBaseUrl,
52415
+ scale,
52416
+ showMinimap,
52417
+ enableCamera,
52418
+ tileClickEvent,
52419
+ unitClickEvent,
52420
+ isLoading,
52421
+ error
52422
+ }
52423
+ ) });
52424
+ }
52425
+ var init_SportsBoard = __esm({
52426
+ "components/game/organisms/SportsBoard.tsx"() {
52427
+ "use client";
52428
+ init_cn();
52429
+ init_IsometricCanvas();
52430
+ SportsBoard.displayName = "SportsBoard";
52431
+ }
52432
+ });
51722
52433
  var StatCard;
51723
52434
  var init_StatCard = __esm({
51724
52435
  "components/core/organisms/StatCard.tsx"() {
@@ -51757,7 +52468,7 @@ var init_StatCard = __esm({
51757
52468
  const labelToUse = propLabel ?? propTitle;
51758
52469
  const eventBus = useEventBus();
51759
52470
  const { t } = useTranslate();
51760
- const handleActionClick = React93__default.useCallback(() => {
52471
+ const handleActionClick = React94__default.useCallback(() => {
51761
52472
  if (action?.event) {
51762
52473
  eventBus.emit(`UI:${action.event}`, {});
51763
52474
  }
@@ -51768,7 +52479,7 @@ var init_StatCard = __esm({
51768
52479
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
51769
52480
  const isLoading = externalLoading ?? false;
51770
52481
  const error = externalError;
51771
- const computeMetricValue = React93__default.useCallback(
52482
+ const computeMetricValue = React94__default.useCallback(
51772
52483
  (metric, items) => {
51773
52484
  if (metric.value !== void 0) {
51774
52485
  return metric.value;
@@ -51807,7 +52518,7 @@ var init_StatCard = __esm({
51807
52518
  },
51808
52519
  []
51809
52520
  );
51810
- const schemaStats = React93__default.useMemo(() => {
52521
+ const schemaStats = React94__default.useMemo(() => {
51811
52522
  if (!metrics || metrics.length === 0) return null;
51812
52523
  return metrics.map((metric) => ({
51813
52524
  label: metric.label,
@@ -51815,7 +52526,7 @@ var init_StatCard = __esm({
51815
52526
  format: metric.format
51816
52527
  }));
51817
52528
  }, [metrics, data, computeMetricValue]);
51818
- const calculatedTrend = React93__default.useMemo(() => {
52529
+ const calculatedTrend = React94__default.useMemo(() => {
51819
52530
  if (manualTrend !== void 0) return manualTrend;
51820
52531
  if (previousValue === void 0 || currentValue === void 0)
51821
52532
  return void 0;
@@ -52564,6 +53275,832 @@ var init_StepFlowOrganism = __esm({
52564
53275
  StepFlowOrganism.displayName = "StepFlowOrganism";
52565
53276
  }
52566
53277
  });
53278
+
53279
+ // components/core/molecules/markdown/index.ts
53280
+ var init_markdown = __esm({
53281
+ "components/core/molecules/markdown/index.ts"() {
53282
+ init_MarkdownContent();
53283
+ init_CodeBlock();
53284
+ }
53285
+ });
53286
+ function groupByOrbital(subagents) {
53287
+ const map = /* @__PURE__ */ new Map();
53288
+ for (const sub of subagents) {
53289
+ const key = sub.orbitalName ?? "(unattached)";
53290
+ const arr = map.get(key) ?? [];
53291
+ arr.push(sub);
53292
+ map.set(key, arr);
53293
+ }
53294
+ return map;
53295
+ }
53296
+ function statusIconName(status) {
53297
+ switch (status) {
53298
+ case "running":
53299
+ return "loader";
53300
+ case "complete":
53301
+ return "check";
53302
+ case "error":
53303
+ return "x";
53304
+ default:
53305
+ return "circle";
53306
+ }
53307
+ }
53308
+ function lastMessage(sub) {
53309
+ if (sub.messages.length === 0) return void 0;
53310
+ return sub.messages[sub.messages.length - 1].message;
53311
+ }
53312
+ function formatHHMMSS(ts) {
53313
+ const d = new Date(ts);
53314
+ const hh = String(d.getHours()).padStart(2, "0");
53315
+ const mm = String(d.getMinutes()).padStart(2, "0");
53316
+ const ss = String(d.getSeconds()).padStart(2, "0");
53317
+ return `${hh}:${mm}:${ss}`;
53318
+ }
53319
+ function compactJson(value) {
53320
+ if (value === void 0 || value === null) return "";
53321
+ if (typeof value === "string") return value;
53322
+ try {
53323
+ const json = JSON.stringify(value);
53324
+ if (json.length <= 240) return json;
53325
+ return json.slice(0, 239) + "\u2026";
53326
+ } catch {
53327
+ return String(value);
53328
+ }
53329
+ }
53330
+ function tryPrettyJson(s) {
53331
+ try {
53332
+ return JSON.stringify(JSON.parse(s), null, 2);
53333
+ } catch {
53334
+ return null;
53335
+ }
53336
+ }
53337
+ function summarizeArgs(args) {
53338
+ const keys = Object.keys(args);
53339
+ if (keys.length === 0) return "";
53340
+ return keys.slice(0, 3).join(", ") + (keys.length > 3 ? ", \u2026" : "");
53341
+ }
53342
+ function previewText(text, max = 120) {
53343
+ if (!text) return "";
53344
+ return text.length > max ? text.slice(0, max - 1) + "\u2026" : text;
53345
+ }
53346
+ function coordinatorToActivityItems(activities) {
53347
+ return activities.flatMap((a) => {
53348
+ switch (a.type) {
53349
+ case "tool_call":
53350
+ return [{
53351
+ type: "tool_call",
53352
+ tool: a.tool,
53353
+ args: a.args,
53354
+ timestamp: a.timestamp
53355
+ }];
53356
+ case "tool_result":
53357
+ return [{
53358
+ type: "tool_result",
53359
+ tool: a.tool,
53360
+ result: a.result,
53361
+ success: a.success,
53362
+ timestamp: a.timestamp
53363
+ }];
53364
+ case "message":
53365
+ return [{
53366
+ type: "message",
53367
+ role: a.role,
53368
+ content: a.content,
53369
+ timestamp: a.timestamp
53370
+ }];
53371
+ case "error":
53372
+ return [{
53373
+ type: "message",
53374
+ role: "system",
53375
+ content: `Error: ${a.message}`,
53376
+ timestamp: a.timestamp
53377
+ }];
53378
+ case "coordinator_decision":
53379
+ case "plan_committed":
53380
+ case "pending_question":
53381
+ case "clarification_question":
53382
+ return [];
53383
+ case "file_operation":
53384
+ return [{
53385
+ type: "file_operation",
53386
+ operation: a.operation,
53387
+ path: a.path,
53388
+ success: a.success,
53389
+ timestamp: a.timestamp
53390
+ }];
53391
+ case "schema_diff":
53392
+ return [{
53393
+ type: "schema_diff",
53394
+ filePath: a.filePath,
53395
+ hunks: a.hunks,
53396
+ timestamp: a.timestamp
53397
+ }];
53398
+ }
53399
+ });
53400
+ }
53401
+ function pluckCoordinatorState(activities) {
53402
+ let decision = null;
53403
+ let plan = null;
53404
+ const pendingQuestions = [];
53405
+ for (const a of activities) {
53406
+ if (a.type === "coordinator_decision") decision = a;
53407
+ else if (a.type === "plan_committed") plan = a;
53408
+ else if (a.type === "pending_question") pendingQuestions.push(a);
53409
+ }
53410
+ return { decision, plan, pendingQuestions };
53411
+ }
53412
+ function subagentMessagesToActivities(messages) {
53413
+ return messages.map((m) => {
53414
+ if (m.tool) {
53415
+ return {
53416
+ type: "tool_call",
53417
+ tool: m.tool,
53418
+ args: { preview: m.message },
53419
+ timestamp: m.timestamp
53420
+ };
53421
+ }
53422
+ return {
53423
+ type: "message",
53424
+ role: "system",
53425
+ content: m.message,
53426
+ timestamp: m.timestamp
53427
+ };
53428
+ });
53429
+ }
53430
+ function buildTimelineItems(messages, activities, subagents) {
53431
+ const items = [];
53432
+ if (messages) {
53433
+ messages.forEach((m, i) => items.push({ source: "message", data: m, index: i }));
53434
+ }
53435
+ if (activities) {
53436
+ activities.forEach((a) => items.push({ source: "activity", data: a }));
53437
+ }
53438
+ subagents.forEach((s) => items.push({ source: "subagent", data: s }));
53439
+ return items;
53440
+ }
53441
+ function timelineItemIcon(item) {
53442
+ switch (item.source) {
53443
+ case "message": {
53444
+ const m = item.data;
53445
+ if (m.role === "tool") return { name: "terminal", color: "text-[var(--color-primary)]" };
53446
+ if (m.reasoningContent) return { name: "sparkles", color: "text-[var(--color-primary)]" };
53447
+ if (m.role === "user") return { name: "user", color: "text-[var(--color-primary)]" };
53448
+ return { name: "message-square", color: "text-[var(--color-muted-foreground)]" };
53449
+ }
53450
+ case "activity": {
53451
+ const a = item.data;
53452
+ switch (a.type) {
53453
+ case "tool_call":
53454
+ return { name: "terminal", color: "text-[var(--color-primary)]" };
53455
+ case "tool_result":
53456
+ return { name: a.success !== false ? "check" : "x", color: a.success !== false ? "text-[var(--color-success)]" : "text-[var(--color-danger)]" };
53457
+ case "error":
53458
+ return { name: "alert-triangle", color: "text-[var(--color-danger)]" };
53459
+ case "file_operation":
53460
+ return { name: "file", color: "text-[var(--color-muted-foreground)]" };
53461
+ case "schema_diff":
53462
+ return { name: "git-commit", color: "text-[var(--color-muted-foreground)]" };
53463
+ default:
53464
+ return { name: "info", color: "text-[var(--color-muted-foreground)]" };
53465
+ }
53466
+ }
53467
+ case "subagent":
53468
+ return { name: "bot", color: "text-[var(--color-primary)]" };
53469
+ }
53470
+ }
53471
+ function timelineItemLabel(item) {
53472
+ switch (item.source) {
53473
+ case "message": {
53474
+ const m = item.data;
53475
+ if (m.role === "tool") return "tool";
53476
+ if (m.reasoningContent) return "thinking";
53477
+ return m.role;
53478
+ }
53479
+ case "activity":
53480
+ return item.data.type;
53481
+ case "subagent":
53482
+ return "subagent";
53483
+ }
53484
+ }
53485
+ function timelineItemPreview(item) {
53486
+ switch (item.source) {
53487
+ case "message": {
53488
+ const m = item.data;
53489
+ if (m.role === "tool") return `${m.toolName ?? "tool"} \u2192 ${m.toolCallId?.slice(0, 8) ?? ""}`;
53490
+ if (m.reasoningContent) return previewText(m.reasoningContent, 120);
53491
+ return previewText(m.content, 120);
53492
+ }
53493
+ case "activity": {
53494
+ const a = item.data;
53495
+ switch (a.type) {
53496
+ case "tool_call":
53497
+ return `${a.tool}(${summarizeArgs(a.args)})`;
53498
+ case "tool_result":
53499
+ return `${a.tool}: ${compactJson(a.result)}`;
53500
+ case "message":
53501
+ return previewText(a.content, 120);
53502
+ case "error":
53503
+ return previewText(a.message, 120);
53504
+ case "file_operation":
53505
+ return `${a.operation} ${a.path}`;
53506
+ case "schema_diff":
53507
+ return `diff ${a.filePath}`;
53508
+ default:
53509
+ return String(a.type);
53510
+ }
53511
+ }
53512
+ case "subagent":
53513
+ return `${item.data.name} \xB7 ${item.data.task}`;
53514
+ }
53515
+ }
53516
+ function timelineItemTimeLabel(item) {
53517
+ if (item.source === "activity") return formatHHMMSS(item.data.timestamp);
53518
+ if (item.source === "subagent") {
53519
+ const ts = item.data.messages[0]?.timestamp;
53520
+ return ts !== void 0 ? formatHHMMSS(ts) : void 0;
53521
+ }
53522
+ return void 0;
53523
+ }
53524
+ function TraceDetailContent({ item }) {
53525
+ const { t } = useTranslate();
53526
+ switch (item.source) {
53527
+ case "message": {
53528
+ const m = item.data;
53529
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
53530
+ /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "items-center", children: /* @__PURE__ */ jsx(Badge, { variant: roleBadgeVariant[m.role], className: "text-[10px] uppercase", children: m.role }) }),
53531
+ typeof m.reasoningContent === "string" && m.reasoningContent.length > 0 && /* @__PURE__ */ jsxs(Box, { children: [
53532
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "mb-1", children: t("subagentTrace.reasoning") }),
53533
+ /* @__PURE__ */ jsx(MarkdownContent, { content: m.reasoningContent })
53534
+ ] }),
53535
+ m.content.length > 0 && /* @__PURE__ */ jsxs(Box, { children: [
53536
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "mb-1", children: t("subagentTrace.content") }),
53537
+ m.role === "tool" ? (() => {
53538
+ const pretty = tryPrettyJson(m.content);
53539
+ return pretty !== null ? /* @__PURE__ */ jsx(CodeBlock, { code: pretty, language: "json", maxHeight: "24rem" }) : /* @__PURE__ */ jsx(Typography, { variant: "body", className: "whitespace-pre-wrap font-mono text-[11px]", children: m.content });
53540
+ })() : /* @__PURE__ */ jsx(MarkdownContent, { content: m.content })
53541
+ ] }),
53542
+ Array.isArray(m.toolCalls) && m.toolCalls.length > 0 && /* @__PURE__ */ jsxs(Box, { children: [
53543
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "mb-1", children: t("subagentTrace.toolCalls") }),
53544
+ /* @__PURE__ */ jsx(
53545
+ Accordion,
53546
+ {
53547
+ multiple: true,
53548
+ items: m.toolCalls.map((tc, i) => ({
53549
+ id: `tc-detail-${i}`,
53550
+ title: `${tc.name}(${summarizeArgs(tc.args)})`,
53551
+ content: /* @__PURE__ */ jsx(CodeBlock, { code: JSON.stringify(tc.args, null, 2), language: "json", maxHeight: "24rem" })
53552
+ }))
53553
+ }
53554
+ )
53555
+ ] })
53556
+ ] });
53557
+ }
53558
+ case "activity": {
53559
+ const a = item.data;
53560
+ switch (a.type) {
53561
+ case "tool_call":
53562
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
53563
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
53564
+ /* @__PURE__ */ jsx(Badge, { variant: "default", className: "text-[10px]", children: "tool_call" }),
53565
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: formatHHMMSS(a.timestamp) })
53566
+ ] }),
53567
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", children: a.tool }),
53568
+ /* @__PURE__ */ jsx(CodeBlock, { code: JSON.stringify(a.args, null, 2), language: "json", maxHeight: "60vh" })
53569
+ ] });
53570
+ case "tool_result":
53571
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
53572
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
53573
+ /* @__PURE__ */ jsx(Badge, { variant: a.success !== false ? "default" : "warning", className: "text-[10px]", children: a.success !== false ? "success" : "fail" }),
53574
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: formatHHMMSS(a.timestamp) })
53575
+ ] }),
53576
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", children: a.tool }),
53577
+ /* @__PURE__ */ jsx(CodeBlock, { code: JSON.stringify(a.result, null, 2), language: "json", maxHeight: "60vh" })
53578
+ ] });
53579
+ case "message":
53580
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
53581
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
53582
+ /* @__PURE__ */ jsx(Badge, { variant: "neutral", className: "text-[10px]", children: a.role }),
53583
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: formatHHMMSS(a.timestamp) })
53584
+ ] }),
53585
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "whitespace-pre-wrap", children: a.content })
53586
+ ] });
53587
+ case "error":
53588
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
53589
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
53590
+ /* @__PURE__ */ jsx(Badge, { variant: "warning", className: "text-[10px]", children: "error" }),
53591
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: formatHHMMSS(a.timestamp) })
53592
+ ] }),
53593
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "whitespace-pre-wrap text-[var(--color-danger)]", children: a.message })
53594
+ ] });
53595
+ case "file_operation":
53596
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
53597
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
53598
+ /* @__PURE__ */ jsx(Badge, { variant: "neutral", className: "text-[10px]", children: "file" }),
53599
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: formatHHMMSS(a.timestamp) })
53600
+ ] }),
53601
+ /* @__PURE__ */ jsxs(Typography, { variant: "body2", children: [
53602
+ a.operation,
53603
+ " ",
53604
+ a.path
53605
+ ] })
53606
+ ] });
53607
+ case "schema_diff":
53608
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
53609
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
53610
+ /* @__PURE__ */ jsx(Badge, { variant: "neutral", className: "text-[10px]", children: "diff" }),
53611
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: formatHHMMSS(a.timestamp) })
53612
+ ] }),
53613
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", children: a.filePath })
53614
+ ] });
53615
+ default:
53616
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
53617
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: formatHHMMSS(a.timestamp) }),
53618
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", children: String(a.type) })
53619
+ ] });
53620
+ }
53621
+ }
53622
+ case "subagent": {
53623
+ const s = item.data;
53624
+ const activities = subagentMessagesToActivities(s.messages);
53625
+ const ts = s.messages[0]?.timestamp;
53626
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
53627
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
53628
+ /* @__PURE__ */ jsx(Badge, { variant: "default", className: "text-[10px]", children: s.role }),
53629
+ ts !== void 0 && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: formatHHMMSS(ts) })
53630
+ ] }),
53631
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", weight: "semibold", children: s.name }),
53632
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "muted", children: s.task }),
53633
+ activities.length > 0 && /* @__PURE__ */ jsx(Box, { className: "border-t border-[var(--color-border)] pt-2", children: /* @__PURE__ */ jsx(InlineActivityStream, { activities, autoScroll: false }) })
53634
+ ] });
53635
+ }
53636
+ }
53637
+ }
53638
+ var InlineActivityRow, InlineActivityStream, CoordinatorCard, SubagentRow, OrbitalGroup, SubagentRichCard, roleBadgeVariant, ChatMessageRow, CoordinatorConversation, SubagentTracePanel;
53639
+ var init_SubagentTracePanel = __esm({
53640
+ "components/core/organisms/SubagentTracePanel.tsx"() {
53641
+ "use client";
53642
+ init_Box();
53643
+ init_Stack();
53644
+ init_Typography();
53645
+ init_Badge();
53646
+ init_Icon();
53647
+ init_Button();
53648
+ init_Modal();
53649
+ init_Accordion();
53650
+ init_markdown();
53651
+ InlineActivityRow = ({ activity }) => {
53652
+ const time = formatHHMMSS(activity.timestamp);
53653
+ const baseRow = "items-start px-3 py-1 hover:bg-[var(--color-surface)]";
53654
+ if (activity.type === "tool_call") {
53655
+ return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: baseRow, children: [
53656
+ /* @__PURE__ */ jsx(Icon, { name: "terminal", size: "xs", className: "mt-0.5 flex-shrink-0 text-[var(--color-primary)]" }),
53657
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "flex-1 min-w-0 text-[11px] font-mono break-all whitespace-pre-wrap", children: [
53658
+ /* @__PURE__ */ jsx(Typography, { as: "span", variant: "caption", weight: "semibold", className: "text-[11px] font-mono", children: activity.tool }),
53659
+ activity.args !== void 0 && /* @__PURE__ */ jsxs(Typography, { as: "span", variant: "caption", color: "muted", className: "text-[11px] font-mono", children: [
53660
+ " ",
53661
+ compactJson(activity.args)
53662
+ ] })
53663
+ ] }),
53664
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px] flex-shrink-0 tabular-nums mt-0.5", children: time })
53665
+ ] });
53666
+ }
53667
+ if (activity.type === "tool_result") {
53668
+ const success = activity.success !== false;
53669
+ return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: baseRow, children: [
53670
+ /* @__PURE__ */ jsx(
53671
+ Icon,
53672
+ {
53673
+ name: success ? "check" : "x",
53674
+ size: "xs",
53675
+ className: `mt-0.5 flex-shrink-0 ${success ? "text-[var(--color-success)]" : "text-[var(--color-danger)]"}`
53676
+ }
53677
+ ),
53678
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "flex-1 min-w-0 text-[11px] font-mono break-all whitespace-pre-wrap", children: [
53679
+ /* @__PURE__ */ jsxs(Typography, { as: "span", variant: "caption", color: "muted", className: "text-[11px] font-mono", children: [
53680
+ activity.tool,
53681
+ ":",
53682
+ " "
53683
+ ] }),
53684
+ /* @__PURE__ */ jsx(Typography, { as: "span", variant: "caption", className: "text-[11px] font-mono", children: compactJson(activity.result) })
53685
+ ] }),
53686
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px] flex-shrink-0 tabular-nums mt-0.5", children: time })
53687
+ ] });
53688
+ }
53689
+ if (activity.type === "message") {
53690
+ const role = activity.role;
53691
+ const iconName = role === "user" ? "user" : role === "system" ? "info" : "sparkles";
53692
+ const roleColor = role === "user" ? "text-[var(--color-primary)]" : role === "system" ? "text-[var(--color-muted-foreground)]" : "text-[var(--color-foreground)]";
53693
+ return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: baseRow, children: [
53694
+ /* @__PURE__ */ jsx(Icon, { name: iconName, size: "xs", className: `mt-0.5 flex-shrink-0 ${roleColor}` }),
53695
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "flex-1 min-w-0 text-[11px] whitespace-pre-wrap break-words", children: activity.content }),
53696
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px] flex-shrink-0 tabular-nums mt-0.5", children: time })
53697
+ ] });
53698
+ }
53699
+ if (activity.type === "error") {
53700
+ return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: baseRow, children: [
53701
+ /* @__PURE__ */ jsx(Icon, { name: "alert-triangle", size: "xs", className: "mt-0.5 flex-shrink-0 text-[var(--color-danger)]" }),
53702
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "flex-1 min-w-0 text-[11px] text-[var(--color-danger)] whitespace-pre-wrap break-words", children: activity.message }),
53703
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px] flex-shrink-0 tabular-nums mt-0.5", children: time })
53704
+ ] });
53705
+ }
53706
+ return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: baseRow, children: [
53707
+ /* @__PURE__ */ jsx(Icon, { name: "file", size: "xs", className: "mt-0.5 flex-shrink-0 text-[var(--color-muted-foreground)]" }),
53708
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", className: "flex-1 min-w-0 text-[11px] font-mono break-all", children: [
53709
+ "[",
53710
+ activity.type,
53711
+ "] ",
53712
+ compactJson(activity)
53713
+ ] }),
53714
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px] flex-shrink-0 tabular-nums mt-0.5", children: time })
53715
+ ] });
53716
+ };
53717
+ InlineActivityStream = ({ activities, autoScroll = true, className }) => {
53718
+ const endRef = React94__default.useRef(null);
53719
+ React94__default.useEffect(() => {
53720
+ if (!autoScroll) return;
53721
+ endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
53722
+ }, [activities.length, autoScroll]);
53723
+ return /* @__PURE__ */ jsxs(Box, { className, children: [
53724
+ activities.map((a, i) => /* @__PURE__ */ jsx(InlineActivityRow, { activity: a }, `${a.timestamp}-${i}`)),
53725
+ /* @__PURE__ */ jsx(Box, { ref: endRef })
53726
+ ] });
53727
+ };
53728
+ CoordinatorCard = ({ snapshot, className }) => {
53729
+ const { t } = useTranslate();
53730
+ const { decision, plan, pendingQuestions } = snapshot;
53731
+ if (!decision && !plan && pendingQuestions.length === 0) return null;
53732
+ return /* @__PURE__ */ jsxs(
53733
+ Box,
53734
+ {
53735
+ className: `px-3 py-2 border-b border-[var(--color-border)] bg-[var(--color-muted)]/30 ${className ?? ""}`,
53736
+ children: [
53737
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center mb-2", children: [
53738
+ /* @__PURE__ */ jsx(Icon, { name: "compass", size: "xs" }),
53739
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold text-[11px]", children: t("subagentTrace.coordinator") })
53740
+ ] }),
53741
+ decision && /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "mb-2", children: [
53742
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
53743
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px] uppercase tracking-wide", children: t("subagentTrace.organism") }),
53744
+ /* @__PURE__ */ jsx(Badge, { variant: "default", className: "text-[10px]", children: decision.organism }),
53745
+ decision.priorOrganism && decision.priorOrganism !== decision.organism && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px]", children: t("subagentTrace.wasOrganism", { organism: decision.priorOrganism }) })
53746
+ ] }),
53747
+ decision.reason && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[11px] mt-0.5", children: decision.reason })
53748
+ ] }),
53749
+ plan && plan.orbitals.length > 0 && /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "mb-2", children: [
53750
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px] uppercase tracking-wide mb-0.5", children: plan.orbitals.length === 1 ? t("subagentTrace.planOrbital", { count: plan.orbitals.length }) : t("subagentTrace.planOrbitals", { count: plan.orbitals.length }) }),
53751
+ /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap", children: plan.orbitals.map((o) => /* @__PURE__ */ jsx(Badge, { variant: "neutral", className: "text-[10px]", children: o }, o)) })
53752
+ ] }),
53753
+ pendingQuestions.length > 0 && /* @__PURE__ */ jsxs(VStack, { gap: "none", children: [
53754
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px] uppercase tracking-wide mb-0.5", children: pendingQuestions.length === 1 ? t("subagentTrace.pendingQuestion", { count: pendingQuestions.length }) : t("subagentTrace.pendingQuestions", { count: pendingQuestions.length }) }),
53755
+ pendingQuestions.map((q) => /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-start", children: [
53756
+ /* @__PURE__ */ jsx(Icon, { name: "help-circle", size: "xs", className: "mt-0.5 flex-shrink-0 text-[var(--color-warning)]" }),
53757
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-[11px] flex-1 min-w-0", children: [
53758
+ q.question,
53759
+ q.orbitalName && /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", className: "text-[10px] ml-1", children: [
53760
+ "(",
53761
+ q.orbitalName,
53762
+ ")"
53763
+ ] })
53764
+ ] })
53765
+ ] }, q.questionId))
53766
+ ] })
53767
+ ]
53768
+ }
53769
+ );
53770
+ };
53771
+ SubagentRow = ({ subagent }) => {
53772
+ const recent = lastMessage(subagent);
53773
+ return /* @__PURE__ */ jsxs(
53774
+ HStack,
53775
+ {
53776
+ gap: "sm",
53777
+ className: "items-start px-3 py-2 border-b border-[var(--color-border)]",
53778
+ children: [
53779
+ /* @__PURE__ */ jsx(Box, { className: "pt-0.5", children: /* @__PURE__ */ jsx(Icon, { name: statusIconName(subagent.status), size: "xs" }) }),
53780
+ /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "flex-1 min-w-0", children: [
53781
+ /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center", children: [
53782
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-medium truncate", children: subagent.name }),
53783
+ /* @__PURE__ */ jsx(Badge, { variant: "default", children: subagent.role })
53784
+ ] }),
53785
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "truncate", children: recent ?? subagent.task })
53786
+ ] })
53787
+ ]
53788
+ }
53789
+ );
53790
+ };
53791
+ OrbitalGroup = ({ orbitalName, subagents }) => {
53792
+ const { t } = useTranslate();
53793
+ const runningCount = subagents.filter((s) => s.status === "running").length;
53794
+ const completeCount = subagents.filter((s) => s.status === "complete").length;
53795
+ return /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "border-b border-[var(--color-border)]", children: [
53796
+ /* @__PURE__ */ jsxs(
53797
+ HStack,
53798
+ {
53799
+ gap: "sm",
53800
+ className: "items-center px-3 py-2 bg-[var(--color-surface)] border-b border-[var(--color-border)]",
53801
+ children: [
53802
+ /* @__PURE__ */ jsx(Icon, { name: "circle", size: "xs" }),
53803
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold flex-1 truncate", children: orbitalName }),
53804
+ /* @__PURE__ */ jsx(Badge, { variant: "default", children: runningCount > 0 ? t("subagentTrace.countRunning", { count: runningCount }) : t("subagentTrace.countDone", { count: completeCount }) })
53805
+ ]
53806
+ }
53807
+ ),
53808
+ subagents.map((sub) => /* @__PURE__ */ jsx(SubagentRow, { subagent: sub }, sub.id))
53809
+ ] });
53810
+ };
53811
+ SubagentRichCard = ({ subagent }) => {
53812
+ const { t } = useTranslate();
53813
+ const activities = React94__default.useMemo(
53814
+ () => subagentMessagesToActivities(subagent.messages),
53815
+ [subagent.messages]
53816
+ );
53817
+ return /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "border-b border-[var(--color-border)] p-3", children: [
53818
+ /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center mb-2", children: [
53819
+ /* @__PURE__ */ jsx(
53820
+ Box,
53821
+ {
53822
+ style: {
53823
+ width: 8,
53824
+ height: 8,
53825
+ borderRadius: "50%",
53826
+ flexShrink: 0,
53827
+ backgroundColor: subagent.status === "complete" ? "var(--color-success)" : subagent.status === "error" ? "var(--color-error)" : "var(--color-primary)",
53828
+ ...subagent.status === "running" ? { animation: "pulse 1.5s infinite" } : {}
53829
+ }
53830
+ }
53831
+ ),
53832
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold flex-1 truncate", children: subagent.name }),
53833
+ /* @__PURE__ */ jsx(Badge, { variant: subagent.role === "deterministic" ? "default" : subagent.role === "llm" ? "info" : "warning", children: subagent.role }),
53834
+ subagent.durationMs !== void 0 && subagent.durationMs > 0 && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: subagent.durationMs < 1e3 ? `${subagent.durationMs}ms` : `${(subagent.durationMs / 1e3).toFixed(1)}s` })
53835
+ ] }),
53836
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "mb-2", children: subagent.task }),
53837
+ activities.length > 0 ? /* @__PURE__ */ jsx(Box, { className: "max-h-64 overflow-y-auto border-t border-[var(--color-border)]", children: /* @__PURE__ */ jsx(InlineActivityStream, { activities, autoScroll: true }) }) : /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "italic text-[10px]", children: subagent.status === "complete" ? t("subagentTrace.noConversationLog") : t("subagentTrace.waitingForProcessData") })
53838
+ ] });
53839
+ };
53840
+ roleBadgeVariant = {
53841
+ system: "neutral",
53842
+ user: "info",
53843
+ assistant: "default",
53844
+ tool: "warning"
53845
+ };
53846
+ ChatMessageRow = ({ message, index }) => {
53847
+ const { t } = useTranslate();
53848
+ const { role, content, toolCalls, reasoningContent, toolCallId, toolName } = message;
53849
+ if (role === "tool") {
53850
+ const pretty = tryPrettyJson(content);
53851
+ const title = `${toolName ?? "tool"} \u2192${toolCallId ? ` ${toolCallId.slice(0, 8)}` : ""}`;
53852
+ const body = pretty !== null ? /* @__PURE__ */ jsx(CodeBlock, { code: pretty, language: "json", maxHeight: "24rem" }) : /* @__PURE__ */ jsx(Typography, { variant: "body", className: "whitespace-pre-wrap font-mono text-[11px]", children: content });
53853
+ const items = [{ id: `tool-${index}`, title, content: body }];
53854
+ return /* @__PURE__ */ jsx(Box, { className: "px-3 py-2 border-b border-[var(--color-border)]", children: /* @__PURE__ */ jsx(Accordion, { items }) });
53855
+ }
53856
+ const hasReasoning = typeof reasoningContent === "string" && reasoningContent.length > 0;
53857
+ const hasToolCalls = Array.isArray(toolCalls) && toolCalls.length > 0;
53858
+ return /* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "px-3 py-2 border-b border-[var(--color-border)]", children: [
53859
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
53860
+ /* @__PURE__ */ jsx(Badge, { variant: roleBadgeVariant[role], className: "text-[10px] uppercase", children: role }),
53861
+ hasReasoning && /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", className: "text-[10px]", children: [
53862
+ "\xB7 ",
53863
+ t("subagentTrace.thinking")
53864
+ ] }),
53865
+ hasToolCalls && /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", className: "text-[10px]", children: [
53866
+ "\xB7 ",
53867
+ toolCalls.length === 1 ? t("subagentTrace.toolCallCount", { count: toolCalls.length }) : t("subagentTrace.toolCallCountPlural", { count: toolCalls.length })
53868
+ ] })
53869
+ ] }),
53870
+ hasReasoning && /* @__PURE__ */ jsx(Accordion, { items: [{
53871
+ id: `reasoning-${index}`,
53872
+ title: t("subagentTrace.reasoning"),
53873
+ content: /* @__PURE__ */ jsx(MarkdownContent, { content: reasoningContent })
53874
+ }] }),
53875
+ content.length > 0 && /* @__PURE__ */ jsx(MarkdownContent, { content }),
53876
+ hasToolCalls && /* @__PURE__ */ jsx(
53877
+ Accordion,
53878
+ {
53879
+ multiple: true,
53880
+ items: toolCalls.map((tc, i) => ({
53881
+ id: `tc-${index}-${i}`,
53882
+ title: `${tc.name}(${summarizeArgs(tc.args)})`,
53883
+ content: /* @__PURE__ */ jsx(CodeBlock, { code: JSON.stringify(tc.args, null, 2), language: "json", maxHeight: "24rem" })
53884
+ }))
53885
+ }
53886
+ )
53887
+ ] });
53888
+ };
53889
+ CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
53890
+ const endRef = React94__default.useRef(null);
53891
+ React94__default.useEffect(() => {
53892
+ if (!autoScroll) return;
53893
+ endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
53894
+ }, [messages.length, autoScroll]);
53895
+ return /* @__PURE__ */ jsxs(Box, { className, children: [
53896
+ messages.map((m, i) => /* @__PURE__ */ jsx(ChatMessageRow, { message: m, index: i }, `msg-${i}`)),
53897
+ /* @__PURE__ */ jsx(Box, { ref: endRef })
53898
+ ] });
53899
+ };
53900
+ SubagentTracePanel = ({
53901
+ subagents,
53902
+ focusedOrbital,
53903
+ disclosureLevel,
53904
+ open,
53905
+ onClose,
53906
+ className,
53907
+ mode = "overlay",
53908
+ coordinatorActivities,
53909
+ coordinatorMessages
53910
+ }) => {
53911
+ const { t } = useTranslate();
53912
+ const [selectedItem, setSelectedItem] = useState(null);
53913
+ const densityLabel = (rich) => rich ? t("subagentTrace.densityRich") : t("subagentTrace.densityCompact");
53914
+ if (mode === "overlay" && !open) return null;
53915
+ const isTabMode = mode === "tab";
53916
+ const isRichMode = isTabMode || disclosureLevel >= 3;
53917
+ if (isTabMode) {
53918
+ const timelineItems = buildTimelineItems(coordinatorMessages, coordinatorActivities, subagents);
53919
+ const hasData = timelineItems.length > 0;
53920
+ return /* @__PURE__ */ jsxs(Box, { className: `h-full w-full bg-[var(--color-card)] overflow-hidden flex flex-col ${className ?? ""}`, children: [
53921
+ /* @__PURE__ */ jsxs(
53922
+ HStack,
53923
+ {
53924
+ gap: "sm",
53925
+ className: "items-center px-3 py-2 border-b border-[var(--color-border)]",
53926
+ children: [
53927
+ /* @__PURE__ */ jsx(Icon, { name: "activity", size: "sm" }),
53928
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold flex-1", children: t("subagentTrace.trace") }),
53929
+ onClose && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: onClose, children: /* @__PURE__ */ jsx(Icon, { name: "x", size: "xs" }) })
53930
+ ]
53931
+ }
53932
+ ),
53933
+ !hasData && /* @__PURE__ */ jsx(Box, { className: "flex-1 flex items-center justify-center px-4", children: /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "muted", className: "text-center", children: t("subagentTrace.noAgentActivity") }) }),
53934
+ hasData && /* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsx(VStack, { gap: "none", children: timelineItems.map((item, i) => {
53935
+ const { name: iconName, color: iconColor } = timelineItemIcon(item);
53936
+ const isLast = i === timelineItems.length - 1;
53937
+ return /* @__PURE__ */ jsxs(
53938
+ Box,
53939
+ {
53940
+ className: "flex items-start px-3 py-2 border-b border-[var(--color-border)] hover:bg-[var(--color-muted)]/30 transition-colors duration-fast cursor-pointer",
53941
+ onClick: () => setSelectedItem(item),
53942
+ children: [
53943
+ /* @__PURE__ */ jsxs(Box, { className: "flex flex-col items-center mr-3 mt-0.5", style: { width: 20 }, children: [
53944
+ /* @__PURE__ */ jsx(
53945
+ Box,
53946
+ {
53947
+ className: "rounded-full flex-shrink-0",
53948
+ style: {
53949
+ width: 8,
53950
+ height: 8,
53951
+ backgroundColor: "var(--color-primary)"
53952
+ }
53953
+ }
53954
+ ),
53955
+ !isLast && /* @__PURE__ */ jsx(
53956
+ Box,
53957
+ {
53958
+ className: "flex-1",
53959
+ style: {
53960
+ width: 2,
53961
+ backgroundColor: "var(--color-border)",
53962
+ marginTop: 4,
53963
+ minHeight: 24
53964
+ }
53965
+ }
53966
+ )
53967
+ ] }),
53968
+ /* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "flex-1 min-w-0", children: [
53969
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
53970
+ /* @__PURE__ */ jsx(Icon, { name: iconName, size: "xs", className: `flex-shrink-0 ${iconColor}` }),
53971
+ timelineItemTimeLabel(item) && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: timelineItemTimeLabel(item) }),
53972
+ /* @__PURE__ */ jsx(Badge, { variant: "neutral", className: "text-[10px]", children: timelineItemLabel(item) })
53973
+ ] }),
53974
+ /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-start", children: [
53975
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "muted", className: "flex-1 min-w-0 line-clamp-2", children: timelineItemPreview(item) }),
53976
+ /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", className: "flex-shrink-0 mt-0", onClick: (e) => {
53977
+ e.stopPropagation();
53978
+ setSelectedItem(item);
53979
+ }, children: /* @__PURE__ */ jsx(Icon, { name: "maximize-2", size: "xs" }) })
53980
+ ] })
53981
+ ] })
53982
+ ]
53983
+ },
53984
+ `${item.source}-${i}`
53985
+ );
53986
+ }) }) }),
53987
+ /* @__PURE__ */ jsx(
53988
+ Modal,
53989
+ {
53990
+ isOpen: selectedItem !== null,
53991
+ onClose: () => setSelectedItem(null),
53992
+ title: selectedItem ? `${timelineItemLabel(selectedItem)}${timelineItemTimeLabel(selectedItem) ? ` \xB7 ${timelineItemTimeLabel(selectedItem)}` : ""}` : "",
53993
+ size: "lg",
53994
+ children: selectedItem && /* @__PURE__ */ jsx(TraceDetailContent, { item: selectedItem })
53995
+ }
53996
+ )
53997
+ ] });
53998
+ }
53999
+ const filtered = focusedOrbital ? subagents.filter((s) => s.orbitalName === focusedOrbital) : subagents;
54000
+ const wrapperClass = isRichMode ? `absolute inset-x-3 bottom-3 sm:inset-x-auto sm:top-3 sm:right-3 sm:bottom-3 w-full sm:w-[28rem] max-w-[calc(100vw-1.5rem)] max-h-[60vh] sm:max-h-none bg-[var(--color-card)] border border-[var(--color-border)] rounded-md shadow-lg overflow-hidden flex flex-col ${className ?? ""}` : `absolute inset-x-3 bottom-3 sm:inset-x-auto sm:top-3 sm:right-3 sm:bottom-3 w-full sm:w-80 max-w-[calc(100vw-1.5rem)] max-h-[60vh] sm:max-h-none bg-[var(--color-card)] border border-[var(--color-border)] rounded-md shadow-lg overflow-hidden flex flex-col ${className ?? ""}`;
54001
+ const wrapperStyle = { zIndex: 20 };
54002
+ const hasCoordinatorData = coordinatorMessages && coordinatorMessages.length > 0 || coordinatorActivities && coordinatorActivities.length > 0;
54003
+ if (filtered.length === 0 && !hasCoordinatorData) {
54004
+ return /* @__PURE__ */ jsxs(Box, { className: wrapperClass, style: wrapperStyle, children: [
54005
+ /* @__PURE__ */ jsxs(
54006
+ HStack,
54007
+ {
54008
+ gap: "sm",
54009
+ className: "items-center px-3 py-2 border-b border-[var(--color-border)]",
54010
+ children: [
54011
+ /* @__PURE__ */ jsx(Icon, { name: "activity", size: "sm" }),
54012
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold flex-1", children: t("subagentTrace.subagents") }),
54013
+ onClose && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: onClose, children: /* @__PURE__ */ jsx(Icon, { name: "x", size: "xs" }) })
54014
+ ]
54015
+ }
54016
+ ),
54017
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 flex items-center justify-center px-4", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-center", children: focusedOrbital ? t("subagentTrace.noSubagentsForOrbital", { orbital: focusedOrbital }) : t("subagentTrace.noSubagentsActive") }) })
54018
+ ] });
54019
+ }
54020
+ if (focusedOrbital) {
54021
+ return /* @__PURE__ */ jsxs(Box, { className: wrapperClass, style: wrapperStyle, children: [
54022
+ /* @__PURE__ */ jsxs(
54023
+ HStack,
54024
+ {
54025
+ gap: "sm",
54026
+ className: "items-center px-3 py-2 border-b border-[var(--color-border)]",
54027
+ children: [
54028
+ /* @__PURE__ */ jsx(Icon, { name: "activity", size: "sm" }),
54029
+ /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "flex-1 min-w-0", children: [
54030
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold truncate", children: focusedOrbital }),
54031
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", children: [
54032
+ filtered.length === 1 ? t("subagentTrace.subagentCount", { count: filtered.length }) : t("subagentTrace.subagentCountPlural", { count: filtered.length }),
54033
+ " \xB7 ",
54034
+ densityLabel(isRichMode)
54035
+ ] })
54036
+ ] }),
54037
+ onClose && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: onClose, children: /* @__PURE__ */ jsx(Icon, { name: "x", size: "xs" }) })
54038
+ ]
54039
+ }
54040
+ ),
54041
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto", children: filtered.map((sub) => isRichMode ? /* @__PURE__ */ jsx(SubagentRichCard, { subagent: sub }, sub.id) : /* @__PURE__ */ jsx(SubagentRow, { subagent: sub }, sub.id)) })
54042
+ ] });
54043
+ }
54044
+ const grouped = groupByOrbital(filtered);
54045
+ const coordinatorSnapshot = pluckCoordinatorState(coordinatorActivities ?? []);
54046
+ return /* @__PURE__ */ jsxs(Box, { className: wrapperClass, style: wrapperStyle, children: [
54047
+ /* @__PURE__ */ jsxs(
54048
+ HStack,
54049
+ {
54050
+ gap: "sm",
54051
+ className: "items-center px-3 py-2 border-b border-[var(--color-border)]",
54052
+ children: [
54053
+ /* @__PURE__ */ jsx(Icon, { name: "activity", size: "sm" }),
54054
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "font-semibold flex-1", children: [
54055
+ t("subagentTrace.subagentsWithCount", { count: filtered.length }),
54056
+ " \xB7 ",
54057
+ densityLabel(isRichMode)
54058
+ ] }),
54059
+ onClose && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: onClose, children: /* @__PURE__ */ jsx(Icon, { name: "x", size: "xs" }) })
54060
+ ]
54061
+ }
54062
+ ),
54063
+ /* @__PURE__ */ jsxs(Box, { className: "flex-1 overflow-y-auto", children: [
54064
+ !focusedOrbital && isRichMode && /* @__PURE__ */ jsx(CoordinatorCard, { snapshot: coordinatorSnapshot }),
54065
+ coordinatorMessages && coordinatorMessages.length > 0 ? /* @__PURE__ */ jsxs(Box, { className: "border-b border-[var(--color-border)]", children: [
54066
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center px-3 py-1.5 bg-[var(--color-card)] border-b border-[var(--color-border)]", children: [
54067
+ /* @__PURE__ */ jsx(Box, { style: { width: 6, height: 6, borderRadius: "50%", backgroundColor: "var(--color-primary)", flexShrink: 0 } }),
54068
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold text-[11px]", children: t("subagentTrace.coordinator") }),
54069
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px]", children: t("subagentTrace.messagesCount", { count: coordinatorMessages.length }) })
54070
+ ] }),
54071
+ /* @__PURE__ */ jsx(Box, { className: "max-h-[36rem] overflow-y-auto", children: /* @__PURE__ */ jsx(CoordinatorConversation, { messages: coordinatorMessages, autoScroll: true }) })
54072
+ ] }) : coordinatorActivities && coordinatorActivities.length > 0 && (() => {
54073
+ const filteredCoordinator = coordinatorActivities;
54074
+ if (filteredCoordinator.length === 0) return null;
54075
+ return /* @__PURE__ */ jsxs(Box, { className: "border-b border-[var(--color-border)]", children: [
54076
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center px-3 py-1.5 bg-[var(--color-card)] border-b border-[var(--color-border)]", children: [
54077
+ /* @__PURE__ */ jsx(Box, { style: { width: 6, height: 6, borderRadius: "50%", backgroundColor: "var(--color-primary)", flexShrink: 0 } }),
54078
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold text-[11px]", children: t("subagentTrace.coordinator") }),
54079
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px]", children: t("subagentTrace.eventsCount", { count: filteredCoordinator.length }) })
54080
+ ] }),
54081
+ /* @__PURE__ */ jsx(Box, { className: "max-h-60 overflow-y-auto", children: /* @__PURE__ */ jsx(
54082
+ InlineActivityStream,
54083
+ {
54084
+ activities: coordinatorToActivityItems(filteredCoordinator),
54085
+ autoScroll: true
54086
+ }
54087
+ ) })
54088
+ ] });
54089
+ })(),
54090
+ isRichMode ? filtered.map((sub) => /* @__PURE__ */ jsx(SubagentRichCard, { subagent: sub }, sub.id)) : Array.from(grouped.entries()).map(([orbitalName, subs]) => /* @__PURE__ */ jsx(
54091
+ OrbitalGroup,
54092
+ {
54093
+ orbitalName,
54094
+ subagents: subs
54095
+ },
54096
+ orbitalName
54097
+ ))
54098
+ ] })
54099
+ ] });
54100
+ };
54101
+ SubagentTracePanel.displayName = "SubagentTracePanel";
54102
+ }
54103
+ });
52567
54104
  var TabbedContainer;
52568
54105
  var init_TabbedContainer = __esm({
52569
54106
  "components/core/organisms/layout/TabbedContainer.tsx"() {
@@ -52678,6 +54215,48 @@ var init_TabbedContainer = __esm({
52678
54215
  TabbedContainer.displayName = "TabbedContainer";
52679
54216
  }
52680
54217
  });
54218
+ function TanksBoard({
54219
+ tiles,
54220
+ units,
54221
+ features,
54222
+ assetManifest,
54223
+ assetBaseUrl,
54224
+ scale = 0.45,
54225
+ showMinimap = true,
54226
+ enableCamera = true,
54227
+ tileClickEvent,
54228
+ unitClickEvent,
54229
+ isLoading,
54230
+ error,
54231
+ className
54232
+ }) {
54233
+ return /* @__PURE__ */ jsx("div", { className: cn("tanks-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
54234
+ IsometricCanvas_default,
54235
+ {
54236
+ tileLayout: "flat",
54237
+ tiles,
54238
+ units,
54239
+ features,
54240
+ assetManifest,
54241
+ assetBaseUrl,
54242
+ scale,
54243
+ showMinimap,
54244
+ enableCamera,
54245
+ tileClickEvent,
54246
+ unitClickEvent,
54247
+ isLoading,
54248
+ error
54249
+ }
54250
+ ) });
54251
+ }
54252
+ var init_TanksBoard = __esm({
54253
+ "components/game/organisms/TanksBoard.tsx"() {
54254
+ "use client";
54255
+ init_cn();
54256
+ init_IsometricCanvas();
54257
+ TanksBoard.displayName = "TanksBoard";
54258
+ }
54259
+ });
52681
54260
  var TeamOrganism;
52682
54261
  var init_TeamOrganism = __esm({
52683
54262
  "components/marketing/organisms/TeamOrganism.tsx"() {
@@ -52781,7 +54360,7 @@ var init_Timeline = __esm({
52781
54360
  }) => {
52782
54361
  const { t } = useTranslate();
52783
54362
  const entityData = Array.isArray(entity) ? entity : [];
52784
- const items = React93__default.useMemo(() => {
54363
+ const items = React94__default.useMemo(() => {
52785
54364
  if (propItems) return propItems;
52786
54365
  if (entityData.length === 0) return [];
52787
54366
  return entityData.map((record, idx) => {
@@ -52888,7 +54467,7 @@ var init_Timeline = __esm({
52888
54467
  }
52889
54468
  });
52890
54469
  function extractToastProps(children) {
52891
- if (!React93__default.isValidElement(children)) {
54470
+ if (!React94__default.isValidElement(children)) {
52892
54471
  if (typeof children === "string") {
52893
54472
  return { message: children };
52894
54473
  }
@@ -52926,7 +54505,7 @@ var init_ToastSlot = __esm({
52926
54505
  eventBus.emit("UI:CLOSE");
52927
54506
  };
52928
54507
  if (!isVisible) return null;
52929
- const isCustomContent = React93__default.isValidElement(children) && !message;
54508
+ const isCustomContent = React94__default.isValidElement(children) && !message;
52930
54509
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
52931
54510
  Toast,
52932
54511
  {
@@ -54542,7 +56121,7 @@ var init_WorldMapTemplate = __esm({
54542
56121
  }
54543
56122
  });
54544
56123
  function lazyThree(name, loader) {
54545
- const Lazy = React93__default.lazy(
56124
+ const Lazy = React94__default.lazy(
54546
56125
  () => loader().then((m) => {
54547
56126
  const Resolved = m[name];
54548
56127
  if (!Resolved) {
@@ -54554,13 +56133,13 @@ function lazyThree(name, loader) {
54554
56133
  })
54555
56134
  );
54556
56135
  function ThreeWrapper(props) {
54557
- return React93__default.createElement(
56136
+ return React94__default.createElement(
54558
56137
  ThreeBoundary,
54559
56138
  { name },
54560
- React93__default.createElement(
54561
- React93__default.Suspense,
56139
+ React94__default.createElement(
56140
+ React94__default.Suspense,
54562
56141
  { fallback: null },
54563
- React93__default.createElement(Lazy, props)
56142
+ React94__default.createElement(Lazy, props)
54564
56143
  )
54565
56144
  );
54566
56145
  }
@@ -54590,6 +56169,7 @@ var init_component_registry_generated = __esm({
54590
56169
  init_BattleTemplate();
54591
56170
  init_BehaviorView();
54592
56171
  init_BloomQuizBlock();
56172
+ init_BoardgameBoard();
54593
56173
  init_BookChapterView();
54594
56174
  init_BookCoverPage();
54595
56175
  init_BookNavBar();
@@ -54616,6 +56196,7 @@ var init_component_registry_generated = __esm({
54616
56196
  init_Center();
54617
56197
  init_Chart();
54618
56198
  init_ChartLegend();
56199
+ init_ChatBar();
54619
56200
  init_Checkbox();
54620
56201
  init_ChoiceButton();
54621
56202
  init_CityBuilderBoard();
@@ -54673,6 +56254,7 @@ var init_component_registry_generated = __esm({
54673
56254
  init_FileTree();
54674
56255
  init_FilterGroup();
54675
56256
  init_FilterPill();
56257
+ init_FishingBoard();
54676
56258
  init_Flex();
54677
56259
  init_FlipCard();
54678
56260
  init_FlipContainer();
@@ -54702,6 +56284,7 @@ var init_component_registry_generated = __esm({
54702
56284
  init_HeroOrganism();
54703
56285
  init_HeroSection();
54704
56286
  init_HexStrategyBoard();
56287
+ init_HolidayRunnerBoard();
54705
56288
  init_Icon();
54706
56289
  init_InfiniteScrollSentinel();
54707
56290
  init_Input();
@@ -54724,11 +56307,13 @@ var init_component_registry_generated = __esm({
54724
56307
  init_MarketingFooter();
54725
56308
  init_MasterDetail();
54726
56309
  init_MasterDetailLayout();
56310
+ init_MatchPuzzleBoard();
54727
56311
  init_MatrixQuestion();
54728
56312
  init_MediaGallery();
54729
56313
  init_Menu();
54730
56314
  init_Meter();
54731
56315
  init_MiniMap();
56316
+ init_MinigolfBoard();
54732
56317
  init_Modal();
54733
56318
  init_ModalSlot();
54734
56319
  init_ModuleCard();
@@ -54741,6 +56326,8 @@ var init_component_registry_generated = __esm({
54741
56326
  init_PageHeader();
54742
56327
  init_Pagination();
54743
56328
  init_PatternTile();
56329
+ init_PinballBoard();
56330
+ init_PirateBoard();
54744
56331
  init_PlatformerBoard();
54745
56332
  init_PlatformerCanvas();
54746
56333
  init_PlatformerTemplate();
@@ -54758,6 +56345,7 @@ var init_component_registry_generated = __esm({
54758
56345
  init_QrScanner();
54759
56346
  init_QuestTracker();
54760
56347
  init_QuizBlock();
56348
+ init_RacingBoard();
54761
56349
  init_Radio();
54762
56350
  init_RangeSlider();
54763
56351
  init_ReflectionBlock();
@@ -54791,12 +56379,16 @@ var init_component_registry_generated = __esm({
54791
56379
  init_SimulatorBoard();
54792
56380
  init_Skeleton();
54793
56381
  init_SocialProof();
56382
+ init_SokobanBoard();
54794
56383
  init_SortableList();
56384
+ init_SpaceShmupBoard();
56385
+ init_SpaceStationBoard();
54795
56386
  init_Sparkline();
54796
56387
  init_Spinner();
54797
56388
  init_Split();
54798
56389
  init_SplitPane();
54799
56390
  init_SplitSection();
56391
+ init_SportsBoard();
54800
56392
  init_Sprite();
54801
56393
  init_StarRating();
54802
56394
  init_StatBadge();
@@ -54811,6 +56403,7 @@ var init_component_registry_generated = __esm({
54811
56403
  init_StatusEffect();
54812
56404
  init_StepFlow();
54813
56405
  init_StepFlowOrganism();
56406
+ init_SubagentTracePanel();
54814
56407
  init_SvgBranch();
54815
56408
  init_SvgConnection();
54816
56409
  init_SvgFlow();
@@ -54830,6 +56423,7 @@ var init_component_registry_generated = __esm({
54830
56423
  init_Tabs();
54831
56424
  init_TagCloud();
54832
56425
  init_TagInput();
56426
+ init_TanksBoard();
54833
56427
  init_TeamCard();
54834
56428
  init_TeamOrganism();
54835
56429
  init_TextHighlight();
@@ -54868,7 +56462,7 @@ var init_component_registry_generated = __esm({
54868
56462
  init_WorldMapBoard();
54869
56463
  init_WorldMapTemplate();
54870
56464
  init_XPBar();
54871
- ThreeBoundary = class extends React93__default.Component {
56465
+ ThreeBoundary = class extends React94__default.Component {
54872
56466
  constructor() {
54873
56467
  super(...arguments);
54874
56468
  __publicField(this, "state", { failed: false });
@@ -54878,7 +56472,7 @@ var init_component_registry_generated = __esm({
54878
56472
  }
54879
56473
  render() {
54880
56474
  if (this.state.failed) {
54881
- return React93__default.createElement(
56475
+ return React94__default.createElement(
54882
56476
  "div",
54883
56477
  {
54884
56478
  "data-testid": "three-unavailable",
@@ -54917,6 +56511,7 @@ var init_component_registry_generated = __esm({
54917
56511
  "BattleTemplate": BattleTemplate,
54918
56512
  "BehaviorView": BehaviorView,
54919
56513
  "BloomQuizBlock": BloomQuizBlock,
56514
+ "BoardgameBoard": BoardgameBoard,
54920
56515
  "BookChapterView": BookChapterView,
54921
56516
  "BookCoverPage": BookCoverPage,
54922
56517
  "BookNavBar": BookNavBar,
@@ -54946,6 +56541,7 @@ var init_component_registry_generated = __esm({
54946
56541
  "Center": Center,
54947
56542
  "Chart": Chart,
54948
56543
  "ChartLegend": ChartLegend,
56544
+ "ChatBar": ChatBar,
54949
56545
  "Checkbox": Checkbox,
54950
56546
  "ChoiceButton": ChoiceButton,
54951
56547
  "CityBuilderBoard": CityBuilderBoard,
@@ -55006,6 +56602,7 @@ var init_component_registry_generated = __esm({
55006
56602
  "FileTree": FileTree,
55007
56603
  "FilterGroup": FilterGroup,
55008
56604
  "FilterPill": FilterPill,
56605
+ "FishingBoard": FishingBoard,
55009
56606
  "Flex": Flex,
55010
56607
  "FlipCard": FlipCard,
55011
56608
  "FlipContainer": FlipContainer,
@@ -55039,6 +56636,7 @@ var init_component_registry_generated = __esm({
55039
56636
  "HeroOrganism": HeroOrganism,
55040
56637
  "HeroSection": HeroSection,
55041
56638
  "HexStrategyBoard": HexStrategyBoard,
56639
+ "HolidayRunnerBoard": HolidayRunnerBoard,
55042
56640
  "Icon": Icon,
55043
56641
  "InfiniteScrollSentinel": InfiniteScrollSentinel,
55044
56642
  "Input": Input,
@@ -55063,11 +56661,13 @@ var init_component_registry_generated = __esm({
55063
56661
  "MarketingFooter": MarketingFooter,
55064
56662
  "MasterDetail": MasterDetail,
55065
56663
  "MasterDetailLayout": MasterDetailLayout,
56664
+ "MatchPuzzleBoard": MatchPuzzleBoard,
55066
56665
  "MatrixQuestion": MatrixQuestion,
55067
56666
  "MediaGallery": MediaGallery,
55068
56667
  "Menu": Menu,
55069
56668
  "Meter": Meter,
55070
56669
  "MiniMap": MiniMap,
56670
+ "MinigolfBoard": MinigolfBoard,
55071
56671
  "Modal": Modal,
55072
56672
  "ModalSlot": ModalSlot,
55073
56673
  "ModuleCard": ModuleCard,
@@ -55080,6 +56680,8 @@ var init_component_registry_generated = __esm({
55080
56680
  "PageHeader": PageHeader,
55081
56681
  "Pagination": Pagination,
55082
56682
  "PatternTile": PatternTile,
56683
+ "PinballBoard": PinballBoard,
56684
+ "PirateBoard": PirateBoard,
55083
56685
  "PlatformerBoard": PlatformerBoard,
55084
56686
  "PlatformerCanvas": PlatformerCanvas,
55085
56687
  "PlatformerTemplate": PlatformerTemplate,
@@ -55097,6 +56699,7 @@ var init_component_registry_generated = __esm({
55097
56699
  "QrScanner": QrScanner,
55098
56700
  "QuestTracker": QuestTracker,
55099
56701
  "QuizBlock": QuizBlock,
56702
+ "RacingBoard": RacingBoard,
55100
56703
  "Radio": Radio,
55101
56704
  "RangeSlider": RangeSlider,
55102
56705
  "ReflectionBlock": ReflectionBlock,
@@ -55130,7 +56733,10 @@ var init_component_registry_generated = __esm({
55130
56733
  "SimulatorBoard": SimulatorBoard,
55131
56734
  "Skeleton": Skeleton,
55132
56735
  "SocialProof": SocialProof,
56736
+ "SokobanBoard": SokobanBoard,
55133
56737
  "SortableList": SortableList,
56738
+ "SpaceShmupBoard": SpaceShmupBoard,
56739
+ "SpaceStationBoard": SpaceStationBoard,
55134
56740
  "Spacer": SpacerPattern,
55135
56741
  "SpacerPattern": SpacerPattern,
55136
56742
  "Sparkline": Sparkline,
@@ -55138,6 +56744,7 @@ var init_component_registry_generated = __esm({
55138
56744
  "Split": Split,
55139
56745
  "SplitPane": SplitPane,
55140
56746
  "SplitSection": SplitSection,
56747
+ "SportsBoard": SportsBoard,
55141
56748
  "Sprite": Sprite,
55142
56749
  "Stack": Stack,
55143
56750
  "StarRating": StarRating,
@@ -55153,6 +56760,7 @@ var init_component_registry_generated = __esm({
55153
56760
  "StatusEffect": StatusEffect,
55154
56761
  "StepFlow": StepFlow,
55155
56762
  "StepFlowOrganism": StepFlowOrganism,
56763
+ "SubagentTracePanel": SubagentTracePanel,
55156
56764
  "SvgBranch": SvgBranch,
55157
56765
  "SvgConnection": SvgConnection,
55158
56766
  "SvgFlow": SvgFlow,
@@ -55172,6 +56780,7 @@ var init_component_registry_generated = __esm({
55172
56780
  "Tabs": Tabs,
55173
56781
  "TagCloud": TagCloud,
55174
56782
  "TagInput": TagInput,
56783
+ "TanksBoard": TanksBoard,
55175
56784
  "TeamCard": TeamCard,
55176
56785
  "TeamOrganism": TeamOrganism,
55177
56786
  "TextHighlight": TextHighlight,
@@ -55229,7 +56838,7 @@ function SuspenseConfigProvider({
55229
56838
  config,
55230
56839
  children
55231
56840
  }) {
55232
- return React93__default.createElement(
56841
+ return React94__default.createElement(
55233
56842
  SuspenseConfigContext.Provider,
55234
56843
  { value: config },
55235
56844
  children
@@ -55719,7 +57328,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
55719
57328
  const key = `${parentId}-${index}-trait:${traitName}`;
55720
57329
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
55721
57330
  }
55722
- return /* @__PURE__ */ jsx(React93__default.Fragment, { children: child }, `${parentId}-${index}`);
57331
+ return /* @__PURE__ */ jsx(React94__default.Fragment, { children: child }, `${parentId}-${index}`);
55723
57332
  }
55724
57333
  if (!child || typeof child !== "object") return null;
55725
57334
  const childId = `${parentId}-${index}`;
@@ -55759,14 +57368,14 @@ function isPatternConfig(value) {
55759
57368
  if (value === null || value === void 0) return false;
55760
57369
  if (typeof value !== "object") return false;
55761
57370
  if (Array.isArray(value)) return false;
55762
- if (React93__default.isValidElement(value)) return false;
57371
+ if (React94__default.isValidElement(value)) return false;
55763
57372
  if (value instanceof Date) return false;
55764
57373
  if (typeof value === "function") return false;
55765
57374
  const record = value;
55766
57375
  return "type" in record && typeof record.type === "string" && getComponentForPattern(record.type) !== null;
55767
57376
  }
55768
57377
  function isPlainConfigObject(value) {
55769
- if (React93__default.isValidElement(value)) return false;
57378
+ if (React94__default.isValidElement(value)) return false;
55770
57379
  if (value instanceof Date) return false;
55771
57380
  const proto = Object.getPrototypeOf(value);
55772
57381
  return proto === Object.prototype || proto === null;
@@ -55892,7 +57501,7 @@ function SlotContentRenderer({
55892
57501
  for (const slotKey of CONTENT_NODE_SLOTS) {
55893
57502
  const slotVal = restProps[slotKey];
55894
57503
  if (slotVal === void 0 || slotVal === null) continue;
55895
- if (React93__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
57504
+ if (React94__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
55896
57505
  if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
55897
57506
  nodeSlotOverrides[slotKey] = renderPatternChildren(
55898
57507
  slotVal,
@@ -56305,7 +57914,7 @@ var AvlTransition = ({
56305
57914
  opacity = 1,
56306
57915
  className
56307
57916
  }) => {
56308
- const ids = React93__default.useMemo(() => {
57917
+ const ids = React94__default.useMemo(() => {
56309
57918
  avlTransitionId += 1;
56310
57919
  return { arrow: `avl-tr-${avlTransitionId}-arrow` };
56311
57920
  }, []);
@@ -56866,7 +58475,7 @@ var AvlStateMachine = ({
56866
58475
  color = "var(--color-primary)",
56867
58476
  animated = false
56868
58477
  }) => {
56869
- const ids = React93__default.useMemo(() => {
58478
+ const ids = React94__default.useMemo(() => {
56870
58479
  avlSmId += 1;
56871
58480
  const base = `avl-sm-${avlSmId}`;
56872
58481
  return { glow: `${base}-glow`, grad: `${base}-grad` };
@@ -57065,7 +58674,7 @@ var AvlOrbitalUnit = ({
57065
58674
  color = "var(--color-primary)",
57066
58675
  animated = false
57067
58676
  }) => {
57068
- const ids = React93__default.useMemo(() => {
58677
+ const ids = React94__default.useMemo(() => {
57069
58678
  avlOuId += 1;
57070
58679
  const base = `avl-ou-${avlOuId}`;
57071
58680
  return { glow: `${base}-glow`, grad: `${base}-grad` };
@@ -57161,7 +58770,7 @@ var AvlClosedCircuit = ({
57161
58770
  color = "var(--color-primary)",
57162
58771
  animated = false
57163
58772
  }) => {
57164
- const ids = React93__default.useMemo(() => {
58773
+ const ids = React94__default.useMemo(() => {
57165
58774
  avlCcId += 1;
57166
58775
  const base = `avl-cc-${avlCcId}`;
57167
58776
  return { glow: `${base}-glow`, grad: `${base}-grad`, arrow: `${base}-arrow` };
@@ -57316,7 +58925,7 @@ var AvlEmitListen = ({
57316
58925
  color = "var(--color-primary)",
57317
58926
  animated = false
57318
58927
  }) => {
57319
- const ids = React93__default.useMemo(() => {
58928
+ const ids = React94__default.useMemo(() => {
57320
58929
  avlElId += 1;
57321
58930
  const base = `avl-el-${avlElId}`;
57322
58931
  return { arrow: `${base}-arrow`, grad: `${base}-grad` };
@@ -57590,7 +59199,7 @@ function renderNode(node, color, glowId) {
57590
59199
  const baseR = node.type === "operator" ? 20 : 16;
57591
59200
  const r2 = Math.max(baseR, labelLen * 3.5 + 6);
57592
59201
  const nc = nodeColor(node.type, color);
57593
- return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
59202
+ return /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
57594
59203
  node.children.map((child, i) => {
57595
59204
  const childR = Math.max(
57596
59205
  child.type === "operator" ? 20 : 16,
@@ -57647,7 +59256,7 @@ var AvlExprTree = ({
57647
59256
  className,
57648
59257
  color = "var(--color-primary)"
57649
59258
  }) => {
57650
- const ids = React93__default.useMemo(() => {
59259
+ const ids = React94__default.useMemo(() => {
57651
59260
  avlEtId += 1;
57652
59261
  return { glow: `avl-et-${avlEtId}-glow` };
57653
59262
  }, []);
@@ -58471,7 +60080,7 @@ var SystemNode = ({ data }) => {
58471
60080
  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) => {
58472
60081
  const tc = transitionCounts[s.name] ?? 0;
58473
60082
  const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
58474
- return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
60083
+ return /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
58475
60084
  /* @__PURE__ */ jsx(AvlState, { x: i * 14 + 1, y: 1, width: 10, height: 8, name: "", role, isInitial: s.isInitial, isTerminal: s.isTerminal }),
58476
60085
  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 })
58477
60086
  ] }, s.name);
@@ -59623,7 +61232,7 @@ function resolveLambdaBindings(body, params, item, index) {
59623
61232
  if (Array.isArray(body)) {
59624
61233
  return body.map((b) => recur(b));
59625
61234
  }
59626
- if (body !== null && typeof body === "object" && !React93__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
61235
+ if (body !== null && typeof body === "object" && !React94__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
59627
61236
  const out = {};
59628
61237
  for (const [k, v] of Object.entries(body)) {
59629
61238
  out[k] = recur(v);
@@ -59642,7 +61251,7 @@ function getSlotContentRenderer4() {
59642
61251
  function makeLambdaFn(params, lambdaBody, callerKey) {
59643
61252
  return (item, index) => {
59644
61253
  const resolvedBody = resolveLambdaBindings(lambdaBody, params, item, index);
59645
- if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React93__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
61254
+ if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React94__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
59646
61255
  return null;
59647
61256
  }
59648
61257
  const record = resolvedBody;
@@ -59661,7 +61270,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
59661
61270
  props: childProps,
59662
61271
  priority: 0
59663
61272
  };
59664
- return React93__default.createElement(SlotContentRenderer2, { content: childContent });
61273
+ return React94__default.createElement(SlotContentRenderer2, { content: childContent });
59665
61274
  };
59666
61275
  }
59667
61276
  function convertNode(node, callerKey) {
@@ -59680,7 +61289,7 @@ function convertNode(node, callerKey) {
59680
61289
  });
59681
61290
  return anyChanged ? mapped : node;
59682
61291
  }
59683
- if (typeof node === "object" && !React93__default.isValidElement(node) && !(node instanceof Date)) {
61292
+ if (typeof node === "object" && !React94__default.isValidElement(node) && !(node instanceof Date)) {
59684
61293
  return convertObjectProps(node);
59685
61294
  }
59686
61295
  return node;
@@ -61912,8 +63521,8 @@ function CanvasDndProvider({
61912
63521
  }) {
61913
63522
  const eventBus = useEventBus();
61914
63523
  const sensors = useAlmadarDndSensors(false);
61915
- const [activePayload, setActivePayload] = React93__default.useState(null);
61916
- const handleDragStart = React93__default.useCallback((e) => {
63524
+ const [activePayload, setActivePayload] = React94__default.useState(null);
63525
+ const handleDragStart = React94__default.useCallback((e) => {
61917
63526
  const data = e.active.data.current;
61918
63527
  const payload = data?.payload;
61919
63528
  if (payload) {
@@ -61924,7 +63533,7 @@ function CanvasDndProvider({
61924
63533
  log13.warn("dragStart:missing-payload", { id: e.active.id });
61925
63534
  }
61926
63535
  }, [eventBus]);
61927
- const handleDragEnd = React93__default.useCallback((e) => {
63536
+ const handleDragEnd = React94__default.useCallback((e) => {
61928
63537
  setActivePayload(null);
61929
63538
  const activeData = e.active.data.current;
61930
63539
  const payload = activeData?.payload;
@@ -61953,7 +63562,7 @@ function CanvasDndProvider({
61953
63562
  const suppressed = onDrop ? onDrop(drop) === true : false;
61954
63563
  if (!suppressed) defaultEmit(eventBus, drop);
61955
63564
  }, [eventBus, onDrop]);
61956
- const handleDragCancel = React93__default.useCallback(() => {
63565
+ const handleDragCancel = React94__default.useCallback(() => {
61957
63566
  setActivePayload(null);
61958
63567
  log13.info("dragCancel");
61959
63568
  }, []);
@@ -62711,7 +64320,7 @@ var OrbPreviewNodeInner = (props) => {
62711
64320
  }
62712
64321
  );
62713
64322
  };
62714
- var OrbPreviewNode = React93__default.memo(OrbPreviewNodeInner);
64323
+ var OrbPreviewNode = React94__default.memo(OrbPreviewNodeInner);
62715
64324
  OrbPreviewNode.displayName = "OrbPreviewNode";
62716
64325
  orbPreviewLog.debug("export-resolved", () => ({
62717
64326
  type: typeof OrbPreviewNode,
@@ -62816,7 +64425,7 @@ var EventFlowEdgeInner = (props) => {
62816
64425
  ) })
62817
64426
  ] });
62818
64427
  };
62819
- var EventFlowEdge = React93__default.memo(EventFlowEdgeInner);
64428
+ var EventFlowEdge = React94__default.memo(EventFlowEdgeInner);
62820
64429
  EventFlowEdge.displayName = "EventFlowEdge";
62821
64430
 
62822
64431
  // components/avl/molecules/BehaviorComposeNode.tsx
@@ -62963,7 +64572,7 @@ var BehaviorComposeNodeInner = (props) => {
62963
64572
  }
62964
64573
  );
62965
64574
  };
62966
- var BehaviorComposeNode = React93__default.memo(BehaviorComposeNodeInner);
64575
+ var BehaviorComposeNode = React94__default.memo(BehaviorComposeNodeInner);
62967
64576
  BehaviorComposeNode.displayName = "BehaviorComposeNode";
62968
64577
 
62969
64578
  // components/avl/molecules/avl-behavior-compose-converter.ts
@@ -63975,7 +65584,7 @@ var TraitCardNodeInner = (props) => {
63975
65584
  }
63976
65585
  );
63977
65586
  };
63978
- var TraitCardNode = React93__default.memo(TraitCardNodeInner);
65587
+ var TraitCardNode = React94__default.memo(TraitCardNodeInner);
63979
65588
  TraitCardNode.displayName = "TraitCardNode";
63980
65589
 
63981
65590
  // components/avl/organisms/FlowCanvas.tsx
@@ -64048,7 +65657,7 @@ function FlowCanvasInner({
64048
65657
  initialOrbital
64049
65658
  );
64050
65659
  const [expandedBehaviorAlias, setExpandedBehaviorAlias] = useState(void 0);
64051
- const screenSizeUserOverrideRef = React93__default.useRef(false);
65660
+ const screenSizeUserOverrideRef = React94__default.useRef(false);
64052
65661
  const [screenSize, setScreenSize] = useState(
64053
65662
  () => typeof window === "undefined" ? "laptop" : detectScreenSize(window.innerWidth)
64054
65663
  );
@@ -64432,7 +66041,7 @@ var ZoomBreadcrumb = ({
64432
66041
  if (eventName && band === "detail") {
64433
66042
  segments.push({ icon: "\u26A1", label: eventName });
64434
66043
  }
64435
- 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-xs text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
66044
+ 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-xs text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
64436
66045
  i > 0 && /* @__PURE__ */ jsx("span", { className: "opacity-40", children: ">" }),
64437
66046
  /* @__PURE__ */ jsx("span", { className: "opacity-60", children: seg.icon }),
64438
66047
  /* @__PURE__ */ jsx("span", { children: seg.label })
@@ -64773,7 +66382,7 @@ var EventWireOverlay = ({
64773
66382
  containerW,
64774
66383
  containerH
64775
66384
  }) => {
64776
- const ids = React93__default.useMemo(() => {
66385
+ const ids = React94__default.useMemo(() => {
64777
66386
  avlOczWireId += 1;
64778
66387
  return { arrow: `avl-ocz-wire-${avlOczWireId}-arrow` };
64779
66388
  }, []);
@@ -65140,7 +66749,7 @@ var AvlOrbitalsCosmicZoom = ({
65140
66749
  borderRadius: 6,
65141
66750
  border: `1px solid ${color}`
65142
66751
  },
65143
- children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
66752
+ children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
65144
66753
  i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", style: { opacity: 0.5, color }, children: "/" }),
65145
66754
  i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
65146
66755
  Box,