@almadar/ui 5.25.0 → 5.26.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 (53) hide show
  1. package/dist/avl/index.cjs +2071 -2859
  2. package/dist/avl/index.js +1020 -1808
  3. package/dist/components/core/atoms/FlipContainer.d.ts +4 -4
  4. package/dist/components/core/atoms/Icon.d.ts +4 -2
  5. package/dist/components/core/atoms/ProgressBar.d.ts +1 -1
  6. package/dist/components/core/atoms/Typography.d.ts +0 -18
  7. package/dist/components/core/atoms/index.d.ts +1 -1
  8. package/dist/components/core/atoms/types.d.ts +6 -0
  9. package/dist/components/core/molecules/ArrayEditor.d.ts +15 -0
  10. package/dist/components/core/molecules/Carousel.d.ts +8 -2
  11. package/dist/components/core/molecules/Container.d.ts +4 -4
  12. package/dist/components/core/molecules/DateRangeSelector.d.ts +3 -4
  13. package/dist/components/core/molecules/DocSidebar.d.ts +4 -4
  14. package/dist/components/core/molecules/EdgeDecoration.d.ts +3 -2
  15. package/dist/components/core/molecules/Flex.d.ts +4 -4
  16. package/dist/components/core/molecules/FlipCard.d.ts +3 -4
  17. package/dist/components/core/molecules/GradientDivider.d.ts +3 -2
  18. package/dist/components/core/molecules/MapEditor.d.ts +16 -0
  19. package/dist/components/core/molecules/ObjectEditor.d.ts +15 -0
  20. package/dist/components/core/molecules/SidePanel.d.ts +4 -4
  21. package/dist/components/core/molecules/SortableList.d.ts +4 -5
  22. package/dist/components/core/molecules/ViolationAlert.d.ts +4 -9
  23. package/dist/components/core/molecules/index.d.ts +4 -3
  24. package/dist/components/core/molecules/markdown/CodeBlock.d.ts +44 -2
  25. package/dist/components/core/organisms/ComponentPatterns.d.ts +0 -3
  26. package/dist/components/game/atoms/DialogueBubble.d.ts +2 -1
  27. package/dist/components/game/atoms/ResourceCounter.d.ts +3 -2
  28. package/dist/components/game/atoms/Sprite.d.ts +2 -2
  29. package/dist/components/game/atoms/StateIndicator.d.ts +4 -5
  30. package/dist/components/game/atoms/StatusEffect.d.ts +2 -3
  31. package/dist/components/game/molecules/ActionButtons.d.ts +6 -0
  32. package/dist/components/game/molecules/GameHud.d.ts +2 -3
  33. package/dist/components/game/molecules/StatBadge.d.ts +6 -0
  34. package/dist/components/game/organisms/puzzles/state-architect/StateJsonView.d.ts +16 -0
  35. package/dist/components/game/organisms/puzzles/state-architect/index.d.ts +2 -2
  36. package/dist/components/index.cjs +2527 -2302
  37. package/dist/components/index.js +1638 -1413
  38. package/dist/docs/index.cjs +6014 -4606
  39. package/dist/docs/index.css +1252 -0
  40. package/dist/docs/index.d.cts +108 -16
  41. package/dist/docs/index.d.ts +2 -2
  42. package/dist/docs/index.js +5970 -4567
  43. package/dist/marketing/index.cjs +36 -13
  44. package/dist/marketing/index.d.cts +30 -20
  45. package/dist/marketing/index.js +36 -13
  46. package/dist/providers/index.cjs +1891 -2679
  47. package/dist/providers/index.js +990 -1778
  48. package/dist/runtime/index.cjs +1931 -2719
  49. package/dist/runtime/index.js +994 -1782
  50. package/package.json +1 -1
  51. package/dist/components/core/molecules/CodeViewer.d.ts +0 -70
  52. package/dist/components/core/molecules/DocCodeBlock.d.ts +0 -14
  53. package/dist/components/game/organisms/puzzles/state-architect/CodeView.d.ts +0 -24
package/dist/avl/index.js CHANGED
@@ -1,13 +1,13 @@
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';
2
+ import * as React93 from 'react';
3
+ import React93__default, { createContext, useState, useMemo, useRef, useEffect, useContext, useCallback, Suspense, useLayoutEffect, Profiler, useReducer, useSyncExternalStore, lazy, useId } from 'react';
4
4
  import { OrbitalProvider, EventBusContext, useTraitScope, VerificationProvider, TraitScopeProvider } from '@almadar/ui/providers';
5
5
  import { createLogger, isLogLevelEnabled } from '@almadar/logger';
6
6
  import ELK from 'elkjs/lib/elk.bundled.js';
7
7
  import { MarkerType, useReactFlow, Handle, Position, getBezierPath, EdgeLabelRenderer, useNodeId, ReactFlowProvider, BaseEdge, useNodesState, useEdgesState, ReactFlow, Controls, Background, BackgroundVariant } from '@xyflow/react';
8
8
  import { useTranslate, useEventBus as useEventBus$1 } from '@almadar/ui/hooks';
9
9
  import * as LucideIcons2 from 'lucide-react';
10
- import { Loader2, X, List, Printer, ChevronRight, ChevronLeft, GitBranch, Pencil, Eye, Plus, ArrowRight, Trash, Code, FileText, WrapText, Check, Copy, AlertTriangle, Trash2, ZoomOut, ZoomIn, Download, RotateCcw, Menu as Menu$1, Package, Calendar, MoreHorizontal, Image as Image$1, Upload, ArrowLeft, HelpCircle, Search, Type, Heading1, Heading2, Heading3, ListOrdered, Quote, Minus, Eraser, TrendingUp, TrendingDown, AlertCircle, Circle, Clock, CheckCircle2, CheckCircle, XCircle, Play, Pause, SkipForward, Bug, Send, ChevronUp, ChevronDown, Wrench, Tag, User, DollarSign, Zap, Sword, Move, Heart, Shield } from 'lucide-react';
10
+ import { Loader2, X, Code, FileText, WrapText, Check, Copy, List, Printer, ChevronRight, ChevronLeft, GitBranch, Pencil, Eye, Plus, ArrowRight, Trash, AlertTriangle, Trash2, ZoomOut, ZoomIn, Download, RotateCcw, Menu as Menu$1, Package, Calendar, MoreHorizontal, Image as Image$1, Upload, ArrowLeft, HelpCircle, Search, Type, Heading1, Heading2, Heading3, ListOrdered, Quote, Minus, Eraser, TrendingUp, TrendingDown, AlertCircle, Circle, Clock, CheckCircle2, CheckCircle, XCircle, Play, Pause, SkipForward, Bug, Send, ChevronUp, ChevronDown, Wrench, Tag, User, DollarSign, Zap, Sword, Move, Heart, Shield } from 'lucide-react';
11
11
  import * as PhosphorIcons from '@phosphor-icons/react';
12
12
  import * as TablerIcons from '@tabler/icons-react';
13
13
  import * as FaIcons from 'react-icons/fa';
