@almadar/ui 5.107.0 → 5.109.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/avl/index.cjs +1427 -2828
  2. package/dist/avl/index.js +525 -1926
  3. package/dist/components/core/atoms/Box.d.ts +2 -0
  4. package/dist/components/{game → core}/atoms/GameIcon.d.ts +1 -1
  5. package/dist/components/core/atoms/index.d.ts +1 -0
  6. package/dist/components/core/templates/index.d.ts +0 -1
  7. package/dist/components/game/molecules/index.d.ts +8 -28
  8. package/dist/components/index.cjs +223 -1691
  9. package/dist/components/index.js +213 -1671
  10. package/dist/lib/drawable/projector.d.ts +1 -1
  11. package/dist/{components/game/three/molecules/GameCanvas3D.d.ts → lib/drawable/three/Canvas3DHost.d.ts} +12 -9
  12. package/dist/lib/drawable/{Drawable3D.d.ts → three/Drawable3D.d.ts} +2 -2
  13. package/dist/lib/drawable/three/GameCamera3D.d.ts +16 -0
  14. package/dist/lib/drawable/three/game3dTheme.d.ts +14 -0
  15. package/dist/{components/game → lib/drawable}/three/hooks/useGameCanvas3DEvents.d.ts +1 -1
  16. package/dist/{components/game → lib/drawable}/three/index.cjs +2019 -2020
  17. package/dist/{components/game → lib/drawable}/three/index.css +3 -3
  18. package/dist/lib/drawable/three/index.d.ts +39 -0
  19. package/dist/{components/game → lib/drawable}/three/index.js +1932 -1934
  20. package/dist/lib/drawable/{mesh3d.d.ts → three/mesh3d.d.ts} +4 -4
  21. package/dist/{components/game/lib → lib}/puzzleObject.d.ts +11 -2
  22. package/dist/marketing/index.d.cts +2 -0
  23. package/dist/{components/game/providers → providers}/GameAudioProvider.d.ts +1 -1
  24. package/dist/providers/index.cjs +1619 -2690
  25. package/dist/providers/index.d.ts +2 -0
  26. package/dist/providers/index.js +827 -1902
  27. package/dist/runtime/index.cjs +1288 -2689
  28. package/dist/runtime/index.js +505 -1906
  29. package/package.json +7 -7
  30. package/dist/components/game/atoms/ActionButton.d.ts +0 -31
  31. package/dist/components/game/atoms/ComboCounter.d.ts +0 -20
  32. package/dist/components/game/atoms/DamageNumber.d.ts +0 -18
  33. package/dist/components/game/atoms/GameCard.d.ts +0 -34
  34. package/dist/components/game/atoms/ItemSlot.d.ts +0 -31
  35. package/dist/components/game/atoms/ResourceCounter.d.ts +0 -26
  36. package/dist/components/game/atoms/Sprite.d.ts +0 -52
  37. package/dist/components/game/atoms/StatusEffect.d.ts +0 -25
  38. package/dist/components/game/atoms/TurnIndicator.d.ts +0 -22
  39. package/dist/components/game/atoms/WaypointMarker.d.ts +0 -23
  40. package/dist/components/game/molecules/EventLog.d.ts +0 -31
  41. package/dist/components/game/molecules/InventoryGrid.d.ts +0 -35
  42. package/dist/components/game/molecules/ObjectRulePanel.d.ts +0 -32
  43. package/dist/components/game/molecules/ResourceBar.d.ts +0 -26
  44. package/dist/components/game/molecules/RuleEditor.d.ts +0 -39
  45. package/dist/components/game/molecules/VariablePanel.d.ts +0 -28
  46. package/dist/components/game/templates/GameTemplate.d.ts +0 -35
  47. package/dist/components/game/three/atoms/SpriteBillboard3D.d.ts +0 -18
  48. package/dist/components/game/three/game3dTheme.d.ts +0 -55
  49. package/dist/components/game/three/index.d.ts +0 -12
  50. package/dist/components/game/three/lib/game3dAssetManifest.d.ts +0 -48
  51. package/dist/components/game/three/molecules/GameCamera3D.d.ts +0 -35
  52. package/dist/components/game/three/molecules/index.d.ts +0 -32
  53. package/dist/components/game/three/patterns.d.ts +0 -16
  54. /package/dist/{components/game/hooks → hooks}/useCamera.d.ts +0 -0
  55. /package/dist/{components/game/hooks → hooks}/useGameAudio.d.ts +0 -0
  56. /package/dist/{components/game/hooks → hooks}/useImageCache.d.ts +0 -0
  57. /package/dist/{components/game/hooks → hooks}/useUnitSpriteAtlas.d.ts +0 -0
  58. /package/dist/{components/game/lib → lib}/boardEntity.d.ts +0 -0
  59. /package/dist/{components/game/three/molecules → lib/drawable/three}/Camera3D.d.ts +0 -0
  60. /package/dist/{components/game/three/molecules → lib/drawable/three}/Canvas3DErrorBoundary.d.ts +0 -0
  61. /package/dist/{components/game/three/molecules → lib/drawable/three}/Canvas3DLoadingState.d.ts +0 -0
  62. /package/dist/{components/game/three/molecules → lib/drawable/three}/Lighting3D.d.ts +0 -0
  63. /package/dist/{components/game/three/molecules → lib/drawable/three}/ModelLoader.d.ts +0 -0
  64. /package/dist/{components/game/three/molecules → lib/drawable/three}/Scene3D.d.ts +0 -0
  65. /package/dist/{components/game → lib/drawable}/three/hooks/useAssetLoader.d.ts +0 -0
  66. /package/dist/{components/game → lib/drawable}/three/hooks/useRaycaster.d.ts +0 -0
  67. /package/dist/{components/game → lib/drawable}/three/hooks/useSceneGraph.d.ts +0 -0
  68. /package/dist/{components/game → lib/drawable}/three/hooks/useThree.d.ts +0 -0
  69. /package/dist/{components/game → lib/drawable}/three/lib/AssetLoader.d.ts +0 -0
  70. /package/dist/{components/game → lib/drawable}/three/lib/culling.d.ts +0 -0
  71. /package/dist/{components/game → lib/drawable}/three/lib/grid3D.d.ts +0 -0
  72. /package/dist/{components/game/lib → lib}/editorUtils.d.ts +0 -0
  73. /package/dist/{components/game/lib → lib}/game.d.ts +0 -0
  74. /package/dist/{components/game/lib/index.d.ts → lib/gameShared.d.ts} +0 -0
  75. /package/dist/{components/game/lib → lib}/isometric.d.ts +0 -0
  76. /package/dist/{components/game/lib → lib}/isometricTypes.d.ts +0 -0
  77. /package/dist/{components/game/lib → lib}/makeAsset.d.ts +0 -0
  78. /package/dist/{components/game/lib → lib}/mechanics.d.ts +0 -0
  79. /package/dist/{components/game/lib → lib}/physicsPresets.d.ts +0 -0
  80. /package/dist/{components/game/lib → lib}/physicsTypes.d.ts +0 -0
  81. /package/dist/{components/game/lib → lib}/spriteAnimation.d.ts +0 -0
  82. /package/dist/{components/game/lib → lib}/spriteAnimationTypes.d.ts +0 -0
  83. /package/dist/{components/game/lib → lib}/spriteSheetConstants.d.ts +0 -0
package/dist/avl/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import * as React97 from 'react';
3
- import React97__default, { createContext, useState, useMemo, useRef, useEffect, useContext, useCallback, Suspense, useLayoutEffect, Profiler, useReducer, useSyncExternalStore, lazy, useId } from 'react';
4
- import { getAllPages, OrbitalProvider, EventBusContext, useTraitScope, ServerBridgeProvider, VerificationProvider, EntitySchemaProvider, OrbitalThemeProvider, useServerBridge, useEntitySchema, useEntitySchemaOptional, TraitScopeProvider, useCurrentPagePath } from '@almadar/ui/providers';
2
+ import * as React90 from 'react';
3
+ import React90__default, { createContext, useState, useMemo, useRef, useEffect, useContext, useCallback, Suspense, useLayoutEffect, Profiler, useReducer, useSyncExternalStore, lazy, useId } from 'react';
4
+ import { getAllPages, OrbitalProvider, EventBusContext, useTraitScope, ServerBridgeProvider, VerificationProvider, EntitySchemaProvider, OrbitalThemeProvider, useServerBridge, useEntitySchema, useEntitySchemaOptional, TraitScopeProvider, useCurrentPagePath, useGameAudioContextOptional } from '@almadar/ui/providers';
5
5
  import { createLogger, setNamespaceLevel, isLogLevelEnabled } from '@almadar/logger';
6
6
  import ELK from 'elkjs/lib/elk.bundled.js';
7
7
  import { MarkerType, useReactFlow, Handle, Position, getBezierPath, EdgeLabelRenderer, useNodeId, ReactFlowProvider, BaseEdge, useNodesState, useEdgesState, ReactFlow, Controls, Background, BackgroundVariant } from '@xyflow/react';
