@almadar/ui 5.138.0 → 5.140.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/avl/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import * as React92 from 'react';
3
- import React92__default, { createContext, useState, useMemo, useRef, useEffect, useContext, useCallback, Suspense, useLayoutEffect, Profiler, useReducer, useSyncExternalStore, lazy, useId } from 'react';
2
+ import * as React93 from 'react';
3
+ import React93__default, { createContext, useState, useMemo, useRef, useEffect, useContext, useCallback, Suspense, useLayoutEffect, Profiler, useReducer, useSyncExternalStore, lazy, useId } from 'react';
4
4
  import { getAllPages, matchPathAmong, OrbitalProvider, EventBusContext, useTraitScopeChain, ServerBridgeProvider, VerificationProvider, EntitySchemaProvider, OrbitalThemeProvider, useServerBridge, EntityBindingContext, useEntitySchema, useEntitySchemaOptional, useEntityBindingSnapshot, TraitScopeProvider, useTraitScope, useCurrentPagePath, useGameAudioContextOptional } from '@almadar/ui/providers';
5
5
  import { createLogger, setNamespaceLevel, isLogLevelEnabled } from '@almadar/logger';
6
6
  import ELK from 'elkjs/lib/elk.bundled.js';
@@ -3301,7 +3301,7 @@ var init_Typography = __esm({
3301
3301
  if (format !== void 0 && format !== "none" && (typeof body === "string" || typeof body === "number" || body instanceof Date)) {
3302
3302
  body = formatValue(body, format);
3303
3303
  }
3304
- return React92__default.createElement(
3304
+ return React93__default.createElement(
3305
3305
  Component,
3306
3306
  {
3307
3307
  id,
@@ -3647,7 +3647,7 @@ var init_Box = __esm({
3647
3647
  fixed: "fixed",
3648
3648
  sticky: "sticky"
3649
3649
  };
3650
- Box = React92__default.forwardRef(
3650
+ Box = React93__default.forwardRef(
3651
3651
  ({
3652
3652
  padding,
3653
3653
  paddingX,
@@ -3712,7 +3712,7 @@ var init_Box = __esm({
3712
3712
  onPointerDown?.(e);
3713
3713
  }, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
3714
3714
  const isClickable = action || onClick;
3715
- return React92__default.createElement(
3715
+ return React93__default.createElement(
3716
3716
  Component,
3717
3717
  {
3718
3718
  ref,
@@ -3808,7 +3808,7 @@ var init_Stack = __esm({
3808
3808
  };
3809
3809
  const isHorizontal = direction === "horizontal";
3810
3810
  const directionClass = responsive && isHorizontal ? reverse ? "flex-col-reverse md:flex-row-reverse" : "flex-col md:flex-row" : isHorizontal ? reverse ? "flex-row-reverse" : "flex-row" : reverse ? "flex-col-reverse" : "flex-col";
3811
- return React92__default.createElement(
3811
+ return React93__default.createElement(
3812
3812
  Component,
3813
3813
  {
3814
3814
  className: cn(
@@ -4300,7 +4300,7 @@ var init_MiniStateMachine = __esm({
4300
4300
  const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
4301
4301
  const tc = transitionCounts[s.name] ?? 0;
4302
4302
  const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
4303
- return /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
4303
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
4304
4304
  /* @__PURE__ */ jsx(
4305
4305
  AvlState,
4306
4306
  {
@@ -4583,7 +4583,7 @@ function resolveMarkerExpression(expression, entity, config, state) {
4583
4583
  function isPlainObject(value) {
4584
4584
  if (value === null || value === void 0 || typeof value !== "object") return false;
4585
4585
  if (Array.isArray(value)) return false;
4586
- if (React92__default.isValidElement(value)) return false;
4586
+ if (React93__default.isValidElement(value)) return false;
4587
4587
  if (value instanceof Date) return false;
4588
4588
  if (typeof value === "function") return false;
4589
4589
  return true;
@@ -4820,7 +4820,7 @@ var init_Icon = __esm({
4820
4820
  const effectiveName = typeof icon === "string" && icon !== "" ? icon : name;
4821
4821
  const effectiveStrokeWidth = strokeWidth != null && strokeWidth > 0 ? strokeWidth : void 0;
4822
4822
  const family = useIconFamily();
4823
- const RenderedComponent = React92__default.useMemo(() => {
4823
+ const RenderedComponent = React93__default.useMemo(() => {
4824
4824
  if (directIcon) return null;
4825
4825
  return effectiveName ? resolveIconForFamily(effectiveName) : null;
4826
4826
  }, [directIcon, effectiveName, family]);
@@ -4944,7 +4944,7 @@ var init_atlasSlice = __esm({
4944
4944
  }
4945
4945
  });
4946
4946
  function useAtlasSliceDataUrl(asset) {
4947
- const [, bump] = React92.useReducer((x) => x + 1, 0);
4947
+ const [, bump] = React93.useReducer((x) => x + 1, 0);
4948
4948
  if (!isAtlasAsset(asset)) return void 0;
4949
4949
  const key = `${asset.atlas}#${asset.sprite}`;
4950
4950
  const cached = sliceDataUrlCache.get(key);
@@ -5007,13 +5007,13 @@ function AtlasImage({
5007
5007
  style,
5008
5008
  "aria-hidden": ariaHidden
5009
5009
  }) {
5010
- const [, bump] = React92.useReducer((x) => x + 1, 0);
5011
- const canvasRef = React92.useRef(null);
5010
+ const [, bump] = React93.useReducer((x) => x + 1, 0);
5011
+ const canvasRef = React93.useRef(null);
5012
5012
  const sliced = isAtlasAsset(asset);
5013
5013
  const atlas = sliced ? getAtlas(asset.atlas, bump) : void 0;
5014
5014
  const img = sliced && asset?.url ? getSheetImage(asset.url, bump) : null;
5015
5015
  const rect = sliced && atlas ? subRectFor(atlas, asset.sprite) : null;
5016
- React92.useEffect(() => {
5016
+ React93.useEffect(() => {
5017
5017
  const canvas = canvasRef.current;
5018
5018
  if (!canvas || !img || !rect) return;
5019
5019
  canvas.width = rect.sw;
@@ -5089,7 +5089,7 @@ function resolveIconProp(value, sizeClass) {
5089
5089
  const IconComp = value;
5090
5090
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
5091
5091
  }
5092
- if (React92__default.isValidElement(value)) {
5092
+ if (React93__default.isValidElement(value)) {
5093
5093
  return value;
5094
5094
  }
5095
5095
  if (typeof value === "object" && value !== null && isIconLike(value)) {
@@ -5166,7 +5166,7 @@ var init_Button = __esm({
5166
5166
  md: "h-icon-default w-icon-default",
5167
5167
  lg: "h-icon-default w-icon-default"
5168
5168
  };
5169
- Button = React92__default.forwardRef(
5169
+ Button = React93__default.forwardRef(
5170
5170
  ({
5171
5171
  className,
5172
5172
  variant = "primary",
@@ -5236,7 +5236,7 @@ var Dialog;
5236
5236
  var init_Dialog = __esm({
5237
5237
  "components/core/atoms/Dialog.tsx"() {
5238
5238
  init_cn();
5239
- Dialog = React92__default.forwardRef(
5239
+ Dialog = React93__default.forwardRef(
5240
5240
  ({
5241
5241
  role = "dialog",
5242
5242
  "aria-modal": ariaModal = true,
@@ -5799,7 +5799,7 @@ var init_Badge = __esm({
5799
5799
  md: "px-2.5 py-1 text-sm",
5800
5800
  lg: "px-3 py-1.5 text-base"
5801
5801
  };
5802
- Badge = React92__default.forwardRef(
5802
+ Badge = React93__default.forwardRef(
5803
5803
  ({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
5804
5804
  const iconSizes3 = {
5805
5805
  sm: "h-icon-default w-icon-default",
@@ -6149,7 +6149,7 @@ var init_SvgFlow = __esm({
6149
6149
  width = 100,
6150
6150
  height = 100
6151
6151
  }) => {
6152
- const markerId = React92__default.useMemo(() => {
6152
+ const markerId = React93__default.useMemo(() => {
6153
6153
  flowIdCounter += 1;
6154
6154
  return `almadar-flow-arrow-${flowIdCounter}`;
6155
6155
  }, []);
@@ -6742,7 +6742,7 @@ var init_SvgRing = __esm({
6742
6742
  width = 100,
6743
6743
  height = 100
6744
6744
  }) => {
6745
- const gradientId = React92__default.useMemo(() => {
6745
+ const gradientId = React93__default.useMemo(() => {
6746
6746
  ringIdCounter += 1;
6747
6747
  return `almadar-ring-glow-${ringIdCounter}`;
6748
6748
  }, []);
@@ -6923,7 +6923,7 @@ var init_Input = __esm({
6923
6923
  init_cn();
6924
6924
  init_Icon();
6925
6925
  init_useEventBus();
6926
- Input = React92__default.forwardRef(
6926
+ Input = React93__default.forwardRef(
6927
6927
  ({
6928
6928
  className,
6929
6929
  inputType,
@@ -6947,9 +6947,9 @@ var init_Input = __esm({
6947
6947
  const eventBus = useEventBus();
6948
6948
  const type = inputType || htmlType || "text";
6949
6949
  const isDeclarative = typeof onChange === "string";
6950
- const [localValue, setLocalValue] = React92__default.useState(value);
6951
- const pendingEchoRef = React92__default.useRef(/* @__PURE__ */ new Set());
6952
- React92__default.useEffect(() => {
6950
+ const [localValue, setLocalValue] = React93__default.useState(value);
6951
+ const pendingEchoRef = React93__default.useRef(/* @__PURE__ */ new Set());
6952
+ React93__default.useEffect(() => {
6953
6953
  if (!isDeclarative) return;
6954
6954
  const incoming = value == null ? "" : String(value);
6955
6955
  if (pendingEchoRef.current.has(incoming)) {
@@ -7109,7 +7109,7 @@ var Label;
7109
7109
  var init_Label = __esm({
7110
7110
  "components/core/atoms/Label.tsx"() {
7111
7111
  init_cn();
7112
- Label = React92__default.forwardRef(
7112
+ Label = React93__default.forwardRef(
7113
7113
  ({ className, required, children, ...props }, ref) => {
7114
7114
  return /* @__PURE__ */ jsxs(
7115
7115
  "label",
@@ -7136,7 +7136,7 @@ var init_Textarea = __esm({
7136
7136
  "components/core/atoms/Textarea.tsx"() {
7137
7137
  init_cn();
7138
7138
  init_useEventBus();
7139
- Textarea = React92__default.forwardRef(
7139
+ Textarea = React93__default.forwardRef(
7140
7140
  ({ className, error, onChange, ...props }, ref) => {
7141
7141
  const eventBus = useEventBus();
7142
7142
  const handleChange = (e) => {
@@ -7375,7 +7375,7 @@ var init_Select = __esm({
7375
7375
  init_cn();
7376
7376
  init_Icon();
7377
7377
  init_useEventBus();
7378
- Select = React92__default.forwardRef(
7378
+ Select = React93__default.forwardRef(
7379
7379
  (props, _ref) => {
7380
7380
  const { multiple, searchable, clearable } = props;
7381
7381
  if (multiple || searchable || clearable) {
@@ -7392,7 +7392,7 @@ var init_Checkbox = __esm({
7392
7392
  "components/core/atoms/Checkbox.tsx"() {
7393
7393
  init_cn();
7394
7394
  init_useEventBus();
7395
- Checkbox = React92__default.forwardRef(
7395
+ Checkbox = React93__default.forwardRef(
7396
7396
  ({ className, label, id, onChange, ...props }, ref) => {
7397
7397
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
7398
7398
  const eventBus = useEventBus();
@@ -7446,7 +7446,7 @@ var init_Spinner = __esm({
7446
7446
  md: "h-6 w-6",
7447
7447
  lg: "h-8 w-8"
7448
7448
  };
7449
- Spinner = React92__default.forwardRef(
7449
+ Spinner = React93__default.forwardRef(
7450
7450
  ({ className, size = "md", overlay, ...props }, ref) => {
7451
7451
  if (overlay) {
7452
7452
  return /* @__PURE__ */ jsx(
@@ -7536,7 +7536,7 @@ var init_Card = __esm({
7536
7536
  chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
7537
7537
  "tile-image-first": "p-0 overflow-hidden"
7538
7538
  };
7539
- Card = React92__default.forwardRef(
7539
+ Card = React93__default.forwardRef(
7540
7540
  ({
7541
7541
  className,
7542
7542
  variant = "bordered",
@@ -7585,9 +7585,9 @@ var init_Card = __esm({
7585
7585
  }
7586
7586
  );
7587
7587
  Card.displayName = "Card";
7588
- CardHeader = React92__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
7588
+ CardHeader = React93__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
7589
7589
  CardHeader.displayName = "CardHeader";
7590
- CardTitle = React92__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7590
+ CardTitle = React93__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7591
7591
  "h3",
7592
7592
  {
7593
7593
  ref,
@@ -7600,11 +7600,11 @@ var init_Card = __esm({
7600
7600
  }
7601
7601
  ));
7602
7602
  CardTitle.displayName = "CardTitle";
7603
- CardContent = React92__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
7603
+ CardContent = React93__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
7604
7604
  CardContent.displayName = "CardContent";
7605
7605
  CardBody = CardContent;
7606
7606
  CardBody.displayName = "CardBody";
7607
- CardFooter = React92__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7607
+ CardFooter = React93__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7608
7608
  "div",
7609
7609
  {
7610
7610
  ref,
@@ -7691,7 +7691,7 @@ var init_FilterPill = __esm({
7691
7691
  md: "w-3.5 h-3.5",
7692
7692
  lg: "w-4 h-4"
7693
7693
  };
7694
- FilterPill = React92__default.forwardRef(
7694
+ FilterPill = React93__default.forwardRef(
7695
7695
  ({
7696
7696
  className,
7697
7697
  variant = "default",
@@ -7820,8 +7820,8 @@ var init_Avatar = __esm({
7820
7820
  actionPayload
7821
7821
  }) => {
7822
7822
  const eventBus = useEventBus();
7823
- const [imgFailed, setImgFailed] = React92__default.useState(false);
7824
- React92__default.useEffect(() => {
7823
+ const [imgFailed, setImgFailed] = React93__default.useState(false);
7824
+ React93__default.useEffect(() => {
7825
7825
  setImgFailed(false);
7826
7826
  }, [src]);
7827
7827
  const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
@@ -7934,7 +7934,7 @@ var init_Center = __esm({
7934
7934
  as: Component = "div"
7935
7935
  }) => {
7936
7936
  const mergedStyle = minHeight ? { minHeight, ...style } : style;
7937
- return React92__default.createElement(Component, {
7937
+ return React93__default.createElement(Component, {
7938
7938
  className: cn(
7939
7939
  inline ? "inline-flex" : "flex",
7940
7940
  horizontal && "justify-center",
@@ -8202,7 +8202,7 @@ var init_Radio = __esm({
8202
8202
  md: "w-2.5 h-2.5",
8203
8203
  lg: "w-3 h-3"
8204
8204
  };
8205
- Radio = React92__default.forwardRef(
8205
+ Radio = React93__default.forwardRef(
8206
8206
  ({
8207
8207
  label,
8208
8208
  helperText,
@@ -8219,12 +8219,12 @@ var init_Radio = __esm({
8219
8219
  onChange,
8220
8220
  ...props
8221
8221
  }, ref) => {
8222
- const reactId = React92__default.useId();
8222
+ const reactId = React93__default.useId();
8223
8223
  const baseId = id || `radio-${reactId}`;
8224
8224
  const hasError = !!error;
8225
8225
  const eventBus = useEventBus();
8226
- const [selected, setSelected] = React92__default.useState(value);
8227
- React92__default.useEffect(() => {
8226
+ const [selected, setSelected] = React93__default.useState(value);
8227
+ React93__default.useEffect(() => {
8228
8228
  if (value !== void 0) setSelected(value);
8229
8229
  }, [value]);
8230
8230
  const pick = (next, e) => {
@@ -8406,7 +8406,7 @@ var init_Switch = __esm({
8406
8406
  "components/core/atoms/Switch.tsx"() {
8407
8407
  "use client";
8408
8408
  init_cn();
8409
- Switch = React92.forwardRef(
8409
+ Switch = React93.forwardRef(
8410
8410
  ({
8411
8411
  checked,
8412
8412
  defaultChecked = false,
@@ -8417,10 +8417,10 @@ var init_Switch = __esm({
8417
8417
  name,
8418
8418
  className
8419
8419
  }, ref) => {
8420
- const [isChecked, setIsChecked] = React92.useState(
8420
+ const [isChecked, setIsChecked] = React93.useState(
8421
8421
  checked !== void 0 ? checked : defaultChecked
8422
8422
  );
8423
- React92.useEffect(() => {
8423
+ React93.useEffect(() => {
8424
8424
  if (checked !== void 0) {
8425
8425
  setIsChecked(checked);
8426
8426
  }
@@ -8698,7 +8698,7 @@ var Aside;
8698
8698
  var init_Aside = __esm({
8699
8699
  "components/core/atoms/Aside.tsx"() {
8700
8700
  init_cn();
8701
- Aside = React92__default.forwardRef(
8701
+ Aside = React93__default.forwardRef(
8702
8702
  ({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
8703
8703
  );
8704
8704
  Aside.displayName = "Aside";
@@ -8777,9 +8777,9 @@ var init_LawReferenceTooltip = __esm({
8777
8777
  className
8778
8778
  }) => {
8779
8779
  const { t } = useTranslate();
8780
- const [isVisible, setIsVisible] = React92__default.useState(false);
8781
- const timeoutRef = React92__default.useRef(null);
8782
- const triggerRef = React92__default.useRef(null);
8780
+ const [isVisible, setIsVisible] = React93__default.useState(false);
8781
+ const timeoutRef = React93__default.useRef(null);
8782
+ const triggerRef = React93__default.useRef(null);
8783
8783
  const handleMouseEnter = () => {
8784
8784
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
8785
8785
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -8790,7 +8790,7 @@ var init_LawReferenceTooltip = __esm({
8790
8790
  };
8791
8791
  const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
8792
8792
  const open = isVisible || revealed;
8793
- React92__default.useEffect(() => {
8793
+ React93__default.useEffect(() => {
8794
8794
  return () => {
8795
8795
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
8796
8796
  };
@@ -9000,7 +9000,7 @@ var init_StatusDot = __esm({
9000
9000
  md: "w-2.5 h-2.5",
9001
9001
  lg: "w-3 h-3"
9002
9002
  };
9003
- StatusDot = React92__default.forwardRef(
9003
+ StatusDot = React93__default.forwardRef(
9004
9004
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
9005
9005
  return /* @__PURE__ */ jsx(
9006
9006
  "span",
@@ -9054,7 +9054,7 @@ var init_TrendIndicator = __esm({
9054
9054
  down: "trending-down",
9055
9055
  flat: "arrow-right"
9056
9056
  };
9057
- TrendIndicator = React92__default.forwardRef(
9057
+ TrendIndicator = React93__default.forwardRef(
9058
9058
  ({
9059
9059
  className,
9060
9060
  value,
@@ -9123,7 +9123,7 @@ var init_RangeSlider = __esm({
9123
9123
  md: "w-4 h-4",
9124
9124
  lg: "w-5 h-5"
9125
9125
  };
9126
- RangeSlider = React92__default.forwardRef(
9126
+ RangeSlider = React93__default.forwardRef(
9127
9127
  ({
9128
9128
  className,
9129
9129
  min = 0,
@@ -9734,7 +9734,7 @@ var init_ContentSection = __esm({
9734
9734
  md: "py-16",
9735
9735
  lg: "py-24"
9736
9736
  };
9737
- ContentSection = React92__default.forwardRef(
9737
+ ContentSection = React93__default.forwardRef(
9738
9738
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
9739
9739
  return /* @__PURE__ */ jsx(
9740
9740
  Box,
@@ -10268,7 +10268,7 @@ var init_AnimatedReveal = __esm({
10268
10268
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
10269
10269
  "none": {}
10270
10270
  };
10271
- AnimatedReveal = React92__default.forwardRef(
10271
+ AnimatedReveal = React93__default.forwardRef(
10272
10272
  ({
10273
10273
  trigger = "scroll",
10274
10274
  animation = "fade-up",
@@ -10428,7 +10428,7 @@ var init_AnimatedGraphic = __esm({
10428
10428
  "components/marketing/atoms/AnimatedGraphic.tsx"() {
10429
10429
  "use client";
10430
10430
  init_cn();
10431
- AnimatedGraphic = React92__default.forwardRef(
10431
+ AnimatedGraphic = React93__default.forwardRef(
10432
10432
  ({
10433
10433
  src,
10434
10434
  svgContent,
@@ -10451,7 +10451,7 @@ var init_AnimatedGraphic = __esm({
10451
10451
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
10452
10452
  const resolvedSvg = svgContent ?? fetchedSvg;
10453
10453
  const prevAnimateRef = useRef(animate);
10454
- const setRef = React92__default.useCallback(
10454
+ const setRef = React93__default.useCallback(
10455
10455
  (node) => {
10456
10456
  containerRef.current = node;
10457
10457
  if (typeof ref === "function") ref(node);
@@ -11178,9 +11178,9 @@ function ControlButton({
11178
11178
  className
11179
11179
  }) {
11180
11180
  const eventBus = useEventBus();
11181
- const [isPressed, setIsPressed] = React92.useState(false);
11181
+ const [isPressed, setIsPressed] = React93.useState(false);
11182
11182
  const actualPressed = pressed ?? isPressed;
11183
- const handlePointerDown = React92.useCallback(
11183
+ const handlePointerDown = React93.useCallback(
11184
11184
  (e) => {
11185
11185
  e.preventDefault();
11186
11186
  if (disabled) return;
@@ -11190,7 +11190,7 @@ function ControlButton({
11190
11190
  },
11191
11191
  [disabled, pressEvent, eventBus, onPress]
11192
11192
  );
11193
- const handlePointerUp = React92.useCallback(
11193
+ const handlePointerUp = React93.useCallback(
11194
11194
  (e) => {
11195
11195
  e.preventDefault();
11196
11196
  if (disabled) return;
@@ -11200,7 +11200,7 @@ function ControlButton({
11200
11200
  },
11201
11201
  [disabled, releaseEvent, eventBus, onRelease]
11202
11202
  );
11203
- const handlePointerLeave = React92.useCallback(
11203
+ const handlePointerLeave = React93.useCallback(
11204
11204
  (e) => {
11205
11205
  if (isPressed) {
11206
11206
  setIsPressed(false);
@@ -11458,8 +11458,8 @@ function ControlGrid({
11458
11458
  className
11459
11459
  }) {
11460
11460
  const eventBus = useEventBus();
11461
- const [active, setActive] = React92.useState(/* @__PURE__ */ new Set());
11462
- const handlePress = React92.useCallback(
11461
+ const [active, setActive] = React93.useState(/* @__PURE__ */ new Set());
11462
+ const handlePress = React93.useCallback(
11463
11463
  (id) => {
11464
11464
  setActive((prev) => new Set(prev).add(id));
11465
11465
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -11473,7 +11473,7 @@ function ControlGrid({
11473
11473
  },
11474
11474
  [kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
11475
11475
  );
11476
- const handleRelease = React92.useCallback(
11476
+ const handleRelease = React93.useCallback(
11477
11477
  (id) => {
11478
11478
  setActive((prev) => {
11479
11479
  const next = new Set(prev);
@@ -11831,7 +11831,7 @@ function GameMenu({
11831
11831
  }) {
11832
11832
  const resolvedOptions = (options?.length ? options : void 0) ?? (menuItems?.length ? menuItems : void 0) ?? DEFAULT_MENU_OPTIONS;
11833
11833
  const eventBus = useEventBus();
11834
- const handleOptionClick = React92.useCallback(
11834
+ const handleOptionClick = React93.useCallback(
11835
11835
  (option) => {
11836
11836
  if (option.event) {
11837
11837
  eventBus.emit(`UI:${option.event}`, { option });
@@ -12067,7 +12067,7 @@ function StateGraph({
12067
12067
  }) {
12068
12068
  const eventBus = useEventBus();
12069
12069
  const nodes = states ?? [];
12070
- const positions = React92.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
12070
+ const positions = React93.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
12071
12071
  return /* @__PURE__ */ jsxs(
12072
12072
  Box,
12073
12073
  {
@@ -12138,8 +12138,8 @@ function MiniMap({
12138
12138
  tileAssets,
12139
12139
  unitAssets
12140
12140
  }) {
12141
- const canvasRef = React92.useRef(null);
12142
- const imgCacheRef = React92.useRef(/* @__PURE__ */ new Map());
12141
+ const canvasRef = React93.useRef(null);
12142
+ const imgCacheRef = React93.useRef(/* @__PURE__ */ new Map());
12143
12143
  function loadImg(url) {
12144
12144
  const cached = imgCacheRef.current.get(url);
12145
12145
  if (cached) return cached.complete ? cached : null;
@@ -12155,7 +12155,7 @@ function MiniMap({
12155
12155
  imgCacheRef.current.set(url, img);
12156
12156
  return null;
12157
12157
  }
12158
- React92.useEffect(() => {
12158
+ React93.useEffect(() => {
12159
12159
  const canvas = canvasRef.current;
12160
12160
  if (!canvas) return;
12161
12161
  const ctx = canvas.getContext("2d");
@@ -12563,6 +12563,12 @@ function createWebPainter(ctx, onAssetLoad) {
12563
12563
  for (let i = 1; i < points.length; i++) ctx.lineTo(points[i].x, points[i].y);
12564
12564
  if (closed) ctx.closePath();
12565
12565
  };
12566
+ const toCanvasStyle = (style) => {
12567
+ if (typeof style === "string") return style;
12568
+ const g = style.kind === "linear" ? ctx.createLinearGradient(style.x1, style.y1, style.x2, style.y2) : ctx.createRadialGradient(style.cx, style.cy, 0, style.cx, style.cy, style.r);
12569
+ for (const stop of style.stops) g.addColorStop(stop.offset, stop.color);
12570
+ return g;
12571
+ };
12566
12572
  return {
12567
12573
  setViewport(width, height, dpr) {
12568
12574
  vw = width;
@@ -12616,47 +12622,47 @@ function createWebPainter(ctx, onAssetLoad) {
12616
12622
  ctx.drawImage(img, dest.x, dest.y, dw, dh);
12617
12623
  }
12618
12624
  },
12619
- fillRect(x, y, w, h, color) {
12620
- ctx.fillStyle = color;
12625
+ fillRect(x, y, w, h, style) {
12626
+ ctx.fillStyle = toCanvasStyle(style);
12621
12627
  ctx.fillRect(x, y, w, h);
12622
12628
  },
12623
- strokeRect(x, y, w, h, color, lineWidth = 1) {
12624
- ctx.strokeStyle = color;
12629
+ strokeRect(x, y, w, h, style, lineWidth = 1) {
12630
+ ctx.strokeStyle = toCanvasStyle(style);
12625
12631
  ctx.lineWidth = lineWidth;
12626
12632
  ctx.strokeRect(x, y, w, h);
12627
12633
  },
12628
- fillPoly(points, color) {
12634
+ fillPoly(points, style) {
12629
12635
  if (points.length === 0) return;
12630
12636
  tracePoly(points, true);
12631
- ctx.fillStyle = color;
12637
+ ctx.fillStyle = toCanvasStyle(style);
12632
12638
  ctx.fill();
12633
12639
  },
12634
- strokePoly(points, color, lineWidth = 1, closed = false) {
12640
+ strokePoly(points, style, lineWidth = 1, closed = false) {
12635
12641
  if (points.length === 0) return;
12636
12642
  tracePoly(points, closed);
12637
- ctx.strokeStyle = color;
12643
+ ctx.strokeStyle = toCanvasStyle(style);
12638
12644
  ctx.lineWidth = lineWidth;
12639
12645
  ctx.stroke();
12640
12646
  },
12641
- fillEllipse(cx, cy, rx, ry, color) {
12647
+ fillEllipse(cx, cy, rx, ry, style) {
12642
12648
  ctx.beginPath();
12643
12649
  ctx.ellipse(cx, cy, rx, ry, 0, 0, Math.PI * 2);
12644
- ctx.fillStyle = color;
12650
+ ctx.fillStyle = toCanvasStyle(style);
12645
12651
  ctx.fill();
12646
12652
  },
12647
- strokeEllipse(cx, cy, rx, ry, color, lineWidth = 1) {
12653
+ strokeEllipse(cx, cy, rx, ry, style, lineWidth = 1) {
12648
12654
  ctx.beginPath();
12649
12655
  ctx.ellipse(cx, cy, rx, ry, 0, 0, Math.PI * 2);
12650
- ctx.strokeStyle = color;
12656
+ ctx.strokeStyle = toCanvasStyle(style);
12651
12657
  ctx.lineWidth = lineWidth;
12652
12658
  ctx.stroke();
12653
12659
  },
12654
- fillPath(d, color) {
12655
- ctx.fillStyle = color;
12660
+ fillPath(d, style) {
12661
+ ctx.fillStyle = toCanvasStyle(style);
12656
12662
  ctx.fill(new Path2D(d));
12657
12663
  },
12658
- strokePath(d, color, lineWidth = 1) {
12659
- ctx.strokeStyle = color;
12664
+ strokePath(d, style, lineWidth = 1) {
12665
+ ctx.strokeStyle = toCanvasStyle(style);
12660
12666
  ctx.lineWidth = lineWidth;
12661
12667
  ctx.stroke(new Path2D(d));
12662
12668
  },
@@ -12730,6 +12736,21 @@ var init_projector = __esm({
12730
12736
  function isValidScenePos(pos) {
12731
12737
  return Number.isFinite(pos?.x) && Number.isFinite(pos?.y);
12732
12738
  }
12739
+ function spriteRect(projector, node, natural) {
12740
+ const tw = projector.tileWidth;
12741
+ const fallbackW = projector.worldPixelDirect ? natural?.w ?? 0 : tw;
12742
+ const fallbackH = projector.worldPixelDirect ? natural?.h ?? 0 : tw;
12743
+ const w = node.width !== void 0 ? node.width * tw : fallbackW;
12744
+ const h = node.height !== void 0 ? node.height * tw : fallbackH;
12745
+ const anchor = node.anchor ?? "top-left";
12746
+ const p = projector.anchorPoint(node.position, anchor);
12747
+ return {
12748
+ x: anchor === "top-left" ? p.x : p.x - w / 2,
12749
+ y: anchor === "ground" ? p.y - h : anchor === "center" ? p.y - h / 2 : p.y,
12750
+ w,
12751
+ h
12752
+ };
12753
+ }
12733
12754
  var init_contract = __esm({
12734
12755
  "lib/drawable/contract.ts"() {
12735
12756
  }
@@ -12744,16 +12765,11 @@ function paintFallbackSquare(painter, node, dctx, reason) {
12744
12765
  warnMissingOnce(reason, node);
12745
12766
  const tw = dctx.projector.tileWidth;
12746
12767
  const natural = dctx.projector.worldPixelDirect ? FALLBACK_WORLD_PX : tw;
12747
- const w = node.width !== void 0 ? node.width * tw : natural;
12748
- const h = node.height !== void 0 ? node.height * tw : natural;
12749
- const anchor = node.anchor ?? "top-left";
12750
- const p = dctx.projector.anchorPoint(node.position, anchor);
12751
- const dx = anchor === "top-left" ? p.x : p.x - w / 2;
12752
- const dy = anchor === "ground" ? p.y - h : anchor === "center" ? p.y - h / 2 : p.y;
12768
+ const rect = spriteRect(dctx.projector, node, { w: natural, h: natural });
12753
12769
  painter.save();
12754
12770
  if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
12755
- painter.fillRect(dx, dy, w, h, "#9b8f7f");
12756
- painter.strokeRect(dx, dy, w, h, "#5e564b", Math.max(1, tw / 32));
12771
+ painter.fillRect(rect.x, rect.y, rect.w, rect.h, "#9b8f7f");
12772
+ painter.strokeRect(rect.x, rect.y, rect.w, rect.h, "#5e564b", Math.max(1, tw / 32));
12757
12773
  painter.restore();
12758
12774
  }
12759
12775
  function DrawSprite(_props) {
@@ -12790,15 +12806,10 @@ var init_DrawSprite = __esm({
12790
12806
  }
12791
12807
  src = { x: r2.sx, y: r2.sy, w: r2.sw, h: r2.sh };
12792
12808
  }
12793
- const tw = dctx.projector.tileWidth;
12794
- const fallbackW = dctx.projector.worldPixelDirect ? src ? src.w : tex.width : tw;
12795
- const fallbackH = dctx.projector.worldPixelDirect ? src ? src.h : tex.height : tw;
12796
- const w = node.width !== void 0 ? node.width * tw : fallbackW;
12797
- const h = node.height !== void 0 ? node.height * tw : fallbackH;
12798
- const anchor = node.anchor ?? "top-left";
12799
- const p = dctx.projector.anchorPoint(node.position, anchor);
12800
- const dx = anchor === "top-left" ? p.x : p.x - w / 2;
12801
- const dy = anchor === "ground" ? p.y - h : anchor === "center" ? p.y - h / 2 : p.y;
12809
+ const rect = spriteRect(dctx.projector, node, src ? { w: src.w, h: src.h } : { w: tex.width, h: tex.height });
12810
+ const { w, h } = rect;
12811
+ const dx = rect.x;
12812
+ const dy = rect.y;
12802
12813
  painter.save();
12803
12814
  if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
12804
12815
  if (node.shadow) painter.setShadow(node.shadow);
@@ -12820,25 +12831,145 @@ var init_DrawSprite = __esm({
12820
12831
  };
12821
12832
  }
12822
12833
  });
12823
-
12824
- // components/game/atoms/DrawShape.tsx
12825
- function DrawShape(_props) {
12834
+ var DrawableRegistryContext;
12835
+ var init_registry = __esm({
12836
+ "lib/drawable/registry.ts"() {
12837
+ DrawableRegistryContext = createContext(null);
12838
+ }
12839
+ });
12840
+ function isAnimatedShape(node) {
12841
+ return Boolean(node.animation && node.animation.durationMs > 0 && node.animation.keyframes.length > 0);
12842
+ }
12843
+ function applyShapeAnimation(node, timeMs) {
12844
+ const anim = node.animation;
12845
+ if (!anim || !(anim.durationMs > 0) || anim.keyframes.length === 0) return node;
12846
+ const frames = [...anim.keyframes].sort((a, b) => a.at - b.at);
12847
+ const cycle = timeMs / anim.durationMs;
12848
+ const t = anim.loop === false ? Math.min(cycle, 1) : cycle - Math.floor(cycle);
12849
+ const out = { ...node };
12850
+ const trackValue = (key) => {
12851
+ const defined = frames.filter((f3) => f3[key] !== void 0);
12852
+ if (defined.length === 0) return void 0;
12853
+ let prev;
12854
+ let next;
12855
+ for (const f3 of defined) {
12856
+ if (f3.at <= t) prev = f3;
12857
+ else if (!next) next = f3;
12858
+ }
12859
+ if (!prev) return defined[0][key];
12860
+ if (!next) return prev[key];
12861
+ const span = next.at - prev.at;
12862
+ const k = span > 0 ? (t - prev.at) / span : 1;
12863
+ const a = prev[key];
12864
+ const b = next[key];
12865
+ if (typeof a === "number" && typeof b === "number") return lerp(a, b, k);
12866
+ return a;
12867
+ };
12868
+ for (const key of NUMERIC_TRACKS) {
12869
+ const v = trackValue(key);
12870
+ if (v !== void 0) out[key] = v;
12871
+ }
12872
+ const fill = trackValue("fill");
12873
+ if (fill !== void 0) out.fill = fill;
12874
+ const stroke = trackValue("stroke");
12875
+ if (stroke !== void 0) out.stroke = stroke;
12876
+ const shadowFrames = frames.filter((f3) => f3.shadow !== void 0);
12877
+ if (shadowFrames.length > 0) {
12878
+ const sh = trackValue("shadow");
12879
+ if (sh !== void 0) {
12880
+ let prevSh;
12881
+ let nextSh;
12882
+ for (const f3 of shadowFrames) {
12883
+ if (f3.at <= t) prevSh = f3;
12884
+ else if (!nextSh) nextSh = f3;
12885
+ }
12886
+ if (prevSh?.shadow && nextSh?.shadow) {
12887
+ const span = nextSh.at - prevSh.at;
12888
+ const k = span > 0 ? (t - prevSh.at) / span : 1;
12889
+ out.shadow = { color: prevSh.shadow.color, blur: lerp(prevSh.shadow.blur, nextSh.shadow.blur, k) };
12890
+ } else {
12891
+ out.shadow = sh;
12892
+ }
12893
+ }
12894
+ }
12895
+ return out;
12896
+ }
12897
+ function gradientStyle(g, ox, oy, scale) {
12898
+ if (g.kind === "linear") {
12899
+ if (!g.from || !g.to) return void 0;
12900
+ return {
12901
+ kind: "linear",
12902
+ x1: ox + g.from.x * scale,
12903
+ y1: oy + g.from.y * scale,
12904
+ x2: ox + g.to.x * scale,
12905
+ y2: oy + g.to.y * scale,
12906
+ stops: g.stops
12907
+ };
12908
+ }
12909
+ if (!g.center || g.radius === void 0) return void 0;
12910
+ return {
12911
+ kind: "radial",
12912
+ cx: ox + g.center.x * scale,
12913
+ cy: oy + g.center.y * scale,
12914
+ r: g.radius * scale,
12915
+ stops: g.stops
12916
+ };
12917
+ }
12918
+ function DrawShape(props) {
12919
+ const register = useContext(DrawableRegistryContext);
12920
+ if (register) {
12921
+ const { opacity, ...rest } = props;
12922
+ const node = {
12923
+ ...rest,
12924
+ type: "draw-shape",
12925
+ ...opacity !== void 0 && opacity > 0 ? { opacity } : {}
12926
+ };
12927
+ register(node);
12928
+ }
12826
12929
  return null;
12827
12930
  }
12828
- var paintShape;
12931
+ var NUMERIC_TRACKS, lerp, paintShape;
12829
12932
  var init_DrawShape = __esm({
12830
12933
  "components/game/atoms/DrawShape.tsx"() {
12831
12934
  "use client";
12832
12935
  init_contract();
12833
- paintShape = (painter, node, dctx) => {
12936
+ init_registry();
12937
+ NUMERIC_TRACKS = [
12938
+ "offsetX",
12939
+ "offsetY",
12940
+ "rotate",
12941
+ "opacity",
12942
+ "radiusX",
12943
+ "radiusY",
12944
+ "width",
12945
+ "height",
12946
+ "strokeWidth"
12947
+ ];
12948
+ lerp = (a, b, k) => a + (b - a) * k;
12949
+ paintShape = (painter, rawNode, dctx) => {
12950
+ const node = dctx.time > 0 ? applyShapeAnimation(rawNode, dctx.time) : rawNode;
12834
12951
  if (!isValidScenePos(node.position)) return;
12835
12952
  painter.save();
12836
12953
  if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
12954
+ const origin = dctx.projector.project(node.position);
12955
+ const tileWidth = dctx.projector.tileWidth;
12956
+ if (node.rotate) {
12957
+ const pivot = node.pivot ?? { x: 0.5, y: 0.5 };
12958
+ const px = origin.x + pivot.x * tileWidth;
12959
+ const py = origin.y + pivot.y * tileWidth;
12960
+ painter.translate(px, py);
12961
+ painter.rotate(node.rotate);
12962
+ painter.translate(-px, -py);
12963
+ }
12964
+ if (node.shadow) painter.setShadow({ color: node.shadow.color, blur: node.shadow.blur * tileWidth });
12965
+ const fill = node.fill === "none" ? void 0 : node.fill;
12966
+ const stroke = node.stroke === "none" ? void 0 : node.stroke;
12967
+ const pxFill = node.gradient ? gradientStyle(node.gradient, origin.x, origin.y, tileWidth) ?? fill : fill;
12837
12968
  switch (node.shape) {
12838
12969
  case "cell": {
12839
12970
  const pts = dctx.projector.cellPath(node.position);
12840
- if (node.fill) painter.fillPoly(pts, node.fill);
12841
- if (node.stroke) painter.strokePoly(pts, node.stroke, node.strokeWidth ?? 1, true);
12971
+ if (pxFill) painter.fillPoly(pts, pxFill);
12972
+ if (stroke) painter.strokePoly(pts, stroke, node.strokeWidth ?? 1, true);
12842
12973
  break;
12843
12974
  }
12844
12975
  case "rect": {
@@ -12848,8 +12979,8 @@ var init_DrawShape = __esm({
12848
12979
  const y = p.y + (node.offsetY ?? 0) * tw;
12849
12980
  const w = (node.width ?? 0) * tw;
12850
12981
  const h = (node.height ?? 0) * tw;
12851
- if (node.fill) painter.fillRect(x, y, w, h, node.fill);
12852
- if (node.stroke) painter.strokeRect(x, y, w, h, node.stroke, node.strokeWidth ?? 1);
12982
+ if (pxFill) painter.fillRect(x, y, w, h, pxFill);
12983
+ if (stroke) painter.strokeRect(x, y, w, h, stroke, node.strokeWidth ?? 1);
12853
12984
  break;
12854
12985
  }
12855
12986
  case "ellipse": {
@@ -12859,26 +12990,26 @@ var init_DrawShape = __esm({
12859
12990
  const cy = p.y + (node.offsetY ?? 0) * tw;
12860
12991
  const rx = (node.radiusX ?? 0) * tw;
12861
12992
  const ry = (node.radiusY ?? rx) * tw;
12862
- if (node.fill) painter.fillEllipse(cx, cy, rx, ry, node.fill);
12863
- if (node.stroke) painter.strokeEllipse(cx, cy, rx, ry, node.stroke, node.strokeWidth ?? 1);
12993
+ if (pxFill) painter.fillEllipse(cx, cy, rx, ry, pxFill);
12994
+ if (stroke) painter.strokeEllipse(cx, cy, rx, ry, stroke, node.strokeWidth ?? 1);
12864
12995
  break;
12865
12996
  }
12866
12997
  case "poly": {
12867
- const base = dctx.projector.project(node.position);
12868
- const tw = dctx.projector.tileWidth;
12869
- const pts = (node.points ?? []).map((pt) => ({ x: base.x + pt.x * tw, y: base.y + pt.y * tw }));
12870
- if (node.fill) painter.fillPoly(pts, node.fill);
12871
- if (node.stroke) painter.strokePoly(pts, node.stroke, node.strokeWidth ?? 1, true);
12998
+ const pts = (node.points ?? []).map((pt) => ({
12999
+ x: origin.x + ((node.offsetX ?? 0) + pt.x) * tileWidth,
13000
+ y: origin.y + ((node.offsetY ?? 0) + pt.y) * tileWidth
13001
+ }));
13002
+ if (pxFill) painter.fillPoly(pts, pxFill);
13003
+ if (stroke) painter.strokePoly(pts, stroke, node.strokeWidth ?? 1, true);
12872
13004
  break;
12873
13005
  }
12874
13006
  case "path": {
12875
13007
  if (!node.d) break;
12876
- const base = dctx.projector.project(node.position);
12877
- const tw = dctx.projector.tileWidth;
12878
- painter.translate(base.x, base.y);
12879
- painter.scale(tw, tw);
12880
- if (node.fill) painter.fillPath(node.d, node.fill);
12881
- if (node.stroke) painter.strokePath(node.d, node.stroke, (node.strokeWidth ?? 1) / tw);
13008
+ painter.translate(origin.x + (node.offsetX ?? 0) * tileWidth, origin.y + (node.offsetY ?? 0) * tileWidth);
13009
+ painter.scale(tileWidth, tileWidth);
13010
+ const localFill = node.gradient ? gradientStyle(node.gradient, 0, 0, 1) ?? fill : fill;
13011
+ if (localFill) painter.fillPath(node.d, localFill);
13012
+ if (stroke) painter.strokePath(node.d, stroke, (node.strokeWidth ?? 1) / tileWidth);
12882
13013
  break;
12883
13014
  }
12884
13015
  }
@@ -13014,12 +13145,18 @@ function collectDrawnItems(nodes) {
13014
13145
  for (const n of nodes) {
13015
13146
  switch (n.type) {
13016
13147
  case "draw-sprite":
13148
+ if (isValidScenePos(n.position)) out.push({ pos: n.position, id: n.id, anchor: n.anchor, width: n.width, height: n.height });
13149
+ break;
13017
13150
  case "draw-shape":
13018
13151
  case "draw-text":
13019
13152
  case "draw-group":
13020
13153
  if (isValidScenePos(n.position)) out.push({ pos: n.position, id: n.id });
13021
13154
  break;
13022
13155
  case "draw-sprite-layer":
13156
+ for (const it of n.items) {
13157
+ if (isValidScenePos(it.position)) out.push({ pos: it.position, id: it.id, anchor: it.anchor, width: it.width, height: it.height });
13158
+ }
13159
+ break;
13023
13160
  case "draw-shape-layer":
13024
13161
  case "draw-text-layer":
13025
13162
  for (const it of n.items) {
@@ -13037,6 +13174,15 @@ function buildHitIndex(items) {
13037
13174
  }
13038
13175
  return m;
13039
13176
  }
13177
+ function hitTestSprites(items, projector, point) {
13178
+ for (let i = items.length - 1; i >= 0; i--) {
13179
+ const it = items[i];
13180
+ if (it.id === void 0) continue;
13181
+ const r2 = spriteRect(projector, { position: it.pos, anchor: it.anchor, width: it.width, height: it.height });
13182
+ if (point.x >= r2.x && point.x <= r2.x + r2.w && point.y >= r2.y && point.y <= r2.y + r2.h) return it.id;
13183
+ }
13184
+ return void 0;
13185
+ }
13040
13186
  var init_hitTest = __esm({
13041
13187
  "lib/drawable/hitTest.ts"() {
13042
13188
  init_contract();
@@ -13065,9 +13211,16 @@ function Canvas2D({
13065
13211
  showMinimap = true,
13066
13212
  followTarget,
13067
13213
  cameraPos,
13068
- bgColor
13214
+ bgColor,
13215
+ children
13069
13216
  }) {
13070
13217
  const instanceId = useMemo(() => Math.random().toString(36).slice(2, 8), []);
13218
+ const childDrawablesRef = useRef([]);
13219
+ childDrawablesRef.current = [];
13220
+ const registerChildDrawable = useCallback((node) => {
13221
+ childDrawablesRef.current.push(node);
13222
+ }, []);
13223
+ const hasJsxChildren = React93.Children.count(children) > 0;
13071
13224
  function isDrawableLayer(node) {
13072
13225
  return node.type === "draw-sprite-layer" || node.type === "draw-shape-layer" || node.type === "draw-text-layer";
13073
13226
  }
@@ -13216,11 +13369,24 @@ function Canvas2D({
13216
13369
  }, [showMinimap, scenePositions]);
13217
13370
  const miniMapWidth = gridExtent.width || 10;
13218
13371
  const miniMapHeight = gridExtent.height || 10;
13219
- const draw = useCallback(() => {
13372
+ const drawableIsAnimated = (node) => {
13373
+ if (node.type === "draw-shape") return isAnimatedShape(node);
13374
+ if (node.type === "draw-group") return Array.isArray(node.items) && node.items.some(drawableIsAnimated);
13375
+ if (node.type === "draw-shape-layer") return Array.isArray(node.items) && node.items.some(isAnimatedShape);
13376
+ return false;
13377
+ };
13378
+ const animRafRef = useRef(0);
13379
+ const drawTimeRef = useRef(() => void 0);
13380
+ const draw = useCallback((timeMs = 0) => {
13220
13381
  const canvas = canvasRef.current;
13221
13382
  if (!canvas) return;
13222
13383
  const ctx = canvas.getContext("2d");
13223
13384
  if (!ctx) return;
13385
+ const scheduleAnimation = (nodes) => {
13386
+ if (!nodes.some(drawableIsAnimated)) return;
13387
+ cancelAnimationFrame(animRafRef.current);
13388
+ animRafRef.current = requestAnimationFrame(() => drawTimeRef.current(performance.now()));
13389
+ };
13224
13390
  const dpr = window.devicePixelRatio || 1;
13225
13391
  canvas.width = viewportSize.width * dpr;
13226
13392
  canvas.height = viewportSize.height * dpr;
@@ -13250,7 +13416,29 @@ function Canvas2D({
13250
13416
  ctx.fillStyle = bgColor ?? BACKGROUND_FALLBACK_COLOR;
13251
13417
  ctx.fillRect(0, 0, viewportSize.width, viewportSize.height);
13252
13418
  }
13253
- if (!drawables || drawables.length === 0) return;
13419
+ if (!drawables || drawables.length === 0) {
13420
+ const childDrawables = childDrawablesRef.current;
13421
+ if (childDrawables.length === 0) return;
13422
+ const cam0 = cameraRef.current;
13423
+ if (camera !== "follow" && dragDistance() === 0) {
13424
+ const focus = cameraPos ?? defaultGridFocus;
13425
+ if (focus) {
13426
+ const p = projector.anchorPoint(focus, "center");
13427
+ cam0.x = p.x - viewportSize.width / 2;
13428
+ cam0.y = p.y - viewportSize.height / 2;
13429
+ }
13430
+ }
13431
+ const painter0 = createWebPainter(ctx, bumpAtlas);
13432
+ painter0.save();
13433
+ painter0.translate(viewportSize.width / 2, viewportSize.height / 2);
13434
+ painter0.scale(cam0.zoom, cam0.zoom);
13435
+ painter0.translate(-viewportSize.width / 2 - cam0.x, -viewportSize.height / 2 - cam0.y);
13436
+ const dctx0 = { projector, time: timeMs, invalidate: bumpAtlas };
13437
+ for (const node of childDrawables) paintDrawable(painter0, node, dctx0);
13438
+ painter0.restore();
13439
+ scheduleAnimation(childDrawables);
13440
+ return;
13441
+ }
13254
13442
  const cam = cameraRef.current;
13255
13443
  if (camera !== "follow" && dragDistance() === 0) {
13256
13444
  const focus = cameraPos ?? defaultGridFocus;
@@ -13268,10 +13456,15 @@ function Canvas2D({
13268
13456
  painter.translate(viewportSize.width / 2, viewportSize.height / 2);
13269
13457
  painter.scale(cam.zoom, cam.zoom);
13270
13458
  painter.translate(-viewportSize.width / 2 - cam.x, -viewportSize.height / 2 - cam.y);
13271
- const dctx = { projector, time: 0, invalidate: bumpAtlas };
13459
+ const dctx = { projector, time: timeMs, invalidate: bumpAtlas };
13272
13460
  for (const node of drawables) paintDrawable(painter, node, dctx);
13273
13461
  painter.restore();
13462
+ scheduleAnimation(drawables);
13274
13463
  }, [viewportSize, backgroundImage, bgColor, drawables, projector, cameraRef, bumpAtlas, getImage, cameraPos, defaultGridFocus, camera, dragDistance]);
13464
+ useEffect(() => {
13465
+ drawTimeRef.current = draw;
13466
+ }, [draw]);
13467
+ useEffect(() => () => cancelAnimationFrame(animRafRef.current), []);
13275
13468
  useEffect(() => {
13276
13469
  if (camera !== "follow" || !followTarget) return;
13277
13470
  const p = projector.anchorPoint(followTarget, "center");
@@ -13334,6 +13527,11 @@ function Canvas2D({
13334
13527
  if (dragDistance() > 5) return;
13335
13528
  if (!canvasRef.current || !tileClickEvent && !unitClickEvent) return;
13336
13529
  const world = screenToWorld(e.clientX, e.clientY, canvasRef.current, viewportSize);
13530
+ const spriteHit = unitClickEvent ? hitTestSprites(drawnItems, projector, world) : void 0;
13531
+ if (spriteHit !== void 0 && unitClickEvent) {
13532
+ eventBus.emit(`UI:${unitClickEvent}`, { unitId: spriteHit });
13533
+ return;
13534
+ }
13337
13535
  const adjustedX = world.x - scaledTileWidth / 2;
13338
13536
  const adjustedY = squareGrid ? world.y - scaledTileWidth / 2 : world.y - scaledDiamondTopY - scaledFloorHeight / 2;
13339
13537
  const isoPos = unproject(adjustedX, adjustedY);
@@ -13343,7 +13541,7 @@ function Canvas2D({
13343
13541
  } else if (tileClickEvent) {
13344
13542
  eventBus.emit(`UI:${tileClickEvent}`, { x: isoPos.x, y: isoPos.y });
13345
13543
  }
13346
- }, [enableCamera, handlePointerUp, dragDistance, screenToWorld, viewportSize, scaledTileWidth, squareGrid, scaledDiamondTopY, scaledFloorHeight, unproject, hitIndex, tileClickEvent, unitClickEvent, eventBus]);
13544
+ }, [enableCamera, handlePointerUp, dragDistance, screenToWorld, viewportSize, scaledTileWidth, squareGrid, scaledDiamondTopY, scaledFloorHeight, unproject, hitIndex, drawnItems, projector, tileClickEvent, unitClickEvent, eventBus]);
13347
13545
  const handleCanvasPointerLeave = useCallback(() => {
13348
13546
  handleMouseLeave();
13349
13547
  if (tileLeaveEvent) eventBus.emit(`UI:${tileLeaveEvent}`, {});
@@ -13413,7 +13611,7 @@ function Canvas2D({
13413
13611
  /* @__PURE__ */ jsx(Typography, { variant: "body", className: "text-muted-foreground", children: t("canvas.loadingMessage") || "Loading\u2026" })
13414
13612
  ] }) });
13415
13613
  }
13416
- if (!drawables || drawables.length === 0) {
13614
+ if ((!drawables || drawables.length === 0) && !hasJsxChildren) {
13417
13615
  return /* @__PURE__ */ jsx(
13418
13616
  Box,
13419
13617
  {
@@ -13427,7 +13625,7 @@ function Canvas2D({
13427
13625
  }
13428
13626
  );
13429
13627
  }
13430
- return /* @__PURE__ */ jsxs(
13628
+ return /* @__PURE__ */ jsx(DrawableRegistryContext.Provider, { value: registerChildDrawable, children: /* @__PURE__ */ jsxs(
13431
13629
  Box,
13432
13630
  {
13433
13631
  ref: containerRef,
@@ -13488,10 +13686,11 @@ function Canvas2D({
13488
13686
  mapWidth: miniMapWidth,
13489
13687
  mapHeight: miniMapHeight
13490
13688
  }
13491
- ) })
13689
+ ) }),
13690
+ hasJsxChildren && /* @__PURE__ */ jsx("div", { "aria-hidden": "true", style: { position: "absolute", width: 0, height: 0, overflow: "hidden" }, children })
13492
13691
  ]
13493
13692
  }
13494
- );
13693
+ ) });
13495
13694
  }
13496
13695
  var canvas2DLog;
13497
13696
  var init_Canvas2D = __esm({
@@ -13513,6 +13712,8 @@ var init_Canvas2D = __esm({
13513
13712
  init_webPainter2d();
13514
13713
  init_projector();
13515
13714
  init_paintDispatch();
13715
+ init_DrawShape();
13716
+ init_registry();
13516
13717
  init_hitTest();
13517
13718
  init_isometric();
13518
13719
  canvas2DLog = createLogger("almadar:ui:game-canvas");
@@ -13554,7 +13755,8 @@ function Canvas({
13554
13755
  tileLeaveEvent,
13555
13756
  featureClickEvent,
13556
13757
  keyMap,
13557
- keyUpMap
13758
+ keyUpMap,
13759
+ children
13558
13760
  }) {
13559
13761
  canvasLog.debug("Canvas render", { mode, drawablesCount: drawables?.length, projection, camera: camera ? JSON.stringify(camera) : void 0 });
13560
13762
  const zoom = camera?.zoom;
@@ -13607,7 +13809,8 @@ function Canvas({
13607
13809
  tileHoverEvent,
13608
13810
  tileLeaveEvent,
13609
13811
  keyMap,
13610
- keyUpMap
13812
+ keyUpMap,
13813
+ ...children !== void 0 ? { children } : {}
13611
13814
  }
13612
13815
  );
13613
13816
  }
@@ -13739,7 +13942,7 @@ function LinearView({
13739
13942
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
13740
13943
  const isDone = i < currentIdx;
13741
13944
  const isCurrent = i === currentIdx;
13742
- return /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
13945
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
13743
13946
  i > 0 && /* @__PURE__ */ jsx(
13744
13947
  Typography,
13745
13948
  {
@@ -14274,7 +14477,7 @@ function SequenceBar({
14274
14477
  else onSlotRemove?.(index);
14275
14478
  }, [emit, slotRemoveEvent, onSlotRemove, playing]);
14276
14479
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
14277
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
14480
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
14278
14481
  i > 0 && /* @__PURE__ */ jsx(
14279
14482
  Typography,
14280
14483
  {
@@ -14923,7 +15126,7 @@ var init_ErrorBoundary = __esm({
14923
15126
  }
14924
15127
  );
14925
15128
  };
14926
- ErrorBoundary = class extends React92__default.Component {
15129
+ ErrorBoundary = class extends React93__default.Component {
14927
15130
  constructor(props) {
14928
15131
  super(props);
14929
15132
  __publicField(this, "reset", () => {
@@ -15192,7 +15395,7 @@ var init_Container = __esm({
15192
15395
  as: Component = "div"
15193
15396
  }) => {
15194
15397
  const resolvedSize = maxWidth ?? size ?? "lg";
15195
- return React92__default.createElement(
15398
+ return React93__default.createElement(
15196
15399
  Component,
15197
15400
  {
15198
15401
  className: cn(
@@ -17330,7 +17533,7 @@ var init_CodeBlock = __esm({
17330
17533
  DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
17331
17534
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
17332
17535
  HIDDEN_LINE_NUMBERS = { display: "none" };
17333
- CodeBlock = React92__default.memo(
17536
+ CodeBlock = React93__default.memo(
17334
17537
  ({
17335
17538
  code: rawCode,
17336
17539
  language = "text",
@@ -17918,7 +18121,7 @@ var init_MarkdownContent = __esm({
17918
18121
  init_Box();
17919
18122
  init_CodeBlock();
17920
18123
  init_cn();
17921
- MarkdownContent = React92__default.memo(
18124
+ MarkdownContent = React93__default.memo(
17922
18125
  ({ content, direction = "ltr", className }) => {
17923
18126
  const { t: _t } = useTranslate();
17924
18127
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -19245,7 +19448,7 @@ var init_StateMachineView = __esm({
19245
19448
  style: { top: title ? 30 : 0 },
19246
19449
  children: [
19247
19450
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
19248
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React92__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
19451
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React93__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
19249
19452
  StateNode2,
19250
19453
  {
19251
19454
  state,
@@ -25067,8 +25270,8 @@ var init_Menu = __esm({
25067
25270
  "bottom-end": "bottom-start"
25068
25271
  };
25069
25272
  const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
25070
- const triggerChild = React92__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
25071
- const triggerElement = React92__default.cloneElement(
25273
+ const triggerChild = React93__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
25274
+ const triggerElement = React93__default.cloneElement(
25072
25275
  triggerChild,
25073
25276
  {
25074
25277
  ref: triggerRef,
@@ -25163,14 +25366,14 @@ function useDataDnd(args) {
25163
25366
  const isZone = Boolean(dragGroup || accepts || sortable);
25164
25367
  const enabled = isZone || Boolean(dndRoot);
25165
25368
  const eventBus = useEventBus();
25166
- const parentRoot = React92__default.useContext(RootCtx);
25369
+ const parentRoot = React93__default.useContext(RootCtx);
25167
25370
  const isRoot = enabled && parentRoot === null;
25168
- const zoneId = React92__default.useId();
25371
+ const zoneId = React93__default.useId();
25169
25372
  const ownGroup = dragGroup ?? accepts ?? zoneId;
25170
- const [optimisticOrders, setOptimisticOrders] = React92__default.useState(() => /* @__PURE__ */ new Map());
25171
- const optimisticOrdersRef = React92__default.useRef(optimisticOrders);
25373
+ const [optimisticOrders, setOptimisticOrders] = React93__default.useState(() => /* @__PURE__ */ new Map());
25374
+ const optimisticOrdersRef = React93__default.useRef(optimisticOrders);
25172
25375
  optimisticOrdersRef.current = optimisticOrders;
25173
- const clearOptimisticOrder = React92__default.useCallback((group) => {
25376
+ const clearOptimisticOrder = React93__default.useCallback((group) => {
25174
25377
  setOptimisticOrders((prev) => {
25175
25378
  if (!prev.has(group)) return prev;
25176
25379
  const next = new Map(prev);
@@ -25195,7 +25398,7 @@ function useDataDnd(args) {
25195
25398
  const raw = it[dndItemIdField];
25196
25399
  return raw != null ? String(raw) : `__idx_${idx}`;
25197
25400
  }).join("|");
25198
- const itemIds = React92__default.useMemo(
25401
+ const itemIds = React93__default.useMemo(
25199
25402
  () => orderedItems.map((it, idx) => {
25200
25403
  const raw = it[dndItemIdField];
25201
25404
  return raw != null ? String(raw) : `__idx_${idx}`;
@@ -25206,7 +25409,7 @@ function useDataDnd(args) {
25206
25409
  const raw = it[dndItemIdField];
25207
25410
  return raw != null ? String(raw) : `__${idx}`;
25208
25411
  }).join("|");
25209
- React92__default.useEffect(() => {
25412
+ React93__default.useEffect(() => {
25210
25413
  const root = isRoot ? null : parentRoot;
25211
25414
  if (root) {
25212
25415
  root.clearOptimisticOrder(ownGroup);
@@ -25214,20 +25417,20 @@ function useDataDnd(args) {
25214
25417
  clearOptimisticOrder(ownGroup);
25215
25418
  }
25216
25419
  }, [itemsContentSig, ownGroup]);
25217
- const zonesRef = React92__default.useRef(/* @__PURE__ */ new Map());
25218
- const registerZone = React92__default.useCallback((zoneId2, meta2) => {
25420
+ const zonesRef = React93__default.useRef(/* @__PURE__ */ new Map());
25421
+ const registerZone = React93__default.useCallback((zoneId2, meta2) => {
25219
25422
  zonesRef.current.set(zoneId2, meta2);
25220
25423
  }, []);
25221
- const unregisterZone = React92__default.useCallback((zoneId2) => {
25424
+ const unregisterZone = React93__default.useCallback((zoneId2) => {
25222
25425
  zonesRef.current.delete(zoneId2);
25223
25426
  }, []);
25224
- const [activeDrag, setActiveDrag] = React92__default.useState(null);
25225
- const [overZoneGroup, setOverZoneGroup] = React92__default.useState(null);
25226
- const meta = React92__default.useMemo(
25427
+ const [activeDrag, setActiveDrag] = React93__default.useState(null);
25428
+ const [overZoneGroup, setOverZoneGroup] = React93__default.useState(null);
25429
+ const meta = React93__default.useMemo(
25227
25430
  () => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
25228
25431
  [ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
25229
25432
  );
25230
- React92__default.useEffect(() => {
25433
+ React93__default.useEffect(() => {
25231
25434
  const target = isRoot ? null : parentRoot;
25232
25435
  if (!target) {
25233
25436
  zonesRef.current.set(zoneId, meta);
@@ -25246,7 +25449,7 @@ function useDataDnd(args) {
25246
25449
  }, [parentRoot, isRoot, zoneId, meta]);
25247
25450
  const sensors = useAlmadarDndSensors(true);
25248
25451
  const collisionDetection = almadarDndCollisionDetection;
25249
- const findZoneByItem = React92__default.useCallback(
25452
+ const findZoneByItem = React93__default.useCallback(
25250
25453
  (id) => {
25251
25454
  for (const z of zonesRef.current.values()) {
25252
25455
  if (z.itemIds.includes(id)) return z;
@@ -25255,7 +25458,7 @@ function useDataDnd(args) {
25255
25458
  },
25256
25459
  []
25257
25460
  );
25258
- React92__default.useCallback(
25461
+ React93__default.useCallback(
25259
25462
  (group) => {
25260
25463
  for (const z of zonesRef.current.values()) {
25261
25464
  if (z.group === group) return z;
@@ -25264,7 +25467,7 @@ function useDataDnd(args) {
25264
25467
  },
25265
25468
  []
25266
25469
  );
25267
- const handleDragEnd = React92__default.useCallback(
25470
+ const handleDragEnd = React93__default.useCallback(
25268
25471
  (event) => {
25269
25472
  const { active, over } = event;
25270
25473
  const activeIdStr = String(active.id);
@@ -25355,8 +25558,8 @@ function useDataDnd(args) {
25355
25558
  },
25356
25559
  [eventBus]
25357
25560
  );
25358
- const sortableData = React92__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
25359
- const SortableItem = React92__default.useCallback(
25561
+ const sortableData = React93__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
25562
+ const SortableItem = React93__default.useCallback(
25360
25563
  ({ id, children }) => {
25361
25564
  const {
25362
25565
  attributes,
@@ -25396,7 +25599,7 @@ function useDataDnd(args) {
25396
25599
  id: droppableId,
25397
25600
  data: sortableData
25398
25601
  });
25399
- const ctx = React92__default.useContext(RootCtx);
25602
+ const ctx = React93__default.useContext(RootCtx);
25400
25603
  const activeDrag2 = ctx?.activeDrag ?? null;
25401
25604
  const overZoneGroup2 = ctx?.overZoneGroup ?? null;
25402
25605
  const isThisZoneOver = overZoneGroup2 === ownGroup;
@@ -25411,7 +25614,7 @@ function useDataDnd(args) {
25411
25614
  showForeignPlaceholder,
25412
25615
  ctxAvailable: ctx != null
25413
25616
  });
25414
- React92__default.useEffect(() => {
25617
+ React93__default.useEffect(() => {
25415
25618
  dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
25416
25619
  }, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
25417
25620
  return /* @__PURE__ */ jsx(
@@ -25425,11 +25628,11 @@ function useDataDnd(args) {
25425
25628
  }
25426
25629
  );
25427
25630
  };
25428
- const rootContextValue = React92__default.useMemo(
25631
+ const rootContextValue = React93__default.useMemo(
25429
25632
  () => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
25430
25633
  [registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
25431
25634
  );
25432
- const handleDragStart = React92__default.useCallback((event) => {
25635
+ const handleDragStart = React93__default.useCallback((event) => {
25433
25636
  const sourceZone = findZoneByItem(event.active.id);
25434
25637
  const rect = event.active.rect.current.initial;
25435
25638
  const height = rect?.height && rect.height > 0 ? rect.height : 64;
@@ -25448,7 +25651,7 @@ function useDataDnd(args) {
25448
25651
  isRoot
25449
25652
  });
25450
25653
  }, [findZoneByItem, isRoot, zoneId]);
25451
- const handleDragOver = React92__default.useCallback((event) => {
25654
+ const handleDragOver = React93__default.useCallback((event) => {
25452
25655
  const { active, over } = event;
25453
25656
  const overData = over?.data?.current;
25454
25657
  const overGroup = overData?.dndGroup ?? null;
@@ -25518,7 +25721,7 @@ function useDataDnd(args) {
25518
25721
  return next;
25519
25722
  });
25520
25723
  }, []);
25521
- const handleDragCancel = React92__default.useCallback((event) => {
25724
+ const handleDragCancel = React93__default.useCallback((event) => {
25522
25725
  setActiveDrag(null);
25523
25726
  setOverZoneGroup(null);
25524
25727
  dndLog.warn("dragCancel", {
@@ -25526,12 +25729,12 @@ function useDataDnd(args) {
25526
25729
  reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
25527
25730
  });
25528
25731
  }, []);
25529
- const handleDragEndWithCleanup = React92__default.useCallback((event) => {
25732
+ const handleDragEndWithCleanup = React93__default.useCallback((event) => {
25530
25733
  handleDragEnd(event);
25531
25734
  setActiveDrag(null);
25532
25735
  setOverZoneGroup(null);
25533
25736
  }, [handleDragEnd]);
25534
- const wrapContainer = React92__default.useCallback(
25737
+ const wrapContainer = React93__default.useCallback(
25535
25738
  (children) => {
25536
25739
  if (!enabled) return children;
25537
25740
  const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
@@ -25585,7 +25788,7 @@ var init_useDataDnd = __esm({
25585
25788
  init_useAlmadarDndCollision();
25586
25789
  init_Box();
25587
25790
  dndLog = createLogger("almadar:ui:dnd");
25588
- RootCtx = React92__default.createContext(null);
25791
+ RootCtx = React93__default.createContext(null);
25589
25792
  }
25590
25793
  });
25591
25794
  function renderIconInput(icon, props) {
@@ -26127,7 +26330,7 @@ function DataList({
26127
26330
  }) {
26128
26331
  const eventBus = useEventBus();
26129
26332
  const { t } = useTranslate();
26130
- const [visibleCount, setVisibleCount] = React92__default.useState(pageSize || Infinity);
26333
+ const [visibleCount, setVisibleCount] = React93__default.useState(pageSize || Infinity);
26131
26334
  const fieldDefs = fields ?? columns ?? [];
26132
26335
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
26133
26336
  const dnd = useDataDnd({
@@ -26143,14 +26346,14 @@ function DataList({
26143
26346
  dndRoot
26144
26347
  });
26145
26348
  const orderedData = dnd.orderedItems;
26146
- const allData = React92__default.useMemo(
26349
+ const allData = React93__default.useMemo(
26147
26350
  () => sortRows(orderedData, sortBy, sortDirection),
26148
26351
  [orderedData, sortBy, sortDirection]
26149
26352
  );
26150
26353
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
26151
26354
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
26152
26355
  const hasRenderProp = typeof children === "function";
26153
- React92__default.useEffect(() => {
26356
+ React93__default.useEffect(() => {
26154
26357
  const renderItemTypeOf = typeof schemaRenderItem;
26155
26358
  const childrenTypeOf = typeof children;
26156
26359
  if (data.length > 0 && !hasRenderProp) {
@@ -26265,7 +26468,7 @@ function DataList({
26265
26468
  return v === void 0 || v === null || v === "" ? raw : String(v);
26266
26469
  };
26267
26470
  return /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: cn("py-2", className), children: [
26268
- groups2.map((group, gi) => /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
26471
+ groups2.map((group, gi) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
26269
26472
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
26270
26473
  group.items.map((itemData, index) => {
26271
26474
  const id = itemData.id || `${gi}-${index}`;
@@ -26464,7 +26667,7 @@ function DataList({
26464
26667
  className
26465
26668
  ),
26466
26669
  children: [
26467
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
26670
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
26468
26671
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
26469
26672
  group.items.map(
26470
26673
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -26551,7 +26754,7 @@ var init_FormSection = __esm({
26551
26754
  columns = 1,
26552
26755
  className
26553
26756
  }) => {
26554
- const [collapsed, setCollapsed] = React92__default.useState(defaultCollapsed);
26757
+ const [collapsed, setCollapsed] = React93__default.useState(defaultCollapsed);
26555
26758
  const { t } = useTranslate();
26556
26759
  const eventBus = useEventBus();
26557
26760
  const gridClass = {
@@ -26559,7 +26762,7 @@ var init_FormSection = __esm({
26559
26762
  2: "grid-cols-1 md:grid-cols-2",
26560
26763
  3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
26561
26764
  }[columns];
26562
- React92__default.useCallback(() => {
26765
+ React93__default.useCallback(() => {
26563
26766
  if (collapsible) {
26564
26767
  setCollapsed((prev) => !prev);
26565
26768
  eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
@@ -27604,7 +27807,7 @@ var init_Flex = __esm({
27604
27807
  flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
27605
27808
  }
27606
27809
  }
27607
- return React92__default.createElement(Component, {
27810
+ return React93__default.createElement(Component, {
27608
27811
  className: cn(
27609
27812
  inline ? "inline-flex" : "flex",
27610
27813
  directionStyles[direction],
@@ -27723,7 +27926,7 @@ var init_Grid = __esm({
27723
27926
  as: Component = "div"
27724
27927
  }) => {
27725
27928
  const mergedStyle = rows ? { gridTemplateRows: `repeat(${rows}, minmax(0, 1fr))`, ...style } : style;
27726
- return React92__default.createElement(
27929
+ return React93__default.createElement(
27727
27930
  Component,
27728
27931
  {
27729
27932
  className: cn(
@@ -27955,9 +28158,9 @@ var init_Popover = __esm({
27955
28158
  onMouseLeave: handleClose,
27956
28159
  onPointerDown: tapTriggerProps.onPointerDown
27957
28160
  };
27958
- const childElement = React92__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
28161
+ const childElement = React93__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
27959
28162
  const childPointerDown = childElement.props.onPointerDown;
27960
- const triggerElement = React92__default.cloneElement(
28163
+ const triggerElement = React93__default.cloneElement(
27961
28164
  childElement,
27962
28165
  {
27963
28166
  ref: triggerRef,
@@ -28566,9 +28769,9 @@ var init_Tooltip = __esm({
28566
28769
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
28567
28770
  };
28568
28771
  }, []);
28569
- const triggerElement = React92__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
28772
+ const triggerElement = React93__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
28570
28773
  const childPointerDown = triggerElement.props.onPointerDown;
28571
- const trigger = React92__default.cloneElement(triggerElement, {
28774
+ const trigger = React93__default.cloneElement(triggerElement, {
28572
28775
  ref: triggerRef,
28573
28776
  onMouseEnter: handleMouseEnter,
28574
28777
  onMouseLeave: handleMouseLeave,
@@ -28658,7 +28861,7 @@ var init_WizardProgress = __esm({
28658
28861
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
28659
28862
  const isActive = index === currentStep;
28660
28863
  const isCompleted = index < currentStep;
28661
- return /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
28864
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
28662
28865
  /* @__PURE__ */ jsx(
28663
28866
  "button",
28664
28867
  {
@@ -30293,7 +30496,7 @@ var init_MapView = __esm({
30293
30496
  shadowSize: [41, 41]
30294
30497
  });
30295
30498
  L.Marker.prototype.options.icon = defaultIcon;
30296
- const { useEffect: useEffect63, useRef: useRef63, useCallback: useCallback95, useState: useState99 } = React92__default;
30499
+ const { useEffect: useEffect63, useRef: useRef63, useCallback: useCallback95, useState: useState99 } = React93__default;
30297
30500
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
30298
30501
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
30299
30502
  function MapUpdater({ centerLat, centerLng, zoom }) {
@@ -31211,8 +31414,8 @@ function TableView({
31211
31414
  }) {
31212
31415
  const eventBus = useEventBus();
31213
31416
  const { t } = useTranslate();
31214
- const [visibleCount, setVisibleCount] = React92__default.useState(pageSize > 0 ? pageSize : Infinity);
31215
- const [localSelected, setLocalSelected] = React92__default.useState(/* @__PURE__ */ new Set());
31417
+ const [visibleCount, setVisibleCount] = React93__default.useState(pageSize > 0 ? pageSize : Infinity);
31418
+ const [localSelected, setLocalSelected] = React93__default.useState(/* @__PURE__ */ new Set());
31216
31419
  const colDefs = (Array.isArray(columns) ? columns : void 0) ?? (Array.isArray(fields) ? fields : void 0) ?? [];
31217
31420
  const actionDefs = Array.isArray(itemActions) ? itemActions : [];
31218
31421
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
@@ -31234,7 +31437,7 @@ function TableView({
31234
31437
  const hasRenderProp = typeof children === "function";
31235
31438
  const idField = dndItemIdField ?? "id";
31236
31439
  const isCoarsePointer = useMediaQuery("(pointer: coarse)");
31237
- React92__default.useEffect(() => {
31440
+ React93__default.useEffect(() => {
31238
31441
  tableViewLog.debug("render", {
31239
31442
  rowCount: data.length,
31240
31443
  colCount: colDefs.length,
@@ -31291,7 +31494,7 @@ function TableView({
31291
31494
  };
31292
31495
  eventBus.emit(`UI:${itemClickEvent}`, payload);
31293
31496
  };
31294
- const colFloors = React92__default.useMemo(
31497
+ const colFloors = React93__default.useMemo(
31295
31498
  () => colDefs.map((col) => {
31296
31499
  const longest = data.reduce((widest, row) => {
31297
31500
  const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
@@ -31453,12 +31656,12 @@ function TableView({
31453
31656
  ]
31454
31657
  }
31455
31658
  );
31456
- return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React92__default.Fragment, { children: rowInner }, id);
31659
+ return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React93__default.Fragment, { children: rowInner }, id);
31457
31660
  };
31458
31661
  const items = Array.from(data);
31459
31662
  const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
31460
31663
  let runningIndex = 0;
31461
- const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
31664
+ const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
31462
31665
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
31463
31666
  group.items.map((row) => renderRow(row, runningIndex++))
31464
31667
  ] }, gi)) });
@@ -32821,7 +33024,7 @@ var init_StepFlow = __esm({
32821
33024
  className
32822
33025
  }) => {
32823
33026
  if (orientation === "vertical") {
32824
- return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React92__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
33027
+ return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React93__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
32825
33028
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
32826
33029
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
32827
33030
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -32832,7 +33035,7 @@ var init_StepFlow = __esm({
32832
33035
  ] })
32833
33036
  ] }) }, index)) });
32834
33037
  }
32835
- 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(React92__default.Fragment, { children: [
33038
+ return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
32836
33039
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
32837
33040
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
32838
33041
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -33822,7 +34025,7 @@ var init_LikertScale = __esm({
33822
34025
  md: "text-base",
33823
34026
  lg: "text-lg"
33824
34027
  };
33825
- LikertScale = React92__default.forwardRef(
34028
+ LikertScale = React93__default.forwardRef(
33826
34029
  ({
33827
34030
  question,
33828
34031
  options = DEFAULT_LIKERT_OPTIONS,
@@ -33834,7 +34037,7 @@ var init_LikertScale = __esm({
33834
34037
  variant = "radios",
33835
34038
  className
33836
34039
  }, ref) => {
33837
- const groupId = React92__default.useId();
34040
+ const groupId = React93__default.useId();
33838
34041
  const eventBus = useEventBus();
33839
34042
  const handleSelect = useCallback(
33840
34043
  (next) => {
@@ -36123,7 +36326,7 @@ var init_DocBreadcrumb = __esm({
36123
36326
  "aria-label": t("aria.breadcrumb"),
36124
36327
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
36125
36328
  const isLast = idx === items.length - 1;
36126
- return /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
36329
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
36127
36330
  idx > 0 && /* @__PURE__ */ jsx(
36128
36331
  Icon,
36129
36332
  {
@@ -36787,7 +36990,7 @@ var init_PageHeader = __esm({
36787
36990
  info: "bg-info/10 text-info"
36788
36991
  };
36789
36992
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
36790
- 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(React92__default.Fragment, { children: [
36993
+ breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
36791
36994
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
36792
36995
  crumb.href ? /* @__PURE__ */ jsx(
36793
36996
  "a",
@@ -37145,7 +37348,7 @@ var init_Section = __esm({
37145
37348
  as: Component = "section"
37146
37349
  }) => {
37147
37350
  const hasHeader = title || description || action;
37148
- return React92__default.createElement(
37351
+ return React93__default.createElement(
37149
37352
  Component,
37150
37353
  {
37151
37354
  className: cn(
@@ -37519,7 +37722,7 @@ var init_WizardContainer = __esm({
37519
37722
  const isCompleted = index < currentStep;
37520
37723
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
37521
37724
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
37522
- return /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
37725
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
37523
37726
  /* @__PURE__ */ jsx(
37524
37727
  Button,
37525
37728
  {
@@ -39306,7 +39509,7 @@ var init_ImportPreviewTree = __esm({
39306
39509
  const renderUnit = (unit, childrenByParent, depth) => {
39307
39510
  const summary = fieldSummary(unit);
39308
39511
  const children = childrenByParent.get(unit.ref) ?? [];
39309
- return /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
39512
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
39310
39513
  /* @__PURE__ */ jsxs(
39311
39514
  Box,
39312
39515
  {
@@ -39403,7 +39606,7 @@ var init_ImportProgress = __esm({
39403
39606
  PIPELINE.map((key, index) => {
39404
39607
  const isComplete = index < currentIndex;
39405
39608
  const isActive = index === currentIndex;
39406
- return /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
39609
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
39407
39610
  index > 0 ? /* @__PURE__ */ jsx(Box, { className: "h-px w-4 bg-border" }) : null,
39408
39611
  /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-1", "data-testid": `import-progress-step-${key}`, children: [
39409
39612
  /* @__PURE__ */ jsx(
@@ -40516,7 +40719,7 @@ var init_DrawGroup = __esm({
40516
40719
  }
40517
40720
  });
40518
40721
  function extractTitle(children) {
40519
- if (!React92__default.isValidElement(children)) return void 0;
40722
+ if (!React93__default.isValidElement(children)) return void 0;
40520
40723
  const props = children.props;
40521
40724
  if (typeof props.title === "string") {
40522
40725
  return props.title;
@@ -40866,12 +41069,12 @@ var init_Form = __esm({
40866
41069
  const isSchemaEntity = isOrbitalEntitySchema(entity);
40867
41070
  const resolvedEntity = isSchemaEntity ? entity : void 0;
40868
41071
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
40869
- const normalizedInitialData = React92__default.useMemo(() => {
41072
+ const normalizedInitialData = React93__default.useMemo(() => {
40870
41073
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
40871
41074
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
40872
41075
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
40873
41076
  }, [entity, initialData]);
40874
- const entityDerivedFields = React92__default.useMemo(() => {
41077
+ const entityDerivedFields = React93__default.useMemo(() => {
40875
41078
  if (fields && fields.length > 0) return void 0;
40876
41079
  if (!resolvedEntity) return void 0;
40877
41080
  return resolvedEntity.fields.map(
@@ -40892,16 +41095,16 @@ var init_Form = __esm({
40892
41095
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
40893
41096
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
40894
41097
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
40895
- const [formData, setFormData] = React92__default.useState(
41098
+ const [formData, setFormData] = React93__default.useState(
40896
41099
  normalizedInitialData
40897
41100
  );
40898
- const [collapsedSections, setCollapsedSections] = React92__default.useState(
41101
+ const [collapsedSections, setCollapsedSections] = React93__default.useState(
40899
41102
  /* @__PURE__ */ new Set()
40900
41103
  );
40901
- const [submitError, setSubmitError] = React92__default.useState(null);
40902
- const formRef = React92__default.useRef(null);
41104
+ const [submitError, setSubmitError] = React93__default.useState(null);
41105
+ const formRef = React93__default.useRef(null);
40903
41106
  const formMode = props.mode;
40904
- const mountedRef = React92__default.useRef(false);
41107
+ const mountedRef = React93__default.useRef(false);
40905
41108
  if (!mountedRef.current) {
40906
41109
  mountedRef.current = true;
40907
41110
  debug("forms", "mount", {
@@ -40914,7 +41117,7 @@ var init_Form = __esm({
40914
41117
  });
40915
41118
  }
40916
41119
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
40917
- const evalContext = React92__default.useMemo(
41120
+ const evalContext = React93__default.useMemo(
40918
41121
  () => ({
40919
41122
  formValues: formData,
40920
41123
  globalVariables: externalContext?.globalVariables ?? {},
@@ -40923,7 +41126,7 @@ var init_Form = __esm({
40923
41126
  }),
40924
41127
  [formData, externalContext]
40925
41128
  );
40926
- React92__default.useEffect(() => {
41129
+ React93__default.useEffect(() => {
40927
41130
  debug("forms", "initialData-sync", {
40928
41131
  mode: formMode,
40929
41132
  normalizedInitialData,
@@ -40934,7 +41137,7 @@ var init_Form = __esm({
40934
41137
  setFormData(normalizedInitialData);
40935
41138
  }
40936
41139
  }, [normalizedInitialData]);
40937
- const processCalculations = React92__default.useCallback(
41140
+ const processCalculations = React93__default.useCallback(
40938
41141
  (changedFieldId, newFormData) => {
40939
41142
  if (!hiddenCalculations.length) return;
40940
41143
  const context = {
@@ -40959,7 +41162,7 @@ var init_Form = __esm({
40959
41162
  },
40960
41163
  [hiddenCalculations, externalContext, eventBus]
40961
41164
  );
40962
- const checkViolations = React92__default.useCallback(
41165
+ const checkViolations = React93__default.useCallback(
40963
41166
  (changedFieldId, newFormData) => {
40964
41167
  if (!violationTriggers.length) return;
40965
41168
  const context = {
@@ -40997,7 +41200,7 @@ var init_Form = __esm({
40997
41200
  processCalculations(name, newFormData);
40998
41201
  checkViolations(name, newFormData);
40999
41202
  };
41000
- const isFieldVisible = React92__default.useCallback(
41203
+ const isFieldVisible = React93__default.useCallback(
41001
41204
  (fieldName) => {
41002
41205
  const condition = conditionalFields[fieldName];
41003
41206
  if (!condition) return true;
@@ -41005,7 +41208,7 @@ var init_Form = __esm({
41005
41208
  },
41006
41209
  [conditionalFields, evalContext]
41007
41210
  );
41008
- const isSectionVisible = React92__default.useCallback(
41211
+ const isSectionVisible = React93__default.useCallback(
41009
41212
  (section) => {
41010
41213
  if (!section.condition) return true;
41011
41214
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -41081,7 +41284,7 @@ var init_Form = __esm({
41081
41284
  eventBus.emit(`UI:${onCancel}`);
41082
41285
  }
41083
41286
  };
41084
- const renderField = React92__default.useCallback(
41287
+ const renderField = React93__default.useCallback(
41085
41288
  (field) => {
41086
41289
  const fieldName = field.name || field.field;
41087
41290
  if (!fieldName) return null;
@@ -41102,7 +41305,7 @@ var init_Form = __esm({
41102
41305
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
41103
41306
  );
41104
41307
  const effectiveFields = entityDerivedFields ?? fields;
41105
- const normalizedFields = React92__default.useMemo(() => {
41308
+ const normalizedFields = React93__default.useMemo(() => {
41106
41309
  if (!effectiveFields || effectiveFields.length === 0) return [];
41107
41310
  return effectiveFields.map((field) => {
41108
41311
  if (typeof field === "string") {
@@ -41126,7 +41329,7 @@ var init_Form = __esm({
41126
41329
  return field;
41127
41330
  });
41128
41331
  }, [effectiveFields, resolvedEntity]);
41129
- const schemaFields = React92__default.useMemo(() => {
41332
+ const schemaFields = React93__default.useMemo(() => {
41130
41333
  if (normalizedFields.length === 0) return null;
41131
41334
  if (isDebugEnabled()) {
41132
41335
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -41136,7 +41339,7 @@ var init_Form = __esm({
41136
41339
  }
41137
41340
  return normalizedFields.map(renderField).filter(Boolean);
41138
41341
  }, [normalizedFields, renderField, entityName, conditionalFields]);
41139
- const sectionElements = React92__default.useMemo(() => {
41342
+ const sectionElements = React93__default.useMemo(() => {
41140
41343
  if (!sections || sections.length === 0) return null;
41141
41344
  return sections.map((section) => {
41142
41345
  if (!isSectionVisible(section)) {
@@ -41862,7 +42065,7 @@ var init_List = __esm({
41862
42065
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
41863
42066
  return [];
41864
42067
  }, [entity]);
41865
- const getItemActions = React92__default.useCallback(
42068
+ const getItemActions = React93__default.useCallback(
41866
42069
  (item) => {
41867
42070
  if (!itemActions) return [];
41868
42071
  if (typeof itemActions === "function") {
@@ -42343,7 +42546,7 @@ var init_MediaGallery = __esm({
42343
42546
  [selectable, selectedItems, selectionEvent, eventBus]
42344
42547
  );
42345
42548
  const entityData = Array.isArray(entity) ? entity : [];
42346
- const items = React92__default.useMemo(() => {
42549
+ const items = React93__default.useMemo(() => {
42347
42550
  if (propItems && propItems.length > 0) return propItems;
42348
42551
  if (entityData.length === 0) return [];
42349
42552
  return entityData.map((record, idx) => {
@@ -42508,7 +42711,7 @@ var init_MediaGallery = __esm({
42508
42711
  }
42509
42712
  });
42510
42713
  function extractTitle2(children) {
42511
- if (!React92__default.isValidElement(children)) return void 0;
42714
+ if (!React93__default.isValidElement(children)) return void 0;
42512
42715
  const props = children.props;
42513
42716
  if (typeof props.title === "string") {
42514
42717
  return props.title;
@@ -42782,7 +42985,7 @@ var init_debugRegistry = __esm({
42782
42985
  }
42783
42986
  });
42784
42987
  function useDebugData() {
42785
- const [data, setData] = React92.useState(() => ({
42988
+ const [data, setData] = React93.useState(() => ({
42786
42989
  traits: [],
42787
42990
  ticks: [],
42788
42991
  guards: [],
@@ -42796,7 +42999,7 @@ function useDebugData() {
42796
42999
  },
42797
43000
  lastUpdate: Date.now()
42798
43001
  }));
42799
- React92.useEffect(() => {
43002
+ React93.useEffect(() => {
42800
43003
  const updateData = () => {
42801
43004
  setData({
42802
43005
  traits: getAllTraits(),
@@ -42905,12 +43108,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
42905
43108
  return positions;
42906
43109
  }
42907
43110
  function WalkMinimap() {
42908
- const [walkStep, setWalkStep] = React92.useState(null);
42909
- const [traits2, setTraits] = React92.useState([]);
42910
- const [coveredEdges, setCoveredEdges] = React92.useState([]);
42911
- const [completedTraits, setCompletedTraits] = React92.useState(/* @__PURE__ */ new Set());
42912
- const prevTraitRef = React92.useRef(null);
42913
- React92.useEffect(() => {
43111
+ const [walkStep, setWalkStep] = React93.useState(null);
43112
+ const [traits2, setTraits] = React93.useState([]);
43113
+ const [coveredEdges, setCoveredEdges] = React93.useState([]);
43114
+ const [completedTraits, setCompletedTraits] = React93.useState(/* @__PURE__ */ new Set());
43115
+ const prevTraitRef = React93.useRef(null);
43116
+ React93.useEffect(() => {
42914
43117
  const interval = setInterval(() => {
42915
43118
  const w = window;
42916
43119
  const step = w.__orbitalWalkStep;
@@ -43346,15 +43549,15 @@ var init_EntitiesTab = __esm({
43346
43549
  });
43347
43550
  function EventFlowTab({ events: events2 }) {
43348
43551
  const { t } = useTranslate();
43349
- const [filter, setFilter] = React92.useState("all");
43350
- const containerRef = React92.useRef(null);
43351
- const [autoScroll, setAutoScroll] = React92.useState(true);
43352
- React92.useEffect(() => {
43552
+ const [filter, setFilter] = React93.useState("all");
43553
+ const containerRef = React93.useRef(null);
43554
+ const [autoScroll, setAutoScroll] = React93.useState(true);
43555
+ React93.useEffect(() => {
43353
43556
  if (autoScroll && containerRef.current) {
43354
43557
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
43355
43558
  }
43356
43559
  }, [events2.length, autoScroll]);
43357
- const filteredEvents = React92.useMemo(() => {
43560
+ const filteredEvents = React93.useMemo(() => {
43358
43561
  if (filter === "all") return events2;
43359
43562
  return events2.filter((e) => e.type === filter);
43360
43563
  }, [events2, filter]);
@@ -43470,7 +43673,7 @@ var init_EventFlowTab = __esm({
43470
43673
  });
43471
43674
  function GuardsPanel({ guards }) {
43472
43675
  const { t } = useTranslate();
43473
- const [filter, setFilter] = React92.useState("all");
43676
+ const [filter, setFilter] = React93.useState("all");
43474
43677
  if (guards.length === 0) {
43475
43678
  return /* @__PURE__ */ jsx(
43476
43679
  EmptyState,
@@ -43483,7 +43686,7 @@ function GuardsPanel({ guards }) {
43483
43686
  }
43484
43687
  const passedCount = guards.filter((g) => g.result).length;
43485
43688
  const failedCount = guards.length - passedCount;
43486
- const filteredGuards = React92.useMemo(() => {
43689
+ const filteredGuards = React93.useMemo(() => {
43487
43690
  if (filter === "all") return guards;
43488
43691
  if (filter === "passed") return guards.filter((g) => g.result);
43489
43692
  return guards.filter((g) => !g.result);
@@ -43646,10 +43849,10 @@ function EffectBadge({ effect }) {
43646
43849
  }
43647
43850
  function TransitionTimeline({ transitions }) {
43648
43851
  const { t } = useTranslate();
43649
- const containerRef = React92.useRef(null);
43650
- const [autoScroll, setAutoScroll] = React92.useState(true);
43651
- const [expandedId, setExpandedId] = React92.useState(null);
43652
- React92.useEffect(() => {
43852
+ const containerRef = React93.useRef(null);
43853
+ const [autoScroll, setAutoScroll] = React93.useState(true);
43854
+ const [expandedId, setExpandedId] = React93.useState(null);
43855
+ React93.useEffect(() => {
43653
43856
  if (autoScroll && containerRef.current) {
43654
43857
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
43655
43858
  }
@@ -43929,9 +44132,9 @@ function getAllEvents(traits2) {
43929
44132
  function EventDispatcherTab({ traits: traits2, schema }) {
43930
44133
  const eventBus = useEventBus();
43931
44134
  const { t } = useTranslate();
43932
- const [log11, setLog] = React92.useState([]);
43933
- const prevStatesRef = React92.useRef(/* @__PURE__ */ new Map());
43934
- React92.useEffect(() => {
44135
+ const [log11, setLog] = React93.useState([]);
44136
+ const prevStatesRef = React93.useRef(/* @__PURE__ */ new Map());
44137
+ React93.useEffect(() => {
43935
44138
  for (const trait of traits2) {
43936
44139
  const prev = prevStatesRef.current.get(trait.id);
43937
44140
  if (prev && prev !== trait.currentState) {
@@ -44100,10 +44303,10 @@ function VerifyModePanel({
44100
44303
  localCount
44101
44304
  }) {
44102
44305
  const { t } = useTranslate();
44103
- const [expanded, setExpanded] = React92.useState(true);
44104
- const scrollRef = React92.useRef(null);
44105
- const prevCountRef = React92.useRef(0);
44106
- React92.useEffect(() => {
44306
+ const [expanded, setExpanded] = React93.useState(true);
44307
+ const scrollRef = React93.useRef(null);
44308
+ const prevCountRef = React93.useRef(0);
44309
+ React93.useEffect(() => {
44107
44310
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
44108
44311
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
44109
44312
  }
@@ -44160,10 +44363,10 @@ function RuntimeDebugger({
44160
44363
  schema
44161
44364
  }) {
44162
44365
  const { t } = useTranslate();
44163
- const [isCollapsed, setIsCollapsed] = React92.useState(mode === "verify" ? true : defaultCollapsed);
44164
- const [isVisible, setIsVisible] = React92.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
44366
+ const [isCollapsed, setIsCollapsed] = React93.useState(mode === "verify" ? true : defaultCollapsed);
44367
+ const [isVisible, setIsVisible] = React93.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
44165
44368
  const debugData = useDebugData();
44166
- React92.useEffect(() => {
44369
+ React93.useEffect(() => {
44167
44370
  if (mode === "inline") return;
44168
44371
  return onDebugToggle((enabled) => {
44169
44372
  setIsVisible(enabled);
@@ -44172,7 +44375,7 @@ function RuntimeDebugger({
44172
44375
  }
44173
44376
  });
44174
44377
  }, [mode]);
44175
- React92.useEffect(() => {
44378
+ React93.useEffect(() => {
44176
44379
  if (mode === "inline") return;
44177
44380
  const handleKeyDown = (e) => {
44178
44381
  if (e.key === "`" && isVisible) {
@@ -44692,7 +44895,7 @@ var init_StatCard = __esm({
44692
44895
  const labelToUse = propLabel ?? propTitle;
44693
44896
  const eventBus = useEventBus();
44694
44897
  const { t } = useTranslate();
44695
- const handleActionClick = React92__default.useCallback(() => {
44898
+ const handleActionClick = React93__default.useCallback(() => {
44696
44899
  if (action?.event) {
44697
44900
  eventBus.emit(`UI:${action.event}`, {});
44698
44901
  }
@@ -44703,7 +44906,7 @@ var init_StatCard = __esm({
44703
44906
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
44704
44907
  const isLoading = externalLoading ?? false;
44705
44908
  const error = externalError;
44706
- const computeMetricValue = React92__default.useCallback(
44909
+ const computeMetricValue = React93__default.useCallback(
44707
44910
  (metric, items) => {
44708
44911
  if (metric.value !== void 0) {
44709
44912
  return metric.value;
@@ -44742,7 +44945,7 @@ var init_StatCard = __esm({
44742
44945
  },
44743
44946
  []
44744
44947
  );
44745
- const schemaStats = React92__default.useMemo(() => {
44948
+ const schemaStats = React93__default.useMemo(() => {
44746
44949
  if (!metrics || metrics.length === 0) return null;
44747
44950
  return metrics.map((metric) => ({
44748
44951
  label: metric.label,
@@ -44750,7 +44953,7 @@ var init_StatCard = __esm({
44750
44953
  format: metric.format
44751
44954
  }));
44752
44955
  }, [metrics, data, computeMetricValue]);
44753
- const calculatedTrend = React92__default.useMemo(() => {
44956
+ const calculatedTrend = React93__default.useMemo(() => {
44754
44957
  if (manualTrend !== void 0) return manualTrend;
44755
44958
  if (previousValue === void 0 || currentValue === void 0)
44756
44959
  return void 0;
@@ -45390,8 +45593,8 @@ var init_SubagentTracePanel = __esm({
45390
45593
  ] });
45391
45594
  };
45392
45595
  InlineActivityStream = ({ activities, autoScroll = true, className }) => {
45393
- const endRef = React92__default.useRef(null);
45394
- React92__default.useEffect(() => {
45596
+ const endRef = React93__default.useRef(null);
45597
+ React93__default.useEffect(() => {
45395
45598
  if (!autoScroll) return;
45396
45599
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
45397
45600
  }, [activities.length, autoScroll]);
@@ -45485,7 +45688,7 @@ var init_SubagentTracePanel = __esm({
45485
45688
  };
45486
45689
  SubagentRichCard = ({ subagent }) => {
45487
45690
  const { t } = useTranslate();
45488
- const activities = React92__default.useMemo(
45691
+ const activities = React93__default.useMemo(
45489
45692
  () => subagentMessagesToActivities(subagent.messages),
45490
45693
  [subagent.messages]
45491
45694
  );
@@ -45562,8 +45765,8 @@ var init_SubagentTracePanel = __esm({
45562
45765
  ] });
45563
45766
  };
45564
45767
  CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
45565
- const endRef = React92__default.useRef(null);
45566
- React92__default.useEffect(() => {
45768
+ const endRef = React93__default.useRef(null);
45769
+ React93__default.useEffect(() => {
45567
45770
  if (!autoScroll) return;
45568
45771
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
45569
45772
  }, [messages.length, autoScroll]);
@@ -45998,7 +46201,7 @@ var init_Timeline = __esm({
45998
46201
  }) => {
45999
46202
  const { t } = useTranslate();
46000
46203
  const entityData = entity ?? [];
46001
- const items = React92__default.useMemo(() => {
46204
+ const items = React93__default.useMemo(() => {
46002
46205
  if (propItems) return propItems;
46003
46206
  if (entityData.length === 0) return [];
46004
46207
  return entityData.map((record, idx) => {
@@ -46100,7 +46303,7 @@ var init_Timeline = __esm({
46100
46303
  }
46101
46304
  });
46102
46305
  function extractToastProps(children) {
46103
- if (!React92__default.isValidElement(children)) {
46306
+ if (!React93__default.isValidElement(children)) {
46104
46307
  if (typeof children === "string") {
46105
46308
  return { message: children };
46106
46309
  }
@@ -46142,7 +46345,7 @@ var init_ToastSlot = __esm({
46142
46345
  eventBus.emit(`${prefix}CLOSE`);
46143
46346
  };
46144
46347
  if (!isVisible) return null;
46145
- const isCustomContent = React92__default.isValidElement(children) && !message;
46348
+ const isCustomContent = React93__default.isValidElement(children) && !message;
46146
46349
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
46147
46350
  Toast,
46148
46351
  {
@@ -46715,7 +46918,7 @@ function SuspenseConfigProvider({
46715
46918
  config,
46716
46919
  children
46717
46920
  }) {
46718
- return React92__default.createElement(
46921
+ return React93__default.createElement(
46719
46922
  SuspenseConfigContext.Provider,
46720
46923
  { value: config },
46721
46924
  children
@@ -46757,7 +46960,7 @@ function enrichFormFields(fields, entityDef) {
46757
46960
  }
46758
46961
  return { name: field, label: humanizeFieldName(field) };
46759
46962
  }
46760
- if (field && typeof field === "object" && !Array.isArray(field) && !React92__default.isValidElement(field) && !(field instanceof Date)) {
46963
+ if (field && typeof field === "object" && !Array.isArray(field) && !React93__default.isValidElement(field) && !(field instanceof Date)) {
46761
46964
  const obj = field;
46762
46965
  const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
46763
46966
  if (!fieldName) return field;
@@ -47229,7 +47432,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
47229
47432
  const key = `${parentId}-${index}-trait:${traitName}`;
47230
47433
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
47231
47434
  }
47232
- return /* @__PURE__ */ jsx(React92__default.Fragment, { children: child }, `${parentId}-${index}`);
47435
+ return /* @__PURE__ */ jsx(React93__default.Fragment, { children: child }, `${parentId}-${index}`);
47233
47436
  }
47234
47437
  if (!child || typeof child !== "object") return null;
47235
47438
  const childId = `${parentId}-${index}`;
@@ -47286,14 +47489,14 @@ function isPatternConfig(value) {
47286
47489
  if (value === null || value === void 0) return false;
47287
47490
  if (typeof value !== "object") return false;
47288
47491
  if (Array.isArray(value)) return false;
47289
- if (React92__default.isValidElement(value)) return false;
47492
+ if (React93__default.isValidElement(value)) return false;
47290
47493
  if (value instanceof Date) return false;
47291
47494
  if (typeof value === "function") return false;
47292
47495
  const record = value;
47293
47496
  return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
47294
47497
  }
47295
47498
  function isPlainConfigObject(value) {
47296
- if (React92__default.isValidElement(value)) return false;
47499
+ if (React93__default.isValidElement(value)) return false;
47297
47500
  if (value instanceof Date) return false;
47298
47501
  const proto = Object.getPrototypeOf(value);
47299
47502
  return proto === Object.prototype || proto === null;
@@ -47414,8 +47617,13 @@ function SlotContentRenderer({
47414
47617
  const isSingleChild = typeof childrenConfig === "string" || typeof childrenConfig === "object" && childrenConfig !== null && !Array.isArray(childrenConfig) && "type" in childrenConfig;
47415
47618
  const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0 || isSingleChild;
47416
47619
  const isDrawHost = isDrawHostPattern(content.pattern);
47620
+ const arr = Array.isArray(childrenConfig) ? childrenConfig : childrenConfig ? [childrenConfig] : [];
47621
+ const hasTraitChildren = arr.some(
47622
+ (c) => typeof c === "string" && TRAIT_BINDING_RE.test(c)
47623
+ );
47624
+ const drawHostUsesReactChildren = isDrawHost && hasTraitChildren;
47417
47625
  const myPath = patternPath ?? "root";
47418
- const renderedChildren = hasChildren && !isDrawHost ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath, content.sourceTrait, {
47626
+ const renderedChildren = hasChildren && (!isDrawHost || drawHostUsesReactChildren) ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath, content.sourceTrait, {
47419
47627
  slot: content.slot,
47420
47628
  transitionEvent: content.transitionEvent,
47421
47629
  fromState: content.fromState,
@@ -47429,7 +47637,7 @@ function SlotContentRenderer({
47429
47637
  for (const slotKey of CONTENT_NODE_SLOTS) {
47430
47638
  const slotVal = restProps[slotKey];
47431
47639
  if (slotVal === void 0 || slotVal === null) continue;
47432
- if (React92__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
47640
+ if (React93__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
47433
47641
  const typelessChildren = !Array.isArray(slotVal) && typeof slotVal === "object" && !("type" in slotVal) && Array.isArray(slotVal.children) ? slotVal.children : void 0;
47434
47642
  if (typelessChildren !== void 0 || Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
47435
47643
  nodeSlotOverrides[slotKey] = renderPatternChildren(
@@ -47476,14 +47684,14 @@ function SlotContentRenderer({
47476
47684
  for (const [k, v] of Object.entries(nodeSlotOverrides)) {
47477
47685
  finalProps[k] = v;
47478
47686
  }
47479
- if (isDrawHost && Array.isArray(childrenConfig) && childrenConfig.length > 0) {
47687
+ if (isDrawHost && !drawHostUsesReactChildren && Array.isArray(childrenConfig) && childrenConfig.length > 0) {
47480
47688
  finalProps.drawables = toDrawableNodes(childrenConfig);
47481
47689
  }
47482
47690
  const entityVal = finalProps.entity;
47483
47691
  const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
47484
47692
  if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
47485
47693
  const sample = resolvedItems[0];
47486
- if (sample && typeof sample === "object" && !Array.isArray(sample) && !React92__default.isValidElement(sample) && !(sample instanceof Date)) {
47694
+ if (sample && typeof sample === "object" && !Array.isArray(sample) && !React93__default.isValidElement(sample) && !(sample instanceof Date)) {
47487
47695
  const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
47488
47696
  finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
47489
47697
  }
@@ -47655,6 +47863,8 @@ var init_UISlotRenderer = __esm({
47655
47863
  "vstack",
47656
47864
  "hstack",
47657
47865
  "box",
47866
+ "canvas",
47867
+ "canvas-2d",
47658
47868
  "grid",
47659
47869
  "center",
47660
47870
  "card",
@@ -47850,7 +48060,7 @@ var AvlTransition = ({
47850
48060
  opacity = 1,
47851
48061
  className
47852
48062
  }) => {
47853
- const ids = React92__default.useMemo(() => {
48063
+ const ids = React93__default.useMemo(() => {
47854
48064
  avlTransitionId += 1;
47855
48065
  return { arrow: `avl-tr-${avlTransitionId}-arrow` };
47856
48066
  }, []);
@@ -48411,7 +48621,7 @@ var AvlStateMachine = ({
48411
48621
  color = "var(--color-primary)",
48412
48622
  animated = false
48413
48623
  }) => {
48414
- const ids = React92__default.useMemo(() => {
48624
+ const ids = React93__default.useMemo(() => {
48415
48625
  avlSmId += 1;
48416
48626
  const base = `avl-sm-${avlSmId}`;
48417
48627
  return { glow: `${base}-glow`, grad: `${base}-grad` };
@@ -48610,7 +48820,7 @@ var AvlOrbitalUnit = ({
48610
48820
  color = "var(--color-primary)",
48611
48821
  animated = false
48612
48822
  }) => {
48613
- const ids = React92__default.useMemo(() => {
48823
+ const ids = React93__default.useMemo(() => {
48614
48824
  avlOuId += 1;
48615
48825
  const base = `avl-ou-${avlOuId}`;
48616
48826
  return { glow: `${base}-glow`, grad: `${base}-grad` };
@@ -48706,7 +48916,7 @@ var AvlClosedCircuit = ({
48706
48916
  color = "var(--color-primary)",
48707
48917
  animated = false
48708
48918
  }) => {
48709
- const ids = React92__default.useMemo(() => {
48919
+ const ids = React93__default.useMemo(() => {
48710
48920
  avlCcId += 1;
48711
48921
  const base = `avl-cc-${avlCcId}`;
48712
48922
  return { glow: `${base}-glow`, grad: `${base}-grad`, arrow: `${base}-arrow` };
@@ -48861,7 +49071,7 @@ var AvlEmitListen = ({
48861
49071
  color = "var(--color-primary)",
48862
49072
  animated = false
48863
49073
  }) => {
48864
- const ids = React92__default.useMemo(() => {
49074
+ const ids = React93__default.useMemo(() => {
48865
49075
  avlElId += 1;
48866
49076
  const base = `avl-el-${avlElId}`;
48867
49077
  return { arrow: `${base}-arrow`, grad: `${base}-grad` };
@@ -49135,7 +49345,7 @@ function renderNode(node, color, glowId) {
49135
49345
  const baseR = node.type === "operator" ? 20 : 16;
49136
49346
  const r2 = Math.max(baseR, labelLen * 3.5 + 6);
49137
49347
  const nc = nodeColor(node.type, color);
49138
- return /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
49348
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
49139
49349
  node.children.map((child, i) => {
49140
49350
  const childR = Math.max(
49141
49351
  child.type === "operator" ? 20 : 16,
@@ -49192,7 +49402,7 @@ var AvlExprTree = ({
49192
49402
  className,
49193
49403
  color = "var(--color-primary)"
49194
49404
  }) => {
49195
- const ids = React92__default.useMemo(() => {
49405
+ const ids = React93__default.useMemo(() => {
49196
49406
  avlEtId += 1;
49197
49407
  return { glow: `avl-et-${avlEtId}-glow` };
49198
49408
  }, []);
@@ -50027,7 +50237,7 @@ var SystemNode = ({ data }) => {
50027
50237
  stateChain.length > 0 && /* @__PURE__ */ jsx("svg", { width: stateChain.length * 14 + 2, height: 10, viewBox: `0 0 ${stateChain.length * 14 + 2} 10`, children: stateChain.map((s, i) => {
50028
50238
  const tc = transitionCounts[s.name] ?? 0;
50029
50239
  const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
50030
- return /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
50240
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
50031
50241
  /* @__PURE__ */ jsx(AvlState, { x: i * 14 + 1, y: 1, width: 10, height: 8, name: "", role, isInitial: s.isInitial ?? void 0, isTerminal: s.isTerminal ?? void 0 }),
50032
50242
  i < stateChain.length - 1 && /* @__PURE__ */ jsx("line", { x1: i * 14 + 12, y1: 5, x2: i * 14 + 15, y2: 5, stroke: "var(--color-border)", strokeWidth: 0.5 })
50033
50243
  ] }, s.name);
@@ -51114,7 +51324,7 @@ function resolveLambdaBindings(body, params, item, index) {
51114
51324
  }
51115
51325
  return substituted;
51116
51326
  }
51117
- if (body !== null && typeof body === "object" && !React92__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
51327
+ if (body !== null && typeof body === "object" && !React93__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
51118
51328
  const out = {};
51119
51329
  for (const [k, v] of Object.entries(body)) {
51120
51330
  out[k] = recur(v);
@@ -51147,7 +51357,7 @@ function deferLambdaEntityExprs(value) {
51147
51357
  }
51148
51358
  return arr.map((v) => deferLambdaEntityExprs(v));
51149
51359
  }
51150
- if (value !== null && typeof value === "object" && !React92__default.isValidElement(value) && !(value instanceof Date) && typeof value !== "function" && !isRenderBindingMarker(value)) {
51360
+ if (value !== null && typeof value === "object" && !React93__default.isValidElement(value) && !(value instanceof Date) && typeof value !== "function" && !isRenderBindingMarker(value)) {
51151
51361
  const out = {};
51152
51362
  for (const [k, v] of Object.entries(value)) {
51153
51363
  out[k] = deferLambdaEntityExprs(v);
@@ -51161,7 +51371,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
51161
51371
  const resolvedBody = deferLambdaEntityExprs(
51162
51372
  resolveLambdaBindings(lambdaBody, params, item, index)
51163
51373
  );
51164
- if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React92__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
51374
+ if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React93__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
51165
51375
  return null;
51166
51376
  }
51167
51377
  const record = resolvedBody;
@@ -51180,7 +51390,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
51180
51390
  props: childProps,
51181
51391
  priority: 0
51182
51392
  };
51183
- return React92__default.createElement(SlotContentRenderer2, { content: childContent });
51393
+ return React93__default.createElement(SlotContentRenderer2, { content: childContent });
51184
51394
  };
51185
51395
  }
51186
51396
  function convertNode(node, callerKey) {
@@ -51200,7 +51410,7 @@ function convertNode(node, callerKey) {
51200
51410
  });
51201
51411
  return anyChanged ? mapped : node;
51202
51412
  }
51203
- if (typeof node === "object" && !React92__default.isValidElement(node) && !(node instanceof Date)) {
51413
+ if (typeof node === "object" && !React93__default.isValidElement(node) && !(node instanceof Date)) {
51204
51414
  return convertObjectProps(node);
51205
51415
  }
51206
51416
  return node;
@@ -53123,8 +53333,8 @@ function CanvasDndProvider({
53123
53333
  }) {
53124
53334
  const eventBus = useEventBus();
53125
53335
  const sensors = useAlmadarDndSensors(false);
53126
- const [activePayload, setActivePayload] = React92__default.useState(null);
53127
- const handleDragStart = React92__default.useCallback((e) => {
53336
+ const [activePayload, setActivePayload] = React93__default.useState(null);
53337
+ const handleDragStart = React93__default.useCallback((e) => {
53128
53338
  const data = e.active.data.current;
53129
53339
  const payload = data?.payload;
53130
53340
  if (payload) {
@@ -53135,7 +53345,7 @@ function CanvasDndProvider({
53135
53345
  log9.warn("dragStart:missing-payload", { id: e.active.id });
53136
53346
  }
53137
53347
  }, [eventBus]);
53138
- const handleDragEnd = React92__default.useCallback((e) => {
53348
+ const handleDragEnd = React93__default.useCallback((e) => {
53139
53349
  setActivePayload(null);
53140
53350
  const activeData = e.active.data.current;
53141
53351
  const payload = activeData?.payload;
@@ -53164,7 +53374,7 @@ function CanvasDndProvider({
53164
53374
  const suppressed = onDrop ? onDrop(drop) === true : false;
53165
53375
  if (!suppressed) defaultEmit(eventBus, drop);
53166
53376
  }, [eventBus, onDrop]);
53167
- const handleDragCancel = React92__default.useCallback(() => {
53377
+ const handleDragCancel = React93__default.useCallback(() => {
53168
53378
  setActivePayload(null);
53169
53379
  log9.info("dragCancel");
53170
53380
  }, []);
@@ -53922,7 +54132,7 @@ var OrbPreviewNodeInner = (props) => {
53922
54132
  }
53923
54133
  );
53924
54134
  };
53925
- var OrbPreviewNode = React92__default.memo(OrbPreviewNodeInner);
54135
+ var OrbPreviewNode = React93__default.memo(OrbPreviewNodeInner);
53926
54136
  OrbPreviewNode.displayName = "OrbPreviewNode";
53927
54137
  orbPreviewLog.debug("export-resolved", () => ({
53928
54138
  type: typeof OrbPreviewNode,
@@ -54027,7 +54237,7 @@ var EventFlowEdgeInner = (props) => {
54027
54237
  ) })
54028
54238
  ] });
54029
54239
  };
54030
- var EventFlowEdge = React92__default.memo(EventFlowEdgeInner);
54240
+ var EventFlowEdge = React93__default.memo(EventFlowEdgeInner);
54031
54241
  EventFlowEdge.displayName = "EventFlowEdge";
54032
54242
 
54033
54243
  // components/avl/molecules/BehaviorComposeNode.tsx
@@ -54174,7 +54384,7 @@ var BehaviorComposeNodeInner = (props) => {
54174
54384
  }
54175
54385
  );
54176
54386
  };
54177
- var BehaviorComposeNode = React92__default.memo(BehaviorComposeNodeInner);
54387
+ var BehaviorComposeNode = React93__default.memo(BehaviorComposeNodeInner);
54178
54388
  BehaviorComposeNode.displayName = "BehaviorComposeNode";
54179
54389
 
54180
54390
  // components/avl/lib/avl-behavior-compose-converter.ts
@@ -55200,7 +55410,7 @@ var TraitCardNodeInner = (props) => {
55200
55410
  }
55201
55411
  );
55202
55412
  };
55203
- var TraitCardNode = React92__default.memo(TraitCardNodeInner);
55413
+ var TraitCardNode = React93__default.memo(TraitCardNodeInner);
55204
55414
  TraitCardNode.displayName = "TraitCardNode";
55205
55415
 
55206
55416
  // components/avl/organisms/FlowCanvas.tsx
@@ -55281,7 +55491,7 @@ function FlowCanvasInner({
55281
55491
  initialOrbital
55282
55492
  );
55283
55493
  const [expandedBehaviorAlias, setExpandedBehaviorAlias] = useState(void 0);
55284
- const screenSizeUserOverrideRef = React92__default.useRef(false);
55494
+ const screenSizeUserOverrideRef = React93__default.useRef(false);
55285
55495
  const [screenSize, setScreenSize] = useState(
55286
55496
  () => typeof window === "undefined" ? "laptop" : detectScreenSize(window.innerWidth)
55287
55497
  );
@@ -55665,7 +55875,7 @@ var ZoomBreadcrumb = ({
55665
55875
  if (eventName && band === "detail") {
55666
55876
  segments.push({ icon: "\u26A1", label: eventName });
55667
55877
  }
55668
- return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-xs text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
55878
+ return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-xs text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
55669
55879
  i > 0 && /* @__PURE__ */ jsx("span", { className: "opacity-40", children: ">" }),
55670
55880
  /* @__PURE__ */ jsx("span", { className: "opacity-60", children: seg.icon }),
55671
55881
  /* @__PURE__ */ jsx("span", { children: seg.label })
@@ -56006,7 +56216,7 @@ var EventWireOverlay = ({
56006
56216
  containerW,
56007
56217
  containerH
56008
56218
  }) => {
56009
- const ids = React92__default.useMemo(() => {
56219
+ const ids = React93__default.useMemo(() => {
56010
56220
  avlOczWireId += 1;
56011
56221
  return { arrow: `avl-ocz-wire-${avlOczWireId}-arrow` };
56012
56222
  }, []);
@@ -56373,7 +56583,7 @@ var AvlOrbitalsCosmicZoom = ({
56373
56583
  borderRadius: 6,
56374
56584
  border: `1px solid ${color}`
56375
56585
  },
56376
- children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
56586
+ children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
56377
56587
  i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", style: { opacity: 0.5, color }, children: "/" }),
56378
56588
  i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
56379
56589
  Box,