@@ -3085,11 +3085,9 @@ var init_cn = __esm({
3085
3085
  // components/core/atoms/Typography.tsx
3086
3086
  var Typography_exports = {};
3087
3087
  __export(Typography_exports, {
3088
- Heading: () => Heading,
3089
- Text: () => Text,
3090
3088
  Typography: () => Typography
3091
3089
  });
3092
- var variantStyles, colorStyles, weightStyles, defaultElements, typographySizeStyles, overflowStyles, Typography, sizeStyles, Heading, Text;
3090
+ var variantStyles, colorStyles, weightStyles, defaultElements, typographySizeStyles, overflowStyles, Typography;
3093
3091
  var init_Typography = __esm({
3094
3092
  "components/core/atoms/Typography.tsx"() {
3095
3093
  init_cn();
@@ -3200,46 +3198,6 @@ var init_Typography = __esm({
3200
3198
  );
3201
3199
  };
3202
3200
  Typography.displayName = "Typography";
3203
- sizeStyles = {
3204
- xs: "text-xs",
3205
- sm: "text-sm",
3206
- md: "text-base",
3207
- lg: "text-lg",
3208
- xl: "text-xl",
3209
- "2xl": "text-2xl",
3210
- "3xl": "text-3xl"
3211
- };
3212
- Heading = ({
3213
- level = 2,
3214
- size,
3215
- className,
3216
- ...props
3217
- }) => {
3218
- const variant = `h${level}`;
3219
- const sizeClass = size ? sizeStyles[size] : void 0;
3220
- return /* @__PURE__ */ jsx(
3221
- Typography,
3222
- {
3223
- variant,
3224
- className: cn(sizeClass, className),
3225
- ...props
3226
- }
3227
- );
3228
- };
3229
- Heading.displayName = "Heading";
3230
- Text = ({
3231
- variant = "body",
3232
- ...props
3233
- }) => {
3234
- return /* @__PURE__ */ jsx(
3235
- Typography,
3236
- {
3237
- variant,
3238
- ...props
3239
- }
3240
- );
3241
- };
3242
- Text.displayName = "Text";
3243
3201
  }
3244
3202
  });
3245
3203
 
@@ -3509,7 +3467,7 @@ var init_Box = __esm({
3509
3467
  fixed: "fixed",
3510
3468
  sticky: "sticky"
3511
3469
  };
3512
- Box = React97__default.forwardRef(
3470
+ Box = React93__default.forwardRef(
3513
3471
  ({
3514
3472
  padding,
3515
3473
  paddingX,
@@ -3559,7 +3517,7 @@ var init_Box = __esm({
3559
3517
  onMouseLeave?.(e);
3560
3518
  }, [hoverEvent, eventBus, onMouseLeave]);
3561
3519
  const isClickable = action || onClick;
3562
- return React97__default.createElement(
3520
+ return React93__default.createElement(
3563
3521
  Component,
3564
3522
  {
3565
3523
  ref,
@@ -4149,7 +4107,7 @@ var init_MiniStateMachine = __esm({
4149
4107
  const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
4150
4108
  const tc = transitionCounts[s.name] ?? 0;
4151
4109
  const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
4152
- return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
4110
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
4153
4111
  /* @__PURE__ */ jsx(
4154
4112
  AvlState,
4155
4113
  {
@@ -5168,12 +5126,20 @@ function doResolve(name) {
5168
5126
  if (asIs && typeof asIs === "object") return asIs;
5169
5127
  return LucideIcons2.HelpCircle;
5170
5128
  }
5171
- var iconAliases, resolvedCache, sizeClasses, animationClasses, Icon;
5129
+ var colorTokenClasses, iconAliases, resolvedCache, sizeClasses, animationClasses, Icon;
5172
5130
  var init_Icon = __esm({
5173
5131
  "components/core/atoms/Icon.tsx"() {
5174
5132
  "use client";
5175
5133
  init_cn();
5176
5134
  init_iconFamily();
5135
+ colorTokenClasses = {
5136
+ primary: "text-primary",
5137
+ secondary: "text-secondary",
5138
+ success: "text-success",
5139
+ warning: "text-warning",
5140
+ error: "text-error",
5141
+ muted: "text-muted-foreground"
5142
+ };
5177
5143
  iconAliases = {
5178
5144
  "close": LucideIcons2.X,
5179
5145
  "trash": LucideIcons2.Trash2,
@@ -5212,7 +5178,7 @@ var init_Icon = __esm({
5212
5178
  const directIcon = typeof icon === "string" ? void 0 : icon;
5213
5179
  const effectiveName = typeof icon === "string" ? icon : name;
5214
5180
  const family = useIconFamily();
5215
- const RenderedComponent = React97__default.useMemo(() => {
5181
+ const RenderedComponent = React93__default.useMemo(() => {
5216
5182
  if (directIcon) return null;
5217
5183
  return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
5218
5184
  }, [directIcon, effectiveName, family]);
@@ -5221,10 +5187,11 @@ var init_Icon = __esm({
5221
5187
  ...effectiveStrokeWidth === void 0 ? { strokeWidth: "var(--icon-stroke-width, 2)" } : {},
5222
5188
  ...style
5223
5189
  };
5190
+ const resolvedColor = color ? color in colorTokenClasses ? colorTokenClasses[color] : color : "text-current";
5224
5191
  const composedClassName = cn(
5225
5192
  sizeClasses[size],
5226
5193
  animationClasses[animation],
5227
- color ? color : "text-current",
5194
+ resolvedColor,
5228
5195
  className
5229
5196
  );
5230
5197
  if (directIcon) {
@@ -5270,7 +5237,7 @@ function resolveIconProp(value, sizeClass) {
5270
5237
  const IconComp = value;
5271
5238
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
5272
5239
  }
5273
- if (React97__default.isValidElement(value)) {
5240
+ if (React93__default.isValidElement(value)) {
5274
5241
  return value;
5275
5242
  }
5276
5243
  if (typeof value === "object" && value !== null && "render" in value) {
@@ -5279,7 +5246,7 @@ function resolveIconProp(value, sizeClass) {
5279
5246
  }
5280
5247
  return value;
5281
5248
  }
5282
- var variantStyles2, sizeStyles2, iconSizeStyles, Button;
5249
+ var variantStyles2, sizeStyles, iconSizeStyles, Button;
5283
5250
  var init_Button = __esm({
5284
5251
  "components/core/atoms/Button.tsx"() {
5285
5252
  "use client";
@@ -5336,7 +5303,7 @@ var init_Button = __esm({
5336
5303
  ].join(" ")
5337
5304
  };
5338
5305
  variantStyles2.destructive = variantStyles2.danger;
5339
- sizeStyles2 = {
5306
+ sizeStyles = {
5340
5307
  sm: "h-button-sm px-3 text-sm",
5341
5308
  md: "h-button-md px-4 text-sm",
5342
5309
  lg: "h-button-lg px-6 text-base"
@@ -5346,7 +5313,7 @@ var init_Button = __esm({
5346
5313
  md: "h-icon-default w-icon-default",
5347
5314
  lg: "h-icon-default w-icon-default"
5348
5315
  };
5349
- Button = React97__default.forwardRef(
5316
+ Button = React93__default.forwardRef(
5350
5317
  ({
5351
5318
  className,
5352
5319
  variant = "primary",
@@ -5389,7 +5356,7 @@ var init_Button = __esm({
5389
5356
  "focus:outline-none focus:ring-[length:var(--focus-ring-width)] focus:ring-ring focus:ring-offset-[length:var(--focus-ring-offset)]",
5390
5357
  "disabled:opacity-50 disabled:cursor-not-allowed",
5391
5358
  variantStyles2[variant],
5392
- sizeStyles2[size],
5359
+ sizeStyles[size],
5393
5360
  className
5394
5361
  ),
5395
5362
  onClick: handleClick,
@@ -5411,7 +5378,7 @@ var Dialog;
5411
5378
  var init_Dialog = __esm({
5412
5379
  "components/core/atoms/Dialog.tsx"() {
5413
5380
  init_cn();
5414
- Dialog = React97__default.forwardRef(
5381
+ Dialog = React93__default.forwardRef(
5415
5382
  ({
5416
5383
  role = "dialog",
5417
5384
  "aria-modal": ariaModal = true,
@@ -5433,43 +5400,6 @@ var init_Dialog = __esm({
5433
5400
  Dialog.displayName = "Dialog";
5434
5401
  }
5435
5402
  });
5436
- var Overlay;
5437
- var init_Overlay = __esm({
5438
- "components/core/atoms/Overlay.tsx"() {
5439
- "use client";
5440
- init_cn();
5441
- init_useEventBus();
5442
- Overlay = ({
5443
- isVisible = true,
5444
- onClick,
5445
- className,
5446
- blur = false,
5447
- action
5448
- }) => {
5449
- const eventBus = useEventBus();
5450
- if (!isVisible) return null;
5451
- const handleClick = (e) => {
5452
- if (action) {
5453
- eventBus.emit(`UI:${action}`, {});
5454
- }
5455
- onClick?.(e);
5456
- };
5457
- return /* @__PURE__ */ jsx(
5458
- "div",
5459
- {
5460
- className: cn(
5461
- "fixed inset-0 z-40",
5462
- blur && "backdrop-blur-sm",
5463
- className
5464
- ),
5465
- style: { backgroundColor: "rgba(0, 0, 0, 0.6)" },
5466
- onClick: action || onClick ? handleClick : void 0,
5467
- "aria-hidden": "true"
5468
- }
5469
- );
5470
- };
5471
- }
5472
- });
5473
5403
  var sizeClasses2, minWidthClasses, lookStyles, Modal;
5474
5404
  var init_Modal = __esm({
5475
5405
  "components/core/molecules/Modal.tsx"() {
@@ -5478,7 +5408,6 @@ var init_Modal = __esm({
5478
5408
  init_Button();
5479
5409
  init_Dialog();
5480
5410
  init_Typography();
5481
- init_Overlay();
5482
5411
  init_cn();
5483
5412
  init_useEventBus();
5484
5413
  sizeClasses2 = {
@@ -5568,130 +5497,160 @@ var init_Modal = __esm({
5568
5497
  }
5569
5498
  };
5570
5499
  return createPortal(
5571
- /* @__PURE__ */ jsxs(Fragment, { children: [
5572
- /* @__PURE__ */ jsx(
5573
- Overlay,
5574
- {
5575
- isVisible: isOpen,
5576
- onClick: handleOverlayClick,
5577
- className: "z-[1000]"
5578
- }
5579
- ),
5580
- /* @__PURE__ */ jsx(
5581
- Box,
5582
- {
5583
- className: cn(
5584
- "fixed inset-0 z-[1001] pointer-events-none",
5585
- "flex items-start justify-center px-4 pb-4 pt-[10vh]",
5586
- "max-sm:items-stretch max-sm:p-0 max-sm:pt-0"
5587
- ),
5588
- children: /* @__PURE__ */ jsxs(
5589
- Dialog,
5590
- {
5591
- ref: modalRef,
5592
- open: true,
5593
- className: cn(
5594
- // Reset browser-default dialog chrome — we own styling. `static`
5595
- // overrides the user-agent `position: absolute` so the parent
5596
- // flex container's `justify-center` actually centers the dialog
5597
- // (without this, the dialog drops out of flex flow and `m-0`
5598
- // kills the user-agent's `margin: auto` centering, pinning the
5599
- // dialog to top-left).
5600
- "static m-0 p-0 border-0 bg-transparent",
5601
- // Pre-existing dialog frame
5602
- "pointer-events-auto w-full flex flex-col bg-surface border shadow-elevation-dialog rounded-container",
5603
- // Desktop sizing + viewport-aware floor.
5604
- sizeClasses2[size],
5605
- minWidthClasses[size],
5606
- "max-h-[80vh]",
5607
- // Mobile: take the entire screen. Override desktop max-w cap,
5608
- // full height, no rounded corners, no min-width.
5609
- "max-sm:max-w-none max-sm:max-h-none max-sm:w-full max-sm:h-full max-sm:rounded-none",
5610
- lookStyles[look],
5611
- className
5500
+ /* @__PURE__ */ jsx(
5501
+ "div",
5502
+ {
5503
+ className: cn(
5504
+ "fixed inset-0 z-[1000]",
5505
+ "flex items-start justify-center px-4 pb-4 pt-[10vh]",
5506
+ "max-sm:items-stretch max-sm:p-0 max-sm:pt-0"
5507
+ ),
5508
+ style: { backgroundColor: "rgba(0, 0, 0, 0.6)" },
5509
+ onClick: handleOverlayClick,
5510
+ "aria-hidden": "true",
5511
+ children: /* @__PURE__ */ jsxs(
5512
+ Dialog,
5513
+ {
5514
+ ref: modalRef,
5515
+ open: true,
5516
+ className: cn(
5517
+ // Reset browser-default dialog chrome — we own styling. `static`
5518
+ // overrides the user-agent `position: absolute` so the parent
5519
+ // flex container's `justify-center` actually centers the dialog
5520
+ // (without this, the dialog drops out of flex flow and `m-0`
5521
+ // kills the user-agent's `margin: auto` centering, pinning the
5522
+ // dialog to top-left).
5523
+ "static m-0 p-0 border-0 bg-transparent",
5524
+ // Pre-existing dialog frame
5525
+ "pointer-events-auto w-full flex flex-col bg-surface border shadow-elevation-dialog rounded-container",
5526
+ // Desktop sizing + viewport-aware floor.
5527
+ sizeClasses2[size],
5528
+ minWidthClasses[size],
5529
+ "max-h-[80vh]",
5530
+ // Mobile: take the entire screen. Override desktop max-w cap,
5531
+ // full height, no rounded corners, no min-width.
5532
+ "max-sm:max-w-none max-sm:max-h-none max-sm:w-full max-sm:h-full max-sm:rounded-none",
5533
+ lookStyles[look],
5534
+ className
5535
+ ),
5536
+ style: dragY > 0 ? {
5537
+ transform: `translateY(${dragY}px)`,
5538
+ transition: isDragging.current ? "none" : "transform 200ms ease-out"
5539
+ } : void 0,
5540
+ ...title && { "aria-labelledby": "modal-title" },
5541
+ children: [
5542
+ /* @__PURE__ */ jsx(
5543
+ Box,
5544
+ {
5545
+ className: "hidden max-sm:flex justify-center py-2 cursor-grab active:cursor-grabbing touch-none",
5546
+ onPointerDown: (e) => {
5547
+ if (!swipeDownToClose) return;
5548
+ dragStartY.current = e.clientY;
5549
+ isDragging.current = true;
5550
+ e.target.setPointerCapture(e.pointerId);
5551
+ },
5552
+ onPointerMove: (e) => {
5553
+ if (!isDragging.current) return;
5554
+ const dy = Math.max(0, e.clientY - dragStartY.current);
5555
+ setDragY(dy);
5556
+ },
5557
+ onPointerUp: () => {
5558
+ if (!isDragging.current) return;
5559
+ isDragging.current = false;
5560
+ if (dragY > 100) {
5561
+ handleClose();
5562
+ }
5563
+ setDragY(0);
5564
+ },
5565
+ onPointerCancel: () => {
5566
+ isDragging.current = false;
5567
+ setDragY(0);
5568
+ },
5569
+ children: /* @__PURE__ */ jsx(Box, { className: "w-10 h-1 rounded-full bg-border" })
5570
+ }
5612
5571
  ),
5613
- style: dragY > 0 ? {
5614
- transform: `translateY(${dragY}px)`,
5615
- transition: isDragging.current ? "none" : "transform 200ms ease-out"
5616
- } : void 0,
5617
- ...title && { "aria-labelledby": "modal-title" },
5618
- children: [
5619
- /* @__PURE__ */ jsx(
5620
- Box,
5621
- {
5622
- className: "hidden max-sm:flex justify-center py-2 cursor-grab active:cursor-grabbing touch-none",
5623
- onPointerDown: (e) => {
5624
- if (!swipeDownToClose) return;
5625
- dragStartY.current = e.clientY;
5626
- isDragging.current = true;
5627
- e.target.setPointerCapture(e.pointerId);
5628
- },
5629
- onPointerMove: (e) => {
5630
- if (!isDragging.current) return;
5631
- const dy = Math.max(0, e.clientY - dragStartY.current);
5632
- setDragY(dy);
5633
- },
5634
- onPointerUp: () => {
5635
- if (!isDragging.current) return;
5636
- isDragging.current = false;
5637
- if (dragY > 100) {
5638
- handleClose();
5572
+ (title || showCloseButton) && /* @__PURE__ */ jsxs(
5573
+ Box,
5574
+ {
5575
+ className: cn(
5576
+ "px-6 py-4 flex items-center justify-between",
5577
+ "border-b-[length:var(--border-width)] border-border"
5578
+ ),
5579
+ children: [
5580
+ title && /* @__PURE__ */ jsx(Typography, { variant: "h4", as: "h2", id: "modal-title", children: title }),
5581
+ showCloseButton && /* @__PURE__ */ jsx(
5582
+ Button,
5583
+ {
5584
+ variant: "ghost",
5585
+ size: "sm",
5586
+ icon: "x",
5587
+ onClick: handleClose,
5588
+ "data-event": "CLOSE",
5589
+ "aria-label": t("aria.closeModal")
5639
5590
  }
5640
- setDragY(0);
5641
- },
5642
- onPointerCancel: () => {
5643
- isDragging.current = false;
5644
- setDragY(0);
5645
- },
5646
- children: /* @__PURE__ */ jsx(Box, { className: "w-10 h-1 rounded-full bg-border" })
5647
- }
5648
- ),
5649
- (title || showCloseButton) && /* @__PURE__ */ jsxs(
5650
- Box,
5651
- {
5652
- className: cn(
5653
- "px-6 py-4 flex items-center justify-between",
5654
- "border-b-[length:var(--border-width)] border-border"
5655
- ),
5656
- children: [
5657
- title && /* @__PURE__ */ jsx(Typography, { variant: "h4", as: "h2", id: "modal-title", children: title }),
5658
- showCloseButton && /* @__PURE__ */ jsx(
5659
- Button,
5660
- {
5661
- variant: "ghost",
5662
- size: "sm",
5663
- icon: "x",
5664
- onClick: handleClose,
5665
- "data-event": "CLOSE",
5666
- "aria-label": t("aria.closeModal")
5667
- }
5668
- )
5669
- ]
5670
- }
5671
- ),
5672
- /* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto p-6", children }),
5673
- footer && /* @__PURE__ */ jsx(
5674
- Box,
5675
- {
5676
- className: cn(
5677
- "px-6 py-4 bg-muted",
5678
- "border-t-[length:var(--border-width)] border-border"
5679
- ),
5680
- children: footer
5681
- }
5682
- )
5683
- ]
5684
- }
5685
- )
5686
- }
5687
- )
5688
- ] }),
5591
+ )
5592
+ ]
5593
+ }
5594
+ ),
5595
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto p-6", children }),
5596
+ footer && /* @__PURE__ */ jsx(
5597
+ Box,
5598
+ {
5599
+ className: cn(
5600
+ "px-6 py-4 bg-muted",
5601
+ "border-t-[length:var(--border-width)] border-border"
5602
+ ),
5603
+ children: footer
5604
+ }
5605
+ )
5606
+ ]
5607
+ }
5608
+ )
5609
+ }
5610
+ ),
5689
5611
  document.body
5690
5612
  );
5691
5613
  };
5692
5614
  Modal.displayName = "Modal";
5693
5615
  }
5694
5616
  });
5617
+ var Overlay;
5618
+ var init_Overlay = __esm({
5619
+ "components/core/atoms/Overlay.tsx"() {
5620
+ "use client";
5621
+ init_cn();
5622
+ init_useEventBus();
5623
+ Overlay = ({
5624
+ isVisible = true,
5625
+ onClick,
5626
+ className,
5627
+ blur = false,
5628
+ action
5629
+ }) => {
5630
+ const eventBus = useEventBus();
5631
+ if (!isVisible) return null;
5632
+ const handleClick = (e) => {
5633
+ if (action) {
5634
+ eventBus.emit(`UI:${action}`, {});
5635
+ }
5636
+ onClick?.(e);
5637
+ };
5638
+ return /* @__PURE__ */ jsx(
5639
+ "div",
5640
+ {
5641
+ className: cn(
5642
+ "fixed inset-0 z-40",
5643
+ blur && "backdrop-blur-sm",
5644
+ className
5645
+ ),
5646
+ style: { backgroundColor: "rgba(0, 0, 0, 0.6)" },
5647
+ onClick: action || onClick ? handleClick : void 0,
5648
+ "aria-hidden": "true"
5649
+ }
5650
+ );
5651
+ };
5652
+ }
5653
+ });
5695
5654
  var sizeWidths, Drawer;
5696
5655
  var init_Drawer = __esm({
5697
5656
  "components/core/molecules/Drawer.tsx"() {
@@ -5872,7 +5831,7 @@ var init_Drawer = __esm({
5872
5831
  Drawer.displayName = "Drawer";
5873
5832
  }
5874
5833
  });
5875
- var variantStyles3, sizeStyles3, Badge;
5834
+ var variantStyles3, sizeStyles2, Badge;
5876
5835
  var init_Badge = __esm({
5877
5836
  "components/core/atoms/Badge.tsx"() {
5878
5837
  init_cn();
@@ -5909,12 +5868,12 @@ var init_Badge = __esm({
5909
5868
  "border-[length:var(--border-width-thin)] border-border"
5910
5869
  ].join(" ")
5911
5870
  };
5912
- sizeStyles3 = {
5871
+ sizeStyles2 = {
5913
5872
  sm: "px-2 py-0.5 text-xs",
5914
5873
  md: "px-2.5 py-1 text-sm",
5915
5874
  lg: "px-3 py-1.5 text-base"
5916
5875
  };
5917
- Badge = React97__default.forwardRef(
5876
+ Badge = React93__default.forwardRef(
5918
5877
  ({ className, variant = "default", size = "sm", amount, label, icon, children, onRemove, removeLabel, ...props }, ref) => {
5919
5878
  const iconSizes3 = {
5920
5879
  sm: "h-icon-default w-icon-default",
@@ -5929,7 +5888,7 @@ var init_Badge = __esm({
5929
5888
  className: cn(
5930
5889
  "inline-flex items-center gap-1 font-bold rounded-sm",
5931
5890
  variantStyles3[variant],
5932
- sizeStyles3[size],
5891
+ sizeStyles2[size],
5933
5892
  onRemove && "pr-1",
5934
5893
  className
5935
5894
  ),
@@ -6230,7 +6189,7 @@ var init_SvgFlow = __esm({
6230
6189
  opacity = 1,
6231
6190
  className
6232
6191
  }) => {
6233
- const markerId = React97__default.useMemo(() => {
6192
+ const markerId = React93__default.useMemo(() => {
6234
6193
  flowIdCounter += 1;
6235
6194
  return `almadar-flow-arrow-${flowIdCounter}`;
6236
6195
  }, []);
@@ -6773,7 +6732,7 @@ var init_SvgRing = __esm({
6773
6732
  className,
6774
6733
  label
6775
6734
  }) => {
6776
- const gradientId = React97__default.useMemo(() => {
6735
+ const gradientId = React93__default.useMemo(() => {
6777
6736
  ringIdCounter += 1;
6778
6737
  return `almadar-ring-glow-${ringIdCounter}`;
6779
6738
  }, []);
@@ -6935,7 +6894,7 @@ var init_Input = __esm({
6935
6894
  "components/core/atoms/Input.tsx"() {
6936
6895
  init_cn();
6937
6896
  init_Icon();
6938
- Input = React97__default.forwardRef(
6897
+ Input = React93__default.forwardRef(
6939
6898
  ({
6940
6899
  className,
6941
6900
  inputType,
@@ -7056,7 +7015,7 @@ var Label;
7056
7015
  var init_Label = __esm({
7057
7016
  "components/core/atoms/Label.tsx"() {
7058
7017
  init_cn();
7059
- Label = React97__default.forwardRef(
7018
+ Label = React93__default.forwardRef(
7060
7019
  ({ className, required, children, ...props }, ref) => {
7061
7020
  return /* @__PURE__ */ jsxs(
7062
7021
  "label",
@@ -7082,7 +7041,7 @@ var Textarea;
7082
7041
  var init_Textarea = __esm({
7083
7042
  "components/core/atoms/Textarea.tsx"() {
7084
7043
  init_cn();
7085
- Textarea = React97__default.forwardRef(
7044
+ Textarea = React93__default.forwardRef(
7086
7045
  ({ className, error, ...props }, ref) => {
7087
7046
  return /* @__PURE__ */ jsx(
7088
7047
  "textarea",
@@ -7112,7 +7071,7 @@ var init_Select = __esm({
7112
7071
  "components/core/atoms/Select.tsx"() {
7113
7072
  init_cn();
7114
7073
  init_Icon();
7115
- Select = React97__default.forwardRef(
7074
+ Select = React93__default.forwardRef(
7116
7075
  ({ className, options, placeholder, error, ...props }, ref) => {
7117
7076
  return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
7118
7077
  /* @__PURE__ */ jsxs(
@@ -7154,7 +7113,7 @@ var Checkbox;
7154
7113
  var init_Checkbox = __esm({
7155
7114
  "components/core/atoms/Checkbox.tsx"() {
7156
7115
  init_cn();
7157
- Checkbox = React97__default.forwardRef(
7116
+ Checkbox = React93__default.forwardRef(
7158
7117
  ({ className, label, id, ...props }, ref) => {
7159
7118
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
7160
7119
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
@@ -7245,7 +7204,7 @@ var init_Card = __esm({
7245
7204
  chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
7246
7205
  "tile-image-first": "p-0 overflow-hidden"
7247
7206
  };
7248
- Card = React97__default.forwardRef(
7207
+ Card = React93__default.forwardRef(
7249
7208
  ({
7250
7209
  className,
7251
7210
  variant = "bordered",
@@ -7283,9 +7242,9 @@ var init_Card = __esm({
7283
7242
  }
7284
7243
  );
7285
7244
  Card.displayName = "Card";
7286
- CardHeader = React97__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
7245
+ CardHeader = React93__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
7287
7246
  CardHeader.displayName = "CardHeader";
7288
- CardTitle = React97__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7247
+ CardTitle = React93__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7289
7248
  "h3",
7290
7249
  {
7291
7250
  ref,
@@ -7298,11 +7257,11 @@ var init_Card = __esm({
7298
7257
  }
7299
7258
  ));
7300
7259
  CardTitle.displayName = "CardTitle";
7301
- CardContent = React97__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
7260
+ CardContent = React93__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
7302
7261
  CardContent.displayName = "CardContent";
7303
7262
  CardBody = CardContent;
7304
7263
  CardBody.displayName = "CardBody";
7305
- CardFooter = React97__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7264
+ CardFooter = React93__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7306
7265
  "div",
7307
7266
  {
7308
7267
  ref,
@@ -7313,7 +7272,7 @@ var init_Card = __esm({
7313
7272
  CardFooter.displayName = "CardFooter";
7314
7273
  }
7315
7274
  });
7316
- var variantStyles5, sizeStyles4, iconSizes, FilterPill;
7275
+ var variantStyles5, sizeStyles3, iconSizes, FilterPill;
7317
7276
  var init_FilterPill = __esm({
7318
7277
  "components/core/atoms/FilterPill.tsx"() {
7319
7278
  init_cn();
@@ -7347,7 +7306,7 @@ var init_FilterPill = __esm({
7347
7306
  "border-[length:var(--border-width-thin)] border-border"
7348
7307
  ].join(" ")
7349
7308
  };
7350
- sizeStyles4 = {
7309
+ sizeStyles3 = {
7351
7310
  sm: "px-2 py-0.5 text-xs",
7352
7311
  md: "px-2.5 py-1 text-sm",
7353
7312
  lg: "px-3 py-1.5 text-base"
@@ -7357,7 +7316,7 @@ var init_FilterPill = __esm({
7357
7316
  md: "w-3.5 h-3.5",
7358
7317
  lg: "w-4 h-4"
7359
7318
  };
7360
- FilterPill = React97__default.forwardRef(
7319
+ FilterPill = React93__default.forwardRef(
7361
7320
  ({
7362
7321
  className,
7363
7322
  variant = "default",
@@ -7391,7 +7350,7 @@ var init_FilterPill = __esm({
7391
7350
  className: cn(
7392
7351
  "inline-flex items-center gap-1 font-bold rounded-pill",
7393
7352
  variantStyles5[variant],
7394
- sizeStyles4[size],
7353
+ sizeStyles3[size],
7395
7354
  (onClick || clickEvent) && "cursor-pointer",
7396
7355
  className
7397
7356
  ),
@@ -7423,18 +7382,18 @@ var init_FilterPill = __esm({
7423
7382
  FilterPill.displayName = "FilterPill";
7424
7383
  }
7425
7384
  });
7426
- var sizeStyles5, Spinner;
7385
+ var sizeStyles4, Spinner;
7427
7386
  var init_Spinner = __esm({
7428
7387
  "components/core/atoms/Spinner.tsx"() {
7429
7388
  init_cn();
7430
7389
  init_Icon();
7431
- sizeStyles5 = {
7390
+ sizeStyles4 = {
7432
7391
  xs: "h-3 w-3",
7433
7392
  sm: "h-icon-default w-icon-default",
7434
7393
  md: "h-6 w-6",
7435
7394
  lg: "h-8 w-8"
7436
7395
  };
7437
- Spinner = React97__default.forwardRef(
7396
+ Spinner = React93__default.forwardRef(
7438
7397
  ({ className, size = "md", ...props }, ref) => {
7439
7398
  return /* @__PURE__ */ jsx(
7440
7399
  "div",
@@ -7442,7 +7401,7 @@ var init_Spinner = __esm({
7442
7401
  ref,
7443
7402
  className: cn("text-foreground", className),
7444
7403
  ...props,
7445
- children: /* @__PURE__ */ jsx(Icon, { name: "loader", className: cn("animate-spin", sizeStyles5[size]) })
7404
+ children: /* @__PURE__ */ jsx(Icon, { name: "loader", className: cn("animate-spin", sizeStyles4[size]) })
7446
7405
  }
7447
7406
  );
7448
7407
  }
@@ -7513,13 +7472,12 @@ var init_Avatar = __esm({
7513
7472
  actionPayload
7514
7473
  }) => {
7515
7474
  const eventBus = useEventBus();
7516
- const [imgFailed, setImgFailed] = React97__default.useState(false);
7517
- React97__default.useEffect(() => {
7475
+ const [imgFailed, setImgFailed] = React93__default.useState(false);
7476
+ React93__default.useEffect(() => {
7518
7477
  setImgFailed(false);
7519
7478
  }, [src]);
7520
7479
  const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
7521
7480
  const IconComponent = typeof iconProp === "string" ? resolveIcon(iconProp) : iconProp;
7522
- const hasImage = !!src && !imgFailed;
7523
7481
  const hasIcon = !!IconComponent;
7524
7482
  const hasInitials = !!initials && !(hasIcon && !providedInitials);
7525
7483
  const getInitialsBackground = () => "bg-primary text-primary-foreground";
@@ -7545,15 +7503,13 @@ var init_Avatar = __esm({
7545
7503
  onClick: isClickable ? handleClick : void 0,
7546
7504
  role: isClickable ? "button" : void 0,
7547
7505
  tabIndex: isClickable ? 0 : void 0,
7548
- children: hasImage ? /* @__PURE__ */ jsx(
7506
+ children: src && !imgFailed ? /* @__PURE__ */ jsx(
7549
7507
  "img",
7550
7508
  {
7551
7509
  src,
7552
7510
  alt: alt || "Avatar",
7553
7511
  className: "w-full h-full object-cover",
7554
- onError: () => {
7555
- setImgFailed(true);
7556
- }
7512
+ onError: () => setImgFailed(true)
7557
7513
  }
7558
7514
  ) : hasInitials ? /* @__PURE__ */ jsx(
7559
7515
  "div",
@@ -7734,6 +7690,7 @@ var init_ProgressBar = __esm({
7734
7690
  primary: "bg-primary",
7735
7691
  success: "bg-success",
7736
7692
  warning: "bg-warning",
7693
+ error: "bg-error",
7737
7694
  danger: "bg-error"
7738
7695
  };
7739
7696
  circularSizeClasses = {
@@ -7899,7 +7856,7 @@ var init_Radio = __esm({
7899
7856
  md: "w-2.5 h-2.5",
7900
7857
  lg: "w-3 h-3"
7901
7858
  };
7902
- Radio = React97__default.forwardRef(
7859
+ Radio = React93__default.forwardRef(
7903
7860
  ({
7904
7861
  label,
7905
7862
  helperText,
@@ -7916,12 +7873,12 @@ var init_Radio = __esm({
7916
7873
  onChange,
7917
7874
  ...props
7918
7875
  }, ref) => {
7919
- const reactId = React97__default.useId();
7876
+ const reactId = React93__default.useId();
7920
7877
  const baseId = id || `radio-${reactId}`;
7921
7878
  const hasError = !!error;
7922
7879
  const eventBus = useEventBus();
7923
- const [selected, setSelected] = React97__default.useState(value);
7924
- React97__default.useEffect(() => {
7880
+ const [selected, setSelected] = React93__default.useState(value);
7881
+ React93__default.useEffect(() => {
7925
7882
  if (value !== void 0) setSelected(value);
7926
7883
  }, [value]);
7927
7884
  const pick = (next, e) => {
@@ -8103,7 +8060,7 @@ var init_Switch = __esm({
8103
8060
  "components/core/atoms/Switch.tsx"() {
8104
8061
  "use client";
8105
8062
  init_cn();
8106
- Switch = React97.forwardRef(
8063
+ Switch = React93.forwardRef(
8107
8064
  ({
8108
8065
  checked,
8109
8066
  defaultChecked = false,
@@ -8114,10 +8071,10 @@ var init_Switch = __esm({
8114
8071
  name,
8115
8072
  className
8116
8073
  }, ref) => {
8117
- const [isChecked, setIsChecked] = React97.useState(
8074
+ const [isChecked, setIsChecked] = React93.useState(
8118
8075
  checked !== void 0 ? checked : defaultChecked
8119
8076
  );
8120
- React97.useEffect(() => {
8077
+ React93.useEffect(() => {
8121
8078
  if (checked !== void 0) {
8122
8079
  setIsChecked(checked);
8123
8080
  }
@@ -8562,7 +8519,7 @@ var Aside;
8562
8519
  var init_Aside = __esm({
8563
8520
  "components/core/atoms/Aside.tsx"() {
8564
8521
  init_cn();
8565
- Aside = React97__default.forwardRef(
8522
+ Aside = React93__default.forwardRef(
8566
8523
  ({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
8567
8524
  );
8568
8525
  Aside.displayName = "Aside";
@@ -8640,8 +8597,8 @@ var init_LawReferenceTooltip = __esm({
8640
8597
  className
8641
8598
  }) => {
8642
8599
  const { t } = useTranslate();
8643
- const [isVisible, setIsVisible] = React97__default.useState(false);
8644
- const timeoutRef = React97__default.useRef(null);
8600
+ const [isVisible, setIsVisible] = React93__default.useState(false);
8601
+ const timeoutRef = React93__default.useRef(null);
8645
8602
  const handleMouseEnter = () => {
8646
8603
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
8647
8604
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -8650,7 +8607,7 @@ var init_LawReferenceTooltip = __esm({
8650
8607
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
8651
8608
  setIsVisible(false);
8652
8609
  };
8653
- React97__default.useEffect(() => {
8610
+ React93__default.useEffect(() => {
8654
8611
  return () => {
8655
8612
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
8656
8613
  };
@@ -8835,7 +8792,7 @@ var init_TimeSlotCell = __esm({
8835
8792
  TimeSlotCell.displayName = "TimeSlotCell";
8836
8793
  }
8837
8794
  });
8838
- var statusColors, pulseRingColors, sizeStyles6, StatusDot;
8795
+ var statusColors, pulseRingColors, sizeStyles5, StatusDot;
8839
8796
  var init_StatusDot = __esm({
8840
8797
  "components/core/atoms/StatusDot.tsx"() {
8841
8798
  init_cn();
@@ -8855,12 +8812,12 @@ var init_StatusDot = __esm({
8855
8812
  warning: "ring-warning",
8856
8813
  critical: "ring-error"
8857
8814
  };
8858
- sizeStyles6 = {
8815
+ sizeStyles5 = {
8859
8816
  sm: "w-2 h-2",
8860
8817
  md: "w-2.5 h-2.5",
8861
8818
  lg: "w-3 h-3"
8862
8819
  };
8863
- StatusDot = React97__default.forwardRef(
8820
+ StatusDot = React93__default.forwardRef(
8864
8821
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
8865
8822
  return /* @__PURE__ */ jsx(
8866
8823
  "span",
@@ -8869,7 +8826,7 @@ var init_StatusDot = __esm({
8869
8826
  className: cn(
8870
8827
  "inline-block rounded-full flex-shrink-0",
8871
8828
  statusColors[status],
8872
- sizeStyles6[size],
8829
+ sizeStyles5[size],
8873
8830
  pulse && [
8874
8831
  "animate-pulse",
8875
8832
  "ring-2 ring-offset-1",
@@ -8899,12 +8856,12 @@ function resolveColor(dir, invert) {
8899
8856
  const isGood = invert ? !isPositive : isPositive;
8900
8857
  return isGood ? "text-success" : "text-error";
8901
8858
  }
8902
- var sizeStyles7, iconNameMap, TrendIndicator;
8859
+ var sizeStyles6, iconNameMap, TrendIndicator;
8903
8860
  var init_TrendIndicator = __esm({
8904
8861
  "components/core/atoms/TrendIndicator.tsx"() {
8905
8862
  init_Icon();
8906
8863
  init_cn();
8907
- sizeStyles7 = {
8864
+ sizeStyles6 = {
8908
8865
  sm: { icon: "w-3 h-3", text: "text-xs" },
8909
8866
  md: { icon: "w-4 h-4", text: "text-sm" },
8910
8867
  lg: { icon: "w-5 h-5", text: "text-base" }
@@ -8914,7 +8871,7 @@ var init_TrendIndicator = __esm({
8914
8871
  down: "trending-down",
8915
8872
  flat: "arrow-right"
8916
8873
  };
8917
- TrendIndicator = React97__default.forwardRef(
8874
+ TrendIndicator = React93__default.forwardRef(
8918
8875
  ({
8919
8876
  className,
8920
8877
  value,
@@ -8928,7 +8885,7 @@ var init_TrendIndicator = __esm({
8928
8885
  const dir = resolveDirection(value, direction);
8929
8886
  const colorClass = resolveColor(dir, invert);
8930
8887
  const iconName = iconNameMap[dir];
8931
- const styles = sizeStyles7[size];
8888
+ const styles = sizeStyles6[size];
8932
8889
  const formattedValue = value !== void 0 ? `${value > 0 ? "+" : ""}${value}%` : void 0;
8933
8890
  const ariaLabel = label ?? (formattedValue ? `${dir} ${formattedValue}` : dir);
8934
8891
  return /* @__PURE__ */ jsxs(
@@ -8981,7 +8938,7 @@ var init_RangeSlider = __esm({
8981
8938
  md: "w-4 h-4",
8982
8939
  lg: "w-5 h-5"
8983
8940
  };
8984
- RangeSlider = React97__default.forwardRef(
8941
+ RangeSlider = React93__default.forwardRef(
8985
8942
  ({
8986
8943
  className,
8987
8944
  min = 0,
@@ -9489,7 +9446,7 @@ var init_ContentSection = __esm({
9489
9446
  md: "py-16",
9490
9447
  lg: "py-24"
9491
9448
  };
9492
- ContentSection = React97__default.forwardRef(
9449
+ ContentSection = React93__default.forwardRef(
9493
9450
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
9494
9451
  return /* @__PURE__ */ jsx(
9495
9452
  Box,
@@ -10023,7 +9980,7 @@ var init_AnimatedReveal = __esm({
10023
9980
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
10024
9981
  "none": {}
10025
9982
  };
10026
- AnimatedReveal = React97__default.forwardRef(
9983
+ AnimatedReveal = React93__default.forwardRef(
10027
9984
  ({
10028
9985
  trigger = "scroll",
10029
9986
  animation = "fade-up",
@@ -10183,7 +10140,7 @@ var init_AnimatedGraphic = __esm({
10183
10140
  "components/marketing/atoms/AnimatedGraphic.tsx"() {
10184
10141
  "use client";
10185
10142
  init_cn();
10186
- AnimatedGraphic = React97__default.forwardRef(
10143
+ AnimatedGraphic = React93__default.forwardRef(
10187
10144
  ({
10188
10145
  src,
10189
10146
  svgContent,
@@ -10206,7 +10163,7 @@ var init_AnimatedGraphic = __esm({
10206
10163
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
10207
10164
  const resolvedSvg = svgContent ?? fetchedSvg;
10208
10165
  const prevAnimateRef = useRef(animate);
10209
- const setRef = React97__default.useCallback(
10166
+ const setRef = React93__default.useCallback(
10210
10167
  (node) => {
10211
10168
  containerRef.current = node;
10212
10169
  if (typeof ref === "function") ref(node);
@@ -10431,9 +10388,9 @@ function ScoreDisplay({
10431
10388
  ...rest
10432
10389
  }) {
10433
10390
  const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
10434
- const [displayValue, setDisplayValue] = React97.useState(resolvedValue);
10435
- const [isAnimating, setIsAnimating] = React97.useState(false);
10436
- React97.useEffect(() => {
10391
+ const [displayValue, setDisplayValue] = React93.useState(resolvedValue);
10392
+ const [isAnimating, setIsAnimating] = React93.useState(false);
10393
+ React93.useEffect(() => {
10437
10394
  if (!animated || displayValue === resolvedValue) {
10438
10395
  setDisplayValue(resolvedValue);
10439
10396
  return;
@@ -10503,9 +10460,9 @@ function ControlButton({
10503
10460
  className
10504
10461
  }) {
10505
10462
  const eventBus = useEventBus();
10506
- const [isPressed, setIsPressed] = React97.useState(false);
10463
+ const [isPressed, setIsPressed] = React93.useState(false);
10507
10464
  const actualPressed = pressed ?? isPressed;
10508
- const handlePointerDown = React97.useCallback(
10465
+ const handlePointerDown = React93.useCallback(
10509
10466
  (e) => {
10510
10467
  e.preventDefault();
10511
10468
  if (disabled) return;
@@ -10515,7 +10472,7 @@ function ControlButton({
10515
10472
  },
10516
10473
  [disabled, pressEvent, eventBus, onPress]
10517
10474
  );
10518
- const handlePointerUp = React97.useCallback(
10475
+ const handlePointerUp = React93.useCallback(
10519
10476
  (e) => {
10520
10477
  e.preventDefault();
10521
10478
  if (disabled) return;
@@ -10525,7 +10482,7 @@ function ControlButton({
10525
10482
  },
10526
10483
  [disabled, releaseEvent, eventBus, onRelease]
10527
10484
  );
10528
- const handlePointerLeave = React97.useCallback(
10485
+ const handlePointerLeave = React93.useCallback(
10529
10486
  (e) => {
10530
10487
  if (isPressed) {
10531
10488
  setIsPressed(false);
@@ -10593,7 +10550,7 @@ var init_ControlButton = __esm({
10593
10550
  }
10594
10551
  });
10595
10552
  function Sprite({
10596
- spritesheet,
10553
+ spritesheet = "https://almadar-kflow-assets.web.app/shared/isometric-blocks/Spritesheet/allTiles_sheet.png",
10597
10554
  frameWidth,
10598
10555
  frameHeight,
10599
10556
  frame,
@@ -10796,7 +10753,7 @@ function ResourceCounter({
10796
10753
  children: [
10797
10754
  icon && /* @__PURE__ */ jsx("span", { className: cn("flex-shrink-0", sizes.icon), children: icon }),
10798
10755
  /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: label }),
10799
- /* @__PURE__ */ jsxs("span", { className: cn("font-bold tabular-nums", color), children: [
10756
+ /* @__PURE__ */ jsxs("span", { className: cn("font-bold tabular-nums", color && (color in colorTokenClasses2 ? colorTokenClasses2[color] : color)), children: [
10800
10757
  value,
10801
10758
  max != null && /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
10802
10759
  "/",
@@ -10807,10 +10764,18 @@ function ResourceCounter({
10807
10764
  }
10808
10765
  );
10809
10766
  }
10810
- var sizeMap5;
10767
+ var colorTokenClasses2, sizeMap5;
10811
10768
  var init_ResourceCounter = __esm({
10812
10769
  "components/game/atoms/ResourceCounter.tsx"() {
10813
10770
  init_cn();
10771
+ colorTokenClasses2 = {
10772
+ primary: "text-primary",
10773
+ secondary: "text-secondary",
10774
+ success: "text-success",
10775
+ warning: "text-warning",
10776
+ error: "text-error",
10777
+ muted: "text-muted-foreground"
10778
+ };
10814
10779
  sizeMap5 = {
10815
10780
  sm: { wrapper: "text-xs gap-1 px-1.5 py-0.5", icon: "text-sm" },
10816
10781
  md: { wrapper: "text-sm gap-1.5 px-2 py-1", icon: "text-base" },
@@ -11014,14 +10979,20 @@ function XPBar({
11014
10979
  }) {
11015
10980
  const sizes = sizeMap9[size];
11016
10981
  const percentage = max > 0 ? Math.max(0, Math.min(100, current / max * 100)) : 0;
11017
- const [fillWidth, setFillWidth] = React97.useState(animated ? 0 : percentage);
11018
- React97.useEffect(() => {
10982
+ const [fillWidth, setFillWidth] = React93.useState(animated ? 0 : percentage);
10983
+ React93.useEffect(() => {
11019
10984
  if (!animated) {
11020
10985
  setFillWidth(percentage);
11021
10986
  return;
11022
10987
  }
11023
- const frame = requestAnimationFrame(() => setFillWidth(percentage));
11024
- return () => cancelAnimationFrame(frame);
10988
+ let frame2;
10989
+ const frame1 = requestAnimationFrame(() => {
10990
+ frame2 = requestAnimationFrame(() => setFillWidth(percentage));
10991
+ });
10992
+ return () => {
10993
+ cancelAnimationFrame(frame1);
10994
+ cancelAnimationFrame(frame2);
10995
+ };
11025
10996
  }, [animated, percentage]);
11026
10997
  return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2", className), children: [
11027
10998
  level != null && /* @__PURE__ */ jsxs(
@@ -11059,7 +11030,7 @@ function XPBar({
11059
11030
  )
11060
11031
  }
11061
11032
  ),
11062
- showLabel && /* @__PURE__ */ jsxs("span", { className: cn("text-muted-foreground tabular-nums", sizes.text), children: [
11033
+ showLabel && /* @__PURE__ */ jsxs("span", { className: cn("text-foreground/70 tabular-nums", sizes.text), children: [
11063
11034
  current,
11064
11035
  " / ",
11065
11036
  max,
@@ -11177,7 +11148,7 @@ function StatusEffect({
11177
11148
  ),
11178
11149
  title: label,
11179
11150
  children: [
11180
- /* @__PURE__ */ jsx("span", { className: cn("flex items-center justify-center", sizes.icon), children: icon }),
11151
+ /* @__PURE__ */ jsx("span", { className: cn("flex items-center justify-center", sizes.icon), children: /* @__PURE__ */ jsx(Icon, { name: icon, size: "sm" }) }),
11181
11152
  duration !== void 0 && /* @__PURE__ */ jsx(
11182
11153
  "span",
11183
11154
  {
@@ -11208,6 +11179,7 @@ var sizeMap11, variantStyles7;
11208
11179
  var init_StatusEffect = __esm({
11209
11180
  "components/game/atoms/StatusEffect.tsx"() {
11210
11181
  init_cn();
11182
+ init_Icon();
11211
11183
  sizeMap11 = {
11212
11184
  sm: { container: "w-8 h-8", icon: "text-sm", badge: "text-xs -top-1 -right-1 w-4 h-4", timer: "text-[9px]" },
11213
11185
  md: { container: "w-10 h-10", icon: "text-base", badge: "text-xs -top-1 -right-1 w-5 h-5", timer: "text-xs" },
@@ -11273,7 +11245,7 @@ var init_DamageNumber = __esm({
11273
11245
  function DialogueBubble({
11274
11246
  speaker,
11275
11247
  text,
11276
- portrait,
11248
+ portrait = "https://almadar-kflow-assets.web.app/shared/characters/archetypes/00_base_model.png",
11277
11249
  position = "bottom",
11278
11250
  className
11279
11251
  }) {
@@ -11441,9 +11413,9 @@ function MiniMap({
11441
11413
  viewportRect,
11442
11414
  className
11443
11415
  }) {
11444
- const canvasRef = React97.useRef(null);
11445
- const frameRef = React97.useRef(0);
11446
- React97.useEffect(() => {
11416
+ const canvasRef = React93.useRef(null);
11417
+ const frameRef = React93.useRef(0);
11418
+ React93.useEffect(() => {
11447
11419
  const canvas = canvasRef.current;
11448
11420
  if (!canvas) return;
11449
11421
  const ctx = canvas.getContext("2d");
@@ -11617,7 +11589,7 @@ var init_ErrorBoundary = __esm({
11617
11589
  }
11618
11590
  );
11619
11591
  };
11620
- ErrorBoundary = class extends React97__default.Component {
11592
+ ErrorBoundary = class extends React93__default.Component {
11621
11593
  constructor(props) {
11622
11594
  super(props);
11623
11595
  __publicField(this, "reset", () => {
@@ -11892,11 +11864,11 @@ var init_wrapCallbackForEvent = __esm({
11892
11864
  "runtime/wrapCallbackForEvent.ts"() {
11893
11865
  }
11894
11866
  });
11895
- var sizeStyles8, paddingStyles3, Container;
11867
+ var sizeStyles7, paddingStyles3, Container;
11896
11868
  var init_Container = __esm({
11897
11869
  "components/core/molecules/Container.tsx"() {
11898
11870
  init_cn();
11899
- sizeStyles8 = {
11871
+ sizeStyles7 = {
11900
11872
  xs: "max-w-xs",
11901
11873
  // 320px
11902
11874
  sm: "max-w-screen-sm",
@@ -11934,7 +11906,7 @@ var init_Container = __esm({
11934
11906
  {
11935
11907
  className: cn(
11936
11908
  "w-full",
11937
- sizeStyles8[resolvedSize],
11909
+ sizeStyles7[resolvedSize],
11938
11910
  paddingStyles3[padding],
11939
11911
  center && "mx-auto",
11940
11912
  className
@@ -12696,7 +12668,7 @@ var init_Tooltip = __esm({
12696
12668
  setIsVisible(false);
12697
12669
  }, hideDelay);
12698
12670
  };
12699
- useEffect(() => {
12671
+ useLayoutEffect(() => {
12700
12672
  if (isVisible) {
12701
12673
  updatePosition();
12702
12674
  }
@@ -12707,8 +12679,8 @@ var init_Tooltip = __esm({
12707
12679
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
12708
12680
  };
12709
12681
  }, []);
12710
- const triggerElement = React97__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
12711
- const trigger = React97__default.cloneElement(triggerElement, {
12682
+ const triggerElement = React93__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
12683
+ const trigger = React93__default.cloneElement(triggerElement, {
12712
12684
  ref: triggerRef,
12713
12685
  onMouseEnter: handleMouseEnter,
12714
12686
  onMouseLeave: handleMouseLeave,
@@ -12855,8 +12827,8 @@ var init_Popover = __esm({
12855
12827
  onMouseEnter: handleOpen,
12856
12828
  onMouseLeave: handleClose
12857
12829
  };
12858
- const childElement = React97__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
12859
- const triggerElement = React97__default.cloneElement(
12830
+ const childElement = React93__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
12831
+ const triggerElement = React93__default.cloneElement(
12860
12832
  childElement,
12861
12833
  {
12862
12834
  ref: triggerRef,
@@ -12872,7 +12844,10 @@ var init_Popover = __esm({
12872
12844
  "bg-card border-2 border-border shadow-elevation-popover",
12873
12845
  className
12874
12846
  ),
12875
- style: computePopoverStyle(position, triggerRect, popoverWidth),
12847
+ style: {
12848
+ ...computePopoverStyle(position, triggerRect, popoverWidth),
12849
+ ...popoverWidth === 0 ? { visibility: "hidden" } : void 0
12850
+ },
12876
12851
  role: "dialog",
12877
12852
  onMouseEnter: trigger === "hover" ? handleOpen : void 0,
12878
12853
  onMouseLeave: trigger === "hover" ? handleClose : void 0,
@@ -12982,8 +12957,8 @@ var init_Menu = __esm({
12982
12957
  };
12983
12958
  const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
12984
12959
  const subMenuSideClass = direction === "rtl" ? "right-full mr-2" : "left-full ml-2";
12985
- const triggerChild = React97__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
12986
- const triggerElement = React97__default.cloneElement(
12960
+ const triggerChild = React93__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
12961
+ const triggerElement = React93__default.cloneElement(
12987
12962
  triggerChild,
12988
12963
  {
12989
12964
  ref: triggerRef,
@@ -13390,12 +13365,12 @@ var init_MapView = __esm({
13390
13365
  shadowSize: [41, 41]
13391
13366
  });
13392
13367
  L.Marker.prototype.options.icon = defaultIcon;
13393
- const { useEffect: useEffect76, useRef: useRef69, useCallback: useCallback122, useState: useState113 } = React97__default;
13368
+ const { useEffect: useEffect76, useRef: useRef68, useCallback: useCallback118, useState: useState110 } = React93__default;
13394
13369
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
13395
13370
  const { useEventBus: useEventBus3 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
13396
13371
  function MapUpdater({ centerLat, centerLng, zoom }) {
13397
13372
  const map = useMap();
13398
- const prevRef = useRef69({ centerLat, centerLng, zoom });
13373
+ const prevRef = useRef68({ centerLat, centerLng, zoom });
13399
13374
  useEffect76(() => {
13400
13375
  const prev = prevRef.current;
13401
13376
  if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
@@ -13435,8 +13410,8 @@ var init_MapView = __esm({
13435
13410
  showAttribution = true
13436
13411
  }) {
13437
13412
  const eventBus = useEventBus3();
13438
- const [clickedPosition, setClickedPosition] = useState113(null);
13439
- const handleMapClick = useCallback122((lat, lng) => {
13413
+ const [clickedPosition, setClickedPosition] = useState110(null);
13414
+ const handleMapClick = useCallback118((lat, lng) => {
13440
13415
  if (showClickedPin) {
13441
13416
  setClickedPosition({ lat, lng });
13442
13417
  }
@@ -13445,7 +13420,7 @@ var init_MapView = __esm({
13445
13420
  eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
13446
13421
  }
13447
13422
  }, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
13448
- const handleMarkerClick = useCallback122((marker) => {
13423
+ const handleMarkerClick = useCallback118((marker) => {
13449
13424
  onMarkerClick?.(marker);
13450
13425
  if (markerClickEvent) {
13451
13426
  eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
@@ -13454,7 +13429,7 @@ var init_MapView = __esm({
13454
13429
  return /* @__PURE__ */ jsx(
13455
13430
  Box,
13456
13431
  {
13457
- className: cn("relative isolate w-full overflow-hidden rounded-lg", className),
13432
+ className: cn("relative isolate z-0 w-full overflow-hidden rounded-lg", className),
13458
13433
  style: { height },
13459
13434
  "data-testid": "map-view",
13460
13435
  children: /* @__PURE__ */ jsxs(
@@ -13636,7 +13611,7 @@ function InputPattern({
13636
13611
  fieldName
13637
13612
  }) {
13638
13613
  const { emit } = useEventBus();
13639
- const [localValue, setLocalValue] = React97__default.useState(value);
13614
+ const [localValue, setLocalValue] = React93__default.useState(value);
13640
13615
  const handleChange = (e) => {
13641
13616
  setLocalValue(e.target.value);
13642
13617
  if (onChange) {
@@ -13674,7 +13649,7 @@ function TextareaPattern({
13674
13649
  fieldName
13675
13650
  }) {
13676
13651
  const { emit } = useEventBus();
13677
- const [localValue, setLocalValue] = React97__default.useState(value);
13652
+ const [localValue, setLocalValue] = React93__default.useState(value);
13678
13653
  const handleChange = (e) => {
13679
13654
  setLocalValue(e.target.value);
13680
13655
  if (onChange) {
@@ -13706,7 +13681,7 @@ function SelectPattern({
13706
13681
  fieldName
13707
13682
  }) {
13708
13683
  const { emit } = useEventBus();
13709
- const [localValue, setLocalValue] = React97__default.useState(value);
13684
+ const [localValue, setLocalValue] = React93__default.useState(value);
13710
13685
  const handleChange = (e) => {
13711
13686
  setLocalValue(e.target.value);
13712
13687
  if (onChange) {
@@ -13735,7 +13710,7 @@ function CheckboxPattern({
13735
13710
  className
13736
13711
  }) {
13737
13712
  const { emit } = useEventBus();
13738
- const [localChecked, setLocalChecked] = React97__default.useState(checked);
13713
+ const [localChecked, setLocalChecked] = React93__default.useState(checked);
13739
13714
  const handleChange = (e) => {
13740
13715
  setLocalChecked(e.target.checked);
13741
13716
  if (onChange) {
@@ -13923,6 +13898,7 @@ var init_ComponentPatterns = __esm({
13923
13898
  init_ProgressBar();
13924
13899
  init_Card();
13925
13900
  init_Typography();
13901
+ init_cn();
13926
13902
  init_Alert();
13927
13903
  init_Tooltip();
13928
13904
  init_Popover();
@@ -13966,8 +13942,8 @@ function ActionButtons({
13966
13942
  disabled
13967
13943
  }) {
13968
13944
  const eventBus = useEventBus();
13969
- const [activeButtons, setActiveButtons] = React97.useState(/* @__PURE__ */ new Set());
13970
- const handlePress = React97.useCallback(
13945
+ const [activeButtons, setActiveButtons] = React93.useState(/* @__PURE__ */ new Set());
13946
+ const handlePress = React93.useCallback(
13971
13947
  (id) => {
13972
13948
  setActiveButtons((prev) => new Set(prev).add(id));
13973
13949
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -13975,7 +13951,7 @@ function ActionButtons({
13975
13951
  },
13976
13952
  [actionEvent, eventBus, onAction]
13977
13953
  );
13978
- const handleRelease = React97.useCallback(
13954
+ const handleRelease = React93.useCallback(
13979
13955
  (id) => {
13980
13956
  setActiveButtons((prev) => {
13981
13957
  const next = new Set(prev);
@@ -14256,259 +14232,6 @@ var init_AnimatedCounter = __esm({
14256
14232
  AnimatedCounter.displayName = "AnimatedCounter";
14257
14233
  }
14258
14234
  });
14259
- var ALL_CATEGORY, GridPicker;
14260
- var init_GridPicker = __esm({
14261
- "components/core/molecules/GridPicker.tsx"() {
14262
- "use client";
14263
- init_cn();
14264
- init_Input();
14265
- init_Badge();
14266
- init_Stack();
14267
- ALL_CATEGORY = "__all__";
14268
- GridPicker = ({
14269
- items,
14270
- value,
14271
- onChange,
14272
- categories,
14273
- searchPlaceholder,
14274
- renderThumbnail,
14275
- cellSize = 32,
14276
- className
14277
- }) => {
14278
- const [search, setSearch] = useState("");
14279
- const [activeCategory, setActiveCategory] = useState(ALL_CATEGORY);
14280
- const gridRef = useRef(null);
14281
- const categoryChips = useMemo(() => {
14282
- if (categories !== void 0) return categories;
14283
- const seen = [];
14284
- for (const item of items) {
14285
- if (!seen.includes(item.category)) seen.push(item.category);
14286
- }
14287
- return seen;
14288
- }, [categories, items]);
14289
- const filtered = useMemo(() => {
14290
- const needle = search.trim().toLowerCase();
14291
- return items.filter((item) => {
14292
- const matchesCategory = activeCategory === ALL_CATEGORY || item.category === activeCategory;
14293
- const matchesSearch = needle === "" || item.label.toLowerCase().includes(needle);
14294
- return matchesCategory && matchesSearch;
14295
- });
14296
- }, [items, search, activeCategory]);
14297
- const select = useCallback(
14298
- (item) => {
14299
- onChange(item.id);
14300
- },
14301
- [onChange]
14302
- );
14303
- const handleKeyDown = useCallback(
14304
- (e, index) => {
14305
- const cells = gridRef.current?.querySelectorAll(
14306
- "[data-gridpicker-cell]"
14307
- );
14308
- if (cells === void 0 || cells.length === 0) return;
14309
- const columns = (() => {
14310
- const grid = gridRef.current;
14311
- if (grid === null) return 1;
14312
- const style = window.getComputedStyle(grid);
14313
- const cols = style.gridTemplateColumns.split(" ").filter(Boolean).length;
14314
- return cols > 0 ? cols : 1;
14315
- })();
14316
- let next = -1;
14317
- if (e.key === "ArrowRight") next = index + 1;
14318
- else if (e.key === "ArrowLeft") next = index - 1;
14319
- else if (e.key === "ArrowDown") next = index + columns;
14320
- else if (e.key === "ArrowUp") next = index - columns;
14321
- else if (e.key === "Enter" || e.key === " ") {
14322
- e.preventDefault();
14323
- select(filtered[index]);
14324
- return;
14325
- } else {
14326
- return;
14327
- }
14328
- e.preventDefault();
14329
- if (next >= 0 && next < cells.length) {
14330
- cells[next].focus();
14331
- }
14332
- },
14333
- [filtered, select]
14334
- );
14335
- return /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: cn("w-full", className), children: [
14336
- /* @__PURE__ */ jsx(
14337
- Input,
14338
- {
14339
- type: "search",
14340
- icon: "search",
14341
- value: search,
14342
- placeholder: searchPlaceholder,
14343
- clearable: true,
14344
- onClear: () => setSearch(""),
14345
- onChange: (e) => setSearch(e.target.value)
14346
- }
14347
- ),
14348
- categoryChips.length > 0 && /* @__PURE__ */ jsxs(HStack, { gap: "xs", wrap: true, children: [
14349
- /* @__PURE__ */ jsx(
14350
- Badge,
14351
- {
14352
- variant: activeCategory === ALL_CATEGORY ? "primary" : "neutral",
14353
- size: "sm",
14354
- role: "button",
14355
- tabIndex: 0,
14356
- "aria-pressed": activeCategory === ALL_CATEGORY,
14357
- className: "cursor-pointer",
14358
- onClick: () => setActiveCategory(ALL_CATEGORY),
14359
- onKeyDown: (e) => {
14360
- if (e.key === "Enter" || e.key === " ") {
14361
- e.preventDefault();
14362
- setActiveCategory(ALL_CATEGORY);
14363
- }
14364
- },
14365
- children: "All"
14366
- }
14367
- ),
14368
- categoryChips.map((category) => /* @__PURE__ */ jsx(
14369
- Badge,
14370
- {
14371
- variant: activeCategory === category ? "primary" : "neutral",
14372
- size: "sm",
14373
- role: "button",
14374
- tabIndex: 0,
14375
- "aria-pressed": activeCategory === category,
14376
- className: "cursor-pointer",
14377
- onClick: () => setActiveCategory(category),
14378
- onKeyDown: (e) => {
14379
- if (e.key === "Enter" || e.key === " ") {
14380
- e.preventDefault();
14381
- setActiveCategory(category);
14382
- }
14383
- },
14384
- children: category
14385
- },
14386
- category
14387
- ))
14388
- ] }),
14389
- /* @__PURE__ */ jsx(
14390
- "div",
14391
- {
14392
- ref: gridRef,
14393
- role: "listbox",
14394
- className: "grid gap-1 overflow-y-auto max-h-64 p-1",
14395
- style: {
14396
- gridTemplateColumns: `repeat(auto-fill, minmax(${cellSize}px, 1fr))`
14397
- },
14398
- children: filtered.map((item, index) => {
14399
- const selected = item.id === value;
14400
- return /* @__PURE__ */ jsx(
14401
- "button",
14402
- {
14403
- type: "button",
14404
- role: "option",
14405
- "aria-selected": selected,
14406
- "aria-label": item.label,
14407
- title: item.label,
14408
- "data-gridpicker-cell": true,
14409
- tabIndex: selected || value === void 0 && index === 0 ? 0 : -1,
14410
- onClick: () => select(item),
14411
- onKeyDown: (e) => handleKeyDown(e, index),
14412
- className: cn(
14413
- "flex items-center justify-center rounded-sm",
14414
- "transition-colors hover:bg-muted",
14415
- "focus:outline-none focus:ring-1 focus:ring-ring",
14416
- selected && "bg-primary/10 ring-1 ring-primary"
14417
- ),
14418
- style: { width: cellSize, height: cellSize },
14419
- children: renderThumbnail(item)
14420
- },
14421
- item.id
14422
- );
14423
- })
14424
- }
14425
- )
14426
- ] });
14427
- };
14428
- GridPicker.displayName = "GridPicker";
14429
- }
14430
- });
14431
- function iconForKind(kind) {
14432
- if (kind === "audio") return "music";
14433
- if (kind === "model") return "box";
14434
- return "file";
14435
- }
14436
- var THUMB_PX, IMAGE_KINDS, AssetPicker;
14437
- var init_AssetPicker = __esm({
14438
- "components/core/molecules/AssetPicker.tsx"() {
14439
- "use client";
14440
- init_GridPicker();
14441
- init_Icon();
14442
- THUMB_PX = 32;
14443
- IMAGE_KINDS = /* @__PURE__ */ new Set([
14444
- "image",
14445
- "spritesheet",
14446
- "scene",
14447
- "portrait"
14448
- ]);
14449
- AssetPicker = ({
14450
- assets,
14451
- value,
14452
- onChange,
14453
- className
14454
- }) => {
14455
- const byUrl = useMemo(() => {
14456
- const map = /* @__PURE__ */ new Map();
14457
- for (const entry of assets) map.set(entry.url, entry);
14458
- return map;
14459
- }, [assets]);
14460
- const items = useMemo(
14461
- () => assets.map((entry) => ({
14462
- id: entry.url,
14463
- label: entry.name,
14464
- category: entry.category
14465
- })),
14466
- [assets]
14467
- );
14468
- const categories = useMemo(() => {
14469
- const seen = [];
14470
- for (const entry of assets) {
14471
- if (!seen.includes(entry.category)) seen.push(entry.category);
14472
- }
14473
- return seen;
14474
- }, [assets]);
14475
- const renderThumbnail = useCallback(
14476
- (item) => {
14477
- const entry = byUrl.get(item.id);
14478
- if (entry === void 0) return null;
14479
- if (IMAGE_KINDS.has(entry.kind)) {
14480
- return /* @__PURE__ */ jsx(
14481
- "img",
14482
- {
14483
- src: entry.thumbnailUrl ?? entry.url,
14484
- alt: entry.name,
14485
- loading: "lazy",
14486
- width: THUMB_PX,
14487
- height: THUMB_PX,
14488
- style: { width: THUMB_PX, height: THUMB_PX, objectFit: "cover" }
14489
- }
14490
- );
14491
- }
14492
- return /* @__PURE__ */ jsx(Icon, { name: iconForKind(entry.kind), size: "sm" });
14493
- },
14494
- [byUrl]
14495
- );
14496
- return /* @__PURE__ */ jsx(
14497
- GridPicker,
14498
- {
14499
- items,
14500
- value,
14501
- onChange,
14502
- categories,
14503
- renderThumbnail,
14504
- cellSize: THUMB_PX,
14505
- className
14506
- }
14507
- );
14508
- };
14509
- AssetPicker.displayName = "AssetPicker";
14510
- }
14511
- });
14512
14235
  var AuthLayout;
14513
14236
  var init_AuthLayout = __esm({
14514
14237
  "components/marketing/templates/AuthLayout.tsx"() {
@@ -16392,6 +16115,263 @@ var init_katex_min = __esm({
16392
16115
  "node_modules/katex/dist/katex.min.css"() {
16393
16116
  }
16394
16117
  });
16118
+ var Tabs;
16119
+ var init_Tabs = __esm({
16120
+ "components/core/molecules/Tabs.tsx"() {
16121
+ "use client";
16122
+ init_Icon();
16123
+ init_Badge();
16124
+ init_Typography();
16125
+ init_Box();
16126
+ init_cn();
16127
+ init_useEventBus();
16128
+ Tabs = ({
16129
+ items,
16130
+ tabs,
16131
+ defaultActiveTab,
16132
+ activeTab: controlledActiveTab,
16133
+ onTabChange,
16134
+ tabChangeEvent,
16135
+ variant = "default",
16136
+ orientation = "horizontal",
16137
+ className
16138
+ }) => {
16139
+ const rawItems = items ?? tabs ?? [];
16140
+ const safeItems = rawItems.map(({ id, value, ...rest }) => ({
16141
+ ...rest,
16142
+ id: id || value || ""
16143
+ }));
16144
+ const eventBus = useEventBus();
16145
+ const { t } = useTranslate();
16146
+ const initialActive = safeItems.find((item) => item.active)?.id;
16147
+ const [internalActiveTab, setInternalActiveTab] = useState(
16148
+ defaultActiveTab || initialActive || safeItems[0]?.id || ""
16149
+ );
16150
+ const activeTab = controlledActiveTab !== void 0 ? controlledActiveTab : internalActiveTab;
16151
+ const tabRefs = useRef({});
16152
+ const handleTabChange = (tabId, tabEvent) => {
16153
+ if (controlledActiveTab === void 0) {
16154
+ setInternalActiveTab(tabId);
16155
+ }
16156
+ onTabChange?.(tabId);
16157
+ if (tabChangeEvent) {
16158
+ eventBus.emit(`UI:${tabChangeEvent}`, { tabId });
16159
+ }
16160
+ if (tabEvent) {
16161
+ eventBus.emit(`UI:${tabEvent}`, { tabId });
16162
+ }
16163
+ };
16164
+ const handleKeyDown = (e, index) => {
16165
+ if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
16166
+ e.preventDefault();
16167
+ const direction = e.key === "ArrowLeft" ? -1 : 1;
16168
+ const nextIndex = (index + direction + safeItems.length) % safeItems.length;
16169
+ const nextTab = safeItems[nextIndex];
16170
+ if (nextTab && !nextTab.disabled) {
16171
+ handleTabChange(nextTab.id);
16172
+ tabRefs.current[nextTab.id]?.focus();
16173
+ }
16174
+ } else if (e.key === "Home" || e.key === "End") {
16175
+ e.preventDefault();
16176
+ const targetIndex = e.key === "Home" ? 0 : safeItems.length - 1;
16177
+ const targetTab = safeItems[targetIndex];
16178
+ if (targetTab && !targetTab.disabled) {
16179
+ handleTabChange(targetTab.id);
16180
+ tabRefs.current[targetTab.id]?.focus();
16181
+ }
16182
+ }
16183
+ };
16184
+ const activeTabContent = safeItems.find((item) => item.id === activeTab)?.content;
16185
+ if (safeItems.length === 0) {
16186
+ return /* @__PURE__ */ jsx(Box, { className: cn("w-full", className), children: /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "py-4", children: t("empty.noItems") }) });
16187
+ }
16188
+ const variantClasses2 = {
16189
+ default: [
16190
+ "border-b-[length:var(--border-width)] border-transparent",
16191
+ "hover:border-muted-foreground",
16192
+ "data-[active=true]:border-primary"
16193
+ ].join(" "),
16194
+ pills: [
16195
+ "rounded-sm",
16196
+ "data-[active=true]:bg-primary",
16197
+ "data-[active=true]:text-primary-foreground"
16198
+ ].join(" "),
16199
+ underline: [
16200
+ "border-b-[length:var(--border-width)] border-transparent",
16201
+ "data-[active=true]:border-primary"
16202
+ ].join(" ")
16203
+ };
16204
+ return /* @__PURE__ */ jsxs(Box, { className: cn("w-full", className), children: [
16205
+ /* @__PURE__ */ jsx(
16206
+ Box,
16207
+ {
16208
+ role: "tablist",
16209
+ className: cn(
16210
+ "flex",
16211
+ // Horizontal tab strip becomes a horizontally-scrollable lane
16212
+ // below its container width — phones with many tabs scroll
16213
+ // instead of clipping. `snap-x` snaps to each tab; the
16214
+ // scrollbar is hidden for a cleaner affordance (the swipe
16215
+ // gesture is the discoverability cue).
16216
+ orientation === "horizontal" ? "flex-row border-b-[length:var(--border-width)] border-border overflow-x-auto snap-x snap-mandatory [&::-webkit-scrollbar]:hidden" : "flex-col border-r-[length:var(--border-width)] border-border",
16217
+ variant === "pills" && "gap-1 p-1 bg-muted border-0 rounded-md",
16218
+ variant === "underline" && orientation === "vertical" && "border-b-0"
16219
+ ),
16220
+ children: safeItems.map((item, index) => {
16221
+ const isActive = item.id === activeTab;
16222
+ const isDisabled = item.disabled;
16223
+ return /* @__PURE__ */ jsxs(
16224
+ Box,
16225
+ {
16226
+ as: "button",
16227
+ ref: (el) => {
16228
+ tabRefs.current[item.id] = el;
16229
+ },
16230
+ role: "tab",
16231
+ "aria-selected": isActive,
16232
+ "aria-controls": `tabpanel-${item.id}`,
16233
+ "aria-disabled": isDisabled,
16234
+ onClick: () => !isDisabled && handleTabChange(item.id, item.event),
16235
+ onKeyDown: (e) => handleKeyDown(e, index),
16236
+ "data-active": isActive,
16237
+ className: cn(
16238
+ "flex items-center gap-2 px-4 py-2 text-sm font-medium transition-all whitespace-nowrap",
16239
+ orientation === "horizontal" && "snap-start shrink-0",
16240
+ "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
16241
+ isDisabled && "opacity-50 cursor-not-allowed",
16242
+ variantClasses2[variant],
16243
+ isActive ? variant === "pills" ? "text-primary-foreground font-bold" : "text-foreground font-bold" : "text-muted-foreground hover:text-foreground"
16244
+ ),
16245
+ children: [
16246
+ item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: item.icon, size: "sm" }) : /* @__PURE__ */ jsx(Icon, { icon: item.icon, size: "sm" })),
16247
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: isActive ? "semibold" : "normal", className: "!text-inherit", children: item.label }),
16248
+ item.badge !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: item.badge })
16249
+ ]
16250
+ },
16251
+ item.id
16252
+ );
16253
+ })
16254
+ }
16255
+ ),
16256
+ activeTabContent !== void 0 && activeTabContent !== null && /* @__PURE__ */ jsx(
16257
+ Box,
16258
+ {
16259
+ role: "tabpanel",
16260
+ id: `tabpanel-${activeTab}`,
16261
+ "aria-labelledby": `tab-${activeTab}`,
16262
+ className: "mt-4",
16263
+ children: activeTabContent
16264
+ }
16265
+ )
16266
+ ] });
16267
+ };
16268
+ Tabs.displayName = "Tabs";
16269
+ }
16270
+ });
16271
+ var ICON_NAME_ALIASES, lookStyles3, EmptyState;
16272
+ var init_EmptyState = __esm({
16273
+ "components/core/molecules/EmptyState.tsx"() {
16274
+ "use client";
16275
+ init_cn();
16276
+ init_atoms2();
16277
+ init_Box();
16278
+ init_Icon();
16279
+ init_Stack();
16280
+ init_Typography();
16281
+ init_useEventBus();
16282
+ ICON_NAME_ALIASES = {
16283
+ check: "check-circle",
16284
+ error: "x-circle",
16285
+ warning: "alert-circle"
16286
+ };
16287
+ lookStyles3 = {
16288
+ "icon-only": "",
16289
+ illustrated: "[&_svg]:w-32 [&_svg]:h-32",
16290
+ "text-only": "[&_svg]:hidden",
16291
+ mascot: "[&_svg]:w-24 [&_svg]:h-24 [&_svg]:rounded-pill"
16292
+ };
16293
+ EmptyState = ({
16294
+ icon,
16295
+ title,
16296
+ message,
16297
+ description,
16298
+ actionLabel,
16299
+ onAction,
16300
+ className,
16301
+ destructive,
16302
+ variant,
16303
+ actionEvent,
16304
+ look = "icon-only"
16305
+ }) => {
16306
+ const eventBus = useEventBus();
16307
+ const { t } = useTranslate();
16308
+ const handleAction = () => {
16309
+ if (actionEvent) eventBus.emit(`UI:${actionEvent}`, {});
16310
+ onAction?.();
16311
+ };
16312
+ const iconName = typeof icon === "string" ? ICON_NAME_ALIASES[icon] ?? icon : void 0;
16313
+ const iconComponent = typeof icon === "function" ? icon : void 0;
16314
+ const hasIcon = Boolean(iconName || iconComponent);
16315
+ const isDestructive = destructive || variant === "error";
16316
+ const isSuccess = variant === "success";
16317
+ const displayText = title || message || t("empty.noItems");
16318
+ return /* @__PURE__ */ jsxs(
16319
+ VStack,
16320
+ {
16321
+ align: "center",
16322
+ className: cn(
16323
+ "justify-center py-12 text-center",
16324
+ lookStyles3[look],
16325
+ className
16326
+ ),
16327
+ children: [
16328
+ hasIcon && /* @__PURE__ */ jsx(
16329
+ Box,
16330
+ {
16331
+ className: cn(
16332
+ "mb-4 rounded-full p-3",
16333
+ isDestructive ? "bg-error/10" : isSuccess ? "bg-success/10" : "bg-muted"
16334
+ ),
16335
+ children: /* @__PURE__ */ jsx(
16336
+ Icon,
16337
+ {
16338
+ ...iconName ? { name: iconName } : { icon: iconComponent },
16339
+ className: cn(
16340
+ "h-8 w-8",
16341
+ isDestructive ? "text-error" : isSuccess ? "text-success" : "text-muted-foreground"
16342
+ )
16343
+ }
16344
+ )
16345
+ }
16346
+ ),
16347
+ /* @__PURE__ */ jsx(
16348
+ Typography,
16349
+ {
16350
+ variant: "h3",
16351
+ className: cn(
16352
+ "text-lg font-medium",
16353
+ isDestructive ? "text-error" : isSuccess ? "text-success" : "text-foreground"
16354
+ ),
16355
+ children: displayText
16356
+ }
16357
+ ),
16358
+ description && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "mt-1 text-muted-foreground max-w-sm", children: description }),
16359
+ actionLabel && (onAction || actionEvent) && /* @__PURE__ */ jsx(
16360
+ Button,
16361
+ {
16362
+ className: "mt-4",
16363
+ variant: isDestructive ? "danger" : "primary",
16364
+ onClick: handleAction,
16365
+ children: actionLabel
16366
+ }
16367
+ )
16368
+ ]
16369
+ }
16370
+ );
16371
+ };
16372
+ EmptyState.displayName = "EmptyState";
16373
+ }
16374
+ });
16395
16375
  function computeFoldRegions(code) {
16396
16376
  const lines = code.split("\n");
16397
16377
  const regions = [];
@@ -16429,9 +16409,32 @@ function computeFoldRegions(code) {
16429
16409
  function toCodeLanguage(value) {
16430
16410
  return value && CODE_LANGUAGE_SET.has(value) ? value : "text";
16431
16411
  }
16432
- var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log6, CODE_LANGUAGES, CODE_LANGUAGE_SET, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
16412
+ function generateDiff(oldVal, newVal) {
16413
+ const oldLines = oldVal.split("\n");
16414
+ const newLines = newVal.split("\n");
16415
+ const diff = [];
16416
+ const maxLen = Math.max(oldLines.length, newLines.length);
16417
+ for (let i = 0; i < maxLen; i++) {
16418
+ const oldLine = oldLines[i];
16419
+ const newLine = newLines[i];
16420
+ if (oldLine === newLine) {
16421
+ diff.push({ type: "context", content: oldLine ?? "", lineNumber: i + 1 });
16422
+ } else {
16423
+ if (oldLine !== void 0) diff.push({ type: "remove", content: oldLine, lineNumber: i + 1 });
16424
+ if (newLine !== void 0) diff.push({ type: "add", content: newLine, lineNumber: i + 1 });
16425
+ }
16426
+ }
16427
+ return diff;
16428
+ }
16429
+ var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log6, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
16433
16430
  var init_CodeBlock = __esm({
16434
16431
  "components/core/molecules/markdown/CodeBlock.tsx"() {
16432
+ init_cn();
16433
+ init_atoms2();
16434
+ init_Tabs();
16435
+ init_LoadingState();
16436
+ init_ErrorState();
16437
+ init_EmptyState();
16435
16438
  init_Box();
16436
16439
  init_Button();
16437
16440
  init_Badge();
@@ -16538,9 +16541,14 @@ var init_CodeBlock = __esm({
16538
16541
  "lolo"
16539
16542
  ];
16540
16543
  CODE_LANGUAGE_SET = new Set(CODE_LANGUAGES);
16544
+ DIFF_STYLES = {
16545
+ add: { bg: "bg-success/10", prefix: "+", text: "text-success" },
16546
+ remove: { bg: "bg-error/10", prefix: "-", text: "text-error" },
16547
+ context: { bg: "", prefix: " ", text: "text-foreground" }
16548
+ };
16541
16549
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
16542
16550
  HIDDEN_LINE_NUMBERS = { display: "none" };
16543
- CodeBlock = React97__default.memo(
16551
+ CodeBlock = React93__default.memo(
16544
16552
  ({
16545
16553
  code: rawCode,
16546
16554
  language = "text",
@@ -16551,7 +16559,20 @@ var init_CodeBlock = __esm({
16551
16559
  className,
16552
16560
  editable = false,
16553
16561
  onChange,
16554
- errorLines
16562
+ errorLines,
16563
+ // viewer props
16564
+ title,
16565
+ mode = "code",
16566
+ diff: propDiff,
16567
+ oldValue,
16568
+ newValue,
16569
+ showLineNumbers = false,
16570
+ wordWrap = false,
16571
+ files,
16572
+ actions,
16573
+ isLoading = false,
16574
+ error,
16575
+ showCopy
16555
16576
  }) => {
16556
16577
  const code = typeof rawCode === "string" ? rawCode : String(rawCode ?? "");
16557
16578
  const isOrb = language === "orb";
@@ -16563,6 +16584,20 @@ var init_CodeBlock = __esm({
16563
16584
  const codeRef = useRef(null);
16564
16585
  const savedScrollLeftRef = useRef(0);
16565
16586
  const [copied, setCopied] = useState(false);
16587
+ const [wrap, setWrap] = useState(wordWrap);
16588
+ const [activeFileIndex, setActiveFileIndex] = useState(0);
16589
+ const activeFile = files?.[activeFileIndex];
16590
+ const activeCode = activeFile?.code ?? code;
16591
+ const activeLanguage = activeFile?.language ?? language;
16592
+ const diffLines = useMemo(() => {
16593
+ if (propDiff) return propDiff;
16594
+ if (mode === "diff" && oldValue !== void 0 && newValue !== void 0) {
16595
+ return generateDiff(oldValue, newValue);
16596
+ }
16597
+ return null;
16598
+ }, [propDiff, mode, oldValue, newValue]);
16599
+ const isViewerMode = !!(title || files || showLineNumbers || diffLines || mode === "diff" || actions);
16600
+ const effectiveCopy = showCopy ?? showCopyButton;
16566
16601
  const [editableValue, setEditableValue] = useState(code);
16567
16602
  const [editableTextareaKey, setEditableTextareaKey] = useState(0);
16568
16603
  const lastPropCodeRef = useRef(code);
@@ -16733,13 +16768,13 @@ var init_CodeBlock = __esm({
16733
16768
  }, [language, code]);
16734
16769
  const handleCopy = async () => {
16735
16770
  try {
16736
- await navigator.clipboard.writeText(code);
16771
+ await navigator.clipboard.writeText(activeCode);
16737
16772
  setCopied(true);
16738
- eventBus.emit("UI:COPY_CODE", { language, success: true });
16773
+ eventBus.emit("UI:COPY_CODE", { language: activeLanguage, success: true });
16739
16774
  setTimeout(() => setCopied(false), 2e3);
16740
16775
  } catch (err) {
16741
16776
  log6.error("Failed to copy code", { error: err instanceof Error ? err : String(err) });
16742
- eventBus.emit("UI:COPY_CODE", { language, success: false });
16777
+ eventBus.emit("UI:COPY_CODE", { language: activeLanguage, success: false });
16743
16778
  }
16744
16779
  };
16745
16780
  const handleSelectionCopy = useCallback((e) => {
@@ -16792,11 +16827,134 @@ var init_CodeBlock = __esm({
16792
16827
  }
16793
16828
  });
16794
16829
  }
16795
- const full = code.split("\n").slice(a, endLine + 1).join("\n");
16830
+ const full = activeCode.split("\n").slice(a, endLine + 1).join("\n");
16796
16831
  e.clipboardData.setData("text/plain", full);
16797
16832
  e.preventDefault();
16798
16833
  }, [code]);
16799
- const hasHeader = showLanguageBadge || showCopyButton;
16834
+ if (isLoading) {
16835
+ return /* @__PURE__ */ jsx(LoadingState, { message: t("common.loading"), className });
16836
+ }
16837
+ if (error) {
16838
+ return /* @__PURE__ */ jsx(ErrorState, { title: t("display.codeViewerError"), message: error.message, className });
16839
+ }
16840
+ if (isViewerMode && !activeCode && !diffLines) {
16841
+ return /* @__PURE__ */ jsx(EmptyState, { icon: Code, title: t("display.noCode"), description: "No code to display.", className });
16842
+ }
16843
+ if (isViewerMode) {
16844
+ const tabItems = files?.map((file, idx) => ({
16845
+ id: `file-${idx}`,
16846
+ label: file.label,
16847
+ content: null
16848
+ }));
16849
+ const lines = activeCode.split("\n");
16850
+ return /* @__PURE__ */ jsx(Card, { className: cn("overflow-hidden", className), children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column" }, children: [
16851
+ tabItems && tabItems.length > 1 && /* @__PURE__ */ jsx(Box, { className: "border-b border-border", children: /* @__PURE__ */ jsx(
16852
+ Tabs,
16853
+ {
16854
+ tabs: tabItems,
16855
+ activeTab: `file-${activeFileIndex}`,
16856
+ onTabChange: (id) => {
16857
+ const idx = parseInt(id.replace("file-", ""), 10);
16858
+ setActiveFileIndex(idx);
16859
+ }
16860
+ }
16861
+ ) }),
16862
+ /* @__PURE__ */ jsxs(
16863
+ HStack,
16864
+ {
16865
+ gap: "sm",
16866
+ align: "center",
16867
+ justify: "between",
16868
+ className: "px-4 py-2 border-b border-border bg-muted/30",
16869
+ children: [
16870
+ /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
16871
+ /* @__PURE__ */ jsx(Icon, { icon: mode === "diff" ? FileText : Code, size: "sm", className: "text-muted-foreground" }),
16872
+ title && /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "truncate", children: title }),
16873
+ activeLanguage && activeLanguage !== "text" && /* @__PURE__ */ jsx(Badge, { variant: "default", children: activeLanguage })
16874
+ ] }),
16875
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
16876
+ /* @__PURE__ */ jsx(
16877
+ Button,
16878
+ {
16879
+ variant: "ghost",
16880
+ size: "sm",
16881
+ icon: WrapText,
16882
+ onClick: () => setWrap(!wrap),
16883
+ className: cn(wrap && "text-primary")
16884
+ }
16885
+ ),
16886
+ effectiveCopy && /* @__PURE__ */ jsx(
16887
+ Button,
16888
+ {
16889
+ variant: "ghost",
16890
+ size: "sm",
16891
+ icon: copied ? Check : Copy,
16892
+ onClick: handleCopy,
16893
+ className: cn(copied && "text-success")
16894
+ }
16895
+ ),
16896
+ actions?.map((action, idx) => /* @__PURE__ */ jsx(
16897
+ Badge,
16898
+ {
16899
+ variant: "default",
16900
+ className: "cursor-pointer hover:opacity-80 transition-opacity",
16901
+ onClick: () => {
16902
+ if (action.event) eventBus.emit(`UI:${action.event}`, {});
16903
+ },
16904
+ children: action.label
16905
+ },
16906
+ idx
16907
+ ))
16908
+ ] })
16909
+ ]
16910
+ }
16911
+ ),
16912
+ /* @__PURE__ */ jsx(Box, { className: "overflow-auto bg-muted/20", style: { maxHeight }, children: diffLines ? /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column" }, className: "font-mono text-xs", children: diffLines.map((line, idx) => {
16913
+ const style = DIFF_STYLES[line.type];
16914
+ return /* @__PURE__ */ jsxs(HStack, { gap: "none", align: "start", className: cn(style.bg, "px-4 py-0.5"), children: [
16915
+ showLineNumbers && /* @__PURE__ */ jsx(
16916
+ Typography,
16917
+ {
16918
+ variant: "caption",
16919
+ color: "secondary",
16920
+ className: "w-8 text-right mr-3 select-none tabular-nums flex-shrink-0",
16921
+ children: line.lineNumber ?? ""
16922
+ }
16923
+ ),
16924
+ /* @__PURE__ */ jsxs(
16925
+ Typography,
16926
+ {
16927
+ variant: "caption",
16928
+ className: cn("font-mono flex-1 min-w-0", style.text, wrap ? "whitespace-pre-wrap break-all" : "whitespace-pre"),
16929
+ children: [
16930
+ /* @__PURE__ */ jsx(Box, { as: "span", className: "select-none opacity-50 mr-2", children: style.prefix }),
16931
+ line.content
16932
+ ]
16933
+ }
16934
+ )
16935
+ ] }, idx);
16936
+ }) }) : /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column" }, className: "font-mono text-xs", children: lines.map((line, idx) => /* @__PURE__ */ jsxs(HStack, { gap: "none", align: "start", className: "px-4 py-0.5 hover:bg-muted/50", children: [
16937
+ showLineNumbers && /* @__PURE__ */ jsx(
16938
+ Typography,
16939
+ {
16940
+ variant: "caption",
16941
+ color: "secondary",
16942
+ className: "w-8 text-right mr-4 select-none tabular-nums flex-shrink-0",
16943
+ children: idx + 1
16944
+ }
16945
+ ),
16946
+ /* @__PURE__ */ jsx(
16947
+ Typography,
16948
+ {
16949
+ variant: "caption",
16950
+ className: cn("font-mono flex-1 min-w-0", wrap ? "whitespace-pre-wrap break-all" : "whitespace-pre"),
16951
+ children: line || " "
16952
+ }
16953
+ )
16954
+ ] }, idx)) }) })
16955
+ ] }) });
16956
+ }
16957
+ const hasHeader = showLanguageBadge || effectiveCopy;
16800
16958
  return /* @__PURE__ */ jsxs(Box, { className: `relative group ${className || ""}`, style: { display: "flex", flexDirection: "column", height: "100%" }, children: [
16801
16959
  hasHeader && /* @__PURE__ */ jsxs(
16802
16960
  HStack,
@@ -16806,7 +16964,7 @@ var init_CodeBlock = __esm({
16806
16964
  className: "px-3 py-2 bg-[var(--color-card)] rounded-t-lg border-b border-gray-700",
16807
16965
  children: [
16808
16966
  showLanguageBadge && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: language }),
16809
- showCopyButton && /* @__PURE__ */ jsx(
16967
+ effectiveCopy && /* @__PURE__ */ jsx(
16810
16968
  Button,
16811
16969
  {
16812
16970
  variant: "ghost",
@@ -16965,7 +17123,7 @@ var init_CodeBlock = __esm({
16965
17123
  )
16966
17124
  ] });
16967
17125
  },
16968
- (prev, next) => prev.language === next.language && prev.code === next.code && prev.showCopyButton === next.showCopyButton && prev.maxHeight === next.maxHeight && prev.foldable === next.foldable && prev.editable === next.editable && prev.onChange === next.onChange && prev.errorLines === next.errorLines
17126
+ (prev, next) => prev.language === next.language && prev.code === next.code && prev.showCopyButton === next.showCopyButton && prev.showCopy === next.showCopy && prev.maxHeight === next.maxHeight && prev.foldable === next.foldable && prev.editable === next.editable && prev.onChange === next.onChange && prev.errorLines === next.errorLines && prev.mode === next.mode && prev.title === next.title && prev.diff === next.diff && prev.files === next.files && prev.actions === next.actions && prev.isLoading === next.isLoading && prev.error === next.error
16969
17127
  );
16970
17128
  CodeBlock.displayName = "CodeBlock";
16971
17129
  }
@@ -16977,7 +17135,7 @@ var init_MarkdownContent = __esm({
16977
17135
  init_Box();
16978
17136
  init_CodeBlock();
16979
17137
  init_cn();
16980
- MarkdownContent = React97__default.memo(
17138
+ MarkdownContent = React93__default.memo(
16981
17139
  ({ content, direction, className }) => {
16982
17140
  const { t: _t } = useTranslate();
16983
17141
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -18073,7 +18231,7 @@ var init_StateMachineView = __esm({
18073
18231
  style: { top: title ? 30 : 0 },
18074
18232
  children: [
18075
18233
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
18076
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React97__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
18234
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React93__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
18077
18235
  StateNode,
18078
18236
  {
18079
18237
  state,
@@ -19222,110 +19380,6 @@ var init_BookTableOfContents = __esm({
19222
19380
  BookTableOfContents.displayName = "BookTableOfContents";
19223
19381
  }
19224
19382
  });
19225
- var ICON_NAME_ALIASES, lookStyles3, EmptyState;
19226
- var init_EmptyState = __esm({
19227
- "components/core/molecules/EmptyState.tsx"() {
19228
- "use client";
19229
- init_cn();
19230
- init_atoms2();
19231
- init_Box();
19232
- init_Icon();
19233
- init_Stack();
19234
- init_Typography();
19235
- init_useEventBus();
19236
- ICON_NAME_ALIASES = {
19237
- check: "check-circle",
19238
- error: "x-circle",
19239
- warning: "alert-circle"
19240
- };
19241
- lookStyles3 = {
19242
- "icon-only": "",
19243
- illustrated: "[&_svg]:w-32 [&_svg]:h-32",
19244
- "text-only": "[&_svg]:hidden",
19245
- mascot: "[&_svg]:w-24 [&_svg]:h-24 [&_svg]:rounded-pill"
19246
- };
19247
- EmptyState = ({
19248
- icon,
19249
- title,
19250
- message,
19251
- description,
19252
- actionLabel,
19253
- onAction,
19254
- className,
19255
- destructive,
19256
- variant,
19257
- actionEvent,
19258
- look = "icon-only"
19259
- }) => {
19260
- const eventBus = useEventBus();
19261
- const { t } = useTranslate();
19262
- const handleAction = () => {
19263
- if (actionEvent) eventBus.emit(`UI:${actionEvent}`, {});
19264
- onAction?.();
19265
- };
19266
- const iconName = typeof icon === "string" ? ICON_NAME_ALIASES[icon] ?? icon : void 0;
19267
- const iconComponent = typeof icon === "function" ? icon : void 0;
19268
- const hasIcon = Boolean(iconName || iconComponent);
19269
- const isDestructive = destructive || variant === "error";
19270
- const isSuccess = variant === "success";
19271
- const displayText = title || message || t("empty.noItems");
19272
- return /* @__PURE__ */ jsxs(
19273
- VStack,
19274
- {
19275
- align: "center",
19276
- className: cn(
19277
- "justify-center py-12 text-center",
19278
- lookStyles3[look],
19279
- className
19280
- ),
19281
- children: [
19282
- hasIcon && /* @__PURE__ */ jsx(
19283
- Box,
19284
- {
19285
- className: cn(
19286
- "mb-4 rounded-full p-3",
19287
- isDestructive ? "bg-error/10" : isSuccess ? "bg-success/10" : "bg-muted"
19288
- ),
19289
- children: /* @__PURE__ */ jsx(
19290
- Icon,
19291
- {
19292
- ...iconName ? { name: iconName } : { icon: iconComponent },
19293
- className: cn(
19294
- "h-8 w-8",
19295
- isDestructive ? "text-error" : isSuccess ? "text-success" : "text-muted-foreground"
19296
- )
19297
- }
19298
- )
19299
- }
19300
- ),
19301
- /* @__PURE__ */ jsx(
19302
- Typography,
19303
- {
19304
- variant: "h3",
19305
- className: cn(
19306
- "text-lg font-medium",
19307
- isDestructive ? "text-error" : isSuccess ? "text-success" : "text-foreground"
19308
- ),
19309
- children: displayText
19310
- }
19311
- ),
19312
- description && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "mt-1 text-muted-foreground max-w-sm", children: description }),
19313
- actionLabel && (onAction || actionEvent) && /* @__PURE__ */ jsx(
19314
- Button,
19315
- {
19316
- className: "mt-4",
19317
- variant: isDestructive ? "danger" : "primary",
19318
- onClick: handleAction,
19319
- children: actionLabel
19320
- }
19321
- )
19322
- ]
19323
- }
19324
- );
19325
- };
19326
- EmptyState.displayName = "EmptyState";
19327
- }
19328
- });
19329
19383
 
19330
19384
  // components/core/organisms/book/types.ts
19331
19385
  function resolveFieldMap(fieldMap) {
@@ -19678,7 +19732,7 @@ var init_Grid = __esm({
19678
19732
  as: Component = "div"
19679
19733
  }) => {
19680
19734
  const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
19681
- return React97__default.createElement(
19735
+ return React93__default.createElement(
19682
19736
  Component,
19683
19737
  {
19684
19738
  className: cn(
@@ -24121,449 +24175,6 @@ var init_ClassifierBoard = __esm({
24121
24175
  ClassifierBoard.displayName = "ClassifierBoard";
24122
24176
  }
24123
24177
  });
24124
- function CodeView({
24125
- data,
24126
- label,
24127
- defaultExpanded = false,
24128
- className
24129
- }) {
24130
- const { t } = useTranslate();
24131
- const [expanded, setExpanded] = useState(defaultExpanded);
24132
- const jsonString = JSON.stringify(data, null, 2);
24133
- return /* @__PURE__ */ jsxs(VStack, { className: cn("rounded-lg border border-border overflow-hidden", className), gap: "none", children: [
24134
- /* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between p-2 bg-muted", gap: "sm", children: [
24135
- /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground font-medium", children: label ?? t("stateArchitect.viewCode") }),
24136
- /* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: () => setExpanded(!expanded), className: "text-xs", children: expanded ? t("stateArchitect.hideJson") : t("stateArchitect.showJson") })
24137
- ] }),
24138
- expanded && /* @__PURE__ */ jsx(Box, { className: "p-3 bg-background overflow-x-auto", children: /* @__PURE__ */ jsx(
24139
- Typography,
24140
- {
24141
- variant: "caption",
24142
- className: "text-foreground font-mono whitespace-pre text-xs leading-relaxed block",
24143
- children: jsonString
24144
- }
24145
- ) })
24146
- ] });
24147
- }
24148
- var init_CodeView = __esm({
24149
- "components/game/organisms/puzzles/state-architect/CodeView.tsx"() {
24150
- init_atoms2();
24151
- init_cn();
24152
- CodeView.displayName = "CodeView";
24153
- }
24154
- });
24155
- var Tabs;
24156
- var init_Tabs = __esm({
24157
- "components/core/molecules/Tabs.tsx"() {
24158
- "use client";
24159
- init_Icon();
24160
- init_Badge();
24161
- init_Typography();
24162
- init_Box();
24163
- init_cn();
24164
- init_useEventBus();
24165
- Tabs = ({
24166
- items,
24167
- tabs,
24168
- defaultActiveTab,
24169
- activeTab: controlledActiveTab,
24170
- onTabChange,
24171
- tabChangeEvent,
24172
- variant = "default",
24173
- orientation = "horizontal",
24174
- className
24175
- }) => {
24176
- const rawItems = items ?? tabs ?? [];
24177
- const safeItems = rawItems.map(({ id, value, ...rest }) => ({
24178
- ...rest,
24179
- id: id || value || ""
24180
- }));
24181
- const eventBus = useEventBus();
24182
- const { t } = useTranslate();
24183
- const initialActive = safeItems.find((item) => item.active)?.id;
24184
- const [internalActiveTab, setInternalActiveTab] = useState(
24185
- defaultActiveTab || initialActive || safeItems[0]?.id || ""
24186
- );
24187
- const activeTab = controlledActiveTab !== void 0 ? controlledActiveTab : internalActiveTab;
24188
- const tabRefs = useRef({});
24189
- const handleTabChange = (tabId, tabEvent) => {
24190
- if (controlledActiveTab === void 0) {
24191
- setInternalActiveTab(tabId);
24192
- }
24193
- onTabChange?.(tabId);
24194
- if (tabChangeEvent) {
24195
- eventBus.emit(`UI:${tabChangeEvent}`, { tabId });
24196
- }
24197
- if (tabEvent) {
24198
- eventBus.emit(`UI:${tabEvent}`, { tabId });
24199
- }
24200
- };
24201
- const handleKeyDown = (e, index) => {
24202
- if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
24203
- e.preventDefault();
24204
- const direction = e.key === "ArrowLeft" ? -1 : 1;
24205
- const nextIndex = (index + direction + safeItems.length) % safeItems.length;
24206
- const nextTab = safeItems[nextIndex];
24207
- if (nextTab && !nextTab.disabled) {
24208
- handleTabChange(nextTab.id);
24209
- tabRefs.current[nextTab.id]?.focus();
24210
- }
24211
- } else if (e.key === "Home" || e.key === "End") {
24212
- e.preventDefault();
24213
- const targetIndex = e.key === "Home" ? 0 : safeItems.length - 1;
24214
- const targetTab = safeItems[targetIndex];
24215
- if (targetTab && !targetTab.disabled) {
24216
- handleTabChange(targetTab.id);
24217
- tabRefs.current[targetTab.id]?.focus();
24218
- }
24219
- }
24220
- };
24221
- const activeTabContent = safeItems.find((item) => item.id === activeTab)?.content;
24222
- if (safeItems.length === 0) {
24223
- return /* @__PURE__ */ jsx(Box, { className: cn("w-full", className), children: /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "py-4", children: t("empty.noItems") }) });
24224
- }
24225
- const variantClasses2 = {
24226
- default: [
24227
- "border-b-[length:var(--border-width)] border-transparent",
24228
- "hover:border-muted-foreground",
24229
- "data-[active=true]:border-primary"
24230
- ].join(" "),
24231
- pills: [
24232
- "rounded-sm",
24233
- "data-[active=true]:bg-primary",
24234
- "data-[active=true]:text-primary-foreground"
24235
- ].join(" "),
24236
- underline: [
24237
- "border-b-[length:var(--border-width)] border-transparent",
24238
- "data-[active=true]:border-primary"
24239
- ].join(" ")
24240
- };
24241
- return /* @__PURE__ */ jsxs(Box, { className: cn("w-full", className), children: [
24242
- /* @__PURE__ */ jsx(
24243
- Box,
24244
- {
24245
- role: "tablist",
24246
- className: cn(
24247
- "flex",
24248
- // Horizontal tab strip becomes a horizontally-scrollable lane
24249
- // below its container width — phones with many tabs scroll
24250
- // instead of clipping. `snap-x` snaps to each tab; the
24251
- // scrollbar is hidden for a cleaner affordance (the swipe
24252
- // gesture is the discoverability cue).
24253
- orientation === "horizontal" ? "flex-row border-b-[length:var(--border-width)] border-border overflow-x-auto snap-x snap-mandatory [&::-webkit-scrollbar]:hidden" : "flex-col border-r-[length:var(--border-width)] border-border",
24254
- variant === "pills" && "gap-1 p-1 bg-muted border-0 rounded-md",
24255
- variant === "underline" && orientation === "vertical" && "border-b-0"
24256
- ),
24257
- children: safeItems.map((item, index) => {
24258
- const isActive = item.id === activeTab;
24259
- const isDisabled = item.disabled;
24260
- return /* @__PURE__ */ jsxs(
24261
- Box,
24262
- {
24263
- as: "button",
24264
- ref: (el) => {
24265
- tabRefs.current[item.id] = el;
24266
- },
24267
- role: "tab",
24268
- "aria-selected": isActive,
24269
- "aria-controls": `tabpanel-${item.id}`,
24270
- "aria-disabled": isDisabled,
24271
- onClick: () => !isDisabled && handleTabChange(item.id, item.event),
24272
- onKeyDown: (e) => handleKeyDown(e, index),
24273
- "data-active": isActive,
24274
- className: cn(
24275
- "flex items-center gap-2 px-4 py-2 text-sm font-medium transition-all whitespace-nowrap",
24276
- orientation === "horizontal" && "snap-start shrink-0",
24277
- "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
24278
- isDisabled && "opacity-50 cursor-not-allowed",
24279
- variantClasses2[variant],
24280
- isActive ? variant === "pills" ? "text-primary-foreground font-bold" : "text-foreground font-bold" : "text-muted-foreground hover:text-foreground"
24281
- ),
24282
- children: [
24283
- item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: item.icon, size: "sm" }) : /* @__PURE__ */ jsx(Icon, { icon: item.icon, size: "sm" })),
24284
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: isActive ? "semibold" : "normal", className: "!text-inherit", children: item.label }),
24285
- item.badge !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: item.badge })
24286
- ]
24287
- },
24288
- item.id
24289
- );
24290
- })
24291
- }
24292
- ),
24293
- activeTabContent !== void 0 && activeTabContent !== null && /* @__PURE__ */ jsx(
24294
- Box,
24295
- {
24296
- role: "tabpanel",
24297
- id: `tabpanel-${activeTab}`,
24298
- "aria-labelledby": `tab-${activeTab}`,
24299
- className: "mt-4",
24300
- children: activeTabContent
24301
- }
24302
- )
24303
- ] });
24304
- };
24305
- Tabs.displayName = "Tabs";
24306
- }
24307
- });
24308
- function generateDiff(oldVal, newVal) {
24309
- const oldLines = oldVal.split("\n");
24310
- const newLines = newVal.split("\n");
24311
- const diff = [];
24312
- const maxLen = Math.max(oldLines.length, newLines.length);
24313
- for (let i = 0; i < maxLen; i++) {
24314
- const oldLine = oldLines[i];
24315
- const newLine = newLines[i];
24316
- if (oldLine === newLine) {
24317
- diff.push({ type: "context", content: oldLine ?? "", lineNumber: i + 1 });
24318
- } else {
24319
- if (oldLine !== void 0) {
24320
- diff.push({ type: "remove", content: oldLine, lineNumber: i + 1 });
24321
- }
24322
- if (newLine !== void 0) {
24323
- diff.push({ type: "add", content: newLine, lineNumber: i + 1 });
24324
- }
24325
- }
24326
- }
24327
- return diff;
24328
- }
24329
- var DIFF_STYLES, CodeViewer;
24330
- var init_CodeViewer = __esm({
24331
- "components/core/molecules/CodeViewer.tsx"() {
24332
- "use client";
24333
- init_cn();
24334
- init_atoms2();
24335
- init_Stack();
24336
- init_LoadingState();
24337
- init_ErrorState();
24338
- init_EmptyState();
24339
- init_Tabs();
24340
- init_useEventBus();
24341
- DIFF_STYLES = {
24342
- add: {
24343
- bg: "bg-success/10",
24344
- prefix: "+",
24345
- text: "text-success"
24346
- },
24347
- remove: {
24348
- bg: "bg-error/10",
24349
- prefix: "-",
24350
- text: "text-error"
24351
- },
24352
- context: {
24353
- bg: "",
24354
- prefix: " ",
24355
- text: "text-foreground"
24356
- }
24357
- };
24358
- CodeViewer = ({
24359
- title,
24360
- code,
24361
- language,
24362
- diff: propDiff,
24363
- oldValue,
24364
- newValue,
24365
- mode = "code",
24366
- showLineNumbers = true,
24367
- showCopy = true,
24368
- wordWrap = false,
24369
- maxHeight = 500,
24370
- files,
24371
- actions,
24372
- entity,
24373
- isLoading = false,
24374
- error,
24375
- className
24376
- }) => {
24377
- const eventBus = useEventBus();
24378
- const { t } = useTranslate();
24379
- const [copied, setCopied] = useState(false);
24380
- const [wrap, setWrap] = useState(wordWrap);
24381
- const [activeFileIndex, setActiveFileIndex] = useState(0);
24382
- const handleAction = useCallback(
24383
- (action) => {
24384
- if (action.event) {
24385
- eventBus.emit(`UI:${action.event}`, {});
24386
- }
24387
- },
24388
- [eventBus]
24389
- );
24390
- const activeFile = files?.[activeFileIndex];
24391
- const activeCode = activeFile?.code ?? code ?? "";
24392
- const activeLanguage = activeFile?.language ?? language ?? "text";
24393
- const lines = useMemo(() => activeCode.split("\n"), [activeCode]);
24394
- const diffLines = useMemo(() => {
24395
- if (propDiff) return propDiff;
24396
- if (mode === "diff" && oldValue !== void 0 && newValue !== void 0) {
24397
- return generateDiff(oldValue, newValue);
24398
- }
24399
- return null;
24400
- }, [propDiff, mode, oldValue, newValue]);
24401
- const handleCopy = useCallback(async () => {
24402
- try {
24403
- await navigator.clipboard.writeText(activeCode);
24404
- setCopied(true);
24405
- eventBus.emit("UI:CODE_COPY", { language: activeLanguage });
24406
- setTimeout(() => setCopied(false), 2e3);
24407
- } catch {
24408
- }
24409
- }, [activeCode, eventBus, activeLanguage]);
24410
- const tabItems = files?.map((file, idx) => ({
24411
- id: `file-${idx}`,
24412
- label: file.label,
24413
- content: null
24414
- }));
24415
- if (isLoading) {
24416
- return /* @__PURE__ */ jsx(LoadingState, { message: t("common.loading"), className });
24417
- }
24418
- if (error) {
24419
- return /* @__PURE__ */ jsx(
24420
- ErrorState,
24421
- {
24422
- title: t("display.codeViewerError"),
24423
- message: error.message,
24424
- className
24425
- }
24426
- );
24427
- }
24428
- if (!activeCode && !diffLines) {
24429
- return /* @__PURE__ */ jsx(
24430
- EmptyState,
24431
- {
24432
- icon: Code,
24433
- title: t("display.noCode"),
24434
- description: "No code to display.",
24435
- className
24436
- }
24437
- );
24438
- }
24439
- return /* @__PURE__ */ jsx(Card, { className: cn("overflow-hidden", className), children: /* @__PURE__ */ jsxs(VStack, { gap: "none", children: [
24440
- tabItems && tabItems.length > 1 && /* @__PURE__ */ jsx(Box, { className: "border-b border-border", children: /* @__PURE__ */ jsx(
24441
- Tabs,
24442
- {
24443
- tabs: tabItems,
24444
- activeTab: `file-${activeFileIndex}`,
24445
- onTabChange: (id) => {
24446
- const idx = parseInt(id.replace("file-", ""), 10);
24447
- setActiveFileIndex(idx);
24448
- }
24449
- }
24450
- ) }),
24451
- /* @__PURE__ */ jsxs(
24452
- HStack,
24453
- {
24454
- gap: "sm",
24455
- align: "center",
24456
- justify: "between",
24457
- className: "px-4 py-2 border-b border-border bg-muted/30",
24458
- children: [
24459
- /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
24460
- /* @__PURE__ */ jsx(Icon, { icon: mode === "diff" ? FileText : Code, size: "sm", className: "text-muted-foreground" }),
24461
- title && /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "truncate", children: title }),
24462
- activeLanguage && activeLanguage !== "text" && /* @__PURE__ */ jsx(Badge, { variant: "default", children: activeLanguage })
24463
- ] }),
24464
- /* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
24465
- /* @__PURE__ */ jsx(
24466
- Button,
24467
- {
24468
- variant: "ghost",
24469
- size: "sm",
24470
- icon: WrapText,
24471
- onClick: () => setWrap(!wrap),
24472
- className: cn(wrap && "text-primary")
24473
- }
24474
- ),
24475
- showCopy && /* @__PURE__ */ jsx(
24476
- Button,
24477
- {
24478
- variant: "ghost",
24479
- size: "sm",
24480
- icon: copied ? Check : Copy,
24481
- onClick: handleCopy,
24482
- className: cn(copied && "text-success")
24483
- }
24484
- ),
24485
- actions?.map((action, idx) => /* @__PURE__ */ jsx(
24486
- Badge,
24487
- {
24488
- variant: "default",
24489
- className: "cursor-pointer hover:opacity-80 transition-opacity",
24490
- onClick: () => handleAction(action),
24491
- children: action.label
24492
- },
24493
- idx
24494
- ))
24495
- ] })
24496
- ]
24497
- }
24498
- ),
24499
- /* @__PURE__ */ jsx(
24500
- Box,
24501
- {
24502
- className: "overflow-auto bg-muted/20",
24503
- style: { maxHeight },
24504
- children: diffLines ? (
24505
- /* Diff mode */
24506
- /* @__PURE__ */ jsx(VStack, { gap: "none", className: "font-mono text-xs", children: diffLines.map((line, idx) => {
24507
- const style = DIFF_STYLES[line.type];
24508
- return /* @__PURE__ */ jsxs(HStack, { gap: "none", align: "start", className: cn(style.bg, "px-4 py-0.5"), children: [
24509
- showLineNumbers && /* @__PURE__ */ jsx(
24510
- Typography,
24511
- {
24512
- variant: "caption",
24513
- color: "secondary",
24514
- className: "w-8 text-right mr-3 select-none tabular-nums flex-shrink-0",
24515
- children: line.lineNumber ?? ""
24516
- }
24517
- ),
24518
- /* @__PURE__ */ jsxs(
24519
- Typography,
24520
- {
24521
- variant: "caption",
24522
- className: cn(
24523
- "font-mono flex-1 min-w-0",
24524
- style.text,
24525
- wrap ? "whitespace-pre-wrap break-all" : "whitespace-pre"
24526
- ),
24527
- children: [
24528
- /* @__PURE__ */ jsx(Box, { as: "span", className: "select-none opacity-50 mr-2", children: style.prefix }),
24529
- line.content
24530
- ]
24531
- }
24532
- )
24533
- ] }, idx);
24534
- }) })
24535
- ) : (
24536
- /* Code mode */
24537
- /* @__PURE__ */ jsx(VStack, { gap: "none", className: "font-mono text-xs", children: lines.map((line, idx) => /* @__PURE__ */ jsxs(HStack, { gap: "none", align: "start", className: "px-4 py-0.5 hover:bg-muted/50", children: [
24538
- showLineNumbers && /* @__PURE__ */ jsx(
24539
- Typography,
24540
- {
24541
- variant: "caption",
24542
- color: "secondary",
24543
- className: "w-8 text-right mr-4 select-none tabular-nums flex-shrink-0",
24544
- children: idx + 1
24545
- }
24546
- ),
24547
- /* @__PURE__ */ jsx(
24548
- Typography,
24549
- {
24550
- variant: "caption",
24551
- className: cn(
24552
- "font-mono flex-1 min-w-0",
24553
- wrap ? "whitespace-pre-wrap break-all" : "whitespace-pre"
24554
- ),
24555
- children: line || " "
24556
- }
24557
- )
24558
- ] }, idx)) })
24559
- )
24560
- }
24561
- )
24562
- ] }) });
24563
- };
24564
- CodeViewer.displayName = "CodeViewer";
24565
- }
24566
- });
24567
24178
  function CombatLog({
24568
24179
  events: events2,
24569
24180
  maxVisible = 50,
@@ -24828,7 +24439,7 @@ function CounterMinimal({
24828
24439
  Button,
24829
24440
  {
24830
24441
  variant: "secondary",
24831
- size: sizeStyles9[size].button,
24442
+ size: sizeStyles8[size].button,
24832
24443
  onClick: onDecrement,
24833
24444
  disabled: resolved.decrementDisabled,
24834
24445
  icon: "minus",
@@ -24840,7 +24451,7 @@ function CounterMinimal({
24840
24451
  {
24841
24452
  variant: "h1",
24842
24453
  className: cn(
24843
- sizeStyles9[size].display,
24454
+ sizeStyles8[size].display,
24844
24455
  "font-bold tabular-nums min-w-[3ch] text-center"
24845
24456
  ),
24846
24457
  children: resolved.count
@@ -24850,7 +24461,7 @@ function CounterMinimal({
24850
24461
  Button,
24851
24462
  {
24852
24463
  variant: "secondary",
24853
- size: sizeStyles9[size].button,
24464
+ size: sizeStyles8[size].button,
24854
24465
  onClick: onIncrement,
24855
24466
  disabled: resolved.incrementDisabled,
24856
24467
  icon: "plus",
@@ -24885,7 +24496,7 @@ function CounterStandard({
24885
24496
  {
24886
24497
  variant: "h1",
24887
24498
  className: cn(
24888
- sizeStyles9[size].display,
24499
+ sizeStyles8[size].display,
24889
24500
  "font-bold tabular-nums text-primary-600"
24890
24501
  ),
24891
24502
  children: resolved.count
@@ -24896,7 +24507,7 @@ function CounterStandard({
24896
24507
  Button,
24897
24508
  {
24898
24509
  variant: "secondary",
24899
- size: sizeStyles9[size].button,
24510
+ size: sizeStyles8[size].button,
24900
24511
  onClick: onDecrement,
24901
24512
  disabled: resolved.decrementDisabled,
24902
24513
  icon: "minus"
@@ -24906,7 +24517,7 @@ function CounterStandard({
24906
24517
  Button,
24907
24518
  {
24908
24519
  variant: "primary",
24909
- size: sizeStyles9[size].button,
24520
+ size: sizeStyles8[size].button,
24910
24521
  onClick: onIncrement,
24911
24522
  disabled: resolved.incrementDisabled,
24912
24523
  icon: "plus"
@@ -24952,7 +24563,7 @@ function CounterFull({
24952
24563
  {
24953
24564
  variant: "h1",
24954
24565
  className: cn(
24955
- sizeStyles9[size].display,
24566
+ sizeStyles8[size].display,
24956
24567
  "font-bold tabular-nums text-primary-600"
24957
24568
  ),
24958
24569
  children: resolved.count
@@ -24965,7 +24576,7 @@ function CounterFull({
24965
24576
  Button,
24966
24577
  {
24967
24578
  variant: "secondary",
24968
- size: sizeStyles9[size].button,
24579
+ size: sizeStyles8[size].button,
24969
24580
  onClick: onDecrement,
24970
24581
  disabled: resolved.decrementDisabled,
24971
24582
  icon: "minus",
@@ -24976,7 +24587,7 @@ function CounterFull({
24976
24587
  Button,
24977
24588
  {
24978
24589
  variant: "primary",
24979
- size: sizeStyles9[size].button,
24590
+ size: sizeStyles8[size].button,
24980
24591
  onClick: onIncrement,
24981
24592
  disabled: resolved.incrementDisabled,
24982
24593
  icon: "plus",
@@ -24996,7 +24607,7 @@ function CounterFull({
24996
24607
  )
24997
24608
  ] }) });
24998
24609
  }
24999
- var sizeStyles9, CounterTemplate;
24610
+ var sizeStyles8, CounterTemplate;
25000
24611
  var init_CounterTemplate = __esm({
25001
24612
  "components/core/templates/CounterTemplate.tsx"() {
25002
24613
  init_cn();
@@ -25004,7 +24615,7 @@ var init_CounterTemplate = __esm({
25004
24615
  init_Stack();
25005
24616
  init_Typography();
25006
24617
  init_Button();
25007
- sizeStyles9 = {
24618
+ sizeStyles8 = {
25008
24619
  sm: { display: "text-4xl", button: "sm" },
25009
24620
  md: { display: "text-6xl", button: "md" },
25010
24621
  lg: { display: "text-8xl", button: "lg" }
@@ -25038,7 +24649,7 @@ function CraftingRecipe({
25038
24649
  className
25039
24650
  }) {
25040
24651
  const eventBus = useEventBus();
25041
- const handleCraft = React97.useCallback(() => {
24652
+ const handleCraft = React93.useCallback(() => {
25042
24653
  onCraft?.();
25043
24654
  if (craftEvent) {
25044
24655
  eventBus.emit(craftEvent, { output: output.label });
@@ -25055,7 +24666,7 @@ function CraftingRecipe({
25055
24666
  children: [
25056
24667
  /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
25057
24668
  const hasSufficient = ingredient.available >= ingredient.required;
25058
- return /* @__PURE__ */ jsxs(React97.Fragment, { children: [
24669
+ return /* @__PURE__ */ jsxs(React93.Fragment, { children: [
25059
24670
  /* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
25060
24671
  ItemSlot,
25061
24672
  {
@@ -25118,8 +24729,8 @@ function DPad({
25118
24729
  }) {
25119
24730
  const eventBus = useEventBus();
25120
24731
  const sizes = sizeMap15[size];
25121
- const [activeDirections, setActiveDirections] = React97.useState(/* @__PURE__ */ new Set());
25122
- const handlePress = React97.useCallback(
24732
+ const [activeDirections, setActiveDirections] = React93.useState(/* @__PURE__ */ new Set());
24733
+ const handlePress = React93.useCallback(
25123
24734
  (direction) => {
25124
24735
  setActiveDirections((prev) => new Set(prev).add(direction));
25125
24736
  if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
@@ -25127,7 +24738,7 @@ function DPad({
25127
24738
  },
25128
24739
  [directionEvent, eventBus, onDirection]
25129
24740
  );
25130
- const handleRelease = React97.useCallback(
24741
+ const handleRelease = React93.useCallback(
25131
24742
  (direction) => {
25132
24743
  setActiveDirections((prev) => {
25133
24744
  const next = new Set(prev);
@@ -25813,14 +25424,14 @@ function useDataDnd(args) {
25813
25424
  const isZone = Boolean(dragGroup || accepts || sortable);
25814
25425
  const enabled = isZone || Boolean(dndRoot);
25815
25426
  const eventBus = useEventBus();
25816
- const parentRoot = React97__default.useContext(RootCtx);
25427
+ const parentRoot = React93__default.useContext(RootCtx);
25817
25428
  const isRoot = enabled && parentRoot === null;
25818
- const zoneId = React97__default.useId();
25429
+ const zoneId = React93__default.useId();
25819
25430
  const ownGroup = dragGroup ?? accepts ?? zoneId;
25820
- const [optimisticOrders, setOptimisticOrders] = React97__default.useState(() => /* @__PURE__ */ new Map());
25821
- const optimisticOrdersRef = React97__default.useRef(optimisticOrders);
25431
+ const [optimisticOrders, setOptimisticOrders] = React93__default.useState(() => /* @__PURE__ */ new Map());
25432
+ const optimisticOrdersRef = React93__default.useRef(optimisticOrders);
25822
25433
  optimisticOrdersRef.current = optimisticOrders;
25823
- const clearOptimisticOrder = React97__default.useCallback((group) => {
25434
+ const clearOptimisticOrder = React93__default.useCallback((group) => {
25824
25435
  setOptimisticOrders((prev) => {
25825
25436
  if (!prev.has(group)) return prev;
25826
25437
  const next = new Map(prev);
@@ -25845,7 +25456,7 @@ function useDataDnd(args) {
25845
25456
  const raw = it[dndItemIdField];
25846
25457
  return String(raw ?? `__idx_${idx}`);
25847
25458
  }).join("|");
25848
- const itemIds = React97__default.useMemo(
25459
+ const itemIds = React93__default.useMemo(
25849
25460
  () => orderedItems.map((it, idx) => {
25850
25461
  const raw = it[dndItemIdField];
25851
25462
  return raw ?? `__idx_${idx}`;
@@ -25853,7 +25464,7 @@ function useDataDnd(args) {
25853
25464
  [itemIdsSignature]
25854
25465
  );
25855
25466
  const itemsContentSig = items.map((it, idx) => String(it[dndItemIdField] ?? `__${idx}`)).join("|");
25856
- React97__default.useEffect(() => {
25467
+ React93__default.useEffect(() => {
25857
25468
  const root = isRoot ? null : parentRoot;
25858
25469
  if (root) {
25859
25470
  root.clearOptimisticOrder(ownGroup);
@@ -25861,20 +25472,20 @@ function useDataDnd(args) {
25861
25472
  clearOptimisticOrder(ownGroup);
25862
25473
  }
25863
25474
  }, [itemsContentSig, ownGroup]);
25864
- const zonesRef = React97__default.useRef(/* @__PURE__ */ new Map());
25865
- const registerZone = React97__default.useCallback((zoneId2, meta2) => {
25475
+ const zonesRef = React93__default.useRef(/* @__PURE__ */ new Map());
25476
+ const registerZone = React93__default.useCallback((zoneId2, meta2) => {
25866
25477
  zonesRef.current.set(zoneId2, meta2);
25867
25478
  }, []);
25868
- const unregisterZone = React97__default.useCallback((zoneId2) => {
25479
+ const unregisterZone = React93__default.useCallback((zoneId2) => {
25869
25480
  zonesRef.current.delete(zoneId2);
25870
25481
  }, []);
25871
- const [activeDrag, setActiveDrag] = React97__default.useState(null);
25872
- const [overZoneGroup, setOverZoneGroup] = React97__default.useState(null);
25873
- const meta = React97__default.useMemo(
25482
+ const [activeDrag, setActiveDrag] = React93__default.useState(null);
25483
+ const [overZoneGroup, setOverZoneGroup] = React93__default.useState(null);
25484
+ const meta = React93__default.useMemo(
25874
25485
  () => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
25875
25486
  [ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
25876
25487
  );
25877
- React97__default.useEffect(() => {
25488
+ React93__default.useEffect(() => {
25878
25489
  const target = isRoot ? null : parentRoot;
25879
25490
  if (!target) {
25880
25491
  zonesRef.current.set(zoneId, meta);
@@ -25893,7 +25504,7 @@ function useDataDnd(args) {
25893
25504
  }, [parentRoot, isRoot, zoneId, meta]);
25894
25505
  const sensors = useAlmadarDndSensors(true);
25895
25506
  const collisionDetection = almadarDndCollisionDetection;
25896
- const findZoneByItem = React97__default.useCallback(
25507
+ const findZoneByItem = React93__default.useCallback(
25897
25508
  (id) => {
25898
25509
  for (const z of zonesRef.current.values()) {
25899
25510
  if (z.itemIds.includes(id)) return z;
@@ -25902,7 +25513,7 @@ function useDataDnd(args) {
25902
25513
  },
25903
25514
  []
25904
25515
  );
25905
- React97__default.useCallback(
25516
+ React93__default.useCallback(
25906
25517
  (group) => {
25907
25518
  for (const z of zonesRef.current.values()) {
25908
25519
  if (z.group === group) return z;
@@ -25911,7 +25522,7 @@ function useDataDnd(args) {
25911
25522
  },
25912
25523
  []
25913
25524
  );
25914
- const handleDragEnd = React97__default.useCallback(
25525
+ const handleDragEnd = React93__default.useCallback(
25915
25526
  (event) => {
25916
25527
  const { active, over } = event;
25917
25528
  const activeIdStr = String(active.id);
@@ -26002,8 +25613,8 @@ function useDataDnd(args) {
26002
25613
  },
26003
25614
  [eventBus]
26004
25615
  );
26005
- const sortableData = React97__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
26006
- const SortableItem = React97__default.useCallback(
25616
+ const sortableData = React93__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
25617
+ const SortableItem = React93__default.useCallback(
26007
25618
  ({ id, children }) => {
26008
25619
  const {
26009
25620
  attributes,
@@ -26043,7 +25654,7 @@ function useDataDnd(args) {
26043
25654
  id: droppableId,
26044
25655
  data: sortableData
26045
25656
  });
26046
- const ctx = React97__default.useContext(RootCtx);
25657
+ const ctx = React93__default.useContext(RootCtx);
26047
25658
  const activeDrag2 = ctx?.activeDrag ?? null;
26048
25659
  const overZoneGroup2 = ctx?.overZoneGroup ?? null;
26049
25660
  const isThisZoneOver = overZoneGroup2 === ownGroup;
@@ -26058,7 +25669,7 @@ function useDataDnd(args) {
26058
25669
  showForeignPlaceholder,
26059
25670
  ctxAvailable: ctx != null
26060
25671
  });
26061
- React97__default.useEffect(() => {
25672
+ React93__default.useEffect(() => {
26062
25673
  dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
26063
25674
  }, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
26064
25675
  return /* @__PURE__ */ jsx(
@@ -26072,11 +25683,11 @@ function useDataDnd(args) {
26072
25683
  }
26073
25684
  );
26074
25685
  };
26075
- const rootContextValue = React97__default.useMemo(
25686
+ const rootContextValue = React93__default.useMemo(
26076
25687
  () => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
26077
25688
  [registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
26078
25689
  );
26079
- const handleDragStart = React97__default.useCallback((event) => {
25690
+ const handleDragStart = React93__default.useCallback((event) => {
26080
25691
  const sourceZone = findZoneByItem(event.active.id);
26081
25692
  const rect = event.active.rect.current.initial;
26082
25693
  const height = rect?.height && rect.height > 0 ? rect.height : 64;
@@ -26095,7 +25706,7 @@ function useDataDnd(args) {
26095
25706
  isRoot
26096
25707
  });
26097
25708
  }, [findZoneByItem, isRoot, zoneId]);
26098
- const handleDragOver = React97__default.useCallback((event) => {
25709
+ const handleDragOver = React93__default.useCallback((event) => {
26099
25710
  const { active, over } = event;
26100
25711
  const overData = over?.data?.current;
26101
25712
  const overGroup = overData?.dndGroup ?? null;
@@ -26165,7 +25776,7 @@ function useDataDnd(args) {
26165
25776
  return next;
26166
25777
  });
26167
25778
  }, []);
26168
- const handleDragCancel = React97__default.useCallback((event) => {
25779
+ const handleDragCancel = React93__default.useCallback((event) => {
26169
25780
  setActiveDrag(null);
26170
25781
  setOverZoneGroup(null);
26171
25782
  dndLog.warn("dragCancel", {
@@ -26173,12 +25784,12 @@ function useDataDnd(args) {
26173
25784
  reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
26174
25785
  });
26175
25786
  }, []);
26176
- const handleDragEndWithCleanup = React97__default.useCallback((event) => {
25787
+ const handleDragEndWithCleanup = React93__default.useCallback((event) => {
26177
25788
  handleDragEnd(event);
26178
25789
  setActiveDrag(null);
26179
25790
  setOverZoneGroup(null);
26180
25791
  }, [handleDragEnd]);
26181
- const wrapContainer = React97__default.useCallback(
25792
+ const wrapContainer = React93__default.useCallback(
26182
25793
  (children) => {
26183
25794
  if (!enabled) return children;
26184
25795
  const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
@@ -26232,7 +25843,7 @@ var init_useDataDnd = __esm({
26232
25843
  init_useAlmadarDndCollision();
26233
25844
  init_Box();
26234
25845
  dndLog = createLogger("almadar:ui:dnd");
26235
- RootCtx = React97__default.createContext(null);
25846
+ RootCtx = React93__default.createContext(null);
26236
25847
  }
26237
25848
  });
26238
25849
  function fieldLabel2(key) {
@@ -26752,7 +26363,7 @@ function DataList({
26752
26363
  }) {
26753
26364
  const eventBus = useEventBus();
26754
26365
  const { t } = useTranslate();
26755
- const [visibleCount, setVisibleCount] = React97__default.useState(pageSize || Infinity);
26366
+ const [visibleCount, setVisibleCount] = React93__default.useState(pageSize || Infinity);
26756
26367
  const fieldDefs = fields ?? columns ?? [];
26757
26368
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
26758
26369
  const dnd = useDataDnd({
@@ -26771,7 +26382,7 @@ function DataList({
26771
26382
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
26772
26383
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
26773
26384
  const hasRenderProp = typeof children === "function";
26774
- React97__default.useEffect(() => {
26385
+ React93__default.useEffect(() => {
26775
26386
  const renderItemTypeOf = typeof schemaRenderItem;
26776
26387
  const childrenTypeOf = typeof children;
26777
26388
  if (data.length > 0 && !hasRenderProp) {
@@ -26876,7 +26487,7 @@ function DataList({
26876
26487
  const items2 = data.map((item) => item);
26877
26488
  const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
26878
26489
  const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
26879
- return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
26490
+ return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
26880
26491
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
26881
26492
  group.items.map((itemData, index) => {
26882
26493
  const id = itemData.id || `${gi}-${index}`;
@@ -27024,7 +26635,7 @@ function DataList({
27024
26635
  className
27025
26636
  ),
27026
26637
  children: [
27027
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
26638
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
27028
26639
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
27029
26640
  group.items.map(
27030
26641
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -28398,7 +28009,7 @@ var init_WizardProgress = __esm({
28398
28009
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
28399
28010
  const isActive = index === currentStep;
28400
28011
  const isCompleted = index < currentStep;
28401
- return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
28012
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
28402
28013
  /* @__PURE__ */ jsx(
28403
28014
  "button",
28404
28015
  {
@@ -28915,8 +28526,9 @@ var init_FormSectionHeader = __esm({
28915
28526
  Box,
28916
28527
  {
28917
28528
  className: cn(
28918
- "px-4 py-3 bg-muted rounded-t-lg border-b-2 border-border border-l-4 border-l-primary",
28919
- isClickable && "cursor-pointer hover:bg-[var(--color-surface-hover)] transition-colors",
28529
+ "px-5 py-4 bg-muted/60 rounded-lg",
28530
+ "border border-border border-l-4 border-l-primary",
28531
+ isClickable && "cursor-pointer hover:bg-muted transition-colors",
28920
28532
  className
28921
28533
  ),
28922
28534
  onClick: isClickable ? onToggle : void 0,
@@ -28927,7 +28539,7 @@ var init_FormSectionHeader = __esm({
28927
28539
  {
28928
28540
  name: icon,
28929
28541
  size: "md",
28930
- className: "text-primary"
28542
+ className: "text-primary shrink-0"
28931
28543
  }
28932
28544
  ),
28933
28545
  statusIcon && /* @__PURE__ */ jsx(
@@ -28935,12 +28547,15 @@ var init_FormSectionHeader = __esm({
28935
28547
  {
28936
28548
  name: statusIcon,
28937
28549
  size: "md",
28938
- className: hasErrors ? "text-error" : "text-success"
28550
+ className: cn(
28551
+ "shrink-0",
28552
+ hasErrors ? "text-error" : "text-success"
28553
+ )
28939
28554
  }
28940
28555
  ),
28941
28556
  /* @__PURE__ */ jsxs(Box, { className: "space-y-0.5", children: [
28942
- /* @__PURE__ */ jsx(Typography, { variant: "subheading", weight: "semibold", children: title }),
28943
- subtitle && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: subtitle })
28557
+ /* @__PURE__ */ jsx(Typography, { variant: "subheading", weight: "semibold", className: "text-foreground", children: title }),
28558
+ subtitle && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "leading-snug", children: subtitle })
28944
28559
  ] })
28945
28560
  ] }),
28946
28561
  /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
@@ -28949,9 +28564,9 @@ var init_FormSectionHeader = __esm({
28949
28564
  Icon,
28950
28565
  {
28951
28566
  name: "chevron-down",
28952
- size: "md",
28567
+ size: "sm",
28953
28568
  className: cn(
28954
- "text-muted-foreground transition-transform",
28569
+ "text-muted-foreground transition-transform duration-200 shrink-0",
28955
28570
  isCollapsed && "-rotate-90"
28956
28571
  )
28957
28572
  }
@@ -29009,50 +28624,6 @@ var init_FlipCard = __esm({
29009
28624
  FlipCard.displayName = "FlipCard";
29010
28625
  }
29011
28626
  });
29012
- function pascalToKebab(name) {
29013
- return name.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Z])([A-Z][a-z])/g, "$1-$2").toLowerCase();
29014
- }
29015
- function kebabToPascal3(name) {
29016
- return name.split("-").map((part) => /^\d+$/.test(part) ? part : part.charAt(0).toUpperCase() + part.slice(1)).join("");
29017
- }
29018
- var ICON_ITEMS, IconPicker;
29019
- var init_IconPicker = __esm({
29020
- "components/core/molecules/IconPicker.tsx"() {
29021
- "use client";
29022
- init_Icon();
29023
- init_GridPicker();
29024
- ICON_ITEMS = (() => {
29025
- const items = [];
29026
- for (const [exportName, candidate] of Object.entries(LucideIcons2)) {
29027
- if (!/^[A-Z]/.test(exportName)) continue;
29028
- if (exportName.endsWith("Icon")) continue;
29029
- if (exportName.startsWith("Lucide")) continue;
29030
- const isComponent = candidate !== null && (typeof candidate === "object" || typeof candidate === "function") && "$$typeof" in candidate;
29031
- if (!isComponent) continue;
29032
- const kebab = pascalToKebab(exportName);
29033
- if (kebabToPascal3(kebab) !== exportName) continue;
29034
- items.push({ id: kebab, label: kebab, category: "icons" });
29035
- }
29036
- return items;
29037
- })();
29038
- IconPicker = ({ value, onChange, className }) => {
29039
- const items = useMemo(() => ICON_ITEMS, []);
29040
- return /* @__PURE__ */ jsx(
29041
- GridPicker,
29042
- {
29043
- items,
29044
- value,
29045
- onChange,
29046
- searchPlaceholder: "Search icons\u2026",
29047
- renderThumbnail: (it) => /* @__PURE__ */ jsx(Icon, { name: it.id }),
29048
- cellSize: 32,
29049
- className
29050
- }
29051
- );
29052
- };
29053
- IconPicker.displayName = "IconPicker";
29054
- }
29055
- });
29056
28627
  function toISODate(d) {
29057
28628
  return d.toISOString().slice(0, 10);
29058
28629
  }
@@ -29497,7 +29068,7 @@ function InventoryGrid({
29497
29068
  const eventBus = useEventBus();
29498
29069
  const slotCount = totalSlots ?? items.length;
29499
29070
  const emptySlotCount = Math.max(0, slotCount - items.length);
29500
- const handleSelect = React97.useCallback(
29071
+ const handleSelect = React93.useCallback(
29501
29072
  (id) => {
29502
29073
  onSelect?.(id);
29503
29074
  if (selectEvent) {
@@ -29714,31 +29285,31 @@ function GameCanvas2D({
29714
29285
  assetBaseUrl = "",
29715
29286
  className
29716
29287
  }) {
29717
- const canvasRef = React97.useRef(null);
29718
- const rafRef = React97.useRef(0);
29719
- const frameRef = React97.useRef(0);
29720
- const lastTimeRef = React97.useRef(0);
29721
- const imageCache = React97.useRef(/* @__PURE__ */ new Map());
29288
+ const canvasRef = React93.useRef(null);
29289
+ const rafRef = React93.useRef(0);
29290
+ const frameRef = React93.useRef(0);
29291
+ const lastTimeRef = React93.useRef(0);
29292
+ const imageCache = React93.useRef(/* @__PURE__ */ new Map());
29722
29293
  const emit = useEmitEvent();
29723
- const onDrawRef = React97.useRef(onDraw);
29294
+ const onDrawRef = React93.useRef(onDraw);
29724
29295
  onDrawRef.current = onDraw;
29725
- const onTickRef = React97.useRef(onTick);
29296
+ const onTickRef = React93.useRef(onTick);
29726
29297
  onTickRef.current = onTick;
29727
- const tickEventRef = React97.useRef(tickEvent);
29298
+ const tickEventRef = React93.useRef(tickEvent);
29728
29299
  tickEventRef.current = tickEvent;
29729
- const drawEventRef = React97.useRef(drawEvent);
29300
+ const drawEventRef = React93.useRef(drawEvent);
29730
29301
  drawEventRef.current = drawEvent;
29731
- const emitRef = React97.useRef(emit);
29302
+ const emitRef = React93.useRef(emit);
29732
29303
  emitRef.current = emit;
29733
- const assetBaseUrlRef = React97.useRef(assetBaseUrl);
29304
+ const assetBaseUrlRef = React93.useRef(assetBaseUrl);
29734
29305
  assetBaseUrlRef.current = assetBaseUrl;
29735
- const backgroundImageRef = React97.useRef(backgroundImage);
29306
+ const backgroundImageRef = React93.useRef(backgroundImage);
29736
29307
  backgroundImageRef.current = backgroundImage;
29737
- const widthRef = React97.useRef(width);
29308
+ const widthRef = React93.useRef(width);
29738
29309
  widthRef.current = width;
29739
- const heightRef = React97.useRef(height);
29310
+ const heightRef = React93.useRef(height);
29740
29311
  heightRef.current = height;
29741
- const loadImage = React97.useCallback((url) => {
29312
+ const loadImage = React93.useCallback((url) => {
29742
29313
  const fullUrl = url.startsWith("http") ? url : `${assetBaseUrlRef.current}${url}`;
29743
29314
  const cached = imageCache.current.get(fullUrl);
29744
29315
  if (cached?.complete && cached.naturalWidth > 0) return cached;
@@ -29750,7 +29321,7 @@ function GameCanvas2D({
29750
29321
  }
29751
29322
  return null;
29752
29323
  }, []);
29753
- React97.useEffect(() => {
29324
+ React93.useEffect(() => {
29754
29325
  const canvas = canvasRef.current;
29755
29326
  if (!canvas) return;
29756
29327
  const ctx = canvas.getContext("2d");
@@ -30053,7 +29624,7 @@ function TurnPanel({
30053
29624
  className
30054
29625
  }) {
30055
29626
  const eventBus = useEventBus();
30056
- const handleAction = React97.useCallback(
29627
+ const handleAction = React93.useCallback(
30057
29628
  (event) => {
30058
29629
  if (event) {
30059
29630
  eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
@@ -30199,7 +29770,7 @@ function UnitCommandBar({
30199
29770
  className
30200
29771
  }) {
30201
29772
  const eventBus = useEventBus();
30202
- const handleCommand = React97.useCallback(
29773
+ const handleCommand = React93.useCallback(
30203
29774
  (event) => {
30204
29775
  if (event) {
30205
29776
  eventBus.emit(event, { unitId: selectedUnitId });
@@ -30684,7 +30255,7 @@ function GameMenu({
30684
30255
  } catch {
30685
30256
  }
30686
30257
  const eventBus = eventBusProp || eventBusFromHook;
30687
- const handleOptionClick = React97.useCallback(
30258
+ const handleOptionClick = React93.useCallback(
30688
30259
  (option) => {
30689
30260
  if (option.event && eventBus) {
30690
30261
  eventBus.emit(`UI:${option.event}`, { option });
@@ -30798,7 +30369,7 @@ function GameOverScreen({
30798
30369
  } catch {
30799
30370
  }
30800
30371
  const eventBus = eventBusProp || eventBusFromHook;
30801
- const handleActionClick = React97.useCallback(
30372
+ const handleActionClick = React93.useCallback(
30802
30373
  (action) => {
30803
30374
  if (action.event && eventBus) {
30804
30375
  eventBus.emit(`UI:${action.event}`, { action });
@@ -31509,14 +31080,14 @@ function useSafeEventBus5() {
31509
31080
  } };
31510
31081
  }
31511
31082
  }
31512
- var sizeStyles10, LONG_PRESS_DELAY, LONG_PRESS_INTERVAL, NumberStepper;
31083
+ var sizeStyles9, LONG_PRESS_DELAY, LONG_PRESS_INTERVAL, NumberStepper;
31513
31084
  var init_NumberStepper = __esm({
31514
31085
  "components/core/molecules/NumberStepper.tsx"() {
31515
31086
  "use client";
31516
31087
  init_cn();
31517
31088
  init_Icon();
31518
31089
  init_useEventBus();
31519
- sizeStyles10 = {
31090
+ sizeStyles9 = {
31520
31091
  sm: {
31521
31092
  button: "w-7 h-7",
31522
31093
  text: "text-sm min-w-[2rem]",
@@ -31554,7 +31125,7 @@ var init_NumberStepper = __esm({
31554
31125
  const timeoutRef = useRef(null);
31555
31126
  const isAtMin = min !== void 0 && value <= min;
31556
31127
  const isAtMax = max !== void 0 && value >= max;
31557
- const styles = sizeStyles10[size];
31128
+ const styles = sizeStyles9[size];
31558
31129
  const emitChange = useCallback(
31559
31130
  (newValue) => {
31560
31131
  const clamped = Math.round(newValue / step) * step;
@@ -31695,14 +31266,14 @@ function useSafeEventBus6() {
31695
31266
  } };
31696
31267
  }
31697
31268
  }
31698
- var sizeStyles11, StarRating;
31269
+ var sizeStyles10, StarRating;
31699
31270
  var init_StarRating = __esm({
31700
31271
  "components/core/molecules/StarRating.tsx"() {
31701
31272
  "use client";
31702
31273
  init_cn();
31703
31274
  init_Icon();
31704
31275
  init_useEventBus();
31705
- sizeStyles11 = {
31276
+ sizeStyles10 = {
31706
31277
  sm: { star: "w-4 h-4", gap: "gap-0.5" },
31707
31278
  md: { star: "w-6 h-6", gap: "gap-1" },
31708
31279
  lg: { star: "w-8 h-8", gap: "gap-1.5" }
@@ -31721,7 +31292,7 @@ var init_StarRating = __esm({
31721
31292
  }) => {
31722
31293
  const [hoverValue, setHoverValue] = useState(null);
31723
31294
  const eventBus = useSafeEventBus6();
31724
- const styles = sizeStyles11[size];
31295
+ const styles = sizeStyles10[size];
31725
31296
  const displayValue = hoverValue ?? value;
31726
31297
  const emitChange = useCallback(
31727
31298
  (newValue) => {
@@ -31792,7 +31363,7 @@ var init_StarRating = __esm({
31792
31363
  name: "star",
31793
31364
  className: cn(
31794
31365
  styles.star,
31795
- "text-muted-foreground",
31366
+ "text-foreground/30",
31796
31367
  "transition-colors duration-100"
31797
31368
  ),
31798
31369
  strokeWidth: 1.5
@@ -32275,8 +31846,8 @@ function TableView({
32275
31846
  }) {
32276
31847
  const eventBus = useEventBus();
32277
31848
  const { t } = useTranslate();
32278
- const [visibleCount, setVisibleCount] = React97__default.useState(pageSize > 0 ? pageSize : Infinity);
32279
- const [localSelected, setLocalSelected] = React97__default.useState(/* @__PURE__ */ new Set());
31849
+ const [visibleCount, setVisibleCount] = React93__default.useState(pageSize > 0 ? pageSize : Infinity);
31850
+ const [localSelected, setLocalSelected] = React93__default.useState(/* @__PURE__ */ new Set());
32280
31851
  const colDefs = columns ?? fields ?? [];
32281
31852
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
32282
31853
  const dnd = useDataDnd({
@@ -32471,12 +32042,12 @@ function TableView({
32471
32042
  ]
32472
32043
  }
32473
32044
  );
32474
- return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React97__default.Fragment, { children: rowInner }, id);
32045
+ return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React93__default.Fragment, { children: rowInner }, id);
32475
32046
  };
32476
32047
  const items = data.map((row) => row);
32477
32048
  const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
32478
32049
  let runningIndex = 0;
32479
- const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
32050
+ const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
32480
32051
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
32481
32052
  group.items.map((row) => renderRow(row, runningIndex++))
32482
32053
  ] }, gi)) });
@@ -33828,7 +33399,7 @@ var init_StepFlow = __esm({
33828
33399
  className
33829
33400
  }) => {
33830
33401
  if (orientation === "vertical") {
33831
- 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: [
33402
+ return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React93__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
33832
33403
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
33833
33404
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
33834
33405
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -33839,7 +33410,7 @@ var init_StepFlow = __esm({
33839
33410
  ] })
33840
33411
  ] }) }, index)) });
33841
33412
  }
33842
- 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: [
33413
+ return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
33843
33414
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
33844
33415
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
33845
33416
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -34594,11 +34165,19 @@ function LatticeSVG({
34594
34165
  function f2(n) {
34595
34166
  return n.toFixed(2);
34596
34167
  }
34597
- var VARIANT_MAP2, EdgeDecoration;
34168
+ var colorTokenVars, VARIANT_MAP2, EdgeDecoration;
34598
34169
  var init_EdgeDecoration = __esm({
34599
34170
  "components/core/molecules/EdgeDecoration.tsx"() {
34600
34171
  "use client";
34601
34172
  init_cn();
34173
+ colorTokenVars = {
34174
+ primary: "var(--color-primary)",
34175
+ secondary: "var(--color-secondary)",
34176
+ success: "var(--color-success)",
34177
+ warning: "var(--color-warning)",
34178
+ error: "var(--color-error)",
34179
+ muted: "var(--color-muted)"
34180
+ };
34602
34181
  VARIANT_MAP2 = {
34603
34182
  arch: ArchSVG,
34604
34183
  vine: VineSVG,
@@ -34608,13 +34187,14 @@ var init_EdgeDecoration = __esm({
34608
34187
  variant = "arch",
34609
34188
  side = "both",
34610
34189
  opacity = 0.15,
34611
- color = "var(--color-primary)",
34190
+ color = "primary",
34612
34191
  strokeWidth = 0.5,
34613
34192
  width = 15,
34614
34193
  className
34615
34194
  }) => {
34616
34195
  const id = useId();
34617
34196
  const Variant = VARIANT_MAP2[variant];
34197
+ const resolvedColor = color in colorTokenVars ? colorTokenVars[color] : color;
34618
34198
  const sides = side === "both" ? ["left", "right"] : [side];
34619
34199
  return /* @__PURE__ */ jsx(Fragment, { children: sides.map((s) => /* @__PURE__ */ jsx(
34620
34200
  "svg",
@@ -34637,7 +34217,7 @@ var init_EdgeDecoration = __esm({
34637
34217
  facing: s,
34638
34218
  w: 200,
34639
34219
  h: 600,
34640
- color,
34220
+ color: resolvedColor,
34641
34221
  strokeWidth
34642
34222
  }
34643
34223
  )
@@ -34648,14 +34228,14 @@ var init_EdgeDecoration = __esm({
34648
34228
  EdgeDecoration.displayName = "EdgeDecoration";
34649
34229
  }
34650
34230
  });
34651
- var sizeStyles12, VoteStack;
34231
+ var sizeStyles11, VoteStack;
34652
34232
  var init_VoteStack = __esm({
34653
34233
  "components/core/molecules/VoteStack.tsx"() {
34654
34234
  "use client";
34655
34235
  init_cn();
34656
34236
  init_Icon();
34657
34237
  init_useEventBus();
34658
- sizeStyles12 = {
34238
+ sizeStyles11 = {
34659
34239
  sm: {
34660
34240
  button: "w-7 h-7",
34661
34241
  text: "text-sm min-w-[2rem]",
@@ -34683,7 +34263,7 @@ var init_VoteStack = __esm({
34683
34263
  className,
34684
34264
  label
34685
34265
  }) => {
34686
- const styles = sizeStyles12[size];
34266
+ const styles = sizeStyles11[size];
34687
34267
  const isUp = userVote === "up";
34688
34268
  const isDown = userVote === "down";
34689
34269
  const eventBus = useEventBus();
@@ -34815,7 +34395,7 @@ var init_LikertScale = __esm({
34815
34395
  md: "text-base",
34816
34396
  lg: "text-lg"
34817
34397
  };
34818
- LikertScale = React97__default.forwardRef(
34398
+ LikertScale = React93__default.forwardRef(
34819
34399
  ({
34820
34400
  question,
34821
34401
  options = DEFAULT_LIKERT_OPTIONS,
@@ -34827,7 +34407,7 @@ var init_LikertScale = __esm({
34827
34407
  variant = "radios",
34828
34408
  className
34829
34409
  }, ref) => {
34830
- const groupId = React97__default.useId();
34410
+ const groupId = React93__default.useId();
34831
34411
  const eventBus = useEventBus();
34832
34412
  const handleSelect = useCallback(
34833
34413
  (next) => {
@@ -34951,7 +34531,7 @@ var init_LikertScale = __esm({
34951
34531
  LikertScale.displayName = "LikertScale";
34952
34532
  }
34953
34533
  });
34954
- var DEFAULT_MATRIX_COLUMNS, sizeStyles13, MatrixQuestion;
34534
+ var DEFAULT_MATRIX_COLUMNS, sizeStyles12, MatrixQuestion;
34955
34535
  var init_MatrixQuestion = __esm({
34956
34536
  "components/core/molecules/MatrixQuestion.tsx"() {
34957
34537
  "use client";
@@ -34967,7 +34547,7 @@ var init_MatrixQuestion = __esm({
34967
34547
  { value: 4, label: "Agree" },
34968
34548
  { value: 5, label: "Strongly Agree" }
34969
34549
  ];
34970
- sizeStyles13 = {
34550
+ sizeStyles12 = {
34971
34551
  sm: {
34972
34552
  cell: "px-2 py-1.5 text-xs",
34973
34553
  radio: "sm",
@@ -34990,7 +34570,7 @@ var init_MatrixQuestion = __esm({
34990
34570
  size = "md",
34991
34571
  className
34992
34572
  }) => {
34993
- const styles = sizeStyles13[size];
34573
+ const styles = sizeStyles12[size];
34994
34574
  const safeRows = rows2 ?? [];
34995
34575
  const safeValues = values ?? {};
34996
34576
  const eventBus = useEventBus();
@@ -35977,7 +35557,6 @@ function BlockRow({
35977
35557
  onUpdate,
35978
35558
  onDelete,
35979
35559
  onDuplicate,
35980
- onInsertAfter,
35981
35560
  onChangeType
35982
35561
  }) {
35983
35562
  const { t } = useTranslate();
@@ -36253,34 +35832,16 @@ function BlockRow({
36253
35832
  "data-block-id": block.id,
36254
35833
  "data-block-type": block.type,
36255
35834
  children: [
36256
- !readOnly && showAffordances && /* @__PURE__ */ jsxs(Box, { className: "flex w-12 shrink-0 items-center gap-0.5 pt-1", children: [
36257
- /* @__PURE__ */ jsx(
36258
- Button,
36259
- {
36260
- type: "button",
36261
- variant: "ghost",
36262
- "aria-label": t("richBlockEditor.insertParagraphBelow"),
36263
- className: cn(
36264
- "inline-flex h-6 w-6 items-center justify-center rounded-sm p-0 gap-0",
36265
- "text-muted-foreground hover:bg-muted hover:text-foreground",
36266
- "opacity-0 group-hover:opacity-100 focus-visible:opacity-100",
36267
- "transition-opacity"
36268
- ),
36269
- onClick: () => onInsertAfter("paragraph"),
36270
- children: /* @__PURE__ */ jsx(Icon, { name: "plus", className: "w-3.5 h-3.5" })
36271
- }
36272
- ),
36273
- /* @__PURE__ */ jsx(
36274
- BlockMenu,
36275
- {
36276
- block,
36277
- readOnly,
36278
- onDelete,
36279
- onDuplicate,
36280
- onChangeType
36281
- }
36282
- )
36283
- ] }),
35835
+ !readOnly && showAffordances && /* @__PURE__ */ jsx(Box, { className: "flex w-8 shrink-0 items-center pt-1", children: /* @__PURE__ */ jsx(
35836
+ BlockMenu,
35837
+ {
35838
+ block,
35839
+ readOnly,
35840
+ onDelete,
35841
+ onDuplicate,
35842
+ onChangeType
35843
+ }
35844
+ ) }),
36284
35845
  /* @__PURE__ */ jsx(Box, { className: "min-w-0 flex-1", children: renderBody() })
36285
35846
  ]
36286
35847
  }
@@ -36403,12 +35964,6 @@ var init_RichBlockEditor = __esm({
36403
35964
  },
36404
35965
  [blocks, commit]
36405
35966
  );
36406
- const handleInsertAfter = useCallback(
36407
- (id, type) => {
36408
- commit(insertAfter(blocks, id, createBlock(type)));
36409
- },
36410
- [blocks, commit]
36411
- );
36412
35967
  const handleChangeType = useCallback(
36413
35968
  (id, type) => {
36414
35969
  commit(
@@ -36465,7 +36020,6 @@ var init_RichBlockEditor = __esm({
36465
36020
  onUpdate: (updater) => handleUpdate(block.id, updater),
36466
36021
  onDelete: () => handleDelete(block.id),
36467
36022
  onDuplicate: () => handleDuplicate(block.id),
36468
- onInsertAfter: (type) => handleInsertAfter(block.id, type),
36469
36023
  onChangeType: (type) => handleChangeType(block.id, type)
36470
36024
  },
36471
36025
  block.id
@@ -37135,7 +36689,7 @@ var init_DocBreadcrumb = __esm({
37135
36689
  "aria-label": t("aria.breadcrumb"),
37136
36690
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
37137
36691
  const isLast = idx === items.length - 1;
37138
- return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
36692
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
37139
36693
  idx > 0 && /* @__PURE__ */ jsx(
37140
36694
  Icon,
37141
36695
  {
@@ -37182,108 +36736,6 @@ var init_DocBreadcrumb = __esm({
37182
36736
  DocBreadcrumb.displayName = "DocBreadcrumb";
37183
36737
  }
37184
36738
  });
37185
- function DocCodeBlock({
37186
- code,
37187
- language,
37188
- title,
37189
- showLineNumbers = false,
37190
- className
37191
- }) {
37192
- const [copied, setCopied] = useState(false);
37193
- const handleCopy = useCallback(() => {
37194
- void navigator.clipboard.writeText(code).then(() => {
37195
- setCopied(true);
37196
- setTimeout(() => setCopied(false), 2e3);
37197
- });
37198
- }, [code]);
37199
- const lines = code.split("\n");
37200
- return /* @__PURE__ */ jsxs(
37201
- Box,
37202
- {
37203
- className: cn(
37204
- "rounded-container border border-border overflow-hidden",
37205
- className
37206
- ),
37207
- position: "relative",
37208
- children: [
37209
- title ? /* @__PURE__ */ jsxs(
37210
- HStack,
37211
- {
37212
- align: "center",
37213
- justify: "between",
37214
- className: "bg-muted px-4 py-2 border-b border-border",
37215
- children: [
37216
- /* @__PURE__ */ jsxs(HStack, { align: "center", gap: "sm", children: [
37217
- /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: title }),
37218
- language ? /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: language }) : null
37219
- ] }),
37220
- /* @__PURE__ */ jsx(
37221
- Button,
37222
- {
37223
- variant: "ghost",
37224
- size: "sm",
37225
- onClick: handleCopy,
37226
- leftIcon: copied ? "check" : "copy",
37227
- children: copied ? "Copied!" : "Copy"
37228
- }
37229
- )
37230
- ]
37231
- }
37232
- ) : null,
37233
- !title ? /* @__PURE__ */ jsx(Box, { position: "absolute", className: "top-2 right-2 z-10", children: /* @__PURE__ */ jsx(
37234
- Button,
37235
- {
37236
- variant: "ghost",
37237
- size: "sm",
37238
- onClick: handleCopy,
37239
- leftIcon: copied ? "check" : "copy",
37240
- children: copied ? "Copied!" : "Copy"
37241
- }
37242
- ) }) : null,
37243
- /* @__PURE__ */ jsxs(HStack, { gap: "none", className: "bg-foreground overflow-x-auto", children: [
37244
- showLineNumbers ? /* @__PURE__ */ jsx(
37245
- Box,
37246
- {
37247
- className: "py-4 pl-4 pr-3 select-none border-r border-border flex-shrink-0",
37248
- children: lines.map((_, i) => /* @__PURE__ */ jsx(
37249
- Typography,
37250
- {
37251
- variant: "caption",
37252
- color: "muted",
37253
- className: "block font-mono text-right leading-6",
37254
- as: "span",
37255
- children: i + 1
37256
- },
37257
- i
37258
- ))
37259
- }
37260
- ) : null,
37261
- /* @__PURE__ */ jsx(
37262
- Box,
37263
- {
37264
- as: "pre",
37265
- className: cn(
37266
- "p-4 font-mono text-sm text-background leading-6 flex-1 min-w-0",
37267
- !title && "pr-24"
37268
- ),
37269
- children: /* @__PURE__ */ jsx(Box, { as: "code", className: "whitespace-pre", children: code })
37270
- }
37271
- )
37272
- ] })
37273
- ]
37274
- }
37275
- );
37276
- }
37277
- var init_DocCodeBlock = __esm({
37278
- "components/core/molecules/DocCodeBlock.tsx"() {
37279
- "use client";
37280
- init_cn();
37281
- init_Box();
37282
- init_Stack();
37283
- init_Typography();
37284
- init_Button();
37285
- }
37286
- });
37287
36739
  function DocPagination({ prev, next, className }) {
37288
36740
  if (!prev && !next) return null;
37289
36741
  return /* @__PURE__ */ jsxs(
@@ -37720,17 +37172,25 @@ var init_DocTOC = __esm({
37720
37172
  DocTOC.displayName = "DocTOC";
37721
37173
  }
37722
37174
  });
37723
- var GradientDivider;
37175
+ var colorTokenVars2, GradientDivider;
37724
37176
  var init_GradientDivider = __esm({
37725
37177
  "components/core/molecules/GradientDivider.tsx"() {
37726
37178
  "use client";
37727
37179
  init_cn();
37728
37180
  init_Box();
37181
+ colorTokenVars2 = {
37182
+ primary: "var(--color-primary)",
37183
+ secondary: "var(--color-secondary)",
37184
+ success: "var(--color-success)",
37185
+ warning: "var(--color-warning)",
37186
+ error: "var(--color-error)",
37187
+ muted: "var(--color-muted)"
37188
+ };
37729
37189
  GradientDivider = ({
37730
37190
  color,
37731
37191
  className
37732
37192
  }) => {
37733
- const centerColor = color ?? "var(--color-primary)";
37193
+ const centerColor = color ? color in colorTokenVars2 ? colorTokenVars2[color] : color : "var(--color-primary)";
37734
37194
  return /* @__PURE__ */ jsx(
37735
37195
  Box,
37736
37196
  {
@@ -37894,7 +37354,7 @@ var init_PageHeader = __esm({
37894
37354
  info: "bg-info/10 text-info"
37895
37355
  };
37896
37356
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
37897
- 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: [
37357
+ breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
37898
37358
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
37899
37359
  crumb.href ? /* @__PURE__ */ jsx(
37900
37360
  "a",
@@ -37981,271 +37441,6 @@ var init_PageHeader = __esm({
37981
37441
  PageHeader.displayName = "PageHeader";
37982
37442
  }
37983
37443
  });
37984
- var FormSection, FormLayout, FormActions;
37985
- var init_FormSection = __esm({
37986
- "components/core/molecules/FormSection.tsx"() {
37987
- "use client";
37988
- init_cn();
37989
- init_atoms2();
37990
- init_Box();
37991
- init_Typography();
37992
- init_Button();
37993
- init_Stack();
37994
- init_Icon();
37995
- init_useEventBus();
37996
- FormSection = ({
37997
- title,
37998
- description,
37999
- children,
38000
- collapsible = false,
38001
- defaultCollapsed = false,
38002
- card = false,
38003
- columns = 1,
38004
- className
38005
- }) => {
38006
- const [collapsed, setCollapsed] = React97__default.useState(defaultCollapsed);
38007
- const { t } = useTranslate();
38008
- const eventBus = useEventBus();
38009
- const gridClass = {
38010
- 1: "grid-cols-1",
38011
- 2: "grid-cols-1 md:grid-cols-2",
38012
- 3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
38013
- }[columns];
38014
- React97__default.useCallback(() => {
38015
- if (collapsible) {
38016
- setCollapsed((prev) => !prev);
38017
- eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
38018
- }
38019
- }, [collapsible, collapsed, eventBus]);
38020
- const content = /* @__PURE__ */ jsxs(Fragment, { children: [
38021
- (title || description) && /* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "mb-4", children: [
38022
- title && /* @__PURE__ */ jsxs(
38023
- HStack,
38024
- {
38025
- justify: "between",
38026
- align: "center",
38027
- className: cn(collapsible && "cursor-pointer"),
38028
- action: collapsible ? "TOGGLE_COLLAPSE" : void 0,
38029
- children: [
38030
- /* @__PURE__ */ jsx(Typography, { variant: "h3", weight: "semibold", children: title }),
38031
- collapsible && /* @__PURE__ */ jsx(
38032
- Button,
38033
- {
38034
- variant: "ghost",
38035
- size: "sm",
38036
- action: "TOGGLE_COLLAPSE",
38037
- children: /* @__PURE__ */ jsx(
38038
- Icon,
38039
- {
38040
- icon: ChevronDown,
38041
- size: "sm",
38042
- className: cn(
38043
- "text-muted-foreground transition-transform",
38044
- collapsed && "rotate-180"
38045
- )
38046
- }
38047
- )
38048
- }
38049
- )
38050
- ]
38051
- }
38052
- ),
38053
- description && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "secondary", children: description })
38054
- ] }),
38055
- (!collapsible || !collapsed) && /* @__PURE__ */ jsx(Box, { className: cn("grid gap-4", gridClass), children })
38056
- ] });
38057
- if (card) {
38058
- return /* @__PURE__ */ jsx(Card, { className: cn("p-6", className), children: content });
38059
- }
38060
- return /* @__PURE__ */ jsx(Box, { className, children: content });
38061
- };
38062
- FormSection.displayName = "FormSection";
38063
- FormLayout = ({
38064
- children,
38065
- dividers = true,
38066
- className
38067
- }) => {
38068
- return /* @__PURE__ */ jsx(
38069
- VStack,
38070
- {
38071
- gap: "lg",
38072
- className: cn(
38073
- dividers && "[&>*+*]:pt-8 [&>*+*]:border-t [&>*+*]:border-border",
38074
- className
38075
- ),
38076
- children
38077
- }
38078
- );
38079
- };
38080
- FormLayout.displayName = "FormLayout";
38081
- FormActions = ({
38082
- children,
38083
- sticky = false,
38084
- align = "right",
38085
- className
38086
- }) => {
38087
- const alignClass2 = {
38088
- left: "justify-start",
38089
- right: "justify-end",
38090
- between: "justify-between",
38091
- center: "justify-center"
38092
- }[align];
38093
- return /* @__PURE__ */ jsx(
38094
- HStack,
38095
- {
38096
- gap: "sm",
38097
- align: "center",
38098
- className: cn(
38099
- "pt-6 border-t border-border",
38100
- alignClass2,
38101
- sticky && "sticky bottom-0 bg-card py-4 -mx-6 px-6 shadow-[0_-4px_6px_-1px_rgb(0,0,0,0.05)]",
38102
- className
38103
- ),
38104
- children
38105
- }
38106
- );
38107
- };
38108
- FormActions.displayName = "FormActions";
38109
- }
38110
- });
38111
- function currentValue(decl, override) {
38112
- return override !== void 0 ? override : decl.default;
38113
- }
38114
- function TextLikeControl({
38115
- field,
38116
- numeric,
38117
- value,
38118
- onCommit
38119
- }) {
38120
- const initial = value === void 0 || value === null ? "" : String(value);
38121
- const [draft, setDraft] = React97__default.useState(initial);
38122
- React97__default.useEffect(() => setDraft(initial), [initial]);
38123
- const commit = () => {
38124
- if (numeric) {
38125
- const n = draft.trim() === "" ? 0 : Number(draft);
38126
- onCommit(field, Number.isNaN(n) ? 0 : n);
38127
- } else {
38128
- onCommit(field, draft);
38129
- }
38130
- };
38131
- return /* @__PURE__ */ jsx(
38132
- Input,
38133
- {
38134
- inputType: numeric ? "number" : "text",
38135
- value: draft,
38136
- onChange: (e) => setDraft(e.target.value),
38137
- onBlur: commit,
38138
- onKeyDown: (e) => {
38139
- if (e.key === "Enter") commit();
38140
- }
38141
- }
38142
- );
38143
- }
38144
- function FieldControl({
38145
- name,
38146
- decl,
38147
- value,
38148
- onChange,
38149
- assets
38150
- }) {
38151
- let control;
38152
- const stringValue = typeof value === "string" ? value : void 0;
38153
- if (decl.type === "icon") {
38154
- control = /* @__PURE__ */ jsx(IconPicker, { value: stringValue, onChange: (icon) => onChange(name, icon) });
38155
- } else if (decl.type === "asset") {
38156
- control = /* @__PURE__ */ jsx(
38157
- AssetPicker,
38158
- {
38159
- assets: assets ?? [],
38160
- value: stringValue,
38161
- onChange: (url) => onChange(name, url)
38162
- }
38163
- );
38164
- } else if (decl.type === "boolean") {
38165
- control = /* @__PURE__ */ jsx(Switch, { checked: value === true, onChange: (c) => onChange(name, c) });
38166
- } else if (decl.type === "string" && decl.values !== void 0 && decl.values.length > 0) {
38167
- control = /* @__PURE__ */ jsx(
38168
- Select,
38169
- {
38170
- options: decl.values.map((v) => ({ value: v, label: v })),
38171
- value: typeof value === "string" ? value : "",
38172
- onChange: (e) => onChange(name, e.target.value)
38173
- }
38174
- );
38175
- } else if (decl.type === "number") {
38176
- control = /* @__PURE__ */ jsx(TextLikeControl, { field: name, numeric: true, value, onCommit: onChange });
38177
- } else if (decl.type === "string") {
38178
- control = /* @__PURE__ */ jsx(TextLikeControl, { field: name, numeric: false, value, onCommit: onChange });
38179
- } else {
38180
- control = /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", children: [
38181
- decl.type,
38182
- " \u2014 edit in source"
38183
- ] });
38184
- }
38185
- return /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
38186
- /* @__PURE__ */ jsx(Typography, { variant: "label", children: decl.label ?? name }),
38187
- control,
38188
- decl.description !== void 0 && decl.description !== "" && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: decl.description })
38189
- ] });
38190
- }
38191
- var TIER_ORDER, PropertyInspector;
38192
- var init_PropertyInspector = __esm({
38193
- "components/core/molecules/PropertyInspector.tsx"() {
38194
- "use client";
38195
- init_cn();
38196
- init_Stack();
38197
- init_Typography();
38198
- init_Button();
38199
- init_Switch();
38200
- init_Select();
38201
- init_Input();
38202
- init_FormSection();
38203
- init_IconPicker();
38204
- init_AssetPicker();
38205
- TIER_ORDER = ["presentation", "domain", "policy", "infra", "internal"];
38206
- PropertyInspector = ({
38207
- config,
38208
- values,
38209
- onChange,
38210
- onReset,
38211
- title,
38212
- className,
38213
- assets
38214
- }) => {
38215
- const fields = Object.entries(config);
38216
- const byTier = /* @__PURE__ */ new Map();
38217
- for (const [name, decl] of fields) {
38218
- const tier = decl.tier ?? "presentation";
38219
- const arr = byTier.get(tier) ?? [];
38220
- arr.push([name, decl]);
38221
- byTier.set(tier, arr);
38222
- }
38223
- const tiers = [...byTier.keys()].sort((a, b) => {
38224
- const ia = TIER_ORDER.indexOf(a);
38225
- const ib = TIER_ORDER.indexOf(b);
38226
- return (ia === -1 ? 99 : ia) - (ib === -1 ? 99 : ib);
38227
- });
38228
- return /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: cn("w-full", className), children: [
38229
- /* @__PURE__ */ jsxs(HStack, { justify: "between", align: "center", children: [
38230
- /* @__PURE__ */ jsx(Typography, { variant: "caption", weight: "bold", children: title ?? "Config" }),
38231
- onReset !== void 0 && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", icon: "rotate-ccw", label: "Reset", onClick: onReset })
38232
- ] }),
38233
- fields.length === 0 && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: "No configurable properties." }),
38234
- tiers.map((tier) => /* @__PURE__ */ jsx(FormSection, { title: tier, collapsible: true, defaultCollapsed: tier !== "presentation", children: /* @__PURE__ */ jsx(VStack, { gap: "sm", children: byTier.get(tier)?.map(([name, decl]) => /* @__PURE__ */ jsx(
38235
- FieldControl,
38236
- {
38237
- name,
38238
- decl,
38239
- value: currentValue(decl, values?.[name]),
38240
- onChange,
38241
- assets
38242
- },
38243
- name
38244
- )) }) }, tier))
38245
- ] });
38246
- };
38247
- }
38248
- });
38249
37444
  var lookStyles8, Header;
38250
37445
  var init_Header = __esm({
38251
37446
  "components/core/molecules/Header.tsx"() {
@@ -38896,7 +38091,7 @@ var init_WizardContainer = __esm({
38896
38091
  const isCompleted = index < currentStep;
38897
38092
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
38898
38093
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
38899
- return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
38094
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
38900
38095
  /* @__PURE__ */ jsx(
38901
38096
  Button,
38902
38097
  {
@@ -41181,7 +40376,7 @@ var init_DetailPanel = __esm({
41181
40376
  }
41182
40377
  });
41183
40378
  function extractTitle(children) {
41184
- if (!React97__default.isValidElement(children)) return void 0;
40379
+ if (!React93__default.isValidElement(children)) return void 0;
41185
40380
  const props = children.props;
41186
40381
  if (typeof props.title === "string") {
41187
40382
  return props.title;
@@ -41236,7 +40431,7 @@ function LinearView({
41236
40431
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
41237
40432
  const isDone = i < currentIdx;
41238
40433
  const isCurrent = i === currentIdx;
41239
- return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
40434
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
41240
40435
  i > 0 && /* @__PURE__ */ jsx(
41241
40436
  Typography,
41242
40437
  {
@@ -42194,12 +41389,12 @@ var init_Form = __esm({
42194
41389
  const isSchemaEntity = isOrbitalEntitySchema(entity);
42195
41390
  const resolvedEntity = isSchemaEntity ? entity : void 0;
42196
41391
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
42197
- const normalizedInitialData = React97__default.useMemo(() => {
41392
+ const normalizedInitialData = React93__default.useMemo(() => {
42198
41393
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
42199
41394
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
42200
41395
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
42201
41396
  }, [entity, initialData]);
42202
- const entityDerivedFields = React97__default.useMemo(() => {
41397
+ const entityDerivedFields = React93__default.useMemo(() => {
42203
41398
  if (fields && fields.length > 0) return void 0;
42204
41399
  if (!resolvedEntity) return void 0;
42205
41400
  return resolvedEntity.fields.map(
@@ -42219,16 +41414,16 @@ var init_Form = __esm({
42219
41414
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
42220
41415
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
42221
41416
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
42222
- const [formData, setFormData] = React97__default.useState(
41417
+ const [formData, setFormData] = React93__default.useState(
42223
41418
  normalizedInitialData
42224
41419
  );
42225
- const [collapsedSections, setCollapsedSections] = React97__default.useState(
41420
+ const [collapsedSections, setCollapsedSections] = React93__default.useState(
42226
41421
  /* @__PURE__ */ new Set()
42227
41422
  );
42228
- const [submitError, setSubmitError] = React97__default.useState(null);
42229
- const formRef = React97__default.useRef(null);
41423
+ const [submitError, setSubmitError] = React93__default.useState(null);
41424
+ const formRef = React93__default.useRef(null);
42230
41425
  const formMode = props.mode;
42231
- const mountedRef = React97__default.useRef(false);
41426
+ const mountedRef = React93__default.useRef(false);
42232
41427
  if (!mountedRef.current) {
42233
41428
  mountedRef.current = true;
42234
41429
  debug("forms", "mount", {
@@ -42241,7 +41436,7 @@ var init_Form = __esm({
42241
41436
  });
42242
41437
  }
42243
41438
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
42244
- const evalContext = React97__default.useMemo(
41439
+ const evalContext = React93__default.useMemo(
42245
41440
  () => ({
42246
41441
  formValues: formData,
42247
41442
  globalVariables: externalContext?.globalVariables ?? {},
@@ -42250,7 +41445,7 @@ var init_Form = __esm({
42250
41445
  }),
42251
41446
  [formData, externalContext]
42252
41447
  );
42253
- React97__default.useEffect(() => {
41448
+ React93__default.useEffect(() => {
42254
41449
  debug("forms", "initialData-sync", {
42255
41450
  mode: formMode,
42256
41451
  normalizedInitialData,
@@ -42261,7 +41456,7 @@ var init_Form = __esm({
42261
41456
  setFormData(normalizedInitialData);
42262
41457
  }
42263
41458
  }, [normalizedInitialData]);
42264
- const processCalculations = React97__default.useCallback(
41459
+ const processCalculations = React93__default.useCallback(
42265
41460
  (changedFieldId, newFormData) => {
42266
41461
  if (!hiddenCalculations.length) return;
42267
41462
  const context = {
@@ -42286,7 +41481,7 @@ var init_Form = __esm({
42286
41481
  },
42287
41482
  [hiddenCalculations, externalContext, eventBus]
42288
41483
  );
42289
- const checkViolations = React97__default.useCallback(
41484
+ const checkViolations = React93__default.useCallback(
42290
41485
  (changedFieldId, newFormData) => {
42291
41486
  if (!violationTriggers.length) return;
42292
41487
  const context = {
@@ -42324,7 +41519,7 @@ var init_Form = __esm({
42324
41519
  processCalculations(name, newFormData);
42325
41520
  checkViolations(name, newFormData);
42326
41521
  };
42327
- const isFieldVisible = React97__default.useCallback(
41522
+ const isFieldVisible = React93__default.useCallback(
42328
41523
  (fieldName) => {
42329
41524
  const condition = conditionalFields[fieldName];
42330
41525
  if (!condition) return true;
@@ -42332,7 +41527,7 @@ var init_Form = __esm({
42332
41527
  },
42333
41528
  [conditionalFields, evalContext]
42334
41529
  );
42335
- const isSectionVisible = React97__default.useCallback(
41530
+ const isSectionVisible = React93__default.useCallback(
42336
41531
  (section) => {
42337
41532
  if (!section.condition) return true;
42338
41533
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -42408,7 +41603,7 @@ var init_Form = __esm({
42408
41603
  eventBus.emit(`UI:${onCancel}`);
42409
41604
  }
42410
41605
  };
42411
- const renderField = React97__default.useCallback(
41606
+ const renderField = React93__default.useCallback(
42412
41607
  (field) => {
42413
41608
  const fieldName = field.name || field.field;
42414
41609
  if (!fieldName) return null;
@@ -42417,19 +41612,19 @@ var init_Form = __esm({
42417
41612
  }
42418
41613
  const inputType = determineInputType(field);
42419
41614
  const label = field.label || fieldName.charAt(0).toUpperCase() + fieldName.slice(1).replace(/([A-Z])/g, " $1");
42420
- const currentValue2 = formData[fieldName] ?? field.defaultValue ?? "";
41615
+ const currentValue = formData[fieldName] ?? field.defaultValue ?? "";
42421
41616
  return /* @__PURE__ */ jsxs(VStack, { gap: "xs", "data-field": fieldName, children: [
42422
41617
  inputType !== "checkbox" && /* @__PURE__ */ jsxs(Typography, { as: "label", variant: "label", weight: "bold", children: [
42423
41618
  label,
42424
41619
  field.required && /* @__PURE__ */ jsx(Typography, { as: "span", color: "error", className: "ml-1", children: "*" })
42425
41620
  ] }),
42426
- renderFieldInput(field, fieldName, inputType, currentValue2, label)
41621
+ renderFieldInput(field, fieldName, inputType, currentValue, label)
42427
41622
  ] }, fieldName);
42428
41623
  },
42429
41624
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
42430
41625
  );
42431
41626
  const effectiveFields = entityDerivedFields ?? fields;
42432
- const normalizedFields = React97__default.useMemo(() => {
41627
+ const normalizedFields = React93__default.useMemo(() => {
42433
41628
  if (!effectiveFields || effectiveFields.length === 0) return [];
42434
41629
  return effectiveFields.map((field) => {
42435
41630
  if (typeof field === "string") {
@@ -42452,7 +41647,7 @@ var init_Form = __esm({
42452
41647
  return field;
42453
41648
  });
42454
41649
  }, [effectiveFields, resolvedEntity]);
42455
- const schemaFields = React97__default.useMemo(() => {
41650
+ const schemaFields = React93__default.useMemo(() => {
42456
41651
  if (normalizedFields.length === 0) return null;
42457
41652
  if (isDebugEnabled()) {
42458
41653
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -42462,7 +41657,7 @@ var init_Form = __esm({
42462
41657
  }
42463
41658
  return normalizedFields.map(renderField).filter(Boolean);
42464
41659
  }, [normalizedFields, renderField, entityName, conditionalFields]);
42465
- const sectionElements = React97__default.useMemo(() => {
41660
+ const sectionElements = React93__default.useMemo(() => {
42466
41661
  if (!sections || sections.length === 0) return null;
42467
41662
  return sections.map((section) => {
42468
41663
  if (!isSectionVisible(section)) {
@@ -42498,7 +41693,7 @@ var init_Form = __esm({
42498
41693
  ] }, section.id);
42499
41694
  }).filter(Boolean);
42500
41695
  }, [sections, isSectionVisible, collapsedSections, renderField, gap]);
42501
- function renderFieldInput(field, fieldName, inputType, currentValue2, label) {
41696
+ function renderFieldInput(field, fieldName, inputType, currentValue, label) {
42502
41697
  const commonProps = {
42503
41698
  id: fieldName,
42504
41699
  name: fieldName,
@@ -42515,7 +41710,7 @@ var init_Form = __esm({
42515
41710
  {
42516
41711
  ...commonProps,
42517
41712
  label: label + (field.required ? " *" : ""),
42518
- checked: Boolean(currentValue2),
41713
+ checked: Boolean(currentValue),
42519
41714
  onChange: (e) => handleChange(fieldName, e.target.checked)
42520
41715
  }
42521
41716
  );
@@ -42524,7 +41719,7 @@ var init_Form = __esm({
42524
41719
  Textarea,
42525
41720
  {
42526
41721
  ...commonProps,
42527
- value: String(currentValue2),
41722
+ value: String(currentValue),
42528
41723
  onChange: (e) => handleChange(fieldName, e.target.value),
42529
41724
  minLength: field.min,
42530
41725
  maxLength: field.max
@@ -42537,7 +41732,7 @@ var init_Form = __esm({
42537
41732
  {
42538
41733
  ...commonProps,
42539
41734
  options,
42540
- value: String(currentValue2),
41735
+ value: String(currentValue),
42541
41736
  onChange: (e) => handleChange(fieldName, e.target.value),
42542
41737
  placeholder: field.placeholder || `Select ${label}...`
42543
41738
  }
@@ -42550,7 +41745,7 @@ var init_Form = __esm({
42550
41745
  RelationSelect,
42551
41746
  {
42552
41747
  ...commonProps,
42553
- value: currentValue2 ? String(currentValue2) : void 0,
41748
+ value: currentValue ? String(currentValue) : void 0,
42554
41749
  onChange: (value) => handleChange(fieldName, value),
42555
41750
  options: relationOptions,
42556
41751
  isLoading: relationLoading,
@@ -42566,7 +41761,7 @@ var init_Form = __esm({
42566
41761
  {
42567
41762
  ...commonProps,
42568
41763
  type: "number",
42569
- value: currentValue2 !== void 0 && currentValue2 !== "" ? String(currentValue2) : "",
41764
+ value: currentValue !== void 0 && currentValue !== "" ? String(currentValue) : "",
42570
41765
  onChange: (e) => handleChange(
42571
41766
  fieldName,
42572
41767
  e.target.value ? Number(e.target.value) : void 0
@@ -42581,7 +41776,7 @@ var init_Form = __esm({
42581
41776
  {
42582
41777
  ...commonProps,
42583
41778
  type: "date",
42584
- value: formatDateValue(currentValue2),
41779
+ value: formatDateValue(currentValue),
42585
41780
  onChange: (e) => handleChange(fieldName, e.target.value)
42586
41781
  }
42587
41782
  );
@@ -42591,7 +41786,7 @@ var init_Form = __esm({
42591
41786
  {
42592
41787
  ...commonProps,
42593
41788
  type: "datetime-local",
42594
- value: formatDateTimeValue(currentValue2),
41789
+ value: formatDateTimeValue(currentValue),
42595
41790
  onChange: (e) => handleChange(fieldName, e.target.value)
42596
41791
  }
42597
41792
  );
@@ -42601,7 +41796,7 @@ var init_Form = __esm({
42601
41796
  {
42602
41797
  ...commonProps,
42603
41798
  type: "email",
42604
- value: String(currentValue2),
41799
+ value: String(currentValue),
42605
41800
  onChange: (e) => handleChange(fieldName, e.target.value),
42606
41801
  minLength: field.min,
42607
41802
  maxLength: field.max
@@ -42613,7 +41808,7 @@ var init_Form = __esm({
42613
41808
  {
42614
41809
  ...commonProps,
42615
41810
  type: "url",
42616
- value: String(currentValue2),
41811
+ value: String(currentValue),
42617
41812
  onChange: (e) => handleChange(fieldName, e.target.value),
42618
41813
  minLength: field.min,
42619
41814
  maxLength: field.max
@@ -42625,7 +41820,7 @@ var init_Form = __esm({
42625
41820
  {
42626
41821
  ...commonProps,
42627
41822
  type: "password",
42628
- value: String(currentValue2),
41823
+ value: String(currentValue),
42629
41824
  onChange: (e) => handleChange(fieldName, e.target.value),
42630
41825
  minLength: field.min,
42631
41826
  maxLength: field.max
@@ -42638,7 +41833,7 @@ var init_Form = __esm({
42638
41833
  {
42639
41834
  ...commonProps,
42640
41835
  type: "text",
42641
- value: String(currentValue2),
41836
+ value: String(currentValue),
42642
41837
  onChange: (e) => handleChange(fieldName, e.target.value),
42643
41838
  minLength: field.min,
42644
41839
  maxLength: field.max
@@ -43737,7 +42932,7 @@ var init_List = __esm({
43737
42932
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
43738
42933
  return [];
43739
42934
  }, [entity]);
43740
- const getItemActions = React97__default.useCallback(
42935
+ const getItemActions = React93__default.useCallback(
43741
42936
  (item) => {
43742
42937
  if (!itemActions) return [];
43743
42938
  if (typeof itemActions === "function") {
@@ -44213,7 +43408,7 @@ var init_MediaGallery = __esm({
44213
43408
  [selectable, selectedItems, selectionEvent, eventBus]
44214
43409
  );
44215
43410
  const entityData = Array.isArray(entity) ? entity : [];
44216
- const items = React97__default.useMemo(() => {
43411
+ const items = React93__default.useMemo(() => {
44217
43412
  if (propItems) return propItems;
44218
43413
  if (entityData.length === 0) return [];
44219
43414
  return entityData.map((record, idx) => ({
@@ -44374,7 +43569,7 @@ var init_MediaGallery = __esm({
44374
43569
  }
44375
43570
  });
44376
43571
  function extractTitle2(children) {
44377
- if (!React97__default.isValidElement(children)) return void 0;
43572
+ if (!React93__default.isValidElement(children)) return void 0;
44378
43573
  const props = children.props;
44379
43574
  if (typeof props.title === "string") {
44380
43575
  return props.title;
@@ -44805,7 +44000,7 @@ var init_debugRegistry = __esm({
44805
44000
  }
44806
44001
  });
44807
44002
  function useDebugData() {
44808
- const [data, setData] = React97.useState(() => ({
44003
+ const [data, setData] = React93.useState(() => ({
44809
44004
  traits: [],
44810
44005
  ticks: [],
44811
44006
  guards: [],
@@ -44819,7 +44014,7 @@ function useDebugData() {
44819
44014
  },
44820
44015
  lastUpdate: Date.now()
44821
44016
  }));
44822
- React97.useEffect(() => {
44017
+ React93.useEffect(() => {
44823
44018
  const updateData = () => {
44824
44019
  setData({
44825
44020
  traits: getAllTraits(),
@@ -44928,12 +44123,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
44928
44123
  return positions;
44929
44124
  }
44930
44125
  function WalkMinimap() {
44931
- const [walkStep, setWalkStep] = React97.useState(null);
44932
- const [traits2, setTraits] = React97.useState([]);
44933
- const [coveredEdges, setCoveredEdges] = React97.useState([]);
44934
- const [completedTraits, setCompletedTraits] = React97.useState(/* @__PURE__ */ new Set());
44935
- const prevTraitRef = React97.useRef(null);
44936
- React97.useEffect(() => {
44126
+ const [walkStep, setWalkStep] = React93.useState(null);
44127
+ const [traits2, setTraits] = React93.useState([]);
44128
+ const [coveredEdges, setCoveredEdges] = React93.useState([]);
44129
+ const [completedTraits, setCompletedTraits] = React93.useState(/* @__PURE__ */ new Set());
44130
+ const prevTraitRef = React93.useRef(null);
44131
+ React93.useEffect(() => {
44937
44132
  const interval = setInterval(() => {
44938
44133
  const w = window;
44939
44134
  const step = w.__orbitalWalkStep;
@@ -45369,15 +44564,15 @@ var init_EntitiesTab = __esm({
45369
44564
  });
45370
44565
  function EventFlowTab({ events: events2 }) {
45371
44566
  const { t } = useTranslate();
45372
- const [filter, setFilter] = React97.useState("all");
45373
- const containerRef = React97.useRef(null);
45374
- const [autoScroll, setAutoScroll] = React97.useState(true);
45375
- React97.useEffect(() => {
44567
+ const [filter, setFilter] = React93.useState("all");
44568
+ const containerRef = React93.useRef(null);
44569
+ const [autoScroll, setAutoScroll] = React93.useState(true);
44570
+ React93.useEffect(() => {
45376
44571
  if (autoScroll && containerRef.current) {
45377
44572
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
45378
44573
  }
45379
44574
  }, [events2.length, autoScroll]);
45380
- const filteredEvents = React97.useMemo(() => {
44575
+ const filteredEvents = React93.useMemo(() => {
45381
44576
  if (filter === "all") return events2;
45382
44577
  return events2.filter((e) => e.type === filter);
45383
44578
  }, [events2, filter]);
@@ -45493,7 +44688,7 @@ var init_EventFlowTab = __esm({
45493
44688
  });
45494
44689
  function GuardsPanel({ guards }) {
45495
44690
  const { t } = useTranslate();
45496
- const [filter, setFilter] = React97.useState("all");
44691
+ const [filter, setFilter] = React93.useState("all");
45497
44692
  if (guards.length === 0) {
45498
44693
  return /* @__PURE__ */ jsx(
45499
44694
  EmptyState,
@@ -45506,7 +44701,7 @@ function GuardsPanel({ guards }) {
45506
44701
  }
45507
44702
  const passedCount = guards.filter((g) => g.result).length;
45508
44703
  const failedCount = guards.length - passedCount;
45509
- const filteredGuards = React97.useMemo(() => {
44704
+ const filteredGuards = React93.useMemo(() => {
45510
44705
  if (filter === "all") return guards;
45511
44706
  if (filter === "passed") return guards.filter((g) => g.result);
45512
44707
  return guards.filter((g) => !g.result);
@@ -45669,10 +44864,10 @@ function EffectBadge({ effect }) {
45669
44864
  }
45670
44865
  function TransitionTimeline({ transitions }) {
45671
44866
  const { t } = useTranslate();
45672
- const containerRef = React97.useRef(null);
45673
- const [autoScroll, setAutoScroll] = React97.useState(true);
45674
- const [expandedId, setExpandedId] = React97.useState(null);
45675
- React97.useEffect(() => {
44867
+ const containerRef = React93.useRef(null);
44868
+ const [autoScroll, setAutoScroll] = React93.useState(true);
44869
+ const [expandedId, setExpandedId] = React93.useState(null);
44870
+ React93.useEffect(() => {
45676
44871
  if (autoScroll && containerRef.current) {
45677
44872
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
45678
44873
  }
@@ -45952,9 +45147,9 @@ function getAllEvents(traits2) {
45952
45147
  function EventDispatcherTab({ traits: traits2, schema }) {
45953
45148
  const eventBus = useEventBus();
45954
45149
  const { t } = useTranslate();
45955
- const [log13, setLog] = React97.useState([]);
45956
- const prevStatesRef = React97.useRef(/* @__PURE__ */ new Map());
45957
- React97.useEffect(() => {
45150
+ const [log13, setLog] = React93.useState([]);
45151
+ const prevStatesRef = React93.useRef(/* @__PURE__ */ new Map());
45152
+ React93.useEffect(() => {
45958
45153
  for (const trait of traits2) {
45959
45154
  const prev = prevStatesRef.current.get(trait.id);
45960
45155
  if (prev && prev !== trait.currentState) {
@@ -46123,10 +45318,10 @@ function VerifyModePanel({
46123
45318
  localCount
46124
45319
  }) {
46125
45320
  const { t } = useTranslate();
46126
- const [expanded, setExpanded] = React97.useState(true);
46127
- const scrollRef = React97.useRef(null);
46128
- const prevCountRef = React97.useRef(0);
46129
- React97.useEffect(() => {
45321
+ const [expanded, setExpanded] = React93.useState(true);
45322
+ const scrollRef = React93.useRef(null);
45323
+ const prevCountRef = React93.useRef(0);
45324
+ React93.useEffect(() => {
46130
45325
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
46131
45326
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
46132
45327
  }
@@ -46183,10 +45378,10 @@ function RuntimeDebugger({
46183
45378
  schema
46184
45379
  }) {
46185
45380
  const { t } = useTranslate();
46186
- const [isCollapsed, setIsCollapsed] = React97.useState(mode === "verify" ? true : defaultCollapsed);
46187
- const [isVisible, setIsVisible] = React97.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
45381
+ const [isCollapsed, setIsCollapsed] = React93.useState(mode === "verify" ? true : defaultCollapsed);
45382
+ const [isVisible, setIsVisible] = React93.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
46188
45383
  const debugData = useDebugData();
46189
- React97.useEffect(() => {
45384
+ React93.useEffect(() => {
46190
45385
  if (mode === "inline") return;
46191
45386
  return onDebugToggle((enabled) => {
46192
45387
  setIsVisible(enabled);
@@ -46195,7 +45390,7 @@ function RuntimeDebugger({
46195
45390
  }
46196
45391
  });
46197
45392
  }, [mode]);
46198
- React97.useEffect(() => {
45393
+ React93.useEffect(() => {
46199
45394
  if (mode === "inline") return;
46200
45395
  const handleKeyDown = (e) => {
46201
45396
  if (e.key === "`" && isVisible) {
@@ -46644,7 +45839,7 @@ function SequenceBar({
46644
45839
  onSlotRemove(index);
46645
45840
  }, [onSlotRemove, playing]);
46646
45841
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
46647
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
45842
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
46648
45843
  i > 0 && /* @__PURE__ */ jsx(
46649
45844
  Typography,
46650
45845
  {
@@ -47602,7 +46797,7 @@ var init_StatCard = __esm({
47602
46797
  title: propTitle,
47603
46798
  value: propValue,
47604
46799
  previousValue,
47605
- currentValue: currentValue2,
46800
+ currentValue,
47606
46801
  trend: manualTrend,
47607
46802
  trendDirection: manualDirection,
47608
46803
  invertTrend = false,
@@ -47623,7 +46818,7 @@ var init_StatCard = __esm({
47623
46818
  const labelToUse = propLabel ?? propTitle;
47624
46819
  const eventBus = useEventBus();
47625
46820
  const { t } = useTranslate();
47626
- const handleActionClick = React97__default.useCallback(() => {
46821
+ const handleActionClick = React93__default.useCallback(() => {
47627
46822
  if (action?.event) {
47628
46823
  eventBus.emit(`UI:${action.event}`, {});
47629
46824
  }
@@ -47634,7 +46829,7 @@ var init_StatCard = __esm({
47634
46829
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
47635
46830
  const isLoading = externalLoading ?? false;
47636
46831
  const error = externalError;
47637
- const computeMetricValue = React97__default.useCallback(
46832
+ const computeMetricValue = React93__default.useCallback(
47638
46833
  (metric, items) => {
47639
46834
  if (metric.value !== void 0) {
47640
46835
  return metric.value;
@@ -47673,7 +46868,7 @@ var init_StatCard = __esm({
47673
46868
  },
47674
46869
  []
47675
46870
  );
47676
- const schemaStats = React97__default.useMemo(() => {
46871
+ const schemaStats = React93__default.useMemo(() => {
47677
46872
  if (!metrics || metrics.length === 0) return null;
47678
46873
  return metrics.map((metric) => ({
47679
46874
  label: metric.label,
@@ -47681,13 +46876,13 @@ var init_StatCard = __esm({
47681
46876
  format: metric.format
47682
46877
  }));
47683
46878
  }, [metrics, data, computeMetricValue]);
47684
- const calculatedTrend = React97__default.useMemo(() => {
46879
+ const calculatedTrend = React93__default.useMemo(() => {
47685
46880
  if (manualTrend !== void 0) return manualTrend;
47686
- if (previousValue === void 0 || currentValue2 === void 0)
46881
+ if (previousValue === void 0 || currentValue === void 0)
47687
46882
  return void 0;
47688
- if (previousValue === 0) return currentValue2 > 0 ? 100 : 0;
47689
- return (currentValue2 - previousValue) / previousValue * 100;
47690
- }, [manualTrend, previousValue, currentValue2]);
46883
+ if (previousValue === 0) return currentValue > 0 ? 100 : 0;
46884
+ return (currentValue - previousValue) / previousValue * 100;
46885
+ }, [manualTrend, previousValue, currentValue]);
47691
46886
  if (schemaStats && schemaStats.length > 1) {
47692
46887
  if (isLoading) {
47693
46888
  return /* @__PURE__ */ jsx(
@@ -47962,6 +47157,37 @@ var init_VariablePanel = __esm({
47962
47157
  VariablePanel.displayName = "VariablePanel";
47963
47158
  }
47964
47159
  });
47160
+ function StateJsonView({
47161
+ data,
47162
+ label,
47163
+ defaultExpanded = false,
47164
+ className
47165
+ }) {
47166
+ const { t } = useTranslate();
47167
+ const [expanded, setExpanded] = useState(defaultExpanded);
47168
+ const jsonString = JSON.stringify(data, null, 2);
47169
+ return /* @__PURE__ */ jsxs(VStack, { className: cn("rounded-lg border border-border overflow-hidden", className), gap: "none", children: [
47170
+ /* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between p-2 bg-muted", gap: "sm", children: [
47171
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground font-medium", children: label ?? t("stateArchitect.viewCode") }),
47172
+ /* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: () => setExpanded(!expanded), className: "text-xs", children: expanded ? t("stateArchitect.hideJson") : t("stateArchitect.showJson") })
47173
+ ] }),
47174
+ expanded && /* @__PURE__ */ jsx(Box, { className: "p-3 bg-background overflow-x-auto", children: /* @__PURE__ */ jsx(
47175
+ Typography,
47176
+ {
47177
+ variant: "caption",
47178
+ className: "text-foreground font-mono whitespace-pre text-xs leading-relaxed block",
47179
+ children: jsonString
47180
+ }
47181
+ ) })
47182
+ ] });
47183
+ }
47184
+ var init_StateJsonView = __esm({
47185
+ "components/game/organisms/puzzles/state-architect/StateJsonView.tsx"() {
47186
+ init_atoms2();
47187
+ init_cn();
47188
+ StateJsonView.displayName = "StateJsonView";
47189
+ }
47190
+ });
47965
47191
  function layoutStates(states, width, height) {
47966
47192
  const cx = width / 2;
47967
47193
  const cy = height / 2;
@@ -48253,7 +47479,7 @@ function StateArchitectBoard({
48253
47479
  !r2.passed && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-error", children: t("stateArchitect.gotState", { state: r2.actualState }) })
48254
47480
  ] }, i))
48255
47481
  ] }),
48256
- resolved.showCodeView !== false && /* @__PURE__ */ jsx(CodeView, { data: codeData, label: "View Code" })
47482
+ resolved.showCodeView !== false && /* @__PURE__ */ jsx(StateJsonView, { data: codeData, label: "View Code" })
48257
47483
  ] })
48258
47484
  ] }),
48259
47485
  playState === "success" && /* @__PURE__ */ jsx(Box, { className: "p-4 rounded-container bg-success/20 border border-success text-center", children: /* @__PURE__ */ jsx(Typography, { variant: "h5", className: "text-success", children: str(resolved.successMessage) || t("stateArchitect.allPassed") }) }),
@@ -48290,7 +47516,7 @@ var init_StateArchitectBoard = __esm({
48290
47516
  init_StateNode();
48291
47517
  init_TransitionArrow();
48292
47518
  init_VariablePanel();
48293
- init_CodeView();
47519
+ init_StateJsonView();
48294
47520
  init_boardEntity();
48295
47521
  ENCOURAGEMENT_KEYS3 = [
48296
47522
  "puzzle.tryAgain1",
@@ -48615,7 +47841,7 @@ var init_Timeline = __esm({
48615
47841
  }) => {
48616
47842
  const { t } = useTranslate();
48617
47843
  const entityData = Array.isArray(entity) ? entity : [];
48618
- const items = React97__default.useMemo(() => {
47844
+ const items = React93__default.useMemo(() => {
48619
47845
  if (propItems) return propItems;
48620
47846
  if (entityData.length === 0) return [];
48621
47847
  return entityData.map((record, idx) => {
@@ -48722,7 +47948,7 @@ var init_Timeline = __esm({
48722
47948
  }
48723
47949
  });
48724
47950
  function extractToastProps(children) {
48725
- if (!React97__default.isValidElement(children)) {
47951
+ if (!React93__default.isValidElement(children)) {
48726
47952
  if (typeof children === "string") {
48727
47953
  return { message: children };
48728
47954
  }
@@ -48760,7 +47986,7 @@ var init_ToastSlot = __esm({
48760
47986
  eventBus.emit("UI:CLOSE");
48761
47987
  };
48762
47988
  if (!isVisible) return null;
48763
- const isCustomContent = React97__default.isValidElement(children) && !message;
47989
+ const isCustomContent = React93__default.isValidElement(children) && !message;
48764
47990
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
48765
47991
  Toast,
48766
47992
  {
@@ -49270,12 +48496,12 @@ var init_WorldMapTemplate = __esm({
49270
48496
  }
49271
48497
  });
49272
48498
  function lazyThree(name, loader) {
49273
- const Lazy = React97__default.lazy(() => loader().then((m) => ({ default: m[name] })));
48499
+ const Lazy = React93__default.lazy(() => loader().then((m) => ({ default: m[name] })));
49274
48500
  function ThreeWrapper(props) {
49275
- return React97__default.createElement(
49276
- React97__default.Suspense,
48501
+ return React93__default.createElement(
48502
+ React93__default.Suspense,
49277
48503
  { fallback: null },
49278
- React97__default.createElement(Lazy, props)
48504
+ React93__default.createElement(Lazy, props)
49279
48505
  );
49280
48506
  }
49281
48507
  ThreeWrapper.displayName = `Lazy(${name})`;
@@ -49295,7 +48521,6 @@ var init_component_registry_generated = __esm({
49295
48521
  init_AnimatedReveal();
49296
48522
  init_ArticleSection();
49297
48523
  init_Aside();
49298
- init_AssetPicker();
49299
48524
  init_AuthLayout();
49300
48525
  init_BattleBoard();
49301
48526
  init_BattleTemplate();
@@ -49324,8 +48549,6 @@ var init_component_registry_generated = __esm({
49324
48549
  init_ChoiceButton();
49325
48550
  init_ClassifierBoard();
49326
48551
  init_CodeBlock();
49327
- init_CodeView();
49328
- init_CodeViewer();
49329
48552
  init_CombatLog();
49330
48553
  init_ComboCounter();
49331
48554
  init_CommunityLinks();
@@ -49353,7 +48576,6 @@ var init_component_registry_generated = __esm({
49353
48576
  init_DialogueBox();
49354
48577
  init_DialogueBubble();
49355
48578
  init_DocBreadcrumb();
49356
- init_DocCodeBlock();
49357
48579
  init_DocPagination();
49358
48580
  init_DocSearch();
49359
48581
  init_DocSidebar();
@@ -49395,13 +48617,11 @@ var init_component_registry_generated = __esm({
49395
48617
  init_GradientDivider();
49396
48618
  init_GraphCanvas();
49397
48619
  init_GraphView();
49398
- init_GridPicker();
49399
48620
  init_Header();
49400
48621
  init_HealthBar();
49401
48622
  init_HealthPanel();
49402
48623
  init_HeroOrganism();
49403
48624
  init_HeroSection();
49404
- init_IconPicker();
49405
48625
  init_InfiniteScrollSentinel();
49406
48626
  init_InputGroup();
49407
48627
  init_InstallBox();
@@ -49446,7 +48666,6 @@ var init_component_registry_generated = __esm({
49446
48666
  init_PricingOrganism();
49447
48667
  init_PricingPageTemplate();
49448
48668
  init_ProgressDots();
49449
- init_PropertyInspector();
49450
48669
  init_PullQuote();
49451
48670
  init_PullToRefresh();
49452
48671
  init_QrScanner();
@@ -49570,7 +48789,6 @@ var init_component_registry_generated = __esm({
49570
48789
  "AnimatedReveal": AnimatedReveal,
49571
48790
  "ArticleSection": ArticleSection,
49572
48791
  "Aside": Aside,
49573
- "AssetPicker": AssetPicker,
49574
48792
  "AuthLayout": AuthLayout,
49575
48793
  "Avatar": AvatarPattern,
49576
48794
  "AvatarPattern": AvatarPattern,
@@ -49612,8 +48830,6 @@ var init_component_registry_generated = __esm({
49612
48830
  "ChoiceButton": ChoiceButton,
49613
48831
  "ClassifierBoard": ClassifierBoard,
49614
48832
  "CodeBlock": CodeBlock,
49615
- "CodeView": CodeView,
49616
- "CodeViewer": CodeViewer,
49617
48833
  "CombatLog": CombatLog,
49618
48834
  "ComboCounter": ComboCounter,
49619
48835
  "CommunityLinks": CommunityLinks,
@@ -49645,7 +48861,6 @@ var init_component_registry_generated = __esm({
49645
48861
  "Divider": DividerPattern,
49646
48862
  "DividerPattern": DividerPattern,
49647
48863
  "DocBreadcrumb": DocBreadcrumb,
49648
- "DocCodeBlock": DocCodeBlock,
49649
48864
  "DocPagination": DocPagination,
49650
48865
  "DocSearch": DocSearch,
49651
48866
  "DocSidebar": DocSidebar,
@@ -49690,7 +48905,6 @@ var init_component_registry_generated = __esm({
49690
48905
  "GraphView": GraphView,
49691
48906
  "Grid": GridPattern,
49692
48907
  "GridPattern": GridPattern,
49693
- "GridPicker": GridPicker,
49694
48908
  "HStack": HStackPattern,
49695
48909
  "HStackPattern": HStackPattern,
49696
48910
  "Header": Header,
@@ -49700,7 +48914,6 @@ var init_component_registry_generated = __esm({
49700
48914
  "HeroSection": HeroSection,
49701
48915
  "Icon": IconPattern,
49702
48916
  "IconPattern": IconPattern,
49703
- "IconPicker": IconPicker,
49704
48917
  "InfiniteScrollSentinel": InfiniteScrollSentinel,
49705
48918
  "Input": InputPattern,
49706
48919
  "InputGroup": InputGroup,
@@ -49757,7 +48970,6 @@ var init_component_registry_generated = __esm({
49757
48970
  "ProgressBar": ProgressBarPattern,
49758
48971
  "ProgressBarPattern": ProgressBarPattern,
49759
48972
  "ProgressDots": ProgressDots,
49760
- "PropertyInspector": PropertyInspector,
49761
48973
  "PullQuote": PullQuote,
49762
48974
  "PullToRefresh": PullToRefresh,
49763
48975
  "QrScanner": QrScanner,
@@ -49899,7 +49111,7 @@ function SuspenseConfigProvider({
49899
49111
  config,
49900
49112
  children
49901
49113
  }) {
49902
- return React97__default.createElement(
49114
+ return React93__default.createElement(
49903
49115
  SuspenseConfigContext.Provider,
49904
49116
  { value: config },
49905
49117
  children
@@ -50389,7 +49601,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
50389
49601
  const key = `${parentId}-${index}-trait:${traitName}`;
50390
49602
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
50391
49603
  }
50392
- return /* @__PURE__ */ jsx(React97__default.Fragment, { children: child }, `${parentId}-${index}`);
49604
+ return /* @__PURE__ */ jsx(React93__default.Fragment, { children: child }, `${parentId}-${index}`);
50393
49605
  }
50394
49606
  if (!child || typeof child !== "object") return null;
50395
49607
  const childId = `${parentId}-${index}`;
@@ -50429,14 +49641,14 @@ function isPatternConfig(value) {
50429
49641
  if (value === null || value === void 0) return false;
50430
49642
  if (typeof value !== "object") return false;
50431
49643
  if (Array.isArray(value)) return false;
50432
- if (React97__default.isValidElement(value)) return false;
49644
+ if (React93__default.isValidElement(value)) return false;
50433
49645
  if (value instanceof Date) return false;
50434
49646
  if (typeof value === "function") return false;
50435
49647
  const record = value;
50436
49648
  return "type" in record && typeof record.type === "string";
50437
49649
  }
50438
49650
  function isPlainConfigObject(value) {
50439
- if (React97__default.isValidElement(value)) return false;
49651
+ if (React93__default.isValidElement(value)) return false;
50440
49652
  if (value instanceof Date) return false;
50441
49653
  const proto = Object.getPrototypeOf(value);
50442
49654
  return proto === Object.prototype || proto === null;
@@ -50925,7 +50137,7 @@ var AvlTransition = ({
50925
50137
  opacity = 1,
50926
50138
  className
50927
50139
  }) => {
50928
- const ids = React97__default.useMemo(() => {
50140
+ const ids = React93__default.useMemo(() => {
50929
50141
  avlTransitionId += 1;
50930
50142
  return { arrow: `avl-tr-${avlTransitionId}-arrow` };
50931
50143
  }, []);
@@ -51486,7 +50698,7 @@ var AvlStateMachine = ({
51486
50698
  color = "var(--color-primary)",
51487
50699
  animated = false
51488
50700
  }) => {
51489
- const ids = React97__default.useMemo(() => {
50701
+ const ids = React93__default.useMemo(() => {
51490
50702
  avlSmId += 1;
51491
50703
  const base = `avl-sm-${avlSmId}`;
51492
50704
  return { glow: `${base}-glow`, grad: `${base}-grad` };
@@ -51685,7 +50897,7 @@ var AvlOrbitalUnit = ({
51685
50897
  color = "var(--color-primary)",
51686
50898
  animated = false
51687
50899
  }) => {
51688
- const ids = React97__default.useMemo(() => {
50900
+ const ids = React93__default.useMemo(() => {
51689
50901
  avlOuId += 1;
51690
50902
  const base = `avl-ou-${avlOuId}`;
51691
50903
  return { glow: `${base}-glow`, grad: `${base}-grad` };
@@ -51781,7 +50993,7 @@ var AvlClosedCircuit = ({
51781
50993
  color = "var(--color-primary)",
51782
50994
  animated = false
51783
50995
  }) => {
51784
- const ids = React97__default.useMemo(() => {
50996
+ const ids = React93__default.useMemo(() => {
51785
50997
  avlCcId += 1;
51786
50998
  const base = `avl-cc-${avlCcId}`;
51787
50999
  return { glow: `${base}-glow`, grad: `${base}-grad`, arrow: `${base}-arrow` };
@@ -51936,7 +51148,7 @@ var AvlEmitListen = ({
51936
51148
  color = "var(--color-primary)",
51937
51149
  animated = false
51938
51150
  }) => {
51939
- const ids = React97__default.useMemo(() => {
51151
+ const ids = React93__default.useMemo(() => {
51940
51152
  avlElId += 1;
51941
51153
  const base = `avl-el-${avlElId}`;
51942
51154
  return { arrow: `${base}-arrow`, grad: `${base}-grad` };
@@ -52210,7 +51422,7 @@ function renderNode(node, color, glowId) {
52210
51422
  const baseR = node.type === "operator" ? 20 : 16;
52211
51423
  const r2 = Math.max(baseR, labelLen * 3.5 + 6);
52212
51424
  const nc = nodeColor(node.type, color);
52213
- return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
51425
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
52214
51426
  node.children.map((child, i) => {
52215
51427
  const childR = Math.max(
52216
51428
  child.type === "operator" ? 20 : 16,
@@ -52267,7 +51479,7 @@ var AvlExprTree = ({
52267
51479
  className,
52268
51480
  color = "var(--color-primary)"
52269
51481
  }) => {
52270
- const ids = React97__default.useMemo(() => {
51482
+ const ids = React93__default.useMemo(() => {
52271
51483
  avlEtId += 1;
52272
51484
  return { glow: `avl-et-${avlEtId}-glow` };
52273
51485
  }, []);
@@ -53091,7 +52303,7 @@ var SystemNode = ({ data }) => {
53091
52303
  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) => {
53092
52304
  const tc = transitionCounts[s.name] ?? 0;
53093
52305
  const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
53094
- return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
52306
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
53095
52307
  /* @__PURE__ */ jsx(AvlState, { x: i * 14 + 1, y: 1, width: 10, height: 8, name: "", role, isInitial: s.isInitial, isTerminal: s.isTerminal }),
53096
52308
  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 })
53097
52309
  ] }, s.name);
@@ -54243,7 +53455,7 @@ function resolveLambdaBindings(body, params, item, index) {
54243
53455
  if (Array.isArray(body)) {
54244
53456
  return body.map((b) => recur(b));
54245
53457
  }
54246
- if (body !== null && typeof body === "object" && !React97__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
53458
+ if (body !== null && typeof body === "object" && !React93__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
54247
53459
  const out = {};
54248
53460
  for (const [k, v] of Object.entries(body)) {
54249
53461
  out[k] = recur(v);
@@ -54262,7 +53474,7 @@ function getSlotContentRenderer2() {
54262
53474
  function makeLambdaFn(params, lambdaBody, callerKey) {
54263
53475
  return (item, index) => {
54264
53476
  const resolvedBody = resolveLambdaBindings(lambdaBody, params, item, index);
54265
- if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React97__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
53477
+ if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React93__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
54266
53478
  return null;
54267
53479
  }
54268
53480
  const record = resolvedBody;
@@ -54281,7 +53493,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
54281
53493
  props: childProps,
54282
53494
  priority: 0
54283
53495
  };
54284
- return React97__default.createElement(SlotContentRenderer2, { content: childContent });
53496
+ return React93__default.createElement(SlotContentRenderer2, { content: childContent });
54285
53497
  };
54286
53498
  }
54287
53499
  function convertNode(node, callerKey) {
@@ -54300,7 +53512,7 @@ function convertNode(node, callerKey) {
54300
53512
  });
54301
53513
  return anyChanged ? mapped : node;
54302
53514
  }
54303
- if (typeof node === "object" && !React97__default.isValidElement(node) && !(node instanceof Date)) {
53515
+ if (typeof node === "object" && !React93__default.isValidElement(node) && !(node instanceof Date)) {
54304
53516
  return convertObjectProps(node);
54305
53517
  }
54306
53518
  return node;
@@ -56313,8 +55525,8 @@ function CanvasDndProvider({
56313
55525
  }) {
56314
55526
  const eventBus = useEventBus();
56315
55527
  const sensors = useAlmadarDndSensors(false);
56316
- const [activePayload, setActivePayload] = React97__default.useState(null);
56317
- const handleDragStart = React97__default.useCallback((e) => {
55528
+ const [activePayload, setActivePayload] = React93__default.useState(null);
55529
+ const handleDragStart = React93__default.useCallback((e) => {
56318
55530
  const data = e.active.data.current;
56319
55531
  const payload = data?.payload;
56320
55532
  if (payload) {
@@ -56325,7 +55537,7 @@ function CanvasDndProvider({
56325
55537
  log11.warn("dragStart:missing-payload", { id: e.active.id });
56326
55538
  }
56327
55539
  }, [eventBus]);
56328
- const handleDragEnd = React97__default.useCallback((e) => {
55540
+ const handleDragEnd = React93__default.useCallback((e) => {
56329
55541
  setActivePayload(null);
56330
55542
  const activeData = e.active.data.current;
56331
55543
  const payload = activeData?.payload;
@@ -56354,7 +55566,7 @@ function CanvasDndProvider({
56354
55566
  const suppressed = onDrop ? onDrop(drop) === true : false;
56355
55567
  if (!suppressed) defaultEmit(eventBus, drop);
56356
55568
  }, [eventBus, onDrop]);
56357
- const handleDragCancel = React97__default.useCallback(() => {
55569
+ const handleDragCancel = React93__default.useCallback(() => {
56358
55570
  setActivePayload(null);
56359
55571
  log11.info("dragCancel");
56360
55572
  }, []);
@@ -57108,7 +56320,7 @@ var OrbPreviewNodeInner = (props) => {
57108
56320
  }
57109
56321
  );
57110
56322
  };
57111
- var OrbPreviewNode = React97__default.memo(OrbPreviewNodeInner);
56323
+ var OrbPreviewNode = React93__default.memo(OrbPreviewNodeInner);
57112
56324
  OrbPreviewNode.displayName = "OrbPreviewNode";
57113
56325
  orbPreviewLog.debug("export-resolved", () => ({
57114
56326
  type: typeof OrbPreviewNode,
@@ -57213,7 +56425,7 @@ var EventFlowEdgeInner = (props) => {
57213
56425
  ) })
57214
56426
  ] });
57215
56427
  };
57216
- var EventFlowEdge = React97__default.memo(EventFlowEdgeInner);
56428
+ var EventFlowEdge = React93__default.memo(EventFlowEdgeInner);
57217
56429
  EventFlowEdge.displayName = "EventFlowEdge";
57218
56430
 
57219
56431
  // components/avl/molecules/BehaviorComposeNode.tsx
@@ -57360,7 +56572,7 @@ var BehaviorComposeNodeInner = (props) => {
57360
56572
  }
57361
56573
  );
57362
56574
  };
57363
- var BehaviorComposeNode = React97__default.memo(BehaviorComposeNodeInner);
56575
+ var BehaviorComposeNode = React93__default.memo(BehaviorComposeNodeInner);
57364
56576
  BehaviorComposeNode.displayName = "BehaviorComposeNode";
57365
56577
 
57366
56578
  // components/avl/molecules/avl-behavior-compose-converter.ts
@@ -57756,8 +56968,8 @@ function OrbInspector({ node, schema, editable = false, userType = "builder", th
57756
56968
  const explicitValue = patternConfig ? patternConfig[propName] : void 0;
57757
56969
  const defaultValue = ps.default;
57758
56970
  const isImplicit = explicitValue === void 0 && defaultValue !== void 0;
57759
- const currentValue2 = explicitValue !== void 0 ? explicitValue : defaultValue;
57760
- const displayValue = currentValue2 !== void 0 ? typeof currentValue2 === "object" ? JSON.stringify(currentValue2) : String(currentValue2) : "";
56971
+ const currentValue = explicitValue !== void 0 ? explicitValue : defaultValue;
56972
+ const displayValue = currentValue !== void 0 ? typeof currentValue === "object" ? JSON.stringify(currentValue) : String(currentValue) : "";
57761
56973
  inspectorLog.debug("prop-row", () => ({
57762
56974
  patternType: patternDef.type,
57763
56975
  patternId: selectedPattern?.patternId ?? "",
@@ -58372,7 +57584,7 @@ var TraitCardNodeInner = (props) => {
58372
57584
  }
58373
57585
  );
58374
57586
  };
58375
- var TraitCardNode = React97__default.memo(TraitCardNodeInner);
57587
+ var TraitCardNode = React93__default.memo(TraitCardNodeInner);
58376
57588
  TraitCardNode.displayName = "TraitCardNode";
58377
57589
 
58378
57590
  // components/avl/organisms/FlowCanvas.tsx
@@ -58445,7 +57657,7 @@ function FlowCanvasInner({
58445
57657
  initialOrbital
58446
57658
  );
58447
57659
  const [expandedBehaviorAlias, setExpandedBehaviorAlias] = useState(void 0);
58448
- const screenSizeUserOverrideRef = React97__default.useRef(false);
57660
+ const screenSizeUserOverrideRef = React93__default.useRef(false);
58449
57661
  const [screenSize, setScreenSize] = useState(
58450
57662
  () => typeof window === "undefined" ? "laptop" : detectScreenSize(window.innerWidth)
58451
57663
  );
@@ -58829,7 +58041,7 @@ var ZoomBreadcrumb = ({
58829
58041
  if (eventName && band === "detail") {
58830
58042
  segments.push({ icon: "\u26A1", label: eventName });
58831
58043
  }
58832
- 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: [
58044
+ return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-xs text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
58833
58045
  i > 0 && /* @__PURE__ */ jsx("span", { className: "opacity-40", children: ">" }),
58834
58046
  /* @__PURE__ */ jsx("span", { className: "opacity-60", children: seg.icon }),
58835
58047
  /* @__PURE__ */ jsx("span", { children: seg.label })
@@ -59170,7 +58382,7 @@ var EventWireOverlay = ({
59170
58382
  containerW,
59171
58383
  containerH
59172
58384
  }) => {
59173
- const ids = React97__default.useMemo(() => {
58385
+ const ids = React93__default.useMemo(() => {
59174
58386
  avlOczWireId += 1;
59175
58387
  return { arrow: `avl-ocz-wire-${avlOczWireId}-arrow` };
59176
58388
  }, []);
@@ -59537,7 +58749,7 @@ var AvlOrbitalsCosmicZoom = ({
59537
58749
  borderRadius: 6,
59538
58750
  border: `1px solid ${color}`
59539
58751
  },
59540
- children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
58752
+ children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
59541
58753
  i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", style: { opacity: 0.5, color }, children: "/" }),
59542
58754
  i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
59543
58755
  Box,