@@ -3174,7 +3174,7 @@ var init_Typography = __esm({
3174
3174
  }) => {
3175
3175
  const variant = variantProp ?? (level ? `h${level}` : "body1");
3176
3176
  const Component = as || defaultElements[variant];
3177
- return React97__default.createElement(
3177
+ return React90__default.createElement(
3178
3178
  Component,
3179
3179
  {
3180
3180
  id,
@@ -3511,7 +3511,7 @@ var init_Box = __esm({
3511
3511
  fixed: "fixed",
3512
3512
  sticky: "sticky"
3513
3513
  };
3514
- Box = React97__default.forwardRef(
3514
+ Box = React90__default.forwardRef(
3515
3515
  ({
3516
3516
  padding,
3517
3517
  paddingX,
@@ -3576,7 +3576,7 @@ var init_Box = __esm({
3576
3576
  onPointerDown?.(e);
3577
3577
  }, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
3578
3578
  const isClickable = action || onClick;
3579
- return React97__default.createElement(
3579
+ return React90__default.createElement(
3580
3580
  Component,
3581
3581
  {
3582
3582
  ref,
@@ -3672,7 +3672,7 @@ var init_Stack = __esm({
3672
3672
  };
3673
3673
  const isHorizontal = direction === "horizontal";
3674
3674
  const directionClass = responsive && isHorizontal ? reverse ? "flex-col-reverse md:flex-row-reverse" : "flex-col md:flex-row" : isHorizontal ? reverse ? "flex-row-reverse" : "flex-row" : reverse ? "flex-col-reverse" : "flex-col";
3675
- return React97__default.createElement(
3675
+ return React90__default.createElement(
3676
3676
  Component,
3677
3677
  {
3678
3678
  className: cn(
@@ -4164,7 +4164,7 @@ var init_MiniStateMachine = __esm({
4164
4164
  const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
4165
4165
  const tc = transitionCounts[s.name] ?? 0;
4166
4166
  const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
4167
- return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
4167
+ return /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
4168
4168
  /* @__PURE__ */ jsx(
4169
4169
  AvlState,
4170
4170
  {
@@ -4494,7 +4494,7 @@ function loadLib(key, importer) {
4494
4494
  return p;
4495
4495
  }
4496
4496
  function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
4497
- const Lazy = React97__default.lazy(async () => {
4497
+ const Lazy = React90__default.lazy(async () => {
4498
4498
  const lib = await loadLib(libKey, importer);
4499
4499
  const Comp = pick(lib);
4500
4500
  if (!Comp) {
@@ -4504,7 +4504,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
4504
4504
  return { default: Comp };
4505
4505
  });
4506
4506
  const Wrapped = (props) => /* @__PURE__ */ jsx(
4507
- React97__default.Suspense,
4507
+ React90__default.Suspense,
4508
4508
  {
4509
4509
  fallback: /* @__PURE__ */ jsx(
4510
4510
  "span",
@@ -5235,7 +5235,7 @@ var init_Icon = __esm({
5235
5235
  const directIcon = typeof icon === "string" ? void 0 : icon;
5236
5236
  const effectiveName = typeof icon === "string" ? icon : name;
5237
5237
  const family = useIconFamily();
5238
- const RenderedComponent = React97__default.useMemo(() => {
5238
+ const RenderedComponent = React90__default.useMemo(() => {
5239
5239
  if (directIcon) return null;
5240
5240
  return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
5241
5241
  }, [directIcon, effectiveName, family]);
@@ -5356,7 +5356,7 @@ var init_atlasSlice = __esm({
5356
5356
  }
5357
5357
  });
5358
5358
  function useAtlasSliceDataUrl(asset) {
5359
- const [, bump] = React97.useReducer((x) => x + 1, 0);
5359
+ const [, bump] = React90.useReducer((x) => x + 1, 0);
5360
5360
  if (!isAtlasAsset(asset)) return void 0;
5361
5361
  const key = `${asset.atlas}#${asset.sprite}`;
5362
5362
  const cached = sliceDataUrlCache.get(key);
@@ -5419,13 +5419,13 @@ function AtlasImage({
5419
5419
  style,
5420
5420
  "aria-hidden": ariaHidden
5421
5421
  }) {
5422
- const [, bump] = React97.useReducer((x) => x + 1, 0);
5423
- const canvasRef = React97.useRef(null);
5422
+ const [, bump] = React90.useReducer((x) => x + 1, 0);
5423
+ const canvasRef = React90.useRef(null);
5424
5424
  const sliced = isAtlasAsset(asset);
5425
5425
  const atlas = sliced ? getAtlas(asset.atlas, bump) : void 0;
5426
5426
  const img = sliced && asset?.url ? getSheetImage(asset.url, bump) : null;
5427
5427
  const rect = sliced && atlas ? subRectFor(atlas, asset.sprite) : null;
5428
- React97.useEffect(() => {
5428
+ React90.useEffect(() => {
5429
5429
  const canvas = canvasRef.current;
5430
5430
  if (!canvas || !img || !rect) return;
5431
5431
  canvas.width = rect.sw;
@@ -5501,7 +5501,7 @@ function resolveIconProp(value, sizeClass) {
5501
5501
  const IconComp = value;
5502
5502
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
5503
5503
  }
5504
- if (React97__default.isValidElement(value)) {
5504
+ if (React90__default.isValidElement(value)) {
5505
5505
  return value;
5506
5506
  }
5507
5507
  if (typeof value === "object" && value !== null && isIconLike(value)) {
@@ -5578,7 +5578,7 @@ var init_Button = __esm({
5578
5578
  md: "h-icon-default w-icon-default",
5579
5579
  lg: "h-icon-default w-icon-default"
5580
5580
  };
5581
- Button = React97__default.forwardRef(
5581
+ Button = React90__default.forwardRef(
5582
5582
  ({
5583
5583
  className,
5584
5584
  variant = "primary",
@@ -5646,7 +5646,7 @@ var Dialog;
5646
5646
  var init_Dialog = __esm({
5647
5647
  "components/core/atoms/Dialog.tsx"() {
5648
5648
  init_cn();
5649
- Dialog = React97__default.forwardRef(
5649
+ Dialog = React90__default.forwardRef(
5650
5650
  ({
5651
5651
  role = "dialog",
5652
5652
  "aria-modal": ariaModal = true,
@@ -6142,7 +6142,7 @@ var init_Badge = __esm({
6142
6142
  md: "px-2.5 py-1 text-sm",
6143
6143
  lg: "px-3 py-1.5 text-base"
6144
6144
  };
6145
- Badge = React97__default.forwardRef(
6145
+ Badge = React90__default.forwardRef(
6146
6146
  ({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
6147
6147
  const iconSizes3 = {
6148
6148
  sm: "h-icon-default w-icon-default",
@@ -6479,7 +6479,7 @@ var init_SvgFlow = __esm({
6479
6479
  width = 100,
6480
6480
  height = 100
6481
6481
  }) => {
6482
- const markerId = React97__default.useMemo(() => {
6482
+ const markerId = React90__default.useMemo(() => {
6483
6483
  flowIdCounter += 1;
6484
6484
  return `almadar-flow-arrow-${flowIdCounter}`;
6485
6485
  }, []);
@@ -7072,7 +7072,7 @@ var init_SvgRing = __esm({
7072
7072
  width = 100,
7073
7073
  height = 100
7074
7074
  }) => {
7075
- const gradientId = React97__default.useMemo(() => {
7075
+ const gradientId = React90__default.useMemo(() => {
7076
7076
  ringIdCounter += 1;
7077
7077
  return `almadar-ring-glow-${ringIdCounter}`;
7078
7078
  }, []);
@@ -7253,7 +7253,7 @@ var init_Input = __esm({
7253
7253
  init_cn();
7254
7254
  init_Icon();
7255
7255
  init_useEventBus();
7256
- Input = React97__default.forwardRef(
7256
+ Input = React90__default.forwardRef(
7257
7257
  ({
7258
7258
  className,
7259
7259
  inputType,
@@ -7413,7 +7413,7 @@ var Label;
7413
7413
  var init_Label = __esm({
7414
7414
  "components/core/atoms/Label.tsx"() {
7415
7415
  init_cn();
7416
- Label = React97__default.forwardRef(
7416
+ Label = React90__default.forwardRef(
7417
7417
  ({ className, required, children, ...props }, ref) => {
7418
7418
  return /* @__PURE__ */ jsxs(
7419
7419
  "label",
@@ -7440,7 +7440,7 @@ var init_Textarea = __esm({
7440
7440
  "components/core/atoms/Textarea.tsx"() {
7441
7441
  init_cn();
7442
7442
  init_useEventBus();
7443
- Textarea = React97__default.forwardRef(
7443
+ Textarea = React90__default.forwardRef(
7444
7444
  ({ className, error, onChange, ...props }, ref) => {
7445
7445
  const eventBus = useEventBus();
7446
7446
  const handleChange = (e) => {
@@ -7679,7 +7679,7 @@ var init_Select = __esm({
7679
7679
  init_cn();
7680
7680
  init_Icon();
7681
7681
  init_useEventBus();
7682
- Select = React97__default.forwardRef(
7682
+ Select = React90__default.forwardRef(
7683
7683
  (props, _ref) => {
7684
7684
  const { multiple, searchable, clearable } = props;
7685
7685
  if (multiple || searchable || clearable) {
@@ -7696,7 +7696,7 @@ var init_Checkbox = __esm({
7696
7696
  "components/core/atoms/Checkbox.tsx"() {
7697
7697
  init_cn();
7698
7698
  init_useEventBus();
7699
- Checkbox = React97__default.forwardRef(
7699
+ Checkbox = React90__default.forwardRef(
7700
7700
  ({ className, label, id, onChange, ...props }, ref) => {
7701
7701
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
7702
7702
  const eventBus = useEventBus();
@@ -7750,7 +7750,7 @@ var init_Spinner = __esm({
7750
7750
  md: "h-6 w-6",
7751
7751
  lg: "h-8 w-8"
7752
7752
  };
7753
- Spinner = React97__default.forwardRef(
7753
+ Spinner = React90__default.forwardRef(
7754
7754
  ({ className, size = "md", overlay, ...props }, ref) => {
7755
7755
  if (overlay) {
7756
7756
  return /* @__PURE__ */ jsx(
@@ -7840,7 +7840,7 @@ var init_Card = __esm({
7840
7840
  chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
7841
7841
  "tile-image-first": "p-0 overflow-hidden"
7842
7842
  };
7843
- Card = React97__default.forwardRef(
7843
+ Card = React90__default.forwardRef(
7844
7844
  ({
7845
7845
  className,
7846
7846
  variant = "bordered",
@@ -7888,9 +7888,9 @@ var init_Card = __esm({
7888
7888
  }
7889
7889
  );
7890
7890
  Card.displayName = "Card";
7891
- CardHeader = React97__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
7891
+ CardHeader = React90__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
7892
7892
  CardHeader.displayName = "CardHeader";
7893
- CardTitle = React97__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7893
+ CardTitle = React90__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7894
7894
  "h3",
7895
7895
  {
7896
7896
  ref,
@@ -7903,11 +7903,11 @@ var init_Card = __esm({
7903
7903
  }
7904
7904
  ));
7905
7905
  CardTitle.displayName = "CardTitle";
7906
- CardContent = React97__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
7906
+ CardContent = React90__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
7907
7907
  CardContent.displayName = "CardContent";
7908
7908
  CardBody = CardContent;
7909
7909
  CardBody.displayName = "CardBody";
7910
- CardFooter = React97__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7910
+ CardFooter = React90__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7911
7911
  "div",
7912
7912
  {
7913
7913
  ref,
@@ -7918,6 +7918,38 @@ var init_Card = __esm({
7918
7918
  CardFooter.displayName = "CardFooter";
7919
7919
  }
7920
7920
  });
7921
+ function GameIcon({ assetUrl, icon, size = "md", alt, className }) {
7922
+ const px = typeof size === "number" ? size : sizeMap[size];
7923
+ const family = useIconFamily();
7924
+ if (assetUrl?.url) {
7925
+ return /* @__PURE__ */ jsx(
7926
+ AtlasImage,
7927
+ {
7928
+ asset: assetUrl,
7929
+ size: px,
7930
+ alt: alt ?? assetUrl.category ?? "",
7931
+ className: cn("flex-shrink-0", className)
7932
+ }
7933
+ );
7934
+ }
7935
+ const I = typeof icon === "string" ? resolveIconForFamily(icon, family) : icon;
7936
+ return /* @__PURE__ */ jsx(I, { width: px, height: px, className: cn("flex-shrink-0", className) });
7937
+ }
7938
+ var sizeMap;
7939
+ var init_GameIcon = __esm({
7940
+ "components/core/atoms/GameIcon.tsx"() {
7941
+ "use client";
7942
+ init_cn();
7943
+ init_iconFamily();
7944
+ init_AtlasImage();
7945
+ sizeMap = {
7946
+ sm: 16,
7947
+ md: 24,
7948
+ lg: 32
7949
+ };
7950
+ GameIcon.displayName = "GameIcon";
7951
+ }
7952
+ });
7921
7953
  var variantStyles5, sizeStyles4, iconSizes, FilterPill;
7922
7954
  var init_FilterPill = __esm({
7923
7955
  "components/core/atoms/FilterPill.tsx"() {
@@ -7962,7 +7994,7 @@ var init_FilterPill = __esm({
7962
7994
  md: "w-3.5 h-3.5",
7963
7995
  lg: "w-4 h-4"
7964
7996
  };
7965
- FilterPill = React97__default.forwardRef(
7997
+ FilterPill = React90__default.forwardRef(
7966
7998
  ({
7967
7999
  className,
7968
8000
  variant = "default",
@@ -8091,8 +8123,8 @@ var init_Avatar = __esm({
8091
8123
  actionPayload
8092
8124
  }) => {
8093
8125
  const eventBus = useEventBus();
8094
- const [imgFailed, setImgFailed] = React97__default.useState(false);
8095
- React97__default.useEffect(() => {
8126
+ const [imgFailed, setImgFailed] = React90__default.useState(false);
8127
+ React90__default.useEffect(() => {
8096
8128
  setImgFailed(false);
8097
8129
  }, [src]);
8098
8130
  const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
@@ -8205,7 +8237,7 @@ var init_Center = __esm({
8205
8237
  as: Component = "div"
8206
8238
  }) => {
8207
8239
  const mergedStyle = minHeight ? { minHeight, ...style } : style;
8208
- return React97__default.createElement(Component, {
8240
+ return React90__default.createElement(Component, {
8209
8241
  className: cn(
8210
8242
  inline ? "inline-flex" : "flex",
8211
8243
  horizontal && "justify-center",
@@ -8473,7 +8505,7 @@ var init_Radio = __esm({
8473
8505
  md: "w-2.5 h-2.5",
8474
8506
  lg: "w-3 h-3"
8475
8507
  };
8476
- Radio = React97__default.forwardRef(
8508
+ Radio = React90__default.forwardRef(
8477
8509
  ({
8478
8510
  label,
8479
8511
  helperText,
@@ -8490,12 +8522,12 @@ var init_Radio = __esm({
8490
8522
  onChange,
8491
8523
  ...props
8492
8524
  }, ref) => {
8493
- const reactId = React97__default.useId();
8525
+ const reactId = React90__default.useId();
8494
8526
  const baseId = id || `radio-${reactId}`;
8495
8527
  const hasError = !!error;
8496
8528
  const eventBus = useEventBus();
8497
- const [selected, setSelected] = React97__default.useState(value);
8498
- React97__default.useEffect(() => {
8529
+ const [selected, setSelected] = React90__default.useState(value);
8530
+ React90__default.useEffect(() => {
8499
8531
  if (value !== void 0) setSelected(value);
8500
8532
  }, [value]);
8501
8533
  const pick = (next, e) => {
@@ -8677,7 +8709,7 @@ var init_Switch = __esm({
8677
8709
  "components/core/atoms/Switch.tsx"() {
8678
8710
  "use client";
8679
8711
  init_cn();
8680
- Switch = React97.forwardRef(
8712
+ Switch = React90.forwardRef(
8681
8713
  ({
8682
8714
  checked,
8683
8715
  defaultChecked = false,
@@ -8688,10 +8720,10 @@ var init_Switch = __esm({
8688
8720
  name,
8689
8721
  className
8690
8722
  }, ref) => {
8691
- const [isChecked, setIsChecked] = React97.useState(
8723
+ const [isChecked, setIsChecked] = React90.useState(
8692
8724
  checked !== void 0 ? checked : defaultChecked
8693
8725
  );
8694
- React97.useEffect(() => {
8726
+ React90.useEffect(() => {
8695
8727
  if (checked !== void 0) {
8696
8728
  setIsChecked(checked);
8697
8729
  }
@@ -8815,7 +8847,7 @@ var init_TextHighlight = __esm({
8815
8847
  }) => {
8816
8848
  const eventBus = useEventBus();
8817
8849
  const baseStyles = "cursor-pointer transition-all duration-150";
8818
- const typeStyles2 = {
8850
+ const typeStyles = {
8819
8851
  question: cn(
8820
8852
  // Blue border for questions
8821
8853
  "bg-card border-b-2 border-primary-600",
@@ -8835,7 +8867,7 @@ var init_TextHighlight = __esm({
8835
8867
  "data-highlight": "true",
8836
8868
  "data-highlight-type": highlightType,
8837
8869
  "data-annotation-id": annotationId,
8838
- className: cn(baseStyles, typeStyles2[highlightType], className),
8870
+ className: cn(baseStyles, typeStyles[highlightType], className),
8839
8871
  onClick: () => {
8840
8872
  if (action) eventBus.emit(`UI:${action}`, { annotationId });
8841
8873
  onClick?.();
@@ -8969,7 +9001,7 @@ var Aside;
8969
9001
  var init_Aside = __esm({
8970
9002
  "components/core/atoms/Aside.tsx"() {
8971
9003
  init_cn();
8972
- Aside = React97__default.forwardRef(
9004
+ Aside = React90__default.forwardRef(
8973
9005
  ({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
8974
9006
  );
8975
9007
  Aside.displayName = "Aside";
@@ -9048,9 +9080,9 @@ var init_LawReferenceTooltip = __esm({
9048
9080
  className
9049
9081
  }) => {
9050
9082
  const { t } = useTranslate();
9051
- const [isVisible, setIsVisible] = React97__default.useState(false);
9052
- const timeoutRef = React97__default.useRef(null);
9053
- const triggerRef = React97__default.useRef(null);
9083
+ const [isVisible, setIsVisible] = React90__default.useState(false);
9084
+ const timeoutRef = React90__default.useRef(null);
9085
+ const triggerRef = React90__default.useRef(null);
9054
9086
  const handleMouseEnter = () => {
9055
9087
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
9056
9088
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -9061,7 +9093,7 @@ var init_LawReferenceTooltip = __esm({
9061
9093
  };
9062
9094
  const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
9063
9095
  const open = isVisible || revealed;
9064
- React97__default.useEffect(() => {
9096
+ React90__default.useEffect(() => {
9065
9097
  return () => {
9066
9098
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
9067
9099
  };
@@ -9271,7 +9303,7 @@ var init_StatusDot = __esm({
9271
9303
  md: "w-2.5 h-2.5",
9272
9304
  lg: "w-3 h-3"
9273
9305
  };
9274
- StatusDot = React97__default.forwardRef(
9306
+ StatusDot = React90__default.forwardRef(
9275
9307
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
9276
9308
  return /* @__PURE__ */ jsx(
9277
9309
  "span",
@@ -9325,7 +9357,7 @@ var init_TrendIndicator = __esm({
9325
9357
  down: "trending-down",
9326
9358
  flat: "arrow-right"
9327
9359
  };
9328
- TrendIndicator = React97__default.forwardRef(
9360
+ TrendIndicator = React90__default.forwardRef(
9329
9361
  ({
9330
9362
  className,
9331
9363
  value,
@@ -9392,7 +9424,7 @@ var init_RangeSlider = __esm({
9392
9424
  md: "w-4 h-4",
9393
9425
  lg: "w-5 h-5"
9394
9426
  };
9395
- RangeSlider = React97__default.forwardRef(
9427
+ RangeSlider = React90__default.forwardRef(
9396
9428
  ({
9397
9429
  className,
9398
9430
  min = 0,
@@ -9986,7 +10018,7 @@ var init_ContentSection = __esm({
9986
10018
  md: "py-16",
9987
10019
  lg: "py-24"
9988
10020
  };
9989
- ContentSection = React97__default.forwardRef(
10021
+ ContentSection = React90__default.forwardRef(
9990
10022
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
9991
10023
  return /* @__PURE__ */ jsx(
9992
10024
  Box,
@@ -10520,7 +10552,7 @@ var init_AnimatedReveal = __esm({
10520
10552
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
10521
10553
  "none": {}
10522
10554
  };
10523
- AnimatedReveal = React97__default.forwardRef(
10555
+ AnimatedReveal = React90__default.forwardRef(
10524
10556
  ({
10525
10557
  trigger = "scroll",
10526
10558
  animation = "fade-up",
@@ -10680,7 +10712,7 @@ var init_AnimatedGraphic = __esm({
10680
10712
  "components/marketing/atoms/AnimatedGraphic.tsx"() {
10681
10713
  "use client";
10682
10714
  init_cn();
10683
- AnimatedGraphic = React97__default.forwardRef(
10715
+ AnimatedGraphic = React90__default.forwardRef(
10684
10716
  ({
10685
10717
  src,
10686
10718
  svgContent,
@@ -10703,7 +10735,7 @@ var init_AnimatedGraphic = __esm({
10703
10735
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
10704
10736
  const resolvedSvg = svgContent ?? fetchedSvg;
10705
10737
  const prevAnimateRef = useRef(animate);
10706
- const setRef = React97__default.useCallback(
10738
+ const setRef = React90__default.useCallback(
10707
10739
  (node) => {
10708
10740
  containerRef.current = node;
10709
10741
  if (typeof ref === "function") ref(node);
@@ -10844,15 +10876,15 @@ var init_TraitFrame = __esm({
10844
10876
  }
10845
10877
  });
10846
10878
 
10847
- // components/game/lib/boardEntity.ts
10879
+ // lib/boardEntity.ts
10848
10880
  var init_boardEntity = __esm({
10849
- "components/game/lib/boardEntity.ts"() {
10881
+ "lib/boardEntity.ts"() {
10850
10882
  }
10851
10883
  });
10852
10884
 
10853
- // components/game/lib/makeAsset.ts
10885
+ // lib/makeAsset.ts
10854
10886
  var init_makeAsset = __esm({
10855
- "components/game/lib/makeAsset.ts"() {
10887
+ "lib/makeAsset.ts"() {
10856
10888
  }
10857
10889
  });
10858
10890
  function getState() {
@@ -11141,13 +11173,13 @@ function useImageCache(urls) {
11141
11173
  };
11142
11174
  }
11143
11175
  var init_useImageCache = __esm({
11144
- "components/game/hooks/useImageCache.ts"() {
11176
+ "hooks/useImageCache.ts"() {
11145
11177
  "use client";
11146
11178
  init_verificationRegistry();
11147
11179
  }
11148
11180
  });
11149
11181
 
11150
- // components/game/lib/isometric.ts
11182
+ // lib/isometric.ts
11151
11183
  function isoToScreen(tileX, tileY, scale, baseOffsetX, layout = "isometric") {
11152
11184
  const scaledTileWidth = TILE_WIDTH * scale;
11153
11185
  const scaledFloorHeight = FLOOR_HEIGHT * scale;
@@ -11185,7 +11217,7 @@ function screenToIso(screenX, screenY, scale, baseOffsetX, layout = "isometric")
11185
11217
  }
11186
11218
  var TILE_WIDTH, FLOOR_HEIGHT, DIAMOND_TOP_Y, BACKGROUND_FALLBACK_COLOR, MINIMAP_TERRAIN_COLORS;
11187
11219
  var init_isometric = __esm({
11188
- "components/game/lib/isometric.ts"() {
11220
+ "lib/isometric.ts"() {
11189
11221
  TILE_WIDTH = 256;
11190
11222
  FLOOR_HEIGHT = 128;
11191
11223
  DIAMOND_TOP_Y = 374;
@@ -11198,155 +11230,13 @@ var init_isometric = __esm({
11198
11230
  }
11199
11231
  });
11200
11232
 
11201
- // components/game/lib/spriteAnimation.ts
11202
- function frameRect(frame, row, columns, frameWidth, frameHeight) {
11203
- return {
11204
- sx: frame % columns * frameWidth,
11205
- sy: row * frameHeight,
11206
- sw: frameWidth,
11207
- sh: frameHeight
11208
- };
11209
- }
11210
- var init_spriteAnimation = __esm({
11211
- "components/game/lib/spriteAnimation.ts"() {
11212
- }
11213
- });
11214
-
11215
- // components/game/lib/index.ts
11216
- var init_lib = __esm({
11217
- "components/game/lib/index.ts"() {
11233
+ // lib/gameShared.ts
11234
+ var init_gameShared = __esm({
11235
+ "lib/gameShared.ts"() {
11218
11236
  init_boardEntity();
11219
11237
  init_makeAsset();
11220
11238
  }
11221
11239
  });
11222
- function GameIcon({ assetUrl, icon, size = "md", alt, className }) {
11223
- const px = typeof size === "number" ? size : sizeMap[size];
11224
- if (assetUrl?.url) {
11225
- return /* @__PURE__ */ jsx(
11226
- AtlasImage,
11227
- {
11228
- asset: assetUrl,
11229
- size: px,
11230
- alt: alt ?? assetUrl.category ?? "",
11231
- className: cn("flex-shrink-0", className)
11232
- }
11233
- );
11234
- }
11235
- const I = typeof icon === "string" ? resolveIcon(icon) : icon;
11236
- return /* @__PURE__ */ jsx(I, { width: px, height: px, className: cn("flex-shrink-0", className) });
11237
- }
11238
- var sizeMap;
11239
- var init_GameIcon = __esm({
11240
- "components/game/atoms/GameIcon.tsx"() {
11241
- "use client";
11242
- init_cn();
11243
- init_Icon();
11244
- init_AtlasImage();
11245
- sizeMap = {
11246
- sm: 16,
11247
- md: 24,
11248
- lg: 32
11249
- };
11250
- GameIcon.displayName = "GameIcon";
11251
- }
11252
- });
11253
- function GameCard({
11254
- id,
11255
- cost,
11256
- art,
11257
- frameAsset,
11258
- attack,
11259
- defense,
11260
- name,
11261
- selected = false,
11262
- disabled = false,
11263
- size = "md",
11264
- animState = "idle",
11265
- onClick,
11266
- clickEvent,
11267
- className
11268
- }) {
11269
- const eventBus = useEventBus();
11270
- const handleClick = React97.useCallback(() => {
11271
- if (disabled) return;
11272
- onClick?.(id);
11273
- if (clickEvent) eventBus.emit(`UI:${clickEvent}`, { cardId: id });
11274
- }, [disabled, id, onClick, clickEvent, eventBus]);
11275
- const artPx = artPxMap[size];
11276
- return /* @__PURE__ */ jsxs(
11277
- Button,
11278
- {
11279
- variant: "ghost",
11280
- onClick: handleClick,
11281
- disabled,
11282
- title: name,
11283
- className: cn(
11284
- "relative isolate flex flex-col items-center rounded-interactive",
11285
- "px-1.5 pt-1.5 pb-1 transition-all duration-150",
11286
- frameAsset?.url ? "border-0" : "border-2 bg-card/90",
11287
- cardSizeMap[size],
11288
- disabled ? "border-border opacity-50 cursor-not-allowed" : "border-accent hover:brightness-125 hover:-translate-y-1 cursor-pointer",
11289
- selected && "ring-2 ring-foreground ring-offset-1 ring-offset-background -translate-y-1",
11290
- ANIM_STATE_CLASS[animState],
11291
- className
11292
- ),
11293
- children: [
11294
- frameAsset?.url && /* @__PURE__ */ jsx(AtlasImage, { asset: frameAsset, fill: true, fit: "fill", "aria-hidden": true, style: { zIndex: -1 } }),
11295
- cost != null && /* @__PURE__ */ jsx(
11296
- Typography,
11297
- {
11298
- as: "span",
11299
- className: cn(
11300
- "absolute -top-2 -left-2 flex items-center justify-center",
11301
- "min-w-[22px] h-[22px] rounded-full px-1",
11302
- "bg-info text-foreground text-xs font-bold border border-background"
11303
- ),
11304
- children: cost
11305
- }
11306
- ),
11307
- /* @__PURE__ */ jsx(Box, { className: "flex-1 flex items-center justify-center w-full", children: art ? /* @__PURE__ */ jsx(GameIcon, { assetUrl: art, icon: "image", size: artPx, alt: name ?? id, className: "flex-shrink-0" }) : /* @__PURE__ */ jsx(Box, { className: "rounded bg-muted/40", style: { width: artPx, height: artPx } }) }),
11308
- name != null && /* @__PURE__ */ jsx(
11309
- Typography,
11310
- {
11311
- variant: "small",
11312
- className: "w-full truncate text-center text-[10px] leading-tight font-semibold",
11313
- children: name
11314
- }
11315
- ),
11316
- (attack != null || defense != null) && /* @__PURE__ */ jsxs(Box, { className: "flex w-full items-center justify-between px-0.5 text-[10px] font-bold leading-none", children: [
11317
- /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-error", children: attack != null ? `\u2694${attack}` : "" }),
11318
- /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-info", children: defense != null ? `\u{1F6E1}${defense}` : "" })
11319
- ] })
11320
- ]
11321
- }
11322
- );
11323
- }
11324
- var cardSizeMap, artPxMap, ANIM_STATE_CLASS;
11325
- var init_GameCard = __esm({
11326
- "components/game/atoms/GameCard.tsx"() {
11327
- "use client";
11328
- init_cn();
11329
- init_useEventBus();
11330
- init_Box();
11331
- init_Button();
11332
- init_Typography();
11333
- init_AtlasImage();
11334
- init_GameIcon();
11335
- cardSizeMap = {
11336
- sm: "w-16 h-24",
11337
- md: "w-20 h-28",
11338
- lg: "w-24 h-36"
11339
- };
11340
- artPxMap = { sm: 40, md: 52, lg: 64 };
11341
- ANIM_STATE_CLASS = {
11342
- idle: "",
11343
- drawn: "scale-105",
11344
- played: "-translate-y-2 opacity-80",
11345
- flipped: "scale-x-0"
11346
- };
11347
- GameCard.displayName = "GameCard";
11348
- }
11349
- });
11350
11240
  function HealthBar({
11351
11241
  current = 3,
11352
11242
  max = 5,
@@ -11551,9 +11441,9 @@ function ControlButton({
11551
11441
  className
11552
11442
  }) {
11553
11443
  const eventBus = useEventBus();
11554
- const [isPressed, setIsPressed] = React97.useState(false);
11444
+ const [isPressed, setIsPressed] = React90.useState(false);
11555
11445
  const actualPressed = pressed ?? isPressed;
11556
- const handlePointerDown = React97.useCallback(
11446
+ const handlePointerDown = React90.useCallback(
11557
11447
  (e) => {
11558
11448
  e.preventDefault();
11559
11449
  if (disabled) return;
@@ -11563,7 +11453,7 @@ function ControlButton({
11563
11453
  },
11564
11454
  [disabled, pressEvent, eventBus, onPress]
11565
11455
  );
11566
- const handlePointerUp = React97.useCallback(
11456
+ const handlePointerUp = React90.useCallback(
11567
11457
  (e) => {
11568
11458
  e.preventDefault();
11569
11459
  if (disabled) return;
@@ -11573,7 +11463,7 @@ function ControlButton({
11573
11463
  },
11574
11464
  [disabled, releaseEvent, eventBus, onRelease]
11575
11465
  );
11576
- const handlePointerLeave = React97.useCallback(
11466
+ const handlePointerLeave = React90.useCallback(
11577
11467
  (e) => {
11578
11468
  if (isPressed) {
11579
11469
  setIsPressed(false);
@@ -11644,157 +11534,6 @@ var init_ControlButton = __esm({
11644
11534
  ControlButton.displayName = "ControlButton";
11645
11535
  }
11646
11536
  });
11647
- function Sprite({
11648
- spritesheet = DEFAULT_SPRITESHEET,
11649
- frameWidth = 64,
11650
- frameHeight = 64,
11651
- frame = 0,
11652
- x = 0,
11653
- y = 0,
11654
- scale = 1,
11655
- flipX = false,
11656
- flipY = false,
11657
- rotation = 0,
11658
- opacity = 1,
11659
- zIndex = 0,
11660
- columns = 16,
11661
- animState: _animState,
11662
- frameRate: _frameRate,
11663
- className,
11664
- onClick,
11665
- action
11666
- }) {
11667
- const eventBus = useEventBus();
11668
- const sourcePosition = useMemo(() => {
11669
- const { sx, sy } = frameRect(frame, Math.floor(frame / columns), columns, frameWidth, frameHeight);
11670
- return { x: sx, y: sy };
11671
- }, [frame, columns, frameWidth, frameHeight]);
11672
- const transform = useMemo(() => {
11673
- const transforms = [
11674
- `translate(${x}px, ${y}px)`
11675
- ];
11676
- if (scale !== 1) {
11677
- transforms.push(`scale(${scale})`);
11678
- }
11679
- if (flipX || flipY) {
11680
- transforms.push(`scale(${flipX ? -1 : 1}, ${flipY ? -1 : 1})`);
11681
- }
11682
- if (rotation !== 0) {
11683
- transforms.push(`rotate(${rotation}deg)`);
11684
- }
11685
- return transforms.join(" ");
11686
- }, [x, y, scale, flipX, flipY, rotation]);
11687
- const backgroundPosition = `-${sourcePosition.x}px -${sourcePosition.y}px`;
11688
- const handleClick = () => {
11689
- if (action) eventBus.emit(`UI:${action}`, {});
11690
- onClick?.();
11691
- };
11692
- return /* @__PURE__ */ jsx(
11693
- Box,
11694
- {
11695
- position: "absolute",
11696
- className,
11697
- onClick: action || onClick ? handleClick : void 0,
11698
- style: {
11699
- width: frameWidth,
11700
- height: frameHeight,
11701
- backgroundImage: `url(${spritesheet.url})`,
11702
- backgroundPosition,
11703
- backgroundRepeat: "no-repeat",
11704
- imageRendering: "pixelated",
11705
- transform,
11706
- transformOrigin: "center center",
11707
- opacity,
11708
- zIndex,
11709
- pointerEvents: action || onClick ? "auto" : "none"
11710
- }
11711
- }
11712
- );
11713
- }
11714
- var DEFAULT_SPRITESHEET;
11715
- var init_Sprite = __esm({
11716
- "components/game/atoms/Sprite.tsx"() {
11717
- "use client";
11718
- init_useEventBus();
11719
- init_Box();
11720
- init_spriteAnimation();
11721
- DEFAULT_SPRITESHEET = {
11722
- url: "https://almadar-kflow-assets.web.app/shared/isometric-blocks/Spritesheet/allTiles_sheet.png",
11723
- role: "tile",
11724
- category: "tile"
11725
- };
11726
- }
11727
- });
11728
- function isKnownState(s) {
11729
- return s in DEFAULT_STATE_STYLES;
11730
- }
11731
- function StateIndicator({
11732
- assetUrl = DEFAULT_ASSET_URL,
11733
- state = "idle",
11734
- label,
11735
- size = "md",
11736
- animated = true,
11737
- stateStyles,
11738
- className
11739
- }) {
11740
- const mergedStyles = stateStyles ? { ...DEFAULT_STATE_STYLES, ...stateStyles } : DEFAULT_STATE_STYLES;
11741
- const knownState = isKnownState(state) ? state : null;
11742
- const config = knownState !== null ? mergedStyles[knownState] ?? DEFAULT_STYLE : DEFAULT_STYLE;
11743
- const displayLabel = label ?? state.charAt(0).toUpperCase() + state.slice(1);
11744
- return /* @__PURE__ */ jsxs(
11745
- Box,
11746
- {
11747
- display: "inline-flex",
11748
- className: cn(
11749
- "items-center gap-1 rounded-full text-foreground font-medium",
11750
- config.bgClass,
11751
- SIZE_CLASSES[size],
11752
- animated && (knownState === null || !STATIC_STATES.has(knownState)) && "animate-pulse",
11753
- className
11754
- ),
11755
- children: [
11756
- /* @__PURE__ */ jsx(Box, { as: "span", children: assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 16, alt: displayLabel, className: "flex-shrink-0" }) : typeof config.icon === "string" ? /^[a-zA-Z0-9-]+$/.test(config.icon) ? /* @__PURE__ */ jsx(Icon, { name: config.icon }) : config.icon : /* @__PURE__ */ jsx(Icon, { icon: config.icon }) }),
11757
- /* @__PURE__ */ jsx(Box, { as: "span", children: displayLabel })
11758
- ]
11759
- }
11760
- );
11761
- }
11762
- var DEFAULT_ASSET_URL, DEFAULT_STATE_STYLES, DEFAULT_STYLE, STATIC_STATES, SIZE_CLASSES;
11763
- var init_StateIndicator = __esm({
11764
- "components/game/atoms/StateIndicator.tsx"() {
11765
- init_Box();
11766
- init_Icon();
11767
- init_cn();
11768
- init_GameIcon();
11769
- DEFAULT_ASSET_URL = {
11770
- url: "https://almadar-kflow-assets.web.app/shared/isometric-dungeon/Isometric/chestClosed_E.png",
11771
- role: "ui",
11772
- category: "state"
11773
- };
11774
- DEFAULT_STATE_STYLES = {
11775
- idle: { icon: "\u23F8", bgClass: "bg-muted" },
11776
- active: { icon: "\u25B6", bgClass: "bg-success" },
11777
- sleeping: { icon: "\u{1F4A4}", bgClass: "bg-muted" },
11778
- moving: { icon: "\u{1F6B6}", bgClass: "bg-info" },
11779
- eating: { icon: "\u{1F37D}\uFE0F", bgClass: "bg-success" },
11780
- waiting: { icon: "\u23F3", bgClass: "bg-warning" },
11781
- happy: { icon: "\u{1F60A}", bgClass: "bg-success" },
11782
- scared: { icon: "\u{1F628}", bgClass: "bg-error" },
11783
- done: { icon: "\u2713", bgClass: "bg-success" },
11784
- error: { icon: "\u2717", bgClass: "bg-error" },
11785
- ready: { icon: "\u2713", bgClass: "bg-success" },
11786
- cooldown: { icon: "\u{1F504}", bgClass: "bg-warning" }
11787
- };
11788
- DEFAULT_STYLE = { icon: "?", bgClass: "bg-muted" };
11789
- STATIC_STATES = /* @__PURE__ */ new Set(["idle", "done"]);
11790
- SIZE_CLASSES = {
11791
- sm: "text-xs px-1.5 py-0.5",
11792
- md: "text-sm px-2 py-1",
11793
- lg: "text-base px-3 py-1.5"
11794
- };
11795
- StateIndicator.displayName = "StateIndicator";
11796
- }
11797
- });
11798
11537
  function formatTime(seconds, format) {
11799
11538
  const clamped = Math.max(0, Math.floor(seconds));
11800
11539
  if (format === "ss") {
@@ -11851,524 +11590,6 @@ var init_TimerDisplay = __esm({
11851
11590
  TimerDisplay.displayName = "TimerDisplay";
11852
11591
  }
11853
11592
  });
11854
- function ResourceCounter({
11855
- assetUrl = DEFAULT_ASSET_URL2,
11856
- icon,
11857
- label = "Gold",
11858
- value = 250,
11859
- max,
11860
- color,
11861
- size = "md",
11862
- className
11863
- }) {
11864
- const sizes = sizeMap6[size];
11865
- return /* @__PURE__ */ jsxs(
11866
- Box,
11867
- {
11868
- className: cn(
11869
- "inline-flex items-center rounded-container",
11870
- "bg-card/80 border border-muted font-medium text-foreground",
11871
- sizes.wrapper,
11872
- className
11873
- ),
11874
- children: [
11875
- assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: sizes.img, alt: label, className: "flex-shrink-0" }) : icon ? /* @__PURE__ */ jsx(Box, { as: "span", className: cn("flex-shrink-0", sizes.icon), children: typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon }) : /* @__PURE__ */ jsx(Icon, { icon }) }) : null,
11876
- /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground", children: label }),
11877
- /* @__PURE__ */ jsxs(Typography, { as: "span", className: cn("font-bold tabular-nums", color && (color in colorTokenClasses2 ? colorTokenClasses2[color] : color)), children: [
11878
- value,
11879
- max != null && /* @__PURE__ */ jsxs(Typography, { as: "span", className: "text-muted-foreground", children: [
11880
- "/",
11881
- max
11882
- ] })
11883
- ] })
11884
- ]
11885
- }
11886
- );
11887
- }
11888
- var colorTokenClasses2, DEFAULT_ASSET_URL2, sizeMap6;
11889
- var init_ResourceCounter = __esm({
11890
- "components/game/atoms/ResourceCounter.tsx"() {
11891
- init_cn();
11892
- init_Icon();
11893
- init_Box();
11894
- init_Typography();
11895
- init_GameIcon();
11896
- colorTokenClasses2 = {
11897
- primary: "text-primary",
11898
- secondary: "text-secondary",
11899
- success: "text-success",
11900
- warning: "text-warning",
11901
- error: "text-error",
11902
- muted: "text-muted-foreground"
11903
- };
11904
- DEFAULT_ASSET_URL2 = {
11905
- url: "https://almadar-kflow-assets.web.app/shared/world-map/gold_mine.png",
11906
- role: "ui",
11907
- category: "coin"
11908
- };
11909
- sizeMap6 = {
11910
- sm: { wrapper: "text-xs gap-1 px-1.5 py-0.5", icon: "text-sm", img: 16 },
11911
- md: { wrapper: "text-sm gap-1.5 px-2 py-1", icon: "text-base", img: 20 },
11912
- lg: { wrapper: "text-base gap-2 px-3 py-1.5", icon: "text-lg", img: 28 }
11913
- };
11914
- ResourceCounter.displayName = "ResourceCounter";
11915
- }
11916
- });
11917
- function ItemSlot({
11918
- assetUrl = DEFAULT_ASSET_URL3,
11919
- icon = "sword",
11920
- label = "Iron Sword",
11921
- quantity,
11922
- rarity = "uncommon",
11923
- empty,
11924
- size = "md",
11925
- selected,
11926
- onClick,
11927
- action,
11928
- className
11929
- }) {
11930
- const eventBus = useEventBus();
11931
- const isClickable = onClick != null || action != null;
11932
- const px = assetSizeMap[size];
11933
- return /* @__PURE__ */ jsx(
11934
- Button,
11935
- {
11936
- variant: "ghost",
11937
- onClick: () => {
11938
- if (action) eventBus.emit(`UI:${action}`, {});
11939
- onClick?.();
11940
- },
11941
- disabled: !isClickable,
11942
- title: label,
11943
- className: cn(
11944
- "relative flex items-center justify-center rounded-interactive border-2",
11945
- "bg-card/80 transition-all duration-150",
11946
- sizeMap7[size],
11947
- empty ? "border-border bg-card/50" : rarityBorderMap[rarity],
11948
- !empty && rarityGlowMap[rarity],
11949
- selected && "ring-2 ring-foreground ring-offset-1 ring-offset-background",
11950
- isClickable && !empty && "hover:brightness-125 cursor-pointer",
11951
- isClickable && empty && "hover:border-muted cursor-pointer",
11952
- !isClickable && "cursor-default",
11953
- className
11954
- ),
11955
- children: empty ? /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground text-base", children: "+" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
11956
- assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: px, alt: label, className: "flex-shrink-0" }) : icon ? /* @__PURE__ */ jsx(Box, { as: "span", className: "flex-shrink-0", children: typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon }) : /* @__PURE__ */ jsx(Icon, { icon }) }) : null,
11957
- quantity != null && quantity > 1 && /* @__PURE__ */ jsx(
11958
- Typography,
11959
- {
11960
- as: "span",
11961
- className: cn(
11962
- "absolute -bottom-1 -right-1 flex items-center justify-center",
11963
- "min-w-[18px] h-[18px] rounded-full px-1",
11964
- "bg-surface border border-muted text-xs font-bold text-foreground"
11965
- ),
11966
- children: quantity
11967
- }
11968
- )
11969
- ] })
11970
- }
11971
- );
11972
- }
11973
- var sizeMap7, rarityBorderMap, rarityGlowMap, DEFAULT_ASSET_URL3, assetSizeMap;
11974
- var init_ItemSlot = __esm({
11975
- "components/game/atoms/ItemSlot.tsx"() {
11976
- "use client";
11977
- init_cn();
11978
- init_Icon();
11979
- init_useEventBus();
11980
- init_Button();
11981
- init_Box();
11982
- init_Typography();
11983
- init_GameIcon();
11984
- sizeMap7 = {
11985
- sm: "w-10 h-10 text-lg",
11986
- md: "w-14 h-14 text-2xl",
11987
- lg: "w-18 h-18 text-3xl"
11988
- };
11989
- rarityBorderMap = {
11990
- common: "border-muted",
11991
- uncommon: "border-success",
11992
- rare: "border-info",
11993
- epic: "border-accent",
11994
- legendary: "border-warning"
11995
- };
11996
- rarityGlowMap = {
11997
- common: "",
11998
- uncommon: "",
11999
- rare: "shadow-sm",
12000
- epic: "shadow-lg",
12001
- legendary: "shadow-lg"
12002
- };
12003
- DEFAULT_ASSET_URL3 = {
12004
- url: "https://almadar-kflow-assets.web.app/shared/isometric-dungeon/Isometric/chestClosed_E.png",
12005
- role: "item",
12006
- category: "item"
12007
- };
12008
- assetSizeMap = {
12009
- sm: 28,
12010
- md: 40,
12011
- lg: 56
12012
- };
12013
- ItemSlot.displayName = "ItemSlot";
12014
- }
12015
- });
12016
- function TurnIndicator({
12017
- assetUrl = DEFAULT_ASSET_URL4,
12018
- currentTurn = 1,
12019
- maxTurns,
12020
- activeTeam,
12021
- phase,
12022
- size = "md",
12023
- className
12024
- }) {
12025
- const sizes = sizeMap8[size];
12026
- return /* @__PURE__ */ jsxs(
12027
- Box,
12028
- {
12029
- className: cn(
12030
- "inline-flex items-center rounded-container",
12031
- "bg-card/80 border border-muted font-medium text-foreground",
12032
- sizes.wrapper,
12033
- className
12034
- ),
12035
- children: [
12036
- /* @__PURE__ */ jsxs(Typography, { as: "span", className: "font-bold tabular-nums", children: [
12037
- "Turn ",
12038
- currentTurn,
12039
- maxTurns != null && /* @__PURE__ */ jsxs(Typography, { as: "span", className: "text-muted-foreground", children: [
12040
- "/",
12041
- maxTurns
12042
- ] })
12043
- ] }),
12044
- phase && /* @__PURE__ */ jsxs(Fragment, { children: [
12045
- /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground", children: "|" }),
12046
- /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground", children: phase })
12047
- ] }),
12048
- activeTeam && /* @__PURE__ */ jsxs(Fragment, { children: [
12049
- /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground", children: "|" }),
12050
- assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 12, className: "flex-shrink-0" }) : /* @__PURE__ */ jsx(Box, { as: "span", className: cn("rounded-full bg-success/20", sizes.dot) }),
12051
- /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-success", children: activeTeam })
12052
- ] })
12053
- ]
12054
- }
12055
- );
12056
- }
12057
- var sizeMap8, DEFAULT_ASSET_URL4;
12058
- var init_TurnIndicator = __esm({
12059
- "components/game/atoms/TurnIndicator.tsx"() {
12060
- init_cn();
12061
- init_Box();
12062
- init_Typography();
12063
- init_GameIcon();
12064
- sizeMap8 = {
12065
- sm: { wrapper: "text-xs gap-1.5 px-2 py-0.5", dot: "w-1.5 h-1.5" },
12066
- md: { wrapper: "text-sm gap-2 px-3 py-1", dot: "w-2 h-2" },
12067
- lg: { wrapper: "text-base gap-2.5 px-4 py-1.5", dot: "w-2.5 h-2.5" }
12068
- };
12069
- DEFAULT_ASSET_URL4 = {
12070
- url: "https://almadar-kflow-assets.web.app/shared/effects/particles/symbol_01.png",
12071
- role: "ui",
12072
- category: "turn"
12073
- };
12074
- TurnIndicator.displayName = "TurnIndicator";
12075
- }
12076
- });
12077
- function getComboIntensity(combo) {
12078
- if (combo >= 10) return "text-error animate-pulse";
12079
- if (combo >= 7) return "text-warning";
12080
- if (combo >= 4) return "text-warning";
12081
- return "text-foreground";
12082
- }
12083
- function getComboScale(combo) {
12084
- if (combo >= 10) return "scale-110";
12085
- if (combo >= 5) return "scale-105";
12086
- return "";
12087
- }
12088
- function ComboCounter({
12089
- assetUrl = DEFAULT_ASSET_URL5,
12090
- combo = 5,
12091
- multiplier,
12092
- streak,
12093
- size = "md",
12094
- className
12095
- }) {
12096
- const sizes = sizeMap9[size];
12097
- if (combo <= 0) return null;
12098
- return /* @__PURE__ */ jsxs(
12099
- Box,
12100
- {
12101
- className: cn(
12102
- "inline-flex flex-col items-center justify-center",
12103
- "rounded-container bg-card/80 border border-muted px-3 py-1.5",
12104
- "transition-transform duration-200",
12105
- getComboScale(combo),
12106
- className
12107
- ),
12108
- children: [
12109
- assetUrl && /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 24, className: "flex-shrink-0 mb-0.5" }),
12110
- /* @__PURE__ */ jsx(Typography, { as: "span", className: cn("font-black tabular-nums leading-none", sizes.combo, getComboIntensity(combo)), children: combo }),
12111
- /* @__PURE__ */ jsx(Typography, { as: "span", className: cn("font-bold uppercase tracking-wider text-muted-foreground", sizes.label), children: "combo" }),
12112
- multiplier != null && multiplier > 1 && /* @__PURE__ */ jsxs(Typography, { as: "span", className: cn("font-bold text-warning tabular-nums", sizes.multiplier), children: [
12113
- "x",
12114
- multiplier.toFixed(1)
12115
- ] }),
12116
- streak != null && streak > 0 && /* @__PURE__ */ jsxs(Typography, { as: "span", className: cn("text-muted-foreground tabular-nums", sizes.label), children: [
12117
- streak,
12118
- " streak"
12119
- ] })
12120
- ]
12121
- }
12122
- );
12123
- }
12124
- var DEFAULT_ASSET_URL5, sizeMap9;
12125
- var init_ComboCounter = __esm({
12126
- "components/game/atoms/ComboCounter.tsx"() {
12127
- init_cn();
12128
- init_Box();
12129
- init_Typography();
12130
- init_GameIcon();
12131
- DEFAULT_ASSET_URL5 = {
12132
- url: "https://almadar-kflow-assets.web.app/shared/effects/flash/flash00.png",
12133
- role: "effect",
12134
- category: "effect"
12135
- };
12136
- sizeMap9 = {
12137
- sm: { combo: "text-lg", label: "text-xs", multiplier: "text-xs" },
12138
- md: { combo: "text-2xl", label: "text-xs", multiplier: "text-sm" },
12139
- lg: { combo: "text-4xl", label: "text-sm", multiplier: "text-base" }
12140
- };
12141
- ComboCounter.displayName = "ComboCounter";
12142
- }
12143
- });
12144
- function WaypointMarker({
12145
- assetUrl = DEFAULT_ASSET_URL6,
12146
- label,
12147
- icon,
12148
- active = true,
12149
- completed = false,
12150
- size = "md",
12151
- className
12152
- }) {
12153
- const sizes = sizeMap10[size];
12154
- return /* @__PURE__ */ jsxs(Box, { className: cn("flex flex-col items-center", className), children: [
12155
- /* @__PURE__ */ jsxs(Box, { className: "relative flex items-center justify-center", children: [
12156
- active && /* @__PURE__ */ jsx(
12157
- Box,
12158
- {
12159
- position: "absolute",
12160
- className: cn(
12161
- "rounded-full border-2 border-info animate-ping opacity-50",
12162
- sizes.ring
12163
- )
12164
- }
12165
- ),
12166
- active && /* @__PURE__ */ jsx(
12167
- Box,
12168
- {
12169
- position: "absolute",
12170
- className: cn(
12171
- "rounded-full border-2 border-info",
12172
- sizes.ring
12173
- )
12174
- }
12175
- ),
12176
- /* @__PURE__ */ jsx(
12177
- Box,
12178
- {
12179
- position: "relative",
12180
- className: cn(
12181
- "flex items-center justify-center rounded-full transition-all duration-200",
12182
- sizes.dot,
12183
- completed && "bg-success text-foreground",
12184
- active && !completed && "bg-info text-foreground",
12185
- !active && !completed && "bg-muted"
12186
- ),
12187
- children: completed ? checkIcon : assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: sizes.img, alt: label, className: "flex-shrink-0" }) : icon ? typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon }) : /* @__PURE__ */ jsx(Icon, { icon }) : null
12188
- }
12189
- )
12190
- ] }),
12191
- label && /* @__PURE__ */ jsx(
12192
- Typography,
12193
- {
12194
- as: "span",
12195
- className: cn(
12196
- "text-center whitespace-nowrap",
12197
- sizes.label,
12198
- completed ? "text-success" : active ? "text-info" : "text-muted-foreground"
12199
- ),
12200
- children: label
12201
- }
12202
- )
12203
- ] });
12204
- }
12205
- var DEFAULT_ASSET_URL6, sizeMap10, checkIcon;
12206
- var init_WaypointMarker = __esm({
12207
- "components/game/atoms/WaypointMarker.tsx"() {
12208
- init_cn();
12209
- init_Icon();
12210
- init_Box();
12211
- init_Typography();
12212
- init_GameIcon();
12213
- DEFAULT_ASSET_URL6 = {
12214
- url: "https://almadar-kflow-assets.web.app/shared/world-map/battle_marker.png",
12215
- role: "ui",
12216
- category: "waypoint"
12217
- };
12218
- sizeMap10 = {
12219
- sm: { dot: "w-4 h-4", ring: "w-6 h-6", label: "text-xs mt-1", img: 12 },
12220
- md: { dot: "w-6 h-6", ring: "w-8 h-8", label: "text-sm mt-1.5", img: 18 },
12221
- lg: { dot: "w-8 h-8", ring: "w-10 h-10", label: "text-base mt-2", img: 24 }
12222
- };
12223
- checkIcon = /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 3, className: "w-3/5 h-3/5", children: /* @__PURE__ */ jsx("path", { d: "M5 13l4 4L19 7", strokeLinecap: "round", strokeLinejoin: "round" }) });
12224
- WaypointMarker.displayName = "WaypointMarker";
12225
- }
12226
- });
12227
- function formatDuration(seconds) {
12228
- if (seconds >= 60) {
12229
- return `${Math.floor(seconds / 60)}m`;
12230
- }
12231
- return `${Math.round(seconds)}s`;
12232
- }
12233
- function StatusEffect({
12234
- assetUrl = DEFAULT_ASSET_URL7,
12235
- icon,
12236
- label = "Shield",
12237
- duration = 30,
12238
- stacks,
12239
- variant = "buff",
12240
- size = "md",
12241
- className
12242
- }) {
12243
- const sizes = sizeMap11[size];
12244
- return /* @__PURE__ */ jsxs(Box, { position: "relative", className: cn("inline-flex flex-col items-center", className), children: [
12245
- /* @__PURE__ */ jsxs(
12246
- Box,
12247
- {
12248
- position: "relative",
12249
- className: cn(
12250
- "flex items-center justify-center rounded-interactive border-2",
12251
- sizes.container,
12252
- variantStyles7[variant]
12253
- ),
12254
- title: label,
12255
- children: [
12256
- /* @__PURE__ */ jsx(Box, { as: "span", className: cn("flex items-center justify-center", sizes.icon), children: assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: sizes.img, alt: label, className: "flex-shrink-0" }) : icon != null && typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon, size: "sm" }) : icon != null ? /* @__PURE__ */ jsx(Icon, { icon, size: "sm" }) : null }),
12257
- duration !== void 0 && /* @__PURE__ */ jsx(
12258
- Typography,
12259
- {
12260
- as: "span",
12261
- className: cn(
12262
- "absolute bottom-0 left-0 right-0 text-center font-mono font-bold text-foreground bg-background/60 leading-tight",
12263
- sizes.timer
12264
- ),
12265
- children: formatDuration(duration)
12266
- }
12267
- )
12268
- ]
12269
- }
12270
- ),
12271
- stacks !== void 0 && stacks > 1 && /* @__PURE__ */ jsx(
12272
- Typography,
12273
- {
12274
- as: "span",
12275
- className: cn(
12276
- "absolute flex items-center justify-center rounded-full bg-card text-foreground font-bold leading-none",
12277
- sizes.badge
12278
- ),
12279
- children: stacks
12280
- }
12281
- ),
12282
- label && /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-xs text-muted-foreground mt-0.5 text-center whitespace-nowrap", children: label })
12283
- ] });
12284
- }
12285
- var DEFAULT_ASSET_URL7, sizeMap11, variantStyles7;
12286
- var init_StatusEffect = __esm({
12287
- "components/game/atoms/StatusEffect.tsx"() {
12288
- init_cn();
12289
- init_Icon();
12290
- init_Box();
12291
- init_Typography();
12292
- init_GameIcon();
12293
- DEFAULT_ASSET_URL7 = {
12294
- url: "https://almadar-kflow-assets.web.app/shared/effects/particles/flame_01.png",
12295
- role: "ui",
12296
- category: "effect"
12297
- };
12298
- sizeMap11 = {
12299
- sm: { container: "w-8 h-8", icon: "text-sm", badge: "text-xs -top-1 -right-1 w-4 h-4", timer: "text-[9px]", img: 20 },
12300
- md: { container: "w-10 h-10", icon: "text-base", badge: "text-xs -top-1 -right-1 w-5 h-5", timer: "text-xs", img: 28 },
12301
- lg: { container: "w-12 h-12", icon: "text-lg", badge: "text-sm -top-1.5 -right-1.5 w-6 h-6", timer: "text-xs", img: 36 }
12302
- };
12303
- variantStyles7 = {
12304
- buff: "border-success bg-success/20",
12305
- debuff: "border-error bg-error/20",
12306
- neutral: "border-muted bg-muted/20"
12307
- };
12308
- StatusEffect.displayName = "StatusEffect";
12309
- }
12310
- });
12311
- function DamageNumber({
12312
- assetUrl = DEFAULT_ASSET_URL8,
12313
- value = 42,
12314
- type = "damage",
12315
- size = "md",
12316
- className
12317
- }) {
12318
- const displayText = type === "miss" ? "MISS" : type === "heal" ? `+${value}` : `${value}`;
12319
- return /* @__PURE__ */ jsxs(Fragment, { children: [
12320
- /* @__PURE__ */ jsx("style", { children: floatKeyframes }),
12321
- /* @__PURE__ */ jsxs(
12322
- Typography,
12323
- {
12324
- as: "span",
12325
- className: cn(
12326
- "inline-flex items-center gap-0.5 font-mono select-none pointer-events-none",
12327
- sizeMap12[size],
12328
- typeStyles[type],
12329
- className
12330
- ),
12331
- style: { animation: "damageFloat 1s ease-out forwards" },
12332
- children: [
12333
- assetUrl && /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 14, className: "flex-shrink-0" }),
12334
- displayText
12335
- ]
12336
- }
12337
- )
12338
- ] });
12339
- }
12340
- var sizeMap12, typeStyles, floatKeyframes, DEFAULT_ASSET_URL8;
12341
- var init_DamageNumber = __esm({
12342
- "components/game/atoms/DamageNumber.tsx"() {
12343
- init_cn();
12344
- init_Typography();
12345
- init_GameIcon();
12346
- sizeMap12 = {
12347
- sm: "text-sm",
12348
- md: "text-lg",
12349
- lg: "text-2xl"
12350
- };
12351
- typeStyles = {
12352
- damage: "text-error font-bold",
12353
- heal: "text-success font-bold",
12354
- crit: "text-warning font-extrabold",
12355
- miss: "text-muted-foreground italic"
12356
- };
12357
- floatKeyframes = `
12358
- @keyframes damageFloat {
12359
- 0% { opacity: 1; transform: translateY(0) scale(1); }
12360
- 20% { transform: translateY(-8px) scale(1.1); }
12361
- 100% { opacity: 0; transform: translateY(-32px) scale(0.8); }
12362
- }
12363
- `;
12364
- DEFAULT_ASSET_URL8 = {
12365
- url: "https://almadar-kflow-assets.web.app/shared/effects/particles/spark_01.png",
12366
- role: "effect",
12367
- category: "effect"
12368
- };
12369
- DamageNumber.displayName = "DamageNumber";
12370
- }
12371
- });
12372
11593
  function DialogueBubble({
12373
11594
  speaker = "Hero",
12374
11595
  text = "The dungeon awaits. Choose your path wisely.",
@@ -12430,16 +11651,14 @@ function ChoiceButton({
12430
11651
  payload,
12431
11652
  className
12432
11653
  }) {
12433
- const eventBus = useEventBus();
12434
11654
  return /* @__PURE__ */ jsxs(
12435
11655
  Button,
12436
11656
  {
12437
11657
  variant: "ghost",
12438
11658
  disabled,
12439
- onClick: () => {
12440
- if (action) eventBus.emit(`UI:${action}`, payload ?? {});
12441
- onClick?.();
12442
- },
11659
+ action,
11660
+ actionPayload: payload,
11661
+ onClick,
12443
11662
  className: cn(
12444
11663
  "w-full text-left px-4 py-2.5 rounded-interactive border transition-all duration-150",
12445
11664
  "flex items-center gap-2",
@@ -12478,7 +11697,6 @@ var init_ChoiceButton = __esm({
12478
11697
  "components/game/atoms/ChoiceButton.tsx"() {
12479
11698
  init_cn();
12480
11699
  init_Icon();
12481
- init_useEventBus();
12482
11700
  init_Button();
12483
11701
  init_Box();
12484
11702
  init_Typography();
@@ -12486,250 +11704,6 @@ var init_ChoiceButton = __esm({
12486
11704
  ChoiceButton.displayName = "ChoiceButton";
12487
11705
  }
12488
11706
  });
12489
- function ActionButton({
12490
- assetUrl = DEFAULT_ASSET_URL9,
12491
- label = "Attack",
12492
- icon,
12493
- cooldown = 0,
12494
- disabled = false,
12495
- hotkey,
12496
- size = "md",
12497
- variant = "primary",
12498
- onClick,
12499
- action,
12500
- className
12501
- }) {
12502
- const eventBus = useEventBus();
12503
- const sizes = sizeMap13[size];
12504
- const onCooldown = cooldown > 0;
12505
- const isDisabled = disabled || onCooldown;
12506
- const cooldownDeg = Math.round(cooldown * 360);
12507
- return /* @__PURE__ */ jsxs(
12508
- Button,
12509
- {
12510
- variant: variant === "danger" ? "danger" : variant === "secondary" ? "secondary" : "primary",
12511
- disabled: isDisabled,
12512
- onClick: () => {
12513
- if (action) eventBus.emit(`UI:${action}`, {});
12514
- onClick?.();
12515
- },
12516
- className: cn(
12517
- "relative inline-flex items-center gap-1.5 rounded-interactive border font-medium overflow-hidden transition-colors duration-150",
12518
- sizes.button,
12519
- variantStyles8[variant],
12520
- isDisabled && "opacity-60 cursor-not-allowed",
12521
- className
12522
- ),
12523
- children: [
12524
- onCooldown && /* @__PURE__ */ jsx(
12525
- Box,
12526
- {
12527
- position: "absolute",
12528
- className: "inset-0 bg-foreground/40 pointer-events-none",
12529
- style: {
12530
- clipPath: `conic-gradient(from 0deg, transparent ${360 - cooldownDeg}deg, black ${360 - cooldownDeg}deg)`,
12531
- WebkitClipPath: `conic-gradient(from 0deg, transparent ${360 - cooldownDeg}deg, black ${360 - cooldownDeg}deg)`,
12532
- background: `conic-gradient(from 0deg, transparent ${360 - cooldownDeg}deg, rgba(0,0,0,0.6) ${360 - cooldownDeg}deg)`
12533
- }
12534
- }
12535
- ),
12536
- assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 16, className: cn("flex-shrink-0", sizes.icon) }) : icon ? /* @__PURE__ */ jsx(Box, { as: "span", className: cn("flex-shrink-0", sizes.icon), children: typeof icon === "string" ? (() => {
12537
- const I = resolveIcon(icon);
12538
- return I ? /* @__PURE__ */ jsx(I, { className: "w-4 h-4" }) : null;
12539
- })() : /* @__PURE__ */ (() => {
12540
- const I = icon;
12541
- return /* @__PURE__ */ jsx(I, { className: "w-4 h-4" });
12542
- })() }) : null,
12543
- /* @__PURE__ */ jsx(Typography, { as: "span", className: "relative z-10", children: label }),
12544
- hotkey && /* @__PURE__ */ jsx(
12545
- Typography,
12546
- {
12547
- as: "span",
12548
- className: cn(
12549
- "absolute top-0.5 right-0.5 bg-foreground/30 text-primary-foreground rounded font-mono leading-tight",
12550
- sizes.hotkey
12551
- ),
12552
- children: hotkey
12553
- }
12554
- )
12555
- ]
12556
- }
12557
- );
12558
- }
12559
- var sizeMap13, variantStyles8, DEFAULT_ASSET_URL9;
12560
- var init_ActionButton = __esm({
12561
- "components/game/atoms/ActionButton.tsx"() {
12562
- init_cn();
12563
- init_Icon();
12564
- init_useEventBus();
12565
- init_Button();
12566
- init_Box();
12567
- init_Typography();
12568
- init_GameIcon();
12569
- sizeMap13 = {
12570
- sm: { button: "h-button-sm px-3 text-xs", hotkey: "text-[9px] px-1", icon: "text-xs" },
12571
- md: { button: "h-button-md px-4 text-sm", hotkey: "text-xs px-1.5", icon: "text-sm" },
12572
- lg: { button: "h-button-lg px-5 text-base", hotkey: "text-xs px-2", icon: "text-base" }
12573
- };
12574
- variantStyles8 = {
12575
- primary: "bg-primary text-primary-foreground hover:bg-primary-hover border-primary",
12576
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary-hover border-border",
12577
- danger: "bg-error text-error-foreground hover:bg-error/90 border-error"
12578
- };
12579
- DEFAULT_ASSET_URL9 = {
12580
- url: "https://almadar-kflow-assets.web.app/shared/effects/particles/slash_01.png",
12581
- role: "ui",
12582
- category: "action"
12583
- };
12584
- ActionButton.displayName = "ActionButton";
12585
- }
12586
- });
12587
- function MiniMap({
12588
- tiles = DEFAULT_TILES,
12589
- units = DEFAULT_UNITS,
12590
- width = 150,
12591
- height = 150,
12592
- mapWidth = 100,
12593
- mapHeight = 100,
12594
- viewportRect = DEFAULT_VIEWPORT,
12595
- className,
12596
- tileAssets,
12597
- unitAssets
12598
- }) {
12599
- const canvasRef = React97.useRef(null);
12600
- const imgCacheRef = React97.useRef(/* @__PURE__ */ new Map());
12601
- function loadImg(url) {
12602
- const cached = imgCacheRef.current.get(url);
12603
- if (cached) return cached.complete ? cached : null;
12604
- const img = new Image();
12605
- img.src = url;
12606
- img.onload = () => {
12607
- const canvas = canvasRef.current;
12608
- if (!canvas) return;
12609
- const ctx = canvas.getContext("2d");
12610
- if (ctx) ctx.clearRect(0, 0, 0, 0);
12611
- };
12612
- imgCacheRef.current.set(url, img);
12613
- return null;
12614
- }
12615
- React97.useEffect(() => {
12616
- const canvas = canvasRef.current;
12617
- if (!canvas) return;
12618
- const ctx = canvas.getContext("2d");
12619
- if (!ctx) return;
12620
- const scaleX2 = width / mapWidth;
12621
- const scaleY2 = height / mapHeight;
12622
- ctx.clearRect(0, 0, width, height);
12623
- ctx.fillStyle = "#111";
12624
- ctx.fillRect(0, 0, width, height);
12625
- for (const tile of tiles) {
12626
- const tileAsset = tileAssets?.[tile.color] ?? tileAssets?.["default"];
12627
- const tileImg = tileAsset ? loadImg(tileAsset.url) : null;
12628
- const tx = Math.floor(tile.x * scaleX2);
12629
- const ty = Math.floor(tile.y * scaleY2);
12630
- const tw = Math.max(1, Math.ceil(scaleX2));
12631
- const th = Math.max(1, Math.ceil(scaleY2));
12632
- if (tileImg) {
12633
- ctx.drawImage(tileImg, tx, ty, tw, th);
12634
- } else {
12635
- ctx.fillStyle = tile.color;
12636
- ctx.fillRect(tx, ty, tw, th);
12637
- }
12638
- }
12639
- for (const unit of units) {
12640
- if (unit.isPlayer) continue;
12641
- const unitAsset = unitAssets?.[unit.color] ?? unitAssets?.["default"];
12642
- const unitImg = unitAsset ? loadImg(unitAsset.url) : null;
12643
- const ux = Math.floor(unit.x * scaleX2) - 1;
12644
- const uy = Math.floor(unit.y * scaleY2) - 1;
12645
- if (unitImg) {
12646
- ctx.drawImage(unitImg, ux, uy, 5, 5);
12647
- } else {
12648
- ctx.fillStyle = unit.color;
12649
- ctx.fillRect(ux, uy, 3, 3);
12650
- }
12651
- }
12652
- if (viewportRect) {
12653
- ctx.strokeStyle = "#ffffff";
12654
- ctx.lineWidth = 1;
12655
- ctx.strokeRect(
12656
- Math.floor(viewportRect.x * scaleX2),
12657
- Math.floor(viewportRect.y * scaleY2),
12658
- Math.floor(viewportRect.w * scaleX2),
12659
- Math.floor(viewportRect.h * scaleY2)
12660
- );
12661
- }
12662
- }, [tiles, units, width, height, mapWidth, mapHeight, viewportRect, tileAssets, unitAssets]);
12663
- const scaleX = width / mapWidth;
12664
- const scaleY = height / mapHeight;
12665
- const playerUnit = units.find((u) => u.isPlayer);
12666
- const playerLeft = playerUnit ? Math.floor(playerUnit.x * scaleX) - 1 : null;
12667
- const playerTop = playerUnit ? Math.floor(playerUnit.y * scaleY) - 1 : null;
12668
- return /* @__PURE__ */ jsxs(Fragment, { children: [
12669
- /* @__PURE__ */ jsx("style", { children: `@keyframes minimap-blink{0%,49%{opacity:1}50%,100%{opacity:0}}` }),
12670
- /* @__PURE__ */ jsxs(
12671
- Box,
12672
- {
12673
- position: "relative",
12674
- display: "inline-block",
12675
- className: cn(
12676
- "border border-border/20 rounded-container",
12677
- className
12678
- ),
12679
- children: [
12680
- /* @__PURE__ */ jsx(
12681
- "canvas",
12682
- {
12683
- ref: canvasRef,
12684
- width,
12685
- height,
12686
- className: "block",
12687
- style: { width, height }
12688
- }
12689
- ),
12690
- playerLeft !== null && playerTop !== null && /* @__PURE__ */ jsx(
12691
- Box,
12692
- {
12693
- position: "absolute",
12694
- style: {
12695
- left: playerLeft,
12696
- top: playerTop,
12697
- width: 3,
12698
- height: 3,
12699
- backgroundColor: "#ffffff",
12700
- animation: "minimap-blink 1s steps(2, end) infinite",
12701
- pointerEvents: "none"
12702
- }
12703
- }
12704
- )
12705
- ]
12706
- }
12707
- )
12708
- ] });
12709
- }
12710
- var DEFAULT_TILES, DEFAULT_UNITS, DEFAULT_VIEWPORT;
12711
- var init_MiniMap = __esm({
12712
- "components/game/atoms/MiniMap.tsx"() {
12713
- "use client";
12714
- init_cn();
12715
- init_Box();
12716
- DEFAULT_TILES = [
12717
- { x: 10, y: 10, color: "#4ade80" },
12718
- { x: 20, y: 15, color: "#4ade80" },
12719
- { x: 30, y: 25, color: "#22c55e" },
12720
- { x: 50, y: 40, color: "#4ade80" },
12721
- { x: 60, y: 55, color: "#16a34a" },
12722
- { x: 40, y: 60, color: "#4ade80" },
12723
- { x: 70, y: 30, color: "#22c55e" },
12724
- { x: 80, y: 70, color: "#4ade80" }
12725
- ];
12726
- DEFAULT_UNITS = [
12727
- { x: 30, y: 30, color: "#60a5fa", isPlayer: true }
12728
- ];
12729
- DEFAULT_VIEWPORT = { x: 20, y: 20, w: 40, h: 40 };
12730
- MiniMap.displayName = "MiniMap";
12731
- }
12732
- });
12733
11707
  function ControlGrid({
12734
11708
  kind,
12735
11709
  buttons = DEFAULT_BUTTONS,
@@ -12747,8 +11721,8 @@ function ControlGrid({
12747
11721
  className
12748
11722
  }) {
12749
11723
  const eventBus = useEventBus();
12750
- const [active, setActive] = React97.useState(/* @__PURE__ */ new Set());
12751
- const handlePress = React97.useCallback(
11724
+ const [active, setActive] = React90.useState(/* @__PURE__ */ new Set());
11725
+ const handlePress = React90.useCallback(
12752
11726
  (id) => {
12753
11727
  setActive((prev) => new Set(prev).add(id));
12754
11728
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -12762,7 +11736,7 @@ function ControlGrid({
12762
11736
  },
12763
11737
  [kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
12764
11738
  );
12765
- const handleRelease = React97.useCallback(
11739
+ const handleRelease = React90.useCallback(
12766
11740
  (id) => {
12767
11741
  setActive((prev) => {
12768
11742
  const next = new Set(prev);
@@ -12947,7 +11921,7 @@ function StatBadge({
12947
11921
  {
12948
11922
  className: cn(
12949
11923
  "inline-flex items-center gap-2 rounded-container border backdrop-blur-sm",
12950
- sizeMap14[size] ?? sizeMap14.md,
11924
+ sizeMap6[size] ?? sizeMap6.md,
12951
11925
  variantMap2[variant] ?? variantMap2.default,
12952
11926
  className
12953
11927
  ),
@@ -12984,7 +11958,7 @@ function StatBadge({
12984
11958
  }
12985
11959
  );
12986
11960
  }
12987
- var sizeMap14, variantMap2;
11961
+ var sizeMap6, variantMap2;
12988
11962
  var init_StatBadge = __esm({
12989
11963
  "components/game/molecules/StatBadge.tsx"() {
12990
11964
  init_cn();
@@ -12994,7 +11968,7 @@ var init_StatBadge = __esm({
12994
11968
  init_GameIcon();
12995
11969
  init_HealthBar();
12996
11970
  init_ScoreDisplay();
12997
- sizeMap14 = {
11971
+ sizeMap6 = {
12998
11972
  sm: "text-xs px-2 py-1",
12999
11973
  md: "text-sm px-3 py-1.5",
13000
11974
  lg: "text-base px-4 py-2"
@@ -13009,129 +11983,6 @@ var init_StatBadge = __esm({
13009
11983
  StatBadge.displayName = "StatBadge";
13010
11984
  }
13011
11985
  });
13012
- function InventoryGrid({
13013
- items = DEFAULT_GRID_ITEMS,
13014
- columns = 4,
13015
- totalSlots = 12,
13016
- selectedId = "",
13017
- onSelect,
13018
- selectEvent,
13019
- size = "md",
13020
- className
13021
- }) {
13022
- const eventBus = useEventBus();
13023
- const slotCount = totalSlots ?? items.length;
13024
- const emptySlotCount = Math.max(0, slotCount - items.length);
13025
- const handleSelect = React97.useCallback(
13026
- (id) => {
13027
- onSelect?.(id);
13028
- if (selectEvent) {
13029
- eventBus.emit(`UI:${selectEvent}`, { id });
13030
- }
13031
- },
13032
- [onSelect, selectEvent, eventBus]
13033
- );
13034
- const gridClass = columnMap[columns] ?? `grid-cols-${columns}`;
13035
- return /* @__PURE__ */ jsxs(
13036
- Box,
13037
- {
13038
- className: cn("grid gap-2", gridClass, className),
13039
- children: [
13040
- items.map((item) => /* @__PURE__ */ jsx(
13041
- ItemSlot,
13042
- {
13043
- icon: item.icon,
13044
- assetUrl: item.assetUrl,
13045
- label: item.label,
13046
- quantity: item.quantity,
13047
- rarity: item.rarity,
13048
- size,
13049
- selected: selectedId === item.id,
13050
- onClick: () => handleSelect(item.id)
13051
- },
13052
- item.id
13053
- )),
13054
- Array.from({ length: emptySlotCount }).map((_, index) => /* @__PURE__ */ jsx(
13055
- ItemSlot,
13056
- {
13057
- empty: true,
13058
- size
13059
- },
13060
- `empty-${index}`
13061
- ))
13062
- ]
13063
- }
13064
- );
13065
- }
13066
- var columnMap, DEFAULT_GRID_ITEMS;
13067
- var init_InventoryGrid = __esm({
13068
- "components/game/molecules/InventoryGrid.tsx"() {
13069
- "use client";
13070
- init_cn();
13071
- init_useEventBus();
13072
- init_ItemSlot();
13073
- init_Box();
13074
- columnMap = {
13075
- 2: "grid-cols-2",
13076
- 3: "grid-cols-3",
13077
- 4: "grid-cols-4",
13078
- 5: "grid-cols-5",
13079
- 6: "grid-cols-6",
13080
- 7: "grid-cols-7",
13081
- 8: "grid-cols-8"
13082
- };
13083
- DEFAULT_GRID_ITEMS = [
13084
- { id: "grid-1", icon: "sword", label: "Iron Sword", quantity: 1, rarity: "common" },
13085
- { id: "grid-2", icon: "flask-conical", label: "Health Potion", quantity: 3, rarity: "uncommon" },
13086
- { id: "grid-3", icon: "shield", label: "Wooden Shield", quantity: 1, rarity: "common" },
13087
- { id: "grid-4", icon: "gem", label: "Ruby Gem", quantity: 2, rarity: "rare" }
13088
- ];
13089
- InventoryGrid.displayName = "InventoryGrid";
13090
- }
13091
- });
13092
- function ResourceBar({
13093
- resources = DEFAULT_RESOURCES,
13094
- size = "md",
13095
- className
13096
- }) {
13097
- return /* @__PURE__ */ jsx(
13098
- Box,
13099
- {
13100
- className: cn(
13101
- "flex items-center gap-2 flex-wrap",
13102
- className
13103
- ),
13104
- children: resources.map((resource, i) => /* @__PURE__ */ jsx(
13105
- StatBadge,
13106
- {
13107
- label: resource.label,
13108
- value: resource.value,
13109
- max: resource.max,
13110
- format: resource.max != null ? "bar" : "number",
13111
- icon: resource.icon,
13112
- assetUrl: resource.assetUrl,
13113
- size
13114
- },
13115
- i
13116
- ))
13117
- }
13118
- );
13119
- }
13120
- var DEFAULT_RESOURCES;
13121
- var init_ResourceBar = __esm({
13122
- "components/game/molecules/ResourceBar.tsx"() {
13123
- "use client";
13124
- init_cn();
13125
- init_StatBadge();
13126
- init_Box();
13127
- DEFAULT_RESOURCES = [
13128
- { icon: "coins", label: "Gold", value: 320 },
13129
- { icon: "zap", label: "Energy", value: 7, max: 10 },
13130
- { icon: "gem", label: "Crystals", value: 15 }
13131
- ];
13132
- ResourceBar.displayName = "ResourceBar";
13133
- }
13134
- });
13135
11986
  function convertElementsToStats(elements) {
13136
11987
  return elements.map((el) => {
13137
11988
  const [source, field] = el.bind?.split(".") ?? [];
@@ -13239,7 +12090,7 @@ function GameMenu({
13239
12090
  }) {
13240
12091
  const resolvedOptions = options ?? menuItems ?? DEFAULT_MENU_OPTIONS;
13241
12092
  const eventBus = useEventBus();
13242
- const handleOptionClick = React97.useCallback(
12093
+ const handleOptionClick = React90.useCallback(
13243
12094
  (option) => {
13244
12095
  if (option.event) {
13245
12096
  eventBus.emit(`UI:${option.event}`, { option });
@@ -13465,7 +12316,7 @@ function StateGraph({
13465
12316
  }) {
13466
12317
  const eventBus = useEventBus();
13467
12318
  const nodes = states ?? [];
13468
- const positions = React97.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
12319
+ const positions = React90.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
13469
12320
  return /* @__PURE__ */ jsxs(
13470
12321
  Box,
13471
12322
  {
@@ -13524,6 +12375,152 @@ var init_StateGraph = __esm({
13524
12375
  init_TransitionArrow();
13525
12376
  }
13526
12377
  });
12378
+ function MiniMap({
12379
+ tiles = DEFAULT_TILES,
12380
+ units = DEFAULT_UNITS,
12381
+ width = 150,
12382
+ height = 150,
12383
+ mapWidth = 100,
12384
+ mapHeight = 100,
12385
+ viewportRect = DEFAULT_VIEWPORT,
12386
+ className,
12387
+ tileAssets,
12388
+ unitAssets
12389
+ }) {
12390
+ const canvasRef = React90.useRef(null);
12391
+ const imgCacheRef = React90.useRef(/* @__PURE__ */ new Map());
12392
+ function loadImg(url) {
12393
+ const cached = imgCacheRef.current.get(url);
12394
+ if (cached) return cached.complete ? cached : null;
12395
+ const img = new Image();
12396
+ img.src = url;
12397
+ img.onload = () => {
12398
+ const canvas = canvasRef.current;
12399
+ if (!canvas) return;
12400
+ const ctx = canvas.getContext("2d");
12401
+ if (ctx) ctx.clearRect(0, 0, 0, 0);
12402
+ };
12403
+ imgCacheRef.current.set(url, img);
12404
+ return null;
12405
+ }
12406
+ React90.useEffect(() => {
12407
+ const canvas = canvasRef.current;
12408
+ if (!canvas) return;
12409
+ const ctx = canvas.getContext("2d");
12410
+ if (!ctx) return;
12411
+ const scaleX2 = width / mapWidth;
12412
+ const scaleY2 = height / mapHeight;
12413
+ ctx.clearRect(0, 0, width, height);
12414
+ ctx.fillStyle = "#111";
12415
+ ctx.fillRect(0, 0, width, height);
12416
+ for (const tile of tiles) {
12417
+ const tileAsset = tileAssets?.[tile.color] ?? tileAssets?.["default"];
12418
+ const tileImg = tileAsset ? loadImg(tileAsset.url) : null;
12419
+ const tx = Math.floor(tile.x * scaleX2);
12420
+ const ty = Math.floor(tile.y * scaleY2);
12421
+ const tw = Math.max(1, Math.ceil(scaleX2));
12422
+ const th = Math.max(1, Math.ceil(scaleY2));
12423
+ if (tileImg) {
12424
+ ctx.drawImage(tileImg, tx, ty, tw, th);
12425
+ } else {
12426
+ ctx.fillStyle = tile.color;
12427
+ ctx.fillRect(tx, ty, tw, th);
12428
+ }
12429
+ }
12430
+ for (const unit of units) {
12431
+ if (unit.isPlayer) continue;
12432
+ const unitAsset = unitAssets?.[unit.color] ?? unitAssets?.["default"];
12433
+ const unitImg = unitAsset ? loadImg(unitAsset.url) : null;
12434
+ const ux = Math.floor(unit.x * scaleX2) - 1;
12435
+ const uy = Math.floor(unit.y * scaleY2) - 1;
12436
+ if (unitImg) {
12437
+ ctx.drawImage(unitImg, ux, uy, 5, 5);
12438
+ } else {
12439
+ ctx.fillStyle = unit.color;
12440
+ ctx.fillRect(ux, uy, 3, 3);
12441
+ }
12442
+ }
12443
+ if (viewportRect) {
12444
+ ctx.strokeStyle = "#ffffff";
12445
+ ctx.lineWidth = 1;
12446
+ ctx.strokeRect(
12447
+ Math.floor(viewportRect.x * scaleX2),
12448
+ Math.floor(viewportRect.y * scaleY2),
12449
+ Math.floor(viewportRect.w * scaleX2),
12450
+ Math.floor(viewportRect.h * scaleY2)
12451
+ );
12452
+ }
12453
+ }, [tiles, units, width, height, mapWidth, mapHeight, viewportRect, tileAssets, unitAssets]);
12454
+ const scaleX = width / mapWidth;
12455
+ const scaleY = height / mapHeight;
12456
+ const playerUnit = units.find((u) => u.isPlayer);
12457
+ const playerLeft = playerUnit ? Math.floor(playerUnit.x * scaleX) - 1 : null;
12458
+ const playerTop = playerUnit ? Math.floor(playerUnit.y * scaleY) - 1 : null;
12459
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
12460
+ /* @__PURE__ */ jsx("style", { children: `@keyframes minimap-blink{0%,49%{opacity:1}50%,100%{opacity:0}}` }),
12461
+ /* @__PURE__ */ jsxs(
12462
+ Box,
12463
+ {
12464
+ position: "relative",
12465
+ display: "inline-block",
12466
+ className: cn(
12467
+ "border border-border/20 rounded-container",
12468
+ className
12469
+ ),
12470
+ children: [
12471
+ /* @__PURE__ */ jsx(
12472
+ "canvas",
12473
+ {
12474
+ ref: canvasRef,
12475
+ width,
12476
+ height,
12477
+ className: "block",
12478
+ style: { width, height }
12479
+ }
12480
+ ),
12481
+ playerLeft !== null && playerTop !== null && /* @__PURE__ */ jsx(
12482
+ Box,
12483
+ {
12484
+ position: "absolute",
12485
+ style: {
12486
+ left: playerLeft,
12487
+ top: playerTop,
12488
+ width: 3,
12489
+ height: 3,
12490
+ backgroundColor: "#ffffff",
12491
+ animation: "minimap-blink 1s steps(2, end) infinite",
12492
+ pointerEvents: "none"
12493
+ }
12494
+ }
12495
+ )
12496
+ ]
12497
+ }
12498
+ )
12499
+ ] });
12500
+ }
12501
+ var DEFAULT_TILES, DEFAULT_UNITS, DEFAULT_VIEWPORT;
12502
+ var init_MiniMap = __esm({
12503
+ "components/game/atoms/MiniMap.tsx"() {
12504
+ "use client";
12505
+ init_cn();
12506
+ init_Box();
12507
+ DEFAULT_TILES = [
12508
+ { x: 10, y: 10, color: "#4ade80" },
12509
+ { x: 20, y: 15, color: "#4ade80" },
12510
+ { x: 30, y: 25, color: "#22c55e" },
12511
+ { x: 50, y: 40, color: "#4ade80" },
12512
+ { x: 60, y: 55, color: "#16a34a" },
12513
+ { x: 40, y: 60, color: "#4ade80" },
12514
+ { x: 70, y: 30, color: "#22c55e" },
12515
+ { x: 80, y: 70, color: "#4ade80" }
12516
+ ];
12517
+ DEFAULT_UNITS = [
12518
+ { x: 30, y: 30, color: "#60a5fa", isPlayer: true }
12519
+ ];
12520
+ DEFAULT_VIEWPORT = { x: 20, y: 20, w: 40, h: 40 };
12521
+ MiniMap.displayName = "MiniMap";
12522
+ }
12523
+ });
13527
12524
  function useCamera() {
13528
12525
  const cameraRef = useRef({ x: 0, y: 0, zoom: 1 });
13529
12526
  const targetCameraRef = useRef(null);
@@ -13633,7 +12630,7 @@ function useCamera() {
13633
12630
  };
13634
12631
  }
13635
12632
  var init_useCamera = __esm({
13636
- "components/game/hooks/useCamera.ts"() {
12633
+ "hooks/useCamera.ts"() {
13637
12634
  "use client";
13638
12635
  }
13639
12636
  });
@@ -14619,7 +13616,7 @@ function Canvas({
14619
13616
  keyMap,
14620
13617
  keyUpMap
14621
13618
  };
14622
- return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(GameCanvas3D, { ...props3d }) });
13619
+ return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(Canvas3DHost, { ...props3d }) });
14623
13620
  }
14624
13621
  return /* @__PURE__ */ jsx(
14625
13622
  Canvas2D,
@@ -14643,35 +13640,17 @@ function Canvas({
14643
13640
  }
14644
13641
  );
14645
13642
  }
14646
- var GameCanvas3D;
13643
+ var Canvas3DHost;
14647
13644
  var init_Canvas = __esm({
14648
13645
  "components/game/molecules/Canvas.tsx"() {
14649
13646
  "use client";
14650
13647
  init_Canvas2D();
14651
- GameCanvas3D = lazy(
14652
- () => import('@almadar/ui/components/molecules/game/three').then((m) => ({ default: m.GameCanvas3D }))
13648
+ Canvas3DHost = lazy(
13649
+ () => import('@almadar/ui/components/molecules/game/three').then((m) => ({ default: m.Canvas3DHost }))
14653
13650
  );
14654
13651
  Canvas.displayName = "Canvas";
14655
13652
  }
14656
13653
  });
14657
- var init_useGameAudio = __esm({
14658
- "components/game/hooks/useGameAudio.ts"() {
14659
- "use client";
14660
- }
14661
- });
14662
- function useGameAudioContextOptional() {
14663
- return useContext(GameAudioContext);
14664
- }
14665
- var GameAudioContext;
14666
- var init_GameAudioProvider = __esm({
14667
- "components/game/providers/GameAudioProvider.tsx"() {
14668
- "use client";
14669
- init_useEventBus();
14670
- init_useGameAudio();
14671
- GameAudioContext = createContext(null);
14672
- GameAudioContext.displayName = "GameAudioContext";
14673
- }
14674
- });
14675
13654
  function GameAudioToggle({
14676
13655
  size = "sm",
14677
13656
  className,
@@ -14703,11 +13682,80 @@ var init_GameAudioToggle = __esm({
14703
13682
  "use client";
14704
13683
  init_atoms();
14705
13684
  init_cn();
14706
- init_GameAudioProvider();
14707
13685
  init_GameIcon();
14708
13686
  GameAudioToggle.displayName = "GameAudioToggle";
14709
13687
  }
14710
13688
  });
13689
+ function isKnownState(s) {
13690
+ return s in DEFAULT_STATE_STYLES;
13691
+ }
13692
+ function StateIndicator({
13693
+ assetUrl = DEFAULT_ASSET_URL,
13694
+ state = "idle",
13695
+ label,
13696
+ size = "md",
13697
+ animated = true,
13698
+ stateStyles,
13699
+ className
13700
+ }) {
13701
+ const mergedStyles = stateStyles ? { ...DEFAULT_STATE_STYLES, ...stateStyles } : DEFAULT_STATE_STYLES;
13702
+ const knownState = isKnownState(state) ? state : null;
13703
+ const config = knownState !== null ? mergedStyles[knownState] ?? DEFAULT_STYLE : DEFAULT_STYLE;
13704
+ const displayLabel = label ?? state.charAt(0).toUpperCase() + state.slice(1);
13705
+ return /* @__PURE__ */ jsxs(
13706
+ Box,
13707
+ {
13708
+ display: "inline-flex",
13709
+ className: cn(
13710
+ "items-center gap-1 rounded-full text-foreground font-medium",
13711
+ config.bgClass,
13712
+ SIZE_CLASSES[size],
13713
+ animated && (knownState === null || !STATIC_STATES.has(knownState)) && "animate-pulse",
13714
+ className
13715
+ ),
13716
+ children: [
13717
+ /* @__PURE__ */ jsx(Box, { as: "span", children: assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 16, alt: displayLabel, className: "flex-shrink-0" }) : typeof config.icon === "string" ? /^[a-zA-Z0-9-]+$/.test(config.icon) ? /* @__PURE__ */ jsx(Icon, { name: config.icon }) : config.icon : /* @__PURE__ */ jsx(Icon, { icon: config.icon }) }),
13718
+ /* @__PURE__ */ jsx(Box, { as: "span", children: displayLabel })
13719
+ ]
13720
+ }
13721
+ );
13722
+ }
13723
+ var DEFAULT_ASSET_URL, DEFAULT_STATE_STYLES, DEFAULT_STYLE, STATIC_STATES, SIZE_CLASSES;
13724
+ var init_StateIndicator = __esm({
13725
+ "components/game/atoms/StateIndicator.tsx"() {
13726
+ init_Box();
13727
+ init_Icon();
13728
+ init_cn();
13729
+ init_GameIcon();
13730
+ DEFAULT_ASSET_URL = {
13731
+ url: "https://almadar-kflow-assets.web.app/shared/isometric-dungeon/Isometric/chestClosed_E.png",
13732
+ role: "ui",
13733
+ category: "state"
13734
+ };
13735
+ DEFAULT_STATE_STYLES = {
13736
+ idle: { icon: "\u23F8", bgClass: "bg-muted" },
13737
+ active: { icon: "\u25B6", bgClass: "bg-success" },
13738
+ sleeping: { icon: "\u{1F4A4}", bgClass: "bg-muted" },
13739
+ moving: { icon: "\u{1F6B6}", bgClass: "bg-info" },
13740
+ eating: { icon: "\u{1F37D}\uFE0F", bgClass: "bg-success" },
13741
+ waiting: { icon: "\u23F3", bgClass: "bg-warning" },
13742
+ happy: { icon: "\u{1F60A}", bgClass: "bg-success" },
13743
+ scared: { icon: "\u{1F628}", bgClass: "bg-error" },
13744
+ done: { icon: "\u2713", bgClass: "bg-success" },
13745
+ error: { icon: "\u2717", bgClass: "bg-error" },
13746
+ ready: { icon: "\u2713", bgClass: "bg-success" },
13747
+ cooldown: { icon: "\u{1F504}", bgClass: "bg-warning" }
13748
+ };
13749
+ DEFAULT_STYLE = { icon: "?", bgClass: "bg-muted" };
13750
+ STATIC_STATES = /* @__PURE__ */ new Set(["idle", "done"]);
13751
+ SIZE_CLASSES = {
13752
+ sm: "text-xs px-1.5 py-0.5",
13753
+ md: "text-sm px-2 py-1",
13754
+ lg: "text-base px-3 py-1.5"
13755
+ };
13756
+ StateIndicator.displayName = "StateIndicator";
13757
+ }
13758
+ });
14711
13759
  function LinearView({
14712
13760
  trait,
14713
13761
  size = "md",
@@ -14719,7 +13767,7 @@ function LinearView({
14719
13767
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
14720
13768
  const isDone = i < currentIdx;
14721
13769
  const isCurrent = i === currentIdx;
14722
- return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
13770
+ return /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
14723
13771
  i > 0 && /* @__PURE__ */ jsx(
14724
13772
  Typography,
14725
13773
  {
@@ -15254,7 +14302,7 @@ function SequenceBar({
15254
14302
  else onSlotRemove?.(index);
15255
14303
  }, [emit, slotRemoveEvent, onSlotRemove, playing]);
15256
14304
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
15257
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
14305
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
15258
14306
  i > 0 && /* @__PURE__ */ jsx(
15259
14307
  Typography,
15260
14308
  {
@@ -15292,254 +14340,10 @@ var init_SequenceBar = __esm({
15292
14340
  SequenceBar.displayName = "SequenceBar";
15293
14341
  }
15294
14342
  });
15295
- function RuleEditor({
15296
- rule,
15297
- availableEvents,
15298
- availableActions,
15299
- onChange,
15300
- onRemove,
15301
- disabled = false,
15302
- className
15303
- }) {
15304
- const { t } = useTranslate();
15305
- const handleWhenChange = useCallback((v) => {
15306
- onChange({ ...rule, whenEvent: v });
15307
- }, [rule, onChange]);
15308
- const handleThenChange = useCallback((v) => {
15309
- onChange({ ...rule, thenAction: v });
15310
- }, [rule, onChange]);
15311
- return /* @__PURE__ */ jsxs(HStack, { className: cn("items-center p-2 rounded-lg bg-muted/50 border border-border", className), gap: "sm", children: [
15312
- /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-primary font-bold whitespace-nowrap", children: t("eventHandler.when") }),
15313
- /* @__PURE__ */ jsx(
15314
- Select,
15315
- {
15316
- value: rule.whenEvent,
15317
- onValueChange: handleWhenChange,
15318
- options: availableEvents,
15319
- disabled,
15320
- className: "flex-1 min-w-0"
15321
- }
15322
- ),
15323
- /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-accent font-bold whitespace-nowrap", children: "\u2192 " + t("eventHandler.then") }),
15324
- /* @__PURE__ */ jsx(
15325
- Select,
15326
- {
15327
- value: rule.thenAction,
15328
- onValueChange: handleThenChange,
15329
- options: availableActions,
15330
- disabled,
15331
- className: "flex-1 min-w-0"
15332
- }
15333
- ),
15334
- onRemove && /* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: onRemove, disabled, className: "shrink-0", children: "\xD7" })
15335
- ] });
15336
- }
15337
- var init_RuleEditor = __esm({
15338
- "components/game/molecules/RuleEditor.tsx"() {
15339
- init_atoms();
15340
- init_cn();
15341
- RuleEditor.displayName = "RuleEditor";
15342
- }
15343
- });
15344
- function EventLog({
15345
- entries,
15346
- maxHeight = 200,
15347
- label,
15348
- className
15349
- }) {
15350
- const { t } = useTranslate();
15351
- const scrollRef = useRef(null);
15352
- useEffect(() => {
15353
- if (scrollRef.current) {
15354
- scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
15355
- }
15356
- }, [entries.length]);
15357
- return /* @__PURE__ */ jsxs(VStack, { className: cn("p-3 rounded-lg bg-card border border-border", className), gap: "sm", children: [
15358
- /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-muted-foreground font-medium", children: label ?? t("eventHandler.eventLog") }),
15359
- /* @__PURE__ */ jsx(
15360
- Box,
15361
- {
15362
- ref: scrollRef,
15363
- className: "overflow-y-auto",
15364
- style: { maxHeight },
15365
- children: /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
15366
- entries.length === 0 && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground italic", children: t("eventHandler.noEvents") }),
15367
- entries.map((entry) => /* @__PURE__ */ jsxs(HStack, { className: "items-start", gap: "xs", children: [
15368
- /* @__PURE__ */ jsx(Typography, { variant: "caption", className: STATUS_STYLES[entry.status], children: STATUS_DOTS[entry.status] }),
15369
- /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-foreground", children: entry.icon }),
15370
- /* @__PURE__ */ jsx(Typography, { variant: "caption", className: cn("flex-1", STATUS_STYLES[entry.status]), children: entry.message })
15371
- ] }, entry.id))
15372
- ] })
15373
- }
15374
- )
15375
- ] });
15376
- }
15377
- var STATUS_STYLES, STATUS_DOTS;
15378
- var init_EventLog = __esm({
15379
- "components/game/molecules/EventLog.tsx"() {
15380
- init_atoms();
15381
- init_cn();
15382
- STATUS_STYLES = {
15383
- pending: "text-muted-foreground",
15384
- active: "text-primary animate-pulse",
15385
- done: "text-success",
15386
- error: "text-error"
15387
- };
15388
- STATUS_DOTS = {
15389
- pending: "\u25CB",
15390
- active: "\u25CF",
15391
- done: "\u2714",
15392
- error: "\u2717"
15393
- };
15394
- EventLog.displayName = "EventLog";
15395
- }
15396
- });
15397
14343
 
15398
- // components/game/lib/puzzleObject.ts
15399
- function objId(o) {
15400
- return o.id == null ? "" : String(o.id);
15401
- }
15402
- function objName(o) {
15403
- return o.name == null ? "" : String(o.name);
15404
- }
15405
- function objIcon(o) {
15406
- return o.icon == null ? "" : String(o.icon);
15407
- }
15408
- function objStates(o) {
15409
- return Array.isArray(o.states) ? o.states : [];
15410
- }
15411
- function objCurrentState(o) {
15412
- return o.currentState == null ? "" : String(o.currentState);
15413
- }
15414
- function objAvailableEvents(o) {
15415
- return Array.isArray(o.availableEvents) ? o.availableEvents : [];
15416
- }
15417
- function objAvailableActions(o) {
15418
- return Array.isArray(o.availableActions) ? o.availableActions : [];
15419
- }
15420
- function objRules(o) {
15421
- return Array.isArray(o.rules) ? o.rules : [];
15422
- }
15423
- function objMaxRules(o) {
15424
- const n = Number(o.maxRules);
15425
- return Number.isFinite(n) && n > 0 ? n : 3;
15426
- }
14344
+ // lib/puzzleObject.ts
15427
14345
  var init_puzzleObject = __esm({
15428
- "components/game/lib/puzzleObject.ts"() {
15429
- }
15430
- });
15431
- function ObjectRulePanel({
15432
- object,
15433
- onRulesChange,
15434
- rulesChangeEvent,
15435
- disabled = false,
15436
- className
15437
- }) {
15438
- const { t } = useTranslate();
15439
- const { emit } = useEventBus();
15440
- const id = objId(object);
15441
- const name = objName(object);
15442
- const icon = objIcon(object);
15443
- const states = objStates(object);
15444
- const currentState = objCurrentState(object);
15445
- const availableEvents = objAvailableEvents(object);
15446
- const availableActions = objAvailableActions(object);
15447
- const rules = objRules(object);
15448
- const maxRules = objMaxRules(object);
15449
- const canAdd = rules.length < maxRules;
15450
- const emitRules = useCallback((newRules) => {
15451
- if (rulesChangeEvent) emit(`UI:${rulesChangeEvent}`, { objectId: id, rules: newRules });
15452
- else onRulesChange?.(id, newRules);
15453
- }, [rulesChangeEvent, emit, id, onRulesChange]);
15454
- const handleRuleChange = useCallback((index, updatedRule) => {
15455
- const newRules = [...rules];
15456
- newRules[index] = updatedRule;
15457
- emitRules(newRules);
15458
- }, [rules, emitRules]);
15459
- const handleRuleRemove = useCallback((index) => {
15460
- const newRules = rules.filter((_, i) => i !== index);
15461
- emitRules(newRules);
15462
- }, [rules, emitRules]);
15463
- const handleAddRule = useCallback(() => {
15464
- if (!canAdd || disabled) return;
15465
- const firstEvent = availableEvents[0]?.value || "";
15466
- const firstAction = availableActions[0]?.value || "";
15467
- const newRule = {
15468
- id: `rule-${nextRuleId++}`,
15469
- whenEvent: firstEvent,
15470
- thenAction: firstAction
15471
- };
15472
- emitRules([...rules, newRule]);
15473
- }, [canAdd, disabled, rules, availableEvents, availableActions, emitRules]);
15474
- const machine = {
15475
- name,
15476
- states,
15477
- currentState,
15478
- transitions: rules.map((r2) => ({
15479
- from: currentState,
15480
- to: states.find((s) => s !== currentState) || currentState,
15481
- event: r2.whenEvent
15482
- }))
15483
- };
15484
- return /* @__PURE__ */ jsxs(VStack, { className: cn("p-4 rounded-lg bg-card border border-border", className), gap: "sm", children: [
15485
- /* @__PURE__ */ jsxs(HStack, { className: "items-center", gap: "sm", children: [
15486
- /* @__PURE__ */ jsx(Typography, { variant: "h5", children: icon }),
15487
- /* @__PURE__ */ jsxs(VStack, { gap: "none", children: [
15488
- /* @__PURE__ */ jsx(Typography, { variant: "body1", className: "text-foreground font-bold", children: name }),
15489
- /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground", children: t("eventHandler.state") + ": " + currentState })
15490
- ] })
15491
- ] }),
15492
- /* @__PURE__ */ jsx(TraitStateViewer, { trait: machine, variant: "compact", size: "sm" }),
15493
- /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
15494
- /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-muted-foreground font-medium", children: t("eventHandler.rules", { count: rules.length, max: maxRules }) + ":" }),
15495
- rules.map((rule, i) => /* @__PURE__ */ jsx(
15496
- RuleEditor,
15497
- {
15498
- rule,
15499
- availableEvents,
15500
- availableActions,
15501
- onChange: (r2) => handleRuleChange(i, r2),
15502
- onRemove: () => handleRuleRemove(i),
15503
- disabled
15504
- },
15505
- rule.id
15506
- )),
15507
- canAdd && !disabled && /* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: handleAddRule, className: "self-start", children: t("eventHandler.addRule") })
15508
- ] })
15509
- ] });
15510
- }
15511
- var nextRuleId;
15512
- var init_ObjectRulePanel = __esm({
15513
- "components/game/molecules/ObjectRulePanel.tsx"() {
15514
- init_atoms();
15515
- init_cn();
15516
- init_useEventBus();
15517
- init_TraitStateViewer();
15518
- init_RuleEditor();
15519
- init_puzzleObject();
15520
- nextRuleId = 1;
15521
- ObjectRulePanel.displayName = "ObjectRulePanel";
15522
- }
15523
- });
15524
- function VariablePanel({
15525
- entityName,
15526
- variables,
15527
- className
15528
- }) {
15529
- const { t } = useTranslate();
15530
- return /* @__PURE__ */ jsxs(VStack, { className: cn("p-3 rounded-lg bg-card border border-border", className), gap: "sm", children: [
15531
- /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-muted-foreground font-medium", children: t("stateArchitect.variables", { name: entityName }) }),
15532
- (variables ?? []).map((v) => /* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between", children: [
15533
- /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-foreground font-medium", children: v.name }),
15534
- /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-accent font-mono", children: v.value })
15535
- ] }, v.name))
15536
- ] });
15537
- }
15538
- var init_VariablePanel = __esm({
15539
- "components/game/molecules/VariablePanel.tsx"() {
15540
- init_atoms();
15541
- init_cn();
15542
- VariablePanel.displayName = "VariablePanel";
14346
+ "lib/puzzleObject.ts"() {
15543
14347
  }
15544
14348
  });
15545
14349
  function StateJsonView({
@@ -15580,125 +14384,6 @@ var init_StateJsonView = __esm({
15580
14384
  StateJsonView.displayName = "StateJsonView";
15581
14385
  }
15582
14386
  });
15583
- var GameTemplate;
15584
- var init_GameTemplate = __esm({
15585
- "components/game/templates/GameTemplate.tsx"() {
15586
- init_cn();
15587
- init_Box();
15588
- init_Stack();
15589
- init_Typography();
15590
- init_Button();
15591
- GameTemplate = ({
15592
- entity,
15593
- title = "Game",
15594
- children,
15595
- hud,
15596
- debugPanel,
15597
- showDebugPanel = false,
15598
- controls,
15599
- className,
15600
- backgroundAsset
15601
- }) => {
15602
- return /* @__PURE__ */ jsxs(
15603
- Box,
15604
- {
15605
- display: "flex",
15606
- fullHeight: true,
15607
- className: cn("flex-col lg:flex-row", className),
15608
- children: [
15609
- /* @__PURE__ */ jsxs(Box, { display: "flex", className: "flex-1 flex-col", children: [
15610
- /* @__PURE__ */ jsxs(
15611
- Box,
15612
- {
15613
- padding: "md",
15614
- border: true,
15615
- className: "border-b-2 border-x-0 border-t-0 border-border flex items-center justify-between",
15616
- children: [
15617
- /* @__PURE__ */ jsx(Typography, { variant: "h4", children: title }),
15618
- controls && /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
15619
- controls.isPlaying ? /* @__PURE__ */ jsx(
15620
- Button,
15621
- {
15622
- variant: "secondary",
15623
- size: "sm",
15624
- icon: "pause",
15625
- onClick: controls.onPause,
15626
- children: "Pause"
15627
- }
15628
- ) : /* @__PURE__ */ jsx(
15629
- Button,
15630
- {
15631
- variant: "primary",
15632
- size: "sm",
15633
- icon: "play",
15634
- onClick: controls.onPlay,
15635
- children: "Play"
15636
- }
15637
- ),
15638
- /* @__PURE__ */ jsx(
15639
- Button,
15640
- {
15641
- variant: "ghost",
15642
- size: "sm",
15643
- icon: "rotate-ccw",
15644
- onClick: controls.onReset,
15645
- children: "Reset"
15646
- }
15647
- )
15648
- ] })
15649
- ]
15650
- }
15651
- ),
15652
- /* @__PURE__ */ jsxs(
15653
- Box,
15654
- {
15655
- position: "relative",
15656
- fullWidth: true,
15657
- className: backgroundAsset ? "flex-1" : "flex-1 bg-muted",
15658
- style: backgroundAsset ? { backgroundImage: `url(${backgroundAsset.url})`, backgroundSize: "cover", backgroundPosition: "center" } : void 0,
15659
- children: [
15660
- children,
15661
- hud && /* @__PURE__ */ jsx(
15662
- Box,
15663
- {
15664
- position: "absolute",
15665
- className: "top-0 left-0 right-0 pointer-events-none",
15666
- children: /* @__PURE__ */ jsx(Box, { padding: "md", className: "pointer-events-auto w-fit", children: hud })
15667
- }
15668
- )
15669
- ]
15670
- }
15671
- )
15672
- ] }),
15673
- showDebugPanel && debugPanel && /* @__PURE__ */ jsxs(
15674
- Box,
15675
- {
15676
- bg: "surface",
15677
- border: true,
15678
- shadow: "sm",
15679
- overflow: "auto",
15680
- className: "w-full lg:w-80 lg:border-l-2 lg:border-t-0 border-t-2 border-border",
15681
- children: [
15682
- /* @__PURE__ */ jsx(
15683
- Box,
15684
- {
15685
- padding: "md",
15686
- border: true,
15687
- className: "border-b-2 border-x-0 border-t-0 border-border",
15688
- children: /* @__PURE__ */ jsx(Typography, { variant: "h6", children: "Debug Panel" })
15689
- }
15690
- ),
15691
- /* @__PURE__ */ jsx(Box, { padding: "md", children: debugPanel })
15692
- ]
15693
- }
15694
- )
15695
- ]
15696
- }
15697
- );
15698
- };
15699
- GameTemplate.displayName = "GameTemplate";
15700
- }
15701
- });
15702
14387
  var FONT_BASE, GAME_FONTS, FONT_FACES, GameShell;
15703
14388
  var init_GameShell = __esm({
15704
14389
  "components/game/templates/GameShell.tsx"() {
@@ -15869,11 +14554,9 @@ var init_GameShell = __esm({
15869
14554
  GameShell.displayName = "GameShell";
15870
14555
  }
15871
14556
  });
15872
-
15873
- // components/game/molecules/index.ts
15874
14557
  var init_molecules = __esm({
15875
14558
  "components/game/molecules/index.ts"() {
15876
- init_lib();
14559
+ init_gameShared();
15877
14560
  init_puzzleObject();
15878
14561
  }
15879
14562
  });
@@ -16273,7 +14956,7 @@ var init_ErrorBoundary = __esm({
16273
14956
  }
16274
14957
  );
16275
14958
  };
16276
- ErrorBoundary = class extends React97__default.Component {
14959
+ ErrorBoundary = class extends React90__default.Component {
16277
14960
  constructor(props) {
16278
14961
  super(props);
16279
14962
  __publicField(this, "reset", () => {
@@ -16555,7 +15238,7 @@ var init_Container = __esm({
16555
15238
  as: Component = "div"
16556
15239
  }) => {
16557
15240
  const resolvedSize = maxWidth ?? size ?? "lg";
16558
- return React97__default.createElement(
15241
+ return React90__default.createElement(
16559
15242
  Component,
16560
15243
  {
16561
15244
  className: cn(
@@ -18553,7 +17236,7 @@ var init_CodeBlock = __esm({
18553
17236
  DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
18554
17237
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
18555
17238
  HIDDEN_LINE_NUMBERS = { display: "none" };
18556
- CodeBlock = React97__default.memo(
17239
+ CodeBlock = React90__default.memo(
18557
17240
  ({
18558
17241
  code: rawCode,
18559
17242
  language = "text",
@@ -19140,7 +17823,7 @@ var init_MarkdownContent = __esm({
19140
17823
  init_Box();
19141
17824
  init_CodeBlock();
19142
17825
  init_cn();
19143
- MarkdownContent = React97__default.memo(
17826
+ MarkdownContent = React90__default.memo(
19144
17827
  ({ content, direction = "ltr", className }) => {
19145
17828
  const { t: _t } = useTranslate();
19146
17829
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -20467,7 +19150,7 @@ var init_StateMachineView = __esm({
20467
19150
  style: { top: title ? 30 : 0 },
20468
19151
  children: [
20469
19152
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
20470
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React97__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
19153
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React90__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
20471
19154
  StateNode2,
20472
19155
  {
20473
19156
  state,
@@ -21898,14 +20581,14 @@ function SpacerPattern({ size = "flex" }) {
21898
20581
  if (size === "flex") {
21899
20582
  return /* @__PURE__ */ jsx(Spacer, {});
21900
20583
  }
21901
- const sizeMap16 = {
20584
+ const sizeMap8 = {
21902
20585
  xs: "0.25rem",
21903
20586
  sm: "0.5rem",
21904
20587
  md: "1rem",
21905
20588
  lg: "1.5rem",
21906
20589
  xl: "2rem"
21907
20590
  };
21908
- return /* @__PURE__ */ jsx(Box, { style: { width: sizeMap16[size], height: sizeMap16[size], flexShrink: 0 } });
20591
+ return /* @__PURE__ */ jsx(Box, { style: { width: sizeMap8[size], height: sizeMap8[size], flexShrink: 0 } });
21909
20592
  }
21910
20593
  function DividerPattern({
21911
20594
  orientation = "horizontal",
@@ -26105,8 +24788,8 @@ var init_Menu = __esm({
26105
24788
  "bottom-end": "bottom-start"
26106
24789
  };
26107
24790
  const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
26108
- const triggerChild = React97__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
26109
- const triggerElement = React97__default.cloneElement(
24791
+ const triggerChild = React90__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
24792
+ const triggerElement = React90__default.cloneElement(
26110
24793
  triggerChild,
26111
24794
  {
26112
24795
  ref: triggerRef,
@@ -26201,14 +24884,14 @@ function useDataDnd(args) {
26201
24884
  const isZone = Boolean(dragGroup || accepts || sortable);
26202
24885
  const enabled = isZone || Boolean(dndRoot);
26203
24886
  const eventBus = useEventBus();
26204
- const parentRoot = React97__default.useContext(RootCtx);
24887
+ const parentRoot = React90__default.useContext(RootCtx);
26205
24888
  const isRoot = enabled && parentRoot === null;
26206
- const zoneId = React97__default.useId();
24889
+ const zoneId = React90__default.useId();
26207
24890
  const ownGroup = dragGroup ?? accepts ?? zoneId;
26208
- const [optimisticOrders, setOptimisticOrders] = React97__default.useState(() => /* @__PURE__ */ new Map());
26209
- const optimisticOrdersRef = React97__default.useRef(optimisticOrders);
24891
+ const [optimisticOrders, setOptimisticOrders] = React90__default.useState(() => /* @__PURE__ */ new Map());
24892
+ const optimisticOrdersRef = React90__default.useRef(optimisticOrders);
26210
24893
  optimisticOrdersRef.current = optimisticOrders;
26211
- const clearOptimisticOrder = React97__default.useCallback((group) => {
24894
+ const clearOptimisticOrder = React90__default.useCallback((group) => {
26212
24895
  setOptimisticOrders((prev) => {
26213
24896
  if (!prev.has(group)) return prev;
26214
24897
  const next = new Map(prev);
@@ -26233,7 +24916,7 @@ function useDataDnd(args) {
26233
24916
  const raw = it[dndItemIdField];
26234
24917
  return raw != null ? String(raw) : `__idx_${idx}`;
26235
24918
  }).join("|");
26236
- const itemIds = React97__default.useMemo(
24919
+ const itemIds = React90__default.useMemo(
26237
24920
  () => orderedItems.map((it, idx) => {
26238
24921
  const raw = it[dndItemIdField];
26239
24922
  return raw != null ? String(raw) : `__idx_${idx}`;
@@ -26244,7 +24927,7 @@ function useDataDnd(args) {
26244
24927
  const raw = it[dndItemIdField];
26245
24928
  return raw != null ? String(raw) : `__${idx}`;
26246
24929
  }).join("|");
26247
- React97__default.useEffect(() => {
24930
+ React90__default.useEffect(() => {
26248
24931
  const root = isRoot ? null : parentRoot;
26249
24932
  if (root) {
26250
24933
  root.clearOptimisticOrder(ownGroup);
@@ -26252,20 +24935,20 @@ function useDataDnd(args) {
26252
24935
  clearOptimisticOrder(ownGroup);
26253
24936
  }
26254
24937
  }, [itemsContentSig, ownGroup]);
26255
- const zonesRef = React97__default.useRef(/* @__PURE__ */ new Map());
26256
- const registerZone = React97__default.useCallback((zoneId2, meta2) => {
24938
+ const zonesRef = React90__default.useRef(/* @__PURE__ */ new Map());
24939
+ const registerZone = React90__default.useCallback((zoneId2, meta2) => {
26257
24940
  zonesRef.current.set(zoneId2, meta2);
26258
24941
  }, []);
26259
- const unregisterZone = React97__default.useCallback((zoneId2) => {
24942
+ const unregisterZone = React90__default.useCallback((zoneId2) => {
26260
24943
  zonesRef.current.delete(zoneId2);
26261
24944
  }, []);
26262
- const [activeDrag, setActiveDrag] = React97__default.useState(null);
26263
- const [overZoneGroup, setOverZoneGroup] = React97__default.useState(null);
26264
- const meta = React97__default.useMemo(
24945
+ const [activeDrag, setActiveDrag] = React90__default.useState(null);
24946
+ const [overZoneGroup, setOverZoneGroup] = React90__default.useState(null);
24947
+ const meta = React90__default.useMemo(
26265
24948
  () => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
26266
24949
  [ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
26267
24950
  );
26268
- React97__default.useEffect(() => {
24951
+ React90__default.useEffect(() => {
26269
24952
  const target = isRoot ? null : parentRoot;
26270
24953
  if (!target) {
26271
24954
  zonesRef.current.set(zoneId, meta);
@@ -26284,7 +24967,7 @@ function useDataDnd(args) {
26284
24967
  }, [parentRoot, isRoot, zoneId, meta]);
26285
24968
  const sensors = useAlmadarDndSensors(true);
26286
24969
  const collisionDetection = almadarDndCollisionDetection;
26287
- const findZoneByItem = React97__default.useCallback(
24970
+ const findZoneByItem = React90__default.useCallback(
26288
24971
  (id) => {
26289
24972
  for (const z of zonesRef.current.values()) {
26290
24973
  if (z.itemIds.includes(id)) return z;
@@ -26293,7 +24976,7 @@ function useDataDnd(args) {
26293
24976
  },
26294
24977
  []
26295
24978
  );
26296
- React97__default.useCallback(
24979
+ React90__default.useCallback(
26297
24980
  (group) => {
26298
24981
  for (const z of zonesRef.current.values()) {
26299
24982
  if (z.group === group) return z;
@@ -26302,7 +24985,7 @@ function useDataDnd(args) {
26302
24985
  },
26303
24986
  []
26304
24987
  );
26305
- const handleDragEnd = React97__default.useCallback(
24988
+ const handleDragEnd = React90__default.useCallback(
26306
24989
  (event) => {
26307
24990
  const { active, over } = event;
26308
24991
  const activeIdStr = String(active.id);
@@ -26393,8 +25076,8 @@ function useDataDnd(args) {
26393
25076
  },
26394
25077
  [eventBus]
26395
25078
  );
26396
- const sortableData = React97__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
26397
- const SortableItem = React97__default.useCallback(
25079
+ const sortableData = React90__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
25080
+ const SortableItem = React90__default.useCallback(
26398
25081
  ({ id, children }) => {
26399
25082
  const {
26400
25083
  attributes,
@@ -26434,7 +25117,7 @@ function useDataDnd(args) {
26434
25117
  id: droppableId,
26435
25118
  data: sortableData
26436
25119
  });
26437
- const ctx = React97__default.useContext(RootCtx);
25120
+ const ctx = React90__default.useContext(RootCtx);
26438
25121
  const activeDrag2 = ctx?.activeDrag ?? null;
26439
25122
  const overZoneGroup2 = ctx?.overZoneGroup ?? null;
26440
25123
  const isThisZoneOver = overZoneGroup2 === ownGroup;
@@ -26449,7 +25132,7 @@ function useDataDnd(args) {
26449
25132
  showForeignPlaceholder,
26450
25133
  ctxAvailable: ctx != null
26451
25134
  });
26452
- React97__default.useEffect(() => {
25135
+ React90__default.useEffect(() => {
26453
25136
  dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
26454
25137
  }, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
26455
25138
  return /* @__PURE__ */ jsx(
@@ -26463,11 +25146,11 @@ function useDataDnd(args) {
26463
25146
  }
26464
25147
  );
26465
25148
  };
26466
- const rootContextValue = React97__default.useMemo(
25149
+ const rootContextValue = React90__default.useMemo(
26467
25150
  () => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
26468
25151
  [registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
26469
25152
  );
26470
- const handleDragStart = React97__default.useCallback((event) => {
25153
+ const handleDragStart = React90__default.useCallback((event) => {
26471
25154
  const sourceZone = findZoneByItem(event.active.id);
26472
25155
  const rect = event.active.rect.current.initial;
26473
25156
  const height = rect?.height && rect.height > 0 ? rect.height : 64;
@@ -26486,7 +25169,7 @@ function useDataDnd(args) {
26486
25169
  isRoot
26487
25170
  });
26488
25171
  }, [findZoneByItem, isRoot, zoneId]);
26489
- const handleDragOver = React97__default.useCallback((event) => {
25172
+ const handleDragOver = React90__default.useCallback((event) => {
26490
25173
  const { active, over } = event;
26491
25174
  const overData = over?.data?.current;
26492
25175
  const overGroup = overData?.dndGroup ?? null;
@@ -26556,7 +25239,7 @@ function useDataDnd(args) {
26556
25239
  return next;
26557
25240
  });
26558
25241
  }, []);
26559
- const handleDragCancel = React97__default.useCallback((event) => {
25242
+ const handleDragCancel = React90__default.useCallback((event) => {
26560
25243
  setActiveDrag(null);
26561
25244
  setOverZoneGroup(null);
26562
25245
  dndLog.warn("dragCancel", {
@@ -26564,12 +25247,12 @@ function useDataDnd(args) {
26564
25247
  reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
26565
25248
  });
26566
25249
  }, []);
26567
- const handleDragEndWithCleanup = React97__default.useCallback((event) => {
25250
+ const handleDragEndWithCleanup = React90__default.useCallback((event) => {
26568
25251
  handleDragEnd(event);
26569
25252
  setActiveDrag(null);
26570
25253
  setOverZoneGroup(null);
26571
25254
  }, [handleDragEnd]);
26572
- const wrapContainer = React97__default.useCallback(
25255
+ const wrapContainer = React90__default.useCallback(
26573
25256
  (children) => {
26574
25257
  if (!enabled) return children;
26575
25258
  const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
@@ -26623,7 +25306,7 @@ var init_useDataDnd = __esm({
26623
25306
  init_useAlmadarDndCollision();
26624
25307
  init_Box();
26625
25308
  dndLog = createLogger("almadar:ui:dnd");
26626
- RootCtx = React97__default.createContext(null);
25309
+ RootCtx = React90__default.createContext(null);
26627
25310
  }
26628
25311
  });
26629
25312
  function renderIconInput(icon, props) {
@@ -27149,7 +25832,7 @@ function DataList({
27149
25832
  }) {
27150
25833
  const eventBus = useEventBus();
27151
25834
  const { t } = useTranslate();
27152
- const [visibleCount, setVisibleCount] = React97__default.useState(pageSize || Infinity);
25835
+ const [visibleCount, setVisibleCount] = React90__default.useState(pageSize || Infinity);
27153
25836
  const fieldDefs = fields ?? columns ?? [];
27154
25837
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
27155
25838
  const dnd = useDataDnd({
@@ -27168,7 +25851,7 @@ function DataList({
27168
25851
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
27169
25852
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
27170
25853
  const hasRenderProp = typeof children === "function";
27171
- React97__default.useEffect(() => {
25854
+ React90__default.useEffect(() => {
27172
25855
  const renderItemTypeOf = typeof schemaRenderItem;
27173
25856
  const childrenTypeOf = typeof children;
27174
25857
  if (data.length > 0 && !hasRenderProp) {
@@ -27272,7 +25955,7 @@ function DataList({
27272
25955
  const items2 = [...data];
27273
25956
  const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
27274
25957
  const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
27275
- return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
25958
+ return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
27276
25959
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
27277
25960
  group.items.map((itemData, index) => {
27278
25961
  const id = itemData.id || `${gi}-${index}`;
@@ -27413,7 +26096,7 @@ function DataList({
27413
26096
  className
27414
26097
  ),
27415
26098
  children: [
27416
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
26099
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
27417
26100
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
27418
26101
  group.items.map(
27419
26102
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -27498,7 +26181,7 @@ var init_FormSection = __esm({
27498
26181
  columns = 1,
27499
26182
  className
27500
26183
  }) => {
27501
- const [collapsed, setCollapsed] = React97__default.useState(defaultCollapsed);
26184
+ const [collapsed, setCollapsed] = React90__default.useState(defaultCollapsed);
27502
26185
  const { t } = useTranslate();
27503
26186
  const eventBus = useEventBus();
27504
26187
  const gridClass = {
@@ -27506,7 +26189,7 @@ var init_FormSection = __esm({
27506
26189
  2: "grid-cols-1 md:grid-cols-2",
27507
26190
  3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
27508
26191
  }[columns];
27509
- React97__default.useCallback(() => {
26192
+ React90__default.useCallback(() => {
27510
26193
  if (collapsible) {
27511
26194
  setCollapsed((prev) => !prev);
27512
26195
  eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
@@ -28456,7 +27139,7 @@ var init_Flex = __esm({
28456
27139
  flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
28457
27140
  }
28458
27141
  }
28459
- return React97__default.createElement(Component, {
27142
+ return React90__default.createElement(Component, {
28460
27143
  className: cn(
28461
27144
  inline ? "inline-flex" : "flex",
28462
27145
  directionStyles[direction],
@@ -28575,7 +27258,7 @@ var init_Grid = __esm({
28575
27258
  as: Component = "div"
28576
27259
  }) => {
28577
27260
  const mergedStyle = rows ? { gridTemplateRows: `repeat(${rows}, minmax(0, 1fr))`, ...style } : style;
28578
- return React97__default.createElement(
27261
+ return React90__default.createElement(
28579
27262
  Component,
28580
27263
  {
28581
27264
  className: cn(
@@ -28771,9 +27454,9 @@ var init_Popover = __esm({
28771
27454
  onMouseLeave: handleClose,
28772
27455
  onPointerDown: tapTriggerProps.onPointerDown
28773
27456
  };
28774
- const childElement = React97__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
27457
+ const childElement = React90__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
28775
27458
  const childPointerDown = childElement.props.onPointerDown;
28776
- const triggerElement = React97__default.cloneElement(
27459
+ const triggerElement = React90__default.cloneElement(
28777
27460
  childElement,
28778
27461
  {
28779
27462
  ref: triggerRef,
@@ -29375,9 +28058,9 @@ var init_Tooltip = __esm({
29375
28058
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
29376
28059
  };
29377
28060
  }, []);
29378
- const triggerElement = React97__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
28061
+ const triggerElement = React90__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
29379
28062
  const childPointerDown = triggerElement.props.onPointerDown;
29380
- const trigger = React97__default.cloneElement(triggerElement, {
28063
+ const trigger = React90__default.cloneElement(triggerElement, {
29381
28064
  ref: triggerRef,
29382
28065
  onMouseEnter: handleMouseEnter,
29383
28066
  onMouseLeave: handleMouseLeave,
@@ -29467,7 +28150,7 @@ var init_WizardProgress = __esm({
29467
28150
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
29468
28151
  const isActive = index === currentStep;
29469
28152
  const isCompleted = index < currentStep;
29470
- return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
28153
+ return /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
29471
28154
  /* @__PURE__ */ jsx(
29472
28155
  "button",
29473
28156
  {
@@ -30370,13 +29053,13 @@ var init_LineChart = __esm({
30370
29053
  LineChart2.displayName = "LineChart";
30371
29054
  }
30372
29055
  });
30373
- var sizeMap15, stateColors, ProgressDots;
29056
+ var sizeMap7, stateColors, ProgressDots;
30374
29057
  var init_ProgressDots = __esm({
30375
29058
  "components/core/molecules/ProgressDots.tsx"() {
30376
29059
  "use client";
30377
29060
  init_cn();
30378
29061
  init_atoms();
30379
- sizeMap15 = {
29062
+ sizeMap7 = {
30380
29063
  sm: { dot: 6, active: 8 },
30381
29064
  md: { dot: 8, active: 10 },
30382
29065
  lg: { dot: 10, active: 14 }
@@ -30402,7 +29085,7 @@ var init_ProgressDots = __esm({
30402
29085
  [currentIndex]
30403
29086
  );
30404
29087
  const resolveState = getState2 ?? defaultGetState;
30405
- const dims = sizeMap15[size];
29088
+ const dims = sizeMap7[size];
30406
29089
  return /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", className: cn(className), children: Array.from({ length: count }, (_, index) => {
30407
29090
  const state = resolveState(index);
30408
29091
  const isActive = state === "active";
@@ -31028,13 +29711,13 @@ var init_MapView = __esm({
31028
29711
  shadowSize: [41, 41]
31029
29712
  });
31030
29713
  L.Marker.prototype.options.icon = defaultIcon;
31031
- const { useEffect: useEffect65, useRef: useRef62, useCallback: useCallback97, useState: useState96 } = React97__default;
29714
+ const { useEffect: useEffect62, useRef: useRef60, useCallback: useCallback92, useState: useState95 } = React90__default;
31032
29715
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
31033
29716
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
31034
29717
  function MapUpdater({ centerLat, centerLng, zoom }) {
31035
29718
  const map = useMap();
31036
- const prevRef = useRef62({ centerLat, centerLng, zoom });
31037
- useEffect65(() => {
29719
+ const prevRef = useRef60({ centerLat, centerLng, zoom });
29720
+ useEffect62(() => {
31038
29721
  const prev = prevRef.current;
31039
29722
  if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
31040
29723
  map.setView([centerLat, centerLng], zoom);
@@ -31045,7 +29728,7 @@ var init_MapView = __esm({
31045
29728
  }
31046
29729
  function MapClickHandler({ onMapClick }) {
31047
29730
  const map = useMap();
31048
- useEffect65(() => {
29731
+ useEffect62(() => {
31049
29732
  if (!onMapClick) return;
31050
29733
  const handler = (e) => {
31051
29734
  onMapClick(e.latlng.lat, e.latlng.lng);
@@ -31073,8 +29756,8 @@ var init_MapView = __esm({
31073
29756
  showAttribution = true
31074
29757
  }) {
31075
29758
  const eventBus = useEventBus2();
31076
- const [clickedPosition, setClickedPosition] = useState96(null);
31077
- const handleMapClick = useCallback97((lat, lng) => {
29759
+ const [clickedPosition, setClickedPosition] = useState95(null);
29760
+ const handleMapClick = useCallback92((lat, lng) => {
31078
29761
  if (showClickedPin) {
31079
29762
  setClickedPosition({ lat, lng });
31080
29763
  }
@@ -31083,7 +29766,7 @@ var init_MapView = __esm({
31083
29766
  eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
31084
29767
  }
31085
29768
  }, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
31086
- const handleMarkerClick = useCallback97((marker) => {
29769
+ const handleMarkerClick = useCallback92((marker) => {
31087
29770
  onMarkerClick?.(marker);
31088
29771
  if (markerClickEvent) {
31089
29772
  eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
@@ -31943,8 +30626,8 @@ function TableView({
31943
30626
  }) {
31944
30627
  const eventBus = useEventBus();
31945
30628
  const { t } = useTranslate();
31946
- const [visibleCount, setVisibleCount] = React97__default.useState(pageSize > 0 ? pageSize : Infinity);
31947
- const [localSelected, setLocalSelected] = React97__default.useState(/* @__PURE__ */ new Set());
30629
+ const [visibleCount, setVisibleCount] = React90__default.useState(pageSize > 0 ? pageSize : Infinity);
30630
+ const [localSelected, setLocalSelected] = React90__default.useState(/* @__PURE__ */ new Set());
31948
30631
  const colDefs = columns ?? fields ?? [];
31949
30632
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
31950
30633
  const dnd = useDataDnd({
@@ -32139,12 +30822,12 @@ function TableView({
32139
30822
  ]
32140
30823
  }
32141
30824
  );
32142
- return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React97__default.Fragment, { children: rowInner }, id);
30825
+ return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React90__default.Fragment, { children: rowInner }, id);
32143
30826
  };
32144
30827
  const items = Array.from(data);
32145
30828
  const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
32146
30829
  let runningIndex = 0;
32147
- const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
30830
+ const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
32148
30831
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
32149
30832
  group.items.map((row) => renderRow(row, runningIndex++))
32150
30833
  ] }, gi)) });
@@ -33501,7 +32184,7 @@ var init_StepFlow = __esm({
33501
32184
  className
33502
32185
  }) => {
33503
32186
  if (orientation === "vertical") {
33504
- return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React97__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
32187
+ return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React90__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
33505
32188
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
33506
32189
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
33507
32190
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -33512,7 +32195,7 @@ var init_StepFlow = __esm({
33512
32195
  ] })
33513
32196
  ] }) }, index)) });
33514
32197
  }
33515
- 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(React97__default.Fragment, { children: [
32198
+ return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
33516
32199
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
33517
32200
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
33518
32201
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -34497,7 +33180,7 @@ var init_LikertScale = __esm({
34497
33180
  md: "text-base",
34498
33181
  lg: "text-lg"
34499
33182
  };
34500
- LikertScale = React97__default.forwardRef(
33183
+ LikertScale = React90__default.forwardRef(
34501
33184
  ({
34502
33185
  question,
34503
33186
  options = DEFAULT_LIKERT_OPTIONS,
@@ -34509,7 +33192,7 @@ var init_LikertScale = __esm({
34509
33192
  variant = "radios",
34510
33193
  className
34511
33194
  }, ref) => {
34512
- const groupId = React97__default.useId();
33195
+ const groupId = React90__default.useId();
34513
33196
  const eventBus = useEventBus();
34514
33197
  const handleSelect = useCallback(
34515
33198
  (next) => {
@@ -36791,7 +35474,7 @@ var init_DocBreadcrumb = __esm({
36791
35474
  "aria-label": t("aria.breadcrumb"),
36792
35475
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
36793
35476
  const isLast = idx === items.length - 1;
36794
- return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
35477
+ return /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
36795
35478
  idx > 0 && /* @__PURE__ */ jsx(
36796
35479
  Icon,
36797
35480
  {
@@ -37455,7 +36138,7 @@ var init_PageHeader = __esm({
37455
36138
  info: "bg-info/10 text-info"
37456
36139
  };
37457
36140
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
37458
- 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(React97__default.Fragment, { children: [
36141
+ breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
37459
36142
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
37460
36143
  crumb.href ? /* @__PURE__ */ jsx(
37461
36144
  "a",
@@ -37772,7 +36455,7 @@ var init_Navigation = __esm({
37772
36455
  Navigation.displayName = "Navigation";
37773
36456
  }
37774
36457
  });
37775
- var paddingStyles4, variantStyles9, Section;
36458
+ var paddingStyles4, variantStyles7, Section;
37776
36459
  var init_Section = __esm({
37777
36460
  "components/core/molecules/Section.tsx"() {
37778
36461
  init_cn();
@@ -37785,7 +36468,7 @@ var init_Section = __esm({
37785
36468
  lg: "p-6",
37786
36469
  xl: "p-8"
37787
36470
  };
37788
- variantStyles9 = {
36471
+ variantStyles7 = {
37789
36472
  default: "",
37790
36473
  card: [
37791
36474
  "bg-card",
@@ -37813,12 +36496,12 @@ var init_Section = __esm({
37813
36496
  as: Component = "section"
37814
36497
  }) => {
37815
36498
  const hasHeader = title || description || action;
37816
- return React97__default.createElement(
36499
+ return React90__default.createElement(
37817
36500
  Component,
37818
36501
  {
37819
36502
  className: cn(
37820
36503
  paddingStyles4[padding],
37821
- variantStyles9[variant],
36504
+ variantStyles7[variant],
37822
36505
  className
37823
36506
  )
37824
36507
  },
@@ -38187,7 +36870,7 @@ var init_WizardContainer = __esm({
38187
36870
  const isCompleted = index < currentStep;
38188
36871
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
38189
36872
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
38190
- return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
36873
+ return /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
38191
36874
  /* @__PURE__ */ jsx(
38192
36875
  Button,
38193
36876
  {
@@ -40620,7 +39303,7 @@ var init_DetailPanel = __esm({
40620
39303
  }
40621
39304
  });
40622
39305
  function extractTitle(children) {
40623
- if (!React97__default.isValidElement(children)) return void 0;
39306
+ if (!React90__default.isValidElement(children)) return void 0;
40624
39307
  const props = children.props;
40625
39308
  if (typeof props.title === "string") {
40626
39309
  return props.title;
@@ -40970,12 +39653,12 @@ var init_Form = __esm({
40970
39653
  const isSchemaEntity = isOrbitalEntitySchema(entity);
40971
39654
  const resolvedEntity = isSchemaEntity ? entity : void 0;
40972
39655
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
40973
- const normalizedInitialData = React97__default.useMemo(() => {
39656
+ const normalizedInitialData = React90__default.useMemo(() => {
40974
39657
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
40975
39658
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
40976
39659
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
40977
39660
  }, [entity, initialData]);
40978
- const entityDerivedFields = React97__default.useMemo(() => {
39661
+ const entityDerivedFields = React90__default.useMemo(() => {
40979
39662
  if (fields && fields.length > 0) return void 0;
40980
39663
  if (!resolvedEntity) return void 0;
40981
39664
  return resolvedEntity.fields.map(
@@ -40996,16 +39679,16 @@ var init_Form = __esm({
40996
39679
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
40997
39680
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
40998
39681
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
40999
- const [formData, setFormData] = React97__default.useState(
39682
+ const [formData, setFormData] = React90__default.useState(
41000
39683
  normalizedInitialData
41001
39684
  );
41002
- const [collapsedSections, setCollapsedSections] = React97__default.useState(
39685
+ const [collapsedSections, setCollapsedSections] = React90__default.useState(
41003
39686
  /* @__PURE__ */ new Set()
41004
39687
  );
41005
- const [submitError, setSubmitError] = React97__default.useState(null);
41006
- const formRef = React97__default.useRef(null);
39688
+ const [submitError, setSubmitError] = React90__default.useState(null);
39689
+ const formRef = React90__default.useRef(null);
41007
39690
  const formMode = props.mode;
41008
- const mountedRef = React97__default.useRef(false);
39691
+ const mountedRef = React90__default.useRef(false);
41009
39692
  if (!mountedRef.current) {
41010
39693
  mountedRef.current = true;
41011
39694
  debug("forms", "mount", {
@@ -41018,7 +39701,7 @@ var init_Form = __esm({
41018
39701
  });
41019
39702
  }
41020
39703
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
41021
- const evalContext = React97__default.useMemo(
39704
+ const evalContext = React90__default.useMemo(
41022
39705
  () => ({
41023
39706
  formValues: formData,
41024
39707
  globalVariables: externalContext?.globalVariables ?? {},
@@ -41027,7 +39710,7 @@ var init_Form = __esm({
41027
39710
  }),
41028
39711
  [formData, externalContext]
41029
39712
  );
41030
- React97__default.useEffect(() => {
39713
+ React90__default.useEffect(() => {
41031
39714
  debug("forms", "initialData-sync", {
41032
39715
  mode: formMode,
41033
39716
  normalizedInitialData,
@@ -41038,7 +39721,7 @@ var init_Form = __esm({
41038
39721
  setFormData(normalizedInitialData);
41039
39722
  }
41040
39723
  }, [normalizedInitialData]);
41041
- const processCalculations = React97__default.useCallback(
39724
+ const processCalculations = React90__default.useCallback(
41042
39725
  (changedFieldId, newFormData) => {
41043
39726
  if (!hiddenCalculations.length) return;
41044
39727
  const context = {
@@ -41063,7 +39746,7 @@ var init_Form = __esm({
41063
39746
  },
41064
39747
  [hiddenCalculations, externalContext, eventBus]
41065
39748
  );
41066
- const checkViolations = React97__default.useCallback(
39749
+ const checkViolations = React90__default.useCallback(
41067
39750
  (changedFieldId, newFormData) => {
41068
39751
  if (!violationTriggers.length) return;
41069
39752
  const context = {
@@ -41101,7 +39784,7 @@ var init_Form = __esm({
41101
39784
  processCalculations(name, newFormData);
41102
39785
  checkViolations(name, newFormData);
41103
39786
  };
41104
- const isFieldVisible = React97__default.useCallback(
39787
+ const isFieldVisible = React90__default.useCallback(
41105
39788
  (fieldName) => {
41106
39789
  const condition = conditionalFields[fieldName];
41107
39790
  if (!condition) return true;
@@ -41109,7 +39792,7 @@ var init_Form = __esm({
41109
39792
  },
41110
39793
  [conditionalFields, evalContext]
41111
39794
  );
41112
- const isSectionVisible = React97__default.useCallback(
39795
+ const isSectionVisible = React90__default.useCallback(
41113
39796
  (section) => {
41114
39797
  if (!section.condition) return true;
41115
39798
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -41185,7 +39868,7 @@ var init_Form = __esm({
41185
39868
  eventBus.emit(`UI:${onCancel}`);
41186
39869
  }
41187
39870
  };
41188
- const renderField = React97__default.useCallback(
39871
+ const renderField = React90__default.useCallback(
41189
39872
  (field) => {
41190
39873
  const fieldName = field.name || field.field;
41191
39874
  if (!fieldName) return null;
@@ -41206,7 +39889,7 @@ var init_Form = __esm({
41206
39889
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
41207
39890
  );
41208
39891
  const effectiveFields = entityDerivedFields ?? fields;
41209
- const normalizedFields = React97__default.useMemo(() => {
39892
+ const normalizedFields = React90__default.useMemo(() => {
41210
39893
  if (!effectiveFields || effectiveFields.length === 0) return [];
41211
39894
  return effectiveFields.map((field) => {
41212
39895
  if (typeof field === "string") {
@@ -41230,7 +39913,7 @@ var init_Form = __esm({
41230
39913
  return field;
41231
39914
  });
41232
39915
  }, [effectiveFields, resolvedEntity]);
41233
- const schemaFields = React97__default.useMemo(() => {
39916
+ const schemaFields = React90__default.useMemo(() => {
41234
39917
  if (normalizedFields.length === 0) return null;
41235
39918
  if (isDebugEnabled()) {
41236
39919
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -41240,7 +39923,7 @@ var init_Form = __esm({
41240
39923
  }
41241
39924
  return normalizedFields.map(renderField).filter(Boolean);
41242
39925
  }, [normalizedFields, renderField, entityName, conditionalFields]);
41243
- const sectionElements = React97__default.useMemo(() => {
39926
+ const sectionElements = React90__default.useMemo(() => {
41244
39927
  if (!sections || sections.length === 0) return null;
41245
39928
  return sections.map((section) => {
41246
39929
  if (!isSectionVisible(section)) {
@@ -41777,18 +40460,18 @@ function entityFieldsFromListItem(item) {
41777
40460
  function getStatusStyle(fieldName, value) {
41778
40461
  const val = String(value).toLowerCase();
41779
40462
  if (val.includes("complete") || val.includes("done"))
41780
- return STATUS_STYLES2.complete;
40463
+ return STATUS_STYLES.complete;
41781
40464
  if (val.includes("active") || val.includes("progress"))
41782
- return STATUS_STYLES2.active;
40465
+ return STATUS_STYLES.active;
41783
40466
  if (val.includes("pending") || val.includes("waiting"))
41784
- return STATUS_STYLES2.pending;
40467
+ return STATUS_STYLES.pending;
41785
40468
  if (val.includes("block") || val.includes("cancel"))
41786
- return STATUS_STYLES2.blocked;
41787
- if (val.includes("high") || val.includes("urgent")) return STATUS_STYLES2.high;
40469
+ return STATUS_STYLES.blocked;
40470
+ if (val.includes("high") || val.includes("urgent")) return STATUS_STYLES.high;
41788
40471
  if (val.includes("medium") || val.includes("normal"))
41789
- return STATUS_STYLES2.medium;
41790
- if (val.includes("low")) return STATUS_STYLES2.low;
41791
- return STATUS_STYLES2.default;
40472
+ return STATUS_STYLES.medium;
40473
+ if (val.includes("low")) return STATUS_STYLES.low;
40474
+ return STATUS_STYLES.default;
41792
40475
  }
41793
40476
  function formatValue3(value, fieldName) {
41794
40477
  if (typeof value === "number") {
@@ -41821,7 +40504,7 @@ function formatValue3(value, fieldName) {
41821
40504
  function formatFieldLabel2(fieldName) {
41822
40505
  return fieldName.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase()).replace(/Id$/, "").trim();
41823
40506
  }
41824
- var STATUS_STYLES2, StatusBadge, ProgressIndicator, List3;
40507
+ var STATUS_STYLES, StatusBadge, ProgressIndicator, List3;
41825
40508
  var init_List = __esm({
41826
40509
  "components/core/organisms/List.tsx"() {
41827
40510
  "use client";
@@ -41834,7 +40517,7 @@ var init_List = __esm({
41834
40517
  init_getNestedValue();
41835
40518
  init_useEventBus();
41836
40519
  init_types2();
41837
- STATUS_STYLES2 = {
40520
+ STATUS_STYLES = {
41838
40521
  complete: {
41839
40522
  bg: "bg-success/10",
41840
40523
  text: "text-success",
@@ -41965,7 +40648,7 @@ var init_List = __esm({
41965
40648
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
41966
40649
  return [];
41967
40650
  }, [entity]);
41968
- const getItemActions = React97__default.useCallback(
40651
+ const getItemActions = React90__default.useCallback(
41969
40652
  (item) => {
41970
40653
  if (!itemActions) return [];
41971
40654
  if (typeof itemActions === "function") {
@@ -42440,7 +41123,7 @@ var init_MediaGallery = __esm({
42440
41123
  [selectable, selectedItems, selectionEvent, eventBus]
42441
41124
  );
42442
41125
  const entityData = Array.isArray(entity) ? entity : [];
42443
- const items = React97__default.useMemo(() => {
41126
+ const items = React90__default.useMemo(() => {
42444
41127
  if (propItems) return propItems;
42445
41128
  if (entityData.length === 0) return [];
42446
41129
  return entityData.map((record, idx) => {
@@ -42603,7 +41286,7 @@ var init_MediaGallery = __esm({
42603
41286
  }
42604
41287
  });
42605
41288
  function extractTitle2(children) {
42606
- if (!React97__default.isValidElement(children)) return void 0;
41289
+ if (!React90__default.isValidElement(children)) return void 0;
42607
41290
  const props = children.props;
42608
41291
  if (typeof props.title === "string") {
42609
41292
  return props.title;
@@ -42877,7 +41560,7 @@ var init_debugRegistry = __esm({
42877
41560
  }
42878
41561
  });
42879
41562
  function useDebugData() {
42880
- const [data, setData] = React97.useState(() => ({
41563
+ const [data, setData] = React90.useState(() => ({
42881
41564
  traits: [],
42882
41565
  ticks: [],
42883
41566
  guards: [],
@@ -42891,7 +41574,7 @@ function useDebugData() {
42891
41574
  },
42892
41575
  lastUpdate: Date.now()
42893
41576
  }));
42894
- React97.useEffect(() => {
41577
+ React90.useEffect(() => {
42895
41578
  const updateData = () => {
42896
41579
  setData({
42897
41580
  traits: getAllTraits(),
@@ -43000,12 +41683,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
43000
41683
  return positions;
43001
41684
  }
43002
41685
  function WalkMinimap() {
43003
- const [walkStep, setWalkStep] = React97.useState(null);
43004
- const [traits2, setTraits] = React97.useState([]);
43005
- const [coveredEdges, setCoveredEdges] = React97.useState([]);
43006
- const [completedTraits, setCompletedTraits] = React97.useState(/* @__PURE__ */ new Set());
43007
- const prevTraitRef = React97.useRef(null);
43008
- React97.useEffect(() => {
41686
+ const [walkStep, setWalkStep] = React90.useState(null);
41687
+ const [traits2, setTraits] = React90.useState([]);
41688
+ const [coveredEdges, setCoveredEdges] = React90.useState([]);
41689
+ const [completedTraits, setCompletedTraits] = React90.useState(/* @__PURE__ */ new Set());
41690
+ const prevTraitRef = React90.useRef(null);
41691
+ React90.useEffect(() => {
43009
41692
  const interval = setInterval(() => {
43010
41693
  const w = window;
43011
41694
  const step = w.__orbitalWalkStep;
@@ -43441,15 +42124,15 @@ var init_EntitiesTab = __esm({
43441
42124
  });
43442
42125
  function EventFlowTab({ events: events2 }) {
43443
42126
  const { t } = useTranslate();
43444
- const [filter, setFilter] = React97.useState("all");
43445
- const containerRef = React97.useRef(null);
43446
- const [autoScroll, setAutoScroll] = React97.useState(true);
43447
- React97.useEffect(() => {
42127
+ const [filter, setFilter] = React90.useState("all");
42128
+ const containerRef = React90.useRef(null);
42129
+ const [autoScroll, setAutoScroll] = React90.useState(true);
42130
+ React90.useEffect(() => {
43448
42131
  if (autoScroll && containerRef.current) {
43449
42132
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
43450
42133
  }
43451
42134
  }, [events2.length, autoScroll]);
43452
- const filteredEvents = React97.useMemo(() => {
42135
+ const filteredEvents = React90.useMemo(() => {
43453
42136
  if (filter === "all") return events2;
43454
42137
  return events2.filter((e) => e.type === filter);
43455
42138
  }, [events2, filter]);
@@ -43565,7 +42248,7 @@ var init_EventFlowTab = __esm({
43565
42248
  });
43566
42249
  function GuardsPanel({ guards }) {
43567
42250
  const { t } = useTranslate();
43568
- const [filter, setFilter] = React97.useState("all");
42251
+ const [filter, setFilter] = React90.useState("all");
43569
42252
  if (guards.length === 0) {
43570
42253
  return /* @__PURE__ */ jsx(
43571
42254
  EmptyState,
@@ -43578,7 +42261,7 @@ function GuardsPanel({ guards }) {
43578
42261
  }
43579
42262
  const passedCount = guards.filter((g) => g.result).length;
43580
42263
  const failedCount = guards.length - passedCount;
43581
- const filteredGuards = React97.useMemo(() => {
42264
+ const filteredGuards = React90.useMemo(() => {
43582
42265
  if (filter === "all") return guards;
43583
42266
  if (filter === "passed") return guards.filter((g) => g.result);
43584
42267
  return guards.filter((g) => !g.result);
@@ -43741,10 +42424,10 @@ function EffectBadge({ effect }) {
43741
42424
  }
43742
42425
  function TransitionTimeline({ transitions }) {
43743
42426
  const { t } = useTranslate();
43744
- const containerRef = React97.useRef(null);
43745
- const [autoScroll, setAutoScroll] = React97.useState(true);
43746
- const [expandedId, setExpandedId] = React97.useState(null);
43747
- React97.useEffect(() => {
42427
+ const containerRef = React90.useRef(null);
42428
+ const [autoScroll, setAutoScroll] = React90.useState(true);
42429
+ const [expandedId, setExpandedId] = React90.useState(null);
42430
+ React90.useEffect(() => {
43748
42431
  if (autoScroll && containerRef.current) {
43749
42432
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
43750
42433
  }
@@ -44024,9 +42707,9 @@ function getAllEvents(traits2) {
44024
42707
  function EventDispatcherTab({ traits: traits2, schema }) {
44025
42708
  const eventBus = useEventBus();
44026
42709
  const { t } = useTranslate();
44027
- const [log12, setLog] = React97.useState([]);
44028
- const prevStatesRef = React97.useRef(/* @__PURE__ */ new Map());
44029
- React97.useEffect(() => {
42710
+ const [log12, setLog] = React90.useState([]);
42711
+ const prevStatesRef = React90.useRef(/* @__PURE__ */ new Map());
42712
+ React90.useEffect(() => {
44030
42713
  for (const trait of traits2) {
44031
42714
  const prev = prevStatesRef.current.get(trait.id);
44032
42715
  if (prev && prev !== trait.currentState) {
@@ -44195,10 +42878,10 @@ function VerifyModePanel({
44195
42878
  localCount
44196
42879
  }) {
44197
42880
  const { t } = useTranslate();
44198
- const [expanded, setExpanded] = React97.useState(true);
44199
- const scrollRef = React97.useRef(null);
44200
- const prevCountRef = React97.useRef(0);
44201
- React97.useEffect(() => {
42881
+ const [expanded, setExpanded] = React90.useState(true);
42882
+ const scrollRef = React90.useRef(null);
42883
+ const prevCountRef = React90.useRef(0);
42884
+ React90.useEffect(() => {
44202
42885
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
44203
42886
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
44204
42887
  }
@@ -44255,10 +42938,10 @@ function RuntimeDebugger({
44255
42938
  schema
44256
42939
  }) {
44257
42940
  const { t } = useTranslate();
44258
- const [isCollapsed, setIsCollapsed] = React97.useState(mode === "verify" ? true : defaultCollapsed);
44259
- const [isVisible, setIsVisible] = React97.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
42941
+ const [isCollapsed, setIsCollapsed] = React90.useState(mode === "verify" ? true : defaultCollapsed);
42942
+ const [isVisible, setIsVisible] = React90.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
44260
42943
  const debugData = useDebugData();
44261
- React97.useEffect(() => {
42944
+ React90.useEffect(() => {
44262
42945
  if (mode === "inline") return;
44263
42946
  return onDebugToggle((enabled) => {
44264
42947
  setIsVisible(enabled);
@@ -44267,7 +42950,7 @@ function RuntimeDebugger({
44267
42950
  }
44268
42951
  });
44269
42952
  }, [mode]);
44270
- React97.useEffect(() => {
42953
+ React90.useEffect(() => {
44271
42954
  if (mode === "inline") return;
44272
42955
  const handleKeyDown = (e) => {
44273
42956
  if (e.key === "`" && isVisible) {
@@ -44787,7 +43470,7 @@ var init_StatCard = __esm({
44787
43470
  const labelToUse = propLabel ?? propTitle;
44788
43471
  const eventBus = useEventBus();
44789
43472
  const { t } = useTranslate();
44790
- const handleActionClick = React97__default.useCallback(() => {
43473
+ const handleActionClick = React90__default.useCallback(() => {
44791
43474
  if (action?.event) {
44792
43475
  eventBus.emit(`UI:${action.event}`, {});
44793
43476
  }
@@ -44798,7 +43481,7 @@ var init_StatCard = __esm({
44798
43481
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
44799
43482
  const isLoading = externalLoading ?? false;
44800
43483
  const error = externalError;
44801
- const computeMetricValue = React97__default.useCallback(
43484
+ const computeMetricValue = React90__default.useCallback(
44802
43485
  (metric, items) => {
44803
43486
  if (metric.value !== void 0) {
44804
43487
  return metric.value;
@@ -44837,7 +43520,7 @@ var init_StatCard = __esm({
44837
43520
  },
44838
43521
  []
44839
43522
  );
44840
- const schemaStats = React97__default.useMemo(() => {
43523
+ const schemaStats = React90__default.useMemo(() => {
44841
43524
  if (!metrics || metrics.length === 0) return null;
44842
43525
  return metrics.map((metric) => ({
44843
43526
  label: metric.label,
@@ -44845,7 +43528,7 @@ var init_StatCard = __esm({
44845
43528
  format: metric.format
44846
43529
  }));
44847
43530
  }, [metrics, data, computeMetricValue]);
44848
- const calculatedTrend = React97__default.useMemo(() => {
43531
+ const calculatedTrend = React90__default.useMemo(() => {
44849
43532
  if (manualTrend !== void 0) return manualTrend;
44850
43533
  if (previousValue === void 0 || currentValue === void 0)
44851
43534
  return void 0;
@@ -45485,8 +44168,8 @@ var init_SubagentTracePanel = __esm({
45485
44168
  ] });
45486
44169
  };
45487
44170
  InlineActivityStream = ({ activities, autoScroll = true, className }) => {
45488
- const endRef = React97__default.useRef(null);
45489
- React97__default.useEffect(() => {
44171
+ const endRef = React90__default.useRef(null);
44172
+ React90__default.useEffect(() => {
45490
44173
  if (!autoScroll) return;
45491
44174
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
45492
44175
  }, [activities.length, autoScroll]);
@@ -45580,7 +44263,7 @@ var init_SubagentTracePanel = __esm({
45580
44263
  };
45581
44264
  SubagentRichCard = ({ subagent }) => {
45582
44265
  const { t } = useTranslate();
45583
- const activities = React97__default.useMemo(
44266
+ const activities = React90__default.useMemo(
45584
44267
  () => subagentMessagesToActivities(subagent.messages),
45585
44268
  [subagent.messages]
45586
44269
  );
@@ -45657,8 +44340,8 @@ var init_SubagentTracePanel = __esm({
45657
44340
  ] });
45658
44341
  };
45659
44342
  CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
45660
- const endRef = React97__default.useRef(null);
45661
- React97__default.useEffect(() => {
44343
+ const endRef = React90__default.useRef(null);
44344
+ React90__default.useEffect(() => {
45662
44345
  if (!autoScroll) return;
45663
44346
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
45664
44347
  }, [messages.length, autoScroll]);
@@ -46037,7 +44720,7 @@ var init_TeamOrganism = __esm({
46037
44720
  TeamOrganism.displayName = "TeamOrganism";
46038
44721
  }
46039
44722
  });
46040
- var lookStyles10, STATUS_STYLES3, Timeline;
44723
+ var lookStyles10, STATUS_STYLES2, Timeline;
46041
44724
  var init_Timeline = __esm({
46042
44725
  "components/core/organisms/Timeline.tsx"() {
46043
44726
  "use client";
@@ -46053,7 +44736,7 @@ var init_Timeline = __esm({
46053
44736
  horizontal: "flex-row [&>*]:flex-row [&>*]:items-center",
46054
44737
  swimlane: "flex-row gap-6 [&>*]:flex-row [&>*]:items-center"
46055
44738
  };
46056
- STATUS_STYLES3 = {
44739
+ STATUS_STYLES2 = {
46057
44740
  complete: {
46058
44741
  dotColor: "text-success",
46059
44742
  lineColor: "bg-success",
@@ -46088,7 +44771,7 @@ var init_Timeline = __esm({
46088
44771
  }) => {
46089
44772
  const { t } = useTranslate();
46090
44773
  const entityData = entity ?? [];
46091
- const items = React97__default.useMemo(() => {
44774
+ const items = React90__default.useMemo(() => {
46092
44775
  if (propItems) return propItems;
46093
44776
  if (entityData.length === 0) return [];
46094
44777
  return entityData.map((record, idx) => {
@@ -46137,7 +44820,7 @@ var init_Timeline = __esm({
46137
44820
  title && /* @__PURE__ */ jsx(Typography, { variant: "h5", weight: "semibold", children: title }),
46138
44821
  /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("relative", lookStyles10[look]), children: items.map((item, idx) => {
46139
44822
  const status = item.status || "pending";
46140
- const style = STATUS_STYLES3[status] || STATUS_STYLES3.pending;
44823
+ const style = STATUS_STYLES2[status] || STATUS_STYLES2.pending;
46141
44824
  const ItemIcon = item.icon || style.icon;
46142
44825
  const isLast = idx === items.length - 1;
46143
44826
  return /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "relative", children: [
@@ -46190,7 +44873,7 @@ var init_Timeline = __esm({
46190
44873
  }
46191
44874
  });
46192
44875
  function extractToastProps(children) {
46193
- if (!React97__default.isValidElement(children)) {
44876
+ if (!React90__default.isValidElement(children)) {
46194
44877
  if (typeof children === "string") {
46195
44878
  return { message: children };
46196
44879
  }
@@ -46232,7 +44915,7 @@ var init_ToastSlot = __esm({
46232
44915
  eventBus.emit(`${prefix}CLOSE`);
46233
44916
  };
46234
44917
  if (!isVisible) return null;
46235
- const isCustomContent = React97__default.isValidElement(children) && !message;
44918
+ const isCustomContent = React90__default.isValidElement(children) && !message;
46236
44919
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
46237
44920
  Toast,
46238
44921
  {
@@ -46248,38 +44931,13 @@ var init_ToastSlot = __esm({
46248
44931
  ToastSlot.displayName = "ToastSlot";
46249
44932
  }
46250
44933
  });
46251
- function lazyThree(name, loader) {
46252
- const Lazy = React97__default.lazy(
46253
- () => loader().then((m) => {
46254
- const Resolved = m[name];
46255
- if (!Resolved) {
46256
- throw new Error(
46257
- `[@almadar/ui] 3D component "${name}" was not found in the three subpath bundle.`
46258
- );
46259
- }
46260
- return { default: Resolved };
46261
- })
46262
- );
46263
- function ThreeWrapper(props) {
46264
- return React97__default.createElement(
46265
- ThreeBoundary,
46266
- { name },
46267
- React97__default.createElement(
46268
- React97__default.Suspense,
46269
- { fallback: null },
46270
- React97__default.createElement(Lazy, props)
46271
- )
46272
- );
46273
- }
46274
- ThreeWrapper.displayName = `Lazy(${name})`;
46275
- return ThreeWrapper;
46276
- }
46277
- var ThreeBoundary, GameCanvas3D2, COMPONENT_REGISTRY;
44934
+
44935
+ // components/core/organisms/component-registry.generated.ts
44936
+ var COMPONENT_REGISTRY;
46278
44937
  var init_component_registry_generated = __esm({
46279
44938
  "components/core/organisms/component-registry.generated.ts"() {
46280
44939
  init_AboutPageTemplate();
46281
44940
  init_Accordion();
46282
- init_ActionButton();
46283
44941
  init_ActionPalette();
46284
44942
  init_ActionTile();
46285
44943
  init_ActivationBlock();
@@ -46323,7 +44981,6 @@ var init_component_registry_generated = __esm({
46323
44981
  init_ChoiceButton();
46324
44982
  init_CodeBlock();
46325
44983
  init_CodeRunnerPanel();
46326
- init_ComboCounter();
46327
44984
  init_CommunityLinks();
46328
44985
  init_ConditionalWrapper();
46329
44986
  init_ConfettiEffect();
@@ -46335,7 +44992,6 @@ var init_component_registry_generated = __esm({
46335
44992
  init_ControlButton();
46336
44993
  init_ControlGrid();
46337
44994
  init_CounterTemplate();
46338
- init_DamageNumber();
46339
44995
  init_DashboardGrid();
46340
44996
  init_DashboardLayout();
46341
44997
  init_DataGrid();
@@ -46365,7 +45021,6 @@ var init_component_registry_generated = __esm({
46365
45021
  init_EmptyState();
46366
45022
  init_ErrorBoundary();
46367
45023
  init_ErrorState();
46368
- init_EventLog();
46369
45024
  init_FeatureCard();
46370
45025
  init_FeatureDetailPageTemplate();
46371
45026
  init_FeatureGrid();
@@ -46382,12 +45037,10 @@ var init_component_registry_generated = __esm({
46382
45037
  init_FormField();
46383
45038
  init_FormSectionHeader();
46384
45039
  init_GameAudioToggle();
46385
- init_GameCard();
46386
45040
  init_GameHud();
46387
45041
  init_GameIcon();
46388
45042
  init_GameMenu();
46389
45043
  init_GameShell();
46390
- init_GameTemplate();
46391
45044
  init_GenericAppTemplate();
46392
45045
  init_GeometricPattern();
46393
45046
  init_GradientDivider();
@@ -46404,8 +45057,6 @@ var init_component_registry_generated = __esm({
46404
45057
  init_Input();
46405
45058
  init_InputGroup();
46406
45059
  init_InstallBox();
46407
- init_InventoryGrid();
46408
- init_ItemSlot();
46409
45060
  init_JazariStateMachine();
46410
45061
  init_LandingPageTemplate();
46411
45062
  init_LawReferenceTooltip();
@@ -46426,13 +45077,11 @@ var init_component_registry_generated = __esm({
46426
45077
  init_MediaGallery();
46427
45078
  init_Menu();
46428
45079
  init_Meter();
46429
- init_MiniMap();
46430
45080
  init_Modal();
46431
45081
  init_ModalSlot();
46432
45082
  init_ModuleCard();
46433
45083
  init_Navigation();
46434
45084
  init_NumberStepper();
46435
- init_ObjectRulePanel();
46436
45085
  init_OptionConstraintGroup();
46437
45086
  init_OrbitalVisualization();
46438
45087
  init_Overlay();
@@ -46458,8 +45107,6 @@ var init_component_registry_generated = __esm({
46458
45107
  init_RelationSelect();
46459
45108
  init_RepeatableFormSection();
46460
45109
  init_ReplyTree();
46461
- init_ResourceBar();
46462
- init_ResourceCounter();
46463
45110
  init_RichBlockEditor();
46464
45111
  init_RuntimeDebugger2();
46465
45112
  init_ScaledDiagram();
@@ -46485,19 +45132,16 @@ var init_component_registry_generated = __esm({
46485
45132
  init_Split();
46486
45133
  init_SplitPane();
46487
45134
  init_SplitSection();
46488
- init_Sprite();
46489
45135
  init_StarRating();
46490
45136
  init_StatBadge();
46491
45137
  init_StatCard();
46492
45138
  init_StatDisplay();
46493
45139
  init_StateGraph();
46494
- init_StateIndicator();
46495
45140
  init_StateJsonView();
46496
45141
  init_StateMachineView();
46497
45142
  init_StatsGrid();
46498
45143
  init_StatsOrganism();
46499
45144
  init_StatusDot();
46500
- init_StatusEffect();
46501
45145
  init_StepFlow();
46502
45146
  init_StepFlowOrganism();
46503
45147
  init_SubagentTracePanel();
@@ -46534,46 +45178,19 @@ var init_component_registry_generated = __esm({
46534
45178
  init_TraitFrame();
46535
45179
  init_TraitSlot();
46536
45180
  init_TrendIndicator();
46537
- init_TurnIndicator();
46538
45181
  init_TypewriterText();
46539
45182
  init_Typography();
46540
45183
  init_UISlotRenderer();
46541
45184
  init_UploadDropZone();
46542
- init_VariablePanel();
46543
45185
  init_VersionDiff();
46544
45186
  init_ViolationAlert();
46545
45187
  init_VoteStack();
46546
- init_WaypointMarker();
46547
45188
  init_WizardContainer();
46548
45189
  init_WizardNavigation();
46549
45190
  init_WizardProgress();
46550
- ThreeBoundary = class extends React97__default.Component {
46551
- constructor() {
46552
- super(...arguments);
46553
- __publicField(this, "state", { failed: false });
46554
- }
46555
- static getDerivedStateFromError() {
46556
- return { failed: true };
46557
- }
46558
- render() {
46559
- if (this.state.failed) {
46560
- return React97__default.createElement(
46561
- "div",
46562
- {
46563
- "data-testid": "three-unavailable",
46564
- style: { padding: 16, fontSize: 13, lineHeight: 1.5, opacity: 0.7 }
46565
- },
46566
- `3D pattern "${this.props.name}" requires three.js. Install the optional peers three + @react-three/fiber + @react-three/drei (matching the host React major) to render it.`
46567
- );
46568
- }
46569
- return this.props.children;
46570
- }
46571
- };
46572
- GameCanvas3D2 = lazyThree("GameCanvas3D", () => import('@almadar/ui/components/molecules/game/three'));
46573
45191
  COMPONENT_REGISTRY = {
46574
45192
  "AboutPageTemplate": AboutPageTemplate,
46575
45193
  "Accordion": Accordion,
46576
- "ActionButton": ActionButton,
46577
45194
  "ActionPalette": ActionPalette,
46578
45195
  "ActionTile": ActionTile,
46579
45196
  "ActivationBlock": ActivationBlock,
@@ -46622,7 +45239,6 @@ var init_component_registry_generated = __esm({
46622
45239
  "ChoiceButton": ChoiceButton,
46623
45240
  "CodeBlock": CodeBlock,
46624
45241
  "CodeRunnerPanel": CodeRunnerPanel,
46625
- "ComboCounter": ComboCounter,
46626
45242
  "CommunityLinks": CommunityLinks,
46627
45243
  "ConditionalWrapper": ConditionalWrapper,
46628
45244
  "ConfettiEffect": ConfettiEffect,
@@ -46634,7 +45250,6 @@ var init_component_registry_generated = __esm({
46634
45250
  "ControlButton": ControlButton,
46635
45251
  "ControlGrid": ControlGrid,
46636
45252
  "CounterTemplate": CounterTemplate,
46637
- "DamageNumber": DamageNumber,
46638
45253
  "DashboardGrid": DashboardGrid,
46639
45254
  "DashboardLayout": DashboardLayout,
46640
45255
  "DataGrid": DataGrid,
@@ -46666,7 +45281,6 @@ var init_component_registry_generated = __esm({
46666
45281
  "EmptyState": EmptyState,
46667
45282
  "ErrorBoundary": ErrorBoundary,
46668
45283
  "ErrorState": ErrorState,
46669
- "EventLog": EventLog,
46670
45284
  "FeatureCard": FeatureCard,
46671
45285
  "FeatureDetailPageTemplate": FeatureDetailPageTemplate,
46672
45286
  "FeatureGrid": FeatureGrid,
@@ -46684,13 +45298,10 @@ var init_component_registry_generated = __esm({
46684
45298
  "FormLayout": FormLayout,
46685
45299
  "FormSectionHeader": FormSectionHeader,
46686
45300
  "GameAudioToggle": GameAudioToggle,
46687
- "GameCanvas3D": GameCanvas3D2,
46688
- "GameCard": GameCard,
46689
45301
  "GameHud": GameHud,
46690
45302
  "GameIcon": GameIcon,
46691
45303
  "GameMenu": GameMenu,
46692
45304
  "GameShell": GameShell,
46693
- "GameTemplate": GameTemplate,
46694
45305
  "GenericAppTemplate": GenericAppTemplate,
46695
45306
  "GeometricPattern": GeometricPattern,
46696
45307
  "GradientDivider": GradientDivider,
@@ -46707,8 +45318,6 @@ var init_component_registry_generated = __esm({
46707
45318
  "Input": Input,
46708
45319
  "InputGroup": InputGroup,
46709
45320
  "InstallBox": InstallBox,
46710
- "InventoryGrid": InventoryGrid,
46711
- "ItemSlot": ItemSlot,
46712
45321
  "JazariStateMachine": JazariStateMachine,
46713
45322
  "Label": LabelPattern,
46714
45323
  "LabelPattern": LabelPattern,
@@ -46731,13 +45340,11 @@ var init_component_registry_generated = __esm({
46731
45340
  "MediaGallery": MediaGallery,
46732
45341
  "Menu": Menu,
46733
45342
  "Meter": Meter,
46734
- "MiniMap": MiniMap,
46735
45343
  "Modal": Modal,
46736
45344
  "ModalSlot": ModalSlot,
46737
45345
  "ModuleCard": ModuleCard,
46738
45346
  "Navigation": Navigation,
46739
45347
  "NumberStepper": NumberStepper,
46740
- "ObjectRulePanel": ObjectRulePanel,
46741
45348
  "OptionConstraintGroup": OptionConstraintGroup,
46742
45349
  "OrbitalVisualization": OrbitalVisualization,
46743
45350
  "Overlay": Overlay,
@@ -46763,8 +45370,6 @@ var init_component_registry_generated = __esm({
46763
45370
  "RelationSelect": RelationSelect,
46764
45371
  "RepeatableFormSection": RepeatableFormSection,
46765
45372
  "ReplyTree": ReplyTree,
46766
- "ResourceBar": ResourceBar,
46767
- "ResourceCounter": ResourceCounter,
46768
45373
  "RichBlockEditor": RichBlockEditor,
46769
45374
  "RuntimeDebugger": RuntimeDebugger,
46770
45375
  "ScaledDiagram": ScaledDiagram,
@@ -46792,20 +45397,17 @@ var init_component_registry_generated = __esm({
46792
45397
  "Split": Split,
46793
45398
  "SplitPane": SplitPane,
46794
45399
  "SplitSection": SplitSection,
46795
- "Sprite": Sprite,
46796
45400
  "Stack": Stack,
46797
45401
  "StarRating": StarRating,
46798
45402
  "StatBadge": StatBadge,
46799
45403
  "StatCard": StatCard,
46800
45404
  "StatDisplay": StatDisplay,
46801
45405
  "StateGraph": StateGraph,
46802
- "StateIndicator": StateIndicator,
46803
45406
  "StateJsonView": StateJsonView,
46804
45407
  "StateMachineView": StateMachineView,
46805
45408
  "StatsGrid": StatsGrid,
46806
45409
  "StatsOrganism": StatsOrganism,
46807
45410
  "StatusDot": StatusDot,
46808
- "StatusEffect": StatusEffect,
46809
45411
  "StepFlow": StepFlow,
46810
45412
  "StepFlowOrganism": StepFlowOrganism,
46811
45413
  "SubagentTracePanel": SubagentTracePanel,
@@ -46842,17 +45444,14 @@ var init_component_registry_generated = __esm({
46842
45444
  "TraitFrame": TraitFrame,
46843
45445
  "TraitSlot": TraitSlot,
46844
45446
  "TrendIndicator": TrendIndicator,
46845
- "TurnIndicator": TurnIndicator,
46846
45447
  "TypewriterText": TypewriterText,
46847
45448
  "Typography": Typography,
46848
45449
  "UISlotRenderer": UISlotRenderer,
46849
45450
  "UploadDropZone": UploadDropZone,
46850
45451
  "VStack": VStack,
46851
- "VariablePanel": VariablePanel,
46852
45452
  "VersionDiff": VersionDiff,
46853
45453
  "ViolationAlert": ViolationAlert,
46854
45454
  "VoteStack": VoteStack,
46855
- "WaypointMarker": WaypointMarker,
46856
45455
  "WizardContainer": WizardContainer,
46857
45456
  "WizardNavigation": WizardNavigation,
46858
45457
  "WizardProgress": WizardProgress,
@@ -46874,7 +45473,7 @@ function SuspenseConfigProvider({
46874
45473
  config,
46875
45474
  children
46876
45475
  }) {
46877
- return React97__default.createElement(
45476
+ return React90__default.createElement(
46878
45477
  SuspenseConfigContext.Provider,
46879
45478
  { value: config },
46880
45479
  children
@@ -46916,7 +45515,7 @@ function enrichFormFields(fields, entityDef) {
46916
45515
  }
46917
45516
  return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
46918
45517
  }
46919
- if (field && typeof field === "object" && !Array.isArray(field) && !React97__default.isValidElement(field) && !(field instanceof Date)) {
45518
+ if (field && typeof field === "object" && !Array.isArray(field) && !React90__default.isValidElement(field) && !(field instanceof Date)) {
46920
45519
  const obj = field;
46921
45520
  const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
46922
45521
  if (!fieldName) return field;
@@ -47369,7 +45968,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
47369
45968
  const key = `${parentId}-${index}-trait:${traitName}`;
47370
45969
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
47371
45970
  }
47372
- return /* @__PURE__ */ jsx(React97__default.Fragment, { children: child }, `${parentId}-${index}`);
45971
+ return /* @__PURE__ */ jsx(React90__default.Fragment, { children: child }, `${parentId}-${index}`);
47373
45972
  }
47374
45973
  if (!child || typeof child !== "object") return null;
47375
45974
  const childId = `${parentId}-${index}`;
@@ -47422,14 +46021,14 @@ function isPatternConfig(value) {
47422
46021
  if (value === null || value === void 0) return false;
47423
46022
  if (typeof value !== "object") return false;
47424
46023
  if (Array.isArray(value)) return false;
47425
- if (React97__default.isValidElement(value)) return false;
46024
+ if (React90__default.isValidElement(value)) return false;
47426
46025
  if (value instanceof Date) return false;
47427
46026
  if (typeof value === "function") return false;
47428
46027
  const record = value;
47429
46028
  return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
47430
46029
  }
47431
46030
  function isPlainConfigObject(value) {
47432
- if (React97__default.isValidElement(value)) return false;
46031
+ if (React90__default.isValidElement(value)) return false;
47433
46032
  if (value instanceof Date) return false;
47434
46033
  const proto = Object.getPrototypeOf(value);
47435
46034
  return proto === Object.prototype || proto === null;
@@ -47556,7 +46155,7 @@ function SlotContentRenderer({
47556
46155
  for (const slotKey of CONTENT_NODE_SLOTS) {
47557
46156
  const slotVal = restProps[slotKey];
47558
46157
  if (slotVal === void 0 || slotVal === null) continue;
47559
- if (React97__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
46158
+ if (React90__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
47560
46159
  if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
47561
46160
  nodeSlotOverrides[slotKey] = renderPatternChildren(
47562
46161
  slotVal,
@@ -47608,7 +46207,7 @@ function SlotContentRenderer({
47608
46207
  const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
47609
46208
  if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
47610
46209
  const sample = resolvedItems[0];
47611
- if (sample && typeof sample === "object" && !Array.isArray(sample) && !React97__default.isValidElement(sample) && !(sample instanceof Date)) {
46210
+ if (sample && typeof sample === "object" && !Array.isArray(sample) && !React90__default.isValidElement(sample) && !(sample instanceof Date)) {
47612
46211
  const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
47613
46212
  finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
47614
46213
  }
@@ -47973,7 +46572,7 @@ var AvlTransition = ({
47973
46572
  opacity = 1,
47974
46573
  className
47975
46574
  }) => {
47976
- const ids = React97__default.useMemo(() => {
46575
+ const ids = React90__default.useMemo(() => {
47977
46576
  avlTransitionId += 1;
47978
46577
  return { arrow: `avl-tr-${avlTransitionId}-arrow` };
47979
46578
  }, []);
@@ -48534,7 +47133,7 @@ var AvlStateMachine = ({
48534
47133
  color = "var(--color-primary)",
48535
47134
  animated = false
48536
47135
  }) => {
48537
- const ids = React97__default.useMemo(() => {
47136
+ const ids = React90__default.useMemo(() => {
48538
47137
  avlSmId += 1;
48539
47138
  const base = `avl-sm-${avlSmId}`;
48540
47139
  return { glow: `${base}-glow`, grad: `${base}-grad` };
@@ -48733,7 +47332,7 @@ var AvlOrbitalUnit = ({
48733
47332
  color = "var(--color-primary)",
48734
47333
  animated = false
48735
47334
  }) => {
48736
- const ids = React97__default.useMemo(() => {
47335
+ const ids = React90__default.useMemo(() => {
48737
47336
  avlOuId += 1;
48738
47337
  const base = `avl-ou-${avlOuId}`;
48739
47338
  return { glow: `${base}-glow`, grad: `${base}-grad` };
@@ -48829,7 +47428,7 @@ var AvlClosedCircuit = ({
48829
47428
  color = "var(--color-primary)",
48830
47429
  animated = false
48831
47430
  }) => {
48832
- const ids = React97__default.useMemo(() => {
47431
+ const ids = React90__default.useMemo(() => {
48833
47432
  avlCcId += 1;
48834
47433
  const base = `avl-cc-${avlCcId}`;
48835
47434
  return { glow: `${base}-glow`, grad: `${base}-grad`, arrow: `${base}-arrow` };
@@ -48984,7 +47583,7 @@ var AvlEmitListen = ({
48984
47583
  color = "var(--color-primary)",
48985
47584
  animated = false
48986
47585
  }) => {
48987
- const ids = React97__default.useMemo(() => {
47586
+ const ids = React90__default.useMemo(() => {
48988
47587
  avlElId += 1;
48989
47588
  const base = `avl-el-${avlElId}`;
48990
47589
  return { arrow: `${base}-arrow`, grad: `${base}-grad` };
@@ -49258,7 +47857,7 @@ function renderNode(node, color, glowId) {
49258
47857
  const baseR = node.type === "operator" ? 20 : 16;
49259
47858
  const r2 = Math.max(baseR, labelLen * 3.5 + 6);
49260
47859
  const nc = nodeColor(node.type, color);
49261
- return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
47860
+ return /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
49262
47861
  node.children.map((child, i) => {
49263
47862
  const childR = Math.max(
49264
47863
  child.type === "operator" ? 20 : 16,
@@ -49315,7 +47914,7 @@ var AvlExprTree = ({
49315
47914
  className,
49316
47915
  color = "var(--color-primary)"
49317
47916
  }) => {
49318
- const ids = React97__default.useMemo(() => {
47917
+ const ids = React90__default.useMemo(() => {
49319
47918
  avlEtId += 1;
49320
47919
  return { glow: `avl-et-${avlEtId}-glow` };
49321
47920
  }, []);
@@ -50150,7 +48749,7 @@ var SystemNode = ({ data }) => {
50150
48749
  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) => {
50151
48750
  const tc = transitionCounts[s.name] ?? 0;
50152
48751
  const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
50153
- return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
48752
+ return /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
50154
48753
  /* @__PURE__ */ jsx(AvlState, { x: i * 14 + 1, y: 1, width: 10, height: 8, name: "", role, isInitial: s.isInitial ?? void 0, isTerminal: s.isTerminal ?? void 0 }),
50155
48754
  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 })
50156
48755
  ] }, s.name);
@@ -51295,7 +49894,7 @@ function resolveLambdaBindings(body, params, item, index) {
51295
49894
  if (Array.isArray(body)) {
51296
49895
  return body.map((b) => recur(b));
51297
49896
  }
51298
- if (body !== null && typeof body === "object" && !React97__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
49897
+ if (body !== null && typeof body === "object" && !React90__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
51299
49898
  const out = {};
51300
49899
  for (const [k, v] of Object.entries(body)) {
51301
49900
  out[k] = recur(v);
@@ -51314,7 +49913,7 @@ function getSlotContentRenderer2() {
51314
49913
  function makeLambdaFn(params, lambdaBody, callerKey) {
51315
49914
  return (item, index) => {
51316
49915
  const resolvedBody = resolveLambdaBindings(lambdaBody, params, item, index);
51317
- if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React97__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
49916
+ if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React90__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
51318
49917
  return null;
51319
49918
  }
51320
49919
  const record = resolvedBody;
@@ -51333,7 +49932,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
51333
49932
  props: childProps,
51334
49933
  priority: 0
51335
49934
  };
51336
- return React97__default.createElement(SlotContentRenderer2, { content: childContent });
49935
+ return React90__default.createElement(SlotContentRenderer2, { content: childContent });
51337
49936
  };
51338
49937
  }
51339
49938
  function convertNode(node, callerKey) {
@@ -51352,7 +49951,7 @@ function convertNode(node, callerKey) {
51352
49951
  });
51353
49952
  return anyChanged ? mapped : node;
51354
49953
  }
51355
- if (typeof node === "object" && !React97__default.isValidElement(node) && !(node instanceof Date)) {
49954
+ if (typeof node === "object" && !React90__default.isValidElement(node) && !(node instanceof Date)) {
51356
49955
  return convertObjectProps(node);
51357
49956
  }
51358
49957
  return node;
@@ -53197,8 +51796,8 @@ function CanvasDndProvider({
53197
51796
  }) {
53198
51797
  const eventBus = useEventBus();
53199
51798
  const sensors = useAlmadarDndSensors(false);
53200
- const [activePayload, setActivePayload] = React97__default.useState(null);
53201
- const handleDragStart = React97__default.useCallback((e) => {
51799
+ const [activePayload, setActivePayload] = React90__default.useState(null);
51800
+ const handleDragStart = React90__default.useCallback((e) => {
53202
51801
  const data = e.active.data.current;
53203
51802
  const payload = data?.payload;
53204
51803
  if (payload) {
@@ -53209,7 +51808,7 @@ function CanvasDndProvider({
53209
51808
  log10.warn("dragStart:missing-payload", { id: e.active.id });
53210
51809
  }
53211
51810
  }, [eventBus]);
53212
- const handleDragEnd = React97__default.useCallback((e) => {
51811
+ const handleDragEnd = React90__default.useCallback((e) => {
53213
51812
  setActivePayload(null);
53214
51813
  const activeData = e.active.data.current;
53215
51814
  const payload = activeData?.payload;
@@ -53238,7 +51837,7 @@ function CanvasDndProvider({
53238
51837
  const suppressed = onDrop ? onDrop(drop) === true : false;
53239
51838
  if (!suppressed) defaultEmit(eventBus, drop);
53240
51839
  }, [eventBus, onDrop]);
53241
- const handleDragCancel = React97__default.useCallback(() => {
51840
+ const handleDragCancel = React90__default.useCallback(() => {
53242
51841
  setActivePayload(null);
53243
51842
  log10.info("dragCancel");
53244
51843
  }, []);
@@ -53996,7 +52595,7 @@ var OrbPreviewNodeInner = (props) => {
53996
52595
  }
53997
52596
  );
53998
52597
  };
53999
- var OrbPreviewNode = React97__default.memo(OrbPreviewNodeInner);
52598
+ var OrbPreviewNode = React90__default.memo(OrbPreviewNodeInner);
54000
52599
  OrbPreviewNode.displayName = "OrbPreviewNode";
54001
52600
  orbPreviewLog.debug("export-resolved", () => ({
54002
52601
  type: typeof OrbPreviewNode,
@@ -54101,7 +52700,7 @@ var EventFlowEdgeInner = (props) => {
54101
52700
  ) })
54102
52701
  ] });
54103
52702
  };
54104
- var EventFlowEdge = React97__default.memo(EventFlowEdgeInner);
52703
+ var EventFlowEdge = React90__default.memo(EventFlowEdgeInner);
54105
52704
  EventFlowEdge.displayName = "EventFlowEdge";
54106
52705
 
54107
52706
  // components/avl/molecules/BehaviorComposeNode.tsx
@@ -54248,7 +52847,7 @@ var BehaviorComposeNodeInner = (props) => {
54248
52847
  }
54249
52848
  );
54250
52849
  };
54251
- var BehaviorComposeNode = React97__default.memo(BehaviorComposeNodeInner);
52850
+ var BehaviorComposeNode = React90__default.memo(BehaviorComposeNodeInner);
54252
52851
  BehaviorComposeNode.displayName = "BehaviorComposeNode";
54253
52852
 
54254
52853
  // components/avl/lib/avl-behavior-compose-converter.ts
@@ -55274,7 +53873,7 @@ var TraitCardNodeInner = (props) => {
55274
53873
  }
55275
53874
  );
55276
53875
  };
55277
- var TraitCardNode = React97__default.memo(TraitCardNodeInner);
53876
+ var TraitCardNode = React90__default.memo(TraitCardNodeInner);
55278
53877
  TraitCardNode.displayName = "TraitCardNode";
55279
53878
 
55280
53879
  // components/avl/organisms/FlowCanvas.tsx
@@ -55347,7 +53946,7 @@ function FlowCanvasInner({
55347
53946
  initialOrbital
55348
53947
  );
55349
53948
  const [expandedBehaviorAlias, setExpandedBehaviorAlias] = useState(void 0);
55350
- const screenSizeUserOverrideRef = React97__default.useRef(false);
53949
+ const screenSizeUserOverrideRef = React90__default.useRef(false);
55351
53950
  const [screenSize, setScreenSize] = useState(
55352
53951
  () => typeof window === "undefined" ? "laptop" : detectScreenSize(window.innerWidth)
55353
53952
  );
@@ -55731,7 +54330,7 @@ var ZoomBreadcrumb = ({
55731
54330
  if (eventName && band === "detail") {
55732
54331
  segments.push({ icon: "\u26A1", label: eventName });
55733
54332
  }
55734
- 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(React97__default.Fragment, { children: [
54333
+ 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(React90__default.Fragment, { children: [
55735
54334
  i > 0 && /* @__PURE__ */ jsx("span", { className: "opacity-40", children: ">" }),
55736
54335
  /* @__PURE__ */ jsx("span", { className: "opacity-60", children: seg.icon }),
55737
54336
  /* @__PURE__ */ jsx("span", { children: seg.label })
@@ -56072,7 +54671,7 @@ var EventWireOverlay = ({
56072
54671
  containerW,
56073
54672
  containerH
56074
54673
  }) => {
56075
- const ids = React97__default.useMemo(() => {
54674
+ const ids = React90__default.useMemo(() => {
56076
54675
  avlOczWireId += 1;
56077
54676
  return { arrow: `avl-ocz-wire-${avlOczWireId}-arrow` };
56078
54677
  }, []);
@@ -56439,7 +55038,7 @@ var AvlOrbitalsCosmicZoom = ({
56439
55038
  borderRadius: 6,
56440
55039
  border: `1px solid ${color}`
56441
55040
  },
56442
- children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
55041
+ children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
56443
55042
  i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", style: { opacity: 0.5, color }, children: "/" }),
56444
55043
  i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
56445
55044
  Box,