@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
@@ -1,5 +1,5 @@
1
- import * as React88 from 'react';
2
- import React88__default, { createContext, useMemo, useContext, useRef, useEffect, useCallback, Suspense, useState, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
1
+ import * as React84 from 'react';
2
+ import React84__default, { createContext, useMemo, useContext, useRef, useEffect, useCallback, Suspense, useState, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
3
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
4
  import { clsx } from 'clsx';
5
5
  import { twMerge } from 'tailwind-merge';
@@ -393,7 +393,7 @@ var init_Box = __esm({
393
393
  fixed: "fixed",
394
394
  sticky: "sticky"
395
395
  };
396
- Box = React88__default.forwardRef(
396
+ Box = React84__default.forwardRef(
397
397
  ({
398
398
  padding,
399
399
  paddingX,
@@ -443,7 +443,7 @@ var init_Box = __esm({
443
443
  onMouseLeave?.(e);
444
444
  }, [hoverEvent, eventBus, onMouseLeave]);
445
445
  const isClickable = action || onClick;
446
- return React88__default.createElement(
446
+ return React84__default.createElement(
447
447
  Component,
448
448
  {
449
449
  ref,
@@ -1182,12 +1182,20 @@ function doResolve(name) {
1182
1182
  if (asIs && typeof asIs === "object") return asIs;
1183
1183
  return LucideIcons2.HelpCircle;
1184
1184
  }
1185
- var iconAliases, resolvedCache, sizeClasses, animationClasses, Icon;
1185
+ var colorTokenClasses, iconAliases, resolvedCache, sizeClasses, animationClasses, Icon;
1186
1186
  var init_Icon = __esm({
1187
1187
  "components/core/atoms/Icon.tsx"() {
1188
1188
  "use client";
1189
1189
  init_cn();
1190
1190
  init_iconFamily();
1191
+ colorTokenClasses = {
1192
+ primary: "text-primary",
1193
+ secondary: "text-secondary",
1194
+ success: "text-success",
1195
+ warning: "text-warning",
1196
+ error: "text-error",
1197
+ muted: "text-muted-foreground"
1198
+ };
1191
1199
  iconAliases = {
1192
1200
  "close": LucideIcons2.X,
1193
1201
  "trash": LucideIcons2.Trash2,
@@ -1226,7 +1234,7 @@ var init_Icon = __esm({
1226
1234
  const directIcon = typeof icon === "string" ? void 0 : icon;
1227
1235
  const effectiveName = typeof icon === "string" ? icon : name;
1228
1236
  const family = useIconFamily();
1229
- const RenderedComponent = React88__default.useMemo(() => {
1237
+ const RenderedComponent = React84__default.useMemo(() => {
1230
1238
  if (directIcon) return null;
1231
1239
  return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
1232
1240
  }, [directIcon, effectiveName, family]);
@@ -1235,10 +1243,11 @@ var init_Icon = __esm({
1235
1243
  ...effectiveStrokeWidth === void 0 ? { strokeWidth: "var(--icon-stroke-width, 2)" } : {},
1236
1244
  ...style
1237
1245
  };
1246
+ const resolvedColor = color ? color in colorTokenClasses ? colorTokenClasses[color] : color : "text-current";
1238
1247
  const composedClassName = cn(
1239
1248
  sizeClasses[size],
1240
1249
  animationClasses[animation],
1241
- color ? color : "text-current",
1250
+ resolvedColor,
1242
1251
  className
1243
1252
  );
1244
1253
  if (directIcon) {
@@ -1284,7 +1293,7 @@ function resolveIconProp(value, sizeClass) {
1284
1293
  const IconComp = value;
1285
1294
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
1286
1295
  }
1287
- if (React88__default.isValidElement(value)) {
1296
+ if (React84__default.isValidElement(value)) {
1288
1297
  return value;
1289
1298
  }
1290
1299
  if (typeof value === "object" && value !== null && "render" in value) {
@@ -1360,7 +1369,7 @@ var init_Button = __esm({
1360
1369
  md: "h-icon-default w-icon-default",
1361
1370
  lg: "h-icon-default w-icon-default"
1362
1371
  };
1363
- Button = React88__default.forwardRef(
1372
+ Button = React84__default.forwardRef(
1364
1373
  ({
1365
1374
  className,
1366
1375
  variant = "primary",
@@ -1425,7 +1434,7 @@ var Dialog;
1425
1434
  var init_Dialog = __esm({
1426
1435
  "components/core/atoms/Dialog.tsx"() {
1427
1436
  init_cn();
1428
- Dialog = React88__default.forwardRef(
1437
+ Dialog = React84__default.forwardRef(
1429
1438
  ({
1430
1439
  role = "dialog",
1431
1440
  "aria-modal": ariaModal = true,
@@ -1451,11 +1460,9 @@ var init_Dialog = __esm({
1451
1460
  // components/core/atoms/Typography.tsx
1452
1461
  var Typography_exports = {};
1453
1462
  __export(Typography_exports, {
1454
- Heading: () => Heading,
1455
- Text: () => Text,
1456
1463
  Typography: () => Typography
1457
1464
  });
1458
- var variantStyles2, colorStyles, weightStyles, defaultElements, typographySizeStyles, overflowStyles2, Typography, sizeStyles2, Heading, Text;
1465
+ var variantStyles2, colorStyles, weightStyles, defaultElements, typographySizeStyles, overflowStyles2, Typography;
1459
1466
  var init_Typography = __esm({
1460
1467
  "components/core/atoms/Typography.tsx"() {
1461
1468
  init_cn();
@@ -1566,83 +1573,6 @@ var init_Typography = __esm({
1566
1573
  );
1567
1574
  };
1568
1575
  Typography.displayName = "Typography";
1569
- sizeStyles2 = {
1570
- xs: "text-xs",
1571
- sm: "text-sm",
1572
- md: "text-base",
1573
- lg: "text-lg",
1574
- xl: "text-xl",
1575
- "2xl": "text-2xl",
1576
- "3xl": "text-3xl"
1577
- };
1578
- Heading = ({
1579
- level = 2,
1580
- size,
1581
- className,
1582
- ...props
1583
- }) => {
1584
- const variant = `h${level}`;
1585
- const sizeClass = size ? sizeStyles2[size] : void 0;
1586
- return /* @__PURE__ */ jsx(
1587
- Typography,
1588
- {
1589
- variant,
1590
- className: cn(sizeClass, className),
1591
- ...props
1592
- }
1593
- );
1594
- };
1595
- Heading.displayName = "Heading";
1596
- Text = ({
1597
- variant = "body",
1598
- ...props
1599
- }) => {
1600
- return /* @__PURE__ */ jsx(
1601
- Typography,
1602
- {
1603
- variant,
1604
- ...props
1605
- }
1606
- );
1607
- };
1608
- Text.displayName = "Text";
1609
- }
1610
- });
1611
- var Overlay;
1612
- var init_Overlay = __esm({
1613
- "components/core/atoms/Overlay.tsx"() {
1614
- "use client";
1615
- init_cn();
1616
- init_useEventBus();
1617
- Overlay = ({
1618
- isVisible = true,
1619
- onClick,
1620
- className,
1621
- blur = false,
1622
- action
1623
- }) => {
1624
- const eventBus = useEventBus();
1625
- if (!isVisible) return null;
1626
- const handleClick = (e) => {
1627
- if (action) {
1628
- eventBus.emit(`UI:${action}`, {});
1629
- }
1630
- onClick?.(e);
1631
- };
1632
- return /* @__PURE__ */ jsx(
1633
- "div",
1634
- {
1635
- className: cn(
1636
- "fixed inset-0 z-40",
1637
- blur && "backdrop-blur-sm",
1638
- className
1639
- ),
1640
- style: { backgroundColor: "rgba(0, 0, 0, 0.6)" },
1641
- onClick: action || onClick ? handleClick : void 0,
1642
- "aria-hidden": "true"
1643
- }
1644
- );
1645
- };
1646
1576
  }
1647
1577
  });
1648
1578
  var sizeClasses2, minWidthClasses, lookStyles, Modal;
@@ -1653,7 +1583,6 @@ var init_Modal = __esm({
1653
1583
  init_Button();
1654
1584
  init_Dialog();
1655
1585
  init_Typography();
1656
- init_Overlay();
1657
1586
  init_cn();
1658
1587
  init_useEventBus();
1659
1588
  sizeClasses2 = {
@@ -1743,130 +1672,160 @@ var init_Modal = __esm({
1743
1672
  }
1744
1673
  };
1745
1674
  return createPortal(
1746
- /* @__PURE__ */ jsxs(Fragment, { children: [
1747
- /* @__PURE__ */ jsx(
1748
- Overlay,
1749
- {
1750
- isVisible: isOpen,
1751
- onClick: handleOverlayClick,
1752
- className: "z-[1000]"
1753
- }
1754
- ),
1755
- /* @__PURE__ */ jsx(
1756
- Box,
1757
- {
1758
- className: cn(
1759
- "fixed inset-0 z-[1001] pointer-events-none",
1760
- "flex items-start justify-center px-4 pb-4 pt-[10vh]",
1761
- "max-sm:items-stretch max-sm:p-0 max-sm:pt-0"
1762
- ),
1763
- children: /* @__PURE__ */ jsxs(
1764
- Dialog,
1765
- {
1766
- ref: modalRef,
1767
- open: true,
1768
- className: cn(
1769
- // Reset browser-default dialog chrome — we own styling. `static`
1770
- // overrides the user-agent `position: absolute` so the parent
1771
- // flex container's `justify-center` actually centers the dialog
1772
- // (without this, the dialog drops out of flex flow and `m-0`
1773
- // kills the user-agent's `margin: auto` centering, pinning the
1774
- // dialog to top-left).
1775
- "static m-0 p-0 border-0 bg-transparent",
1776
- // Pre-existing dialog frame
1777
- "pointer-events-auto w-full flex flex-col bg-surface border shadow-elevation-dialog rounded-container",
1778
- // Desktop sizing + viewport-aware floor.
1779
- sizeClasses2[size],
1780
- minWidthClasses[size],
1781
- "max-h-[80vh]",
1782
- // Mobile: take the entire screen. Override desktop max-w cap,
1783
- // full height, no rounded corners, no min-width.
1784
- "max-sm:max-w-none max-sm:max-h-none max-sm:w-full max-sm:h-full max-sm:rounded-none",
1785
- lookStyles[look],
1786
- className
1675
+ /* @__PURE__ */ jsx(
1676
+ "div",
1677
+ {
1678
+ className: cn(
1679
+ "fixed inset-0 z-[1000]",
1680
+ "flex items-start justify-center px-4 pb-4 pt-[10vh]",
1681
+ "max-sm:items-stretch max-sm:p-0 max-sm:pt-0"
1682
+ ),
1683
+ style: { backgroundColor: "rgba(0, 0, 0, 0.6)" },
1684
+ onClick: handleOverlayClick,
1685
+ "aria-hidden": "true",
1686
+ children: /* @__PURE__ */ jsxs(
1687
+ Dialog,
1688
+ {
1689
+ ref: modalRef,
1690
+ open: true,
1691
+ className: cn(
1692
+ // Reset browser-default dialog chrome — we own styling. `static`
1693
+ // overrides the user-agent `position: absolute` so the parent
1694
+ // flex container's `justify-center` actually centers the dialog
1695
+ // (without this, the dialog drops out of flex flow and `m-0`
1696
+ // kills the user-agent's `margin: auto` centering, pinning the
1697
+ // dialog to top-left).
1698
+ "static m-0 p-0 border-0 bg-transparent",
1699
+ // Pre-existing dialog frame
1700
+ "pointer-events-auto w-full flex flex-col bg-surface border shadow-elevation-dialog rounded-container",
1701
+ // Desktop sizing + viewport-aware floor.
1702
+ sizeClasses2[size],
1703
+ minWidthClasses[size],
1704
+ "max-h-[80vh]",
1705
+ // Mobile: take the entire screen. Override desktop max-w cap,
1706
+ // full height, no rounded corners, no min-width.
1707
+ "max-sm:max-w-none max-sm:max-h-none max-sm:w-full max-sm:h-full max-sm:rounded-none",
1708
+ lookStyles[look],
1709
+ className
1710
+ ),
1711
+ style: dragY > 0 ? {
1712
+ transform: `translateY(${dragY}px)`,
1713
+ transition: isDragging.current ? "none" : "transform 200ms ease-out"
1714
+ } : void 0,
1715
+ ...title && { "aria-labelledby": "modal-title" },
1716
+ children: [
1717
+ /* @__PURE__ */ jsx(
1718
+ Box,
1719
+ {
1720
+ className: "hidden max-sm:flex justify-center py-2 cursor-grab active:cursor-grabbing touch-none",
1721
+ onPointerDown: (e) => {
1722
+ if (!swipeDownToClose) return;
1723
+ dragStartY.current = e.clientY;
1724
+ isDragging.current = true;
1725
+ e.target.setPointerCapture(e.pointerId);
1726
+ },
1727
+ onPointerMove: (e) => {
1728
+ if (!isDragging.current) return;
1729
+ const dy = Math.max(0, e.clientY - dragStartY.current);
1730
+ setDragY(dy);
1731
+ },
1732
+ onPointerUp: () => {
1733
+ if (!isDragging.current) return;
1734
+ isDragging.current = false;
1735
+ if (dragY > 100) {
1736
+ handleClose();
1737
+ }
1738
+ setDragY(0);
1739
+ },
1740
+ onPointerCancel: () => {
1741
+ isDragging.current = false;
1742
+ setDragY(0);
1743
+ },
1744
+ children: /* @__PURE__ */ jsx(Box, { className: "w-10 h-1 rounded-full bg-border" })
1745
+ }
1787
1746
  ),
1788
- style: dragY > 0 ? {
1789
- transform: `translateY(${dragY}px)`,
1790
- transition: isDragging.current ? "none" : "transform 200ms ease-out"
1791
- } : void 0,
1792
- ...title && { "aria-labelledby": "modal-title" },
1793
- children: [
1794
- /* @__PURE__ */ jsx(
1795
- Box,
1796
- {
1797
- className: "hidden max-sm:flex justify-center py-2 cursor-grab active:cursor-grabbing touch-none",
1798
- onPointerDown: (e) => {
1799
- if (!swipeDownToClose) return;
1800
- dragStartY.current = e.clientY;
1801
- isDragging.current = true;
1802
- e.target.setPointerCapture(e.pointerId);
1803
- },
1804
- onPointerMove: (e) => {
1805
- if (!isDragging.current) return;
1806
- const dy = Math.max(0, e.clientY - dragStartY.current);
1807
- setDragY(dy);
1808
- },
1809
- onPointerUp: () => {
1810
- if (!isDragging.current) return;
1811
- isDragging.current = false;
1812
- if (dragY > 100) {
1813
- handleClose();
1747
+ (title || showCloseButton) && /* @__PURE__ */ jsxs(
1748
+ Box,
1749
+ {
1750
+ className: cn(
1751
+ "px-6 py-4 flex items-center justify-between",
1752
+ "border-b-[length:var(--border-width)] border-border"
1753
+ ),
1754
+ children: [
1755
+ title && /* @__PURE__ */ jsx(Typography, { variant: "h4", as: "h2", id: "modal-title", children: title }),
1756
+ showCloseButton && /* @__PURE__ */ jsx(
1757
+ Button,
1758
+ {
1759
+ variant: "ghost",
1760
+ size: "sm",
1761
+ icon: "x",
1762
+ onClick: handleClose,
1763
+ "data-event": "CLOSE",
1764
+ "aria-label": t("aria.closeModal")
1814
1765
  }
1815
- setDragY(0);
1816
- },
1817
- onPointerCancel: () => {
1818
- isDragging.current = false;
1819
- setDragY(0);
1820
- },
1821
- children: /* @__PURE__ */ jsx(Box, { className: "w-10 h-1 rounded-full bg-border" })
1822
- }
1823
- ),
1824
- (title || showCloseButton) && /* @__PURE__ */ jsxs(
1825
- Box,
1826
- {
1827
- className: cn(
1828
- "px-6 py-4 flex items-center justify-between",
1829
- "border-b-[length:var(--border-width)] border-border"
1830
- ),
1831
- children: [
1832
- title && /* @__PURE__ */ jsx(Typography, { variant: "h4", as: "h2", id: "modal-title", children: title }),
1833
- showCloseButton && /* @__PURE__ */ jsx(
1834
- Button,
1835
- {
1836
- variant: "ghost",
1837
- size: "sm",
1838
- icon: "x",
1839
- onClick: handleClose,
1840
- "data-event": "CLOSE",
1841
- "aria-label": t("aria.closeModal")
1842
- }
1843
- )
1844
- ]
1845
- }
1846
- ),
1847
- /* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto p-6", children }),
1848
- footer && /* @__PURE__ */ jsx(
1849
- Box,
1850
- {
1851
- className: cn(
1852
- "px-6 py-4 bg-muted",
1853
- "border-t-[length:var(--border-width)] border-border"
1854
- ),
1855
- children: footer
1856
- }
1857
- )
1858
- ]
1859
- }
1860
- )
1861
- }
1862
- )
1863
- ] }),
1766
+ )
1767
+ ]
1768
+ }
1769
+ ),
1770
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto p-6", children }),
1771
+ footer && /* @__PURE__ */ jsx(
1772
+ Box,
1773
+ {
1774
+ className: cn(
1775
+ "px-6 py-4 bg-muted",
1776
+ "border-t-[length:var(--border-width)] border-border"
1777
+ ),
1778
+ children: footer
1779
+ }
1780
+ )
1781
+ ]
1782
+ }
1783
+ )
1784
+ }
1785
+ ),
1864
1786
  document.body
1865
1787
  );
1866
1788
  };
1867
1789
  Modal.displayName = "Modal";
1868
1790
  }
1869
1791
  });
1792
+ var Overlay;
1793
+ var init_Overlay = __esm({
1794
+ "components/core/atoms/Overlay.tsx"() {
1795
+ "use client";
1796
+ init_cn();
1797
+ init_useEventBus();
1798
+ Overlay = ({
1799
+ isVisible = true,
1800
+ onClick,
1801
+ className,
1802
+ blur = false,
1803
+ action
1804
+ }) => {
1805
+ const eventBus = useEventBus();
1806
+ if (!isVisible) return null;
1807
+ const handleClick = (e) => {
1808
+ if (action) {
1809
+ eventBus.emit(`UI:${action}`, {});
1810
+ }
1811
+ onClick?.(e);
1812
+ };
1813
+ return /* @__PURE__ */ jsx(
1814
+ "div",
1815
+ {
1816
+ className: cn(
1817
+ "fixed inset-0 z-40",
1818
+ blur && "backdrop-blur-sm",
1819
+ className
1820
+ ),
1821
+ style: { backgroundColor: "rgba(0, 0, 0, 0.6)" },
1822
+ onClick: action || onClick ? handleClick : void 0,
1823
+ "aria-hidden": "true"
1824
+ }
1825
+ );
1826
+ };
1827
+ }
1828
+ });
1870
1829
  var sizeWidths, Drawer;
1871
1830
  var init_Drawer = __esm({
1872
1831
  "components/core/molecules/Drawer.tsx"() {
@@ -2047,7 +2006,7 @@ var init_Drawer = __esm({
2047
2006
  Drawer.displayName = "Drawer";
2048
2007
  }
2049
2008
  });
2050
- var variantStyles3, sizeStyles3, Badge;
2009
+ var variantStyles3, sizeStyles2, Badge;
2051
2010
  var init_Badge = __esm({
2052
2011
  "components/core/atoms/Badge.tsx"() {
2053
2012
  init_cn();
@@ -2084,12 +2043,12 @@ var init_Badge = __esm({
2084
2043
  "border-[length:var(--border-width-thin)] border-border"
2085
2044
  ].join(" ")
2086
2045
  };
2087
- sizeStyles3 = {
2046
+ sizeStyles2 = {
2088
2047
  sm: "px-2 py-0.5 text-xs",
2089
2048
  md: "px-2.5 py-1 text-sm",
2090
2049
  lg: "px-3 py-1.5 text-base"
2091
2050
  };
2092
- Badge = React88__default.forwardRef(
2051
+ Badge = React84__default.forwardRef(
2093
2052
  ({ className, variant = "default", size = "sm", amount, label, icon, children, onRemove, removeLabel, ...props }, ref) => {
2094
2053
  const iconSizes3 = {
2095
2054
  sm: "h-icon-default w-icon-default",
@@ -2104,7 +2063,7 @@ var init_Badge = __esm({
2104
2063
  className: cn(
2105
2064
  "inline-flex items-center gap-1 font-bold rounded-sm",
2106
2065
  variantStyles3[variant],
2107
- sizeStyles3[size],
2066
+ sizeStyles2[size],
2108
2067
  onRemove && "pr-1",
2109
2068
  className
2110
2069
  ),
@@ -2405,7 +2364,7 @@ var init_SvgFlow = __esm({
2405
2364
  opacity = 1,
2406
2365
  className
2407
2366
  }) => {
2408
- const markerId = React88__default.useMemo(() => {
2367
+ const markerId = React84__default.useMemo(() => {
2409
2368
  flowIdCounter += 1;
2410
2369
  return `almadar-flow-arrow-${flowIdCounter}`;
2411
2370
  }, []);
@@ -2948,7 +2907,7 @@ var init_SvgRing = __esm({
2948
2907
  className,
2949
2908
  label
2950
2909
  }) => {
2951
- const gradientId = React88__default.useMemo(() => {
2910
+ const gradientId = React84__default.useMemo(() => {
2952
2911
  ringIdCounter += 1;
2953
2912
  return `almadar-ring-glow-${ringIdCounter}`;
2954
2913
  }, []);
@@ -3110,7 +3069,7 @@ var init_Input = __esm({
3110
3069
  "components/core/atoms/Input.tsx"() {
3111
3070
  init_cn();
3112
3071
  init_Icon();
3113
- Input = React88__default.forwardRef(
3072
+ Input = React84__default.forwardRef(
3114
3073
  ({
3115
3074
  className,
3116
3075
  inputType,
@@ -3231,7 +3190,7 @@ var Label;
3231
3190
  var init_Label = __esm({
3232
3191
  "components/core/atoms/Label.tsx"() {
3233
3192
  init_cn();
3234
- Label = React88__default.forwardRef(
3193
+ Label = React84__default.forwardRef(
3235
3194
  ({ className, required, children, ...props }, ref) => {
3236
3195
  return /* @__PURE__ */ jsxs(
3237
3196
  "label",
@@ -3257,7 +3216,7 @@ var Textarea;
3257
3216
  var init_Textarea = __esm({
3258
3217
  "components/core/atoms/Textarea.tsx"() {
3259
3218
  init_cn();
3260
- Textarea = React88__default.forwardRef(
3219
+ Textarea = React84__default.forwardRef(
3261
3220
  ({ className, error, ...props }, ref) => {
3262
3221
  return /* @__PURE__ */ jsx(
3263
3222
  "textarea",
@@ -3287,7 +3246,7 @@ var init_Select = __esm({
3287
3246
  "components/core/atoms/Select.tsx"() {
3288
3247
  init_cn();
3289
3248
  init_Icon();
3290
- Select = React88__default.forwardRef(
3249
+ Select = React84__default.forwardRef(
3291
3250
  ({ className, options, placeholder, error, ...props }, ref) => {
3292
3251
  return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
3293
3252
  /* @__PURE__ */ jsxs(
@@ -3329,7 +3288,7 @@ var Checkbox;
3329
3288
  var init_Checkbox = __esm({
3330
3289
  "components/core/atoms/Checkbox.tsx"() {
3331
3290
  init_cn();
3332
- Checkbox = React88__default.forwardRef(
3291
+ Checkbox = React84__default.forwardRef(
3333
3292
  ({ className, label, id, ...props }, ref) => {
3334
3293
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
3335
3294
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
@@ -3420,7 +3379,7 @@ var init_Card = __esm({
3420
3379
  chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
3421
3380
  "tile-image-first": "p-0 overflow-hidden"
3422
3381
  };
3423
- Card = React88__default.forwardRef(
3382
+ Card = React84__default.forwardRef(
3424
3383
  ({
3425
3384
  className,
3426
3385
  variant = "bordered",
@@ -3458,9 +3417,9 @@ var init_Card = __esm({
3458
3417
  }
3459
3418
  );
3460
3419
  Card.displayName = "Card";
3461
- CardHeader = React88__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
3420
+ CardHeader = React84__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
3462
3421
  CardHeader.displayName = "CardHeader";
3463
- CardTitle = React88__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3422
+ CardTitle = React84__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3464
3423
  "h3",
3465
3424
  {
3466
3425
  ref,
@@ -3473,11 +3432,11 @@ var init_Card = __esm({
3473
3432
  }
3474
3433
  ));
3475
3434
  CardTitle.displayName = "CardTitle";
3476
- CardContent = React88__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
3435
+ CardContent = React84__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
3477
3436
  CardContent.displayName = "CardContent";
3478
3437
  CardBody = CardContent;
3479
3438
  CardBody.displayName = "CardBody";
3480
- CardFooter = React88__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3439
+ CardFooter = React84__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3481
3440
  "div",
3482
3441
  {
3483
3442
  ref,
@@ -3488,7 +3447,7 @@ var init_Card = __esm({
3488
3447
  CardFooter.displayName = "CardFooter";
3489
3448
  }
3490
3449
  });
3491
- var variantStyles5, sizeStyles4, iconSizes, FilterPill;
3450
+ var variantStyles5, sizeStyles3, iconSizes, FilterPill;
3492
3451
  var init_FilterPill = __esm({
3493
3452
  "components/core/atoms/FilterPill.tsx"() {
3494
3453
  init_cn();
@@ -3522,7 +3481,7 @@ var init_FilterPill = __esm({
3522
3481
  "border-[length:var(--border-width-thin)] border-border"
3523
3482
  ].join(" ")
3524
3483
  };
3525
- sizeStyles4 = {
3484
+ sizeStyles3 = {
3526
3485
  sm: "px-2 py-0.5 text-xs",
3527
3486
  md: "px-2.5 py-1 text-sm",
3528
3487
  lg: "px-3 py-1.5 text-base"
@@ -3532,7 +3491,7 @@ var init_FilterPill = __esm({
3532
3491
  md: "w-3.5 h-3.5",
3533
3492
  lg: "w-4 h-4"
3534
3493
  };
3535
- FilterPill = React88__default.forwardRef(
3494
+ FilterPill = React84__default.forwardRef(
3536
3495
  ({
3537
3496
  className,
3538
3497
  variant = "default",
@@ -3566,7 +3525,7 @@ var init_FilterPill = __esm({
3566
3525
  className: cn(
3567
3526
  "inline-flex items-center gap-1 font-bold rounded-pill",
3568
3527
  variantStyles5[variant],
3569
- sizeStyles4[size],
3528
+ sizeStyles3[size],
3570
3529
  (onClick || clickEvent) && "cursor-pointer",
3571
3530
  className
3572
3531
  ),
@@ -3598,18 +3557,18 @@ var init_FilterPill = __esm({
3598
3557
  FilterPill.displayName = "FilterPill";
3599
3558
  }
3600
3559
  });
3601
- var sizeStyles5, Spinner;
3560
+ var sizeStyles4, Spinner;
3602
3561
  var init_Spinner = __esm({
3603
3562
  "components/core/atoms/Spinner.tsx"() {
3604
3563
  init_cn();
3605
3564
  init_Icon();
3606
- sizeStyles5 = {
3565
+ sizeStyles4 = {
3607
3566
  xs: "h-3 w-3",
3608
3567
  sm: "h-icon-default w-icon-default",
3609
3568
  md: "h-6 w-6",
3610
3569
  lg: "h-8 w-8"
3611
3570
  };
3612
- Spinner = React88__default.forwardRef(
3571
+ Spinner = React84__default.forwardRef(
3613
3572
  ({ className, size = "md", ...props }, ref) => {
3614
3573
  return /* @__PURE__ */ jsx(
3615
3574
  "div",
@@ -3617,7 +3576,7 @@ var init_Spinner = __esm({
3617
3576
  ref,
3618
3577
  className: cn("text-foreground", className),
3619
3578
  ...props,
3620
- children: /* @__PURE__ */ jsx(Icon, { name: "loader", className: cn("animate-spin", sizeStyles5[size]) })
3579
+ children: /* @__PURE__ */ jsx(Icon, { name: "loader", className: cn("animate-spin", sizeStyles4[size]) })
3621
3580
  }
3622
3581
  );
3623
3582
  }
@@ -3688,13 +3647,12 @@ var init_Avatar = __esm({
3688
3647
  actionPayload
3689
3648
  }) => {
3690
3649
  const eventBus = useEventBus();
3691
- const [imgFailed, setImgFailed] = React88__default.useState(false);
3692
- React88__default.useEffect(() => {
3650
+ const [imgFailed, setImgFailed] = React84__default.useState(false);
3651
+ React84__default.useEffect(() => {
3693
3652
  setImgFailed(false);
3694
3653
  }, [src]);
3695
3654
  const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
3696
3655
  const IconComponent = typeof iconProp === "string" ? resolveIcon(iconProp) : iconProp;
3697
- const hasImage = !!src && !imgFailed;
3698
3656
  const hasIcon = !!IconComponent;
3699
3657
  const hasInitials = !!initials && !(hasIcon && !providedInitials);
3700
3658
  const getInitialsBackground = () => "bg-primary text-primary-foreground";
@@ -3720,15 +3678,13 @@ var init_Avatar = __esm({
3720
3678
  onClick: isClickable ? handleClick : void 0,
3721
3679
  role: isClickable ? "button" : void 0,
3722
3680
  tabIndex: isClickable ? 0 : void 0,
3723
- children: hasImage ? /* @__PURE__ */ jsx(
3681
+ children: src && !imgFailed ? /* @__PURE__ */ jsx(
3724
3682
  "img",
3725
3683
  {
3726
3684
  src,
3727
3685
  alt: alt || "Avatar",
3728
3686
  className: "w-full h-full object-cover",
3729
- onError: () => {
3730
- setImgFailed(true);
3731
- }
3687
+ onError: () => setImgFailed(true)
3732
3688
  }
3733
3689
  ) : hasInitials ? /* @__PURE__ */ jsx(
3734
3690
  "div",
@@ -3909,6 +3865,7 @@ var init_ProgressBar = __esm({
3909
3865
  primary: "bg-primary",
3910
3866
  success: "bg-success",
3911
3867
  warning: "bg-warning",
3868
+ error: "bg-error",
3912
3869
  danger: "bg-error"
3913
3870
  };
3914
3871
  circularSizeClasses = {
@@ -4074,7 +4031,7 @@ var init_Radio = __esm({
4074
4031
  md: "w-2.5 h-2.5",
4075
4032
  lg: "w-3 h-3"
4076
4033
  };
4077
- Radio = React88__default.forwardRef(
4034
+ Radio = React84__default.forwardRef(
4078
4035
  ({
4079
4036
  label,
4080
4037
  helperText,
@@ -4091,12 +4048,12 @@ var init_Radio = __esm({
4091
4048
  onChange,
4092
4049
  ...props
4093
4050
  }, ref) => {
4094
- const reactId = React88__default.useId();
4051
+ const reactId = React84__default.useId();
4095
4052
  const baseId = id || `radio-${reactId}`;
4096
4053
  const hasError = !!error;
4097
4054
  const eventBus = useEventBus();
4098
- const [selected, setSelected] = React88__default.useState(value);
4099
- React88__default.useEffect(() => {
4055
+ const [selected, setSelected] = React84__default.useState(value);
4056
+ React84__default.useEffect(() => {
4100
4057
  if (value !== void 0) setSelected(value);
4101
4058
  }, [value]);
4102
4059
  const pick = (next, e) => {
@@ -4278,7 +4235,7 @@ var init_Switch = __esm({
4278
4235
  "components/core/atoms/Switch.tsx"() {
4279
4236
  "use client";
4280
4237
  init_cn();
4281
- Switch = React88.forwardRef(
4238
+ Switch = React84.forwardRef(
4282
4239
  ({
4283
4240
  checked,
4284
4241
  defaultChecked = false,
@@ -4289,10 +4246,10 @@ var init_Switch = __esm({
4289
4246
  name,
4290
4247
  className
4291
4248
  }, ref) => {
4292
- const [isChecked, setIsChecked] = React88.useState(
4249
+ const [isChecked, setIsChecked] = React84.useState(
4293
4250
  checked !== void 0 ? checked : defaultChecked
4294
4251
  );
4295
- React88.useEffect(() => {
4252
+ React84.useEffect(() => {
4296
4253
  if (checked !== void 0) {
4297
4254
  setIsChecked(checked);
4298
4255
  }
@@ -4823,7 +4780,7 @@ var Aside;
4823
4780
  var init_Aside = __esm({
4824
4781
  "components/core/atoms/Aside.tsx"() {
4825
4782
  init_cn();
4826
- Aside = React88__default.forwardRef(
4783
+ Aside = React84__default.forwardRef(
4827
4784
  ({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
4828
4785
  );
4829
4786
  Aside.displayName = "Aside";
@@ -4901,8 +4858,8 @@ var init_LawReferenceTooltip = __esm({
4901
4858
  className
4902
4859
  }) => {
4903
4860
  const { t } = useTranslate();
4904
- const [isVisible, setIsVisible] = React88__default.useState(false);
4905
- const timeoutRef = React88__default.useRef(null);
4861
+ const [isVisible, setIsVisible] = React84__default.useState(false);
4862
+ const timeoutRef = React84__default.useRef(null);
4906
4863
  const handleMouseEnter = () => {
4907
4864
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
4908
4865
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -4911,7 +4868,7 @@ var init_LawReferenceTooltip = __esm({
4911
4868
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
4912
4869
  setIsVisible(false);
4913
4870
  };
4914
- React88__default.useEffect(() => {
4871
+ React84__default.useEffect(() => {
4915
4872
  return () => {
4916
4873
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
4917
4874
  };
@@ -5096,7 +5053,7 @@ var init_TimeSlotCell = __esm({
5096
5053
  TimeSlotCell.displayName = "TimeSlotCell";
5097
5054
  }
5098
5055
  });
5099
- var statusColors, pulseRingColors, sizeStyles6, StatusDot;
5056
+ var statusColors, pulseRingColors, sizeStyles5, StatusDot;
5100
5057
  var init_StatusDot = __esm({
5101
5058
  "components/core/atoms/StatusDot.tsx"() {
5102
5059
  init_cn();
@@ -5116,12 +5073,12 @@ var init_StatusDot = __esm({
5116
5073
  warning: "ring-warning",
5117
5074
  critical: "ring-error"
5118
5075
  };
5119
- sizeStyles6 = {
5076
+ sizeStyles5 = {
5120
5077
  sm: "w-2 h-2",
5121
5078
  md: "w-2.5 h-2.5",
5122
5079
  lg: "w-3 h-3"
5123
5080
  };
5124
- StatusDot = React88__default.forwardRef(
5081
+ StatusDot = React84__default.forwardRef(
5125
5082
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
5126
5083
  return /* @__PURE__ */ jsx(
5127
5084
  "span",
@@ -5130,7 +5087,7 @@ var init_StatusDot = __esm({
5130
5087
  className: cn(
5131
5088
  "inline-block rounded-full flex-shrink-0",
5132
5089
  statusColors[status],
5133
- sizeStyles6[size],
5090
+ sizeStyles5[size],
5134
5091
  pulse && [
5135
5092
  "animate-pulse",
5136
5093
  "ring-2 ring-offset-1",
@@ -5160,12 +5117,12 @@ function resolveColor(dir, invert) {
5160
5117
  const isGood = invert ? !isPositive : isPositive;
5161
5118
  return isGood ? "text-success" : "text-error";
5162
5119
  }
5163
- var sizeStyles7, iconNameMap, TrendIndicator;
5120
+ var sizeStyles6, iconNameMap, TrendIndicator;
5164
5121
  var init_TrendIndicator = __esm({
5165
5122
  "components/core/atoms/TrendIndicator.tsx"() {
5166
5123
  init_Icon();
5167
5124
  init_cn();
5168
- sizeStyles7 = {
5125
+ sizeStyles6 = {
5169
5126
  sm: { icon: "w-3 h-3", text: "text-xs" },
5170
5127
  md: { icon: "w-4 h-4", text: "text-sm" },
5171
5128
  lg: { icon: "w-5 h-5", text: "text-base" }
@@ -5175,7 +5132,7 @@ var init_TrendIndicator = __esm({
5175
5132
  down: "trending-down",
5176
5133
  flat: "arrow-right"
5177
5134
  };
5178
- TrendIndicator = React88__default.forwardRef(
5135
+ TrendIndicator = React84__default.forwardRef(
5179
5136
  ({
5180
5137
  className,
5181
5138
  value,
@@ -5189,7 +5146,7 @@ var init_TrendIndicator = __esm({
5189
5146
  const dir = resolveDirection(value, direction);
5190
5147
  const colorClass = resolveColor(dir, invert);
5191
5148
  const iconName = iconNameMap[dir];
5192
- const styles = sizeStyles7[size];
5149
+ const styles = sizeStyles6[size];
5193
5150
  const formattedValue = value !== void 0 ? `${value > 0 ? "+" : ""}${value}%` : void 0;
5194
5151
  const ariaLabel = label ?? (formattedValue ? `${dir} ${formattedValue}` : dir);
5195
5152
  return /* @__PURE__ */ jsxs(
@@ -5242,7 +5199,7 @@ var init_RangeSlider = __esm({
5242
5199
  md: "w-4 h-4",
5243
5200
  lg: "w-5 h-5"
5244
5201
  };
5245
- RangeSlider = React88__default.forwardRef(
5202
+ RangeSlider = React84__default.forwardRef(
5246
5203
  ({
5247
5204
  className,
5248
5205
  min = 0,
@@ -5750,7 +5707,7 @@ var init_ContentSection = __esm({
5750
5707
  md: "py-16",
5751
5708
  lg: "py-24"
5752
5709
  };
5753
- ContentSection = React88__default.forwardRef(
5710
+ ContentSection = React84__default.forwardRef(
5754
5711
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
5755
5712
  return /* @__PURE__ */ jsx(
5756
5713
  Box,
@@ -6284,7 +6241,7 @@ var init_AnimatedReveal = __esm({
6284
6241
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
6285
6242
  "none": {}
6286
6243
  };
6287
- AnimatedReveal = React88__default.forwardRef(
6244
+ AnimatedReveal = React84__default.forwardRef(
6288
6245
  ({
6289
6246
  trigger = "scroll",
6290
6247
  animation = "fade-up",
@@ -6444,7 +6401,7 @@ var init_AnimatedGraphic = __esm({
6444
6401
  "components/marketing/atoms/AnimatedGraphic.tsx"() {
6445
6402
  "use client";
6446
6403
  init_cn();
6447
- AnimatedGraphic = React88__default.forwardRef(
6404
+ AnimatedGraphic = React84__default.forwardRef(
6448
6405
  ({
6449
6406
  src,
6450
6407
  svgContent,
@@ -6467,7 +6424,7 @@ var init_AnimatedGraphic = __esm({
6467
6424
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
6468
6425
  const resolvedSvg = svgContent ?? fetchedSvg;
6469
6426
  const prevAnimateRef = useRef(animate);
6470
- const setRef = React88__default.useCallback(
6427
+ const setRef = React84__default.useCallback(
6471
6428
  (node) => {
6472
6429
  containerRef.current = node;
6473
6430
  if (typeof ref === "function") ref(node);
@@ -6692,9 +6649,9 @@ function ScoreDisplay({
6692
6649
  ...rest
6693
6650
  }) {
6694
6651
  const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
6695
- const [displayValue, setDisplayValue] = React88.useState(resolvedValue);
6696
- const [isAnimating, setIsAnimating] = React88.useState(false);
6697
- React88.useEffect(() => {
6652
+ const [displayValue, setDisplayValue] = React84.useState(resolvedValue);
6653
+ const [isAnimating, setIsAnimating] = React84.useState(false);
6654
+ React84.useEffect(() => {
6698
6655
  if (!animated || displayValue === resolvedValue) {
6699
6656
  setDisplayValue(resolvedValue);
6700
6657
  return;
@@ -6764,9 +6721,9 @@ function ControlButton({
6764
6721
  className
6765
6722
  }) {
6766
6723
  const eventBus = useEventBus();
6767
- const [isPressed, setIsPressed] = React88.useState(false);
6724
+ const [isPressed, setIsPressed] = React84.useState(false);
6768
6725
  const actualPressed = pressed ?? isPressed;
6769
- const handlePointerDown = React88.useCallback(
6726
+ const handlePointerDown = React84.useCallback(
6770
6727
  (e) => {
6771
6728
  e.preventDefault();
6772
6729
  if (disabled) return;
@@ -6776,7 +6733,7 @@ function ControlButton({
6776
6733
  },
6777
6734
  [disabled, pressEvent, eventBus, onPress]
6778
6735
  );
6779
- const handlePointerUp = React88.useCallback(
6736
+ const handlePointerUp = React84.useCallback(
6780
6737
  (e) => {
6781
6738
  e.preventDefault();
6782
6739
  if (disabled) return;
@@ -6786,7 +6743,7 @@ function ControlButton({
6786
6743
  },
6787
6744
  [disabled, releaseEvent, eventBus, onRelease]
6788
6745
  );
6789
- const handlePointerLeave = React88.useCallback(
6746
+ const handlePointerLeave = React84.useCallback(
6790
6747
  (e) => {
6791
6748
  if (isPressed) {
6792
6749
  setIsPressed(false);
@@ -6854,7 +6811,7 @@ var init_ControlButton = __esm({
6854
6811
  }
6855
6812
  });
6856
6813
  function Sprite({
6857
- spritesheet,
6814
+ spritesheet = "https://almadar-kflow-assets.web.app/shared/isometric-blocks/Spritesheet/allTiles_sheet.png",
6858
6815
  frameWidth,
6859
6816
  frameHeight,
6860
6817
  frame,
@@ -7057,7 +7014,7 @@ function ResourceCounter({
7057
7014
  children: [
7058
7015
  icon && /* @__PURE__ */ jsx("span", { className: cn("flex-shrink-0", sizes.icon), children: icon }),
7059
7016
  /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: label }),
7060
- /* @__PURE__ */ jsxs("span", { className: cn("font-bold tabular-nums", color), children: [
7017
+ /* @__PURE__ */ jsxs("span", { className: cn("font-bold tabular-nums", color && (color in colorTokenClasses2 ? colorTokenClasses2[color] : color)), children: [
7061
7018
  value,
7062
7019
  max != null && /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
7063
7020
  "/",
@@ -7068,10 +7025,18 @@ function ResourceCounter({
7068
7025
  }
7069
7026
  );
7070
7027
  }
7071
- var sizeMap5;
7028
+ var colorTokenClasses2, sizeMap5;
7072
7029
  var init_ResourceCounter = __esm({
7073
7030
  "components/game/atoms/ResourceCounter.tsx"() {
7074
7031
  init_cn();
7032
+ colorTokenClasses2 = {
7033
+ primary: "text-primary",
7034
+ secondary: "text-secondary",
7035
+ success: "text-success",
7036
+ warning: "text-warning",
7037
+ error: "text-error",
7038
+ muted: "text-muted-foreground"
7039
+ };
7075
7040
  sizeMap5 = {
7076
7041
  sm: { wrapper: "text-xs gap-1 px-1.5 py-0.5", icon: "text-sm" },
7077
7042
  md: { wrapper: "text-sm gap-1.5 px-2 py-1", icon: "text-base" },
@@ -7275,14 +7240,20 @@ function XPBar({
7275
7240
  }) {
7276
7241
  const sizes = sizeMap9[size];
7277
7242
  const percentage = max > 0 ? Math.max(0, Math.min(100, current / max * 100)) : 0;
7278
- const [fillWidth, setFillWidth] = React88.useState(animated ? 0 : percentage);
7279
- React88.useEffect(() => {
7243
+ const [fillWidth, setFillWidth] = React84.useState(animated ? 0 : percentage);
7244
+ React84.useEffect(() => {
7280
7245
  if (!animated) {
7281
7246
  setFillWidth(percentage);
7282
7247
  return;
7283
7248
  }
7284
- const frame = requestAnimationFrame(() => setFillWidth(percentage));
7285
- return () => cancelAnimationFrame(frame);
7249
+ let frame2;
7250
+ const frame1 = requestAnimationFrame(() => {
7251
+ frame2 = requestAnimationFrame(() => setFillWidth(percentage));
7252
+ });
7253
+ return () => {
7254
+ cancelAnimationFrame(frame1);
7255
+ cancelAnimationFrame(frame2);
7256
+ };
7286
7257
  }, [animated, percentage]);
7287
7258
  return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2", className), children: [
7288
7259
  level != null && /* @__PURE__ */ jsxs(
@@ -7320,7 +7291,7 @@ function XPBar({
7320
7291
  )
7321
7292
  }
7322
7293
  ),
7323
- showLabel && /* @__PURE__ */ jsxs("span", { className: cn("text-muted-foreground tabular-nums", sizes.text), children: [
7294
+ showLabel && /* @__PURE__ */ jsxs("span", { className: cn("text-foreground/70 tabular-nums", sizes.text), children: [
7324
7295
  current,
7325
7296
  " / ",
7326
7297
  max,
@@ -7438,7 +7409,7 @@ function StatusEffect({
7438
7409
  ),
7439
7410
  title: label,
7440
7411
  children: [
7441
- /* @__PURE__ */ jsx("span", { className: cn("flex items-center justify-center", sizes.icon), children: icon }),
7412
+ /* @__PURE__ */ jsx("span", { className: cn("flex items-center justify-center", sizes.icon), children: /* @__PURE__ */ jsx(Icon, { name: icon, size: "sm" }) }),
7442
7413
  duration !== void 0 && /* @__PURE__ */ jsx(
7443
7414
  "span",
7444
7415
  {
@@ -7469,6 +7440,7 @@ var sizeMap11, variantStyles7;
7469
7440
  var init_StatusEffect = __esm({
7470
7441
  "components/game/atoms/StatusEffect.tsx"() {
7471
7442
  init_cn();
7443
+ init_Icon();
7472
7444
  sizeMap11 = {
7473
7445
  sm: { container: "w-8 h-8", icon: "text-sm", badge: "text-xs -top-1 -right-1 w-4 h-4", timer: "text-[9px]" },
7474
7446
  md: { container: "w-10 h-10", icon: "text-base", badge: "text-xs -top-1 -right-1 w-5 h-5", timer: "text-xs" },
@@ -7534,7 +7506,7 @@ var init_DamageNumber = __esm({
7534
7506
  function DialogueBubble({
7535
7507
  speaker,
7536
7508
  text,
7537
- portrait,
7509
+ portrait = "https://almadar-kflow-assets.web.app/shared/characters/archetypes/00_base_model.png",
7538
7510
  position = "bottom",
7539
7511
  className
7540
7512
  }) {
@@ -7702,9 +7674,9 @@ function MiniMap({
7702
7674
  viewportRect,
7703
7675
  className
7704
7676
  }) {
7705
- const canvasRef = React88.useRef(null);
7706
- const frameRef = React88.useRef(0);
7707
- React88.useEffect(() => {
7677
+ const canvasRef = React84.useRef(null);
7678
+ const frameRef = React84.useRef(0);
7679
+ React84.useEffect(() => {
7708
7680
  const canvas = canvasRef.current;
7709
7681
  if (!canvas) return;
7710
7682
  const ctx = canvas.getContext("2d");
@@ -7878,7 +7850,7 @@ var init_ErrorBoundary = __esm({
7878
7850
  }
7879
7851
  );
7880
7852
  };
7881
- ErrorBoundary = class extends React88__default.Component {
7853
+ ErrorBoundary = class extends React84__default.Component {
7882
7854
  constructor(props) {
7883
7855
  super(props);
7884
7856
  __publicField(this, "reset", () => {
@@ -8153,11 +8125,11 @@ var init_wrapCallbackForEvent = __esm({
8153
8125
  "runtime/wrapCallbackForEvent.ts"() {
8154
8126
  }
8155
8127
  });
8156
- var sizeStyles8, paddingStyles3, Container;
8128
+ var sizeStyles7, paddingStyles3, Container;
8157
8129
  var init_Container = __esm({
8158
8130
  "components/core/molecules/Container.tsx"() {
8159
8131
  init_cn();
8160
- sizeStyles8 = {
8132
+ sizeStyles7 = {
8161
8133
  xs: "max-w-xs",
8162
8134
  // 320px
8163
8135
  sm: "max-w-screen-sm",
@@ -8195,7 +8167,7 @@ var init_Container = __esm({
8195
8167
  {
8196
8168
  className: cn(
8197
8169
  "w-full",
8198
- sizeStyles8[resolvedSize],
8170
+ sizeStyles7[resolvedSize],
8199
8171
  paddingStyles3[padding],
8200
8172
  center && "mx-auto",
8201
8173
  className
@@ -8957,7 +8929,7 @@ var init_Tooltip = __esm({
8957
8929
  setIsVisible(false);
8958
8930
  }, hideDelay);
8959
8931
  };
8960
- useEffect(() => {
8932
+ useLayoutEffect(() => {
8961
8933
  if (isVisible) {
8962
8934
  updatePosition();
8963
8935
  }
@@ -8968,8 +8940,8 @@ var init_Tooltip = __esm({
8968
8940
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
8969
8941
  };
8970
8942
  }, []);
8971
- const triggerElement = React88__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
8972
- const trigger = React88__default.cloneElement(triggerElement, {
8943
+ const triggerElement = React84__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
8944
+ const trigger = React84__default.cloneElement(triggerElement, {
8973
8945
  ref: triggerRef,
8974
8946
  onMouseEnter: handleMouseEnter,
8975
8947
  onMouseLeave: handleMouseLeave,
@@ -9116,8 +9088,8 @@ var init_Popover = __esm({
9116
9088
  onMouseEnter: handleOpen,
9117
9089
  onMouseLeave: handleClose
9118
9090
  };
9119
- const childElement = React88__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
9120
- const triggerElement = React88__default.cloneElement(
9091
+ const childElement = React84__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
9092
+ const triggerElement = React84__default.cloneElement(
9121
9093
  childElement,
9122
9094
  {
9123
9095
  ref: triggerRef,
@@ -9133,7 +9105,10 @@ var init_Popover = __esm({
9133
9105
  "bg-card border-2 border-border shadow-elevation-popover",
9134
9106
  className
9135
9107
  ),
9136
- style: computePopoverStyle(position, triggerRect, popoverWidth),
9108
+ style: {
9109
+ ...computePopoverStyle(position, triggerRect, popoverWidth),
9110
+ ...popoverWidth === 0 ? { visibility: "hidden" } : void 0
9111
+ },
9137
9112
  role: "dialog",
9138
9113
  onMouseEnter: trigger === "hover" ? handleOpen : void 0,
9139
9114
  onMouseLeave: trigger === "hover" ? handleClose : void 0,
@@ -9243,8 +9218,8 @@ var init_Menu = __esm({
9243
9218
  };
9244
9219
  const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
9245
9220
  const subMenuSideClass = direction === "rtl" ? "right-full mr-2" : "left-full ml-2";
9246
- const triggerChild = React88__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
9247
- const triggerElement = React88__default.cloneElement(
9221
+ const triggerChild = React84__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
9222
+ const triggerElement = React84__default.cloneElement(
9248
9223
  triggerChild,
9249
9224
  {
9250
9225
  ref: triggerRef,
@@ -9651,12 +9626,12 @@ var init_MapView = __esm({
9651
9626
  shadowSize: [41, 41]
9652
9627
  });
9653
9628
  L.Marker.prototype.options.icon = defaultIcon;
9654
- const { useEffect: useEffect72, useRef: useRef67, useCallback: useCallback116, useState: useState105 } = React88__default;
9629
+ const { useEffect: useEffect72, useRef: useRef66, useCallback: useCallback112, useState: useState102 } = React84__default;
9655
9630
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
9656
9631
  const { useEventBus: useEventBus3 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
9657
9632
  function MapUpdater({ centerLat, centerLng, zoom }) {
9658
9633
  const map = useMap();
9659
- const prevRef = useRef67({ centerLat, centerLng, zoom });
9634
+ const prevRef = useRef66({ centerLat, centerLng, zoom });
9660
9635
  useEffect72(() => {
9661
9636
  const prev = prevRef.current;
9662
9637
  if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
@@ -9696,8 +9671,8 @@ var init_MapView = __esm({
9696
9671
  showAttribution = true
9697
9672
  }) {
9698
9673
  const eventBus = useEventBus3();
9699
- const [clickedPosition, setClickedPosition] = useState105(null);
9700
- const handleMapClick = useCallback116((lat, lng) => {
9674
+ const [clickedPosition, setClickedPosition] = useState102(null);
9675
+ const handleMapClick = useCallback112((lat, lng) => {
9701
9676
  if (showClickedPin) {
9702
9677
  setClickedPosition({ lat, lng });
9703
9678
  }
@@ -9706,7 +9681,7 @@ var init_MapView = __esm({
9706
9681
  eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
9707
9682
  }
9708
9683
  }, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
9709
- const handleMarkerClick = useCallback116((marker) => {
9684
+ const handleMarkerClick = useCallback112((marker) => {
9710
9685
  onMarkerClick?.(marker);
9711
9686
  if (markerClickEvent) {
9712
9687
  eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
@@ -9715,7 +9690,7 @@ var init_MapView = __esm({
9715
9690
  return /* @__PURE__ */ jsx(
9716
9691
  Box,
9717
9692
  {
9718
- className: cn("relative isolate w-full overflow-hidden rounded-lg", className),
9693
+ className: cn("relative isolate z-0 w-full overflow-hidden rounded-lg", className),
9719
9694
  style: { height },
9720
9695
  "data-testid": "map-view",
9721
9696
  children: /* @__PURE__ */ jsxs(
@@ -9897,7 +9872,7 @@ function InputPattern({
9897
9872
  fieldName
9898
9873
  }) {
9899
9874
  const { emit } = useEventBus();
9900
- const [localValue, setLocalValue] = React88__default.useState(value);
9875
+ const [localValue, setLocalValue] = React84__default.useState(value);
9901
9876
  const handleChange = (e) => {
9902
9877
  setLocalValue(e.target.value);
9903
9878
  if (onChange) {
@@ -9935,7 +9910,7 @@ function TextareaPattern({
9935
9910
  fieldName
9936
9911
  }) {
9937
9912
  const { emit } = useEventBus();
9938
- const [localValue, setLocalValue] = React88__default.useState(value);
9913
+ const [localValue, setLocalValue] = React84__default.useState(value);
9939
9914
  const handleChange = (e) => {
9940
9915
  setLocalValue(e.target.value);
9941
9916
  if (onChange) {
@@ -9967,7 +9942,7 @@ function SelectPattern({
9967
9942
  fieldName
9968
9943
  }) {
9969
9944
  const { emit } = useEventBus();
9970
- const [localValue, setLocalValue] = React88__default.useState(value);
9945
+ const [localValue, setLocalValue] = React84__default.useState(value);
9971
9946
  const handleChange = (e) => {
9972
9947
  setLocalValue(e.target.value);
9973
9948
  if (onChange) {
@@ -9996,7 +9971,7 @@ function CheckboxPattern({
9996
9971
  className
9997
9972
  }) {
9998
9973
  const { emit } = useEventBus();
9999
- const [localChecked, setLocalChecked] = React88__default.useState(checked);
9974
+ const [localChecked, setLocalChecked] = React84__default.useState(checked);
10000
9975
  const handleChange = (e) => {
10001
9976
  setLocalChecked(e.target.checked);
10002
9977
  if (onChange) {
@@ -10184,6 +10159,7 @@ var init_ComponentPatterns = __esm({
10184
10159
  init_ProgressBar();
10185
10160
  init_Card();
10186
10161
  init_Typography();
10162
+ init_cn();
10187
10163
  init_Alert();
10188
10164
  init_Tooltip();
10189
10165
  init_Popover();
@@ -10227,8 +10203,8 @@ function ActionButtons({
10227
10203
  disabled
10228
10204
  }) {
10229
10205
  const eventBus = useEventBus();
10230
- const [activeButtons, setActiveButtons] = React88.useState(/* @__PURE__ */ new Set());
10231
- const handlePress = React88.useCallback(
10206
+ const [activeButtons, setActiveButtons] = React84.useState(/* @__PURE__ */ new Set());
10207
+ const handlePress = React84.useCallback(
10232
10208
  (id) => {
10233
10209
  setActiveButtons((prev) => new Set(prev).add(id));
10234
10210
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -10236,7 +10212,7 @@ function ActionButtons({
10236
10212
  },
10237
10213
  [actionEvent, eventBus, onAction]
10238
10214
  );
10239
- const handleRelease = React88.useCallback(
10215
+ const handleRelease = React84.useCallback(
10240
10216
  (id) => {
10241
10217
  setActiveButtons((prev) => {
10242
10218
  const next = new Set(prev);
@@ -10517,259 +10493,6 @@ var init_AnimatedCounter = __esm({
10517
10493
  AnimatedCounter.displayName = "AnimatedCounter";
10518
10494
  }
10519
10495
  });
10520
- var ALL_CATEGORY, GridPicker;
10521
- var init_GridPicker = __esm({
10522
- "components/core/molecules/GridPicker.tsx"() {
10523
- "use client";
10524
- init_cn();
10525
- init_Input();
10526
- init_Badge();
10527
- init_Stack();
10528
- ALL_CATEGORY = "__all__";
10529
- GridPicker = ({
10530
- items,
10531
- value,
10532
- onChange,
10533
- categories,
10534
- searchPlaceholder,
10535
- renderThumbnail,
10536
- cellSize = 32,
10537
- className
10538
- }) => {
10539
- const [search, setSearch] = useState("");
10540
- const [activeCategory, setActiveCategory] = useState(ALL_CATEGORY);
10541
- const gridRef = useRef(null);
10542
- const categoryChips = useMemo(() => {
10543
- if (categories !== void 0) return categories;
10544
- const seen = [];
10545
- for (const item of items) {
10546
- if (!seen.includes(item.category)) seen.push(item.category);
10547
- }
10548
- return seen;
10549
- }, [categories, items]);
10550
- const filtered = useMemo(() => {
10551
- const needle = search.trim().toLowerCase();
10552
- return items.filter((item) => {
10553
- const matchesCategory = activeCategory === ALL_CATEGORY || item.category === activeCategory;
10554
- const matchesSearch = needle === "" || item.label.toLowerCase().includes(needle);
10555
- return matchesCategory && matchesSearch;
10556
- });
10557
- }, [items, search, activeCategory]);
10558
- const select = useCallback(
10559
- (item) => {
10560
- onChange(item.id);
10561
- },
10562
- [onChange]
10563
- );
10564
- const handleKeyDown = useCallback(
10565
- (e, index) => {
10566
- const cells = gridRef.current?.querySelectorAll(
10567
- "[data-gridpicker-cell]"
10568
- );
10569
- if (cells === void 0 || cells.length === 0) return;
10570
- const columns = (() => {
10571
- const grid = gridRef.current;
10572
- if (grid === null) return 1;
10573
- const style = window.getComputedStyle(grid);
10574
- const cols = style.gridTemplateColumns.split(" ").filter(Boolean).length;
10575
- return cols > 0 ? cols : 1;
10576
- })();
10577
- let next = -1;
10578
- if (e.key === "ArrowRight") next = index + 1;
10579
- else if (e.key === "ArrowLeft") next = index - 1;
10580
- else if (e.key === "ArrowDown") next = index + columns;
10581
- else if (e.key === "ArrowUp") next = index - columns;
10582
- else if (e.key === "Enter" || e.key === " ") {
10583
- e.preventDefault();
10584
- select(filtered[index]);
10585
- return;
10586
- } else {
10587
- return;
10588
- }
10589
- e.preventDefault();
10590
- if (next >= 0 && next < cells.length) {
10591
- cells[next].focus();
10592
- }
10593
- },
10594
- [filtered, select]
10595
- );
10596
- return /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: cn("w-full", className), children: [
10597
- /* @__PURE__ */ jsx(
10598
- Input,
10599
- {
10600
- type: "search",
10601
- icon: "search",
10602
- value: search,
10603
- placeholder: searchPlaceholder,
10604
- clearable: true,
10605
- onClear: () => setSearch(""),
10606
- onChange: (e) => setSearch(e.target.value)
10607
- }
10608
- ),
10609
- categoryChips.length > 0 && /* @__PURE__ */ jsxs(HStack, { gap: "xs", wrap: true, children: [
10610
- /* @__PURE__ */ jsx(
10611
- Badge,
10612
- {
10613
- variant: activeCategory === ALL_CATEGORY ? "primary" : "neutral",
10614
- size: "sm",
10615
- role: "button",
10616
- tabIndex: 0,
10617
- "aria-pressed": activeCategory === ALL_CATEGORY,
10618
- className: "cursor-pointer",
10619
- onClick: () => setActiveCategory(ALL_CATEGORY),
10620
- onKeyDown: (e) => {
10621
- if (e.key === "Enter" || e.key === " ") {
10622
- e.preventDefault();
10623
- setActiveCategory(ALL_CATEGORY);
10624
- }
10625
- },
10626
- children: "All"
10627
- }
10628
- ),
10629
- categoryChips.map((category) => /* @__PURE__ */ jsx(
10630
- Badge,
10631
- {
10632
- variant: activeCategory === category ? "primary" : "neutral",
10633
- size: "sm",
10634
- role: "button",
10635
- tabIndex: 0,
10636
- "aria-pressed": activeCategory === category,
10637
- className: "cursor-pointer",
10638
- onClick: () => setActiveCategory(category),
10639
- onKeyDown: (e) => {
10640
- if (e.key === "Enter" || e.key === " ") {
10641
- e.preventDefault();
10642
- setActiveCategory(category);
10643
- }
10644
- },
10645
- children: category
10646
- },
10647
- category
10648
- ))
10649
- ] }),
10650
- /* @__PURE__ */ jsx(
10651
- "div",
10652
- {
10653
- ref: gridRef,
10654
- role: "listbox",
10655
- className: "grid gap-1 overflow-y-auto max-h-64 p-1",
10656
- style: {
10657
- gridTemplateColumns: `repeat(auto-fill, minmax(${cellSize}px, 1fr))`
10658
- },
10659
- children: filtered.map((item, index) => {
10660
- const selected = item.id === value;
10661
- return /* @__PURE__ */ jsx(
10662
- "button",
10663
- {
10664
- type: "button",
10665
- role: "option",
10666
- "aria-selected": selected,
10667
- "aria-label": item.label,
10668
- title: item.label,
10669
- "data-gridpicker-cell": true,
10670
- tabIndex: selected || value === void 0 && index === 0 ? 0 : -1,
10671
- onClick: () => select(item),
10672
- onKeyDown: (e) => handleKeyDown(e, index),
10673
- className: cn(
10674
- "flex items-center justify-center rounded-sm",
10675
- "transition-colors hover:bg-muted",
10676
- "focus:outline-none focus:ring-1 focus:ring-ring",
10677
- selected && "bg-primary/10 ring-1 ring-primary"
10678
- ),
10679
- style: { width: cellSize, height: cellSize },
10680
- children: renderThumbnail(item)
10681
- },
10682
- item.id
10683
- );
10684
- })
10685
- }
10686
- )
10687
- ] });
10688
- };
10689
- GridPicker.displayName = "GridPicker";
10690
- }
10691
- });
10692
- function iconForKind(kind) {
10693
- if (kind === "audio") return "music";
10694
- if (kind === "model") return "box";
10695
- return "file";
10696
- }
10697
- var THUMB_PX, IMAGE_KINDS, AssetPicker;
10698
- var init_AssetPicker = __esm({
10699
- "components/core/molecules/AssetPicker.tsx"() {
10700
- "use client";
10701
- init_GridPicker();
10702
- init_Icon();
10703
- THUMB_PX = 32;
10704
- IMAGE_KINDS = /* @__PURE__ */ new Set([
10705
- "image",
10706
- "spritesheet",
10707
- "scene",
10708
- "portrait"
10709
- ]);
10710
- AssetPicker = ({
10711
- assets,
10712
- value,
10713
- onChange,
10714
- className
10715
- }) => {
10716
- const byUrl = useMemo(() => {
10717
- const map = /* @__PURE__ */ new Map();
10718
- for (const entry of assets) map.set(entry.url, entry);
10719
- return map;
10720
- }, [assets]);
10721
- const items = useMemo(
10722
- () => assets.map((entry) => ({
10723
- id: entry.url,
10724
- label: entry.name,
10725
- category: entry.category
10726
- })),
10727
- [assets]
10728
- );
10729
- const categories = useMemo(() => {
10730
- const seen = [];
10731
- for (const entry of assets) {
10732
- if (!seen.includes(entry.category)) seen.push(entry.category);
10733
- }
10734
- return seen;
10735
- }, [assets]);
10736
- const renderThumbnail = useCallback(
10737
- (item) => {
10738
- const entry = byUrl.get(item.id);
10739
- if (entry === void 0) return null;
10740
- if (IMAGE_KINDS.has(entry.kind)) {
10741
- return /* @__PURE__ */ jsx(
10742
- "img",
10743
- {
10744
- src: entry.thumbnailUrl ?? entry.url,
10745
- alt: entry.name,
10746
- loading: "lazy",
10747
- width: THUMB_PX,
10748
- height: THUMB_PX,
10749
- style: { width: THUMB_PX, height: THUMB_PX, objectFit: "cover" }
10750
- }
10751
- );
10752
- }
10753
- return /* @__PURE__ */ jsx(Icon, { name: iconForKind(entry.kind), size: "sm" });
10754
- },
10755
- [byUrl]
10756
- );
10757
- return /* @__PURE__ */ jsx(
10758
- GridPicker,
10759
- {
10760
- items,
10761
- value,
10762
- onChange,
10763
- categories,
10764
- renderThumbnail,
10765
- cellSize: THUMB_PX,
10766
- className
10767
- }
10768
- );
10769
- };
10770
- AssetPicker.displayName = "AssetPicker";
10771
- }
10772
- });
10773
10496
  var AuthLayout;
10774
10497
  var init_AuthLayout = __esm({
10775
10498
  "components/marketing/templates/AuthLayout.tsx"() {
@@ -13482,6 +13205,263 @@ var init_katex_min = __esm({
13482
13205
  "node_modules/katex/dist/katex.min.css"() {
13483
13206
  }
13484
13207
  });
13208
+ var Tabs;
13209
+ var init_Tabs = __esm({
13210
+ "components/core/molecules/Tabs.tsx"() {
13211
+ "use client";
13212
+ init_Icon();
13213
+ init_Badge();
13214
+ init_Typography();
13215
+ init_Box();
13216
+ init_cn();
13217
+ init_useEventBus();
13218
+ Tabs = ({
13219
+ items,
13220
+ tabs,
13221
+ defaultActiveTab,
13222
+ activeTab: controlledActiveTab,
13223
+ onTabChange,
13224
+ tabChangeEvent,
13225
+ variant = "default",
13226
+ orientation = "horizontal",
13227
+ className
13228
+ }) => {
13229
+ const rawItems = items ?? tabs ?? [];
13230
+ const safeItems = rawItems.map(({ id, value, ...rest }) => ({
13231
+ ...rest,
13232
+ id: id || value || ""
13233
+ }));
13234
+ const eventBus = useEventBus();
13235
+ const { t } = useTranslate();
13236
+ const initialActive = safeItems.find((item) => item.active)?.id;
13237
+ const [internalActiveTab, setInternalActiveTab] = useState(
13238
+ defaultActiveTab || initialActive || safeItems[0]?.id || ""
13239
+ );
13240
+ const activeTab = controlledActiveTab !== void 0 ? controlledActiveTab : internalActiveTab;
13241
+ const tabRefs = useRef({});
13242
+ const handleTabChange = (tabId, tabEvent) => {
13243
+ if (controlledActiveTab === void 0) {
13244
+ setInternalActiveTab(tabId);
13245
+ }
13246
+ onTabChange?.(tabId);
13247
+ if (tabChangeEvent) {
13248
+ eventBus.emit(`UI:${tabChangeEvent}`, { tabId });
13249
+ }
13250
+ if (tabEvent) {
13251
+ eventBus.emit(`UI:${tabEvent}`, { tabId });
13252
+ }
13253
+ };
13254
+ const handleKeyDown = (e, index) => {
13255
+ if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
13256
+ e.preventDefault();
13257
+ const direction = e.key === "ArrowLeft" ? -1 : 1;
13258
+ const nextIndex = (index + direction + safeItems.length) % safeItems.length;
13259
+ const nextTab = safeItems[nextIndex];
13260
+ if (nextTab && !nextTab.disabled) {
13261
+ handleTabChange(nextTab.id);
13262
+ tabRefs.current[nextTab.id]?.focus();
13263
+ }
13264
+ } else if (e.key === "Home" || e.key === "End") {
13265
+ e.preventDefault();
13266
+ const targetIndex = e.key === "Home" ? 0 : safeItems.length - 1;
13267
+ const targetTab = safeItems[targetIndex];
13268
+ if (targetTab && !targetTab.disabled) {
13269
+ handleTabChange(targetTab.id);
13270
+ tabRefs.current[targetTab.id]?.focus();
13271
+ }
13272
+ }
13273
+ };
13274
+ const activeTabContent = safeItems.find((item) => item.id === activeTab)?.content;
13275
+ if (safeItems.length === 0) {
13276
+ return /* @__PURE__ */ jsx(Box, { className: cn("w-full", className), children: /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "py-4", children: t("empty.noItems") }) });
13277
+ }
13278
+ const variantClasses2 = {
13279
+ default: [
13280
+ "border-b-[length:var(--border-width)] border-transparent",
13281
+ "hover:border-muted-foreground",
13282
+ "data-[active=true]:border-primary"
13283
+ ].join(" "),
13284
+ pills: [
13285
+ "rounded-sm",
13286
+ "data-[active=true]:bg-primary",
13287
+ "data-[active=true]:text-primary-foreground"
13288
+ ].join(" "),
13289
+ underline: [
13290
+ "border-b-[length:var(--border-width)] border-transparent",
13291
+ "data-[active=true]:border-primary"
13292
+ ].join(" ")
13293
+ };
13294
+ return /* @__PURE__ */ jsxs(Box, { className: cn("w-full", className), children: [
13295
+ /* @__PURE__ */ jsx(
13296
+ Box,
13297
+ {
13298
+ role: "tablist",
13299
+ className: cn(
13300
+ "flex",
13301
+ // Horizontal tab strip becomes a horizontally-scrollable lane
13302
+ // below its container width — phones with many tabs scroll
13303
+ // instead of clipping. `snap-x` snaps to each tab; the
13304
+ // scrollbar is hidden for a cleaner affordance (the swipe
13305
+ // gesture is the discoverability cue).
13306
+ 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",
13307
+ variant === "pills" && "gap-1 p-1 bg-muted border-0 rounded-md",
13308
+ variant === "underline" && orientation === "vertical" && "border-b-0"
13309
+ ),
13310
+ children: safeItems.map((item, index) => {
13311
+ const isActive = item.id === activeTab;
13312
+ const isDisabled = item.disabled;
13313
+ return /* @__PURE__ */ jsxs(
13314
+ Box,
13315
+ {
13316
+ as: "button",
13317
+ ref: (el) => {
13318
+ tabRefs.current[item.id] = el;
13319
+ },
13320
+ role: "tab",
13321
+ "aria-selected": isActive,
13322
+ "aria-controls": `tabpanel-${item.id}`,
13323
+ "aria-disabled": isDisabled,
13324
+ onClick: () => !isDisabled && handleTabChange(item.id, item.event),
13325
+ onKeyDown: (e) => handleKeyDown(e, index),
13326
+ "data-active": isActive,
13327
+ className: cn(
13328
+ "flex items-center gap-2 px-4 py-2 text-sm font-medium transition-all whitespace-nowrap",
13329
+ orientation === "horizontal" && "snap-start shrink-0",
13330
+ "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
13331
+ isDisabled && "opacity-50 cursor-not-allowed",
13332
+ variantClasses2[variant],
13333
+ isActive ? variant === "pills" ? "text-primary-foreground font-bold" : "text-foreground font-bold" : "text-muted-foreground hover:text-foreground"
13334
+ ),
13335
+ children: [
13336
+ item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: item.icon, size: "sm" }) : /* @__PURE__ */ jsx(Icon, { icon: item.icon, size: "sm" })),
13337
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: isActive ? "semibold" : "normal", className: "!text-inherit", children: item.label }),
13338
+ item.badge !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: item.badge })
13339
+ ]
13340
+ },
13341
+ item.id
13342
+ );
13343
+ })
13344
+ }
13345
+ ),
13346
+ activeTabContent !== void 0 && activeTabContent !== null && /* @__PURE__ */ jsx(
13347
+ Box,
13348
+ {
13349
+ role: "tabpanel",
13350
+ id: `tabpanel-${activeTab}`,
13351
+ "aria-labelledby": `tab-${activeTab}`,
13352
+ className: "mt-4",
13353
+ children: activeTabContent
13354
+ }
13355
+ )
13356
+ ] });
13357
+ };
13358
+ Tabs.displayName = "Tabs";
13359
+ }
13360
+ });
13361
+ var ICON_NAME_ALIASES, lookStyles3, EmptyState;
13362
+ var init_EmptyState = __esm({
13363
+ "components/core/molecules/EmptyState.tsx"() {
13364
+ "use client";
13365
+ init_cn();
13366
+ init_atoms2();
13367
+ init_Box();
13368
+ init_Icon();
13369
+ init_Stack();
13370
+ init_Typography();
13371
+ init_useEventBus();
13372
+ ICON_NAME_ALIASES = {
13373
+ check: "check-circle",
13374
+ error: "x-circle",
13375
+ warning: "alert-circle"
13376
+ };
13377
+ lookStyles3 = {
13378
+ "icon-only": "",
13379
+ illustrated: "[&_svg]:w-32 [&_svg]:h-32",
13380
+ "text-only": "[&_svg]:hidden",
13381
+ mascot: "[&_svg]:w-24 [&_svg]:h-24 [&_svg]:rounded-pill"
13382
+ };
13383
+ EmptyState = ({
13384
+ icon,
13385
+ title,
13386
+ message,
13387
+ description,
13388
+ actionLabel,
13389
+ onAction,
13390
+ className,
13391
+ destructive,
13392
+ variant,
13393
+ actionEvent,
13394
+ look = "icon-only"
13395
+ }) => {
13396
+ const eventBus = useEventBus();
13397
+ const { t } = useTranslate();
13398
+ const handleAction = () => {
13399
+ if (actionEvent) eventBus.emit(`UI:${actionEvent}`, {});
13400
+ onAction?.();
13401
+ };
13402
+ const iconName = typeof icon === "string" ? ICON_NAME_ALIASES[icon] ?? icon : void 0;
13403
+ const iconComponent = typeof icon === "function" ? icon : void 0;
13404
+ const hasIcon = Boolean(iconName || iconComponent);
13405
+ const isDestructive = destructive || variant === "error";
13406
+ const isSuccess = variant === "success";
13407
+ const displayText = title || message || t("empty.noItems");
13408
+ return /* @__PURE__ */ jsxs(
13409
+ VStack,
13410
+ {
13411
+ align: "center",
13412
+ className: cn(
13413
+ "justify-center py-12 text-center",
13414
+ lookStyles3[look],
13415
+ className
13416
+ ),
13417
+ children: [
13418
+ hasIcon && /* @__PURE__ */ jsx(
13419
+ Box,
13420
+ {
13421
+ className: cn(
13422
+ "mb-4 rounded-full p-3",
13423
+ isDestructive ? "bg-error/10" : isSuccess ? "bg-success/10" : "bg-muted"
13424
+ ),
13425
+ children: /* @__PURE__ */ jsx(
13426
+ Icon,
13427
+ {
13428
+ ...iconName ? { name: iconName } : { icon: iconComponent },
13429
+ className: cn(
13430
+ "h-8 w-8",
13431
+ isDestructive ? "text-error" : isSuccess ? "text-success" : "text-muted-foreground"
13432
+ )
13433
+ }
13434
+ )
13435
+ }
13436
+ ),
13437
+ /* @__PURE__ */ jsx(
13438
+ Typography,
13439
+ {
13440
+ variant: "h3",
13441
+ className: cn(
13442
+ "text-lg font-medium",
13443
+ isDestructive ? "text-error" : isSuccess ? "text-success" : "text-foreground"
13444
+ ),
13445
+ children: displayText
13446
+ }
13447
+ ),
13448
+ description && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "mt-1 text-muted-foreground max-w-sm", children: description }),
13449
+ actionLabel && (onAction || actionEvent) && /* @__PURE__ */ jsx(
13450
+ Button,
13451
+ {
13452
+ className: "mt-4",
13453
+ variant: isDestructive ? "danger" : "primary",
13454
+ onClick: handleAction,
13455
+ children: actionLabel
13456
+ }
13457
+ )
13458
+ ]
13459
+ }
13460
+ );
13461
+ };
13462
+ EmptyState.displayName = "EmptyState";
13463
+ }
13464
+ });
13485
13465
  function computeFoldRegions(code) {
13486
13466
  const lines = code.split("\n");
13487
13467
  const regions = [];
@@ -13519,9 +13499,32 @@ function computeFoldRegions(code) {
13519
13499
  function toCodeLanguage(value) {
13520
13500
  return value && CODE_LANGUAGE_SET.has(value) ? value : "text";
13521
13501
  }
13522
- var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log7, CODE_LANGUAGES, CODE_LANGUAGE_SET, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
13502
+ function generateDiff(oldVal, newVal) {
13503
+ const oldLines = oldVal.split("\n");
13504
+ const newLines = newVal.split("\n");
13505
+ const diff = [];
13506
+ const maxLen = Math.max(oldLines.length, newLines.length);
13507
+ for (let i = 0; i < maxLen; i++) {
13508
+ const oldLine = oldLines[i];
13509
+ const newLine = newLines[i];
13510
+ if (oldLine === newLine) {
13511
+ diff.push({ type: "context", content: oldLine ?? "", lineNumber: i + 1 });
13512
+ } else {
13513
+ if (oldLine !== void 0) diff.push({ type: "remove", content: oldLine, lineNumber: i + 1 });
13514
+ if (newLine !== void 0) diff.push({ type: "add", content: newLine, lineNumber: i + 1 });
13515
+ }
13516
+ }
13517
+ return diff;
13518
+ }
13519
+ var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log7, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
13523
13520
  var init_CodeBlock = __esm({
13524
13521
  "components/core/molecules/markdown/CodeBlock.tsx"() {
13522
+ init_cn();
13523
+ init_atoms2();
13524
+ init_Tabs();
13525
+ init_LoadingState();
13526
+ init_ErrorState();
13527
+ init_EmptyState();
13525
13528
  init_Box();
13526
13529
  init_Button();
13527
13530
  init_Badge();
@@ -13628,9 +13631,14 @@ var init_CodeBlock = __esm({
13628
13631
  "lolo"
13629
13632
  ];
13630
13633
  CODE_LANGUAGE_SET = new Set(CODE_LANGUAGES);
13634
+ DIFF_STYLES = {
13635
+ add: { bg: "bg-success/10", prefix: "+", text: "text-success" },
13636
+ remove: { bg: "bg-error/10", prefix: "-", text: "text-error" },
13637
+ context: { bg: "", prefix: " ", text: "text-foreground" }
13638
+ };
13631
13639
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
13632
13640
  HIDDEN_LINE_NUMBERS = { display: "none" };
13633
- CodeBlock = React88__default.memo(
13641
+ CodeBlock = React84__default.memo(
13634
13642
  ({
13635
13643
  code: rawCode,
13636
13644
  language = "text",
@@ -13641,7 +13649,20 @@ var init_CodeBlock = __esm({
13641
13649
  className,
13642
13650
  editable = false,
13643
13651
  onChange,
13644
- errorLines
13652
+ errorLines,
13653
+ // viewer props
13654
+ title,
13655
+ mode = "code",
13656
+ diff: propDiff,
13657
+ oldValue,
13658
+ newValue,
13659
+ showLineNumbers = false,
13660
+ wordWrap = false,
13661
+ files,
13662
+ actions,
13663
+ isLoading = false,
13664
+ error,
13665
+ showCopy
13645
13666
  }) => {
13646
13667
  const code = typeof rawCode === "string" ? rawCode : String(rawCode ?? "");
13647
13668
  const isOrb = language === "orb";
@@ -13653,6 +13674,20 @@ var init_CodeBlock = __esm({
13653
13674
  const codeRef = useRef(null);
13654
13675
  const savedScrollLeftRef = useRef(0);
13655
13676
  const [copied, setCopied] = useState(false);
13677
+ const [wrap, setWrap] = useState(wordWrap);
13678
+ const [activeFileIndex, setActiveFileIndex] = useState(0);
13679
+ const activeFile = files?.[activeFileIndex];
13680
+ const activeCode = activeFile?.code ?? code;
13681
+ const activeLanguage = activeFile?.language ?? language;
13682
+ const diffLines = useMemo(() => {
13683
+ if (propDiff) return propDiff;
13684
+ if (mode === "diff" && oldValue !== void 0 && newValue !== void 0) {
13685
+ return generateDiff(oldValue, newValue);
13686
+ }
13687
+ return null;
13688
+ }, [propDiff, mode, oldValue, newValue]);
13689
+ const isViewerMode = !!(title || files || showLineNumbers || diffLines || mode === "diff" || actions);
13690
+ const effectiveCopy = showCopy ?? showCopyButton;
13656
13691
  const [editableValue, setEditableValue] = useState(code);
13657
13692
  const [editableTextareaKey, setEditableTextareaKey] = useState(0);
13658
13693
  const lastPropCodeRef = useRef(code);
@@ -13823,13 +13858,13 @@ var init_CodeBlock = __esm({
13823
13858
  }, [language, code]);
13824
13859
  const handleCopy = async () => {
13825
13860
  try {
13826
- await navigator.clipboard.writeText(code);
13861
+ await navigator.clipboard.writeText(activeCode);
13827
13862
  setCopied(true);
13828
- eventBus.emit("UI:COPY_CODE", { language, success: true });
13863
+ eventBus.emit("UI:COPY_CODE", { language: activeLanguage, success: true });
13829
13864
  setTimeout(() => setCopied(false), 2e3);
13830
13865
  } catch (err) {
13831
13866
  log7.error("Failed to copy code", { error: err instanceof Error ? err : String(err) });
13832
- eventBus.emit("UI:COPY_CODE", { language, success: false });
13867
+ eventBus.emit("UI:COPY_CODE", { language: activeLanguage, success: false });
13833
13868
  }
13834
13869
  };
13835
13870
  const handleSelectionCopy = useCallback((e) => {
@@ -13882,11 +13917,134 @@ var init_CodeBlock = __esm({
13882
13917
  }
13883
13918
  });
13884
13919
  }
13885
- const full = code.split("\n").slice(a, endLine + 1).join("\n");
13920
+ const full = activeCode.split("\n").slice(a, endLine + 1).join("\n");
13886
13921
  e.clipboardData.setData("text/plain", full);
13887
13922
  e.preventDefault();
13888
13923
  }, [code]);
13889
- const hasHeader = showLanguageBadge || showCopyButton;
13924
+ if (isLoading) {
13925
+ return /* @__PURE__ */ jsx(LoadingState, { message: t("common.loading"), className });
13926
+ }
13927
+ if (error) {
13928
+ return /* @__PURE__ */ jsx(ErrorState, { title: t("display.codeViewerError"), message: error.message, className });
13929
+ }
13930
+ if (isViewerMode && !activeCode && !diffLines) {
13931
+ return /* @__PURE__ */ jsx(EmptyState, { icon: Code, title: t("display.noCode"), description: "No code to display.", className });
13932
+ }
13933
+ if (isViewerMode) {
13934
+ const tabItems = files?.map((file, idx) => ({
13935
+ id: `file-${idx}`,
13936
+ label: file.label,
13937
+ content: null
13938
+ }));
13939
+ const lines = activeCode.split("\n");
13940
+ return /* @__PURE__ */ jsx(Card, { className: cn("overflow-hidden", className), children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column" }, children: [
13941
+ tabItems && tabItems.length > 1 && /* @__PURE__ */ jsx(Box, { className: "border-b border-border", children: /* @__PURE__ */ jsx(
13942
+ Tabs,
13943
+ {
13944
+ tabs: tabItems,
13945
+ activeTab: `file-${activeFileIndex}`,
13946
+ onTabChange: (id) => {
13947
+ const idx = parseInt(id.replace("file-", ""), 10);
13948
+ setActiveFileIndex(idx);
13949
+ }
13950
+ }
13951
+ ) }),
13952
+ /* @__PURE__ */ jsxs(
13953
+ HStack,
13954
+ {
13955
+ gap: "sm",
13956
+ align: "center",
13957
+ justify: "between",
13958
+ className: "px-4 py-2 border-b border-border bg-muted/30",
13959
+ children: [
13960
+ /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
13961
+ /* @__PURE__ */ jsx(Icon, { icon: mode === "diff" ? FileText : Code, size: "sm", className: "text-muted-foreground" }),
13962
+ title && /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "truncate", children: title }),
13963
+ activeLanguage && activeLanguage !== "text" && /* @__PURE__ */ jsx(Badge, { variant: "default", children: activeLanguage })
13964
+ ] }),
13965
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
13966
+ /* @__PURE__ */ jsx(
13967
+ Button,
13968
+ {
13969
+ variant: "ghost",
13970
+ size: "sm",
13971
+ icon: WrapText,
13972
+ onClick: () => setWrap(!wrap),
13973
+ className: cn(wrap && "text-primary")
13974
+ }
13975
+ ),
13976
+ effectiveCopy && /* @__PURE__ */ jsx(
13977
+ Button,
13978
+ {
13979
+ variant: "ghost",
13980
+ size: "sm",
13981
+ icon: copied ? Check : Copy,
13982
+ onClick: handleCopy,
13983
+ className: cn(copied && "text-success")
13984
+ }
13985
+ ),
13986
+ actions?.map((action, idx) => /* @__PURE__ */ jsx(
13987
+ Badge,
13988
+ {
13989
+ variant: "default",
13990
+ className: "cursor-pointer hover:opacity-80 transition-opacity",
13991
+ onClick: () => {
13992
+ if (action.event) eventBus.emit(`UI:${action.event}`, {});
13993
+ },
13994
+ children: action.label
13995
+ },
13996
+ idx
13997
+ ))
13998
+ ] })
13999
+ ]
14000
+ }
14001
+ ),
14002
+ /* @__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) => {
14003
+ const style = DIFF_STYLES[line.type];
14004
+ return /* @__PURE__ */ jsxs(HStack, { gap: "none", align: "start", className: cn(style.bg, "px-4 py-0.5"), children: [
14005
+ showLineNumbers && /* @__PURE__ */ jsx(
14006
+ Typography,
14007
+ {
14008
+ variant: "caption",
14009
+ color: "secondary",
14010
+ className: "w-8 text-right mr-3 select-none tabular-nums flex-shrink-0",
14011
+ children: line.lineNumber ?? ""
14012
+ }
14013
+ ),
14014
+ /* @__PURE__ */ jsxs(
14015
+ Typography,
14016
+ {
14017
+ variant: "caption",
14018
+ className: cn("font-mono flex-1 min-w-0", style.text, wrap ? "whitespace-pre-wrap break-all" : "whitespace-pre"),
14019
+ children: [
14020
+ /* @__PURE__ */ jsx(Box, { as: "span", className: "select-none opacity-50 mr-2", children: style.prefix }),
14021
+ line.content
14022
+ ]
14023
+ }
14024
+ )
14025
+ ] }, idx);
14026
+ }) }) : /* @__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: [
14027
+ showLineNumbers && /* @__PURE__ */ jsx(
14028
+ Typography,
14029
+ {
14030
+ variant: "caption",
14031
+ color: "secondary",
14032
+ className: "w-8 text-right mr-4 select-none tabular-nums flex-shrink-0",
14033
+ children: idx + 1
14034
+ }
14035
+ ),
14036
+ /* @__PURE__ */ jsx(
14037
+ Typography,
14038
+ {
14039
+ variant: "caption",
14040
+ className: cn("font-mono flex-1 min-w-0", wrap ? "whitespace-pre-wrap break-all" : "whitespace-pre"),
14041
+ children: line || " "
14042
+ }
14043
+ )
14044
+ ] }, idx)) }) })
14045
+ ] }) });
14046
+ }
14047
+ const hasHeader = showLanguageBadge || effectiveCopy;
13890
14048
  return /* @__PURE__ */ jsxs(Box, { className: `relative group ${className || ""}`, style: { display: "flex", flexDirection: "column", height: "100%" }, children: [
13891
14049
  hasHeader && /* @__PURE__ */ jsxs(
13892
14050
  HStack,
@@ -13896,7 +14054,7 @@ var init_CodeBlock = __esm({
13896
14054
  className: "px-3 py-2 bg-[var(--color-card)] rounded-t-lg border-b border-gray-700",
13897
14055
  children: [
13898
14056
  showLanguageBadge && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: language }),
13899
- showCopyButton && /* @__PURE__ */ jsx(
14057
+ effectiveCopy && /* @__PURE__ */ jsx(
13900
14058
  Button,
13901
14059
  {
13902
14060
  variant: "ghost",
@@ -14055,7 +14213,7 @@ var init_CodeBlock = __esm({
14055
14213
  )
14056
14214
  ] });
14057
14215
  },
14058
- (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
14216
+ (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
14059
14217
  );
14060
14218
  CodeBlock.displayName = "CodeBlock";
14061
14219
  }
@@ -14067,7 +14225,7 @@ var init_MarkdownContent = __esm({
14067
14225
  init_Box();
14068
14226
  init_CodeBlock();
14069
14227
  init_cn();
14070
- MarkdownContent = React88__default.memo(
14228
+ MarkdownContent = React84__default.memo(
14071
14229
  ({ content, direction, className }) => {
14072
14230
  const { t: _t } = useTranslate();
14073
14231
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -15163,7 +15321,7 @@ var init_StateMachineView = __esm({
15163
15321
  style: { top: title ? 30 : 0 },
15164
15322
  children: [
15165
15323
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
15166
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React88__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
15324
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React84__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
15167
15325
  StateNode,
15168
15326
  {
15169
15327
  state,
@@ -16312,110 +16470,6 @@ var init_BookTableOfContents = __esm({
16312
16470
  BookTableOfContents.displayName = "BookTableOfContents";
16313
16471
  }
16314
16472
  });
16315
- var ICON_NAME_ALIASES, lookStyles3, EmptyState;
16316
- var init_EmptyState = __esm({
16317
- "components/core/molecules/EmptyState.tsx"() {
16318
- "use client";
16319
- init_cn();
16320
- init_atoms2();
16321
- init_Box();
16322
- init_Icon();
16323
- init_Stack();
16324
- init_Typography();
16325
- init_useEventBus();
16326
- ICON_NAME_ALIASES = {
16327
- check: "check-circle",
16328
- error: "x-circle",
16329
- warning: "alert-circle"
16330
- };
16331
- lookStyles3 = {
16332
- "icon-only": "",
16333
- illustrated: "[&_svg]:w-32 [&_svg]:h-32",
16334
- "text-only": "[&_svg]:hidden",
16335
- mascot: "[&_svg]:w-24 [&_svg]:h-24 [&_svg]:rounded-pill"
16336
- };
16337
- EmptyState = ({
16338
- icon,
16339
- title,
16340
- message,
16341
- description,
16342
- actionLabel,
16343
- onAction,
16344
- className,
16345
- destructive,
16346
- variant,
16347
- actionEvent,
16348
- look = "icon-only"
16349
- }) => {
16350
- const eventBus = useEventBus();
16351
- const { t } = useTranslate();
16352
- const handleAction = () => {
16353
- if (actionEvent) eventBus.emit(`UI:${actionEvent}`, {});
16354
- onAction?.();
16355
- };
16356
- const iconName = typeof icon === "string" ? ICON_NAME_ALIASES[icon] ?? icon : void 0;
16357
- const iconComponent = typeof icon === "function" ? icon : void 0;
16358
- const hasIcon = Boolean(iconName || iconComponent);
16359
- const isDestructive = destructive || variant === "error";
16360
- const isSuccess = variant === "success";
16361
- const displayText = title || message || t("empty.noItems");
16362
- return /* @__PURE__ */ jsxs(
16363
- VStack,
16364
- {
16365
- align: "center",
16366
- className: cn(
16367
- "justify-center py-12 text-center",
16368
- lookStyles3[look],
16369
- className
16370
- ),
16371
- children: [
16372
- hasIcon && /* @__PURE__ */ jsx(
16373
- Box,
16374
- {
16375
- className: cn(
16376
- "mb-4 rounded-full p-3",
16377
- isDestructive ? "bg-error/10" : isSuccess ? "bg-success/10" : "bg-muted"
16378
- ),
16379
- children: /* @__PURE__ */ jsx(
16380
- Icon,
16381
- {
16382
- ...iconName ? { name: iconName } : { icon: iconComponent },
16383
- className: cn(
16384
- "h-8 w-8",
16385
- isDestructive ? "text-error" : isSuccess ? "text-success" : "text-muted-foreground"
16386
- )
16387
- }
16388
- )
16389
- }
16390
- ),
16391
- /* @__PURE__ */ jsx(
16392
- Typography,
16393
- {
16394
- variant: "h3",
16395
- className: cn(
16396
- "text-lg font-medium",
16397
- isDestructive ? "text-error" : isSuccess ? "text-success" : "text-foreground"
16398
- ),
16399
- children: displayText
16400
- }
16401
- ),
16402
- description && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "mt-1 text-muted-foreground max-w-sm", children: description }),
16403
- actionLabel && (onAction || actionEvent) && /* @__PURE__ */ jsx(
16404
- Button,
16405
- {
16406
- className: "mt-4",
16407
- variant: isDestructive ? "danger" : "primary",
16408
- onClick: handleAction,
16409
- children: actionLabel
16410
- }
16411
- )
16412
- ]
16413
- }
16414
- );
16415
- };
16416
- EmptyState.displayName = "EmptyState";
16417
- }
16418
- });
16419
16473
 
16420
16474
  // components/core/organisms/book/types.ts
16421
16475
  function resolveFieldMap(fieldMap) {
@@ -16768,7 +16822,7 @@ var init_Grid = __esm({
16768
16822
  as: Component = "div"
16769
16823
  }) => {
16770
16824
  const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
16771
- return React88__default.createElement(
16825
+ return React84__default.createElement(
16772
16826
  Component,
16773
16827
  {
16774
16828
  className: cn(
@@ -21211,449 +21265,6 @@ var init_ClassifierBoard = __esm({
21211
21265
  ClassifierBoard.displayName = "ClassifierBoard";
21212
21266
  }
21213
21267
  });
21214
- function CodeView({
21215
- data,
21216
- label,
21217
- defaultExpanded = false,
21218
- className
21219
- }) {
21220
- const { t } = useTranslate();
21221
- const [expanded, setExpanded] = useState(defaultExpanded);
21222
- const jsonString = JSON.stringify(data, null, 2);
21223
- return /* @__PURE__ */ jsxs(VStack, { className: cn("rounded-lg border border-border overflow-hidden", className), gap: "none", children: [
21224
- /* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between p-2 bg-muted", gap: "sm", children: [
21225
- /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground font-medium", children: label ?? t("stateArchitect.viewCode") }),
21226
- /* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: () => setExpanded(!expanded), className: "text-xs", children: expanded ? t("stateArchitect.hideJson") : t("stateArchitect.showJson") })
21227
- ] }),
21228
- expanded && /* @__PURE__ */ jsx(Box, { className: "p-3 bg-background overflow-x-auto", children: /* @__PURE__ */ jsx(
21229
- Typography,
21230
- {
21231
- variant: "caption",
21232
- className: "text-foreground font-mono whitespace-pre text-xs leading-relaxed block",
21233
- children: jsonString
21234
- }
21235
- ) })
21236
- ] });
21237
- }
21238
- var init_CodeView = __esm({
21239
- "components/game/organisms/puzzles/state-architect/CodeView.tsx"() {
21240
- init_atoms2();
21241
- init_cn();
21242
- CodeView.displayName = "CodeView";
21243
- }
21244
- });
21245
- var Tabs;
21246
- var init_Tabs = __esm({
21247
- "components/core/molecules/Tabs.tsx"() {
21248
- "use client";
21249
- init_Icon();
21250
- init_Badge();
21251
- init_Typography();
21252
- init_Box();
21253
- init_cn();
21254
- init_useEventBus();
21255
- Tabs = ({
21256
- items,
21257
- tabs,
21258
- defaultActiveTab,
21259
- activeTab: controlledActiveTab,
21260
- onTabChange,
21261
- tabChangeEvent,
21262
- variant = "default",
21263
- orientation = "horizontal",
21264
- className
21265
- }) => {
21266
- const rawItems = items ?? tabs ?? [];
21267
- const safeItems = rawItems.map(({ id, value, ...rest }) => ({
21268
- ...rest,
21269
- id: id || value || ""
21270
- }));
21271
- const eventBus = useEventBus();
21272
- const { t } = useTranslate();
21273
- const initialActive = safeItems.find((item) => item.active)?.id;
21274
- const [internalActiveTab, setInternalActiveTab] = useState(
21275
- defaultActiveTab || initialActive || safeItems[0]?.id || ""
21276
- );
21277
- const activeTab = controlledActiveTab !== void 0 ? controlledActiveTab : internalActiveTab;
21278
- const tabRefs = useRef({});
21279
- const handleTabChange = (tabId, tabEvent) => {
21280
- if (controlledActiveTab === void 0) {
21281
- setInternalActiveTab(tabId);
21282
- }
21283
- onTabChange?.(tabId);
21284
- if (tabChangeEvent) {
21285
- eventBus.emit(`UI:${tabChangeEvent}`, { tabId });
21286
- }
21287
- if (tabEvent) {
21288
- eventBus.emit(`UI:${tabEvent}`, { tabId });
21289
- }
21290
- };
21291
- const handleKeyDown = (e, index) => {
21292
- if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
21293
- e.preventDefault();
21294
- const direction = e.key === "ArrowLeft" ? -1 : 1;
21295
- const nextIndex = (index + direction + safeItems.length) % safeItems.length;
21296
- const nextTab = safeItems[nextIndex];
21297
- if (nextTab && !nextTab.disabled) {
21298
- handleTabChange(nextTab.id);
21299
- tabRefs.current[nextTab.id]?.focus();
21300
- }
21301
- } else if (e.key === "Home" || e.key === "End") {
21302
- e.preventDefault();
21303
- const targetIndex = e.key === "Home" ? 0 : safeItems.length - 1;
21304
- const targetTab = safeItems[targetIndex];
21305
- if (targetTab && !targetTab.disabled) {
21306
- handleTabChange(targetTab.id);
21307
- tabRefs.current[targetTab.id]?.focus();
21308
- }
21309
- }
21310
- };
21311
- const activeTabContent = safeItems.find((item) => item.id === activeTab)?.content;
21312
- if (safeItems.length === 0) {
21313
- return /* @__PURE__ */ jsx(Box, { className: cn("w-full", className), children: /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "py-4", children: t("empty.noItems") }) });
21314
- }
21315
- const variantClasses2 = {
21316
- default: [
21317
- "border-b-[length:var(--border-width)] border-transparent",
21318
- "hover:border-muted-foreground",
21319
- "data-[active=true]:border-primary"
21320
- ].join(" "),
21321
- pills: [
21322
- "rounded-sm",
21323
- "data-[active=true]:bg-primary",
21324
- "data-[active=true]:text-primary-foreground"
21325
- ].join(" "),
21326
- underline: [
21327
- "border-b-[length:var(--border-width)] border-transparent",
21328
- "data-[active=true]:border-primary"
21329
- ].join(" ")
21330
- };
21331
- return /* @__PURE__ */ jsxs(Box, { className: cn("w-full", className), children: [
21332
- /* @__PURE__ */ jsx(
21333
- Box,
21334
- {
21335
- role: "tablist",
21336
- className: cn(
21337
- "flex",
21338
- // Horizontal tab strip becomes a horizontally-scrollable lane
21339
- // below its container width — phones with many tabs scroll
21340
- // instead of clipping. `snap-x` snaps to each tab; the
21341
- // scrollbar is hidden for a cleaner affordance (the swipe
21342
- // gesture is the discoverability cue).
21343
- 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",
21344
- variant === "pills" && "gap-1 p-1 bg-muted border-0 rounded-md",
21345
- variant === "underline" && orientation === "vertical" && "border-b-0"
21346
- ),
21347
- children: safeItems.map((item, index) => {
21348
- const isActive = item.id === activeTab;
21349
- const isDisabled = item.disabled;
21350
- return /* @__PURE__ */ jsxs(
21351
- Box,
21352
- {
21353
- as: "button",
21354
- ref: (el) => {
21355
- tabRefs.current[item.id] = el;
21356
- },
21357
- role: "tab",
21358
- "aria-selected": isActive,
21359
- "aria-controls": `tabpanel-${item.id}`,
21360
- "aria-disabled": isDisabled,
21361
- onClick: () => !isDisabled && handleTabChange(item.id, item.event),
21362
- onKeyDown: (e) => handleKeyDown(e, index),
21363
- "data-active": isActive,
21364
- className: cn(
21365
- "flex items-center gap-2 px-4 py-2 text-sm font-medium transition-all whitespace-nowrap",
21366
- orientation === "horizontal" && "snap-start shrink-0",
21367
- "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
21368
- isDisabled && "opacity-50 cursor-not-allowed",
21369
- variantClasses2[variant],
21370
- isActive ? variant === "pills" ? "text-primary-foreground font-bold" : "text-foreground font-bold" : "text-muted-foreground hover:text-foreground"
21371
- ),
21372
- children: [
21373
- item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: item.icon, size: "sm" }) : /* @__PURE__ */ jsx(Icon, { icon: item.icon, size: "sm" })),
21374
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: isActive ? "semibold" : "normal", className: "!text-inherit", children: item.label }),
21375
- item.badge !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: item.badge })
21376
- ]
21377
- },
21378
- item.id
21379
- );
21380
- })
21381
- }
21382
- ),
21383
- activeTabContent !== void 0 && activeTabContent !== null && /* @__PURE__ */ jsx(
21384
- Box,
21385
- {
21386
- role: "tabpanel",
21387
- id: `tabpanel-${activeTab}`,
21388
- "aria-labelledby": `tab-${activeTab}`,
21389
- className: "mt-4",
21390
- children: activeTabContent
21391
- }
21392
- )
21393
- ] });
21394
- };
21395
- Tabs.displayName = "Tabs";
21396
- }
21397
- });
21398
- function generateDiff(oldVal, newVal) {
21399
- const oldLines = oldVal.split("\n");
21400
- const newLines = newVal.split("\n");
21401
- const diff = [];
21402
- const maxLen = Math.max(oldLines.length, newLines.length);
21403
- for (let i = 0; i < maxLen; i++) {
21404
- const oldLine = oldLines[i];
21405
- const newLine = newLines[i];
21406
- if (oldLine === newLine) {
21407
- diff.push({ type: "context", content: oldLine ?? "", lineNumber: i + 1 });
21408
- } else {
21409
- if (oldLine !== void 0) {
21410
- diff.push({ type: "remove", content: oldLine, lineNumber: i + 1 });
21411
- }
21412
- if (newLine !== void 0) {
21413
- diff.push({ type: "add", content: newLine, lineNumber: i + 1 });
21414
- }
21415
- }
21416
- }
21417
- return diff;
21418
- }
21419
- var DIFF_STYLES, CodeViewer;
21420
- var init_CodeViewer = __esm({
21421
- "components/core/molecules/CodeViewer.tsx"() {
21422
- "use client";
21423
- init_cn();
21424
- init_atoms2();
21425
- init_Stack();
21426
- init_LoadingState();
21427
- init_ErrorState();
21428
- init_EmptyState();
21429
- init_Tabs();
21430
- init_useEventBus();
21431
- DIFF_STYLES = {
21432
- add: {
21433
- bg: "bg-success/10",
21434
- prefix: "+",
21435
- text: "text-success"
21436
- },
21437
- remove: {
21438
- bg: "bg-error/10",
21439
- prefix: "-",
21440
- text: "text-error"
21441
- },
21442
- context: {
21443
- bg: "",
21444
- prefix: " ",
21445
- text: "text-foreground"
21446
- }
21447
- };
21448
- CodeViewer = ({
21449
- title,
21450
- code,
21451
- language,
21452
- diff: propDiff,
21453
- oldValue,
21454
- newValue,
21455
- mode = "code",
21456
- showLineNumbers = true,
21457
- showCopy = true,
21458
- wordWrap = false,
21459
- maxHeight = 500,
21460
- files,
21461
- actions,
21462
- entity,
21463
- isLoading = false,
21464
- error,
21465
- className
21466
- }) => {
21467
- const eventBus = useEventBus();
21468
- const { t } = useTranslate();
21469
- const [copied, setCopied] = useState(false);
21470
- const [wrap, setWrap] = useState(wordWrap);
21471
- const [activeFileIndex, setActiveFileIndex] = useState(0);
21472
- const handleAction = useCallback(
21473
- (action) => {
21474
- if (action.event) {
21475
- eventBus.emit(`UI:${action.event}`, {});
21476
- }
21477
- },
21478
- [eventBus]
21479
- );
21480
- const activeFile = files?.[activeFileIndex];
21481
- const activeCode = activeFile?.code ?? code ?? "";
21482
- const activeLanguage = activeFile?.language ?? language ?? "text";
21483
- const lines = useMemo(() => activeCode.split("\n"), [activeCode]);
21484
- const diffLines = useMemo(() => {
21485
- if (propDiff) return propDiff;
21486
- if (mode === "diff" && oldValue !== void 0 && newValue !== void 0) {
21487
- return generateDiff(oldValue, newValue);
21488
- }
21489
- return null;
21490
- }, [propDiff, mode, oldValue, newValue]);
21491
- const handleCopy = useCallback(async () => {
21492
- try {
21493
- await navigator.clipboard.writeText(activeCode);
21494
- setCopied(true);
21495
- eventBus.emit("UI:CODE_COPY", { language: activeLanguage });
21496
- setTimeout(() => setCopied(false), 2e3);
21497
- } catch {
21498
- }
21499
- }, [activeCode, eventBus, activeLanguage]);
21500
- const tabItems = files?.map((file, idx) => ({
21501
- id: `file-${idx}`,
21502
- label: file.label,
21503
- content: null
21504
- }));
21505
- if (isLoading) {
21506
- return /* @__PURE__ */ jsx(LoadingState, { message: t("common.loading"), className });
21507
- }
21508
- if (error) {
21509
- return /* @__PURE__ */ jsx(
21510
- ErrorState,
21511
- {
21512
- title: t("display.codeViewerError"),
21513
- message: error.message,
21514
- className
21515
- }
21516
- );
21517
- }
21518
- if (!activeCode && !diffLines) {
21519
- return /* @__PURE__ */ jsx(
21520
- EmptyState,
21521
- {
21522
- icon: Code,
21523
- title: t("display.noCode"),
21524
- description: "No code to display.",
21525
- className
21526
- }
21527
- );
21528
- }
21529
- return /* @__PURE__ */ jsx(Card, { className: cn("overflow-hidden", className), children: /* @__PURE__ */ jsxs(VStack, { gap: "none", children: [
21530
- tabItems && tabItems.length > 1 && /* @__PURE__ */ jsx(Box, { className: "border-b border-border", children: /* @__PURE__ */ jsx(
21531
- Tabs,
21532
- {
21533
- tabs: tabItems,
21534
- activeTab: `file-${activeFileIndex}`,
21535
- onTabChange: (id) => {
21536
- const idx = parseInt(id.replace("file-", ""), 10);
21537
- setActiveFileIndex(idx);
21538
- }
21539
- }
21540
- ) }),
21541
- /* @__PURE__ */ jsxs(
21542
- HStack,
21543
- {
21544
- gap: "sm",
21545
- align: "center",
21546
- justify: "between",
21547
- className: "px-4 py-2 border-b border-border bg-muted/30",
21548
- children: [
21549
- /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
21550
- /* @__PURE__ */ jsx(Icon, { icon: mode === "diff" ? FileText : Code, size: "sm", className: "text-muted-foreground" }),
21551
- title && /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "truncate", children: title }),
21552
- activeLanguage && activeLanguage !== "text" && /* @__PURE__ */ jsx(Badge, { variant: "default", children: activeLanguage })
21553
- ] }),
21554
- /* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
21555
- /* @__PURE__ */ jsx(
21556
- Button,
21557
- {
21558
- variant: "ghost",
21559
- size: "sm",
21560
- icon: WrapText,
21561
- onClick: () => setWrap(!wrap),
21562
- className: cn(wrap && "text-primary")
21563
- }
21564
- ),
21565
- showCopy && /* @__PURE__ */ jsx(
21566
- Button,
21567
- {
21568
- variant: "ghost",
21569
- size: "sm",
21570
- icon: copied ? Check : Copy,
21571
- onClick: handleCopy,
21572
- className: cn(copied && "text-success")
21573
- }
21574
- ),
21575
- actions?.map((action, idx) => /* @__PURE__ */ jsx(
21576
- Badge,
21577
- {
21578
- variant: "default",
21579
- className: "cursor-pointer hover:opacity-80 transition-opacity",
21580
- onClick: () => handleAction(action),
21581
- children: action.label
21582
- },
21583
- idx
21584
- ))
21585
- ] })
21586
- ]
21587
- }
21588
- ),
21589
- /* @__PURE__ */ jsx(
21590
- Box,
21591
- {
21592
- className: "overflow-auto bg-muted/20",
21593
- style: { maxHeight },
21594
- children: diffLines ? (
21595
- /* Diff mode */
21596
- /* @__PURE__ */ jsx(VStack, { gap: "none", className: "font-mono text-xs", children: diffLines.map((line, idx) => {
21597
- const style = DIFF_STYLES[line.type];
21598
- return /* @__PURE__ */ jsxs(HStack, { gap: "none", align: "start", className: cn(style.bg, "px-4 py-0.5"), children: [
21599
- showLineNumbers && /* @__PURE__ */ jsx(
21600
- Typography,
21601
- {
21602
- variant: "caption",
21603
- color: "secondary",
21604
- className: "w-8 text-right mr-3 select-none tabular-nums flex-shrink-0",
21605
- children: line.lineNumber ?? ""
21606
- }
21607
- ),
21608
- /* @__PURE__ */ jsxs(
21609
- Typography,
21610
- {
21611
- variant: "caption",
21612
- className: cn(
21613
- "font-mono flex-1 min-w-0",
21614
- style.text,
21615
- wrap ? "whitespace-pre-wrap break-all" : "whitespace-pre"
21616
- ),
21617
- children: [
21618
- /* @__PURE__ */ jsx(Box, { as: "span", className: "select-none opacity-50 mr-2", children: style.prefix }),
21619
- line.content
21620
- ]
21621
- }
21622
- )
21623
- ] }, idx);
21624
- }) })
21625
- ) : (
21626
- /* Code mode */
21627
- /* @__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: [
21628
- showLineNumbers && /* @__PURE__ */ jsx(
21629
- Typography,
21630
- {
21631
- variant: "caption",
21632
- color: "secondary",
21633
- className: "w-8 text-right mr-4 select-none tabular-nums flex-shrink-0",
21634
- children: idx + 1
21635
- }
21636
- ),
21637
- /* @__PURE__ */ jsx(
21638
- Typography,
21639
- {
21640
- variant: "caption",
21641
- className: cn(
21642
- "font-mono flex-1 min-w-0",
21643
- wrap ? "whitespace-pre-wrap break-all" : "whitespace-pre"
21644
- ),
21645
- children: line || " "
21646
- }
21647
- )
21648
- ] }, idx)) })
21649
- )
21650
- }
21651
- )
21652
- ] }) });
21653
- };
21654
- CodeViewer.displayName = "CodeViewer";
21655
- }
21656
- });
21657
21268
  function CombatLog({
21658
21269
  events: events2,
21659
21270
  maxVisible = 50,
@@ -21918,7 +21529,7 @@ function CounterMinimal({
21918
21529
  Button,
21919
21530
  {
21920
21531
  variant: "secondary",
21921
- size: sizeStyles9[size].button,
21532
+ size: sizeStyles8[size].button,
21922
21533
  onClick: onDecrement,
21923
21534
  disabled: resolved.decrementDisabled,
21924
21535
  icon: "minus",
@@ -21930,7 +21541,7 @@ function CounterMinimal({
21930
21541
  {
21931
21542
  variant: "h1",
21932
21543
  className: cn(
21933
- sizeStyles9[size].display,
21544
+ sizeStyles8[size].display,
21934
21545
  "font-bold tabular-nums min-w-[3ch] text-center"
21935
21546
  ),
21936
21547
  children: resolved.count
@@ -21940,7 +21551,7 @@ function CounterMinimal({
21940
21551
  Button,
21941
21552
  {
21942
21553
  variant: "secondary",
21943
- size: sizeStyles9[size].button,
21554
+ size: sizeStyles8[size].button,
21944
21555
  onClick: onIncrement,
21945
21556
  disabled: resolved.incrementDisabled,
21946
21557
  icon: "plus",
@@ -21975,7 +21586,7 @@ function CounterStandard({
21975
21586
  {
21976
21587
  variant: "h1",
21977
21588
  className: cn(
21978
- sizeStyles9[size].display,
21589
+ sizeStyles8[size].display,
21979
21590
  "font-bold tabular-nums text-primary-600"
21980
21591
  ),
21981
21592
  children: resolved.count
@@ -21986,7 +21597,7 @@ function CounterStandard({
21986
21597
  Button,
21987
21598
  {
21988
21599
  variant: "secondary",
21989
- size: sizeStyles9[size].button,
21600
+ size: sizeStyles8[size].button,
21990
21601
  onClick: onDecrement,
21991
21602
  disabled: resolved.decrementDisabled,
21992
21603
  icon: "minus"
@@ -21996,7 +21607,7 @@ function CounterStandard({
21996
21607
  Button,
21997
21608
  {
21998
21609
  variant: "primary",
21999
- size: sizeStyles9[size].button,
21610
+ size: sizeStyles8[size].button,
22000
21611
  onClick: onIncrement,
22001
21612
  disabled: resolved.incrementDisabled,
22002
21613
  icon: "plus"
@@ -22042,7 +21653,7 @@ function CounterFull({
22042
21653
  {
22043
21654
  variant: "h1",
22044
21655
  className: cn(
22045
- sizeStyles9[size].display,
21656
+ sizeStyles8[size].display,
22046
21657
  "font-bold tabular-nums text-primary-600"
22047
21658
  ),
22048
21659
  children: resolved.count
@@ -22055,7 +21666,7 @@ function CounterFull({
22055
21666
  Button,
22056
21667
  {
22057
21668
  variant: "secondary",
22058
- size: sizeStyles9[size].button,
21669
+ size: sizeStyles8[size].button,
22059
21670
  onClick: onDecrement,
22060
21671
  disabled: resolved.decrementDisabled,
22061
21672
  icon: "minus",
@@ -22066,7 +21677,7 @@ function CounterFull({
22066
21677
  Button,
22067
21678
  {
22068
21679
  variant: "primary",
22069
- size: sizeStyles9[size].button,
21680
+ size: sizeStyles8[size].button,
22070
21681
  onClick: onIncrement,
22071
21682
  disabled: resolved.incrementDisabled,
22072
21683
  icon: "plus",
@@ -22086,7 +21697,7 @@ function CounterFull({
22086
21697
  )
22087
21698
  ] }) });
22088
21699
  }
22089
- var sizeStyles9, CounterTemplate;
21700
+ var sizeStyles8, CounterTemplate;
22090
21701
  var init_CounterTemplate = __esm({
22091
21702
  "components/core/templates/CounterTemplate.tsx"() {
22092
21703
  init_cn();
@@ -22094,7 +21705,7 @@ var init_CounterTemplate = __esm({
22094
21705
  init_Stack();
22095
21706
  init_Typography();
22096
21707
  init_Button();
22097
- sizeStyles9 = {
21708
+ sizeStyles8 = {
22098
21709
  sm: { display: "text-4xl", button: "sm" },
22099
21710
  md: { display: "text-6xl", button: "md" },
22100
21711
  lg: { display: "text-8xl", button: "lg" }
@@ -22128,7 +21739,7 @@ function CraftingRecipe({
22128
21739
  className
22129
21740
  }) {
22130
21741
  const eventBus = useEventBus();
22131
- const handleCraft = React88.useCallback(() => {
21742
+ const handleCraft = React84.useCallback(() => {
22132
21743
  onCraft?.();
22133
21744
  if (craftEvent) {
22134
21745
  eventBus.emit(craftEvent, { output: output.label });
@@ -22145,7 +21756,7 @@ function CraftingRecipe({
22145
21756
  children: [
22146
21757
  /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
22147
21758
  const hasSufficient = ingredient.available >= ingredient.required;
22148
- return /* @__PURE__ */ jsxs(React88.Fragment, { children: [
21759
+ return /* @__PURE__ */ jsxs(React84.Fragment, { children: [
22149
21760
  /* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
22150
21761
  ItemSlot,
22151
21762
  {
@@ -22208,8 +21819,8 @@ function DPad({
22208
21819
  }) {
22209
21820
  const eventBus = useEventBus();
22210
21821
  const sizes = sizeMap15[size];
22211
- const [activeDirections, setActiveDirections] = React88.useState(/* @__PURE__ */ new Set());
22212
- const handlePress = React88.useCallback(
21822
+ const [activeDirections, setActiveDirections] = React84.useState(/* @__PURE__ */ new Set());
21823
+ const handlePress = React84.useCallback(
22213
21824
  (direction) => {
22214
21825
  setActiveDirections((prev) => new Set(prev).add(direction));
22215
21826
  if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
@@ -22217,7 +21828,7 @@ function DPad({
22217
21828
  },
22218
21829
  [directionEvent, eventBus, onDirection]
22219
21830
  );
22220
- const handleRelease = React88.useCallback(
21831
+ const handleRelease = React84.useCallback(
22221
21832
  (direction) => {
22222
21833
  setActiveDirections((prev) => {
22223
21834
  const next = new Set(prev);
@@ -22903,14 +22514,14 @@ function useDataDnd(args) {
22903
22514
  const isZone = Boolean(dragGroup || accepts || sortable);
22904
22515
  const enabled = isZone || Boolean(dndRoot);
22905
22516
  const eventBus = useEventBus();
22906
- const parentRoot = React88__default.useContext(RootCtx);
22517
+ const parentRoot = React84__default.useContext(RootCtx);
22907
22518
  const isRoot = enabled && parentRoot === null;
22908
- const zoneId = React88__default.useId();
22519
+ const zoneId = React84__default.useId();
22909
22520
  const ownGroup = dragGroup ?? accepts ?? zoneId;
22910
- const [optimisticOrders, setOptimisticOrders] = React88__default.useState(() => /* @__PURE__ */ new Map());
22911
- const optimisticOrdersRef = React88__default.useRef(optimisticOrders);
22521
+ const [optimisticOrders, setOptimisticOrders] = React84__default.useState(() => /* @__PURE__ */ new Map());
22522
+ const optimisticOrdersRef = React84__default.useRef(optimisticOrders);
22912
22523
  optimisticOrdersRef.current = optimisticOrders;
22913
- const clearOptimisticOrder = React88__default.useCallback((group) => {
22524
+ const clearOptimisticOrder = React84__default.useCallback((group) => {
22914
22525
  setOptimisticOrders((prev) => {
22915
22526
  if (!prev.has(group)) return prev;
22916
22527
  const next = new Map(prev);
@@ -22935,7 +22546,7 @@ function useDataDnd(args) {
22935
22546
  const raw = it[dndItemIdField];
22936
22547
  return String(raw ?? `__idx_${idx}`);
22937
22548
  }).join("|");
22938
- const itemIds = React88__default.useMemo(
22549
+ const itemIds = React84__default.useMemo(
22939
22550
  () => orderedItems.map((it, idx) => {
22940
22551
  const raw = it[dndItemIdField];
22941
22552
  return raw ?? `__idx_${idx}`;
@@ -22943,7 +22554,7 @@ function useDataDnd(args) {
22943
22554
  [itemIdsSignature]
22944
22555
  );
22945
22556
  const itemsContentSig = items.map((it, idx) => String(it[dndItemIdField] ?? `__${idx}`)).join("|");
22946
- React88__default.useEffect(() => {
22557
+ React84__default.useEffect(() => {
22947
22558
  const root = isRoot ? null : parentRoot;
22948
22559
  if (root) {
22949
22560
  root.clearOptimisticOrder(ownGroup);
@@ -22951,20 +22562,20 @@ function useDataDnd(args) {
22951
22562
  clearOptimisticOrder(ownGroup);
22952
22563
  }
22953
22564
  }, [itemsContentSig, ownGroup]);
22954
- const zonesRef = React88__default.useRef(/* @__PURE__ */ new Map());
22955
- const registerZone = React88__default.useCallback((zoneId2, meta2) => {
22565
+ const zonesRef = React84__default.useRef(/* @__PURE__ */ new Map());
22566
+ const registerZone = React84__default.useCallback((zoneId2, meta2) => {
22956
22567
  zonesRef.current.set(zoneId2, meta2);
22957
22568
  }, []);
22958
- const unregisterZone = React88__default.useCallback((zoneId2) => {
22569
+ const unregisterZone = React84__default.useCallback((zoneId2) => {
22959
22570
  zonesRef.current.delete(zoneId2);
22960
22571
  }, []);
22961
- const [activeDrag, setActiveDrag] = React88__default.useState(null);
22962
- const [overZoneGroup, setOverZoneGroup] = React88__default.useState(null);
22963
- const meta = React88__default.useMemo(
22572
+ const [activeDrag, setActiveDrag] = React84__default.useState(null);
22573
+ const [overZoneGroup, setOverZoneGroup] = React84__default.useState(null);
22574
+ const meta = React84__default.useMemo(
22964
22575
  () => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
22965
22576
  [ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
22966
22577
  );
22967
- React88__default.useEffect(() => {
22578
+ React84__default.useEffect(() => {
22968
22579
  const target = isRoot ? null : parentRoot;
22969
22580
  if (!target) {
22970
22581
  zonesRef.current.set(zoneId, meta);
@@ -22983,7 +22594,7 @@ function useDataDnd(args) {
22983
22594
  }, [parentRoot, isRoot, zoneId, meta]);
22984
22595
  const sensors = useAlmadarDndSensors(true);
22985
22596
  const collisionDetection = almadarDndCollisionDetection;
22986
- const findZoneByItem = React88__default.useCallback(
22597
+ const findZoneByItem = React84__default.useCallback(
22987
22598
  (id) => {
22988
22599
  for (const z of zonesRef.current.values()) {
22989
22600
  if (z.itemIds.includes(id)) return z;
@@ -22992,7 +22603,7 @@ function useDataDnd(args) {
22992
22603
  },
22993
22604
  []
22994
22605
  );
22995
- React88__default.useCallback(
22606
+ React84__default.useCallback(
22996
22607
  (group) => {
22997
22608
  for (const z of zonesRef.current.values()) {
22998
22609
  if (z.group === group) return z;
@@ -23001,7 +22612,7 @@ function useDataDnd(args) {
23001
22612
  },
23002
22613
  []
23003
22614
  );
23004
- const handleDragEnd = React88__default.useCallback(
22615
+ const handleDragEnd = React84__default.useCallback(
23005
22616
  (event) => {
23006
22617
  const { active, over } = event;
23007
22618
  const activeIdStr = String(active.id);
@@ -23092,8 +22703,8 @@ function useDataDnd(args) {
23092
22703
  },
23093
22704
  [eventBus]
23094
22705
  );
23095
- const sortableData = React88__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
23096
- const SortableItem = React88__default.useCallback(
22706
+ const sortableData = React84__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
22707
+ const SortableItem = React84__default.useCallback(
23097
22708
  ({ id, children }) => {
23098
22709
  const {
23099
22710
  attributes,
@@ -23133,7 +22744,7 @@ function useDataDnd(args) {
23133
22744
  id: droppableId,
23134
22745
  data: sortableData
23135
22746
  });
23136
- const ctx = React88__default.useContext(RootCtx);
22747
+ const ctx = React84__default.useContext(RootCtx);
23137
22748
  const activeDrag2 = ctx?.activeDrag ?? null;
23138
22749
  const overZoneGroup2 = ctx?.overZoneGroup ?? null;
23139
22750
  const isThisZoneOver = overZoneGroup2 === ownGroup;
@@ -23148,7 +22759,7 @@ function useDataDnd(args) {
23148
22759
  showForeignPlaceholder,
23149
22760
  ctxAvailable: ctx != null
23150
22761
  });
23151
- React88__default.useEffect(() => {
22762
+ React84__default.useEffect(() => {
23152
22763
  dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
23153
22764
  }, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
23154
22765
  return /* @__PURE__ */ jsx(
@@ -23162,11 +22773,11 @@ function useDataDnd(args) {
23162
22773
  }
23163
22774
  );
23164
22775
  };
23165
- const rootContextValue = React88__default.useMemo(
22776
+ const rootContextValue = React84__default.useMemo(
23166
22777
  () => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
23167
22778
  [registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
23168
22779
  );
23169
- const handleDragStart = React88__default.useCallback((event) => {
22780
+ const handleDragStart = React84__default.useCallback((event) => {
23170
22781
  const sourceZone = findZoneByItem(event.active.id);
23171
22782
  const rect = event.active.rect.current.initial;
23172
22783
  const height = rect?.height && rect.height > 0 ? rect.height : 64;
@@ -23185,7 +22796,7 @@ function useDataDnd(args) {
23185
22796
  isRoot
23186
22797
  });
23187
22798
  }, [findZoneByItem, isRoot, zoneId]);
23188
- const handleDragOver = React88__default.useCallback((event) => {
22799
+ const handleDragOver = React84__default.useCallback((event) => {
23189
22800
  const { active, over } = event;
23190
22801
  const overData = over?.data?.current;
23191
22802
  const overGroup = overData?.dndGroup ?? null;
@@ -23255,7 +22866,7 @@ function useDataDnd(args) {
23255
22866
  return next;
23256
22867
  });
23257
22868
  }, []);
23258
- const handleDragCancel = React88__default.useCallback((event) => {
22869
+ const handleDragCancel = React84__default.useCallback((event) => {
23259
22870
  setActiveDrag(null);
23260
22871
  setOverZoneGroup(null);
23261
22872
  dndLog.warn("dragCancel", {
@@ -23263,12 +22874,12 @@ function useDataDnd(args) {
23263
22874
  reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
23264
22875
  });
23265
22876
  }, []);
23266
- const handleDragEndWithCleanup = React88__default.useCallback((event) => {
22877
+ const handleDragEndWithCleanup = React84__default.useCallback((event) => {
23267
22878
  handleDragEnd(event);
23268
22879
  setActiveDrag(null);
23269
22880
  setOverZoneGroup(null);
23270
22881
  }, [handleDragEnd]);
23271
- const wrapContainer = React88__default.useCallback(
22882
+ const wrapContainer = React84__default.useCallback(
23272
22883
  (children) => {
23273
22884
  if (!enabled) return children;
23274
22885
  const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
@@ -23322,7 +22933,7 @@ var init_useDataDnd = __esm({
23322
22933
  init_useAlmadarDndCollision();
23323
22934
  init_Box();
23324
22935
  dndLog = createLogger("almadar:ui:dnd");
23325
- RootCtx = React88__default.createContext(null);
22936
+ RootCtx = React84__default.createContext(null);
23326
22937
  }
23327
22938
  });
23328
22939
  function fieldLabel2(key) {
@@ -23842,7 +23453,7 @@ function DataList({
23842
23453
  }) {
23843
23454
  const eventBus = useEventBus();
23844
23455
  const { t } = useTranslate();
23845
- const [visibleCount, setVisibleCount] = React88__default.useState(pageSize || Infinity);
23456
+ const [visibleCount, setVisibleCount] = React84__default.useState(pageSize || Infinity);
23846
23457
  const fieldDefs = fields ?? columns ?? [];
23847
23458
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
23848
23459
  const dnd = useDataDnd({
@@ -23861,7 +23472,7 @@ function DataList({
23861
23472
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
23862
23473
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
23863
23474
  const hasRenderProp = typeof children === "function";
23864
- React88__default.useEffect(() => {
23475
+ React84__default.useEffect(() => {
23865
23476
  const renderItemTypeOf = typeof schemaRenderItem;
23866
23477
  const childrenTypeOf = typeof children;
23867
23478
  if (data.length > 0 && !hasRenderProp) {
@@ -23966,7 +23577,7 @@ function DataList({
23966
23577
  const items2 = data.map((item) => item);
23967
23578
  const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
23968
23579
  const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
23969
- return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React88__default.Fragment, { children: [
23580
+ return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
23970
23581
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
23971
23582
  group.items.map((itemData, index) => {
23972
23583
  const id = itemData.id || `${gi}-${index}`;
@@ -24114,7 +23725,7 @@ function DataList({
24114
23725
  className
24115
23726
  ),
24116
23727
  children: [
24117
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React88__default.Fragment, { children: [
23728
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
24118
23729
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
24119
23730
  group.items.map(
24120
23731
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -25488,7 +25099,7 @@ var init_WizardProgress = __esm({
25488
25099
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
25489
25100
  const isActive = index === currentStep;
25490
25101
  const isCompleted = index < currentStep;
25491
- return /* @__PURE__ */ jsxs(React88__default.Fragment, { children: [
25102
+ return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
25492
25103
  /* @__PURE__ */ jsx(
25493
25104
  "button",
25494
25105
  {
@@ -26005,8 +25616,9 @@ var init_FormSectionHeader = __esm({
26005
25616
  Box,
26006
25617
  {
26007
25618
  className: cn(
26008
- "px-4 py-3 bg-muted rounded-t-lg border-b-2 border-border border-l-4 border-l-primary",
26009
- isClickable && "cursor-pointer hover:bg-[var(--color-surface-hover)] transition-colors",
25619
+ "px-5 py-4 bg-muted/60 rounded-lg",
25620
+ "border border-border border-l-4 border-l-primary",
25621
+ isClickable && "cursor-pointer hover:bg-muted transition-colors",
26010
25622
  className
26011
25623
  ),
26012
25624
  onClick: isClickable ? onToggle : void 0,
@@ -26017,7 +25629,7 @@ var init_FormSectionHeader = __esm({
26017
25629
  {
26018
25630
  name: icon,
26019
25631
  size: "md",
26020
- className: "text-primary"
25632
+ className: "text-primary shrink-0"
26021
25633
  }
26022
25634
  ),
26023
25635
  statusIcon && /* @__PURE__ */ jsx(
@@ -26025,12 +25637,15 @@ var init_FormSectionHeader = __esm({
26025
25637
  {
26026
25638
  name: statusIcon,
26027
25639
  size: "md",
26028
- className: hasErrors ? "text-error" : "text-success"
25640
+ className: cn(
25641
+ "shrink-0",
25642
+ hasErrors ? "text-error" : "text-success"
25643
+ )
26029
25644
  }
26030
25645
  ),
26031
25646
  /* @__PURE__ */ jsxs(Box, { className: "space-y-0.5", children: [
26032
- /* @__PURE__ */ jsx(Typography, { variant: "subheading", weight: "semibold", children: title }),
26033
- subtitle && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: subtitle })
25647
+ /* @__PURE__ */ jsx(Typography, { variant: "subheading", weight: "semibold", className: "text-foreground", children: title }),
25648
+ subtitle && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "leading-snug", children: subtitle })
26034
25649
  ] })
26035
25650
  ] }),
26036
25651
  /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
@@ -26039,9 +25654,9 @@ var init_FormSectionHeader = __esm({
26039
25654
  Icon,
26040
25655
  {
26041
25656
  name: "chevron-down",
26042
- size: "md",
25657
+ size: "sm",
26043
25658
  className: cn(
26044
- "text-muted-foreground transition-transform",
25659
+ "text-muted-foreground transition-transform duration-200 shrink-0",
26045
25660
  isCollapsed && "-rotate-90"
26046
25661
  )
26047
25662
  }
@@ -26099,50 +25714,6 @@ var init_FlipCard = __esm({
26099
25714
  FlipCard.displayName = "FlipCard";
26100
25715
  }
26101
25716
  });
26102
- function pascalToKebab(name) {
26103
- return name.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Z])([A-Z][a-z])/g, "$1-$2").toLowerCase();
26104
- }
26105
- function kebabToPascal3(name) {
26106
- return name.split("-").map((part) => /^\d+$/.test(part) ? part : part.charAt(0).toUpperCase() + part.slice(1)).join("");
26107
- }
26108
- var ICON_ITEMS, IconPicker;
26109
- var init_IconPicker = __esm({
26110
- "components/core/molecules/IconPicker.tsx"() {
26111
- "use client";
26112
- init_Icon();
26113
- init_GridPicker();
26114
- ICON_ITEMS = (() => {
26115
- const items = [];
26116
- for (const [exportName, candidate] of Object.entries(LucideIcons2)) {
26117
- if (!/^[A-Z]/.test(exportName)) continue;
26118
- if (exportName.endsWith("Icon")) continue;
26119
- if (exportName.startsWith("Lucide")) continue;
26120
- const isComponent = candidate !== null && (typeof candidate === "object" || typeof candidate === "function") && "$$typeof" in candidate;
26121
- if (!isComponent) continue;
26122
- const kebab = pascalToKebab(exportName);
26123
- if (kebabToPascal3(kebab) !== exportName) continue;
26124
- items.push({ id: kebab, label: kebab, category: "icons" });
26125
- }
26126
- return items;
26127
- })();
26128
- IconPicker = ({ value, onChange, className }) => {
26129
- const items = useMemo(() => ICON_ITEMS, []);
26130
- return /* @__PURE__ */ jsx(
26131
- GridPicker,
26132
- {
26133
- items,
26134
- value,
26135
- onChange,
26136
- searchPlaceholder: "Search icons\u2026",
26137
- renderThumbnail: (it) => /* @__PURE__ */ jsx(Icon, { name: it.id }),
26138
- cellSize: 32,
26139
- className
26140
- }
26141
- );
26142
- };
26143
- IconPicker.displayName = "IconPicker";
26144
- }
26145
- });
26146
25717
  function toISODate(d) {
26147
25718
  return d.toISOString().slice(0, 10);
26148
25719
  }
@@ -26587,7 +26158,7 @@ function InventoryGrid({
26587
26158
  const eventBus = useEventBus();
26588
26159
  const slotCount = totalSlots ?? items.length;
26589
26160
  const emptySlotCount = Math.max(0, slotCount - items.length);
26590
- const handleSelect = React88.useCallback(
26161
+ const handleSelect = React84.useCallback(
26591
26162
  (id) => {
26592
26163
  onSelect?.(id);
26593
26164
  if (selectEvent) {
@@ -26804,31 +26375,31 @@ function GameCanvas2D({
26804
26375
  assetBaseUrl = "",
26805
26376
  className
26806
26377
  }) {
26807
- const canvasRef = React88.useRef(null);
26808
- const rafRef = React88.useRef(0);
26809
- const frameRef = React88.useRef(0);
26810
- const lastTimeRef = React88.useRef(0);
26811
- const imageCache = React88.useRef(/* @__PURE__ */ new Map());
26378
+ const canvasRef = React84.useRef(null);
26379
+ const rafRef = React84.useRef(0);
26380
+ const frameRef = React84.useRef(0);
26381
+ const lastTimeRef = React84.useRef(0);
26382
+ const imageCache = React84.useRef(/* @__PURE__ */ new Map());
26812
26383
  const emit = useEmitEvent();
26813
- const onDrawRef = React88.useRef(onDraw);
26384
+ const onDrawRef = React84.useRef(onDraw);
26814
26385
  onDrawRef.current = onDraw;
26815
- const onTickRef = React88.useRef(onTick);
26386
+ const onTickRef = React84.useRef(onTick);
26816
26387
  onTickRef.current = onTick;
26817
- const tickEventRef = React88.useRef(tickEvent);
26388
+ const tickEventRef = React84.useRef(tickEvent);
26818
26389
  tickEventRef.current = tickEvent;
26819
- const drawEventRef = React88.useRef(drawEvent);
26390
+ const drawEventRef = React84.useRef(drawEvent);
26820
26391
  drawEventRef.current = drawEvent;
26821
- const emitRef = React88.useRef(emit);
26392
+ const emitRef = React84.useRef(emit);
26822
26393
  emitRef.current = emit;
26823
- const assetBaseUrlRef = React88.useRef(assetBaseUrl);
26394
+ const assetBaseUrlRef = React84.useRef(assetBaseUrl);
26824
26395
  assetBaseUrlRef.current = assetBaseUrl;
26825
- const backgroundImageRef = React88.useRef(backgroundImage);
26396
+ const backgroundImageRef = React84.useRef(backgroundImage);
26826
26397
  backgroundImageRef.current = backgroundImage;
26827
- const widthRef = React88.useRef(width);
26398
+ const widthRef = React84.useRef(width);
26828
26399
  widthRef.current = width;
26829
- const heightRef = React88.useRef(height);
26400
+ const heightRef = React84.useRef(height);
26830
26401
  heightRef.current = height;
26831
- const loadImage = React88.useCallback((url) => {
26402
+ const loadImage = React84.useCallback((url) => {
26832
26403
  const fullUrl = url.startsWith("http") ? url : `${assetBaseUrlRef.current}${url}`;
26833
26404
  const cached = imageCache.current.get(fullUrl);
26834
26405
  if (cached?.complete && cached.naturalWidth > 0) return cached;
@@ -26840,7 +26411,7 @@ function GameCanvas2D({
26840
26411
  }
26841
26412
  return null;
26842
26413
  }, []);
26843
- React88.useEffect(() => {
26414
+ React84.useEffect(() => {
26844
26415
  const canvas = canvasRef.current;
26845
26416
  if (!canvas) return;
26846
26417
  const ctx = canvas.getContext("2d");
@@ -27143,7 +26714,7 @@ function TurnPanel({
27143
26714
  className
27144
26715
  }) {
27145
26716
  const eventBus = useEventBus();
27146
- const handleAction = React88.useCallback(
26717
+ const handleAction = React84.useCallback(
27147
26718
  (event) => {
27148
26719
  if (event) {
27149
26720
  eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
@@ -27289,7 +26860,7 @@ function UnitCommandBar({
27289
26860
  className
27290
26861
  }) {
27291
26862
  const eventBus = useEventBus();
27292
- const handleCommand = React88.useCallback(
26863
+ const handleCommand = React84.useCallback(
27293
26864
  (event) => {
27294
26865
  if (event) {
27295
26866
  eventBus.emit(event, { unitId: selectedUnitId });
@@ -27774,7 +27345,7 @@ function GameMenu({
27774
27345
  } catch {
27775
27346
  }
27776
27347
  const eventBus = eventBusProp || eventBusFromHook;
27777
- const handleOptionClick = React88.useCallback(
27348
+ const handleOptionClick = React84.useCallback(
27778
27349
  (option) => {
27779
27350
  if (option.event && eventBus) {
27780
27351
  eventBus.emit(`UI:${option.event}`, { option });
@@ -27888,7 +27459,7 @@ function GameOverScreen({
27888
27459
  } catch {
27889
27460
  }
27890
27461
  const eventBus = eventBusProp || eventBusFromHook;
27891
- const handleActionClick = React88.useCallback(
27462
+ const handleActionClick = React84.useCallback(
27892
27463
  (action) => {
27893
27464
  if (action.event && eventBus) {
27894
27465
  eventBus.emit(`UI:${action.event}`, { action });
@@ -28599,14 +28170,14 @@ function useSafeEventBus5() {
28599
28170
  } };
28600
28171
  }
28601
28172
  }
28602
- var sizeStyles10, LONG_PRESS_DELAY, LONG_PRESS_INTERVAL, NumberStepper;
28173
+ var sizeStyles9, LONG_PRESS_DELAY, LONG_PRESS_INTERVAL, NumberStepper;
28603
28174
  var init_NumberStepper = __esm({
28604
28175
  "components/core/molecules/NumberStepper.tsx"() {
28605
28176
  "use client";
28606
28177
  init_cn();
28607
28178
  init_Icon();
28608
28179
  init_useEventBus();
28609
- sizeStyles10 = {
28180
+ sizeStyles9 = {
28610
28181
  sm: {
28611
28182
  button: "w-7 h-7",
28612
28183
  text: "text-sm min-w-[2rem]",
@@ -28644,7 +28215,7 @@ var init_NumberStepper = __esm({
28644
28215
  const timeoutRef = useRef(null);
28645
28216
  const isAtMin = min !== void 0 && value <= min;
28646
28217
  const isAtMax = max !== void 0 && value >= max;
28647
- const styles = sizeStyles10[size];
28218
+ const styles = sizeStyles9[size];
28648
28219
  const emitChange = useCallback(
28649
28220
  (newValue) => {
28650
28221
  const clamped = Math.round(newValue / step) * step;
@@ -28785,14 +28356,14 @@ function useSafeEventBus6() {
28785
28356
  } };
28786
28357
  }
28787
28358
  }
28788
- var sizeStyles11, StarRating;
28359
+ var sizeStyles10, StarRating;
28789
28360
  var init_StarRating = __esm({
28790
28361
  "components/core/molecules/StarRating.tsx"() {
28791
28362
  "use client";
28792
28363
  init_cn();
28793
28364
  init_Icon();
28794
28365
  init_useEventBus();
28795
- sizeStyles11 = {
28366
+ sizeStyles10 = {
28796
28367
  sm: { star: "w-4 h-4", gap: "gap-0.5" },
28797
28368
  md: { star: "w-6 h-6", gap: "gap-1" },
28798
28369
  lg: { star: "w-8 h-8", gap: "gap-1.5" }
@@ -28811,7 +28382,7 @@ var init_StarRating = __esm({
28811
28382
  }) => {
28812
28383
  const [hoverValue, setHoverValue] = useState(null);
28813
28384
  const eventBus = useSafeEventBus6();
28814
- const styles = sizeStyles11[size];
28385
+ const styles = sizeStyles10[size];
28815
28386
  const displayValue = hoverValue ?? value;
28816
28387
  const emitChange = useCallback(
28817
28388
  (newValue) => {
@@ -28882,7 +28453,7 @@ var init_StarRating = __esm({
28882
28453
  name: "star",
28883
28454
  className: cn(
28884
28455
  styles.star,
28885
- "text-muted-foreground",
28456
+ "text-foreground/30",
28886
28457
  "transition-colors duration-100"
28887
28458
  ),
28888
28459
  strokeWidth: 1.5
@@ -29365,8 +28936,8 @@ function TableView({
29365
28936
  }) {
29366
28937
  const eventBus = useEventBus();
29367
28938
  const { t } = useTranslate();
29368
- const [visibleCount, setVisibleCount] = React88__default.useState(pageSize > 0 ? pageSize : Infinity);
29369
- const [localSelected, setLocalSelected] = React88__default.useState(/* @__PURE__ */ new Set());
28939
+ const [visibleCount, setVisibleCount] = React84__default.useState(pageSize > 0 ? pageSize : Infinity);
28940
+ const [localSelected, setLocalSelected] = React84__default.useState(/* @__PURE__ */ new Set());
29370
28941
  const colDefs = columns ?? fields ?? [];
29371
28942
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
29372
28943
  const dnd = useDataDnd({
@@ -29561,12 +29132,12 @@ function TableView({
29561
29132
  ]
29562
29133
  }
29563
29134
  );
29564
- return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React88__default.Fragment, { children: rowInner }, id);
29135
+ return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React84__default.Fragment, { children: rowInner }, id);
29565
29136
  };
29566
29137
  const items = data.map((row) => row);
29567
29138
  const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
29568
29139
  let runningIndex = 0;
29569
- const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React88__default.Fragment, { children: [
29140
+ const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
29570
29141
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
29571
29142
  group.items.map((row) => renderRow(row, runningIndex++))
29572
29143
  ] }, gi)) });
@@ -30918,7 +30489,7 @@ var init_StepFlow = __esm({
30918
30489
  className
30919
30490
  }) => {
30920
30491
  if (orientation === "vertical") {
30921
- return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React88__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
30492
+ return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React84__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
30922
30493
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
30923
30494
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
30924
30495
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -30929,7 +30500,7 @@ var init_StepFlow = __esm({
30929
30500
  ] })
30930
30501
  ] }) }, index)) });
30931
30502
  }
30932
- 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(React88__default.Fragment, { children: [
30503
+ 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(React84__default.Fragment, { children: [
30933
30504
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
30934
30505
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
30935
30506
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -31684,11 +31255,19 @@ function LatticeSVG({
31684
31255
  function f2(n) {
31685
31256
  return n.toFixed(2);
31686
31257
  }
31687
- var VARIANT_MAP2, EdgeDecoration;
31258
+ var colorTokenVars, VARIANT_MAP2, EdgeDecoration;
31688
31259
  var init_EdgeDecoration = __esm({
31689
31260
  "components/core/molecules/EdgeDecoration.tsx"() {
31690
31261
  "use client";
31691
31262
  init_cn();
31263
+ colorTokenVars = {
31264
+ primary: "var(--color-primary)",
31265
+ secondary: "var(--color-secondary)",
31266
+ success: "var(--color-success)",
31267
+ warning: "var(--color-warning)",
31268
+ error: "var(--color-error)",
31269
+ muted: "var(--color-muted)"
31270
+ };
31692
31271
  VARIANT_MAP2 = {
31693
31272
  arch: ArchSVG,
31694
31273
  vine: VineSVG,
@@ -31698,13 +31277,14 @@ var init_EdgeDecoration = __esm({
31698
31277
  variant = "arch",
31699
31278
  side = "both",
31700
31279
  opacity = 0.15,
31701
- color = "var(--color-primary)",
31280
+ color = "primary",
31702
31281
  strokeWidth = 0.5,
31703
31282
  width = 15,
31704
31283
  className
31705
31284
  }) => {
31706
31285
  const id = useId();
31707
31286
  const Variant = VARIANT_MAP2[variant];
31287
+ const resolvedColor = color in colorTokenVars ? colorTokenVars[color] : color;
31708
31288
  const sides = side === "both" ? ["left", "right"] : [side];
31709
31289
  return /* @__PURE__ */ jsx(Fragment, { children: sides.map((s) => /* @__PURE__ */ jsx(
31710
31290
  "svg",
@@ -31727,7 +31307,7 @@ var init_EdgeDecoration = __esm({
31727
31307
  facing: s,
31728
31308
  w: 200,
31729
31309
  h: 600,
31730
- color,
31310
+ color: resolvedColor,
31731
31311
  strokeWidth
31732
31312
  }
31733
31313
  )
@@ -31738,14 +31318,14 @@ var init_EdgeDecoration = __esm({
31738
31318
  EdgeDecoration.displayName = "EdgeDecoration";
31739
31319
  }
31740
31320
  });
31741
- var sizeStyles12, VoteStack;
31321
+ var sizeStyles11, VoteStack;
31742
31322
  var init_VoteStack = __esm({
31743
31323
  "components/core/molecules/VoteStack.tsx"() {
31744
31324
  "use client";
31745
31325
  init_cn();
31746
31326
  init_Icon();
31747
31327
  init_useEventBus();
31748
- sizeStyles12 = {
31328
+ sizeStyles11 = {
31749
31329
  sm: {
31750
31330
  button: "w-7 h-7",
31751
31331
  text: "text-sm min-w-[2rem]",
@@ -31773,7 +31353,7 @@ var init_VoteStack = __esm({
31773
31353
  className,
31774
31354
  label
31775
31355
  }) => {
31776
- const styles = sizeStyles12[size];
31356
+ const styles = sizeStyles11[size];
31777
31357
  const isUp = userVote === "up";
31778
31358
  const isDown = userVote === "down";
31779
31359
  const eventBus = useEventBus();
@@ -31905,7 +31485,7 @@ var init_LikertScale = __esm({
31905
31485
  md: "text-base",
31906
31486
  lg: "text-lg"
31907
31487
  };
31908
- LikertScale = React88__default.forwardRef(
31488
+ LikertScale = React84__default.forwardRef(
31909
31489
  ({
31910
31490
  question,
31911
31491
  options = DEFAULT_LIKERT_OPTIONS,
@@ -31917,7 +31497,7 @@ var init_LikertScale = __esm({
31917
31497
  variant = "radios",
31918
31498
  className
31919
31499
  }, ref) => {
31920
- const groupId = React88__default.useId();
31500
+ const groupId = React84__default.useId();
31921
31501
  const eventBus = useEventBus();
31922
31502
  const handleSelect = useCallback(
31923
31503
  (next) => {
@@ -32041,7 +31621,7 @@ var init_LikertScale = __esm({
32041
31621
  LikertScale.displayName = "LikertScale";
32042
31622
  }
32043
31623
  });
32044
- var DEFAULT_MATRIX_COLUMNS, sizeStyles13, MatrixQuestion;
31624
+ var DEFAULT_MATRIX_COLUMNS, sizeStyles12, MatrixQuestion;
32045
31625
  var init_MatrixQuestion = __esm({
32046
31626
  "components/core/molecules/MatrixQuestion.tsx"() {
32047
31627
  "use client";
@@ -32057,7 +31637,7 @@ var init_MatrixQuestion = __esm({
32057
31637
  { value: 4, label: "Agree" },
32058
31638
  { value: 5, label: "Strongly Agree" }
32059
31639
  ];
32060
- sizeStyles13 = {
31640
+ sizeStyles12 = {
32061
31641
  sm: {
32062
31642
  cell: "px-2 py-1.5 text-xs",
32063
31643
  radio: "sm",
@@ -32080,7 +31660,7 @@ var init_MatrixQuestion = __esm({
32080
31660
  size = "md",
32081
31661
  className
32082
31662
  }) => {
32083
- const styles = sizeStyles13[size];
31663
+ const styles = sizeStyles12[size];
32084
31664
  const safeRows = rows2 ?? [];
32085
31665
  const safeValues = values ?? {};
32086
31666
  const eventBus = useEventBus();
@@ -33067,7 +32647,6 @@ function BlockRow({
33067
32647
  onUpdate,
33068
32648
  onDelete,
33069
32649
  onDuplicate,
33070
- onInsertAfter,
33071
32650
  onChangeType
33072
32651
  }) {
33073
32652
  const { t } = useTranslate();
@@ -33343,34 +32922,16 @@ function BlockRow({
33343
32922
  "data-block-id": block.id,
33344
32923
  "data-block-type": block.type,
33345
32924
  children: [
33346
- !readOnly && showAffordances && /* @__PURE__ */ jsxs(Box, { className: "flex w-12 shrink-0 items-center gap-0.5 pt-1", children: [
33347
- /* @__PURE__ */ jsx(
33348
- Button,
33349
- {
33350
- type: "button",
33351
- variant: "ghost",
33352
- "aria-label": t("richBlockEditor.insertParagraphBelow"),
33353
- className: cn(
33354
- "inline-flex h-6 w-6 items-center justify-center rounded-sm p-0 gap-0",
33355
- "text-muted-foreground hover:bg-muted hover:text-foreground",
33356
- "opacity-0 group-hover:opacity-100 focus-visible:opacity-100",
33357
- "transition-opacity"
33358
- ),
33359
- onClick: () => onInsertAfter("paragraph"),
33360
- children: /* @__PURE__ */ jsx(Icon, { name: "plus", className: "w-3.5 h-3.5" })
33361
- }
33362
- ),
33363
- /* @__PURE__ */ jsx(
33364
- BlockMenu,
33365
- {
33366
- block,
33367
- readOnly,
33368
- onDelete,
33369
- onDuplicate,
33370
- onChangeType
33371
- }
33372
- )
33373
- ] }),
32925
+ !readOnly && showAffordances && /* @__PURE__ */ jsx(Box, { className: "flex w-8 shrink-0 items-center pt-1", children: /* @__PURE__ */ jsx(
32926
+ BlockMenu,
32927
+ {
32928
+ block,
32929
+ readOnly,
32930
+ onDelete,
32931
+ onDuplicate,
32932
+ onChangeType
32933
+ }
32934
+ ) }),
33374
32935
  /* @__PURE__ */ jsx(Box, { className: "min-w-0 flex-1", children: renderBody() })
33375
32936
  ]
33376
32937
  }
@@ -33493,12 +33054,6 @@ var init_RichBlockEditor = __esm({
33493
33054
  },
33494
33055
  [blocks, commit]
33495
33056
  );
33496
- const handleInsertAfter = useCallback(
33497
- (id, type) => {
33498
- commit(insertAfter(blocks, id, createBlock(type)));
33499
- },
33500
- [blocks, commit]
33501
- );
33502
33057
  const handleChangeType = useCallback(
33503
33058
  (id, type) => {
33504
33059
  commit(
@@ -33555,7 +33110,6 @@ var init_RichBlockEditor = __esm({
33555
33110
  onUpdate: (updater) => handleUpdate(block.id, updater),
33556
33111
  onDelete: () => handleDelete(block.id),
33557
33112
  onDuplicate: () => handleDuplicate(block.id),
33558
- onInsertAfter: (type) => handleInsertAfter(block.id, type),
33559
33113
  onChangeType: (type) => handleChangeType(block.id, type)
33560
33114
  },
33561
33115
  block.id
@@ -34225,7 +33779,7 @@ var init_DocBreadcrumb = __esm({
34225
33779
  "aria-label": t("aria.breadcrumb"),
34226
33780
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
34227
33781
  const isLast = idx === items.length - 1;
34228
- return /* @__PURE__ */ jsxs(React88__default.Fragment, { children: [
33782
+ return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
34229
33783
  idx > 0 && /* @__PURE__ */ jsx(
34230
33784
  Icon,
34231
33785
  {
@@ -34272,108 +33826,6 @@ var init_DocBreadcrumb = __esm({
34272
33826
  DocBreadcrumb.displayName = "DocBreadcrumb";
34273
33827
  }
34274
33828
  });
34275
- function DocCodeBlock({
34276
- code,
34277
- language,
34278
- title,
34279
- showLineNumbers = false,
34280
- className
34281
- }) {
34282
- const [copied, setCopied] = useState(false);
34283
- const handleCopy = useCallback(() => {
34284
- void navigator.clipboard.writeText(code).then(() => {
34285
- setCopied(true);
34286
- setTimeout(() => setCopied(false), 2e3);
34287
- });
34288
- }, [code]);
34289
- const lines = code.split("\n");
34290
- return /* @__PURE__ */ jsxs(
34291
- Box,
34292
- {
34293
- className: cn(
34294
- "rounded-container border border-border overflow-hidden",
34295
- className
34296
- ),
34297
- position: "relative",
34298
- children: [
34299
- title ? /* @__PURE__ */ jsxs(
34300
- HStack,
34301
- {
34302
- align: "center",
34303
- justify: "between",
34304
- className: "bg-muted px-4 py-2 border-b border-border",
34305
- children: [
34306
- /* @__PURE__ */ jsxs(HStack, { align: "center", gap: "sm", children: [
34307
- /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: title }),
34308
- language ? /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: language }) : null
34309
- ] }),
34310
- /* @__PURE__ */ jsx(
34311
- Button,
34312
- {
34313
- variant: "ghost",
34314
- size: "sm",
34315
- onClick: handleCopy,
34316
- leftIcon: copied ? "check" : "copy",
34317
- children: copied ? "Copied!" : "Copy"
34318
- }
34319
- )
34320
- ]
34321
- }
34322
- ) : null,
34323
- !title ? /* @__PURE__ */ jsx(Box, { position: "absolute", className: "top-2 right-2 z-10", children: /* @__PURE__ */ jsx(
34324
- Button,
34325
- {
34326
- variant: "ghost",
34327
- size: "sm",
34328
- onClick: handleCopy,
34329
- leftIcon: copied ? "check" : "copy",
34330
- children: copied ? "Copied!" : "Copy"
34331
- }
34332
- ) }) : null,
34333
- /* @__PURE__ */ jsxs(HStack, { gap: "none", className: "bg-foreground overflow-x-auto", children: [
34334
- showLineNumbers ? /* @__PURE__ */ jsx(
34335
- Box,
34336
- {
34337
- className: "py-4 pl-4 pr-3 select-none border-r border-border flex-shrink-0",
34338
- children: lines.map((_, i) => /* @__PURE__ */ jsx(
34339
- Typography,
34340
- {
34341
- variant: "caption",
34342
- color: "muted",
34343
- className: "block font-mono text-right leading-6",
34344
- as: "span",
34345
- children: i + 1
34346
- },
34347
- i
34348
- ))
34349
- }
34350
- ) : null,
34351
- /* @__PURE__ */ jsx(
34352
- Box,
34353
- {
34354
- as: "pre",
34355
- className: cn(
34356
- "p-4 font-mono text-sm text-background leading-6 flex-1 min-w-0",
34357
- !title && "pr-24"
34358
- ),
34359
- children: /* @__PURE__ */ jsx(Box, { as: "code", className: "whitespace-pre", children: code })
34360
- }
34361
- )
34362
- ] })
34363
- ]
34364
- }
34365
- );
34366
- }
34367
- var init_DocCodeBlock = __esm({
34368
- "components/core/molecules/DocCodeBlock.tsx"() {
34369
- "use client";
34370
- init_cn();
34371
- init_Box();
34372
- init_Stack();
34373
- init_Typography();
34374
- init_Button();
34375
- }
34376
- });
34377
33829
  function DocPagination({ prev, next, className }) {
34378
33830
  if (!prev && !next) return null;
34379
33831
  return /* @__PURE__ */ jsxs(
@@ -34810,17 +34262,25 @@ var init_DocTOC = __esm({
34810
34262
  DocTOC.displayName = "DocTOC";
34811
34263
  }
34812
34264
  });
34813
- var GradientDivider;
34265
+ var colorTokenVars2, GradientDivider;
34814
34266
  var init_GradientDivider = __esm({
34815
34267
  "components/core/molecules/GradientDivider.tsx"() {
34816
34268
  "use client";
34817
34269
  init_cn();
34818
34270
  init_Box();
34271
+ colorTokenVars2 = {
34272
+ primary: "var(--color-primary)",
34273
+ secondary: "var(--color-secondary)",
34274
+ success: "var(--color-success)",
34275
+ warning: "var(--color-warning)",
34276
+ error: "var(--color-error)",
34277
+ muted: "var(--color-muted)"
34278
+ };
34819
34279
  GradientDivider = ({
34820
34280
  color,
34821
34281
  className
34822
34282
  }) => {
34823
- const centerColor = color ?? "var(--color-primary)";
34283
+ const centerColor = color ? color in colorTokenVars2 ? colorTokenVars2[color] : color : "var(--color-primary)";
34824
34284
  return /* @__PURE__ */ jsx(
34825
34285
  Box,
34826
34286
  {
@@ -35189,7 +34649,7 @@ var init_MiniStateMachine = __esm({
35189
34649
  const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
35190
34650
  const tc = transitionCounts[s.name] ?? 0;
35191
34651
  const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
35192
- return /* @__PURE__ */ jsxs(React88__default.Fragment, { children: [
34652
+ return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
35193
34653
  /* @__PURE__ */ jsx(
35194
34654
  AvlState,
35195
34655
  {
@@ -35393,7 +34853,7 @@ var init_PageHeader = __esm({
35393
34853
  info: "bg-info/10 text-info"
35394
34854
  };
35395
34855
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
35396
- 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(React88__default.Fragment, { children: [
34856
+ 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(React84__default.Fragment, { children: [
35397
34857
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
35398
34858
  crumb.href ? /* @__PURE__ */ jsx(
35399
34859
  "a",
@@ -35480,271 +34940,6 @@ var init_PageHeader = __esm({
35480
34940
  PageHeader.displayName = "PageHeader";
35481
34941
  }
35482
34942
  });
35483
- var FormSection, FormLayout, FormActions;
35484
- var init_FormSection = __esm({
35485
- "components/core/molecules/FormSection.tsx"() {
35486
- "use client";
35487
- init_cn();
35488
- init_atoms2();
35489
- init_Box();
35490
- init_Typography();
35491
- init_Button();
35492
- init_Stack();
35493
- init_Icon();
35494
- init_useEventBus();
35495
- FormSection = ({
35496
- title,
35497
- description,
35498
- children,
35499
- collapsible = false,
35500
- defaultCollapsed = false,
35501
- card = false,
35502
- columns = 1,
35503
- className
35504
- }) => {
35505
- const [collapsed, setCollapsed] = React88__default.useState(defaultCollapsed);
35506
- const { t } = useTranslate();
35507
- const eventBus = useEventBus();
35508
- const gridClass = {
35509
- 1: "grid-cols-1",
35510
- 2: "grid-cols-1 md:grid-cols-2",
35511
- 3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
35512
- }[columns];
35513
- React88__default.useCallback(() => {
35514
- if (collapsible) {
35515
- setCollapsed((prev) => !prev);
35516
- eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
35517
- }
35518
- }, [collapsible, collapsed, eventBus]);
35519
- const content = /* @__PURE__ */ jsxs(Fragment, { children: [
35520
- (title || description) && /* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "mb-4", children: [
35521
- title && /* @__PURE__ */ jsxs(
35522
- HStack,
35523
- {
35524
- justify: "between",
35525
- align: "center",
35526
- className: cn(collapsible && "cursor-pointer"),
35527
- action: collapsible ? "TOGGLE_COLLAPSE" : void 0,
35528
- children: [
35529
- /* @__PURE__ */ jsx(Typography, { variant: "h3", weight: "semibold", children: title }),
35530
- collapsible && /* @__PURE__ */ jsx(
35531
- Button,
35532
- {
35533
- variant: "ghost",
35534
- size: "sm",
35535
- action: "TOGGLE_COLLAPSE",
35536
- children: /* @__PURE__ */ jsx(
35537
- Icon,
35538
- {
35539
- icon: ChevronDown,
35540
- size: "sm",
35541
- className: cn(
35542
- "text-muted-foreground transition-transform",
35543
- collapsed && "rotate-180"
35544
- )
35545
- }
35546
- )
35547
- }
35548
- )
35549
- ]
35550
- }
35551
- ),
35552
- description && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "secondary", children: description })
35553
- ] }),
35554
- (!collapsible || !collapsed) && /* @__PURE__ */ jsx(Box, { className: cn("grid gap-4", gridClass), children })
35555
- ] });
35556
- if (card) {
35557
- return /* @__PURE__ */ jsx(Card, { className: cn("p-6", className), children: content });
35558
- }
35559
- return /* @__PURE__ */ jsx(Box, { className, children: content });
35560
- };
35561
- FormSection.displayName = "FormSection";
35562
- FormLayout = ({
35563
- children,
35564
- dividers = true,
35565
- className
35566
- }) => {
35567
- return /* @__PURE__ */ jsx(
35568
- VStack,
35569
- {
35570
- gap: "lg",
35571
- className: cn(
35572
- dividers && "[&>*+*]:pt-8 [&>*+*]:border-t [&>*+*]:border-border",
35573
- className
35574
- ),
35575
- children
35576
- }
35577
- );
35578
- };
35579
- FormLayout.displayName = "FormLayout";
35580
- FormActions = ({
35581
- children,
35582
- sticky = false,
35583
- align = "right",
35584
- className
35585
- }) => {
35586
- const alignClass2 = {
35587
- left: "justify-start",
35588
- right: "justify-end",
35589
- between: "justify-between",
35590
- center: "justify-center"
35591
- }[align];
35592
- return /* @__PURE__ */ jsx(
35593
- HStack,
35594
- {
35595
- gap: "sm",
35596
- align: "center",
35597
- className: cn(
35598
- "pt-6 border-t border-border",
35599
- alignClass2,
35600
- sticky && "sticky bottom-0 bg-card py-4 -mx-6 px-6 shadow-[0_-4px_6px_-1px_rgb(0,0,0,0.05)]",
35601
- className
35602
- ),
35603
- children
35604
- }
35605
- );
35606
- };
35607
- FormActions.displayName = "FormActions";
35608
- }
35609
- });
35610
- function currentValue(decl, override) {
35611
- return override !== void 0 ? override : decl.default;
35612
- }
35613
- function TextLikeControl({
35614
- field,
35615
- numeric,
35616
- value,
35617
- onCommit
35618
- }) {
35619
- const initial = value === void 0 || value === null ? "" : String(value);
35620
- const [draft, setDraft] = React88__default.useState(initial);
35621
- React88__default.useEffect(() => setDraft(initial), [initial]);
35622
- const commit = () => {
35623
- if (numeric) {
35624
- const n = draft.trim() === "" ? 0 : Number(draft);
35625
- onCommit(field, Number.isNaN(n) ? 0 : n);
35626
- } else {
35627
- onCommit(field, draft);
35628
- }
35629
- };
35630
- return /* @__PURE__ */ jsx(
35631
- Input,
35632
- {
35633
- inputType: numeric ? "number" : "text",
35634
- value: draft,
35635
- onChange: (e) => setDraft(e.target.value),
35636
- onBlur: commit,
35637
- onKeyDown: (e) => {
35638
- if (e.key === "Enter") commit();
35639
- }
35640
- }
35641
- );
35642
- }
35643
- function FieldControl({
35644
- name,
35645
- decl,
35646
- value,
35647
- onChange,
35648
- assets
35649
- }) {
35650
- let control;
35651
- const stringValue = typeof value === "string" ? value : void 0;
35652
- if (decl.type === "icon") {
35653
- control = /* @__PURE__ */ jsx(IconPicker, { value: stringValue, onChange: (icon) => onChange(name, icon) });
35654
- } else if (decl.type === "asset") {
35655
- control = /* @__PURE__ */ jsx(
35656
- AssetPicker,
35657
- {
35658
- assets: assets ?? [],
35659
- value: stringValue,
35660
- onChange: (url) => onChange(name, url)
35661
- }
35662
- );
35663
- } else if (decl.type === "boolean") {
35664
- control = /* @__PURE__ */ jsx(Switch, { checked: value === true, onChange: (c) => onChange(name, c) });
35665
- } else if (decl.type === "string" && decl.values !== void 0 && decl.values.length > 0) {
35666
- control = /* @__PURE__ */ jsx(
35667
- Select,
35668
- {
35669
- options: decl.values.map((v) => ({ value: v, label: v })),
35670
- value: typeof value === "string" ? value : "",
35671
- onChange: (e) => onChange(name, e.target.value)
35672
- }
35673
- );
35674
- } else if (decl.type === "number") {
35675
- control = /* @__PURE__ */ jsx(TextLikeControl, { field: name, numeric: true, value, onCommit: onChange });
35676
- } else if (decl.type === "string") {
35677
- control = /* @__PURE__ */ jsx(TextLikeControl, { field: name, numeric: false, value, onCommit: onChange });
35678
- } else {
35679
- control = /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", children: [
35680
- decl.type,
35681
- " \u2014 edit in source"
35682
- ] });
35683
- }
35684
- return /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
35685
- /* @__PURE__ */ jsx(Typography, { variant: "label", children: decl.label ?? name }),
35686
- control,
35687
- decl.description !== void 0 && decl.description !== "" && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: decl.description })
35688
- ] });
35689
- }
35690
- var TIER_ORDER, PropertyInspector;
35691
- var init_PropertyInspector = __esm({
35692
- "components/core/molecules/PropertyInspector.tsx"() {
35693
- "use client";
35694
- init_cn();
35695
- init_Stack();
35696
- init_Typography();
35697
- init_Button();
35698
- init_Switch();
35699
- init_Select();
35700
- init_Input();
35701
- init_FormSection();
35702
- init_IconPicker();
35703
- init_AssetPicker();
35704
- TIER_ORDER = ["presentation", "domain", "policy", "infra", "internal"];
35705
- PropertyInspector = ({
35706
- config,
35707
- values,
35708
- onChange,
35709
- onReset,
35710
- title,
35711
- className,
35712
- assets
35713
- }) => {
35714
- const fields = Object.entries(config);
35715
- const byTier = /* @__PURE__ */ new Map();
35716
- for (const [name, decl] of fields) {
35717
- const tier = decl.tier ?? "presentation";
35718
- const arr = byTier.get(tier) ?? [];
35719
- arr.push([name, decl]);
35720
- byTier.set(tier, arr);
35721
- }
35722
- const tiers = [...byTier.keys()].sort((a, b) => {
35723
- const ia = TIER_ORDER.indexOf(a);
35724
- const ib = TIER_ORDER.indexOf(b);
35725
- return (ia === -1 ? 99 : ia) - (ib === -1 ? 99 : ib);
35726
- });
35727
- return /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: cn("w-full", className), children: [
35728
- /* @__PURE__ */ jsxs(HStack, { justify: "between", align: "center", children: [
35729
- /* @__PURE__ */ jsx(Typography, { variant: "caption", weight: "bold", children: title ?? "Config" }),
35730
- onReset !== void 0 && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", icon: "rotate-ccw", label: "Reset", onClick: onReset })
35731
- ] }),
35732
- fields.length === 0 && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: "No configurable properties." }),
35733
- 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(
35734
- FieldControl,
35735
- {
35736
- name,
35737
- decl,
35738
- value: currentValue(decl, values?.[name]),
35739
- onChange,
35740
- assets
35741
- },
35742
- name
35743
- )) }) }, tier))
35744
- ] });
35745
- };
35746
- }
35747
- });
35748
34943
  var lookStyles8, Header;
35749
34944
  var init_Header = __esm({
35750
34945
  "components/core/molecules/Header.tsx"() {
@@ -36395,7 +35590,7 @@ var init_WizardContainer = __esm({
36395
35590
  const isCompleted = index < currentStep;
36396
35591
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
36397
35592
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
36398
- return /* @__PURE__ */ jsxs(React88__default.Fragment, { children: [
35593
+ return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
36399
35594
  /* @__PURE__ */ jsx(
36400
35595
  Button,
36401
35596
  {
@@ -38680,7 +37875,7 @@ var init_DetailPanel = __esm({
38680
37875
  }
38681
37876
  });
38682
37877
  function extractTitle(children) {
38683
- if (!React88__default.isValidElement(children)) return void 0;
37878
+ if (!React84__default.isValidElement(children)) return void 0;
38684
37879
  const props = children.props;
38685
37880
  if (typeof props.title === "string") {
38686
37881
  return props.title;
@@ -38735,7 +37930,7 @@ function LinearView({
38735
37930
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
38736
37931
  const isDone = i < currentIdx;
38737
37932
  const isCurrent = i === currentIdx;
38738
- return /* @__PURE__ */ jsxs(React88__default.Fragment, { children: [
37933
+ return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
38739
37934
  i > 0 && /* @__PURE__ */ jsx(
38740
37935
  Typography,
38741
37936
  {
@@ -39693,12 +38888,12 @@ var init_Form = __esm({
39693
38888
  const isSchemaEntity = isOrbitalEntitySchema(entity);
39694
38889
  const resolvedEntity = isSchemaEntity ? entity : void 0;
39695
38890
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
39696
- const normalizedInitialData = React88__default.useMemo(() => {
38891
+ const normalizedInitialData = React84__default.useMemo(() => {
39697
38892
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
39698
38893
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
39699
38894
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
39700
38895
  }, [entity, initialData]);
39701
- const entityDerivedFields = React88__default.useMemo(() => {
38896
+ const entityDerivedFields = React84__default.useMemo(() => {
39702
38897
  if (fields && fields.length > 0) return void 0;
39703
38898
  if (!resolvedEntity) return void 0;
39704
38899
  return resolvedEntity.fields.map(
@@ -39718,16 +38913,16 @@ var init_Form = __esm({
39718
38913
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
39719
38914
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
39720
38915
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
39721
- const [formData, setFormData] = React88__default.useState(
38916
+ const [formData, setFormData] = React84__default.useState(
39722
38917
  normalizedInitialData
39723
38918
  );
39724
- const [collapsedSections, setCollapsedSections] = React88__default.useState(
38919
+ const [collapsedSections, setCollapsedSections] = React84__default.useState(
39725
38920
  /* @__PURE__ */ new Set()
39726
38921
  );
39727
- const [submitError, setSubmitError] = React88__default.useState(null);
39728
- const formRef = React88__default.useRef(null);
38922
+ const [submitError, setSubmitError] = React84__default.useState(null);
38923
+ const formRef = React84__default.useRef(null);
39729
38924
  const formMode = props.mode;
39730
- const mountedRef = React88__default.useRef(false);
38925
+ const mountedRef = React84__default.useRef(false);
39731
38926
  if (!mountedRef.current) {
39732
38927
  mountedRef.current = true;
39733
38928
  debug("forms", "mount", {
@@ -39740,7 +38935,7 @@ var init_Form = __esm({
39740
38935
  });
39741
38936
  }
39742
38937
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
39743
- const evalContext = React88__default.useMemo(
38938
+ const evalContext = React84__default.useMemo(
39744
38939
  () => ({
39745
38940
  formValues: formData,
39746
38941
  globalVariables: externalContext?.globalVariables ?? {},
@@ -39749,7 +38944,7 @@ var init_Form = __esm({
39749
38944
  }),
39750
38945
  [formData, externalContext]
39751
38946
  );
39752
- React88__default.useEffect(() => {
38947
+ React84__default.useEffect(() => {
39753
38948
  debug("forms", "initialData-sync", {
39754
38949
  mode: formMode,
39755
38950
  normalizedInitialData,
@@ -39760,7 +38955,7 @@ var init_Form = __esm({
39760
38955
  setFormData(normalizedInitialData);
39761
38956
  }
39762
38957
  }, [normalizedInitialData]);
39763
- const processCalculations = React88__default.useCallback(
38958
+ const processCalculations = React84__default.useCallback(
39764
38959
  (changedFieldId, newFormData) => {
39765
38960
  if (!hiddenCalculations.length) return;
39766
38961
  const context = {
@@ -39785,7 +38980,7 @@ var init_Form = __esm({
39785
38980
  },
39786
38981
  [hiddenCalculations, externalContext, eventBus]
39787
38982
  );
39788
- const checkViolations = React88__default.useCallback(
38983
+ const checkViolations = React84__default.useCallback(
39789
38984
  (changedFieldId, newFormData) => {
39790
38985
  if (!violationTriggers.length) return;
39791
38986
  const context = {
@@ -39823,7 +39018,7 @@ var init_Form = __esm({
39823
39018
  processCalculations(name, newFormData);
39824
39019
  checkViolations(name, newFormData);
39825
39020
  };
39826
- const isFieldVisible = React88__default.useCallback(
39021
+ const isFieldVisible = React84__default.useCallback(
39827
39022
  (fieldName) => {
39828
39023
  const condition = conditionalFields[fieldName];
39829
39024
  if (!condition) return true;
@@ -39831,7 +39026,7 @@ var init_Form = __esm({
39831
39026
  },
39832
39027
  [conditionalFields, evalContext]
39833
39028
  );
39834
- const isSectionVisible = React88__default.useCallback(
39029
+ const isSectionVisible = React84__default.useCallback(
39835
39030
  (section) => {
39836
39031
  if (!section.condition) return true;
39837
39032
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -39907,7 +39102,7 @@ var init_Form = __esm({
39907
39102
  eventBus.emit(`UI:${onCancel}`);
39908
39103
  }
39909
39104
  };
39910
- const renderField = React88__default.useCallback(
39105
+ const renderField = React84__default.useCallback(
39911
39106
  (field) => {
39912
39107
  const fieldName = field.name || field.field;
39913
39108
  if (!fieldName) return null;
@@ -39916,19 +39111,19 @@ var init_Form = __esm({
39916
39111
  }
39917
39112
  const inputType = determineInputType(field);
39918
39113
  const label = field.label || fieldName.charAt(0).toUpperCase() + fieldName.slice(1).replace(/([A-Z])/g, " $1");
39919
- const currentValue2 = formData[fieldName] ?? field.defaultValue ?? "";
39114
+ const currentValue = formData[fieldName] ?? field.defaultValue ?? "";
39920
39115
  return /* @__PURE__ */ jsxs(VStack, { gap: "xs", "data-field": fieldName, children: [
39921
39116
  inputType !== "checkbox" && /* @__PURE__ */ jsxs(Typography, { as: "label", variant: "label", weight: "bold", children: [
39922
39117
  label,
39923
39118
  field.required && /* @__PURE__ */ jsx(Typography, { as: "span", color: "error", className: "ml-1", children: "*" })
39924
39119
  ] }),
39925
- renderFieldInput(field, fieldName, inputType, currentValue2, label)
39120
+ renderFieldInput(field, fieldName, inputType, currentValue, label)
39926
39121
  ] }, fieldName);
39927
39122
  },
39928
39123
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
39929
39124
  );
39930
39125
  const effectiveFields = entityDerivedFields ?? fields;
39931
- const normalizedFields = React88__default.useMemo(() => {
39126
+ const normalizedFields = React84__default.useMemo(() => {
39932
39127
  if (!effectiveFields || effectiveFields.length === 0) return [];
39933
39128
  return effectiveFields.map((field) => {
39934
39129
  if (typeof field === "string") {
@@ -39951,7 +39146,7 @@ var init_Form = __esm({
39951
39146
  return field;
39952
39147
  });
39953
39148
  }, [effectiveFields, resolvedEntity]);
39954
- const schemaFields = React88__default.useMemo(() => {
39149
+ const schemaFields = React84__default.useMemo(() => {
39955
39150
  if (normalizedFields.length === 0) return null;
39956
39151
  if (isDebugEnabled()) {
39957
39152
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -39961,7 +39156,7 @@ var init_Form = __esm({
39961
39156
  }
39962
39157
  return normalizedFields.map(renderField).filter(Boolean);
39963
39158
  }, [normalizedFields, renderField, entityName, conditionalFields]);
39964
- const sectionElements = React88__default.useMemo(() => {
39159
+ const sectionElements = React84__default.useMemo(() => {
39965
39160
  if (!sections || sections.length === 0) return null;
39966
39161
  return sections.map((section) => {
39967
39162
  if (!isSectionVisible(section)) {
@@ -39997,7 +39192,7 @@ var init_Form = __esm({
39997
39192
  ] }, section.id);
39998
39193
  }).filter(Boolean);
39999
39194
  }, [sections, isSectionVisible, collapsedSections, renderField, gap]);
40000
- function renderFieldInput(field, fieldName, inputType, currentValue2, label) {
39195
+ function renderFieldInput(field, fieldName, inputType, currentValue, label) {
40001
39196
  const commonProps = {
40002
39197
  id: fieldName,
40003
39198
  name: fieldName,
@@ -40014,7 +39209,7 @@ var init_Form = __esm({
40014
39209
  {
40015
39210
  ...commonProps,
40016
39211
  label: label + (field.required ? " *" : ""),
40017
- checked: Boolean(currentValue2),
39212
+ checked: Boolean(currentValue),
40018
39213
  onChange: (e) => handleChange(fieldName, e.target.checked)
40019
39214
  }
40020
39215
  );
@@ -40023,7 +39218,7 @@ var init_Form = __esm({
40023
39218
  Textarea,
40024
39219
  {
40025
39220
  ...commonProps,
40026
- value: String(currentValue2),
39221
+ value: String(currentValue),
40027
39222
  onChange: (e) => handleChange(fieldName, e.target.value),
40028
39223
  minLength: field.min,
40029
39224
  maxLength: field.max
@@ -40036,7 +39231,7 @@ var init_Form = __esm({
40036
39231
  {
40037
39232
  ...commonProps,
40038
39233
  options,
40039
- value: String(currentValue2),
39234
+ value: String(currentValue),
40040
39235
  onChange: (e) => handleChange(fieldName, e.target.value),
40041
39236
  placeholder: field.placeholder || `Select ${label}...`
40042
39237
  }
@@ -40049,7 +39244,7 @@ var init_Form = __esm({
40049
39244
  RelationSelect,
40050
39245
  {
40051
39246
  ...commonProps,
40052
- value: currentValue2 ? String(currentValue2) : void 0,
39247
+ value: currentValue ? String(currentValue) : void 0,
40053
39248
  onChange: (value) => handleChange(fieldName, value),
40054
39249
  options: relationOptions,
40055
39250
  isLoading: relationLoading,
@@ -40065,7 +39260,7 @@ var init_Form = __esm({
40065
39260
  {
40066
39261
  ...commonProps,
40067
39262
  type: "number",
40068
- value: currentValue2 !== void 0 && currentValue2 !== "" ? String(currentValue2) : "",
39263
+ value: currentValue !== void 0 && currentValue !== "" ? String(currentValue) : "",
40069
39264
  onChange: (e) => handleChange(
40070
39265
  fieldName,
40071
39266
  e.target.value ? Number(e.target.value) : void 0
@@ -40080,7 +39275,7 @@ var init_Form = __esm({
40080
39275
  {
40081
39276
  ...commonProps,
40082
39277
  type: "date",
40083
- value: formatDateValue(currentValue2),
39278
+ value: formatDateValue(currentValue),
40084
39279
  onChange: (e) => handleChange(fieldName, e.target.value)
40085
39280
  }
40086
39281
  );
@@ -40090,7 +39285,7 @@ var init_Form = __esm({
40090
39285
  {
40091
39286
  ...commonProps,
40092
39287
  type: "datetime-local",
40093
- value: formatDateTimeValue(currentValue2),
39288
+ value: formatDateTimeValue(currentValue),
40094
39289
  onChange: (e) => handleChange(fieldName, e.target.value)
40095
39290
  }
40096
39291
  );
@@ -40100,7 +39295,7 @@ var init_Form = __esm({
40100
39295
  {
40101
39296
  ...commonProps,
40102
39297
  type: "email",
40103
- value: String(currentValue2),
39298
+ value: String(currentValue),
40104
39299
  onChange: (e) => handleChange(fieldName, e.target.value),
40105
39300
  minLength: field.min,
40106
39301
  maxLength: field.max
@@ -40112,7 +39307,7 @@ var init_Form = __esm({
40112
39307
  {
40113
39308
  ...commonProps,
40114
39309
  type: "url",
40115
- value: String(currentValue2),
39310
+ value: String(currentValue),
40116
39311
  onChange: (e) => handleChange(fieldName, e.target.value),
40117
39312
  minLength: field.min,
40118
39313
  maxLength: field.max
@@ -40124,7 +39319,7 @@ var init_Form = __esm({
40124
39319
  {
40125
39320
  ...commonProps,
40126
39321
  type: "password",
40127
- value: String(currentValue2),
39322
+ value: String(currentValue),
40128
39323
  onChange: (e) => handleChange(fieldName, e.target.value),
40129
39324
  minLength: field.min,
40130
39325
  maxLength: field.max
@@ -40137,7 +39332,7 @@ var init_Form = __esm({
40137
39332
  {
40138
39333
  ...commonProps,
40139
39334
  type: "text",
40140
- value: String(currentValue2),
39335
+ value: String(currentValue),
40141
39336
  onChange: (e) => handleChange(fieldName, e.target.value),
40142
39337
  minLength: field.min,
40143
39338
  maxLength: field.max
@@ -41236,7 +40431,7 @@ var init_List = __esm({
41236
40431
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
41237
40432
  return [];
41238
40433
  }, [entity]);
41239
- const getItemActions = React88__default.useCallback(
40434
+ const getItemActions = React84__default.useCallback(
41240
40435
  (item) => {
41241
40436
  if (!itemActions) return [];
41242
40437
  if (typeof itemActions === "function") {
@@ -41712,7 +40907,7 @@ var init_MediaGallery = __esm({
41712
40907
  [selectable, selectedItems, selectionEvent, eventBus]
41713
40908
  );
41714
40909
  const entityData = Array.isArray(entity) ? entity : [];
41715
- const items = React88__default.useMemo(() => {
40910
+ const items = React84__default.useMemo(() => {
41716
40911
  if (propItems) return propItems;
41717
40912
  if (entityData.length === 0) return [];
41718
40913
  return entityData.map((record, idx) => ({
@@ -41873,7 +41068,7 @@ var init_MediaGallery = __esm({
41873
41068
  }
41874
41069
  });
41875
41070
  function extractTitle2(children) {
41876
- if (!React88__default.isValidElement(children)) return void 0;
41071
+ if (!React84__default.isValidElement(children)) return void 0;
41877
41072
  const props = children.props;
41878
41073
  if (typeof props.title === "string") {
41879
41074
  return props.title;
@@ -42304,7 +41499,7 @@ var init_debugRegistry = __esm({
42304
41499
  }
42305
41500
  });
42306
41501
  function useDebugData() {
42307
- const [data, setData] = React88.useState(() => ({
41502
+ const [data, setData] = React84.useState(() => ({
42308
41503
  traits: [],
42309
41504
  ticks: [],
42310
41505
  guards: [],
@@ -42318,7 +41513,7 @@ function useDebugData() {
42318
41513
  },
42319
41514
  lastUpdate: Date.now()
42320
41515
  }));
42321
- React88.useEffect(() => {
41516
+ React84.useEffect(() => {
42322
41517
  const updateData = () => {
42323
41518
  setData({
42324
41519
  traits: getAllTraits(),
@@ -42427,12 +41622,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
42427
41622
  return positions;
42428
41623
  }
42429
41624
  function WalkMinimap() {
42430
- const [walkStep, setWalkStep] = React88.useState(null);
42431
- const [traits2, setTraits] = React88.useState([]);
42432
- const [coveredEdges, setCoveredEdges] = React88.useState([]);
42433
- const [completedTraits, setCompletedTraits] = React88.useState(/* @__PURE__ */ new Set());
42434
- const prevTraitRef = React88.useRef(null);
42435
- React88.useEffect(() => {
41625
+ const [walkStep, setWalkStep] = React84.useState(null);
41626
+ const [traits2, setTraits] = React84.useState([]);
41627
+ const [coveredEdges, setCoveredEdges] = React84.useState([]);
41628
+ const [completedTraits, setCompletedTraits] = React84.useState(/* @__PURE__ */ new Set());
41629
+ const prevTraitRef = React84.useRef(null);
41630
+ React84.useEffect(() => {
42436
41631
  const interval = setInterval(() => {
42437
41632
  const w = window;
42438
41633
  const step = w.__orbitalWalkStep;
@@ -42868,15 +42063,15 @@ var init_EntitiesTab = __esm({
42868
42063
  });
42869
42064
  function EventFlowTab({ events: events2 }) {
42870
42065
  const { t } = useTranslate();
42871
- const [filter, setFilter] = React88.useState("all");
42872
- const containerRef = React88.useRef(null);
42873
- const [autoScroll, setAutoScroll] = React88.useState(true);
42874
- React88.useEffect(() => {
42066
+ const [filter, setFilter] = React84.useState("all");
42067
+ const containerRef = React84.useRef(null);
42068
+ const [autoScroll, setAutoScroll] = React84.useState(true);
42069
+ React84.useEffect(() => {
42875
42070
  if (autoScroll && containerRef.current) {
42876
42071
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
42877
42072
  }
42878
42073
  }, [events2.length, autoScroll]);
42879
- const filteredEvents = React88.useMemo(() => {
42074
+ const filteredEvents = React84.useMemo(() => {
42880
42075
  if (filter === "all") return events2;
42881
42076
  return events2.filter((e) => e.type === filter);
42882
42077
  }, [events2, filter]);
@@ -42992,7 +42187,7 @@ var init_EventFlowTab = __esm({
42992
42187
  });
42993
42188
  function GuardsPanel({ guards }) {
42994
42189
  const { t } = useTranslate();
42995
- const [filter, setFilter] = React88.useState("all");
42190
+ const [filter, setFilter] = React84.useState("all");
42996
42191
  if (guards.length === 0) {
42997
42192
  return /* @__PURE__ */ jsx(
42998
42193
  EmptyState,
@@ -43005,7 +42200,7 @@ function GuardsPanel({ guards }) {
43005
42200
  }
43006
42201
  const passedCount = guards.filter((g) => g.result).length;
43007
42202
  const failedCount = guards.length - passedCount;
43008
- const filteredGuards = React88.useMemo(() => {
42203
+ const filteredGuards = React84.useMemo(() => {
43009
42204
  if (filter === "all") return guards;
43010
42205
  if (filter === "passed") return guards.filter((g) => g.result);
43011
42206
  return guards.filter((g) => !g.result);
@@ -43168,10 +42363,10 @@ function EffectBadge({ effect }) {
43168
42363
  }
43169
42364
  function TransitionTimeline({ transitions }) {
43170
42365
  const { t } = useTranslate();
43171
- const containerRef = React88.useRef(null);
43172
- const [autoScroll, setAutoScroll] = React88.useState(true);
43173
- const [expandedId, setExpandedId] = React88.useState(null);
43174
- React88.useEffect(() => {
42366
+ const containerRef = React84.useRef(null);
42367
+ const [autoScroll, setAutoScroll] = React84.useState(true);
42368
+ const [expandedId, setExpandedId] = React84.useState(null);
42369
+ React84.useEffect(() => {
43175
42370
  if (autoScroll && containerRef.current) {
43176
42371
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
43177
42372
  }
@@ -43451,9 +42646,9 @@ function getAllEvents(traits2) {
43451
42646
  function EventDispatcherTab({ traits: traits2, schema }) {
43452
42647
  const eventBus = useEventBus();
43453
42648
  const { t } = useTranslate();
43454
- const [log12, setLog] = React88.useState([]);
43455
- const prevStatesRef = React88.useRef(/* @__PURE__ */ new Map());
43456
- React88.useEffect(() => {
42649
+ const [log12, setLog] = React84.useState([]);
42650
+ const prevStatesRef = React84.useRef(/* @__PURE__ */ new Map());
42651
+ React84.useEffect(() => {
43457
42652
  for (const trait of traits2) {
43458
42653
  const prev = prevStatesRef.current.get(trait.id);
43459
42654
  if (prev && prev !== trait.currentState) {
@@ -43622,10 +42817,10 @@ function VerifyModePanel({
43622
42817
  localCount
43623
42818
  }) {
43624
42819
  const { t } = useTranslate();
43625
- const [expanded, setExpanded] = React88.useState(true);
43626
- const scrollRef = React88.useRef(null);
43627
- const prevCountRef = React88.useRef(0);
43628
- React88.useEffect(() => {
42820
+ const [expanded, setExpanded] = React84.useState(true);
42821
+ const scrollRef = React84.useRef(null);
42822
+ const prevCountRef = React84.useRef(0);
42823
+ React84.useEffect(() => {
43629
42824
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
43630
42825
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
43631
42826
  }
@@ -43682,10 +42877,10 @@ function RuntimeDebugger({
43682
42877
  schema
43683
42878
  }) {
43684
42879
  const { t } = useTranslate();
43685
- const [isCollapsed, setIsCollapsed] = React88.useState(mode === "verify" ? true : defaultCollapsed);
43686
- const [isVisible, setIsVisible] = React88.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
42880
+ const [isCollapsed, setIsCollapsed] = React84.useState(mode === "verify" ? true : defaultCollapsed);
42881
+ const [isVisible, setIsVisible] = React84.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
43687
42882
  const debugData = useDebugData();
43688
- React88.useEffect(() => {
42883
+ React84.useEffect(() => {
43689
42884
  if (mode === "inline") return;
43690
42885
  return onDebugToggle((enabled) => {
43691
42886
  setIsVisible(enabled);
@@ -43694,7 +42889,7 @@ function RuntimeDebugger({
43694
42889
  }
43695
42890
  });
43696
42891
  }, [mode]);
43697
- React88.useEffect(() => {
42892
+ React84.useEffect(() => {
43698
42893
  if (mode === "inline") return;
43699
42894
  const handleKeyDown = (e) => {
43700
42895
  if (e.key === "`" && isVisible) {
@@ -44143,7 +43338,7 @@ function SequenceBar({
44143
43338
  onSlotRemove(index);
44144
43339
  }, [onSlotRemove, playing]);
44145
43340
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
44146
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React88__default.Fragment, { children: [
43341
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
44147
43342
  i > 0 && /* @__PURE__ */ jsx(
44148
43343
  Typography,
44149
43344
  {
@@ -45101,7 +44296,7 @@ var init_StatCard = __esm({
45101
44296
  title: propTitle,
45102
44297
  value: propValue,
45103
44298
  previousValue,
45104
- currentValue: currentValue2,
44299
+ currentValue,
45105
44300
  trend: manualTrend,
45106
44301
  trendDirection: manualDirection,
45107
44302
  invertTrend = false,
@@ -45122,7 +44317,7 @@ var init_StatCard = __esm({
45122
44317
  const labelToUse = propLabel ?? propTitle;
45123
44318
  const eventBus = useEventBus();
45124
44319
  const { t } = useTranslate();
45125
- const handleActionClick = React88__default.useCallback(() => {
44320
+ const handleActionClick = React84__default.useCallback(() => {
45126
44321
  if (action?.event) {
45127
44322
  eventBus.emit(`UI:${action.event}`, {});
45128
44323
  }
@@ -45133,7 +44328,7 @@ var init_StatCard = __esm({
45133
44328
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
45134
44329
  const isLoading = externalLoading ?? false;
45135
44330
  const error = externalError;
45136
- const computeMetricValue = React88__default.useCallback(
44331
+ const computeMetricValue = React84__default.useCallback(
45137
44332
  (metric, items) => {
45138
44333
  if (metric.value !== void 0) {
45139
44334
  return metric.value;
@@ -45172,7 +44367,7 @@ var init_StatCard = __esm({
45172
44367
  },
45173
44368
  []
45174
44369
  );
45175
- const schemaStats = React88__default.useMemo(() => {
44370
+ const schemaStats = React84__default.useMemo(() => {
45176
44371
  if (!metrics || metrics.length === 0) return null;
45177
44372
  return metrics.map((metric) => ({
45178
44373
  label: metric.label,
@@ -45180,13 +44375,13 @@ var init_StatCard = __esm({
45180
44375
  format: metric.format
45181
44376
  }));
45182
44377
  }, [metrics, data, computeMetricValue]);
45183
- const calculatedTrend = React88__default.useMemo(() => {
44378
+ const calculatedTrend = React84__default.useMemo(() => {
45184
44379
  if (manualTrend !== void 0) return manualTrend;
45185
- if (previousValue === void 0 || currentValue2 === void 0)
44380
+ if (previousValue === void 0 || currentValue === void 0)
45186
44381
  return void 0;
45187
- if (previousValue === 0) return currentValue2 > 0 ? 100 : 0;
45188
- return (currentValue2 - previousValue) / previousValue * 100;
45189
- }, [manualTrend, previousValue, currentValue2]);
44382
+ if (previousValue === 0) return currentValue > 0 ? 100 : 0;
44383
+ return (currentValue - previousValue) / previousValue * 100;
44384
+ }, [manualTrend, previousValue, currentValue]);
45190
44385
  if (schemaStats && schemaStats.length > 1) {
45191
44386
  if (isLoading) {
45192
44387
  return /* @__PURE__ */ jsx(
@@ -45461,6 +44656,37 @@ var init_VariablePanel = __esm({
45461
44656
  VariablePanel.displayName = "VariablePanel";
45462
44657
  }
45463
44658
  });
44659
+ function StateJsonView({
44660
+ data,
44661
+ label,
44662
+ defaultExpanded = false,
44663
+ className
44664
+ }) {
44665
+ const { t } = useTranslate();
44666
+ const [expanded, setExpanded] = useState(defaultExpanded);
44667
+ const jsonString = JSON.stringify(data, null, 2);
44668
+ return /* @__PURE__ */ jsxs(VStack, { className: cn("rounded-lg border border-border overflow-hidden", className), gap: "none", children: [
44669
+ /* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between p-2 bg-muted", gap: "sm", children: [
44670
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground font-medium", children: label ?? t("stateArchitect.viewCode") }),
44671
+ /* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: () => setExpanded(!expanded), className: "text-xs", children: expanded ? t("stateArchitect.hideJson") : t("stateArchitect.showJson") })
44672
+ ] }),
44673
+ expanded && /* @__PURE__ */ jsx(Box, { className: "p-3 bg-background overflow-x-auto", children: /* @__PURE__ */ jsx(
44674
+ Typography,
44675
+ {
44676
+ variant: "caption",
44677
+ className: "text-foreground font-mono whitespace-pre text-xs leading-relaxed block",
44678
+ children: jsonString
44679
+ }
44680
+ ) })
44681
+ ] });
44682
+ }
44683
+ var init_StateJsonView = __esm({
44684
+ "components/game/organisms/puzzles/state-architect/StateJsonView.tsx"() {
44685
+ init_atoms2();
44686
+ init_cn();
44687
+ StateJsonView.displayName = "StateJsonView";
44688
+ }
44689
+ });
45464
44690
  function layoutStates(states, width, height) {
45465
44691
  const cx = width / 2;
45466
44692
  const cy = height / 2;
@@ -45752,7 +44978,7 @@ function StateArchitectBoard({
45752
44978
  !r.passed && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-error", children: t("stateArchitect.gotState", { state: r.actualState }) })
45753
44979
  ] }, i))
45754
44980
  ] }),
45755
- resolved.showCodeView !== false && /* @__PURE__ */ jsx(CodeView, { data: codeData, label: "View Code" })
44981
+ resolved.showCodeView !== false && /* @__PURE__ */ jsx(StateJsonView, { data: codeData, label: "View Code" })
45756
44982
  ] })
45757
44983
  ] }),
45758
44984
  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") }) }),
@@ -45789,7 +45015,7 @@ var init_StateArchitectBoard = __esm({
45789
45015
  init_StateNode();
45790
45016
  init_TransitionArrow();
45791
45017
  init_VariablePanel();
45792
- init_CodeView();
45018
+ init_StateJsonView();
45793
45019
  init_boardEntity();
45794
45020
  ENCOURAGEMENT_KEYS3 = [
45795
45021
  "puzzle.tryAgain1",
@@ -46114,7 +45340,7 @@ var init_Timeline = __esm({
46114
45340
  }) => {
46115
45341
  const { t } = useTranslate();
46116
45342
  const entityData = Array.isArray(entity) ? entity : [];
46117
- const items = React88__default.useMemo(() => {
45343
+ const items = React84__default.useMemo(() => {
46118
45344
  if (propItems) return propItems;
46119
45345
  if (entityData.length === 0) return [];
46120
45346
  return entityData.map((record, idx) => {
@@ -46221,7 +45447,7 @@ var init_Timeline = __esm({
46221
45447
  }
46222
45448
  });
46223
45449
  function extractToastProps(children) {
46224
- if (!React88__default.isValidElement(children)) {
45450
+ if (!React84__default.isValidElement(children)) {
46225
45451
  if (typeof children === "string") {
46226
45452
  return { message: children };
46227
45453
  }
@@ -46259,7 +45485,7 @@ var init_ToastSlot = __esm({
46259
45485
  eventBus.emit("UI:CLOSE");
46260
45486
  };
46261
45487
  if (!isVisible) return null;
46262
- const isCustomContent = React88__default.isValidElement(children) && !message;
45488
+ const isCustomContent = React84__default.isValidElement(children) && !message;
46263
45489
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
46264
45490
  Toast,
46265
45491
  {
@@ -46769,12 +45995,12 @@ var init_WorldMapTemplate = __esm({
46769
45995
  }
46770
45996
  });
46771
45997
  function lazyThree(name, loader) {
46772
- const Lazy = React88__default.lazy(() => loader().then((m) => ({ default: m[name] })));
45998
+ const Lazy = React84__default.lazy(() => loader().then((m) => ({ default: m[name] })));
46773
45999
  function ThreeWrapper(props) {
46774
- return React88__default.createElement(
46775
- React88__default.Suspense,
46000
+ return React84__default.createElement(
46001
+ React84__default.Suspense,
46776
46002
  { fallback: null },
46777
- React88__default.createElement(Lazy, props)
46003
+ React84__default.createElement(Lazy, props)
46778
46004
  );
46779
46005
  }
46780
46006
  ThreeWrapper.displayName = `Lazy(${name})`;
@@ -46794,7 +46020,6 @@ var init_component_registry_generated = __esm({
46794
46020
  init_AnimatedReveal();
46795
46021
  init_ArticleSection();
46796
46022
  init_Aside();
46797
- init_AssetPicker();
46798
46023
  init_AuthLayout();
46799
46024
  init_BattleBoard();
46800
46025
  init_BattleTemplate();
@@ -46823,8 +46048,6 @@ var init_component_registry_generated = __esm({
46823
46048
  init_ChoiceButton();
46824
46049
  init_ClassifierBoard();
46825
46050
  init_CodeBlock();
46826
- init_CodeView();
46827
- init_CodeViewer();
46828
46051
  init_CombatLog();
46829
46052
  init_ComboCounter();
46830
46053
  init_CommunityLinks();
@@ -46852,7 +46075,6 @@ var init_component_registry_generated = __esm({
46852
46075
  init_DialogueBox();
46853
46076
  init_DialogueBubble();
46854
46077
  init_DocBreadcrumb();
46855
- init_DocCodeBlock();
46856
46078
  init_DocPagination();
46857
46079
  init_DocSearch();
46858
46080
  init_DocSidebar();
@@ -46894,13 +46116,11 @@ var init_component_registry_generated = __esm({
46894
46116
  init_GradientDivider();
46895
46117
  init_GraphCanvas();
46896
46118
  init_GraphView();
46897
- init_GridPicker();
46898
46119
  init_Header();
46899
46120
  init_HealthBar();
46900
46121
  init_HealthPanel();
46901
46122
  init_HeroOrganism();
46902
46123
  init_HeroSection();
46903
- init_IconPicker();
46904
46124
  init_InfiniteScrollSentinel();
46905
46125
  init_InputGroup();
46906
46126
  init_InstallBox();
@@ -46945,7 +46165,6 @@ var init_component_registry_generated = __esm({
46945
46165
  init_PricingOrganism();
46946
46166
  init_PricingPageTemplate();
46947
46167
  init_ProgressDots();
46948
- init_PropertyInspector();
46949
46168
  init_PullQuote();
46950
46169
  init_PullToRefresh();
46951
46170
  init_QrScanner();
@@ -47069,7 +46288,6 @@ var init_component_registry_generated = __esm({
47069
46288
  "AnimatedReveal": AnimatedReveal,
47070
46289
  "ArticleSection": ArticleSection,
47071
46290
  "Aside": Aside,
47072
- "AssetPicker": AssetPicker,
47073
46291
  "AuthLayout": AuthLayout,
47074
46292
  "Avatar": AvatarPattern,
47075
46293
  "AvatarPattern": AvatarPattern,
@@ -47111,8 +46329,6 @@ var init_component_registry_generated = __esm({
47111
46329
  "ChoiceButton": ChoiceButton,
47112
46330
  "ClassifierBoard": ClassifierBoard,
47113
46331
  "CodeBlock": CodeBlock,
47114
- "CodeView": CodeView,
47115
- "CodeViewer": CodeViewer,
47116
46332
  "CombatLog": CombatLog,
47117
46333
  "ComboCounter": ComboCounter,
47118
46334
  "CommunityLinks": CommunityLinks,
@@ -47144,7 +46360,6 @@ var init_component_registry_generated = __esm({
47144
46360
  "Divider": DividerPattern,
47145
46361
  "DividerPattern": DividerPattern,
47146
46362
  "DocBreadcrumb": DocBreadcrumb,
47147
- "DocCodeBlock": DocCodeBlock,
47148
46363
  "DocPagination": DocPagination,
47149
46364
  "DocSearch": DocSearch,
47150
46365
  "DocSidebar": DocSidebar,
@@ -47189,7 +46404,6 @@ var init_component_registry_generated = __esm({
47189
46404
  "GraphView": GraphView,
47190
46405
  "Grid": GridPattern,
47191
46406
  "GridPattern": GridPattern,
47192
- "GridPicker": GridPicker,
47193
46407
  "HStack": HStackPattern,
47194
46408
  "HStackPattern": HStackPattern,
47195
46409
  "Header": Header,
@@ -47199,7 +46413,6 @@ var init_component_registry_generated = __esm({
47199
46413
  "HeroSection": HeroSection,
47200
46414
  "Icon": IconPattern,
47201
46415
  "IconPattern": IconPattern,
47202
- "IconPicker": IconPicker,
47203
46416
  "InfiniteScrollSentinel": InfiniteScrollSentinel,
47204
46417
  "Input": InputPattern,
47205
46418
  "InputGroup": InputGroup,
@@ -47256,7 +46469,6 @@ var init_component_registry_generated = __esm({
47256
46469
  "ProgressBar": ProgressBarPattern,
47257
46470
  "ProgressBarPattern": ProgressBarPattern,
47258
46471
  "ProgressDots": ProgressDots,
47259
- "PropertyInspector": PropertyInspector,
47260
46472
  "PullQuote": PullQuote,
47261
46473
  "PullToRefresh": PullToRefresh,
47262
46474
  "QrScanner": QrScanner,
@@ -47398,7 +46610,7 @@ function SuspenseConfigProvider({
47398
46610
  config,
47399
46611
  children
47400
46612
  }) {
47401
- return React88__default.createElement(
46613
+ return React84__default.createElement(
47402
46614
  SuspenseConfigContext.Provider,
47403
46615
  { value: config },
47404
46616
  children
@@ -47888,7 +47100,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
47888
47100
  const key = `${parentId}-${index}-trait:${traitName}`;
47889
47101
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
47890
47102
  }
47891
- return /* @__PURE__ */ jsx(React88__default.Fragment, { children: child }, `${parentId}-${index}`);
47103
+ return /* @__PURE__ */ jsx(React84__default.Fragment, { children: child }, `${parentId}-${index}`);
47892
47104
  }
47893
47105
  if (!child || typeof child !== "object") return null;
47894
47106
  const childId = `${parentId}-${index}`;
@@ -47928,14 +47140,14 @@ function isPatternConfig(value) {
47928
47140
  if (value === null || value === void 0) return false;
47929
47141
  if (typeof value !== "object") return false;
47930
47142
  if (Array.isArray(value)) return false;
47931
- if (React88__default.isValidElement(value)) return false;
47143
+ if (React84__default.isValidElement(value)) return false;
47932
47144
  if (value instanceof Date) return false;
47933
47145
  if (typeof value === "function") return false;
47934
47146
  const record = value;
47935
47147
  return "type" in record && typeof record.type === "string";
47936
47148
  }
47937
47149
  function isPlainConfigObject(value) {
47938
- if (React88__default.isValidElement(value)) return false;
47150
+ if (React84__default.isValidElement(value)) return false;
47939
47151
  if (value instanceof Date) return false;
47940
47152
  const proto = Object.getPrototypeOf(value);
47941
47153
  return proto === Object.prototype || proto === null;
@@ -48345,7 +47557,7 @@ function resolveLambdaBindings(body, params, item, index) {
48345
47557
  if (Array.isArray(body)) {
48346
47558
  return body.map((b) => recur(b));
48347
47559
  }
48348
- if (body !== null && typeof body === "object" && !React88__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
47560
+ if (body !== null && typeof body === "object" && !React84__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
48349
47561
  const out = {};
48350
47562
  for (const [k, v] of Object.entries(body)) {
48351
47563
  out[k] = recur(v);
@@ -48364,7 +47576,7 @@ function getSlotContentRenderer2() {
48364
47576
  function makeLambdaFn(params, lambdaBody, callerKey) {
48365
47577
  return (item, index) => {
48366
47578
  const resolvedBody = resolveLambdaBindings(lambdaBody, params, item, index);
48367
- if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React88__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
47579
+ if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React84__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
48368
47580
  return null;
48369
47581
  }
48370
47582
  const record = resolvedBody;
@@ -48383,7 +47595,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
48383
47595
  props: childProps,
48384
47596
  priority: 0
48385
47597
  };
48386
- return React88__default.createElement(SlotContentRenderer2, { content: childContent });
47598
+ return React84__default.createElement(SlotContentRenderer2, { content: childContent });
48387
47599
  };
48388
47600
  }
48389
47601
  function convertNode(node, callerKey) {
@@ -48402,7 +47614,7 @@ function convertNode(node, callerKey) {
48402
47614
  });
48403
47615
  return anyChanged ? mapped : node;
48404
47616
  }
48405
- if (typeof node === "object" && !React88__default.isValidElement(node) && !(node instanceof Date)) {
47617
+ if (typeof node === "object" && !React84__default.isValidElement(node) && !(node instanceof Date)) {
48406
47618
  return convertObjectProps(node);
48407
47619
  }
48408
47620
  return node;