uilint-react 0.2.137 → 0.2.138
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/DevTool.d.ts.map +1 -1
- package/dist/SchemaPanel-0lLkqa2L.js +893 -0
- package/dist/SchemaPanel-0lLkqa2L.js.map +1 -0
- package/dist/components/ui-lint/index.d.ts +1 -2
- package/dist/components/ui-lint/index.d.ts.map +1 -1
- package/dist/components/ui-lint/types.d.ts +10 -45
- package/dist/components/ui-lint/types.d.ts.map +1 -1
- package/dist/consistency/highlights.d.ts.map +1 -1
- package/dist/core/plugin-system/adapter.d.ts +24 -0
- package/dist/core/plugin-system/adapter.d.ts.map +1 -0
- package/dist/core/plugin-system/index.d.ts +2 -1
- package/dist/core/plugin-system/index.d.ts.map +1 -1
- package/dist/core/plugin-system/loader.d.ts +22 -2
- package/dist/core/plugin-system/loader.d.ts.map +1 -1
- package/dist/core/plugin-system/types.d.ts +1 -7
- package/dist/core/plugin-system/types.d.ts.map +1 -1
- package/dist/core/services/websocket.d.ts +2 -1
- package/dist/core/services/websocket.d.ts.map +1 -1
- package/dist/core/store/composed-store.d.ts +5 -5
- package/dist/core/store/composed-store.d.ts.map +1 -1
- package/dist/core/store/core-slice.d.ts +36 -0
- package/dist/core/store/core-slice.d.ts.map +1 -1
- package/dist/devtools.js +116 -116
- package/dist/devtools.js.map +1 -1
- package/dist/index-Cc4gwBce.js +18605 -0
- package/dist/index-Cc4gwBce.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +53 -18890
- package/dist/index.js.map +1 -1
- package/dist/plugins/eslint/panels/RulePanel.d.ts.map +1 -1
- package/dist/plugins/eslint/tile-provider.d.ts +2 -1
- package/dist/plugins/eslint/tile-provider.d.ts.map +1 -1
- package/dist/ui/UILint.d.ts.map +1 -1
- package/dist/ui/components/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/ui/components/CommandPalette/EmptyState.d.ts.map +1 -1
- package/dist/ui/components/CommandPalette/ExpandableTile.d.ts.map +1 -1
- package/dist/ui/components/CommandPalette/ExpandableTileGrid.d.ts.map +1 -1
- package/dist/ui/components/CommandPalette/ExpandedTileHeader.d.ts.map +1 -1
- package/dist/ui/components/CommandPalette/OnboardingState.d.ts.map +1 -1
- package/dist/ui/components/CommandPalette/RuleToggleBar.d.ts +3 -0
- package/dist/ui/components/CommandPalette/RuleToggleBar.d.ts.map +1 -0
- package/dist/ui/components/CommandPalette/index.d.ts +2 -2
- package/dist/ui/components/CommandPalette/index.d.ts.map +1 -1
- package/dist/ui/components/CommandPalette/layout/index.d.ts +4 -6
- package/dist/ui/components/CommandPalette/layout/index.d.ts.map +1 -1
- package/dist/ui/components/HeatmapOverlay.d.ts.map +1 -1
- package/dist/ui/components/HierarchicalTiles/ExpandableContainer.d.ts.map +1 -1
- package/dist/ui/components/HierarchicalTiles/ExpandableTileGrid.d.ts.map +1 -1
- package/dist/ui/components/HierarchicalTiles/Tile.d.ts +6 -8
- package/dist/ui/components/HierarchicalTiles/Tile.d.ts.map +1 -1
- package/dist/ui/components/HierarchicalTiles/TileGrid.d.ts +6 -5
- package/dist/ui/components/HierarchicalTiles/TileGrid.d.ts.map +1 -1
- package/dist/ui/components/HierarchicalTiles/TileHeader.d.ts +7 -6
- package/dist/ui/components/HierarchicalTiles/TileHeader.d.ts.map +1 -1
- package/dist/ui/components/HierarchicalTiles/layout/mosaic-layout.d.ts +9 -3
- package/dist/ui/components/HierarchicalTiles/layout/mosaic-layout.d.ts.map +1 -1
- package/dist/ui/components/HierarchicalTiles/layout/types.d.ts +4 -0
- package/dist/ui/components/HierarchicalTiles/layout/types.d.ts.map +1 -1
- package/dist/ui/components/HierarchicalTiles/types.d.ts +2 -3
- package/dist/ui/components/HierarchicalTiles/types.d.ts.map +1 -1
- package/dist/ui/components/Inspector/Breadcrumbs.d.ts +3 -1
- package/dist/ui/components/Inspector/Breadcrumbs.d.ts.map +1 -1
- package/dist/ui/components/Inspector/CollapsedIssueIndicator.d.ts.map +1 -1
- package/dist/ui/components/Inspector/ElementDetail.d.ts.map +1 -1
- package/dist/ui/components/Inspector/FileNodeAdapter.d.ts +2 -1
- package/dist/ui/components/Inspector/FileNodeAdapter.d.ts.map +1 -1
- package/dist/ui/components/Inspector/InspectorSidebar.d.ts.map +1 -1
- package/dist/ui/components/Inspector/IssueDetail.d.ts.map +1 -1
- package/dist/ui/components/Inspector/IssuesList.d.ts.map +1 -1
- package/dist/ui/components/Inspector/RuleHeader.d.ts +6 -1
- package/dist/ui/components/Inspector/RuleHeader.d.ts.map +1 -1
- package/dist/ui/components/Inspector/RuleNodeAdapter.d.ts.map +1 -1
- package/dist/ui/components/Inspector/SourceViewer.d.ts.map +1 -1
- package/dist/ui/components/InspectorToggle.d.ts.map +1 -1
- package/dist/ui/components/PluginToolbar.d.ts +6 -0
- package/dist/ui/components/PluginToolbar.d.ts.map +1 -0
- package/dist/ui/components/Popover.d.ts.map +1 -1
- package/dist/ui/components/RegionSelector.d.ts.map +1 -1
- package/dist/ui/components/Schema/SchemaPanel.d.ts +20 -0
- package/dist/ui/components/Schema/SchemaPanel.d.ts.map +1 -0
- package/dist/ui/components/Schema/binding-utils.d.ts +49 -0
- package/dist/ui/components/Schema/binding-utils.d.ts.map +1 -0
- package/dist/ui/components/Schema/icon-map.d.ts +16 -0
- package/dist/ui/components/Schema/icon-map.d.ts.map +1 -0
- package/dist/ui/components/Schema/index.d.ts +10 -0
- package/dist/ui/components/Schema/index.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/ActionsSection.d.ts +13 -0
- package/dist/ui/components/Schema/sections/ActionsSection.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/BadgeSection.d.ts +12 -0
- package/dist/ui/components/Schema/sections/BadgeSection.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/CardSection.d.ts +13 -0
- package/dist/ui/components/Schema/sections/CardSection.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/CodeComparisonSection.d.ts +14 -0
- package/dist/ui/components/Schema/sections/CodeComparisonSection.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/CodeViewerSection.d.ts +14 -0
- package/dist/ui/components/Schema/sections/CodeViewerSection.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/ConditionalSection.d.ts +14 -0
- package/dist/ui/components/Schema/sections/ConditionalSection.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/DividerSection.d.ts +10 -0
- package/dist/ui/components/Schema/sections/DividerSection.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/HeaderSection.d.ts +12 -0
- package/dist/ui/components/Schema/sections/HeaderSection.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/ImageSection.d.ts +12 -0
- package/dist/ui/components/Schema/sections/ImageSection.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/ListSection.d.ts +14 -0
- package/dist/ui/components/Schema/sections/ListSection.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/ProgressSection.d.ts +12 -0
- package/dist/ui/components/Schema/sections/ProgressSection.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/TextSection.d.ts +12 -0
- package/dist/ui/components/Schema/sections/TextSection.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/index.d.ts +18 -0
- package/dist/ui/components/Schema/sections/index.d.ts.map +1 -0
- package/dist/ui/components/badge.d.ts.map +1 -1
- package/dist/ui/components/bottom-sheet.d.ts.map +1 -1
- package/dist/ui/components/button.d.ts.map +1 -1
- package/dist/ui/hooks/useTileItems.d.ts.map +1 -1
- package/dist/ui/types.d.ts +1 -1
- package/package.json +14 -4
- package/dist/index-L3Zm-CoX.js +0 -513
- package/dist/index-L3Zm-CoX.js.map +0 -1
- package/dist/plugins/semantic/commands.d.ts +0 -6
- package/dist/plugins/semantic/commands.d.ts.map +0 -1
- package/dist/plugins/semantic/index.d.ts +0 -15
- package/dist/plugins/semantic/index.d.ts.map +0 -1
- package/dist/plugins/semantic/panels/DuplicateSimilarityBadge.d.ts +0 -21
- package/dist/plugins/semantic/panels/DuplicateSimilarityBadge.d.ts.map +0 -1
- package/dist/plugins/semantic/panels/DuplicatesInspectorPanel.d.ts +0 -8
- package/dist/plugins/semantic/panels/DuplicatesInspectorPanel.d.ts.map +0 -1
- package/dist/plugins/semantic/panels/ScrollableCodeSection.d.ts +0 -27
- package/dist/plugins/semantic/panels/ScrollableCodeSection.d.ts.map +0 -1
- package/dist/plugins/semantic/panels/index.d.ts +0 -11
- package/dist/plugins/semantic/panels/index.d.ts.map +0 -1
- package/dist/plugins/semantic/panels/useDiffHighlights.d.ts +0 -45
- package/dist/plugins/semantic/panels/useDiffHighlights.d.ts.map +0 -1
- package/dist/plugins/semantic/slice.d.ts +0 -52
- package/dist/plugins/semantic/slice.d.ts.map +0 -1
- package/dist/plugins/semantic/types.d.ts +0 -121
- package/dist/plugins/semantic/types.d.ts.map +0 -1
- package/dist/plugins/vision/commands.d.ts +0 -6
- package/dist/plugins/vision/commands.d.ts.map +0 -1
- package/dist/plugins/vision/index.d.ts +0 -12
- package/dist/plugins/vision/index.d.ts.map +0 -1
- package/dist/plugins/vision/slice.d.ts +0 -123
- package/dist/plugins/vision/slice.d.ts.map +0 -1
- package/dist/plugins/vision/types.d.ts +0 -169
- package/dist/plugins/vision/types.d.ts.map +0 -1
- package/dist/scanner/vision-capture.d.ts +0 -131
- package/dist/scanner/vision-capture.d.ts.map +0 -1
- package/dist/ui/components/CommandPalette/Tile.d.ts +0 -18
- package/dist/ui/components/CommandPalette/Tile.d.ts.map +0 -1
- package/dist/ui/components/CommandPalette/TileGrid.d.ts +0 -20
- package/dist/ui/components/CommandPalette/TileGrid.d.ts.map +0 -1
- package/dist/ui/components/CommandPalette/layout/expanded-layout.d.ts +0 -43
- package/dist/ui/components/CommandPalette/layout/expanded-layout.d.ts.map +0 -1
- package/dist/ui/components/CommandPalette/layout/mosaic-layout.d.ts +0 -89
- package/dist/ui/components/CommandPalette/layout/mosaic-layout.d.ts.map +0 -1
- package/dist/ui/components/CommandPalette/layout/types.d.ts +0 -67
- package/dist/ui/components/CommandPalette/layout/types.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-Cc4gwBce.js","sources":["../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js","../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.development.js","../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js","../src/core/store/core-slice.ts","../src/core/store/tile-selectors.ts","../src/core/store/heatmap-selectors.ts","../src/core/store/file-groups-selector.ts","../src/core/store/issues-selectors.ts","../../../node_modules/.pnpm/zustand@5.0.10_@types+react@19.2.8_react@19.2.3/node_modules/zustand/esm/vanilla.mjs","../../../node_modules/.pnpm/zustand@5.0.10_@types+react@19.2.8_react@19.2.3/node_modules/zustand/esm/react.mjs","../src/core/store/drag-slice.ts","../src/core/plugin-system/registry.ts","../src/core/store/subscriptions.ts","../src/core/store/composed-store.ts","../src/ui/hooks/useElementRects.ts","../src/ui/types.ts","../src/ui/components/HeatmapOverlay.tsx","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/utils/use-constant.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/utils/is-browser.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/context/PresenceContext.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/array.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/clamp.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/format-error-message.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/errors.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/global-config.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/is-numerical-string.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/is-object.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/is-zero-value-string.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/memo.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/noop.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/pipe.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/progress.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/subscription-manager.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/time-conversion.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/velocity-per-second.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/warn-once.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/easing/back.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/easing/anticipate.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/easing/circ.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/easing/ease.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs","../../../node_modules/.pnpm/motion-utils@12.24.10/node_modules/motion-utils/dist/es/easing/utils/map.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/frameloop/order.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/frameloop/render-step.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/frameloop/batcher.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/frameloop/frame.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/frameloop/sync-time.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/types/numbers/index.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/types/color/utils.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/types/color/hex.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/types/numbers/units.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/types/color/index.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/types/complex/index.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/utils/mix/immediate.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/utils/mix/number.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/utils/mix/color.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/utils/mix/visibility.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/utils/mix/complex.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/utils/mix/index.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/generators/spring/defaults.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/generators/spring/find.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/generators/spring/index.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/utils/interpolate.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/dom/style-set.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/utils/supports/flags.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/utils/supports/memo.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/utils/get-final-keyframe.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/utils/keys-position.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/index.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/utils/setters.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/will-change/is.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/types/auto.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/types/test.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/types/dimensions.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/types/complex/filter.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/types/int.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/types/maps/transform.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/types/maps/number.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/utils/is-html-element.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/frameloop/microtask.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/gestures/utils/setup.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/gestures/hover.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/gestures/press/index.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/utils/is-svg-element.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/types/utils/find.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/projection/geometry/models.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/store.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/utils/is-variant-label.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/utils/variant-props.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/utils/motion-values.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/VisualElement.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/Feature.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/projection/utils/measure.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/html/utils/build-styles.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/html/utils/render.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/svg/utils/path.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/svg/utils/render.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/utils/shallow-compare.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/projection/geometry/copy.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/projection/geometry/utils.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/projection/styles/transform.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/utils/delay.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/events/add-dom-event.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/animation/animate/single-value.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/projection/shared/stack.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/projection/node/state.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs","../../../node_modules/.pnpm/motion-dom@12.26.2/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/context/LazyContext.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/motion/features/definitions.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/motion/features/load-features.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/context/MotionContext/index.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/context/MotionContext/create.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/render/html/use-props.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/render/svg/use-props.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/render/dom/use-render.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/motion/utils/symbol.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/utils/is-ref-object.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/motion/index.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/render/components/create-proxy.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/motion/features/animation/index.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/motion/features/animations.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/events/event-info.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/utils/get-context-window.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/utils/distance.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/gestures/drag/index.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/gestures/pan/index.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/motion/features/drag.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/gestures/hover.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/gestures/focus.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/gestures/press.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/motion/features/gestures.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/motion/features/layout.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs","../../../node_modules/.pnpm/framer-motion@12.26.2_@emotion+is-prop-valid@1.4.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs","../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs","../../../node_modules/.pnpm/tailwind-merge@3.4.0/node_modules/tailwind-merge/dist/bundle-mjs.mjs","../src/lib/utils.ts","../src/ui/hooks/useIssues.ts","../src/core/services/websocket.ts","../src/core/services/source-cache.ts","../src/core/services/manifest-fetcher.ts","../src/plugins/eslint/static-handler.ts","../src/ui/hooks/useSourceCode.ts","../src/ui/hooks/useTileNavigation.ts","../src/ui/hooks/useTileItems.ts","../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/shared/src/utils.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/defaultAttributes.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/Icon.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/createLucideIcon.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/brain.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/camera.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/check.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/chevron-down.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/chevron-left.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/chevron-right.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/chevron-up.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/circle-alert.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/circle-check-big.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/circle-question-mark.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/circle-x.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/clipboard.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/clock.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/code-xml.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/code.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/copy.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/crop.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/external-link.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/eye.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/file-code.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/file.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/folder.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/funnel.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/git-branch.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/info.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/layers.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/link.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/loader-circle.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/maximize-2.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/minus.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/panel-right.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/pause.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/play.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/plus.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/refresh-cw.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/scan-line.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/search.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/settings.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/sparkles.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/square-pen.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/target.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/terminal.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/trash-2.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/triangle-alert.js","../../../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/x.js","../src/ui/icons.tsx","../src/ui/components/kbd.tsx","../src/ui/components/badge.tsx","../../../node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.2_@types+react@19.2.8_react@19.2.3/node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../../node_modules/.pnpm/@radix-ui+react-slot@1.2.4_@types+react@19.2.8_react@19.2.3/node_modules/@radix-ui/react-slot/dist/index.mjs","../src/ui/components/button.tsx","../src/ui/components/icon-button.tsx","../src/ui/components/input.tsx","../src/ui/components/card.tsx","../src/ui/components/glass-panel.tsx","../src/ui/components/Popover.tsx","../src/ui/components/CommandPalette/SearchInput.tsx","../src/ui/components/HierarchicalTiles/Tile.tsx","../src/ui/components/HierarchicalTiles/layout/mosaic-layout.ts","../src/ui/components/HierarchicalTiles/layout/expanded-layout.ts","../src/ui/components/HierarchicalTiles/animations/expansion-animations.ts","../src/ui/components/HierarchicalTiles/TileGrid.tsx","../src/ui/components/CommandPalette/OnboardingState.tsx","../src/ui/components/CommandPalette/RuleToggleBar.tsx","../src/ui/components/CommandPalette/CommandPalette.tsx","../src/ui/components/Inspector/OptionField.tsx","../src/ui/components/Inspector/RuleOptionsForm.tsx","../src/ui/components/Inspector/RuleConfig.tsx","../src/ui/components/Inspector/RuleHeader.tsx","../src/ui/hooks/useFullSourceCode.ts","../src/ui/components/Inspector/IssueAnnotation.tsx","../src/ui/components/Inspector/IssueReference.tsx","../src/ui/components/Inspector/CollapsedIssueIndicator.tsx","../src/ui/components/Inspector/source-regions.ts","../src/ui/components/Inspector/CodeRegion.tsx","../src/ui/components/Inspector/CollapsedLines.tsx","../src/ui/components/Inspector/FileSourceView.tsx","../src/ui/components/Inspector/IssueSummaryView.tsx","../src/ui/components/Inspector/Breadcrumbs.tsx","../src/ui/components/HierarchicalTiles/HierarchyProvider.tsx","../src/ui/components/HierarchicalTiles/TileHeader.tsx","../src/ui/components/HierarchicalTiles/ExpandableTileGrid.tsx","../src/ui/components/Inspector/RuleNodeAdapter.tsx","../src/ui/components/Inspector/IssuesList.tsx","../src/components/ui-lint/code-formatting.ts","../src/ui/components/Inspector/SourceViewer.tsx","../src/ui/components/Inspector/IssueDetail.tsx","../src/ui/components/Inspector/ElementDetail.tsx","../src/ui/components/Inspector/ResizeHandle.tsx","../src/ui/components/Inspector/InspectorSidebar.tsx","../src/ui/components/PluginToolbar.tsx","../src/ui/components/InspectorToggle.tsx","../src/ui/components/RegionSelector.tsx","../src/ui/UILint.tsx","../src/components/ui-lint/types.ts","../src/components/ui-lint/dom-utils.ts","../src/components/ui-lint/source-fetcher.ts","../src/consistency/snapshot.ts","../src/consistency/highlights.tsx","../src/core/services/dom-observer.ts","../src/ui/components/Schema/icon-map.tsx","../src/core/plugin-system/adapter.ts","../src/core/plugin-system/loader.ts","../src/plugins/eslint/commands.ts","../src/plugins/eslint/slice.ts","../src/plugins/eslint/scanner.ts","../src/plugins/eslint/panels/RulePanel.tsx","../src/plugins/eslint/tile-provider.ts","../src/plugins/eslint/types.ts","../src/plugins/eslint/index.ts","../src/plugins/fix-prompt/FixPromptPanel.tsx","../src/plugins/fix-prompt/index.ts","../src/styles/inject-styles.ts","../src/DevTool.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","/**\n * Core UI State Slice\n *\n * Contains ONLY core UI state that doesn't belong to any plugin.\n * Uses Zustand's StateCreator pattern for composable slices.\n */\n\nimport type { StateCreator } from \"zustand\";\nimport { devWarn } from \"uilint-core\";\nimport type {\n PluginServices,\n TileItem,\n ExpandedTile,\n ExpansionPath,\n ExpansionLevel,\n} from \"../plugin-system/types\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Breakpoints for responsive design.\n */\nexport const BREAKPOINTS = {\n sm: 640,\n md: 768,\n lg: 1024,\n} as const;\n\n/**\n * Mobile/viewport detection state.\n */\nexport interface MobileState {\n /** Viewport width < 768px */\n isMobile: boolean;\n /** Viewport width >= 768px and < 1024px */\n isTablet: boolean;\n /** Device has touch capability */\n isTouchDevice: boolean;\n /** Viewport width < 640px */\n isSmallScreen: boolean;\n}\n\n/**\n * Connection status for onboarding UI.\n * Tracks the connection state and provides details for user feedback.\n */\nexport interface ConnectionStatus {\n /** Operating mode: websocket (live) or static (manifest-based) */\n mode: \"websocket\" | \"static\";\n /** Current reconnection attempt number (websocket mode) */\n reconnectAttempts: number;\n /** Maximum reconnection attempts before giving up */\n maxReconnectAttempts: number;\n /** Whether max reconnect attempts have been exhausted */\n reconnectExhausted: boolean;\n /** Error message if connection/manifest failed */\n error: string | null;\n}\n\n/**\n * Filter chip for the command palette search.\n * @deprecated Use TileFilter from plugin-system/types instead\n */\nexport interface CommandPaletteFilter {\n type: \"rule\" | \"issue\" | \"loc\" | \"file\" | \"capture\" | \"plugin\";\n value: string;\n label: string;\n}\n\n/**\n * Command palette state.\n */\nexport interface CommandPaletteState {\n /** Whether the command palette is open */\n open: boolean;\n /** Current search query */\n query: string;\n /** Currently selected index for keyboard navigation */\n selectedIndex: number;\n /**\n * Expansion path for the expandable tile UI.\n * Stack of expanded tiles representing the current drill-down state.\n * Empty array = root view (no expansion).\n */\n expansionPath: ExpansionPath;\n}\n\n/**\n * Inspector sidebar state.\n */\nexport interface InspectorState {\n /** Whether the inspector is open */\n open: boolean;\n /** Which plugin panel is currently shown (null if none) - DEPRECATED: use unified view */\n panelId: string | null;\n /** Data passed to the panel - DEPRECATED: use unified view */\n data: Record<string, unknown> | null;\n /** Whether inspector is docked (participates in layout) or floating */\n docked: boolean;\n /** Width when docked (resizable) */\n width: number;\n /** Position when floating */\n floatingPosition: { x: number; y: number } | null;\n /** Size when floating */\n floatingSize: { width: number; height: number } | null;\n /** Computed available width for tile grid layout (derived from width/floatingSize) */\n layoutAvailableWidth: number;\n /** File paths that are expanded in the issues list */\n expandedFiles: string[];\n /** Expanded rule ID (level 0) */\n expandedRuleId: string | null;\n /** Expanded file path within the rule (level 1) */\n expandedFilePath: string | null;\n /** Currently selected issue ID (for heatmap highlight sync) */\n selectedIssueId: string | null;\n /** Whether the rule config section is expanded */\n ruleConfigExpanded: boolean;\n /** Whether to show full source view (false = show issue summary view) */\n showFullSource: boolean;\n}\n\n/**\n * Heat map filter state for focusing on related elements.\n * Used when inspecting issues that reference multiple locations (e.g., duplicates).\n */\nexport interface HeatmapFilterState {\n /**\n * Filter mode:\n * - \"all\": Show all elements with issues (default)\n * - \"related-only\": Only show elements in highlightedLocs\n */\n mode: \"all\" | \"related-only\";\n /**\n * dataLoc values to highlight when mode is \"related-only\".\n * Empty array = show all elements.\n */\n highlightedLocs: string[];\n /**\n * Optional label describing the filter (e.g., \"Duplicate Pair\")\n */\n filterLabel: string | null;\n}\n\n// ============================================================================\n// Overlay Interaction\n// ============================================================================\n\n/**\n * Generic overlay interaction requested by a plugin.\n * Plugins request interactions (e.g., region selection) and the host\n * renders the appropriate UI, then dispatches results back to the plugin.\n */\nexport interface OverlayInteraction {\n /** Interaction type — determines which UI the host renders */\n type: \"region-select\";\n /** Plugin ID that requested the interaction */\n pluginId: string;\n /** Callback when interaction completes successfully */\n onComplete: (result: unknown) => void;\n /** Callback when interaction is cancelled */\n onCancel: () => void;\n}\n\n// ============================================================================\n// Slice Interface\n// ============================================================================\n\n/**\n * Core UI state slice interface.\n * Contains state and actions for core UI functionality.\n */\nexport interface CoreSlice {\n // ============ Alt Key Mode ============\n /** Whether the Alt key is currently held */\n altKeyHeld: boolean;\n /** Set Alt key held state */\n setAltKeyHeld: (held: boolean) => void;\n\n // ============ Selection ============\n /** Currently selected element ID */\n selectedElementId: string | null;\n /** Currently hovered element ID (for overlay highlighting) */\n hoveredElementId: string | null;\n /** Set selected element ID */\n setSelectedElementId: (id: string | null) => void;\n /** Set hovered element ID */\n setHoveredElementId: (id: string | null) => void;\n\n // ============ Command Palette ============\n /** Command palette state */\n commandPalette: CommandPaletteState;\n /** Open the command palette */\n openCommandPalette: () => void;\n /** Close the command palette */\n closeCommandPalette: () => void;\n /** Set the command palette search query */\n setCommandPaletteQuery: (query: string) => void;\n /** Set the selected index for keyboard navigation */\n setCommandPaletteSelectedIndex: (index: number) => void;\n\n // ============ Tile Expansion ============\n /**\n * Expand a tile, showing its children inside it.\n * Pushes the tile onto the expansion path stack.\n * @param tile The tile item to expand\n * @param children The children to show inside the expanded tile\n * @param siblings Other tiles at the same level (for collapsed strip)\n * @param providerId The provider that owns this tile\n */\n expandTile: (\n tile: TileItem,\n children: TileItem[],\n siblings: TileItem[],\n providerId: string\n ) => void;\n /**\n * Collapse the most recently expanded tile.\n * Pops from the expansion path stack.\n */\n collapseTile: () => void;\n /**\n * Collapse to a specific level in the expansion path.\n * @param level The level to collapse to (0 = root)\n */\n collapseToLevel: (level: ExpansionLevel) => void;\n /**\n * Collapse all expanded tiles, returning to root view.\n */\n collapseAll: () => void;\n /**\n * Get the current expansion level.\n * @returns The current depth (0 = root, 1 = first expansion, etc.)\n */\n getCurrentExpansionLevel: () => ExpansionLevel;\n\n // ============ Inspector ============\n /** Inspector sidebar state */\n inspector: InspectorState;\n /** Open the inspector with a specific panel - DEPRECATED: use openInspectorPanel */\n openInspector: (panelId: string, data?: Record<string, unknown>) => void;\n /** Open the inspector (unified view) */\n openInspectorPanel: () => void;\n /** Close the inspector */\n closeInspector: () => void;\n /** Toggle between docked and floating mode */\n toggleInspectorDocked: () => void;\n /** Set inspector width (docked mode) */\n setInspectorWidth: (width: number) => void;\n /** Set inspector position (floating mode) */\n setInspectorFloatingPosition: (position: { x: number; y: number }) => void;\n /** Set inspector size (floating mode) */\n setInspectorFloatingSize: (size: { width: number; height: number }) => void;\n /** Toggle a file's expanded state in the issues list */\n toggleFileExpanded: (filePath: string) => void;\n /** Expand a specific file in the issues list */\n expandFile: (filePath: string) => void;\n /** Collapse a specific file in the issues list */\n collapseFile: (filePath: string) => void;\n /** Expand a rule tile (level 0) */\n expandRule: (ruleId: string) => void;\n /** Collapse the expanded rule */\n collapseRule: () => void;\n /** Expand a file within the expanded rule (level 1) */\n expandFileInRule: (filePath: string) => void;\n /** Collapse the expanded file, keeping rule expanded */\n collapseFileInRule: () => void;\n /** Collapse all (both rule and file) */\n collapseAllInspector: () => void;\n /** Select an issue (for heatmap highlight sync) */\n selectIssue: (issueId: string | null) => void;\n /** Toggle the rule config section */\n toggleRuleConfig: () => void;\n /** Show the full source view */\n showFullSourceView: () => void;\n /** Show the issue summary view (hide full source) */\n showIssueSummaryView: () => void;\n\n // ============ Connection (delegated from websocket service) ============\n /** Whether connected to the WebSocket server */\n wsConnected: boolean;\n /** WebSocket server URL */\n wsUrl: string;\n /** Detailed connection status for onboarding UI */\n connectionStatus: ConnectionStatus;\n /** Update connection status (called by DevTool/websocket handlers) */\n setConnectionStatus: (status: Partial<ConnectionStatus>) => void;\n /** Retry the connection (websocket mode only) */\n retryConnection: () => void;\n\n // ============ Heatmap Filtering ============\n /** Heat map filter state for focusing on related elements */\n heatmapFilter: HeatmapFilterState;\n /**\n * Set heatmap filter to highlight specific elements\n * @param locs dataLoc values to highlight\n * @param label Optional label describing the filter\n */\n setHeatmapFilter: (locs: string[], label?: string) => void;\n /** Clear heatmap filter (show all elements) */\n clearHeatmapFilter: () => void;\n\n // ============ Mobile/Viewport Detection ============\n /** Mobile detection state */\n mobile: MobileState;\n /** Update mobile state (called by subscriptions) */\n setMobileState: (state: MobileState) => void;\n\n // ============ Overlay Interactions ============\n /**\n * Active overlay interaction requested by a plugin.\n * The host renders the appropriate UI (e.g., RegionSelector)\n * and dispatches the result back to the plugin.\n */\n overlayInteraction: OverlayInteraction | null;\n /**\n * Start an overlay interaction (called by plugins).\n * @param interaction The interaction configuration\n */\n startOverlayInteraction: (interaction: OverlayInteraction) => void;\n /**\n * Complete the active overlay interaction with a result.\n * Clears the interaction and dispatches the result callback.\n */\n completeOverlayInteraction: (result: unknown) => void;\n /**\n * Cancel the active overlay interaction.\n * Clears the interaction and dispatches the cancel callback.\n */\n cancelOverlayInteraction: () => void;\n}\n\n// ============================================================================\n// localStorage Keys\n// ============================================================================\n\nconst STORAGE_KEYS = {\n inspectorDocked: \"uilint:inspectorDocked\",\n inspectorWidth: \"uilint:inspectorWidth\",\n inspectorFloatingPosition: \"uilint:inspectorFloatingPosition\",\n inspectorFloatingSize: \"uilint:inspectorFloatingSize\",\n} as const;\n\n// ============================================================================\n// SSR-Safe Storage Helpers\n// ============================================================================\n\n/**\n * Check if we're in a browser environment.\n */\nfunction isBrowser(): boolean {\n return typeof window !== \"undefined\" && typeof localStorage !== \"undefined\";\n}\n\n/**\n * Safely get a value from localStorage with SSR support.\n */\nfunction getStorageValue<T>(key: string, defaultValue: T): T {\n if (!isBrowser()) return defaultValue;\n\n try {\n const stored = localStorage.getItem(key);\n if (stored === null) return defaultValue;\n return JSON.parse(stored) as T;\n } catch (e) {\n devWarn(`[UILint] Failed to load ${key} from localStorage:`, e);\n return defaultValue;\n }\n}\n\n/**\n * Safely set a value in localStorage with SSR support.\n */\nfunction setStorageValue<T>(key: string, value: T): void {\n if (!isBrowser()) return;\n\n try {\n localStorage.setItem(key, JSON.stringify(value));\n } catch (e) {\n devWarn(`[UILint] Failed to save ${key} to localStorage:`, e);\n }\n}\n\n// ============================================================================\n// Default Values\n// ============================================================================\n\nconst DEFAULT_COMMAND_PALETTE_STATE: CommandPaletteState = {\n open: false,\n query: \"\",\n selectedIndex: 0,\n expansionPath: [],\n};\n\nconst DEFAULT_HEATMAP_FILTER_STATE: HeatmapFilterState = {\n mode: \"all\",\n highlightedLocs: [],\n filterLabel: null,\n};\n\nconst DEFAULT_INSPECTOR_WIDTH = 400;\nconst DEFAULT_FLOATING_WIDTH = 450;\nconst LAYOUT_PADDING = 32; // Padding subtracted from sidebar width for layout\nconst _DEFAULT_WS_URL = \"ws://localhost:9234\";\n\n/**\n * Compute the available width for tile grid layout.\n * Subtracts padding from the raw sidebar width.\n */\nfunction computeLayoutAvailableWidth(\n docked: boolean,\n width: number,\n floatingSize: { width: number; height: number } | null\n): number {\n const rawWidth = docked ? width : (floatingSize?.width ?? DEFAULT_FLOATING_WIDTH);\n return Math.max(0, rawWidth - LAYOUT_PADDING);\n}\n\nconst DEFAULT_MOBILE_STATE: MobileState = {\n isMobile: false,\n isTablet: false,\n isTouchDevice: false,\n isSmallScreen: false,\n};\n\nconst DEFAULT_CONNECTION_STATUS: ConnectionStatus = {\n mode: \"websocket\",\n reconnectAttempts: 0,\n maxReconnectAttempts: 5,\n reconnectExhausted: false,\n error: null,\n};\n\n/**\n * Load initial inspector state from localStorage.\n */\nfunction loadInitialInspectorState(): InspectorState {\n const docked = getStorageValue(STORAGE_KEYS.inspectorDocked, true);\n const width = getStorageValue(STORAGE_KEYS.inspectorWidth, DEFAULT_INSPECTOR_WIDTH);\n const floatingSize = getStorageValue<{ width: number; height: number } | null>(\n STORAGE_KEYS.inspectorFloatingSize,\n null\n );\n\n return {\n open: false,\n panelId: null,\n data: null,\n docked,\n width,\n floatingPosition: getStorageValue(STORAGE_KEYS.inspectorFloatingPosition, null),\n floatingSize,\n layoutAvailableWidth: computeLayoutAvailableWidth(docked, width, floatingSize),\n expandedFiles: [],\n expandedRuleId: null,\n expandedFilePath: null,\n selectedIssueId: null,\n ruleConfigExpanded: false,\n showFullSource: false,\n };\n}\n\n// ============================================================================\n// Slice Creator\n// ============================================================================\n\n/**\n * Create the core UI state slice.\n *\n * @param services - Plugin services for accessing WebSocket and storage\n * @returns StateCreator for the core slice\n */\nexport const createCoreSlice = (\n services: PluginServices\n): StateCreator<CoreSlice> => (set, get) => ({\n // ============ Alt Key Mode ============\n altKeyHeld: false,\n\n setAltKeyHeld: (held) => {\n set({ altKeyHeld: held });\n },\n\n // ============ Selection ============\n selectedElementId: null,\n hoveredElementId: null,\n\n setSelectedElementId: (id) => {\n set({ selectedElementId: id });\n },\n\n setHoveredElementId: (id) => {\n set({ hoveredElementId: id });\n },\n\n // ============ Command Palette ============\n commandPalette: { ...DEFAULT_COMMAND_PALETTE_STATE },\n\n openCommandPalette: () => {\n set({\n commandPalette: {\n ...get().commandPalette,\n open: true,\n query: \"\",\n selectedIndex: 0,\n },\n });\n },\n\n closeCommandPalette: () => {\n const current = get().commandPalette;\n set({\n commandPalette: {\n ...current,\n open: false,\n query: \"\",\n selectedIndex: 0,\n },\n });\n },\n\n setCommandPaletteQuery: (query) => {\n set({\n commandPalette: {\n ...get().commandPalette,\n query,\n selectedIndex: 0,\n },\n });\n },\n\n setCommandPaletteSelectedIndex: (index) => {\n set({\n commandPalette: {\n ...get().commandPalette,\n selectedIndex: index,\n },\n });\n },\n\n // ============ Tile Expansion ============\n expandTile: (tile, children, siblings, providerId) => {\n const current = get().commandPalette;\n const currentLevel = current.expansionPath.length as ExpansionLevel;\n\n // Cap at level 2 (rules -> files -> issues)\n if (currentLevel >= 2) {\n devWarn(\"[UILint] Cannot expand beyond level 2\");\n return;\n }\n\n const expandedTile: ExpandedTile = {\n item: tile,\n providerId,\n level: currentLevel,\n children,\n siblings: siblings.filter((s) => s.id !== tile.id), // Exclude the expanded tile from siblings\n };\n\n set({\n commandPalette: {\n ...current,\n expansionPath: [...current.expansionPath, expandedTile],\n selectedIndex: 0, // Reset selection when expanding\n query: \"\", // Clear search when expanding\n },\n });\n },\n\n collapseTile: () => {\n const current = get().commandPalette;\n if (current.expansionPath.length === 0) return;\n\n set({\n commandPalette: {\n ...current,\n expansionPath: current.expansionPath.slice(0, -1),\n selectedIndex: 0,\n query: \"\",\n },\n });\n },\n\n collapseToLevel: (level) => {\n const current = get().commandPalette;\n if (level < 0 || level > 2) return;\n\n set({\n commandPalette: {\n ...current,\n expansionPath: current.expansionPath.slice(0, level),\n selectedIndex: 0,\n query: \"\",\n },\n });\n },\n\n collapseAll: () => {\n const current = get().commandPalette;\n if (current.expansionPath.length === 0) return;\n\n set({\n commandPalette: {\n ...current,\n expansionPath: [],\n selectedIndex: 0,\n query: \"\",\n },\n });\n },\n\n getCurrentExpansionLevel: () => {\n return get().commandPalette.expansionPath.length as ExpansionLevel;\n },\n\n // ============ Inspector ============\n inspector: loadInitialInspectorState(),\n\n openInspector: (panelId, data) => {\n set({\n inspector: {\n ...get().inspector,\n open: true,\n panelId,\n data: data ?? null,\n },\n });\n },\n\n openInspectorPanel: () => {\n set({\n inspector: {\n ...get().inspector,\n open: true,\n },\n });\n },\n\n closeInspector: () => {\n set({\n inspector: {\n ...get().inspector,\n open: false,\n panelId: null,\n data: null,\n selectedIssueId: null,\n },\n });\n },\n\n toggleInspectorDocked: () => {\n const current = get().inspector;\n const newDocked = !current.docked;\n setStorageValue(STORAGE_KEYS.inspectorDocked, newDocked);\n set({\n inspector: {\n ...current,\n docked: newDocked,\n layoutAvailableWidth: computeLayoutAvailableWidth(\n newDocked,\n current.width,\n current.floatingSize\n ),\n },\n });\n },\n\n setInspectorWidth: (width) => {\n const current = get().inspector;\n setStorageValue(STORAGE_KEYS.inspectorWidth, width);\n set({\n inspector: {\n ...current,\n width,\n layoutAvailableWidth: computeLayoutAvailableWidth(\n current.docked,\n width,\n current.floatingSize\n ),\n },\n });\n },\n\n setInspectorFloatingPosition: (position) => {\n setStorageValue(STORAGE_KEYS.inspectorFloatingPosition, position);\n set({\n inspector: {\n ...get().inspector,\n floatingPosition: position,\n },\n });\n },\n\n setInspectorFloatingSize: (size) => {\n const current = get().inspector;\n setStorageValue(STORAGE_KEYS.inspectorFloatingSize, size);\n set({\n inspector: {\n ...current,\n floatingSize: size,\n layoutAvailableWidth: computeLayoutAvailableWidth(\n current.docked,\n current.width,\n size\n ),\n },\n });\n },\n\n toggleFileExpanded: (filePath) => {\n const current = get().inspector;\n const isExpanded = current.expandedFiles.includes(filePath);\n set({\n inspector: {\n ...current,\n expandedFiles: isExpanded\n ? current.expandedFiles.filter((f) => f !== filePath)\n : [...current.expandedFiles, filePath],\n },\n });\n },\n\n expandFile: (filePath) => {\n const current = get().inspector;\n if (current.expandedFiles.includes(filePath)) return;\n set({\n inspector: {\n ...current,\n expandedFiles: [...current.expandedFiles, filePath],\n },\n });\n },\n\n collapseFile: (filePath) => {\n const current = get().inspector;\n set({\n inspector: {\n ...current,\n expandedFiles: current.expandedFiles.filter((f) => f !== filePath),\n },\n });\n },\n\n expandRule: (ruleId) => {\n const current = get().inspector;\n // Toggle: clicking the same rule collapses it\n if (current.expandedRuleId === ruleId) {\n set({\n inspector: {\n ...current,\n expandedRuleId: null,\n expandedFilePath: null,\n },\n });\n } else {\n set({\n inspector: {\n ...current,\n expandedRuleId: ruleId,\n expandedFilePath: null,\n },\n });\n }\n },\n\n collapseRule: () => {\n set({\n inspector: {\n ...get().inspector,\n expandedRuleId: null,\n expandedFilePath: null,\n showFullSource: false,\n selectedIssueId: null, // Clear selection to prevent auto-expand effect from re-expanding\n },\n });\n },\n\n expandFileInRule: (filePath) => {\n set({\n inspector: {\n ...get().inspector,\n expandedFilePath: filePath,\n },\n });\n },\n\n collapseFileInRule: () => {\n set({\n inspector: {\n ...get().inspector,\n expandedFilePath: null,\n showFullSource: false,\n selectedIssueId: null, // Clear selection to prevent auto-expand effect from re-expanding\n },\n });\n },\n\n collapseAllInspector: () => {\n set({\n inspector: {\n ...get().inspector,\n expandedRuleId: null,\n expandedFilePath: null,\n showFullSource: false,\n selectedIssueId: null, // Clear selection to prevent auto-expand effect from re-expanding\n },\n });\n },\n\n selectIssue: (issueId) => {\n set({\n inspector: {\n ...get().inspector,\n selectedIssueId: issueId,\n },\n });\n },\n\n toggleRuleConfig: () => {\n const current = get().inspector;\n set({\n inspector: {\n ...current,\n ruleConfigExpanded: !current.ruleConfigExpanded,\n },\n });\n },\n\n showFullSourceView: () => {\n set({\n inspector: {\n ...get().inspector,\n showFullSource: true,\n },\n });\n },\n\n showIssueSummaryView: () => {\n set({\n inspector: {\n ...get().inspector,\n showFullSource: false,\n },\n });\n },\n\n // ============ Connection (delegated from websocket service) ============\n wsConnected: services.websocket.isConnected,\n wsUrl: services.websocket.url,\n connectionStatus: { ...DEFAULT_CONNECTION_STATUS },\n\n setConnectionStatus: (status) => {\n const current = get().connectionStatus;\n set({\n connectionStatus: {\n ...current,\n ...status,\n },\n });\n },\n\n retryConnection: () => {\n const { connectionStatus } = get();\n if (connectionStatus.mode === \"websocket\") {\n // Reset reconnect state and trigger reconnection\n set({\n connectionStatus: {\n ...connectionStatus,\n reconnectAttempts: 0,\n reconnectExhausted: false,\n error: null,\n },\n });\n // Trigger websocket reconnection\n services.websocket.connect();\n }\n },\n\n // ============ Heatmap Filtering ============\n heatmapFilter: { ...DEFAULT_HEATMAP_FILTER_STATE },\n\n setHeatmapFilter: (locs, label) => {\n set({\n heatmapFilter: {\n mode: locs.length > 0 ? \"related-only\" : \"all\",\n highlightedLocs: locs,\n filterLabel: label ?? null,\n },\n });\n },\n\n clearHeatmapFilter: () => {\n set({\n heatmapFilter: { ...DEFAULT_HEATMAP_FILTER_STATE },\n });\n },\n\n // ============ Mobile/Viewport Detection ============\n mobile: { ...DEFAULT_MOBILE_STATE },\n\n setMobileState: (mobileState) => {\n set({ mobile: mobileState });\n },\n\n // ============ Overlay Interactions ============\n overlayInteraction: null,\n\n startOverlayInteraction: (interaction) => {\n set({ overlayInteraction: interaction });\n },\n\n completeOverlayInteraction: (result) => {\n const interaction = get().overlayInteraction;\n if (interaction) {\n set({ overlayInteraction: null });\n interaction.onComplete(result);\n }\n },\n\n cancelOverlayInteraction: () => {\n const interaction = get().overlayInteraction;\n if (interaction) {\n set({ overlayInteraction: null });\n interaction.onCancel();\n }\n },\n});\n","/**\n * Tile Selectors\n *\n * Zustand selectors and helper functions for tile-related operations.\n * Note: Tile items are computed on-demand in useTileItems hook,\n * not stored in state.\n */\n\nimport type { CoreSlice } from \"./core-slice\";\nimport type { TileItem } from \"../plugin-system/types\";\n\n// Issue type for search filtering (matches the structure in tile metadata)\ninterface IssueForSearch {\n message?: string;\n ruleId?: string;\n filePath?: string;\n}\n\n// ============================================================================\n// Helper Functions\n// ============================================================================\n\n/**\n * Filter tile items by query text.\n * Enhanced to search within underlying issues, not just tile labels.\n *\n * Matches against (case-insensitive):\n * - Tile label (rule name or filename)\n * - Tile subtitle (rule description or file path)\n * - Issue messages within the tile (if stored in metadata.issues)\n * - Issue rule IDs (for file tiles)\n */\nexport function filterByQuery(items: TileItem[], query: string): TileItem[] {\n if (!query.trim()) {\n return items;\n }\n\n const normalizedQuery = query.toLowerCase().trim();\n\n return items.filter((item) => {\n // Check tile label and subtitle\n const label = item.label?.toLowerCase() ?? \"\";\n const subtitle = item.subtitle?.toLowerCase() ?? \"\";\n\n if (label.includes(normalizedQuery) || subtitle.includes(normalizedQuery)) {\n return true;\n }\n\n // Check underlying issues (stored in metadata for search filtering)\n const issues = item.metadata?.issues as IssueForSearch[] | undefined;\n if (issues && Array.isArray(issues)) {\n for (const issue of issues) {\n // Check issue message\n if (issue.message?.toLowerCase().includes(normalizedQuery)) {\n return true;\n }\n // Check rule ID (useful for file tiles)\n if (issue.ruleId?.toLowerCase().includes(normalizedQuery)) {\n return true;\n }\n }\n }\n\n // Check ruleId directly (for rule tiles)\n const ruleId = item.metadata?.ruleId as string | undefined;\n if (ruleId?.toLowerCase().includes(normalizedQuery)) {\n return true;\n }\n\n // Check filePath (for file tiles)\n const filePath = item.metadata?.filePath as string | undefined;\n if (filePath?.toLowerCase().includes(normalizedQuery)) {\n return true;\n }\n\n return false;\n });\n}\n\n/**\n * Deduplicate tile items by id, keeping the first occurrence.\n */\nexport function dedupeItems(items: TileItem[]): TileItem[] {\n const seen = new Set<string>();\n const result: TileItem[] = [];\n\n for (const item of items) {\n if (!seen.has(item.id)) {\n seen.add(item.id);\n result.push(item);\n }\n }\n\n return result;\n}\n\n// ============================================================================\n// Selectors\n// ============================================================================\n\n/**\n * Selector to get the current command palette query.\n */\nexport function selectTileQuery(state: CoreSlice): string {\n return state.commandPalette.query;\n}\n","/**\n * Heatmap Selectors\n *\n * Selectors for the heatmap overlay.\n * Uses the additive selection model: all elements are visible,\n * selected ones are emphasized (full opacity), others are dimmed.\n *\n * Selection is based on inspector expansion state:\n * - expandedRuleId: emphasize all elements with that rule\n * - expandedFilePath: further narrow to that file\n */\n\nimport type { ComposedState } from \"./composed-store\";\nimport type { HeatmapFilterState } from \"./core-slice\";\nimport type { Issue } from \"../../ui/types\";\n\n// ============================================================================\n// Selectors\n// ============================================================================\n\n/**\n * Select the heatmap filter state.\n *\n * @param state - The composed store state\n * @returns The heatmap filter state object\n *\n * @example\n * ```tsx\n * const heatmapFilter = useComposedStore(selectHeatmapFilter);\n * console.log(heatmapFilter.mode); // \"all\" | \"related-only\"\n * ```\n */\nexport function selectHeatmapFilter(state: ComposedState): HeatmapFilterState {\n return state.heatmapFilter;\n}\n\n/**\n * Select the filter label (if any).\n * The label describes what the current filter is showing (e.g., \"Duplicate Pair\").\n *\n * @param state - The composed store state\n * @returns The filter label string or null if no label is set\n *\n * @example\n * ```tsx\n * const filterLabel = useComposedStore(selectHeatmapFilterLabel);\n * if (filterLabel) {\n * console.log(`Showing: ${filterLabel}`);\n * }\n * ```\n */\nexport function selectHeatmapFilterLabel(state: ComposedState): string | null {\n return state.heatmapFilter.filterLabel;\n}\n\n/**\n * Select if heatmap is in filtered mode.\n * Returns true when the heatmap is showing only a subset of elements\n * (mode is \"related-only\" AND there are highlighted locations).\n *\n * @param state - The composed store state\n * @returns true if the heatmap is currently filtered\n *\n * @example\n * ```tsx\n * const isFiltered = useComposedStore(selectIsHeatmapFiltered);\n * if (isFiltered) {\n * // Show \"Clear filter\" button\n * }\n * ```\n */\nexport function selectIsHeatmapFiltered(state: ComposedState): boolean {\n const { mode, highlightedLocs } = state.heatmapFilter;\n return mode === \"related-only\" && highlightedLocs.length > 0;\n}\n\n/**\n * Select the highlighted locations array.\n *\n * @param state - The composed store state\n * @returns Array of dataLoc strings that are highlighted\n *\n * @example\n * ```tsx\n * const highlightedLocs = useComposedStore(selectHighlightedLocs);\n * console.log(`${highlightedLocs.length} locations highlighted`);\n * ```\n */\nexport function selectHighlightedLocs(state: ComposedState): string[] {\n return state.heatmapFilter.highlightedLocs;\n}\n\n/**\n * Select the count of highlighted locations.\n *\n * @param state - The composed store state\n * @returns Number of highlighted locations\n *\n * @example\n * ```tsx\n * const count = useComposedStore(selectHighlightedLocsCount);\n * console.log(`Showing ${count} related elements`);\n * ```\n */\nexport function selectHighlightedLocsCount(state: ComposedState): number {\n return state.heatmapFilter.highlightedLocs.length;\n}\n\n\n// ============================================================================\n// Additive Selection Model (New)\n// ============================================================================\n\n// Stable empty Set for when nothing is selected\nconst EMPTY_SET: Set<string> = new Set();\n\n// Cache for selectSelectedDataLocs\nlet cachedExpandedRuleId: string | null = null;\nlet cachedExpandedFilePath: string | null = null;\nlet cachedIssuesMapForSelection: Map<string, Issue[]> | null = null;\nlet cachedSelectedDataLocs: Set<string> = EMPTY_SET;\n\n/**\n * Clear the selected data locs cache. Call this when the store is reset.\n */\nexport function clearSelectedDataLocsCache(): void {\n cachedExpandedRuleId = null;\n cachedExpandedFilePath = null;\n cachedIssuesMapForSelection = null;\n cachedSelectedDataLocs = EMPTY_SET;\n}\n\n/**\n * Select dataLocs that match the current selection (expanded rule/file).\n * Used for the additive selection model where all elements are visible\n * but selected ones are emphasized (full opacity) and others are dimmed.\n *\n * Returns empty Set when nothing is selected, meaning all elements\n * should be displayed with equal emphasis.\n *\n * @param state - The composed store state\n * @returns Set of dataLoc strings that should be emphasized\n *\n * @example\n * ```tsx\n * const selectedDataLocs = useComposedStore(selectSelectedDataLocs);\n * const isEmphasized = selectedDataLocs.size === 0 || selectedDataLocs.has(dataLoc);\n * // isEmphasized true = full opacity, false = dimmed\n * ```\n */\nexport function selectSelectedDataLocs(state: ComposedState): Set<string> {\n const expandedRuleId = state.inspector.expandedRuleId;\n const expandedFilePath = state.inspector.expandedFilePath;\n const issuesMap = state.plugins?.eslint?.issues;\n\n // Return cached result if inputs haven't changed\n if (\n expandedRuleId === cachedExpandedRuleId &&\n expandedFilePath === cachedExpandedFilePath &&\n issuesMap === cachedIssuesMapForSelection\n ) {\n return cachedSelectedDataLocs;\n }\n\n // Update cache references\n cachedExpandedRuleId = expandedRuleId;\n cachedExpandedFilePath = expandedFilePath;\n cachedIssuesMapForSelection = issuesMap ?? null;\n\n // No selection or no issues = empty set (all elements equal emphasis)\n if (!expandedRuleId || !issuesMap || issuesMap.size === 0) {\n cachedSelectedDataLocs = EMPTY_SET;\n return cachedSelectedDataLocs;\n }\n\n // Build set of dataLocs that match the selection\n const selected = new Set<string>();\n\n for (const [dataLoc, issues] of issuesMap) {\n for (const issue of issues) {\n // Check if issue matches the expanded rule\n if (issue.ruleId === expandedRuleId) {\n // If file is also expanded, must match that too\n if (!expandedFilePath || issue.filePath === expandedFilePath) {\n selected.add(dataLoc);\n break; // Only need to add dataLoc once\n }\n }\n }\n }\n\n cachedSelectedDataLocs = selected.size > 0 ? selected : EMPTY_SET;\n return cachedSelectedDataLocs;\n}\n\n/**\n * Check if there's an active selection (expanded rule).\n * Useful for determining whether to apply emphasis styling.\n *\n * @param state - The composed store state\n * @returns true if a rule is currently expanded/selected\n */\nexport function selectHasActiveSelection(state: ComposedState): boolean {\n return state.inspector.expandedRuleId !== null;\n}\n","/**\n * File Groups Selector\n *\n * Core selector for the unified inspector view.\n * Groups issues by file for display in the inspector.\n * This is the single source of truth for what the inspector displays.\n *\n * Note: Filtering is no longer used. All issues are always shown.\n * Selection/expansion state determines visual emphasis (additive model).\n */\n\nimport type { ComposedState } from \"./composed-store\";\nimport type { Issue, IssueSeverity } from \"../../ui/types\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Issues grouped by rule within a file.\n */\nexport interface RuleGroup {\n /** Rule ID (e.g., \"no-unused-vars\") */\n ruleId: string;\n /** Human-readable rule name */\n ruleName: string;\n /** Number of issues for this rule in this file */\n count: number;\n /** Highest severity among issues in this group */\n highestSeverity: IssueSeverity;\n}\n\n/**\n * A file with its issues grouped by rule.\n */\nexport interface FileGroup {\n /** Full file path */\n filePath: string;\n /** File name only (e.g., \"App.tsx\") */\n fileName: string;\n /** Directory path (e.g., \"src/components\") */\n directory: string;\n /** Total number of issues in this file */\n totalCount: number;\n /** Severity counts for this file */\n severityCounts: { error: number; warning: number; info: number };\n /** Highest severity among all issues in this file */\n highestSeverity: IssueSeverity;\n /** Issues grouped by rule */\n ruleGroups: RuleGroup[];\n /** All issues in this file (flat, for expansion) */\n issues: Issue[];\n}\n\n/**\n * Summary statistics for the current filter state.\n */\nexport interface FileGroupsSummary {\n /** Total issues across all files */\n totalIssues: number;\n /** Number of files with issues */\n totalFiles: number;\n /** Number of unique rules with issues */\n totalRules: number;\n /** Overall severity counts */\n severityCounts: { error: number; warning: number; info: number };\n}\n\n// ============================================================================\n// Stable Empty Values (prevent unnecessary re-renders)\n// ============================================================================\n\nconst EMPTY_FILE_GROUPS: FileGroup[] = [];\nconst EMPTY_SUMMARY: FileGroupsSummary = {\n totalIssues: 0,\n totalFiles: 0,\n totalRules: 0,\n severityCounts: { error: 0, warning: 0, info: 0 },\n};\n\n// ============================================================================\n// Memoization Cache\n// ============================================================================\n\nlet cachedIssuesMap: Map<string, Issue[]> | null = null;\nlet cachedFileGroups: FileGroup[] = EMPTY_FILE_GROUPS;\nlet cachedSummary: FileGroupsSummary = EMPTY_SUMMARY;\n\n/**\n * Clear the file groups cache. Call this when the store is reset.\n */\nexport function clearFileGroupsCache(): void {\n cachedIssuesMap = null;\n cachedFileGroups = EMPTY_FILE_GROUPS;\n cachedSummary = EMPTY_SUMMARY;\n}\n\n// ============================================================================\n// Helper Functions\n// ============================================================================\n\n/**\n * Determine the highest severity from a list of issues.\n */\nfunction getHighestSeverity(issues: Issue[]): IssueSeverity {\n let highest: IssueSeverity = \"info\";\n for (const issue of issues) {\n if (issue.severity === \"error\") return \"error\";\n if (issue.severity === \"warning\") highest = \"warning\";\n }\n return highest;\n}\n\n/**\n * Count issues by severity.\n */\nfunction countSeverities(issues: Issue[]): { error: number; warning: number; info: number } {\n const counts = { error: 0, warning: 0, info: 0 };\n for (const issue of issues) {\n counts[issue.severity]++;\n }\n return counts;\n}\n\n/**\n * Extract file name from path.\n */\nfunction getFileName(filePath: string): string {\n const parts = filePath.split(\"/\");\n return parts[parts.length - 1] || filePath;\n}\n\n/**\n * Extract directory from path.\n */\nfunction getDirectory(filePath: string): string {\n const parts = filePath.split(\"/\");\n parts.pop();\n return parts.join(\"/\") || \"/\";\n}\n\n/**\n * Get a short rule name from a potentially namespaced rule ID.\n */\nfunction getShortRuleName(ruleId: string): string {\n // Handle namespaced rules like \"@typescript-eslint/no-unused-vars\"\n if (ruleId.includes(\"/\")) {\n return ruleId.split(\"/\").pop() || ruleId;\n }\n return ruleId;\n}\n\n/**\n * Sort severity for comparison (error > warning > info).\n */\nfunction severityOrder(severity: IssueSeverity): number {\n switch (severity) {\n case \"error\": return 0;\n case \"warning\": return 1;\n case \"info\": return 2;\n }\n}\n\n// ============================================================================\n// Core Selector Logic\n// ============================================================================\n\n/**\n * Build file groups from issues.\n * Returns all issues grouped by file (no filtering).\n */\nfunction buildFileGroups(\n issuesMap: Map<string, Issue[]>\n): { fileGroups: FileGroup[]; summary: FileGroupsSummary } {\n // Collect all issues by file path\n const issuesByFile = new Map<string, Issue[]>();\n const allRuleIds = new Set<string>();\n\n for (const issues of issuesMap.values()) {\n for (const issue of issues) {\n const existing = issuesByFile.get(issue.filePath) || [];\n existing.push(issue);\n issuesByFile.set(issue.filePath, existing);\n allRuleIds.add(issue.ruleId);\n }\n }\n\n // Build file groups\n const fileGroups: FileGroup[] = [];\n let totalIssues = 0;\n const overallSeverityCounts = { error: 0, warning: 0, info: 0 };\n\n for (const [filePath, issues] of issuesByFile) {\n // Sort issues by line number\n const sortedIssues = [...issues].sort((a, b) => a.line - b.line);\n\n // Group by rule\n const issuesByRule = new Map<string, Issue[]>();\n for (const issue of sortedIssues) {\n const existing = issuesByRule.get(issue.ruleId) || [];\n existing.push(issue);\n issuesByRule.set(issue.ruleId, existing);\n }\n\n // Build rule groups\n const ruleGroups: RuleGroup[] = [];\n for (const [ruleId, ruleIssues] of issuesByRule) {\n ruleGroups.push({\n ruleId,\n ruleName: getShortRuleName(ruleId),\n count: ruleIssues.length,\n highestSeverity: getHighestSeverity(ruleIssues),\n });\n }\n\n // Sort rule groups by severity (errors first), then by count\n ruleGroups.sort((a, b) => {\n const severityDiff = severityOrder(a.highestSeverity) - severityOrder(b.highestSeverity);\n if (severityDiff !== 0) return severityDiff;\n return b.count - a.count;\n });\n\n const severityCounts = countSeverities(sortedIssues);\n totalIssues += sortedIssues.length;\n overallSeverityCounts.error += severityCounts.error;\n overallSeverityCounts.warning += severityCounts.warning;\n overallSeverityCounts.info += severityCounts.info;\n\n fileGroups.push({\n filePath,\n fileName: getFileName(filePath),\n directory: getDirectory(filePath),\n totalCount: sortedIssues.length,\n severityCounts,\n highestSeverity: getHighestSeverity(sortedIssues),\n ruleGroups,\n issues: sortedIssues,\n });\n }\n\n // Sort file groups by severity (errors first), then by count\n fileGroups.sort((a, b) => {\n const severityDiff = severityOrder(a.highestSeverity) - severityOrder(b.highestSeverity);\n if (severityDiff !== 0) return severityDiff;\n return b.totalCount - a.totalCount;\n });\n\n const summary: FileGroupsSummary = {\n totalIssues,\n totalFiles: fileGroups.length,\n totalRules: allRuleIds.size,\n severityCounts: overallSeverityCounts,\n };\n\n return { fileGroups, summary };\n}\n\n// ============================================================================\n// Selectors\n// ============================================================================\n\n/**\n * Select all file groups (no filtering).\n * This is the main selector for the inspector view.\n *\n * Results are memoized to ensure stable references.\n *\n * @param state - The composed store state\n * @returns Array of FileGroup objects\n */\nexport function selectFileGroups(state: ComposedState): FileGroup[] {\n const issuesMap = state.plugins?.eslint?.issues;\n\n // Return cached result if inputs haven't changed\n if (issuesMap === cachedIssuesMap) {\n return cachedFileGroups;\n }\n\n // Update cache references\n cachedIssuesMap = issuesMap ?? null;\n\n // No issues = empty result\n if (!issuesMap || issuesMap.size === 0) {\n cachedFileGroups = EMPTY_FILE_GROUPS;\n cachedSummary = EMPTY_SUMMARY;\n return cachedFileGroups;\n }\n\n // Build file groups\n const { fileGroups, summary } = buildFileGroups(issuesMap);\n\n cachedFileGroups = fileGroups.length > 0 ? fileGroups : EMPTY_FILE_GROUPS;\n cachedSummary = summary;\n\n return cachedFileGroups;\n}\n\n/**\n * @deprecated Use selectFileGroups instead. Filtering has been removed.\n */\nexport const selectFilteredFileGroups = selectFileGroups;\n\n/**\n * Select summary statistics for all issues.\n * Must be called after selectFileGroups for accurate results.\n *\n * @param state - The composed store state\n * @returns Summary statistics\n */\nexport function selectFileGroupsSummary(state: ComposedState): FileGroupsSummary {\n // Ensure cache is up to date\n selectFileGroups(state);\n return cachedSummary;\n}\n\n/**\n * Select the expanded rule ID (for additive selection model).\n * Replaces the old filter-based approach.\n *\n * @param state - The composed store state\n * @returns The expanded rule ID or null\n */\nexport function selectExpandedRuleId(state: ComposedState): string | null {\n return state.inspector.expandedRuleId;\n}\n\n/**\n * Select the expanded file path (for additive selection model).\n * Replaces the old filter-based approach.\n *\n * @param state - The composed store state\n * @returns The expanded file path or null\n */\nexport function selectExpandedFilePath(state: ComposedState): string | null {\n return state.inspector.expandedFilePath;\n}\n\n/**\n * Check if there are any issues to display.\n *\n * @param state - The composed store state\n * @returns true if there are any issues\n */\nexport function selectHasIssues(state: ComposedState): boolean {\n const fileGroups = selectFileGroups(state);\n return fileGroups.length > 0;\n}\n\n/**\n * @deprecated Use selectHasIssues instead. Filtering has been removed.\n */\nexport const selectHasFilteredIssues = selectHasIssues;\n","/**\n * Issues Selectors\n *\n * Zustand selectors for computing derived issue state.\n * Used by useIssues hook and components that display issues.\n */\n\nimport type { ComposedState } from \"./composed-store\";\nimport type { Issue } from \"../../ui/types\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface SeverityCounts {\n error: number;\n warning: number;\n info: number;\n}\n\n// ============================================================================\n// Stable Empty Values (prevent unnecessary re-renders)\n// ============================================================================\n\nconst EMPTY_ISSUES: Issue[] = [];\nconst EMPTY_BY_FILE = new Map<string, Issue[]>();\nconst EMPTY_BY_DATALOC = new Map<string, Issue[]>();\nconst ZERO_SEVERITY_COUNTS: SeverityCounts = { error: 0, warning: 0, info: 0 };\n\n// ============================================================================\n// Selectors\n// ============================================================================\n\n/**\n * Selector to get the raw issues Map from the ESLint plugin state.\n * Returns the Map keyed by dataLoc, or an empty Map if not available.\n *\n * @param state - The composed store state\n * @returns Map of dataLoc to Issue[]\n */\nexport function selectIssuesMap(state: ComposedState): Map<string, Issue[]> {\n return state.plugins?.eslint?.issues ?? EMPTY_BY_DATALOC;\n}\n\n/**\n * Selector to get all issues as a flat array.\n * Flattens the Map values into a single Issue[].\n *\n * @param state - The composed store state\n * @returns All issues from all dataLocs\n */\nexport function selectAllIssues(state: ComposedState): Issue[] {\n const issuesMap = state.plugins?.eslint?.issues;\n if (!issuesMap || issuesMap.size === 0) {\n return EMPTY_ISSUES;\n }\n\n const allIssues: Issue[] = [];\n for (const issues of issuesMap.values()) {\n allIssues.push(...issues);\n }\n\n return allIssues;\n}\n\n/**\n * Selector to get issues grouped by file path.\n * Reorganizes issues from dataLoc-keyed to filePath-keyed Map.\n *\n * @param state - The composed store state\n * @returns Map of filePath to Issue[]\n */\nexport function selectIssuesByFile(state: ComposedState): Map<string, Issue[]> {\n const issuesMap = state.plugins?.eslint?.issues;\n if (!issuesMap || issuesMap.size === 0) {\n return EMPTY_BY_FILE;\n }\n\n const byFile = new Map<string, Issue[]>();\n\n for (const issues of issuesMap.values()) {\n for (const issue of issues) {\n const existing = byFile.get(issue.filePath);\n if (existing) {\n existing.push(issue);\n } else {\n byFile.set(issue.filePath, [issue]);\n }\n }\n }\n\n return byFile;\n}\n\n/**\n * Selector to get the total count of all issues.\n *\n * @param state - The composed store state\n * @returns Total number of issues across all dataLocs\n */\nexport function selectTotalIssueCount(state: ComposedState): number {\n const issuesMap = state.plugins?.eslint?.issues;\n if (!issuesMap || issuesMap.size === 0) {\n return 0;\n }\n\n let count = 0;\n for (const issues of issuesMap.values()) {\n count += issues.length;\n }\n\n return count;\n}\n\n/**\n * Selector to get issue counts grouped by severity.\n *\n * @param state - The composed store state\n * @returns Object with error, warning, and info counts\n */\nexport function selectSeverityCounts(state: ComposedState): SeverityCounts {\n const issuesMap = state.plugins?.eslint?.issues;\n if (!issuesMap || issuesMap.size === 0) {\n return ZERO_SEVERITY_COUNTS;\n }\n\n const counts: SeverityCounts = { error: 0, warning: 0, info: 0 };\n\n for (const issues of issuesMap.values()) {\n for (const issue of issues) {\n counts[issue.severity]++;\n }\n }\n\n return counts;\n}\n\n/**\n * Selector to check if there are any issues.\n *\n * @param state - The composed store state\n * @returns true if there are any issues\n */\nexport function selectHasIssues(state: ComposedState): boolean {\n const issuesMap = state.plugins?.eslint?.issues;\n if (!issuesMap || issuesMap.size === 0) {\n return false;\n }\n\n for (const issues of issuesMap.values()) {\n if (issues.length > 0) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Selector to check if there are any errors (highest severity).\n *\n * @param state - The composed store state\n * @returns true if there are any error-severity issues\n */\nexport function selectHasErrors(state: ComposedState): boolean {\n const issuesMap = state.plugins?.eslint?.issues;\n if (!issuesMap || issuesMap.size === 0) {\n return false;\n }\n\n for (const issues of issuesMap.values()) {\n for (const issue of issues) {\n if (issue.severity === \"error\") {\n return true;\n }\n }\n }\n\n return false;\n}\n","const createStoreImpl = (createState) => {\n let state;\n const listeners = /* @__PURE__ */ new Set();\n const setState = (partial, replace) => {\n const nextState = typeof partial === \"function\" ? partial(state) : partial;\n if (!Object.is(nextState, state)) {\n const previousState = state;\n state = (replace != null ? replace : typeof nextState !== \"object\" || nextState === null) ? nextState : Object.assign({}, state, nextState);\n listeners.forEach((listener) => listener(state, previousState));\n }\n };\n const getState = () => state;\n const getInitialState = () => initialState;\n const subscribe = (listener) => {\n listeners.add(listener);\n return () => listeners.delete(listener);\n };\n const api = { setState, getState, getInitialState, subscribe };\n const initialState = state = createState(setState, getState, api);\n return api;\n};\nconst createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);\n\nexport { createStore };\n","import React from 'react';\nimport { createStore } from 'zustand/vanilla';\n\nconst identity = (arg) => arg;\nfunction useStore(api, selector = identity) {\n const slice = React.useSyncExternalStore(\n api.subscribe,\n React.useCallback(() => selector(api.getState()), [api, selector]),\n React.useCallback(() => selector(api.getInitialState()), [api, selector])\n );\n React.useDebugValue(slice);\n return slice;\n}\nconst createImpl = (createState) => {\n const api = createStore(createState);\n const useBoundStore = (selector) => useStore(api, selector);\n Object.assign(useBoundStore, api);\n return useBoundStore;\n};\nconst create = ((createState) => createState ? createImpl(createState) : createImpl);\n\nexport { create, useStore };\n","/**\n * Drag State Slice\n *\n * Zustand slice for unified drag state management.\n * Handles drag operations for InspectorSidebar and resize handles.\n *\n * Components call startDrag on mouse/touch down, and the subscription system\n * handles move/end events globally, eliminating useEffect-based event listeners.\n */\n\nimport type { StateCreator } from \"zustand\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Position in pixel coordinates.\n */\nexport interface DragPosition {\n x: number;\n y: number;\n}\n\n/**\n * Types of draggable elements in the UI.\n */\nexport type DragType =\n | \"inspector-floating\"\n | \"inspector-resize\"\n | \"docked-resize\";\n\n/**\n * Active drag operation state.\n */\nexport interface ActiveDrag {\n /** Type of element being dragged */\n type: DragType;\n /** Mouse/touch position at drag start */\n startPos: DragPosition;\n /** Current mouse/touch position */\n currentPos: DragPosition;\n /** Offset from element origin to cursor at start (for maintaining grab point) */\n offset: DragPosition;\n /** Initial element position at drag start (for calculating final position) */\n elementStartPos?: DragPosition;\n /** Initial element size at drag start (for resize operations) */\n elementStartSize?: { width: number; height: number };\n}\n\n// ============================================================================\n// Slice Interface\n// ============================================================================\n\n/**\n * Drag state slice interface.\n */\nexport interface DragSlice {\n // ============ State ============\n /** Currently active drag operation, null if not dragging */\n activeDrag: ActiveDrag | null;\n\n // ============ Actions ============\n /**\n * Start a drag operation.\n *\n * @param type - Type of element being dragged\n * @param startPos - Mouse/touch position at start\n * @param offset - Offset from element origin to cursor\n * @param elementStartPos - Initial element position (optional)\n * @param elementStartSize - Initial element size for resize (optional)\n */\n startDrag: (\n type: DragType,\n startPos: DragPosition,\n offset: DragPosition,\n elementStartPos?: DragPosition,\n elementStartSize?: { width: number; height: number }\n ) => void;\n\n /**\n * Update the current position during drag.\n * Called by the global mouse/touch move subscription.\n *\n * @param currentPos - Current mouse/touch position\n */\n updateDrag: (currentPos: DragPosition) => void;\n\n /**\n * End the current drag operation.\n * Called by the global mouse/touch up subscription.\n */\n endDrag: () => void;\n\n /**\n * Check if currently dragging a specific type.\n *\n * @param type - Type to check\n * @returns true if dragging that type\n */\n isDragging: (type?: DragType) => boolean;\n\n /**\n * Get the delta from drag start to current position.\n *\n * @returns Delta position or null if not dragging\n */\n getDragDelta: () => DragPosition | null;\n}\n\n// ============================================================================\n// Slice Creator\n// ============================================================================\n\n/**\n * Create the drag state slice.\n */\nexport const createDragSlice: StateCreator<DragSlice> = (set, get) => ({\n // ============ State ============\n activeDrag: null,\n\n // ============ Actions ============\n startDrag: (type, startPos, offset, elementStartPos, elementStartSize) => {\n set({\n activeDrag: {\n type,\n startPos,\n currentPos: startPos,\n offset,\n elementStartPos,\n elementStartSize,\n },\n });\n },\n\n updateDrag: (currentPos) => {\n const { activeDrag } = get();\n if (!activeDrag) return;\n\n set({\n activeDrag: {\n ...activeDrag,\n currentPos,\n },\n });\n },\n\n endDrag: () => {\n set({ activeDrag: null });\n },\n\n isDragging: (type) => {\n const { activeDrag } = get();\n if (!activeDrag) return false;\n if (type === undefined) return true;\n return activeDrag.type === type;\n },\n\n getDragDelta: () => {\n const { activeDrag } = get();\n if (!activeDrag) return null;\n\n return {\n x: activeDrag.currentPos.x - activeDrag.startPos.x,\n y: activeDrag.currentPos.y - activeDrag.startPos.y,\n };\n },\n});\n\n// ============================================================================\n// Selectors\n// ============================================================================\n\n/**\n * Selector to check if any drag is active.\n */\nexport function selectIsDragging(state: DragSlice): boolean {\n return state.activeDrag !== null;\n}\n\n/**\n * Selector to check if dragging a specific type.\n */\nexport function selectIsDraggingType(state: DragSlice, type: DragType): boolean {\n return state.activeDrag?.type === type;\n}\n\n/**\n * Selector to get the current drag delta.\n */\nexport function selectDragDelta(state: DragSlice): DragPosition | null {\n const { activeDrag } = state;\n if (!activeDrag) return null;\n\n return {\n x: activeDrag.currentPos.x - activeDrag.startPos.x,\n y: activeDrag.currentPos.y - activeDrag.startPos.y,\n };\n}\n\n/**\n * Selector to get the calculated element position during drag.\n * Returns the element's start position plus the drag delta.\n */\nexport function selectDraggedElementPosition(state: DragSlice): DragPosition | null {\n const { activeDrag } = state;\n if (!activeDrag?.elementStartPos) return null;\n\n const delta = selectDragDelta(state);\n if (!delta) return null;\n\n return {\n x: activeDrag.elementStartPos.x + delta.x,\n y: activeDrag.elementStartPos.y + delta.y,\n };\n}\n\n/**\n * Selector to get the calculated element size during resize drag.\n * Returns the element's start size plus the drag delta.\n */\nexport function selectDraggedElementSize(\n state: DragSlice\n): { width: number; height: number } | null {\n const { activeDrag } = state;\n if (!activeDrag?.elementStartSize) return null;\n\n const delta = selectDragDelta(state);\n if (!delta) return null;\n\n return {\n width: activeDrag.elementStartSize.width + delta.x,\n height: activeDrag.elementStartSize.height + delta.y,\n };\n}\n","/**\n * Plugin Registry\n *\n * Manages plugin registration and lifecycle for the UILint plugin system.\n * Handles dependency resolution, initialization order, and aggregation of\n * plugin contributions (commands, analyzers, inspector panels, etc.).\n */\n\nimport { devLog, devWarn, devError } from \"uilint-core\";\nimport type {\n Plugin,\n PluginServices,\n Command,\n Analyzer,\n InspectorPanel,\n RuleUIContribution,\n RuleMeta,\n RuleDefinition,\n ToolbarAction,\n ToolbarActionGroup,\n CategoryProvider,\n} from \"./types\";\n\n/**\n * Wrapper for a registered plugin with initialization state\n */\ninterface RegisteredPlugin {\n plugin: Plugin;\n initialized: boolean;\n}\n\n/**\n * Topologically sort plugins by their dependencies.\n * Ensures plugins are initialized after their dependencies.\n *\n * @param plugins - Array of plugins to sort\n * @returns Sorted array with dependencies before dependents\n * @throws Error if circular dependency is detected\n */\nexport function sortByDependencies(plugins: Plugin[]): Plugin[] {\n const pluginMap = new Map<string, Plugin>();\n for (const plugin of plugins) {\n pluginMap.set(plugin.id, plugin);\n }\n\n const sorted: Plugin[] = [];\n const visited = new Set<string>();\n const visiting = new Set<string>(); // For cycle detection\n\n function visit(plugin: Plugin): void {\n const id = plugin.id;\n\n // Already processed\n if (visited.has(id)) {\n return;\n }\n\n // Cycle detection\n if (visiting.has(id)) {\n throw new Error(\n `[PluginRegistry] Circular dependency detected involving plugin: ${id}`\n );\n }\n\n visiting.add(id);\n\n // Visit dependencies first\n const deps = plugin.dependencies || [];\n for (const depId of deps) {\n const depPlugin = pluginMap.get(depId);\n if (depPlugin) {\n visit(depPlugin);\n }\n // Note: Missing dependencies are handled during registration validation\n }\n\n visiting.delete(id);\n visited.add(id);\n sorted.push(plugin);\n }\n\n for (const plugin of plugins) {\n visit(plugin);\n }\n\n return sorted;\n}\n\n/**\n * Plugin Registry\n *\n * Central registry for managing UILint plugins. Handles:\n * - Plugin registration with dependency validation\n * - Aggregation of plugin contributions (commands, panels, etc.)\n * - Lifecycle management (dispose)\n *\n * Note: Plugin initialization is handled by `initializePlugins()` in composed-store.ts,\n * which is the single entry point for plugin setup.\n */\nexport class PluginRegistry {\n private plugins: Map<string, RegisteredPlugin> = new Map();\n private services: PluginServices | null = null;\n\n /**\n * Register a plugin with the registry.\n *\n * @param plugin - The plugin to register\n * @throws Warning if plugin with same ID already registered\n * @throws Warning if plugin dependencies are not registered\n */\n register(plugin: Plugin): void {\n devLog(`[PluginRegistry] Registering plugin: ${plugin.id}`);\n\n // Check for duplicate\n if (this.plugins.has(plugin.id)) {\n devWarn(\n `[PluginRegistry] Plugin \"${plugin.id}\" is already registered. Skipping duplicate registration.`\n );\n return;\n }\n\n // Check dependencies\n const deps = plugin.dependencies || [];\n const missingDeps: string[] = [];\n for (const depId of deps) {\n if (!this.plugins.has(depId)) {\n missingDeps.push(depId);\n }\n }\n\n if (missingDeps.length > 0) {\n devWarn(\n `[PluginRegistry] Plugin \"${plugin.id}\" has unregistered dependencies: ${missingDeps.join(\", \")}. ` +\n `These plugins should be registered first for proper initialization order.`\n );\n }\n\n // Register the plugin\n this.plugins.set(plugin.id, {\n plugin,\n initialized: false,\n });\n\n devLog(\n `[PluginRegistry] Plugin \"${plugin.id}\" registered successfully`\n );\n }\n\n /**\n * Set the plugin services reference.\n * Called by initializePlugins() after creating services.\n *\n * @param services - The plugin services\n */\n setServices(services: PluginServices): void {\n this.services = services;\n }\n\n /**\n * Mark a plugin as initialized.\n * Called by initializePlugins() after successfully initializing a plugin.\n *\n * @param pluginId - The ID of the plugin to mark as initialized\n */\n markPluginInitialized(pluginId: string): void {\n const registered = this.plugins.get(pluginId);\n if (registered) {\n registered.initialized = true;\n }\n }\n\n /**\n * Get all registered plugins.\n *\n * @returns Array of all registered plugins\n */\n getPlugins(): Plugin[] {\n return Array.from(this.plugins.values()).map((rp) => rp.plugin);\n }\n\n /**\n * Get a specific plugin by ID.\n *\n * @param id - The plugin ID to look up\n * @returns The plugin if found, undefined otherwise\n */\n getPlugin(id: string): Plugin | undefined {\n return this.plugins.get(id)?.plugin;\n }\n\n /**\n * Aggregate all commands from all registered plugins.\n *\n * @returns Array of all commands from all plugins\n */\n getAllCommands(): Command[] {\n const commands: Command[] = [];\n\n for (const { plugin } of this.plugins.values()) {\n if (plugin.commands) {\n commands.push(...plugin.commands);\n }\n }\n\n return commands;\n }\n\n /**\n * Aggregate all analyzers from all registered plugins.\n *\n * @returns Array of all analyzers from all plugins\n */\n getAllAnalyzers(): Analyzer[] {\n const analyzers: Analyzer[] = [];\n\n for (const { plugin } of this.plugins.values()) {\n if (plugin.analyzers) {\n analyzers.push(...plugin.analyzers);\n }\n }\n\n return analyzers;\n }\n\n /**\n * Aggregate all inspector panels from all registered plugins.\n * Panels are sorted by priority (higher priority first).\n *\n * @returns Array of all inspector panels, sorted by priority\n */\n getAllInspectorPanels(): InspectorPanel[] {\n const panels: InspectorPanel[] = [];\n\n for (const { plugin } of this.plugins.values()) {\n if (plugin.inspectorPanels) {\n panels.push(...plugin.inspectorPanels);\n }\n }\n\n // Sort by priority (higher priority first, default to 0)\n return panels.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));\n }\n\n /**\n * Aggregate all toolbar actions from all registered plugins.\n * Actions are sorted by priority (higher priority first).\n *\n * @returns Array of all toolbar actions, sorted by priority\n */\n getAllToolbarActions(): ToolbarAction[] {\n const actions: ToolbarAction[] = [];\n\n for (const { plugin } of this.plugins.values()) {\n if (plugin.toolbarActions) {\n actions.push(...plugin.toolbarActions);\n }\n }\n\n // Sort by priority (higher priority first, default to 0)\n return actions.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));\n }\n\n /**\n * Aggregate all toolbar action groups from all registered plugins.\n * Groups are sorted by priority (higher priority first).\n *\n * @returns Array of all toolbar action groups, sorted by priority\n */\n getAllToolbarActionGroups(): ToolbarActionGroup[] {\n const groups: ToolbarActionGroup[] = [];\n\n for (const { plugin } of this.plugins.values()) {\n if (plugin.toolbarActionGroups) {\n groups.push(...plugin.toolbarActionGroups);\n }\n }\n\n // Sort by priority (higher priority first, default to 0)\n return groups.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));\n }\n\n /**\n * Get all tile providers from registered plugins.\n * These provide tile items for the command palette grid.\n *\n * @returns Array of tile providers with their plugin IDs\n */\n getAllTileProviders(): Array<{ pluginId: string; provider: NonNullable<Plugin['tileProvider']> }> {\n const providers: Array<{ pluginId: string; provider: NonNullable<Plugin['tileProvider']> }> = [];\n\n for (const { plugin, initialized } of this.plugins.values()) {\n if (!initialized) continue;\n\n if (plugin.tileProvider) {\n providers.push({\n pluginId: plugin.id,\n provider: plugin.tileProvider,\n });\n }\n }\n\n return providers;\n }\n\n /**\n * @deprecated Use getAllTileProviders() instead\n */\n getAllCategoryProviders(): CategoryProvider[] {\n return [];\n }\n\n /**\n * Aggregate all rules from all registered plugins.\n * Queries each plugin's getRules method if implemented.\n *\n * @returns Array of all rule definitions from all plugins\n */\n getAllRules(): RuleDefinition[] {\n if (!this.services) {\n devWarn(\"[PluginRegistry] Cannot get rules: services not initialized\");\n return [];\n }\n\n const rules: RuleDefinition[] = [];\n\n for (const { plugin, initialized } of this.plugins.values()) {\n if (!initialized) continue;\n\n if (plugin.getRules) {\n try {\n const pluginRules = plugin.getRules(this.services);\n rules.push(...pluginRules);\n } catch (error) {\n devError(\n `[PluginRegistry] Error getting rules from plugin \"${plugin.id}\":`,\n error\n );\n }\n }\n }\n\n return rules;\n }\n\n /**\n * Set the severity for a specific rule.\n * Finds the plugin that handles the rule and delegates to it.\n *\n * @param ruleId - The rule ID to configure\n * @param severity - The new severity level\n */\n setRuleSeverity(ruleId: string, severity: \"error\" | \"warning\" | \"off\"): void {\n if (!this.services) {\n devWarn(\"[PluginRegistry] Cannot set rule severity: services not initialized\");\n return;\n }\n\n // Find the plugin that handles this rule\n for (const { plugin, initialized } of this.plugins.values()) {\n if (!initialized) continue;\n\n // Check if plugin explicitly handles this rule\n if (plugin.handlesRules) {\n const handles = plugin.handlesRules({ id: ruleId });\n if (handles && plugin.setRuleSeverity) {\n plugin.setRuleSeverity(ruleId, severity, this.services);\n return;\n }\n }\n\n // Check if rule ID starts with plugin ID prefix\n if (ruleId.startsWith(`${plugin.id}/`) && plugin.setRuleSeverity) {\n plugin.setRuleSeverity(ruleId, severity, this.services);\n return;\n }\n }\n\n devWarn(`[PluginRegistry] No plugin found to handle rule: ${ruleId}`);\n }\n\n /**\n * Get configuration options for a specific rule.\n *\n * @param ruleId - The rule ID to get config for\n * @returns The rule configuration, or undefined if not found\n */\n getRuleConfig(ruleId: string): Record<string, unknown> | undefined {\n if (!this.services) {\n devWarn(\"[PluginRegistry] Cannot get rule config: services not initialized\");\n return undefined;\n }\n\n for (const { plugin, initialized } of this.plugins.values()) {\n if (!initialized) continue;\n\n if (plugin.handlesRules?.({ id: ruleId }) && plugin.getRuleConfig) {\n return plugin.getRuleConfig(ruleId, this.services);\n }\n\n if (ruleId.startsWith(`${plugin.id}/`) && plugin.getRuleConfig) {\n return plugin.getRuleConfig(ruleId, this.services);\n }\n }\n\n return undefined;\n }\n\n /**\n * Set configuration options for a specific rule.\n *\n * @param ruleId - The rule ID to configure\n * @param config - The configuration options to set\n */\n setRuleConfig(ruleId: string, config: Record<string, unknown>): void {\n if (!this.services) {\n devWarn(\"[PluginRegistry] Cannot set rule config: services not initialized\");\n return;\n }\n\n for (const { plugin, initialized } of this.plugins.values()) {\n if (!initialized) continue;\n\n if (plugin.handlesRules?.({ id: ruleId }) && plugin.setRuleConfig) {\n plugin.setRuleConfig(ruleId, config, this.services);\n return;\n }\n\n if (ruleId.startsWith(`${plugin.id}/`) && plugin.setRuleConfig) {\n plugin.setRuleConfig(ruleId, config, this.services);\n return;\n }\n }\n\n devWarn(`[PluginRegistry] No plugin found to configure rule: ${ruleId}`);\n }\n\n /**\n * Resolve which plugin handles a specific rule.\n *\n * First checks for plugins that explicitly claim the rule via ruleContributions,\n * then falls back to matching by rule category.\n *\n * @param ruleId - The rule ID to look up\n * @param ruleMeta - The rule metadata\n * @returns The plugin that handles this rule, or a default core plugin\n */\n getPluginForRule(ruleId: string, ruleMeta: RuleMeta): Plugin {\n // First, check if any plugin explicitly contributes to this rule\n for (const { plugin } of this.plugins.values()) {\n if (plugin.ruleContributions) {\n const contribution = plugin.ruleContributions.find(\n (rc) => rc.ruleId === ruleId\n );\n if (contribution) {\n return plugin;\n }\n }\n }\n\n // Fall back to matching by category or prefix\n // e.g., \"uilint/semantic\" might be handled by a semantic-analysis plugin\n for (const { plugin } of this.plugins.values()) {\n // Check if plugin ID matches rule prefix\n if (ruleId.startsWith(`${plugin.id}/`)) {\n return plugin;\n }\n\n // Check if plugin handles this rule category\n if (\n ruleMeta.category &&\n plugin.ruleCategories &&\n plugin.ruleCategories.includes(ruleMeta.category)\n ) {\n return plugin;\n }\n }\n\n // Return a default \"core\" plugin if no specific match\n // First try to find a core plugin\n const corePlugin = this.plugins.get(\"core\")?.plugin;\n if (corePlugin) {\n return corePlugin;\n }\n\n // Return the first registered plugin as ultimate fallback\n const firstPlugin = this.plugins.values().next().value;\n if (firstPlugin) {\n return firstPlugin.plugin;\n }\n\n // If no plugins at all, return a minimal plugin object\n return {\n id: \"default\",\n name: \"Default\",\n version: \"1.0.0\",\n };\n }\n\n /**\n * Get custom UI contribution for a specific rule.\n *\n * @param ruleId - The rule ID to look up\n * @returns The rule UI contribution if found, undefined otherwise\n */\n getRuleContribution(ruleId: string): RuleUIContribution | undefined {\n for (const { plugin } of this.plugins.values()) {\n if (plugin.ruleContributions) {\n const contribution = plugin.ruleContributions.find(\n (rc) => rc.ruleId === ruleId\n );\n if (contribution) {\n return contribution;\n }\n }\n }\n\n return undefined;\n }\n\n /**\n * Dispose all plugins and clean up resources.\n * Calls dispose on each plugin in reverse initialization order.\n */\n disposeAll(): void {\n devLog(\"[PluginRegistry] Disposing all plugins...\");\n\n // Get all plugins and sort by dependencies (reverse order for disposal)\n const allPlugins = Array.from(this.plugins.values()).map((rp) => rp.plugin);\n const sortedPlugins = sortByDependencies(allPlugins).reverse();\n\n for (const plugin of sortedPlugins) {\n const registered = this.plugins.get(plugin.id);\n if (!registered || !registered.initialized) continue;\n\n try {\n devLog(`[PluginRegistry] Disposing plugin: ${plugin.id}`);\n\n if (plugin.dispose && this.services) {\n plugin.dispose(this.services);\n }\n\n registered.initialized = false;\n devLog(\n `[PluginRegistry] Plugin \"${plugin.id}\" disposed successfully`\n );\n } catch (error) {\n devError(\n `[PluginRegistry] Failed to dispose plugin \"${plugin.id}\":`,\n error\n );\n }\n }\n\n // Clear services reference\n this.services = null;\n\n devLog(\"[PluginRegistry] All plugins disposed\");\n }\n\n /**\n * Check if a plugin is registered.\n *\n * @param id - The plugin ID to check\n * @returns true if the plugin is registered\n */\n isRegistered(id: string): boolean {\n return this.plugins.has(id);\n }\n\n /**\n * Check if a plugin is initialized.\n *\n * @param id - The plugin ID to check\n * @returns true if the plugin is initialized, false otherwise\n */\n isInitialized(id: string): boolean {\n return this.plugins.get(id)?.initialized ?? false;\n }\n\n /**\n * Get the current plugin services (available after initializeAll).\n *\n * @returns The plugin services, or null if not yet initialized\n */\n getServices(): PluginServices | null {\n return this.services;\n }\n\n /**\n * Clear all registered plugins.\n * Useful for testing or resetting the registry.\n */\n clear(): void {\n devLog(\"[PluginRegistry] Clearing all plugins\");\n this.disposeAll();\n this.plugins.clear();\n }\n}\n\n/**\n * Factory function to create a new PluginRegistry instance.\n * Use this in tests to get isolated registry instances.\n *\n * @returns A new PluginRegistry instance\n */\nexport function createPluginRegistry(): PluginRegistry {\n return new PluginRegistry();\n}\n\n/**\n * Singleton instance of the plugin registry.\n * Use this for global plugin management.\n */\nexport const pluginRegistry = createPluginRegistry();\n","/**\n * Store Subscriptions\n *\n * Centralized subscription layer that runs outside React.\n * Handles global event listeners and updates the store directly.\n *\n * This eliminates the need for useEffect-based event listeners in components,\n * providing a more efficient and predictable way to handle:\n * - Keyboard shortcuts\n * - Viewport resize / mobile detection\n * - Orientation changes\n */\n\nimport type { StoreApi } from \"zustand\";\nimport type { ComposedStore } from \"./composed-store\";\nimport { BREAKPOINTS, type MobileState } from \"./core-slice\";\nimport { pluginRegistry } from \"../plugin-system/registry\";\nimport { getPluginServices } from \"./composed-store\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Cleanup function returned by subscription initializers.\n */\nexport type CleanupFn = () => void;\n\n/**\n * Options for initializing subscriptions.\n */\nexport interface SubscriptionOptions {\n /** Whether to enable keyboard shortcuts (default: true) */\n enableKeyboardShortcuts?: boolean;\n /** Whether to enable mobile detection (default: true) */\n enableMobileDetection?: boolean;\n /** Whether to enable global drag handlers (default: true) */\n enableDragHandlers?: boolean;\n}\n\n// ============================================================================\n// Mobile Detection Helpers\n// ============================================================================\n\n/**\n * Safely call matchMedia (not available in some environments like SSR/tests).\n */\nfunction safeMatchMedia(query: string): MediaQueryList | null {\n if (typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") {\n return null;\n }\n return window.matchMedia(query);\n}\n\n/**\n * Compute the current mobile state based on window dimensions and touch capability.\n */\nexport function computeMobileState(): MobileState {\n if (typeof window === \"undefined\") {\n return {\n isMobile: false,\n isTablet: false,\n isTouchDevice: false,\n isSmallScreen: false,\n };\n }\n\n const width = window.innerWidth;\n const hasTouch = \"ontouchstart\" in window || navigator.maxTouchPoints > 0;\n const mq = safeMatchMedia(\"(pointer: coarse)\");\n const prefersTouch = mq?.matches ?? false;\n\n return {\n isMobile: width < BREAKPOINTS.md,\n isTablet: width >= BREAKPOINTS.md && width < BREAKPOINTS.lg,\n isTouchDevice: hasTouch && prefersTouch,\n isSmallScreen: width < BREAKPOINTS.sm,\n };\n}\n\n// ============================================================================\n// Keyboard Shortcuts Subscription\n// ============================================================================\n\n/**\n * Initialize keyboard shortcut listeners.\n *\n * Handles:\n * - Cmd/Ctrl+K: Toggle command palette\n * - Cmd/Ctrl+Shift+C: Vision capture full page\n * - Cmd/Ctrl+Shift+R: Vision capture region\n * - Escape: Close command palette\n * - Alt: Enable heatmap hover details\n *\n * @param store - The Zustand store API\n * @returns Cleanup function to remove event listeners\n */\nexport function initializeKeyboardShortcuts(\n store: StoreApi<ComposedStore>\n): CleanupFn {\n if (typeof window === \"undefined\") {\n return () => {};\n }\n\n const handleKeyDown = (e: KeyboardEvent) => {\n const state = store.getState();\n\n // Cmd+K or Ctrl+K toggles palette\n if ((e.metaKey || e.ctrlKey) && e.key === \"k\") {\n e.preventDefault();\n if (state.commandPalette.open) {\n state.closeCommandPalette();\n } else {\n state.openCommandPalette();\n }\n return;\n }\n\n // Cmd+Shift+C or Ctrl+Shift+C: Vision capture full page\n if ((e.metaKey || e.ctrlKey) && e.shiftKey && e.key === \"C\") {\n e.preventDefault();\n const services = getPluginServices();\n if (!services) return;\n const groups = pluginRegistry.getAllToolbarActionGroups();\n for (const group of groups) {\n const action = group.actions.find((a) => a.id === \"vision:capture-full-page\");\n if (action) {\n action.onClick(services);\n return;\n }\n }\n return;\n }\n\n // Cmd+Shift+R or Ctrl+Shift+R: Vision capture region\n if ((e.metaKey || e.ctrlKey) && e.shiftKey && e.key === \"R\") {\n e.preventDefault();\n const services = getPluginServices();\n if (!services) return;\n const groups = pluginRegistry.getAllToolbarActionGroups();\n for (const group of groups) {\n const action = group.actions.find((a) => a.id === \"vision:capture-region\");\n if (action) {\n action.onClick(services);\n return;\n }\n }\n return;\n }\n\n // Escape closes palette\n if (e.key === \"Escape\" && state.commandPalette.open) {\n e.preventDefault();\n state.closeCommandPalette();\n return;\n }\n\n // Alt key for heatmap details\n if (e.key === \"Alt\") {\n state.setAltKeyHeld(true);\n }\n };\n\n const handleKeyUp = (e: KeyboardEvent) => {\n if (e.key === \"Alt\") {\n store.getState().setAltKeyHeld(false);\n }\n };\n\n window.addEventListener(\"keydown\", handleKeyDown);\n window.addEventListener(\"keyup\", handleKeyUp);\n\n return () => {\n window.removeEventListener(\"keydown\", handleKeyDown);\n window.removeEventListener(\"keyup\", handleKeyUp);\n };\n}\n\n// ============================================================================\n// Mobile Detection Subscription\n// ============================================================================\n\n/**\n * Initialize mobile/viewport detection listeners.\n *\n * Updates the store's mobile state on:\n * - Window resize\n * - Orientation change\n * - Pointer media query change (coarse/fine)\n *\n * @param store - The Zustand store API\n * @returns Cleanup function to remove event listeners\n */\nexport function initializeMobileDetection(\n store: StoreApi<ComposedStore>\n): CleanupFn {\n if (typeof window === \"undefined\") {\n return () => {};\n }\n\n const updateMobileState = () => {\n const mobileState = computeMobileState();\n store.getState().setMobileState(mobileState);\n };\n\n // Set initial state\n updateMobileState();\n\n // Use AbortController for clean event listener management\n const controller = new AbortController();\n const { signal } = controller;\n\n window.addEventListener(\"resize\", updateMobileState, { signal });\n window.addEventListener(\"orientationchange\", updateMobileState, { signal });\n\n // Also listen for pointer media query changes\n const mq = safeMatchMedia(\"(pointer: coarse)\");\n if (mq) {\n mq.addEventListener(\"change\", updateMobileState, { signal });\n }\n\n return () => {\n controller.abort();\n };\n}\n\n// ============================================================================\n// Inspector Auto-Undock Subscription\n// ============================================================================\n\n/**\n * Initialize inspector auto-undock behavior.\n *\n * Automatically undocks the inspector when switching to mobile viewport\n * while the inspector is open and docked.\n *\n * @param store - The Zustand store API\n * @returns Cleanup function to unsubscribe\n */\nexport function initializeInspectorAutoUndock(\n store: StoreApi<ComposedStore>\n): CleanupFn {\n // Subscribe to state changes with selector\n let previousIsMobile = store.getState().mobile.isMobile;\n\n const unsubscribe = store.subscribe((state) => {\n const { isMobile } = state.mobile;\n const { docked, open } = state.inspector;\n\n // Only act when transitioning TO mobile (not when already mobile)\n if (isMobile && !previousIsMobile && docked && open) {\n state.toggleInspectorDocked();\n }\n\n previousIsMobile = isMobile;\n });\n\n return unsubscribe;\n}\n\n// ============================================================================\n// Drag Event Subscription\n// ============================================================================\n\n/**\n * Initialize global drag event handlers.\n *\n * Listens for mouse/touch move and end events globally and updates\n * the drag slice accordingly. This eliminates the need for useEffect-based\n * event listeners in individual draggable components.\n *\n * @param store - The Zustand store API\n * @returns Cleanup function to remove event listeners\n */\nexport function initializeDragHandlers(\n store: StoreApi<ComposedStore>\n): CleanupFn {\n if (typeof window === \"undefined\") {\n return () => {};\n }\n\n const handleMouseMove = (e: MouseEvent) => {\n const state = store.getState();\n if (!state.activeDrag) return;\n\n state.updateDrag({ x: e.clientX, y: e.clientY });\n };\n\n const handleTouchMove = (e: TouchEvent) => {\n const state = store.getState();\n if (!state.activeDrag) return;\n\n const touch = e.touches[0];\n if (touch) {\n state.updateDrag({ x: touch.clientX, y: touch.clientY });\n }\n };\n\n const handleMouseUp = () => {\n const state = store.getState();\n if (state.activeDrag) {\n state.endDrag();\n }\n };\n\n const handleTouchEnd = () => {\n const state = store.getState();\n if (state.activeDrag) {\n state.endDrag();\n }\n };\n\n // Use capture phase to ensure we get events even if other handlers stop propagation\n window.addEventListener(\"mousemove\", handleMouseMove);\n window.addEventListener(\"mouseup\", handleMouseUp);\n window.addEventListener(\"touchmove\", handleTouchMove, { passive: true });\n window.addEventListener(\"touchend\", handleTouchEnd);\n window.addEventListener(\"touchcancel\", handleTouchEnd);\n\n return () => {\n window.removeEventListener(\"mousemove\", handleMouseMove);\n window.removeEventListener(\"mouseup\", handleMouseUp);\n window.removeEventListener(\"touchmove\", handleTouchMove);\n window.removeEventListener(\"touchend\", handleTouchEnd);\n window.removeEventListener(\"touchcancel\", handleTouchEnd);\n };\n}\n\n// ============================================================================\n// Main Initialization\n// ============================================================================\n\n/**\n * Initialize all store subscriptions.\n *\n * This should be called once when the store is created.\n * Returns a cleanup function that removes all event listeners.\n *\n * @param store - The Zustand store API\n * @param options - Options for which subscriptions to enable\n * @returns Cleanup function to tear down all subscriptions\n *\n * @example\n * ```typescript\n * const store = createComposedStore();\n * const cleanup = initializeSubscriptions(store);\n *\n * // Later, when shutting down:\n * cleanup();\n * ```\n */\nexport function initializeSubscriptions(\n store: StoreApi<ComposedStore>,\n options: SubscriptionOptions = {}\n): CleanupFn {\n const {\n enableKeyboardShortcuts = true,\n enableMobileDetection = true,\n enableDragHandlers = true,\n } = options;\n\n const cleanupFns: CleanupFn[] = [];\n\n if (enableKeyboardShortcuts) {\n cleanupFns.push(initializeKeyboardShortcuts(store));\n }\n\n if (enableMobileDetection) {\n cleanupFns.push(initializeMobileDetection(store));\n cleanupFns.push(initializeInspectorAutoUndock(store));\n }\n\n if (enableDragHandlers) {\n cleanupFns.push(initializeDragHandlers(store));\n }\n\n // Return combined cleanup function\n return () => {\n cleanupFns.forEach((cleanup) => cleanup());\n };\n}\n","/**\n * Composed Store\n *\n * Creates a unified Zustand store that merges the core slice with all\n * registered plugin slices. This enables a plugin architecture where\n * plugins can contribute their own state slices that get merged into\n * a single store.\n *\n * Key features:\n * - Core slice is always initialized first\n * - Plugin slices are merged as plugins are registered\n * - Dynamic slice registration is supported\n * - Provides PluginServices-compatible getState/setState\n * - Full TypeScript support for combined state\n */\n\nimport { create, type StoreApi, type UseBoundStore } from \"zustand\";\nimport { devLog, devWarn, devError } from \"uilint-core\";\nimport { createCoreSlice, type CoreSlice } from \"./core-slice\";\nimport { createDragSlice, type DragSlice } from \"./drag-slice\";\nimport { initializeSubscriptions, type CleanupFn } from \"./subscriptions\";\nimport { clearSelectedDataLocsCache } from \"./heatmap-selectors\";\nimport { clearFileGroupsCache } from \"./file-groups-selector\";\nimport {\n pluginRegistry,\n sortByDependencies,\n type PluginRegistry,\n} from \"../plugin-system/registry\";\nimport type {\n PluginServices,\n WebSocketService,\n DOMObserverService,\n} from \"../plugin-system/types\";\n\n// ============================================================================\n// Factory Options\n// ============================================================================\n\n/**\n * Options for creating a composed store instance.\n * Allows dependency injection for testing and customization.\n */\nexport interface ComposedStoreOptions {\n /** Custom WebSocket service implementation */\n websocket?: WebSocketService;\n /** Custom DOM observer service implementation */\n domObserver?: DOMObserverService;\n /** Custom plugin registry instance */\n registry?: PluginRegistry;\n}\n\n// ============================================================================\n// Plugin Slice Types\n// ============================================================================\n\n// Import plugin slice types for type composition\nimport type { ESLintPluginSlice } from \"../../plugins/eslint/slice\";\n\n/**\n * Map of plugin IDs to their slice types.\n *\n * Known local plugins are typed explicitly. External plugins (e.g. vision,\n * semantic) register dynamically via the plugin system and are accessed\n * through the index signature.\n */\nexport interface PluginSliceMap {\n eslint: ESLintPluginSlice;\n [pluginId: string]: unknown;\n}\n\n/**\n * Type for all possible plugin slices (union of all plugin slice types).\n */\nexport type AnyPluginSlice = PluginSliceMap[keyof PluginSliceMap];\n\n/**\n * Namespace-prefixed plugin slices.\n * Each plugin's state is accessible via `plugins.{pluginId}`.\n */\nexport interface PluginSlices {\n plugins: {\n [K in keyof PluginSliceMap]?: PluginSliceMap[K];\n };\n}\n\n// ============================================================================\n// Composed Store Type\n// ============================================================================\n\n/**\n * The composed store state combines:\n * 1. CoreSlice - Core UI state (floating icon, command palette, inspector, etc.)\n * 2. DragSlice - Unified drag state management\n * 3. PluginSlices - Namespaced plugin state accessible via `plugins.{pluginId}`\n */\nexport type ComposedState = CoreSlice & DragSlice & PluginSlices;\n\n/**\n * Actions for managing the composed store\n */\nexport interface ComposedStoreActions {\n /**\n * Register a plugin's slice into the store.\n * Called when a plugin is initialized with its createSlice method.\n *\n * @param pluginId - The unique plugin identifier\n * @param slice - The plugin's state slice\n */\n registerPluginSlice: <K extends keyof PluginSliceMap>(\n pluginId: K,\n slice: PluginSliceMap[K]\n ) => void;\n\n /**\n * Unregister a plugin's slice from the store.\n * Called when a plugin is disposed.\n *\n * @param pluginId - The unique plugin identifier\n */\n unregisterPluginSlice: (pluginId: keyof PluginSliceMap) => void;\n\n /**\n * Get a specific plugin's slice.\n * Returns undefined if the plugin is not registered.\n *\n * @param pluginId - The unique plugin identifier\n * @returns The plugin's slice or undefined\n */\n getPluginSlice: <K extends keyof PluginSliceMap>(\n pluginId: K\n ) => PluginSliceMap[K] | undefined;\n\n /**\n * Update a specific plugin's slice.\n * Merges the partial update with the existing slice.\n *\n * @param pluginId - The unique plugin identifier\n * @param partial - Partial update to merge into the slice\n */\n setPluginSlice: <K extends keyof PluginSliceMap>(\n pluginId: K,\n partial: Partial<PluginSliceMap[K]>\n ) => void;\n}\n\n/**\n * Full composed store type including state and actions\n */\nexport type ComposedStore = ComposedState & ComposedStoreActions;\n\n// ============================================================================\n// Store Instance\n// ============================================================================\n\n/**\n * Reference to the store instance.\n * Initialized lazily via createComposedStore().\n */\nlet storeInstance: UseBoundStore<StoreApi<ComposedStore>> | null = null;\n\n/**\n * Plugin services instance for providing to plugins.\n * Created alongside the store.\n */\nlet pluginServicesInstance: PluginServices | null = null;\n\n/**\n * Cleanup function for store subscriptions.\n * Called when the store is reset.\n */\nlet subscriptionsCleanup: CleanupFn | null = null;\n\n/**\n * Default WebSocket service stub.\n * In practice, this would be replaced with a real implementation.\n */\nconst createDefaultWebSocketService = (): WebSocketService => ({\n isConnected: false,\n url: \"ws://localhost:9234\",\n connect: () => {\n devWarn(\"[ComposedStore] WebSocket connect called but not implemented\");\n },\n disconnect: () => {\n devWarn(\"[ComposedStore] WebSocket disconnect called but not implemented\");\n },\n send: () => {\n devWarn(\"[ComposedStore] WebSocket send called but not implemented\");\n },\n on: () => {\n devWarn(\"[ComposedStore] WebSocket on called but not implemented\");\n return () => {};\n },\n onConnectionChange: () => {\n devWarn(\"[ComposedStore] WebSocket onConnectionChange called but not implemented\");\n return () => {};\n },\n});\n\n/**\n * Default DOM observer service stub.\n * In practice, this would be replaced with a real implementation.\n */\nconst createDefaultDOMObserverService = (): DOMObserverService => ({\n start: () => {\n devWarn(\"[ComposedStore] DOMObserver start called but not implemented\");\n },\n stop: () => {\n devWarn(\"[ComposedStore] DOMObserver stop called but not implemented\");\n },\n onElementsAdded: () => {\n devWarn(\"[ComposedStore] DOMObserver onElementsAdded called but not implemented\");\n return () => {};\n },\n onElementsRemoved: () => {\n devWarn(\"[ComposedStore] DOMObserver onElementsRemoved called but not implemented\");\n return () => {};\n },\n});\n\n// ============================================================================\n// Store Creation\n// ============================================================================\n\n/**\n * Internal result from creating a store with factory function.\n * Contains both the store and the plugin services for that store.\n */\ninterface StoreCreationResult {\n store: UseBoundStore<StoreApi<ComposedStore>>;\n services: PluginServices;\n cleanup: CleanupFn;\n}\n\n/**\n * Internal factory function that creates a new store instance.\n * Does NOT use singletons - creates a fresh store every time.\n * Used internally by both createComposedStore and createComposedStoreFactory.\n *\n * @param options - Configuration for the store\n * @returns The created store and plugin services\n */\nfunction createStoreInternal(options: ComposedStoreOptions = {}): StoreCreationResult {\n // Create plugin services that the core slice and plugins will use\n const websocket = options.websocket ?? createDefaultWebSocketService();\n const domObserver = options.domObserver ?? createDefaultDOMObserverService();\n\n let services: PluginServices;\n\n // Create the store\n const store = create<ComposedStore>()((set, get) => {\n // Create plugin services that wrap the store's getState/setState\n // Note: Methods must be bound to the websocket instance to preserve `this` context\n services = {\n websocket: {\n get isConnected() {\n return websocket.isConnected;\n },\n get url() {\n return websocket.url;\n },\n connect: websocket.connect.bind(websocket),\n disconnect: websocket.disconnect.bind(websocket),\n send: websocket.send.bind(websocket),\n on: websocket.on.bind(websocket),\n onConnectionChange: websocket.onConnectionChange.bind(websocket),\n },\n domObserver: {\n start: domObserver.start.bind(domObserver),\n stop: domObserver.stop.bind(domObserver),\n onElementsAdded: domObserver.onElementsAdded.bind(domObserver),\n onElementsRemoved: domObserver.onElementsRemoved.bind(domObserver),\n },\n getState: <T = unknown>() => {\n const state = get();\n return state as unknown as T;\n },\n setState: <T = unknown>(partial: Partial<T>) => {\n set(partial as Partial<ComposedStore>);\n },\n openInspector: (mode, data) => {\n const state = get();\n // Map to core slice's openInspector\n if (data.ruleId) {\n state.openInspector(\"rule\", { ruleId: data.ruleId });\n } else if (data.elementId) {\n state.openInspector(\"element\", { elementId: data.elementId });\n } else {\n // Generic inspector open\n set({\n inspector: {\n ...state.inspector,\n open: true,\n panelId: mode,\n data: data as Record<string, unknown>,\n },\n });\n }\n },\n closeCommandPalette: () => {\n get().closeCommandPalette();\n },\n closeInspector: () => {\n get().closeInspector();\n },\n invalidateCategory: () => {\n // No-op: category system removed\n },\n };\n\n // Initialize the core slice with services\n const coreSliceCreator = createCoreSlice(services);\n const coreSlice = coreSliceCreator(set, get, {\n setState: set,\n getState: get,\n getInitialState: () => get(),\n subscribe: () => () => {},\n });\n\n // Initialize the drag slice\n const dragSlice = createDragSlice(set, get, {\n setState: set,\n getState: get,\n getInitialState: () => get(),\n subscribe: () => () => {},\n });\n\n return {\n // Core slice state and actions\n ...coreSlice,\n\n // Drag slice state and actions\n ...dragSlice,\n\n // Plugin slices namespace (empty initially)\n plugins: {},\n\n // Actions for managing plugin slices\n registerPluginSlice: <K extends keyof PluginSliceMap>(\n pluginId: K,\n slice: PluginSliceMap[K]\n ) => {\n devLog(`[ComposedStore] Registering plugin slice: ${String(pluginId)}`);\n set((state) => ({\n plugins: {\n ...state.plugins,\n [pluginId]: slice,\n },\n }));\n },\n\n unregisterPluginSlice: (pluginId: keyof PluginSliceMap) => {\n devLog(`[ComposedStore] Unregistering plugin slice: ${String(pluginId)}`);\n set((state) => {\n const { [pluginId]: _removed, ...rest } = state.plugins;\n return { plugins: rest };\n });\n },\n\n getPluginSlice: <K extends keyof PluginSliceMap>(\n pluginId: K\n ): PluginSliceMap[K] | undefined => {\n return get().plugins[pluginId] as PluginSliceMap[K] | undefined;\n },\n\n setPluginSlice: <K extends keyof PluginSliceMap>(\n pluginId: K,\n partial: Partial<PluginSliceMap[K]>\n ) => {\n set((state) => {\n const existingSlice = state.plugins[pluginId];\n if (!existingSlice) {\n devWarn(\n `[ComposedStore] Cannot update unregistered plugin slice: ${String(pluginId)}`\n );\n return state;\n }\n\n return {\n plugins: {\n ...state.plugins,\n [pluginId]: {\n ...existingSlice,\n ...partial,\n },\n },\n };\n });\n },\n };\n });\n\n // services is definitely assigned after store creation\n\n // Subscribe to websocket connection changes to update store state\n websocket.onConnectionChange((connected) => {\n store.setState({ wsConnected: connected, wsUrl: websocket.url });\n });\n\n // Initialize store subscriptions (keyboard shortcuts, mobile detection, etc.)\n const cleanup = initializeSubscriptions(store);\n\n return { store, services: services!, cleanup };\n}\n\n/**\n * Factory function for creating isolated store instances.\n * Use this in tests to get fresh stores with injected dependencies.\n *\n * Unlike createComposedStore(), this does NOT use a singleton pattern.\n * Each call creates a completely new, isolated store instance.\n *\n * @param options - Dependencies and configuration for the store\n * @returns A new store instance (not a singleton)\n *\n * @example\n * ```typescript\n * // In tests\n * const mockWebSocket = createMockWebSocketService();\n * const mockDomObserver = createMockDOMObserverService();\n * const testRegistry = createPluginRegistry();\n *\n * const store = createComposedStoreFactory({\n * websocket: mockWebSocket,\n * domObserver: mockDomObserver,\n * registry: testRegistry,\n * });\n *\n * // Each test gets its own isolated store\n * expect(store.getState().commandPalette.open).toBe(false);\n * ```\n */\nexport function createComposedStoreFactory(\n options: ComposedStoreOptions = {}\n): UseBoundStore<StoreApi<ComposedStore>> {\n const { store } = createStoreInternal(options);\n return store;\n}\n\n/**\n * Create the composed store with core slice and plugin support.\n * Uses a singleton pattern - returns the same instance if already created.\n *\n * For testing, use createComposedStoreFactory() instead which creates\n * isolated instances.\n *\n * @param options - Optional configuration for the store\n * @returns The singleton store instance\n */\nexport function createComposedStore(\n options?: ComposedStoreOptions\n): UseBoundStore<StoreApi<ComposedStore>> {\n // Return existing instance if already created\n if (storeInstance) {\n return storeInstance;\n }\n\n // Create new store and services\n const result = createStoreInternal(options);\n storeInstance = result.store;\n pluginServicesInstance = result.services;\n subscriptionsCleanup = result.cleanup;\n\n return storeInstance;\n}\n\n// ============================================================================\n// Store Hook\n// ============================================================================\n\n/**\n * Hook to access the composed store.\n * This is the primary way components should access the store.\n *\n * If the store hasn't been created yet, it will be created with default options.\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * // Access core state\n * const isOpen = useComposedStore((state) => state.commandPalette.open);\n *\n * // Access plugin state\n * const eslintSlice = useComposedStore((state) => state.plugins.eslint);\n *\n * return <div>...</div>;\n * }\n * ```\n */\nexport function useComposedStore(): ComposedStore;\nexport function useComposedStore<T>(selector: (state: ComposedStore) => T): T;\nexport function useComposedStore<T>(selector?: (state: ComposedStore) => T) {\n // Ensure the store is created\n if (!storeInstance) {\n createComposedStore();\n }\n\n // Use the store with optional selector\n if (selector) {\n return storeInstance!(selector);\n }\n return storeInstance!();\n}\n\n// ============================================================================\n// Plugin Integration\n// ============================================================================\n\n/**\n * Create scoped plugin services for a specific plugin.\n * The getState/setState methods are scoped to the plugin's slice within plugins.{pluginId}.\n *\n * @param pluginId - The plugin ID\n * @param baseServices - The base plugin services\n * @param store - The composed store\n * @returns Scoped plugin services\n */\nfunction createScopedServicesForPlugin(\n pluginId: string,\n baseServices: PluginServices,\n store: UseBoundStore<StoreApi<ComposedStore>>\n): PluginServices {\n return {\n ...baseServices,\n getState: <T = unknown>() => {\n // Return the plugin's scoped slice, not the full store state\n // This allows plugins to access their own state directly (e.g., state.issues)\n const fullState = store.getState();\n const pluginSlice = fullState.plugins[pluginId as keyof PluginSliceMap] || {};\n return pluginSlice as unknown as T;\n },\n setState: <T = unknown>(partial: Partial<T>) => {\n // Merge the partial update into the plugin's slice at plugins.{pluginId}\n store.setState((state) => {\n const existingSlice = state.plugins[pluginId as keyof PluginSliceMap] || {};\n return {\n plugins: {\n ...state.plugins,\n [pluginId]: {\n ...existingSlice,\n ...partial,\n },\n },\n };\n });\n },\n };\n}\n\n/**\n * Initialize all registered plugins and merge their slices into the store.\n *\n * This is the single entry point for plugin initialization. It:\n * 1. Creates the store with provided services\n * 2. Sorts plugins by dependencies\n * 3. Creates state slices for each plugin\n * 4. Initializes each plugin\n * 5. Registers category providers for command bar\n * 6. Loads category counts\n *\n * @param options - Optional configuration for services and registry\n * @returns Promise that resolves when all plugins are initialized\n */\nexport async function initializePlugins(\n options?: ComposedStoreOptions\n): Promise<void> {\n // Ensure the store is created with the provided services\n const store = createComposedStore(options);\n\n // Get the plugin services\n if (!pluginServicesInstance) {\n throw new Error(\"[initializePlugins] Plugin services not initialized\");\n }\n\n // Use provided registry or default singleton\n const registry = options?.registry ?? pluginRegistry;\n\n // Set services on the registry so methods like getAllRules() work\n registry.setServices(pluginServicesInstance);\n\n // Get plugins and sort by dependencies for correct initialization order\n const plugins = registry.getPlugins();\n const sortedPlugins = sortByDependencies(plugins);\n\n devLog(\n `[initializePlugins] Initialization order: ${sortedPlugins.map((p) => p.id).join(\" -> \")}`\n );\n\n // First, create slices for all plugins and register them\n for (const plugin of sortedPlugins) {\n if (plugin.createSlice && plugin.id) {\n try {\n // Create scoped services for this plugin\n const scopedServices = createScopedServicesForPlugin(\n plugin.id,\n pluginServicesInstance,\n store\n );\n\n const slice = plugin.createSlice(scopedServices);\n\n // Register the slice in the store\n store.getState().registerPluginSlice(plugin.id, slice);\n } catch (error) {\n devError(\n `[initializePlugins] Failed to create slice for plugin ${plugin.id}:`,\n error\n );\n }\n }\n }\n\n // Now initialize all plugins with their scoped services\n // This must happen AFTER slices are registered so handlers can access state\n for (const plugin of sortedPlugins) {\n if (plugin.id) {\n try {\n const scopedServices = createScopedServicesForPlugin(\n plugin.id,\n pluginServicesInstance,\n store\n );\n\n // Initialize the plugin\n if (plugin.initialize) {\n await plugin.initialize(scopedServices);\n }\n\n // Mark plugin as initialized in the registry\n registry.markPluginInitialized(plugin.id);\n } catch (error) {\n devError(\n `[initializePlugins] Failed to initialize plugin ${plugin.id}:`,\n error\n );\n // Continue with other plugins even if one fails\n }\n }\n }\n\n devLog(\n `[initializePlugins] Initialized ${plugins.length} plugins`\n );\n}\n\n// ============================================================================\n// Utility Functions\n// ============================================================================\n\n/**\n * Get the raw store API for advanced use cases.\n * Prefer using useComposedStore hook in React components.\n *\n * @returns The store API or null if not created\n */\nexport function getStoreApi(): StoreApi<ComposedStore> | null {\n return storeInstance ?? null;\n}\n\n/**\n * Get the plugin services instance.\n * Useful for plugins that need to access services outside of React.\n *\n * @returns The plugin services or null if not created\n */\nexport function getPluginServices(): PluginServices | null {\n return pluginServicesInstance;\n}\n\n/**\n * Reset the store instance.\n * Primarily useful for testing.\n *\n * @param options - Optional configuration to immediately create a new store with\n * @returns The new store instance if options were provided, undefined otherwise\n *\n * @example\n * ```typescript\n * // Simple reset\n * resetStore();\n *\n * // Reset and immediately create new store with mocks\n * const store = resetStore({\n * websocket: mockWebSocket,\n * domObserver: mockDomObserver,\n * });\n * ```\n */\nexport function resetStore(\n options?: ComposedStoreOptions\n): UseBoundStore<StoreApi<ComposedStore>> | void {\n // Clean up subscriptions before resetting\n if (subscriptionsCleanup) {\n subscriptionsCleanup();\n subscriptionsCleanup = null;\n }\n\n // Clear module-level memoization caches from selectors\n // This ensures stale data doesn't persist across store resets (important for tests)\n clearSelectedDataLocsCache();\n clearFileGroupsCache();\n\n // Zustand stores don't have a destroy method, just clear the reference\n storeInstance = null;\n pluginServicesInstance = null;\n\n // If options provided, immediately create a new store\n if (options) {\n return createComposedStore(options);\n }\n}\n\n// ============================================================================\n// Type Guards & Utilities\n// ============================================================================\n\n/**\n * Check if a plugin slice is registered in the store.\n *\n * @param pluginId - The plugin ID to check\n * @returns true if the plugin slice is registered\n */\nexport function hasPluginSlice(pluginId: string): boolean {\n if (!storeInstance) return false;\n return pluginId in storeInstance.getState().plugins;\n}\n\n/**\n * Get typed plugin slice with proper type inference.\n *\n * @param pluginId - The plugin ID\n * @returns The plugin slice or undefined\n */\nexport function getPluginSlice<K extends keyof PluginSliceMap>(\n pluginId: K\n): PluginSliceMap[K] | undefined {\n if (!storeInstance) return undefined;\n return storeInstance.getState().plugins[pluginId] as PluginSliceMap[K] | undefined;\n}\n\n/**\n * Create typed plugin services for a specific plugin.\n * This provides getState/setState scoped to the plugin's slice.\n *\n * @param pluginId - The plugin ID\n * @returns Scoped plugin services\n */\nexport function createScopedPluginServices<K extends keyof PluginSliceMap>(\n pluginId: K\n): PluginServices | null {\n if (!pluginServicesInstance || !storeInstance) return null;\n\n return {\n ...pluginServicesInstance,\n getState: <T = PluginSliceMap[K]>() => {\n const slice = storeInstance!.getState().plugins[pluginId];\n return slice as unknown as T;\n },\n setState: <T = PluginSliceMap[K]>(partial: Partial<T>) => {\n storeInstance!.getState().setPluginSlice(pluginId, partial as Partial<PluginSliceMap[K]>);\n },\n };\n}\n","import { useState, useEffect, useCallback, useRef } from \"react\";\n\ninterface ElementRect {\n dataLoc: string;\n rect: DOMRect;\n element: Element;\n}\n\n/**\n * Hook that tracks DOM element positions for heatmap overlay\n *\n * Updates positions when:\n * - Scroll or resize events fire\n * - DOM elements with data-loc are added/removed/changed\n * - Document margin changes (inspector dock/undock)\n *\n * @param dataLocs - Set or Map of dataLoc strings to track\n */\nexport function useElementRects(\n dataLocs: Set<string> | Map<string, unknown> | undefined\n) {\n const [rects, setRects] = useState<Map<string, ElementRect>>(new Map());\n const observerRef = useRef<MutationObserver | null>(null);\n const styleObserverRef = useRef<MutationObserver | null>(null);\n const rafRef = useRef<number | null>(null);\n const transitionPollRef = useRef<number | null>(null);\n\n const updateRects = useCallback(() => {\n if (!dataLocs) {\n setRects(new Map());\n return;\n }\n\n const dataLocSet =\n dataLocs instanceof Set ? dataLocs : new Set(dataLocs.keys());\n\n if (dataLocSet.size === 0) {\n setRects(new Map());\n return;\n }\n\n const newRects = new Map<string, ElementRect>();\n const elements = document.querySelectorAll(\"[data-loc]\");\n\n elements.forEach((el) => {\n const dataLoc = el.getAttribute(\"data-loc\");\n if (dataLoc && dataLocSet.has(dataLoc)) {\n const rect = el.getBoundingClientRect();\n // Only include visible elements\n if (rect.width > 0 && rect.height > 0) {\n newRects.set(dataLoc, { dataLoc, rect, element: el });\n }\n }\n });\n\n setRects(newRects);\n }, [dataLocs]);\n\n // Throttled update for scroll/resize/style changes\n const throttledUpdate = useCallback(() => {\n if (rafRef.current) return;\n rafRef.current = requestAnimationFrame(() => {\n updateRects();\n rafRef.current = null;\n });\n }, [updateRects]);\n\n useEffect(() => {\n updateRects();\n\n // Poll to keep heatmap in sync during continuous layout changes\n // Runs for ~250ms at 60fps after triggering events\n const pollForUpdates = () => {\n if (transitionPollRef.current) {\n cancelAnimationFrame(transitionPollRef.current);\n }\n let frames = 15; // ~250ms at 60fps\n const poll = () => {\n updateRects();\n frames--;\n if (frames > 0) {\n transitionPollRef.current = requestAnimationFrame(poll);\n } else {\n transitionPollRef.current = null;\n }\n };\n poll();\n };\n\n // Handle scroll with polling for smooth updates during momentum scrolling\n const handleScroll = () => {\n pollForUpdates();\n };\n window.addEventListener(\"scroll\", handleScroll, { passive: true });\n\n // Handle window resize with polling for smooth updates during drag\n const handleWindowResize = () => {\n pollForUpdates();\n };\n window.addEventListener(\"resize\", handleWindowResize, { passive: true });\n\n // Watch for DOM changes in body\n observerRef.current = new MutationObserver(throttledUpdate);\n observerRef.current.observe(document.body, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: [\"data-loc\"],\n });\n\n // Watch for style changes on document.documentElement (margin changes from inspector)\n // When style changes, poll for the duration of the CSS transition\n styleObserverRef.current = new MutationObserver((mutations) => {\n for (const mutation of mutations) {\n if (mutation.type === \"attributes\" && mutation.attributeName === \"style\") {\n pollForUpdates();\n break;\n }\n }\n });\n styleObserverRef.current.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"style\"],\n });\n\n // Also listen for transitionend as a final sync point\n const handleTransitionEnd = (e: TransitionEvent) => {\n if (e.target === document.documentElement && e.propertyName === \"margin-right\") {\n updateRects();\n }\n };\n document.documentElement.addEventListener(\"transitionend\", handleTransitionEnd);\n\n return () => {\n window.removeEventListener(\"scroll\", handleScroll);\n window.removeEventListener(\"resize\", handleWindowResize);\n observerRef.current?.disconnect();\n styleObserverRef.current?.disconnect();\n document.documentElement.removeEventListener(\"transitionend\", handleTransitionEnd);\n if (rafRef.current) cancelAnimationFrame(rafRef.current);\n if (transitionPollRef.current) cancelAnimationFrame(transitionPollRef.current);\n };\n }, [updateRects, throttledUpdate]);\n\n return rects;\n}\n","/**\n * Unified Issue type for UILint UI\n * Replaces: ESLintIssue, ElementIssue, VisionIssue, PluginIssue\n */\n\n/** Issue severity levels */\nexport type IssueSeverity = \"error\" | \"warning\" | \"info\";\n\n/** Issue scan status for a dataLoc */\nexport type IssueStatus = \"pending\" | \"scanning\" | \"complete\" | \"error\";\n\n/**\n * Unified Issue type - single representation used everywhere\n */\nexport interface Issue {\n /** Unique ID: `${pluginId}:${ruleId}:${dataLoc}:${line}` */\n id: string;\n /** Issue message */\n message: string;\n /** Severity level */\n severity: IssueSeverity;\n /** Source location key (format: \"path:line:column\") */\n dataLoc: string;\n /** Rule ID that generated this issue */\n ruleId: string;\n /** Plugin that provided this issue */\n pluginId: string;\n /** Source file path */\n filePath: string;\n /** Line number (1-indexed) */\n line: number;\n /** Column number (1-indexed, optional) */\n column?: number;\n /** Additional metadata */\n metadata?: Record<string, unknown>;\n}\n\n/** Raw ESLint issue from WebSocket */\nexport interface RawESLintIssue {\n line: number;\n column?: number;\n message: string;\n ruleId?: string;\n dataLoc?: string;\n severity?: 1 | 2;\n}\n\n/**\n * Parse dataLoc string into components\n * Format: \"path:line:column\" or \"path:line\"\n */\nexport function parseDataLoc(dataLoc: string): {\n filePath: string;\n line: number;\n column: number;\n} {\n const parts = dataLoc.split(\":\");\n const column = parseInt(parts.pop() || \"0\", 10);\n const line = parseInt(parts.pop() || \"0\", 10);\n const filePath = parts.join(\":\");\n return { filePath, line, column };\n}\n\n/**\n * Create unique issue ID\n */\nexport function createIssueId(\n pluginId: string,\n ruleId: string,\n dataLoc: string,\n line: number\n): string {\n return `${pluginId}:${ruleId}:${dataLoc}:${line}`;\n}\n\n/**\n * Convert severity number to string\n */\nexport function severityFromNumber(num: 1 | 2 | number): IssueSeverity {\n return num === 2 ? \"error\" : \"warning\";\n}\n\n/**\n * Get CSS color for severity (uses CSS variables from globals.css)\n */\nexport function severityToColor(severity: IssueSeverity): string {\n switch (severity) {\n case \"error\":\n return \"var(--uilint-error, oklch(0.72 0.17 25))\";\n case \"warning\":\n return \"var(--uilint-warning, oklch(0.82 0.165 80))\";\n case \"info\":\n return \"var(--uilint-info, oklch(0.623 0.214 259))\";\n }\n}\n\n/**\n * Convert raw ESLint issue to unified Issue\n * Returns null if issue is invalid\n */\nexport function fromESLintIssue(\n raw: RawESLintIssue,\n pluginId: string = \"eslint\"\n): Issue | null {\n if (!raw.message || !raw.line) return null;\n\n const dataLoc = raw.dataLoc || \"\";\n const { filePath } = dataLoc ? parseDataLoc(dataLoc) : { filePath: \"\" };\n const ruleId = raw.ruleId || \"unknown\";\n const severity = raw.severity ? severityFromNumber(raw.severity) : \"warning\";\n\n return {\n id: createIssueId(pluginId, ruleId, dataLoc, raw.line),\n message: raw.message,\n severity,\n dataLoc,\n ruleId,\n pluginId,\n filePath,\n line: raw.line,\n column: raw.column,\n };\n}\n","/* eslint-disable uilint/prefer-tailwind */\n/**\n * HeatmapOverlay - Renders colored borders around elements with issues\n *\n * Key interaction model:\n * - Element rectangles are click-through (pointerEvents: none) to allow\n * interaction with the underlying application\n * - Only the inset badge (square, top-right corner) is clickable\n * - Clicking the badge adds file, rule, and loc filters to narrow to that exact element\n * - Alt+hover on badge shows tooltip with issue details\n *\n * The heatmap automatically reflects the current tile filters:\n * - No filters: show all issues\n * - Rule filter: show only issues for that rule\n * - File filter: show only issues in that file\n * - Loc filter: show only the exact element at that location\n * - Combined filters: intersection of all filter conditions\n */\nimport React, { useMemo } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport {\n useComposedStore,\n selectIssuesMap,\n selectSelectedDataLocs,\n selectHasActiveSelection,\n} from \"../../core/store\";\nimport { useElementRects } from \"../hooks/useElementRects\";\nimport { severityToColor } from \"../types\";\nimport type { Issue } from \"../types\";\n\ninterface OverlayItemProps {\n dataLoc: string;\n rect: DOMRect;\n issues: Issue[];\n isHovered: boolean;\n isSelected: boolean;\n isEmphasized: boolean;\n showDetails: boolean;\n onBadgeClick: () => void;\n onBadgeHover: (hovered: boolean) => void;\n}\n\nfunction OverlayItem({ rect, issues, isHovered, isSelected, isEmphasized, showDetails, onBadgeClick, onBadgeHover }: OverlayItemProps) {\n // Get highest severity for border color\n const severity = useMemo(() => {\n if (issues.some(i => i.severity === \"error\")) return \"error\";\n if (issues.some(i => i.severity === \"warning\")) return \"warning\";\n return \"info\";\n }, [issues]);\n\n const color = severityToColor(severity);\n const count = issues.length;\n\n // Calculate opacity based on emphasis state\n // - isEmphasized true: full opacity (1.0)\n // - isEmphasized false: dimmed (0.3)\n // - hover/selected always boosts visibility\n const baseOpacity = isEmphasized ? 1 : 0.3;\n const finalOpacity = isHovered || isSelected ? Math.max(baseOpacity, 0.8) : baseOpacity;\n\n return (\n <div\n style={{\n position: \"fixed\",\n left: rect.left - 2,\n top: rect.top - 2,\n width: rect.width + 4,\n height: rect.height + 4,\n border: `${isSelected ? 3 : 2}px solid ${color}`,\n borderRadius: 4,\n pointerEvents: \"none\", // Click-through - allows underlying app interaction\n opacity: finalOpacity,\n transition: \"opacity 0.15s, border-width 0.15s\",\n zIndex: isSelected ? 99991 : 99990,\n boxShadow: isSelected ? `0 0 0 2px ${color}40, 0 0 12px ${color}60` : undefined,\n }}\n >\n {/* Clickable indicator - inset square */}\n <span\n onClick={(e) => {\n e.stopPropagation();\n onBadgeClick();\n }}\n onMouseEnter={() => onBadgeHover(true)}\n onMouseLeave={() => onBadgeHover(false)}\n style={{\n position: \"absolute\",\n top: 0,\n right: 0,\n width: 8,\n height: 8,\n borderRadius: 2,\n background: color,\n pointerEvents: \"auto\", // Only badge is clickable\n cursor: \"pointer\",\n boxShadow: \"0 1px 2px rgba(0,0,0,0.25)\",\n transition: \"transform 0.1s, box-shadow 0.1s\",\n }}\n onMouseOver={(e) => {\n (e.currentTarget as HTMLElement).style.transform = \"scale(1.2)\";\n (e.currentTarget as HTMLElement).style.boxShadow = \"0 2px 6px rgba(0,0,0,0.4)\";\n }}\n onMouseOut={(e) => {\n (e.currentTarget as HTMLElement).style.transform = \"scale(1)\";\n (e.currentTarget as HTMLElement).style.boxShadow = \"0 1px 3px rgba(0,0,0,0.3)\";\n }}\n />\n\n {/* Tooltip on Alt+hover badge */}\n {showDetails && isHovered && (\n <div\n style={{\n position: \"absolute\",\n top: 18,\n right: 0,\n padding: \"8px 12px\",\n background: \"#1f2937\",\n color: \"white\",\n borderRadius: 6,\n fontSize: 12,\n maxWidth: 300,\n whiteSpace: \"pre-wrap\",\n boxShadow: \"0 4px 12px rgba(0,0,0,0.2)\",\n zIndex: 99992,\n pointerEvents: \"none\",\n }}\n >\n <strong>{count} issue{count !== 1 ? \"s\" : \"\"}</strong>\n <div style={{ marginTop: 4, opacity: 0.8 }}>\n {issues.slice(0, 3).map((issue, i) => (\n <div key={i} style={{ marginTop: i > 0 ? 4 : 0 }}>\n • {issue.message.slice(0, 60)}{issue.message.length > 60 ? \"...\" : \"\"}\n </div>\n ))}\n {issues.length > 3 && (\n <div style={{ marginTop: 4, opacity: 0.6 }}>\n +{issues.length - 3} more...\n </div>\n )}\n </div>\n </div>\n )}\n </div>\n );\n}\n\nexport function HeatmapOverlay() {\n const altKeyHeld = useComposedStore((s) => s.altKeyHeld);\n const openInspectorPanel = useComposedStore((s) => s.openInspectorPanel);\n const expandRule = useComposedStore((s) => s.expandRule);\n const expandFileInRule = useComposedStore((s) => s.expandFileInRule);\n const selectIssue = useComposedStore((s) => s.selectIssue);\n const hoveredElementId = useComposedStore((s) => s.hoveredElementId);\n const setHoveredElementId = useComposedStore((s) => s.setHoveredElementId);\n const selectedIssueId = useComposedStore((s) => s.inspector.selectedIssueId);\n\n // Use selectors for issues and selection state (additive model)\n const issues = useComposedStore(selectIssuesMap);\n const selectedDataLocs = useComposedStore(selectSelectedDataLocs);\n const hasActiveSelection = useComposedStore(selectHasActiveSelection);\n\n // Track element positions\n const elementRects = useElementRects(issues);\n\n // All entries are shown (additive model - no filtering)\n // Emphasis is determined by selectedDataLocs\n const allEntries = useMemo(() => {\n return Array.from(elementRects.entries());\n }, [elementRects]);\n\n // Handle clicking the badge on an overlay item\n // Opens inspector and expands to the rule/file for this issue\n const handleBadgeClick = (dataLoc: string) => {\n const elementIssues = issues.get(dataLoc) || [];\n if (elementIssues.length > 0) {\n const firstIssue = elementIssues[0];\n\n // Expand the rule tile for this issue\n expandRule(firstIssue.ruleId);\n\n // Expand to the file within the rule\n expandFileInRule(firstIssue.filePath);\n\n // Select the first issue to highlight it\n selectIssue(firstIssue.id);\n }\n // Open the inspector panel\n openInspectorPanel();\n };\n\n // Handle badge hover - updates hovered element for visual feedback\n const handleBadgeHover = (dataLoc: string, hovered: boolean) => {\n setHoveredElementId(hovered ? dataLoc : null);\n };\n\n // Determine if a dataLoc contains the currently selected issue\n const getSelectedDataLoc = useMemo(() => {\n if (!selectedIssueId) return null;\n for (const [dataLoc, dataLocIssues] of issues.entries()) {\n if (dataLocIssues.some(i => i.id === selectedIssueId)) {\n return dataLoc;\n }\n }\n return null;\n }, [selectedIssueId, issues]);\n\n // Don't render if no issues\n if (!issues || issues.size === 0) {\n return null;\n }\n\n const portalRoot = document.getElementById(\"uilint-portal\") || document.body;\n\n return createPortal(\n <div\n style={{\n position: \"fixed\",\n top: 0,\n left: 0,\n width: \"100%\",\n height: \"100%\",\n pointerEvents: \"none\",\n zIndex: 99990,\n }}\n >\n {allEntries.map(([dataLoc, { rect }]) => {\n const elementIssues = issues.get(dataLoc) || [];\n if (elementIssues.length === 0) return null;\n\n // Emphasis: full opacity if no selection, or if this loc is in selection\n const isEmphasized = !hasActiveSelection || selectedDataLocs.has(dataLoc);\n\n return (\n <OverlayItem\n key={dataLoc}\n dataLoc={dataLoc}\n rect={rect}\n issues={elementIssues}\n isHovered={hoveredElementId === dataLoc}\n isSelected={getSelectedDataLoc === dataLoc}\n isEmphasized={isEmphasized}\n showDetails={altKeyHeld}\n onBadgeClick={() => handleBadgeClick(dataLoc)}\n onBadgeHover={(hovered) => handleBadgeHover(dataLoc, hovered)}\n />\n );\n })}\n </div>,\n portalRoot\n );\n}\n","\"use client\";\nimport { createContext } from 'react';\n\nconst LayoutGroupContext = createContext({});\n\nexport { LayoutGroupContext };\n//# sourceMappingURL=LayoutGroupContext.mjs.map\n","\"use client\";\nimport { useRef } from 'react';\n\n/**\n * Creates a constant value over the lifecycle of a component.\n *\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\n * you can ensure that initialisers don't execute twice or more.\n */\nfunction useConstant(init) {\n const ref = useRef(null);\n if (ref.current === null) {\n ref.current = init();\n }\n return ref.current;\n}\n\nexport { useConstant };\n//# sourceMappingURL=use-constant.mjs.map\n","const isBrowser = typeof window !== \"undefined\";\n\nexport { isBrowser };\n//# sourceMappingURL=is-browser.mjs.map\n","\"use client\";\nimport { useLayoutEffect, useEffect } from 'react';\nimport { isBrowser } from './is-browser.mjs';\n\nconst useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;\n\nexport { useIsomorphicLayoutEffect };\n//# sourceMappingURL=use-isomorphic-effect.mjs.map\n","\"use client\";\nimport { createContext } from 'react';\n\n/**\n * @public\n */\nconst PresenceContext = \n/* @__PURE__ */ createContext(null);\n\nexport { PresenceContext };\n//# sourceMappingURL=PresenceContext.mjs.map\n","function addUniqueItem(arr, item) {\n if (arr.indexOf(item) === -1)\n arr.push(item);\n}\nfunction removeItem(arr, item) {\n const index = arr.indexOf(item);\n if (index > -1)\n arr.splice(index, 1);\n}\n// Adapted from array-move\nfunction moveItem([...arr], fromIndex, toIndex) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\n const [item] = arr.splice(fromIndex, 1);\n arr.splice(endIndex, 0, item);\n }\n return arr;\n}\n\nexport { addUniqueItem, moveItem, removeItem };\n","const clamp = (min, max, v) => {\n if (v > max)\n return max;\n if (v < min)\n return min;\n return v;\n};\n\nexport { clamp };\n","function formatErrorMessage(message, errorCode) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message;\n}\n\nexport { formatErrorMessage };\n","import { formatErrorMessage } from './format-error-message.mjs';\n\nlet warning = () => { };\nlet invariant = () => { };\nif (typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\") {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode));\n }\n };\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode));\n }\n };\n}\n\nexport { invariant, warning };\n","const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\n","/**\n * Check if value is a numerical string, ie a string that is purely a number eg \"100\" or \"-100.1\"\n */\nconst isNumericalString = (v) => /^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(v);\n\nexport { isNumericalString };\n","function isObject(value) {\n return typeof value === \"object\" && value !== null;\n}\n\nexport { isObject };\n","/**\n * Check if the value is a zero value string like \"0px\" or \"0%\"\n */\nconst isZeroValueString = (v) => /^0[^.\\s]+$/u.test(v);\n\nexport { isZeroValueString };\n","/*#__NO_SIDE_EFFECTS__*/\nfunction memo(callback) {\n let result;\n return () => {\n if (result === undefined)\n result = callback();\n return result;\n };\n}\n\nexport { memo };\n","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n","/**\n * Pipe\n * Compose other transformers to run linearily\n * pipe(min(20), max(40))\n * @param {...functions} transformers\n * @return {function}\n */\nconst combineFunctions = (a, b) => (v) => b(a(v));\nconst pipe = (...transformers) => transformers.reduce(combineFunctions);\n\nexport { pipe };\n","/*\n Progress within given range\n\n Given a lower limit and an upper limit, we return the progress\n (expressed as a number 0-1) represented by the given value, and\n limit that progress to within 0-1.\n\n @param [number]: Lower limit\n @param [number]: Upper limit\n @param [number]: Value to find progress within given range\n @return [number]: Progress of value within range as expressed 0-1\n*/\n/*#__NO_SIDE_EFFECTS__*/\nconst progress = (from, to, value) => {\n const toFromDifference = to - from;\n return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;\n};\n\nexport { progress };\n","import { addUniqueItem, removeItem } from './array.mjs';\n\nclass SubscriptionManager {\n constructor() {\n this.subscriptions = [];\n }\n add(handler) {\n addUniqueItem(this.subscriptions, handler);\n return () => removeItem(this.subscriptions, handler);\n }\n notify(a, b, c) {\n const numSubscriptions = this.subscriptions.length;\n if (!numSubscriptions)\n return;\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c);\n }\n else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i];\n handler && handler(a, b, c);\n }\n }\n }\n getSize() {\n return this.subscriptions.length;\n }\n clear() {\n this.subscriptions.length = 0;\n }\n}\n\nexport { SubscriptionManager };\n","/**\n * Converts seconds to milliseconds\n *\n * @param seconds - Time in seconds.\n * @return milliseconds - Converted time in milliseconds.\n */\n/*#__NO_SIDE_EFFECTS__*/\nconst secondsToMilliseconds = (seconds) => seconds * 1000;\n/*#__NO_SIDE_EFFECTS__*/\nconst millisecondsToSeconds = (milliseconds) => milliseconds / 1000;\n\nexport { millisecondsToSeconds, secondsToMilliseconds };\n","/*\n Convert velocity into velocity per second\n\n @param [number]: Unit per frame\n @param [number]: Frame duration in ms\n*/\nfunction velocityPerSecond(velocity, frameDuration) {\n return frameDuration ? velocity * (1000 / frameDuration) : 0;\n}\n\nexport { velocityPerSecond };\n","import { formatErrorMessage } from './format-error-message.mjs';\n\nconst warned = new Set();\nfunction hasWarned(message) {\n return warned.has(message);\n}\nfunction warnOnce(condition, message, errorCode) {\n if (condition || warned.has(message))\n return;\n console.warn(formatErrorMessage(message, errorCode));\n warned.add(message);\n}\n\nexport { hasWarned, warnOnce };\n","import { noop } from '../noop.mjs';\n\n/*\n Bezier function generator\n This has been modified from Gaëtan Renaudeau's BezierEasing\n https://github.com/gre/bezier-easing/blob/master/src/index.js\n https://github.com/gre/bezier-easing/blob/master/LICENSE\n \n I've removed the newtonRaphsonIterate algo because in benchmarking it\n wasn't noticeably faster than binarySubdivision, indeed removing it\n usually improved times, depending on the curve.\n I also removed the lookup table, as for the added bundle size and loop we're\n only cutting ~4 or so subdivision iterations. I bumped the max iterations up\n to 12 to compensate and this still tended to be faster for no perceivable\n loss in accuracy.\n Usage\n const easeOut = cubicBezier(.17,.67,.83,.67);\n const x = easeOut(0.5); // returns 0.627...\n*/\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nconst calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) *\n t;\nconst subdivisionPrecision = 0.0000001;\nconst subdivisionMaxIterations = 12;\nfunction binarySubdivide(x, lowerBound, upperBound, mX1, mX2) {\n let currentX;\n let currentT;\n let i = 0;\n do {\n currentT = lowerBound + (upperBound - lowerBound) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - x;\n if (currentX > 0.0) {\n upperBound = currentT;\n }\n else {\n lowerBound = currentT;\n }\n } while (Math.abs(currentX) > subdivisionPrecision &&\n ++i < subdivisionMaxIterations);\n return currentT;\n}\nfunction cubicBezier(mX1, mY1, mX2, mY2) {\n // If this is a linear gradient, return linear easing\n if (mX1 === mY1 && mX2 === mY2)\n return noop;\n const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2);\n // If animation is at start/end, return t without easing\n return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2);\n}\n\nexport { cubicBezier };\n","// Accepts an easing function and returns a new one that outputs mirrored values for\n// the second half of the animation. Turns easeIn into easeInOut.\nconst mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;\n\nexport { mirrorEasing };\n","// Accepts an easing function and returns a new one that outputs reversed values.\n// Turns easeIn into easeOut.\nconst reverseEasing = (easing) => (p) => 1 - easing(1 - p);\n\nexport { reverseEasing };\n","import { cubicBezier } from './cubic-bezier.mjs';\nimport { mirrorEasing } from './modifiers/mirror.mjs';\nimport { reverseEasing } from './modifiers/reverse.mjs';\n\nconst backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99);\nconst backIn = /*@__PURE__*/ reverseEasing(backOut);\nconst backInOut = /*@__PURE__*/ mirrorEasing(backIn);\n\nexport { backIn, backInOut, backOut };\n","import { backIn } from './back.mjs';\n\nconst anticipate = (p) => (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));\n\nexport { anticipate };\n","import { mirrorEasing } from './modifiers/mirror.mjs';\nimport { reverseEasing } from './modifiers/reverse.mjs';\n\nconst circIn = (p) => 1 - Math.sin(Math.acos(p));\nconst circOut = reverseEasing(circIn);\nconst circInOut = mirrorEasing(circIn);\n\nexport { circIn, circInOut, circOut };\n","import { cubicBezier } from './cubic-bezier.mjs';\n\nconst easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1);\nconst easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1);\nconst easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1);\n\nexport { easeIn, easeInOut, easeOut };\n","const isEasingArray = (ease) => {\n return Array.isArray(ease) && typeof ease[0] !== \"number\";\n};\n\nexport { isEasingArray };\n","const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === \"number\";\n\nexport { isBezierDefinition };\n","import { invariant } from '../../errors.mjs';\nimport { noop } from '../../noop.mjs';\nimport { anticipate } from '../anticipate.mjs';\nimport { backIn, backInOut, backOut } from '../back.mjs';\nimport { circIn, circInOut, circOut } from '../circ.mjs';\nimport { cubicBezier } from '../cubic-bezier.mjs';\nimport { easeIn, easeInOut, easeOut } from '../ease.mjs';\nimport { isBezierDefinition } from './is-bezier-definition.mjs';\n\nconst easingLookup = {\n linear: noop,\n easeIn,\n easeInOut,\n easeOut,\n circIn,\n circInOut,\n circOut,\n backIn,\n backInOut,\n backOut,\n anticipate,\n};\nconst isValidEasing = (easing) => {\n return typeof easing === \"string\";\n};\nconst easingDefinitionToFunction = (definition) => {\n if (isBezierDefinition(definition)) {\n // If cubic bezier definition, create bezier curve\n invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, \"cubic-bezier-length\");\n const [x1, y1, x2, y2] = definition;\n return cubicBezier(x1, y1, x2, y2);\n }\n else if (isValidEasing(definition)) {\n // Else lookup from table\n invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, \"invalid-easing-type\");\n return easingLookup[definition];\n }\n return definition;\n};\n\nexport { easingDefinitionToFunction };\n","const stepsOrder = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\n\nexport { stepsOrder };\n","import { statsBuffer } from '../stats/buffer.mjs';\n\nfunction createRenderStep(runNextFrame, stepName) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n let numCalls = 0;\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n numCalls++;\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n if (!queue.has(callback))\n queue.add(callback);\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n [thisFrame, nextFrame] = [nextFrame, thisFrame];\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n /**\n * If we're recording stats then\n */\n if (stepName && statsBuffer.value) {\n statsBuffer.value.frameloop[stepName].push(numCalls);\n }\n numCalls = 0;\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear();\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n\nexport { createRenderStep };\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { stepsOrder } from './order.mjs';\nimport { createRenderStep } from './render-step.mjs';\n\nconst maxElapsed = 40;\nfunction createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame, allowKeepAlive ? key : undefined);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const timestamp = MotionGlobalConfig.useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!MotionGlobalConfig.useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n setup.process(state);\n read.process(state);\n resolveKeyframes.process(state);\n preUpdate.process(state);\n update.process(state);\n preRender.process(state);\n render.process(state);\n postRender.process(state);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n\nexport { createRenderBatcher };\n","import { noop } from 'motion-utils';\nimport { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n\nexport { cancelFrame, frame, frameData, frameSteps };\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { frameData } from './frame.mjs';\n\nlet now;\nfunction clearTime() {\n now = undefined;\n}\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nconst time = {\n now: () => {\n if (now === undefined) {\n time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now());\n }\n return now;\n },\n set: (newTime) => {\n now = newTime;\n queueMicrotask(clearTime);\n },\n};\n\nexport { time };\n","const checkStringStartsWith = (token) => (key) => typeof key === \"string\" && key.startsWith(token);\nconst isCSSVariableName = \n/*@__PURE__*/ checkStringStartsWith(\"--\");\nconst startsAsVariableToken = \n/*@__PURE__*/ checkStringStartsWith(\"var(--\");\nconst isCSSVariableToken = (value) => {\n const startsWithToken = startsAsVariableToken(value);\n if (!startsWithToken)\n return false;\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim());\n};\nconst singleCssVariableRegex = /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu;\n/**\n * Check if a value contains a CSS variable anywhere (e.g. inside calc()).\n * Unlike isCSSVariableToken which checks if the value IS a var() token,\n * this checks if the value CONTAINS var() somewhere in the string.\n */\nfunction containsCSSVariable(value) {\n if (typeof value !== \"string\")\n return false;\n // Strip comments to avoid false positives\n return value.split(\"/*\")[0].includes(\"var(--\");\n}\n\nexport { containsCSSVariable, isCSSVariableName, isCSSVariableToken };\n","import { clamp } from 'motion-utils';\n\nconst number = {\n test: (v) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v) => v,\n};\nconst alpha = {\n ...number,\n transform: (v) => clamp(0, 1, v),\n};\nconst scale = {\n ...number,\n default: 1,\n};\n\nexport { alpha, number, scale };\n","// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nconst sanitize = (v) => Math.round(v * 100000) / 100000;\n\nexport { sanitize };\n","const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu;\n\nexport { floatRegex };\n","function isNullish(v) {\n return v == null;\n}\n\nexport { isNullish };\n","const singleColorRegex = /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu;\n\nexport { singleColorRegex };\n","import { floatRegex } from '../utils/float-regex.mjs';\nimport { isNullish } from '../utils/is-nullish.mjs';\nimport { singleColorRegex } from '../utils/single-color-regex.mjs';\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nconst isColorString = (type, testProp) => (v) => {\n return Boolean((typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp)));\n};\nconst splitColor = (aName, bName, cName) => (v) => {\n if (typeof v !== \"string\")\n return v;\n const [a, b, c, alpha] = v.match(floatRegex);\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n };\n};\n\nexport { isColorString, splitColor };\n","import { clamp } from 'motion-utils';\nimport { number, alpha } from '../numbers/index.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { isColorString, splitColor } from './utils.mjs';\n\nconst clampRgbUnit = (v) => clamp(0, 255, v);\nconst rgbUnit = {\n ...number,\n transform: (v) => Math.round(clampRgbUnit(v)),\n};\nconst rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\",\n};\n\nexport { rgbUnit, rgba };\n","import { rgba } from './rgba.mjs';\nimport { isColorString } from './utils.mjs';\n\nfunction parseHex(v) {\n let r = \"\";\n let g = \"\";\n let b = \"\";\n let a = \"\";\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3);\n g = v.substring(3, 5);\n b = v.substring(5, 7);\n a = v.substring(7, 9);\n // Or we have 3 characters, ie #F00\n }\n else {\n r = v.substring(1, 2);\n g = v.substring(2, 3);\n b = v.substring(3, 4);\n a = v.substring(4, 5);\n r += r;\n g += g;\n b += b;\n a += a;\n }\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n };\n}\nconst hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n};\n\nexport { hex };\n","/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit) => ({\n test: (v) => typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v) => `${v}${unit}`,\n});\nconst degrees = /*@__PURE__*/ createUnitType(\"deg\");\nconst percent = /*@__PURE__*/ createUnitType(\"%\");\nconst px = /*@__PURE__*/ createUnitType(\"px\");\nconst vh = /*@__PURE__*/ createUnitType(\"vh\");\nconst vw = /*@__PURE__*/ createUnitType(\"vw\");\nconst progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v) => percent.parse(v) / 100,\n transform: (v) => percent.transform(v * 100),\n}))();\n\nexport { degrees, percent, progressPercentage, px, vh, vw };\n","import { alpha } from '../numbers/index.mjs';\nimport { percent } from '../numbers/units.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { isColorString, splitColor } from './utils.mjs';\n\nconst hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {\n return (\"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\");\n },\n};\n\nexport { hsla };\n","import { hex } from './hex.mjs';\nimport { hsla } from './hsla.mjs';\nimport { rgba } from './rgba.mjs';\n\nconst color = {\n test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v) => {\n if (rgba.test(v)) {\n return rgba.parse(v);\n }\n else if (hsla.test(v)) {\n return hsla.parse(v);\n }\n else {\n return hex.parse(v);\n }\n },\n transform: (v) => {\n return typeof v === \"string\"\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v)\n : hsla.transform(v);\n },\n getAnimatableNone: (v) => {\n const parsed = color.parse(v);\n parsed.alpha = 0;\n return color.transform(parsed);\n },\n};\n\nexport { color };\n","const colorRegex = /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu;\n\nexport { colorRegex };\n","import { color } from '../color/index.mjs';\nimport { colorRegex } from '../utils/color-regex.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\n\nfunction test(v) {\n return (isNaN(v) &&\n typeof v === \"string\" &&\n (v.match(floatRegex)?.length || 0) +\n (v.match(colorRegex)?.length || 0) >\n 0);\n}\nconst NUMBER_TOKEN = \"number\";\nconst COLOR_TOKEN = \"color\";\nconst VAR_TOKEN = \"var\";\nconst VAR_FUNCTION_TOKEN = \"var(\";\nconst SPLIT_TOKEN = \"${}\";\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex = /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu;\nfunction analyseComplexValue(value) {\n const originalValue = value.toString();\n const values = [];\n const indexes = {\n color: [],\n number: [],\n var: [],\n };\n const types = [];\n let i = 0;\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i);\n types.push(COLOR_TOKEN);\n values.push(color.parse(parsedValue));\n }\n else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i);\n types.push(VAR_TOKEN);\n values.push(parsedValue);\n }\n else {\n indexes.number.push(i);\n types.push(NUMBER_TOKEN);\n values.push(parseFloat(parsedValue));\n }\n ++i;\n return SPLIT_TOKEN;\n });\n const split = tokenised.split(SPLIT_TOKEN);\n return { values, split, indexes, types };\n}\nfunction parseComplexValue(v) {\n return analyseComplexValue(v).values;\n}\nfunction createTransformer(source) {\n const { split, types } = analyseComplexValue(source);\n const numSections = split.length;\n return (v) => {\n let output = \"\";\n for (let i = 0; i < numSections; i++) {\n output += split[i];\n if (v[i] !== undefined) {\n const type = types[i];\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i]);\n }\n else if (type === COLOR_TOKEN) {\n output += color.transform(v[i]);\n }\n else {\n output += v[i];\n }\n }\n }\n return output;\n };\n}\nconst convertNumbersToZero = (v) => typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v;\nfunction getAnimatableNone(v) {\n const parsed = parseComplexValue(v);\n const transformer = createTransformer(v);\n return transformer(parsed.map(convertNumbersToZero));\n}\nconst complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n};\n\nexport { analyseComplexValue, complex };\n","// Adapted from https://gist.github.com/mjackson/5311256\nfunction hueToRgb(p, q, t) {\n if (t < 0)\n t += 1;\n if (t > 1)\n t -= 1;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n}\nfunction hslaToRgba({ hue, saturation, lightness, alpha }) {\n hue /= 360;\n saturation /= 100;\n lightness /= 100;\n let red = 0;\n let green = 0;\n let blue = 0;\n if (!saturation) {\n red = green = blue = lightness;\n }\n else {\n const q = lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation;\n const p = 2 * lightness - q;\n red = hueToRgb(p, q, hue + 1 / 3);\n green = hueToRgb(p, q, hue);\n blue = hueToRgb(p, q, hue - 1 / 3);\n }\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n };\n}\n\nexport { hslaToRgba };\n","function mixImmediate(a, b) {\n return (p) => (p > 0 ? b : a);\n}\n\nexport { mixImmediate };\n","/*\n Value in range from progress\n\n Given a lower limit and an upper limit, we return the value within\n that range as expressed by progress (usually a number from 0 to 1)\n\n So progress = 0.5 would change\n\n from -------- to\n\n to\n\n from ---- to\n\n E.g. from = 10, to = 20, progress = 0.5 => 15\n\n @param [number]: Lower limit of range\n @param [number]: Upper limit of range\n @param [number]: The progress between lower and upper limits expressed 0-1\n @return [number]: Value as calculated from progress within range (not limited within range)\n*/\nconst mixNumber = (from, to, progress) => {\n return from + (to - from) * progress;\n};\n\nexport { mixNumber };\n","import { warning } from 'motion-utils';\nimport { hex } from '../../value/types/color/hex.mjs';\nimport { hsla } from '../../value/types/color/hsla.mjs';\nimport { hslaToRgba } from '../../value/types/color/hsla-to-rgba.mjs';\nimport { rgba } from '../../value/types/color/rgba.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber } from './number.mjs';\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nconst mixLinearColor = (from, to, v) => {\n const fromExpo = from * from;\n const expo = v * (to * to - fromExpo) + fromExpo;\n return expo < 0 ? 0 : Math.sqrt(expo);\n};\nconst colorTypes = [hex, rgba, hsla];\nconst getColorType = (v) => colorTypes.find((type) => type.test(v));\nfunction asRGBA(color) {\n const type = getColorType(color);\n warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, \"color-not-animatable\");\n if (!Boolean(type))\n return false;\n let model = type.parse(color);\n if (type === hsla) {\n // TODO Remove this cast - needed since Motion's stricter typing\n model = hslaToRgba(model);\n }\n return model;\n}\nconst mixColor = (from, to) => {\n const fromRGBA = asRGBA(from);\n const toRGBA = asRGBA(to);\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to);\n }\n const blended = { ...fromRGBA };\n return (v) => {\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v);\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v);\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v);\n blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v);\n return rgba.transform(blended);\n };\n};\n\nexport { mixColor, mixLinearColor };\n","const invisibleValues = new Set([\"none\", \"hidden\"]);\n/**\n * Returns a function that, when provided a progress value between 0 and 1,\n * will return the \"none\" or \"hidden\" string only when the progress is that of\n * the origin or target.\n */\nfunction mixVisibility(origin, target) {\n if (invisibleValues.has(origin)) {\n return (p) => (p <= 0 ? origin : target);\n }\n else {\n return (p) => (p >= 1 ? target : origin);\n }\n}\n\nexport { invisibleValues, mixVisibility };\n","import { pipe, warning } from 'motion-utils';\nimport { isCSSVariableToken } from '../../animation/utils/is-css-variable.mjs';\nimport { color } from '../../value/types/color/index.mjs';\nimport { complex, analyseComplexValue } from '../../value/types/complex/index.mjs';\nimport { mixColor } from './color.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber as mixNumber$1 } from './number.mjs';\nimport { invisibleValues, mixVisibility } from './visibility.mjs';\n\nfunction mixNumber(a, b) {\n return (p) => mixNumber$1(a, b, p);\n}\nfunction getMixer(a) {\n if (typeof a === \"number\") {\n return mixNumber;\n }\n else if (typeof a === \"string\") {\n return isCSSVariableToken(a)\n ? mixImmediate\n : color.test(a)\n ? mixColor\n : mixComplex;\n }\n else if (Array.isArray(a)) {\n return mixArray;\n }\n else if (typeof a === \"object\") {\n return color.test(a) ? mixColor : mixObject;\n }\n return mixImmediate;\n}\nfunction mixArray(a, b) {\n const output = [...a];\n const numValues = output.length;\n const blendValue = a.map((v, i) => getMixer(v)(v, b[i]));\n return (p) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](p);\n }\n return output;\n };\n}\nfunction mixObject(a, b) {\n const output = { ...a, ...b };\n const blendValue = {};\n for (const key in output) {\n if (a[key] !== undefined && b[key] !== undefined) {\n blendValue[key] = getMixer(a[key])(a[key], b[key]);\n }\n }\n return (v) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v);\n }\n return output;\n };\n}\nfunction matchOrder(origin, target) {\n const orderedOrigin = [];\n const pointers = { color: 0, var: 0, number: 0 };\n for (let i = 0; i < target.values.length; i++) {\n const type = target.types[i];\n const originIndex = origin.indexes[type][pointers[type]];\n const originValue = origin.values[originIndex] ?? 0;\n orderedOrigin[i] = originValue;\n pointers[type]++;\n }\n return orderedOrigin;\n}\nconst mixComplex = (origin, target) => {\n const template = complex.createTransformer(target);\n const originStats = analyseComplexValue(origin);\n const targetStats = analyseComplexValue(target);\n const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length &&\n originStats.indexes.color.length === targetStats.indexes.color.length &&\n originStats.indexes.number.length >= targetStats.indexes.number.length;\n if (canInterpolate) {\n if ((invisibleValues.has(origin) &&\n !targetStats.values.length) ||\n (invisibleValues.has(target) &&\n !originStats.values.length)) {\n return mixVisibility(origin, target);\n }\n return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template);\n }\n else {\n warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, \"complex-values-different\");\n return mixImmediate(origin, target);\n }\n};\n\nexport { getMixer, mixArray, mixComplex, mixObject };\n","import { getMixer } from './complex.mjs';\nimport { mixNumber } from './number.mjs';\n\nfunction mix(from, to, p) {\n if (typeof from === \"number\" &&\n typeof to === \"number\" &&\n typeof p === \"number\") {\n return mixNumber(from, to, p);\n }\n const mixer = getMixer(from);\n return mixer(from, to);\n}\n\nexport { mix };\n","import { time } from '../../frameloop/sync-time.mjs';\nimport { frame, cancelFrame, frameData } from '../../frameloop/frame.mjs';\n\nconst frameloopDriver = (update) => {\n const passTimestamp = ({ timestamp }) => update(timestamp);\n return {\n start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),\n stop: () => cancelFrame(passTimestamp),\n /**\n * If we're processing this frame we can use the\n * framelocked timestamp to keep things in sync.\n */\n now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),\n };\n};\n\nexport { frameloopDriver };\n","const generateLinearEasing = (easing, duration, // as milliseconds\nresolution = 10 // as milliseconds\n) => {\n let points = \"\";\n const numPoints = Math.max(Math.round(duration / resolution), 2);\n for (let i = 0; i < numPoints; i++) {\n points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + \", \";\n }\n return `linear(${points.substring(0, points.length - 2)})`;\n};\n\nexport { generateLinearEasing };\n","/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nconst maxGeneratorDuration = 20000;\nfunction calcGeneratorDuration(generator) {\n let duration = 0;\n const timeStep = 50;\n let state = generator.next(duration);\n while (!state.done && duration < maxGeneratorDuration) {\n duration += timeStep;\n state = generator.next(duration);\n }\n return duration >= maxGeneratorDuration ? Infinity : duration;\n}\n\nexport { calcGeneratorDuration, maxGeneratorDuration };\n","import { millisecondsToSeconds } from 'motion-utils';\nimport { calcGeneratorDuration, maxGeneratorDuration } from './calc-duration.mjs';\n\n/**\n * Create a progress => progress easing function from a generator.\n */\nfunction createGeneratorEasing(options, scale = 100, createGenerator) {\n const generator = createGenerator({ ...options, keyframes: [0, scale] });\n const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n return {\n type: \"keyframes\",\n ease: (progress) => {\n return generator.next(duration * progress).value / scale;\n },\n duration: millisecondsToSeconds(duration),\n };\n}\n\nexport { createGeneratorEasing };\n","import { velocityPerSecond } from 'motion-utils';\n\nconst velocitySampleDuration = 5; // ms\nfunction calcGeneratorVelocity(resolveValue, t, current) {\n const prevT = Math.max(t - velocitySampleDuration, 0);\n return velocityPerSecond(current - resolveValue(prevT), t - prevT);\n}\n\nexport { calcGeneratorVelocity };\n","const springDefaults = {\n // Default spring physics\n stiffness: 100,\n damping: 10,\n mass: 1.0,\n velocity: 0.0,\n // Default duration/bounce-based options\n duration: 800, // in ms\n bounce: 0.3,\n visualDuration: 0.3, // in seconds\n // Rest thresholds\n restSpeed: {\n granular: 0.01,\n default: 2,\n },\n restDelta: {\n granular: 0.005,\n default: 0.5,\n },\n // Limits\n minDuration: 0.01, // in seconds\n maxDuration: 10.0, // in seconds\n minDamping: 0.05,\n maxDamping: 1,\n};\n\nexport { springDefaults };\n","import { warning, secondsToMilliseconds, clamp, millisecondsToSeconds } from 'motion-utils';\nimport { springDefaults } from './defaults.mjs';\n\nconst safeMin = 0.001;\nfunction findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) {\n let envelope;\n let derivative;\n warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), \"Spring duration must be 10 seconds or less\", \"spring-duration-limit\");\n let dampingRatio = 1 - bounce;\n /**\n * Restrict dampingRatio and duration to within acceptable ranges.\n */\n dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio);\n duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration));\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const a = exponentialDecay - velocity;\n const b = calcAngularFreq(undampedFreq, dampingRatio);\n const c = Math.exp(-delta);\n return safeMin - (a / b) * c;\n };\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const d = delta * velocity + velocity;\n const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;\n const f = Math.exp(-delta);\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;\n return (factor * ((d - e) * f)) / g;\n };\n }\n else {\n /**\n * Critically-damped spring\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (undampedFreq - velocity) * duration + 1;\n return -safeMin + a * b;\n };\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (velocity - undampedFreq) * (duration * duration);\n return a * b;\n };\n }\n const initialGuess = 5 / duration;\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess);\n duration = secondsToMilliseconds(duration);\n if (isNaN(undampedFreq)) {\n return {\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n duration,\n };\n }\n else {\n const stiffness = Math.pow(undampedFreq, 2) * mass;\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\n duration,\n };\n }\n}\nconst rootIterations = 12;\nfunction approximateRoot(envelope, derivative, initialGuess) {\n let result = initialGuess;\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result);\n }\n return result;\n}\nfunction calcAngularFreq(undampedFreq, dampingRatio) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);\n}\n\nexport { calcAngularFreq, findSpring };\n","import { millisecondsToSeconds, secondsToMilliseconds, clamp } from 'motion-utils';\nimport { generateLinearEasing } from '../../waapi/utils/linear.mjs';\nimport { calcGeneratorDuration, maxGeneratorDuration } from '../utils/calc-duration.mjs';\nimport { createGeneratorEasing } from '../utils/create-generator-easing.mjs';\nimport { calcGeneratorVelocity } from '../utils/velocity.mjs';\nimport { springDefaults } from './defaults.mjs';\nimport { findSpring, calcAngularFreq } from './find.mjs';\n\nconst durationKeys = [\"duration\", \"bounce\"];\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"];\nfunction isSpringType(options, keys) {\n return keys.some((key) => options[key] !== undefined);\n}\nfunction getSpringOptions(options) {\n let springOptions = {\n velocity: springDefaults.velocity,\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n mass: springDefaults.mass,\n isResolvedFromDuration: false,\n ...options,\n };\n // stiffness/damping/mass overrides duration/bounce\n if (!isSpringType(options, physicsKeys) &&\n isSpringType(options, durationKeys)) {\n if (options.visualDuration) {\n const visualDuration = options.visualDuration;\n const root = (2 * Math.PI) / (visualDuration * 1.2);\n const stiffness = root * root;\n const damping = 2 *\n clamp(0.05, 1, 1 - (options.bounce || 0)) *\n Math.sqrt(stiffness);\n springOptions = {\n ...springOptions,\n mass: springDefaults.mass,\n stiffness,\n damping,\n };\n }\n else {\n const derived = findSpring(options);\n springOptions = {\n ...springOptions,\n ...derived,\n mass: springDefaults.mass,\n };\n springOptions.isResolvedFromDuration = true;\n }\n }\n return springOptions;\n}\nfunction spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) {\n const options = typeof optionsOrVisualDuration !== \"object\"\n ? {\n visualDuration: optionsOrVisualDuration,\n keyframes: [0, 1],\n bounce,\n }\n : optionsOrVisualDuration;\n let { restSpeed, restDelta } = options;\n const origin = options.keyframes[0];\n const target = options.keyframes[options.keyframes.length - 1];\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = { done: false, value: origin };\n const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({\n ...options,\n velocity: -millisecondsToSeconds(options.velocity || 0),\n });\n const initialVelocity = velocity || 0.0;\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));\n const initialDelta = target - origin;\n const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass));\n /**\n * If we're working on a granular scale, use smaller defaults for determining\n * when the spring is finished.\n *\n * These defaults have been selected emprically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const isGranularScale = Math.abs(initialDelta) < 5;\n restSpeed || (restSpeed = isGranularScale\n ? springDefaults.restSpeed.granular\n : springDefaults.restSpeed.default);\n restDelta || (restDelta = isGranularScale\n ? springDefaults.restDelta.granular\n : springDefaults.restDelta.default);\n let resolveSpring;\n if (dampingRatio < 1) {\n const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);\n // Underdamped spring\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n return (target -\n envelope *\n (((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq) *\n Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t)));\n };\n }\n else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t) => target -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta +\n (initialVelocity + undampedAngularFreq * initialDelta) * t);\n }\n else {\n // Overdamped spring\n const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n // When performing sinh or cosh values can hit Infinity so we cap them here\n const freqForT = Math.min(dampedAngularFreq * t, 300);\n return (target -\n (envelope *\n ((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) *\n Math.sinh(freqForT) +\n dampedAngularFreq *\n initialDelta *\n Math.cosh(freqForT))) /\n dampedAngularFreq);\n };\n }\n const generator = {\n calculatedDuration: isResolvedFromDuration ? duration || null : null,\n next: (t) => {\n const current = resolveSpring(t);\n if (!isResolvedFromDuration) {\n let currentVelocity = t === 0 ? initialVelocity : 0.0;\n /**\n * We only need to calculate velocity for under-damped springs\n * as over- and critically-damped springs can't overshoot, so\n * checking only for displacement is enough.\n */\n if (dampingRatio < 1) {\n currentVelocity =\n t === 0\n ? secondsToMilliseconds(initialVelocity)\n : calcGeneratorVelocity(resolveSpring, t, current);\n }\n const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed;\n const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta;\n state.done =\n isBelowVelocityThreshold && isBelowDisplacementThreshold;\n }\n else {\n state.done = t >= duration;\n }\n state.value = state.done ? target : current;\n return state;\n },\n toString: () => {\n const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30);\n return calculatedDuration + \"ms \" + easing;\n },\n toTransition: () => { },\n };\n return generator;\n}\nspring.applyToOptions = (options) => {\n const generatorOptions = createGeneratorEasing(options, 100, spring);\n options.ease = generatorOptions.ease;\n options.duration = secondsToMilliseconds(generatorOptions.duration);\n options.type = \"keyframes\";\n return options;\n};\n\nexport { spring };\n","import { spring } from './spring/index.mjs';\nimport { calcGeneratorVelocity } from './utils/velocity.mjs';\n\nfunction inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) {\n const origin = keyframes[0];\n const state = {\n done: false,\n value: origin,\n };\n const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max);\n const nearestBoundary = (v) => {\n if (min === undefined)\n return max;\n if (max === undefined)\n return min;\n return Math.abs(min - v) < Math.abs(max - v) ? min : max;\n };\n let amplitude = power * velocity;\n const ideal = origin + amplitude;\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal);\n /**\n * If the target has changed we need to re-calculate the amplitude, otherwise\n * the animation will start from the wrong position.\n */\n if (target !== ideal)\n amplitude = target - origin;\n const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant);\n const calcLatest = (t) => target + calcDelta(t);\n const applyFriction = (t) => {\n const delta = calcDelta(t);\n const latest = calcLatest(t);\n state.done = Math.abs(delta) <= restDelta;\n state.value = state.done ? target : latest;\n };\n /**\n * Ideally this would resolve for t in a stateless way, we could\n * do that by always precalculating the animation but as we know\n * this will be done anyway we can assume that spring will\n * be discovered during that.\n */\n let timeReachedBoundary;\n let spring$1;\n const checkCatchBoundary = (t) => {\n if (!isOutOfBounds(state.value))\n return;\n timeReachedBoundary = t;\n spring$1 = spring({\n keyframes: [state.value, nearestBoundary(state.value)],\n velocity: calcGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n });\n };\n checkCatchBoundary(0);\n return {\n calculatedDuration: null,\n next: (t) => {\n /**\n * We need to resolve the friction to figure out if we need a\n * spring but we don't want to do this twice per frame. So here\n * we flag if we updated for this frame and later if we did\n * we can skip doing it again.\n */\n let hasUpdatedFrame = false;\n if (!spring$1 && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true;\n applyFriction(t);\n checkCatchBoundary(t);\n }\n /**\n * If we have a spring and the provided t is beyond the moment the friction\n * animation crossed the min/max boundary, use the spring.\n */\n if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {\n return spring$1.next(t - timeReachedBoundary);\n }\n else {\n !hasUpdatedFrame && applyFriction(t);\n return state;\n }\n },\n };\n}\n\nexport { inertia };\n","import { invariant, clamp, MotionGlobalConfig, noop, pipe, progress } from 'motion-utils';\nimport { mix } from './mix/index.mjs';\n\nfunction createMixers(output, ease, customMixer) {\n const mixers = [];\n const mixerFactory = customMixer || MotionGlobalConfig.mix || mix;\n const numMixers = output.length - 1;\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1]);\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease;\n mixer = pipe(easingFunction, mixer);\n }\n mixers.push(mixer);\n }\n return mixers;\n}\n/**\n * Create a function that maps from a numerical input array to a generic output array.\n *\n * Accepts:\n * - Numbers\n * - Colors (hex, hsl, hsla, rgb, rgba)\n * - Complex (combinations of one or more numbers or strings)\n *\n * ```jsx\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\n *\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\n * ```\n *\n * TODO Revisit this approach once we've moved to data models for values,\n * probably not needed to pregenerate mixer functions.\n *\n * @public\n */\nfunction interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {\n const inputLength = input.length;\n invariant(inputLength === output.length, \"Both input and output ranges must be the same length\", \"range-length\");\n /**\n * If we're only provided a single input, we can just make a function\n * that returns the output.\n */\n if (inputLength === 1)\n return () => output[0];\n if (inputLength === 2 && output[0] === output[1])\n return () => output[1];\n const isZeroDeltaRange = input[0] === input[1];\n // If input runs highest -> lowest, reverse both arrays\n if (input[0] > input[inputLength - 1]) {\n input = [...input].reverse();\n output = [...output].reverse();\n }\n const mixers = createMixers(output, ease, mixer);\n const numMixers = mixers.length;\n const interpolator = (v) => {\n if (isZeroDeltaRange && v < input[0])\n return output[0];\n let i = 0;\n if (numMixers > 1) {\n for (; i < input.length - 2; i++) {\n if (v < input[i + 1])\n break;\n }\n }\n const progressInRange = progress(input[i], input[i + 1], v);\n return mixers[i](progressInRange);\n };\n return isClamp\n ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator;\n}\n\nexport { interpolate };\n","import { progress } from 'motion-utils';\nimport { mixNumber } from '../../../utils/mix/number.mjs';\n\nfunction fillOffset(offset, remaining) {\n const min = offset[offset.length - 1];\n for (let i = 1; i <= remaining; i++) {\n const offsetProgress = progress(0, remaining, i);\n offset.push(mixNumber(min, 1, offsetProgress));\n }\n}\n\nexport { fillOffset };\n","import { fillOffset } from './fill.mjs';\n\nfunction defaultOffset(arr) {\n const offset = [0];\n fillOffset(offset, arr.length - 1);\n return offset;\n}\n\nexport { defaultOffset };\n","function convertOffsetToTimes(offset, duration) {\n return offset.map((o) => o * duration);\n}\n\nexport { convertOffsetToTimes };\n","import { easeInOut, isEasingArray, easingDefinitionToFunction } from 'motion-utils';\nimport { interpolate } from '../../utils/interpolate.mjs';\nimport { defaultOffset } from '../keyframes/offsets/default.mjs';\nimport { convertOffsetToTimes } from '../keyframes/offsets/time.mjs';\n\nfunction defaultEasing(values, easing) {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1);\n}\nfunction keyframes({ duration = 300, keyframes: keyframeValues, times, ease = \"easeInOut\", }) {\n /**\n * Easing functions can be externally defined as strings. Here we convert them\n * into actual functions.\n */\n const easingFunctions = isEasingArray(ease)\n ? ease.map(easingDefinitionToFunction)\n : easingDefinitionToFunction(ease);\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = {\n done: false,\n value: keyframeValues[0],\n };\n /**\n * Create a times array based on the provided 0-1 offsets\n */\n const absoluteTimes = convertOffsetToTimes(\n // Only use the provided offsets if they're the correct length\n // TODO Maybe we should warn here if there's a length mismatch\n times && times.length === keyframeValues.length\n ? times\n : defaultOffset(keyframeValues), duration);\n const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {\n ease: Array.isArray(easingFunctions)\n ? easingFunctions\n : defaultEasing(keyframeValues, easingFunctions),\n });\n return {\n calculatedDuration: duration,\n next: (t) => {\n state.value = mapTimeToKeyframe(t);\n state.done = t >= duration;\n return state;\n },\n };\n}\n\nexport { defaultEasing, keyframes };\n","const isNotNull = (value) => value !== null;\nfunction getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }, finalKeyframe, speed = 1) {\n const resolvedKeyframes = keyframes.filter(isNotNull);\n const useFirstKeyframe = speed < 0 || (repeat && repeatType !== \"loop\" && repeat % 2 === 1);\n const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1;\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe;\n}\n\nexport { getFinalKeyframe };\n","import { inertia } from '../generators/inertia.mjs';\nimport { keyframes } from '../generators/keyframes.mjs';\nimport { spring } from '../generators/spring/index.mjs';\n\nconst transitionTypeMap = {\n decay: inertia,\n inertia,\n tween: keyframes,\n keyframes: keyframes,\n spring,\n};\nfunction replaceTransitionType(transition) {\n if (typeof transition.type === \"string\") {\n transition.type = transitionTypeMap[transition.type];\n }\n}\n\nexport { replaceTransitionType };\n","class WithPromise {\n constructor() {\n this.updateFinished();\n }\n get finished() {\n return this._finished;\n }\n updateFinished() {\n this._finished = new Promise((resolve) => {\n this.resolve = resolve;\n });\n }\n notifyFinished() {\n this.resolve();\n }\n /**\n * Allows the animation to be awaited.\n *\n * @deprecated Use `finished` instead.\n */\n then(onResolve, onReject) {\n return this.finished.then(onResolve, onReject);\n }\n}\n\nexport { WithPromise };\n","import { invariant, pipe, clamp, millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { activeAnimations } from '../stats/animation-count.mjs';\nimport { mix } from '../utils/mix/index.mjs';\nimport { frameloopDriver } from './drivers/frame.mjs';\nimport { inertia } from './generators/inertia.mjs';\nimport { keyframes } from './generators/keyframes.mjs';\nimport { calcGeneratorDuration } from './generators/utils/calc-duration.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\n\nconst percentToProgress = (percent) => percent / 100;\nclass JSAnimation extends WithPromise {\n constructor(options) {\n super();\n this.state = \"idle\";\n this.startTime = null;\n this.isStopped = false;\n /**\n * The current time of the animation.\n */\n this.currentTime = 0;\n /**\n * The time at which the animation was paused.\n */\n this.holdTime = null;\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n this.playbackSpeed = 1;\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n this.stop = () => {\n const { motionValue } = this.options;\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now());\n }\n this.isStopped = true;\n if (this.state === \"idle\")\n return;\n this.teardown();\n this.options.onStop?.();\n };\n activeAnimations.mainThread++;\n this.options = options;\n this.initAnimation();\n this.play();\n if (options.autoplay === false)\n this.pause();\n }\n initAnimation() {\n const { options } = this;\n replaceTransitionType(options);\n const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options;\n let { keyframes: keyframes$1 } = options;\n const generatorFactory = type || keyframes;\n if (process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframes) {\n invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, \"spring-two-frames\");\n }\n if (generatorFactory !== keyframes &&\n typeof keyframes$1[0] !== \"number\") {\n this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));\n keyframes$1 = [0, 100];\n }\n const generator = generatorFactory({ ...options, keyframes: keyframes$1 });\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes$1].reverse(),\n velocity: -velocity,\n });\n }\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator);\n }\n const { calculatedDuration } = generator;\n this.calculatedDuration = calculatedDuration;\n this.resolvedDuration = calculatedDuration + repeatDelay;\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay;\n this.generator = generator;\n }\n updateTime(timestamp) {\n const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed;\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime;\n }\n else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime = animationTime;\n }\n }\n tick(timestamp, sample = false) {\n const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this;\n if (this.startTime === null)\n return generator.next(0);\n const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options;\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp);\n }\n else if (this.speed < 0) {\n this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime);\n }\n if (sample) {\n this.currentTime = timestamp;\n }\n else {\n this.updateTime(timestamp);\n }\n // Rebase on delay\n const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1);\n const isInDelayPhase = this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration;\n this.currentTime = Math.max(timeWithoutDelay, 0);\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration;\n }\n let elapsed = this.currentTime;\n let frameGenerator = generator;\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration;\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress);\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0;\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1;\n }\n iterationProgress === 1 && currentIteration--;\n currentIteration = Math.min(currentIteration, repeat + 1);\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n const isOddIteration = Boolean(currentIteration % 2);\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress;\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration;\n }\n }\n else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator;\n }\n }\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;\n }\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n const state = isInDelayPhase\n ? { done: false, value: keyframes[0] }\n : frameGenerator.next(elapsed);\n if (mixKeyframes) {\n state.value = mixKeyframes(state.value);\n }\n let { done } = state;\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0;\n }\n const isAnimationFinished = this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done));\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n }\n if (onUpdate) {\n onUpdate(state.value);\n }\n if (isAnimationFinished) {\n this.finish();\n }\n return state;\n }\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve, reject) {\n return this.finished.then(resolve, reject);\n }\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration);\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(this.currentTime);\n }\n set time(newTime) {\n newTime = secondsToMilliseconds(newTime);\n this.currentTime = newTime;\n if (this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0) {\n this.holdTime = newTime;\n }\n else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed;\n }\n this.driver?.start(false);\n }\n get speed() {\n return this.playbackSpeed;\n }\n set speed(newSpeed) {\n this.updateTime(time.now());\n const hasChanged = this.playbackSpeed !== newSpeed;\n this.playbackSpeed = newSpeed;\n if (hasChanged) {\n this.time = millisecondsToSeconds(this.currentTime);\n }\n }\n play() {\n if (this.isStopped)\n return;\n const { driver = frameloopDriver, startTime } = this.options;\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp));\n }\n this.options.onPlay?.();\n const now = this.driver.now();\n if (this.state === \"finished\") {\n this.updateFinished();\n this.startTime = now;\n }\n else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime;\n }\n else if (!this.startTime) {\n this.startTime = startTime ?? now;\n }\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration;\n }\n this.holdTime = null;\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\";\n this.driver.start();\n }\n pause() {\n this.state = \"paused\";\n this.updateTime(time.now());\n this.holdTime = this.currentTime;\n }\n complete() {\n if (this.state !== \"running\") {\n this.play();\n }\n this.state = \"finished\";\n this.holdTime = null;\n }\n finish() {\n this.notifyFinished();\n this.teardown();\n this.state = \"finished\";\n this.options.onComplete?.();\n }\n cancel() {\n this.holdTime = null;\n this.startTime = 0;\n this.tick(0);\n this.teardown();\n this.options.onCancel?.();\n }\n teardown() {\n this.state = \"idle\";\n this.stopDriver();\n this.startTime = this.holdTime = null;\n activeAnimations.mainThread--;\n }\n stopDriver() {\n if (!this.driver)\n return;\n this.driver.stop();\n this.driver = undefined;\n }\n sample(sampleTime) {\n this.startTime = 0;\n return this.tick(sampleTime, true);\n }\n attachTimeline(timeline) {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\";\n this.options.ease = \"linear\";\n this.initAnimation();\n }\n this.driver?.stop();\n return timeline.observe(this);\n }\n}\n// Legacy function support\nfunction animateValue(options) {\n return new JSAnimation(options);\n}\n\nexport { JSAnimation, animateValue };\n","function fillWildcards(keyframes) {\n for (let i = 1; i < keyframes.length; i++) {\n keyframes[i] ?? (keyframes[i] = keyframes[i - 1]);\n }\n}\n\nexport { fillWildcards };\n","const radToDeg = (rad) => (rad * 180) / Math.PI;\nconst rotate = (v) => {\n const angle = radToDeg(Math.atan2(v[1], v[0]));\n return rebaseAngle(angle);\n};\nconst matrix2dParsers = {\n x: 4,\n y: 5,\n translateX: 4,\n translateY: 5,\n scaleX: 0,\n scaleY: 3,\n scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2,\n rotate,\n rotateZ: rotate,\n skewX: (v) => radToDeg(Math.atan(v[1])),\n skewY: (v) => radToDeg(Math.atan(v[2])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2,\n};\nconst rebaseAngle = (angle) => {\n angle = angle % 360;\n if (angle < 0)\n angle += 360;\n return angle;\n};\nconst rotateZ = rotate;\nconst scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]);\nconst scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]);\nconst matrix3dParsers = {\n x: 12,\n y: 13,\n z: 14,\n translateX: 12,\n translateY: 13,\n translateZ: 14,\n scaleX,\n scaleY,\n scale: (v) => (scaleX(v) + scaleY(v)) / 2,\n rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))),\n rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))),\n rotateZ,\n rotate: rotateZ,\n skewX: (v) => radToDeg(Math.atan(v[4])),\n skewY: (v) => radToDeg(Math.atan(v[1])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2,\n};\nfunction defaultTransformValue(name) {\n return name.includes(\"scale\") ? 1 : 0;\n}\nfunction parseValueFromTransform(transform, name) {\n if (!transform || transform === \"none\") {\n return defaultTransformValue(name);\n }\n const matrix3dMatch = transform.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u);\n let parsers;\n let match;\n if (matrix3dMatch) {\n parsers = matrix3dParsers;\n match = matrix3dMatch;\n }\n else {\n const matrix2dMatch = transform.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u);\n parsers = matrix2dParsers;\n match = matrix2dMatch;\n }\n if (!match) {\n return defaultTransformValue(name);\n }\n const valueParser = parsers[name];\n const values = match[1].split(\",\").map(convertTransformToNumber);\n return typeof valueParser === \"function\"\n ? valueParser(values)\n : values[valueParser];\n}\nconst readTransformValue = (instance, name) => {\n const { transform = \"none\" } = getComputedStyle(instance);\n return parseValueFromTransform(transform, name);\n};\nfunction convertTransformToNumber(value) {\n return parseFloat(value.trim());\n}\n\nexport { defaultTransformValue, parseValueFromTransform, readTransformValue };\n","/**\n * Generate a list of every possible transform key.\n */\nconst transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n];\n/**\n * A quick lookup for transform props.\n */\nconst transformProps = /*@__PURE__*/ (() => new Set(transformPropOrder))();\n\nexport { transformPropOrder, transformProps };\n","import { parseValueFromTransform } from '../../../render/dom/parse-transform.mjs';\nimport { transformPropOrder } from '../../../render/utils/keys-transform.mjs';\nimport { number } from '../../../value/types/numbers/index.mjs';\nimport { px } from '../../../value/types/numbers/units.mjs';\n\nconst isNumOrPxType = (v) => v === number || v === px;\nconst transformKeys = new Set([\"x\", \"y\", \"z\"]);\nconst nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));\nfunction removeNonTranslationalTransform(visualElement) {\n const removedTransforms = [];\n nonTranslationalTransformKeys.forEach((key) => {\n const value = visualElement.getValue(key);\n if (value !== undefined) {\n removedTransforms.push([key, value.get()]);\n value.set(key.startsWith(\"scale\") ? 1 : 0);\n }\n });\n return removedTransforms;\n}\nconst positionalValues = {\n // Dimensions\n width: ({ x }, { paddingLeft = \"0\", paddingRight = \"0\" }) => x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight),\n height: ({ y }, { paddingTop = \"0\", paddingBottom = \"0\" }) => y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom),\n top: (_bbox, { top }) => parseFloat(top),\n left: (_bbox, { left }) => parseFloat(left),\n bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min),\n right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min),\n // Transform\n x: (_bbox, { transform }) => parseValueFromTransform(transform, \"x\"),\n y: (_bbox, { transform }) => parseValueFromTransform(transform, \"y\"),\n};\n// Alias translate longform names\npositionalValues.translateX = positionalValues.x;\npositionalValues.translateY = positionalValues.y;\n\nexport { isNumOrPxType, positionalValues, removeNonTranslationalTransform };\n","import { fillWildcards } from './utils/fill-wildcards.mjs';\nimport { removeNonTranslationalTransform } from './utils/unit-conversion.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst toResolve = new Set();\nlet isScheduled = false;\nlet anyNeedsMeasurement = false;\nlet isForced = false;\nfunction measureAllKeyframes() {\n if (anyNeedsMeasurement) {\n const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement);\n const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element));\n const transformsToRestore = new Map();\n /**\n * Write pass\n * If we're measuring elements we want to remove bounding box-changing transforms.\n */\n elementsToMeasure.forEach((element) => {\n const removedTransforms = removeNonTranslationalTransform(element);\n if (!removedTransforms.length)\n return;\n transformsToRestore.set(element, removedTransforms);\n element.render();\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureInitialState());\n // Write\n elementsToMeasure.forEach((element) => {\n element.render();\n const restore = transformsToRestore.get(element);\n if (restore) {\n restore.forEach(([key, value]) => {\n element.getValue(key)?.set(value);\n });\n }\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureEndState());\n // Write\n resolversToMeasure.forEach((resolver) => {\n if (resolver.suspendedScrollY !== undefined) {\n window.scrollTo(0, resolver.suspendedScrollY);\n }\n });\n }\n anyNeedsMeasurement = false;\n isScheduled = false;\n toResolve.forEach((resolver) => resolver.complete(isForced));\n toResolve.clear();\n}\nfunction readAllKeyframes() {\n toResolve.forEach((resolver) => {\n resolver.readKeyframes();\n if (resolver.needsMeasurement) {\n anyNeedsMeasurement = true;\n }\n });\n}\nfunction flushKeyframeResolvers() {\n isForced = true;\n readAllKeyframes();\n measureAllKeyframes();\n isForced = false;\n}\nclass KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) {\n this.state = \"pending\";\n /**\n * Track whether this resolver is async. If it is, it'll be added to the\n * resolver queue and flushed in the next frame. Resolvers that aren't going\n * to trigger read/write thrashing don't need to be async.\n */\n this.isAsync = false;\n /**\n * Track whether this resolver needs to perform a measurement\n * to resolve its keyframes.\n */\n this.needsMeasurement = false;\n this.unresolvedKeyframes = [...unresolvedKeyframes];\n this.onComplete = onComplete;\n this.name = name;\n this.motionValue = motionValue;\n this.element = element;\n this.isAsync = isAsync;\n }\n scheduleResolve() {\n this.state = \"scheduled\";\n if (this.isAsync) {\n toResolve.add(this);\n if (!isScheduled) {\n isScheduled = true;\n frame.read(readAllKeyframes);\n frame.resolveKeyframes(measureAllKeyframes);\n }\n }\n else {\n this.readKeyframes();\n this.complete();\n }\n }\n readKeyframes() {\n const { unresolvedKeyframes, name, element, motionValue } = this;\n // If initial keyframe is null we need to read it from the DOM\n if (unresolvedKeyframes[0] === null) {\n const currentValue = motionValue?.get();\n // TODO: This doesn't work if the final keyframe is a wildcard\n const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (currentValue !== undefined) {\n unresolvedKeyframes[0] = currentValue;\n }\n else if (element && name) {\n const valueAsRead = element.readValue(name, finalKeyframe);\n if (valueAsRead !== undefined && valueAsRead !== null) {\n unresolvedKeyframes[0] = valueAsRead;\n }\n }\n if (unresolvedKeyframes[0] === undefined) {\n unresolvedKeyframes[0] = finalKeyframe;\n }\n if (motionValue && currentValue === undefined) {\n motionValue.set(unresolvedKeyframes[0]);\n }\n }\n fillWildcards(unresolvedKeyframes);\n }\n setFinalKeyframe() { }\n measureInitialState() { }\n renderEndStyles() { }\n measureEndState() { }\n complete(isForcedComplete = false) {\n this.state = \"complete\";\n this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete);\n toResolve.delete(this);\n }\n cancel() {\n if (this.state === \"scheduled\") {\n toResolve.delete(this);\n this.state = \"pending\";\n }\n }\n resume() {\n if (this.state === \"pending\")\n this.scheduleResolve();\n }\n}\n\nexport { KeyframeResolver, flushKeyframeResolvers };\n","const isCSSVar = (name) => name.startsWith(\"--\");\n\nexport { isCSSVar };\n","import { isCSSVar } from './is-css-var.mjs';\n\nfunction setStyle(element, name, value) {\n isCSSVar(name)\n ? element.style.setProperty(name, value)\n : (element.style[name] = value);\n}\n\nexport { setStyle };\n","import { memo } from 'motion-utils';\n\nconst supportsScrollTimeline = /* @__PURE__ */ memo(() => window.ScrollTimeline !== undefined);\n\nexport { supportsScrollTimeline };\n","/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nconst supportsFlags = {};\n\nexport { supportsFlags };\n","import { memo } from 'motion-utils';\nimport { supportsFlags } from './flags.mjs';\n\nfunction memoSupports(callback, supportsFlag) {\n const memoized = memo(callback);\n return () => supportsFlags[supportsFlag] ?? memoized();\n}\n\nexport { memoSupports };\n","import { memoSupports } from './memo.mjs';\n\nconst supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {\n try {\n document\n .createElement(\"div\")\n .animate({ opacity: 0 }, { easing: \"linear(0, 1)\" });\n }\n catch (e) {\n return false;\n }\n return true;\n}, \"linearEasing\");\n\nexport { supportsLinearEasing };\n","const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;\n\nexport { cubicBezierAsString };\n","import { cubicBezierAsString } from './cubic-bezier.mjs';\n\nconst supportedWaapiEasing = {\n linear: \"linear\",\n ease: \"ease\",\n easeIn: \"ease-in\",\n easeOut: \"ease-out\",\n easeInOut: \"ease-in-out\",\n circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),\n circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),\n backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\n backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\n};\n\nexport { supportedWaapiEasing };\n","import { isBezierDefinition } from 'motion-utils';\nimport { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { generateLinearEasing } from '../utils/linear.mjs';\nimport { cubicBezierAsString } from './cubic-bezier.mjs';\nimport { supportedWaapiEasing } from './supported.mjs';\n\nfunction mapEasingToNativeEasing(easing, duration) {\n if (!easing) {\n return undefined;\n }\n else if (typeof easing === \"function\") {\n return supportsLinearEasing()\n ? generateLinearEasing(easing, duration)\n : \"ease-out\";\n }\n else if (isBezierDefinition(easing)) {\n return cubicBezierAsString(easing);\n }\n else if (Array.isArray(easing)) {\n return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) ||\n supportedWaapiEasing.easeOut);\n }\n else {\n return supportedWaapiEasing[easing];\n }\n}\n\nexport { mapEasingToNativeEasing };\n","import { activeAnimations } from '../../stats/animation-count.mjs';\nimport { statsBuffer } from '../../stats/buffer.mjs';\nimport { mapEasingToNativeEasing } from './easing/map-easing.mjs';\n\nfunction startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = \"loop\", ease = \"easeOut\", times, } = {}, pseudoElement = undefined) {\n const keyframeOptions = {\n [valueName]: keyframes,\n };\n if (times)\n keyframeOptions.offset = times;\n const easing = mapEasingToNativeEasing(ease, duration);\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing))\n keyframeOptions.easing = easing;\n if (statsBuffer.value) {\n activeAnimations.waapi++;\n }\n const options = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n };\n if (pseudoElement)\n options.pseudoElement = pseudoElement;\n const animation = element.animate(keyframeOptions, options);\n if (statsBuffer.value) {\n animation.finished.finally(() => {\n activeAnimations.waapi--;\n });\n }\n return animation;\n}\n\nexport { startWaapiAnimation };\n","function isGenerator(type) {\n return typeof type === \"function\" && \"applyToOptions\" in type;\n}\n\nexport { isGenerator };\n","import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { isGenerator } from '../../generators/utils/is-generator.mjs';\n\nfunction applyGeneratorOptions({ type, ...options }) {\n if (isGenerator(type) && supportsLinearEasing()) {\n return type.applyToOptions(options);\n }\n else {\n options.duration ?? (options.duration = 300);\n options.ease ?? (options.ease = \"easeOut\");\n }\n return options;\n}\n\nexport { applyGeneratorOptions };\n","import { invariant, millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { supportsScrollTimeline } from '../utils/supports/scroll-timeline.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { startWaapiAnimation } from './waapi/start-waapi-animation.mjs';\nimport { applyGeneratorOptions } from './waapi/utils/apply-generator.mjs';\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nclass NativeAnimation extends WithPromise {\n constructor(options) {\n super();\n this.finishedTime = null;\n this.isStopped = false;\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n this.manualStartTime = null;\n if (!options)\n return;\n const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;\n this.isPseudoElement = Boolean(pseudoElement);\n this.allowFlatten = allowFlatten;\n this.options = options;\n invariant(typeof options.type !== \"string\", `Mini animate() doesn't support \"type\" as a string.`, \"mini-spring\");\n const transition = applyGeneratorOptions(options);\n this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement);\n if (transition.autoplay === false) {\n this.animation.pause();\n }\n this.animation.onfinish = () => {\n this.finishedTime = this.time;\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe);\n }\n else {\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n */\n setStyle(element, name, keyframe);\n }\n this.animation.cancel();\n }\n onComplete?.();\n this.notifyFinished();\n };\n }\n play() {\n if (this.isStopped)\n return;\n this.manualStartTime = null;\n this.animation.play();\n if (this.state === \"finished\") {\n this.updateFinished();\n }\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.finish?.();\n }\n cancel() {\n try {\n this.animation.cancel();\n }\n catch (e) { }\n }\n stop() {\n if (this.isStopped)\n return;\n this.isStopped = true;\n const { state } = this;\n if (state === \"idle\" || state === \"finished\") {\n return;\n }\n if (this.updateMotionValue) {\n this.updateMotionValue();\n }\n else {\n this.commitStyles();\n }\n if (!this.isPseudoElement)\n this.cancel();\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n commitStyles() {\n if (!this.isPseudoElement) {\n this.animation.commitStyles?.();\n }\n }\n get duration() {\n const duration = this.animation.effect?.getComputedTiming?.().duration || 0;\n return millisecondsToSeconds(Number(duration));\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0);\n }\n set time(newTime) {\n this.manualStartTime = null;\n this.finishedTime = null;\n this.animation.currentTime = secondsToMilliseconds(newTime);\n }\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate;\n }\n set speed(newSpeed) {\n // Allow backwards playback after finishing\n if (newSpeed < 0)\n this.finishedTime = null;\n this.animation.playbackRate = newSpeed;\n }\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState;\n }\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime);\n }\n set startTime(newStartTime) {\n this.manualStartTime = this.animation.startTime = newStartTime;\n }\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({ timeline, observe }) {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" });\n }\n this.animation.onfinish = null;\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline;\n return noop;\n }\n else {\n return observe(this);\n }\n }\n}\n\nexport { NativeAnimation };\n","import { anticipate, backInOut, circInOut } from 'motion-utils';\n\nconst unsupportedEasingFunctions = {\n anticipate,\n backInOut,\n circInOut,\n};\nfunction isUnsupportedEase(key) {\n return key in unsupportedEasingFunctions;\n}\nfunction replaceStringEasing(transition) {\n if (typeof transition.ease === \"string\" &&\n isUnsupportedEase(transition.ease)) {\n transition.ease = unsupportedEasingFunctions[transition.ease];\n }\n}\n\nexport { replaceStringEasing };\n","import { clamp } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { NativeAnimation } from './NativeAnimation.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { replaceStringEasing } from './waapi/utils/unsupported-easing.mjs';\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10; //ms\nclass NativeAnimationExtended extends NativeAnimation {\n constructor(options) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options);\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options);\n super(options);\n if (options.startTime !== undefined) {\n this.startTime = options.startTime;\n }\n this.options = options;\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read committed styles back out of the DOM, we can\n * create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to calculate velocity for any subsequent animation.\n */\n updateMotionValue(value) {\n const { motionValue, onUpdate, onComplete, element, ...options } = this.options;\n if (!motionValue)\n return;\n if (value !== undefined) {\n motionValue.set(value);\n return;\n }\n const sampleAnimation = new JSAnimation({\n ...options,\n autoplay: false,\n });\n /**\n * Use wall-clock elapsed time for sampling.\n * Under CPU load, WAAPI's currentTime may not reflect actual\n * elapsed time, causing incorrect sampling and visual jumps.\n */\n const sampleTime = Math.max(sampleDelta, time.now() - this.startTime);\n const delta = clamp(0, sampleDelta, sampleTime - sampleDelta);\n motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, sampleAnimation.sample(sampleTime).value, delta);\n sampleAnimation.stop();\n }\n}\n\nexport { NativeAnimationExtended };\n","import { complex } from '../../value/types/complex/index.mjs';\n\n/**\n * Check if a value is animatable. Examples:\n *\n * ✅: 100, \"100px\", \"#fff\"\n * ❌: \"block\", \"url(2.jpg)\"\n * @param value\n *\n * @internal\n */\nconst isAnimatable = (value, name) => {\n // If the list of keys that might be non-animatable grows, replace with Set\n if (name === \"zIndex\")\n return false;\n // If it's a number or a keyframes array, we can animate it. We might at some point\n // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,\n // but for now lets leave it like this for performance reasons\n if (typeof value === \"number\" || Array.isArray(value))\n return true;\n if (typeof value === \"string\" && // It's animatable if we have a string\n (complex.test(value) || value === \"0\") && // And it contains numbers and/or colors\n !value.startsWith(\"url(\") // Unless it starts with \"url(\"\n ) {\n return true;\n }\n return false;\n};\n\nexport { isAnimatable };\n","import { warning } from 'motion-utils';\nimport { isGenerator } from '../generators/utils/is-generator.mjs';\nimport { isAnimatable } from './is-animatable.mjs';\n\nfunction hasKeyframesChanged(keyframes) {\n const current = keyframes[0];\n if (keyframes.length === 1)\n return true;\n for (let i = 0; i < keyframes.length; i++) {\n if (keyframes[i] !== current)\n return true;\n }\n}\nfunction canAnimate(keyframes, name, type, velocity) {\n /**\n * Check if we're able to animate between the start and end keyframes,\n * and throw a warning if we're attempting to animate between one that's\n * animatable and another that isn't.\n */\n const originKeyframe = keyframes[0];\n if (originKeyframe === null)\n return false;\n /**\n * These aren't traditionally animatable but we do support them.\n * In future we could look into making this more generic or replacing\n * this function with mix() === mixImmediate\n */\n if (name === \"display\" || name === \"visibility\")\n return true;\n const targetKeyframe = keyframes[keyframes.length - 1];\n const isOriginAnimatable = isAnimatable(originKeyframe, name);\n const isTargetAnimatable = isAnimatable(targetKeyframe, name);\n warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from \"${originKeyframe}\" to \"${targetKeyframe}\". \"${isOriginAnimatable ? targetKeyframe : originKeyframe}\" is not an animatable value.`, \"value-not-animatable\");\n // Always skip if any of these are true\n if (!isOriginAnimatable || !isTargetAnimatable) {\n return false;\n }\n return (hasKeyframesChanged(keyframes) ||\n ((type === \"spring\" || isGenerator(type)) && velocity));\n}\n\nexport { canAnimate };\n","function makeAnimationInstant(options) {\n options.duration = 0;\n options.type = \"keyframes\";\n}\n\nexport { makeAnimationInstant };\n","import { memo } from 'motion-utils';\n\n/**\n * A list of values that can be hardware-accelerated.\n */\nconst acceleratedValues = new Set([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n // TODO: Could be re-enabled now we have support for linear() easing\n // \"background-color\"\n]);\nconst supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, \"animate\"));\nfunction supportsBrowserAnimation(options) {\n const { motionValue, name, repeatDelay, repeatType, damping, type } = options;\n const subject = motionValue?.owner?.current;\n /**\n * We use this check instead of isHTMLElement() because we explicitly\n * **don't** want elements in different timing contexts (i.e. popups)\n * to be accelerated, as it's not possible to sync these animations\n * properly with those driven from the main window frameloop.\n */\n if (!(subject instanceof HTMLElement)) {\n return false;\n }\n const { onUpdate, transformTemplate } = motionValue.owner.getProps();\n return (supportsWaapi() &&\n name &&\n acceleratedValues.has(name) &&\n (name !== \"transform\" || !transformTemplate) &&\n /**\n * If we're outputting values to onUpdate then we can't use WAAPI as there's\n * no way to read the value from WAAPI every frame.\n */\n !onUpdate &&\n !repeatDelay &&\n repeatType !== \"mirror\" &&\n damping !== 0 &&\n type !== \"inertia\");\n}\n\nexport { supportsBrowserAnimation };\n","import { MotionGlobalConfig, noop } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { KeyframeResolver, flushKeyframeResolvers } from './keyframes/KeyframesResolver.mjs';\nimport { NativeAnimationExtended } from './NativeAnimationExtended.mjs';\nimport { canAnimate } from './utils/can-animate.mjs';\nimport { makeAnimationInstant } from './utils/make-animation-instant.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { supportsBrowserAnimation } from './waapi/supports/waapi.mjs';\n\n/**\n * Maximum time allowed between an animation being created and it being\n * resolved for us to use the latter as the start time.\n *\n * This is to ensure that while we prefer to \"start\" an animation as soon\n * as it's triggered, we also want to avoid a visual jump if there's a big delay\n * between these two moments.\n */\nconst MAX_RESOLVE_DELAY = 40;\nclass AsyncMotionValueAnimation extends WithPromise {\n constructor({ autoplay = true, delay = 0, type = \"keyframes\", repeat = 0, repeatDelay = 0, repeatType = \"loop\", keyframes, name, motionValue, element, ...options }) {\n super();\n /**\n * Bound to support return animation.stop pattern\n */\n this.stop = () => {\n if (this._animation) {\n this._animation.stop();\n this.stopTimeline?.();\n }\n this.keyframeResolver?.cancel();\n };\n this.createdAt = time.now();\n const optionsWithDefaults = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n name,\n motionValue,\n element,\n ...options,\n };\n const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver;\n this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element);\n this.keyframeResolver?.scheduleResolve();\n }\n onKeyframesResolved(keyframes, finalKeyframe, options, sync) {\n this.keyframeResolver = undefined;\n const { name, type, velocity, delay, isHandoff, onUpdate } = options;\n this.resolvedAt = time.now();\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n if (!canAnimate(keyframes, name, type, velocity)) {\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe));\n }\n keyframes[0] = keyframes[keyframes.length - 1];\n makeAnimationInstant(options);\n options.repeat = 0;\n }\n /**\n * Resolve startTime for the animation.\n *\n * This method uses the createdAt and resolvedAt to calculate the\n * animation startTime. *Ideally*, we would use the createdAt time as t=0\n * as the following frame would then be the first frame of the animation in\n * progress, which would feel snappier.\n *\n * However, if there's a delay (main thread work) between the creation of\n * the animation and the first committed frame, we prefer to use resolvedAt\n * to avoid a sudden jump into the animation.\n */\n const startTime = sync\n ? !this.resolvedAt\n ? this.createdAt\n : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY\n ? this.resolvedAt\n : this.createdAt\n : undefined;\n const resolvedOptions = {\n startTime,\n finalKeyframe,\n ...options,\n keyframes,\n };\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n */\n const animation = !isHandoff && supportsBrowserAnimation(resolvedOptions)\n ? new NativeAnimationExtended({\n ...resolvedOptions,\n element: resolvedOptions.motionValue.owner.current,\n })\n : new JSAnimation(resolvedOptions);\n animation.finished.then(() => this.notifyFinished()).catch(noop);\n if (this.pendingTimeline) {\n this.stopTimeline = animation.attachTimeline(this.pendingTimeline);\n this.pendingTimeline = undefined;\n }\n this._animation = animation;\n }\n get finished() {\n if (!this._animation) {\n return this._finished;\n }\n else {\n return this.animation.finished;\n }\n }\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n get animation() {\n if (!this._animation) {\n this.keyframeResolver?.resume();\n flushKeyframeResolvers();\n }\n return this._animation;\n }\n get duration() {\n return this.animation.duration;\n }\n get iterationDuration() {\n return this.animation.iterationDuration;\n }\n get time() {\n return this.animation.time;\n }\n set time(newTime) {\n this.animation.time = newTime;\n }\n get speed() {\n return this.animation.speed;\n }\n get state() {\n return this.animation.state;\n }\n set speed(newSpeed) {\n this.animation.speed = newSpeed;\n }\n get startTime() {\n return this.animation.startTime;\n }\n attachTimeline(timeline) {\n if (this._animation) {\n this.stopTimeline = this.animation.attachTimeline(timeline);\n }\n else {\n this.pendingTimeline = timeline;\n }\n return () => this.stop();\n }\n play() {\n this.animation.play();\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.complete();\n }\n cancel() {\n if (this._animation) {\n this.animation.cancel();\n }\n this.keyframeResolver?.cancel();\n }\n}\n\nexport { AsyncMotionValueAnimation };\n","import { invariant, isNumericalString } from 'motion-utils';\nimport { isCSSVariableToken } from './is-css-variable.mjs';\n\n/**\n * Parse Framer's special CSS variable format into a CSS token and a fallback.\n *\n * ```\n * `var(--foo, #fff)` => [`--foo`, '#fff']\n * ```\n *\n * @param current\n */\nconst splitCSSVariableRegex = \n// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words\n/^var\\(--(?:([\\w-]+)|([\\w-]+), ?([a-zA-Z\\d ()%#.,-]+))\\)/u;\nfunction parseCSSVariable(current) {\n const match = splitCSSVariableRegex.exec(current);\n if (!match)\n return [,];\n const [, token1, token2, fallback] = match;\n return [`--${token1 ?? token2}`, fallback];\n}\nconst maxDepth = 4;\nfunction getVariableValue(current, element, depth = 1) {\n invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property \"${current}\". This may indicate a circular fallback dependency.`, \"max-css-var-depth\");\n const [token, fallback] = parseCSSVariable(current);\n // No CSS variable detected\n if (!token)\n return;\n // Attempt to read this CSS variable off the element\n const resolved = window.getComputedStyle(element).getPropertyValue(token);\n if (resolved) {\n const trimmed = resolved.trim();\n return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed;\n }\n return isCSSVariableToken(fallback)\n ? getVariableValue(fallback, element, depth + 1)\n : fallback;\n}\n\nexport { getVariableValue, parseCSSVariable };\n","function getValueTransition(transition, key) {\n return (transition?.[key] ??\n transition?.[\"default\"] ??\n transition);\n}\n\nexport { getValueTransition };\n","import { transformProps } from '../../render/utils/keys-transform.mjs';\n\nconst underDampedSpring = {\n type: \"spring\",\n stiffness: 500,\n damping: 25,\n restSpeed: 10,\n};\nconst criticallyDampedSpring = (target) => ({\n type: \"spring\",\n stiffness: 550,\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\n restSpeed: 10,\n});\nconst keyframesTransition = {\n type: \"keyframes\",\n duration: 0.8,\n};\n/**\n * Default easing curve is a slightly shallower version of\n * the default browser easing curve.\n */\nconst ease = {\n type: \"keyframes\",\n ease: [0.25, 0.1, 0.35, 1],\n duration: 0.3,\n};\nconst getDefaultTransition = (valueKey, { keyframes }) => {\n if (keyframes.length > 2) {\n return keyframesTransition;\n }\n else if (transformProps.has(valueKey)) {\n return valueKey.startsWith(\"scale\")\n ? criticallyDampedSpring(keyframes[1])\n : underDampedSpring;\n }\n return ease;\n};\n\nexport { getDefaultTransition };\n","/**\n * Decide whether a transition is defined on a given Transition.\n * This filters out orchestration options and returns true\n * if any options are left.\n */\nfunction isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) {\n return !!Object.keys(transition).length;\n}\n\nexport { isTransitionDefined };\n","const isNotNull = (value) => value !== null;\nfunction getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }, finalKeyframe) {\n const resolvedKeyframes = keyframes.filter(isNotNull);\n const index = repeat && repeatType !== \"loop\" && repeat % 2 === 1\n ? 0\n : resolvedKeyframes.length - 1;\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe;\n}\n\nexport { getFinalKeyframe };\n","function calcChildStagger(children, child, delayChildren, staggerChildren = 0, staggerDirection = 1) {\n const index = Array.from(children)\n .sort((a, b) => a.sortNodePosition(b))\n .indexOf(child);\n const numChildren = children.size;\n const maxStaggerDuration = (numChildren - 1) * staggerChildren;\n const delayIsFunction = typeof delayChildren === \"function\";\n return delayIsFunction\n ? delayChildren(index, numChildren)\n : staggerDirection === 1\n ? index * staggerChildren\n : maxStaggerDuration - index * staggerChildren;\n}\n\nexport { calcChildStagger };\n","import { secondsToMilliseconds, MotionGlobalConfig } from 'motion-utils';\nimport { AsyncMotionValueAnimation } from '../AsyncMotionValueAnimation.mjs';\nimport { JSAnimation } from '../JSAnimation.mjs';\nimport { getValueTransition } from '../utils/get-value-transition.mjs';\nimport { makeAnimationInstant } from '../utils/make-animation-instant.mjs';\nimport { getDefaultTransition } from '../utils/default-transitions.mjs';\nimport { getFinalKeyframe } from '../utils/get-final-keyframe.mjs';\nimport { isTransitionDefined } from '../utils/is-transition-defined.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {};\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0;\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition;\n elapsed = elapsed - secondsToMilliseconds(delay);\n const options = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v);\n valueTransition.onUpdate && valueTransition.onUpdate(v);\n },\n onComplete: () => {\n onComplete();\n valueTransition.onComplete && valueTransition.onComplete();\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n };\n /**\n * If there's no transition defined for this value, we can generate\n * unique transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n Object.assign(options, getDefaultTransition(name, options));\n }\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n options.duration && (options.duration = secondsToMilliseconds(options.duration));\n options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay));\n /**\n * Support deprecated way to set initial value. Prefer keyframe syntax.\n */\n if (options.from !== undefined) {\n options.keyframes[0] = options.from;\n }\n let shouldSkip = false;\n if (options.type === false ||\n (options.duration === 0 && !options.repeatDelay)) {\n makeAnimationInstant(options);\n if (options.delay === 0) {\n shouldSkip = true;\n }\n }\n if (MotionGlobalConfig.instantAnimations ||\n MotionGlobalConfig.skipAnimations) {\n shouldSkip = true;\n makeAnimationInstant(options);\n options.delay = 0;\n }\n /**\n * If the transition type or easing has been explicitly set by the user\n * then we don't want to allow flattening the animation.\n */\n options.allowFlatten = !valueTransition.type && !valueTransition.ease;\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition);\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate(finalKeyframe);\n options.onComplete();\n });\n return;\n }\n }\n return valueTransition.isSync\n ? new JSAnimation(options)\n : new AsyncMotionValueAnimation(options);\n};\n\nexport { animateMotionValue };\n","import { transformPropOrder } from './keys-transform.mjs';\n\nconst positionalKeys = new Set([\n \"width\",\n \"height\",\n \"top\",\n \"left\",\n \"right\",\n \"bottom\",\n ...transformPropOrder,\n]);\n\nexport { positionalKeys };\n","import { warnOnce, SubscriptionManager, velocityPerSecond } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { frame } from '../frameloop/frame.mjs';\n\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30;\nconst isFloat = (value) => {\n return !isNaN(parseFloat(value));\n};\nconst collectMotionValues = {\n current: undefined,\n};\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nclass MotionValue {\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init, options = {}) {\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n this.canTrackVelocity = null;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n this.updateAndNotify = (v) => {\n const currentTime = time.now();\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue();\n }\n this.prev = this.current;\n this.setCurrent(v);\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current);\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty();\n }\n }\n }\n };\n this.hasAnimated = false;\n this.setCurrent(init);\n this.owner = options.owner;\n }\n setCurrent(current) {\n this.current = current;\n this.updatedAt = time.now();\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current);\n }\n }\n setPrevFrameValue(prevFrameValue = this.current) {\n this.prevFrameValue = prevFrameValue;\n this.prevUpdatedAt = this.updatedAt;\n }\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return <motion.div style={{ x }} />\n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription) {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\n }\n return this.on(\"change\", subscription);\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n const unsubscribe = this.events[eventName].add(callback);\n if (eventName === \"change\") {\n return () => {\n unsubscribe();\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop();\n }\n });\n };\n }\n return unsubscribe;\n }\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear();\n }\n }\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect, stopPassiveEffect) {\n this.passiveEffect = passiveEffect;\n this.stopPassiveEffect = stopPassiveEffect;\n }\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v);\n }\n else {\n this.passiveEffect(v, this.updateAndNotify);\n }\n }\n setWithVelocity(prev, current, delta) {\n this.set(current);\n this.prev = undefined;\n this.prevFrameValue = prev;\n this.prevUpdatedAt = this.updatedAt - delta;\n }\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v, endAnimation = true) {\n this.updateAndNotify(v);\n this.prev = v;\n this.prevUpdatedAt = this.prevFrameValue = undefined;\n endAnimation && this.stop();\n if (this.stopPassiveEffect)\n this.stopPassiveEffect();\n }\n dirty() {\n this.events.change?.notify(this.current);\n }\n addDependent(dependent) {\n if (!this.dependents) {\n this.dependents = new Set();\n }\n this.dependents.add(dependent);\n }\n removeDependent(dependent) {\n if (this.dependents) {\n this.dependents.delete(dependent);\n }\n }\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this);\n }\n return this.current;\n }\n /**\n * @public\n */\n getPrevious() {\n return this.prev;\n }\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now();\n if (!this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA) {\n return 0;\n }\n const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA);\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(parseFloat(this.current) -\n parseFloat(this.prevFrameValue), delta);\n }\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation) {\n this.stop();\n return new Promise((resolve) => {\n this.hasAnimated = true;\n this.animation = startAnimation(resolve);\n if (this.events.animationStart) {\n this.events.animationStart.notify();\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify();\n }\n this.clearAnimation();\n });\n }\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop();\n if (this.events.animationCancel) {\n this.events.animationCancel.notify();\n }\n }\n this.clearAnimation();\n }\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation;\n }\n clearAnimation() {\n delete this.animation;\n }\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear();\n this.events.destroy?.notify();\n this.clearListeners();\n this.stop();\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect();\n }\n }\n}\nfunction motionValue(init, options) {\n return new MotionValue(init, options);\n}\n\nexport { MotionValue, collectMotionValues, motionValue };\n","function getValueState(visualElement) {\n const state = [{}, {}];\n visualElement?.values.forEach((value, key) => {\n state[0][key] = value.get();\n state[1][key] = value.getVelocity();\n });\n return state;\n}\nfunction resolveVariantFromProps(props, definition, custom, visualElement) {\n /**\n * If the variant definition is a function, resolve.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n /**\n * If the variant definition is a variant label, or\n * the function returned a variant label, resolve.\n */\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition];\n }\n /**\n * At this point we've resolved both functions and variant labels,\n * but the resolved variant label might itself have been a function.\n * If so, resolve. This can only have returned a valid target object.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n return definition;\n}\n\nexport { resolveVariantFromProps };\n","import { resolveVariantFromProps } from './resolve-variants.mjs';\n\nfunction resolveVariant(visualElement, definition, custom) {\n const props = visualElement.getProps();\n return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement);\n}\n\nexport { resolveVariant };\n","const isKeyframesTarget = (v) => {\n return Array.isArray(v);\n};\n\nexport { isKeyframesTarget };\n","import { motionValue } from '../../value/index.mjs';\nimport { resolveVariant } from './resolve-dynamic-variants.mjs';\nimport { isKeyframesTarget } from './is-keyframes-target.mjs';\n\n/**\n * Set VisualElement's MotionValue, creating a new MotionValue for it if\n * it doesn't exist.\n */\nfunction setMotionValue(visualElement, key, value) {\n if (visualElement.hasValue(key)) {\n visualElement.getValue(key).set(value);\n }\n else {\n visualElement.addValue(key, motionValue(value));\n }\n}\nfunction resolveFinalValueInKeyframes(v) {\n // TODO maybe throw if v.length - 1 is placeholder token?\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v;\n}\nfunction setTarget(visualElement, definition) {\n const resolved = resolveVariant(visualElement, definition);\n let { transitionEnd = {}, transition = {}, ...target } = resolved || {};\n target = { ...target, ...transitionEnd };\n for (const key in target) {\n const value = resolveFinalValueInKeyframes(target[key]);\n setMotionValue(visualElement, key, value);\n }\n}\n\nexport { setTarget };\n","const isMotionValue = (value) => Boolean(value && value.getVelocity);\n\nexport { isMotionValue };\n","import { isMotionValue } from '../utils/is-motion-value.mjs';\n\nfunction isWillChangeMotionValue(value) {\n return Boolean(isMotionValue(value) && value.add);\n}\n\nexport { isWillChangeMotionValue };\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { isWillChangeMotionValue } from './is.mjs';\n\nfunction addValueToWillChange(visualElement, key) {\n const willChange = visualElement.getValue(\"willChange\");\n /**\n * It could be that a user has set willChange to a regular MotionValue,\n * in which case we can't add the value to it.\n */\n if (isWillChangeMotionValue(willChange)) {\n return willChange.add(key);\n }\n else if (!willChange && MotionGlobalConfig.WillChange) {\n const newWillChange = new MotionGlobalConfig.WillChange(\"auto\");\n visualElement.addValue(\"willChange\", newWillChange);\n newWillChange.add(key);\n }\n}\n\nexport { addValueToWillChange };\n","function camelToDash(str) {\n return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`);\n}\n\nexport { camelToDash };\n","import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs';\n\nconst optimizedAppearDataId = \"framerAppearId\";\nconst optimizedAppearDataAttribute = \"data-\" + camelToDash(optimizedAppearDataId);\n\nexport { optimizedAppearDataAttribute, optimizedAppearDataId };\n","import { optimizedAppearDataAttribute } from './data-id.mjs';\n\nfunction getOptimisedAppearId(visualElement) {\n return visualElement.props[optimizedAppearDataAttribute];\n}\n\nexport { getOptimisedAppearId };\n","import { getValueTransition } from '../utils/get-value-transition.mjs';\nimport { positionalKeys } from '../../render/utils/keys-position.mjs';\nimport { setTarget } from '../../render/utils/setters.mjs';\nimport { addValueToWillChange } from '../../value/will-change/add-will-change.mjs';\nimport { getOptimisedAppearId } from '../optimized-appear/get-appear-id.mjs';\nimport { animateMotionValue } from './motion-value.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {\n const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;\n needsAnimating[key] = false;\n return shouldBlock;\n}\nfunction animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {\n let { transition = visualElement.getDefaultTransition(), transitionEnd, ...target } = targetAndTransition;\n if (transitionOverride)\n transition = transitionOverride;\n const animations = [];\n const animationTypeState = type &&\n visualElement.animationState &&\n visualElement.animationState.getState()[type];\n for (const key in target) {\n const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null);\n const valueTarget = target[key];\n if (valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))) {\n continue;\n }\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n };\n /**\n * If the value is already at the defined target, skip the animation.\n */\n const currentValue = value.get();\n if (currentValue !== undefined &&\n !value.isAnimating &&\n !Array.isArray(valueTarget) &&\n valueTarget === currentValue &&\n !valueTransition.velocity) {\n continue;\n }\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false;\n if (window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement);\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(appearId, key, frame);\n if (startTime !== null) {\n valueTransition.startTime = startTime;\n isHandoff = true;\n }\n }\n }\n addValueToWillChange(visualElement, key);\n value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition, visualElement, isHandoff));\n const animation = value.animation;\n if (animation) {\n animations.push(animation);\n }\n }\n if (transitionEnd) {\n Promise.all(animations).then(() => {\n frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd);\n });\n });\n }\n return animations;\n}\n\nexport { animateTarget };\n","import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\nimport { calcChildStagger } from '../utils/calc-child-stagger.mjs';\nimport { animateTarget } from './visual-element-target.mjs';\n\nfunction animateVariant(visualElement, variant, options = {}) {\n const resolved = resolveVariant(visualElement, variant, options.type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined);\n let { transition = visualElement.getDefaultTransition() || {} } = resolved || {};\n if (options.transitionOverride) {\n transition = options.transitionOverride;\n }\n /**\n * If we have a variant, create a callback that runs it as an animation.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getAnimation = resolved\n ? () => Promise.all(animateTarget(visualElement, resolved, options))\n : () => Promise.resolve();\n /**\n * If we have children, create a callback that runs all their animations.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size\n ? (forwardDelay = 0) => {\n const { delayChildren = 0, staggerChildren, staggerDirection, } = transition;\n return animateChildren(visualElement, variant, forwardDelay, delayChildren, staggerChildren, staggerDirection, options);\n }\n : () => Promise.resolve();\n /**\n * If the transition explicitly defines a \"when\" option, we need to resolve either\n * this animation or all children animations before playing the other.\n */\n const { when } = transition;\n if (when) {\n const [first, last] = when === \"beforeChildren\"\n ? [getAnimation, getChildAnimations]\n : [getChildAnimations, getAnimation];\n return first().then(() => last());\n }\n else {\n return Promise.all([getAnimation(), getChildAnimations(options.delay)]);\n }\n}\nfunction animateChildren(visualElement, variant, delay = 0, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) {\n const animations = [];\n for (const child of visualElement.variantChildren) {\n child.notify(\"AnimationStart\", variant);\n animations.push(animateVariant(child, variant, {\n ...options,\n delay: delay +\n (typeof delayChildren === \"function\" ? 0 : delayChildren) +\n calcChildStagger(visualElement.variantChildren, child, delayChildren, staggerChildren, staggerDirection),\n }).then(() => child.notify(\"AnimationComplete\", variant)));\n }\n return Promise.all(animations);\n}\n\nexport { animateVariant };\n","import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\nimport { animateTarget } from './visual-element-target.mjs';\nimport { animateVariant } from './visual-element-variant.mjs';\n\nfunction animateVisualElement(visualElement, definition, options = {}) {\n visualElement.notify(\"AnimationStart\", definition);\n let animation;\n if (Array.isArray(definition)) {\n const animations = definition.map((variant) => animateVariant(visualElement, variant, options));\n animation = Promise.all(animations);\n }\n else if (typeof definition === \"string\") {\n animation = animateVariant(visualElement, definition, options);\n }\n else {\n const resolvedDefinition = typeof definition === \"function\"\n ? resolveVariant(visualElement, definition, options.custom)\n : definition;\n animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options));\n }\n return animation.then(() => {\n visualElement.notify(\"AnimationComplete\", definition);\n });\n}\n\nexport { animateVisualElement };\n","/**\n * ValueType for \"auto\"\n */\nconst auto = {\n test: (v) => v === \"auto\",\n parse: (v) => v,\n};\n\nexport { auto };\n","/**\n * Tests a provided value against a ValueType\n */\nconst testValueType = (v) => (type) => type.test(v);\n\nexport { testValueType };\n","import { auto } from './auto.mjs';\nimport { number } from './numbers/index.mjs';\nimport { px, percent, degrees, vw, vh } from './numbers/units.mjs';\nimport { testValueType } from './test.mjs';\n\n/**\n * A list of value types commonly used for dimensions\n */\nconst dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto];\n/**\n * Tests a dimensional value against the list of dimension ValueTypes\n */\nconst findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v));\n\nexport { dimensionValueTypes, findDimensionValueType };\n","import { isZeroValueString } from 'motion-utils';\n\nfunction isNone(value) {\n if (typeof value === \"number\") {\n return value === 0;\n }\n else if (value !== null) {\n return value === \"none\" || value === \"0\" || isZeroValueString(value);\n }\n else {\n return true;\n }\n}\n\nexport { isNone };\n","import { complex } from './index.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\n\n/**\n * Properties that should default to 1 or 100%\n */\nconst maxDefaults = new Set([\"brightness\", \"contrast\", \"saturate\", \"opacity\"]);\nfunction applyDefaultFilter(v) {\n const [name, value] = v.slice(0, -1).split(\"(\");\n if (name === \"drop-shadow\")\n return v;\n const [number] = value.match(floatRegex) || [];\n if (!number)\n return v;\n const unit = value.replace(number, \"\");\n let defaultValue = maxDefaults.has(name) ? 1 : 0;\n if (number !== value)\n defaultValue *= 100;\n return name + \"(\" + defaultValue + unit + \")\";\n}\nconst functionRegex = /\\b([a-z-]*)\\(.*?\\)/gu;\nconst filter = {\n ...complex,\n getAnimatableNone: (v) => {\n const functions = v.match(functionRegex);\n return functions ? functions.map(applyDefaultFilter).join(\" \") : v;\n },\n};\n\nexport { filter };\n","import { number } from './numbers/index.mjs';\n\nconst int = {\n ...number,\n transform: Math.round,\n};\n\nexport { int };\n","import { scale, alpha } from '../numbers/index.mjs';\nimport { degrees, px, progressPercentage } from '../numbers/units.mjs';\n\nconst transformValueTypes = {\n rotate: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n};\n\nexport { transformValueTypes };\n","import { int } from '../int.mjs';\nimport { alpha } from '../numbers/index.mjs';\nimport { px } from '../numbers/units.mjs';\nimport { transformValueTypes } from './transform.mjs';\n\nconst numberValueTypes = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n radius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n ...transformValueTypes,\n zIndex: int,\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n};\n\nexport { numberValueTypes };\n","import { color } from '../color/index.mjs';\nimport { filter } from '../complex/filter.mjs';\nimport { numberValueTypes } from './number.mjs';\n\n/**\n * A map of default value types for common values\n */\nconst defaultValueTypes = {\n ...numberValueTypes,\n // Color props\n color,\n backgroundColor: color,\n outlineColor: color,\n fill: color,\n stroke: color,\n // Border props\n borderColor: color,\n borderTopColor: color,\n borderRightColor: color,\n borderBottomColor: color,\n borderLeftColor: color,\n filter,\n WebkitFilter: filter,\n};\n/**\n * Gets the default ValueType for the provided value key\n */\nconst getDefaultValueType = (key) => defaultValueTypes[key];\n\nexport { defaultValueTypes, getDefaultValueType };\n","import { complex } from '../complex/index.mjs';\nimport { filter } from '../complex/filter.mjs';\nimport { getDefaultValueType } from '../maps/defaults.mjs';\n\nfunction getAnimatableNone(key, value) {\n let defaultValueType = getDefaultValueType(key);\n if (defaultValueType !== filter)\n defaultValueType = complex;\n // If value is not recognised as animatable, ie \"none\", create an animatable version origin based on the target\n return defaultValueType.getAnimatableNone\n ? defaultValueType.getAnimatableNone(value)\n : undefined;\n}\n\nexport { getAnimatableNone };\n","import { analyseComplexValue } from '../../../value/types/complex/index.mjs';\nimport { getAnimatableNone } from '../../../value/types/utils/animatable-none.mjs';\n\n/**\n * If we encounter keyframes like \"none\" or \"0\" and we also have keyframes like\n * \"#fff\" or \"200px 200px\" we want to find a keyframe to serve as a template for\n * the \"none\" keyframes. In this case \"#fff\" or \"200px 200px\" - then these get turned into\n * zero equivalents, i.e. \"#fff0\" or \"0px 0px\".\n */\nconst invalidTemplates = new Set([\"auto\", \"none\", \"0\"]);\nfunction makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) {\n let i = 0;\n let animatableTemplate = undefined;\n while (i < unresolvedKeyframes.length && !animatableTemplate) {\n const keyframe = unresolvedKeyframes[i];\n if (typeof keyframe === \"string\" &&\n !invalidTemplates.has(keyframe) &&\n analyseComplexValue(keyframe).values.length) {\n animatableTemplate = unresolvedKeyframes[i];\n }\n i++;\n }\n if (animatableTemplate && name) {\n for (const noneIndex of noneKeyframeIndexes) {\n unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate);\n }\n }\n}\n\nexport { makeNoneKeyframesAnimatable };\n","import { positionalKeys } from '../../render/utils/keys-position.mjs';\nimport { findDimensionValueType } from '../../value/types/dimensions.mjs';\nimport { getVariableValue } from '../utils/css-variables-conversion.mjs';\nimport { isCSSVariableToken, containsCSSVariable } from '../utils/is-css-variable.mjs';\nimport { KeyframeResolver } from './KeyframesResolver.mjs';\nimport { isNone } from './utils/is-none.mjs';\nimport { makeNoneKeyframesAnimatable } from './utils/make-none-animatable.mjs';\nimport { positionalValues, isNumOrPxType } from './utils/unit-conversion.mjs';\n\nclass DOMKeyframesResolver extends KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element) {\n super(unresolvedKeyframes, onComplete, name, motionValue, element, true);\n }\n readKeyframes() {\n const { unresolvedKeyframes, element, name } = this;\n if (!element || !element.current)\n return;\n super.readKeyframes();\n /**\n * If any keyframe is a CSS variable, we need to find its value by sampling the element\n */\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n let keyframe = unresolvedKeyframes[i];\n if (typeof keyframe === \"string\") {\n keyframe = keyframe.trim();\n if (isCSSVariableToken(keyframe)) {\n const resolved = getVariableValue(keyframe, element.current);\n if (resolved !== undefined) {\n unresolvedKeyframes[i] = resolved;\n }\n if (i === unresolvedKeyframes.length - 1) {\n this.finalKeyframe = keyframe;\n }\n }\n }\n }\n /**\n * Resolve \"none\" values. We do this potentially twice - once before and once after measuring keyframes.\n * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which\n * have a far bigger performance impact.\n */\n this.resolveNoneKeyframes();\n /**\n * Check to see if unit type has changed. If so schedule jobs that will\n * temporarily set styles to the destination keyframes.\n * Skip if we have more than two keyframes or this isn't a positional value.\n * TODO: We can throw if there are multiple keyframes and the value type changes.\n */\n if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) {\n return;\n }\n const [origin, target] = unresolvedKeyframes;\n const originType = findDimensionValueType(origin);\n const targetType = findDimensionValueType(target);\n /**\n * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other\n * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410.\n */\n const originHasVar = containsCSSVariable(origin);\n const targetHasVar = containsCSSVariable(target);\n if (originHasVar !== targetHasVar && positionalValues[name]) {\n this.needsMeasurement = true;\n return;\n }\n /**\n * Either we don't recognise these value types or we can animate between them.\n */\n if (originType === targetType)\n return;\n /**\n * If both values are numbers or pixels, we can animate between them by\n * converting them to numbers.\n */\n if (isNumOrPxType(originType) && isNumOrPxType(targetType)) {\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n const value = unresolvedKeyframes[i];\n if (typeof value === \"string\") {\n unresolvedKeyframes[i] = parseFloat(value);\n }\n }\n }\n else if (positionalValues[name]) {\n /**\n * Else, the only way to resolve this is by measuring the element.\n */\n this.needsMeasurement = true;\n }\n }\n resolveNoneKeyframes() {\n const { unresolvedKeyframes, name } = this;\n const noneKeyframeIndexes = [];\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (unresolvedKeyframes[i] === null ||\n isNone(unresolvedKeyframes[i])) {\n noneKeyframeIndexes.push(i);\n }\n }\n if (noneKeyframeIndexes.length) {\n makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name);\n }\n }\n measureInitialState() {\n const { element, unresolvedKeyframes, name } = this;\n if (!element || !element.current)\n return;\n if (name === \"height\") {\n this.suspendedScrollY = window.pageYOffset;\n }\n this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));\n unresolvedKeyframes[0] = this.measuredOrigin;\n // Set final key frame to measure after next render\n const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (measureKeyframe !== undefined) {\n element.getValue(name, measureKeyframe).jump(measureKeyframe, false);\n }\n }\n measureEndState() {\n const { element, name, unresolvedKeyframes } = this;\n if (!element || !element.current)\n return;\n const value = element.getValue(name);\n value && value.jump(this.measuredOrigin, false);\n const finalKeyframeIndex = unresolvedKeyframes.length - 1;\n const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex];\n unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));\n if (finalKeyframe !== null && this.finalKeyframe === undefined) {\n this.finalKeyframe = finalKeyframe;\n }\n // If we removed transform values, reapply them before the next render\n if (this.removedTransforms?.length) {\n this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => {\n element\n .getValue(unsetTransformName)\n .set(unsetTransformValue);\n });\n }\n this.resolveNoneKeyframes();\n }\n}\n\nexport { DOMKeyframesResolver };\n","function resolveElements(elementOrSelector, scope, selectorCache) {\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector];\n }\n else if (typeof elementOrSelector === \"string\") {\n let root = document;\n if (scope) {\n root = scope.current;\n }\n const elements = selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector);\n return elements ? Array.from(elements) : [];\n }\n return Array.from(elementOrSelector);\n}\n\nexport { resolveElements };\n","/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nconst getValueAsType = (value, type) => {\n return type && typeof value === \"number\"\n ? type.transform(value)\n : value;\n};\n\nexport { getValueAsType };\n","import { isObject } from 'motion-utils';\n\n/**\n * Checks if an element is an HTML element in a way\n * that works across iframes\n */\nfunction isHTMLElement(element) {\n return isObject(element) && \"offsetHeight\" in element;\n}\n\nexport { isHTMLElement };\n","import { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: microtask, cancel: cancelMicrotask } = \n/* @__PURE__ */ createRenderBatcher(queueMicrotask, false);\n\nexport { cancelMicrotask, microtask };\n","const isDragging = {\n x: false,\n y: false,\n};\nfunction isDragActive() {\n return isDragging.x || isDragging.y;\n}\n\nexport { isDragActive, isDragging };\n","import { isDragging } from './is-active.mjs';\n\nfunction setDragLock(axis) {\n if (axis === \"x\" || axis === \"y\") {\n if (isDragging[axis]) {\n return null;\n }\n else {\n isDragging[axis] = true;\n return () => {\n isDragging[axis] = false;\n };\n }\n }\n else {\n if (isDragging.x || isDragging.y) {\n return null;\n }\n else {\n isDragging.x = isDragging.y = true;\n return () => {\n isDragging.x = isDragging.y = false;\n };\n }\n }\n}\n\nexport { setDragLock };\n","import { resolveElements } from '../../utils/resolve-elements.mjs';\n\nfunction setupGesture(elementOrSelector, options) {\n const elements = resolveElements(elementOrSelector);\n const gestureAbortController = new AbortController();\n const eventOptions = {\n passive: true,\n ...options,\n signal: gestureAbortController.signal,\n };\n const cancel = () => gestureAbortController.abort();\n return [elements, eventOptions, cancel];\n}\n\nexport { setupGesture };\n","import { isDragActive } from './drag/state/is-active.mjs';\nimport { setupGesture } from './utils/setup.mjs';\n\nfunction isValidHover(event) {\n return !(event.pointerType === \"touch\" || isDragActive());\n}\n/**\n * Create a hover gesture. hover() is different to .addEventListener(\"pointerenter\")\n * in that it has an easier syntax, filters out polyfilled touch events, interoperates\n * with drag gestures, and automatically removes the \"pointerennd\" event listener when the hover ends.\n *\n * @public\n */\nfunction hover(elementOrSelector, onHoverStart, options = {}) {\n const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options);\n const onPointerEnter = (enterEvent) => {\n if (!isValidHover(enterEvent))\n return;\n const { target } = enterEvent;\n const onHoverEnd = onHoverStart(target, enterEvent);\n if (typeof onHoverEnd !== \"function\" || !target)\n return;\n const onPointerLeave = (leaveEvent) => {\n if (!isValidHover(leaveEvent))\n return;\n onHoverEnd(leaveEvent);\n target.removeEventListener(\"pointerleave\", onPointerLeave);\n };\n target.addEventListener(\"pointerleave\", onPointerLeave, eventOptions);\n };\n elements.forEach((element) => {\n element.addEventListener(\"pointerenter\", onPointerEnter, eventOptions);\n });\n return cancel;\n}\n\nexport { hover };\n","/**\n * Recursively traverse up the tree to check whether the provided child node\n * is the parent or a descendant of it.\n *\n * @param parent - Element to find\n * @param child - Element to test against parent\n */\nconst isNodeOrChild = (parent, child) => {\n if (!child) {\n return false;\n }\n else if (parent === child) {\n return true;\n }\n else {\n return isNodeOrChild(parent, child.parentElement);\n }\n};\n\nexport { isNodeOrChild };\n","const isPrimaryPointer = (event) => {\n if (event.pointerType === \"mouse\") {\n return typeof event.button !== \"number\" || event.button <= 0;\n }\n else {\n /**\n * isPrimary is true for all mice buttons, whereas every touch point\n * is regarded as its own input. So subsequent concurrent touch points\n * will be false.\n *\n * Specifically match against false here as incomplete versions of\n * PointerEvents in very old browser might have it set as undefined.\n */\n return event.isPrimary !== false;\n }\n};\n\nexport { isPrimaryPointer };\n","const interactiveElements = new Set([\n \"BUTTON\",\n \"INPUT\",\n \"SELECT\",\n \"TEXTAREA\",\n \"A\",\n]);\n/**\n * Checks if an element is an interactive form element that should prevent\n * drag gestures from starting when clicked.\n *\n * This specifically targets form controls, buttons, and links - not just any\n * element with tabIndex, since motion elements with tap handlers automatically\n * get tabIndex=0 for keyboard accessibility.\n */\nfunction isElementKeyboardAccessible(element) {\n return (interactiveElements.has(element.tagName) ||\n element.isContentEditable === true);\n}\n\nexport { isElementKeyboardAccessible };\n","const isPressing = new WeakSet();\n\nexport { isPressing };\n","import { isPressing } from './state.mjs';\n\n/**\n * Filter out events that are not \"Enter\" keys.\n */\nfunction filterEvents(callback) {\n return (event) => {\n if (event.key !== \"Enter\")\n return;\n callback(event);\n };\n}\nfunction firePointerEvent(target, type) {\n target.dispatchEvent(new PointerEvent(\"pointer\" + type, { isPrimary: true, bubbles: true }));\n}\nconst enableKeyboardPress = (focusEvent, eventOptions) => {\n const element = focusEvent.currentTarget;\n if (!element)\n return;\n const handleKeydown = filterEvents(() => {\n if (isPressing.has(element))\n return;\n firePointerEvent(element, \"down\");\n const handleKeyup = filterEvents(() => {\n firePointerEvent(element, \"up\");\n });\n const handleBlur = () => firePointerEvent(element, \"cancel\");\n element.addEventListener(\"keyup\", handleKeyup, eventOptions);\n element.addEventListener(\"blur\", handleBlur, eventOptions);\n });\n element.addEventListener(\"keydown\", handleKeydown, eventOptions);\n /**\n * Add an event listener that fires on blur to remove the keydown events.\n */\n element.addEventListener(\"blur\", () => element.removeEventListener(\"keydown\", handleKeydown), eventOptions);\n};\n\nexport { enableKeyboardPress };\n","import { isHTMLElement } from '../../utils/is-html-element.mjs';\nimport { isDragActive } from '../drag/state/is-active.mjs';\nimport { isNodeOrChild } from '../utils/is-node-or-child.mjs';\nimport { isPrimaryPointer } from '../utils/is-primary-pointer.mjs';\nimport { setupGesture } from '../utils/setup.mjs';\nimport { isElementKeyboardAccessible } from './utils/is-keyboard-accessible.mjs';\nimport { enableKeyboardPress } from './utils/keyboard.mjs';\nimport { isPressing } from './utils/state.mjs';\n\n/**\n * Filter out events that are not primary pointer events, or are triggering\n * while a Motion gesture is active.\n */\nfunction isValidPressEvent(event) {\n return isPrimaryPointer(event) && !isDragActive();\n}\n/**\n * Create a press gesture.\n *\n * Press is different to `\"pointerdown\"`, `\"pointerup\"` in that it\n * automatically filters out secondary pointer events like right\n * click and multitouch.\n *\n * It also adds accessibility support for keyboards, where\n * an element with a press gesture will receive focus and\n * trigger on Enter `\"keydown\"` and `\"keyup\"` events.\n *\n * This is different to a browser's `\"click\"` event, which does\n * respond to keyboards but only for the `\"click\"` itself, rather\n * than the press start and end/cancel. The element also needs\n * to be focusable for this to work, whereas a press gesture will\n * make an element focusable by default.\n *\n * @public\n */\nfunction press(targetOrSelector, onPressStart, options = {}) {\n const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options);\n const startPress = (startEvent) => {\n const target = startEvent.currentTarget;\n if (!isValidPressEvent(startEvent))\n return;\n isPressing.add(target);\n const onPressEnd = onPressStart(target, startEvent);\n const onPointerEnd = (endEvent, success) => {\n window.removeEventListener(\"pointerup\", onPointerUp);\n window.removeEventListener(\"pointercancel\", onPointerCancel);\n if (isPressing.has(target)) {\n isPressing.delete(target);\n }\n if (!isValidPressEvent(endEvent)) {\n return;\n }\n if (typeof onPressEnd === \"function\") {\n onPressEnd(endEvent, { success });\n }\n };\n const onPointerUp = (upEvent) => {\n onPointerEnd(upEvent, target === window ||\n target === document ||\n options.useGlobalTarget ||\n isNodeOrChild(target, upEvent.target));\n };\n const onPointerCancel = (cancelEvent) => {\n onPointerEnd(cancelEvent, false);\n };\n window.addEventListener(\"pointerup\", onPointerUp, eventOptions);\n window.addEventListener(\"pointercancel\", onPointerCancel, eventOptions);\n };\n targets.forEach((target) => {\n const pointerDownTarget = options.useGlobalTarget ? window : target;\n pointerDownTarget.addEventListener(\"pointerdown\", startPress, eventOptions);\n if (isHTMLElement(target)) {\n target.addEventListener(\"focus\", (event) => enableKeyboardPress(event, eventOptions));\n if (!isElementKeyboardAccessible(target) &&\n !target.hasAttribute(\"tabindex\")) {\n target.tabIndex = 0;\n }\n }\n });\n return cancelEvents;\n}\n\nexport { press };\n","import { isObject } from 'motion-utils';\n\n/**\n * Checks if an element is an SVG element in a way\n * that works across iframes\n */\nfunction isSVGElement(element) {\n return isObject(element) && \"ownerSVGElement\" in element;\n}\n\nexport { isSVGElement };\n","import { isSVGElement } from './is-svg-element.mjs';\n\n/**\n * Checks if an element is specifically an SVGSVGElement (the root SVG element)\n * in a way that works across iframes\n */\nfunction isSVGSVGElement(element) {\n return isSVGElement(element) && element.tagName === \"svg\";\n}\n\nexport { isSVGSVGElement };\n","import { color } from '../color/index.mjs';\nimport { complex } from '../complex/index.mjs';\nimport { dimensionValueTypes } from '../dimensions.mjs';\nimport { testValueType } from '../test.mjs';\n\n/**\n * A list of all ValueTypes\n */\nconst valueTypes = [...dimensionValueTypes, color, complex];\n/**\n * Tests a value against the list of ValueTypes\n */\nconst findValueType = (v) => valueTypes.find(testValueType(v));\n\nexport { findValueType };\n","const createAxisDelta = () => ({\n translate: 0,\n scale: 1,\n origin: 0,\n originPoint: 0,\n});\nconst createDelta = () => ({\n x: createAxisDelta(),\n y: createAxisDelta(),\n});\nconst createAxis = () => ({ min: 0, max: 0 });\nconst createBox = () => ({\n x: createAxis(),\n y: createAxis(),\n});\n\nexport { createAxis, createAxisDelta, createBox, createDelta };\n","// Does this device prefer reduced motion? Returns `null` server-side.\nconst prefersReducedMotion = { current: null };\nconst hasReducedMotionListener = { current: false };\n\nexport { hasReducedMotionListener, prefersReducedMotion };\n","import { hasReducedMotionListener, prefersReducedMotion } from './state.mjs';\n\nconst isBrowser = typeof window !== \"undefined\";\nfunction initPrefersReducedMotion() {\n hasReducedMotionListener.current = true;\n if (!isBrowser)\n return;\n if (window.matchMedia) {\n const motionMediaQuery = window.matchMedia(\"(prefers-reduced-motion)\");\n const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches);\n motionMediaQuery.addEventListener(\"change\", setReducedMotionPreferences);\n setReducedMotionPreferences();\n }\n else {\n prefersReducedMotion.current = false;\n }\n}\n\nexport { hasReducedMotionListener, initPrefersReducedMotion, prefersReducedMotion };\n","const visualElementStore = new WeakMap();\n\nexport { visualElementStore };\n","function isAnimationControls(v) {\n return (v !== null &&\n typeof v === \"object\" &&\n typeof v.start === \"function\");\n}\n\nexport { isAnimationControls };\n","/**\n * Decides if the supplied variable is variant label\n */\nfunction isVariantLabel(v) {\n return typeof v === \"string\" || Array.isArray(v);\n}\n\nexport { isVariantLabel };\n","const variantPriorityOrder = [\n \"animate\",\n \"whileInView\",\n \"whileFocus\",\n \"whileHover\",\n \"whileTap\",\n \"whileDrag\",\n \"exit\",\n];\nconst variantProps = [\"initial\", ...variantPriorityOrder];\n\nexport { variantPriorityOrder, variantProps };\n","import { isAnimationControls } from './is-animation-controls.mjs';\nimport { isVariantLabel } from './is-variant-label.mjs';\nimport { variantProps } from './variant-props.mjs';\n\nfunction isControllingVariants(props) {\n return (isAnimationControls(props.animate) ||\n variantProps.some((name) => isVariantLabel(props[name])));\n}\nfunction isVariantNode(props) {\n return Boolean(isControllingVariants(props) || props.variants);\n}\n\nexport { isControllingVariants, isVariantNode };\n","import { motionValue } from '../../value/index.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\n\n/**\n * Updates motion values from props changes.\n * Uses `any` type for element to avoid circular dependencies with VisualElement.\n */\nfunction updateMotionValuesFromProps(element, next, prev) {\n for (const key in next) {\n const nextValue = next[key];\n const prevValue = prev[key];\n if (isMotionValue(nextValue)) {\n /**\n * If this is a motion value found in props or style, we want to add it\n * to our visual element's motion value map.\n */\n element.addValue(key, nextValue);\n }\n else if (isMotionValue(prevValue)) {\n /**\n * If we're swapping from a motion value to a static value,\n * create a new motion value from that\n */\n element.addValue(key, motionValue(nextValue, { owner: element }));\n }\n else if (prevValue !== nextValue) {\n /**\n * If this is a flat value that has changed, update the motion value\n * or create one if it doesn't exist. We only want to do this if we're\n * not handling the value with our animation state.\n */\n if (element.hasValue(key)) {\n const existingValue = element.getValue(key);\n if (existingValue.liveStyle === true) {\n existingValue.jump(nextValue);\n }\n else if (!existingValue.hasAnimated) {\n existingValue.set(nextValue);\n }\n }\n else {\n const latestValue = element.getStaticValue(key);\n element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element }));\n }\n }\n }\n // Handle removed values\n for (const key in prev) {\n if (next[key] === undefined)\n element.removeValue(key);\n }\n return next;\n}\n\nexport { updateMotionValuesFromProps };\n","import { warnOnce, isNumericalString, isZeroValueString, SubscriptionManager } from 'motion-utils';\nimport { microtask } from '../frameloop/microtask.mjs';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { motionValue } from '../value/index.mjs';\nimport { isMotionValue } from '../value/utils/is-motion-value.mjs';\nimport { KeyframeResolver } from '../animation/keyframes/KeyframesResolver.mjs';\nimport { transformProps } from './utils/keys-transform.mjs';\nimport { complex } from '../value/types/complex/index.mjs';\nimport { findValueType } from '../value/types/utils/find.mjs';\nimport { getAnimatableNone } from '../value/types/utils/animatable-none.mjs';\nimport { createBox } from '../projection/geometry/models.mjs';\nimport { initPrefersReducedMotion } from './utils/reduced-motion/index.mjs';\nimport { visualElementStore } from './store.mjs';\nimport { isControllingVariants, isVariantNode } from './utils/is-controlling-variants.mjs';\nimport { updateMotionValuesFromProps } from './utils/motion-values.mjs';\nimport { resolveVariantFromProps } from './utils/resolve-variants.mjs';\nimport { hasReducedMotionListener, prefersReducedMotion } from './utils/reduced-motion/state.mjs';\nimport { frame, cancelFrame } from '../frameloop/frame.mjs';\n\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n];\n/**\n * Static feature definitions - can be injected by framework layer\n */\nlet featureDefinitions = {};\n/**\n * Set feature definitions for all VisualElements.\n * This should be called by the framework layer (e.g., framer-motion) during initialization.\n */\nfunction setFeatureDefinitions(definitions) {\n featureDefinitions = definitions;\n}\n/**\n * Get the current feature definitions\n */\nfunction getFeatureDefinitions() {\n return featureDefinitions;\n}\n/**\n * A VisualElement is an imperative abstraction around UI elements such as\n * HTMLElement, SVGElement, Three.Object3D etc.\n */\nclass VisualElement {\n /**\n * This method takes React props and returns found MotionValues. For example, HTML\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\n *\n * This isn't an abstract method as it needs calling in the constructor, but it is\n * intended to be one.\n */\n scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) {\n return {};\n }\n constructor({ parent, props, presenceContext, reducedMotionConfig, blockInitialAnimation, visualState, }, options = {}) {\n /**\n * A reference to the current underlying Instance, e.g. a HTMLElement\n * or Three.Mesh etc.\n */\n this.current = null;\n /**\n * A set containing references to this VisualElement's children.\n */\n this.children = new Set();\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n this.isVariantNode = false;\n this.isControllingVariants = false;\n /**\n * Decides whether this VisualElement should animate in reduced motion\n * mode.\n *\n * TODO: This is currently set on every individual VisualElement but feels\n * like it could be set globally.\n */\n this.shouldReduceMotion = null;\n /**\n * A map of all motion values attached to this visual element. Motion\n * values are source of truth for any given animated value. A motion\n * value might be provided externally by the component via props.\n */\n this.values = new Map();\n this.KeyframeResolver = KeyframeResolver;\n /**\n * Cleanup functions for active features (hover/tap/exit etc)\n */\n this.features = {};\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n this.valueSubscriptions = new Map();\n /**\n * A reference to the previously-provided motion values as returned\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\n * if any motion values need to be removed after props are updated.\n */\n this.prevMotionValues = {};\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n /**\n * An object containing an unsubscribe function for each prop event subscription.\n * For example, every \"Update\" event can have multiple subscribers via\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\n */\n this.propEventSubscriptions = {};\n this.notifyUpdate = () => this.notify(\"Update\", this.latestValues);\n this.render = () => {\n if (!this.current)\n return;\n this.triggerBuild();\n this.renderInstance(this.current, this.renderState, this.props.style, this.projection);\n };\n this.renderScheduledAt = 0.0;\n this.scheduleRender = () => {\n const now = time.now();\n if (this.renderScheduledAt < now) {\n this.renderScheduledAt = now;\n frame.render(this.render, false, true);\n }\n };\n const { latestValues, renderState } = visualState;\n this.latestValues = latestValues;\n this.baseTarget = { ...latestValues };\n this.initialValues = props.initial ? { ...latestValues } : {};\n this.renderState = renderState;\n this.parent = parent;\n this.props = props;\n this.presenceContext = presenceContext;\n this.depth = parent ? parent.depth + 1 : 0;\n this.reducedMotionConfig = reducedMotionConfig;\n this.options = options;\n this.blockInitialAnimation = Boolean(blockInitialAnimation);\n this.isControllingVariants = isControllingVariants(props);\n this.isVariantNode = isVariantNode(props);\n if (this.isVariantNode) {\n this.variantChildren = new Set();\n }\n this.manuallyAnimateOnMount = Boolean(parent && parent.current);\n /**\n * Any motion values that are provided to the element when created\n * aren't yet bound to the element, as this would technically be impure.\n * However, we iterate through the motion values and set them to the\n * initial values for this component.\n *\n * TODO: This is impure and we should look at changing this to run on mount.\n * Doing so will break some tests but this isn't necessarily a breaking change,\n * more a reflection of the test.\n */\n const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this);\n for (const key in initialMotionValues) {\n const value = initialMotionValues[key];\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key]);\n }\n }\n }\n mount(instance) {\n this.current = instance;\n visualElementStore.set(instance, this);\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance);\n }\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\n this.removeFromVariantTree = this.parent.addVariantChild(this);\n }\n this.values.forEach((value, key) => this.bindToMotionValue(key, value));\n /**\n * Determine reduced motion preference. Only initialize the matchMedia\n * listener if we actually need the dynamic value (i.e., when config\n * is neither \"never\" nor \"always\").\n */\n if (this.reducedMotionConfig === \"never\") {\n this.shouldReduceMotion = false;\n }\n else if (this.reducedMotionConfig === \"always\") {\n this.shouldReduceMotion = true;\n }\n else {\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion();\n }\n this.shouldReduceMotion = prefersReducedMotion.current;\n }\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(this.shouldReduceMotion !== true, \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\", \"reduced-motion-disabled\");\n }\n this.parent?.addChild(this);\n this.update(this.props, this.presenceContext);\n }\n unmount() {\n this.projection && this.projection.unmount();\n cancelFrame(this.notifyUpdate);\n cancelFrame(this.render);\n this.valueSubscriptions.forEach((remove) => remove());\n this.valueSubscriptions.clear();\n this.removeFromVariantTree && this.removeFromVariantTree();\n this.parent?.removeChild(this);\n for (const key in this.events) {\n this.events[key].clear();\n }\n for (const key in this.features) {\n const feature = this.features[key];\n if (feature) {\n feature.unmount();\n feature.isMounted = false;\n }\n }\n this.current = null;\n }\n addChild(child) {\n this.children.add(child);\n this.enteringChildren ?? (this.enteringChildren = new Set());\n this.enteringChildren.add(child);\n }\n removeChild(child) {\n this.children.delete(child);\n this.enteringChildren && this.enteringChildren.delete(child);\n }\n bindToMotionValue(key, value) {\n if (this.valueSubscriptions.has(key)) {\n this.valueSubscriptions.get(key)();\n }\n const valueIsTransform = transformProps.has(key);\n if (valueIsTransform && this.onBindTransform) {\n this.onBindTransform();\n }\n const removeOnChange = value.on(\"change\", (latestValue) => {\n this.latestValues[key] = latestValue;\n this.props.onUpdate && frame.preRender(this.notifyUpdate);\n if (valueIsTransform && this.projection) {\n this.projection.isTransformDirty = true;\n }\n this.scheduleRender();\n });\n let removeSyncCheck;\n if (typeof window !== \"undefined\" && window.MotionCheckAppearSync) {\n removeSyncCheck = window.MotionCheckAppearSync(this, key, value);\n }\n this.valueSubscriptions.set(key, () => {\n removeOnChange();\n if (removeSyncCheck)\n removeSyncCheck();\n if (value.owner)\n value.stop();\n });\n }\n sortNodePosition(other) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (!this.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type) {\n return 0;\n }\n return this.sortInstanceNodePosition(this.current, other.current);\n }\n updateFeatures() {\n let key = \"animation\";\n for (key in featureDefinitions) {\n const featureDefinition = featureDefinitions[key];\n if (!featureDefinition)\n continue;\n const { isEnabled, Feature: FeatureConstructor } = featureDefinition;\n /**\n * If this feature is enabled but not active, make a new instance.\n */\n if (!this.features[key] &&\n FeatureConstructor &&\n isEnabled(this.props)) {\n this.features[key] = new FeatureConstructor(this);\n }\n /**\n * If we have a feature, mount or update it.\n */\n if (this.features[key]) {\n const feature = this.features[key];\n if (feature.isMounted) {\n feature.update();\n }\n else {\n feature.mount();\n feature.isMounted = true;\n }\n }\n }\n }\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.props);\n }\n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox() {\n return this.current\n ? this.measureInstanceViewportBox(this.current, this.props)\n : createBox();\n }\n getStaticValue(key) {\n return this.latestValues[key];\n }\n setStaticValue(key, value) {\n this.latestValues[key] = value;\n }\n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n update(props, presenceContext) {\n if (props.transformTemplate || this.props.transformTemplate) {\n this.scheduleRender();\n }\n this.prevProps = this.props;\n this.props = props;\n this.prevPresenceContext = this.presenceContext;\n this.presenceContext = presenceContext;\n /**\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\n */\n for (let i = 0; i < propEventHandlers.length; i++) {\n const key = propEventHandlers[i];\n if (this.propEventSubscriptions[key]) {\n this.propEventSubscriptions[key]();\n delete this.propEventSubscriptions[key];\n }\n const listenerName = (\"on\" + key);\n const listener = props[listenerName];\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key, listener);\n }\n }\n this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this), this.prevMotionValues);\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue();\n }\n }\n getProps() {\n return this.props;\n }\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name) {\n return this.props.variants ? this.props.variants[name] : undefined;\n }\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition;\n }\n getTransformPagePoint() {\n return this.props.transformPagePoint;\n }\n getClosestVariantNode() {\n return this.isVariantNode\n ? this\n : this.parent\n ? this.parent.getClosestVariantNode()\n : undefined;\n }\n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild(child) {\n const closestVariantNode = this.getClosestVariantNode();\n if (closestVariantNode) {\n closestVariantNode.variantChildren &&\n closestVariantNode.variantChildren.add(child);\n return () => closestVariantNode.variantChildren.delete(child);\n }\n }\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key, value) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key);\n if (value !== existingValue) {\n if (existingValue)\n this.removeValue(key);\n this.bindToMotionValue(key, value);\n this.values.set(key, value);\n this.latestValues[key] = value.get();\n }\n }\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key) {\n this.values.delete(key);\n const unsubscribe = this.valueSubscriptions.get(key);\n if (unsubscribe) {\n unsubscribe();\n this.valueSubscriptions.delete(key);\n }\n delete this.latestValues[key];\n this.removeValueFromRenderState(key, this.renderState);\n }\n /**\n * Check whether we have a motion value for this key\n */\n hasValue(key) {\n return this.values.has(key);\n }\n getValue(key, defaultValue) {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key];\n }\n let value = this.values.get(key);\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this });\n this.addValue(key, value);\n }\n return value;\n }\n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue(key, target) {\n let value = this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : this.getBaseTargetFromProps(this.props, key) ??\n this.readValueFromInstance(this.current, key, this.options);\n if (value !== undefined && value !== null) {\n if (typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value);\n }\n else if (!findValueType(value) && complex.test(target)) {\n value = getAnimatableNone(key, target);\n }\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value);\n }\n return isMotionValue(value) ? value.get() : value;\n }\n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget(key, value) {\n this.baseTarget[key] = value;\n }\n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget(key) {\n const { initial } = this.props;\n let valueFromInitial;\n if (typeof initial === \"string\" || typeof initial === \"object\") {\n const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom);\n if (variant) {\n valueFromInitial = variant[key];\n }\n }\n /**\n * If this value still exists in the current initial variant, read that.\n */\n if (initial && valueFromInitial !== undefined) {\n return valueFromInitial;\n }\n /**\n * Alternatively, if this VisualElement config has defined a getBaseTarget\n * so we can read the value from an alternative source, try that.\n */\n const target = this.getBaseTargetFromProps(this.props, key);\n if (target !== undefined && !isMotionValue(target))\n return target;\n /**\n * If the value was initially defined on initial, but it doesn't any more,\n * return undefined. Otherwise return the value as initially read from the DOM.\n */\n return this.initialValues[key] !== undefined &&\n valueFromInitial === undefined\n ? undefined\n : this.baseTarget[key];\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n return this.events[eventName].add(callback);\n }\n notify(eventName, ...args) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args);\n }\n }\n scheduleRenderMicrotask() {\n microtask.render(this.render);\n }\n}\n\nexport { VisualElement, getFeatureDefinitions, setFeatureDefinitions };\n","/**\n * Feature base class for extending VisualElement functionality.\n * Features are plugins that can be mounted/unmounted to add behavior\n * like gestures, animations, or layout tracking.\n */\nclass Feature {\n constructor(node) {\n this.isMounted = false;\n this.node = node;\n }\n update() { }\n}\n\nexport { Feature };\n","import { isMotionValue } from '../../value/utils/is-motion-value.mjs';\nimport { DOMKeyframesResolver } from '../../animation/keyframes/DOMKeyframesResolver.mjs';\nimport { VisualElement } from '../VisualElement.mjs';\n\nclass DOMVisualElement extends VisualElement {\n constructor() {\n super(...arguments);\n this.KeyframeResolver = DOMKeyframesResolver;\n }\n sortInstanceNodePosition(a, b) {\n /**\n * compareDocumentPosition returns a bitmask, by using the bitwise &\n * we're returning true if 2 in that bitmask is set to true. 2 is set\n * to true if b preceeds a.\n */\n return a.compareDocumentPosition(b) & 2 ? 1 : -1;\n }\n getBaseTargetFromProps(props, key) {\n const style = props.style;\n return style ? style[key] : undefined;\n }\n removeValueFromRenderState(key, { vars, style }) {\n delete vars[key];\n delete style[key];\n }\n handleChildMotionValue() {\n if (this.childSubscription) {\n this.childSubscription();\n delete this.childSubscription;\n }\n const { children } = this.props;\n if (isMotionValue(children)) {\n this.childSubscription = children.on(\"change\", (latest) => {\n if (this.current) {\n this.current.textContent = `${latest}`;\n }\n });\n }\n }\n}\n\nexport { DOMVisualElement };\n","/**\n * Bounding boxes tend to be defined as top, left, right, bottom. For various operations\n * it's easier to consider each axis individually. This function returns a bounding box\n * as a map of single-axis min/max values.\n */\nfunction convertBoundingBoxToBox({ top, left, right, bottom, }) {\n return {\n x: { min: left, max: right },\n y: { min: top, max: bottom },\n };\n}\nfunction convertBoxToBoundingBox({ x, y }) {\n return { top: y.min, right: x.max, bottom: y.max, left: x.min };\n}\n/**\n * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function\n * provided by Framer to allow measured points to be corrected for device scaling. This is used\n * when measuring DOM elements and DOM event points.\n */\nfunction transformBoxPoints(point, transformPoint) {\n if (!transformPoint)\n return point;\n const topLeft = transformPoint({ x: point.left, y: point.top });\n const bottomRight = transformPoint({ x: point.right, y: point.bottom });\n return {\n top: topLeft.y,\n left: topLeft.x,\n bottom: bottomRight.y,\n right: bottomRight.x,\n };\n}\n\nexport { convertBoundingBoxToBox, convertBoxToBoundingBox, transformBoxPoints };\n","function isIdentityScale(scale) {\n return scale === undefined || scale === 1;\n}\nfunction hasScale({ scale, scaleX, scaleY }) {\n return (!isIdentityScale(scale) ||\n !isIdentityScale(scaleX) ||\n !isIdentityScale(scaleY));\n}\nfunction hasTransform(values) {\n return (hasScale(values) ||\n has2DTranslate(values) ||\n values.z ||\n values.rotate ||\n values.rotateX ||\n values.rotateY ||\n values.skewX ||\n values.skewY);\n}\nfunction has2DTranslate(values) {\n return is2DTranslate(values.x) || is2DTranslate(values.y);\n}\nfunction is2DTranslate(value) {\n return value && value !== \"0%\";\n}\n\nexport { has2DTranslate, hasScale, hasTransform };\n","import { mixNumber } from '../../utils/mix/number.mjs';\nimport { hasTransform } from '../utils/has-transform.mjs';\n\n/**\n * Scales a point based on a factor and an originPoint\n */\nfunction scalePoint(point, scale, originPoint) {\n const distanceFromOrigin = point - originPoint;\n const scaled = scale * distanceFromOrigin;\n return originPoint + scaled;\n}\n/**\n * Applies a translate/scale delta to a point\n */\nfunction applyPointDelta(point, translate, scale, originPoint, boxScale) {\n if (boxScale !== undefined) {\n point = scalePoint(point, boxScale, originPoint);\n }\n return scalePoint(point, scale, originPoint) + translate;\n}\n/**\n * Applies a translate/scale delta to an axis\n */\nfunction applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) {\n axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale);\n axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale);\n}\n/**\n * Applies a translate/scale delta to a box\n */\nfunction applyBoxDelta(box, { x, y }) {\n applyAxisDelta(box.x, x.translate, x.scale, x.originPoint);\n applyAxisDelta(box.y, y.translate, y.scale, y.originPoint);\n}\nconst TREE_SCALE_SNAP_MIN = 0.999999999999;\nconst TREE_SCALE_SNAP_MAX = 1.0000000000001;\n/**\n * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms\n * in a tree upon our box before then calculating how to project it into our desired viewport-relative box\n *\n * This is the final nested loop within updateLayoutDelta for future refactoring\n */\nfunction applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) {\n const treeLength = treePath.length;\n if (!treeLength)\n return;\n // Reset the treeScale\n treeScale.x = treeScale.y = 1;\n let node;\n let delta;\n for (let i = 0; i < treeLength; i++) {\n node = treePath[i];\n delta = node.projectionDelta;\n /**\n * TODO: Prefer to remove this, but currently we have motion components with\n * display: contents in Framer.\n */\n const { visualElement } = node.options;\n if (visualElement &&\n visualElement.props.style &&\n visualElement.props.style.display === \"contents\") {\n continue;\n }\n if (isSharedTransition &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root) {\n transformBox(box, {\n x: -node.scroll.offset.x,\n y: -node.scroll.offset.y,\n });\n }\n if (delta) {\n // Incoporate each ancestor's scale into a cumulative treeScale for this component\n treeScale.x *= delta.x.scale;\n treeScale.y *= delta.y.scale;\n // Apply each ancestor's calculated delta into this component's recorded layout box\n applyBoxDelta(box, delta);\n }\n if (isSharedTransition && hasTransform(node.latestValues)) {\n transformBox(box, node.latestValues);\n }\n }\n /**\n * Snap tree scale back to 1 if it's within a non-perceivable threshold.\n * This will help reduce useless scales getting rendered.\n */\n if (treeScale.x < TREE_SCALE_SNAP_MAX &&\n treeScale.x > TREE_SCALE_SNAP_MIN) {\n treeScale.x = 1.0;\n }\n if (treeScale.y < TREE_SCALE_SNAP_MAX &&\n treeScale.y > TREE_SCALE_SNAP_MIN) {\n treeScale.y = 1.0;\n }\n}\nfunction translateAxis(axis, distance) {\n axis.min = axis.min + distance;\n axis.max = axis.max + distance;\n}\n/**\n * Apply a transform to an axis from the latest resolved motion values.\n * This function basically acts as a bridge between a flat motion value map\n * and applyAxisDelta\n */\nfunction transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) {\n const originPoint = mixNumber(axis.min, axis.max, axisOrigin);\n // Apply the axis delta to the final axis\n applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale);\n}\n/**\n * Apply a transform to a box from the latest resolved motion values.\n */\nfunction transformBox(box, transform) {\n transformAxis(box.x, transform.x, transform.scaleX, transform.scale, transform.originX);\n transformAxis(box.y, transform.y, transform.scaleY, transform.scale, transform.originY);\n}\n\nexport { applyAxisDelta, applyBoxDelta, applyPointDelta, applyTreeDeltas, scalePoint, transformAxis, transformBox, translateAxis };\n","import { convertBoundingBoxToBox, transformBoxPoints } from '../geometry/conversion.mjs';\nimport { translateAxis } from '../geometry/delta-apply.mjs';\n\nfunction measureViewportBox(instance, transformPoint) {\n return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint));\n}\nfunction measurePageBox(element, rootProjectionNode, transformPagePoint) {\n const viewportBox = measureViewportBox(element, transformPagePoint);\n const { scroll } = rootProjectionNode;\n if (scroll) {\n translateAxis(viewportBox.x, scroll.offset.x);\n translateAxis(viewportBox.y, scroll.offset.y);\n }\n return viewportBox;\n}\n\nexport { measurePageBox, measureViewportBox };\n","import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs';\nimport { numberValueTypes } from '../../../value/types/maps/number.mjs';\nimport { transformPropOrder } from '../../utils/keys-transform.mjs';\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n};\nconst numTransforms = transformPropOrder.length;\n/**\n * Build a CSS transform style from individual x/y/scale etc properties.\n *\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\n * providing a transformTemplate function.\n */\nfunction buildTransform(latestValues, transform, transformTemplate) {\n // The transform string we're going to build into.\n let transformString = \"\";\n let transformIsDefault = true;\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < numTransforms; i++) {\n const key = transformPropOrder[i];\n const value = latestValues[key];\n if (value === undefined)\n continue;\n let valueIsDefault = true;\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0);\n }\n else {\n valueIsDefault = parseFloat(value) === 0;\n }\n if (!valueIsDefault || transformTemplate) {\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (!valueIsDefault) {\n transformIsDefault = false;\n const transformName = translateAlias[key] || key;\n transformString += `${transformName}(${valueAsType}) `;\n }\n if (transformTemplate) {\n transform[key] = valueAsType;\n }\n }\n }\n transformString = transformString.trim();\n // If we have a custom `transform` template, pass our transform values and\n // generated transformString to that before returning\n if (transformTemplate) {\n transformString = transformTemplate(transform, transformIsDefault ? \"\" : transformString);\n }\n else if (transformIsDefault) {\n transformString = \"none\";\n }\n return transformString;\n}\n\nexport { buildTransform };\n","import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs';\nimport { numberValueTypes } from '../../../value/types/maps/number.mjs';\nimport { transformProps } from '../../utils/keys-transform.mjs';\nimport { isCSSVariableName } from '../../../animation/utils/is-css-variable.mjs';\nimport { buildTransform } from './build-transform.mjs';\n\nfunction buildHTMLStyles(state, latestValues, transformTemplate) {\n const { style, vars, transformOrigin } = state;\n // Track whether we encounter any transform or transformOrigin values.\n let hasTransform = false;\n let hasTransformOrigin = false;\n /**\n * Loop over all our latest animated values and decide whether to handle them\n * as a style or CSS variable.\n *\n * Transforms and transform origins are kept separately for further processing.\n */\n for (const key in latestValues) {\n const value = latestValues[key];\n if (transformProps.has(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true;\n continue;\n }\n else if (isCSSVariableName(key)) {\n vars[key] = value;\n continue;\n }\n else {\n // Convert the value to its default value type, ie 0 -> \"0px\"\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (key.startsWith(\"origin\")) {\n // If this is a transform origin, flag and enable further transform-origin processing\n hasTransformOrigin = true;\n transformOrigin[key] =\n valueAsType;\n }\n else {\n style[key] = valueAsType;\n }\n }\n }\n if (!latestValues.transform) {\n if (hasTransform || transformTemplate) {\n style.transform = buildTransform(latestValues, state.transform, transformTemplate);\n }\n else if (style.transform) {\n /**\n * If we have previously created a transform but currently don't have any,\n * reset transform style to none.\n */\n style.transform = \"none\";\n }\n }\n /**\n * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\n if (hasTransformOrigin) {\n const { originX = \"50%\", originY = \"50%\", originZ = 0, } = transformOrigin;\n style.transformOrigin = `${originX} ${originY} ${originZ}`;\n }\n}\n\nexport { buildHTMLStyles };\n","function renderHTML(element, { style, vars }, styleProp, projection) {\n const elementStyle = element.style;\n let key;\n for (key in style) {\n // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type.\n elementStyle[key] = style[key];\n }\n // Write projection styles directly to element style\n projection?.applyProjectionStyles(elementStyle, styleProp);\n for (key in vars) {\n // Loop over any CSS variables and assign those.\n // They can only be assigned using `setProperty`.\n elementStyle.setProperty(key, vars[key]);\n }\n}\n\nexport { renderHTML };\n","import { px } from '../../value/types/numbers/units.mjs';\n\nfunction pixelsToPercent(pixels, axis) {\n if (axis.max === axis.min)\n return 0;\n return (pixels / (axis.max - axis.min)) * 100;\n}\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nconst correctBorderRadius = {\n correct: (latest, node) => {\n if (!node.target)\n return latest;\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest);\n }\n else {\n return latest;\n }\n }\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x);\n const y = pixelsToPercent(latest, node.target.y);\n return `${x}% ${y}%`;\n },\n};\n\nexport { correctBorderRadius, pixelsToPercent };\n","import { complex } from '../../value/types/complex/index.mjs';\nimport { mixNumber } from '../../utils/mix/number.mjs';\n\nconst correctBoxShadow = {\n correct: (latest, { treeScale, projectionDelta }) => {\n const original = latest;\n const shadow = complex.parse(latest);\n // TODO: Doesn't support multiple shadows\n if (shadow.length > 5)\n return original;\n const template = complex.createTransformer(latest);\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0;\n // Calculate the overall context scale\n const xScale = projectionDelta.x.scale * treeScale.x;\n const yScale = projectionDelta.y.scale * treeScale.y;\n shadow[0 + offset] /= xScale;\n shadow[1 + offset] /= yScale;\n /**\n * Ideally we'd correct x and y scales individually, but because blur and\n * spread apply to both we have to take a scale average and apply that instead.\n * We could potentially improve the outcome of this by incorporating the ratio between\n * the two scales.\n */\n const averageScale = mixNumber(xScale, yScale, 0.5);\n // Blur\n if (typeof shadow[2 + offset] === \"number\")\n shadow[2 + offset] /= averageScale;\n // Spread\n if (typeof shadow[3 + offset] === \"number\")\n shadow[3 + offset] /= averageScale;\n return template(shadow);\n },\n};\n\nexport { correctBoxShadow };\n","import { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs';\nimport { correctBorderRadius } from './scale-border-radius.mjs';\nimport { correctBoxShadow } from './scale-box-shadow.mjs';\n\nconst scaleCorrectors = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomLeftRadius\",\n \"borderBottomRightRadius\",\n ],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n};\nfunction addScaleCorrector(correctors) {\n for (const key in correctors) {\n scaleCorrectors[key] = correctors[key];\n if (isCSSVariableName(key)) {\n scaleCorrectors[key].isCSSVariable = true;\n }\n }\n}\n\nexport { addScaleCorrector, scaleCorrectors };\n","import { transformProps } from './keys-transform.mjs';\nimport { scaleCorrectors } from '../../projection/styles/scale-correction.mjs';\nexport { addScaleCorrector } from '../../projection/styles/scale-correction.mjs';\n\nfunction isForcedMotionValue(key, { layout, layoutId }) {\n return (transformProps.has(key) ||\n key.startsWith(\"origin\") ||\n ((layout || layoutId !== undefined) &&\n (!!scaleCorrectors[key] || key === \"opacity\")));\n}\n\nexport { isForcedMotionValue, scaleCorrectors };\n","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\nimport { isForcedMotionValue } from '../../utils/is-forced-motion-value.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const style = props.style;\n const prevStyle = prevProps?.style;\n const newValues = {};\n if (!style)\n return newValues;\n for (const key in style) {\n if (isMotionValue(style[key]) ||\n (prevStyle && isMotionValue(prevStyle[key])) ||\n isForcedMotionValue(key, props) ||\n visualElement?.getValue(key)?.liveStyle !== undefined) {\n newValues[key] = style[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n","import { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs';\nimport { transformProps } from '../utils/keys-transform.mjs';\nimport { defaultTransformValue, readTransformValue } from '../dom/parse-transform.mjs';\nimport { measureViewportBox } from '../../projection/utils/measure.mjs';\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\nimport { buildHTMLStyles } from './utils/build-styles.mjs';\nimport { renderHTML } from './utils/render.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\n\nfunction getComputedStyle(element) {\n return window.getComputedStyle(element);\n}\nclass HTMLVisualElement extends DOMVisualElement {\n constructor() {\n super(...arguments);\n this.type = \"html\";\n this.renderInstance = renderHTML;\n }\n readValueFromInstance(instance, key) {\n if (transformProps.has(key)) {\n return this.projection?.isProjecting\n ? defaultTransformValue(key)\n : readTransformValue(instance, key);\n }\n else {\n const computedStyle = getComputedStyle(instance);\n const value = (isCSSVariableName(key)\n ? computedStyle.getPropertyValue(key)\n : computedStyle[key]) || 0;\n return typeof value === \"string\" ? value.trim() : value;\n }\n }\n measureInstanceViewportBox(instance, { transformPagePoint }) {\n return measureViewportBox(instance, transformPagePoint);\n }\n build(renderState, latestValues, props) {\n buildHTMLStyles(renderState, latestValues, props.transformTemplate);\n }\n scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement);\n }\n}\n\nexport { HTMLVisualElement, getComputedStyle };\n","import { px } from '../../../value/types/numbers/units.mjs';\n\nconst dashKeys = {\n offset: \"stroke-dashoffset\",\n array: \"stroke-dasharray\",\n};\nconst camelKeys = {\n offset: \"strokeDashoffset\",\n array: \"strokeDasharray\",\n};\n/**\n * Build SVG path properties. Uses the path's measured length to convert\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\n * and stroke-dasharray attributes.\n *\n * This function is mutative to reduce per-frame GC.\n */\nfunction buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) {\n // Normalise path length by setting SVG attribute pathLength to 1\n attrs.pathLength = 1;\n // We use dash case when setting attributes directly to the DOM node and camel case\n // when defining props on a React component.\n const keys = useDashCase ? dashKeys : camelKeys;\n // Build the dash offset\n attrs[keys.offset] = px.transform(-offset);\n // Build the dash array\n const pathLength = px.transform(length);\n const pathSpacing = px.transform(spacing);\n attrs[keys.array] = `${pathLength} ${pathSpacing}`;\n}\n\nexport { buildSVGPath };\n","import { buildHTMLStyles } from '../../html/utils/build-styles.mjs';\nimport { buildSVGPath } from './path.mjs';\n\n/**\n * CSS Motion Path properties that should remain as CSS styles on SVG elements.\n */\nconst cssMotionPathProperties = [\n \"offsetDistance\",\n \"offsetPath\",\n \"offsetRotate\",\n \"offsetAnchor\",\n];\n/**\n * Build SVG visual attributes, like cx and style.transform\n */\nfunction buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, \n// This is object creation, which we try to avoid per-frame.\n...latest }, isSVGTag, transformTemplate, styleProp) {\n buildHTMLStyles(state, latest, transformTemplate);\n /**\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\n * as normal HTML tags.\n */\n if (isSVGTag) {\n if (state.style.viewBox) {\n state.attrs.viewBox = state.style.viewBox;\n }\n return;\n }\n state.attrs = state.style;\n state.style = {};\n const { attrs, style } = state;\n /**\n * However, we apply transforms as CSS transforms.\n * So if we detect a transform, transformOrigin we take it from attrs and copy it into style.\n */\n if (attrs.transform) {\n style.transform = attrs.transform;\n delete attrs.transform;\n }\n if (style.transform || attrs.transformOrigin) {\n style.transformOrigin = attrs.transformOrigin ?? \"50% 50%\";\n delete attrs.transformOrigin;\n }\n if (style.transform) {\n /**\n * SVG's element transform-origin uses its own median as a reference.\n * Therefore, transformBox becomes a fill-box\n */\n style.transformBox = styleProp?.transformBox ?? \"fill-box\";\n delete attrs.transformBox;\n }\n for (const key of cssMotionPathProperties) {\n if (attrs[key] !== undefined) {\n style[key] = attrs[key];\n delete attrs[key];\n }\n }\n // Render attrX/attrY/attrScale as attributes\n if (attrX !== undefined)\n attrs.x = attrX;\n if (attrY !== undefined)\n attrs.y = attrY;\n if (attrScale !== undefined)\n attrs.scale = attrScale;\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false);\n }\n}\n\nexport { buildSVGAttrs };\n","/**\n * A set of attribute names that are always read/written as camel case.\n */\nconst camelCaseAttributes = new Set([\n \"baseFrequency\",\n \"diffuseConstant\",\n \"kernelMatrix\",\n \"kernelUnitLength\",\n \"keySplines\",\n \"keyTimes\",\n \"limitingConeAngle\",\n \"markerHeight\",\n \"markerWidth\",\n \"numOctaves\",\n \"targetX\",\n \"targetY\",\n \"surfaceScale\",\n \"specularConstant\",\n \"specularExponent\",\n \"stdDeviation\",\n \"tableValues\",\n \"viewBox\",\n \"gradientTransform\",\n \"pathLength\",\n \"startOffset\",\n \"textLength\",\n \"lengthAdjust\",\n]);\n\nexport { camelCaseAttributes };\n","const isSVGTag = (tag) => typeof tag === \"string\" && tag.toLowerCase() === \"svg\";\n\nexport { isSVGTag };\n","import { camelToDash } from '../../dom/utils/camel-to-dash.mjs';\nimport { renderHTML } from '../../html/utils/render.mjs';\nimport { camelCaseAttributes } from './camel-case-attrs.mjs';\n\nfunction renderSVG(element, renderState, _styleProp, projection) {\n renderHTML(element, renderState, undefined, projection);\n for (const key in renderState.attrs) {\n element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]);\n }\n}\n\nexport { renderSVG };\n","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\nimport { transformPropOrder } from '../../utils/keys-transform.mjs';\nimport { scrapeMotionValuesFromProps as scrapeMotionValuesFromProps$1 } from '../../html/utils/scrape-motion-values.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement);\n for (const key in props) {\n if (isMotionValue(props[key]) ||\n isMotionValue(prevProps[key])) {\n const targetKey = transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key;\n newValues[targetKey] = props[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n","import { transformProps } from '../utils/keys-transform.mjs';\nimport { getDefaultValueType } from '../../value/types/maps/defaults.mjs';\nimport { createBox } from '../../projection/geometry/models.mjs';\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\nimport { camelToDash } from '../dom/utils/camel-to-dash.mjs';\nimport { buildSVGAttrs } from './utils/build-attrs.mjs';\nimport { camelCaseAttributes } from './utils/camel-case-attrs.mjs';\nimport { isSVGTag } from './utils/is-svg-tag.mjs';\nimport { renderSVG } from './utils/render.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\n\nclass SVGVisualElement extends DOMVisualElement {\n constructor() {\n super(...arguments);\n this.type = \"svg\";\n this.isSVGTag = false;\n this.measureInstanceViewportBox = createBox;\n }\n getBaseTargetFromProps(props, key) {\n return props[key];\n }\n readValueFromInstance(instance, key) {\n if (transformProps.has(key)) {\n const defaultType = getDefaultValueType(key);\n return defaultType ? defaultType.default || 0 : 0;\n }\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;\n return instance.getAttribute(key);\n }\n scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement);\n }\n build(renderState, latestValues, props) {\n buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style);\n }\n renderInstance(instance, renderState, styleProp, projection) {\n renderSVG(instance, renderState, styleProp, projection);\n }\n mount(instance) {\n this.isSVGTag = isSVGTag(instance.tagName);\n super.mount(instance);\n }\n}\n\nexport { SVGVisualElement };\n","import { isVariantLabel } from './is-variant-label.mjs';\nimport { variantProps } from './variant-props.mjs';\n\nconst numVariantProps = variantProps.length;\n/**\n * Get variant context from a visual element's parent chain.\n * Uses `any` type for visualElement to avoid circular dependencies.\n */\nfunction getVariantContext(visualElement) {\n if (!visualElement)\n return undefined;\n if (!visualElement.isControllingVariants) {\n const context = visualElement.parent\n ? getVariantContext(visualElement.parent) || {}\n : {};\n if (visualElement.props.initial !== undefined) {\n context.initial = visualElement.props.initial;\n }\n return context;\n }\n const context = {};\n for (let i = 0; i < numVariantProps; i++) {\n const name = variantProps[i];\n const prop = visualElement.props[name];\n if (isVariantLabel(prop) || prop === false) {\n context[name] = prop;\n }\n }\n return context;\n}\n\nexport { getVariantContext };\n","function shallowCompare(next, prev) {\n if (!Array.isArray(prev))\n return false;\n const prevLength = prev.length;\n if (prevLength !== next.length)\n return false;\n for (let i = 0; i < prevLength; i++) {\n if (prev[i] !== next[i])\n return false;\n }\n return true;\n}\n\nexport { shallowCompare };\n","import { animateVisualElement } from '../../animation/interfaces/visual-element.mjs';\nimport { calcChildStagger } from '../../animation/utils/calc-child-stagger.mjs';\nimport { getVariantContext } from './get-variant-context.mjs';\nimport { isAnimationControls } from './is-animation-controls.mjs';\nimport { isKeyframesTarget } from './is-keyframes-target.mjs';\nimport { isVariantLabel } from './is-variant-label.mjs';\nimport { resolveVariant } from './resolve-dynamic-variants.mjs';\nimport { shallowCompare } from './shallow-compare.mjs';\nimport { variantPriorityOrder } from './variant-props.mjs';\n\nconst reversePriorityOrder = [...variantPriorityOrder].reverse();\nconst numAnimationTypes = variantPriorityOrder.length;\nfunction createAnimateFunction(visualElement) {\n return (animations) => {\n return Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options)));\n };\n}\nfunction createAnimationState(visualElement) {\n let animate = createAnimateFunction(visualElement);\n let state = createState();\n let isInitialRender = true;\n /**\n * This function will be used to reduce the animation definitions for\n * each active animation type into an object of resolved values for it.\n */\n const buildResolvedTypeValues = (type) => (acc, definition) => {\n const resolved = resolveVariant(visualElement, definition, type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined);\n if (resolved) {\n const { transition, transitionEnd, ...target } = resolved;\n acc = { ...acc, ...target, ...transitionEnd };\n }\n return acc;\n };\n /**\n * This just allows us to inject mocked animation functions\n * @internal\n */\n function setAnimateFunction(makeAnimator) {\n animate = makeAnimator(visualElement);\n }\n /**\n * When we receive new props, we need to:\n * 1. Create a list of protected keys for each type. This is a directory of\n * value keys that are currently being \"handled\" by types of a higher priority\n * so that whenever an animation is played of a given type, these values are\n * protected from being animated.\n * 2. Determine if an animation type needs animating.\n * 3. Determine if any values have been removed from a type and figure out\n * what to animate those to.\n */\n function animateChanges(changedActiveType) {\n const { props } = visualElement;\n const context = getVariantContext(visualElement.parent) || {};\n /**\n * A list of animations that we'll build into as we iterate through the animation\n * types. This will get executed at the end of the function.\n */\n const animations = [];\n /**\n * Keep track of which values have been removed. Then, as we hit lower priority\n * animation types, we can check if they contain removed values and animate to that.\n */\n const removedKeys = new Set();\n /**\n * A dictionary of all encountered keys. This is an object to let us build into and\n * copy it without iteration. Each time we hit an animation type we set its protected\n * keys - the keys its not allowed to animate - to the latest version of this object.\n */\n let encounteredKeys = {};\n /**\n * If a variant has been removed at a given index, and this component is controlling\n * variant animations, we want to ensure lower-priority variants are forced to animate.\n */\n let removedVariantIndex = Infinity;\n /**\n * Iterate through all animation types in reverse priority order. For each, we want to\n * detect which values it's handling and whether or not they've changed (and therefore\n * need to be animated). If any values have been removed, we want to detect those in\n * lower priority props and flag for animation.\n */\n for (let i = 0; i < numAnimationTypes; i++) {\n const type = reversePriorityOrder[i];\n const typeState = state[type];\n const prop = props[type] !== undefined\n ? props[type]\n : context[type];\n const propIsVariant = isVariantLabel(prop);\n /**\n * If this type has *just* changed isActive status, set activeDelta\n * to that status. Otherwise set to null.\n */\n const activeDelta = type === changedActiveType ? typeState.isActive : null;\n if (activeDelta === false)\n removedVariantIndex = i;\n /**\n * If this prop is an inherited variant, rather than been set directly on the\n * component itself, we want to make sure we allow the parent to trigger animations.\n *\n * TODO: Can probably change this to a !isControllingVariants check\n */\n let isInherited = prop === context[type] &&\n prop !== props[type] &&\n propIsVariant;\n if (isInherited &&\n isInitialRender &&\n visualElement.manuallyAnimateOnMount) {\n isInherited = false;\n }\n /**\n * Set all encountered keys so far as the protected keys for this type. This will\n * be any key that has been animated or otherwise handled by active, higher-priortiy types.\n */\n typeState.protectedKeys = { ...encounteredKeys };\n // Check if we can skip analysing this prop early\n if (\n // If it isn't active and hasn't *just* been set as inactive\n (!typeState.isActive && activeDelta === null) ||\n // If we didn't and don't have any defined prop for this animation type\n (!prop && !typeState.prevProp) ||\n // Or if the prop doesn't define an animation\n isAnimationControls(prop) ||\n typeof prop === \"boolean\") {\n continue;\n }\n /**\n * As we go look through the values defined on this type, if we detect\n * a changed value or a value that was removed in a higher priority, we set\n * this to true and add this prop to the animation list.\n */\n const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop);\n let shouldAnimateType = variantDidChange ||\n // If we're making this variant active, we want to always make it active\n (type === changedActiveType &&\n typeState.isActive &&\n !isInherited &&\n propIsVariant) ||\n // If we removed a higher-priority variant (i is in reverse order)\n (i > removedVariantIndex && propIsVariant);\n let handledRemovedValues = false;\n /**\n * As animations can be set as variant lists, variants or target objects, we\n * coerce everything to an array if it isn't one already\n */\n const definitionList = Array.isArray(prop) ? prop : [prop];\n /**\n * Build an object of all the resolved values. We'll use this in the subsequent\n * animateChanges calls to determine whether a value has changed.\n */\n let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {});\n if (activeDelta === false)\n resolvedValues = {};\n /**\n * Now we need to loop through all the keys in the prev prop and this prop,\n * and decide:\n * 1. If the value has changed, and needs animating\n * 2. If it has been removed, and needs adding to the removedKeys set\n * 3. If it has been removed in a higher priority type and needs animating\n * 4. If it hasn't been removed in a higher priority but hasn't changed, and\n * needs adding to the type's protectedKeys list.\n */\n const { prevResolvedValues = {} } = typeState;\n const allKeys = {\n ...prevResolvedValues,\n ...resolvedValues,\n };\n const markToAnimate = (key) => {\n shouldAnimateType = true;\n if (removedKeys.has(key)) {\n handledRemovedValues = true;\n removedKeys.delete(key);\n }\n typeState.needsAnimating[key] = true;\n const motionValue = visualElement.getValue(key);\n if (motionValue)\n motionValue.liveStyle = false;\n };\n for (const key in allKeys) {\n const next = resolvedValues[key];\n const prev = prevResolvedValues[key];\n // If we've already handled this we can just skip ahead\n if (encounteredKeys.hasOwnProperty(key))\n continue;\n /**\n * If the value has changed, we probably want to animate it.\n */\n let valueHasChanged = false;\n if (isKeyframesTarget(next) && isKeyframesTarget(prev)) {\n valueHasChanged = !shallowCompare(next, prev);\n }\n else {\n valueHasChanged = next !== prev;\n }\n if (valueHasChanged) {\n if (next !== undefined && next !== null) {\n // If next is defined and doesn't equal prev, it needs animating\n markToAnimate(key);\n }\n else {\n // If it's undefined, it's been removed.\n removedKeys.add(key);\n }\n }\n else if (next !== undefined && removedKeys.has(key)) {\n /**\n * If next hasn't changed and it isn't undefined, we want to check if it's\n * been removed by a higher priority\n */\n markToAnimate(key);\n }\n else {\n /**\n * If it hasn't changed, we add it to the list of protected values\n * to ensure it doesn't get animated.\n */\n typeState.protectedKeys[key] = true;\n }\n }\n /**\n * Update the typeState so next time animateChanges is called we can compare the\n * latest prop and resolvedValues to these.\n */\n typeState.prevProp = prop;\n typeState.prevResolvedValues = resolvedValues;\n if (typeState.isActive) {\n encounteredKeys = { ...encounteredKeys, ...resolvedValues };\n }\n if (isInitialRender && visualElement.blockInitialAnimation) {\n shouldAnimateType = false;\n }\n /**\n * If this is an inherited prop we want to skip this animation\n * unless the inherited variants haven't changed on this render.\n */\n const willAnimateViaParent = isInherited && variantDidChange;\n const needsAnimating = !willAnimateViaParent || handledRemovedValues;\n if (shouldAnimateType && needsAnimating) {\n animations.push(...definitionList.map((animation) => {\n const options = { type };\n /**\n * If we're performing the initial animation, but we're not\n * rendering at the same time as the variant-controlling parent,\n * we want to use the parent's transition to calculate the stagger.\n */\n if (typeof animation === \"string\" &&\n isInitialRender &&\n !willAnimateViaParent &&\n visualElement.manuallyAnimateOnMount &&\n visualElement.parent) {\n const { parent } = visualElement;\n const parentVariant = resolveVariant(parent, animation);\n if (parent.enteringChildren && parentVariant) {\n const { delayChildren } = parentVariant.transition || {};\n options.delay = calcChildStagger(parent.enteringChildren, visualElement, delayChildren);\n }\n }\n return {\n animation: animation,\n options,\n };\n }));\n }\n }\n /**\n * If there are some removed value that haven't been dealt with,\n * we need to create a new animation that falls back either to the value\n * defined in the style prop, or the last read value.\n */\n if (removedKeys.size) {\n const fallbackAnimation = {};\n /**\n * If the initial prop contains a transition we can use that, otherwise\n * allow the animation function to use the visual element's default.\n */\n if (typeof props.initial !== \"boolean\") {\n const initialTransition = resolveVariant(visualElement, Array.isArray(props.initial)\n ? props.initial[0]\n : props.initial);\n if (initialTransition && initialTransition.transition) {\n fallbackAnimation.transition = initialTransition.transition;\n }\n }\n removedKeys.forEach((key) => {\n const fallbackTarget = visualElement.getBaseTarget(key);\n const motionValue = visualElement.getValue(key);\n if (motionValue)\n motionValue.liveStyle = true;\n // @ts-expect-error - @mattgperry to figure if we should do something here\n fallbackAnimation[key] = fallbackTarget ?? null;\n });\n animations.push({ animation: fallbackAnimation });\n }\n let shouldAnimate = Boolean(animations.length);\n if (isInitialRender &&\n (props.initial === false || props.initial === props.animate) &&\n !visualElement.manuallyAnimateOnMount) {\n shouldAnimate = false;\n }\n isInitialRender = false;\n return shouldAnimate ? animate(animations) : Promise.resolve();\n }\n /**\n * Change whether a certain animation type is active.\n */\n function setActive(type, isActive) {\n // If the active state hasn't changed, we can safely do nothing here\n if (state[type].isActive === isActive)\n return Promise.resolve();\n // Propagate active change to children\n visualElement.variantChildren?.forEach((child) => child.animationState?.setActive(type, isActive));\n state[type].isActive = isActive;\n const animations = animateChanges(type);\n for (const key in state) {\n state[key].protectedKeys = {};\n }\n return animations;\n }\n return {\n animateChanges,\n setActive,\n setAnimateFunction,\n getState: () => state,\n reset: () => {\n state = createState();\n /**\n * Temporarily disabling resetting this flag as it prevents components\n * with initial={false} from animating after being remounted, for instance\n * as the child of an Activity component.\n */\n // isInitialRender = true\n },\n };\n}\nfunction checkVariantsDidChange(prev, next) {\n if (typeof next === \"string\") {\n return next !== prev;\n }\n else if (Array.isArray(next)) {\n return !shallowCompare(next, prev);\n }\n return false;\n}\nfunction createTypeState(isActive = false) {\n return {\n isActive,\n protectedKeys: {},\n needsAnimating: {},\n prevResolvedValues: {},\n };\n}\nfunction createState() {\n return {\n animate: createTypeState(true),\n whileInView: createTypeState(),\n whileHover: createTypeState(),\n whileTap: createTypeState(),\n whileDrag: createTypeState(),\n whileFocus: createTypeState(),\n exit: createTypeState(),\n };\n}\n\nexport { checkVariantsDidChange, createAnimationState };\n","import { mixNumber } from '../../utils/mix/number.mjs';\n\nconst SCALE_PRECISION = 0.0001;\nconst SCALE_MIN = 1 - SCALE_PRECISION;\nconst SCALE_MAX = 1 + SCALE_PRECISION;\nconst TRANSLATE_PRECISION = 0.01;\nconst TRANSLATE_MIN = 0 - TRANSLATE_PRECISION;\nconst TRANSLATE_MAX = 0 + TRANSLATE_PRECISION;\nfunction calcLength(axis) {\n return axis.max - axis.min;\n}\nfunction isNear(value, target, maxDistance) {\n return Math.abs(value - target) <= maxDistance;\n}\nfunction calcAxisDelta(delta, source, target, origin = 0.5) {\n delta.origin = origin;\n delta.originPoint = mixNumber(source.min, source.max, delta.origin);\n delta.scale = calcLength(target) / calcLength(source);\n delta.translate =\n mixNumber(target.min, target.max, delta.origin) - delta.originPoint;\n if ((delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) ||\n isNaN(delta.scale)) {\n delta.scale = 1.0;\n }\n if ((delta.translate >= TRANSLATE_MIN &&\n delta.translate <= TRANSLATE_MAX) ||\n isNaN(delta.translate)) {\n delta.translate = 0.0;\n }\n}\nfunction calcBoxDelta(delta, source, target, origin) {\n calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined);\n calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined);\n}\nfunction calcRelativeAxis(target, relative, parent) {\n target.min = parent.min + relative.min;\n target.max = target.min + calcLength(relative);\n}\nfunction calcRelativeBox(target, relative, parent) {\n calcRelativeAxis(target.x, relative.x, parent.x);\n calcRelativeAxis(target.y, relative.y, parent.y);\n}\nfunction calcRelativeAxisPosition(target, layout, parent) {\n target.min = layout.min - parent.min;\n target.max = target.min + calcLength(layout);\n}\nfunction calcRelativePosition(target, layout, parent) {\n calcRelativeAxisPosition(target.x, layout.x, parent.x);\n calcRelativeAxisPosition(target.y, layout.y, parent.y);\n}\n\nexport { calcAxisDelta, calcBoxDelta, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, isNear };\n","import { mixNumber } from '../../utils/mix/number.mjs';\nimport { percent } from '../../value/types/numbers/units.mjs';\nimport { scalePoint } from './delta-apply.mjs';\n\n/**\n * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse\n */\nfunction removePointDelta(point, translate, scale, originPoint, boxScale) {\n point -= translate;\n point = scalePoint(point, 1 / scale, originPoint);\n if (boxScale !== undefined) {\n point = scalePoint(point, 1 / boxScale, originPoint);\n }\n return point;\n}\n/**\n * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse\n */\nfunction removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) {\n if (percent.test(translate)) {\n translate = parseFloat(translate);\n const relativeProgress = mixNumber(sourceAxis.min, sourceAxis.max, translate / 100);\n translate = relativeProgress - sourceAxis.min;\n }\n if (typeof translate !== \"number\")\n return;\n let originPoint = mixNumber(originAxis.min, originAxis.max, origin);\n if (axis === originAxis)\n originPoint -= translate;\n axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale);\n axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale);\n}\n/**\n * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nfunction removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) {\n removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis);\n}\n/**\n * The names of the motion values we want to apply as translation, scale and origin.\n */\nconst xKeys = [\"x\", \"scaleX\", \"originX\"];\nconst yKeys = [\"y\", \"scaleY\", \"originY\"];\n/**\n * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nfunction removeBoxTransforms(box, transforms, originBox, sourceBox) {\n removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined);\n removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined);\n}\n\nexport { removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta };\n","/**\n * Reset an axis to the provided origin box.\n *\n * This is a mutative operation.\n */\nfunction copyAxisInto(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}\n/**\n * Reset a box to the provided origin box.\n *\n * This is a mutative operation.\n */\nfunction copyBoxInto(box, originBox) {\n copyAxisInto(box.x, originBox.x);\n copyAxisInto(box.y, originBox.y);\n}\n/**\n * Reset a delta to the provided origin box.\n *\n * This is a mutative operation.\n */\nfunction copyAxisDeltaInto(delta, originDelta) {\n delta.translate = originDelta.translate;\n delta.scale = originDelta.scale;\n delta.originPoint = originDelta.originPoint;\n delta.origin = originDelta.origin;\n}\n\nexport { copyAxisDeltaInto, copyAxisInto, copyBoxInto };\n","import { calcLength } from './delta-calc.mjs';\n\nfunction isAxisDeltaZero(delta) {\n return delta.translate === 0 && delta.scale === 1;\n}\nfunction isDeltaZero(delta) {\n return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y);\n}\nfunction axisEquals(a, b) {\n return a.min === b.min && a.max === b.max;\n}\nfunction boxEquals(a, b) {\n return axisEquals(a.x, b.x) && axisEquals(a.y, b.y);\n}\nfunction axisEqualsRounded(a, b) {\n return (Math.round(a.min) === Math.round(b.min) &&\n Math.round(a.max) === Math.round(b.max));\n}\nfunction boxEqualsRounded(a, b) {\n return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y);\n}\nfunction aspectRatio(box) {\n return calcLength(box.x) / calcLength(box.y);\n}\nfunction axisDeltaEquals(a, b) {\n return (a.translate === b.translate &&\n a.scale === b.scale &&\n a.originPoint === b.originPoint);\n}\n\nexport { aspectRatio, axisDeltaEquals, axisEquals, axisEqualsRounded, boxEquals, boxEqualsRounded, isDeltaZero };\n","function eachAxis(callback) {\n return [callback(\"x\"), callback(\"y\")];\n}\n\nexport { eachAxis };\n","function buildProjectionTransform(delta, treeScale, latestTransform) {\n let transform = \"\";\n /**\n * The translations we use to calculate are always relative to the viewport coordinate space.\n * But when we apply scales, we also scale the coordinate space of an element and its children.\n * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need\n * to move an element 100 pixels, we actually need to move it 200 in within that scaled space.\n */\n const xTranslate = delta.x.translate / treeScale.x;\n const yTranslate = delta.y.translate / treeScale.y;\n const zTranslate = latestTransform?.z || 0;\n if (xTranslate || yTranslate || zTranslate) {\n transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `;\n }\n /**\n * Apply scale correction for the tree transform.\n * This will apply scale to the screen-orientated axes.\n */\n if (treeScale.x !== 1 || treeScale.y !== 1) {\n transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `;\n }\n if (latestTransform) {\n const { transformPerspective, rotate, rotateX, rotateY, skewX, skewY } = latestTransform;\n if (transformPerspective)\n transform = `perspective(${transformPerspective}px) ${transform}`;\n if (rotate)\n transform += `rotate(${rotate}deg) `;\n if (rotateX)\n transform += `rotateX(${rotateX}deg) `;\n if (rotateY)\n transform += `rotateY(${rotateY}deg) `;\n if (skewX)\n transform += `skewX(${skewX}deg) `;\n if (skewY)\n transform += `skewY(${skewY}deg) `;\n }\n /**\n * Apply scale to match the size of the element to the size we want it.\n * This will apply scale to the element-orientated axes.\n */\n const elementScaleX = delta.x.scale * treeScale.x;\n const elementScaleY = delta.y.scale * treeScale.y;\n if (elementScaleX !== 1 || elementScaleY !== 1) {\n transform += `scale(${elementScaleX}, ${elementScaleY})`;\n }\n return transform || \"none\";\n}\n\nexport { buildProjectionTransform };\n","import { mixNumber } from '../../utils/mix/number.mjs';\nimport { percent, px } from '../../value/types/numbers/units.mjs';\nimport { progress, circOut, noop } from 'motion-utils';\n\nconst borders = [\"TopLeft\", \"TopRight\", \"BottomLeft\", \"BottomRight\"];\nconst numBorders = borders.length;\nconst asNumber = (value) => typeof value === \"string\" ? parseFloat(value) : value;\nconst isPx = (value) => typeof value === \"number\" || px.test(value);\nfunction mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) {\n if (shouldCrossfadeOpacity) {\n target.opacity = mixNumber(0, lead.opacity ?? 1, easeCrossfadeIn(progress));\n target.opacityExit = mixNumber(follow.opacity ?? 1, 0, easeCrossfadeOut(progress));\n }\n else if (isOnlyMember) {\n target.opacity = mixNumber(follow.opacity ?? 1, lead.opacity ?? 1, progress);\n }\n /**\n * Mix border radius\n */\n for (let i = 0; i < numBorders; i++) {\n const borderLabel = `border${borders[i]}Radius`;\n let followRadius = getRadius(follow, borderLabel);\n let leadRadius = getRadius(lead, borderLabel);\n if (followRadius === undefined && leadRadius === undefined)\n continue;\n followRadius || (followRadius = 0);\n leadRadius || (leadRadius = 0);\n const canMix = followRadius === 0 ||\n leadRadius === 0 ||\n isPx(followRadius) === isPx(leadRadius);\n if (canMix) {\n target[borderLabel] = Math.max(mixNumber(asNumber(followRadius), asNumber(leadRadius), progress), 0);\n if (percent.test(leadRadius) || percent.test(followRadius)) {\n target[borderLabel] += \"%\";\n }\n }\n else {\n target[borderLabel] = leadRadius;\n }\n }\n /**\n * Mix rotation\n */\n if (follow.rotate || lead.rotate) {\n target.rotate = mixNumber(follow.rotate || 0, lead.rotate || 0, progress);\n }\n}\nfunction getRadius(values, radiusName) {\n return values[radiusName] !== undefined\n ? values[radiusName]\n : values.borderRadius;\n}\nconst easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut);\nconst easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop);\nfunction compress(min, max, easing) {\n return (p) => {\n // Could replace ifs with clamp\n if (p < min)\n return 0;\n if (p > max)\n return 1;\n return easing(progress(min, max, p));\n };\n}\n\nexport { mixValues };\n","import { time } from '../frameloop/sync-time.mjs';\nimport { secondsToMilliseconds } from 'motion-utils';\nimport { frame, cancelFrame } from '../frameloop/frame.mjs';\n\n/**\n * Timeout defined in ms\n */\nfunction delay(callback, timeout) {\n const start = time.now();\n const checkElapsed = ({ timestamp }) => {\n const elapsed = timestamp - start;\n if (elapsed >= timeout) {\n cancelFrame(checkElapsed);\n callback(elapsed - timeout);\n }\n };\n frame.setup(checkElapsed, true);\n return () => cancelFrame(checkElapsed);\n}\nfunction delayInSeconds(callback, timeout) {\n return delay(callback, secondsToMilliseconds(timeout));\n}\n\nexport { delay, delayInSeconds };\n","function addDomEvent(target, eventName, handler, options = { passive: true }) {\n target.addEventListener(eventName, handler, options);\n return () => target.removeEventListener(eventName, handler);\n}\n\nexport { addDomEvent };\n","import { isMotionValue } from './is-motion-value.mjs';\n\n/**\n * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself\n */\nfunction resolveMotionValue(value) {\n return isMotionValue(value) ? value.get() : value;\n}\n\nexport { resolveMotionValue };\n","import { animateMotionValue } from '../interfaces/motion-value.mjs';\nimport { motionValue } from '../../value/index.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\n\nfunction animateSingleValue(value, keyframes, options) {\n const motionValue$1 = isMotionValue(value) ? value : motionValue(value);\n motionValue$1.start(animateMotionValue(\"\", motionValue$1, keyframes, options));\n return motionValue$1.animation;\n}\n\nexport { animateSingleValue };\n","const compareByDepth = (a, b) => a.depth - b.depth;\n\nexport { compareByDepth };\n","import { addUniqueItem, removeItem } from 'motion-utils';\nimport { compareByDepth } from './compare-by-depth.mjs';\n\nclass FlatTree {\n constructor() {\n this.children = [];\n this.isDirty = false;\n }\n add(child) {\n addUniqueItem(this.children, child);\n this.isDirty = true;\n }\n remove(child) {\n removeItem(this.children, child);\n this.isDirty = true;\n }\n forEach(callback) {\n this.isDirty && this.children.sort(compareByDepth);\n this.isDirty = false;\n this.children.forEach(callback);\n }\n}\n\nexport { FlatTree };\n","import { addUniqueItem, removeItem } from 'motion-utils';\n\nclass NodeStack {\n constructor() {\n this.members = [];\n }\n add(node) {\n addUniqueItem(this.members, node);\n node.scheduleRender();\n }\n remove(node) {\n removeItem(this.members, node);\n if (node === this.prevLead) {\n this.prevLead = undefined;\n }\n if (node === this.lead) {\n const prevLead = this.members[this.members.length - 1];\n if (prevLead) {\n this.promote(prevLead);\n }\n }\n }\n relegate(node) {\n const indexOfNode = this.members.findIndex((member) => node === member);\n if (indexOfNode === 0)\n return false;\n /**\n * Find the next projection node that is present\n */\n let prevLead;\n for (let i = indexOfNode; i >= 0; i--) {\n const member = this.members[i];\n if (member.isPresent !== false) {\n prevLead = member;\n break;\n }\n }\n if (prevLead) {\n this.promote(prevLead);\n return true;\n }\n else {\n return false;\n }\n }\n promote(node, preserveFollowOpacity) {\n const prevLead = this.lead;\n if (node === prevLead)\n return;\n this.prevLead = prevLead;\n this.lead = node;\n node.show();\n if (prevLead) {\n prevLead.instance && prevLead.scheduleRender();\n node.scheduleRender();\n node.resumeFrom = prevLead;\n if (preserveFollowOpacity) {\n node.resumeFrom.preserveOpacity = true;\n }\n if (prevLead.snapshot) {\n node.snapshot = prevLead.snapshot;\n node.snapshot.latestValues =\n prevLead.animationValues || prevLead.latestValues;\n }\n if (node.root && node.root.isUpdating) {\n node.isLayoutDirty = true;\n }\n const { crossfade } = node.options;\n if (crossfade === false) {\n prevLead.hide();\n }\n }\n }\n exitAnimationComplete() {\n this.members.forEach((node) => {\n const { options, resumingFrom } = node;\n options.onExitComplete && options.onExitComplete();\n if (resumingFrom) {\n resumingFrom.options.onExitComplete &&\n resumingFrom.options.onExitComplete();\n }\n });\n }\n scheduleRender() {\n this.members.forEach((node) => {\n node.instance && node.scheduleRender(false);\n });\n }\n /**\n * Clear any leads that have been removed this render to prevent them from being\n * used in future animations and to prevent memory leaks\n */\n removeLeadSnapshot() {\n if (this.lead && this.lead.snapshot) {\n this.lead.snapshot = undefined;\n }\n }\n}\n\nexport { NodeStack };\n","/**\n * This should only ever be modified on the client otherwise it'll\n * persist through server requests. If we need instanced states we\n * could lazy-init via root.\n */\nconst globalProjectionState = {\n /**\n * Global flag as to whether the tree has animated since the last time\n * we resized the window\n */\n hasAnimatedSinceResize: true,\n /**\n * We set this to true once, on the first update. Any nodes added to the tree beyond that\n * update will be given a `data-projection-id` attribute.\n */\n hasEverUpdated: false,\n};\n\nexport { globalProjectionState };\n","import { activeAnimations } from '../../stats/animation-count.mjs';\nimport { getValueTransition } from '../../animation/utils/get-value-transition.mjs';\nimport { microtask } from '../../frameloop/microtask.mjs';\nimport { time } from '../../frameloop/sync-time.mjs';\nimport { translateAxis, transformBox, applyBoxDelta, applyTreeDeltas } from '../geometry/delta-apply.mjs';\nimport { calcLength, calcRelativeBox, calcRelativePosition, calcBoxDelta, isNear } from '../geometry/delta-calc.mjs';\nimport { removeBoxTransforms } from '../geometry/delta-remove.mjs';\nimport { copyBoxInto, copyAxisDeltaInto } from '../geometry/copy.mjs';\nimport { createBox, createDelta } from '../geometry/models.mjs';\nimport { boxEqualsRounded, isDeltaZero, axisDeltaEquals, aspectRatio, boxEquals } from '../geometry/utils.mjs';\nimport { buildProjectionTransform } from '../styles/transform.mjs';\nimport { eachAxis } from '../utils/each-axis.mjs';\nimport { hasTransform, hasScale, has2DTranslate } from '../utils/has-transform.mjs';\nimport { mixValues } from '../animation/mix-values.mjs';\nimport { isSVGElement } from '../../utils/is-svg-element.mjs';\nimport { isSVGSVGElement } from '../../utils/is-svg-svg-element.mjs';\nimport { mixNumber } from '../../utils/mix/number.mjs';\nimport { motionValue } from '../../value/index.mjs';\nimport { scaleCorrectors } from '../styles/scale-correction.mjs';\nimport { statsBuffer } from '../../stats/buffer.mjs';\nimport { SubscriptionManager, clamp, noop } from 'motion-utils';\nimport { animateSingleValue } from '../../animation/animate/single-value.mjs';\nimport { getOptimisedAppearId } from '../../animation/optimized-appear/get-appear-id.mjs';\nimport { FlatTree } from '../utils/flat-tree.mjs';\nimport { delay } from '../../utils/delay.mjs';\nimport { resolveMotionValue } from '../../value/utils/resolve-motion-value.mjs';\nimport { NodeStack } from '../shared/stack.mjs';\nimport { globalProjectionState } from './state.mjs';\nimport { frame, cancelFrame, frameData, frameSteps } from '../../frameloop/frame.mjs';\n\nconst metrics = {\n nodes: 0,\n calculatedTargetDeltas: 0,\n calculatedProjections: 0,\n};\nconst transformAxes = [\"\", \"X\", \"Y\", \"Z\"];\n/**\n * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1\n * which has a noticeable difference in spring animations\n */\nconst animationTarget = 1000;\nlet id = 0;\nfunction resetDistortingTransform(key, visualElement, values, sharedAnimationValues) {\n const { latestValues } = visualElement;\n // Record the distorting transform and then temporarily set it to 0\n if (latestValues[key]) {\n values[key] = latestValues[key];\n visualElement.setStaticValue(key, 0);\n if (sharedAnimationValues) {\n sharedAnimationValues[key] = 0;\n }\n }\n}\nfunction cancelTreeOptimisedTransformAnimations(projectionNode) {\n projectionNode.hasCheckedOptimisedAppear = true;\n if (projectionNode.root === projectionNode)\n return;\n const { visualElement } = projectionNode.options;\n if (!visualElement)\n return;\n const appearId = getOptimisedAppearId(visualElement);\n if (window.MotionHasOptimisedAnimation(appearId, \"transform\")) {\n const { layout, layoutId } = projectionNode.options;\n window.MotionCancelOptimisedAnimation(appearId, \"transform\", frame, !(layout || layoutId));\n }\n const { parent } = projectionNode;\n if (parent && !parent.hasCheckedOptimisedAppear) {\n cancelTreeOptimisedTransformAnimations(parent);\n }\n}\nfunction createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) {\n return class ProjectionNode {\n constructor(latestValues = {}, parent = defaultParent?.()) {\n /**\n * A unique ID generated for every projection node.\n */\n this.id = id++;\n /**\n * An id that represents a unique session instigated by startUpdate.\n */\n this.animationId = 0;\n this.animationCommitId = 0;\n /**\n * A Set containing all this component's children. This is used to iterate\n * through the children.\n *\n * TODO: This could be faster to iterate as a flat array stored on the root node.\n */\n this.children = new Set();\n /**\n * Options for the node. We use this to configure what kind of layout animations\n * we should perform (if any).\n */\n this.options = {};\n /**\n * We use this to detect when its safe to shut down part of a projection tree.\n * We have to keep projecting children for scale correction and relative projection\n * until all their parents stop performing layout animations.\n */\n this.isTreeAnimating = false;\n this.isAnimationBlocked = false;\n /**\n * Flag to true if we think this layout has been changed. We can't always know this,\n * currently we set it to true every time a component renders, or if it has a layoutDependency\n * if that has changed between renders. Additionally, components can be grouped by LayoutGroup\n * and if one node is dirtied, they all are.\n */\n this.isLayoutDirty = false;\n /**\n * Flag to true if we think the projection calculations for this node needs\n * recalculating as a result of an updated transform or layout animation.\n */\n this.isProjectionDirty = false;\n /**\n * Flag to true if the layout *or* transform has changed. This then gets propagated\n * throughout the projection tree, forcing any element below to recalculate on the next frame.\n */\n this.isSharedProjectionDirty = false;\n /**\n * Flag transform dirty. This gets propagated throughout the whole tree but is only\n * respected by shared nodes.\n */\n this.isTransformDirty = false;\n /**\n * Block layout updates for instant layout transitions throughout the tree.\n */\n this.updateManuallyBlocked = false;\n this.updateBlockedByResize = false;\n /**\n * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate`\n * call.\n */\n this.isUpdating = false;\n /**\n * If this is an SVG element we currently disable projection transforms\n */\n this.isSVG = false;\n /**\n * Flag to true (during promotion) if a node doing an instant layout transition needs to reset\n * its projection styles.\n */\n this.needsReset = false;\n /**\n * Flags whether this node should have its transform reset prior to measuring.\n */\n this.shouldResetTransform = false;\n /**\n * Store whether this node has been checked for optimised appear animations. As\n * effects fire bottom-up, and we want to look up the tree for appear animations,\n * this makes sure we only check each path once, stopping at nodes that\n * have already been checked.\n */\n this.hasCheckedOptimisedAppear = false;\n /**\n * An object representing the calculated contextual/accumulated/tree scale.\n * This will be used to scale calculcated projection transforms, as these are\n * calculated in screen-space but need to be scaled for elements to layoutly\n * make it to their calculated destinations.\n *\n * TODO: Lazy-init\n */\n this.treeScale = { x: 1, y: 1 };\n /**\n *\n */\n this.eventHandlers = new Map();\n this.hasTreeAnimated = false;\n this.layoutVersion = 0;\n // Note: Currently only running on root node\n this.updateScheduled = false;\n this.scheduleUpdate = () => this.update();\n this.projectionUpdateScheduled = false;\n this.checkUpdateFailed = () => {\n if (this.isUpdating) {\n this.isUpdating = false;\n this.clearAllSnapshots();\n }\n };\n /**\n * This is a multi-step process as shared nodes might be of different depths. Nodes\n * are sorted by depth order, so we need to resolve the entire tree before moving to\n * the next step.\n */\n this.updateProjection = () => {\n this.projectionUpdateScheduled = false;\n /**\n * Reset debug counts. Manually resetting rather than creating a new\n * object each frame.\n */\n if (statsBuffer.value) {\n metrics.nodes =\n metrics.calculatedTargetDeltas =\n metrics.calculatedProjections =\n 0;\n }\n this.nodes.forEach(propagateDirtyNodes);\n this.nodes.forEach(resolveTargetDelta);\n this.nodes.forEach(calcProjection);\n this.nodes.forEach(cleanDirtyNodes);\n if (statsBuffer.addProjectionMetrics) {\n statsBuffer.addProjectionMetrics(metrics);\n }\n };\n /**\n * Frame calculations\n */\n this.resolvedRelativeTargetAt = 0.0;\n this.linkedParentVersion = 0;\n this.hasProjected = false;\n this.isVisible = true;\n this.animationProgress = 0;\n /**\n * Shared layout\n */\n // TODO Only running on root node\n this.sharedNodes = new Map();\n this.latestValues = latestValues;\n this.root = parent ? parent.root || parent : this;\n this.path = parent ? [...parent.path, parent] : [];\n this.parent = parent;\n this.depth = parent ? parent.depth + 1 : 0;\n for (let i = 0; i < this.path.length; i++) {\n this.path[i].shouldResetTransform = true;\n }\n if (this.root === this)\n this.nodes = new FlatTree();\n }\n addEventListener(name, handler) {\n if (!this.eventHandlers.has(name)) {\n this.eventHandlers.set(name, new SubscriptionManager());\n }\n return this.eventHandlers.get(name).add(handler);\n }\n notifyListeners(name, ...args) {\n const subscriptionManager = this.eventHandlers.get(name);\n subscriptionManager && subscriptionManager.notify(...args);\n }\n hasListeners(name) {\n return this.eventHandlers.has(name);\n }\n /**\n * Lifecycles\n */\n mount(instance) {\n if (this.instance)\n return;\n this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance);\n this.instance = instance;\n const { layoutId, layout, visualElement } = this.options;\n if (visualElement && !visualElement.current) {\n visualElement.mount(instance);\n }\n this.root.nodes.add(this);\n this.parent && this.parent.children.add(this);\n if (this.root.hasTreeAnimated && (layout || layoutId)) {\n this.isLayoutDirty = true;\n }\n if (attachResizeListener) {\n let cancelDelay;\n let innerWidth = 0;\n const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false);\n // Set initial innerWidth in a frame.read callback to batch the read\n frame.read(() => {\n innerWidth = window.innerWidth;\n });\n attachResizeListener(instance, () => {\n const newInnerWidth = window.innerWidth;\n if (newInnerWidth === innerWidth)\n return;\n innerWidth = newInnerWidth;\n this.root.updateBlockedByResize = true;\n cancelDelay && cancelDelay();\n cancelDelay = delay(resizeUnblockUpdate, 250);\n if (globalProjectionState.hasAnimatedSinceResize) {\n globalProjectionState.hasAnimatedSinceResize = false;\n this.nodes.forEach(finishAnimation);\n }\n });\n }\n if (layoutId) {\n this.root.registerSharedNode(layoutId, this);\n }\n // Only register the handler if it requires layout animation\n if (this.options.animate !== false &&\n visualElement &&\n (layoutId || layout)) {\n this.addEventListener(\"didUpdate\", ({ delta, hasLayoutChanged, hasRelativeLayoutChanged, layout: newLayout, }) => {\n if (this.isTreeAnimationBlocked()) {\n this.target = undefined;\n this.relativeTarget = undefined;\n return;\n }\n // TODO: Check here if an animation exists\n const layoutTransition = this.options.transition ||\n visualElement.getDefaultTransition() ||\n defaultLayoutTransition;\n const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps();\n /**\n * The target layout of the element might stay the same,\n * but its position relative to its parent has changed.\n */\n const hasTargetChanged = !this.targetLayout ||\n !boxEqualsRounded(this.targetLayout, newLayout);\n /*\n * Note: Disabled to fix relative animations always triggering new\n * layout animations. If this causes further issues, we can try\n * a different approach to detecting relative target changes.\n */\n // || hasRelativeLayoutChanged\n /**\n * If the layout hasn't seemed to have changed, it might be that the\n * element is visually in the same place in the document but its position\n * relative to its parent has indeed changed. So here we check for that.\n */\n const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeLayoutChanged;\n if (this.options.layoutRoot ||\n this.resumeFrom ||\n hasOnlyRelativeTargetChanged ||\n (hasLayoutChanged &&\n (hasTargetChanged || !this.currentAnimation))) {\n if (this.resumeFrom) {\n this.resumingFrom = this.resumeFrom;\n this.resumingFrom.resumingFrom = undefined;\n }\n const animationOptions = {\n ...getValueTransition(layoutTransition, \"layout\"),\n onPlay: onLayoutAnimationStart,\n onComplete: onLayoutAnimationComplete,\n };\n if (visualElement.shouldReduceMotion ||\n this.options.layoutRoot) {\n animationOptions.delay = 0;\n animationOptions.type = false;\n }\n this.startAnimation(animationOptions);\n /**\n * Set animation origin after starting animation to avoid layout jump\n * caused by stopping previous layout animation\n */\n this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged);\n }\n else {\n /**\n * If the layout hasn't changed and we have an animation that hasn't started yet,\n * finish it immediately. Otherwise it will be animating from a location\n * that was probably never committed to screen and look like a jumpy box.\n */\n if (!hasLayoutChanged) {\n finishAnimation(this);\n }\n if (this.isLead() && this.options.onExitComplete) {\n this.options.onExitComplete();\n }\n }\n this.targetLayout = newLayout;\n });\n }\n }\n unmount() {\n this.options.layoutId && this.willUpdate();\n this.root.nodes.remove(this);\n const stack = this.getStack();\n stack && stack.remove(this);\n this.parent && this.parent.children.delete(this);\n this.instance = undefined;\n this.eventHandlers.clear();\n cancelFrame(this.updateProjection);\n }\n // only on the root\n blockUpdate() {\n this.updateManuallyBlocked = true;\n }\n unblockUpdate() {\n this.updateManuallyBlocked = false;\n }\n isUpdateBlocked() {\n return this.updateManuallyBlocked || this.updateBlockedByResize;\n }\n isTreeAnimationBlocked() {\n return (this.isAnimationBlocked ||\n (this.parent && this.parent.isTreeAnimationBlocked()) ||\n false);\n }\n // Note: currently only running on root node\n startUpdate() {\n if (this.isUpdateBlocked())\n return;\n this.isUpdating = true;\n this.nodes && this.nodes.forEach(resetSkewAndRotation);\n this.animationId++;\n }\n getTransformTemplate() {\n const { visualElement } = this.options;\n return visualElement && visualElement.getProps().transformTemplate;\n }\n willUpdate(shouldNotifyListeners = true) {\n this.root.hasTreeAnimated = true;\n if (this.root.isUpdateBlocked()) {\n this.options.onExitComplete && this.options.onExitComplete();\n return;\n }\n /**\n * If we're running optimised appear animations then these must be\n * cancelled before measuring the DOM. This is so we can measure\n * the true layout of the element rather than the WAAPI animation\n * which will be unaffected by the resetSkewAndRotate step.\n *\n * Note: This is a DOM write. Worst case scenario is this is sandwiched\n * between other snapshot reads which will cause unnecessary style recalculations.\n * This has to happen here though, as we don't yet know which nodes will need\n * snapshots in startUpdate(), but we only want to cancel optimised animations\n * if a layout animation measurement is actually going to be affected by them.\n */\n if (window.MotionCancelOptimisedAnimation &&\n !this.hasCheckedOptimisedAppear) {\n cancelTreeOptimisedTransformAnimations(this);\n }\n !this.root.isUpdating && this.root.startUpdate();\n if (this.isLayoutDirty)\n return;\n this.isLayoutDirty = true;\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n node.shouldResetTransform = true;\n node.updateScroll(\"snapshot\");\n if (node.options.layoutRoot) {\n node.willUpdate(false);\n }\n }\n const { layoutId, layout } = this.options;\n if (layoutId === undefined && !layout)\n return;\n const transformTemplate = this.getTransformTemplate();\n this.prevTransformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined;\n this.updateSnapshot();\n shouldNotifyListeners && this.notifyListeners(\"willUpdate\");\n }\n update() {\n this.updateScheduled = false;\n const updateWasBlocked = this.isUpdateBlocked();\n // When doing an instant transition, we skip the layout update,\n // but should still clean up the measurements so that the next\n // snapshot could be taken correctly.\n if (updateWasBlocked) {\n this.unblockUpdate();\n this.clearAllSnapshots();\n this.nodes.forEach(clearMeasurements);\n return;\n }\n /**\n * If this is a repeat of didUpdate then ignore the animation.\n */\n if (this.animationId <= this.animationCommitId) {\n this.nodes.forEach(clearIsLayoutDirty);\n return;\n }\n this.animationCommitId = this.animationId;\n if (!this.isUpdating) {\n this.nodes.forEach(clearIsLayoutDirty);\n }\n else {\n this.isUpdating = false;\n /**\n * Write\n */\n this.nodes.forEach(resetTransformStyle);\n /**\n * Read ==================\n */\n // Update layout measurements of updated children\n this.nodes.forEach(updateLayout);\n /**\n * Write\n */\n // Notify listeners that the layout is updated\n this.nodes.forEach(notifyLayoutUpdate);\n }\n this.clearAllSnapshots();\n /**\n * Manually flush any pending updates. Ideally\n * we could leave this to the following requestAnimationFrame but this seems\n * to leave a flash of incorrectly styled content.\n */\n const now = time.now();\n frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp);\n frameData.timestamp = now;\n frameData.isProcessing = true;\n frameSteps.update.process(frameData);\n frameSteps.preRender.process(frameData);\n frameSteps.render.process(frameData);\n frameData.isProcessing = false;\n }\n didUpdate() {\n if (!this.updateScheduled) {\n this.updateScheduled = true;\n microtask.read(this.scheduleUpdate);\n }\n }\n clearAllSnapshots() {\n this.nodes.forEach(clearSnapshot);\n this.sharedNodes.forEach(removeLeadSnapshots);\n }\n scheduleUpdateProjection() {\n if (!this.projectionUpdateScheduled) {\n this.projectionUpdateScheduled = true;\n frame.preRender(this.updateProjection, false, true);\n }\n }\n scheduleCheckAfterUnmount() {\n /**\n * If the unmounting node is in a layoutGroup and did trigger a willUpdate,\n * we manually call didUpdate to give a chance to the siblings to animate.\n * Otherwise, cleanup all snapshots to prevents future nodes from reusing them.\n */\n frame.postRender(() => {\n if (this.isLayoutDirty) {\n this.root.didUpdate();\n }\n else {\n this.root.checkUpdateFailed();\n }\n });\n }\n /**\n * Update measurements\n */\n updateSnapshot() {\n if (this.snapshot || !this.instance)\n return;\n this.snapshot = this.measure();\n if (this.snapshot &&\n !calcLength(this.snapshot.measuredBox.x) &&\n !calcLength(this.snapshot.measuredBox.y)) {\n this.snapshot = undefined;\n }\n }\n updateLayout() {\n if (!this.instance)\n return;\n this.updateScroll();\n if (!(this.options.alwaysMeasureLayout && this.isLead()) &&\n !this.isLayoutDirty) {\n return;\n }\n /**\n * When a node is mounted, it simply resumes from the prevLead's\n * snapshot instead of taking a new one, but the ancestors scroll\n * might have updated while the prevLead is unmounted. We need to\n * update the scroll again to make sure the layout we measure is\n * up to date.\n */\n if (this.resumeFrom && !this.resumeFrom.instance) {\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n node.updateScroll();\n }\n }\n const prevLayout = this.layout;\n this.layout = this.measure(false);\n this.layoutVersion++;\n this.layoutCorrected = createBox();\n this.isLayoutDirty = false;\n this.projectionDelta = undefined;\n this.notifyListeners(\"measure\", this.layout.layoutBox);\n const { visualElement } = this.options;\n visualElement &&\n visualElement.notify(\"LayoutMeasure\", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined);\n }\n updateScroll(phase = \"measure\") {\n let needsMeasurement = Boolean(this.options.layoutScroll && this.instance);\n if (this.scroll &&\n this.scroll.animationId === this.root.animationId &&\n this.scroll.phase === phase) {\n needsMeasurement = false;\n }\n if (needsMeasurement && this.instance) {\n const isRoot = checkIsScrollRoot(this.instance);\n this.scroll = {\n animationId: this.root.animationId,\n phase,\n isRoot,\n offset: measureScroll(this.instance),\n wasRoot: this.scroll ? this.scroll.isRoot : isRoot,\n };\n }\n }\n resetTransform() {\n if (!resetTransform)\n return;\n const isResetRequested = this.isLayoutDirty ||\n this.shouldResetTransform ||\n this.options.alwaysMeasureLayout;\n const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta);\n const transformTemplate = this.getTransformTemplate();\n const transformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined;\n const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue;\n if (isResetRequested &&\n this.instance &&\n (hasProjection ||\n hasTransform(this.latestValues) ||\n transformTemplateHasChanged)) {\n resetTransform(this.instance, transformTemplateValue);\n this.shouldResetTransform = false;\n this.scheduleRender();\n }\n }\n measure(removeTransform = true) {\n const pageBox = this.measurePageBox();\n let layoutBox = this.removeElementScroll(pageBox);\n /**\n * Measurements taken during the pre-render stage\n * still have transforms applied so we remove them\n * via calculation.\n */\n if (removeTransform) {\n layoutBox = this.removeTransform(layoutBox);\n }\n roundBox(layoutBox);\n return {\n animationId: this.root.animationId,\n measuredBox: pageBox,\n layoutBox,\n latestValues: {},\n source: this.id,\n };\n }\n measurePageBox() {\n const { visualElement } = this.options;\n if (!visualElement)\n return createBox();\n const box = visualElement.measureViewportBox();\n const wasInScrollRoot = this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot);\n if (!wasInScrollRoot) {\n // Remove viewport scroll to give page-relative coordinates\n const { scroll } = this.root;\n if (scroll) {\n translateAxis(box.x, scroll.offset.x);\n translateAxis(box.y, scroll.offset.y);\n }\n }\n return box;\n }\n removeElementScroll(box) {\n const boxWithoutScroll = createBox();\n copyBoxInto(boxWithoutScroll, box);\n if (this.scroll?.wasRoot) {\n return boxWithoutScroll;\n }\n /**\n * Performance TODO: Keep a cumulative scroll offset down the tree\n * rather than loop back up the path.\n */\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n const { scroll, options } = node;\n if (node !== this.root && scroll && options.layoutScroll) {\n /**\n * If this is a new scroll root, we want to remove all previous scrolls\n * from the viewport box.\n */\n if (scroll.wasRoot) {\n copyBoxInto(boxWithoutScroll, box);\n }\n translateAxis(boxWithoutScroll.x, scroll.offset.x);\n translateAxis(boxWithoutScroll.y, scroll.offset.y);\n }\n }\n return boxWithoutScroll;\n }\n applyTransform(box, transformOnly = false) {\n const withTransforms = createBox();\n copyBoxInto(withTransforms, box);\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n if (!transformOnly &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root) {\n transformBox(withTransforms, {\n x: -node.scroll.offset.x,\n y: -node.scroll.offset.y,\n });\n }\n if (!hasTransform(node.latestValues))\n continue;\n transformBox(withTransforms, node.latestValues);\n }\n if (hasTransform(this.latestValues)) {\n transformBox(withTransforms, this.latestValues);\n }\n return withTransforms;\n }\n removeTransform(box) {\n const boxWithoutTransform = createBox();\n copyBoxInto(boxWithoutTransform, box);\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n if (!node.instance)\n continue;\n if (!hasTransform(node.latestValues))\n continue;\n hasScale(node.latestValues) && node.updateSnapshot();\n const sourceBox = createBox();\n const nodeBox = node.measurePageBox();\n copyBoxInto(sourceBox, nodeBox);\n removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot ? node.snapshot.layoutBox : undefined, sourceBox);\n }\n if (hasTransform(this.latestValues)) {\n removeBoxTransforms(boxWithoutTransform, this.latestValues);\n }\n return boxWithoutTransform;\n }\n setTargetDelta(delta) {\n this.targetDelta = delta;\n this.root.scheduleUpdateProjection();\n this.isProjectionDirty = true;\n }\n setOptions(options) {\n this.options = {\n ...this.options,\n ...options,\n crossfade: options.crossfade !== undefined ? options.crossfade : true,\n };\n }\n clearMeasurements() {\n this.scroll = undefined;\n this.layout = undefined;\n this.snapshot = undefined;\n this.prevTransformTemplateValue = undefined;\n this.targetDelta = undefined;\n this.target = undefined;\n this.isLayoutDirty = false;\n }\n forceRelativeParentToResolveTarget() {\n if (!this.relativeParent)\n return;\n /**\n * If the parent target isn't up-to-date, force it to update.\n * This is an unfortunate de-optimisation as it means any updating relative\n * projection will cause all the relative parents to recalculate back\n * up the tree.\n */\n if (this.relativeParent.resolvedRelativeTargetAt !==\n frameData.timestamp) {\n this.relativeParent.resolveTargetDelta(true);\n }\n }\n resolveTargetDelta(forceRecalculation = false) {\n /**\n * Once the dirty status of nodes has been spread through the tree, we also\n * need to check if we have a shared node of a different depth that has itself\n * been dirtied.\n */\n const lead = this.getLead();\n this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty);\n this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty);\n this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty);\n const isShared = Boolean(this.resumingFrom) || this !== lead;\n /**\n * We don't use transform for this step of processing so we don't\n * need to check whether any nodes have changed transform.\n */\n const canSkip = !(forceRecalculation ||\n (isShared && this.isSharedProjectionDirty) ||\n this.isProjectionDirty ||\n this.parent?.isProjectionDirty ||\n this.attemptToResolveRelativeTarget ||\n this.root.updateBlockedByResize);\n if (canSkip)\n return;\n const { layout, layoutId } = this.options;\n /**\n * If we have no layout, we can't perform projection, so early return\n */\n if (!this.layout || !(layout || layoutId))\n return;\n this.resolvedRelativeTargetAt = frameData.timestamp;\n const relativeParent = this.getClosestProjectingParent();\n if (relativeParent &&\n this.linkedParentVersion !== relativeParent.layoutVersion &&\n !relativeParent.options.layoutRoot) {\n this.removeRelativeTarget();\n }\n /**\n * If we don't have a targetDelta but do have a layout, we can attempt to resolve\n * a relativeParent. This will allow a component to perform scale correction\n * even if no animation has started.\n */\n if (!this.targetDelta && !this.relativeTarget) {\n if (relativeParent && relativeParent.layout) {\n this.createRelativeTarget(relativeParent, this.layout.layoutBox, relativeParent.layout.layoutBox);\n }\n else {\n this.removeRelativeTarget();\n }\n }\n /**\n * If we have no relative target or no target delta our target isn't valid\n * for this frame.\n */\n if (!this.relativeTarget && !this.targetDelta)\n return;\n /**\n * Lazy-init target data structure\n */\n if (!this.target) {\n this.target = createBox();\n this.targetWithTransforms = createBox();\n }\n /**\n * If we've got a relative box for this component, resolve it into a target relative to the parent.\n */\n if (this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.relativeParent &&\n this.relativeParent.target) {\n this.forceRelativeParentToResolveTarget();\n calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target);\n /**\n * If we've only got a targetDelta, resolve it into a target\n */\n }\n else if (this.targetDelta) {\n if (Boolean(this.resumingFrom)) {\n // TODO: This is creating a new object every frame\n this.target = this.applyTransform(this.layout.layoutBox);\n }\n else {\n copyBoxInto(this.target, this.layout.layoutBox);\n }\n applyBoxDelta(this.target, this.targetDelta);\n }\n else {\n /**\n * If no target, use own layout as target\n */\n copyBoxInto(this.target, this.layout.layoutBox);\n }\n /**\n * If we've been told to attempt to resolve a relative target, do so.\n */\n if (this.attemptToResolveRelativeTarget) {\n this.attemptToResolveRelativeTarget = false;\n if (relativeParent &&\n Boolean(relativeParent.resumingFrom) ===\n Boolean(this.resumingFrom) &&\n !relativeParent.options.layoutScroll &&\n relativeParent.target &&\n this.animationProgress !== 1) {\n this.createRelativeTarget(relativeParent, this.target, relativeParent.target);\n }\n else {\n this.relativeParent = this.relativeTarget = undefined;\n }\n }\n /**\n * Increase debug counter for resolved target deltas\n */\n if (statsBuffer.value) {\n metrics.calculatedTargetDeltas++;\n }\n }\n getClosestProjectingParent() {\n if (!this.parent ||\n hasScale(this.parent.latestValues) ||\n has2DTranslate(this.parent.latestValues)) {\n return undefined;\n }\n if (this.parent.isProjecting()) {\n return this.parent;\n }\n else {\n return this.parent.getClosestProjectingParent();\n }\n }\n isProjecting() {\n return Boolean((this.relativeTarget ||\n this.targetDelta ||\n this.options.layoutRoot) &&\n this.layout);\n }\n createRelativeTarget(relativeParent, layout, parentLayout) {\n this.relativeParent = relativeParent;\n this.linkedParentVersion = relativeParent.layoutVersion;\n this.forceRelativeParentToResolveTarget();\n this.relativeTarget = createBox();\n this.relativeTargetOrigin = createBox();\n calcRelativePosition(this.relativeTargetOrigin, layout, parentLayout);\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);\n }\n removeRelativeTarget() {\n this.relativeParent = this.relativeTarget = undefined;\n }\n calcProjection() {\n const lead = this.getLead();\n const isShared = Boolean(this.resumingFrom) || this !== lead;\n let canSkip = true;\n /**\n * If this is a normal layout animation and neither this node nor its nearest projecting\n * is dirty then we can't skip.\n */\n if (this.isProjectionDirty || this.parent?.isProjectionDirty) {\n canSkip = false;\n }\n /**\n * If this is a shared layout animation and this node's shared projection is dirty then\n * we can't skip.\n */\n if (isShared &&\n (this.isSharedProjectionDirty || this.isTransformDirty)) {\n canSkip = false;\n }\n /**\n * If we have resolved the target this frame we must recalculate the\n * projection to ensure it visually represents the internal calculations.\n */\n if (this.resolvedRelativeTargetAt === frameData.timestamp) {\n canSkip = false;\n }\n if (canSkip)\n return;\n const { layout, layoutId } = this.options;\n /**\n * If this section of the tree isn't animating we can\n * delete our target sources for the following frame.\n */\n this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) ||\n this.currentAnimation ||\n this.pendingAnimation);\n if (!this.isTreeAnimating) {\n this.targetDelta = this.relativeTarget = undefined;\n }\n if (!this.layout || !(layout || layoutId))\n return;\n /**\n * Reset the corrected box with the latest values from box, as we're then going\n * to perform mutative operations on it.\n */\n copyBoxInto(this.layoutCorrected, this.layout.layoutBox);\n /**\n * Record previous tree scales before updating.\n */\n const prevTreeScaleX = this.treeScale.x;\n const prevTreeScaleY = this.treeScale.y;\n /**\n * Apply all the parent deltas to this box to produce the corrected box. This\n * is the layout box, as it will appear on screen as a result of the transforms of its parents.\n */\n applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared);\n /**\n * If this layer needs to perform scale correction but doesn't have a target,\n * use the layout as the target.\n */\n if (lead.layout &&\n !lead.target &&\n (this.treeScale.x !== 1 || this.treeScale.y !== 1)) {\n lead.target = lead.layout.layoutBox;\n lead.targetWithTransforms = createBox();\n }\n const { target } = lead;\n if (!target) {\n /**\n * If we don't have a target to project into, but we were previously\n * projecting, we want to remove the stored transform and schedule\n * a render to ensure the elements reflect the removed transform.\n */\n if (this.prevProjectionDelta) {\n this.createProjectionDeltas();\n this.scheduleRender();\n }\n return;\n }\n if (!this.projectionDelta || !this.prevProjectionDelta) {\n this.createProjectionDeltas();\n }\n else {\n copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x);\n copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y);\n }\n /**\n * Update the delta between the corrected box and the target box before user-set transforms were applied.\n * This will allow us to calculate the corrected borderRadius and boxShadow to compensate\n * for our layout reprojection, but still allow them to be scaled correctly by the user.\n * It might be that to simplify this we may want to accept that user-set scale is also corrected\n * and we wouldn't have to keep and calc both deltas, OR we could support a user setting\n * to allow people to choose whether these styles are corrected based on just the\n * layout reprojection or the final bounding box.\n */\n calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues);\n if (this.treeScale.x !== prevTreeScaleX ||\n this.treeScale.y !== prevTreeScaleY ||\n !axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) ||\n !axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) {\n this.hasProjected = true;\n this.scheduleRender();\n this.notifyListeners(\"projectionUpdate\", target);\n }\n /**\n * Increase debug counter for recalculated projections\n */\n if (statsBuffer.value) {\n metrics.calculatedProjections++;\n }\n }\n hide() {\n this.isVisible = false;\n // TODO: Schedule render\n }\n show() {\n this.isVisible = true;\n // TODO: Schedule render\n }\n scheduleRender(notifyAll = true) {\n this.options.visualElement?.scheduleRender();\n if (notifyAll) {\n const stack = this.getStack();\n stack && stack.scheduleRender();\n }\n if (this.resumingFrom && !this.resumingFrom.instance) {\n this.resumingFrom = undefined;\n }\n }\n createProjectionDeltas() {\n this.prevProjectionDelta = createDelta();\n this.projectionDelta = createDelta();\n this.projectionDeltaWithTransform = createDelta();\n }\n setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false) {\n const snapshot = this.snapshot;\n const snapshotLatestValues = snapshot ? snapshot.latestValues : {};\n const mixedValues = { ...this.latestValues };\n const targetDelta = createDelta();\n if (!this.relativeParent ||\n !this.relativeParent.options.layoutRoot) {\n this.relativeTarget = this.relativeTargetOrigin = undefined;\n }\n this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged;\n const relativeLayout = createBox();\n const snapshotSource = snapshot ? snapshot.source : undefined;\n const layoutSource = this.layout ? this.layout.source : undefined;\n const isSharedLayoutAnimation = snapshotSource !== layoutSource;\n const stack = this.getStack();\n const isOnlyMember = !stack || stack.members.length <= 1;\n const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation &&\n !isOnlyMember &&\n this.options.crossfade === true &&\n !this.path.some(hasOpacityCrossfade));\n this.animationProgress = 0;\n let prevRelativeTarget;\n this.mixTargetDelta = (latest) => {\n const progress = latest / 1000;\n mixAxisDelta(targetDelta.x, delta.x, progress);\n mixAxisDelta(targetDelta.y, delta.y, progress);\n this.setTargetDelta(targetDelta);\n if (this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.layout &&\n this.relativeParent &&\n this.relativeParent.layout) {\n calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox);\n mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress);\n /**\n * If this is an unchanged relative target we can consider the\n * projection not dirty.\n */\n if (prevRelativeTarget &&\n boxEquals(this.relativeTarget, prevRelativeTarget)) {\n this.isProjectionDirty = false;\n }\n if (!prevRelativeTarget)\n prevRelativeTarget = createBox();\n copyBoxInto(prevRelativeTarget, this.relativeTarget);\n }\n if (isSharedLayoutAnimation) {\n this.animationValues = mixedValues;\n mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember);\n }\n this.root.scheduleUpdateProjection();\n this.scheduleRender();\n this.animationProgress = progress;\n };\n this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0);\n }\n startAnimation(options) {\n this.notifyListeners(\"animationStart\");\n this.currentAnimation?.stop();\n this.resumingFrom?.currentAnimation?.stop();\n if (this.pendingAnimation) {\n cancelFrame(this.pendingAnimation);\n this.pendingAnimation = undefined;\n }\n /**\n * Start the animation in the next frame to have a frame with progress 0,\n * where the target is the same as when the animation started, so we can\n * calculate the relative positions correctly for instant transitions.\n */\n this.pendingAnimation = frame.update(() => {\n globalProjectionState.hasAnimatedSinceResize = true;\n activeAnimations.layout++;\n this.motionValue || (this.motionValue = motionValue(0));\n this.currentAnimation = animateSingleValue(this.motionValue, [0, 1000], {\n ...options,\n velocity: 0,\n isSync: true,\n onUpdate: (latest) => {\n this.mixTargetDelta(latest);\n options.onUpdate && options.onUpdate(latest);\n },\n onStop: () => {\n activeAnimations.layout--;\n },\n onComplete: () => {\n activeAnimations.layout--;\n options.onComplete && options.onComplete();\n this.completeAnimation();\n },\n });\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = this.currentAnimation;\n }\n this.pendingAnimation = undefined;\n });\n }\n completeAnimation() {\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = undefined;\n this.resumingFrom.preserveOpacity = undefined;\n }\n const stack = this.getStack();\n stack && stack.exitAnimationComplete();\n this.resumingFrom =\n this.currentAnimation =\n this.animationValues =\n undefined;\n this.notifyListeners(\"animationComplete\");\n }\n finishAnimation() {\n if (this.currentAnimation) {\n this.mixTargetDelta && this.mixTargetDelta(animationTarget);\n this.currentAnimation.stop();\n }\n this.completeAnimation();\n }\n applyTransformsToTarget() {\n const lead = this.getLead();\n let { targetWithTransforms, target, layout, latestValues } = lead;\n if (!targetWithTransforms || !target || !layout)\n return;\n /**\n * If we're only animating position, and this element isn't the lead element,\n * then instead of projecting into the lead box we instead want to calculate\n * a new target that aligns the two boxes but maintains the layout shape.\n */\n if (this !== lead &&\n this.layout &&\n layout &&\n shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) {\n target = this.target || createBox();\n const xLength = calcLength(this.layout.layoutBox.x);\n target.x.min = lead.target.x.min;\n target.x.max = target.x.min + xLength;\n const yLength = calcLength(this.layout.layoutBox.y);\n target.y.min = lead.target.y.min;\n target.y.max = target.y.min + yLength;\n }\n copyBoxInto(targetWithTransforms, target);\n /**\n * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal.\n * This is the final box that we will then project into by calculating a transform delta and\n * applying it to the corrected box.\n */\n transformBox(targetWithTransforms, latestValues);\n /**\n * Update the delta between the corrected box and the final target box, after\n * user-set transforms are applied to it. This will be used by the renderer to\n * create a transform style that will reproject the element from its layout layout\n * into the desired bounding box.\n */\n calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues);\n }\n registerSharedNode(layoutId, node) {\n if (!this.sharedNodes.has(layoutId)) {\n this.sharedNodes.set(layoutId, new NodeStack());\n }\n const stack = this.sharedNodes.get(layoutId);\n stack.add(node);\n const config = node.options.initialPromotionConfig;\n node.promote({\n transition: config ? config.transition : undefined,\n preserveFollowOpacity: config && config.shouldPreserveFollowOpacity\n ? config.shouldPreserveFollowOpacity(node)\n : undefined,\n });\n }\n isLead() {\n const stack = this.getStack();\n return stack ? stack.lead === this : true;\n }\n getLead() {\n const { layoutId } = this.options;\n return layoutId ? this.getStack()?.lead || this : this;\n }\n getPrevLead() {\n const { layoutId } = this.options;\n return layoutId ? this.getStack()?.prevLead : undefined;\n }\n getStack() {\n const { layoutId } = this.options;\n if (layoutId)\n return this.root.sharedNodes.get(layoutId);\n }\n promote({ needsReset, transition, preserveFollowOpacity, } = {}) {\n const stack = this.getStack();\n if (stack)\n stack.promote(this, preserveFollowOpacity);\n if (needsReset) {\n this.projectionDelta = undefined;\n this.needsReset = true;\n }\n if (transition)\n this.setOptions({ transition });\n }\n relegate() {\n const stack = this.getStack();\n if (stack) {\n return stack.relegate(this);\n }\n else {\n return false;\n }\n }\n resetSkewAndRotation() {\n const { visualElement } = this.options;\n if (!visualElement)\n return;\n // If there's no detected skew or rotation values, we can early return without a forced render.\n let hasDistortingTransform = false;\n /**\n * An unrolled check for rotation values. Most elements don't have any rotation and\n * skipping the nested loop and new object creation is 50% faster.\n */\n const { latestValues } = visualElement;\n if (latestValues.z ||\n latestValues.rotate ||\n latestValues.rotateX ||\n latestValues.rotateY ||\n latestValues.rotateZ ||\n latestValues.skewX ||\n latestValues.skewY) {\n hasDistortingTransform = true;\n }\n // If there's no distorting values, we don't need to do any more.\n if (!hasDistortingTransform)\n return;\n const resetValues = {};\n if (latestValues.z) {\n resetDistortingTransform(\"z\", visualElement, resetValues, this.animationValues);\n }\n // Check the skew and rotate value of all axes and reset to 0\n for (let i = 0; i < transformAxes.length; i++) {\n resetDistortingTransform(`rotate${transformAxes[i]}`, visualElement, resetValues, this.animationValues);\n resetDistortingTransform(`skew${transformAxes[i]}`, visualElement, resetValues, this.animationValues);\n }\n // Force a render of this element to apply the transform with all skews and rotations\n // set to 0.\n visualElement.render();\n // Put back all the values we reset\n for (const key in resetValues) {\n visualElement.setStaticValue(key, resetValues[key]);\n if (this.animationValues) {\n this.animationValues[key] = resetValues[key];\n }\n }\n // Schedule a render for the next frame. This ensures we won't visually\n // see the element with the reset rotate value applied.\n visualElement.scheduleRender();\n }\n applyProjectionStyles(targetStyle, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties\n styleProp) {\n if (!this.instance || this.isSVG)\n return;\n if (!this.isVisible) {\n targetStyle.visibility = \"hidden\";\n return;\n }\n const transformTemplate = this.getTransformTemplate();\n if (this.needsReset) {\n this.needsReset = false;\n targetStyle.visibility = \"\";\n targetStyle.opacity = \"\";\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\";\n targetStyle.transform = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : \"none\";\n return;\n }\n const lead = this.getLead();\n if (!this.projectionDelta || !this.layout || !lead.target) {\n if (this.options.layoutId) {\n targetStyle.opacity =\n this.latestValues.opacity !== undefined\n ? this.latestValues.opacity\n : 1;\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\";\n }\n if (this.hasProjected && !hasTransform(this.latestValues)) {\n targetStyle.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\";\n this.hasProjected = false;\n }\n return;\n }\n targetStyle.visibility = \"\";\n const valuesToRender = lead.animationValues || lead.latestValues;\n this.applyTransformsToTarget();\n let transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender);\n if (transformTemplate) {\n transform = transformTemplate(valuesToRender, transform);\n }\n targetStyle.transform = transform;\n const { x, y } = this.projectionDelta;\n targetStyle.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`;\n if (lead.animationValues) {\n /**\n * If the lead component is animating, assign this either the entering/leaving\n * opacity\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity ??\n this.latestValues.opacity ??\n 1\n : this.preserveOpacity\n ? this.latestValues.opacity\n : valuesToRender.opacityExit;\n }\n else {\n /**\n * Or we're not animating at all, set the lead component to its layout\n * opacity and other components to hidden.\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity !== undefined\n ? valuesToRender.opacity\n : \"\"\n : valuesToRender.opacityExit !== undefined\n ? valuesToRender.opacityExit\n : 0;\n }\n /**\n * Apply scale correction\n */\n for (const key in scaleCorrectors) {\n if (valuesToRender[key] === undefined)\n continue;\n const { correct, applyTo, isCSSVariable } = scaleCorrectors[key];\n /**\n * Only apply scale correction to the value if we have an\n * active projection transform. Otherwise these values become\n * vulnerable to distortion if the element changes size without\n * a corresponding layout animation.\n */\n const corrected = transform === \"none\"\n ? valuesToRender[key]\n : correct(valuesToRender[key], lead);\n if (applyTo) {\n const num = applyTo.length;\n for (let i = 0; i < num; i++) {\n targetStyle[applyTo[i]] = corrected;\n }\n }\n else {\n // If this is a CSS variable, set it directly on the instance.\n // Replacing this function from creating styles to setting them\n // would be a good place to remove per frame object creation\n if (isCSSVariable) {\n this.options.visualElement.renderState.vars[key] = corrected;\n }\n else {\n targetStyle[key] = corrected;\n }\n }\n }\n /**\n * Disable pointer events on follow components. This is to ensure\n * that if a follow component covers a lead component it doesn't block\n * pointer events on the lead.\n */\n if (this.options.layoutId) {\n targetStyle.pointerEvents =\n lead === this\n ? resolveMotionValue(styleProp?.pointerEvents) || \"\"\n : \"none\";\n }\n }\n clearSnapshot() {\n this.resumeFrom = this.snapshot = undefined;\n }\n // Only run on root\n resetTree() {\n this.root.nodes.forEach((node) => node.currentAnimation?.stop());\n this.root.nodes.forEach(clearMeasurements);\n this.root.sharedNodes.clear();\n }\n };\n}\nfunction updateLayout(node) {\n node.updateLayout();\n}\nfunction notifyLayoutUpdate(node) {\n const snapshot = node.resumeFrom?.snapshot || node.snapshot;\n if (node.isLead() &&\n node.layout &&\n snapshot &&\n node.hasListeners(\"didUpdate\")) {\n const { layoutBox: layout, measuredBox: measuredLayout } = node.layout;\n const { animationType } = node.options;\n const isShared = snapshot.source !== node.layout.source;\n // TODO Maybe we want to also resize the layout snapshot so we don't trigger\n // animations for instance if layout=\"size\" and an element has only changed position\n if (animationType === \"size\") {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis];\n const length = calcLength(axisSnapshot);\n axisSnapshot.min = layout[axis].min;\n axisSnapshot.max = axisSnapshot.min + length;\n });\n }\n else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis];\n const length = calcLength(layout[axis]);\n axisSnapshot.max = axisSnapshot.min + length;\n /**\n * Ensure relative target gets resized and rerendererd\n */\n if (node.relativeTarget && !node.currentAnimation) {\n node.isProjectionDirty = true;\n node.relativeTarget[axis].max =\n node.relativeTarget[axis].min + length;\n }\n });\n }\n const layoutDelta = createDelta();\n calcBoxDelta(layoutDelta, layout, snapshot.layoutBox);\n const visualDelta = createDelta();\n if (isShared) {\n calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox);\n }\n else {\n calcBoxDelta(visualDelta, layout, snapshot.layoutBox);\n }\n const hasLayoutChanged = !isDeltaZero(layoutDelta);\n let hasRelativeLayoutChanged = false;\n if (!node.resumeFrom) {\n const relativeParent = node.getClosestProjectingParent();\n /**\n * If the relativeParent is itself resuming from a different element then\n * the relative snapshot is not relavent\n */\n if (relativeParent && !relativeParent.resumeFrom) {\n const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent;\n if (parentSnapshot && parentLayout) {\n const relativeSnapshot = createBox();\n calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox);\n const relativeLayout = createBox();\n calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox);\n if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) {\n hasRelativeLayoutChanged = true;\n }\n if (relativeParent.options.layoutRoot) {\n node.relativeTarget = relativeLayout;\n node.relativeTargetOrigin = relativeSnapshot;\n node.relativeParent = relativeParent;\n }\n }\n }\n }\n node.notifyListeners(\"didUpdate\", {\n layout,\n snapshot,\n delta: visualDelta,\n layoutDelta,\n hasLayoutChanged,\n hasRelativeLayoutChanged,\n });\n }\n else if (node.isLead()) {\n const { onExitComplete } = node.options;\n onExitComplete && onExitComplete();\n }\n /**\n * Clearing transition\n * TODO: Investigate why this transition is being passed in as {type: false } from Framer\n * and why we need it at all\n */\n node.options.transition = undefined;\n}\nfunction propagateDirtyNodes(node) {\n /**\n * Increase debug counter for nodes encountered this frame\n */\n if (statsBuffer.value) {\n metrics.nodes++;\n }\n if (!node.parent)\n return;\n /**\n * If this node isn't projecting, propagate isProjectionDirty. It will have\n * no performance impact but it will allow the next child that *is* projecting\n * but *isn't* dirty to just check its parent to see if *any* ancestor needs\n * correcting.\n */\n if (!node.isProjecting()) {\n node.isProjectionDirty = node.parent.isProjectionDirty;\n }\n /**\n * Propagate isSharedProjectionDirty and isTransformDirty\n * throughout the whole tree. A future revision can take another look at\n * this but for safety we still recalcualte shared nodes.\n */\n node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty ||\n node.parent.isProjectionDirty ||\n node.parent.isSharedProjectionDirty));\n node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty);\n}\nfunction cleanDirtyNodes(node) {\n node.isProjectionDirty =\n node.isSharedProjectionDirty =\n node.isTransformDirty =\n false;\n}\nfunction clearSnapshot(node) {\n node.clearSnapshot();\n}\nfunction clearMeasurements(node) {\n node.clearMeasurements();\n}\nfunction clearIsLayoutDirty(node) {\n node.isLayoutDirty = false;\n}\nfunction resetTransformStyle(node) {\n const { visualElement } = node.options;\n if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) {\n visualElement.notify(\"BeforeLayoutMeasure\");\n }\n node.resetTransform();\n}\nfunction finishAnimation(node) {\n node.finishAnimation();\n node.targetDelta = node.relativeTarget = node.target = undefined;\n node.isProjectionDirty = true;\n}\nfunction resolveTargetDelta(node) {\n node.resolveTargetDelta();\n}\nfunction calcProjection(node) {\n node.calcProjection();\n}\nfunction resetSkewAndRotation(node) {\n node.resetSkewAndRotation();\n}\nfunction removeLeadSnapshots(stack) {\n stack.removeLeadSnapshot();\n}\nfunction mixAxisDelta(output, delta, p) {\n output.translate = mixNumber(delta.translate, 0, p);\n output.scale = mixNumber(delta.scale, 1, p);\n output.origin = delta.origin;\n output.originPoint = delta.originPoint;\n}\nfunction mixAxis(output, from, to, p) {\n output.min = mixNumber(from.min, to.min, p);\n output.max = mixNumber(from.max, to.max, p);\n}\nfunction mixBox(output, from, to, p) {\n mixAxis(output.x, from.x, to.x, p);\n mixAxis(output.y, from.y, to.y, p);\n}\nfunction hasOpacityCrossfade(node) {\n return (node.animationValues && node.animationValues.opacityExit !== undefined);\n}\nconst defaultLayoutTransition = {\n duration: 0.45,\n ease: [0.4, 0, 0.1, 1],\n};\nconst userAgentContains = (string) => typeof navigator !== \"undefined\" &&\n navigator.userAgent &&\n navigator.userAgent.toLowerCase().includes(string);\n/**\n * Measured bounding boxes must be rounded in Safari and\n * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements\n * can appear to jump.\n */\nconst roundPoint = userAgentContains(\"applewebkit/\") && !userAgentContains(\"chrome/\")\n ? Math.round\n : noop;\nfunction roundAxis(axis) {\n // Round to the nearest .5 pixels to support subpixel layouts\n axis.min = roundPoint(axis.min);\n axis.max = roundPoint(axis.max);\n}\nfunction roundBox(box) {\n roundAxis(box.x);\n roundAxis(box.y);\n}\nfunction shouldAnimatePositionOnly(animationType, snapshot, layout) {\n return (animationType === \"position\" ||\n (animationType === \"preserve-aspect\" &&\n !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2)));\n}\nfunction checkNodeWasScrollRoot(node) {\n return node !== node.root && node.scroll?.wasRoot;\n}\n\nexport { cleanDirtyNodes, createProjectionNode, mixAxis, mixAxisDelta, mixBox, propagateDirtyNodes };\n","import { addDomEvent } from '../../events/add-dom-event.mjs';\nimport { createProjectionNode } from './create-projection-node.mjs';\n\nconst DocumentProjectionNode = createProjectionNode({\n attachResizeListener: (ref, notify) => addDomEvent(ref, \"resize\", notify),\n measureScroll: () => ({\n x: document.documentElement.scrollLeft || document.body.scrollLeft,\n y: document.documentElement.scrollTop || document.body.scrollTop,\n }),\n checkIsScrollRoot: () => true,\n});\n\nexport { DocumentProjectionNode };\n","import { createProjectionNode } from './create-projection-node.mjs';\nimport { DocumentProjectionNode } from './DocumentProjectionNode.mjs';\n\nconst rootProjectionNode = {\n current: undefined,\n};\nconst HTMLProjectionNode = createProjectionNode({\n measureScroll: (instance) => ({\n x: instance.scrollLeft,\n y: instance.scrollTop,\n }),\n defaultParent: () => {\n if (!rootProjectionNode.current) {\n const documentNode = new DocumentProjectionNode({});\n documentNode.mount(window);\n documentNode.setOptions({ layoutScroll: true });\n rootProjectionNode.current = documentNode;\n }\n return rootProjectionNode.current;\n },\n resetTransform: (instance, value) => {\n instance.style.transform = value !== undefined ? value : \"none\";\n },\n checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === \"fixed\"),\n});\n\nexport { HTMLProjectionNode, rootProjectionNode };\n","\"use client\";\nimport { createContext } from 'react';\n\n/**\n * @public\n */\nconst MotionConfigContext = createContext({\n transformPagePoint: (p) => p,\n isStatic: false,\n reducedMotion: \"never\",\n});\n\nexport { MotionConfigContext };\n//# sourceMappingURL=MotionConfigContext.mjs.map\n","import * as React from 'react';\n\n/**\n * Taken from https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx\n */\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n }\n else if (ref !== null && ref !== undefined) {\n ref.current = value;\n }\n}\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */\nfunction composeRefs(...refs) {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup === \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n // React <19 will log an error to the console if a callback ref returns a\n // value. We don't use ref cleanups internally so this will only happen if a\n // user's ref callback returns a value, which we only expect if they are\n // using the cleanup functionality added in React 19.\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup === \"function\") {\n cleanup();\n }\n else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */\nfunction useComposedRefs(...refs) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return React.useCallback(composeRefs(...refs), refs);\n}\n\nexport { useComposedRefs };\n//# sourceMappingURL=use-composed-ref.mjs.map\n","\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { isHTMLElement } from 'motion-dom';\nimport * as React from 'react';\nimport { useId, useRef, useContext, useInsertionEffect } from 'react';\nimport { MotionConfigContext } from '../../context/MotionConfigContext.mjs';\nimport { useComposedRefs } from '../../utils/use-composed-ref.mjs';\n\n/**\n * Measurement functionality has to be within a separate component\n * to leverage snapshot lifecycle.\n */\nclass PopChildMeasure extends React.Component {\n getSnapshotBeforeUpdate(prevProps) {\n const element = this.props.childRef.current;\n if (element && prevProps.isPresent && !this.props.isPresent) {\n const parent = element.offsetParent;\n const parentWidth = isHTMLElement(parent)\n ? parent.offsetWidth || 0\n : 0;\n const size = this.props.sizeRef.current;\n size.height = element.offsetHeight || 0;\n size.width = element.offsetWidth || 0;\n size.top = element.offsetTop;\n size.left = element.offsetLeft;\n size.right = parentWidth - size.width - size.left;\n }\n return null;\n }\n /**\n * Required with getSnapshotBeforeUpdate to stop React complaining.\n */\n componentDidUpdate() { }\n render() {\n return this.props.children;\n }\n}\nfunction PopChild({ children, isPresent, anchorX, root }) {\n const id = useId();\n const ref = useRef(null);\n const size = useRef({\n width: 0,\n height: 0,\n top: 0,\n left: 0,\n right: 0,\n });\n const { nonce } = useContext(MotionConfigContext);\n /**\n * In React 19, refs are passed via props.ref instead of element.ref.\n * We check props.ref first (React 19) and fall back to element.ref (React 18).\n */\n const childRef = children.props?.ref ??\n children?.ref;\n const composedRef = useComposedRefs(ref, childRef);\n /**\n * We create and inject a style block so we can apply this explicit\n * sizing in a non-destructive manner by just deleting the style block.\n *\n * We can't apply size via render as the measurement happens\n * in getSnapshotBeforeUpdate (post-render), likewise if we apply the\n * styles directly on the DOM node, we might be overwriting\n * styles set via the style prop.\n */\n useInsertionEffect(() => {\n const { width, height, top, left, right } = size.current;\n if (isPresent || !ref.current || !width || !height)\n return;\n const x = anchorX === \"left\" ? `left: ${left}` : `right: ${right}`;\n ref.current.dataset.motionPopId = id;\n const style = document.createElement(\"style\");\n if (nonce)\n style.nonce = nonce;\n const parent = root ?? document.head;\n parent.appendChild(style);\n if (style.sheet) {\n style.sheet.insertRule(`\n [data-motion-pop-id=\"${id}\"] {\n position: absolute !important;\n width: ${width}px !important;\n height: ${height}px !important;\n ${x}px !important;\n top: ${top}px !important;\n }\n `);\n }\n return () => {\n if (parent.contains(style)) {\n parent.removeChild(style);\n }\n };\n }, [isPresent]);\n return (jsx(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, children: React.cloneElement(children, { ref: composedRef }) }));\n}\n\nexport { PopChild };\n//# sourceMappingURL=PopChild.mjs.map\n","\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { useId, useMemo } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { PopChild } from './PopChild.mjs';\n\nconst PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, anchorX, root }) => {\n const presenceChildren = useConstant(newChildrenMap);\n const id = useId();\n let isReusedContext = true;\n let context = useMemo(() => {\n isReusedContext = false;\n return {\n id,\n initial,\n isPresent,\n custom,\n onExitComplete: (childId) => {\n presenceChildren.set(childId, true);\n for (const isComplete of presenceChildren.values()) {\n if (!isComplete)\n return; // can stop searching when any is incomplete\n }\n onExitComplete && onExitComplete();\n },\n register: (childId) => {\n presenceChildren.set(childId, false);\n return () => presenceChildren.delete(childId);\n },\n };\n }, [isPresent, presenceChildren, onExitComplete]);\n /**\n * If the presence of a child affects the layout of the components around it,\n * we want to make a new context value to ensure they get re-rendered\n * so they can detect that layout change.\n */\n if (presenceAffectsLayout && isReusedContext) {\n context = { ...context };\n }\n useMemo(() => {\n presenceChildren.forEach((_, key) => presenceChildren.set(key, false));\n }, [isPresent]);\n /**\n * If there's no `motion` components to fire exit animations, we want to remove this\n * component immediately.\n */\n React.useEffect(() => {\n !isPresent &&\n !presenceChildren.size &&\n onExitComplete &&\n onExitComplete();\n }, [isPresent]);\n if (mode === \"popLayout\") {\n children = (jsx(PopChild, { isPresent: isPresent, anchorX: anchorX, root: root, children: children }));\n }\n return (jsx(PresenceContext.Provider, { value: context, children: children }));\n};\nfunction newChildrenMap() {\n return new Map();\n}\n\nexport { PresenceChild };\n//# sourceMappingURL=PresenceChild.mjs.map\n","\"use client\";\nimport { useContext, useId, useEffect, useCallback } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\n\n/**\n * When a component is the child of `AnimatePresence`, it can use `usePresence`\n * to access information about whether it's still present in the React tree.\n *\n * ```jsx\n * import { usePresence } from \"framer-motion\"\n *\n * export const Component = () => {\n * const [isPresent, safeToRemove] = usePresence()\n *\n * useEffect(() => {\n * !isPresent && setTimeout(safeToRemove, 1000)\n * }, [isPresent])\n *\n * return <div />\n * }\n * ```\n *\n * If `isPresent` is `false`, it means that a component has been removed the tree, but\n * `AnimatePresence` won't really remove it until `safeToRemove` has been called.\n *\n * @public\n */\nfunction usePresence(subscribe = true) {\n const context = useContext(PresenceContext);\n if (context === null)\n return [true, null];\n const { isPresent, onExitComplete, register } = context;\n // It's safe to call the following hooks conditionally (after an early return) because the context will always\n // either be null or non-null for the lifespan of the component.\n const id = useId();\n useEffect(() => {\n if (subscribe) {\n return register(id);\n }\n }, [subscribe]);\n const safeToRemove = useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]);\n return !isPresent && onExitComplete ? [false, safeToRemove] : [true];\n}\n/**\n * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.\n * There is no `safeToRemove` function.\n *\n * ```jsx\n * import { useIsPresent } from \"framer-motion\"\n *\n * export const Component = () => {\n * const isPresent = useIsPresent()\n *\n * useEffect(() => {\n * !isPresent && console.log(\"I've been removed!\")\n * }, [isPresent])\n *\n * return <div />\n * }\n * ```\n *\n * @public\n */\nfunction useIsPresent() {\n return isPresent(useContext(PresenceContext));\n}\nfunction isPresent(context) {\n return context === null ? true : context.isPresent;\n}\n\nexport { isPresent, useIsPresent, usePresence };\n//# sourceMappingURL=use-presence.mjs.map\n","import { Children, isValidElement } from 'react';\n\nconst getChildKey = (child) => child.key || \"\";\nfunction onlyElements(children) {\n const filtered = [];\n // We use forEach here instead of map as map mutates the component key by preprending `.$`\n Children.forEach(children, (child) => {\n if (isValidElement(child))\n filtered.push(child);\n });\n return filtered;\n}\n\nexport { getChildKey, onlyElements };\n//# sourceMappingURL=utils.mjs.map\n","\"use client\";\nimport { jsx, Fragment } from 'react/jsx-runtime';\nimport { useMemo, useRef, useState, useContext } from 'react';\nimport { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\nimport { PresenceChild } from './PresenceChild.mjs';\nimport { usePresence } from './use-presence.mjs';\nimport { onlyElements, getChildKey } from './utils.mjs';\n\n/**\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\n *\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\n *\n * Any `motion` components that have an `exit` property defined will animate out when removed from\n * the tree.\n *\n * ```jsx\n * import { motion, AnimatePresence } from 'framer-motion'\n *\n * export const Items = ({ items }) => (\n * <AnimatePresence>\n * {items.map(item => (\n * <motion.div\n * key={item.id}\n * initial={{ opacity: 0 }}\n * animate={{ opacity: 1 }}\n * exit={{ opacity: 0 }}\n * />\n * ))}\n * </AnimatePresence>\n * )\n * ```\n *\n * You can sequence exit animations throughout a tree using variants.\n *\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\n * once all `motion` components have finished animating out. Likewise, any components using\n * `usePresence` all need to call `safeToRemove`.\n *\n * @public\n */\nconst AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = \"sync\", propagate = false, anchorX = \"left\", root }) => {\n const [isParentPresent, safeToRemove] = usePresence(propagate);\n /**\n * Filter any children that aren't ReactElements. We can only track components\n * between renders with a props.key.\n */\n const presentChildren = useMemo(() => onlyElements(children), [children]);\n /**\n * Track the keys of the currently rendered children. This is used to\n * determine which children are exiting.\n */\n const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey);\n /**\n * If `initial={false}` we only want to pass this to components in the first render.\n */\n const isInitialRender = useRef(true);\n /**\n * A ref containing the currently present children. When all exit animations\n * are complete, we use this to re-render the component with the latest children\n * *committed* rather than the latest children *rendered*.\n */\n const pendingPresentChildren = useRef(presentChildren);\n /**\n * Track which exiting children have finished animating out.\n */\n const exitComplete = useConstant(() => new Map());\n /**\n * Track which components are currently processing exit to prevent duplicate processing.\n */\n const exitingComponents = useRef(new Set());\n /**\n * Save children to render as React state. To ensure this component is concurrent-safe,\n * we check for exiting children via an effect.\n */\n const [diffedChildren, setDiffedChildren] = useState(presentChildren);\n const [renderedChildren, setRenderedChildren] = useState(presentChildren);\n useIsomorphicLayoutEffect(() => {\n isInitialRender.current = false;\n pendingPresentChildren.current = presentChildren;\n /**\n * Update complete status of exiting children.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const key = getChildKey(renderedChildren[i]);\n if (!presentKeys.includes(key)) {\n if (exitComplete.get(key) !== true) {\n exitComplete.set(key, false);\n }\n }\n else {\n exitComplete.delete(key);\n exitingComponents.current.delete(key);\n }\n }\n }, [renderedChildren, presentKeys.length, presentKeys.join(\"-\")]);\n const exitingChildren = [];\n if (presentChildren !== diffedChildren) {\n let nextChildren = [...presentChildren];\n /**\n * Loop through all the currently rendered components and decide which\n * are exiting.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const child = renderedChildren[i];\n const key = getChildKey(child);\n if (!presentKeys.includes(key)) {\n nextChildren.splice(i, 0, child);\n exitingChildren.push(child);\n }\n }\n /**\n * If we're in \"wait\" mode, and we have exiting children, we want to\n * only render these until they've all exited.\n */\n if (mode === \"wait\" && exitingChildren.length) {\n nextChildren = exitingChildren;\n }\n setRenderedChildren(onlyElements(nextChildren));\n setDiffedChildren(presentChildren);\n /**\n * Early return to ensure once we've set state with the latest diffed\n * children, we can immediately re-render.\n */\n return null;\n }\n if (process.env.NODE_ENV !== \"production\" &&\n mode === \"wait\" &&\n renderedChildren.length > 1) {\n console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.`);\n }\n /**\n * If we've been provided a forceRender function by the LayoutGroupContext,\n * we can use it to force a re-render amongst all surrounding components once\n * all components have finished animating out.\n */\n const { forceRender } = useContext(LayoutGroupContext);\n return (jsx(Fragment, { children: renderedChildren.map((child) => {\n const key = getChildKey(child);\n const isPresent = propagate && !isParentPresent\n ? false\n : presentChildren === renderedChildren ||\n presentKeys.includes(key);\n const onExit = () => {\n if (exitingComponents.current.has(key)) {\n return;\n }\n exitingComponents.current.add(key);\n if (exitComplete.has(key)) {\n exitComplete.set(key, true);\n }\n else {\n return;\n }\n let isEveryExitComplete = true;\n exitComplete.forEach((isExitComplete) => {\n if (!isExitComplete)\n isEveryExitComplete = false;\n });\n if (isEveryExitComplete) {\n forceRender?.();\n setRenderedChildren(pendingPresentChildren.current);\n propagate && safeToRemove?.();\n onExitComplete && onExitComplete();\n }\n };\n return (jsx(PresenceChild, { isPresent: isPresent, initial: !isInitialRender.current || initial\n ? undefined\n : false, custom: custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode, root: root, onExitComplete: isPresent ? undefined : onExit, anchorX: anchorX, children: child }, key));\n }) }));\n};\n\nexport { AnimatePresence };\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\nimport { createContext } from 'react';\n\nconst LazyContext = createContext({ strict: false });\n\nexport { LazyContext };\n//# sourceMappingURL=LazyContext.mjs.map\n","import { getFeatureDefinitions, setFeatureDefinitions } from 'motion-dom';\n\nconst featureProps = {\n animation: [\n \"animate\",\n \"variants\",\n \"whileHover\",\n \"whileTap\",\n \"exit\",\n \"whileInView\",\n \"whileFocus\",\n \"whileDrag\",\n ],\n exit: [\"exit\"],\n drag: [\"drag\", \"dragControls\"],\n focus: [\"whileFocus\"],\n hover: [\"whileHover\", \"onHoverStart\", \"onHoverEnd\"],\n tap: [\"whileTap\", \"onTap\", \"onTapStart\", \"onTapCancel\"],\n pan: [\"onPan\", \"onPanStart\", \"onPanSessionStart\", \"onPanEnd\"],\n inView: [\"whileInView\", \"onViewportEnter\", \"onViewportLeave\"],\n layout: [\"layout\", \"layoutId\"],\n};\nlet isInitialized = false;\n/**\n * Initialize feature definitions with isEnabled checks.\n * This must be called before any motion components are rendered.\n */\nfunction initFeatureDefinitions() {\n if (isInitialized)\n return;\n const initialFeatureDefinitions = {};\n for (const key in featureProps) {\n initialFeatureDefinitions[key] = {\n isEnabled: (props) => featureProps[key].some((name) => !!props[name]),\n };\n }\n setFeatureDefinitions(initialFeatureDefinitions);\n isInitialized = true;\n}\n/**\n * Get the current feature definitions, initializing if needed.\n */\nfunction getInitializedFeatureDefinitions() {\n initFeatureDefinitions();\n return getFeatureDefinitions();\n}\n\nexport { getInitializedFeatureDefinitions, initFeatureDefinitions };\n//# sourceMappingURL=definitions.mjs.map\n","import { setFeatureDefinitions } from 'motion-dom';\nimport { getInitializedFeatureDefinitions } from './definitions.mjs';\n\nfunction loadFeatures(features) {\n const featureDefinitions = getInitializedFeatureDefinitions();\n for (const key in features) {\n featureDefinitions[key] = {\n ...featureDefinitions[key],\n ...features[key],\n };\n }\n setFeatureDefinitions(featureDefinitions);\n}\n\nexport { loadFeatures };\n//# sourceMappingURL=load-features.mjs.map\n","/**\n * A list of all valid MotionProps.\n *\n * @privateRemarks\n * This doesn't throw if a `MotionProp` name is missing - it should.\n */\nconst validMotionProps = new Set([\n \"animate\",\n \"exit\",\n \"variants\",\n \"initial\",\n \"style\",\n \"values\",\n \"variants\",\n \"transition\",\n \"transformTemplate\",\n \"custom\",\n \"inherit\",\n \"onBeforeLayoutMeasure\",\n \"onAnimationStart\",\n \"onAnimationComplete\",\n \"onUpdate\",\n \"onDragStart\",\n \"onDrag\",\n \"onDragEnd\",\n \"onMeasureDragConstraints\",\n \"onDirectionLock\",\n \"onDragTransitionEnd\",\n \"_dragX\",\n \"_dragY\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onViewportEnter\",\n \"onViewportLeave\",\n \"globalTapTarget\",\n \"ignoreStrict\",\n \"viewport\",\n]);\n/**\n * Check whether a prop name is a valid `MotionProp` key.\n *\n * @param key - Name of the property to check\n * @returns `true` is key is a valid `MotionProp`.\n *\n * @public\n */\nfunction isValidMotionProp(key) {\n return (key.startsWith(\"while\") ||\n (key.startsWith(\"drag\") && key !== \"draggable\") ||\n key.startsWith(\"layout\") ||\n key.startsWith(\"onTap\") ||\n key.startsWith(\"onPan\") ||\n key.startsWith(\"onLayout\") ||\n validMotionProps.has(key));\n}\n\nexport { isValidMotionProp };\n//# sourceMappingURL=valid-prop.mjs.map\n","import { isValidMotionProp } from '../../../motion/utils/valid-prop.mjs';\n\nlet shouldForward = (key) => !isValidMotionProp(key);\nfunction loadExternalIsValidProp(isValidProp) {\n if (typeof isValidProp !== \"function\")\n return;\n // Explicitly filter our events\n shouldForward = (key) => key.startsWith(\"on\") ? !isValidMotionProp(key) : isValidProp(key);\n}\n/**\n * Emotion and Styled Components both allow users to pass through arbitrary props to their components\n * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which\n * of these should be passed to the underlying DOM node.\n *\n * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props\n * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props\n * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of\n * `@emotion/is-prop-valid`, however to fix this problem we need to use it.\n *\n * By making it an optionalDependency we can offer this functionality only in the situations where it's\n * actually required.\n */\ntry {\n /**\n * We attempt to import this package but require won't be defined in esm environments, in that case\n * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed\n * in favour of explicit injection.\n */\n loadExternalIsValidProp(require(\"@emotion/is-prop-valid\").default);\n}\ncatch {\n // We don't need to actually do anything here - the fallback is the existing `isPropValid`.\n}\nfunction filterProps(props, isDom, forwardMotionProps) {\n const filteredProps = {};\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\")\n continue;\n if (shouldForward(key) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\"] &&\n key.startsWith(\"onDrag\"))) {\n filteredProps[key] =\n props[key];\n }\n }\n return filteredProps;\n}\n\nexport { filterProps, loadExternalIsValidProp };\n//# sourceMappingURL=filter-props.mjs.map\n","\"use client\";\nimport { createContext } from 'react';\n\nconst MotionContext = /* @__PURE__ */ createContext({});\n\nexport { MotionContext };\n//# sourceMappingURL=index.mjs.map\n","import { isControllingVariants, isVariantLabel } from 'motion-dom';\n\nfunction getCurrentTreeVariants(props, context) {\n if (isControllingVariants(props)) {\n const { initial, animate } = props;\n return {\n initial: initial === false || isVariantLabel(initial)\n ? initial\n : undefined,\n animate: isVariantLabel(animate) ? animate : undefined,\n };\n }\n return props.inherit !== false ? context : {};\n}\n\nexport { getCurrentTreeVariants };\n//# sourceMappingURL=utils.mjs.map\n","\"use client\";\nimport { useContext, useMemo } from 'react';\nimport { MotionContext } from './index.mjs';\nimport { getCurrentTreeVariants } from './utils.mjs';\n\nfunction useCreateMotionContext(props) {\n const { initial, animate } = getCurrentTreeVariants(props, useContext(MotionContext));\n return useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]);\n}\nfunction variantLabelsAsDependency(prop) {\n return Array.isArray(prop) ? prop.join(\" \") : prop;\n}\n\nexport { useCreateMotionContext };\n//# sourceMappingURL=create.mjs.map\n","const createHtmlRenderState = () => ({\n style: {},\n transform: {},\n transformOrigin: {},\n vars: {},\n});\n\nexport { createHtmlRenderState };\n//# sourceMappingURL=create-render-state.mjs.map\n","\"use client\";\nimport { isMotionValue, isForcedMotionValue, buildHTMLStyles } from 'motion-dom';\nimport { useMemo } from 'react';\nimport { createHtmlRenderState } from './utils/create-render-state.mjs';\n\nfunction copyRawValuesOnly(target, source, props) {\n for (const key in source) {\n if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {\n target[key] = source[key];\n }\n }\n}\nfunction useInitialMotionValues({ transformTemplate }, visualState) {\n return useMemo(() => {\n const state = createHtmlRenderState();\n buildHTMLStyles(state, visualState, transformTemplate);\n return Object.assign({}, state.vars, state.style);\n }, [visualState]);\n}\nfunction useStyle(props, visualState) {\n const styleProp = props.style || {};\n const style = {};\n /**\n * Copy non-Motion Values straight into style\n */\n copyRawValuesOnly(style, styleProp, props);\n Object.assign(style, useInitialMotionValues(props, visualState));\n return style;\n}\nfunction useHTMLProps(props, visualState) {\n // The `any` isn't ideal but it is the type of createElement props argument\n const htmlProps = {};\n const style = useStyle(props, visualState);\n if (props.drag && props.dragListener !== false) {\n // Disable the ghost element when a user drags\n htmlProps.draggable = false;\n // Disable text selection\n style.userSelect =\n style.WebkitUserSelect =\n style.WebkitTouchCallout =\n \"none\";\n // Disable scrolling on the draggable direction\n style.touchAction =\n props.drag === true\n ? \"none\"\n : `pan-${props.drag === \"x\" ? \"y\" : \"x\"}`;\n }\n if (props.tabIndex === undefined &&\n (props.onTap || props.onTapStart || props.whileTap)) {\n htmlProps.tabIndex = 0;\n }\n htmlProps.style = style;\n return htmlProps;\n}\n\nexport { copyRawValuesOnly, useHTMLProps };\n//# sourceMappingURL=use-props.mjs.map\n","import { createHtmlRenderState } from '../../html/utils/create-render-state.mjs';\n\nconst createSvgRenderState = () => ({\n ...createHtmlRenderState(),\n attrs: {},\n});\n\nexport { createSvgRenderState };\n//# sourceMappingURL=create-render-state.mjs.map\n","\"use client\";\nimport { buildSVGAttrs, isSVGTag } from 'motion-dom';\nimport { useMemo } from 'react';\nimport { copyRawValuesOnly } from '../html/use-props.mjs';\nimport { createSvgRenderState } from './utils/create-render-state.mjs';\n\nfunction useSVGProps(props, visualState, _isStatic, Component) {\n const visualProps = useMemo(() => {\n const state = createSvgRenderState();\n buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate, props.style);\n return {\n ...state.attrs,\n style: { ...state.style },\n };\n }, [visualState]);\n if (props.style) {\n const rawStyles = {};\n copyRawValuesOnly(rawStyles, props.style, props);\n visualProps.style = { ...rawStyles, ...visualProps.style };\n }\n return visualProps;\n}\n\nexport { useSVGProps };\n//# sourceMappingURL=use-props.mjs.map\n","/**\n * We keep these listed separately as we use the lowercase tag names as part\n * of the runtime bundle to detect SVG components\n */\nconst lowercaseSVGElements = [\n \"animate\",\n \"circle\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"g\",\n \"image\",\n \"line\",\n \"filter\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"rect\",\n \"stop\",\n \"switch\",\n \"symbol\",\n \"svg\",\n \"text\",\n \"tspan\",\n \"use\",\n \"view\",\n];\n\nexport { lowercaseSVGElements };\n//# sourceMappingURL=lowercase-elements.mjs.map\n","import { lowercaseSVGElements } from '../../svg/lowercase-elements.mjs';\n\nfunction isSVGComponent(Component) {\n if (\n /**\n * If it's not a string, it's a custom React component. Currently we only support\n * HTML custom React components.\n */\n typeof Component !== \"string\" ||\n /**\n * If it contains a dash, the element is a custom HTML webcomponent.\n */\n Component.includes(\"-\")) {\n return false;\n }\n else if (\n /**\n * If it's in our list of lowercase SVG tags, it's an SVG component\n */\n lowercaseSVGElements.indexOf(Component) > -1 ||\n /**\n * If it contains a capital letter, it's an SVG component\n */\n /[A-Z]/u.test(Component)) {\n return true;\n }\n return false;\n}\n\nexport { isSVGComponent };\n//# sourceMappingURL=is-svg-component.mjs.map\n","\"use client\";\nimport { isMotionValue } from 'motion-dom';\nimport { Fragment, useMemo, createElement } from 'react';\nimport { useHTMLProps } from '../html/use-props.mjs';\nimport { useSVGProps } from '../svg/use-props.mjs';\nimport { filterProps } from './utils/filter-props.mjs';\nimport { isSVGComponent } from './utils/is-svg-component.mjs';\n\nfunction useRender(Component, props, ref, { latestValues, }, isStatic, forwardMotionProps = false, isSVG) {\n const useVisualProps = (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps;\n const visualProps = useVisualProps(props, latestValues, isStatic, Component);\n const filteredProps = filterProps(props, typeof Component === \"string\", forwardMotionProps);\n const elementProps = Component !== Fragment ? { ...filteredProps, ...visualProps, ref } : {};\n /**\n * If component has been handed a motion value as its child,\n * memoise its initial value and render that. Subsequent updates\n * will be handled by the onChange handler\n */\n const { children } = props;\n const renderedChildren = useMemo(() => (isMotionValue(children) ? children.get() : children), [children]);\n return createElement(Component, {\n ...elementProps,\n children: renderedChildren,\n });\n}\n\nexport { useRender };\n//# sourceMappingURL=use-render.mjs.map\n","\"use client\";\nimport { resolveMotionValue, isControllingVariants, isVariantNode, isAnimationControls, resolveVariantFromProps } from 'motion-dom';\nimport { useContext } from 'react';\nimport { MotionContext } from '../../context/MotionContext/index.mjs';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\n\nfunction makeState({ scrapeMotionValuesFromProps, createRenderState, }, props, context, presenceContext) {\n const state = {\n latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps),\n renderState: createRenderState(),\n };\n return state;\n}\nfunction makeLatestValues(props, context, presenceContext, scrapeMotionValues) {\n const values = {};\n const motionValues = scrapeMotionValues(props, {});\n for (const key in motionValues) {\n values[key] = resolveMotionValue(motionValues[key]);\n }\n let { initial, animate } = props;\n const isControllingVariants$1 = isControllingVariants(props);\n const isVariantNode$1 = isVariantNode(props);\n if (context &&\n isVariantNode$1 &&\n !isControllingVariants$1 &&\n props.inherit !== false) {\n if (initial === undefined)\n initial = context.initial;\n if (animate === undefined)\n animate = context.animate;\n }\n let isInitialAnimationBlocked = presenceContext\n ? presenceContext.initial === false\n : false;\n isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false;\n const variantToSet = isInitialAnimationBlocked ? animate : initial;\n if (variantToSet &&\n typeof variantToSet !== \"boolean\" &&\n !isAnimationControls(variantToSet)) {\n const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet];\n for (let i = 0; i < list.length; i++) {\n const resolved = resolveVariantFromProps(props, list[i]);\n if (resolved) {\n const { transitionEnd, transition, ...target } = resolved;\n for (const key in target) {\n let valueTarget = target[key];\n if (Array.isArray(valueTarget)) {\n /**\n * Take final keyframe if the initial animation is blocked because\n * we want to initialise at the end of that blocked animation.\n */\n const index = isInitialAnimationBlocked\n ? valueTarget.length - 1\n : 0;\n valueTarget = valueTarget[index];\n }\n if (valueTarget !== null) {\n values[key] = valueTarget;\n }\n }\n for (const key in transitionEnd) {\n values[key] = transitionEnd[key];\n }\n }\n }\n }\n return values;\n}\nconst makeUseVisualState = (config) => (props, isStatic) => {\n const context = useContext(MotionContext);\n const presenceContext = useContext(PresenceContext);\n const make = () => makeState(config, props, context, presenceContext);\n return isStatic ? make() : useConstant(make);\n};\n\nexport { makeUseVisualState };\n//# sourceMappingURL=use-visual-state.mjs.map\n","\"use client\";\nimport { scrapeHTMLMotionValuesFromProps } from 'motion-dom';\nimport { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs';\nimport { createHtmlRenderState } from './utils/create-render-state.mjs';\n\nconst useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeHTMLMotionValuesFromProps,\n createRenderState: createHtmlRenderState,\n});\n\nexport { useHTMLVisualState };\n//# sourceMappingURL=use-html-visual-state.mjs.map\n","\"use client\";\nimport { scrapeSVGMotionValuesFromProps } from 'motion-dom';\nimport { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs';\nimport { createSvgRenderState } from './utils/create-render-state.mjs';\n\nconst useSVGVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeSVGMotionValuesFromProps,\n createRenderState: createSvgRenderState,\n});\n\nexport { useSVGVisualState };\n//# sourceMappingURL=use-svg-visual-state.mjs.map\n","const motionComponentSymbol = Symbol.for(\"motionComponentSymbol\");\n\nexport { motionComponentSymbol };\n//# sourceMappingURL=symbol.mjs.map\n","\"use client\";\nimport { useRef, useInsertionEffect, useCallback } from 'react';\n\n/**\n * Creates a ref function that, when called, hydrates the provided\n * external ref and VisualElement.\n */\nfunction useMotionRef(visualState, visualElement, externalRef) {\n /**\n * Store externalRef in a ref to avoid including it in the useCallback\n * dependency array. Including externalRef in dependencies causes issues\n * with libraries like Radix UI that create new callback refs on each render\n * when using asChild - this would cause the callback to be recreated,\n * triggering element remounts and breaking AnimatePresence exit animations.\n */\n const externalRefContainer = useRef(externalRef);\n useInsertionEffect(() => {\n externalRefContainer.current = externalRef;\n });\n // Store cleanup function returned by callback refs (React 19 feature)\n const refCleanup = useRef(null);\n return useCallback((instance) => {\n if (instance) {\n visualState.onMount?.(instance);\n }\n if (visualElement) {\n instance ? visualElement.mount(instance) : visualElement.unmount();\n }\n const ref = externalRefContainer.current;\n if (typeof ref === \"function\") {\n if (instance) {\n const cleanup = ref(instance);\n if (typeof cleanup === \"function\") {\n refCleanup.current = cleanup;\n }\n }\n else if (refCleanup.current) {\n refCleanup.current();\n refCleanup.current = null;\n }\n else {\n ref(instance);\n }\n }\n else if (ref) {\n ref.current = instance;\n }\n }, [visualElement]);\n}\n\nexport { useMotionRef };\n//# sourceMappingURL=use-motion-ref.mjs.map\n","\"use client\";\nimport { createContext } from 'react';\n\n/**\n * Internal, exported only for usage in Framer\n */\nconst SwitchLayoutGroupContext = createContext({});\n\nexport { SwitchLayoutGroupContext };\n//# sourceMappingURL=SwitchLayoutGroupContext.mjs.map\n","function isRefObject(ref) {\n return (ref &&\n typeof ref === \"object\" &&\n Object.prototype.hasOwnProperty.call(ref, \"current\"));\n}\n\nexport { isRefObject };\n//# sourceMappingURL=is-ref-object.mjs.map\n","\"use client\";\nimport { optimizedAppearDataAttribute } from 'motion-dom';\nimport { useContext, useRef, useInsertionEffect, useEffect } from 'react';\nimport { LazyContext } from '../../context/LazyContext.mjs';\nimport { MotionConfigContext } from '../../context/MotionConfigContext.mjs';\nimport { MotionContext } from '../../context/MotionContext/index.mjs';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { SwitchLayoutGroupContext } from '../../context/SwitchLayoutGroupContext.mjs';\nimport { isRefObject } from '../../utils/is-ref-object.mjs';\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\n\nfunction useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) {\n const { visualElement: parent } = useContext(MotionContext);\n const lazyContext = useContext(LazyContext);\n const presenceContext = useContext(PresenceContext);\n const reducedMotionConfig = useContext(MotionConfigContext).reducedMotion;\n const visualElementRef = useRef(null);\n /**\n * If we haven't preloaded a renderer, check to see if we have one lazy-loaded\n */\n createVisualElement =\n createVisualElement ||\n lazyContext.renderer;\n if (!visualElementRef.current && createVisualElement) {\n visualElementRef.current = createVisualElement(Component, {\n visualState,\n parent,\n props,\n presenceContext,\n blockInitialAnimation: presenceContext\n ? presenceContext.initial === false\n : false,\n reducedMotionConfig,\n isSVG,\n });\n }\n const visualElement = visualElementRef.current;\n /**\n * Load Motion gesture and animation features. These are rendered as renderless\n * components so each feature can optionally make use of React lifecycle methods.\n */\n const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext);\n if (visualElement &&\n !visualElement.projection &&\n ProjectionNodeConstructor &&\n (visualElement.type === \"html\" || visualElement.type === \"svg\")) {\n createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig);\n }\n const isMounted = useRef(false);\n useInsertionEffect(() => {\n /**\n * Check the component has already mounted before calling\n * `update` unnecessarily. This ensures we skip the initial update.\n */\n if (visualElement && isMounted.current) {\n visualElement.update(props, presenceContext);\n }\n });\n /**\n * Cache this value as we want to know whether HandoffAppearAnimations\n * was present on initial render - it will be deleted after this.\n */\n const optimisedAppearId = props[optimizedAppearDataAttribute];\n const wantsHandoff = useRef(Boolean(optimisedAppearId) &&\n !window.MotionHandoffIsComplete?.(optimisedAppearId) &&\n window.MotionHasOptimisedAnimation?.(optimisedAppearId));\n useIsomorphicLayoutEffect(() => {\n if (!visualElement)\n return;\n isMounted.current = true;\n window.MotionIsMounted = true;\n visualElement.updateFeatures();\n visualElement.scheduleRenderMicrotask();\n /**\n * Ideally this function would always run in a useEffect.\n *\n * However, if we have optimised appear animations to handoff from,\n * it needs to happen synchronously to ensure there's no flash of\n * incorrect styles in the event of a hydration error.\n *\n * So if we detect a situtation where optimised appear animations\n * are running, we use useLayoutEffect to trigger animations.\n */\n if (wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n });\n useEffect(() => {\n if (!visualElement)\n return;\n if (!wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n if (wantsHandoff.current) {\n // This ensures all future calls to animateChanges() in this component will run in useEffect\n queueMicrotask(() => {\n window.MotionHandoffMarkAsComplete?.(optimisedAppearId);\n });\n wantsHandoff.current = false;\n }\n /**\n * Now we've finished triggering animations for this element we\n * can wipe the enteringChildren set for the next render.\n */\n visualElement.enteringChildren = undefined;\n });\n return visualElement;\n}\nfunction createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {\n const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutCrossfade, } = props;\n visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props[\"data-framer-portal-id\"]\n ? undefined\n : getClosestProjectingNode(visualElement.parent));\n visualElement.projection.setOptions({\n layoutId,\n layout,\n alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),\n visualElement,\n /**\n * TODO: Update options in an effect. This could be tricky as it'll be too late\n * to update by the time layout animations run.\n * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,\n * ensuring it gets called if there's no potential layout animations.\n *\n */\n animationType: typeof layout === \"string\" ? layout : \"both\",\n initialPromotionConfig,\n crossfade: layoutCrossfade,\n layoutScroll,\n layoutRoot,\n });\n}\nfunction getClosestProjectingNode(visualElement) {\n if (!visualElement)\n return undefined;\n return visualElement.options.allowProjection !== false\n ? visualElement.projection\n : getClosestProjectingNode(visualElement.parent);\n}\n\nexport { useVisualElement };\n//# sourceMappingURL=use-visual-element.mjs.map\n","\"use client\";\nimport { jsxs, jsx } from 'react/jsx-runtime';\nimport { warning, invariant } from 'motion-utils';\nimport { forwardRef, useContext } from 'react';\nimport { LayoutGroupContext } from '../context/LayoutGroupContext.mjs';\nimport { LazyContext } from '../context/LazyContext.mjs';\nimport { MotionConfigContext } from '../context/MotionConfigContext.mjs';\nimport { MotionContext } from '../context/MotionContext/index.mjs';\nimport { useCreateMotionContext } from '../context/MotionContext/create.mjs';\nimport { useRender } from '../render/dom/use-render.mjs';\nimport { isSVGComponent } from '../render/dom/utils/is-svg-component.mjs';\nimport { useHTMLVisualState } from '../render/html/use-html-visual-state.mjs';\nimport { useSVGVisualState } from '../render/svg/use-svg-visual-state.mjs';\nimport { isBrowser } from '../utils/is-browser.mjs';\nimport { getInitializedFeatureDefinitions } from './features/definitions.mjs';\nimport { loadFeatures } from './features/load-features.mjs';\nimport { motionComponentSymbol } from './utils/symbol.mjs';\nimport { useMotionRef } from './utils/use-motion-ref.mjs';\nimport { useVisualElement } from './utils/use-visual-element.mjs';\n\n/**\n * Create a `motion` component.\n *\n * This function accepts a Component argument, which can be either a string (ie \"div\"\n * for `motion.div`), or an actual React component.\n *\n * Alongside this is a config option which provides a way of rendering the provided\n * component \"offline\", or outside the React render cycle.\n */\nfunction createMotionComponent(Component, { forwardMotionProps = false, type } = {}, preloadedFeatures, createVisualElement) {\n preloadedFeatures && loadFeatures(preloadedFeatures);\n /**\n * Determine whether to use SVG or HTML rendering based on:\n * 1. Explicit `type` option (highest priority)\n * 2. Auto-detection via `isSVGComponent`\n */\n const isSVG = type ? type === \"svg\" : isSVGComponent(Component);\n const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState;\n function MotionDOMComponent(props, externalRef) {\n /**\n * If we need to measure the element we load this functionality in a\n * separate class component in order to gain access to getSnapshotBeforeUpdate.\n */\n let MeasureLayout;\n const configAndProps = {\n ...useContext(MotionConfigContext),\n ...props,\n layoutId: useLayoutId(props),\n };\n const { isStatic } = configAndProps;\n const context = useCreateMotionContext(props);\n const visualState = useVisualState(props, isStatic);\n if (!isStatic && isBrowser) {\n useStrictMode(configAndProps, preloadedFeatures);\n const layoutProjection = getProjectionFunctionality(configAndProps);\n MeasureLayout = layoutProjection.MeasureLayout;\n /**\n * Create a VisualElement for this component. A VisualElement provides a common\n * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as\n * providing a way of rendering to these APIs outside of the React render loop\n * for more performant animations and interactions\n */\n context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG);\n }\n /**\n * The mount order and hierarchy is specific to ensure our element ref\n * is hydrated by the time features fire their effects.\n */\n return (jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG)] }));\n }\n MotionDOMComponent.displayName = `motion.${typeof Component === \"string\"\n ? Component\n : `create(${Component.displayName ?? Component.name ?? \"\"})`}`;\n const ForwardRefMotionComponent = forwardRef(MotionDOMComponent);\n ForwardRefMotionComponent[motionComponentSymbol] = Component;\n return ForwardRefMotionComponent;\n}\nfunction useLayoutId({ layoutId }) {\n const layoutGroupId = useContext(LayoutGroupContext).id;\n return layoutGroupId && layoutId !== undefined\n ? layoutGroupId + \"-\" + layoutId\n : layoutId;\n}\nfunction useStrictMode(configAndProps, preloadedFeatures) {\n const isStrict = useContext(LazyContext).strict;\n /**\n * If we're in development mode, check to make sure we're not rendering a motion component\n * as a child of LazyMotion, as this will break the file-size benefits of using it.\n */\n if (process.env.NODE_ENV !== \"production\" &&\n preloadedFeatures &&\n isStrict) {\n const strictMessage = \"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.\";\n configAndProps.ignoreStrict\n ? warning(false, strictMessage, \"lazy-strict-mode\")\n : invariant(false, strictMessage, \"lazy-strict-mode\");\n }\n}\nfunction getProjectionFunctionality(props) {\n const featureDefinitions = getInitializedFeatureDefinitions();\n const { drag, layout } = featureDefinitions;\n if (!drag && !layout)\n return {};\n const combined = { ...drag, ...layout };\n return {\n MeasureLayout: drag?.isEnabled(props) || layout?.isEnabled(props)\n ? combined.MeasureLayout\n : undefined,\n ProjectionNode: combined.ProjectionNode,\n };\n}\n\nexport { createMotionComponent };\n//# sourceMappingURL=index.mjs.map\n","import { warnOnce } from 'motion-utils';\nimport { createMotionComponent } from '../../motion/index.mjs';\n\nfunction createMotionProxy(preloadedFeatures, createVisualElement) {\n if (typeof Proxy === \"undefined\") {\n return createMotionComponent;\n }\n /**\n * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc.\n * Rather than generating them anew every render.\n */\n const componentCache = new Map();\n const factory = (Component, options) => {\n return createMotionComponent(Component, options, preloadedFeatures, createVisualElement);\n };\n /**\n * Support for deprecated`motion(Component)` pattern\n */\n const deprecatedFactoryFunction = (Component, options) => {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, \"motion() is deprecated. Use motion.create() instead.\");\n }\n return factory(Component, options);\n };\n return new Proxy(deprecatedFactoryFunction, {\n /**\n * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.\n * The prop name is passed through as `key` and we can use that to generate a `motion`\n * DOM component with that name.\n */\n get: (_target, key) => {\n if (key === \"create\")\n return factory;\n /**\n * If this element doesn't exist in the component cache, create it and cache.\n */\n if (!componentCache.has(key)) {\n componentCache.set(key, createMotionComponent(key, undefined, preloadedFeatures, createVisualElement));\n }\n return componentCache.get(key);\n },\n });\n}\n\nexport { createMotionProxy };\n//# sourceMappingURL=create-proxy.mjs.map\n","import { SVGVisualElement, HTMLVisualElement } from 'motion-dom';\nimport { Fragment } from 'react';\nimport { isSVGComponent } from './utils/is-svg-component.mjs';\n\nconst createDomVisualElement = (Component, options) => {\n /**\n * Use explicit isSVG override if provided, otherwise auto-detect\n */\n const isSVG = options.isSVG ?? isSVGComponent(Component);\n return isSVG\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options, {\n allowProjection: Component !== Fragment,\n });\n};\n\nexport { createDomVisualElement };\n//# sourceMappingURL=create-visual-element.mjs.map\n","import { Feature, createAnimationState, isAnimationControls } from 'motion-dom';\n\nclass AnimationFeature extends Feature {\n /**\n * We dynamically generate the AnimationState manager as it contains a reference\n * to the underlying animation library. We only want to load that if we load this,\n * so people can optionally code split it out using the `m` component.\n */\n constructor(node) {\n super(node);\n node.animationState || (node.animationState = createAnimationState(node));\n }\n updateAnimationControlsSubscription() {\n const { animate } = this.node.getProps();\n if (isAnimationControls(animate)) {\n this.unmountControls = animate.subscribe(this.node);\n }\n }\n /**\n * Subscribe any provided AnimationControls to the component's VisualElement\n */\n mount() {\n this.updateAnimationControlsSubscription();\n }\n update() {\n const { animate } = this.node.getProps();\n const { animate: prevAnimate } = this.node.prevProps || {};\n if (animate !== prevAnimate) {\n this.updateAnimationControlsSubscription();\n }\n }\n unmount() {\n this.node.animationState.reset();\n this.unmountControls?.();\n }\n}\n\nexport { AnimationFeature };\n//# sourceMappingURL=index.mjs.map\n","import { Feature } from 'motion-dom';\n\nlet id = 0;\nclass ExitAnimationFeature extends Feature {\n constructor() {\n super(...arguments);\n this.id = id++;\n }\n update() {\n if (!this.node.presenceContext)\n return;\n const { isPresent, onExitComplete } = this.node.presenceContext;\n const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {};\n if (!this.node.animationState || isPresent === prevIsPresent) {\n return;\n }\n const exitAnimation = this.node.animationState.setActive(\"exit\", !isPresent);\n if (onExitComplete && !isPresent) {\n exitAnimation.then(() => {\n onExitComplete(this.id);\n });\n }\n }\n mount() {\n const { register, onExitComplete } = this.node.presenceContext || {};\n if (onExitComplete) {\n onExitComplete(this.id);\n }\n if (register) {\n this.unmount = register(this.id);\n }\n }\n unmount() { }\n}\n\nexport { ExitAnimationFeature };\n//# sourceMappingURL=exit.mjs.map\n","import { AnimationFeature } from './animation/index.mjs';\nimport { ExitAnimationFeature } from './animation/exit.mjs';\n\nconst animations = {\n animation: {\n Feature: AnimationFeature,\n },\n exit: {\n Feature: ExitAnimationFeature,\n },\n};\n\nexport { animations };\n//# sourceMappingURL=animations.mjs.map\n","import { isPrimaryPointer } from 'motion-dom';\n\nfunction extractEventInfo(event) {\n return {\n point: {\n x: event.pageX,\n y: event.pageY,\n },\n };\n}\nconst addPointerInfo = (handler) => {\n return (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event));\n};\n\nexport { addPointerInfo, extractEventInfo };\n//# sourceMappingURL=event-info.mjs.map\n","import { addDomEvent } from 'motion-dom';\nimport { addPointerInfo } from './event-info.mjs';\n\nfunction addPointerEvent(target, eventName, handler, options) {\n return addDomEvent(target, eventName, addPointerInfo(handler), options);\n}\n\nexport { addPointerEvent };\n//# sourceMappingURL=add-pointer-event.mjs.map\n","// Fixes https://github.com/motiondivision/motion/issues/2270\nconst getContextWindow = ({ current }) => {\n return current ? current.ownerDocument.defaultView : null;\n};\n\nexport { getContextWindow };\n//# sourceMappingURL=get-context-window.mjs.map\n","const distance = (a, b) => Math.abs(a - b);\nfunction distance2D(a, b) {\n // Multi-dimensional\n const xDelta = distance(a.x, b.x);\n const yDelta = distance(a.y, b.y);\n return Math.sqrt(xDelta ** 2 + yDelta ** 2);\n}\n\nexport { distance, distance2D };\n//# sourceMappingURL=distance.mjs.map\n","import { frame, isPrimaryPointer, cancelFrame, frameData } from 'motion-dom';\nimport { pipe, secondsToMilliseconds, millisecondsToSeconds } from 'motion-utils';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { extractEventInfo } from '../../events/event-info.mjs';\nimport { distance2D } from '../../utils/distance.mjs';\n\nconst overflowStyles = /*#__PURE__*/ new Set([\"auto\", \"scroll\"]);\n/**\n * @internal\n */\nclass PanSession {\n constructor(event, handlers, { transformPagePoint, contextWindow = window, dragSnapToOrigin = false, distanceThreshold = 3, element, } = {}) {\n /**\n * @internal\n */\n this.startEvent = null;\n /**\n * @internal\n */\n this.lastMoveEvent = null;\n /**\n * @internal\n */\n this.lastMoveEventInfo = null;\n /**\n * @internal\n */\n this.handlers = {};\n /**\n * @internal\n */\n this.contextWindow = window;\n /**\n * Scroll positions of scrollable ancestors and window.\n * @internal\n */\n this.scrollPositions = new Map();\n /**\n * Cleanup function for scroll listeners.\n * @internal\n */\n this.removeScrollListeners = null;\n this.onElementScroll = (event) => {\n this.handleScroll(event.target);\n };\n this.onWindowScroll = () => {\n this.handleScroll(window);\n };\n this.updatePoint = () => {\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n const info = getPanInfo(this.lastMoveEventInfo, this.history);\n const isPanStarted = this.startEvent !== null;\n // Only start panning if the offset is larger than 3 pixels. If we make it\n // any larger than this we'll want to reset the pointer history\n // on the first update to avoid visual snapping to the cursor.\n const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold;\n if (!isPanStarted && !isDistancePastThreshold)\n return;\n const { point } = info;\n const { timestamp } = frameData;\n this.history.push({ ...point, timestamp });\n const { onStart, onMove } = this.handlers;\n if (!isPanStarted) {\n onStart && onStart(this.lastMoveEvent, info);\n this.startEvent = this.lastMoveEvent;\n }\n onMove && onMove(this.lastMoveEvent, info);\n };\n this.handlePointerMove = (event, info) => {\n this.lastMoveEvent = event;\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);\n // Throttle mouse move event to once per frame\n frame.update(this.updatePoint, true);\n };\n this.handlePointerUp = (event, info) => {\n this.end();\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;\n // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked)\n // This ensures constraint animations continue when interrupted by a click\n if (this.dragSnapToOrigin || !this.startEvent) {\n resumeAnimation && resumeAnimation();\n }\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n const panInfo = getPanInfo(event.type === \"pointercancel\"\n ? this.lastMoveEventInfo\n : transformPoint(info, this.transformPagePoint), this.history);\n if (this.startEvent && onEnd) {\n onEnd(event, panInfo);\n }\n onSessionEnd && onSessionEnd(event, panInfo);\n };\n // If we have more than one touch, don't start detecting this gesture\n if (!isPrimaryPointer(event))\n return;\n this.dragSnapToOrigin = dragSnapToOrigin;\n this.handlers = handlers;\n this.transformPagePoint = transformPagePoint;\n this.distanceThreshold = distanceThreshold;\n this.contextWindow = contextWindow || window;\n const info = extractEventInfo(event);\n const initialInfo = transformPoint(info, this.transformPagePoint);\n const { point } = initialInfo;\n const { timestamp } = frameData;\n this.history = [{ ...point, timestamp }];\n const { onSessionStart } = handlers;\n onSessionStart &&\n onSessionStart(event, getPanInfo(initialInfo, this.history));\n this.removeListeners = pipe(addPointerEvent(this.contextWindow, \"pointermove\", this.handlePointerMove), addPointerEvent(this.contextWindow, \"pointerup\", this.handlePointerUp), addPointerEvent(this.contextWindow, \"pointercancel\", this.handlePointerUp));\n // Start scroll tracking if element provided\n if (element) {\n this.startScrollTracking(element);\n }\n }\n /**\n * Start tracking scroll on ancestors and window.\n */\n startScrollTracking(element) {\n // Store initial scroll positions for scrollable ancestors\n let current = element.parentElement;\n while (current) {\n const style = getComputedStyle(current);\n if (overflowStyles.has(style.overflowX) ||\n overflowStyles.has(style.overflowY)) {\n this.scrollPositions.set(current, {\n x: current.scrollLeft,\n y: current.scrollTop,\n });\n }\n current = current.parentElement;\n }\n // Track window scroll\n this.scrollPositions.set(window, {\n x: window.scrollX,\n y: window.scrollY,\n });\n // Capture listener catches element scroll events as they bubble\n window.addEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n passive: true,\n });\n // Direct window scroll listener (window scroll doesn't bubble)\n window.addEventListener(\"scroll\", this.onWindowScroll, {\n passive: true,\n });\n this.removeScrollListeners = () => {\n window.removeEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n });\n window.removeEventListener(\"scroll\", this.onWindowScroll);\n };\n }\n /**\n * Handle scroll compensation during drag.\n *\n * For element scroll: adjusts history origin since pageX/pageY doesn't change.\n * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.\n */\n handleScroll(target) {\n const initial = this.scrollPositions.get(target);\n if (!initial)\n return;\n const isWindow = target === window;\n const current = isWindow\n ? { x: window.scrollX, y: window.scrollY }\n : {\n x: target.scrollLeft,\n y: target.scrollTop,\n };\n const delta = { x: current.x - initial.x, y: current.y - initial.y };\n if (delta.x === 0 && delta.y === 0)\n return;\n if (isWindow) {\n // Window scroll: pageX/pageY changes, so update lastMoveEventInfo\n if (this.lastMoveEventInfo) {\n this.lastMoveEventInfo.point.x += delta.x;\n this.lastMoveEventInfo.point.y += delta.y;\n }\n }\n else {\n // Element scroll: pageX/pageY unchanged, so adjust history origin\n if (this.history.length > 0) {\n this.history[0].x -= delta.x;\n this.history[0].y -= delta.y;\n }\n }\n this.scrollPositions.set(target, current);\n frame.update(this.updatePoint, true);\n }\n updateHandlers(handlers) {\n this.handlers = handlers;\n }\n end() {\n this.removeListeners && this.removeListeners();\n this.removeScrollListeners && this.removeScrollListeners();\n this.scrollPositions.clear();\n cancelFrame(this.updatePoint);\n }\n}\nfunction transformPoint(info, transformPagePoint) {\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info;\n}\nfunction subtractPoint(a, b) {\n return { x: a.x - b.x, y: a.y - b.y };\n}\nfunction getPanInfo({ point }, history) {\n return {\n point,\n delta: subtractPoint(point, lastDevicePoint(history)),\n offset: subtractPoint(point, startDevicePoint(history)),\n velocity: getVelocity(history, 0.1),\n };\n}\nfunction startDevicePoint(history) {\n return history[0];\n}\nfunction lastDevicePoint(history) {\n return history[history.length - 1];\n}\nfunction getVelocity(history, timeDelta) {\n if (history.length < 2) {\n return { x: 0, y: 0 };\n }\n let i = history.length - 1;\n let timestampedPoint = null;\n const lastPoint = lastDevicePoint(history);\n while (i >= 0) {\n timestampedPoint = history[i];\n if (lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta)) {\n break;\n }\n i--;\n }\n if (!timestampedPoint) {\n return { x: 0, y: 0 };\n }\n const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);\n if (time === 0) {\n return { x: 0, y: 0 };\n }\n const currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / time,\n y: (lastPoint.y - timestampedPoint.y) / time,\n };\n if (currentVelocity.x === Infinity) {\n currentVelocity.x = 0;\n }\n if (currentVelocity.y === Infinity) {\n currentVelocity.y = 0;\n }\n return currentVelocity;\n}\n\nexport { PanSession };\n//# sourceMappingURL=PanSession.mjs.map\n","import { mixNumber, calcLength } from 'motion-dom';\nimport { progress, clamp } from 'motion-utils';\n\n/**\n * Apply constraints to a point. These constraints are both physical along an\n * axis, and an elastic factor that determines how much to constrain the point\n * by if it does lie outside the defined parameters.\n */\nfunction applyConstraints(point, { min, max }, elastic) {\n if (min !== undefined && point < min) {\n // If we have a min point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(min, point, elastic.min)\n : Math.max(point, min);\n }\n else if (max !== undefined && point > max) {\n // If we have a max point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(max, point, elastic.max)\n : Math.min(point, max);\n }\n return point;\n}\n/**\n * Calculate constraints in terms of the viewport when defined relatively to the\n * measured axis. This is measured from the nearest edge, so a max constraint of 200\n * on an axis with a max value of 300 would return a constraint of 500 - axis length\n */\nfunction calcRelativeAxisConstraints(axis, min, max) {\n return {\n min: min !== undefined ? axis.min + min : undefined,\n max: max !== undefined\n ? axis.max + max - (axis.max - axis.min)\n : undefined,\n };\n}\n/**\n * Calculate constraints in terms of the viewport when\n * defined relatively to the measured bounding box.\n */\nfunction calcRelativeConstraints(layoutBox, { top, left, bottom, right }) {\n return {\n x: calcRelativeAxisConstraints(layoutBox.x, left, right),\n y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),\n };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative axis\n */\nfunction calcViewportAxisConstraints(layoutAxis, constraintsAxis) {\n let min = constraintsAxis.min - layoutAxis.min;\n let max = constraintsAxis.max - layoutAxis.max;\n // If the constraints axis is actually smaller than the layout axis then we can\n // flip the constraints\n if (constraintsAxis.max - constraintsAxis.min <\n layoutAxis.max - layoutAxis.min) {\n [min, max] = [max, min];\n }\n return { min, max };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative box\n */\nfunction calcViewportConstraints(layoutBox, constraintsBox) {\n return {\n x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),\n y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),\n };\n}\n/**\n * Calculate a transform origin relative to the source axis, between 0-1, that results\n * in an asthetically pleasing scale/transform needed to project from source to target.\n */\nfunction calcOrigin(source, target) {\n let origin = 0.5;\n const sourceLength = calcLength(source);\n const targetLength = calcLength(target);\n if (targetLength > sourceLength) {\n origin = progress(target.min, target.max - sourceLength, source.min);\n }\n else if (sourceLength > targetLength) {\n origin = progress(source.min, source.max - targetLength, target.min);\n }\n return clamp(0, 1, origin);\n}\n/**\n * Rebase the calculated viewport constraints relative to the layout.min point.\n */\nfunction rebaseAxisConstraints(layout, constraints) {\n const relativeConstraints = {};\n if (constraints.min !== undefined) {\n relativeConstraints.min = constraints.min - layout.min;\n }\n if (constraints.max !== undefined) {\n relativeConstraints.max = constraints.max - layout.min;\n }\n return relativeConstraints;\n}\nconst defaultElastic = 0.35;\n/**\n * Accepts a dragElastic prop and returns resolved elastic values for each axis.\n */\nfunction resolveDragElastic(dragElastic = defaultElastic) {\n if (dragElastic === false) {\n dragElastic = 0;\n }\n else if (dragElastic === true) {\n dragElastic = defaultElastic;\n }\n return {\n x: resolveAxisElastic(dragElastic, \"left\", \"right\"),\n y: resolveAxisElastic(dragElastic, \"top\", \"bottom\"),\n };\n}\nfunction resolveAxisElastic(dragElastic, minLabel, maxLabel) {\n return {\n min: resolvePointElastic(dragElastic, minLabel),\n max: resolvePointElastic(dragElastic, maxLabel),\n };\n}\nfunction resolvePointElastic(dragElastic, label) {\n return typeof dragElastic === \"number\"\n ? dragElastic\n : dragElastic[label] || 0;\n}\n\nexport { applyConstraints, calcOrigin, calcRelativeAxisConstraints, calcRelativeConstraints, calcViewportAxisConstraints, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, resolveAxisElastic, resolveDragElastic, resolvePointElastic };\n//# sourceMappingURL=constraints.mjs.map\n","import { createBox, frame, eachAxis, measurePageBox, convertBoxToBoundingBox, convertBoundingBoxToBox, addValueToWillChange, animateMotionValue, mixNumber, isElementKeyboardAccessible, addDomEvent, setDragLock, percent, calcLength } from 'motion-dom';\nimport { invariant } from 'motion-utils';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { extractEventInfo } from '../../events/event-info.mjs';\nimport { getContextWindow } from '../../utils/get-context-window.mjs';\nimport { isRefObject } from '../../utils/is-ref-object.mjs';\nimport { PanSession } from '../pan/PanSession.mjs';\nimport { applyConstraints, calcRelativeConstraints, resolveDragElastic, rebaseAxisConstraints, calcViewportConstraints, calcOrigin, defaultElastic } from './utils/constraints.mjs';\n\nconst elementDragControls = new WeakMap();\nclass VisualElementDragControls {\n constructor(visualElement) {\n this.openDragLock = null;\n this.isDragging = false;\n this.currentDirection = null;\n this.originPoint = { x: 0, y: 0 };\n /**\n * The permitted boundaries of travel, in pixels.\n */\n this.constraints = false;\n this.hasMutatedConstraints = false;\n /**\n * The per-axis resolved elastic values.\n */\n this.elastic = createBox();\n /**\n * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n this.latestPointerEvent = null;\n /**\n * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n this.latestPanInfo = null;\n this.visualElement = visualElement;\n }\n start(originEvent, { snapToCursor = false, distanceThreshold } = {}) {\n /**\n * Don't start dragging if this component is exiting\n */\n const { presenceContext } = this.visualElement;\n if (presenceContext && presenceContext.isPresent === false)\n return;\n const onSessionStart = (event) => {\n // Stop or pause animations based on context:\n // - snapToCursor: stop because we'll set new position values\n // - otherwise: pause to allow resume if no drag starts (for constraint animations)\n if (snapToCursor) {\n this.stopAnimation();\n this.snapToCursor(extractEventInfo(event).point);\n }\n else {\n this.pauseAnimation();\n }\n };\n const onStart = (event, info) => {\n // Stop any paused animation so motion values reflect true current position\n // (pauseAnimation was called in onSessionStart to allow resume if no drag started)\n this.stopAnimation();\n // Attempt to grab the global drag gesture lock - maybe make this part of PanSession\n const { drag, dragPropagation, onDragStart } = this.getProps();\n if (drag && !dragPropagation) {\n if (this.openDragLock)\n this.openDragLock();\n this.openDragLock = setDragLock(drag);\n // If we don 't have the lock, don't start dragging\n if (!this.openDragLock)\n return;\n }\n this.latestPointerEvent = event;\n this.latestPanInfo = info;\n this.isDragging = true;\n this.currentDirection = null;\n this.resolveConstraints();\n if (this.visualElement.projection) {\n this.visualElement.projection.isAnimationBlocked = true;\n this.visualElement.projection.target = undefined;\n }\n /**\n * Record gesture origin and pointer offset\n */\n eachAxis((axis) => {\n let current = this.getAxisMotionValue(axis).get() || 0;\n /**\n * If the MotionValue is a percentage value convert to px\n */\n if (percent.test(current)) {\n const { projection } = this.visualElement;\n if (projection && projection.layout) {\n const measuredAxis = projection.layout.layoutBox[axis];\n if (measuredAxis) {\n const length = calcLength(measuredAxis);\n current = length * (parseFloat(current) / 100);\n }\n }\n }\n this.originPoint[axis] = current;\n });\n // Fire onDragStart event\n if (onDragStart) {\n frame.postRender(() => onDragStart(event, info));\n }\n addValueToWillChange(this.visualElement, \"transform\");\n const { animationState } = this.visualElement;\n animationState && animationState.setActive(\"whileDrag\", true);\n };\n const onMove = (event, info) => {\n this.latestPointerEvent = event;\n this.latestPanInfo = info;\n const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps();\n // If we didn't successfully receive the gesture lock, early return.\n if (!dragPropagation && !this.openDragLock)\n return;\n const { offset } = info;\n // Attempt to detect drag direction if directionLock is true\n if (dragDirectionLock && this.currentDirection === null) {\n this.currentDirection = getCurrentDirection(offset);\n // If we've successfully set a direction, notify listener\n if (this.currentDirection !== null) {\n onDirectionLock && onDirectionLock(this.currentDirection);\n }\n return;\n }\n // Update each point with the latest position\n this.updateAxis(\"x\", info.point, offset);\n this.updateAxis(\"y\", info.point, offset);\n /**\n * Ideally we would leave the renderer to fire naturally at the end of\n * this frame but if the element is about to change layout as the result\n * of a re-render we want to ensure the browser can read the latest\n * bounding box to ensure the pointer and element don't fall out of sync.\n */\n this.visualElement.render();\n /**\n * This must fire after the render call as it might trigger a state\n * change which itself might trigger a layout update.\n */\n onDrag && onDrag(event, info);\n };\n const onSessionEnd = (event, info) => {\n this.latestPointerEvent = event;\n this.latestPanInfo = info;\n this.stop(event, info);\n this.latestPointerEvent = null;\n this.latestPanInfo = null;\n };\n const resumeAnimation = () => eachAxis((axis) => this.getAnimationState(axis) === \"paused\" &&\n this.getAxisMotionValue(axis).animation?.play());\n const { dragSnapToOrigin } = this.getProps();\n this.panSession = new PanSession(originEvent, {\n onSessionStart,\n onStart,\n onMove,\n onSessionEnd,\n resumeAnimation,\n }, {\n transformPagePoint: this.visualElement.getTransformPagePoint(),\n dragSnapToOrigin,\n distanceThreshold,\n contextWindow: getContextWindow(this.visualElement),\n element: this.visualElement.current,\n });\n }\n /**\n * @internal\n */\n stop(event, panInfo) {\n const finalEvent = event || this.latestPointerEvent;\n const finalPanInfo = panInfo || this.latestPanInfo;\n const isDragging = this.isDragging;\n this.cancel();\n if (!isDragging || !finalPanInfo || !finalEvent)\n return;\n const { velocity } = finalPanInfo;\n this.startAnimation(velocity);\n const { onDragEnd } = this.getProps();\n if (onDragEnd) {\n frame.postRender(() => onDragEnd(finalEvent, finalPanInfo));\n }\n }\n /**\n * @internal\n */\n cancel() {\n this.isDragging = false;\n const { projection, animationState } = this.visualElement;\n if (projection) {\n projection.isAnimationBlocked = false;\n }\n this.panSession && this.panSession.end();\n this.panSession = undefined;\n const { dragPropagation } = this.getProps();\n if (!dragPropagation && this.openDragLock) {\n this.openDragLock();\n this.openDragLock = null;\n }\n animationState && animationState.setActive(\"whileDrag\", false);\n }\n updateAxis(axis, _point, offset) {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!offset || !shouldDrag(axis, drag, this.currentDirection))\n return;\n const axisValue = this.getAxisMotionValue(axis);\n let next = this.originPoint[axis] + offset[axis];\n // Apply constraints\n if (this.constraints && this.constraints[axis]) {\n next = applyConstraints(next, this.constraints[axis], this.elastic[axis]);\n }\n axisValue.set(next);\n }\n resolveConstraints() {\n const { dragConstraints, dragElastic } = this.getProps();\n const layout = this.visualElement.projection &&\n !this.visualElement.projection.layout\n ? this.visualElement.projection.measure(false)\n : this.visualElement.projection?.layout;\n const prevConstraints = this.constraints;\n if (dragConstraints && isRefObject(dragConstraints)) {\n if (!this.constraints) {\n this.constraints = this.resolveRefConstraints();\n }\n }\n else {\n if (dragConstraints && layout) {\n this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints);\n }\n else {\n this.constraints = false;\n }\n }\n this.elastic = resolveDragElastic(dragElastic);\n /**\n * If we're outputting to external MotionValues, we want to rebase the measured constraints\n * from viewport-relative to component-relative.\n */\n if (prevConstraints !== this.constraints &&\n layout &&\n this.constraints &&\n !this.hasMutatedConstraints) {\n eachAxis((axis) => {\n if (this.constraints !== false &&\n this.getAxisMotionValue(axis)) {\n this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]);\n }\n });\n }\n }\n resolveRefConstraints() {\n const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps();\n if (!constraints || !isRefObject(constraints))\n return false;\n const constraintsElement = constraints.current;\n invariant(constraintsElement !== null, \"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.\", \"drag-constraints-ref\");\n const { projection } = this.visualElement;\n // TODO\n if (!projection || !projection.layout)\n return false;\n const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint());\n let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox);\n /**\n * If there's an onMeasureDragConstraints listener we call it and\n * if different constraints are returned, set constraints to that\n */\n if (onMeasureDragConstraints) {\n const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints));\n this.hasMutatedConstraints = !!userConstraints;\n if (userConstraints) {\n measuredConstraints = convertBoundingBoxToBox(userConstraints);\n }\n }\n return measuredConstraints;\n }\n startAnimation(velocity) {\n const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps();\n const constraints = this.constraints || {};\n const momentumAnimations = eachAxis((axis) => {\n if (!shouldDrag(axis, drag, this.currentDirection)) {\n return;\n }\n let transition = (constraints && constraints[axis]) || {};\n if (dragSnapToOrigin)\n transition = { min: 0, max: 0 };\n /**\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\n * of spring animations so we should look into adding a disable spring option to `inertia`.\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\n * using the value of `dragElastic`.\n */\n const bounceStiffness = dragElastic ? 200 : 1000000;\n const bounceDamping = dragElastic ? 40 : 10000000;\n const inertia = {\n type: \"inertia\",\n velocity: dragMomentum ? velocity[axis] : 0,\n bounceStiffness,\n bounceDamping,\n timeConstant: 750,\n restDelta: 1,\n restSpeed: 10,\n ...dragTransition,\n ...transition,\n };\n // If we're not animating on an externally-provided `MotionValue` we can use the\n // component's animation controls which will handle interactions with whileHover (etc),\n // otherwise we just have to animate the `MotionValue` itself.\n return this.startAxisValueAnimation(axis, inertia);\n });\n // Run all animations and then resolve the new drag constraints.\n return Promise.all(momentumAnimations).then(onDragTransitionEnd);\n }\n startAxisValueAnimation(axis, transition) {\n const axisValue = this.getAxisMotionValue(axis);\n addValueToWillChange(this.visualElement, axis);\n return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false));\n }\n stopAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).stop());\n }\n pauseAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).animation?.pause());\n }\n getAnimationState(axis) {\n return this.getAxisMotionValue(axis).animation?.state;\n }\n /**\n * Drag works differently depending on which props are provided.\n *\n * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.\n * - Otherwise, we apply the delta to the x/y motion values.\n */\n getAxisMotionValue(axis) {\n const dragKey = `_drag${axis.toUpperCase()}`;\n const props = this.visualElement.getProps();\n const externalMotionValue = props[dragKey];\n return externalMotionValue\n ? externalMotionValue\n : this.visualElement.getValue(axis, (props.initial\n ? props.initial[axis]\n : undefined) || 0);\n }\n snapToCursor(point) {\n eachAxis((axis) => {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!shouldDrag(axis, drag, this.currentDirection))\n return;\n const { projection } = this.visualElement;\n const axisValue = this.getAxisMotionValue(axis);\n if (projection && projection.layout) {\n const { min, max } = projection.layout.layoutBox[axis];\n /**\n * The layout measurement includes the current transform value,\n * so we need to add it back to get the correct snap position.\n * This fixes an issue where elements with initial coordinates\n * would snap to the wrong position on the first drag.\n */\n const current = axisValue.get() || 0;\n axisValue.set(point[axis] - mixNumber(min, max, 0.5) + current);\n }\n });\n }\n /**\n * When the viewport resizes we want to check if the measured constraints\n * have changed and, if so, reposition the element within those new constraints\n * relative to where it was before the resize.\n */\n scalePositionWithinConstraints() {\n if (!this.visualElement.current)\n return;\n const { drag, dragConstraints } = this.getProps();\n const { projection } = this.visualElement;\n if (!isRefObject(dragConstraints) || !projection || !this.constraints)\n return;\n /**\n * Stop current animations as there can be visual glitching if we try to do\n * this mid-animation\n */\n this.stopAnimation();\n /**\n * Record the relative position of the dragged element relative to the\n * constraints box and save as a progress value.\n */\n const boxProgress = { x: 0, y: 0 };\n eachAxis((axis) => {\n const axisValue = this.getAxisMotionValue(axis);\n if (axisValue && this.constraints !== false) {\n const latest = axisValue.get();\n boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]);\n }\n });\n /**\n * Update the layout of this element and resolve the latest drag constraints\n */\n const { transformTemplate } = this.visualElement.getProps();\n this.visualElement.current.style.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\";\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n this.resolveConstraints();\n /**\n * For each axis, calculate the current progress of the layout axis\n * within the new constraints.\n */\n eachAxis((axis) => {\n if (!shouldDrag(axis, drag, null))\n return;\n /**\n * Calculate a new transform based on the previous box progress\n */\n const axisValue = this.getAxisMotionValue(axis);\n const { min, max } = this.constraints[axis];\n axisValue.set(mixNumber(min, max, boxProgress[axis]));\n });\n }\n addListeners() {\n if (!this.visualElement.current)\n return;\n elementDragControls.set(this.visualElement, this);\n const element = this.visualElement.current;\n /**\n * Attach a pointerdown event listener on this DOM element to initiate drag tracking.\n */\n const stopPointerListener = addPointerEvent(element, \"pointerdown\", (event) => {\n const { drag, dragListener = true } = this.getProps();\n if (drag &&\n dragListener &&\n !isElementKeyboardAccessible(event.target)) {\n this.start(event);\n }\n });\n const measureDragConstraints = () => {\n const { dragConstraints } = this.getProps();\n if (isRefObject(dragConstraints) && dragConstraints.current) {\n this.constraints = this.resolveRefConstraints();\n }\n };\n const { projection } = this.visualElement;\n const stopMeasureLayoutListener = projection.addEventListener(\"measure\", measureDragConstraints);\n if (projection && !projection.layout) {\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n }\n frame.read(measureDragConstraints);\n /**\n * Attach a window resize listener to scale the draggable target within its defined\n * constraints as the window resizes.\n */\n const stopResizeListener = addDomEvent(window, \"resize\", () => this.scalePositionWithinConstraints());\n /**\n * If the element's layout changes, calculate the delta and apply that to\n * the drag gesture's origin point.\n */\n const stopLayoutUpdateListener = projection.addEventListener(\"didUpdate\", (({ delta, hasLayoutChanged }) => {\n if (this.isDragging && hasLayoutChanged) {\n eachAxis((axis) => {\n const motionValue = this.getAxisMotionValue(axis);\n if (!motionValue)\n return;\n this.originPoint[axis] += delta[axis].translate;\n motionValue.set(motionValue.get() + delta[axis].translate);\n });\n this.visualElement.render();\n }\n }));\n return () => {\n stopResizeListener();\n stopPointerListener();\n stopMeasureLayoutListener();\n stopLayoutUpdateListener && stopLayoutUpdateListener();\n };\n }\n getProps() {\n const props = this.visualElement.getProps();\n const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props;\n return {\n ...props,\n drag,\n dragDirectionLock,\n dragPropagation,\n dragConstraints,\n dragElastic,\n dragMomentum,\n };\n }\n}\nfunction shouldDrag(direction, drag, currentDirection) {\n return ((drag === true || drag === direction) &&\n (currentDirection === null || currentDirection === direction));\n}\n/**\n * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower\n * than the provided threshold, return `null`.\n *\n * @param offset - The x/y offset from origin.\n * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.\n */\nfunction getCurrentDirection(offset, lockThreshold = 10) {\n let direction = null;\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\";\n }\n else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\";\n }\n return direction;\n}\n\nexport { VisualElementDragControls, elementDragControls };\n//# sourceMappingURL=VisualElementDragControls.mjs.map\n","import { Feature } from 'motion-dom';\nimport { noop } from 'motion-utils';\nimport { VisualElementDragControls } from './VisualElementDragControls.mjs';\n\nclass DragGesture extends Feature {\n constructor(node) {\n super(node);\n this.removeGroupControls = noop;\n this.removeListeners = noop;\n this.controls = new VisualElementDragControls(node);\n }\n mount() {\n // If we've been provided a DragControls for manual control over the drag gesture,\n // subscribe this component to it on mount.\n const { dragControls } = this.node.getProps();\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls);\n }\n this.removeListeners = this.controls.addListeners() || noop;\n }\n update() {\n const { dragControls } = this.node.getProps();\n const { dragControls: prevDragControls } = this.node.prevProps || {};\n if (dragControls !== prevDragControls) {\n this.removeGroupControls();\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls);\n }\n }\n }\n unmount() {\n this.removeGroupControls();\n this.removeListeners();\n }\n}\n\nexport { DragGesture };\n//# sourceMappingURL=index.mjs.map\n","import { Feature, frame } from 'motion-dom';\nimport { noop } from 'motion-utils';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { getContextWindow } from '../../utils/get-context-window.mjs';\nimport { PanSession } from './PanSession.mjs';\n\nconst asyncHandler = (handler) => (event, info) => {\n if (handler) {\n frame.postRender(() => handler(event, info));\n }\n};\nclass PanGesture extends Feature {\n constructor() {\n super(...arguments);\n this.removePointerDownListener = noop;\n }\n onPointerDown(pointerDownEvent) {\n this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), {\n transformPagePoint: this.node.getTransformPagePoint(),\n contextWindow: getContextWindow(this.node),\n });\n }\n createPanHandlers() {\n const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps();\n return {\n onSessionStart: asyncHandler(onPanSessionStart),\n onStart: asyncHandler(onPanStart),\n onMove: onPan,\n onEnd: (event, info) => {\n delete this.session;\n if (onPanEnd) {\n frame.postRender(() => onPanEnd(event, info));\n }\n },\n };\n }\n mount() {\n this.removePointerDownListener = addPointerEvent(this.node.current, \"pointerdown\", (event) => this.onPointerDown(event));\n }\n update() {\n this.session && this.session.updateHandlers(this.createPanHandlers());\n }\n unmount() {\n this.removePointerDownListener();\n this.session && this.session.end();\n }\n}\n\nexport { PanGesture };\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { globalProjectionState, frame, microtask } from 'motion-dom';\nimport { useContext, Component } from 'react';\nimport { usePresence } from '../../../components/AnimatePresence/use-presence.mjs';\nimport { LayoutGroupContext } from '../../../context/LayoutGroupContext.mjs';\nimport { SwitchLayoutGroupContext } from '../../../context/SwitchLayoutGroupContext.mjs';\n\n/**\n * Track whether we've taken any snapshots yet. If not,\n * we can safely skip notification of didUpdate.\n *\n * Difficult to capture in a test but to prevent flickering\n * we must set this to true either on update or unmount.\n * Running `next-env/layout-id` in Safari will show this behaviour if broken.\n */\nlet hasTakenAnySnapshot = false;\nclass MeasureLayoutWithContext extends Component {\n /**\n * This only mounts projection nodes for components that\n * need measuring, we might want to do it for all components\n * in order to incorporate transforms\n */\n componentDidMount() {\n const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props;\n const { projection } = visualElement;\n if (projection) {\n if (layoutGroup.group)\n layoutGroup.group.add(projection);\n if (switchLayoutGroup && switchLayoutGroup.register && layoutId) {\n switchLayoutGroup.register(projection);\n }\n if (hasTakenAnySnapshot) {\n projection.root.didUpdate();\n }\n projection.addEventListener(\"animationComplete\", () => {\n this.safeToRemove();\n });\n projection.setOptions({\n ...projection.options,\n onExitComplete: () => this.safeToRemove(),\n });\n }\n globalProjectionState.hasEverUpdated = true;\n }\n getSnapshotBeforeUpdate(prevProps) {\n const { layoutDependency, visualElement, drag, isPresent } = this.props;\n const { projection } = visualElement;\n if (!projection)\n return null;\n /**\n * TODO: We use this data in relegate to determine whether to\n * promote a previous element. There's no guarantee its presence data\n * will have updated by this point - if a bug like this arises it will\n * have to be that we markForRelegation and then find a new lead some other way,\n * perhaps in didUpdate\n */\n projection.isPresent = isPresent;\n hasTakenAnySnapshot = true;\n if (drag ||\n prevProps.layoutDependency !== layoutDependency ||\n layoutDependency === undefined ||\n prevProps.isPresent !== isPresent) {\n projection.willUpdate();\n }\n else {\n this.safeToRemove();\n }\n if (prevProps.isPresent !== isPresent) {\n if (isPresent) {\n projection.promote();\n }\n else if (!projection.relegate()) {\n /**\n * If there's another stack member taking over from this one,\n * it's in charge of the exit animation and therefore should\n * be in charge of the safe to remove. Otherwise we call it here.\n */\n frame.postRender(() => {\n const stack = projection.getStack();\n if (!stack || !stack.members.length) {\n this.safeToRemove();\n }\n });\n }\n }\n return null;\n }\n componentDidUpdate() {\n const { projection } = this.props.visualElement;\n if (projection) {\n projection.root.didUpdate();\n microtask.postRender(() => {\n if (!projection.currentAnimation && projection.isLead()) {\n this.safeToRemove();\n }\n });\n }\n }\n componentWillUnmount() {\n const { visualElement, layoutGroup, switchLayoutGroup: promoteContext, } = this.props;\n const { projection } = visualElement;\n hasTakenAnySnapshot = true;\n if (projection) {\n projection.scheduleCheckAfterUnmount();\n if (layoutGroup && layoutGroup.group)\n layoutGroup.group.remove(projection);\n if (promoteContext && promoteContext.deregister)\n promoteContext.deregister(projection);\n }\n }\n safeToRemove() {\n const { safeToRemove } = this.props;\n safeToRemove && safeToRemove();\n }\n render() {\n return null;\n }\n}\nfunction MeasureLayout(props) {\n const [isPresent, safeToRemove] = usePresence();\n const layoutGroup = useContext(LayoutGroupContext);\n return (jsx(MeasureLayoutWithContext, { ...props, layoutGroup: layoutGroup, switchLayoutGroup: useContext(SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove }));\n}\n\nexport { MeasureLayout };\n//# sourceMappingURL=MeasureLayout.mjs.map\n","import { DragGesture } from '../../gestures/drag/index.mjs';\nimport { PanGesture } from '../../gestures/pan/index.mjs';\nimport { MeasureLayout } from './layout/MeasureLayout.mjs';\nimport { HTMLProjectionNode } from 'motion-dom';\n\nconst drag = {\n pan: {\n Feature: PanGesture,\n },\n drag: {\n Feature: DragGesture,\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n};\n\nexport { drag };\n//# sourceMappingURL=drag.mjs.map\n","import { Feature, hover, frame } from 'motion-dom';\nimport { extractEventInfo } from '../events/event-info.mjs';\n\nfunction handleHoverEvent(node, event, lifecycle) {\n const { props } = node;\n if (node.animationState && props.whileHover) {\n node.animationState.setActive(\"whileHover\", lifecycle === \"Start\");\n }\n const eventName = (\"onHover\" + lifecycle);\n const callback = props[eventName];\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)));\n }\n}\nclass HoverGesture extends Feature {\n mount() {\n const { current } = this.node;\n if (!current)\n return;\n this.unmount = hover(current, (_element, startEvent) => {\n handleHoverEvent(this.node, startEvent, \"Start\");\n return (endEvent) => handleHoverEvent(this.node, endEvent, \"End\");\n });\n }\n unmount() { }\n}\n\nexport { HoverGesture };\n//# sourceMappingURL=hover.mjs.map\n","import { Feature, addDomEvent } from 'motion-dom';\nimport { pipe } from 'motion-utils';\n\nclass FocusGesture extends Feature {\n constructor() {\n super(...arguments);\n this.isActive = false;\n }\n onFocus() {\n let isFocusVisible = false;\n /**\n * If this element doesn't match focus-visible then don't\n * apply whileHover. But, if matches throws that focus-visible\n * is not a valid selector then in that browser outline styles will be applied\n * to the element by default and we want to match that behaviour with whileFocus.\n */\n try {\n isFocusVisible = this.node.current.matches(\":focus-visible\");\n }\n catch (e) {\n isFocusVisible = true;\n }\n if (!isFocusVisible || !this.node.animationState)\n return;\n this.node.animationState.setActive(\"whileFocus\", true);\n this.isActive = true;\n }\n onBlur() {\n if (!this.isActive || !this.node.animationState)\n return;\n this.node.animationState.setActive(\"whileFocus\", false);\n this.isActive = false;\n }\n mount() {\n this.unmount = pipe(addDomEvent(this.node.current, \"focus\", () => this.onFocus()), addDomEvent(this.node.current, \"blur\", () => this.onBlur()));\n }\n unmount() { }\n}\n\nexport { FocusGesture };\n//# sourceMappingURL=focus.mjs.map\n","import { Feature, press, frame } from 'motion-dom';\nimport { extractEventInfo } from '../events/event-info.mjs';\n\nfunction handlePressEvent(node, event, lifecycle) {\n const { props } = node;\n if (node.current instanceof HTMLButtonElement && node.current.disabled) {\n return;\n }\n if (node.animationState && props.whileTap) {\n node.animationState.setActive(\"whileTap\", lifecycle === \"Start\");\n }\n const eventName = (\"onTap\" + (lifecycle === \"End\" ? \"\" : lifecycle));\n const callback = props[eventName];\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)));\n }\n}\nclass PressGesture extends Feature {\n mount() {\n const { current } = this.node;\n if (!current)\n return;\n this.unmount = press(current, (_element, startEvent) => {\n handlePressEvent(this.node, startEvent, \"Start\");\n return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? \"End\" : \"Cancel\");\n }, { useGlobalTarget: this.node.props.globalTapTarget });\n }\n unmount() { }\n}\n\nexport { PressGesture };\n//# sourceMappingURL=press.mjs.map\n","/**\n * Map an IntersectionHandler callback to an element. We only ever make one handler for one\n * element, so even though these handlers might all be triggered by different\n * observers, we can keep them in the same map.\n */\nconst observerCallbacks = new WeakMap();\n/**\n * Multiple observers can be created for multiple element/document roots. Each with\n * different settings. So here we store dictionaries of observers to each root,\n * using serialised settings (threshold/margin) as lookup keys.\n */\nconst observers = new WeakMap();\nconst fireObserverCallback = (entry) => {\n const callback = observerCallbacks.get(entry.target);\n callback && callback(entry);\n};\nconst fireAllObserverCallbacks = (entries) => {\n entries.forEach(fireObserverCallback);\n};\nfunction initIntersectionObserver({ root, ...options }) {\n const lookupRoot = root || document;\n /**\n * If we don't have an observer lookup map for this root, create one.\n */\n if (!observers.has(lookupRoot)) {\n observers.set(lookupRoot, {});\n }\n const rootObservers = observers.get(lookupRoot);\n const key = JSON.stringify(options);\n /**\n * If we don't have an observer for this combination of root and settings,\n * create one.\n */\n if (!rootObservers[key]) {\n rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options });\n }\n return rootObservers[key];\n}\nfunction observeIntersection(element, options, callback) {\n const rootInteresectionObserver = initIntersectionObserver(options);\n observerCallbacks.set(element, callback);\n rootInteresectionObserver.observe(element);\n return () => {\n observerCallbacks.delete(element);\n rootInteresectionObserver.unobserve(element);\n };\n}\n\nexport { observeIntersection };\n//# sourceMappingURL=observers.mjs.map\n","import { Feature } from 'motion-dom';\nimport { observeIntersection } from './observers.mjs';\n\nconst thresholdNames = {\n some: 0,\n all: 1,\n};\nclass InViewFeature extends Feature {\n constructor() {\n super(...arguments);\n this.hasEnteredView = false;\n this.isInView = false;\n }\n startObserver() {\n this.unmount();\n const { viewport = {} } = this.node.getProps();\n const { root, margin: rootMargin, amount = \"some\", once } = viewport;\n const options = {\n root: root ? root.current : undefined,\n rootMargin,\n threshold: typeof amount === \"number\" ? amount : thresholdNames[amount],\n };\n const onIntersectionUpdate = (entry) => {\n const { isIntersecting } = entry;\n /**\n * If there's been no change in the viewport state, early return.\n */\n if (this.isInView === isIntersecting)\n return;\n this.isInView = isIntersecting;\n /**\n * Handle hasEnteredView. If this is only meant to run once, and\n * element isn't visible, early return. Otherwise set hasEnteredView to true.\n */\n if (once && !isIntersecting && this.hasEnteredView) {\n return;\n }\n else if (isIntersecting) {\n this.hasEnteredView = true;\n }\n if (this.node.animationState) {\n this.node.animationState.setActive(\"whileInView\", isIntersecting);\n }\n /**\n * Use the latest committed props rather than the ones in scope\n * when this observer is created\n */\n const { onViewportEnter, onViewportLeave } = this.node.getProps();\n const callback = isIntersecting ? onViewportEnter : onViewportLeave;\n callback && callback(entry);\n };\n return observeIntersection(this.node.current, options, onIntersectionUpdate);\n }\n mount() {\n this.startObserver();\n }\n update() {\n if (typeof IntersectionObserver === \"undefined\")\n return;\n const { props, prevProps } = this.node;\n const hasOptionsChanged = [\"amount\", \"margin\", \"root\"].some(hasViewportOptionChanged(props, prevProps));\n if (hasOptionsChanged) {\n this.startObserver();\n }\n }\n unmount() { }\n}\nfunction hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) {\n return (name) => viewport[name] !== prevViewport[name];\n}\n\nexport { InViewFeature };\n//# sourceMappingURL=index.mjs.map\n","import { HoverGesture } from '../../gestures/hover.mjs';\nimport { FocusGesture } from '../../gestures/focus.mjs';\nimport { PressGesture } from '../../gestures/press.mjs';\nimport { InViewFeature } from './viewport/index.mjs';\n\nconst gestureAnimations = {\n inView: {\n Feature: InViewFeature,\n },\n tap: {\n Feature: PressGesture,\n },\n focus: {\n Feature: FocusGesture,\n },\n hover: {\n Feature: HoverGesture,\n },\n};\n\nexport { gestureAnimations };\n//# sourceMappingURL=gestures.mjs.map\n","import { HTMLProjectionNode } from 'motion-dom';\nimport { MeasureLayout } from './layout/MeasureLayout.mjs';\n\nconst layout = {\n layout: {\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n};\n\nexport { layout };\n//# sourceMappingURL=layout.mjs.map\n","import { animations } from '../../../motion/features/animations.mjs';\nimport { drag } from '../../../motion/features/drag.mjs';\nimport { gestureAnimations } from '../../../motion/features/gestures.mjs';\nimport { layout } from '../../../motion/features/layout.mjs';\n\nconst featureBundle = {\n ...animations,\n ...gestureAnimations,\n ...drag,\n ...layout,\n};\n\nexport { featureBundle };\n//# sourceMappingURL=feature-bundle.mjs.map\n","import { createDomVisualElement } from '../../dom/create-visual-element.mjs';\nimport { createMotionProxy } from '../create-proxy.mjs';\nimport { featureBundle } from './feature-bundle.mjs';\n\nconst motion = /*@__PURE__*/ createMotionProxy(featureBundle, createDomVisualElement);\n\nexport { motion };\n//# sourceMappingURL=proxy.mjs.map\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","/**\n * Concatenates two arrays faster than the array spread operator.\n */\nconst concatArrays = (array1, array2) => {\n // Pre-allocate for better V8 optimization\n const combinedArray = new Array(array1.length + array2.length);\n for (let i = 0; i < array1.length; i++) {\n combinedArray[i] = array1[i];\n }\n for (let i = 0; i < array2.length; i++) {\n combinedArray[array1.length + i] = array2[i];\n }\n return combinedArray;\n};\n\n// Factory function ensures consistent object shapes\nconst createClassValidatorObject = (classGroupId, validator) => ({\n classGroupId,\n validator\n});\n// Factory ensures consistent ClassPartObject shape\nconst createClassPartObject = (nextPart = new Map(), validators = null, classGroupId) => ({\n nextPart,\n validators,\n classGroupId\n});\nconst CLASS_PART_SEPARATOR = '-';\nconst EMPTY_CONFLICTS = [];\n// I use two dots here because one dot is used as prefix for class groups in plugins\nconst ARBITRARY_PROPERTY_PREFIX = 'arbitrary..';\nconst createClassGroupUtils = config => {\n const classMap = createClassMap(config);\n const {\n conflictingClassGroups,\n conflictingClassGroupModifiers\n } = config;\n const getClassGroupId = className => {\n if (className.startsWith('[') && className.endsWith(']')) {\n return getGroupIdForArbitraryProperty(className);\n }\n const classParts = className.split(CLASS_PART_SEPARATOR);\n // Classes like `-inset-1` produce an empty string as first classPart. We assume that classes for negative values are used correctly and skip it.\n const startIndex = classParts[0] === '' && classParts.length > 1 ? 1 : 0;\n return getGroupRecursive(classParts, startIndex, classMap);\n };\n const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {\n if (hasPostfixModifier) {\n const modifierConflicts = conflictingClassGroupModifiers[classGroupId];\n const baseConflicts = conflictingClassGroups[classGroupId];\n if (modifierConflicts) {\n if (baseConflicts) {\n // Merge base conflicts with modifier conflicts\n return concatArrays(baseConflicts, modifierConflicts);\n }\n // Only modifier conflicts\n return modifierConflicts;\n }\n // Fall back to without postfix if no modifier conflicts\n return baseConflicts || EMPTY_CONFLICTS;\n }\n return conflictingClassGroups[classGroupId] || EMPTY_CONFLICTS;\n };\n return {\n getClassGroupId,\n getConflictingClassGroupIds\n };\n};\nconst getGroupRecursive = (classParts, startIndex, classPartObject) => {\n const classPathsLength = classParts.length - startIndex;\n if (classPathsLength === 0) {\n return classPartObject.classGroupId;\n }\n const currentClassPart = classParts[startIndex];\n const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);\n if (nextClassPartObject) {\n const result = getGroupRecursive(classParts, startIndex + 1, nextClassPartObject);\n if (result) return result;\n }\n const validators = classPartObject.validators;\n if (validators === null) {\n return undefined;\n }\n // Build classRest string efficiently by joining from startIndex onwards\n const classRest = startIndex === 0 ? classParts.join(CLASS_PART_SEPARATOR) : classParts.slice(startIndex).join(CLASS_PART_SEPARATOR);\n const validatorsLength = validators.length;\n for (let i = 0; i < validatorsLength; i++) {\n const validatorObj = validators[i];\n if (validatorObj.validator(classRest)) {\n return validatorObj.classGroupId;\n }\n }\n return undefined;\n};\n/**\n * Get the class group ID for an arbitrary property.\n *\n * @param className - The class name to get the group ID for. Is expected to be string starting with `[` and ending with `]`.\n */\nconst getGroupIdForArbitraryProperty = className => className.slice(1, -1).indexOf(':') === -1 ? undefined : (() => {\n const content = className.slice(1, -1);\n const colonIndex = content.indexOf(':');\n const property = content.slice(0, colonIndex);\n return property ? ARBITRARY_PROPERTY_PREFIX + property : undefined;\n})();\n/**\n * Exported for testing only\n */\nconst createClassMap = config => {\n const {\n theme,\n classGroups\n } = config;\n return processClassGroups(classGroups, theme);\n};\n// Split into separate functions to maintain monomorphic call sites\nconst processClassGroups = (classGroups, theme) => {\n const classMap = createClassPartObject();\n for (const classGroupId in classGroups) {\n const group = classGroups[classGroupId];\n processClassesRecursively(group, classMap, classGroupId, theme);\n }\n return classMap;\n};\nconst processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {\n const len = classGroup.length;\n for (let i = 0; i < len; i++) {\n const classDefinition = classGroup[i];\n processClassDefinition(classDefinition, classPartObject, classGroupId, theme);\n }\n};\n// Split into separate functions for each type to maintain monomorphic call sites\nconst processClassDefinition = (classDefinition, classPartObject, classGroupId, theme) => {\n if (typeof classDefinition === 'string') {\n processStringDefinition(classDefinition, classPartObject, classGroupId);\n return;\n }\n if (typeof classDefinition === 'function') {\n processFunctionDefinition(classDefinition, classPartObject, classGroupId, theme);\n return;\n }\n processObjectDefinition(classDefinition, classPartObject, classGroupId, theme);\n};\nconst processStringDefinition = (classDefinition, classPartObject, classGroupId) => {\n const classPartObjectToEdit = classDefinition === '' ? classPartObject : getPart(classPartObject, classDefinition);\n classPartObjectToEdit.classGroupId = classGroupId;\n};\nconst processFunctionDefinition = (classDefinition, classPartObject, classGroupId, theme) => {\n if (isThemeGetter(classDefinition)) {\n processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);\n return;\n }\n if (classPartObject.validators === null) {\n classPartObject.validators = [];\n }\n classPartObject.validators.push(createClassValidatorObject(classGroupId, classDefinition));\n};\nconst processObjectDefinition = (classDefinition, classPartObject, classGroupId, theme) => {\n const entries = Object.entries(classDefinition);\n const len = entries.length;\n for (let i = 0; i < len; i++) {\n const [key, value] = entries[i];\n processClassesRecursively(value, getPart(classPartObject, key), classGroupId, theme);\n }\n};\nconst getPart = (classPartObject, path) => {\n let current = classPartObject;\n const parts = path.split(CLASS_PART_SEPARATOR);\n const len = parts.length;\n for (let i = 0; i < len; i++) {\n const part = parts[i];\n let next = current.nextPart.get(part);\n if (!next) {\n next = createClassPartObject();\n current.nextPart.set(part, next);\n }\n current = next;\n }\n return current;\n};\n// Type guard maintains monomorphic check\nconst isThemeGetter = func => 'isThemeGetter' in func && func.isThemeGetter === true;\n\n// LRU cache implementation using plain objects for simplicity\nconst createLruCache = maxCacheSize => {\n if (maxCacheSize < 1) {\n return {\n get: () => undefined,\n set: () => {}\n };\n }\n let cacheSize = 0;\n let cache = Object.create(null);\n let previousCache = Object.create(null);\n const update = (key, value) => {\n cache[key] = value;\n cacheSize++;\n if (cacheSize > maxCacheSize) {\n cacheSize = 0;\n previousCache = cache;\n cache = Object.create(null);\n }\n };\n return {\n get(key) {\n let value = cache[key];\n if (value !== undefined) {\n return value;\n }\n if ((value = previousCache[key]) !== undefined) {\n update(key, value);\n return value;\n }\n },\n set(key, value) {\n if (key in cache) {\n cache[key] = value;\n } else {\n update(key, value);\n }\n }\n };\n};\nconst IMPORTANT_MODIFIER = '!';\nconst MODIFIER_SEPARATOR = ':';\nconst EMPTY_MODIFIERS = [];\n// Pre-allocated result object shape for consistency\nconst createResultObject = (modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition, isExternal) => ({\n modifiers,\n hasImportantModifier,\n baseClassName,\n maybePostfixModifierPosition,\n isExternal\n});\nconst createParseClassName = config => {\n const {\n prefix,\n experimentalParseClassName\n } = config;\n /**\n * Parse class name into parts.\n *\n * Inspired by `splitAtTopLevelOnly` used in Tailwind CSS\n * @see https://github.com/tailwindlabs/tailwindcss/blob/v3.2.2/src/util/splitAtTopLevelOnly.js\n */\n let parseClassName = className => {\n // Use simple array with push for better performance\n const modifiers = [];\n let bracketDepth = 0;\n let parenDepth = 0;\n let modifierStart = 0;\n let postfixModifierPosition;\n const len = className.length;\n for (let index = 0; index < len; index++) {\n const currentCharacter = className[index];\n if (bracketDepth === 0 && parenDepth === 0) {\n if (currentCharacter === MODIFIER_SEPARATOR) {\n modifiers.push(className.slice(modifierStart, index));\n modifierStart = index + 1;\n continue;\n }\n if (currentCharacter === '/') {\n postfixModifierPosition = index;\n continue;\n }\n }\n if (currentCharacter === '[') bracketDepth++;else if (currentCharacter === ']') bracketDepth--;else if (currentCharacter === '(') parenDepth++;else if (currentCharacter === ')') parenDepth--;\n }\n const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.slice(modifierStart);\n // Inline important modifier check\n let baseClassName = baseClassNameWithImportantModifier;\n let hasImportantModifier = false;\n if (baseClassNameWithImportantModifier.endsWith(IMPORTANT_MODIFIER)) {\n baseClassName = baseClassNameWithImportantModifier.slice(0, -1);\n hasImportantModifier = true;\n } else if (\n /**\n * In Tailwind CSS v3 the important modifier was at the start of the base class name. This is still supported for legacy reasons.\n * @see https://github.com/dcastil/tailwind-merge/issues/513#issuecomment-2614029864\n */\n baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER)) {\n baseClassName = baseClassNameWithImportantModifier.slice(1);\n hasImportantModifier = true;\n }\n const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : undefined;\n return createResultObject(modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition);\n };\n if (prefix) {\n const fullPrefix = prefix + MODIFIER_SEPARATOR;\n const parseClassNameOriginal = parseClassName;\n parseClassName = className => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.slice(fullPrefix.length)) : createResultObject(EMPTY_MODIFIERS, false, className, undefined, true);\n }\n if (experimentalParseClassName) {\n const parseClassNameOriginal = parseClassName;\n parseClassName = className => experimentalParseClassName({\n className,\n parseClassName: parseClassNameOriginal\n });\n }\n return parseClassName;\n};\n\n/**\n * Sorts modifiers according to following schema:\n * - Predefined modifiers are sorted alphabetically\n * - When an arbitrary variant appears, it must be preserved which modifiers are before and after it\n */\nconst createSortModifiers = config => {\n // Pre-compute weights for all known modifiers for O(1) comparison\n const modifierWeights = new Map();\n // Assign weights to sensitive modifiers (highest priority, but preserve order)\n config.orderSensitiveModifiers.forEach((mod, index) => {\n modifierWeights.set(mod, 1000000 + index); // High weights for sensitive mods\n });\n return modifiers => {\n const result = [];\n let currentSegment = [];\n // Process modifiers in one pass\n for (let i = 0; i < modifiers.length; i++) {\n const modifier = modifiers[i];\n // Check if modifier is sensitive (starts with '[' or in orderSensitiveModifiers)\n const isArbitrary = modifier[0] === '[';\n const isOrderSensitive = modifierWeights.has(modifier);\n if (isArbitrary || isOrderSensitive) {\n // Sort and flush current segment alphabetically\n if (currentSegment.length > 0) {\n currentSegment.sort();\n result.push(...currentSegment);\n currentSegment = [];\n }\n result.push(modifier);\n } else {\n // Regular modifier - add to current segment for batch sorting\n currentSegment.push(modifier);\n }\n }\n // Sort and add any remaining segment items\n if (currentSegment.length > 0) {\n currentSegment.sort();\n result.push(...currentSegment);\n }\n return result;\n };\n};\nconst createConfigUtils = config => ({\n cache: createLruCache(config.cacheSize),\n parseClassName: createParseClassName(config),\n sortModifiers: createSortModifiers(config),\n ...createClassGroupUtils(config)\n});\nconst SPLIT_CLASSES_REGEX = /\\s+/;\nconst mergeClassList = (classList, configUtils) => {\n const {\n parseClassName,\n getClassGroupId,\n getConflictingClassGroupIds,\n sortModifiers\n } = configUtils;\n /**\n * Set of classGroupIds in following format:\n * `{importantModifier}{variantModifiers}{classGroupId}`\n * @example 'float'\n * @example 'hover:focus:bg-color'\n * @example 'md:!pr'\n */\n const classGroupsInConflict = [];\n const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);\n let result = '';\n for (let index = classNames.length - 1; index >= 0; index -= 1) {\n const originalClassName = classNames[index];\n const {\n isExternal,\n modifiers,\n hasImportantModifier,\n baseClassName,\n maybePostfixModifierPosition\n } = parseClassName(originalClassName);\n if (isExternal) {\n result = originalClassName + (result.length > 0 ? ' ' + result : result);\n continue;\n }\n let hasPostfixModifier = !!maybePostfixModifierPosition;\n let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);\n if (!classGroupId) {\n if (!hasPostfixModifier) {\n // Not a Tailwind class\n result = originalClassName + (result.length > 0 ? ' ' + result : result);\n continue;\n }\n classGroupId = getClassGroupId(baseClassName);\n if (!classGroupId) {\n // Not a Tailwind class\n result = originalClassName + (result.length > 0 ? ' ' + result : result);\n continue;\n }\n hasPostfixModifier = false;\n }\n // Fast path: skip sorting for empty or single modifier\n const variantModifier = modifiers.length === 0 ? '' : modifiers.length === 1 ? modifiers[0] : sortModifiers(modifiers).join(':');\n const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;\n const classId = modifierId + classGroupId;\n if (classGroupsInConflict.indexOf(classId) > -1) {\n // Tailwind class omitted due to conflict\n continue;\n }\n classGroupsInConflict.push(classId);\n const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier);\n for (let i = 0; i < conflictGroups.length; ++i) {\n const group = conflictGroups[i];\n classGroupsInConflict.push(modifierId + group);\n }\n // Tailwind class not in conflict\n result = originalClassName + (result.length > 0 ? ' ' + result : result);\n }\n return result;\n};\n\n/**\n * The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better.\n *\n * Specifically:\n * - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js\n * - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts\n *\n * Original code has MIT license: Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)\n */\nconst twJoin = (...classLists) => {\n let index = 0;\n let argument;\n let resolvedValue;\n let string = '';\n while (index < classLists.length) {\n if (argument = classLists[index++]) {\n if (resolvedValue = toValue(argument)) {\n string && (string += ' ');\n string += resolvedValue;\n }\n }\n }\n return string;\n};\nconst toValue = mix => {\n // Fast path for strings\n if (typeof mix === 'string') {\n return mix;\n }\n let resolvedValue;\n let string = '';\n for (let k = 0; k < mix.length; k++) {\n if (mix[k]) {\n if (resolvedValue = toValue(mix[k])) {\n string && (string += ' ');\n string += resolvedValue;\n }\n }\n }\n return string;\n};\nconst createTailwindMerge = (createConfigFirst, ...createConfigRest) => {\n let configUtils;\n let cacheGet;\n let cacheSet;\n let functionToCall;\n const initTailwindMerge = classList => {\n const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());\n configUtils = createConfigUtils(config);\n cacheGet = configUtils.cache.get;\n cacheSet = configUtils.cache.set;\n functionToCall = tailwindMerge;\n return tailwindMerge(classList);\n };\n const tailwindMerge = classList => {\n const cachedResult = cacheGet(classList);\n if (cachedResult) {\n return cachedResult;\n }\n const result = mergeClassList(classList, configUtils);\n cacheSet(classList, result);\n return result;\n };\n functionToCall = initTailwindMerge;\n return (...args) => functionToCall(twJoin(...args));\n};\nconst fallbackThemeArr = [];\nconst fromTheme = key => {\n const themeGetter = theme => theme[key] || fallbackThemeArr;\n themeGetter.isThemeGetter = true;\n return themeGetter;\n};\nconst arbitraryValueRegex = /^\\[(?:(\\w[\\w-]*):)?(.+)\\]$/i;\nconst arbitraryVariableRegex = /^\\((?:(\\w[\\w-]*):)?(.+)\\)$/i;\nconst fractionRegex = /^\\d+\\/\\d+$/;\nconst tshirtUnitRegex = /^(\\d+(\\.\\d+)?)?(xs|sm|md|lg|xl)$/;\nconst lengthUnitRegex = /\\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\\b(calc|min|max|clamp)\\(.+\\)|^0$/;\nconst colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\\(.+\\)$/;\n// Shadow always begins with x and y offset separated by underscore optionally prepended by inset\nconst shadowRegex = /^(inset_)?-?((\\d+)?\\.?(\\d+)[a-z]+|0)_-?((\\d+)?\\.?(\\d+)[a-z]+|0)/;\nconst imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\\(.+\\)$/;\nconst isFraction = value => fractionRegex.test(value);\nconst isNumber = value => !!value && !Number.isNaN(Number(value));\nconst isInteger = value => !!value && Number.isInteger(Number(value));\nconst isPercent = value => value.endsWith('%') && isNumber(value.slice(0, -1));\nconst isTshirtSize = value => tshirtUnitRegex.test(value);\nconst isAny = () => true;\nconst isLengthOnly = value =>\n// `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.\n// For example, `hsl(0 0% 0%)` would be classified as a length without this check.\n// I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.\nlengthUnitRegex.test(value) && !colorFunctionRegex.test(value);\nconst isNever = () => false;\nconst isShadow = value => shadowRegex.test(value);\nconst isImage = value => imageRegex.test(value);\nconst isAnyNonArbitrary = value => !isArbitraryValue(value) && !isArbitraryVariable(value);\nconst isArbitrarySize = value => getIsArbitraryValue(value, isLabelSize, isNever);\nconst isArbitraryValue = value => arbitraryValueRegex.test(value);\nconst isArbitraryLength = value => getIsArbitraryValue(value, isLabelLength, isLengthOnly);\nconst isArbitraryNumber = value => getIsArbitraryValue(value, isLabelNumber, isNumber);\nconst isArbitraryPosition = value => getIsArbitraryValue(value, isLabelPosition, isNever);\nconst isArbitraryImage = value => getIsArbitraryValue(value, isLabelImage, isImage);\nconst isArbitraryShadow = value => getIsArbitraryValue(value, isLabelShadow, isShadow);\nconst isArbitraryVariable = value => arbitraryVariableRegex.test(value);\nconst isArbitraryVariableLength = value => getIsArbitraryVariable(value, isLabelLength);\nconst isArbitraryVariableFamilyName = value => getIsArbitraryVariable(value, isLabelFamilyName);\nconst isArbitraryVariablePosition = value => getIsArbitraryVariable(value, isLabelPosition);\nconst isArbitraryVariableSize = value => getIsArbitraryVariable(value, isLabelSize);\nconst isArbitraryVariableImage = value => getIsArbitraryVariable(value, isLabelImage);\nconst isArbitraryVariableShadow = value => getIsArbitraryVariable(value, isLabelShadow, true);\n// Helpers\nconst getIsArbitraryValue = (value, testLabel, testValue) => {\n const result = arbitraryValueRegex.exec(value);\n if (result) {\n if (result[1]) {\n return testLabel(result[1]);\n }\n return testValue(result[2]);\n }\n return false;\n};\nconst getIsArbitraryVariable = (value, testLabel, shouldMatchNoLabel = false) => {\n const result = arbitraryVariableRegex.exec(value);\n if (result) {\n if (result[1]) {\n return testLabel(result[1]);\n }\n return shouldMatchNoLabel;\n }\n return false;\n};\n// Labels\nconst isLabelPosition = label => label === 'position' || label === 'percentage';\nconst isLabelImage = label => label === 'image' || label === 'url';\nconst isLabelSize = label => label === 'length' || label === 'size' || label === 'bg-size';\nconst isLabelLength = label => label === 'length';\nconst isLabelNumber = label => label === 'number';\nconst isLabelFamilyName = label => label === 'family-name';\nconst isLabelShadow = label => label === 'shadow';\nconst validators = /*#__PURE__*/Object.defineProperty({\n __proto__: null,\n isAny,\n isAnyNonArbitrary,\n isArbitraryImage,\n isArbitraryLength,\n isArbitraryNumber,\n isArbitraryPosition,\n isArbitraryShadow,\n isArbitrarySize,\n isArbitraryValue,\n isArbitraryVariable,\n isArbitraryVariableFamilyName,\n isArbitraryVariableImage,\n isArbitraryVariableLength,\n isArbitraryVariablePosition,\n isArbitraryVariableShadow,\n isArbitraryVariableSize,\n isFraction,\n isInteger,\n isNumber,\n isPercent,\n isTshirtSize\n}, Symbol.toStringTag, {\n value: 'Module'\n});\nconst getDefaultConfig = () => {\n /**\n * Theme getters for theme variable namespaces\n * @see https://tailwindcss.com/docs/theme#theme-variable-namespaces\n */\n /***/\n const themeColor = fromTheme('color');\n const themeFont = fromTheme('font');\n const themeText = fromTheme('text');\n const themeFontWeight = fromTheme('font-weight');\n const themeTracking = fromTheme('tracking');\n const themeLeading = fromTheme('leading');\n const themeBreakpoint = fromTheme('breakpoint');\n const themeContainer = fromTheme('container');\n const themeSpacing = fromTheme('spacing');\n const themeRadius = fromTheme('radius');\n const themeShadow = fromTheme('shadow');\n const themeInsetShadow = fromTheme('inset-shadow');\n const themeTextShadow = fromTheme('text-shadow');\n const themeDropShadow = fromTheme('drop-shadow');\n const themeBlur = fromTheme('blur');\n const themePerspective = fromTheme('perspective');\n const themeAspect = fromTheme('aspect');\n const themeEase = fromTheme('ease');\n const themeAnimate = fromTheme('animate');\n /**\n * Helpers to avoid repeating the same scales\n *\n * We use functions that create a new array every time they're called instead of static arrays.\n * This ensures that users who modify any scale by mutating the array (e.g. with `array.push(element)`) don't accidentally mutate arrays in other parts of the config.\n */\n /***/\n const scaleBreak = () => ['auto', 'avoid', 'all', 'avoid-page', 'page', 'left', 'right', 'column'];\n const scalePosition = () => ['center', 'top', 'bottom', 'left', 'right', 'top-left',\n // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378\n 'left-top', 'top-right',\n // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378\n 'right-top', 'bottom-right',\n // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378\n 'right-bottom', 'bottom-left',\n // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378\n 'left-bottom'];\n const scalePositionWithArbitrary = () => [...scalePosition(), isArbitraryVariable, isArbitraryValue];\n const scaleOverflow = () => ['auto', 'hidden', 'clip', 'visible', 'scroll'];\n const scaleOverscroll = () => ['auto', 'contain', 'none'];\n const scaleUnambiguousSpacing = () => [isArbitraryVariable, isArbitraryValue, themeSpacing];\n const scaleInset = () => [isFraction, 'full', 'auto', ...scaleUnambiguousSpacing()];\n const scaleGridTemplateColsRows = () => [isInteger, 'none', 'subgrid', isArbitraryVariable, isArbitraryValue];\n const scaleGridColRowStartAndEnd = () => ['auto', {\n span: ['full', isInteger, isArbitraryVariable, isArbitraryValue]\n }, isInteger, isArbitraryVariable, isArbitraryValue];\n const scaleGridColRowStartOrEnd = () => [isInteger, 'auto', isArbitraryVariable, isArbitraryValue];\n const scaleGridAutoColsRows = () => ['auto', 'min', 'max', 'fr', isArbitraryVariable, isArbitraryValue];\n const scaleAlignPrimaryAxis = () => ['start', 'end', 'center', 'between', 'around', 'evenly', 'stretch', 'baseline', 'center-safe', 'end-safe'];\n const scaleAlignSecondaryAxis = () => ['start', 'end', 'center', 'stretch', 'center-safe', 'end-safe'];\n const scaleMargin = () => ['auto', ...scaleUnambiguousSpacing()];\n const scaleSizing = () => [isFraction, 'auto', 'full', 'dvw', 'dvh', 'lvw', 'lvh', 'svw', 'svh', 'min', 'max', 'fit', ...scaleUnambiguousSpacing()];\n const scaleColor = () => [themeColor, isArbitraryVariable, isArbitraryValue];\n const scaleBgPosition = () => [...scalePosition(), isArbitraryVariablePosition, isArbitraryPosition, {\n position: [isArbitraryVariable, isArbitraryValue]\n }];\n const scaleBgRepeat = () => ['no-repeat', {\n repeat: ['', 'x', 'y', 'space', 'round']\n }];\n const scaleBgSize = () => ['auto', 'cover', 'contain', isArbitraryVariableSize, isArbitrarySize, {\n size: [isArbitraryVariable, isArbitraryValue]\n }];\n const scaleGradientStopPosition = () => [isPercent, isArbitraryVariableLength, isArbitraryLength];\n const scaleRadius = () => [\n // Deprecated since Tailwind CSS v4.0.0\n '', 'none', 'full', themeRadius, isArbitraryVariable, isArbitraryValue];\n const scaleBorderWidth = () => ['', isNumber, isArbitraryVariableLength, isArbitraryLength];\n const scaleLineStyle = () => ['solid', 'dashed', 'dotted', 'double'];\n const scaleBlendMode = () => ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity'];\n const scaleMaskImagePosition = () => [isNumber, isPercent, isArbitraryVariablePosition, isArbitraryPosition];\n const scaleBlur = () => [\n // Deprecated since Tailwind CSS v4.0.0\n '', 'none', themeBlur, isArbitraryVariable, isArbitraryValue];\n const scaleRotate = () => ['none', isNumber, isArbitraryVariable, isArbitraryValue];\n const scaleScale = () => ['none', isNumber, isArbitraryVariable, isArbitraryValue];\n const scaleSkew = () => [isNumber, isArbitraryVariable, isArbitraryValue];\n const scaleTranslate = () => [isFraction, 'full', ...scaleUnambiguousSpacing()];\n return {\n cacheSize: 500,\n theme: {\n animate: ['spin', 'ping', 'pulse', 'bounce'],\n aspect: ['video'],\n blur: [isTshirtSize],\n breakpoint: [isTshirtSize],\n color: [isAny],\n container: [isTshirtSize],\n 'drop-shadow': [isTshirtSize],\n ease: ['in', 'out', 'in-out'],\n font: [isAnyNonArbitrary],\n 'font-weight': ['thin', 'extralight', 'light', 'normal', 'medium', 'semibold', 'bold', 'extrabold', 'black'],\n 'inset-shadow': [isTshirtSize],\n leading: ['none', 'tight', 'snug', 'normal', 'relaxed', 'loose'],\n perspective: ['dramatic', 'near', 'normal', 'midrange', 'distant', 'none'],\n radius: [isTshirtSize],\n shadow: [isTshirtSize],\n spacing: ['px', isNumber],\n text: [isTshirtSize],\n 'text-shadow': [isTshirtSize],\n tracking: ['tighter', 'tight', 'normal', 'wide', 'wider', 'widest']\n },\n classGroups: {\n // --------------\n // --- Layout ---\n // --------------\n /**\n * Aspect Ratio\n * @see https://tailwindcss.com/docs/aspect-ratio\n */\n aspect: [{\n aspect: ['auto', 'square', isFraction, isArbitraryValue, isArbitraryVariable, themeAspect]\n }],\n /**\n * Container\n * @see https://tailwindcss.com/docs/container\n * @deprecated since Tailwind CSS v4.0.0\n */\n container: ['container'],\n /**\n * Columns\n * @see https://tailwindcss.com/docs/columns\n */\n columns: [{\n columns: [isNumber, isArbitraryValue, isArbitraryVariable, themeContainer]\n }],\n /**\n * Break After\n * @see https://tailwindcss.com/docs/break-after\n */\n 'break-after': [{\n 'break-after': scaleBreak()\n }],\n /**\n * Break Before\n * @see https://tailwindcss.com/docs/break-before\n */\n 'break-before': [{\n 'break-before': scaleBreak()\n }],\n /**\n * Break Inside\n * @see https://tailwindcss.com/docs/break-inside\n */\n 'break-inside': [{\n 'break-inside': ['auto', 'avoid', 'avoid-page', 'avoid-column']\n }],\n /**\n * Box Decoration Break\n * @see https://tailwindcss.com/docs/box-decoration-break\n */\n 'box-decoration': [{\n 'box-decoration': ['slice', 'clone']\n }],\n /**\n * Box Sizing\n * @see https://tailwindcss.com/docs/box-sizing\n */\n box: [{\n box: ['border', 'content']\n }],\n /**\n * Display\n * @see https://tailwindcss.com/docs/display\n */\n display: ['block', 'inline-block', 'inline', 'flex', 'inline-flex', 'table', 'inline-table', 'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row-group', 'table-row', 'flow-root', 'grid', 'inline-grid', 'contents', 'list-item', 'hidden'],\n /**\n * Screen Reader Only\n * @see https://tailwindcss.com/docs/display#screen-reader-only\n */\n sr: ['sr-only', 'not-sr-only'],\n /**\n * Floats\n * @see https://tailwindcss.com/docs/float\n */\n float: [{\n float: ['right', 'left', 'none', 'start', 'end']\n }],\n /**\n * Clear\n * @see https://tailwindcss.com/docs/clear\n */\n clear: [{\n clear: ['left', 'right', 'both', 'none', 'start', 'end']\n }],\n /**\n * Isolation\n * @see https://tailwindcss.com/docs/isolation\n */\n isolation: ['isolate', 'isolation-auto'],\n /**\n * Object Fit\n * @see https://tailwindcss.com/docs/object-fit\n */\n 'object-fit': [{\n object: ['contain', 'cover', 'fill', 'none', 'scale-down']\n }],\n /**\n * Object Position\n * @see https://tailwindcss.com/docs/object-position\n */\n 'object-position': [{\n object: scalePositionWithArbitrary()\n }],\n /**\n * Overflow\n * @see https://tailwindcss.com/docs/overflow\n */\n overflow: [{\n overflow: scaleOverflow()\n }],\n /**\n * Overflow X\n * @see https://tailwindcss.com/docs/overflow\n */\n 'overflow-x': [{\n 'overflow-x': scaleOverflow()\n }],\n /**\n * Overflow Y\n * @see https://tailwindcss.com/docs/overflow\n */\n 'overflow-y': [{\n 'overflow-y': scaleOverflow()\n }],\n /**\n * Overscroll Behavior\n * @see https://tailwindcss.com/docs/overscroll-behavior\n */\n overscroll: [{\n overscroll: scaleOverscroll()\n }],\n /**\n * Overscroll Behavior X\n * @see https://tailwindcss.com/docs/overscroll-behavior\n */\n 'overscroll-x': [{\n 'overscroll-x': scaleOverscroll()\n }],\n /**\n * Overscroll Behavior Y\n * @see https://tailwindcss.com/docs/overscroll-behavior\n */\n 'overscroll-y': [{\n 'overscroll-y': scaleOverscroll()\n }],\n /**\n * Position\n * @see https://tailwindcss.com/docs/position\n */\n position: ['static', 'fixed', 'absolute', 'relative', 'sticky'],\n /**\n * Top / Right / Bottom / Left\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n inset: [{\n inset: scaleInset()\n }],\n /**\n * Right / Left\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n 'inset-x': [{\n 'inset-x': scaleInset()\n }],\n /**\n * Top / Bottom\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n 'inset-y': [{\n 'inset-y': scaleInset()\n }],\n /**\n * Start\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n start: [{\n start: scaleInset()\n }],\n /**\n * End\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n end: [{\n end: scaleInset()\n }],\n /**\n * Top\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n top: [{\n top: scaleInset()\n }],\n /**\n * Right\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n right: [{\n right: scaleInset()\n }],\n /**\n * Bottom\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n bottom: [{\n bottom: scaleInset()\n }],\n /**\n * Left\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n left: [{\n left: scaleInset()\n }],\n /**\n * Visibility\n * @see https://tailwindcss.com/docs/visibility\n */\n visibility: ['visible', 'invisible', 'collapse'],\n /**\n * Z-Index\n * @see https://tailwindcss.com/docs/z-index\n */\n z: [{\n z: [isInteger, 'auto', isArbitraryVariable, isArbitraryValue]\n }],\n // ------------------------\n // --- Flexbox and Grid ---\n // ------------------------\n /**\n * Flex Basis\n * @see https://tailwindcss.com/docs/flex-basis\n */\n basis: [{\n basis: [isFraction, 'full', 'auto', themeContainer, ...scaleUnambiguousSpacing()]\n }],\n /**\n * Flex Direction\n * @see https://tailwindcss.com/docs/flex-direction\n */\n 'flex-direction': [{\n flex: ['row', 'row-reverse', 'col', 'col-reverse']\n }],\n /**\n * Flex Wrap\n * @see https://tailwindcss.com/docs/flex-wrap\n */\n 'flex-wrap': [{\n flex: ['nowrap', 'wrap', 'wrap-reverse']\n }],\n /**\n * Flex\n * @see https://tailwindcss.com/docs/flex\n */\n flex: [{\n flex: [isNumber, isFraction, 'auto', 'initial', 'none', isArbitraryValue]\n }],\n /**\n * Flex Grow\n * @see https://tailwindcss.com/docs/flex-grow\n */\n grow: [{\n grow: ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Flex Shrink\n * @see https://tailwindcss.com/docs/flex-shrink\n */\n shrink: [{\n shrink: ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Order\n * @see https://tailwindcss.com/docs/order\n */\n order: [{\n order: [isInteger, 'first', 'last', 'none', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Grid Template Columns\n * @see https://tailwindcss.com/docs/grid-template-columns\n */\n 'grid-cols': [{\n 'grid-cols': scaleGridTemplateColsRows()\n }],\n /**\n * Grid Column Start / End\n * @see https://tailwindcss.com/docs/grid-column\n */\n 'col-start-end': [{\n col: scaleGridColRowStartAndEnd()\n }],\n /**\n * Grid Column Start\n * @see https://tailwindcss.com/docs/grid-column\n */\n 'col-start': [{\n 'col-start': scaleGridColRowStartOrEnd()\n }],\n /**\n * Grid Column End\n * @see https://tailwindcss.com/docs/grid-column\n */\n 'col-end': [{\n 'col-end': scaleGridColRowStartOrEnd()\n }],\n /**\n * Grid Template Rows\n * @see https://tailwindcss.com/docs/grid-template-rows\n */\n 'grid-rows': [{\n 'grid-rows': scaleGridTemplateColsRows()\n }],\n /**\n * Grid Row Start / End\n * @see https://tailwindcss.com/docs/grid-row\n */\n 'row-start-end': [{\n row: scaleGridColRowStartAndEnd()\n }],\n /**\n * Grid Row Start\n * @see https://tailwindcss.com/docs/grid-row\n */\n 'row-start': [{\n 'row-start': scaleGridColRowStartOrEnd()\n }],\n /**\n * Grid Row End\n * @see https://tailwindcss.com/docs/grid-row\n */\n 'row-end': [{\n 'row-end': scaleGridColRowStartOrEnd()\n }],\n /**\n * Grid Auto Flow\n * @see https://tailwindcss.com/docs/grid-auto-flow\n */\n 'grid-flow': [{\n 'grid-flow': ['row', 'col', 'dense', 'row-dense', 'col-dense']\n }],\n /**\n * Grid Auto Columns\n * @see https://tailwindcss.com/docs/grid-auto-columns\n */\n 'auto-cols': [{\n 'auto-cols': scaleGridAutoColsRows()\n }],\n /**\n * Grid Auto Rows\n * @see https://tailwindcss.com/docs/grid-auto-rows\n */\n 'auto-rows': [{\n 'auto-rows': scaleGridAutoColsRows()\n }],\n /**\n * Gap\n * @see https://tailwindcss.com/docs/gap\n */\n gap: [{\n gap: scaleUnambiguousSpacing()\n }],\n /**\n * Gap X\n * @see https://tailwindcss.com/docs/gap\n */\n 'gap-x': [{\n 'gap-x': scaleUnambiguousSpacing()\n }],\n /**\n * Gap Y\n * @see https://tailwindcss.com/docs/gap\n */\n 'gap-y': [{\n 'gap-y': scaleUnambiguousSpacing()\n }],\n /**\n * Justify Content\n * @see https://tailwindcss.com/docs/justify-content\n */\n 'justify-content': [{\n justify: [...scaleAlignPrimaryAxis(), 'normal']\n }],\n /**\n * Justify Items\n * @see https://tailwindcss.com/docs/justify-items\n */\n 'justify-items': [{\n 'justify-items': [...scaleAlignSecondaryAxis(), 'normal']\n }],\n /**\n * Justify Self\n * @see https://tailwindcss.com/docs/justify-self\n */\n 'justify-self': [{\n 'justify-self': ['auto', ...scaleAlignSecondaryAxis()]\n }],\n /**\n * Align Content\n * @see https://tailwindcss.com/docs/align-content\n */\n 'align-content': [{\n content: ['normal', ...scaleAlignPrimaryAxis()]\n }],\n /**\n * Align Items\n * @see https://tailwindcss.com/docs/align-items\n */\n 'align-items': [{\n items: [...scaleAlignSecondaryAxis(), {\n baseline: ['', 'last']\n }]\n }],\n /**\n * Align Self\n * @see https://tailwindcss.com/docs/align-self\n */\n 'align-self': [{\n self: ['auto', ...scaleAlignSecondaryAxis(), {\n baseline: ['', 'last']\n }]\n }],\n /**\n * Place Content\n * @see https://tailwindcss.com/docs/place-content\n */\n 'place-content': [{\n 'place-content': scaleAlignPrimaryAxis()\n }],\n /**\n * Place Items\n * @see https://tailwindcss.com/docs/place-items\n */\n 'place-items': [{\n 'place-items': [...scaleAlignSecondaryAxis(), 'baseline']\n }],\n /**\n * Place Self\n * @see https://tailwindcss.com/docs/place-self\n */\n 'place-self': [{\n 'place-self': ['auto', ...scaleAlignSecondaryAxis()]\n }],\n // Spacing\n /**\n * Padding\n * @see https://tailwindcss.com/docs/padding\n */\n p: [{\n p: scaleUnambiguousSpacing()\n }],\n /**\n * Padding X\n * @see https://tailwindcss.com/docs/padding\n */\n px: [{\n px: scaleUnambiguousSpacing()\n }],\n /**\n * Padding Y\n * @see https://tailwindcss.com/docs/padding\n */\n py: [{\n py: scaleUnambiguousSpacing()\n }],\n /**\n * Padding Start\n * @see https://tailwindcss.com/docs/padding\n */\n ps: [{\n ps: scaleUnambiguousSpacing()\n }],\n /**\n * Padding End\n * @see https://tailwindcss.com/docs/padding\n */\n pe: [{\n pe: scaleUnambiguousSpacing()\n }],\n /**\n * Padding Top\n * @see https://tailwindcss.com/docs/padding\n */\n pt: [{\n pt: scaleUnambiguousSpacing()\n }],\n /**\n * Padding Right\n * @see https://tailwindcss.com/docs/padding\n */\n pr: [{\n pr: scaleUnambiguousSpacing()\n }],\n /**\n * Padding Bottom\n * @see https://tailwindcss.com/docs/padding\n */\n pb: [{\n pb: scaleUnambiguousSpacing()\n }],\n /**\n * Padding Left\n * @see https://tailwindcss.com/docs/padding\n */\n pl: [{\n pl: scaleUnambiguousSpacing()\n }],\n /**\n * Margin\n * @see https://tailwindcss.com/docs/margin\n */\n m: [{\n m: scaleMargin()\n }],\n /**\n * Margin X\n * @see https://tailwindcss.com/docs/margin\n */\n mx: [{\n mx: scaleMargin()\n }],\n /**\n * Margin Y\n * @see https://tailwindcss.com/docs/margin\n */\n my: [{\n my: scaleMargin()\n }],\n /**\n * Margin Start\n * @see https://tailwindcss.com/docs/margin\n */\n ms: [{\n ms: scaleMargin()\n }],\n /**\n * Margin End\n * @see https://tailwindcss.com/docs/margin\n */\n me: [{\n me: scaleMargin()\n }],\n /**\n * Margin Top\n * @see https://tailwindcss.com/docs/margin\n */\n mt: [{\n mt: scaleMargin()\n }],\n /**\n * Margin Right\n * @see https://tailwindcss.com/docs/margin\n */\n mr: [{\n mr: scaleMargin()\n }],\n /**\n * Margin Bottom\n * @see https://tailwindcss.com/docs/margin\n */\n mb: [{\n mb: scaleMargin()\n }],\n /**\n * Margin Left\n * @see https://tailwindcss.com/docs/margin\n */\n ml: [{\n ml: scaleMargin()\n }],\n /**\n * Space Between X\n * @see https://tailwindcss.com/docs/margin#adding-space-between-children\n */\n 'space-x': [{\n 'space-x': scaleUnambiguousSpacing()\n }],\n /**\n * Space Between X Reverse\n * @see https://tailwindcss.com/docs/margin#adding-space-between-children\n */\n 'space-x-reverse': ['space-x-reverse'],\n /**\n * Space Between Y\n * @see https://tailwindcss.com/docs/margin#adding-space-between-children\n */\n 'space-y': [{\n 'space-y': scaleUnambiguousSpacing()\n }],\n /**\n * Space Between Y Reverse\n * @see https://tailwindcss.com/docs/margin#adding-space-between-children\n */\n 'space-y-reverse': ['space-y-reverse'],\n // --------------\n // --- Sizing ---\n // --------------\n /**\n * Size\n * @see https://tailwindcss.com/docs/width#setting-both-width-and-height\n */\n size: [{\n size: scaleSizing()\n }],\n /**\n * Width\n * @see https://tailwindcss.com/docs/width\n */\n w: [{\n w: [themeContainer, 'screen', ...scaleSizing()]\n }],\n /**\n * Min-Width\n * @see https://tailwindcss.com/docs/min-width\n */\n 'min-w': [{\n 'min-w': [themeContainer, 'screen', /** Deprecated. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */\n 'none', ...scaleSizing()]\n }],\n /**\n * Max-Width\n * @see https://tailwindcss.com/docs/max-width\n */\n 'max-w': [{\n 'max-w': [themeContainer, 'screen', 'none', /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */\n 'prose', /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */\n {\n screen: [themeBreakpoint]\n }, ...scaleSizing()]\n }],\n /**\n * Height\n * @see https://tailwindcss.com/docs/height\n */\n h: [{\n h: ['screen', 'lh', ...scaleSizing()]\n }],\n /**\n * Min-Height\n * @see https://tailwindcss.com/docs/min-height\n */\n 'min-h': [{\n 'min-h': ['screen', 'lh', 'none', ...scaleSizing()]\n }],\n /**\n * Max-Height\n * @see https://tailwindcss.com/docs/max-height\n */\n 'max-h': [{\n 'max-h': ['screen', 'lh', ...scaleSizing()]\n }],\n // ------------------\n // --- Typography ---\n // ------------------\n /**\n * Font Size\n * @see https://tailwindcss.com/docs/font-size\n */\n 'font-size': [{\n text: ['base', themeText, isArbitraryVariableLength, isArbitraryLength]\n }],\n /**\n * Font Smoothing\n * @see https://tailwindcss.com/docs/font-smoothing\n */\n 'font-smoothing': ['antialiased', 'subpixel-antialiased'],\n /**\n * Font Style\n * @see https://tailwindcss.com/docs/font-style\n */\n 'font-style': ['italic', 'not-italic'],\n /**\n * Font Weight\n * @see https://tailwindcss.com/docs/font-weight\n */\n 'font-weight': [{\n font: [themeFontWeight, isArbitraryVariable, isArbitraryNumber]\n }],\n /**\n * Font Stretch\n * @see https://tailwindcss.com/docs/font-stretch\n */\n 'font-stretch': [{\n 'font-stretch': ['ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded', isPercent, isArbitraryValue]\n }],\n /**\n * Font Family\n * @see https://tailwindcss.com/docs/font-family\n */\n 'font-family': [{\n font: [isArbitraryVariableFamilyName, isArbitraryValue, themeFont]\n }],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-normal': ['normal-nums'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-ordinal': ['ordinal'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-slashed-zero': ['slashed-zero'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-figure': ['lining-nums', 'oldstyle-nums'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-spacing': ['proportional-nums', 'tabular-nums'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-fraction': ['diagonal-fractions', 'stacked-fractions'],\n /**\n * Letter Spacing\n * @see https://tailwindcss.com/docs/letter-spacing\n */\n tracking: [{\n tracking: [themeTracking, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Line Clamp\n * @see https://tailwindcss.com/docs/line-clamp\n */\n 'line-clamp': [{\n 'line-clamp': [isNumber, 'none', isArbitraryVariable, isArbitraryNumber]\n }],\n /**\n * Line Height\n * @see https://tailwindcss.com/docs/line-height\n */\n leading: [{\n leading: [/** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */\n themeLeading, ...scaleUnambiguousSpacing()]\n }],\n /**\n * List Style Image\n * @see https://tailwindcss.com/docs/list-style-image\n */\n 'list-image': [{\n 'list-image': ['none', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * List Style Position\n * @see https://tailwindcss.com/docs/list-style-position\n */\n 'list-style-position': [{\n list: ['inside', 'outside']\n }],\n /**\n * List Style Type\n * @see https://tailwindcss.com/docs/list-style-type\n */\n 'list-style-type': [{\n list: ['disc', 'decimal', 'none', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Text Alignment\n * @see https://tailwindcss.com/docs/text-align\n */\n 'text-alignment': [{\n text: ['left', 'center', 'right', 'justify', 'start', 'end']\n }],\n /**\n * Placeholder Color\n * @deprecated since Tailwind CSS v3.0.0\n * @see https://v3.tailwindcss.com/docs/placeholder-color\n */\n 'placeholder-color': [{\n placeholder: scaleColor()\n }],\n /**\n * Text Color\n * @see https://tailwindcss.com/docs/text-color\n */\n 'text-color': [{\n text: scaleColor()\n }],\n /**\n * Text Decoration\n * @see https://tailwindcss.com/docs/text-decoration\n */\n 'text-decoration': ['underline', 'overline', 'line-through', 'no-underline'],\n /**\n * Text Decoration Style\n * @see https://tailwindcss.com/docs/text-decoration-style\n */\n 'text-decoration-style': [{\n decoration: [...scaleLineStyle(), 'wavy']\n }],\n /**\n * Text Decoration Thickness\n * @see https://tailwindcss.com/docs/text-decoration-thickness\n */\n 'text-decoration-thickness': [{\n decoration: [isNumber, 'from-font', 'auto', isArbitraryVariable, isArbitraryLength]\n }],\n /**\n * Text Decoration Color\n * @see https://tailwindcss.com/docs/text-decoration-color\n */\n 'text-decoration-color': [{\n decoration: scaleColor()\n }],\n /**\n * Text Underline Offset\n * @see https://tailwindcss.com/docs/text-underline-offset\n */\n 'underline-offset': [{\n 'underline-offset': [isNumber, 'auto', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Text Transform\n * @see https://tailwindcss.com/docs/text-transform\n */\n 'text-transform': ['uppercase', 'lowercase', 'capitalize', 'normal-case'],\n /**\n * Text Overflow\n * @see https://tailwindcss.com/docs/text-overflow\n */\n 'text-overflow': ['truncate', 'text-ellipsis', 'text-clip'],\n /**\n * Text Wrap\n * @see https://tailwindcss.com/docs/text-wrap\n */\n 'text-wrap': [{\n text: ['wrap', 'nowrap', 'balance', 'pretty']\n }],\n /**\n * Text Indent\n * @see https://tailwindcss.com/docs/text-indent\n */\n indent: [{\n indent: scaleUnambiguousSpacing()\n }],\n /**\n * Vertical Alignment\n * @see https://tailwindcss.com/docs/vertical-align\n */\n 'vertical-align': [{\n align: ['baseline', 'top', 'middle', 'bottom', 'text-top', 'text-bottom', 'sub', 'super', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Whitespace\n * @see https://tailwindcss.com/docs/whitespace\n */\n whitespace: [{\n whitespace: ['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'break-spaces']\n }],\n /**\n * Word Break\n * @see https://tailwindcss.com/docs/word-break\n */\n break: [{\n break: ['normal', 'words', 'all', 'keep']\n }],\n /**\n * Overflow Wrap\n * @see https://tailwindcss.com/docs/overflow-wrap\n */\n wrap: [{\n wrap: ['break-word', 'anywhere', 'normal']\n }],\n /**\n * Hyphens\n * @see https://tailwindcss.com/docs/hyphens\n */\n hyphens: [{\n hyphens: ['none', 'manual', 'auto']\n }],\n /**\n * Content\n * @see https://tailwindcss.com/docs/content\n */\n content: [{\n content: ['none', isArbitraryVariable, isArbitraryValue]\n }],\n // -------------------\n // --- Backgrounds ---\n // -------------------\n /**\n * Background Attachment\n * @see https://tailwindcss.com/docs/background-attachment\n */\n 'bg-attachment': [{\n bg: ['fixed', 'local', 'scroll']\n }],\n /**\n * Background Clip\n * @see https://tailwindcss.com/docs/background-clip\n */\n 'bg-clip': [{\n 'bg-clip': ['border', 'padding', 'content', 'text']\n }],\n /**\n * Background Origin\n * @see https://tailwindcss.com/docs/background-origin\n */\n 'bg-origin': [{\n 'bg-origin': ['border', 'padding', 'content']\n }],\n /**\n * Background Position\n * @see https://tailwindcss.com/docs/background-position\n */\n 'bg-position': [{\n bg: scaleBgPosition()\n }],\n /**\n * Background Repeat\n * @see https://tailwindcss.com/docs/background-repeat\n */\n 'bg-repeat': [{\n bg: scaleBgRepeat()\n }],\n /**\n * Background Size\n * @see https://tailwindcss.com/docs/background-size\n */\n 'bg-size': [{\n bg: scaleBgSize()\n }],\n /**\n * Background Image\n * @see https://tailwindcss.com/docs/background-image\n */\n 'bg-image': [{\n bg: ['none', {\n linear: [{\n to: ['t', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl']\n }, isInteger, isArbitraryVariable, isArbitraryValue],\n radial: ['', isArbitraryVariable, isArbitraryValue],\n conic: [isInteger, isArbitraryVariable, isArbitraryValue]\n }, isArbitraryVariableImage, isArbitraryImage]\n }],\n /**\n * Background Color\n * @see https://tailwindcss.com/docs/background-color\n */\n 'bg-color': [{\n bg: scaleColor()\n }],\n /**\n * Gradient Color Stops From Position\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-from-pos': [{\n from: scaleGradientStopPosition()\n }],\n /**\n * Gradient Color Stops Via Position\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-via-pos': [{\n via: scaleGradientStopPosition()\n }],\n /**\n * Gradient Color Stops To Position\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-to-pos': [{\n to: scaleGradientStopPosition()\n }],\n /**\n * Gradient Color Stops From\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-from': [{\n from: scaleColor()\n }],\n /**\n * Gradient Color Stops Via\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-via': [{\n via: scaleColor()\n }],\n /**\n * Gradient Color Stops To\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-to': [{\n to: scaleColor()\n }],\n // ---------------\n // --- Borders ---\n // ---------------\n /**\n * Border Radius\n * @see https://tailwindcss.com/docs/border-radius\n */\n rounded: [{\n rounded: scaleRadius()\n }],\n /**\n * Border Radius Start\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-s': [{\n 'rounded-s': scaleRadius()\n }],\n /**\n * Border Radius End\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-e': [{\n 'rounded-e': scaleRadius()\n }],\n /**\n * Border Radius Top\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-t': [{\n 'rounded-t': scaleRadius()\n }],\n /**\n * Border Radius Right\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-r': [{\n 'rounded-r': scaleRadius()\n }],\n /**\n * Border Radius Bottom\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-b': [{\n 'rounded-b': scaleRadius()\n }],\n /**\n * Border Radius Left\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-l': [{\n 'rounded-l': scaleRadius()\n }],\n /**\n * Border Radius Start Start\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-ss': [{\n 'rounded-ss': scaleRadius()\n }],\n /**\n * Border Radius Start End\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-se': [{\n 'rounded-se': scaleRadius()\n }],\n /**\n * Border Radius End End\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-ee': [{\n 'rounded-ee': scaleRadius()\n }],\n /**\n * Border Radius End Start\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-es': [{\n 'rounded-es': scaleRadius()\n }],\n /**\n * Border Radius Top Left\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-tl': [{\n 'rounded-tl': scaleRadius()\n }],\n /**\n * Border Radius Top Right\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-tr': [{\n 'rounded-tr': scaleRadius()\n }],\n /**\n * Border Radius Bottom Right\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-br': [{\n 'rounded-br': scaleRadius()\n }],\n /**\n * Border Radius Bottom Left\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-bl': [{\n 'rounded-bl': scaleRadius()\n }],\n /**\n * Border Width\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w': [{\n border: scaleBorderWidth()\n }],\n /**\n * Border Width X\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-x': [{\n 'border-x': scaleBorderWidth()\n }],\n /**\n * Border Width Y\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-y': [{\n 'border-y': scaleBorderWidth()\n }],\n /**\n * Border Width Start\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-s': [{\n 'border-s': scaleBorderWidth()\n }],\n /**\n * Border Width End\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-e': [{\n 'border-e': scaleBorderWidth()\n }],\n /**\n * Border Width Top\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-t': [{\n 'border-t': scaleBorderWidth()\n }],\n /**\n * Border Width Right\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-r': [{\n 'border-r': scaleBorderWidth()\n }],\n /**\n * Border Width Bottom\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-b': [{\n 'border-b': scaleBorderWidth()\n }],\n /**\n * Border Width Left\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-l': [{\n 'border-l': scaleBorderWidth()\n }],\n /**\n * Divide Width X\n * @see https://tailwindcss.com/docs/border-width#between-children\n */\n 'divide-x': [{\n 'divide-x': scaleBorderWidth()\n }],\n /**\n * Divide Width X Reverse\n * @see https://tailwindcss.com/docs/border-width#between-children\n */\n 'divide-x-reverse': ['divide-x-reverse'],\n /**\n * Divide Width Y\n * @see https://tailwindcss.com/docs/border-width#between-children\n */\n 'divide-y': [{\n 'divide-y': scaleBorderWidth()\n }],\n /**\n * Divide Width Y Reverse\n * @see https://tailwindcss.com/docs/border-width#between-children\n */\n 'divide-y-reverse': ['divide-y-reverse'],\n /**\n * Border Style\n * @see https://tailwindcss.com/docs/border-style\n */\n 'border-style': [{\n border: [...scaleLineStyle(), 'hidden', 'none']\n }],\n /**\n * Divide Style\n * @see https://tailwindcss.com/docs/border-style#setting-the-divider-style\n */\n 'divide-style': [{\n divide: [...scaleLineStyle(), 'hidden', 'none']\n }],\n /**\n * Border Color\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color': [{\n border: scaleColor()\n }],\n /**\n * Border Color X\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-x': [{\n 'border-x': scaleColor()\n }],\n /**\n * Border Color Y\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-y': [{\n 'border-y': scaleColor()\n }],\n /**\n * Border Color S\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-s': [{\n 'border-s': scaleColor()\n }],\n /**\n * Border Color E\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-e': [{\n 'border-e': scaleColor()\n }],\n /**\n * Border Color Top\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-t': [{\n 'border-t': scaleColor()\n }],\n /**\n * Border Color Right\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-r': [{\n 'border-r': scaleColor()\n }],\n /**\n * Border Color Bottom\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-b': [{\n 'border-b': scaleColor()\n }],\n /**\n * Border Color Left\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-l': [{\n 'border-l': scaleColor()\n }],\n /**\n * Divide Color\n * @see https://tailwindcss.com/docs/divide-color\n */\n 'divide-color': [{\n divide: scaleColor()\n }],\n /**\n * Outline Style\n * @see https://tailwindcss.com/docs/outline-style\n */\n 'outline-style': [{\n outline: [...scaleLineStyle(), 'none', 'hidden']\n }],\n /**\n * Outline Offset\n * @see https://tailwindcss.com/docs/outline-offset\n */\n 'outline-offset': [{\n 'outline-offset': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Outline Width\n * @see https://tailwindcss.com/docs/outline-width\n */\n 'outline-w': [{\n outline: ['', isNumber, isArbitraryVariableLength, isArbitraryLength]\n }],\n /**\n * Outline Color\n * @see https://tailwindcss.com/docs/outline-color\n */\n 'outline-color': [{\n outline: scaleColor()\n }],\n // ---------------\n // --- Effects ---\n // ---------------\n /**\n * Box Shadow\n * @see https://tailwindcss.com/docs/box-shadow\n */\n shadow: [{\n shadow: [\n // Deprecated since Tailwind CSS v4.0.0\n '', 'none', themeShadow, isArbitraryVariableShadow, isArbitraryShadow]\n }],\n /**\n * Box Shadow Color\n * @see https://tailwindcss.com/docs/box-shadow#setting-the-shadow-color\n */\n 'shadow-color': [{\n shadow: scaleColor()\n }],\n /**\n * Inset Box Shadow\n * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-shadow\n */\n 'inset-shadow': [{\n 'inset-shadow': ['none', themeInsetShadow, isArbitraryVariableShadow, isArbitraryShadow]\n }],\n /**\n * Inset Box Shadow Color\n * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-shadow-color\n */\n 'inset-shadow-color': [{\n 'inset-shadow': scaleColor()\n }],\n /**\n * Ring Width\n * @see https://tailwindcss.com/docs/box-shadow#adding-a-ring\n */\n 'ring-w': [{\n ring: scaleBorderWidth()\n }],\n /**\n * Ring Width Inset\n * @see https://v3.tailwindcss.com/docs/ring-width#inset-rings\n * @deprecated since Tailwind CSS v4.0.0\n * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158\n */\n 'ring-w-inset': ['ring-inset'],\n /**\n * Ring Color\n * @see https://tailwindcss.com/docs/box-shadow#setting-the-ring-color\n */\n 'ring-color': [{\n ring: scaleColor()\n }],\n /**\n * Ring Offset Width\n * @see https://v3.tailwindcss.com/docs/ring-offset-width\n * @deprecated since Tailwind CSS v4.0.0\n * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158\n */\n 'ring-offset-w': [{\n 'ring-offset': [isNumber, isArbitraryLength]\n }],\n /**\n * Ring Offset Color\n * @see https://v3.tailwindcss.com/docs/ring-offset-color\n * @deprecated since Tailwind CSS v4.0.0\n * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158\n */\n 'ring-offset-color': [{\n 'ring-offset': scaleColor()\n }],\n /**\n * Inset Ring Width\n * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-ring\n */\n 'inset-ring-w': [{\n 'inset-ring': scaleBorderWidth()\n }],\n /**\n * Inset Ring Color\n * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-ring-color\n */\n 'inset-ring-color': [{\n 'inset-ring': scaleColor()\n }],\n /**\n * Text Shadow\n * @see https://tailwindcss.com/docs/text-shadow\n */\n 'text-shadow': [{\n 'text-shadow': ['none', themeTextShadow, isArbitraryVariableShadow, isArbitraryShadow]\n }],\n /**\n * Text Shadow Color\n * @see https://tailwindcss.com/docs/text-shadow#setting-the-shadow-color\n */\n 'text-shadow-color': [{\n 'text-shadow': scaleColor()\n }],\n /**\n * Opacity\n * @see https://tailwindcss.com/docs/opacity\n */\n opacity: [{\n opacity: [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Mix Blend Mode\n * @see https://tailwindcss.com/docs/mix-blend-mode\n */\n 'mix-blend': [{\n 'mix-blend': [...scaleBlendMode(), 'plus-darker', 'plus-lighter']\n }],\n /**\n * Background Blend Mode\n * @see https://tailwindcss.com/docs/background-blend-mode\n */\n 'bg-blend': [{\n 'bg-blend': scaleBlendMode()\n }],\n /**\n * Mask Clip\n * @see https://tailwindcss.com/docs/mask-clip\n */\n 'mask-clip': [{\n 'mask-clip': ['border', 'padding', 'content', 'fill', 'stroke', 'view']\n }, 'mask-no-clip'],\n /**\n * Mask Composite\n * @see https://tailwindcss.com/docs/mask-composite\n */\n 'mask-composite': [{\n mask: ['add', 'subtract', 'intersect', 'exclude']\n }],\n /**\n * Mask Image\n * @see https://tailwindcss.com/docs/mask-image\n */\n 'mask-image-linear-pos': [{\n 'mask-linear': [isNumber]\n }],\n 'mask-image-linear-from-pos': [{\n 'mask-linear-from': scaleMaskImagePosition()\n }],\n 'mask-image-linear-to-pos': [{\n 'mask-linear-to': scaleMaskImagePosition()\n }],\n 'mask-image-linear-from-color': [{\n 'mask-linear-from': scaleColor()\n }],\n 'mask-image-linear-to-color': [{\n 'mask-linear-to': scaleColor()\n }],\n 'mask-image-t-from-pos': [{\n 'mask-t-from': scaleMaskImagePosition()\n }],\n 'mask-image-t-to-pos': [{\n 'mask-t-to': scaleMaskImagePosition()\n }],\n 'mask-image-t-from-color': [{\n 'mask-t-from': scaleColor()\n }],\n 'mask-image-t-to-color': [{\n 'mask-t-to': scaleColor()\n }],\n 'mask-image-r-from-pos': [{\n 'mask-r-from': scaleMaskImagePosition()\n }],\n 'mask-image-r-to-pos': [{\n 'mask-r-to': scaleMaskImagePosition()\n }],\n 'mask-image-r-from-color': [{\n 'mask-r-from': scaleColor()\n }],\n 'mask-image-r-to-color': [{\n 'mask-r-to': scaleColor()\n }],\n 'mask-image-b-from-pos': [{\n 'mask-b-from': scaleMaskImagePosition()\n }],\n 'mask-image-b-to-pos': [{\n 'mask-b-to': scaleMaskImagePosition()\n }],\n 'mask-image-b-from-color': [{\n 'mask-b-from': scaleColor()\n }],\n 'mask-image-b-to-color': [{\n 'mask-b-to': scaleColor()\n }],\n 'mask-image-l-from-pos': [{\n 'mask-l-from': scaleMaskImagePosition()\n }],\n 'mask-image-l-to-pos': [{\n 'mask-l-to': scaleMaskImagePosition()\n }],\n 'mask-image-l-from-color': [{\n 'mask-l-from': scaleColor()\n }],\n 'mask-image-l-to-color': [{\n 'mask-l-to': scaleColor()\n }],\n 'mask-image-x-from-pos': [{\n 'mask-x-from': scaleMaskImagePosition()\n }],\n 'mask-image-x-to-pos': [{\n 'mask-x-to': scaleMaskImagePosition()\n }],\n 'mask-image-x-from-color': [{\n 'mask-x-from': scaleColor()\n }],\n 'mask-image-x-to-color': [{\n 'mask-x-to': scaleColor()\n }],\n 'mask-image-y-from-pos': [{\n 'mask-y-from': scaleMaskImagePosition()\n }],\n 'mask-image-y-to-pos': [{\n 'mask-y-to': scaleMaskImagePosition()\n }],\n 'mask-image-y-from-color': [{\n 'mask-y-from': scaleColor()\n }],\n 'mask-image-y-to-color': [{\n 'mask-y-to': scaleColor()\n }],\n 'mask-image-radial': [{\n 'mask-radial': [isArbitraryVariable, isArbitraryValue]\n }],\n 'mask-image-radial-from-pos': [{\n 'mask-radial-from': scaleMaskImagePosition()\n }],\n 'mask-image-radial-to-pos': [{\n 'mask-radial-to': scaleMaskImagePosition()\n }],\n 'mask-image-radial-from-color': [{\n 'mask-radial-from': scaleColor()\n }],\n 'mask-image-radial-to-color': [{\n 'mask-radial-to': scaleColor()\n }],\n 'mask-image-radial-shape': [{\n 'mask-radial': ['circle', 'ellipse']\n }],\n 'mask-image-radial-size': [{\n 'mask-radial': [{\n closest: ['side', 'corner'],\n farthest: ['side', 'corner']\n }]\n }],\n 'mask-image-radial-pos': [{\n 'mask-radial-at': scalePosition()\n }],\n 'mask-image-conic-pos': [{\n 'mask-conic': [isNumber]\n }],\n 'mask-image-conic-from-pos': [{\n 'mask-conic-from': scaleMaskImagePosition()\n }],\n 'mask-image-conic-to-pos': [{\n 'mask-conic-to': scaleMaskImagePosition()\n }],\n 'mask-image-conic-from-color': [{\n 'mask-conic-from': scaleColor()\n }],\n 'mask-image-conic-to-color': [{\n 'mask-conic-to': scaleColor()\n }],\n /**\n * Mask Mode\n * @see https://tailwindcss.com/docs/mask-mode\n */\n 'mask-mode': [{\n mask: ['alpha', 'luminance', 'match']\n }],\n /**\n * Mask Origin\n * @see https://tailwindcss.com/docs/mask-origin\n */\n 'mask-origin': [{\n 'mask-origin': ['border', 'padding', 'content', 'fill', 'stroke', 'view']\n }],\n /**\n * Mask Position\n * @see https://tailwindcss.com/docs/mask-position\n */\n 'mask-position': [{\n mask: scaleBgPosition()\n }],\n /**\n * Mask Repeat\n * @see https://tailwindcss.com/docs/mask-repeat\n */\n 'mask-repeat': [{\n mask: scaleBgRepeat()\n }],\n /**\n * Mask Size\n * @see https://tailwindcss.com/docs/mask-size\n */\n 'mask-size': [{\n mask: scaleBgSize()\n }],\n /**\n * Mask Type\n * @see https://tailwindcss.com/docs/mask-type\n */\n 'mask-type': [{\n 'mask-type': ['alpha', 'luminance']\n }],\n /**\n * Mask Image\n * @see https://tailwindcss.com/docs/mask-image\n */\n 'mask-image': [{\n mask: ['none', isArbitraryVariable, isArbitraryValue]\n }],\n // ---------------\n // --- Filters ---\n // ---------------\n /**\n * Filter\n * @see https://tailwindcss.com/docs/filter\n */\n filter: [{\n filter: [\n // Deprecated since Tailwind CSS v3.0.0\n '', 'none', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Blur\n * @see https://tailwindcss.com/docs/blur\n */\n blur: [{\n blur: scaleBlur()\n }],\n /**\n * Brightness\n * @see https://tailwindcss.com/docs/brightness\n */\n brightness: [{\n brightness: [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Contrast\n * @see https://tailwindcss.com/docs/contrast\n */\n contrast: [{\n contrast: [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Drop Shadow\n * @see https://tailwindcss.com/docs/drop-shadow\n */\n 'drop-shadow': [{\n 'drop-shadow': [\n // Deprecated since Tailwind CSS v4.0.0\n '', 'none', themeDropShadow, isArbitraryVariableShadow, isArbitraryShadow]\n }],\n /**\n * Drop Shadow Color\n * @see https://tailwindcss.com/docs/filter-drop-shadow#setting-the-shadow-color\n */\n 'drop-shadow-color': [{\n 'drop-shadow': scaleColor()\n }],\n /**\n * Grayscale\n * @see https://tailwindcss.com/docs/grayscale\n */\n grayscale: [{\n grayscale: ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Hue Rotate\n * @see https://tailwindcss.com/docs/hue-rotate\n */\n 'hue-rotate': [{\n 'hue-rotate': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Invert\n * @see https://tailwindcss.com/docs/invert\n */\n invert: [{\n invert: ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Saturate\n * @see https://tailwindcss.com/docs/saturate\n */\n saturate: [{\n saturate: [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Sepia\n * @see https://tailwindcss.com/docs/sepia\n */\n sepia: [{\n sepia: ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Filter\n * @see https://tailwindcss.com/docs/backdrop-filter\n */\n 'backdrop-filter': [{\n 'backdrop-filter': [\n // Deprecated since Tailwind CSS v3.0.0\n '', 'none', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Blur\n * @see https://tailwindcss.com/docs/backdrop-blur\n */\n 'backdrop-blur': [{\n 'backdrop-blur': scaleBlur()\n }],\n /**\n * Backdrop Brightness\n * @see https://tailwindcss.com/docs/backdrop-brightness\n */\n 'backdrop-brightness': [{\n 'backdrop-brightness': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Contrast\n * @see https://tailwindcss.com/docs/backdrop-contrast\n */\n 'backdrop-contrast': [{\n 'backdrop-contrast': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Grayscale\n * @see https://tailwindcss.com/docs/backdrop-grayscale\n */\n 'backdrop-grayscale': [{\n 'backdrop-grayscale': ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Hue Rotate\n * @see https://tailwindcss.com/docs/backdrop-hue-rotate\n */\n 'backdrop-hue-rotate': [{\n 'backdrop-hue-rotate': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Invert\n * @see https://tailwindcss.com/docs/backdrop-invert\n */\n 'backdrop-invert': [{\n 'backdrop-invert': ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Opacity\n * @see https://tailwindcss.com/docs/backdrop-opacity\n */\n 'backdrop-opacity': [{\n 'backdrop-opacity': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Saturate\n * @see https://tailwindcss.com/docs/backdrop-saturate\n */\n 'backdrop-saturate': [{\n 'backdrop-saturate': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Sepia\n * @see https://tailwindcss.com/docs/backdrop-sepia\n */\n 'backdrop-sepia': [{\n 'backdrop-sepia': ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n // --------------\n // --- Tables ---\n // --------------\n /**\n * Border Collapse\n * @see https://tailwindcss.com/docs/border-collapse\n */\n 'border-collapse': [{\n border: ['collapse', 'separate']\n }],\n /**\n * Border Spacing\n * @see https://tailwindcss.com/docs/border-spacing\n */\n 'border-spacing': [{\n 'border-spacing': scaleUnambiguousSpacing()\n }],\n /**\n * Border Spacing X\n * @see https://tailwindcss.com/docs/border-spacing\n */\n 'border-spacing-x': [{\n 'border-spacing-x': scaleUnambiguousSpacing()\n }],\n /**\n * Border Spacing Y\n * @see https://tailwindcss.com/docs/border-spacing\n */\n 'border-spacing-y': [{\n 'border-spacing-y': scaleUnambiguousSpacing()\n }],\n /**\n * Table Layout\n * @see https://tailwindcss.com/docs/table-layout\n */\n 'table-layout': [{\n table: ['auto', 'fixed']\n }],\n /**\n * Caption Side\n * @see https://tailwindcss.com/docs/caption-side\n */\n caption: [{\n caption: ['top', 'bottom']\n }],\n // ---------------------------------\n // --- Transitions and Animation ---\n // ---------------------------------\n /**\n * Transition Property\n * @see https://tailwindcss.com/docs/transition-property\n */\n transition: [{\n transition: ['', 'all', 'colors', 'opacity', 'shadow', 'transform', 'none', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Transition Behavior\n * @see https://tailwindcss.com/docs/transition-behavior\n */\n 'transition-behavior': [{\n transition: ['normal', 'discrete']\n }],\n /**\n * Transition Duration\n * @see https://tailwindcss.com/docs/transition-duration\n */\n duration: [{\n duration: [isNumber, 'initial', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Transition Timing Function\n * @see https://tailwindcss.com/docs/transition-timing-function\n */\n ease: [{\n ease: ['linear', 'initial', themeEase, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Transition Delay\n * @see https://tailwindcss.com/docs/transition-delay\n */\n delay: [{\n delay: [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Animation\n * @see https://tailwindcss.com/docs/animation\n */\n animate: [{\n animate: ['none', themeAnimate, isArbitraryVariable, isArbitraryValue]\n }],\n // ------------------\n // --- Transforms ---\n // ------------------\n /**\n * Backface Visibility\n * @see https://tailwindcss.com/docs/backface-visibility\n */\n backface: [{\n backface: ['hidden', 'visible']\n }],\n /**\n * Perspective\n * @see https://tailwindcss.com/docs/perspective\n */\n perspective: [{\n perspective: [themePerspective, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Perspective Origin\n * @see https://tailwindcss.com/docs/perspective-origin\n */\n 'perspective-origin': [{\n 'perspective-origin': scalePositionWithArbitrary()\n }],\n /**\n * Rotate\n * @see https://tailwindcss.com/docs/rotate\n */\n rotate: [{\n rotate: scaleRotate()\n }],\n /**\n * Rotate X\n * @see https://tailwindcss.com/docs/rotate\n */\n 'rotate-x': [{\n 'rotate-x': scaleRotate()\n }],\n /**\n * Rotate Y\n * @see https://tailwindcss.com/docs/rotate\n */\n 'rotate-y': [{\n 'rotate-y': scaleRotate()\n }],\n /**\n * Rotate Z\n * @see https://tailwindcss.com/docs/rotate\n */\n 'rotate-z': [{\n 'rotate-z': scaleRotate()\n }],\n /**\n * Scale\n * @see https://tailwindcss.com/docs/scale\n */\n scale: [{\n scale: scaleScale()\n }],\n /**\n * Scale X\n * @see https://tailwindcss.com/docs/scale\n */\n 'scale-x': [{\n 'scale-x': scaleScale()\n }],\n /**\n * Scale Y\n * @see https://tailwindcss.com/docs/scale\n */\n 'scale-y': [{\n 'scale-y': scaleScale()\n }],\n /**\n * Scale Z\n * @see https://tailwindcss.com/docs/scale\n */\n 'scale-z': [{\n 'scale-z': scaleScale()\n }],\n /**\n * Scale 3D\n * @see https://tailwindcss.com/docs/scale\n */\n 'scale-3d': ['scale-3d'],\n /**\n * Skew\n * @see https://tailwindcss.com/docs/skew\n */\n skew: [{\n skew: scaleSkew()\n }],\n /**\n * Skew X\n * @see https://tailwindcss.com/docs/skew\n */\n 'skew-x': [{\n 'skew-x': scaleSkew()\n }],\n /**\n * Skew Y\n * @see https://tailwindcss.com/docs/skew\n */\n 'skew-y': [{\n 'skew-y': scaleSkew()\n }],\n /**\n * Transform\n * @see https://tailwindcss.com/docs/transform\n */\n transform: [{\n transform: [isArbitraryVariable, isArbitraryValue, '', 'none', 'gpu', 'cpu']\n }],\n /**\n * Transform Origin\n * @see https://tailwindcss.com/docs/transform-origin\n */\n 'transform-origin': [{\n origin: scalePositionWithArbitrary()\n }],\n /**\n * Transform Style\n * @see https://tailwindcss.com/docs/transform-style\n */\n 'transform-style': [{\n transform: ['3d', 'flat']\n }],\n /**\n * Translate\n * @see https://tailwindcss.com/docs/translate\n */\n translate: [{\n translate: scaleTranslate()\n }],\n /**\n * Translate X\n * @see https://tailwindcss.com/docs/translate\n */\n 'translate-x': [{\n 'translate-x': scaleTranslate()\n }],\n /**\n * Translate Y\n * @see https://tailwindcss.com/docs/translate\n */\n 'translate-y': [{\n 'translate-y': scaleTranslate()\n }],\n /**\n * Translate Z\n * @see https://tailwindcss.com/docs/translate\n */\n 'translate-z': [{\n 'translate-z': scaleTranslate()\n }],\n /**\n * Translate None\n * @see https://tailwindcss.com/docs/translate\n */\n 'translate-none': ['translate-none'],\n // ---------------------\n // --- Interactivity ---\n // ---------------------\n /**\n * Accent Color\n * @see https://tailwindcss.com/docs/accent-color\n */\n accent: [{\n accent: scaleColor()\n }],\n /**\n * Appearance\n * @see https://tailwindcss.com/docs/appearance\n */\n appearance: [{\n appearance: ['none', 'auto']\n }],\n /**\n * Caret Color\n * @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities\n */\n 'caret-color': [{\n caret: scaleColor()\n }],\n /**\n * Color Scheme\n * @see https://tailwindcss.com/docs/color-scheme\n */\n 'color-scheme': [{\n scheme: ['normal', 'dark', 'light', 'light-dark', 'only-dark', 'only-light']\n }],\n /**\n * Cursor\n * @see https://tailwindcss.com/docs/cursor\n */\n cursor: [{\n cursor: ['auto', 'default', 'pointer', 'wait', 'text', 'move', 'help', 'not-allowed', 'none', 'context-menu', 'progress', 'cell', 'crosshair', 'vertical-text', 'alias', 'copy', 'no-drop', 'grab', 'grabbing', 'all-scroll', 'col-resize', 'row-resize', 'n-resize', 'e-resize', 's-resize', 'w-resize', 'ne-resize', 'nw-resize', 'se-resize', 'sw-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'zoom-in', 'zoom-out', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Field Sizing\n * @see https://tailwindcss.com/docs/field-sizing\n */\n 'field-sizing': [{\n 'field-sizing': ['fixed', 'content']\n }],\n /**\n * Pointer Events\n * @see https://tailwindcss.com/docs/pointer-events\n */\n 'pointer-events': [{\n 'pointer-events': ['auto', 'none']\n }],\n /**\n * Resize\n * @see https://tailwindcss.com/docs/resize\n */\n resize: [{\n resize: ['none', '', 'y', 'x']\n }],\n /**\n * Scroll Behavior\n * @see https://tailwindcss.com/docs/scroll-behavior\n */\n 'scroll-behavior': [{\n scroll: ['auto', 'smooth']\n }],\n /**\n * Scroll Margin\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-m': [{\n 'scroll-m': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin X\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mx': [{\n 'scroll-mx': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Y\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-my': [{\n 'scroll-my': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Start\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-ms': [{\n 'scroll-ms': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin End\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-me': [{\n 'scroll-me': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Top\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mt': [{\n 'scroll-mt': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Right\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mr': [{\n 'scroll-mr': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Bottom\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mb': [{\n 'scroll-mb': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Left\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-ml': [{\n 'scroll-ml': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-p': [{\n 'scroll-p': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding X\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-px': [{\n 'scroll-px': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Y\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-py': [{\n 'scroll-py': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Start\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-ps': [{\n 'scroll-ps': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding End\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pe': [{\n 'scroll-pe': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Top\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pt': [{\n 'scroll-pt': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Right\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pr': [{\n 'scroll-pr': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Bottom\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pb': [{\n 'scroll-pb': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Left\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pl': [{\n 'scroll-pl': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Snap Align\n * @see https://tailwindcss.com/docs/scroll-snap-align\n */\n 'snap-align': [{\n snap: ['start', 'end', 'center', 'align-none']\n }],\n /**\n * Scroll Snap Stop\n * @see https://tailwindcss.com/docs/scroll-snap-stop\n */\n 'snap-stop': [{\n snap: ['normal', 'always']\n }],\n /**\n * Scroll Snap Type\n * @see https://tailwindcss.com/docs/scroll-snap-type\n */\n 'snap-type': [{\n snap: ['none', 'x', 'y', 'both']\n }],\n /**\n * Scroll Snap Type Strictness\n * @see https://tailwindcss.com/docs/scroll-snap-type\n */\n 'snap-strictness': [{\n snap: ['mandatory', 'proximity']\n }],\n /**\n * Touch Action\n * @see https://tailwindcss.com/docs/touch-action\n */\n touch: [{\n touch: ['auto', 'none', 'manipulation']\n }],\n /**\n * Touch Action X\n * @see https://tailwindcss.com/docs/touch-action\n */\n 'touch-x': [{\n 'touch-pan': ['x', 'left', 'right']\n }],\n /**\n * Touch Action Y\n * @see https://tailwindcss.com/docs/touch-action\n */\n 'touch-y': [{\n 'touch-pan': ['y', 'up', 'down']\n }],\n /**\n * Touch Action Pinch Zoom\n * @see https://tailwindcss.com/docs/touch-action\n */\n 'touch-pz': ['touch-pinch-zoom'],\n /**\n * User Select\n * @see https://tailwindcss.com/docs/user-select\n */\n select: [{\n select: ['none', 'text', 'all', 'auto']\n }],\n /**\n * Will Change\n * @see https://tailwindcss.com/docs/will-change\n */\n 'will-change': [{\n 'will-change': ['auto', 'scroll', 'contents', 'transform', isArbitraryVariable, isArbitraryValue]\n }],\n // -----------\n // --- SVG ---\n // -----------\n /**\n * Fill\n * @see https://tailwindcss.com/docs/fill\n */\n fill: [{\n fill: ['none', ...scaleColor()]\n }],\n /**\n * Stroke Width\n * @see https://tailwindcss.com/docs/stroke-width\n */\n 'stroke-w': [{\n stroke: [isNumber, isArbitraryVariableLength, isArbitraryLength, isArbitraryNumber]\n }],\n /**\n * Stroke\n * @see https://tailwindcss.com/docs/stroke\n */\n stroke: [{\n stroke: ['none', ...scaleColor()]\n }],\n // ---------------------\n // --- Accessibility ---\n // ---------------------\n /**\n * Forced Color Adjust\n * @see https://tailwindcss.com/docs/forced-color-adjust\n */\n 'forced-color-adjust': [{\n 'forced-color-adjust': ['auto', 'none']\n }]\n },\n conflictingClassGroups: {\n overflow: ['overflow-x', 'overflow-y'],\n overscroll: ['overscroll-x', 'overscroll-y'],\n inset: ['inset-x', 'inset-y', 'start', 'end', 'top', 'right', 'bottom', 'left'],\n 'inset-x': ['right', 'left'],\n 'inset-y': ['top', 'bottom'],\n flex: ['basis', 'grow', 'shrink'],\n gap: ['gap-x', 'gap-y'],\n p: ['px', 'py', 'ps', 'pe', 'pt', 'pr', 'pb', 'pl'],\n px: ['pr', 'pl'],\n py: ['pt', 'pb'],\n m: ['mx', 'my', 'ms', 'me', 'mt', 'mr', 'mb', 'ml'],\n mx: ['mr', 'ml'],\n my: ['mt', 'mb'],\n size: ['w', 'h'],\n 'font-size': ['leading'],\n 'fvn-normal': ['fvn-ordinal', 'fvn-slashed-zero', 'fvn-figure', 'fvn-spacing', 'fvn-fraction'],\n 'fvn-ordinal': ['fvn-normal'],\n 'fvn-slashed-zero': ['fvn-normal'],\n 'fvn-figure': ['fvn-normal'],\n 'fvn-spacing': ['fvn-normal'],\n 'fvn-fraction': ['fvn-normal'],\n 'line-clamp': ['display', 'overflow'],\n rounded: ['rounded-s', 'rounded-e', 'rounded-t', 'rounded-r', 'rounded-b', 'rounded-l', 'rounded-ss', 'rounded-se', 'rounded-ee', 'rounded-es', 'rounded-tl', 'rounded-tr', 'rounded-br', 'rounded-bl'],\n 'rounded-s': ['rounded-ss', 'rounded-es'],\n 'rounded-e': ['rounded-se', 'rounded-ee'],\n 'rounded-t': ['rounded-tl', 'rounded-tr'],\n 'rounded-r': ['rounded-tr', 'rounded-br'],\n 'rounded-b': ['rounded-br', 'rounded-bl'],\n 'rounded-l': ['rounded-tl', 'rounded-bl'],\n 'border-spacing': ['border-spacing-x', 'border-spacing-y'],\n 'border-w': ['border-w-x', 'border-w-y', 'border-w-s', 'border-w-e', 'border-w-t', 'border-w-r', 'border-w-b', 'border-w-l'],\n 'border-w-x': ['border-w-r', 'border-w-l'],\n 'border-w-y': ['border-w-t', 'border-w-b'],\n 'border-color': ['border-color-x', 'border-color-y', 'border-color-s', 'border-color-e', 'border-color-t', 'border-color-r', 'border-color-b', 'border-color-l'],\n 'border-color-x': ['border-color-r', 'border-color-l'],\n 'border-color-y': ['border-color-t', 'border-color-b'],\n translate: ['translate-x', 'translate-y', 'translate-none'],\n 'translate-none': ['translate', 'translate-x', 'translate-y', 'translate-z'],\n 'scroll-m': ['scroll-mx', 'scroll-my', 'scroll-ms', 'scroll-me', 'scroll-mt', 'scroll-mr', 'scroll-mb', 'scroll-ml'],\n 'scroll-mx': ['scroll-mr', 'scroll-ml'],\n 'scroll-my': ['scroll-mt', 'scroll-mb'],\n 'scroll-p': ['scroll-px', 'scroll-py', 'scroll-ps', 'scroll-pe', 'scroll-pt', 'scroll-pr', 'scroll-pb', 'scroll-pl'],\n 'scroll-px': ['scroll-pr', 'scroll-pl'],\n 'scroll-py': ['scroll-pt', 'scroll-pb'],\n touch: ['touch-x', 'touch-y', 'touch-pz'],\n 'touch-x': ['touch'],\n 'touch-y': ['touch'],\n 'touch-pz': ['touch']\n },\n conflictingClassGroupModifiers: {\n 'font-size': ['leading']\n },\n orderSensitiveModifiers: ['*', '**', 'after', 'backdrop', 'before', 'details-content', 'file', 'first-letter', 'first-line', 'marker', 'placeholder', 'selection']\n };\n};\n\n/**\n * @param baseConfig Config where other config will be merged into. This object will be mutated.\n * @param configExtension Partial config to merge into the `baseConfig`.\n */\nconst mergeConfigs = (baseConfig, {\n cacheSize,\n prefix,\n experimentalParseClassName,\n extend = {},\n override = {}\n}) => {\n overrideProperty(baseConfig, 'cacheSize', cacheSize);\n overrideProperty(baseConfig, 'prefix', prefix);\n overrideProperty(baseConfig, 'experimentalParseClassName', experimentalParseClassName);\n overrideConfigProperties(baseConfig.theme, override.theme);\n overrideConfigProperties(baseConfig.classGroups, override.classGroups);\n overrideConfigProperties(baseConfig.conflictingClassGroups, override.conflictingClassGroups);\n overrideConfigProperties(baseConfig.conflictingClassGroupModifiers, override.conflictingClassGroupModifiers);\n overrideProperty(baseConfig, 'orderSensitiveModifiers', override.orderSensitiveModifiers);\n mergeConfigProperties(baseConfig.theme, extend.theme);\n mergeConfigProperties(baseConfig.classGroups, extend.classGroups);\n mergeConfigProperties(baseConfig.conflictingClassGroups, extend.conflictingClassGroups);\n mergeConfigProperties(baseConfig.conflictingClassGroupModifiers, extend.conflictingClassGroupModifiers);\n mergeArrayProperties(baseConfig, extend, 'orderSensitiveModifiers');\n return baseConfig;\n};\nconst overrideProperty = (baseObject, overrideKey, overrideValue) => {\n if (overrideValue !== undefined) {\n baseObject[overrideKey] = overrideValue;\n }\n};\nconst overrideConfigProperties = (baseObject, overrideObject) => {\n if (overrideObject) {\n for (const key in overrideObject) {\n overrideProperty(baseObject, key, overrideObject[key]);\n }\n }\n};\nconst mergeConfigProperties = (baseObject, mergeObject) => {\n if (mergeObject) {\n for (const key in mergeObject) {\n mergeArrayProperties(baseObject, mergeObject, key);\n }\n }\n};\nconst mergeArrayProperties = (baseObject, mergeObject, key) => {\n const mergeValue = mergeObject[key];\n if (mergeValue !== undefined) {\n baseObject[key] = baseObject[key] ? baseObject[key].concat(mergeValue) : mergeValue;\n }\n};\nconst extendTailwindMerge = (configExtension, ...createConfig) => typeof configExtension === 'function' ? createTailwindMerge(getDefaultConfig, configExtension, ...createConfig) : createTailwindMerge(() => mergeConfigs(getDefaultConfig(), configExtension), ...createConfig);\nconst twMerge = /*#__PURE__*/createTailwindMerge(getDefaultConfig);\nexport { createTailwindMerge, extendTailwindMerge, fromTheme, getDefaultConfig, mergeConfigs, twJoin, twMerge, validators };\n//# sourceMappingURL=bundle-mjs.mjs.map\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * `cn()` helper used across shadcn/cult components.\n *\n * Note: We scope Tailwind utilities to the devtool container via\n * `tailwind.config.ts` (`important: \".dev-tool-root\"`), so we do NOT need a\n * custom class prefix. Keeping classnames standard also ensures Tailwind JIT\n * can see them and emit the right utilities into the injected CSS bundle.\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import { useCallback } from \"react\";\nimport {\n useComposedStore,\n selectIssuesMap,\n selectAllIssues,\n selectIssuesByFile,\n selectTotalIssueCount,\n selectSeverityCounts,\n} from \"../../core/store\";\nimport type { Issue } from \"../types\";\n\n/**\n * Hook that aggregates issues from all plugin slices.\n *\n * Uses Zustand selectors for derived state - all filtering and aggregation\n * is performed in the store selectors, not in this hook.\n */\nexport function useIssues() {\n // Use store selectors for all derived state\n const allIssues = useComposedStore(selectAllIssues);\n const byFile = useComposedStore(selectIssuesByFile);\n const byDataLoc = useComposedStore(selectIssuesMap);\n const totalCount = useComposedStore(selectTotalIssueCount);\n const countBySeverity = useComposedStore(selectSeverityCounts);\n\n // Keep getIssuesForDataLoc as callback for direct lookup\n const getIssuesForDataLoc = useCallback(\n (dataLoc: string): Issue[] => {\n return byDataLoc.get(dataLoc) || [];\n },\n [byDataLoc]\n );\n\n return {\n allIssues,\n byFile,\n byDataLoc,\n getIssuesForDataLoc,\n totalCount,\n countBySeverity,\n };\n}\n","/**\n * WebSocket Service - Singleton shared by all plugins\n *\n * Provides connection management, message routing, and automatic reconnection\n * with exponential backoff.\n */\n\nimport { devLog, devWarn, devError } from \"uilint-core\";\n\n// Constants\nexport const DEFAULT_WS_URL = \"ws://localhost:9234\";\nexport const MAX_RECONNECT_ATTEMPTS = 10;\nexport const RECONNECT_BASE_DELAY = 1000;\nexport const MAX_RECONNECT_DELAY = 10_000;\n\n// Type definitions\nexport type MessageHandler<T = unknown> = (data: T) => void;\nexport type ConnectionHandler = (connected: boolean) => void;\nexport type ReconnectHandler = (attempts: number, maxAttempts: number, exhausted: boolean) => void;\n\n/**\n * Options for dependency injection in WebSocketService\n * Allows injecting mock implementations for testing\n */\nexport interface WebSocketServiceOptions {\n /** Factory function to create WebSocket instances */\n createWebSocket?: (url: string) => WebSocket;\n /** Custom setTimeout implementation */\n setTimeout?: typeof globalThis.setTimeout;\n /** Custom clearTimeout implementation */\n clearTimeout?: typeof globalThis.clearTimeout;\n}\n\n/**\n * WebSocket service interface\n */\nexport interface WebSocketService {\n readonly isConnected: boolean;\n readonly url: string;\n readonly reconnectAttempts: number;\n connect(url?: string): void;\n disconnect(): void;\n send(message: unknown): void;\n on<T>(type: string, handler: MessageHandler<T>): () => void;\n onConnectionChange(handler: ConnectionHandler): () => void;\n onReconnectAttempt(handler: ReconnectHandler): () => void;\n}\n\n/**\n * WebSocket service implementation\n */\nexport class WebSocketServiceImpl implements WebSocketService {\n private ws: WebSocket | null = null;\n private handlers: Map<string, Set<MessageHandler>> = new Map();\n private connectionHandlers: Set<ConnectionHandler> = new Set();\n private reconnectHandlers: Set<ReconnectHandler> = new Set();\n private _reconnectAttempts: number = 0;\n private reconnectTimeout: ReturnType<typeof setTimeout> | null = null;\n private intentionalDisconnect: boolean = false;\n\n // Injectable dependencies with defaults\n private readonly createWebSocket: (url: string) => WebSocket;\n private readonly _setTimeout: typeof globalThis.setTimeout;\n private readonly _clearTimeout: typeof globalThis.clearTimeout;\n\n public isConnected: boolean = false;\n public url: string = DEFAULT_WS_URL;\n\n /** Current reconnection attempt count */\n public get reconnectAttempts(): number {\n return this._reconnectAttempts;\n }\n\n /**\n * Create a new WebSocket service instance\n * @param options - Optional dependency injection options for testing\n */\n constructor(private options: WebSocketServiceOptions = {}) {\n this.createWebSocket =\n options.createWebSocket ?? ((url: string) => new WebSocket(url));\n this._setTimeout = options.setTimeout ?? globalThis.setTimeout;\n this._clearTimeout = options.clearTimeout ?? globalThis.clearTimeout;\n }\n\n /**\n * Connect to the WebSocket server\n * @param url - Optional URL to connect to (defaults to DEFAULT_WS_URL)\n */\n connect(url?: string): void {\n // SSR guard - WebSocket is not available during server-side rendering\n // Skip check if a custom createWebSocket factory was provided (e.g., in tests)\n if (typeof WebSocket === \"undefined\" && !this.options.createWebSocket) {\n devWarn(\"[WebSocket] WebSocket is not available in this environment\");\n return;\n }\n\n // Don't reconnect if already connected to the same URL\n if (this.ws && this.isConnected && (!url || url === this.url)) {\n return;\n }\n\n // Close existing connection if URL changed\n if (this.ws) {\n this.intentionalDisconnect = true;\n this.ws.close();\n }\n\n this.url = url ?? DEFAULT_WS_URL;\n this.intentionalDisconnect = false;\n\n try {\n this.ws = this.createWebSocket(this.url);\n this.setupEventHandlers();\n } catch (error) {\n devError(\"[WebSocket] Failed to create WebSocket:\", error);\n this.scheduleReconnect();\n }\n }\n\n /**\n * Disconnect from the WebSocket server\n * Prevents automatic reconnection\n */\n disconnect(): void {\n this.intentionalDisconnect = true;\n\n // Clear any pending reconnect\n if (this.reconnectTimeout) {\n this._clearTimeout(this.reconnectTimeout);\n this.reconnectTimeout = null;\n }\n\n if (this.ws) {\n this.ws.close();\n this.ws = null;\n }\n\n this.isConnected = false;\n this._reconnectAttempts = 0;\n }\n\n /**\n * Send a message to the WebSocket server\n * @param message - The message to send (will be JSON stringified)\n */\n send(message: unknown): void {\n if (!this.ws || !this.isConnected) {\n devWarn(\"[WebSocket] Cannot send message: not connected\");\n return;\n }\n\n try {\n this.ws.send(JSON.stringify(message));\n } catch (error) {\n devError(\"[WebSocket] Failed to send message:\", error);\n }\n }\n\n /**\n * Subscribe to messages of a specific type\n * @param type - Message type to subscribe to, or \"*\" for all messages\n * @param handler - Handler function to call when message is received\n * @returns Unsubscribe function\n */\n on<T>(type: string, handler: MessageHandler<T>): () => void {\n if (!this.handlers.has(type)) {\n this.handlers.set(type, new Set());\n }\n\n const handlers = this.handlers.get(type)!;\n handlers.add(handler as MessageHandler);\n\n // Return unsubscribe function\n return () => {\n handlers.delete(handler as MessageHandler);\n if (handlers.size === 0) {\n this.handlers.delete(type);\n }\n };\n }\n\n /**\n * Subscribe to connection status changes\n * @param handler - Handler function to call when connection status changes\n * @returns Unsubscribe function\n */\n onConnectionChange(handler: ConnectionHandler): () => void {\n this.connectionHandlers.add(handler);\n\n // Immediately notify of current state\n handler(this.isConnected);\n\n // Return unsubscribe function\n return () => {\n this.connectionHandlers.delete(handler);\n };\n }\n\n /**\n * Subscribe to reconnection attempt changes\n * @param handler - Handler called when reconnect attempts change\n * @returns Unsubscribe function\n */\n onReconnectAttempt(handler: ReconnectHandler): () => void {\n this.reconnectHandlers.add(handler);\n\n // Immediately notify of current state\n const exhausted = this._reconnectAttempts >= MAX_RECONNECT_ATTEMPTS;\n handler(this._reconnectAttempts, MAX_RECONNECT_ATTEMPTS, exhausted);\n\n // Return unsubscribe function\n return () => {\n this.reconnectHandlers.delete(handler);\n };\n }\n\n /**\n * Notify all reconnect handlers of attempt changes\n */\n private notifyReconnectAttempt(): void {\n const exhausted = this._reconnectAttempts >= MAX_RECONNECT_ATTEMPTS;\n this.reconnectHandlers.forEach((handler) => {\n try {\n handler(this._reconnectAttempts, MAX_RECONNECT_ATTEMPTS, exhausted);\n } catch (error) {\n devError(\"[WebSocket] Reconnect handler error:\", error);\n }\n });\n }\n\n /**\n * Set up WebSocket event handlers\n */\n private setupEventHandlers(): void {\n if (!this.ws) return;\n\n this.ws.onopen = () => {\n devLog(`[WebSocket] Connected to ${this.url}`);\n this.isConnected = true;\n this._reconnectAttempts = 0;\n this.notifyConnectionChange(true);\n this.notifyReconnectAttempt();\n };\n\n this.ws.onclose = (event) => {\n devLog(`[WebSocket] Disconnected from ${this.url} (code: ${event?.code ?? 'unknown'}, reason: ${event?.reason || 'none'})`);\n this.isConnected = false;\n this.notifyConnectionChange(false);\n\n if (!this.intentionalDisconnect) {\n this.scheduleReconnect();\n }\n };\n\n this.ws.onerror = (event) => {\n devError(\"[WebSocket] Connection error:\", event);\n };\n\n this.ws.onmessage = (event) => {\n try {\n const message = JSON.parse(event.data);\n const type = message.type as string | undefined;\n\n devLog(`[WebSocket] Received message: ${type || 'unknown'}`, message);\n\n if (type) {\n this.dispatch(type, message);\n } else {\n // If no type, dispatch to wildcard handlers only\n this.dispatch(\"*\", message);\n }\n } catch (error) {\n devError(\"[WebSocket] Failed to parse message:\", error);\n }\n };\n }\n\n /**\n * Dispatch a message to registered handlers\n * @param type - Message type\n * @param data - Message data\n */\n private dispatch(type: string, data: unknown): void {\n // Dispatch to specific type handlers\n const typeHandlers = this.handlers.get(type);\n if (typeHandlers) {\n typeHandlers.forEach((handler) => {\n try {\n handler(data);\n } catch (error) {\n devError(`[WebSocket] Handler error for type \"${type}\":`, error);\n }\n });\n }\n\n // Also dispatch to wildcard handlers (unless this is already a wildcard dispatch)\n if (type !== \"*\") {\n const wildcardHandlers = this.handlers.get(\"*\");\n if (wildcardHandlers) {\n wildcardHandlers.forEach((handler) => {\n try {\n handler(data);\n } catch (error) {\n devError(\"[WebSocket] Wildcard handler error:\", error);\n }\n });\n }\n }\n }\n\n /**\n * Notify all connection handlers of a status change\n * @param connected - Current connection status\n */\n private notifyConnectionChange(connected: boolean): void {\n this.connectionHandlers.forEach((handler) => {\n try {\n handler(connected);\n } catch (error) {\n devError(\"[WebSocket] Connection handler error:\", error);\n }\n });\n }\n\n /**\n * Schedule a reconnection attempt with exponential backoff\n */\n private scheduleReconnect(): void {\n if (this.intentionalDisconnect) {\n return;\n }\n\n if (this._reconnectAttempts >= MAX_RECONNECT_ATTEMPTS) {\n devWarn(\n `[WebSocket] Max reconnection attempts (${MAX_RECONNECT_ATTEMPTS}) reached`\n );\n // Notify handlers that reconnection is exhausted\n this.notifyReconnectAttempt();\n return;\n }\n\n // Clear any existing timeout\n if (this.reconnectTimeout) {\n this._clearTimeout(this.reconnectTimeout);\n }\n\n // Calculate delay with exponential backoff, capped at MAX_RECONNECT_DELAY\n const delay = Math.min(\n RECONNECT_BASE_DELAY * Math.pow(2, this._reconnectAttempts),\n MAX_RECONNECT_DELAY\n );\n this._reconnectAttempts++;\n\n // Notify handlers of the new attempt count\n this.notifyReconnectAttempt();\n\n devLog(\n `[WebSocket] Reconnecting in ${delay}ms (attempt ${this._reconnectAttempts}/${MAX_RECONNECT_ATTEMPTS})`\n );\n\n this.reconnectTimeout = this._setTimeout(() => {\n this.reconnectTimeout = null;\n this.connect(this.url);\n }, delay);\n }\n}\n\n/**\n * Factory function to create a WebSocket service instance\n * @param options - Optional dependency injection options for testing\n * @returns A new WebSocket service instance\n */\nexport function createWebSocketService(\n options?: WebSocketServiceOptions\n): WebSocketService {\n return new WebSocketServiceImpl(options);\n}\n\n// Export singleton instance\nexport const websocket = new WebSocketServiceImpl();\n","/**\n * Source Code Cache Service\n *\n * Caches fetched source files with TTL and provides\n * line extraction utilities for the source viewer.\n */\n\nexport interface CachedSourceFile {\n content: string;\n lines: string[];\n totalLines: number;\n relativePath: string;\n fetchedAt: number;\n}\n\nexport interface SourceContext {\n lines: string[];\n startLine: number; // 1-indexed\n highlightLine: number; // 1-indexed\n relativePath: string;\n}\n\nconst CACHE_TTL_MS = 5 * 60 * 1000; // 5 minutes\nconst cache = new Map<string, CachedSourceFile>();\n\n// Pending requests to deduplicate concurrent fetches\nconst pendingRequests = new Map<string, Promise<CachedSourceFile | null>>();\n\n/**\n * Get cached source file if available and not expired\n */\nexport function getCachedSource(filePath: string): CachedSourceFile | null {\n const cached = cache.get(filePath);\n if (!cached) return null;\n if (Date.now() - cached.fetchedAt > CACHE_TTL_MS) {\n cache.delete(filePath);\n return null;\n }\n return cached;\n}\n\n/**\n * Store source file in cache\n */\nexport function setCachedSource(\n filePath: string,\n content: string,\n totalLines: number,\n relativePath: string\n): CachedSourceFile {\n const entry: CachedSourceFile = {\n content,\n lines: content.split(\"\\n\"),\n totalLines,\n relativePath,\n fetchedAt: Date.now(),\n };\n cache.set(filePath, entry);\n return entry;\n}\n\n/**\n * Invalidate cached source for a file (called on file:changed)\n */\nexport function invalidateSource(filePath: string): void {\n cache.delete(filePath);\n}\n\n/**\n * Clear entire source cache\n */\nexport function clearSourceCache(): void {\n cache.clear();\n}\n\n/**\n * Extract lines around a target line with configurable context.\n */\nexport function extractContext(\n cached: CachedSourceFile,\n targetLine: number,\n contextAbove: number = 5,\n contextBelow: number = 5\n): SourceContext {\n const lineIndex = targetLine - 1; // 0-indexed\n const startIndex = Math.max(0, lineIndex - contextAbove);\n const endIndex = Math.min(cached.lines.length, lineIndex + contextBelow + 1);\n\n return {\n lines: cached.lines.slice(startIndex, endIndex),\n startLine: startIndex + 1,\n highlightLine: targetLine,\n relativePath: cached.relativePath,\n };\n}\n\n/**\n * Get or set pending request for deduplication\n */\nexport function getPendingRequest(\n filePath: string\n): Promise<CachedSourceFile | null> | undefined {\n return pendingRequests.get(filePath);\n}\n\nexport function setPendingRequest(\n filePath: string,\n promise: Promise<CachedSourceFile | null>\n): void {\n pendingRequests.set(filePath, promise);\n // Clean up after promise resolves\n promise.finally(() => {\n pendingRequests.delete(filePath);\n });\n}\n","/**\n * Manifest Fetcher Service\n *\n * Fetches and caches the static lint manifest.\n * Used in static/remote mode as an alternative to the WebSocket connection.\n */\n\nimport { devLog, devError } from \"uilint-core\";\nimport type { LintManifest } from \"./manifest-types\";\n\n/**\n * Options for creating a manifest fetcher\n */\nexport interface ManifestFetcherOptions {\n /** URL to fetch manifest from */\n manifestUrl: string;\n /** Number of retry attempts on failure (default: 3) */\n retries?: number;\n /** Delay between retries in ms (default: 1000) */\n retryDelay?: number;\n /** Cache TTL in ms (default: 0 = no expiry, fetch once) */\n cacheTtl?: number;\n}\n\n/**\n * Result of a fetch operation\n */\nexport interface FetchResult {\n manifest: LintManifest;\n /** Whether this came from cache */\n cached: boolean;\n /** Timestamp when fetched */\n fetchedAt: number;\n}\n\n/**\n * Manifest fetcher interface\n */\nexport interface ManifestFetcher {\n /** Fetch the manifest (uses cache if available) */\n fetch(): Promise<FetchResult>;\n /** Get cached manifest without fetching */\n getCached(): LintManifest | null;\n /** Invalidate the cache */\n invalidate(): void;\n /** Check if manifest is currently being fetched */\n isFetching(): boolean;\n /** Get the manifest URL */\n getManifestUrl(): string;\n}\n\n/**\n * Create a manifest fetcher instance\n */\nexport function createManifestFetcher(\n options: ManifestFetcherOptions\n): ManifestFetcher {\n const {\n manifestUrl,\n retries = 3,\n retryDelay = 1000,\n cacheTtl = 0,\n } = options;\n\n let cached: LintManifest | null = null;\n let cachedAt: number | null = null;\n let fetchPromise: Promise<FetchResult> | null = null;\n\n /**\n * Check if cache is still valid\n */\n function isCacheValid(): boolean {\n if (!cached || cachedAt === null) return false;\n if (cacheTtl === 0) return true; // No expiry\n return Date.now() - cachedAt < cacheTtl;\n }\n\n /**\n * Sleep for a duration\n */\n function sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n }\n\n /**\n * Fetch with retries\n */\n async function fetchWithRetries(): Promise<LintManifest> {\n let lastError: Error | null = null;\n\n for (let attempt = 0; attempt <= retries; attempt++) {\n try {\n if (attempt > 0) {\n devLog(\n `[ManifestFetcher] Retry attempt ${attempt}/${retries}...`\n );\n await sleep(retryDelay * attempt); // Exponential backoff\n }\n\n const response = await fetch(manifestUrl);\n\n if (!response.ok) {\n throw new Error(\n `Failed to fetch manifest: ${response.status} ${response.statusText}`\n );\n }\n\n const manifest = (await response.json()) as LintManifest;\n\n // Basic validation\n if (manifest.version !== \"1.0\") {\n throw new Error(\n `Unsupported manifest version: ${manifest.version}`\n );\n }\n\n if (!Array.isArray(manifest.files)) {\n throw new Error(\"Invalid manifest: missing files array\");\n }\n\n return manifest;\n } catch (error) {\n lastError =\n error instanceof Error ? error : new Error(String(error));\n devError(\n `[ManifestFetcher] Fetch failed (attempt ${attempt + 1}):`,\n lastError.message\n );\n }\n }\n\n throw lastError ?? new Error(\"Failed to fetch manifest\");\n }\n\n return {\n async fetch(): Promise<FetchResult> {\n // Return cached if valid\n if (isCacheValid() && cached) {\n return {\n manifest: cached,\n cached: true,\n fetchedAt: cachedAt!,\n };\n }\n\n // Deduplicate concurrent fetches\n if (fetchPromise) {\n return fetchPromise;\n }\n\n fetchPromise = (async () => {\n try {\n devLog(\n `[ManifestFetcher] Fetching manifest from ${manifestUrl}...`\n );\n const manifest = await fetchWithRetries();\n\n cached = manifest;\n cachedAt = Date.now();\n\n devLog(\n `[ManifestFetcher] Loaded manifest: ${manifest.summary.totalIssues} issues in ${manifest.summary.filesWithIssues} files`\n );\n\n return {\n manifest,\n cached: false,\n fetchedAt: cachedAt,\n };\n } finally {\n fetchPromise = null;\n }\n })();\n\n return fetchPromise;\n },\n\n getCached(): LintManifest | null {\n return isCacheValid() ? cached : null;\n },\n\n invalidate(): void {\n cached = null;\n cachedAt = null;\n devLog(\"[ManifestFetcher] Cache invalidated\");\n },\n\n isFetching(): boolean {\n return fetchPromise !== null;\n },\n\n getManifestUrl(): string {\n return manifestUrl;\n },\n };\n}\n\n/**\n * Global manifest fetcher instance (set when static mode is configured)\n */\nlet globalFetcher: ManifestFetcher | null = null;\n\n/**\n * Configure the global manifest fetcher for static mode\n */\nexport function configureManifestFetcher(\n options: ManifestFetcherOptions\n): ManifestFetcher {\n globalFetcher = createManifestFetcher(options);\n return globalFetcher;\n}\n\n/**\n * Get the global manifest fetcher\n */\nexport function getManifestFetcher(): ManifestFetcher | null {\n return globalFetcher;\n}\n\n/**\n * Clear the global manifest fetcher\n */\nexport function clearManifestFetcher(): void {\n globalFetcher = null;\n}\n","/**\n * Static Mode Handler\n *\n * Processes manifest data and populates the ESLint store.\n * Used as an alternative to WebSocket communication for remote/production deployments.\n */\n\nimport { devLog, devError } from \"uilint-core\";\nimport type { PluginServices } from \"../../core/plugin-system/types\";\nimport type { AvailableRule, RuleConfig } from \"./types\";\nimport type { Issue } from \"../../ui/types\";\nimport { createIssueId, parseDataLoc } from \"../../ui/types\";\nimport type {\n LintManifest,\n ManifestIssue,\n ManifestRuleMeta,\n} from \"../../core/services/manifest-types\";\nimport {\n configureManifestFetcher,\n type ManifestFetcher,\n} from \"../../core/services/manifest-fetcher\";\n\n/**\n * Convert manifest issue to unified Issue type\n */\nfunction convertManifestIssue(issue: ManifestIssue, rules: ManifestRuleMeta[]): Issue {\n const { filePath } = parseDataLoc(issue.dataLoc);\n const ruleId = issue.ruleId || \"unknown\";\n\n // Look up severity from rule metadata (rule IDs are always full form: \"uilint/...\")\n const rule = rules.find((r) => r.id === ruleId);\n const severityStr = rule?.currentSeverity ?? rule?.defaultSeverity ?? \"warn\";\n const severity = severityStr === \"error\" ? \"error\" : \"warning\";\n\n return {\n id: createIssueId(\"eslint\", ruleId, issue.dataLoc, issue.line),\n message: issue.message,\n severity,\n dataLoc: issue.dataLoc,\n ruleId,\n pluginId: \"eslint\",\n filePath,\n line: issue.line,\n column: issue.column,\n };\n}\n\n/**\n * Convert manifest rule metadata to AvailableRule format\n */\nfunction convertRuleMetadata(rule: ManifestRuleMeta): AvailableRule {\n return {\n id: rule.id,\n name: rule.name,\n description: rule.description,\n category: rule.category,\n defaultSeverity: rule.defaultSeverity,\n currentSeverity: rule.currentSeverity,\n docs: rule.docs,\n };\n}\n\n/**\n * Process a fetched manifest and populate the store\n */\nexport function processManifest(\n services: PluginServices,\n manifest: LintManifest\n): void {\n devLog(\n \"[ESLint Plugin] Processing manifest:\",\n manifest.summary.totalIssues,\n \"issues in\",\n manifest.summary.filesWithIssues,\n \"files\"\n );\n\n // Convert all issues and group by dataLoc\n const byDataLoc = new Map<string, Issue[]>();\n\n for (const file of manifest.files) {\n for (const rawIssue of file.issues) {\n const issue = convertManifestIssue(rawIssue, manifest.rules);\n const existing = byDataLoc.get(issue.dataLoc) || [];\n byDataLoc.set(issue.dataLoc, [...existing, issue]);\n }\n }\n\n // Convert rules to AvailableRule format\n const availableRules = manifest.rules.map(convertRuleMetadata);\n\n // Build rule configs\n const ruleConfigs = new Map<string, RuleConfig>();\n for (const rule of manifest.rules) {\n ruleConfigs.set(rule.id, {\n severity: rule.currentSeverity ?? rule.defaultSeverity,\n });\n }\n\n // Update store in a single batch\n services.setState({\n issues: byDataLoc,\n availableRules,\n ruleConfigs,\n workspaceRoot: manifest.workspaceRoot,\n scanStatus: \"complete\",\n });\n\n devLog(\n \"[ESLint Plugin] Manifest processed:\",\n byDataLoc.size,\n \"unique dataLocs with issues\"\n );\n}\n\n/**\n * Filter manifest issues to only those visible in the current DOM\n * (Optimization for large manifests)\n */\nexport function filterManifestByVisibleElements(\n manifest: LintManifest,\n visibleDataLocs: Set<string>\n): ManifestIssue[] {\n const filtered: ManifestIssue[] = [];\n\n for (const file of manifest.files) {\n for (const issue of file.issues) {\n if (visibleDataLocs.has(issue.dataLoc)) {\n filtered.push(issue);\n }\n }\n }\n\n return filtered;\n}\n\n/**\n * Get source snippet for a dataLoc from the manifest\n */\nexport function getSourceSnippet(\n manifest: LintManifest,\n dataLoc: string\n): { lines: string[]; startLine: number; endLine: number } | null {\n const { filePath } = parseDataLoc(dataLoc);\n\n // Find the file entry\n const fileEntry = manifest.files.find((f) => {\n // Handle both exact match and relative path variations\n return f.filePath === filePath || dataLoc.startsWith(f.filePath + \":\");\n });\n\n if (!fileEntry?.snippets) {\n return null;\n }\n\n return fileEntry.snippets[dataLoc] ?? null;\n}\n\n/**\n * Get full source content for a file from the manifest\n */\nexport function getFileSource(\n filePath: string\n): { content: string; lines: string[]; totalLines: number; relativePath: string } | null {\n if (!staticModeState?.manifest) {\n return null;\n }\n\n const { manifest } = staticModeState;\n\n // Find the file entry - try various path matching strategies\n const fileEntry = manifest.files.find((f) => {\n // Exact match\n if (f.filePath === filePath) return true;\n // filePath ends with manifest's filePath (e.g., \"/full/path/src/file.tsx\" matches \"src/file.tsx\")\n if (filePath.endsWith(f.filePath)) return true;\n // manifest's filePath ends with filePath\n if (f.filePath.endsWith(filePath)) return true;\n // Handle Windows vs Unix path separators\n const normalizedManifest = f.filePath.replace(/\\\\/g, \"/\");\n const normalizedRequest = filePath.replace(/\\\\/g, \"/\");\n if (normalizedManifest === normalizedRequest) return true;\n if (normalizedRequest.endsWith(normalizedManifest)) return true;\n if (normalizedManifest.endsWith(normalizedRequest)) return true;\n return false;\n });\n\n if (!fileEntry?.content) {\n devLog(\"[Static Handler] No source content found for file:\", filePath);\n return null;\n }\n\n const lines = fileEntry.content.split(\"\\n\");\n\n return {\n content: fileEntry.content,\n lines,\n totalLines: lines.length,\n relativePath: fileEntry.filePath,\n };\n}\n\n/**\n * Static mode plugin state\n */\ninterface StaticModeState {\n mode: \"static\";\n manifestUrl: string;\n fetcher: ManifestFetcher;\n manifest: LintManifest | null;\n}\n\nlet staticModeState: StaticModeState | null = null;\n\n/**\n * Configure the ESLint plugin for static mode\n */\nexport function configureStaticMode(manifestUrl: string): void {\n const fetcher = configureManifestFetcher({ manifestUrl });\n staticModeState = {\n mode: \"static\",\n manifestUrl,\n fetcher,\n manifest: null,\n };\n devLog(\"[ESLint Plugin] Configured for static mode:\", manifestUrl);\n}\n\n/**\n * Check if static mode is configured\n */\nexport function isStaticMode(): boolean {\n return staticModeState !== null;\n}\n\n/**\n * Get the static mode state\n */\nexport function getStaticModeState(): StaticModeState | null {\n return staticModeState;\n}\n\n/**\n * Clear static mode configuration\n */\nexport function clearStaticMode(): void {\n staticModeState = null;\n}\n\n/**\n * Initialize the ESLint plugin in static mode\n */\nexport function initializeStaticMode(services: PluginServices): () => void {\n if (!staticModeState) {\n devError(\"[ESLint Plugin] Static mode not configured\");\n return () => {};\n }\n\n const { fetcher } = staticModeState;\n\n devLog(\"[ESLint Plugin] Initializing in static mode...\");\n\n // Set initial state\n services.setState({ scanStatus: \"scanning\" });\n\n // Fetch manifest\n fetcher\n .fetch()\n .then(({ manifest }) => {\n staticModeState!.manifest = manifest;\n processManifest(services, manifest);\n })\n .catch((error) => {\n devError(\"[ESLint Plugin] Failed to fetch manifest:\", error);\n services.setState({ scanStatus: \"error\" });\n });\n\n // In static mode, DOM observer just filters already-loaded issues\n // No need to send WebSocket requests\n const unsubscribeDom = services.domObserver.onElementsAdded((elements) => {\n if (!staticModeState?.manifest) return;\n\n // Log for debugging\n devLog(\n \"[ESLint Plugin] Static mode: DOM elements detected:\",\n elements.length\n );\n\n // No action needed - issues are already loaded from manifest\n // The HeatmapOverlay will match them by dataLoc\n });\n\n // Return cleanup function\n return () => {\n unsubscribeDom();\n devLog(\"[ESLint Plugin] Static mode disposed\");\n };\n}\n\n/**\n * Get manifest metadata for display (e.g., in toolbar)\n */\nexport function getManifestMetadata(): {\n generatedAt: string;\n commitSha?: string;\n branch?: string;\n summary: LintManifest[\"summary\"];\n} | null {\n if (!staticModeState?.manifest) return null;\n\n const { manifest } = staticModeState;\n return {\n generatedAt: manifest.generatedAt,\n commitSha: manifest.commitSha,\n branch: manifest.branch,\n summary: manifest.summary,\n };\n}\n","/**\n * useSourceCode - Hook for fetching and caching source code\n *\n * Fetches source code via WebSocket and provides context lines\n * around a target line for the source viewer.\n */\n\nimport { useState, useEffect, useCallback, useRef } from \"react\";\nimport { useComposedStore } from \"../../core/store\";\nimport { websocket } from \"../../core/services/websocket\";\nimport {\n getCachedSource,\n setCachedSource,\n extractContext,\n getPendingRequest,\n setPendingRequest,\n invalidateSource,\n type SourceContext,\n type CachedSourceFile,\n} from \"../../core/services/source-cache\";\nimport { isStaticMode, getFileSource } from \"../../plugins/eslint/static-handler\";\n\ninterface UseSourceCodeOptions {\n filePath: string;\n line: number;\n contextAbove?: number;\n contextBelow?: number;\n enabled?: boolean;\n}\n\ninterface UseSourceCodeResult {\n context: SourceContext | null;\n isLoading: boolean;\n error: string | null;\n refetch: () => void;\n}\n\ninterface SourceResultMessage {\n type: \"source:result\";\n filePath: string;\n content: string;\n totalLines: number;\n relativePath: string;\n requestId?: string;\n}\n\ninterface SourceErrorMessage {\n type: \"source:error\";\n filePath: string;\n error: string;\n requestId?: string;\n}\n\ninterface FileChangedMessage {\n type: \"file:changed\";\n filePath: string;\n}\n\nexport function useSourceCode({\n filePath,\n line,\n contextAbove = 5,\n contextBelow = 5,\n enabled = true,\n}: UseSourceCodeOptions): UseSourceCodeResult {\n const [context, setContext] = useState<SourceContext | null>(null);\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const wsConnected = useComposedStore((s) => s.wsConnected);\n const requestIdRef = useRef<string | null>(null);\n\n const fetchSource = useCallback(() => {\n if (!enabled || !filePath) {\n return;\n }\n\n // Check cache first\n const cached = getCachedSource(filePath);\n if (cached) {\n setContext(extractContext(cached, line, contextAbove, contextBelow));\n setIsLoading(false);\n setError(null);\n return;\n }\n\n // In static mode (no WebSocket), get source from manifest\n if (!wsConnected && isStaticMode()) {\n const manifestSource = getFileSource(filePath);\n if (manifestSource) {\n // Cache it for future requests\n const cachedSource = setCachedSource(\n filePath,\n manifestSource.content,\n manifestSource.totalLines,\n manifestSource.relativePath\n );\n setContext(extractContext(cachedSource, line, contextAbove, contextBelow));\n setIsLoading(false);\n setError(null);\n } else {\n setContext(null);\n setIsLoading(false);\n setError(\"Source not available in manifest\");\n }\n return;\n }\n\n // Need WebSocket for non-static mode\n if (!wsConnected) {\n return;\n }\n\n // Check for pending request (deduplication)\n const pending = getPendingRequest(filePath);\n if (pending) {\n setIsLoading(true);\n pending.then((result) => {\n if (result) {\n setContext(extractContext(result, line, contextAbove, contextBelow));\n setError(null);\n }\n setIsLoading(false);\n });\n return;\n }\n\n setIsLoading(true);\n setError(null);\n\n // Create a promise for this request\n const requestId = `source-${filePath}-${Date.now()}`;\n requestIdRef.current = requestId;\n\n const promise = new Promise<CachedSourceFile | null>((resolve) => {\n // Set up one-time handlers for this request\n const unsubResult = websocket.on<SourceResultMessage>(\n \"source:result\",\n (message) => {\n if (message.filePath === filePath) {\n const cached = setCachedSource(\n message.filePath,\n message.content,\n message.totalLines,\n message.relativePath\n );\n unsubResult();\n unsubError();\n resolve(cached);\n }\n }\n );\n\n const unsubError = websocket.on<SourceErrorMessage>(\n \"source:error\",\n (message) => {\n if (message.filePath === filePath) {\n setError(message.error);\n unsubResult();\n unsubError();\n resolve(null);\n }\n }\n );\n\n // Send the request\n websocket.send({\n type: \"source:fetch\",\n filePath,\n requestId,\n });\n\n // Timeout after 10 seconds\n setTimeout(() => {\n unsubResult();\n unsubError();\n resolve(null);\n }, 10000);\n });\n\n setPendingRequest(filePath, promise);\n\n promise.then((result) => {\n if (result) {\n setContext(extractContext(result, line, contextAbove, contextBelow));\n }\n setIsLoading(false);\n });\n }, [filePath, line, contextAbove, contextBelow, enabled, wsConnected]);\n\n // Fetch on mount and when dependencies change\n useEffect(() => {\n fetchSource();\n }, [fetchSource]);\n\n // Subscribe to file changes to invalidate cache\n useEffect(() => {\n if (!filePath) return;\n\n const unsubscribe = websocket.on<FileChangedMessage>(\n \"file:changed\",\n (message) => {\n // Check if the changed file matches our file path\n if (\n message.filePath === filePath ||\n message.filePath.endsWith(filePath) ||\n filePath.endsWith(message.filePath)\n ) {\n invalidateSource(filePath);\n // Refetch if we're still mounted and enabled\n if (enabled) {\n fetchSource();\n }\n }\n }\n );\n\n return unsubscribe;\n }, [filePath, enabled, fetchSource]);\n\n return { context, isLoading, error, refetch: fetchSource };\n}\n","/**\n * useTileNavigation - 2D keyboard navigation for tile grids\n *\n * Handles arrow key navigation in a grid layout with configurable columns,\n * plus Enter to select, Backspace to go back, and Home/End for quick jumps.\n */\n\nimport { useState, useCallback, useEffect } from \"react\";\nimport type { TileItem } from \"../../core/plugin-system/types\";\n\nexport interface UseTileNavigationReturn {\n selectedIndex: number;\n setSelectedIndex: (index: number) => void;\n handleKeyDown: (e: React.KeyboardEvent) => void;\n}\n\nexport function useTileNavigation(\n items: TileItem[],\n columns: number,\n onSelect: (item: TileItem) => void,\n onBack?: () => void\n): UseTileNavigationReturn {\n const [selectedIndex, setSelectedIndex] = useState(0);\n\n // Reset index to 0 when items array changes\n useEffect(() => {\n setSelectedIndex(0);\n }, [items]);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n const itemCount = items.length;\n if (itemCount === 0) return;\n\n // Helper to clamp index within bounds\n const clamp = (index: number) => Math.max(0, Math.min(index, itemCount - 1));\n\n // Get current row position\n const currentRow = Math.floor(selectedIndex / columns);\n const currentCol = selectedIndex % columns;\n const rowStart = currentRow * columns;\n const rowEnd = Math.min(rowStart + columns - 1, itemCount - 1);\n\n switch (e.key) {\n case \"ArrowDown\": {\n e.preventDefault();\n const newIndex = selectedIndex + columns;\n // Wrap to start if past end\n if (newIndex >= itemCount) {\n setSelectedIndex(currentCol < itemCount ? currentCol : 0);\n } else {\n setSelectedIndex(newIndex);\n }\n break;\n }\n\n case \"ArrowUp\": {\n e.preventDefault();\n const newIndex = selectedIndex - columns;\n // Wrap to end if before start\n if (newIndex < 0) {\n // Find the last row's equivalent position\n const totalRows = Math.ceil(itemCount / columns);\n const lastRowStart = (totalRows - 1) * columns;\n const lastRowIndex = lastRowStart + currentCol;\n setSelectedIndex(clamp(lastRowIndex));\n } else {\n setSelectedIndex(newIndex);\n }\n break;\n }\n\n case \"ArrowLeft\": {\n e.preventDefault();\n // Stop at row start\n if (selectedIndex > rowStart) {\n setSelectedIndex(selectedIndex - 1);\n }\n break;\n }\n\n case \"ArrowRight\": {\n e.preventDefault();\n // Stop at row end\n if (selectedIndex < rowEnd) {\n setSelectedIndex(selectedIndex + 1);\n }\n break;\n }\n\n case \"Enter\": {\n e.preventDefault();\n const item = items[selectedIndex];\n if (item) {\n onSelect(item);\n }\n break;\n }\n\n case \"Backspace\": {\n if (onBack) {\n e.preventDefault();\n onBack();\n }\n break;\n }\n\n case \"Home\": {\n e.preventDefault();\n setSelectedIndex(0);\n break;\n }\n\n case \"End\": {\n e.preventDefault();\n setSelectedIndex(itemCount - 1);\n break;\n }\n\n default:\n // Don't prevent default for unhandled keys\n break;\n }\n },\n [items, columns, selectedIndex, onSelect, onBack]\n );\n\n return {\n selectedIndex,\n setSelectedIndex,\n handleKeyDown,\n };\n}\n","/**\n * useTileItems - React hook for accessing tile items\n *\n * Computes tile items on demand from plugin providers.\n * With the new expandable tile model, this always returns root-level tiles (rules).\n * Expansion to children (files, issues) is handled by the ExpandableTileGrid component.\n */\n\nimport { useMemo } from \"react\";\nimport { devWarn } from \"uilint-core\";\nimport {\n useComposedStore,\n selectIssuesMap,\n getPluginServices,\n} from \"../../core/store\";\nimport { filterByQuery, dedupeItems } from \"../../core/store/tile-selectors\";\nimport { pluginRegistry } from \"../../core/plugin-system/registry\";\nimport type { TileItem } from \"../../core/plugin-system/types\";\n\n/**\n * Return type for the useTileItems hook\n */\nexport interface UseTileItemsResult {\n /** Tile items to display */\n items: TileItem[];\n /** Whether any provider is still loading (always false - computation is sync) */\n isLoading: boolean;\n /** Whether current state represents a terminal state (no more drill-down) */\n isTerminal: boolean;\n}\n\n// Stable empty array to avoid creating new references\nconst EMPTY_ITEMS: TileItem[] = [];\n\n// Empty filters - we always show root-level tiles now\nconst EMPTY_FILTERS: never[] = [];\n\n/**\n * Compute tile items from all registered providers.\n * Always returns root-level tiles (no filters applied).\n */\nfunction computeTileItems(): TileItem[] {\n const services = getPluginServices();\n if (!services) {\n devWarn(\"[useTileItems] Plugin services not available\");\n return EMPTY_ITEMS;\n }\n\n const tileProviders = pluginRegistry.getAllTileProviders();\n if (tileProviders.length === 0) {\n return EMPTY_ITEMS;\n }\n\n const allItems: TileItem[] = [];\n\n for (const { pluginId, provider } of tileProviders) {\n try {\n // Always pass empty filters to get root-level tiles\n const result = provider.getTileItems(services, EMPTY_FILTERS);\n\n // Add providerId to each item's metadata for expansion handling\n const itemsWithProvider = result.map((item) => ({\n ...item,\n metadata: {\n ...item.metadata,\n providerId: pluginId,\n },\n }));\n\n allItems.push(...itemsWithProvider);\n } catch (error) {\n devWarn(\n `[useTileItems] Error getting tile items from plugin \"${pluginId}\":`,\n error\n );\n }\n }\n\n return allItems;\n}\n\n/**\n * Hook that returns tile items to display.\n *\n * With the new expandable tile model, this always returns root-level tiles.\n * Child tiles (files, issues) are fetched by the ExpandableTileGrid when\n * tiles are expanded.\n *\n * @param query - Optional search query to filter tiles\n * @returns Object containing items, loading state, and terminal state\n *\n * @example\n * ```tsx\n * function TileGrid() {\n * const { items, isLoading } = useTileItems();\n *\n * if (isLoading) return <Spinner />;\n *\n * return (\n * <ExpandableTileGrid items={items} ... />\n * );\n * }\n * ```\n */\nexport function useTileItems(query?: string): UseTileItemsResult {\n // Get query from store if not provided\n const storeQuery = useComposedStore((s) => s.commandPalette.query);\n const effectiveQuery = query ?? storeQuery;\n\n // Subscribe to issues changes to trigger re-computation when lint results arrive\n const issuesMap = useComposedStore(selectIssuesMap);\n\n // Subscribe to disabled rules to re-compute when rules are toggled\n const disabledRules = useComposedStore(\n (s) => (s.plugins?.eslint as { disabledRules?: Set<string> } | undefined)?.disabledRules\n );\n\n // Compute raw tile items when issues or disabled rules change\n const rawItems = useMemo(() => computeTileItems(), [issuesMap, disabledRules]);\n\n // Apply query filtering and deduplication\n const items = useMemo(() => {\n if (rawItems.length === 0) return EMPTY_ITEMS;\n const filtered = filterByQuery(rawItems, effectiveQuery);\n return dedupeItems(filtered);\n }, [rawItems, effectiveQuery]);\n\n return {\n items,\n // Always false since computation is synchronous\n isLoading: false,\n // Never terminal at root level - expansion handles drill-down\n isTerminal: false,\n };\n}\n","/**\n * Copyright 2022 Joe Bell. All rights reserved.\n *\n * This file is licensed to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with the\n * License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n */ import { clsx } from \"clsx\";\nconst falsyToString = (value)=>typeof value === \"boolean\" ? `${value}` : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>(props)=>{\n var _config_compoundVariants;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants, defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{\n let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nconst toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\").toLowerCase();\nconst toCamelCase = (string) => string.replace(\n /^([A-Z])|[\\s-_]+(\\w)/g,\n (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()\n);\nconst toPascalCase = (string) => {\n const camelCase = toCamelCase(string);\n return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);\n};\nconst mergeClasses = (...classes) => classes.filter((className, index, array) => {\n return Boolean(className) && className.trim() !== \"\" && array.indexOf(className) === index;\n}).join(\" \").trim();\nconst hasA11yProp = (props) => {\n for (const prop in props) {\n if (prop.startsWith(\"aria-\") || prop === \"role\" || prop === \"title\") {\n return true;\n }\n }\n};\n\nexport { hasA11yProp, mergeClasses, toCamelCase, toKebabCase, toPascalCase };\n//# sourceMappingURL=utils.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nvar defaultAttributes = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n};\n\nexport { defaultAttributes as default };\n//# sourceMappingURL=defaultAttributes.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { forwardRef, createElement } from 'react';\nimport defaultAttributes from './defaultAttributes.js';\nimport { mergeClasses, hasA11yProp } from './shared/src/utils.js';\n\nconst Icon = forwardRef(\n ({\n color = \"currentColor\",\n size = 24,\n strokeWidth = 2,\n absoluteStrokeWidth,\n className = \"\",\n children,\n iconNode,\n ...rest\n }, ref) => createElement(\n \"svg\",\n {\n ref,\n ...defaultAttributes,\n width: size,\n height: size,\n stroke: color,\n strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,\n className: mergeClasses(\"lucide\", className),\n ...!children && !hasA11yProp(rest) && { \"aria-hidden\": \"true\" },\n ...rest\n },\n [\n ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...Array.isArray(children) ? children : [children]\n ]\n )\n);\n\nexport { Icon as default };\n//# sourceMappingURL=Icon.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { forwardRef, createElement } from 'react';\nimport { mergeClasses, toKebabCase, toPascalCase } from './shared/src/utils.js';\nimport Icon from './Icon.js';\n\nconst createLucideIcon = (iconName, iconNode) => {\n const Component = forwardRef(\n ({ className, ...props }, ref) => createElement(Icon, {\n ref,\n iconNode,\n className: mergeClasses(\n `lucide-${toKebabCase(toPascalCase(iconName))}`,\n `lucide-${iconName}`,\n className\n ),\n ...props\n })\n );\n Component.displayName = toPascalCase(iconName);\n return Component;\n};\n\nexport { createLucideIcon as default };\n//# sourceMappingURL=createLucideIcon.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M12 18V5\", key: \"adv99a\" }],\n [\"path\", { d: \"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4\", key: \"1e3is1\" }],\n [\"path\", { d: \"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5\", key: \"1gqd8o\" }],\n [\"path\", { d: \"M17.997 5.125a4 4 0 0 1 2.526 5.77\", key: \"iwvgf7\" }],\n [\"path\", { d: \"M18 18a4 4 0 0 0 2-7.464\", key: \"efp6ie\" }],\n [\"path\", { d: \"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517\", key: \"1gq6am\" }],\n [\"path\", { d: \"M6 18a4 4 0 0 1-2-7.464\", key: \"k1g0md\" }],\n [\"path\", { d: \"M6.003 5.125a4 4 0 0 0-2.526 5.77\", key: \"q97ue3\" }]\n];\nconst Brain = createLucideIcon(\"brain\", __iconNode);\n\nexport { __iconNode, Brain as default };\n//# sourceMappingURL=brain.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z\",\n key: \"18u6gg\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"13\", r: \"3\", key: \"1vg3eu\" }]\n];\nconst Camera = createLucideIcon(\"camera\", __iconNode);\n\nexport { __iconNode, Camera as default };\n//# sourceMappingURL=camera.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"M20 6 9 17l-5-5\", key: \"1gmf2c\" }]];\nconst Check = createLucideIcon(\"check\", __iconNode);\n\nexport { __iconNode, Check as default };\n//# sourceMappingURL=check.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"m6 9 6 6 6-6\", key: \"qrunsl\" }]];\nconst ChevronDown = createLucideIcon(\"chevron-down\", __iconNode);\n\nexport { __iconNode, ChevronDown as default };\n//# sourceMappingURL=chevron-down.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"m15 18-6-6 6-6\", key: \"1wnfg3\" }]];\nconst ChevronLeft = createLucideIcon(\"chevron-left\", __iconNode);\n\nexport { __iconNode, ChevronLeft as default };\n//# sourceMappingURL=chevron-left.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"m9 18 6-6-6-6\", key: \"mthhwq\" }]];\nconst ChevronRight = createLucideIcon(\"chevron-right\", __iconNode);\n\nexport { __iconNode, ChevronRight as default };\n//# sourceMappingURL=chevron-right.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"m18 15-6-6-6 6\", key: \"153udz\" }]];\nconst ChevronUp = createLucideIcon(\"chevron-up\", __iconNode);\n\nexport { __iconNode, ChevronUp as default };\n//# sourceMappingURL=chevron-up.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"line\", { x1: \"12\", x2: \"12\", y1: \"8\", y2: \"12\", key: \"1pkeuh\" }],\n [\"line\", { x1: \"12\", x2: \"12.01\", y1: \"16\", y2: \"16\", key: \"4dfq90\" }]\n];\nconst CircleAlert = createLucideIcon(\"circle-alert\", __iconNode);\n\nexport { __iconNode, CircleAlert as default };\n//# sourceMappingURL=circle-alert.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M21.801 10A10 10 0 1 1 17 3.335\", key: \"yps3ct\" }],\n [\"path\", { d: \"m9 11 3 3L22 4\", key: \"1pflzl\" }]\n];\nconst CircleCheckBig = createLucideIcon(\"circle-check-big\", __iconNode);\n\nexport { __iconNode, CircleCheckBig as default };\n//# sourceMappingURL=circle-check-big.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"path\", { d: \"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\", key: \"1u773s\" }],\n [\"path\", { d: \"M12 17h.01\", key: \"p32p05\" }]\n];\nconst CircleQuestionMark = createLucideIcon(\"circle-question-mark\", __iconNode);\n\nexport { __iconNode, CircleQuestionMark as default };\n//# sourceMappingURL=circle-question-mark.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"path\", { d: \"m15 9-6 6\", key: \"1uzhvr\" }],\n [\"path\", { d: \"m9 9 6 6\", key: \"z0biqf\" }]\n];\nconst CircleX = createLucideIcon(\"circle-x\", __iconNode);\n\nexport { __iconNode, CircleX as default };\n//# sourceMappingURL=circle-x.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"rect\", { width: \"8\", height: \"4\", x: \"8\", y: \"2\", rx: \"1\", ry: \"1\", key: \"tgr4d6\" }],\n [\n \"path\",\n {\n d: \"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2\",\n key: \"116196\"\n }\n ]\n];\nconst Clipboard = createLucideIcon(\"clipboard\", __iconNode);\n\nexport { __iconNode, Clipboard as default };\n//# sourceMappingURL=clipboard.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M12 6v6l4 2\", key: \"mmk7yg\" }],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }]\n];\nconst Clock = createLucideIcon(\"clock\", __iconNode);\n\nexport { __iconNode, Clock as default };\n//# sourceMappingURL=clock.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"m18 16 4-4-4-4\", key: \"1inbqp\" }],\n [\"path\", { d: \"m6 8-4 4 4 4\", key: \"15zrgr\" }],\n [\"path\", { d: \"m14.5 4-5 16\", key: \"e7oirm\" }]\n];\nconst CodeXml = createLucideIcon(\"code-xml\", __iconNode);\n\nexport { __iconNode, CodeXml as default };\n//# sourceMappingURL=code-xml.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"m16 18 6-6-6-6\", key: \"eg8j8\" }],\n [\"path\", { d: \"m8 6-6 6 6 6\", key: \"ppft3o\" }]\n];\nconst Code = createLucideIcon(\"code\", __iconNode);\n\nexport { __iconNode, Code as default };\n//# sourceMappingURL=code.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"rect\", { width: \"14\", height: \"14\", x: \"8\", y: \"8\", rx: \"2\", ry: \"2\", key: \"17jyea\" }],\n [\"path\", { d: \"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\", key: \"zix9uf\" }]\n];\nconst Copy = createLucideIcon(\"copy\", __iconNode);\n\nexport { __iconNode, Copy as default };\n//# sourceMappingURL=copy.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M6 2v14a2 2 0 0 0 2 2h14\", key: \"ron5a4\" }],\n [\"path\", { d: \"M18 22V8a2 2 0 0 0-2-2H2\", key: \"7s9ehn\" }]\n];\nconst Crop = createLucideIcon(\"crop\", __iconNode);\n\nexport { __iconNode, Crop as default };\n//# sourceMappingURL=crop.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M15 3h6v6\", key: \"1q9fwt\" }],\n [\"path\", { d: \"M10 14 21 3\", key: \"gplh6r\" }],\n [\"path\", { d: \"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\", key: \"a6xqqp\" }]\n];\nconst ExternalLink = createLucideIcon(\"external-link\", __iconNode);\n\nexport { __iconNode, ExternalLink as default };\n//# sourceMappingURL=external-link.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\",\n key: \"1nclc0\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\", key: \"1v7zrd\" }]\n];\nconst Eye = createLucideIcon(\"eye\", __iconNode);\n\nexport { __iconNode, Eye as default };\n//# sourceMappingURL=eye.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\",\n key: \"1oefj6\"\n }\n ],\n [\"path\", { d: \"M14 2v5a1 1 0 0 0 1 1h5\", key: \"wfsgrz\" }],\n [\"path\", { d: \"M10 12.5 8 15l2 2.5\", key: \"1tg20x\" }],\n [\"path\", { d: \"m14 12.5 2 2.5-2 2.5\", key: \"yinavb\" }]\n];\nconst FileCode = createLucideIcon(\"file-code\", __iconNode);\n\nexport { __iconNode, FileCode as default };\n//# sourceMappingURL=file-code.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\",\n key: \"1oefj6\"\n }\n ],\n [\"path\", { d: \"M14 2v5a1 1 0 0 0 1 1h5\", key: \"wfsgrz\" }]\n];\nconst File = createLucideIcon(\"file\", __iconNode);\n\nexport { __iconNode, File as default };\n//# sourceMappingURL=file.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z\",\n key: \"1kt360\"\n }\n ]\n];\nconst Folder = createLucideIcon(\"folder\", __iconNode);\n\nexport { __iconNode, Folder as default };\n//# sourceMappingURL=folder.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z\",\n key: \"sc7q7i\"\n }\n ]\n];\nconst Funnel = createLucideIcon(\"funnel\", __iconNode);\n\nexport { __iconNode, Funnel as default };\n//# sourceMappingURL=funnel.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"line\", { x1: \"6\", x2: \"6\", y1: \"3\", y2: \"15\", key: \"17qcm7\" }],\n [\"circle\", { cx: \"18\", cy: \"6\", r: \"3\", key: \"1h7g24\" }],\n [\"circle\", { cx: \"6\", cy: \"18\", r: \"3\", key: \"fqmcym\" }],\n [\"path\", { d: \"M18 9a9 9 0 0 1-9 9\", key: \"n2h4wq\" }]\n];\nconst GitBranch = createLucideIcon(\"git-branch\", __iconNode);\n\nexport { __iconNode, GitBranch as default };\n//# sourceMappingURL=git-branch.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"path\", { d: \"M12 16v-4\", key: \"1dtifu\" }],\n [\"path\", { d: \"M12 8h.01\", key: \"e9boi3\" }]\n];\nconst Info = createLucideIcon(\"info\", __iconNode);\n\nexport { __iconNode, Info as default };\n//# sourceMappingURL=info.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z\",\n key: \"zw3jo\"\n }\n ],\n [\n \"path\",\n {\n d: \"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12\",\n key: \"1wduqc\"\n }\n ],\n [\n \"path\",\n {\n d: \"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17\",\n key: \"kqbvx6\"\n }\n ]\n];\nconst Layers = createLucideIcon(\"layers\", __iconNode);\n\nexport { __iconNode, Layers as default };\n//# sourceMappingURL=layers.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\", key: \"1cjeqo\" }],\n [\"path\", { d: \"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\", key: \"19qd67\" }]\n];\nconst Link = createLucideIcon(\"link\", __iconNode);\n\nexport { __iconNode, Link as default };\n//# sourceMappingURL=link.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"M21 12a9 9 0 1 1-6.219-8.56\", key: \"13zald\" }]];\nconst LoaderCircle = createLucideIcon(\"loader-circle\", __iconNode);\n\nexport { __iconNode, LoaderCircle as default };\n//# sourceMappingURL=loader-circle.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M15 3h6v6\", key: \"1q9fwt\" }],\n [\"path\", { d: \"m21 3-7 7\", key: \"1l2asr\" }],\n [\"path\", { d: \"m3 21 7-7\", key: \"tjx5ai\" }],\n [\"path\", { d: \"M9 21H3v-6\", key: \"wtvkvv\" }]\n];\nconst Maximize2 = createLucideIcon(\"maximize-2\", __iconNode);\n\nexport { __iconNode, Maximize2 as default };\n//# sourceMappingURL=maximize-2.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"M5 12h14\", key: \"1ays0h\" }]];\nconst Minus = createLucideIcon(\"minus\", __iconNode);\n\nexport { __iconNode, Minus as default };\n//# sourceMappingURL=minus.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"rect\", { width: \"18\", height: \"18\", x: \"3\", y: \"3\", rx: \"2\", key: \"afitv7\" }],\n [\"path\", { d: \"M15 3v18\", key: \"14nvp0\" }]\n];\nconst PanelRight = createLucideIcon(\"panel-right\", __iconNode);\n\nexport { __iconNode, PanelRight as default };\n//# sourceMappingURL=panel-right.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"rect\", { x: \"14\", y: \"3\", width: \"5\", height: \"18\", rx: \"1\", key: \"kaeet6\" }],\n [\"rect\", { x: \"5\", y: \"3\", width: \"5\", height: \"18\", rx: \"1\", key: \"1wsw3u\" }]\n];\nconst Pause = createLucideIcon(\"pause\", __iconNode);\n\nexport { __iconNode, Pause as default };\n//# sourceMappingURL=pause.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\",\n key: \"10ikf1\"\n }\n ]\n];\nconst Play = createLucideIcon(\"play\", __iconNode);\n\nexport { __iconNode, Play as default };\n//# sourceMappingURL=play.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M5 12h14\", key: \"1ays0h\" }],\n [\"path\", { d: \"M12 5v14\", key: \"s699le\" }]\n];\nconst Plus = createLucideIcon(\"plus\", __iconNode);\n\nexport { __iconNode, Plus as default };\n//# sourceMappingURL=plus.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\", key: \"v9h5vc\" }],\n [\"path\", { d: \"M21 3v5h-5\", key: \"1q7to0\" }],\n [\"path\", { d: \"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\", key: \"3uifl3\" }],\n [\"path\", { d: \"M8 16H3v5\", key: \"1cv678\" }]\n];\nconst RefreshCw = createLucideIcon(\"refresh-cw\", __iconNode);\n\nexport { __iconNode, RefreshCw as default };\n//# sourceMappingURL=refresh-cw.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M3 7V5a2 2 0 0 1 2-2h2\", key: \"aa7l1z\" }],\n [\"path\", { d: \"M17 3h2a2 2 0 0 1 2 2v2\", key: \"4qcy5o\" }],\n [\"path\", { d: \"M21 17v2a2 2 0 0 1-2 2h-2\", key: \"6vwrx8\" }],\n [\"path\", { d: \"M7 21H5a2 2 0 0 1-2-2v-2\", key: \"ioqczr\" }],\n [\"path\", { d: \"M7 12h10\", key: \"b7w52i\" }]\n];\nconst ScanLine = createLucideIcon(\"scan-line\", __iconNode);\n\nexport { __iconNode, ScanLine as default };\n//# sourceMappingURL=scan-line.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"m21 21-4.34-4.34\", key: \"14j7rj\" }],\n [\"circle\", { cx: \"11\", cy: \"11\", r: \"8\", key: \"4ej97u\" }]\n];\nconst Search = createLucideIcon(\"search\", __iconNode);\n\nexport { __iconNode, Search as default };\n//# sourceMappingURL=search.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915\",\n key: \"1i5ecw\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\", key: \"1v7zrd\" }]\n];\nconst Settings = createLucideIcon(\"settings\", __iconNode);\n\nexport { __iconNode, Settings as default };\n//# sourceMappingURL=settings.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z\",\n key: \"1s2grr\"\n }\n ],\n [\"path\", { d: \"M20 2v4\", key: \"1rf3ol\" }],\n [\"path\", { d: \"M22 4h-4\", key: \"gwowj6\" }],\n [\"circle\", { cx: \"4\", cy: \"20\", r: \"2\", key: \"6kqj1y\" }]\n];\nconst Sparkles = createLucideIcon(\"sparkles\", __iconNode);\n\nexport { __iconNode, Sparkles as default };\n//# sourceMappingURL=sparkles.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\", key: \"1m0v6g\" }],\n [\n \"path\",\n {\n d: \"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z\",\n key: \"ohrbg2\"\n }\n ]\n];\nconst SquarePen = createLucideIcon(\"square-pen\", __iconNode);\n\nexport { __iconNode, SquarePen as default };\n//# sourceMappingURL=square-pen.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"6\", key: \"1vlfrh\" }],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"2\", key: \"1c9p78\" }]\n];\nconst Target = createLucideIcon(\"target\", __iconNode);\n\nexport { __iconNode, Target as default };\n//# sourceMappingURL=target.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M12 19h8\", key: \"baeox8\" }],\n [\"path\", { d: \"m4 17 6-6-6-6\", key: \"1yngyt\" }]\n];\nconst Terminal = createLucideIcon(\"terminal\", __iconNode);\n\nexport { __iconNode, Terminal as default };\n//# sourceMappingURL=terminal.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M10 11v6\", key: \"nco0om\" }],\n [\"path\", { d: \"M14 11v6\", key: \"outv1u\" }],\n [\"path\", { d: \"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\", key: \"miytrc\" }],\n [\"path\", { d: \"M3 6h18\", key: \"d0wm0j\" }],\n [\"path\", { d: \"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\", key: \"e791ji\" }]\n];\nconst Trash2 = createLucideIcon(\"trash-2\", __iconNode);\n\nexport { __iconNode, Trash2 as default };\n//# sourceMappingURL=trash-2.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\",\n key: \"wmoenq\"\n }\n ],\n [\"path\", { d: \"M12 9v4\", key: \"juzpu7\" }],\n [\"path\", { d: \"M12 17h.01\", key: \"p32p05\" }]\n];\nconst TriangleAlert = createLucideIcon(\"triangle-alert\", __iconNode);\n\nexport { __iconNode, TriangleAlert as default };\n//# sourceMappingURL=triangle-alert.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M18 6 6 18\", key: \"1bl5f8\" }],\n [\"path\", { d: \"m6 6 12 12\", key: \"d8bk6v\" }]\n];\nconst X = createLucideIcon(\"x\", __iconNode);\n\nexport { __iconNode, X as default };\n//# sourceMappingURL=x.js.map\n","// icons.tsx - Re-export Lucide icons for UILint UI\n// Using lucide-react for consistent, well-designed icons\n\nimport React from \"react\";\n\n/**\n * Custom UILint Inspector icon - layered UI elements with status indicator\n * Represents inspecting UI components for issues\n */\nexport function UILintInspectorIcon({ size = 24, className }: { size?: number; className?: string }) {\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.75\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={className}\n >\n {/* Back layer - UI component */}\n <rect x=\"3\" y=\"3\" width=\"12\" height=\"12\" rx=\"2\" opacity=\"0.4\" />\n {/* Front layer - UI component */}\n <rect x=\"9\" y=\"9\" width=\"12\" height=\"12\" rx=\"2\" />\n {/* Status dot - represents linting indicator */}\n <circle cx=\"18\" cy=\"6\" r=\"2.5\" fill=\"currentColor\" stroke=\"none\" />\n </svg>\n );\n}\n\nexport {\n // Brand/logo - using CheckSquare as UILint logo\n CheckSquare as UILintIcon,\n // Search\n Search as SearchIcon,\n // Close\n X as CloseIcon,\n // Severity indicators\n AlertTriangle as WarningIcon,\n XCircle as ErrorIcon,\n Info as InfoIcon,\n // File and navigation\n File as FileIcon,\n FileCode as FileCodeIcon,\n List as RuleIcon,\n Scale as RuleScaleIcon,\n ChevronRight as ChevronRightIcon,\n ChevronRight as ChevronIcon,\n ChevronDown as ChevronDownIcon,\n ExternalLink as ExternalLinkIcon,\n // Settings and actions\n Settings as SettingsIcon,\n Check as CheckIcon,\n Wifi as ConnectionIcon,\n // Command palette actions\n Play as PlayIcon,\n Square as StopIcon,\n RotateCcw as RefreshIcon,\n // Inspector dock/float toggle\n Maximize2 as MaximizeIcon,\n PanelRight as DockIcon,\n} from \"lucide-react\";\n","/**\n * Kbd - macOS-style keyboard hint component\n *\n * A shadcn-style component for displaying keyboard shortcuts and hints.\n * Inspired by Spotlight/Raycast keyboard hints with smooth animations.\n *\n * Features:\n * - CSS variable theming (--uilint-kbd-*)\n * - Fade-in animation via motion/react\n * - Size and variant options via CVA\n */\nimport * as React from \"react\";\nimport { motion, type HTMLMotionProps } from \"motion/react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\n/**\n * Kbd variants using CVA for consistent styling\n */\nconst kbdVariants = cva(\n // Base styles\n [\n \"inline-flex items-center justify-center\",\n \"font-medium\",\n \"font-[-apple-system,BlinkMacSystemFont,'SF_Pro_Text','Segoe_UI',sans-serif]\",\n \"rounded\",\n \"select-none\",\n \"whitespace-nowrap\",\n ].join(\" \"),\n {\n variants: {\n variant: {\n default: [\n // Use CSS variables with fallbacks to the inline styles from existing implementations\n \"bg-[var(--uilint-kbd-background,linear-gradient(180deg,#ffffff_0%,#f3f4f6_100%))]\",\n \"text-[var(--uilint-kbd-text,#6b7280)]\",\n \"border border-[var(--uilint-kbd-border,rgba(0,0,0,0.1))]\",\n \"shadow-[var(--uilint-kbd-shadow,0_1px_0_rgba(0,0,0,0.08))]\",\n ].join(\" \"),\n subtle: [\n \"bg-[var(--uilint-kbd-background-subtle,rgba(0,0,0,0.04))]\",\n \"text-[var(--uilint-kbd-text-subtle,#9ca3af)]\",\n \"border border-[var(--uilint-kbd-border-subtle,transparent)]\",\n ].join(\" \"),\n },\n size: {\n sm: \"min-w-4 h-4 px-1 text-[9px]\",\n default: \"min-w-[18px] h-[18px] px-1 text-[10px]\",\n lg: \"min-w-6 h-6 px-1.5 text-xs\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\n/**\n * Motion variants for fade-in animation\n */\nconst kbdMotionVariants = {\n hidden: {\n opacity: 0,\n scale: 0.95,\n },\n visible: {\n opacity: 1,\n scale: 1,\n },\n} as const;\n\nexport interface KbdProps\n extends Omit<HTMLMotionProps<\"kbd\">, \"children\">,\n VariantProps<typeof kbdVariants> {\n /** The keyboard key or shortcut to display */\n children: React.ReactNode;\n /** Whether to animate the component on mount */\n animate?: boolean;\n /** Animation duration in seconds */\n animationDuration?: number;\n}\n\n/**\n * Kbd component - Renders a keyboard hint with macOS-style appearance\n *\n * @example\n * ```tsx\n * // Basic usage\n * <Kbd>esc</Kbd>\n * <Kbd>Enter</Kbd>\n *\n * // With modifier keys\n * <Kbd>⌘K</Kbd>\n * <Kbd>Ctrl+S</Kbd>\n *\n * // Variants\n * <Kbd variant=\"subtle\">Tab</Kbd>\n *\n * // Sizes\n * <Kbd size=\"sm\">↑</Kbd>\n * <Kbd size=\"lg\">Space</Kbd>\n *\n * // With animation disabled\n * <Kbd animate={false}>F1</Kbd>\n * ```\n */\nconst Kbd = React.forwardRef<HTMLElement, KbdProps>(\n (\n {\n className,\n variant,\n size,\n children,\n animate = true,\n animationDuration = 0.1,\n style,\n ...props\n },\n ref\n ) => {\n // Inline style fallbacks for CSS variable support\n // These ensure the component works even without CSS variables defined\n const baseStyles = {\n // Gradient background needs inline style as Tailwind can't do gradient vars easily\n background:\n variant === \"subtle\"\n ? \"var(--uilint-kbd-background-subtle, rgba(0, 0, 0, 0.04))\"\n : \"var(--uilint-kbd-background, linear-gradient(180deg, #ffffff 0%, #f3f4f6 100%))\",\n color:\n variant === \"subtle\"\n ? \"var(--uilint-kbd-text-subtle, #9ca3af)\"\n : \"var(--uilint-kbd-text, #6b7280)\",\n borderColor:\n variant === \"subtle\"\n ? \"var(--uilint-kbd-border-subtle, transparent)\"\n : \"var(--uilint-kbd-border, rgba(0, 0, 0, 0.1))\",\n boxShadow:\n variant === \"subtle\"\n ? \"none\"\n : \"var(--uilint-kbd-shadow, 0 1px 0 rgba(0, 0, 0, 0.08))\",\n ...style,\n } as const;\n\n if (animate) {\n return (\n <motion.kbd\n ref={ref as React.Ref<HTMLElement>}\n className={cn(kbdVariants({ variant, size }), className)}\n style={baseStyles}\n initial=\"hidden\"\n animate=\"visible\"\n variants={kbdMotionVariants}\n transition={{ duration: animationDuration, ease: \"easeOut\" }}\n {...props}\n >\n {children}\n </motion.kbd>\n );\n }\n\n return (\n <motion.kbd\n ref={ref as React.Ref<HTMLElement>}\n className={cn(kbdVariants({ variant, size }), className)}\n style={baseStyles}\n {...props}\n >\n {children}\n </motion.kbd>\n );\n }\n);\n\nKbd.displayName = \"Kbd\";\n\nexport { Kbd, kbdVariants, kbdMotionVariants };\n","/* eslint-disable uilint/prefer-tailwind */\n/**\n * Badge component - Status badges for displaying issue severities, counts, categories, etc.\n *\n * Follows shadcn conventions with:\n * - CVA (class-variance-authority) for variant handling\n * - motion/react for scale + fade animations\n * - CSS variables from the uilint design system\n */\nimport * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { motion, type HTMLMotionProps } from \"motion/react\";\n\nimport { cn } from \"../../lib/utils\";\n\n/**\n * Badge variants using CVA\n *\n * Uses Tailwind utilities mapped to --uilint-* CSS variables via globals.css @theme\n */\nconst badgeVariants = cva(\n // Base styles\n \"inline-flex items-center justify-center font-semibold transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n {\n variants: {\n variant: {\n default:\n \"bg-surface-elevated text-text-secondary border border-border\",\n error:\n \"bg-error-bg text-error border-0\",\n warning:\n \"bg-warning-bg text-warning border-0\",\n success:\n \"bg-success-bg text-success border-0\",\n info:\n \"bg-info-bg text-info border-0\",\n outline:\n \"bg-transparent text-text-secondary border border-border\",\n },\n size: {\n sm: \"px-1.5 py-0.5 text-[10px] leading-tight min-h-4\",\n default: \"px-2 py-0.5 text-xs leading-tight min-h-5\",\n lg: \"px-3 py-1 text-sm leading-tight min-h-6\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\n// Crisp easing curve matching the codebase animation style\nconst crispEase = [0.32, 0.72, 0, 1] as const;\n\n// Motion variants for scale + fade animation\nconst badgeMotionVariants = {\n initial: {\n opacity: 0,\n scale: 0.85,\n },\n animate: {\n opacity: 1,\n scale: 1,\n },\n exit: {\n opacity: 0,\n scale: 0.85,\n },\n};\n\nexport interface BadgeProps\n extends Omit<HTMLMotionProps<\"span\">, \"children\">,\n VariantProps<typeof badgeVariants> {\n children: React.ReactNode;\n /** Disable motion animations */\n disableAnimation?: boolean;\n}\n\n/**\n * Badge - Animated status badge component\n *\n * @example\n * ```tsx\n * <Badge variant=\"error\">3 errors</Badge>\n * <Badge variant=\"success\" size=\"sm\">Passed</Badge>\n * <Badge variant=\"warning\" size=\"lg\">Needs review</Badge>\n * ```\n */\nfunction Badge({\n className,\n variant,\n size,\n children,\n disableAnimation = false,\n style,\n ...props\n}: BadgeProps) {\n // Apply badge radius from CSS variable\n const badgeStyle = {\n borderRadius: \"var(--uilint-badge-radius, 6px)\",\n ...style,\n } as const;\n\n if (disableAnimation) {\n return (\n <span\n className={cn(badgeVariants({ variant, size }), className)}\n style={badgeStyle as React.CSSProperties}\n >\n {children}\n </span>\n );\n }\n\n return (\n <motion.span\n className={cn(badgeVariants({ variant, size }), className)}\n style={badgeStyle}\n variants={badgeMotionVariants}\n initial=\"initial\"\n animate=\"animate\"\n exit=\"exit\"\n transition={{\n duration: 0.15,\n ease: crispEase,\n }}\n {...props}\n >\n {children}\n </motion.span>\n );\n}\n\n/**\n * StatBadge - Badge with icon and label for displaying statistics\n *\n * Inspired by IssuesSummaryCard's StatBadge pattern\n *\n * @example\n * ```tsx\n * <StatBadge\n * icon={<AlertCircle size={14} />}\n * label=\"Errors\"\n * value={5}\n * variant=\"error\"\n * />\n * ```\n */\nexport interface StatBadgeProps extends VariantProps<typeof badgeVariants> {\n icon?: React.ReactNode;\n label: string;\n value: number | string;\n className?: string;\n /** Disable motion animations */\n disableAnimation?: boolean;\n}\n\nfunction StatBadge({\n icon,\n label,\n value,\n variant,\n size,\n className,\n disableAnimation = false,\n}: StatBadgeProps) {\n const resolvedVariant = variant ?? \"default\";\n const resolvedSize = size ?? \"default\";\n\n const sizeStyles: Record<\"sm\" | \"default\" | \"lg\", {\n padding: string;\n gap: number;\n valueSize: number;\n labelSize: number;\n }> = {\n sm: {\n padding: \"6px 8px\",\n gap: 3,\n valueSize: 13,\n labelSize: 9,\n },\n default: {\n padding: \"8px 10px\",\n gap: 4,\n valueSize: 15,\n labelSize: 10,\n },\n lg: {\n padding: \"10px 14px\",\n gap: 5,\n valueSize: 18,\n labelSize: 11,\n },\n };\n\n const styles = sizeStyles[resolvedSize];\n\n // Get variant colors using CSS variables\n const variantColors: Record<string, { color: string; bgColor: string }> = {\n default: {\n color: \"var(--uilint-text-secondary)\",\n bgColor: \"var(--uilint-surface-elevated)\",\n },\n error: {\n color: \"var(--uilint-error)\",\n bgColor: \"var(--uilint-error-bg)\",\n },\n warning: {\n color: \"var(--uilint-warning)\",\n bgColor: \"var(--uilint-warning-bg)\",\n },\n success: {\n color: \"var(--uilint-success)\",\n bgColor: \"var(--uilint-success-bg)\",\n },\n info: {\n color: \"var(--uilint-info)\",\n bgColor: \"var(--uilint-info-bg)\",\n },\n outline: {\n color: \"var(--uilint-text-secondary)\",\n bgColor: \"transparent\",\n },\n };\n\n const colors = variantColors[resolvedVariant];\n\n const content = (\n <>\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: styles.gap,\n marginBottom: 2,\n }}\n >\n {icon && (\n <span style={{ color: colors.color, display: \"flex\" }}>{icon}</span>\n )}\n <span\n style={{\n fontSize: styles.valueSize,\n fontWeight: 700,\n color: colors.color,\n }}\n >\n {value}\n </span>\n </div>\n <div\n style={{\n fontSize: styles.labelSize,\n color: \"var(--uilint-text-muted)\",\n fontWeight: 500,\n }}\n >\n {label}\n </div>\n </>\n );\n\n const containerStyle: React.CSSProperties = {\n padding: styles.padding,\n borderRadius: \"var(--uilint-badge-radius, 8px)\",\n background: colors.bgColor,\n textAlign: \"center\",\n };\n\n if (disableAnimation) {\n return (\n <div className={className} style={containerStyle}>\n {content}\n </div>\n );\n }\n\n return (\n <motion.div\n className={className}\n style={containerStyle}\n variants={badgeMotionVariants}\n initial=\"initial\"\n animate=\"animate\"\n exit=\"exit\"\n transition={{\n duration: 0.15,\n ease: crispEase,\n }}\n >\n {content}\n </motion.div>\n );\n}\n\n/**\n * CategoryBadge - Small uppercase badge for categories\n *\n * Inspired by CommandPalette's category badge pattern\n *\n * @example\n * ```tsx\n * <CategoryBadge>accessibility</CategoryBadge>\n * <CategoryBadge isSelected>performance</CategoryBadge>\n * ```\n */\nexport interface CategoryBadgeProps {\n children: React.ReactNode;\n isSelected?: boolean;\n className?: string;\n /** Disable motion animations */\n disableAnimation?: boolean;\n}\n\nfunction CategoryBadge({\n children,\n isSelected = false,\n className,\n disableAnimation = false,\n}: CategoryBadgeProps) {\n const badgeStyle: React.CSSProperties = {\n fontSize: 9,\n fontWeight: 600,\n textTransform: \"uppercase\",\n letterSpacing: \"0.03em\",\n background: isSelected\n ? \"var(--uilint-info-bg)\"\n : \"var(--uilint-surface-elevated)\",\n color: isSelected\n ? \"var(--uilint-info)\"\n : \"var(--uilint-text-muted)\",\n padding: \"3px 8px\",\n borderRadius: \"var(--uilint-badge-radius, 6px)\",\n transition: \"all 0.1s ease\",\n };\n\n if (disableAnimation) {\n return (\n <span className={className} style={badgeStyle}>\n {children}\n </span>\n );\n }\n\n return (\n <motion.span\n className={className}\n style={badgeStyle}\n variants={badgeMotionVariants}\n initial=\"initial\"\n animate=\"animate\"\n exit=\"exit\"\n transition={{\n duration: 0.1,\n ease: crispEase,\n }}\n >\n {children}\n </motion.span>\n );\n}\n\n/**\n * CountBadge - Numeric count badge with automatic variant selection\n *\n * @example\n * ```tsx\n * <CountBadge count={0} /> // success variant\n * <CountBadge count={5} /> // warning variant\n * <CountBadge count={10} isError /> // error variant\n * ```\n */\nexport interface CountBadgeProps {\n count: number;\n /** Force error variant regardless of count */\n isError?: boolean;\n /** Use success variant when count is 0 (default: true) */\n zeroIsSuccess?: boolean;\n size?: \"sm\" | \"default\" | \"lg\";\n className?: string;\n /** Disable motion animations */\n disableAnimation?: boolean;\n}\n\nfunction CountBadge({\n count,\n isError = false,\n zeroIsSuccess = true,\n size = \"default\",\n className,\n disableAnimation = false,\n}: CountBadgeProps) {\n let variant: \"success\" | \"warning\" | \"error\" = \"warning\";\n\n if (isError) {\n variant = \"error\";\n } else if (count === 0 && zeroIsSuccess) {\n variant = \"success\";\n }\n\n return (\n <Badge\n variant={variant}\n size={size}\n className={cn(\"font-mono tabular-nums\", className)}\n disableAnimation={disableAnimation}\n >\n {count}\n </Badge>\n );\n}\n\nexport { Badge, StatBadge, CategoryBadge, CountBadge, badgeVariants };\n","// packages/react/compose-refs/src/compose-refs.tsx\nimport * as React from \"react\";\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\nfunction composeRefs(...refs) {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\nfunction useComposedRefs(...refs) {\n return React.useCallback(composeRefs(...refs), refs);\n}\nexport {\n composeRefs,\n useComposedRefs\n};\n//# sourceMappingURL=index.mjs.map\n","// src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\nvar REACT_LAZY_TYPE = Symbol.for(\"react.lazy\");\nvar use = React[\" use \".trim().toString()];\nfunction isPromiseLike(value) {\n return typeof value === \"object\" && value !== null && \"then\" in value;\n}\nfunction isLazyComponent(element) {\n return element != null && typeof element === \"object\" && \"$$typeof\" in element && element.$$typeof === REACT_LAZY_TYPE && \"_payload\" in element && isPromiseLike(element._payload);\n}\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlotClone(ownerName) {\n const SlotClone = React.forwardRef((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\nvar SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n };\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n","/**\n * Button - shadcn-style button component with motion animations\n *\n * Features:\n * - Multiple variants (default, destructive, outline, secondary, ghost, glass)\n * - Size options (sm, default, lg, icon)\n * - Motion animations for hover and tap interactions\n * - Composition via asChild prop using Radix Slot\n * - CSS variable-based theming\n */\nimport * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { motion } from \"motion/react\";\nimport { cn } from \"../../lib/utils\";\n\nconst buttonVariants = cva(\n // Base styles\n [\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap\",\n \"text-sm font-medium\",\n \"transition-colors duration-150\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n \"[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n ],\n {\n variants: {\n variant: {\n default: [\n \"bg-[var(--uilint-button-default-bg)]\",\n \"text-[var(--uilint-button-default-text)]\",\n \"shadow-[var(--uilint-button-shadow)]\",\n \"hover:shadow-[var(--uilint-button-shadow-hover)]\",\n \"focus-visible:ring-[var(--uilint-button-default-bg)]\",\n ],\n destructive: [\n \"bg-[var(--uilint-button-destructive-bg)]\",\n \"text-[var(--uilint-button-destructive-text)]\",\n \"shadow-[var(--uilint-button-shadow)]\",\n \"hover:shadow-[var(--uilint-button-shadow-hover)]\",\n \"hover:bg-[var(--uilint-button-destructive-bg)]/90\",\n \"focus-visible:ring-[var(--uilint-button-destructive-bg)]\",\n ],\n outline: [\n \"bg-[var(--uilint-button-outline-bg)]\",\n \"text-[var(--uilint-button-outline-text)]\",\n \"border border-current/20\",\n \"hover:bg-[var(--uilint-button-outline-text)]/10\",\n \"focus-visible:ring-[var(--uilint-button-outline-text)]\",\n ],\n secondary: [\n \"bg-[var(--uilint-button-secondary-bg)]\",\n \"text-[var(--uilint-button-secondary-text)]\",\n \"shadow-[var(--uilint-button-shadow)]\",\n \"hover:shadow-[var(--uilint-button-shadow-hover)]\",\n \"hover:bg-[var(--uilint-button-secondary-bg)]/80\",\n \"focus-visible:ring-[var(--uilint-button-secondary-bg)]\",\n ],\n ghost: [\n \"bg-[var(--uilint-button-ghost-bg)]\",\n \"text-[var(--uilint-button-ghost-text)]\",\n \"hover:bg-[var(--uilint-button-ghost-text)]/10\",\n \"focus-visible:ring-[var(--uilint-button-ghost-text)]\",\n ],\n glass: [\n \"bg-[var(--uilint-button-glass-bg)]\",\n \"text-[var(--uilint-button-glass-text)]\",\n \"backdrop-blur-md\",\n \"border border-white/20\",\n \"shadow-[var(--uilint-button-shadow)]\",\n \"hover:shadow-[var(--uilint-button-shadow-hover)]\",\n \"hover:bg-white/30\",\n \"focus-visible:ring-white/50\",\n ],\n },\n size: {\n default: \"h-10 px-4 py-2 rounded-[var(--uilint-button-radius)]\",\n sm: \"h-8 px-3 text-xs rounded-[var(--uilint-button-radius)]\",\n lg: \"h-12 px-8 text-base rounded-[var(--uilint-button-radius)]\",\n icon: \"h-10 w-10 rounded-[var(--uilint-button-radius)]\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\n// Motion animation variants\nconst motionVariants = {\n initial: { scale: 1 },\n hover: { scale: 1.02 },\n tap: { scale: 0.98 },\n};\n\n// Crisp easing curve matching the design system\nconst crispEase = [0.32, 0.72, 0, 1] as const;\n\nconst motionTransition = {\n duration: 0.15,\n ease: crispEase,\n} as const;\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n /** Merge props onto child element instead of rendering a button */\n asChild?: boolean;\n}\n\n/**\n * Button component with motion animations and variant support.\n *\n * @example\n * ```tsx\n * // Default button\n * <Button>Click me</Button>\n *\n * // Destructive variant\n * <Button variant=\"destructive\">Delete</Button>\n *\n * // Glass variant with icon size\n * <Button variant=\"glass\" size=\"icon\">\n * <SearchIcon />\n * </Button>\n *\n * // As a link using asChild\n * <Button asChild>\n * <a href=\"/dashboard\">Dashboard</a>\n * </Button>\n * ```\n */\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const classes = cn(buttonVariants({ variant, size, className }));\n\n // When asChild is true, use Slot to merge props onto child\n if (asChild) {\n return <Slot ref={ref} className={classes} {...props} />;\n }\n\n return (\n <motion.button\n ref={ref}\n className={classes}\n variants={motionVariants}\n initial=\"initial\"\n whileHover={props.disabled ? undefined : \"hover\"}\n whileTap={props.disabled ? undefined : \"tap\"}\n transition={motionTransition}\n disabled={props.disabled}\n type={props.type}\n onClick={props.onClick}\n aria-label={props[\"aria-label\"]}\n aria-disabled={props[\"aria-disabled\"]}\n title={props.title}\n name={props.name}\n value={props.value}\n form={props.form}\n tabIndex={props.tabIndex}\n style={props.style as React.CSSProperties}\n >\n {props.children}\n </motion.button>\n );\n }\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n","/**\n * IconButton - Reusable icon button component with motion animations\n *\n * Follows shadcn conventions with CVA variant handling.\n * Supports default, ghost, and glass variants with hover/tap animations.\n */\nimport * as React from \"react\";\nimport { motion, type HTMLMotionProps } from \"motion/react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../../lib/utils\";\n\n/**\n * Icon button variants using CVA\n *\n * Uses CSS variables from the design system:\n * - Sizing: --uilint-icon-button-size, --uilint-icon-button-size-sm, --uilint-icon-button-size-lg\n * - Radius: --uilint-icon-button-radius\n * - Colors: --uilint-hover, --uilint-active, --uilint-text-muted, --uilint-text-secondary\n * - Glass: --uilint-glass, --uilint-glass-border\n */\nconst iconButtonVariants = cva(\n // Base styles\n [\n \"inline-flex items-center justify-center\",\n \"border-none outline-none\",\n \"cursor-pointer\",\n \"transition-colors\",\n \"disabled:pointer-events-none disabled:opacity-40\",\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0\",\n ],\n {\n variants: {\n variant: {\n default: [\n \"bg-[var(--uilint-hover)]\",\n \"text-[var(--uilint-text-secondary)]\",\n \"hover:bg-[var(--uilint-active)]\",\n \"hover:text-[var(--uilint-text-primary)]\",\n ],\n ghost: [\n \"bg-transparent\",\n \"text-[var(--uilint-text-muted)]\",\n \"hover:bg-[var(--uilint-hover)]\",\n \"hover:text-[var(--uilint-text-secondary)]\",\n ],\n glass: [\n \"bg-[var(--uilint-glass)]\",\n \"text-[var(--uilint-text-secondary)]\",\n \"border border-[var(--uilint-glass-border)]\",\n \"backdrop-blur-md\",\n \"hover:bg-[var(--uilint-glass-medium)]\",\n \"hover:text-[var(--uilint-text-primary)]\",\n ],\n },\n size: {\n sm: [\n \"w-[var(--uilint-icon-button-size-sm)]\",\n \"h-[var(--uilint-icon-button-size-sm)]\",\n \"rounded-[calc(var(--uilint-icon-button-radius)-2px)]\",\n \"[&_svg]:w-4 [&_svg]:h-4\",\n ],\n default: [\n \"w-[var(--uilint-icon-button-size)]\",\n \"h-[var(--uilint-icon-button-size)]\",\n \"rounded-[var(--uilint-icon-button-radius)]\",\n \"[&_svg]:w-[18px] [&_svg]:h-[18px]\",\n ],\n lg: [\n \"w-[var(--uilint-icon-button-size-lg)]\",\n \"h-[var(--uilint-icon-button-size-lg)]\",\n \"rounded-[calc(var(--uilint-icon-button-radius)+2px)]\",\n \"[&_svg]:w-5 [&_svg]:h-5\",\n ],\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\n/**\n * Motion variants for hover and tap animations\n */\nconst motionVariants = {\n initial: {\n scale: 1,\n boxShadow: \"0 0 0 0 rgba(0, 0, 0, 0)\",\n },\n hover: {\n scale: 1.05,\n boxShadow: \"0 2px 8px rgba(0, 0, 0, 0.08)\",\n transition: {\n type: \"tween\" as const,\n duration: 0.15,\n ease: [0.25, 0.1, 0.25, 1] as const,\n },\n },\n tap: {\n scale: 0.95,\n transition: {\n type: \"tween\" as const,\n duration: 0.1,\n ease: [0.25, 0.1, 0.25, 1] as const,\n },\n },\n};\n\n/**\n * Glass variant has a subtle glow effect on hover\n */\nconst glassMotionVariants = {\n initial: {\n scale: 1,\n boxShadow: \"0 0 0 0 rgba(255, 255, 255, 0)\",\n },\n hover: {\n scale: 1.05,\n boxShadow: \"0 4px 16px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.1)\",\n transition: {\n type: \"tween\" as const,\n duration: 0.15,\n ease: [0.25, 0.1, 0.25, 1] as const,\n },\n },\n tap: {\n scale: 0.95,\n transition: {\n type: \"tween\" as const,\n duration: 0.1,\n ease: [0.25, 0.1, 0.25, 1] as const,\n },\n },\n};\n\nexport interface IconButtonProps\n extends Omit<HTMLMotionProps<\"button\">, \"ref\">,\n VariantProps<typeof iconButtonVariants> {\n /** Render as child component (for composition) */\n asChild?: boolean;\n /** Disable motion animations */\n disableMotion?: boolean;\n}\n\n/**\n * IconButton component with motion animations\n *\n * @example\n * ```tsx\n * // Default variant\n * <IconButton onClick={handleClick}>\n * <SearchIcon />\n * </IconButton>\n *\n * // Ghost variant\n * <IconButton variant=\"ghost\" onClick={handleClick}>\n * <CloseIcon />\n * </IconButton>\n *\n * // Glass variant with small size\n * <IconButton variant=\"glass\" size=\"sm\" onClick={handleClick}>\n * <SettingsIcon />\n * </IconButton>\n * ```\n */\nconst IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(\n (\n {\n className,\n variant,\n size,\n asChild = false,\n disableMotion = false,\n disabled,\n ...props\n },\n ref\n ) => {\n const classes = cn(iconButtonVariants({ variant, size, className }));\n\n // Use Slot for composition if asChild is true\n if (asChild) {\n return (\n <Slot\n ref={ref as React.Ref<HTMLElement>}\n className={classes}\n {...(props as React.HTMLAttributes<HTMLElement>)}\n />\n );\n }\n\n // If motion is disabled, render a regular button\n if (disableMotion || disabled) {\n return (\n <button\n ref={ref}\n className={classes}\n disabled={disabled}\n {...(props as React.ButtonHTMLAttributes<HTMLButtonElement>)}\n />\n );\n }\n\n // Select motion variants based on button variant\n const selectedMotionVariants =\n variant === \"glass\" ? glassMotionVariants : motionVariants;\n\n return (\n <motion.button\n ref={ref}\n className={classes}\n disabled={disabled}\n variants={selectedMotionVariants}\n initial=\"initial\"\n whileHover=\"hover\"\n whileTap=\"tap\"\n {...props}\n />\n );\n }\n);\n\nIconButton.displayName = \"IconButton\";\n\nexport { IconButton, iconButtonVariants };\n","/**\n * Input - shadcn-style input component with motion animations\n *\n * Features:\n * - CVA-based variant system (default, glass, error)\n * - Size variants (sm, default, lg)\n * - Focus ring animation using motion/react\n * - Icon slot support (left icon)\n * - Uses uilint design system CSS variables\n */\nimport * as React from \"react\";\nimport { motion, AnimatePresence } from \"motion/react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\nconst inputVariants = cva(\n // Base styles using CSS variables\n [\n \"flex w-full transition-colors\",\n \"file:border-0 file:bg-transparent file:text-sm file:font-medium\",\n \"disabled:cursor-not-allowed disabled:opacity-50\",\n \"placeholder:text-[var(--uilint-input-placeholder)]\",\n \"outline-none\",\n ],\n {\n variants: {\n variant: {\n default: [\n \"bg-[var(--uilint-input-bg)]\",\n \"border border-[var(--uilint-input-border)]\",\n \"text-[var(--uilint-text-primary)]\",\n \"focus:border-[var(--uilint-input-border-focus)]\",\n ],\n glass: [\n \"bg-[var(--uilint-glass-medium)]\",\n \"backdrop-blur-[var(--uilint-glass-blur-medium)]\",\n \"border border-[var(--uilint-glass-border)]\",\n \"text-[var(--uilint-text-primary)]\",\n \"focus:border-[var(--uilint-input-border-focus)]\",\n ],\n error: [\n \"bg-[var(--uilint-input-bg)]\",\n \"border border-[var(--uilint-error)]\",\n \"text-[var(--uilint-text-primary)]\",\n \"focus:border-[var(--uilint-error)]\",\n ],\n },\n size: {\n sm: \"h-8 px-2.5 text-xs rounded-[calc(var(--uilint-input-radius)-2px)]\",\n default: \"h-10 px-3 text-sm rounded-[var(--uilint-input-radius)]\",\n lg: \"h-12 px-4 text-base rounded-[calc(var(--uilint-input-radius)+2px)]\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\nexport interface InputProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\">,\n VariantProps<typeof inputVariants> {\n /**\n * Icon element to display on the left side of the input\n */\n icon?: React.ReactNode;\n /**\n * Container className for the wrapper div (when icon is present)\n */\n containerClassName?: string;\n}\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n (\n {\n className,\n containerClassName,\n variant,\n size,\n type = \"text\",\n icon,\n onFocus,\n onBlur,\n ...props\n },\n ref\n ) => {\n const [isFocused, setIsFocused] = React.useState(false);\n\n const handleFocus = React.useCallback(\n (e: React.FocusEvent<HTMLInputElement>) => {\n setIsFocused(true);\n onFocus?.(e);\n },\n [onFocus]\n );\n\n const handleBlur = React.useCallback(\n (e: React.FocusEvent<HTMLInputElement>) => {\n setIsFocused(false);\n onBlur?.(e);\n },\n [onBlur]\n );\n\n // Get ring color based on variant\n const ringColor =\n variant === \"error\"\n ? \"var(--uilint-error)\"\n : \"var(--uilint-input-ring)\";\n\n // Base input element\n const inputElement = (\n <input\n type={type}\n className={cn(\n inputVariants({ variant, size }),\n icon && \"pl-9\",\n className\n )}\n ref={ref}\n onFocus={handleFocus}\n onBlur={handleBlur}\n {...props}\n />\n );\n\n // If no icon, render simple wrapper with focus ring animation\n if (!icon) {\n return (\n <div className={cn(\"relative\", containerClassName)}>\n {inputElement}\n <AnimatePresence>\n {isFocused && (\n <motion.div\n initial={{ opacity: 0, scale: 0.98 }}\n animate={{ opacity: 1, scale: 1 }}\n exit={{ opacity: 0, scale: 0.98 }}\n transition={{ duration: 0.15, ease: \"easeOut\" }}\n className=\"pointer-events-none absolute inset-0 rounded-[var(--uilint-input-radius)]\"\n style={{\n boxShadow: `0 0 0 3px ${ringColor}`,\n }}\n />\n )}\n </AnimatePresence>\n </div>\n );\n }\n\n // With icon, wrap in container\n return (\n <div className={cn(\"relative\", containerClassName)}>\n {/* Icon container */}\n <motion.div\n animate={{\n color: isFocused\n ? \"var(--uilint-accent)\"\n : \"var(--uilint-text-muted)\",\n }}\n transition={{ duration: 0.15 }}\n className={cn(\n \"pointer-events-none absolute left-3 flex items-center justify-center\",\n size === \"sm\" && \"top-2\",\n size === \"default\" && \"top-2.5\",\n size === \"lg\" && \"top-3\"\n )}\n >\n {icon}\n </motion.div>\n\n {inputElement}\n\n {/* Animated focus ring */}\n <AnimatePresence>\n {isFocused && (\n <motion.div\n initial={{ opacity: 0, scale: 0.98 }}\n animate={{ opacity: 1, scale: 1 }}\n exit={{ opacity: 0, scale: 0.98 }}\n transition={{ duration: 0.15, ease: \"easeOut\" }}\n className={cn(\n \"pointer-events-none absolute inset-0\",\n size === \"sm\" && \"rounded-[calc(var(--uilint-input-radius)-2px)]\",\n size === \"default\" && \"rounded-[var(--uilint-input-radius)]\",\n size === \"lg\" && \"rounded-[calc(var(--uilint-input-radius)+2px)]\"\n )}\n style={{\n boxShadow: `0 0 0 3px ${ringColor}`,\n }}\n />\n )}\n </AnimatePresence>\n </div>\n );\n }\n);\n\nInput.displayName = \"Input\";\n\nexport { Input, inputVariants };\n","/**\n * Card Component System\n *\n * A composable card component following shadcn conventions.\n * Supports multiple variants: default, elevated, and glass (glassmorphism).\n * Includes motion animations for interactive states.\n */\nimport * as React from \"react\";\nimport { motion, type HTMLMotionProps } from \"motion/react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../../lib/utils\";\n\n/* -----------------------------------------------------------------------------\n * Card Variants (CVA)\n * -------------------------------------------------------------------------- */\n\nconst cardVariants = cva(\n // Base styles using CSS variables\n [\n \"relative\",\n \"flex\",\n \"flex-col\",\n \"overflow-hidden\",\n \"transition-all\",\n ].join(\" \"),\n {\n variants: {\n variant: {\n default: [\n // Default card styling\n \"[background:var(--uilint-card-bg)]\",\n \"[border:1px_solid_var(--uilint-card-border)]\",\n \"[border-radius:var(--uilint-card-radius)]\",\n \"[box-shadow:var(--uilint-card-shadow)]\",\n ].join(\" \"),\n elevated: [\n // Elevated card with stronger shadow\n \"[background:var(--uilint-card-elevated-bg)]\",\n \"[border:1px_solid_var(--uilint-card-border)]\",\n \"[border-radius:var(--uilint-card-radius)]\",\n \"[box-shadow:var(--uilint-card-elevated-shadow)]\",\n ].join(\" \"),\n glass: [\n // Glassmorphism effect\n \"[background:var(--uilint-card-glass-bg)]\",\n \"[border:1px_solid_var(--uilint-card-glass-border)]\",\n \"[border-radius:var(--uilint-card-radius)]\",\n \"[backdrop-filter:blur(var(--uilint-glass-blur-medium))]\",\n \"[box-shadow:var(--uilint-card-shadow)]\",\n // Subtle top highlight for glass effect\n \"before:absolute\",\n \"before:inset-x-0\",\n \"before:top-0\",\n \"before:h-px\",\n \"before:[background:var(--uilint-glass-highlight)]\",\n ].join(\" \"),\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n);\n\n/* -----------------------------------------------------------------------------\n * Motion Animation Variants\n * -------------------------------------------------------------------------- */\n\nconst fadeInVariants = {\n initial: { opacity: 0, y: 4 },\n animate: { opacity: 1, y: 0 },\n exit: { opacity: 0, y: 4 },\n};\n\nconst hoverLiftVariants = {\n rest: {\n y: 0,\n boxShadow: \"var(--uilint-card-shadow)\",\n },\n hover: {\n y: -2,\n boxShadow: \"var(--uilint-card-shadow-hover)\",\n },\n};\n\nconst transitionConfig = {\n duration: 0.15,\n ease: [0.32, 0.72, 0, 1] as const, // Crisp easing\n};\n\n/* -----------------------------------------------------------------------------\n * Card Types\n * -------------------------------------------------------------------------- */\n\nexport interface CardProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof cardVariants> {\n /** Enable interactive hover effects (lift animation) */\n interactive?: boolean;\n /** Enable motion animations */\n animated?: boolean;\n /** Render as a different element using motion component */\n asChild?: boolean;\n}\n\n/* -----------------------------------------------------------------------------\n * Card Component\n * -------------------------------------------------------------------------- */\n\nconst Card = React.forwardRef<HTMLDivElement, CardProps>(\n (\n {\n className,\n variant,\n interactive = false,\n animated = false,\n children,\n ...props\n },\n ref\n ) => {\n // Use motion div for interactive or animated cards\n if (interactive || animated) {\n return (\n <motion.div\n ref={ref}\n className={cn(\n cardVariants({ variant }),\n interactive && \"cursor-pointer\",\n className\n )}\n variants={interactive ? hoverLiftVariants : undefined}\n initial={animated ? fadeInVariants.initial : \"rest\"}\n animate={animated ? fadeInVariants.animate : \"rest\"}\n exit={animated ? fadeInVariants.exit : undefined}\n whileHover={interactive ? \"hover\" : undefined}\n transition={transitionConfig}\n {...(props as HTMLMotionProps<\"div\">)}\n >\n {children}\n </motion.div>\n );\n }\n\n // Static card without motion\n return (\n <div\n ref={ref}\n className={cn(cardVariants({ variant }), className)}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\nCard.displayName = \"Card\";\n\n/* -----------------------------------------------------------------------------\n * CardHeader Component\n * -------------------------------------------------------------------------- */\n\nexport type CardHeaderProps = React.HTMLAttributes<HTMLDivElement>;\n\nconst CardHeader = React.forwardRef<HTMLDivElement, CardHeaderProps>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex flex-col gap-1.5 p-4\", className)}\n {...props}\n />\n )\n);\nCardHeader.displayName = \"CardHeader\";\n\n/* -----------------------------------------------------------------------------\n * CardTitle Component\n * -------------------------------------------------------------------------- */\n\nexport type CardTitleProps = React.HTMLAttributes<HTMLHeadingElement>;\n\nconst CardTitle = React.forwardRef<HTMLHeadingElement, CardTitleProps>(\n ({ className, ...props }, ref) => (\n <h3\n ref={ref}\n className={cn(\n \"text-base font-semibold leading-tight tracking-tight\",\n \"[color:var(--uilint-text-primary)]\",\n className\n )}\n {...props}\n />\n )\n);\nCardTitle.displayName = \"CardTitle\";\n\n/* -----------------------------------------------------------------------------\n * CardDescription Component\n * -------------------------------------------------------------------------- */\n\nexport type CardDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst CardDescription = React.forwardRef<\n HTMLParagraphElement,\n CardDescriptionProps\n>(({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={cn(\n \"text-sm leading-relaxed\",\n \"[color:var(--uilint-text-secondary)]\",\n className\n )}\n {...props}\n />\n));\nCardDescription.displayName = \"CardDescription\";\n\n/* -----------------------------------------------------------------------------\n * CardContent Component\n * -------------------------------------------------------------------------- */\n\nexport type CardContentProps = React.HTMLAttributes<HTMLDivElement>;\n\nconst CardContent = React.forwardRef<HTMLDivElement, CardContentProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"p-4 pt-0\", className)} {...props} />\n )\n);\nCardContent.displayName = \"CardContent\";\n\n/* -----------------------------------------------------------------------------\n * CardFooter Component\n * -------------------------------------------------------------------------- */\n\nexport type CardFooterProps = React.HTMLAttributes<HTMLDivElement>;\n\nconst CardFooter = React.forwardRef<HTMLDivElement, CardFooterProps>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n \"flex items-center gap-2 p-4 pt-0\",\n \"[border-top:1px_solid_var(--uilint-card-border)]\",\n \"mt-auto\",\n className\n )}\n {...props}\n />\n )\n);\nCardFooter.displayName = \"CardFooter\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Card,\n CardHeader,\n CardTitle,\n CardDescription,\n CardContent,\n CardFooter,\n cardVariants,\n};\n","/**\n * GlassPanel - Glassmorphism container component\n *\n * A shadcn-style component for glass morphism UI panels.\n * Used as the base container for CommandPalette, modals, etc.\n *\n * Features:\n * - CSS variable theming (--uilint-glass-*)\n * - Blur intensity variants (light, medium, heavy)\n * - Shadow variants (none, sm, md, lg)\n * - Optional border styling\n * - Scale + fade entrance/exit animations via motion/react\n * - Fully typed with HTMLDivElement attribute support\n */\nimport * as React from \"react\";\nimport { motion, AnimatePresence, type HTMLMotionProps } from \"motion/react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\n/**\n * GlassPanel variants using CVA for consistent styling\n */\nconst glassPanelVariants = cva(\n // Base styles\n [\n \"relative\",\n \"overflow-hidden\",\n \"rounded-[var(--uilint-radius,12px)]\",\n ].join(\" \"),\n {\n variants: {\n blur: {\n light: \"\",\n medium: \"\",\n heavy: \"\",\n },\n shadow: {\n none: \"\",\n sm: \"\",\n md: \"\",\n lg: \"\",\n },\n bordered: {\n true: \"\",\n false: \"\",\n },\n },\n defaultVariants: {\n blur: \"medium\",\n shadow: \"md\",\n bordered: true,\n },\n }\n);\n\n/**\n * Motion variants for entrance/exit animations\n */\nconst glassPanelMotionVariants = {\n hidden: {\n opacity: 0,\n scale: 0.96,\n y: -10,\n },\n visible: {\n opacity: 1,\n scale: 1,\n y: 0,\n },\n exit: {\n opacity: 0,\n scale: 0.98,\n y: -5,\n },\n} as const;\n\n/**\n * Default transition settings for smooth animations\n */\nconst defaultTransition = {\n duration: 0.2,\n ease: [0.25, 0.1, 0.25, 1], // cubic-bezier for smooth deceleration\n} as const;\n\nexport interface GlassPanelProps\n extends Omit<HTMLMotionProps<\"div\">, \"children\">,\n VariantProps<typeof glassPanelVariants> {\n /** Content to render inside the panel */\n children: React.ReactNode;\n /** Whether to animate the component on mount/unmount */\n animate?: boolean;\n /** Custom animation transition settings */\n transition?: typeof defaultTransition;\n /** Whether to show the panel (controls AnimatePresence) */\n show?: boolean;\n /** Use AnimatePresence for exit animations (requires show prop) */\n usePresence?: boolean;\n}\n\n/**\n * Build inline styles for glass effect using CSS variables\n * This ensures proper backdrop-filter support and CSS variable fallbacks\n */\nfunction getGlassStyles(\n blur: \"light\" | \"medium\" | \"heavy\" | null | undefined,\n shadow: \"none\" | \"sm\" | \"md\" | \"lg\" | null | undefined,\n bordered: boolean | null | undefined,\n customStyle?: React.CSSProperties\n): React.CSSProperties {\n // Blur values mapping to CSS variables with fallbacks - increased for more frosted effect\n const blurValues = {\n light: \"var(--uilint-glass-blur-light, 12px)\",\n medium: \"var(--uilint-glass-blur-medium, 24px)\",\n heavy: \"var(--uilint-glass-blur-heavy, 40px)\",\n };\n\n // Background values - more transparent for cleaner look\n const backgroundValues = {\n light: \"var(--uilint-glass-light, rgba(255, 255, 255, 0.4))\",\n medium: \"var(--uilint-glass-medium, rgba(255, 255, 255, 0.55))\",\n heavy: \"var(--uilint-glass-heavy, rgba(255, 255, 255, 0.7))\",\n };\n\n // Shadow values - softer, more diffused shadows\n const shadowValues = {\n none: \"none\",\n sm: \"var(--uilint-card-shadow, 0 2px 8px rgba(0, 0, 0, 0.03))\",\n md: \"var(--uilint-shadow, 0 8px 32px rgba(0, 0, 0, 0.06))\",\n lg: \"var(--uilint-shadow-lg, 0 16px 48px rgba(0, 0, 0, 0.08))\",\n };\n\n const blurKey = blur ?? \"medium\";\n const shadowKey = shadow ?? \"md\";\n const blurValue = blurValues[blurKey];\n const shadowValue = shadowValues[shadowKey];\n const backgroundValue = backgroundValues[blurKey];\n\n // Build box-shadow - more subtle inset highlights\n const boxShadowParts: string[] = [];\n\n // Subtle inset highlight for glass effect (top edge shine)\n boxShadowParts.push(\"inset 0 1px 0 0 var(--uilint-glass-highlight, rgba(255, 255, 255, 0.25))\");\n\n // Add external shadow\n if (shadowValue !== \"none\") {\n boxShadowParts.push(shadowValue);\n }\n\n return {\n background: backgroundValue,\n backdropFilter: `blur(${blurValue}) saturate(150%)`,\n WebkitBackdropFilter: `blur(${blurValue}) saturate(150%)`,\n boxShadow: boxShadowParts.join(\", \"),\n border: bordered !== false\n ? \"1px solid var(--uilint-glass-border, rgba(255, 255, 255, 0.15))\"\n : \"none\",\n ...customStyle,\n };\n}\n\n/**\n * GlassPanel component - Renders a glassmorphism container\n *\n * @example\n * ```tsx\n * // Basic usage\n * <GlassPanel>\n * <p>Content goes here</p>\n * </GlassPanel>\n *\n * // With blur intensity variants\n * <GlassPanel blur=\"light\">Light blur</GlassPanel>\n * <GlassPanel blur=\"medium\">Medium blur</GlassPanel>\n * <GlassPanel blur=\"heavy\">Heavy blur</GlassPanel>\n *\n * // With shadow variants\n * <GlassPanel shadow=\"none\">No shadow</GlassPanel>\n * <GlassPanel shadow=\"sm\">Small shadow</GlassPanel>\n * <GlassPanel shadow=\"lg\">Large shadow</GlassPanel>\n *\n * // Without border\n * <GlassPanel bordered={false}>Borderless panel</GlassPanel>\n *\n * // With entrance/exit animations using AnimatePresence\n * <GlassPanel show={isVisible} usePresence>\n * <p>Animated content</p>\n * </GlassPanel>\n *\n * // Without animation\n * <GlassPanel animate={false}>\n * <p>Static content</p>\n * </GlassPanel>\n *\n * // CommandPalette-style usage\n * <GlassPanel\n * blur=\"heavy\"\n * shadow=\"lg\"\n * className=\"w-full max-w-[580px]\"\n * >\n * <SearchInput />\n * <ResultsList />\n * </GlassPanel>\n * ```\n */\nconst GlassPanel = React.forwardRef<HTMLDivElement, GlassPanelProps>(\n (\n {\n className,\n blur,\n shadow,\n bordered,\n children,\n animate = true,\n transition = defaultTransition,\n show = true,\n usePresence = false,\n style,\n ...props\n },\n ref\n ) => {\n const glassStyles = getGlassStyles(blur, shadow, bordered, style as React.CSSProperties | undefined);\n const variantClasses = glassPanelVariants({ blur, shadow, bordered });\n\n // Render with AnimatePresence for controlled show/hide with exit animations\n if (usePresence) {\n return (\n <AnimatePresence>\n {show && (\n <motion.div\n ref={ref}\n className={cn(variantClasses, className)}\n style={glassStyles}\n initial=\"hidden\"\n animate=\"visible\"\n exit=\"exit\"\n variants={glassPanelMotionVariants}\n transition={transition}\n {...props}\n >\n {children}\n </motion.div>\n )}\n </AnimatePresence>\n );\n }\n\n // Render with entrance animation only\n if (animate) {\n return (\n <motion.div\n ref={ref}\n className={cn(variantClasses, className)}\n style={glassStyles}\n initial=\"hidden\"\n animate=\"visible\"\n variants={glassPanelMotionVariants}\n transition={transition}\n {...props}\n >\n {children}\n </motion.div>\n );\n }\n\n // Render without animation\n return (\n <motion.div\n ref={ref}\n className={cn(variantClasses, className)}\n style={glassStyles}\n {...props}\n >\n {children}\n </motion.div>\n );\n }\n);\n\nGlassPanel.displayName = \"GlassPanel\";\n\nexport {\n GlassPanel,\n glassPanelVariants,\n glassPanelMotionVariants,\n defaultTransition as glassPanelTransition,\n getGlassStyles,\n};\n","/* eslint-disable uilint/consistent-dark-mode */\n/**\n * Popover - Floating overlay anchored to a trigger element\n *\n * Features:\n * - Glassmorphic styling matching the design system\n * - Smooth motion animations\n * - Click outside to close\n * - Escape key to close\n * - Auto-positioning to stay within viewport\n */\nimport React, { useRef, useState, useEffect, useCallback } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { motion, AnimatePresence } from \"motion/react\";\nimport { cn } from \"../../lib/utils\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface PopoverProps {\n /** Whether the popover is open */\n open: boolean;\n /** Called when the popover should close */\n onClose: () => void;\n /** The trigger element that anchors the popover */\n trigger: React.ReactNode;\n /** The content to show in the popover */\n children: React.ReactNode;\n /** Preferred placement relative to trigger */\n placement?: \"top\" | \"bottom\" | \"left\" | \"right\";\n /** Alignment along the placement axis */\n align?: \"start\" | \"center\" | \"end\";\n /** Additional class name for the popover content */\n className?: string;\n /** Width of the popover (default: auto) */\n width?: number | \"trigger\" | \"auto\";\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function Popover({\n open,\n onClose,\n trigger,\n children,\n placement = \"bottom\",\n align = \"start\",\n className,\n width = \"auto\",\n}: PopoverProps) {\n const triggerRef = useRef<HTMLDivElement>(null);\n const popoverRef = useRef<HTMLDivElement>(null);\n const [position, setPosition] = useState({ top: 0, left: 0 });\n const [actualWidth, setActualWidth] = useState<number | undefined>(undefined);\n\n // Calculate position based on trigger element\n const updatePosition = useCallback(() => {\n if (!triggerRef.current || !open) return;\n\n const triggerRect = triggerRef.current.getBoundingClientRect();\n const popoverEl = popoverRef.current;\n const popoverRect = popoverEl?.getBoundingClientRect();\n\n let top = 0;\n let left = 0;\n\n // Calculate width\n if (width === \"trigger\") {\n setActualWidth(triggerRect.width);\n } else if (typeof width === \"number\") {\n setActualWidth(width);\n } else {\n setActualWidth(undefined);\n }\n\n const popoverWidth = popoverRect?.width || actualWidth || 200;\n const popoverHeight = popoverRect?.height || 200;\n const gap = 8;\n\n // Calculate initial position based on placement\n switch (placement) {\n case \"top\":\n top = triggerRect.top - popoverHeight - gap;\n break;\n case \"bottom\":\n top = triggerRect.bottom + gap;\n break;\n case \"left\":\n left = triggerRect.left - popoverWidth - gap;\n top = triggerRect.top;\n break;\n case \"right\":\n left = triggerRect.right + gap;\n top = triggerRect.top;\n break;\n }\n\n // Calculate horizontal alignment for top/bottom placements\n if (placement === \"top\" || placement === \"bottom\") {\n switch (align) {\n case \"start\":\n left = triggerRect.left;\n break;\n case \"center\":\n left = triggerRect.left + (triggerRect.width - popoverWidth) / 2;\n break;\n case \"end\":\n left = triggerRect.right - popoverWidth;\n break;\n }\n }\n\n // Calculate vertical alignment for left/right placements\n if (placement === \"left\" || placement === \"right\") {\n switch (align) {\n case \"start\":\n top = triggerRect.top;\n break;\n case \"center\":\n top = triggerRect.top + (triggerRect.height - popoverHeight) / 2;\n break;\n case \"end\":\n top = triggerRect.bottom - popoverHeight;\n break;\n }\n }\n\n // Constrain to viewport\n const padding = 16;\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n\n // Horizontal constraint\n if (left < padding) {\n left = padding;\n } else if (left + popoverWidth > viewportWidth - padding) {\n left = viewportWidth - popoverWidth - padding;\n }\n\n // Vertical constraint\n if (top < padding) {\n top = padding;\n } else if (top + popoverHeight > viewportHeight - padding) {\n top = viewportHeight - popoverHeight - padding;\n }\n\n setPosition({ top, left });\n }, [open, placement, align, width, actualWidth]);\n\n // Update position on open and resize\n useEffect(() => {\n if (!open) return;\n\n updatePosition();\n\n // Re-calculate after content renders\n const raf = requestAnimationFrame(updatePosition);\n\n window.addEventListener(\"resize\", updatePosition);\n window.addEventListener(\"scroll\", updatePosition, true);\n\n return () => {\n cancelAnimationFrame(raf);\n window.removeEventListener(\"resize\", updatePosition);\n window.removeEventListener(\"scroll\", updatePosition, true);\n };\n }, [open, updatePosition]);\n\n // Handle click outside\n useEffect(() => {\n if (!open) return;\n\n const handleClickOutside = (e: MouseEvent) => {\n const target = e.target as Node;\n if (\n popoverRef.current &&\n !popoverRef.current.contains(target) &&\n triggerRef.current &&\n !triggerRef.current.contains(target)\n ) {\n onClose();\n }\n };\n\n // Delay to avoid closing on the same click that opened\n const timeout = setTimeout(() => {\n document.addEventListener(\"mousedown\", handleClickOutside);\n }, 0);\n\n return () => {\n clearTimeout(timeout);\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }, [open, onClose]);\n\n // Handle escape key\n useEffect(() => {\n if (!open) return;\n\n const handleEscape = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n onClose();\n }\n };\n\n document.addEventListener(\"keydown\", handleEscape);\n return () => document.removeEventListener(\"keydown\", handleEscape);\n }, [open, onClose]);\n\n const portalRoot = typeof document !== \"undefined\"\n ? document.getElementById(\"uilint-portal\") || document.body\n : null;\n\n return (\n <>\n <div ref={triggerRef} className=\"inline-flex\">\n {trigger}\n </div>\n\n {portalRoot &&\n createPortal(\n <AnimatePresence>\n {open && (\n <motion.div\n ref={popoverRef}\n initial={{ opacity: 0, scale: 0.95, y: -4 }}\n animate={{ opacity: 1, scale: 1, y: 0 }}\n exit={{ opacity: 0, scale: 0.95, y: -4 }}\n transition={{ duration: 0.15, ease: [0.32, 0.72, 0, 1] }}\n className={cn(\n \"fixed z-[99998]\",\n \"rounded-xl\",\n \"border border-foreground/[0.08]\",\n \"bg-surface/95 backdrop-blur-xl\",\n \"shadow-xl shadow-black/10\",\n \"overflow-hidden\",\n className\n )}\n style={{\n top: position.top,\n left: position.left,\n width: actualWidth,\n pointerEvents: \"auto\",\n }}\n >\n {children}\n </motion.div>\n )}\n </AnimatePresence>,\n portalRoot\n )}\n </>\n );\n}\n\nexport default Popover;\n","/**\n * SearchInput - Hero search bar for command palette\n *\n * Spotlight/Raycast-inspired design:\n * - Large, prominent input (48px height)\n * - Subtle focus glow\n * - Glassmorphic background\n * - Minimal color - monochrome with single accent\n * - shadcn class conventions\n */\n\nimport * as React from \"react\";\nimport { useRef, useEffect, useState } from \"react\";\nimport { motion, AnimatePresence } from \"motion/react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { SearchIcon, CloseIcon } from \"../../icons\";\nimport { Kbd, IconButton } from \"../primitives\";\nimport { cn } from \"../../../lib/utils\";\nimport { useComposedStore } from \"../../../core/store\";\n\n// ============================================================================\n// Variants\n// ============================================================================\n\nconst searchContainerVariants = cva(\n \"flex items-center gap-4 border-b transition-all duration-150\",\n {\n variants: {\n size: {\n default: \"px-5 py-4\",\n large: \"px-6 py-5\",\n },\n state: {\n default: \"bg-transparent border-foreground/[0.06]\",\n focused: \"bg-foreground/[0.02] border-foreground/[0.08]\",\n },\n },\n defaultVariants: {\n size: \"large\",\n state: \"default\",\n },\n }\n);\n\nconst searchInputVariants = cva(\n \"flex-1 bg-transparent border-none outline-none font-normal tracking-tight\",\n {\n variants: {\n size: {\n default: \"text-base h-8\",\n large: \"text-lg h-10\",\n },\n },\n defaultVariants: {\n size: \"large\",\n },\n }\n);\n\n// ============================================================================\n// Animation variants\n// ============================================================================\n\nconst iconMotionVariants = {\n default: { scale: 1, opacity: 0.35 },\n focused: { scale: 1, opacity: 0.5 },\n};\n\nconst clearButtonMotionVariants = {\n initial: { opacity: 0, scale: 0.8 },\n animate: { opacity: 1, scale: 1 },\n exit: { opacity: 0, scale: 0.8 },\n};\n\nconst hintMotionVariants = {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n exit: { opacity: 0 },\n};\n\n// Crisp easing\nconst crispEase = [0.32, 0.72, 0, 1] as const;\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface SearchInputProps extends VariantProps<typeof searchContainerVariants> {\n /** Current search value */\n value: string;\n /** Callback when value changes */\n onChange: (value: string) => void;\n /** Placeholder text */\n placeholder?: string;\n /** Auto focus on mount */\n autoFocus?: boolean;\n /** Additional class name */\n className?: string;\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\n/**\n * SearchInput - Hero search bar component\n *\n * @example\n * ```tsx\n * <SearchInput\n * value={query}\n * onChange={setQuery}\n * placeholder=\"Search commands, issues, rules...\"\n * />\n * ```\n */\nexport function SearchInput({\n value,\n onChange,\n placeholder = \"Search commands, issues, rules...\",\n autoFocus = true,\n size,\n className,\n}: SearchInputProps) {\n const inputRef = useRef<HTMLInputElement>(null);\n const [isFocused, setIsFocused] = useState(false);\n const isMobile = useComposedStore((s) => s.mobile.isMobile);\n\n // Auto-focus on mount with slight delay for animation\n useEffect(() => {\n if (!autoFocus) return;\n\n const timer = setTimeout(() => {\n inputRef.current?.focus();\n }, 50);\n return () => clearTimeout(timer);\n }, [autoFocus]);\n\n const state = isFocused ? \"focused\" : \"default\";\n\n return (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ duration: 0.1 }}\n className={cn(searchContainerVariants({ size, state }), className)}\n style={{\n // Minimal styling - no extra visual noise\n boxShadow: \"none\",\n }}\n >\n {/* Search icon */}\n <motion.div\n variants={iconMotionVariants}\n animate={state}\n transition={{ duration: 0.15, ease: crispEase }}\n className=\"flex items-center justify-center shrink-0\"\n style={{ color: \"var(--uilint-text-muted)\" }}\n >\n <SearchIcon size={size === \"large\" ? 22 : 18} />\n </motion.div>\n\n {/* Input container */}\n <div className=\"flex-1 flex items-center min-w-0\">\n {/* Input */}\n <input\n ref={inputRef}\n type=\"text\"\n value={value}\n onChange={(e) => onChange(e.target.value)}\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n placeholder={placeholder}\n className={cn(searchInputVariants({ size }), \"min-w-[120px] w-full\")}\n style={{\n color: \"var(--uilint-text-primary)\",\n caretColor: \"var(--uilint-accent)\",\n }}\n />\n </div>\n\n {/* Clear button / Keyboard hint (desktop only) */}\n <AnimatePresence mode=\"wait\">\n {value ? (\n <motion.div\n key=\"clear\"\n variants={clearButtonMotionVariants}\n initial=\"initial\"\n animate=\"animate\"\n exit=\"exit\"\n transition={{ duration: 0.1, ease: crispEase }}\n >\n <IconButton\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => onChange(\"\")}\n disableMotion\n style={{\n color: \"var(--uilint-text-muted)\",\n opacity: 0.6,\n }}\n >\n <CloseIcon size={14} />\n </IconButton>\n </motion.div>\n ) : !isMobile ? (\n <motion.div\n key=\"hint\"\n variants={hintMotionVariants}\n initial=\"initial\"\n animate=\"animate\"\n exit=\"exit\"\n transition={{ duration: 0.1, ease: crispEase }}\n className=\"flex items-center gap-2 shrink-0\"\n >\n <Kbd animate={false}>esc</Kbd>\n <span\n className=\"text-[11px]\"\n style={{ color: \"var(--uilint-text-disabled)\" }}\n >\n to close\n </span>\n </motion.div>\n ) : null}\n </AnimatePresence>\n </motion.div>\n );\n}\n\nexport { searchContainerVariants, searchInputVariants };\n","/**\n * Tile - Glassmorphic tile component for mosaic grid\n *\n * iOS-style glassmorphic design:\n * - Translucent background with backdrop blur\n * - Minimal color palette with proper light/dark mode contrast\n * - Large, light-weight fonts\n * - Clean, modern aesthetic using shadcn conventions\n *\n * Display format:\n * - Line 1: Rule/file name (label)\n * - Line 2: \"X issues in Y files\" or \"X issues\"\n */\nimport React, { useMemo } from \"react\";\nimport { motion } from \"motion/react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../../lib/utils\";\nimport { ExternalLinkIcon } from \"../../icons\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport type TileBucket = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n\nexport interface TileProps extends VariantProps<typeof tileVariants> {\n id: string;\n label: string;\n /** Optional subtitle (e.g., file path) shown above label */\n subtitle?: string;\n /** Tile type for visual differentiation (gradient color) */\n tileType?: \"rule\" | \"file\";\n count: number;\n /** Number of files (for \"X issues in Y files\" display) */\n fileCount?: number;\n bucket: TileBucket;\n isSelected: boolean;\n onClick: () => void;\n onOpenInInspector?: () => void;\n}\n\n// ============================================================================\n// Variants\n// ============================================================================\n\nconst tileVariants = cva(\n [\n \"h-full cursor-pointer overflow-hidden relative box-border\",\n \"flex flex-col justify-between\",\n \"rounded-2xl\",\n \"transition-all duration-150\",\n ],\n {\n variants: {\n selected: {\n true: \"bg-foreground/[0.04] border border-foreground/12\",\n false:\n \"border border-foreground/[0.04] hover:bg-foreground/[0.03] hover:border-foreground/[0.08]\",\n },\n size: {\n xs: \"p-3\",\n sm: \"p-4\",\n md: \"p-5\",\n lg: \"p-6\",\n xl: \"p-7\",\n },\n },\n defaultVariants: {\n selected: false,\n size: \"md\",\n },\n }\n);\n\n// ============================================================================\n// Animation\n// ============================================================================\n\nconst crispEase = [0.32, 0.72, 0, 1] as const;\n\n// ============================================================================\n// Sub-components\n// ============================================================================\n\n/**\n * Hover highlight overlay - subtle top-left shine\n */\nfunction HoverOverlay({ isHovered }: { isHovered: boolean }) {\n return (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: isHovered ? 1 : 0 }}\n transition={{ duration: 0.15 }}\n className=\"absolute inset-0 rounded-2xl pointer-events-none bg-linear-to-br from-foreground/2 to-transparent\"\n />\n );\n}\n\n/**\n * Type gradient flourish - corner gradient to differentiate tile types\n */\nfunction TypeGradient({ tileType }: { tileType?: \"rule\" | \"file\" }) {\n if (!tileType) return null;\n\n // Use CSS variable for the color based on tile type\n const colorVar = tileType === \"rule\" ? \"var(--color-tile-rule)\" : \"var(--color-tile-file)\";\n\n return (\n <div\n className=\"absolute top-0 right-0 w-20 h-20 pointer-events-none rounded-tr-2xl\"\n style={{\n background: `radial-gradient(circle at top right, ${colorVar} 0%, transparent 70%)`,\n opacity: 0.25,\n }}\n />\n );\n}\n\n/**\n * Format the issue summary parts (e.g., \"72\" and \"issues in 4 files\")\n * Returns count separately for prominent styling\n */\nfunction formatIssueSummaryParts(\n count: number,\n fileCount?: number\n): { count: number; suffix: string } {\n const issueWord = count === 1 ? \"issue\" : \"issues\";\n if (fileCount !== undefined && fileCount > 0) {\n const fileWord = fileCount === 1 ? \"file\" : \"files\";\n return { count, suffix: `${issueWord} in ${fileCount} ${fileWord}` };\n }\n return { count, suffix: issueWord };\n}\n\n/**\n * Get font size for label based on bucket (larger tiles = larger fonts)\n */\nfunction getLabelFontSize(bucket: TileBucket): string {\n switch (bucket) {\n case \"xl\":\n return \"text-2xl\";\n case \"lg\":\n return \"text-xl\";\n case \"md\":\n return \"text-lg\";\n case \"sm\":\n return \"text-base\";\n case \"xs\":\n return \"text-sm\";\n default:\n return \"text-lg\";\n }\n}\n\n/**\n * Get font size for summary based on bucket\n */\nfunction getSummaryFontSize(bucket: TileBucket): string {\n switch (bucket) {\n case \"xl\":\n return \"text-base\";\n case \"lg\":\n return \"text-sm\";\n case \"md\":\n return \"text-sm\";\n case \"sm\":\n return \"text-xs\";\n case \"xs\":\n return \"text-[11px]\";\n default:\n return \"text-sm\";\n }\n}\n\n// ============================================================================\n// Main Component\n// ============================================================================\n\nexport function Tile({\n id,\n label,\n subtitle,\n tileType,\n count,\n fileCount,\n bucket,\n isSelected,\n onClick,\n onOpenInInspector,\n}: TileProps) {\n const [isHovered, setIsHovered] = React.useState(false);\n\n const handleOpenInInspector = (e: React.MouseEvent) => {\n e.stopPropagation();\n onOpenInInspector?.();\n };\n\n // Icon size for external link button based on bucket\n const iconSize = useMemo(() => {\n if (bucket === \"xl\") return 16;\n if (bucket === \"lg\") return 14;\n if (bucket === \"md\") return 14;\n if (bucket === \"sm\") return 12;\n return 10;\n }, [bucket]);\n\n // Format the issue summary parts (count separate for prominent styling)\n const { count: issueCount, suffix } = formatIssueSummaryParts(\n count,\n fileCount\n );\n\n // Get font sizes based on bucket\n const labelFontSize = getLabelFontSize(bucket);\n const summaryFontSize = getSummaryFontSize(bucket);\n\n // Get path font size (smaller than summary)\n const pathFontSize = bucket === \"xs\" ? \"text-[10px]\" : \"text-xs\";\n\n return (\n <motion.div\n data-tile-id={id}\n onClick={onClick}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n whileHover={{ scale: 1.02 }}\n whileTap={{ scale: 0.98 }}\n transition={{\n duration: 0.15,\n ease: crispEase,\n }}\n className={cn(tileVariants({ selected: isSelected, size: bucket }))}\n >\n {/* Content: path + label at top, issue summary at bottom */}\n <div className=\"flex flex-col justify-between h-full\">\n {/* Top section: path, icon + label, and inspector button */}\n <div className=\"flex items-start justify-between gap-1.5\">\n <div className=\"flex-1 min-w-0 flex flex-col\">\n {/* Path (subtitle) - small subdued text above label, mono for files */}\n {subtitle && (\n <div\n className={cn(\n \"text-muted-foreground/50 truncate mb-0.5\",\n pathFontSize,\n tileType === \"file\" && \"font-mono\"\n )}\n >\n {subtitle}\n </div>\n )}\n\n {/* Label */}\n <span\n className={cn(\n \"font-light leading-tight tracking-tight text-foreground line-clamp-2\",\n labelFontSize\n )}\n title={label}\n >\n {label}\n </span>\n </div>\n\n {/* Open in inspector button */}\n {onOpenInInspector && (\n <motion.button\n onClick={handleOpenInInspector}\n initial={{ opacity: 0 }}\n animate={{ opacity: isHovered ? 1 : 0 }}\n whileHover={{ scale: 1.1 }}\n whileTap={{ scale: 0.95 }}\n transition={{ duration: 0.1 }}\n className=\"shrink-0 p-1 -mt-0.5 -mr-0.5 rounded-lg text-muted-foreground/50 hover:text-foreground/70 hover:bg-foreground/6 transition-colors\"\n title=\"Open in inspector\"\n aria-label=\"Open in inspector\"\n >\n <ExternalLinkIcon size={iconSize} />\n </motion.button>\n )}\n </div>\n\n {/* Bottom section: Issue summary */}\n <div\n className={cn(\n \"flex items-baseline gap-1 mt-auto pt-2\",\n summaryFontSize\n )}\n >\n <span className={cn(\"font-light text-foreground\", labelFontSize)}>\n {issueCount}\n </span>\n <span className=\"font-normal text-muted-foreground/60\">{suffix}</span>\n </div>\n </div>\n\n {/* Hover highlight overlay */}\n <HoverOverlay isHovered={isHovered} />\n\n {/* Type gradient flourish */}\n <TypeGradient tileType={tileType} />\n </motion.div>\n );\n}\n","/**\n * Mosaic Layout Calculator - Skyline Bin-Packing Algorithm\n *\n * Uses Skyline bin-packing for variable-sized rectangles.\n * Tiles have dimensions based on:\n * - Surface area proportional to log(count)\n * - Aspect ratio based on label length\n */\n\nimport type { TileBucket } from \"../../../../core/plugin-system/types\";\nimport type {\n TileLayout,\n MosaicLayoutResult,\n MosaicLayoutConfig,\n LayoutItem,\n} from \"./types\";\n\n// Default padding\nconst DEFAULT_PADDING = { top: 0, right: 0, bottom: 0, left: 0 };\n\n// Default configuration\nconst DEFAULT_CONFIG = {\n availableWidth: 416,\n gap: 12,\n minTileWidth: 100,\n maxTileWidth: 320,\n minTileHeight: 110, // Increased to fit path + title + issue summary\n maxTileHeight: 280,\n minArea: 8_000,\n maxArea: 60_000,\n padding: DEFAULT_PADDING,\n};\n\n// ============================================================================\n// Skyline Types\n// ============================================================================\n\n/** A segment in the skyline contour */\ninterface SkylineNode {\n x: number;\n y: number;\n width: number;\n}\n\n/** A tile with calculated dimensions before packing */\ninterface SizedTile {\n id: string;\n width: number;\n height: number;\n originalIndex: number;\n}\n\n/** A tile with its packed position */\ninterface PackedTile {\n id: string;\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\n// ============================================================================\n// Dimension Calculation\n// ============================================================================\n\n/**\n * Clamp a value between min and max\n */\nfunction clamp(value: number, min: number, max: number): number {\n return Math.max(min, Math.min(max, value));\n}\n\n/**\n * Calculate ideal tile dimensions based on issue count and label length.\n *\n * - Area is proportional to log(count) for better visual balance\n * - Aspect ratio is based on label length (longer labels = wider tiles)\n */\nfunction calculateIdealDimensions(\n item: LayoutItem,\n totalIssues: number,\n config: typeof DEFAULT_CONFIG\n): { width: number; height: number } {\n // Calculate area from count using log scaling\n // This prevents extreme size differences between tiles\n // Handle edge cases: negative counts, zero totalIssues\n const safeCount = Math.max(0, item.count);\n const safeTotalIssues = Math.max(1, totalIssues);\n const fraction = safeTotalIssues > 1\n ? Math.log1p(safeCount) / Math.log1p(safeTotalIssues)\n : 1;\n const area = config.minArea + fraction * (config.maxArea - config.minArea);\n\n // Calculate aspect ratio from label length\n // Short labels → square, long labels → landscape\n const labelLen = item.label?.length ?? 0;\n const subtitleLen = item.subtitle?.length ?? 0;\n const maxLen = Math.max(labelLen, subtitleLen);\n\n let aspectRatio: number;\n if (maxLen <= 10) {\n aspectRatio = 1.0; // Square\n } else if (maxLen <= 20) {\n aspectRatio = 1.5; // Slight landscape\n } else {\n // Gradually wider for longer labels (2.0 to 3.0)\n aspectRatio = 2.0 + Math.min(1, (maxLen - 20) / 20);\n }\n\n // Derive dimensions from area and aspect ratio\n // area = width * height\n // aspectRatio = width / height\n // Therefore: width = sqrt(area * aspectRatio), height = sqrt(area / aspectRatio)\n let width = Math.sqrt(area * aspectRatio);\n let height = Math.sqrt(area / aspectRatio);\n\n // Clamp to min/max constraints\n width = clamp(width, config.minTileWidth, config.maxTileWidth);\n height = clamp(height, config.minTileHeight, config.maxTileHeight);\n\n return { width: Math.round(width), height: Math.round(height) };\n}\n\n// ============================================================================\n// Skyline Bin-Packing\n// ============================================================================\n\n/**\n * Find the best position for a tile in the skyline.\n * Uses Bottom-Left strategy: find the position with lowest Y that fits.\n */\nfunction findBestSkylinePosition(\n skyline: SkylineNode[],\n tileWidth: number,\n tileHeight: number,\n containerWidth: number,\n gap: number\n): { x: number; y: number; skylineIndex: number } {\n let bestX = 0;\n let bestY = Infinity;\n let bestIndex = 0;\n\n // Try placing the tile starting at each skyline node\n for (let i = 0; i < skyline.length; i++) {\n const node = skyline[i];\n\n // Check if tile fits horizontally from this position\n const endX = node.x + tileWidth + gap;\n if (endX > containerWidth + gap) continue; // Doesn't fit\n\n // Find max Y across all skyline nodes this tile would span\n let maxY = node.y;\n let currentX = node.x;\n\n for (let j = i; j < skyline.length && currentX < node.x + tileWidth; j++) {\n maxY = Math.max(maxY, skyline[j].y);\n currentX += skyline[j].width;\n }\n\n // Check if this is a better position (lower Y)\n if (maxY < bestY) {\n bestY = maxY;\n bestX = node.x;\n bestIndex = i;\n }\n }\n\n // If nothing found, place at origin (shouldn't happen with proper initialization)\n if (bestY === Infinity) {\n return { x: 0, y: 0, skylineIndex: 0 };\n }\n\n return { x: bestX, y: bestY, skylineIndex: bestIndex };\n}\n\n/**\n * Update the skyline after placing a tile.\n * Merges the new rectangle into the skyline contour.\n */\nfunction updateSkyline(\n skyline: SkylineNode[],\n tileX: number,\n tileY: number,\n tileWidth: number,\n tileHeight: number,\n gap: number\n): SkylineNode[] {\n const newY = tileY + tileHeight + gap;\n const tileEndX = tileX + tileWidth + gap;\n\n const newSkyline: SkylineNode[] = [];\n\n for (let i = 0; i < skyline.length; i++) {\n const node = skyline[i];\n const nodeEndX = node.x + node.width;\n\n // Node is completely before the tile\n if (nodeEndX <= tileX) {\n newSkyline.push(node);\n continue;\n }\n\n // Node is completely after the tile\n if (node.x >= tileEndX) {\n newSkyline.push(node);\n continue;\n }\n\n // Node overlaps with tile - need to split\n\n // Part before tile\n if (node.x < tileX) {\n newSkyline.push({\n x: node.x,\n y: node.y,\n width: tileX - node.x,\n });\n }\n\n // Part after tile\n if (nodeEndX > tileEndX) {\n newSkyline.push({\n x: tileEndX,\n y: node.y,\n width: nodeEndX - tileEndX,\n });\n }\n }\n\n // Add the new skyline segment for the tile\n newSkyline.push({\n x: tileX,\n y: newY,\n width: tileWidth + gap,\n });\n\n // Sort by x position and merge adjacent segments with same Y\n newSkyline.sort((a, b) => a.x - b.x);\n\n const merged: SkylineNode[] = [];\n for (const node of newSkyline) {\n if (merged.length === 0) {\n merged.push(node);\n continue;\n }\n\n const last = merged[merged.length - 1];\n const lastEndX = last.x + last.width;\n\n // Merge if adjacent (or overlapping) and same height\n if (Math.abs(lastEndX - node.x) < 1 && last.y === node.y) {\n last.width = node.x + node.width - last.x;\n } else if (lastEndX >= node.x && last.y === node.y) {\n // Overlapping with same height\n last.width = Math.max(lastEndX, node.x + node.width) - last.x;\n } else {\n merged.push(node);\n }\n }\n\n return merged;\n}\n\n/**\n * Pack tiles using Skyline Bottom-Left algorithm.\n * Sort by height (descending) to place tallest first for better packing.\n */\nfunction packTiles(\n tiles: SizedTile[],\n containerWidth: number,\n gap: number\n): PackedTile[] {\n if (tiles.length === 0) return [];\n\n // Sort by height descending (place tallest first)\n const sorted = [...tiles].sort((a, b) => b.height - a.height);\n\n // Initialize skyline as a single segment spanning the container\n let skyline: SkylineNode[] = [{ x: 0, y: 0, width: containerWidth }];\n\n const packed: PackedTile[] = [];\n\n for (const tile of sorted) {\n const pos = findBestSkylinePosition(\n skyline,\n tile.width,\n tile.height,\n containerWidth,\n gap\n );\n\n packed.push({\n id: tile.id,\n x: pos.x,\n y: pos.y,\n width: tile.width,\n height: tile.height,\n });\n\n skyline = updateSkyline(\n skyline,\n pos.x,\n pos.y,\n tile.width,\n tile.height,\n gap\n );\n }\n\n return packed;\n}\n\n// ============================================================================\n// Bucket Calculation\n// ============================================================================\n\n/**\n * Assign bucket based on surface area for styling purposes.\n */\nfunction getBucketFromArea(height: number, width: number): TileBucket {\n const area = height * width;\n if (area <= 12000) return \"xs\";\n if (area <= 18000) return \"sm\";\n if (area <= 28000) return \"md\";\n if (area <= 42000) return \"lg\";\n return \"xl\";\n}\n\n/**\n * Calculate bucket size based on normalized percentiles.\n * Kept for backwards compatibility.\n */\nexport function calculateBucket(count: number, sortedCounts: number[]): TileBucket {\n if (sortedCounts.length === 0) return \"md\";\n\n const total = sortedCounts.length;\n const position = sortedCounts.findIndex((c) => count >= c);\n const percentile = position === -1 ? 1 : position / total;\n\n if (percentile < 0.1) return \"xl\";\n if (percentile < 0.3) return \"lg\";\n if (percentile < 0.6) return \"md\";\n if (percentile < 0.85) return \"sm\";\n return \"xs\";\n}\n\n/**\n * Calculate buckets for all items based on their counts.\n * Kept for backwards compatibility.\n */\nexport function calculateBuckets(items: LayoutItem[]): Map<string, TileBucket> {\n const sortedCounts = items.map((item) => item.count).sort((a, b) => b - a);\n const buckets = new Map<string, TileBucket>();\n\n for (const item of items) {\n buckets.set(item.id, calculateBucket(item.count, sortedCounts));\n }\n\n return buckets;\n}\n\n// ============================================================================\n// Main Layout Function\n// ============================================================================\n\n/**\n * Main Skyline bin-packing mosaic layout algorithm.\n *\n * Tiles have:\n * - Surface area proportional to log(count)\n * - Aspect ratio based on label length\n * - Variable widths and heights (no column snapping)\n */\nexport function calculateMosaicLayout(\n items: LayoutItem[],\n config: MosaicLayoutConfig = {}\n): MosaicLayoutResult {\n // Merge padding separately to handle partial padding objects\n const padding = {\n ...DEFAULT_PADDING,\n ...config.padding,\n };\n\n if (items.length === 0) {\n return {\n tiles: new Map(),\n rowCount: 0,\n columnCount: 0,\n pattern: \"grid\",\n totalHeight: padding.top + padding.bottom,\n };\n }\n\n const mergedConfig = {\n ...DEFAULT_CONFIG,\n ...config,\n padding,\n };\n\n const { availableWidth, gap } = mergedConfig;\n const { top: paddingTop, left: paddingLeft, bottom: paddingBottom } = padding;\n\n // Calculate total issues for proportional area\n const totalIssues = items.reduce((sum, item) => sum + item.count, 0);\n\n // Step 1: Calculate ideal dimensions for each tile\n const sizedTiles: SizedTile[] = items.map((item, index) => {\n const dims = calculateIdealDimensions(item, totalIssues, mergedConfig);\n return {\n id: item.id,\n width: dims.width,\n height: dims.height,\n originalIndex: index,\n };\n });\n\n // Step 2: Pack tiles using Skyline algorithm\n const packed = packTiles(sizedTiles, availableWidth, gap);\n\n // Step 3: Convert to TileLayout\n const tiles = new Map<string, TileLayout>();\n\n let maxY = 0;\n for (const p of packed) {\n const bucket = getBucketFromArea(p.height, p.width);\n\n tiles.set(p.id, {\n id: p.id,\n row: 0, // Legacy field\n column: 0, // Legacy field\n width: `${p.width}px`,\n widthFraction: p.width / availableWidth,\n bucket,\n isRowStart: p.x === 0,\n x: p.x + paddingLeft,\n y: p.y + paddingTop,\n height: p.height,\n });\n\n maxY = Math.max(maxY, p.y + p.height);\n }\n\n const totalHeight = maxY + paddingTop + paddingBottom;\n\n // Determine pattern based on item count\n let pattern: MosaicLayoutResult[\"pattern\"] = \"grid\";\n if (items.length === 1) pattern = \"single\";\n else if (items.length === 2) pattern = \"pair\";\n else if (items.length === 3) pattern = \"trio\";\n else if (items.length === 4) pattern = \"quad\";\n\n // Estimate column count based on average tile width\n const avgWidth = sizedTiles.reduce((sum, t) => sum + t.width, 0) / sizedTiles.length;\n const estimatedColumns = Math.round(availableWidth / (avgWidth + gap));\n\n return {\n tiles,\n rowCount: Math.ceil(items.length / Math.max(1, estimatedColumns)),\n columnCount: Math.max(1, estimatedColumns),\n pattern,\n totalHeight,\n };\n}\n\n/**\n * Group tiles by row for rendering (kept for backwards compatibility)\n */\nexport function groupTilesByRow<T extends { id: string }>(\n items: T[],\n layout: MosaicLayoutResult\n): T[][] {\n if (items.length === 0) return [];\n\n // Sort by y position, then x position\n const sorted = [...items].sort((a, b) => {\n const layoutA = layout.tiles.get(a.id);\n const layoutB = layout.tiles.get(b.id);\n const yDiff = (layoutA?.y ?? 0) - (layoutB?.y ?? 0);\n if (Math.abs(yDiff) > 10) return yDiff;\n return (layoutA?.x ?? 0) - (layoutB?.x ?? 0);\n });\n\n return [sorted];\n}\n\n// Bucket heights mapping (for getBucketHeight compatibility)\nconst BUCKET_HEIGHTS: Record<TileBucket, number> = {\n xs: 115,\n sm: 140,\n md: 185,\n lg: 240,\n xl: 280,\n};\n\n/**\n * Get bucket height in pixels\n */\nexport function getBucketHeight(bucket: TileBucket): number {\n return BUCKET_HEIGHTS[bucket];\n}\n\n// ============================================================================\n// Expanded Tile Layout Helpers\n// ============================================================================\n\n/**\n * Configuration for collapsed tile strip layout\n */\nexport interface CollapsedStripConfig {\n /** Width of each collapsed tile */\n tileWidth?: number;\n /** Height of collapsed tiles */\n tileHeight?: number;\n /** Gap between tiles */\n gap?: number;\n /** Padding around the strip */\n padding?: number;\n}\n\nconst DEFAULT_COLLAPSED_CONFIG: Required<CollapsedStripConfig> = {\n tileWidth: 100,\n tileHeight: 56,\n gap: 8,\n padding: 12,\n};\n\n/**\n * Layout info for a collapsed tile in the strip\n */\nexport interface CollapsedTileLayout {\n id: string;\n x: number;\n width: number;\n height: number;\n}\n\n/**\n * Calculate layout for collapsed tiles in horizontal strip\n */\nexport function calculateCollapsedStripLayout(\n items: LayoutItem[],\n config: CollapsedStripConfig = {}\n): {\n tiles: CollapsedTileLayout[];\n totalWidth: number;\n height: number;\n} {\n const mergedConfig = { ...DEFAULT_COLLAPSED_CONFIG, ...config };\n const { tileWidth, tileHeight, gap, padding } = mergedConfig;\n\n if (items.length === 0) {\n return { tiles: [], totalWidth: padding * 2, height: tileHeight + padding * 2 };\n }\n\n const tiles: CollapsedTileLayout[] = items.map((item, index) => ({\n id: item.id,\n x: padding + index * (tileWidth + gap),\n width: tileWidth,\n height: tileHeight,\n }));\n\n const totalWidth = padding * 2 + items.length * tileWidth + (items.length - 1) * gap;\n const height = tileHeight + padding * 2;\n\n return { tiles, totalWidth, height };\n}\n\n/**\n * Calculate layout for children within an expanded tile\n */\nexport interface ChildGridConfig {\n /** Available width for the grid */\n availableWidth?: number;\n /** Number of columns */\n columns?: number;\n /** Gap between tiles */\n gap?: number;\n /** Tile height */\n tileHeight?: number;\n}\n\nconst DEFAULT_CHILD_GRID_CONFIG: Required<ChildGridConfig> = {\n availableWidth: 480,\n columns: 3,\n gap: 8,\n tileHeight: 80,\n};\n\n/**\n * Layout info for a child tile in the grid\n */\nexport interface ChildTileLayout {\n id: string;\n x: number;\n y: number;\n width: number;\n height: number;\n row: number;\n column: number;\n}\n\n/**\n * Calculate layout for child tiles in a simple grid\n */\nexport function calculateChildGridLayout(\n items: LayoutItem[],\n config: ChildGridConfig = {}\n): {\n tiles: ChildTileLayout[];\n totalHeight: number;\n columns: number;\n} {\n const mergedConfig = { ...DEFAULT_CHILD_GRID_CONFIG, ...config };\n const { availableWidth, columns, gap, tileHeight } = mergedConfig;\n\n if (items.length === 0) {\n return { tiles: [], totalHeight: 0, columns };\n }\n\n const tileWidth = (availableWidth - gap * (columns - 1)) / columns;\n const rows = Math.ceil(items.length / columns);\n\n const tiles: ChildTileLayout[] = items.map((item, index) => {\n const row = Math.floor(index / columns);\n const column = index % columns;\n return {\n id: item.id,\n x: column * (tileWidth + gap),\n y: row * (tileHeight + gap),\n width: tileWidth,\n height: tileHeight,\n row,\n column,\n };\n });\n\n const totalHeight = rows * tileHeight + (rows - 1) * gap;\n\n return { tiles, totalHeight, columns };\n}\n","/**\n * Expanded Layout Algorithm\n *\n * Calculates positions for all tiles when one tile is expanded to show children.\n *\n * Algorithm:\n * 1. Calculate original mosaic layout for all tiles\n * 2. If a tile is expanded:\n * a. Calculate children layout to determine expanded height\n * b. Find expanded tile's original Y position\n * c. Separate tiles into ABOVE (keep position) and DISPLACED (reflow below)\n * d. Place expanded tile at original Y, full width\n * e. Re-layout displaced tiles below the expanded tile\n * 3. Return final positions for all tiles\n */\n\nimport { calculateMosaicLayout } from \"./mosaic-layout\";\nimport type { LayoutItem } from \"./types\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface ExpandedLayoutConfig {\n /** Available width for the grid (default: 532) */\n availableWidth?: number;\n /** Gap between tiles (default: 14) */\n gap?: number;\n /** Padding around the grid */\n padding?: {\n top?: number;\n right?: number;\n bottom?: number;\n left?: number;\n };\n}\n\n/** Internal type with all values resolved (no optional properties) */\ninterface ResolvedLayoutConfig {\n availableWidth: number;\n gap: number;\n padding: {\n top: number;\n right: number;\n bottom: number;\n left: number;\n };\n}\n\nexport interface ExpandedLayoutInput {\n /** All items in the grid */\n items: LayoutItem[];\n /** ID of the expanded tile, or null if none */\n expandedId: string | null;\n /** Children of the expanded tile */\n children: LayoutItem[];\n /** Layout configuration */\n config?: ExpandedLayoutConfig;\n /** Extra height to add to expanded tile (for custom content like RuleHeader, RuleConfig) */\n extraExpandedHeight?: number;\n}\n\nexport interface TilePosition {\n id: string;\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface ExpandedLayoutResult {\n /** Map of tile ID to position */\n positions: Map<string, TilePosition>;\n /** Position of the expanded tile (if any) */\n expandedPosition: TilePosition | null;\n /** Total height of the layout */\n totalHeight: number;\n /** Height of the children grid inside the expanded tile */\n childrenHeight: number;\n}\n\n// ============================================================================\n// Constants\n// ============================================================================\n\nconst DEFAULT_CONFIG: ResolvedLayoutConfig = {\n availableWidth: 532,\n gap: 14,\n padding: { top: 20, right: 24, bottom: 20, left: 24 },\n};\n\nconst EXPANDED_HEADER_HEIGHT = 52;\nconst EXPANDED_CONTENT_PADDING = 12;\nconst CHILDREN_GAP = 10;\n\n// ============================================================================\n// Main Function\n// ============================================================================\n\nexport function calculateExpandedLayout(input: ExpandedLayoutInput): ExpandedLayoutResult {\n const { items, expandedId, children } = input;\n const config = mergeConfig(input.config);\n\n // Handle empty items\n if (items.length === 0) {\n return {\n positions: new Map(),\n expandedPosition: null,\n totalHeight: config.padding.top + config.padding.bottom,\n childrenHeight: 0,\n };\n }\n\n // Calculate original layout for all items\n const originalLayout = calculateMosaicLayout(items, {\n availableWidth: config.availableWidth,\n gap: config.gap,\n padding: config.padding,\n });\n\n // If no tile is expanded, return original layout\n if (!expandedId) {\n const positions = new Map<string, TilePosition>();\n for (const item of items) {\n const layout = originalLayout.tiles.get(item.id);\n if (layout) {\n positions.set(item.id, {\n id: item.id,\n x: layout.x,\n y: layout.y,\n width: parseFloat(layout.width),\n height: layout.height,\n });\n }\n }\n return {\n positions,\n expandedPosition: null,\n totalHeight: originalLayout.totalHeight,\n childrenHeight: 0,\n };\n }\n\n // Get expanded tile's original position\n const expandedOriginal = originalLayout.tiles.get(expandedId);\n if (!expandedOriginal) {\n // Expanded tile not found - fall back to normal layout\n const positions = new Map<string, TilePosition>();\n for (const item of items) {\n const layout = originalLayout.tiles.get(item.id);\n if (layout) {\n positions.set(item.id, {\n id: item.id,\n x: layout.x,\n y: layout.y,\n width: parseFloat(layout.width),\n height: layout.height,\n });\n }\n }\n return {\n positions,\n expandedPosition: null,\n totalHeight: originalLayout.totalHeight,\n childrenHeight: 0,\n };\n }\n\n // Calculate children layout to determine expanded height\n const childrenLayout = calculateChildrenHeight(children, config);\n const extraHeight = input.extraExpandedHeight ?? 0;\n const expandedHeight = EXPANDED_HEADER_HEIGHT + childrenLayout.totalHeight + EXPANDED_CONTENT_PADDING * 2 + extraHeight;\n\n // The Y position where the expanded tile starts\n const expandedY = expandedOriginal.y;\n\n // Separate tiles into ABOVE and DISPLACED\n const tilesAbove: LayoutItem[] = [];\n const tilesDisplaced: LayoutItem[] = [];\n\n for (const item of items) {\n if (item.id === expandedId) continue;\n\n const layout = originalLayout.tiles.get(item.id);\n if (!layout) continue;\n\n // A tile is ABOVE if its bottom edge is at or above the expanded tile's top edge\n const tileBottom = layout.y + layout.height;\n if (tileBottom <= expandedY) {\n tilesAbove.push(item);\n } else {\n tilesDisplaced.push(item);\n }\n }\n\n // Build final positions map\n const positions = new Map<string, TilePosition>();\n\n // Tiles above keep their original positions\n for (const item of tilesAbove) {\n const layout = originalLayout.tiles.get(item.id)!;\n positions.set(item.id, {\n id: item.id,\n x: layout.x,\n y: layout.y,\n width: parseFloat(layout.width),\n height: layout.height,\n });\n }\n\n // Expanded tile: full width at original Y\n const expandedPosition: TilePosition = {\n id: expandedId,\n x: config.padding.left,\n y: expandedY,\n width: config.availableWidth,\n height: expandedHeight,\n };\n positions.set(expandedId, expandedPosition);\n\n // Calculate where displaced tiles start\n const displacedStartY = expandedY + expandedHeight + config.gap;\n\n // Re-layout displaced tiles\n if (tilesDisplaced.length > 0) {\n const displacedLayout = calculateMosaicLayout(tilesDisplaced, {\n availableWidth: config.availableWidth,\n gap: config.gap,\n padding: { top: 0, right: 0, bottom: config.padding.bottom, left: 0 },\n });\n\n for (const item of tilesDisplaced) {\n const layout = displacedLayout.tiles.get(item.id);\n if (layout) {\n positions.set(item.id, {\n id: item.id,\n x: layout.x + config.padding.left,\n y: layout.y + displacedStartY,\n width: parseFloat(layout.width),\n height: layout.height,\n });\n }\n }\n\n const totalHeight = displacedStartY + displacedLayout.totalHeight;\n return {\n positions,\n expandedPosition,\n totalHeight,\n childrenHeight: childrenLayout.totalHeight,\n };\n }\n\n // No displaced tiles\n const totalHeight = expandedY + expandedHeight + config.padding.bottom;\n return {\n positions,\n expandedPosition,\n totalHeight,\n childrenHeight: childrenLayout.totalHeight,\n };\n}\n\n// ============================================================================\n// Helper Functions\n// ============================================================================\n\nfunction mergeConfig(config?: ExpandedLayoutConfig): ResolvedLayoutConfig {\n return {\n availableWidth: config?.availableWidth ?? DEFAULT_CONFIG.availableWidth,\n gap: config?.gap ?? DEFAULT_CONFIG.gap,\n padding: {\n top: config?.padding?.top ?? DEFAULT_CONFIG.padding.top,\n right: config?.padding?.right ?? DEFAULT_CONFIG.padding.right,\n bottom: config?.padding?.bottom ?? DEFAULT_CONFIG.padding.bottom,\n left: config?.padding?.left ?? DEFAULT_CONFIG.padding.left,\n },\n };\n}\n\n/**\n * Calculate the height of children grid using mosaic layout\n */\nfunction calculateChildrenHeight(\n children: LayoutItem[],\n config: ResolvedLayoutConfig\n): { totalHeight: number } {\n if (children.length === 0) {\n return { totalHeight: 0 };\n }\n\n // Use mosaic layout for children to get accurate height\n // Children grid width = expanded tile width - content padding on each side\n // Expanded tile width = availableWidth (532)\n // Content padding = EXPANDED_CONTENT_PADDING (12px) on each side = 24px total\n const childrenWidth = config.availableWidth - EXPANDED_CONTENT_PADDING * 2;\n\n const layout = calculateMosaicLayout(children, {\n availableWidth: childrenWidth,\n gap: CHILDREN_GAP,\n padding: { top: 0, right: 0, bottom: 0, left: 0 },\n });\n\n return { totalHeight: layout.totalHeight };\n}\n","/**\n * Expansion Animation System\n *\n * Centralized animation definitions for the expandable tile UI.\n * Uses motion/react (Framer Motion) for smooth, coordinated animations.\n */\n\nimport type { Transition, Variants } from \"motion/react\";\n\n// ============================================================================\n// Shared Easing Curves\n// ============================================================================\n\n/**\n * Crisp easing curve - snappy, responsive feel.\n * Used throughout the command palette for consistency.\n */\nexport const crispEase = [0.32, 0.72, 0, 1] as const;\n\n/**\n * Smooth overshoot easing - gentle bounce at the end.\n * Used for expansion animations to feel more organic.\n */\nexport const smoothOvershoot = [0.16, 1, 0.3, 1] as const;\n\n/**\n * Quick ease-in - for elements exiting.\n */\nexport const quickEaseIn = [0.4, 0, 1, 1] as const;\n\n// ============================================================================\n// Duration Constants\n// ============================================================================\n\nexport const DURATIONS = {\n /** Quick micro-interactions (hover, tap) */\n micro: 0.15,\n /** Standard transitions */\n standard: 0.2,\n /** Expansion/collapse of tiles */\n expand: 0.3,\n /** Stagger delay between children */\n staggerChild: 0.04,\n /** Delay before children start animating */\n childrenDelay: 0.15,\n /** Quick exit for collapsing elements */\n quickExit: 0.15,\n} as const;\n\n// ============================================================================\n// Tile State Variants\n// ============================================================================\n\n/**\n * Variants for the main tile container.\n * Handles transitions between normal, expanded, and collapsed-sibling states.\n */\nexport const tileContainerVariants: Variants = {\n // Standard tile in the grid\n normal: {\n scale: 1,\n opacity: 1,\n },\n\n // Expanded tile (showing children)\n expanded: {\n scale: 1,\n opacity: 1,\n },\n\n // Sibling of an expanded tile (minimal view in collapsed strip)\n collapsedSibling: {\n scale: 0.95,\n opacity: 0.8,\n },\n\n // Exit animation\n exit: {\n scale: 0.95,\n opacity: 0,\n },\n};\n\n/**\n * Transition for tile container state changes.\n */\nexport const tileContainerTransition: Transition = {\n duration: DURATIONS.expand,\n ease: crispEase,\n};\n\n// ============================================================================\n// Expansion Animation Variants\n// ============================================================================\n\n/**\n * Variants for the expanded tile wrapper.\n * Animates the expansion from tile size to full width.\n */\nexport const expansionWrapperVariants: Variants = {\n collapsed: {\n opacity: 0,\n scale: 0.95,\n },\n expanded: {\n opacity: 1,\n scale: 1,\n },\n};\n\n/**\n * Transition for expansion wrapper.\n */\nexport const expansionWrapperTransition: Transition = {\n duration: DURATIONS.expand,\n ease: crispEase,\n};\n\n// ============================================================================\n// Children Stagger Variants\n// ============================================================================\n\n/**\n * Parent variants for staggered children animation.\n * Apply to the container that holds child tiles.\n */\nexport const childrenContainerVariants: Variants = {\n hidden: {},\n visible: {\n transition: {\n staggerChildren: DURATIONS.staggerChild,\n delayChildren: DURATIONS.childrenDelay,\n },\n },\n exit: {\n transition: {\n staggerChildren: 0.02,\n staggerDirection: -1,\n },\n },\n};\n\n/**\n * Individual child tile animation variants.\n */\nexport const childTileVariants: Variants = {\n hidden: {\n opacity: 0,\n y: 12,\n scale: 0.95,\n },\n visible: {\n opacity: 1,\n y: 0,\n scale: 1,\n },\n exit: {\n opacity: 0,\n scale: 0.95,\n },\n};\n\n/**\n * Transition for individual child tiles.\n */\nexport const childTileTransition: Transition = {\n duration: DURATIONS.standard,\n ease: crispEase,\n};\n\n// ============================================================================\n// Collapsed Strip Variants\n// ============================================================================\n\n/**\n * Variants for the collapsed sibling strip.\n * Animates the strip sliding in/out.\n */\nexport const collapsedStripVariants: Variants = {\n hidden: {\n opacity: 0,\n y: -8,\n height: 0,\n },\n visible: {\n opacity: 1,\n y: 0,\n height: \"auto\",\n },\n exit: {\n opacity: 0,\n y: -8,\n height: 0,\n },\n};\n\n/**\n * Transition for collapsed strip.\n */\nexport const collapsedStripTransition: Transition = {\n duration: DURATIONS.standard,\n ease: crispEase,\n};\n\n/**\n * Variants for individual tiles in the collapsed strip.\n */\nexport const collapsedTileVariants: Variants = {\n hidden: {\n opacity: 0,\n scale: 0.8,\n },\n visible: {\n opacity: 1,\n scale: 1,\n },\n exit: {\n opacity: 0,\n scale: 0.8,\n },\n};\n\n// ============================================================================\n// Header Variants\n// ============================================================================\n\n/**\n * Variants for the expanded tile header.\n */\nexport const headerVariants: Variants = {\n hidden: {\n opacity: 0,\n x: -12,\n },\n visible: {\n opacity: 1,\n x: 0,\n },\n exit: {\n opacity: 0,\n x: -12,\n },\n};\n\n/**\n * Transition for header animations.\n */\nexport const headerTransition: Transition = {\n duration: DURATIONS.standard,\n ease: crispEase,\n};\n\n// ============================================================================\n// Back Button Variants\n// ============================================================================\n\n/**\n * Variants for the back button in the header.\n */\nexport const backButtonVariants: Variants = {\n rest: {\n x: 0,\n },\n hover: {\n x: -3,\n },\n tap: {\n x: -6,\n scale: 0.95,\n },\n};\n\n/**\n * Transition for back button interactions.\n */\nexport const backButtonTransition: Transition = {\n duration: DURATIONS.micro,\n ease: crispEase,\n};\n\n// ============================================================================\n// Layout Animation Config\n// ============================================================================\n\n/**\n * Layout transition for smooth position/size changes.\n * Use with motion's `layout` prop.\n */\nexport const layoutTransition: Transition = {\n duration: 0.25,\n ease: crispEase,\n};\n\n/**\n * Faster layout transition for smaller movements.\n */\nexport const quickLayoutTransition: Transition = {\n duration: 0.15,\n ease: crispEase,\n};\n\n// ============================================================================\n// Utility Functions\n// ============================================================================\n\n/**\n * Calculate stagger delay for a tile based on its index.\n * Caps the maximum delay to prevent long waits for large grids.\n */\nexport function getStaggerDelay(index: number, maxDelay = 0.2): number {\n return Math.min(index * DURATIONS.staggerChild, maxDelay);\n}\n\n/**\n * Get animation variants for a tile based on its visual state.\n */\nexport function getTileAnimationState(\n isExpanded: boolean,\n isCollapsedSibling: boolean\n): keyof typeof tileContainerVariants {\n if (isExpanded) return \"expanded\";\n if (isCollapsedSibling) return \"collapsedSibling\";\n return \"normal\";\n}\n","/**\n * TileGrid - Bin-packing mosaic grid for tiles\n *\n * Features:\n * - True masonry layout with absolute positioning\n * - Places largest tiles first, fills vertical gaps\n * - Staggered entrance animations\n * - Glassmorphic empty state with proper light/dark mode support\n * - Generic item type support\n */\nimport React from \"react\";\nimport { motion, AnimatePresence } from \"motion/react\";\nimport { Sparkles } from \"lucide-react\";\nimport { cn } from \"../../../lib/utils\";\nimport { Tile } from \"./Tile\";\nimport { calculateMosaicLayout } from \"./layout\";\nimport { crispEase } from \"./animations\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Base item type that TileGrid can work with.\n * Items must have at minimum an id, label, and count.\n * Optional properties match the Tile component's props.\n */\nexport interface BaseTileItem {\n id: string;\n label: string;\n count: number;\n /** Optional subtitle (e.g., file path) shown above label */\n subtitle?: string;\n /** Tile type for visual differentiation (gradient color) */\n tileType?: \"rule\" | \"file\";\n severityCounts?: { error: number; warning: number; info: number };\n /** Number of files (for \"X issues in Y files\" display) */\n fileCount?: number;\n /** Optional metadata for additional tile information */\n metadata?: Record<string, unknown>;\n}\n\nexport interface TileGridProps<T extends BaseTileItem> {\n items: T[];\n onTileClick: (item: T) => void;\n onOpenInInspector?: (item: T) => void;\n selectedIndex: number;\n isTerminal?: boolean;\n /** Override the available width for layout (default: 532) */\n availableWidth?: number;\n /** Override padding (default: { top: 20, right: 24, bottom: 20, left: 24 }) */\n padding?: { top: number; right: number; bottom: number; left: number };\n}\n\n// ============================================================================\n// Constants\n// ============================================================================\n\n/**\n * Command palette width: 580px\n * Grid padding: 24px on each side\n * Available width for tiles: 580 - 48 = 532px\n */\nconst GRID_PADDING = { top: 20, right: 24, bottom: 20, left: 24 };\nconst GRID_AVAILABLE_WIDTH = 532;\nconst GRID_GAP = 14;\n\n// ============================================================================\n// Sub-components\n// ============================================================================\n\n/**\n * EmptyState - Minimal placeholder when no tiles to display\n */\nfunction EmptyState() {\n return (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ duration: 0.2 }}\n className={cn(\n \"flex flex-col items-center justify-center\",\n \"py-16 px-8 text-center\"\n )}\n >\n <div className=\"mb-4 opacity-30\">\n <Sparkles size={28} strokeWidth={1.5} />\n </div>\n <div className=\"text-sm font-normal text-foreground/60 mb-1\">\n No items to display\n </div>\n <div className=\"text-xs text-muted-foreground/70\">\n Try adjusting your filters or search query\n </div>\n </motion.div>\n );\n}\n\n// ============================================================================\n// Main Component\n// ============================================================================\n\nexport function TileGrid<T extends BaseTileItem>({\n items,\n onTileClick,\n onOpenInInspector,\n selectedIndex,\n availableWidth = GRID_AVAILABLE_WIDTH,\n padding = GRID_PADDING,\n}: TileGridProps<T>) {\n // Handle empty state early (no hooks needed)\n if (items.length === 0) {\n return <EmptyState />;\n }\n\n // Single memoized computation for layout, sorted items, and index map\n const { layout, sortedItems, itemIndexMap } = React.useMemo(() => {\n const computedLayout = calculateMosaicLayout(items, {\n availableWidth,\n gap: GRID_GAP,\n padding,\n });\n\n // Sort items by y position for proper stagger animation\n const sorted = [...items].sort((a, b) => {\n const layoutA = computedLayout.tiles.get(a.id);\n const layoutB = computedLayout.tiles.get(b.id);\n const yDiff = (layoutA?.y ?? 0) - (layoutB?.y ?? 0);\n if (Math.abs(yDiff) > 10) return yDiff;\n return (layoutA?.x ?? 0) - (layoutB?.x ?? 0);\n });\n\n // Build index lookup for selection\n const indexMap = new Map<string, number>();\n sorted.forEach((item, index) => indexMap.set(item.id, index));\n\n return { layout: computedLayout, sortedItems: sorted, itemIndexMap: indexMap };\n }, [items, availableWidth, padding]);\n\n return (\n <div\n className=\"relative\"\n style={{\n height: layout.totalHeight,\n minHeight: 200,\n }}\n >\n <AnimatePresence mode=\"popLayout\">\n {sortedItems.map((item, animIndex) => {\n const tileLayout = layout.tiles.get(item.id);\n if (!tileLayout) return null;\n\n const globalIndex = itemIndexMap.get(item.id) ?? animIndex;\n\n return (\n <motion.div\n key={item.id}\n initial={{ opacity: 0, scale: 0.9 }}\n animate={{ opacity: 1, scale: 1 }}\n exit={{ opacity: 0, scale: 0.95 }}\n transition={{\n duration: 0.2,\n ease: crispEase,\n delay: Math.min(animIndex * 0.03, 0.2),\n }}\n className=\"absolute\"\n style={{\n left: tileLayout.x,\n top: tileLayout.y,\n width: tileLayout.width,\n height: tileLayout.height,\n }}\n >\n <Tile\n id={item.id}\n label={item.label}\n subtitle={item.subtitle}\n tileType={item.tileType ?? (item.metadata?.tileType as \"rule\" | \"file\" | undefined)}\n count={item.count}\n fileCount={item.fileCount}\n bucket={tileLayout.bucket}\n isSelected={globalIndex === selectedIndex}\n onClick={() => onTileClick(item)}\n onOpenInInspector={onOpenInInspector ? () => onOpenInInspector(item) : undefined}\n />\n </motion.div>\n );\n })}\n </AnimatePresence>\n </div>\n );\n}\n","/**\n * OnboardingState - Setup instructions when UILint server is not connected\n *\n * Shows clear, simple instructions for how to start the UILint server using npx.\n * Focused on getting users up and running quickly.\n */\nimport React, { useState, useCallback } from \"react\";\nimport { motion } from \"motion/react\";\nimport { Terminal, Copy, Check, RefreshCw } from \"lucide-react\";\nimport { useComposedStore } from \"../../../core/store\";\nimport { cn } from \"../../../lib/utils\";\n\n// Crisp easing curve matching the design system\nconst crispEase = [0.32, 0.72, 0, 1] as const;\n\ntype OnboardingVariant = \"disconnected\" | \"manifest-error\";\n\ninterface OnboardingStateProps {\n variant: OnboardingVariant;\n}\n\n/**\n * Copy button with feedback\n */\nfunction CopyButton({ text }: { text: string }) {\n const [copied, setCopied] = useState(false);\n\n const handleCopy = useCallback(async () => {\n try {\n await navigator.clipboard.writeText(text);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n } catch {\n // Fallback for older browsers\n const textarea = document.createElement(\"textarea\");\n textarea.value = text;\n document.body.appendChild(textarea);\n textarea.select();\n document.execCommand(\"copy\");\n document.body.removeChild(textarea);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n }\n }, [text]);\n\n return (\n <motion.button\n onClick={handleCopy}\n whileHover={{ scale: 1.05 }}\n whileTap={{ scale: 0.95 }}\n className={cn(\n \"px-2 py-1.5 border-none rounded-md cursor-pointer flex items-center justify-center transition-colors duration-200\",\n copied ? \"bg-success text-white\" : \"bg-[rgba(128,128,128,0.15)] text-text-secondary\"\n )}\n title={copied ? \"Copied!\" : \"Copy to clipboard\"}\n >\n {copied ? <Check size={14} /> : <Copy size={14} />}\n </motion.button>\n );\n}\n\n/**\n * Command box with copy functionality\n */\nfunction CommandBox({ command }: { command: string }) {\n return (\n <motion.div\n initial={{ opacity: 0, y: 4 }}\n animate={{ opacity: 1, y: 0 }}\n transition={{ delay: 0.2, duration: 0.2, ease: crispEase }}\n className=\"flex items-center gap-2 px-3.5 py-3 bg-surface-elevated rounded-[10px] border border-border mt-5\"\n >\n <Terminal size={15} className=\"text-text-muted shrink-0\" />\n <code className=\"flex-1 text-sm font-mono text-text-primary tracking-tight font-medium\">\n {command}\n </code>\n <CopyButton text={command} />\n </motion.div>\n );\n}\n\n/**\n * Retry button - simple secondary style\n */\nfunction RetryButton({ onClick }: { onClick: () => void }) {\n return (\n <motion.button\n onClick={onClick}\n whileHover={{ scale: 1.02 }}\n whileTap={{ scale: 0.98 }}\n initial={{ opacity: 0, y: 4 }}\n animate={{ opacity: 1, y: 0 }}\n transition={{ delay: 0.3, duration: 0.2, ease: crispEase }}\n className=\"mt-4 px-5 py-2.5 text-[13px] font-medium text-text-secondary bg-transparent border border-border rounded-[10px] cursor-pointer flex items-center gap-2\"\n >\n <RefreshCw size={14} />\n Try again\n </motion.button>\n );\n}\n\n/**\n * OnboardingState - Main component\n *\n * Simple, focused onboarding that shows users how to get started.\n */\nexport function OnboardingState({ variant }: OnboardingStateProps) {\n const retryConnection = useComposedStore((s) => s.retryConnection);\n const connectionStatus = useComposedStore((s) => s.connectionStatus);\n\n const content = React.useMemo(() => {\n switch (variant) {\n case \"disconnected\":\n return {\n title: \"Get started with UILint\",\n subtitle: \"Run this command in your project directory:\",\n command: \"npx uilint serve\",\n showRetry: connectionStatus.mode === \"websocket\",\n };\n case \"manifest-error\":\n return {\n title: \"Build lint manifest\",\n subtitle: \"Generate a lint report for your project:\",\n command: \"npx uilint build\",\n showRetry: false,\n };\n }\n }, [variant, connectionStatus.mode]);\n\n return (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.2, ease: crispEase }}\n className=\"flex flex-col items-center justify-center px-8 py-12 text-center min-h-[260px]\"\n >\n <motion.h3\n initial={{ opacity: 0, y: 8 }}\n animate={{ opacity: 1, y: 0 }}\n transition={{ delay: 0.05, duration: 0.2, ease: crispEase }}\n className=\"m-0 text-base font-semibold text-text-primary tracking-tight\"\n >\n {content.title}\n </motion.h3>\n\n <motion.p\n initial={{ opacity: 0, y: 6 }}\n animate={{ opacity: 1, y: 0 }}\n transition={{ delay: 0.1, duration: 0.2, ease: crispEase }}\n className=\"mt-2.5 mb-0 mx-0 text-sm text-text-muted leading-normal max-w-[320px]\"\n >\n {content.subtitle}\n </motion.p>\n\n <CommandBox command={content.command} />\n\n {content.showRetry && <RetryButton onClick={retryConnection} />}\n </motion.div>\n );\n}\n\nexport default OnboardingState;\n","/**\n * RuleToggleBar - Row of toggle buttons for quickly enabling/disabling rules\n *\n * Features:\n * - Horizontal scrollable row of rule toggle buttons\n * - Visual indication for enabled/disabled state\n * - Issue count badge for each rule\n * - Click to toggle rule visibility\n */\nimport React from \"react\";\nimport { motion, AnimatePresence } from \"motion/react\";\nimport { cn } from \"../../../lib/utils\";\nimport { useComposedStore } from \"../../../core/store\";\nimport type { AvailableRule } from \"../../../plugins/eslint/types\";\nimport type { ESLintPluginSlice } from \"../../../plugins/eslint/slice\";\nimport type { Issue } from \"../../types\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\ninterface RuleToggleButtonProps {\n rule: AvailableRule;\n isEnabled: boolean;\n issueCount: number;\n onClick: () => void;\n}\n\n// ============================================================================\n// Sub-components\n// ============================================================================\n\n/**\n * Individual rule toggle button\n */\nfunction RuleToggleButton({ rule, isEnabled, issueCount, onClick }: RuleToggleButtonProps) {\n // Get a short display name (remove plugin prefix like \"uilint/\")\n const displayName = rule.name || rule.id.replace(/^[^/]+\\//, \"\");\n\n return (\n <motion.button\n type=\"button\"\n onClick={onClick}\n whileHover={{ scale: 1.02 }}\n whileTap={{ scale: 0.98 }}\n transition={{ duration: 0.1 }}\n className={cn(\n \"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg\",\n \"text-xs font-medium whitespace-nowrap\",\n \"transition-all duration-150\",\n \"border\",\n isEnabled\n ? [\n \"bg-foreground/[0.06] border-foreground/[0.08]\",\n \"text-foreground/90\",\n \"hover:bg-foreground/[0.08] hover:border-foreground/[0.12]\",\n ]\n : [\n \"bg-transparent border-foreground/[0.04]\",\n \"text-foreground/40\",\n \"hover:bg-foreground/[0.02] hover:text-foreground/50\",\n ]\n )}\n title={isEnabled ? `Hide ${displayName} issues` : `Show ${displayName} issues`}\n >\n <span className={cn(!isEnabled && \"line-through decoration-foreground/30\")}>\n {displayName}\n </span>\n {issueCount > 0 && (\n <span\n className={cn(\n \"min-w-[18px] h-[18px] px-1 rounded-full\",\n \"text-[10px] font-semibold\",\n \"flex items-center justify-center\",\n isEnabled\n ? \"bg-foreground/[0.08] text-foreground/70\"\n : \"bg-foreground/[0.04] text-foreground/30\"\n )}\n >\n {issueCount}\n </span>\n )}\n </motion.button>\n );\n}\n\n// ============================================================================\n// Main Component\n// ============================================================================\n\nexport function RuleToggleBar() {\n // Get eslint plugin state\n const eslintSlice = useComposedStore((s) => s.plugins.eslint) as ESLintPluginSlice | undefined;\n\n // Get available rules and disabled rules set\n const availableRules = eslintSlice?.availableRules ?? [];\n const disabledRules = eslintSlice?.disabledRules ?? new Set<string>();\n const toggleRule = eslintSlice?.toggleRule;\n\n // Get issues to calculate counts per rule\n const issuesMap = eslintSlice?.issues ?? new Map<string, Issue[]>();\n\n // Calculate issue counts by rule\n const issueCountsByRule = React.useMemo(() => {\n const counts = new Map<string, number>();\n\n for (const issues of issuesMap.values()) {\n for (const issue of issues) {\n if (issue.ruleId) {\n counts.set(issue.ruleId, (counts.get(issue.ruleId) ?? 0) + 1);\n }\n }\n }\n\n return counts;\n }, [issuesMap]);\n\n // Don't render if no rules or toggle function\n if (!toggleRule || availableRules.length === 0) {\n return null;\n }\n\n const handleToggle = (ruleId: string) => {\n toggleRule(ruleId);\n };\n\n return (\n <div className=\"px-4 py-2 border-b border-foreground/[0.04]\">\n <div className=\"flex items-center gap-1.5 overflow-x-auto scrollbar-none\">\n <AnimatePresence mode=\"popLayout\">\n {availableRules.map((rule) => {\n const isEnabled = !disabledRules.has(rule.id);\n const issueCount = issueCountsByRule.get(rule.id) ?? 0;\n\n return (\n <motion.div\n key={rule.id}\n initial={{ opacity: 0, scale: 0.9 }}\n animate={{ opacity: 1, scale: 1 }}\n exit={{ opacity: 0, scale: 0.9 }}\n transition={{ duration: 0.15 }}\n >\n <RuleToggleButton\n rule={rule}\n isEnabled={isEnabled}\n issueCount={issueCount}\n onClick={() => handleToggle(rule.id)}\n />\n </motion.div>\n );\n })}\n </AnimatePresence>\n </div>\n </div>\n );\n}\n\nexport default RuleToggleBar;\n","/**\n * CommandPalette - Elegant command interface inspired by Spotlight & Raycast\n *\n * REDESIGNED: Flat tile interface showing all rules and files together.\n * Single click on any tile opens the inspector with that context.\n *\n * Features:\n * - Hero search input with glassmorphic styling\n * - Flat tile grid showing rules + files sorted by issue count\n * - Search filters tiles by underlying issues\n * - Single click opens inspector\n *\n * Visual design:\n * - Minimal colors, visual hierarchy through opacity/weight\n * - Glassmorphic container with backdrop blur\n * - Staggered animations with crisp easing\n * - shadcn class conventions\n */\n\nimport React, { useCallback } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { AnimatePresence, motion } from \"motion/react\";\nimport { devError } from \"uilint-core\";\nimport { cn } from \"../../../lib/utils\";\nimport { useComposedStore, getPluginServices } from \"../../../core/store\";\nimport { useTileItems, useTileNavigation } from \"../../hooks\";\nimport { SearchInput } from \"./SearchInput\";\nimport { TileGrid } from \"../HierarchicalTiles/TileGrid\";\nimport { OnboardingState } from \"./OnboardingState\";\nimport { RuleToggleBar } from \"./RuleToggleBar\";\nimport { GlassPanel } from \"../primitives\";\nimport type { TileItem } from \"../../../core/plugin-system/types\";\nimport type { ScanStatus } from \"../../../plugins/eslint/slice\";\n\n// Crisp easing for panel motion\nconst panelTransition = {\n duration: 0.12,\n ease: [0.32, 0.72, 0, 1] as const,\n};\n\nexport function CommandPalette() {\n const isOpen = useComposedStore((s) => s.commandPalette.open);\n const query = useComposedStore((s) => s.commandPalette.query);\n const closeCommandPalette = useComposedStore((s) => s.closeCommandPalette);\n const setQuery = useComposedStore((s) => s.setCommandPaletteQuery);\n const openInspectorPanel = useComposedStore((s) => s.openInspectorPanel);\n const expandRule = useComposedStore((s) => s.expandRule);\n const expandFileInRule = useComposedStore((s) => s.expandFileInRule);\n\n // Mobile detection from store\n const isMobile = useComposedStore((s) => s.mobile.isMobile);\n\n // Connection status for onboarding\n const wsConnected = useComposedStore((s) => s.wsConnected);\n const connectionStatus = useComposedStore((s) => s.connectionStatus);\n const scanStatus = useComposedStore(\n (s) =>\n (s.plugins?.eslint as { scanStatus?: ScanStatus } | undefined)?.scanStatus\n );\n\n // Determine if we should show onboarding state\n const showOnboarding = React.useMemo(() => {\n // In websocket mode, show onboarding if not connected\n if (connectionStatus.mode === \"websocket\" && !wsConnected) {\n return true;\n }\n // In static mode, show onboarding if scan status is error\n if (connectionStatus.mode === \"static\" && scanStatus === \"error\") {\n return true;\n }\n return false;\n }, [connectionStatus.mode, wsConnected, scanStatus]);\n\n // Determine onboarding variant\n const onboardingVariant = React.useMemo(() => {\n if (connectionStatus.mode === \"static\" && scanStatus === \"error\") {\n return \"manifest-error\" as const;\n }\n return \"disconnected\" as const;\n }, [connectionStatus.mode, scanStatus]);\n\n // Get tile items using the hook (flat list of rules + files)\n const { items: tileItems, isLoading } = useTileItems(query);\n\n // Handle tile click - opens inspector with appropriate context\n const handleTileClick = useCallback(\n async (item: TileItem) => {\n const services = getPluginServices();\n if (!services) {\n devError(\"[CommandPalette] Plugin services not available\");\n return;\n }\n\n // Check if item has an execute function in metadata (commands)\n const execute = item.metadata?.execute as\n | ((services: unknown) => Promise<void>)\n | undefined;\n if (execute) {\n try {\n await execute(services);\n } catch (error) {\n devError(\n `[CommandPalette] Error executing tile item \"${item.id}\":`,\n error\n );\n }\n closeCommandPalette();\n return;\n }\n\n // Open inspector with context based on tile type\n const tileType = item.metadata?.tileType as string | undefined;\n\n if (tileType === \"rule\") {\n // Rule tile: expand the rule in inspector\n const ruleId = item.metadata?.ruleId as string;\n if (ruleId) {\n expandRule(ruleId);\n }\n } else if (tileType === \"file\") {\n // File tile: expand to show the file in inspector\n // For global file tiles, we just open the inspector (file will be shown in the default view)\n const filePath = item.metadata?.filePath as string;\n if (filePath) {\n // If there's a ruleId, expand that rule and then the file\n const ruleId = item.metadata?.ruleId as string | undefined;\n if (ruleId) {\n expandRule(ruleId);\n expandFileInRule(filePath);\n }\n // For global file tiles (no ruleId), just open inspector\n // The IssuesList will show all issues for that file\n }\n }\n\n openInspectorPanel();\n closeCommandPalette();\n },\n [closeCommandPalette, openInspectorPanel, expandRule, expandFileInRule]\n );\n\n // Use tile navigation for 2D keyboard navigation\n const { selectedIndex, handleKeyDown: tileHandleKeyDown } = useTileNavigation(\n tileItems,\n 3, // columns\n handleTileClick,\n () => {} // No back navigation needed in flat mode\n );\n\n // Keyboard handler for tile navigation\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n // Delegate to tile navigation for Up/Down/Left/Right/Enter/etc.\n tileHandleKeyDown(e);\n },\n [tileHandleKeyDown]\n );\n\n const portalRoot = document.getElementById(\"uilint-portal\") || document.body;\n\n return createPortal(\n <AnimatePresence>\n {isOpen && (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.12 }}\n className={cn(\n \"fixed inset-0 flex justify-center z-[99998] pointer-events-auto\",\n isMobile\n ? \"items-stretch bg-surface pt-0\"\n : \"items-start bg-transparent pt-[100px]\"\n )}\n onClick={(e) => {\n if (e.target === e.currentTarget) closeCommandPalette();\n }}\n onKeyDown={handleKeyDown}\n >\n <motion.div\n initial={\n isMobile ? { opacity: 0 } : { opacity: 0, scale: 0.96, y: -20 }\n }\n animate={isMobile ? { opacity: 1 } : { opacity: 1, scale: 1, y: 0 }}\n exit={\n isMobile ? { opacity: 0 } : { opacity: 0, scale: 0.98, y: -10 }\n }\n transition={isMobile ? { duration: 0.15 } : panelTransition}\n className={isMobile ? \"flex flex-col w-full h-full\" : undefined}\n >\n <GlassPanel\n blur={isMobile ? \"light\" : \"heavy\"}\n shadow={isMobile ? undefined : \"lg\"}\n animate={false}\n className={cn(\n \"overflow-hidden\",\n isMobile\n ? \"w-full h-full flex flex-col rounded-none pt-[env(safe-area-inset-top,0px)] pb-[env(safe-area-inset-bottom,0px)]\"\n : \"w-[580px] h-auto block rounded-[20px]\"\n )}\n >\n {/* Mobile Header with Close Button */}\n {isMobile && (\n <div className=\"flex items-center justify-between px-4 pt-3 pb-2 border-b border-border\">\n <span className=\"text-[15px] font-semibold text-text-primary\">\n Search\n </span>\n <button\n onClick={closeCommandPalette}\n className=\"px-4 py-2 text-sm font-medium text-accent bg-transparent border-none cursor-pointer rounded-lg\"\n >\n Done\n </button>\n </div>\n )}\n\n {/* Hero Search Input */}\n <SearchInput\n value={query}\n onChange={setQuery}\n size={isMobile ? \"default\" : \"large\"}\n />\n\n {/* Rule Toggle Bar - quick toggles for filtering rules */}\n {!showOnboarding && <RuleToggleBar />}\n\n {/* Content Area: Tile Grid or Onboarding */}\n <div\n className={cn(\n \"min-h-0 overflow-y-auto overflow-x-hidden\",\n \"[-webkit-overflow-scrolling:touch]\",\n isMobile ? \"flex-1 max-h-none\" : \"max-h-[440px]\"\n )}\n >\n <AnimatePresence mode={isMobile ? \"sync\" : \"wait\"}>\n {/* Onboarding state - show when not connected */}\n {showOnboarding ? (\n <motion.div\n key=\"onboarding\"\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.15 }}\n >\n <OnboardingState variant={onboardingVariant} />\n </motion.div>\n ) : isLoading ? (\n /* Loading state */\n <motion.div\n key=\"loading\"\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.15 }}\n className=\"py-12 px-6 flex flex-col items-center justify-center\"\n >\n <motion.div\n animate={{ rotate: 360 }}\n transition={{\n duration: 1,\n repeat: Infinity,\n ease: \"linear\",\n }}\n className=\"w-6 h-6 rounded-full border-2 border-border border-t-accent\"\n />\n <div className=\"mt-3 text-[13px] text-text-muted\">\n Loading...\n </div>\n </motion.div>\n ) : (\n /* Flat Tile Grid - rules + files together */\n <motion.div\n key=\"tiles\"\n initial={isMobile ? false : { opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={isMobile ? undefined : { opacity: 0 }}\n transition={{ duration: isMobile ? 0 : 0.1 }}\n >\n <TileGrid\n items={tileItems}\n onTileClick={handleTileClick}\n selectedIndex={selectedIndex}\n />\n </motion.div>\n )}\n </AnimatePresence>\n </div>\n </GlassPanel>\n </motion.div>\n </motion.div>\n )}\n </AnimatePresence>,\n portalRoot\n );\n}\n","/**\n * OptionField - Dynamic form field renderer for rule options\n *\n * Renders appropriate input based on OptionFieldSchema type:\n * - text: Text input\n * - number: Number input with validation\n * - boolean: Toggle button group\n * - select: Dropdown selector\n * - multiselect: Multi-select with pills\n * - array: Comma-separated text input\n *\n * Uses glassmorphism styling consistent with the design system.\n */\nimport React, { useCallback, useState, useRef, useEffect } from \"react\";\nimport { motion, AnimatePresence } from \"motion/react\";\nimport { cn } from \"../../../lib/utils\";\nimport type { OptionFieldSchema } from \"../../../plugins/eslint/types\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface OptionFieldProps {\n /** Field schema defining type, label, etc. */\n schema: OptionFieldSchema;\n /** Current field value */\n value: unknown;\n /** Called when value changes */\n onChange: (key: string, value: unknown) => void;\n /** Whether field is disabled */\n disabled?: boolean;\n /** Additional class name */\n className?: string;\n}\n\n// ============================================================================\n// Shared Styles\n// ============================================================================\n\nconst labelStyles = \"block text-xs text-muted-foreground/70 uppercase tracking-wider mb-1.5\";\n\nconst inputBaseStyles = cn(\n \"w-full px-3 py-2 text-sm rounded-md\",\n \"bg-foreground/[0.02] border border-foreground/[0.06]\",\n \"text-foreground placeholder:text-muted-foreground/40\",\n \"focus:outline-none focus:border-foreground/[0.12]\",\n \"transition-colors duration-100\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\"\n);\n\nconst descriptionStyles = \"text-xs text-muted-foreground/50 mt-1.5\";\n\n// ============================================================================\n// Text Field\n// ============================================================================\n\nfunction TextField({\n schema,\n value,\n onChange,\n disabled,\n}: Omit<OptionFieldProps, \"className\">) {\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange(schema.key, e.target.value);\n },\n [schema.key, onChange]\n );\n\n return (\n <input\n type=\"text\"\n value={(value as string) ?? \"\"}\n onChange={handleChange}\n placeholder={schema.placeholder}\n disabled={disabled}\n className={inputBaseStyles}\n />\n );\n}\n\n// ============================================================================\n// Number Field\n// ============================================================================\n\nfunction NumberField({\n schema,\n value,\n onChange,\n disabled,\n}: Omit<OptionFieldProps, \"className\">) {\n const [localValue, setLocalValue] = useState<string>(\n value !== undefined && value !== null ? String(value) : \"\"\n );\n const [isValid, setIsValid] = useState(true);\n\n // Sync local value when external value changes\n useEffect(() => {\n const newValue = value !== undefined && value !== null ? String(value) : \"\";\n setLocalValue(newValue);\n }, [value]);\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value;\n setLocalValue(inputValue);\n\n // Allow empty input\n if (inputValue === \"\" || inputValue === \"-\") {\n setIsValid(true);\n return;\n }\n\n const numValue = parseFloat(inputValue);\n if (!isNaN(numValue)) {\n setIsValid(true);\n onChange(schema.key, numValue);\n } else {\n setIsValid(false);\n }\n },\n [schema.key, onChange]\n );\n\n const handleBlur = useCallback(() => {\n // On blur, if empty, reset to default\n if (localValue === \"\" || localValue === \"-\") {\n const defaultVal = schema.defaultValue as number;\n setLocalValue(String(defaultVal));\n onChange(schema.key, defaultVal);\n }\n }, [localValue, schema.key, schema.defaultValue, onChange]);\n\n return (\n <input\n type=\"text\"\n inputMode=\"numeric\"\n value={localValue}\n onChange={handleChange}\n onBlur={handleBlur}\n placeholder={schema.placeholder ?? String(schema.defaultValue)}\n disabled={disabled}\n className={cn(\n inputBaseStyles,\n !isValid && \"border-error/50 focus:border-error\"\n )}\n />\n );\n}\n\n// ============================================================================\n// Boolean Field (Toggle)\n// ============================================================================\n\nfunction BooleanField({\n schema,\n value,\n onChange,\n disabled,\n}: Omit<OptionFieldProps, \"className\">) {\n const isEnabled = Boolean(value);\n\n const handleToggle = useCallback(\n (newValue: boolean) => {\n if (!disabled) {\n onChange(schema.key, newValue);\n }\n },\n [schema.key, onChange, disabled]\n );\n\n return (\n <div className=\"flex items-center gap-1 p-1 bg-foreground/[0.02] rounded-lg border border-foreground/[0.04]\">\n <button\n type=\"button\"\n onClick={() => handleToggle(false)}\n disabled={disabled}\n className={cn(\n \"flex items-center gap-2 px-3 py-1.5 rounded-md\",\n \"text-sm transition-colors duration-100\",\n !isEnabled\n ? \"bg-foreground/[0.08] text-foreground\"\n : \"text-foreground/60 hover:bg-foreground/[0.04] hover:text-foreground/80\",\n disabled && \"cursor-not-allowed opacity-50\"\n )}\n >\n <div\n className={cn(\n \"w-2 h-2 rounded-full\",\n !isEnabled ? \"bg-muted-foreground/50\" : \"bg-muted-foreground/20\"\n )}\n />\n <span>Off</span>\n </button>\n <button\n type=\"button\"\n onClick={() => handleToggle(true)}\n disabled={disabled}\n className={cn(\n \"flex items-center gap-2 px-3 py-1.5 rounded-md\",\n \"text-sm transition-colors duration-100\",\n isEnabled\n ? \"bg-foreground/[0.08] text-foreground\"\n : \"text-foreground/60 hover:bg-foreground/[0.04] hover:text-foreground/80\",\n disabled && \"cursor-not-allowed opacity-50\"\n )}\n >\n <div\n className={cn(\n \"w-2 h-2 rounded-full\",\n isEnabled ? \"bg-success/70\" : \"bg-success/20\"\n )}\n />\n <span>On</span>\n </button>\n </div>\n );\n}\n\n// ============================================================================\n// Select Field\n// ============================================================================\n\nfunction SelectField({\n schema,\n value,\n onChange,\n disabled,\n}: Omit<OptionFieldProps, \"className\">) {\n const [isOpen, setIsOpen] = useState(false);\n const containerRef = useRef<HTMLDivElement>(null);\n\n // Close dropdown when clicking outside\n useEffect(() => {\n function handleClickOutside(e: MouseEvent) {\n if (containerRef.current && !containerRef.current.contains(e.target as Node)) {\n setIsOpen(false);\n }\n }\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => document.removeEventListener(\"mousedown\", handleClickOutside);\n }, []);\n\n const options = schema.options ?? [];\n const selectedOption = options.find((opt) => opt.value === value);\n\n const handleSelect = useCallback(\n (optValue: string | number) => {\n onChange(schema.key, optValue);\n setIsOpen(false);\n },\n [schema.key, onChange]\n );\n\n return (\n <div ref={containerRef} className=\"relative\">\n <button\n type=\"button\"\n onClick={() => !disabled && setIsOpen(!isOpen)}\n disabled={disabled}\n className={cn(\n inputBaseStyles,\n \"flex items-center justify-between text-left\",\n disabled && \"cursor-not-allowed\"\n )}\n >\n <span className={!selectedOption ? \"text-muted-foreground/40\" : \"\"}>\n {selectedOption?.label ?? schema.placeholder ?? \"Select...\"}\n </span>\n <svg\n className={cn(\n \"w-4 h-4 text-muted-foreground/50 transition-transform duration-150\",\n isOpen && \"rotate-180\"\n )}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M19 9l-7 7-7-7\" />\n </svg>\n </button>\n\n <AnimatePresence>\n {isOpen && (\n <motion.div\n initial={{ opacity: 0, y: -4 }}\n animate={{ opacity: 1, y: 0 }}\n exit={{ opacity: 0, y: -4 }}\n transition={{ duration: 0.15 }}\n className={cn(\n \"absolute z-50 w-full mt-1 py-1 rounded-md\",\n \"bg-background/95 backdrop-blur-sm\",\n \"border border-foreground/[0.08]\",\n \"shadow-lg\"\n )}\n >\n {options.map((option) => (\n <button\n key={option.value}\n type=\"button\"\n onClick={() => handleSelect(option.value)}\n className={cn(\n \"w-full px-3 py-2 text-sm text-left\",\n \"transition-colors duration-75\",\n option.value === value\n ? \"bg-foreground/[0.06] text-foreground\"\n : \"text-foreground/80 hover:bg-foreground/[0.04]\"\n )}\n >\n {option.label}\n </button>\n ))}\n </motion.div>\n )}\n </AnimatePresence>\n </div>\n );\n}\n\n// ============================================================================\n// Multiselect Field\n// ============================================================================\n\nfunction MultiselectField({\n schema,\n value,\n onChange,\n disabled,\n}: Omit<OptionFieldProps, \"className\">) {\n const selectedValues = Array.isArray(value) ? (value as (string | number)[]) : [];\n const options = schema.options ?? [];\n\n const handleToggle = useCallback(\n (optValue: string | number) => {\n if (disabled) return;\n\n const newValues = selectedValues.includes(optValue)\n ? selectedValues.filter((v) => v !== optValue)\n : [...selectedValues, optValue];\n onChange(schema.key, newValues);\n },\n [schema.key, selectedValues, onChange, disabled]\n );\n\n return (\n <div className=\"flex flex-wrap gap-1.5\">\n {options.map((option) => {\n const isSelected = selectedValues.includes(option.value);\n return (\n <button\n key={option.value}\n type=\"button\"\n onClick={() => handleToggle(option.value)}\n disabled={disabled}\n className={cn(\n \"px-2.5 py-1 text-xs rounded-md\",\n \"transition-colors duration-100\",\n \"border\",\n isSelected\n ? \"bg-foreground/[0.08] border-foreground/[0.12] text-foreground\"\n : \"bg-foreground/[0.02] border-foreground/[0.04] text-foreground/60 hover:text-foreground/80 hover:bg-foreground/[0.04]\",\n disabled && \"cursor-not-allowed opacity-50\"\n )}\n >\n {option.label}\n </button>\n );\n })}\n </div>\n );\n}\n\n// ============================================================================\n// Array Field (comma-separated)\n// ============================================================================\n\nfunction ArrayField({\n schema,\n value,\n onChange,\n disabled,\n}: Omit<OptionFieldProps, \"className\">) {\n // Convert array to comma-separated string for display\n const arrayValue = Array.isArray(value) ? value : [];\n const stringValue = arrayValue.join(\", \");\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value;\n // Parse comma-separated values, trim whitespace\n const newArray = inputValue\n .split(\",\")\n .map((s) => s.trim())\n .filter((s) => s.length > 0);\n onChange(schema.key, newArray);\n },\n [schema.key, onChange]\n );\n\n return (\n <input\n type=\"text\"\n value={stringValue}\n onChange={handleChange}\n placeholder={schema.placeholder ?? \"value1, value2, value3\"}\n disabled={disabled}\n className={inputBaseStyles}\n />\n );\n}\n\n// ============================================================================\n// Main Component\n// ============================================================================\n\nexport function OptionField({\n schema,\n value,\n onChange,\n disabled = false,\n className,\n}: OptionFieldProps) {\n // Render appropriate field based on type\n const renderField = () => {\n switch (schema.type) {\n case \"text\":\n return <TextField schema={schema} value={value} onChange={onChange} disabled={disabled} />;\n case \"number\":\n return <NumberField schema={schema} value={value} onChange={onChange} disabled={disabled} />;\n case \"boolean\":\n return <BooleanField schema={schema} value={value} onChange={onChange} disabled={disabled} />;\n case \"select\":\n return <SelectField schema={schema} value={value} onChange={onChange} disabled={disabled} />;\n case \"multiselect\":\n return <MultiselectField schema={schema} value={value} onChange={onChange} disabled={disabled} />;\n case \"array\":\n return <ArrayField schema={schema} value={value} onChange={onChange} disabled={disabled} />;\n default:\n return <TextField schema={schema} value={value} onChange={onChange} disabled={disabled} />;\n }\n };\n\n return (\n <div className={cn(\"mb-4\", className)}>\n <label className={labelStyles}>{schema.label}</label>\n {renderField()}\n {schema.description && (\n <p className={descriptionStyles}>{schema.description}</p>\n )}\n </div>\n );\n}\n\nexport default OptionField;\n","/**\n * RuleOptionsForm - Container for rule option fields\n *\n * Maps over optionSchema.fields to render OptionField components.\n * Calls onChange immediately when any field changes (instant apply via WebSocket).\n *\n * Features:\n * - Dynamic field rendering based on schema\n * - Immediate change propagation\n * - Loading state during updates\n * - Reset to defaults functionality\n */\nimport React, { useCallback } from \"react\";\nimport { motion } from \"motion/react\";\nimport { cn } from \"../../../lib/utils\";\nimport { OptionField } from \"./OptionField\";\nimport type { RuleOptionSchema, OptionFieldSchema } from \"../../../plugins/eslint/types\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface RuleOptionsFormProps {\n /** Rule ID for context */\n ruleId: string;\n /** Option schema defining available fields */\n optionSchema: RuleOptionSchema;\n /** Current option values */\n currentOptions: Record<string, unknown>;\n /** Default option values for reset */\n defaultOptions: Record<string, unknown>;\n /** Called when any option changes - applies immediately */\n onOptionChange: (key: string, value: unknown) => void;\n /** Called to reset all options to defaults */\n onReset?: () => void;\n /** Whether an update is in progress */\n isUpdating?: boolean;\n /** Additional class name */\n className?: string;\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function RuleOptionsForm({\n optionSchema,\n currentOptions,\n defaultOptions,\n onOptionChange,\n onReset,\n isUpdating = false,\n className,\n}: RuleOptionsFormProps) {\n const fields = optionSchema?.fields ?? [];\n\n // Get value for a field, falling back to default\n const getFieldValue = useCallback(\n (field: OptionFieldSchema) => {\n const currentValue = currentOptions[field.key];\n if (currentValue !== undefined) {\n return currentValue;\n }\n // Fall back to default from schema\n return field.defaultValue;\n },\n [currentOptions]\n );\n\n // Check if current values differ from defaults\n const hasChanges = useCallback(() => {\n for (const field of fields) {\n const current = currentOptions[field.key];\n const defaultVal = defaultOptions[field.key] ?? field.defaultValue;\n\n // Handle array comparison\n if (Array.isArray(current) && Array.isArray(defaultVal)) {\n if (current.length !== defaultVal.length) return true;\n if (current.some((v, i) => v !== defaultVal[i])) return true;\n } else if (current !== defaultVal) {\n return true;\n }\n }\n return false;\n }, [fields, currentOptions, defaultOptions]);\n\n // No fields - show message\n if (fields.length === 0) {\n return (\n <div className={cn(\"text-xs text-muted-foreground/50 italic\", className)}>\n No additional options for this rule\n </div>\n );\n }\n\n return (\n <motion.div\n initial={{ opacity: 0, y: -4 }}\n animate={{ opacity: 1, y: 0 }}\n transition={{ duration: 0.15 }}\n className={cn(\"relative\", className)}\n >\n {/* Updating overlay */}\n {isUpdating && (\n <div className=\"absolute inset-0 bg-background/50 backdrop-blur-[1px] z-10 flex items-center justify-center rounded-md\">\n <span className=\"text-xs text-muted-foreground animate-pulse\">\n Updating...\n </span>\n </div>\n )}\n\n {/* Options header */}\n <div className=\"flex items-center justify-between mb-3\">\n <label className=\"text-xs text-muted-foreground/70 uppercase tracking-wider\">\n Options\n </label>\n {onReset && hasChanges() && (\n <button\n type=\"button\"\n onClick={onReset}\n disabled={isUpdating}\n className={cn(\n \"text-xs text-muted-foreground/60 hover:text-foreground/80\",\n \"transition-colors duration-100\",\n isUpdating && \"cursor-not-allowed opacity-50\"\n )}\n >\n Reset to defaults\n </button>\n )}\n </div>\n\n {/* Option fields */}\n <div className={cn(isUpdating && \"opacity-50 pointer-events-none\")}>\n {fields.map((field) => (\n <OptionField\n key={field.key}\n schema={field}\n value={getFieldValue(field)}\n onChange={onOptionChange}\n disabled={isUpdating}\n />\n ))}\n </div>\n </motion.div>\n );\n}\n\nexport default RuleOptionsForm;\n","/**\n * RuleConfig - Configuration panel for a rule (shown in popover)\n *\n * Displays:\n * - Severity selector (off/warn/error)\n * - Dynamic rule-specific options based on optionSchema\n *\n * Changes apply immediately via WebSocket to update ESLint config.\n * Glassmorphic styling with minimal color.\n */\nimport React from \"react\";\nimport { cn } from \"../../../lib/utils\";\nimport { RuleOptionsForm } from \"./RuleOptionsForm\";\nimport type { RuleOptionSchema } from \"../../../plugins/eslint/types\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport type RuleSeverity = \"off\" | \"warn\" | \"error\";\n\nexport interface RuleConfigProps {\n /** Rule ID */\n ruleId: string;\n /** Current severity setting */\n currentSeverity: RuleSeverity;\n /** Called when severity is changed */\n onSeverityChange: (severity: RuleSeverity) => void;\n /** Option schema for dynamic form fields */\n optionSchema?: RuleOptionSchema;\n /** Current option values */\n currentOptions?: Record<string, unknown>;\n /** Default option values for reset */\n defaultOptions?: Record<string, unknown>;\n /** Called when an option value changes - applies immediately */\n onOptionChange?: (key: string, value: unknown) => void;\n /** Called to reset options to defaults */\n onResetOptions?: () => void;\n /** Whether an update is in progress */\n isUpdating?: boolean;\n /** Additional class name */\n className?: string;\n}\n\n// ============================================================================\n// Sub-components\n// ============================================================================\n\ninterface SeverityButtonProps {\n severity: RuleSeverity;\n isSelected: boolean;\n onClick: () => void;\n label: string;\n}\n\nfunction SeverityButton({ severity, isSelected, onClick, label }: SeverityButtonProps) {\n const dotClass = {\n off: \"bg-muted-foreground/30\",\n warn: \"bg-warning/70\",\n error: \"bg-error/70\",\n }[severity];\n\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className={cn(\n \"flex items-center gap-2 px-3 py-2 rounded-md\",\n \"text-sm transition-colors duration-100\",\n isSelected\n ? \"bg-foreground/[0.08] text-foreground\"\n : \"text-foreground/60 hover:bg-foreground/[0.04] hover:text-foreground/80\"\n )}\n >\n <div className={cn(\"w-2 h-2 rounded-full\", dotClass)} />\n <span>{label}</span>\n </button>\n );\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function RuleConfig({\n ruleId,\n currentSeverity,\n onSeverityChange,\n optionSchema,\n currentOptions,\n defaultOptions,\n onOptionChange,\n onResetOptions,\n isUpdating = false,\n className,\n}: RuleConfigProps) {\n return (\n <div className={cn(\"px-3 py-3\", className)}>\n {/* Severity selector */}\n <div className=\"mb-4\">\n <label className=\"block text-xs text-muted-foreground/70 uppercase tracking-wider mb-2\">\n Severity\n </label>\n <div className=\"flex items-center gap-1 p-1 bg-foreground/[0.02] rounded-lg border border-foreground/[0.04]\">\n <SeverityButton\n severity=\"off\"\n isSelected={currentSeverity === \"off\"}\n onClick={() => onSeverityChange(\"off\")}\n label=\"Off\"\n />\n <SeverityButton\n severity=\"warn\"\n isSelected={currentSeverity === \"warn\"}\n onClick={() => onSeverityChange(\"warn\")}\n label=\"Warn\"\n />\n <SeverityButton\n severity=\"error\"\n isSelected={currentSeverity === \"error\"}\n onClick={() => onSeverityChange(\"error\")}\n label=\"Error\"\n />\n </div>\n </div>\n\n {/* Rule options form */}\n {optionSchema && optionSchema.fields && optionSchema.fields.length > 0 ? (\n <RuleOptionsForm\n ruleId={ruleId}\n optionSchema={optionSchema}\n currentOptions={currentOptions ?? {}}\n defaultOptions={defaultOptions ?? {}}\n onOptionChange={onOptionChange ?? (() => {})}\n onReset={onResetOptions}\n isUpdating={isUpdating}\n />\n ) : (\n <div className=\"text-xs text-muted-foreground/50 italic\">\n No additional options for this rule\n </div>\n )}\n </div>\n );\n}\n\nexport default RuleConfig;\n","/**\n * RuleHeader - Compact contextual rule info header for the inspector\n *\n * Shown when a rule filter is active. Displays:\n * - Severity indicator showing highest issue severity\n * - Rule name, category, and inline actions\n * - Description revealed on hover/focus for reduced visual weight\n * - Configure button opens a popover with rule settings\n *\n * Glassmorphic styling with minimal color\n */\nimport React, { useState, useCallback } from \"react\";\nimport { motion, AnimatePresence } from \"motion/react\";\nimport { cn } from \"../../../lib/utils\";\nimport { CloseIcon, ExternalLinkIcon, SettingsIcon, ErrorIcon, WarningIcon, InfoIcon } from \"../../icons\";\nimport { IconButton, Popover } from \"../primitives\";\nimport { RuleConfig } from \"./RuleConfig\";\nimport type { TileFilter } from \"../../../core/plugin-system/types\";\nimport type { RuleOptionSchema } from \"../../../plugins/eslint/types\";\nimport type { RuleSeverity } from \"./RuleConfig\";\nimport type { IssueSeverity } from \"../../types\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface RuleHeaderProps {\n /** The active rule filter */\n ruleFilter: TileFilter;\n /** Rule description (from available rules metadata) */\n description?: string;\n /** Rule category (e.g., \"Possible Errors\") */\n category?: string;\n /** URL to rule documentation */\n docsUrl?: string;\n /** Called to clear the rule filter */\n onClear: () => void;\n /** Whether to show the close button (default: true, set to false when inside expanded tile) */\n showCloseButton?: boolean;\n /** Highest severity among issues for this rule */\n highestSeverity?: IssueSeverity;\n /** Total issue count for this rule */\n issueCount?: number;\n /** Additional class name */\n className?: string;\n\n // Rule config props (for popover)\n /** Current severity setting for the rule */\n currentSeverity?: RuleSeverity;\n /** Called when severity is changed */\n onSeverityChange?: (severity: RuleSeverity) => void;\n /** Option schema for dynamic form fields */\n optionSchema?: RuleOptionSchema;\n /** Current option values */\n currentOptions?: Record<string, unknown>;\n /** Default option values for reset */\n defaultOptions?: Record<string, unknown>;\n /** Called when an option value changes */\n onOptionChange?: (key: string, value: unknown) => void;\n /** Called to reset options to defaults */\n onResetOptions?: () => void;\n /** Whether an update is in progress */\n isUpdating?: boolean;\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function RuleHeader({\n ruleFilter,\n description,\n category,\n docsUrl,\n onClear,\n showCloseButton = true,\n highestSeverity,\n issueCount,\n className,\n // Rule config props\n currentSeverity = \"warn\",\n onSeverityChange,\n optionSchema,\n currentOptions,\n defaultOptions,\n onOptionChange,\n onResetOptions,\n isUpdating,\n}: RuleHeaderProps) {\n const [showDescription, setShowDescription] = useState(false);\n const [configPopoverOpen, setConfigPopoverOpen] = useState(false);\n\n // Get namespace if present\n const namespace = ruleFilter.id.includes(\"/\")\n ? ruleFilter.id.split(\"/\")[0]\n : null;\n\n const handleSeverityChange = useCallback(\n (severity: RuleSeverity) => {\n onSeverityChange?.(severity);\n },\n [onSeverityChange]\n );\n\n const handleOptionChange = useCallback(\n (key: string, value: unknown) => {\n onOptionChange?.(key, value);\n },\n [onOptionChange]\n );\n\n // Check if config is available\n const hasConfig = onSeverityChange !== undefined;\n\n return (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.1 }}\n className={cn(\n \"bg-foreground/[0.01]\",\n \"border-b border-foreground/[0.04]\",\n className\n )}\n >\n {/* Compact header - single row with all controls */}\n <div className=\"px-3 py-2\">\n <div className=\"flex items-center gap-2\">\n {/* Severity indicator with count */}\n {highestSeverity && (\n <div\n className={cn(\n \"flex items-center gap-1.5 px-2 py-1 rounded-md\",\n highestSeverity === \"error\" && \"bg-error/10 text-error\",\n highestSeverity === \"warning\" && \"bg-warning/10 text-warning\",\n highestSeverity === \"info\" && \"bg-info/10 text-info\"\n )}\n >\n {highestSeverity === \"error\" && <ErrorIcon size={12} />}\n {highestSeverity === \"warning\" && <WarningIcon size={12} />}\n {highestSeverity === \"info\" && <InfoIcon size={12} />}\n {issueCount !== undefined && (\n <span className=\"text-[11px] font-medium tabular-nums\">\n {issueCount}\n </span>\n )}\n </div>\n )}\n\n {/* Category badge */}\n {(category || namespace) && (\n <span className=\"text-[10px] text-muted-foreground/50 uppercase tracking-wider flex-shrink-0\">\n {namespace || category}\n </span>\n )}\n\n {/* Spacer */}\n <div className=\"flex-1\" />\n\n {/* Inline actions */}\n <div className=\"flex items-center gap-1\">\n {/* Info toggle - reveals description */}\n {description && (\n <button\n type=\"button\"\n onClick={() => setShowDescription(!showDescription)}\n className={cn(\n \"px-2 py-1 rounded\",\n \"text-[11px] text-muted-foreground/60 hover:text-foreground/80\",\n \"hover:bg-foreground/[0.04]\",\n \"transition-colors duration-100\",\n showDescription && \"bg-foreground/[0.04] text-foreground/80\"\n )}\n title={showDescription ? \"Hide description\" : \"Show description\"}\n >\n Info\n </button>\n )}\n\n {/* Config popover */}\n {hasConfig && (\n <Popover\n open={configPopoverOpen}\n onClose={() => setConfigPopoverOpen(false)}\n placement=\"bottom\"\n align=\"end\"\n width={320}\n trigger={\n <button\n type=\"button\"\n onClick={() => setConfigPopoverOpen(!configPopoverOpen)}\n className={cn(\n \"inline-flex items-center gap-1.5\",\n \"px-2 py-1 rounded\",\n \"text-[11px] text-muted-foreground/60 hover:text-foreground/80\",\n \"hover:bg-foreground/[0.04]\",\n \"transition-colors duration-100\",\n configPopoverOpen && \"bg-foreground/[0.04] text-foreground/80\"\n )}\n >\n <SettingsIcon size={12} />\n Configure\n </button>\n }\n >\n <div className=\"p-1\">\n <RuleConfig\n ruleId={ruleFilter.id}\n currentSeverity={currentSeverity}\n onSeverityChange={handleSeverityChange}\n optionSchema={optionSchema}\n currentOptions={currentOptions}\n defaultOptions={defaultOptions}\n onOptionChange={handleOptionChange}\n onResetOptions={onResetOptions}\n isUpdating={isUpdating}\n />\n </div>\n </Popover>\n )}\n\n {/* Docs link */}\n {docsUrl && (\n <a\n href={docsUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={cn(\n \"inline-flex items-center gap-1\",\n \"px-2 py-1 rounded\",\n \"text-[11px] text-muted-foreground/50 hover:text-foreground/70\",\n \"hover:bg-foreground/[0.04]\",\n \"transition-colors duration-100\"\n )}\n >\n <ExternalLinkIcon size={10} />\n Docs\n </a>\n )}\n\n {/* Close button */}\n {showCloseButton && (\n <IconButton\n variant=\"ghost\"\n size=\"sm\"\n onClick={onClear}\n title=\"Clear filter\"\n className=\"opacity-40 hover:opacity-100 ml-1\"\n >\n <CloseIcon size={12} />\n </IconButton>\n )}\n </div>\n </div>\n </div>\n\n {/* Collapsible description */}\n <AnimatePresence>\n {showDescription && description && (\n <motion.div\n initial={{ height: 0, opacity: 0 }}\n animate={{ height: \"auto\", opacity: 1 }}\n exit={{ height: 0, opacity: 0 }}\n transition={{ duration: 0.15 }}\n className=\"overflow-hidden\"\n >\n <p className=\"px-3 pb-2 text-xs text-foreground/60 leading-relaxed\">\n {description}\n </p>\n </motion.div>\n )}\n </AnimatePresence>\n </motion.div>\n );\n}\n\nexport default RuleHeader;\n","/**\n * useFullSourceCode - Hook for fetching full source file content\n *\n * Similar to useSourceCode but returns the entire file content\n * for use in the FileSourceView component.\n */\n\nimport { useState, useEffect, useCallback, useRef } from \"react\";\nimport { useComposedStore } from \"../../core/store\";\nimport { websocket } from \"../../core/services/websocket\";\nimport {\n getCachedSource,\n setCachedSource,\n invalidateSource,\n type CachedSourceFile,\n} from \"../../core/services/source-cache\";\nimport { isStaticMode, getFileSource } from \"../../plugins/eslint/static-handler\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\ninterface UseFullSourceCodeOptions {\n /** File path to fetch */\n filePath: string;\n /** Whether to fetch (default: true) */\n enabled?: boolean;\n}\n\ninterface UseFullSourceCodeResult {\n /** Full source file content */\n source: CachedSourceFile | null;\n /** All lines as an array */\n lines: string[];\n /** Total number of lines */\n totalLines: number;\n /** Whether currently loading */\n isLoading: boolean;\n /** Error message if any */\n error: string | null;\n /** Manually trigger refetch */\n refetch: () => void;\n}\n\ninterface SourceResultMessage {\n type: \"source:result\";\n filePath: string;\n content: string;\n totalLines: number;\n relativePath: string;\n requestId?: string;\n}\n\ninterface SourceErrorMessage {\n type: \"source:error\";\n filePath: string;\n error: string;\n requestId?: string;\n}\n\ninterface FileChangedMessage {\n type: \"file:changed\";\n filePath: string;\n}\n\n// Pending requests map for deduplication\nconst pendingRequests = new Map<string, Promise<CachedSourceFile | null>>();\n\n// ============================================================================\n// Hook\n// ============================================================================\n\nexport function useFullSourceCode({\n filePath,\n enabled = true,\n}: UseFullSourceCodeOptions): UseFullSourceCodeResult {\n const [source, setSource] = useState<CachedSourceFile | null>(null);\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const wsConnected = useComposedStore((s) => s.wsConnected);\n const requestIdRef = useRef<string | null>(null);\n\n const fetchSource = useCallback(() => {\n if (!enabled || !filePath) {\n return;\n }\n\n // Check cache first\n const cached = getCachedSource(filePath);\n if (cached) {\n setSource(cached);\n setIsLoading(false);\n setError(null);\n return;\n }\n\n // In static mode (no WebSocket), get source from manifest\n if (!wsConnected && isStaticMode()) {\n const manifestSource = getFileSource(filePath);\n if (manifestSource) {\n // Cache it for future requests\n const cachedSource = setCachedSource(\n filePath,\n manifestSource.content,\n manifestSource.totalLines,\n manifestSource.relativePath\n );\n setSource(cachedSource);\n setIsLoading(false);\n setError(null);\n } else {\n setSource(null);\n setIsLoading(false);\n setError(\"Source not available in manifest\");\n }\n return;\n }\n\n // Need WebSocket for non-static mode\n if (!wsConnected) {\n return;\n }\n\n // Check for pending request (deduplication)\n const pending = pendingRequests.get(filePath);\n if (pending) {\n setIsLoading(true);\n pending.then((result) => {\n if (result) {\n setSource(result);\n setError(null);\n }\n setIsLoading(false);\n });\n return;\n }\n\n setIsLoading(true);\n setError(null);\n\n // Create a promise for this request\n const requestId = `source-full-${filePath}-${Date.now()}`;\n requestIdRef.current = requestId;\n\n const promise = new Promise<CachedSourceFile | null>((resolve) => {\n // Set up one-time handlers for this request\n const unsubResult = websocket.on<SourceResultMessage>(\n \"source:result\",\n (message) => {\n if (message.filePath === filePath) {\n const cached = setCachedSource(\n message.filePath,\n message.content,\n message.totalLines,\n message.relativePath\n );\n unsubResult();\n unsubError();\n resolve(cached);\n }\n }\n );\n\n const unsubError = websocket.on<SourceErrorMessage>(\n \"source:error\",\n (message) => {\n if (message.filePath === filePath) {\n setError(message.error);\n unsubResult();\n unsubError();\n resolve(null);\n }\n }\n );\n\n // Send the request\n websocket.send({\n type: \"source:fetch\",\n filePath,\n requestId,\n });\n\n // Timeout after 10 seconds\n setTimeout(() => {\n unsubResult();\n unsubError();\n resolve(null);\n }, 10000);\n });\n\n pendingRequests.set(filePath, promise);\n\n promise\n .then((result) => {\n if (result) {\n setSource(result);\n }\n setIsLoading(false);\n })\n .finally(() => {\n pendingRequests.delete(filePath);\n });\n }, [filePath, enabled, wsConnected]);\n\n // Fetch on mount and when dependencies change\n useEffect(() => {\n fetchSource();\n }, [fetchSource]);\n\n // Subscribe to file changes to invalidate cache\n useEffect(() => {\n if (!filePath) return;\n\n const unsubscribe = websocket.on<FileChangedMessage>(\n \"file:changed\",\n (message) => {\n // Check if the changed file matches our file path\n if (\n message.filePath === filePath ||\n message.filePath.endsWith(filePath) ||\n filePath.endsWith(message.filePath)\n ) {\n invalidateSource(filePath);\n setSource(null);\n // Refetch if we're still mounted and enabled\n if (enabled) {\n fetchSource();\n }\n }\n }\n );\n\n return unsubscribe;\n }, [filePath, enabled, fetchSource]);\n\n return {\n source,\n lines: source?.lines ?? [],\n totalLines: source?.totalLines ?? 0,\n isLoading,\n error,\n refetch: fetchSource,\n };\n}\n","/**\n * IssueAnnotation - Clean inline issue indicator below a code line\n *\n * Simplified design with:\n * - Subtle severity indicator\n * - Issue message only (no rule badge - context from parent)\n * - Reduced visual intensity\n * - Auto-scroll when selected (e.g., from heatmap click)\n *\n * Focus on clarity without visual noise\n */\nimport React, { useRef, useLayoutEffect } from \"react\";\nimport { motion } from \"motion/react\";\nimport { cn } from \"../../../lib/utils\";\nimport type { Issue } from \"../../types\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface IssueAnnotationProps {\n /** The issue to display */\n issue: Issue;\n /** Whether this issue is selected */\n isSelected: boolean;\n /** Called when clicked */\n onSelect: () => void;\n /** Width of the line number gutter */\n gutterWidth?: number;\n /** Additional class name */\n className?: string;\n}\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\n/**\n * Get CSS classes for severity styling - reduced intensity\n */\nfunction getSeverityClasses(severity: Issue[\"severity\"]): {\n border: string;\n bg: string;\n dot: string;\n} {\n switch (severity) {\n case \"error\":\n return {\n border: \"border-error/20\",\n bg: \"bg-error/[0.06]\",\n dot: \"bg-error/70\",\n };\n case \"warning\":\n return {\n border: \"border-warning/20\",\n bg: \"bg-warning/[0.06]\",\n dot: \"bg-warning/70\",\n };\n case \"info\":\n return {\n border: \"border-info/20\",\n bg: \"bg-info/[0.06]\",\n dot: \"bg-info/70\",\n };\n }\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function IssueAnnotation({\n issue,\n isSelected,\n onSelect,\n gutterWidth = 40,\n className,\n}: IssueAnnotationProps) {\n const ref = useRef<HTMLDivElement>(null);\n const severityClasses = getSeverityClasses(issue.severity);\n\n // Auto-scroll into view when selected (e.g., from heatmap click)\n useLayoutEffect(() => {\n if (isSelected && ref.current?.scrollIntoView) {\n ref.current.scrollIntoView({ block: \"nearest\", behavior: \"smooth\" });\n }\n }, [isSelected]);\n\n return (\n <motion.div\n ref={ref}\n onClick={onSelect}\n layout\n layoutId={`issue-${issue.id}`}\n initial={{ opacity: 0, y: -4, scale: 0.98 }}\n animate={{ opacity: 1, y: 0, scale: 1 }}\n exit={{ opacity: 0, y: -4, scale: 0.98 }}\n transition={{\n duration: 0.2,\n ease: [0.32, 0.72, 0, 1],\n layout: { duration: 0.25 }\n }}\n className={cn(\n \"flex items-start gap-2 cursor-pointer\",\n \"mx-2 my-1\",\n \"py-2 px-3\",\n \"rounded-lg\",\n \"border\",\n severityClasses.border,\n severityClasses.bg,\n isSelected && \"ring-1 ring-foreground/20\",\n \"hover:brightness-[0.97]\",\n \"transition-all duration-100\",\n className\n )}\n style={{ marginLeft: gutterWidth + 8 }}\n >\n {/* Severity dot - minimal indicator */}\n <div\n className={cn(\n \"flex-shrink-0 mt-1\",\n \"w-1.5 h-1.5 rounded-full\",\n severityClasses.dot\n )}\n />\n\n {/* Message content - clean and simple */}\n <p\n className={cn(\n \"flex-1 min-w-0\",\n \"text-[11px] leading-relaxed\",\n \"text-foreground/80\",\n \"font-sans\",\n isSelected ? \"line-clamp-none\" : \"line-clamp-2\"\n )}\n >\n {issue.message}\n </p>\n </motion.div>\n );\n}\n\nexport default IssueAnnotation;\n","/**\n * IssueReference - Compact reference to a repeated issue\n *\n * When the same issue message appears multiple times in a file,\n * we show the full annotation for the first occurrence and this\n * compact reference for subsequent occurrences.\n *\n * Shows: \"↳ line X\"\n * Auto-scrolls into view when selected (e.g., from heatmap click)\n */\nimport React, { useRef, useLayoutEffect } from \"react\";\nimport { motion } from \"motion/react\";\nimport { cn } from \"../../../lib/utils\";\nimport type { Issue } from \"../../types\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface IssueReferenceProps {\n /** The issue being referenced */\n issue: Issue;\n /** Line number of the first occurrence */\n firstLine: number;\n /** Whether this reference is selected */\n isSelected: boolean;\n /** Called when clicked */\n onSelect: () => void;\n /** Width of the line number gutter */\n gutterWidth?: number;\n /** Additional class name */\n className?: string;\n}\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\nfunction getSeverityDotClass(severity: Issue[\"severity\"]): string {\n switch (severity) {\n case \"error\":\n return \"bg-error/60\";\n case \"warning\":\n return \"bg-warning/60\";\n case \"info\":\n return \"bg-info/60\";\n }\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function IssueReference({\n issue,\n firstLine,\n isSelected,\n onSelect,\n gutterWidth = 40,\n className,\n}: IssueReferenceProps) {\n const ref = useRef<HTMLButtonElement>(null);\n\n // Auto-scroll into view when selected (e.g., from heatmap click)\n useLayoutEffect(() => {\n if (isSelected && ref.current?.scrollIntoView) {\n ref.current.scrollIntoView({ block: \"nearest\", behavior: \"smooth\" });\n }\n }, [isSelected]);\n\n return (\n <motion.button\n ref={ref}\n type=\"button\"\n onClick={onSelect}\n layout\n layoutId={`issue-ref-${issue.id}`}\n initial={{ opacity: 0, scale: 0.95 }}\n animate={{ opacity: 1, scale: 1 }}\n exit={{ opacity: 0, scale: 0.95 }}\n transition={{\n duration: 0.15,\n ease: [0.32, 0.72, 0, 1],\n layout: { duration: 0.2 }\n }}\n className={cn(\n \"flex items-center gap-1.5 cursor-pointer\",\n \"mx-2 my-0.5\",\n \"py-1 px-2\",\n \"rounded\",\n \"text-[10px] text-muted-foreground/50\",\n \"hover:text-muted-foreground/70 hover:bg-foreground/[0.02]\",\n isSelected && \"text-muted-foreground/70 bg-foreground/[0.03]\",\n \"transition-colors duration-100\",\n className\n )}\n style={{ marginLeft: gutterWidth + 8 }}\n >\n {/* Severity dot */}\n <div\n className={cn(\n \"w-1 h-1 rounded-full flex-shrink-0\",\n getSeverityDotClass(issue.severity)\n )}\n />\n\n {/* Reference text */}\n <span className=\"font-mono\">\n ↳ line {firstLine}\n </span>\n </motion.button>\n );\n}\n\nexport default IssueReference;\n","/* eslint-disable uilint/consistent-dark-mode -- uses semantic classes that handle dark mode via CSS variables */\n/**\n * CollapsedIssueIndicator - Minimal collapsed view for issues\n *\n * When another issue is selected, non-selected issues collapse to this\n * minimal indicator showing:\n * - Small severity dot (error/warning/info color)\n * - Line number badge\n * - Tooltip with issue message on hover\n * - Click to select and expand that issue\n *\n * Helps users focus on the selected issue while maintaining\n * awareness of other issues in the file.\n */\nimport React, { useState, useRef, useLayoutEffect } from \"react\";\nimport { motion, AnimatePresence } from \"motion/react\";\nimport { cn } from \"../../../lib/utils\";\nimport type { Issue } from \"../../types\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface CollapsedIssueIndicatorProps {\n /** The issue to display */\n issue: Issue;\n /** Called when clicked to select this issue */\n onSelect: () => void;\n /** Width of the line number gutter */\n gutterWidth?: number;\n /** Additional class name */\n className?: string;\n}\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\n/**\n * Get severity dot color class\n */\nfunction getSeverityDotClass(severity: Issue[\"severity\"]): string {\n switch (severity) {\n case \"error\":\n return \"bg-error/80\";\n case \"warning\":\n return \"bg-warning/80\";\n case \"info\":\n return \"bg-info/80\";\n }\n}\n\n/**\n * Get severity background class for hover state\n */\nfunction getSeverityHoverBgClass(severity: Issue[\"severity\"]): string {\n switch (severity) {\n case \"error\":\n return \"hover:bg-error/10\";\n case \"warning\":\n return \"hover:bg-warning/10\";\n case \"info\":\n return \"hover:bg-info/10\";\n }\n}\n\n/**\n * Get severity border class for the badge\n */\nfunction getSeverityBorderClass(severity: Issue[\"severity\"]): string {\n switch (severity) {\n case \"error\":\n return \"border-error/30\";\n case \"warning\":\n return \"border-warning/30\";\n case \"info\":\n return \"border-info/30\";\n }\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function CollapsedIssueIndicator({\n issue,\n onSelect,\n gutterWidth = 40,\n className,\n}: CollapsedIssueIndicatorProps) {\n const ref = useRef<HTMLButtonElement>(null);\n const [isHovered, setIsHovered] = useState(false);\n\n // Auto-scroll into view when this indicator is focused (keyboard nav)\n useLayoutEffect(() => {\n const el = ref.current;\n if (!el) return;\n\n const handleFocus = () => {\n el.scrollIntoView({ block: \"nearest\", behavior: \"smooth\" });\n };\n\n el.addEventListener(\"focus\", handleFocus);\n return () => el.removeEventListener(\"focus\", handleFocus);\n }, []);\n\n return (\n <motion.button\n ref={ref}\n type=\"button\"\n onClick={onSelect}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n layout\n layoutId={`issue-collapsed-${issue.id}`}\n initial={{ opacity: 0, scale: 0.8, x: -8 }}\n animate={{ opacity: 1, scale: 1, x: 0 }}\n exit={{ opacity: 0, scale: 0.8, x: -8 }}\n transition={{\n duration: 0.2,\n ease: [0.32, 0.72, 0, 1],\n layout: { duration: 0.25 }\n }}\n className={cn(\n \"relative flex items-center gap-1.5\",\n \"mx-2 my-0.5\",\n \"py-1 px-2\",\n \"rounded-full\",\n \"border\",\n \"bg-foreground/[0.02]\",\n getSeverityBorderClass(issue.severity),\n getSeverityHoverBgClass(issue.severity),\n \"cursor-pointer\",\n \"transition-colors duration-100\",\n \"focus:outline-none focus:ring-1 focus:ring-foreground/20\",\n className\n )}\n style={{ marginLeft: gutterWidth + 8 }}\n aria-label={`Issue on line ${issue.line}: ${issue.message}`}\n >\n {/* Severity dot */}\n <div\n className={cn(\n \"w-1.5 h-1.5 rounded-full flex-shrink-0\",\n getSeverityDotClass(issue.severity)\n )}\n />\n\n {/* Line number badge */}\n <span className=\"text-[10px] font-mono text-muted-foreground/60 tabular-nums\">\n L{issue.line}\n </span>\n\n {/* Tooltip on hover */}\n <AnimatePresence>\n {isHovered && (\n <motion.div\n initial={{ opacity: 0, y: 4, scale: 0.95 }}\n animate={{ opacity: 1, y: 0, scale: 1 }}\n exit={{ opacity: 0, y: 4, scale: 0.95 }}\n transition={{ duration: 0.15 }}\n className={cn(\n \"absolute left-0 top-full mt-1 z-50\",\n \"max-w-xs\",\n \"py-1.5 px-2.5\",\n \"rounded-lg\",\n \"bg-popover\",\n \"border border-foreground/10\",\n \"shadow-lg shadow-black/10\",\n \"pointer-events-none\"\n )}\n >\n <p className=\"text-[11px] text-foreground/80 leading-relaxed line-clamp-3\">\n {issue.message}\n </p>\n <p className=\"text-[9px] text-muted-foreground/50 mt-1 font-mono\">\n {issue.ruleId}\n </p>\n </motion.div>\n )}\n </AnimatePresence>\n </motion.button>\n );\n}\n\nexport default CollapsedIssueIndicator;\n","/**\n * Source Regions - Utility for calculating visible code regions\n *\n * Given a list of issues with line numbers, calculates which regions\n * of the source file to display (with context around each issue)\n * and which regions to collapse (gaps between issue regions).\n *\n * Similar to GitHub's diff view with expandable collapsed sections.\n */\nimport type { Issue } from \"../../types\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * A contiguous region of source code to display.\n */\nexport interface CodeRegion {\n /** Start line number (1-indexed, inclusive) */\n startLine: number;\n /** End line number (1-indexed, inclusive) */\n endLine: number;\n /** Issues within this region, sorted by line */\n issues: Issue[];\n}\n\n/**\n * A collapsed section between visible regions.\n */\nexport interface CollapsedGap {\n /** Unique identifier for this gap (index-based) */\n id: number;\n /** Start line number (1-indexed, inclusive) */\n startLine: number;\n /** End line number (1-indexed, inclusive) */\n endLine: number;\n /** Number of hidden lines */\n lineCount: number;\n /** Position: 'start' = before first region, 'middle' = between regions, 'end' = after last region */\n position: \"start\" | \"middle\" | \"end\";\n}\n\n/**\n * Result of region calculation.\n */\nexport interface RegionCalculationResult {\n /** Visible code regions with their issues */\n regions: CodeRegion[];\n /** Collapsed gaps between regions */\n gaps: CollapsedGap[];\n}\n\n// ============================================================================\n// Region Calculation\n// ============================================================================\n\n/**\n * Calculate visible regions and collapsed gaps for a file's issues.\n *\n * Algorithm:\n * 1. Sort issues by line number\n * 2. For each issue, create a region: [line - contextAbove, line + contextBelow]\n * 3. Merge overlapping or adjacent regions\n * 4. Identify gaps (collapsed sections) between regions\n * 5. Handle file start/end gaps\n *\n * @param issues - Issues in this file (will be sorted by line)\n * @param totalLines - Total number of lines in the file\n * @param contextLines - Number of context lines above and below each issue\n * @returns Regions to display and gaps to collapse\n */\nexport function calculateRegions(\n issues: Issue[],\n totalLines: number,\n contextLines: number = 2\n): RegionCalculationResult {\n // Edge case: no issues means no regions\n if (issues.length === 0) {\n // Single gap covering entire file if there are lines\n if (totalLines > 0) {\n return {\n regions: [],\n gaps: [\n {\n id: 0,\n startLine: 1,\n endLine: totalLines,\n lineCount: totalLines,\n position: \"start\",\n },\n ],\n };\n }\n return { regions: [], gaps: [] };\n }\n\n // Sort issues by line number\n const sortedIssues = [...issues].sort((a, b) => a.line - b.line);\n\n // Create initial regions for each issue\n const rawRegions: Array<{ start: number; end: number; issues: Issue[] }> = [];\n\n for (const issue of sortedIssues) {\n const start = Math.max(1, issue.line - contextLines);\n const end = Math.min(totalLines, issue.line + contextLines);\n\n // Check if this overlaps or is adjacent to the last region\n const lastRegion = rawRegions[rawRegions.length - 1];\n if (lastRegion && start <= lastRegion.end + 1) {\n // Merge: extend the last region and add the issue\n lastRegion.end = Math.max(lastRegion.end, end);\n lastRegion.issues.push(issue);\n } else {\n // New region\n rawRegions.push({ start, end, issues: [issue] });\n }\n }\n\n // Convert to CodeRegion format\n const regions: CodeRegion[] = rawRegions.map((r) => ({\n startLine: r.start,\n endLine: r.end,\n issues: r.issues,\n }));\n\n // Calculate gaps between regions\n const gaps: CollapsedGap[] = [];\n let gapId = 0;\n\n // Gap before first region (if any)\n if (regions.length > 0 && regions[0].startLine > 1) {\n gaps.push({\n id: gapId++,\n startLine: 1,\n endLine: regions[0].startLine - 1,\n lineCount: regions[0].startLine - 1,\n position: \"start\",\n });\n }\n\n // Gaps between regions\n for (let i = 0; i < regions.length - 1; i++) {\n const currentEnd = regions[i].endLine;\n const nextStart = regions[i + 1].startLine;\n\n if (nextStart > currentEnd + 1) {\n gaps.push({\n id: gapId++,\n startLine: currentEnd + 1,\n endLine: nextStart - 1,\n lineCount: nextStart - currentEnd - 1,\n position: \"middle\",\n });\n }\n }\n\n // Gap after last region (if any)\n if (regions.length > 0) {\n const lastRegion = regions[regions.length - 1];\n if (lastRegion.endLine < totalLines) {\n gaps.push({\n id: gapId++,\n startLine: lastRegion.endLine + 1,\n endLine: totalLines,\n lineCount: totalLines - lastRegion.endLine,\n position: \"end\",\n });\n }\n }\n\n return { regions, gaps };\n}\n\n/**\n * Expand a gap by merging it into adjacent regions.\n *\n * When a user clicks \"Show N hidden lines\", we need to recalculate\n * the regions to include those lines.\n *\n * @param result - Current region calculation result\n * @param gapId - ID of the gap to expand\n * @returns New result with the gap expanded\n */\nexport function expandGap(\n result: RegionCalculationResult,\n gapId: number\n): RegionCalculationResult {\n const gapIndex = result.gaps.findIndex((g) => g.id === gapId);\n if (gapIndex === -1) {\n return result; // Gap not found, return unchanged\n }\n\n const gap = result.gaps[gapIndex];\n const newRegions = [...result.regions];\n const newGaps = result.gaps.filter((g) => g.id !== gapId);\n\n if (gap.position === \"start\") {\n // Expand into the first region\n if (newRegions.length > 0) {\n newRegions[0] = {\n ...newRegions[0],\n startLine: gap.startLine,\n };\n } else {\n // No regions exist, create one for the gap\n newRegions.push({\n startLine: gap.startLine,\n endLine: gap.endLine,\n issues: [],\n });\n }\n } else if (gap.position === \"end\") {\n // Expand from the last region\n if (newRegions.length > 0) {\n const lastIdx = newRegions.length - 1;\n newRegions[lastIdx] = {\n ...newRegions[lastIdx],\n endLine: gap.endLine,\n };\n } else {\n newRegions.push({\n startLine: gap.startLine,\n endLine: gap.endLine,\n issues: [],\n });\n }\n } else {\n // Middle gap - merge the two adjacent regions\n // Find the region before this gap\n const beforeRegionIdx = newRegions.findIndex(\n (r) => r.endLine === gap.startLine - 1\n );\n const afterRegionIdx = newRegions.findIndex(\n (r) => r.startLine === gap.endLine + 1\n );\n\n if (beforeRegionIdx !== -1 && afterRegionIdx !== -1) {\n // Merge before and after regions\n const mergedRegion: CodeRegion = {\n startLine: newRegions[beforeRegionIdx].startLine,\n endLine: newRegions[afterRegionIdx].endLine,\n issues: [\n ...newRegions[beforeRegionIdx].issues,\n ...newRegions[afterRegionIdx].issues,\n ],\n };\n\n // Remove after region first (higher index), then before\n if (afterRegionIdx > beforeRegionIdx) {\n newRegions.splice(afterRegionIdx, 1);\n newRegions.splice(beforeRegionIdx, 1, mergedRegion);\n } else {\n newRegions.splice(beforeRegionIdx, 1);\n newRegions.splice(afterRegionIdx, 1, mergedRegion);\n }\n }\n }\n\n return { regions: newRegions, gaps: newGaps };\n}\n\n/**\n * Get issues for a specific line number.\n *\n * @param issues - All issues in the file\n * @param lineNumber - Line number to check\n * @returns Issues on that line\n */\nexport function getIssuesForLine(issues: Issue[], lineNumber: number): Issue[] {\n return issues.filter((issue) => issue.line === lineNumber);\n}\n\n/**\n * Check if a line has any issues.\n *\n * @param issues - All issues in the file\n * @param lineNumber - Line number to check\n * @returns True if the line has issues\n */\nexport function lineHasIssues(issues: Issue[], lineNumber: number): boolean {\n return issues.some((issue) => issue.line === lineNumber);\n}\n\n/**\n * Get the highest severity for a line.\n *\n * @param issues - Issues on this line\n * @returns Highest severity or null if no issues\n */\nexport function getLineSeverity(\n issues: Issue[]\n): Issue[\"severity\"] | null {\n if (issues.length === 0) return null;\n\n const severityOrder: Record<Issue[\"severity\"], number> = {\n error: 0,\n warning: 1,\n info: 2,\n };\n\n const sorted = [...issues].sort(\n (a, b) => severityOrder[a.severity] - severityOrder[b.severity]\n );\n\n return sorted[0].severity;\n}\n","/**\n * CodeRegion - Renders a contiguous block of source code lines\n *\n * Displays line numbers in a gutter and code content, with\n * issue annotations inline below lines that have issues.\n */\nimport React from \"react\";\nimport { AnimatePresence } from \"motion/react\";\nimport { cn } from \"../../../lib/utils\";\nimport { IssueAnnotation } from \"./IssueAnnotation\";\nimport { IssueReference } from \"./IssueReference\";\nimport { CollapsedIssueIndicator } from \"./CollapsedIssueIndicator\";\nimport { getIssuesForLine, getLineSeverity } from \"./source-regions\";\nimport type { Issue } from \"../../types\";\nimport type { FirstOccurrenceMap } from \"./FileSourceView\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface CodeRegionProps {\n /** Source code lines to display */\n lines: string[];\n /** Starting line number (1-indexed) */\n startLine: number;\n /** All issues in this region */\n issues: Issue[];\n /** Currently selected issue ID */\n selectedIssueId: string | null;\n /** Called when an issue is selected */\n onIssueSelect: (issueId: string) => void;\n /** Width of the line number gutter */\n gutterWidth?: number;\n /** Map of message -> first line number for deduplication */\n firstOccurrenceMap?: FirstOccurrenceMap;\n /** Additional class name */\n className?: string;\n}\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\n/**\n * Get background class for a line based on its issues\n * Reduced intensity for cleaner appearance\n */\nfunction getLineBackgroundClass(\n severity: Issue[\"severity\"] | null,\n hasIssues: boolean\n): string {\n if (!hasIssues) return \"\";\n\n switch (severity) {\n case \"error\":\n return \"bg-error/[0.04]\";\n case \"warning\":\n return \"bg-warning/[0.04]\";\n case \"info\":\n return \"bg-info/[0.04]\";\n default:\n return \"\";\n }\n}\n\n/**\n * Get border class for a line with issues\n * Subtle indicator without overwhelming the code\n */\nfunction getLineBorderClass(\n severity: Issue[\"severity\"] | null,\n hasIssues: boolean\n): string {\n if (!hasIssues) return \"border-l border-l-transparent\";\n\n switch (severity) {\n case \"error\":\n return \"border-l border-l-error/50\";\n case \"warning\":\n return \"border-l border-l-warning/50\";\n case \"info\":\n return \"border-l border-l-info/50\";\n default:\n return \"border-l border-l-transparent\";\n }\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function CodeRegion({\n lines,\n startLine,\n issues,\n selectedIssueId,\n onIssueSelect,\n gutterWidth = 40,\n firstOccurrenceMap,\n className,\n}: CodeRegionProps) {\n return (\n <div\n className={cn(\n \"font-mono text-xs leading-relaxed\",\n \"overflow-x-auto\",\n className\n )}\n >\n {lines.map((lineContent, index) => {\n const lineNumber = startLine + index;\n const lineIssues = getIssuesForLine(issues, lineNumber);\n const hasIssues = lineIssues.length > 0;\n const severity = getLineSeverity(lineIssues);\n\n return (\n <div key={lineNumber} className=\"group\">\n {/* Code line */}\n <div\n className={cn(\n \"flex\",\n getLineBackgroundClass(severity, hasIssues),\n getLineBorderClass(severity, hasIssues)\n )}\n >\n {/* Line number gutter */}\n <span\n className={cn(\n \"flex-shrink-0 select-none text-right pr-3 py-0.5\",\n \"text-muted-foreground/40\",\n \"bg-foreground/[0.02]\",\n \"border-r border-foreground/[0.06]\",\n hasIssues && \"text-muted-foreground/60\"\n )}\n style={{ width: gutterWidth }}\n >\n {lineNumber}\n </span>\n\n {/* Code content */}\n <code\n className={cn(\n \"flex-1 pl-3 pr-4 py-0.5\",\n \"text-foreground/80\",\n \"whitespace-pre\",\n hasIssues && \"text-foreground/90\"\n )}\n >\n {lineContent || \" \"}\n </code>\n </div>\n\n {/* Issue annotations below the line */}\n <AnimatePresence mode=\"sync\">\n {lineIssues.map((issue) => {\n const isSelected = selectedIssueId === issue.id;\n const hasSelection = selectedIssueId !== null;\n\n // When another issue is selected, collapse non-selected issues\n // to minimal indicators to help user focus\n if (hasSelection && !isSelected) {\n return (\n <CollapsedIssueIndicator\n key={issue.id}\n issue={issue}\n onSelect={() => onIssueSelect(issue.id)}\n gutterWidth={gutterWidth}\n />\n );\n }\n\n // Check if this is the first occurrence of this message\n const firstLine = firstOccurrenceMap?.get(issue.message);\n const isFirstOccurrence = !firstLine || firstLine === lineNumber;\n\n if (isFirstOccurrence) {\n return (\n <IssueAnnotation\n key={issue.id}\n issue={issue}\n isSelected={isSelected}\n onSelect={() => onIssueSelect(issue.id)}\n gutterWidth={gutterWidth}\n />\n );\n }\n\n // Render compact reference for repeated issues\n return (\n <IssueReference\n key={issue.id}\n issue={issue}\n firstLine={firstLine}\n isSelected={isSelected}\n onSelect={() => onIssueSelect(issue.id)}\n gutterWidth={gutterWidth}\n />\n );\n })}\n </AnimatePresence>\n </div>\n );\n })}\n </div>\n );\n}\n\nexport default CodeRegion;\n","/**\n * CollapsedLines - Expandable section representing hidden lines\n *\n * Displays a clickable row that shows \"Show N hidden lines\"\n * Similar to GitHub's diff view collapsed sections.\n */\nimport React from \"react\";\nimport { motion } from \"motion/react\";\nimport { cn } from \"../../../lib/utils\";\nimport { ChevronDownIcon } from \"../../icons\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface CollapsedLinesProps {\n /** Start line number of the collapsed section (1-indexed) */\n startLine: number;\n /** End line number of the collapsed section (1-indexed) */\n endLine: number;\n /** Number of hidden lines */\n lineCount: number;\n /** Called when the user clicks to expand */\n onExpand: () => void;\n /** Width of the line number gutter */\n gutterWidth?: number;\n /** Additional class name */\n className?: string;\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function CollapsedLines({\n startLine,\n endLine,\n lineCount,\n onExpand,\n gutterWidth = 40,\n className,\n}: CollapsedLinesProps) {\n return (\n <motion.button\n type=\"button\"\n onClick={onExpand}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n whileHover={{ backgroundColor: \"rgba(var(--foreground-rgb), 0.04)\" }}\n className={cn(\n \"w-full flex items-center\",\n \"text-xs text-muted-foreground/60 hover:text-muted-foreground/80\",\n \"bg-foreground/[0.01]\",\n \"border-y border-dashed border-foreground/[0.06]\",\n \"cursor-pointer\",\n \"transition-colors duration-100\",\n \"group\",\n className\n )}\n >\n {/* Gutter spacer */}\n <span\n className=\"flex-shrink-0 py-1.5 bg-foreground/[0.02] border-r border-foreground/[0.06]\"\n style={{ width: gutterWidth }}\n />\n\n {/* Content */}\n <span className=\"flex items-center gap-2 px-3 py-1.5\">\n <ChevronDownIcon\n size={12}\n className=\"text-muted-foreground/40 group-hover:text-muted-foreground/60 transition-colors\"\n />\n <span>\n Show {lineCount} hidden {lineCount === 1 ? \"line\" : \"lines\"}\n </span>\n <span className=\"text-muted-foreground/40\">\n ({startLine}–{endLine})\n </span>\n </span>\n </motion.button>\n );\n}\n\nexport default CollapsedLines;\n","/**\n * FileSourceView - Source code view with inline issue annotations\n *\n * Main container that replaces the flat issue list in FileSection.\n * Shows source code with collapsed sections between issue regions,\n * similar to GitHub's diff view.\n *\n * Features:\n * - Shows context lines around each issue\n * - Collapses large gaps between issues\n * - Click to expand collapsed sections\n * - Inline issue annotations with severity colors\n */\nimport React, { useState, useMemo, useCallback } from \"react\";\nimport { AnimatePresence } from \"motion/react\";\nimport { cn } from \"../../../lib/utils\";\nimport { useFullSourceCode } from \"../../hooks/useFullSourceCode\";\nimport { CodeRegion } from \"./CodeRegion\";\nimport { CollapsedLines } from \"./CollapsedLines\";\nimport {\n calculateRegions,\n expandGap,\n type RegionCalculationResult,\n} from \"./source-regions\";\nimport type { Issue } from \"../../types\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface FileSourceViewProps {\n /** Full file path */\n filePath: string;\n /** Issues in this file */\n issues: Issue[];\n /** Number of context lines above/below each issue */\n contextLines?: number;\n /** Currently selected issue ID */\n selectedIssueId: string | null;\n /** Called when an issue is selected */\n onIssueSelect: (issueId: string) => void;\n /** Whether to fetch source (default: true) */\n enabled?: boolean;\n /** Additional class name */\n className?: string;\n}\n\n// ============================================================================\n// Constants\n// ============================================================================\n\nconst DEFAULT_CONTEXT_LINES = 2;\nconst MIN_GUTTER_WIDTH = 32;\nconst CHAR_WIDTH = 8;\nconst GUTTER_PADDING = 16;\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Map of issue message -> line number of first occurrence\n * Used to deduplicate repeated issue messages\n */\nexport type FirstOccurrenceMap = Map<string, number>;\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function FileSourceView({\n filePath,\n issues,\n contextLines = DEFAULT_CONTEXT_LINES,\n selectedIssueId,\n onIssueSelect,\n enabled = true,\n className,\n}: FileSourceViewProps) {\n // Fetch full source code\n const { lines, totalLines, isLoading, error } = useFullSourceCode({\n filePath,\n enabled,\n });\n\n // Track expanded gaps (by gap ID)\n const [expandedGapIds, setExpandedGapIds] = useState<Set<number>>(new Set());\n\n // Calculate regions and gaps\n const baseResult = useMemo(() => {\n if (totalLines === 0) {\n return { regions: [], gaps: [] };\n }\n return calculateRegions(issues, totalLines, contextLines);\n }, [issues, totalLines, contextLines]);\n\n // Apply expanded gaps to get final result\n const result = useMemo(() => {\n let current: RegionCalculationResult = baseResult;\n\n // Expand each gap that's been clicked\n for (const gapId of expandedGapIds) {\n current = expandGap(current, gapId);\n }\n\n return current;\n }, [baseResult, expandedGapIds, totalLines]);\n\n // Handle gap expansion\n const handleExpandGap = useCallback((gapId: number) => {\n setExpandedGapIds((prev) => new Set([...prev, gapId]));\n }, []);\n\n // Calculate gutter width based on max line number\n const gutterWidth = useMemo(() => {\n const maxLineDigits = Math.max(3, String(totalLines).length);\n return Math.max(MIN_GUTTER_WIDTH, maxLineDigits * CHAR_WIDTH + GUTTER_PADDING);\n }, [totalLines]);\n\n // Compute first occurrence map for deduplicating repeated messages\n // Key: issue message, Value: line number of first occurrence\n const firstOccurrenceMap = useMemo((): FirstOccurrenceMap => {\n const map = new Map<string, number>();\n\n // Sort issues by line number to ensure consistent \"first\" determination\n const sortedIssues = [...issues].sort((a, b) => a.line - b.line);\n\n for (const issue of sortedIssues) {\n if (!map.has(issue.message)) {\n map.set(issue.message, issue.line);\n }\n }\n\n return map;\n }, [issues]);\n\n // Extract lines for a region\n const getRegionLines = useCallback(\n (startLine: number, endLine: number): string[] => {\n // Lines array is 0-indexed, line numbers are 1-indexed\n return lines.slice(startLine - 1, endLine);\n },\n [lines]\n );\n\n // Loading state\n if (isLoading) {\n return (\n <div className={cn(\"py-6 text-center\", className)}>\n <div className=\"text-xs text-muted-foreground/60\">Loading source...</div>\n </div>\n );\n }\n\n // Error state\n if (error) {\n return (\n <div className={cn(\"py-6 text-center\", className)}>\n <div className=\"text-xs text-muted-foreground/60\">\n Could not load source: {error}\n </div>\n </div>\n );\n }\n\n // No source available\n if (totalLines === 0) {\n return (\n <div className={cn(\"py-6 text-center\", className)}>\n <div className=\"text-xs text-muted-foreground/60\">\n Source not available\n </div>\n </div>\n );\n }\n\n // Build interleaved list of regions and gaps\n const elements: React.ReactNode[] = [];\n let gapIndex = 0;\n let regionIndex = 0;\n\n // Sort gaps by start line\n const sortedGaps = [...result.gaps].sort((a, b) => a.startLine - b.startLine);\n\n // Interleave regions and gaps in order\n while (gapIndex < sortedGaps.length || regionIndex < result.regions.length) {\n const nextGap = sortedGaps[gapIndex];\n const nextRegion = result.regions[regionIndex];\n\n // Determine which comes first\n const gapFirst =\n nextGap &&\n (!nextRegion || nextGap.startLine < nextRegion.startLine);\n\n if (gapFirst && nextGap) {\n elements.push(\n <CollapsedLines\n key={`gap-${nextGap.id}`}\n startLine={nextGap.startLine}\n endLine={nextGap.endLine}\n lineCount={nextGap.lineCount}\n onExpand={() => handleExpandGap(nextGap.id)}\n gutterWidth={gutterWidth}\n />\n );\n gapIndex++;\n } else if (nextRegion) {\n const regionLines = getRegionLines(\n nextRegion.startLine,\n nextRegion.endLine\n );\n\n elements.push(\n <CodeRegion\n key={`region-${nextRegion.startLine}-${nextRegion.endLine}`}\n lines={regionLines}\n startLine={nextRegion.startLine}\n issues={nextRegion.issues}\n selectedIssueId={selectedIssueId}\n onIssueSelect={onIssueSelect}\n gutterWidth={gutterWidth}\n firstOccurrenceMap={firstOccurrenceMap}\n />\n );\n regionIndex++;\n }\n }\n\n return (\n <div\n className={cn(\n \"border-t border-foreground/[0.06]\",\n \"bg-background/50\",\n className\n )}\n >\n <AnimatePresence mode=\"sync\">{elements}</AnimatePresence>\n </div>\n );\n}\n\nexport default FileSourceView;\n","/**\n * IssueSummaryView - Lightweight intermediate view between file tile and source\n *\n * Compact list of issues with minimal chrome:\n * - Severity indicator + line number + message\n * - Click to select and view in source\n * - No redundant containers or summary bars\n */\nimport React, { useCallback } from \"react\";\nimport { motion } from \"motion/react\";\nimport { AlertCircle, AlertTriangle, Info, Code2, ChevronRight } from \"lucide-react\";\nimport { cn } from \"../../../lib/utils\";\nimport type { Issue } from \"../../types\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface IssueSummaryViewProps {\n /** Issues in this file */\n issues: Issue[];\n /** Currently selected issue ID */\n selectedIssueId: string | null;\n /** Callback when an issue is clicked */\n onIssueClick: (issue: Issue) => void;\n /** Callback when \"Show full source\" is clicked */\n onShowFullSource: () => void;\n /** Additional class name */\n className?: string;\n}\n\n// ============================================================================\n// Helper Components\n// ============================================================================\n\n/**\n * Severity icon component\n */\nfunction SeverityIcon({ severity }: { severity: Issue[\"severity\"] }) {\n switch (severity) {\n case \"error\":\n return <AlertCircle size={14} className=\"text-error flex-shrink-0\" />;\n case \"warning\":\n return <AlertTriangle size={14} className=\"text-warning flex-shrink-0\" />;\n case \"info\":\n return <Info size={14} className=\"text-info flex-shrink-0\" />;\n }\n}\n\n/**\n * Individual issue row - compact single-line format\n */\nfunction IssueRow({\n issue,\n isSelected,\n onClick,\n index,\n}: {\n issue: Issue;\n isSelected: boolean;\n onClick: () => void;\n index: number;\n}) {\n return (\n <motion.button\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{\n duration: 0.1,\n delay: Math.min(index * 0.02, 0.2),\n }}\n onClick={onClick}\n className={cn(\n \"w-full text-left\",\n \"flex items-center gap-2 px-3 py-2\",\n \"border-b border-foreground/[0.03]\",\n \"transition-colors duration-100\",\n \"hover:bg-foreground/[0.03]\",\n \"group\",\n isSelected && \"bg-foreground/[0.05]\"\n )}\n >\n {/* Severity icon */}\n <SeverityIcon severity={issue.severity} />\n\n {/* Line number */}\n <span className=\"flex-shrink-0 text-[11px] font-mono text-muted-foreground/60 tabular-nums w-8\">\n {issue.line}\n </span>\n\n {/* Message - single line */}\n <span className=\"flex-1 min-w-0 text-xs text-foreground/70 truncate\">\n {issue.message}\n </span>\n\n {/* Chevron indicator */}\n <ChevronRight size={12} className=\"flex-shrink-0 text-muted-foreground/30 opacity-0 group-hover:opacity-100 transition-opacity\" />\n </motion.button>\n );\n}\n\n// ============================================================================\n// Main Component\n// ============================================================================\n\nexport function IssueSummaryView({\n issues,\n selectedIssueId,\n onIssueClick,\n onShowFullSource,\n className,\n}: IssueSummaryViewProps) {\n // Sort issues by line number\n const sortedIssues = React.useMemo(\n () => [...issues].sort((a, b) => a.line - b.line),\n [issues]\n );\n\n const handleIssueClick = useCallback(\n (issue: Issue) => {\n onIssueClick(issue);\n },\n [onIssueClick]\n );\n\n return (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.1 }}\n className={cn(\n \"flex flex-col\",\n className\n )}\n >\n {/* Issue list - no scroll container, parent handles it */}\n <div className=\"flex-1\">\n {sortedIssues.map((issue, index) => (\n <IssueRow\n key={issue.id}\n issue={issue}\n isSelected={selectedIssueId === issue.id}\n onClick={() => handleIssueClick(issue)}\n index={index}\n />\n ))}\n </div>\n\n {/* Show full source link - minimal styling */}\n <button\n onClick={onShowFullSource}\n className={cn(\n \"flex items-center justify-center gap-1.5\",\n \"px-3 py-2 mt-1\",\n \"text-xs text-muted-foreground/60 hover:text-foreground/80\",\n \"hover:bg-foreground/[0.03]\",\n \"transition-colors duration-100\",\n \"border-t border-foreground/[0.03]\"\n )}\n >\n <Code2 size={12} />\n <span>View source</span>\n </button>\n </motion.div>\n );\n}\n\nexport default IssueSummaryView;\n","/**\n * Breadcrumbs - Navigation trail for the inspector hierarchy\n *\n * Shows the current navigation path:\n * - \"All Rules\" (root, always shown)\n * - \"→ [Rule Name]\" (when rule expanded)\n * - \"→ [File Name]\" (when file expanded within rule)\n *\n * Each segment is clickable to navigate back to that level.\n */\nimport React from \"react\";\nimport { motion } from \"motion/react\";\nimport { ChevronRight, Layers } from \"lucide-react\";\nimport { cn } from \"../../../lib/utils\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface BreadcrumbsProps {\n /** Name of the expanded rule (null if at root) */\n expandedRuleName: string | null;\n /** Name of the expanded file (null if no file expanded) */\n expandedFileName: string | null;\n /** Called when \"All Rules\" is clicked */\n onCollapseToRoot: () => void;\n /** Called when rule name is clicked (collapses file only) */\n onCollapseFile: () => void;\n /** Visual variant - 'standalone' has border/bg, 'embedded' is minimal */\n variant?: \"standalone\" | \"embedded\";\n /** Additional class name */\n className?: string;\n}\n\n// ============================================================================\n// Helper Components\n// ============================================================================\n\n/**\n * Separator between breadcrumb segments\n */\nfunction Separator() {\n return (\n <ChevronRight\n size={12}\n className=\"text-muted-foreground/30 flex-shrink-0 mx-1\"\n />\n );\n}\n\n/**\n * Individual breadcrumb segment\n */\nfunction Segment({\n children,\n onClick,\n isActive = false,\n icon,\n}: {\n children: React.ReactNode;\n onClick?: () => void;\n isActive?: boolean;\n icon?: React.ReactNode;\n}) {\n const isClickable = !!onClick && !isActive;\n\n return (\n <motion.button\n onClick={isClickable ? onClick : undefined}\n disabled={!isClickable}\n className={cn(\n \"flex items-center gap-1 px-1.5 py-0.5 rounded text-xs\",\n \"transition-colors duration-100\",\n isClickable && \"hover:bg-foreground/[0.05] cursor-pointer\",\n isActive\n ? \"text-foreground/80 font-medium\"\n : \"text-muted-foreground/60\",\n !isClickable && !isActive && \"cursor-default\"\n )}\n whileHover={isClickable ? { scale: 1.02 } : undefined}\n whileTap={isClickable ? { scale: 0.98 } : undefined}\n >\n {icon}\n <span className=\"truncate max-w-[120px]\">{children}</span>\n </motion.button>\n );\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function Breadcrumbs({\n expandedRuleName,\n expandedFileName,\n onCollapseToRoot,\n onCollapseFile,\n variant = \"standalone\",\n className,\n}: BreadcrumbsProps) {\n // Don't render if at root level (no rule expanded)\n if (!expandedRuleName) {\n return null;\n }\n\n return (\n <motion.div\n initial={{ opacity: 0, y: -4 }}\n animate={{ opacity: 1, y: 0 }}\n exit={{ opacity: 0, y: -4 }}\n transition={{ duration: 0.15 }}\n className={cn(\n \"flex items-center px-4 py-2\",\n variant !== \"embedded\" && \"border-b border-foreground/[0.04] bg-foreground/[0.01]\",\n className\n )}\n >\n {/* Root: All Rules */}\n <Segment\n onClick={onCollapseToRoot}\n icon={<Layers size={11} className=\"opacity-50\" />}\n >\n All Rules\n </Segment>\n\n {/* Rule segment */}\n <Separator />\n <Segment\n onClick={expandedFileName ? onCollapseFile : undefined}\n isActive={!expandedFileName}\n >\n {expandedRuleName}\n </Segment>\n\n {/* File segment (if expanded) */}\n {expandedFileName && (\n <>\n <Separator />\n <Segment isActive>{expandedFileName}</Segment>\n </>\n )}\n </motion.div>\n );\n}\n\nexport default Breadcrumbs;\n","/**\n * HierarchyProvider - Context provider for hierarchical tile expansion state\n *\n * Manages the expansion path for hierarchical tile navigation.\n * Supports both controlled and uncontrolled modes:\n * - Controlled: Pass `expansionPath`, `onExpand`, and `onCollapse` props\n * - Uncontrolled: Manage state internally with useState\n *\n * @module HierarchyProvider\n */\nimport React, {\n createContext,\n useContext,\n useState,\n useCallback,\n useMemo,\n type ReactNode,\n} from \"react\";\nimport type { HierarchyContextValue, HierarchyNode } from \"./types\";\n\n// ============================================================================\n// Constants\n// ============================================================================\n\n/**\n * Maximum allowed expansion depth.\n * Prevents deeply nested expansions for UX clarity.\n */\nconst MAX_EXPANSION_DEPTH = 2;\n\n// ============================================================================\n// Context\n// ============================================================================\n\n/**\n * React context for hierarchy expansion state.\n * Initialized as null to detect usage outside of provider.\n *\n * @internal\n */\nconst HierarchyContext = createContext<HierarchyContextValue<unknown> | null>(\n null\n);\n\n// ============================================================================\n// Provider Props\n// ============================================================================\n\n/**\n * Props for the HierarchyProvider component.\n *\n * @template T - The type of the data payload in hierarchy nodes\n */\nexport interface HierarchyProviderProps<T> {\n /**\n * Child components that will have access to the hierarchy context.\n */\n children: ReactNode;\n\n /**\n * Controlled expansion path.\n * When provided, the component operates in controlled mode.\n * Must be used together with `onExpand` and `onCollapse`.\n */\n expansionPath?: HierarchyNode<T>[];\n\n /**\n * Callback fired when a node should be expanded.\n * Required for controlled mode.\n *\n * @param node - The node to expand\n */\n onExpand?: (node: HierarchyNode<T>) => void;\n\n /**\n * Callback fired when the current expansion should be collapsed.\n * Required for controlled mode.\n */\n onCollapse?: () => void;\n\n /**\n * Callback fired when collapsing to a specific level.\n * Optional for controlled mode - falls back to multiple onCollapse calls.\n *\n * @param level - The level to collapse to (0 = fully collapsed)\n */\n onCollapseToLevel?: (level: number) => void;\n}\n\n// ============================================================================\n// Provider Component\n// ============================================================================\n\n/**\n * HierarchyProvider - Context provider for managing hierarchical expansion state.\n *\n * Provides expansion state and navigation methods to descendant components.\n * Supports both controlled and uncontrolled usage patterns.\n *\n * @template T - The type of the data payload in hierarchy nodes\n *\n * @example Uncontrolled usage (internal state management)\n * ```tsx\n * function MyComponent() {\n * return (\n * <HierarchyProvider>\n * <TileGrid nodes={nodes} />\n * </HierarchyProvider>\n * );\n * }\n * ```\n *\n * @example Controlled usage (external state management)\n * ```tsx\n * function MyComponent() {\n * const [expansionPath, setExpansionPath] = useState<HierarchyNode<MyData>[]>([]);\n *\n * return (\n * <HierarchyProvider\n * expansionPath={expansionPath}\n * onExpand={(node) => setExpansionPath([...expansionPath, node])}\n * onCollapse={() => setExpansionPath(expansionPath.slice(0, -1))}\n * >\n * <TileGrid nodes={nodes} />\n * </HierarchyProvider>\n * );\n * }\n * ```\n */\nexport function HierarchyProvider<T>({\n children,\n expansionPath: controlledPath,\n onExpand: controlledOnExpand,\n onCollapse: controlledOnCollapse,\n onCollapseToLevel: controlledOnCollapseToLevel,\n}: HierarchyProviderProps<T>): React.ReactElement {\n // Internal state for uncontrolled mode\n const [internalPath, setInternalPath] = useState<HierarchyNode<T>[]>([]);\n\n // Determine if we're in controlled mode\n const isControlled = controlledPath !== undefined;\n\n // Use controlled or internal state\n const expansionPath = isControlled ? controlledPath : internalPath;\n\n /**\n * Expand a node by adding it to the expansion path.\n * Respects MAX_EXPANSION_DEPTH limit.\n */\n const expand = useCallback(\n (node: HierarchyNode<T>) => {\n if (isControlled) {\n // In controlled mode, delegate to parent\n controlledOnExpand?.(node);\n } else {\n // In uncontrolled mode, manage internally\n setInternalPath((currentPath: HierarchyNode<T>[]) => {\n // Check if we've reached max depth\n if (currentPath.length >= MAX_EXPANSION_DEPTH) {\n // Replace the last item instead of adding\n return [...currentPath.slice(0, -1), node];\n }\n return [...currentPath, node];\n });\n }\n },\n [isControlled, controlledOnExpand]\n );\n\n /**\n * Collapse the most recently expanded node.\n * Removes the last entry from the expansion path.\n */\n const collapse = useCallback(() => {\n if (isControlled) {\n // In controlled mode, delegate to parent\n controlledOnCollapse?.();\n } else {\n // In uncontrolled mode, pop the last item\n setInternalPath((currentPath: HierarchyNode<T>[]) => currentPath.slice(0, -1));\n }\n }, [isControlled, controlledOnCollapse]);\n\n /**\n * Collapse to a specific level in the hierarchy.\n * Level 0 means fully collapsed, level 1 means one expansion, etc.\n */\n const collapseToLevel = useCallback(\n (level: number) => {\n if (isControlled) {\n // In controlled mode, use dedicated callback if provided\n if (controlledOnCollapseToLevel) {\n controlledOnCollapseToLevel(level);\n } else {\n // Fallback: call collapse repeatedly (parent should handle state)\n // This is a simplified approach; parent may want to handle differently\n controlledOnCollapse?.();\n }\n } else {\n // In uncontrolled mode, slice the path to the target level\n setInternalPath((currentPath: HierarchyNode<T>[]) => currentPath.slice(0, level));\n }\n },\n [isControlled, controlledOnCollapseToLevel, controlledOnCollapse]\n );\n\n /**\n * Collapse all expansions, returning to the root view.\n * Equivalent to collapseToLevel(0).\n */\n const collapseAll = useCallback(() => {\n collapseToLevel(0);\n }, [collapseToLevel]);\n\n // Compute derived values\n const currentLevel = expansionPath.length;\n const expandedNodeId =\n expansionPath.length > 0\n ? expansionPath[expansionPath.length - 1].id\n : null;\n\n // Memoize the context value to prevent unnecessary re-renders\n const contextValue = useMemo<HierarchyContextValue<T>>(\n () => ({\n expansionPath,\n currentLevel,\n expandedNodeId,\n expand,\n collapse,\n collapseToLevel,\n collapseAll,\n }),\n [\n expansionPath,\n currentLevel,\n expandedNodeId,\n expand,\n collapse,\n collapseToLevel,\n collapseAll,\n ]\n );\n\n return (\n <HierarchyContext.Provider\n value={contextValue as HierarchyContextValue<unknown>}\n >\n {children}\n </HierarchyContext.Provider>\n );\n}\n\n// ============================================================================\n// Hook\n// ============================================================================\n\n/**\n * useHierarchy - Hook to access the hierarchy context.\n *\n * Provides access to the current expansion state and navigation methods.\n * Must be used within a HierarchyProvider component.\n *\n * @template T - The type of the data payload in hierarchy nodes\n *\n * @returns The hierarchy context value with expansion state and methods\n *\n * @throws Error if used outside of a HierarchyProvider\n *\n * @example\n * ```tsx\n * function TileComponent({ node }) {\n * const { expand, expandedNodeId, currentLevel } = useHierarchy<MyData>();\n *\n * const isExpanded = expandedNodeId === node.id;\n *\n * return (\n * <button onClick={() => expand(node)}>\n * {node.label} {isExpanded && '(expanded)'}\n * </button>\n * );\n * }\n * ```\n */\nexport function useHierarchy<T>(): HierarchyContextValue<T> {\n const context = useContext(HierarchyContext);\n\n if (context === null) {\n throw new Error(\n \"useHierarchy must be used within a HierarchyProvider. \" +\n \"Wrap your component tree with <HierarchyProvider> to fix this error.\"\n );\n }\n\n return context as HierarchyContextValue<T>;\n}\n","/**\n * TileHeader - Generalized header for hierarchical tiles\n *\n * Shows:\n * - Back button (arrow) to navigate up\n * - Label and issue summary (\"X issues in Y files\")\n * - Optional icon\n *\n * Reusable across different tile-based UIs.\n */\nimport React from \"react\";\nimport { motion } from \"motion/react\";\nimport { ChevronLeft } from \"lucide-react\";\nimport { cn } from \"../../../lib/utils\";\nimport {\n headerVariants,\n headerTransition,\n backButtonVariants,\n backButtonTransition,\n} from \"./animations/expansion-animations\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface TileHeaderProps {\n /** Main label text */\n label: string;\n /** Optional subtitle (e.g., file path) */\n subtitle?: string;\n /** Tile type for visual differentiation */\n tileType?: \"rule\" | \"file\";\n /** Issue count */\n count?: number;\n /** Number of files (for \"X issues in Y files\" display) */\n fileCount?: number;\n /** Callback when back button is clicked */\n onBack: () => void;\n /** Optional additional class names */\n className?: string;\n /** Depth level (for visual indication) */\n level?: number;\n}\n\n/**\n * Format the issue summary line (e.g., \"72 issues in 4 files\" or \"12 issues\")\n */\nfunction formatIssueSummary(count: number, fileCount?: number): string {\n const issueWord = count === 1 ? \"issue\" : \"issues\";\n if (fileCount !== undefined && fileCount > 0) {\n const fileWord = fileCount === 1 ? \"file\" : \"files\";\n return `${count} ${issueWord} in ${fileCount} ${fileWord}`;\n }\n return `${count} ${issueWord}`;\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function TileHeader({\n label,\n subtitle,\n tileType,\n count,\n fileCount,\n onBack,\n className,\n}: TileHeaderProps) {\n const summary = count !== undefined ? formatIssueSummary(count, fileCount) : undefined;\n\n return (\n <motion.div\n variants={headerVariants}\n initial=\"hidden\"\n animate=\"visible\"\n exit=\"exit\"\n transition={headerTransition}\n className={cn(\n \"flex items-center justify-between gap-2 px-3 py-2\",\n \"border-b border-foreground/[0.04]\",\n className\n )}\n >\n {/* Left side: Back button + icon + label */}\n <div className=\"flex items-center gap-1.5 min-w-0 flex-1\">\n {/* Back button */}\n <motion.button\n onClick={onBack}\n variants={backButtonVariants}\n initial=\"rest\"\n whileHover=\"hover\"\n whileTap=\"tap\"\n transition={backButtonTransition}\n className={cn(\n \"flex items-center justify-center\",\n \"w-6 h-6 rounded-md\",\n \"text-muted-foreground/70 hover:text-foreground\",\n \"hover:bg-foreground/[0.05]\",\n \"transition-colors duration-100\",\n \"flex-shrink-0\"\n )}\n aria-label=\"Go back\"\n >\n <ChevronLeft size={16} strokeWidth={2} />\n </motion.button>\n\n {/* Label, subtitle, and issue summary - inline */}\n <div className=\"min-w-0 flex-1 flex flex-col\">\n <div className=\"flex items-baseline gap-2\">\n <motion.h3\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ duration: 0.1 }}\n className=\"text-sm font-medium text-foreground truncate\"\n >\n {label}\n </motion.h3>\n {summary && (\n <motion.span\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ duration: 0.1, delay: 0.05 }}\n className=\"text-[11px] text-muted-foreground/50 truncate hidden sm:inline\"\n >\n {summary}\n </motion.span>\n )}\n </div>\n {subtitle && (\n <motion.p\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ duration: 0.1 }}\n className={cn(\n \"text-[10px] text-muted-foreground/50 truncate\",\n tileType === \"file\" && \"font-mono\"\n )}\n >\n {subtitle}\n </motion.p>\n )}\n </div>\n </div>\n </motion.div>\n );\n}\n","/**\n * ExpandableTileGrid - Generic mosaic grid where tiles expand in-place\n *\n * A controlled component that renders a mosaic grid of tiles with in-place expansion.\n * When a tile is expanded:\n * - The tile expands IN PLACE to show its children inside it\n * - The expanded tile takes full width at its original row position\n * - Tiles that were beside it reflow below (since it now takes full width)\n * - Tiles that were already below also move down to accommodate\n *\n * This component is state-agnostic - it receives expansion state via props,\n * making it reusable across command palette, inspector, and other contexts.\n */\nimport React, { useMemo } from \"react\";\nimport { motion, AnimatePresence } from \"motion/react\";\nimport { cn } from \"../../../lib/utils\";\nimport { Tile } from \"./Tile\";\nimport { TileGrid } from \"./TileGrid\";\nimport { TileHeader } from \"./TileHeader\";\nimport { calculateMosaicLayout, calculateExpandedLayout } from \"./layout\";\nimport type { LayoutItem } from \"./layout\";\nimport type { BaseTileItem } from \"./TileGrid\";\nimport {\n childrenContainerVariants,\n crispEase,\n DURATIONS,\n} from \"./animations\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface ExpandableTileGridProps<T extends BaseTileItem> {\n /** Root-level tile items */\n items: T[];\n /** ID of the currently expanded tile, or null if none */\n expandedId: string | null;\n /** Children to show inside the expanded tile */\n expandedChildren: T[];\n /** Callback when a non-expanded tile is clicked */\n onTileClick: (item: T) => void;\n /** Callback when a child inside the expanded tile is clicked */\n onExpandedChildClick: (item: T) => void;\n /** Callback when the back button is clicked on the expanded tile */\n onBack: () => void;\n /** Available width for the grid */\n availableWidth: number;\n /** Currently selected index for keyboard navigation */\n selectedIndex?: number;\n /** Gap between tiles (default: 14) */\n gap?: number;\n /** Padding around the grid */\n padding?: { top: number; right: number; bottom: number; left: number };\n /** Extra height to add to expanded tile for custom content (RuleHeader, RuleConfig, etc.) */\n extraExpandedHeight?: number;\n /** Custom render function for expanded tile content */\n renderExpandedContent?: (\n item: T,\n children: T[],\n childrenHeight: number,\n availableWidth: number\n ) => React.ReactNode;\n}\n\n// ============================================================================\n// Constants\n// ============================================================================\n\nconst DEFAULT_GAP = 14;\nconst DEFAULT_PADDING = { top: 0, right: 0, bottom: 0, left: 0 };\nconst EXPANDED_CONTENT_PADDING = 12;\n\n// ============================================================================\n// Sub-components\n// ============================================================================\n\ninterface DefaultExpandedContentProps<T extends BaseTileItem> {\n item: T;\n children: T[];\n childrenHeight: number;\n availableWidth: number;\n onBack: () => void;\n onChildClick: (item: T) => void;\n}\n\nfunction DefaultExpandedContent<T extends BaseTileItem>({\n item,\n children,\n childrenHeight,\n availableWidth,\n onBack,\n onChildClick,\n}: DefaultExpandedContentProps<T>) {\n return (\n <motion.div\n layoutId={`tile-${item.id}`}\n initial={{ opacity: 0.9 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0.9 }}\n transition={{ duration: DURATIONS.expand, ease: crispEase }}\n className={cn(\n \"rounded-2xl\",\n \"border border-foreground/[0.08]\",\n \"bg-background/60 backdrop-blur-md\",\n \"overflow-hidden\",\n \"shadow-lg\",\n \"h-full\"\n )}\n >\n <TileHeader\n label={item.label}\n subtitle={item.subtitle}\n tileType={item.tileType}\n count={item.count}\n fileCount={item.fileCount}\n onBack={onBack}\n />\n <motion.div\n variants={childrenContainerVariants}\n initial=\"hidden\"\n animate=\"visible\"\n exit=\"exit\"\n className=\"p-3\"\n style={{ height: childrenHeight + EXPANDED_CONTENT_PADDING * 2 }}\n >\n <TileGrid\n items={children}\n onTileClick={onChildClick}\n selectedIndex={-1}\n availableWidth={availableWidth - EXPANDED_CONTENT_PADDING * 2}\n padding={{ top: 0, right: 0, bottom: 0, left: 0 }}\n />\n </motion.div>\n </motion.div>\n );\n}\n\n// ============================================================================\n// Main Component\n// ============================================================================\n\nexport function ExpandableTileGrid<T extends BaseTileItem>({\n items,\n expandedId,\n expandedChildren,\n onTileClick,\n onExpandedChildClick,\n onBack,\n availableWidth,\n selectedIndex = -1,\n gap = DEFAULT_GAP,\n padding = DEFAULT_PADDING,\n extraExpandedHeight = 0,\n renderExpandedContent,\n}: ExpandableTileGridProps<T>) {\n // Compute the ORIGINAL layout (without expansion) - used for bucket sizing\n const originalLayout = useMemo(() => {\n return calculateMosaicLayout(items, {\n availableWidth,\n gap,\n padding,\n });\n }, [items, availableWidth, gap, padding]);\n\n // Convert items to LayoutItems for the layout algorithm\n const layoutItems: LayoutItem[] = useMemo(\n () => items.map((item) => ({ id: item.id, count: item.count })),\n [items]\n );\n\n // Convert children to LayoutItems\n const childLayoutItems: LayoutItem[] = useMemo(\n () => expandedChildren.map((c) => ({ id: c.id, count: c.count })),\n [expandedChildren]\n );\n\n // Use the pure layout algorithm for all position calculations\n const layoutResult = useMemo(() => {\n return calculateExpandedLayout({\n items: layoutItems,\n expandedId,\n children: childLayoutItems,\n config: {\n availableWidth,\n gap,\n padding,\n },\n extraExpandedHeight,\n });\n }, [layoutItems, expandedId, childLayoutItems, availableWidth, gap, padding, extraExpandedHeight]);\n\n // Extract positions and heights from the layout result\n const positions = layoutResult.positions;\n const totalHeight = layoutResult.totalHeight;\n\n // Build index map for selection (sorted by position)\n const itemIndexMap = useMemo(() => {\n const indexMap = new Map<string, number>();\n const sortedByPosition = [...items].sort((a, b) => {\n const posA = positions.get(a.id);\n const posB = positions.get(b.id);\n const yDiff = (posA?.y ?? 0) - (posB?.y ?? 0);\n if (Math.abs(yDiff) > 10) return yDiff;\n return (posA?.x ?? 0) - (posB?.x ?? 0);\n });\n sortedByPosition.forEach((item, index) => indexMap.set(item.id, index));\n return indexMap;\n }, [items, positions]);\n\n // Find the expanded item\n const expandedItem = useMemo(\n () => items.find((item) => item.id === expandedId) || null,\n [items, expandedId]\n );\n\n return (\n <div className=\"relative\" style={{ height: totalHeight, minHeight: 200 }}>\n <AnimatePresence mode=\"popLayout\">\n {items.map((item, animIndex) => {\n const pos = positions.get(item.id);\n const originalLayoutItem = originalLayout.tiles.get(item.id);\n if (!pos || !originalLayoutItem) return null;\n\n const globalIndex = itemIndexMap.get(item.id) ?? animIndex;\n const isExpanded = item.id === expandedId;\n const isSelected = globalIndex === selectedIndex;\n\n if (isExpanded && expandedItem) {\n return (\n <motion.div\n key={item.id}\n className=\"absolute\"\n style={{ left: pos.x, width: pos.width, height: pos.height }}\n initial={{ top: pos.y, opacity: 0.9 }}\n animate={{ top: pos.y, opacity: 1 }}\n exit={{ opacity: 0.9 }}\n transition={{ duration: DURATIONS.expand, ease: crispEase }}\n >\n {renderExpandedContent ? (\n renderExpandedContent(\n item,\n expandedChildren,\n layoutResult.childrenHeight,\n availableWidth\n )\n ) : (\n <DefaultExpandedContent\n item={item}\n children={expandedChildren}\n childrenHeight={layoutResult.childrenHeight}\n availableWidth={availableWidth}\n onBack={onBack}\n onChildClick={onExpandedChildClick}\n />\n )}\n </motion.div>\n );\n }\n\n return (\n <motion.div\n key={item.id}\n className=\"absolute\"\n style={{\n left: pos.x,\n width: pos.width,\n height: pos.height,\n }}\n initial={{ top: originalLayoutItem.y, opacity: 0, scale: 0.9 }}\n animate={{ top: pos.y, opacity: 1, scale: 1 }}\n exit={{ opacity: 0, scale: 0.95 }}\n transition={{\n duration: DURATIONS.standard,\n ease: crispEase,\n delay: Math.min(animIndex * 0.02, 0.15),\n }}\n >\n <Tile\n id={item.id}\n label={item.label}\n subtitle={item.subtitle}\n tileType={item.tileType ?? (item.metadata?.tileType as \"rule\" | \"file\" | undefined)}\n count={item.count}\n fileCount={item.fileCount}\n bucket={originalLayoutItem.bucket}\n isSelected={isSelected}\n onClick={() => onTileClick(item)}\n />\n </motion.div>\n );\n })}\n </AnimatePresence>\n </div>\n );\n}\n","/**\n * RuleNodeAdapter - Transform issues into rule-first hierarchy\n *\n * Converts flat issue data into a two-level hierarchy:\n * Level 0: Rules (aggregated across all files)\n * Level 1: Files (for each rule, which files have issues)\n */\n\nimport type { HierarchyNode, SeverityCounts } from \"../HierarchicalTiles\";\nimport type { FileGroup } from \"../../../core/store/file-groups-selector\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Data payload for rule hierarchy nodes.\n * Contains aggregated rule information across all files.\n */\nexport interface RuleData {\n ruleId: string;\n ruleName: string;\n highestSeverity: \"error\" | \"warning\" | \"info\";\n files: FileForRule[];\n}\n\n/**\n * File information within a rule's hierarchy.\n * Represents a single file that has issues for a specific rule.\n */\nexport interface FileForRule {\n filePath: string;\n fileName: string;\n directory: string;\n issueCount: number;\n severityCounts: SeverityCounts;\n issues: Array<{\n id: string;\n message: string;\n severity: \"error\" | \"warning\" | \"info\";\n line: number;\n column?: number;\n }>;\n}\n\n/**\n * Type alias for rule-based hierarchy nodes.\n * Represents a rule in the hierarchical tiles structure.\n */\nexport type RuleNode = HierarchyNode<RuleData>;\n\n/**\n * Type alias for file nodes within a rule's hierarchy.\n * Represents a file containing issues for a specific rule.\n */\nexport type FileForRuleNode = HierarchyNode<FileForRule>;\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\n/**\n * Format count text: \"X issues in Y files\" or \"X issue in Y file\"\n */\nfunction formatCountText(issueCount: number, fileCount: number): string {\n const issuePlural = issueCount === 1 ? \"issue\" : \"issues\";\n const filePlural = fileCount === 1 ? \"file\" : \"files\";\n return `${issueCount} ${issuePlural} in ${fileCount} ${filePlural}`;\n}\n\n/**\n * Get a short rule name from a potentially namespaced rule ID.\n * Handles namespaced rules like \"@typescript-eslint/no-unused-vars\".\n */\nfunction getShortRuleName(ruleId: string): string {\n if (ruleId.includes(\"/\")) {\n return ruleId.split(\"/\").pop() || ruleId;\n }\n return ruleId;\n}\n\n// ============================================================================\n// Transform Functions\n// ============================================================================\n\n/**\n * Transform FileGroup[] into RuleNode[] (rule-first hierarchy)\n *\n * Aggregates issues by rule across all files, creating a two-level structure:\n * - Level 0: Rules sorted by severity (errors first), then by count\n * - Level 1: Files for each rule, also sorted by severity then count\n *\n * @param fileGroups - Array of FileGroup objects from the selector\n * @returns Array of RuleNode objects ready for HierarchicalTiles\n */\nexport function fileGroupsToRuleNodes(fileGroups: FileGroup[]): RuleNode[] {\n // Aggregate issues by rule across all files\n const ruleMap = new Map<\n string,\n {\n ruleId: string;\n ruleName: string;\n totalCount: number;\n severityCounts: SeverityCounts;\n highestSeverity: \"error\" | \"warning\" | \"info\";\n files: Map<string, FileForRule>;\n }\n >();\n\n for (const fileGroup of fileGroups) {\n for (const issue of fileGroup.issues) {\n const ruleId = issue.ruleId || \"unknown\";\n const ruleName = getShortRuleName(ruleId);\n\n if (!ruleMap.has(ruleId)) {\n ruleMap.set(ruleId, {\n ruleId,\n ruleName,\n totalCount: 0,\n severityCounts: { error: 0, warning: 0, info: 0 },\n highestSeverity: \"info\",\n files: new Map(),\n });\n }\n\n const rule = ruleMap.get(ruleId)!;\n rule.totalCount++;\n rule.severityCounts[issue.severity]++;\n\n // Update highest severity\n if (issue.severity === \"error\") {\n rule.highestSeverity = \"error\";\n } else if (issue.severity === \"warning\" && rule.highestSeverity !== \"error\") {\n rule.highestSeverity = \"warning\";\n }\n\n // Add to file map\n if (!rule.files.has(fileGroup.filePath)) {\n rule.files.set(fileGroup.filePath, {\n filePath: fileGroup.filePath,\n fileName: fileGroup.fileName,\n directory: fileGroup.directory,\n issueCount: 0,\n severityCounts: { error: 0, warning: 0, info: 0 },\n issues: [],\n });\n }\n\n const file = rule.files.get(fileGroup.filePath)!;\n file.issueCount++;\n file.severityCounts[issue.severity]++;\n file.issues.push({\n id: issue.id,\n message: issue.message,\n severity: issue.severity,\n line: issue.line,\n column: issue.column,\n });\n }\n }\n\n // Convert to RuleNode array, sorted by severity then count\n const ruleNodes: RuleNode[] = Array.from(ruleMap.values())\n .sort((a, b) => {\n // Sort by severity first (error > warning > info)\n const severityOrder = { error: 0, warning: 1, info: 2 };\n const severityDiff = severityOrder[a.highestSeverity] - severityOrder[b.highestSeverity];\n if (severityDiff !== 0) return severityDiff;\n // Then by count\n return b.totalCount - a.totalCount;\n })\n .map((rule) => {\n // Gather top preview messages from issues across all files\n const allIssues = Array.from(rule.files.values()).flatMap((f) => f.issues);\n const previewMessages = allIssues.slice(0, 3).map((i) => i.message);\n\n return {\n id: rule.ruleId,\n label: rule.ruleName,\n subtitle: formatCountText(rule.totalCount, rule.files.size),\n count: rule.totalCount,\n previewMessages,\n fileCount: rule.files.size,\n data: {\n ruleId: rule.ruleId,\n ruleName: rule.ruleName,\n highestSeverity: rule.highestSeverity,\n files: Array.from(rule.files.values()),\n },\n hasChildren: true,\n isLeaf: false,\n };\n });\n\n return ruleNodes;\n}\n\n/**\n * Get file nodes for a specific rule.\n *\n * Transforms a RuleNode's file data into FileForRuleNode[] for\n * rendering the second level of the hierarchy.\n *\n * @param ruleNode - The RuleNode to extract file nodes from\n * @returns Array of FileForRuleNode objects sorted by severity then count\n */\nexport function getFileNodesForRule(ruleNode: RuleNode): FileForRuleNode[] {\n return ruleNode.data.files\n .sort((a, b) => {\n // Sort by severity first, then count\n const severityOrder = { error: 0, warning: 1, info: 2 };\n const aHighest =\n a.severityCounts.error > 0 ? \"error\" : a.severityCounts.warning > 0 ? \"warning\" : \"info\";\n const bHighest =\n b.severityCounts.error > 0 ? \"error\" : b.severityCounts.warning > 0 ? \"warning\" : \"info\";\n const severityDiff = severityOrder[aHighest] - severityOrder[bHighest];\n if (severityDiff !== 0) return severityDiff;\n return b.issueCount - a.issueCount;\n })\n .map((file) => ({\n id: `${ruleNode.id}:${file.filePath}`,\n label: file.fileName,\n subtitle: file.filePath,\n tileType: \"file\" as const,\n count: file.issueCount,\n severityCounts: file.severityCounts,\n data: file,\n isLeaf: true,\n }));\n}\n","/**\n * IssuesList - Main content component for the unified inspector\n *\n * Orchestrates a two-level tile hierarchy with in-place expansion:\n * - Level 0: Rule tiles (aggregated across all files)\n * - Level 1: File tiles (for a specific rule) - shown INSIDE expanded rule tile\n * - Level 2: Source view (for a specific file within a rule) - shown below expanded file\n *\n * Uses the additive selection model - all tiles visible, expanded ones emphasized.\n * Tiles expand IN PLACE using the mosaic layout algorithm, keeping siblings visible.\n */\nimport React, { useCallback, useMemo, useEffect, useRef } from \"react\";\nimport { motion } from \"motion/react\";\nimport { useComposedStore } from \"../../../core/store\";\nimport {\n selectFileGroups,\n} from \"../../../core/store/file-groups-selector\";\nimport { pluginRegistry } from \"../../../core/plugin-system/registry\";\nimport type { ESLintPluginSlice } from \"../../../plugins/eslint/slice\";\nimport { RuleHeader } from \"./RuleHeader\";\nimport { FileSourceView } from \"./FileSourceView\";\nimport { IssueSummaryView } from \"./IssueSummaryView\";\nimport { Breadcrumbs } from \"./Breadcrumbs\";\nimport {\n ExpandableTileGrid,\n TileGrid,\n crispEase,\n DURATIONS,\n type BaseTileItem,\n} from \"../HierarchicalTiles\";\nimport {\n fileGroupsToRuleNodes,\n getFileNodesForRule,\n type RuleNode,\n type FileForRuleNode,\n} from \"./RuleNodeAdapter\";\nimport { cn } from \"../../../lib/utils\";\n\n// ============================================================================\n// Tile Item Adapters\n// ============================================================================\n\n/**\n * Convert RuleNode to BaseTileItem for TileGrid.\n */\nfunction ruleNodeToTileItem(node: RuleNode): BaseTileItem & { data: RuleNode[\"data\"] } {\n return {\n id: node.id,\n label: node.label,\n count: node.count ?? 0,\n fileCount: node.fileCount,\n data: node.data,\n };\n}\n\n/**\n * Convert FileForRuleNode to BaseTileItem for TileGrid.\n */\nfunction fileNodeToTileItem(node: FileForRuleNode): BaseTileItem & { data: FileForRuleNode[\"data\"] } {\n return {\n id: node.id,\n label: node.label,\n subtitle: node.subtitle,\n tileType: node.tileType,\n count: node.count ?? 0,\n severityCounts: node.severityCounts,\n data: node.data,\n };\n}\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface IssuesListProps {\n /** Additional class name */\n className?: string;\n}\n\n// ============================================================================\n// Empty State\n// ============================================================================\n\nfunction EmptyState() {\n return (\n <div className=\"flex flex-col items-center justify-center py-12 px-4 text-center\">\n <div className=\"text-4xl mb-4 opacity-30\">✨</div>\n <h3 className=\"text-lg font-medium text-foreground/80 mb-2\">\n No issues found\n </h3>\n <p className=\"text-sm text-muted-foreground/60 max-w-xs\">\n Great job! Your code looks clean.\n </p>\n </div>\n );\n}\n\n// ============================================================================\n// Constants for height calculation\n// ============================================================================\n\n/** Approximate height of the breadcrumb bar */\nconst BREADCRUMB_HEIGHT = 34;\n\n/** Approximate height of compact RuleHeader component */\nconst RULE_HEADER_HEIGHT = 40;\n\n/** Height for file content area when showing inline (issue summary or source view) */\nconst FILE_CONTENT_MIN_HEIGHT = 300;\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function IssuesList({ className }: IssuesListProps) {\n // Ref for scrolling\n const scrollContainerRef = useRef<HTMLDivElement>(null);\n\n // Store selectors\n const fileGroups = useComposedStore(selectFileGroups);\n const expandedRuleId = useComposedStore((s) => s.inspector.expandedRuleId);\n const expandedFilePath = useComposedStore((s) => s.inspector.expandedFilePath);\n const selectedIssueId = useComposedStore((s) => s.inspector.selectedIssueId);\n const showFullSource = useComposedStore((s) => s.inspector.showFullSource);\n const availableWidth = useComposedStore((s) => s.inspector.layoutAvailableWidth);\n\n // Store actions\n const expandRule = useComposedStore((s) => s.expandRule);\n const collapseRule = useComposedStore((s) => s.collapseRule);\n const expandFileInRule = useComposedStore((s) => s.expandFileInRule);\n const collapseFileInRule = useComposedStore((s) => s.collapseFileInRule);\n const selectIssue = useComposedStore((s) => s.selectIssue);\n const showFullSourceView = useComposedStore((s) => s.showFullSourceView);\n\n // Transform fileGroups to rule nodes\n const ruleNodes = useMemo(() => fileGroupsToRuleNodes(fileGroups), [fileGroups]);\n\n // Get the expanded rule and its file nodes\n const expandedRule = useMemo(\n () => ruleNodes.find((r) => r.id === expandedRuleId) || null,\n [ruleNodes, expandedRuleId]\n );\n const fileNodes = useMemo(\n () => (expandedRule ? getFileNodesForRule(expandedRule) : []),\n [expandedRule]\n );\n const expandedFile = useMemo(\n () => fileNodes.find((f) => f.data.filePath === expandedFilePath) || null,\n [fileNodes, expandedFilePath]\n );\n\n // Convert nodes to BaseTileItem format for TileGrid\n const ruleTileItems = useMemo(\n () => ruleNodes.map(ruleNodeToTileItem),\n [ruleNodes]\n );\n const fileTileItems = useMemo(\n () => fileNodes.map(fileNodeToTileItem),\n [fileNodes]\n );\n\n // Get issues for the expanded file, FILTERED by the expanded rule\n // Uses expandedFile.data.issues which contains only issues for this rule\n \n const expandedFileIssues = useMemo(() => {\n if (!expandedFilePath || !expandedFile || !expandedRule) return [];\n // Enrich the simplified issue data with full Issue fields\n return expandedFile.data.issues.map((issue) => ({\n ...issue,\n ruleId: expandedRule.id,\n pluginId: \"eslint\",\n filePath: expandedFilePath,\n dataLoc: `${expandedFilePath}:${issue.line}:${issue.column ?? 0}`,\n }));\n }, [expandedFilePath, expandedFile, expandedRule]);\n\n // No auto-expand - user must click to expand a rule\n\n // Auto-expand rule and file containing selected issue (e.g., from heatmap click)\n useEffect(() => {\n if (!selectedIssueId) return;\n\n // Find which rule and file contains the selected issue\n for (const rule of ruleNodes) {\n for (const file of rule.data.files) {\n const hasIssue = file.issues.some((issue) => issue.id === selectedIssueId);\n if (hasIssue) {\n // Expand the rule if not already expanded\n if (expandedRuleId !== rule.id) {\n expandRule(rule.id);\n }\n // Then expand the file within the rule\n if (expandedFilePath !== file.filePath) {\n expandFileInRule(file.filePath);\n }\n return;\n }\n }\n }\n }, [selectedIssueId, ruleNodes, expandedRuleId, expandedFilePath, expandRule, expandFileInRule]);\n\n // Auto-scroll expanded tile to top of viewport when rule is expanded\n useEffect(() => {\n if (!expandedRuleId || !scrollContainerRef.current) return;\n\n // Small delay to let the layout animation start\n const timeoutId = setTimeout(() => {\n // Find the expanded tile element by its data attribute\n const expandedTile = scrollContainerRef.current?.querySelector(\n `[data-tile-id=\"${expandedRuleId}\"]`\n );\n\n if (expandedTile && typeof expandedTile.scrollIntoView === \"function\") {\n // Scroll the tile to the top of the scroll container\n expandedTile.scrollIntoView({\n behavior: \"smooth\",\n block: \"start\",\n });\n }\n }, 50); // Small delay to let layout settle\n\n return () => clearTimeout(timeoutId);\n }, [expandedRuleId]);\n\n // Handle issue selection\n const handleIssueSelect = useCallback(\n (issueId: string) => {\n selectIssue(selectedIssueId === issueId ? null : issueId);\n },\n [selectedIssueId, selectIssue]\n );\n\n // Get current rule config from ESLint store\n const ruleConfig = useComposedStore((s) => {\n if (!expandedRuleId) return null;\n const eslintState = s.plugins?.eslint as ESLintPluginSlice | undefined;\n if (!eslintState?.ruleConfigs) return null;\n return eslintState.ruleConfigs.get(expandedRuleId);\n });\n\n // Get rule metadata including optionSchema\n const ruleMetadata = useComposedStore((s) => {\n if (!expandedRuleId) return null;\n const eslintState = s.plugins?.eslint as ESLintPluginSlice | undefined;\n if (!eslintState?.availableRules) return null;\n return eslintState.availableRules.find((r) => r.id === expandedRuleId);\n });\n\n // Get isUpdating state\n const isRuleUpdating = useComposedStore((s) => {\n if (!expandedRuleId) return false;\n const eslintState = s.plugins?.eslint as ESLintPluginSlice | undefined;\n if (!eslintState?.ruleConfigUpdating) return false;\n return eslintState.ruleConfigUpdating.get(expandedRuleId) ?? false;\n });\n\n // Handle severity change - calls plugin registry to update ESLint config\n const handleSeverityChange = useCallback(\n (severity: \"off\" | \"warn\" | \"error\") => {\n if (!expandedRuleId) return;\n // Map \"warn\" to \"warning\" for plugin registry API\n const apiSeverity = severity === \"warn\" ? \"warning\" : severity;\n pluginRegistry.setRuleSeverity(expandedRuleId, apiSeverity);\n },\n [expandedRuleId]\n );\n\n // Handle option change - calls plugin registry to update ESLint config\n const handleOptionChange = useCallback(\n (key: string, value: unknown) => {\n if (!expandedRuleId) return;\n // Merge the changed option with current options\n const currentOptions = ruleConfig?.options ?? {};\n const newOptions = { ...currentOptions, [key]: value };\n pluginRegistry.setRuleConfig(expandedRuleId, newOptions);\n },\n [expandedRuleId, ruleConfig?.options]\n );\n\n // Handle reset to defaults\n const handleResetOptions = useCallback(() => {\n if (!expandedRuleId || !ruleMetadata?.defaultOptions) return;\n // defaultOptions is typically an array with the first element being the options object\n const defaultOpts = Array.isArray(ruleMetadata.defaultOptions)\n ? (ruleMetadata.defaultOptions[0] as Record<string, unknown>) ?? {}\n : (ruleMetadata.defaultOptions as Record<string, unknown>) ?? {};\n pluginRegistry.setRuleConfig(expandedRuleId, defaultOpts);\n }, [expandedRuleId, ruleMetadata?.defaultOptions]);\n\n // Determine current rule severity from ESLint config\n const currentRuleSeverity: \"off\" | \"warn\" | \"error\" = useMemo(() => {\n if (!ruleConfig?.severity) return \"warn\";\n return ruleConfig.severity;\n }, [ruleConfig?.severity]);\n\n // Get default options for the rule\n const defaultOptions = useMemo(() => {\n if (!ruleMetadata?.defaultOptions) return {};\n return Array.isArray(ruleMetadata.defaultOptions)\n ? (ruleMetadata.defaultOptions[0] as Record<string, unknown>) ?? {}\n : (ruleMetadata.defaultOptions as Record<string, unknown>) ?? {};\n }, [ruleMetadata?.defaultOptions]);\n\n // Extra height for expanded tile\n // When showing file content inline, we need more height\n const extraExpandedHeight = expandedFilePath\n ? BREADCRUMB_HEIGHT + RULE_HEADER_HEIGHT + FILE_CONTENT_MIN_HEIGHT\n : BREADCRUMB_HEIGHT + RULE_HEADER_HEIGHT;\n\n // Custom render function for expanded rule tile content\n // Renders RuleHeader (with config popover) and either file tiles or file content INSIDE the expanded tile\n const renderExpandedRuleContent = useCallback(\n (\n item: BaseTileItem,\n children: BaseTileItem[],\n childrenHeight: number,\n tileAvailableWidth: number\n ) => {\n // Check if a file is expanded within this rule\n const isFileExpanded = expandedFilePath !== null;\n\n return (\n <motion.div\n data-tile-id={item.id}\n layoutId={`tile-${item.id}`}\n initial={{ opacity: 0.9 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0.9 }}\n transition={{ duration: DURATIONS.expand, ease: crispEase }}\n className={cn(\n \"rounded-xl\",\n \"border border-foreground/[0.05]\",\n \"bg-background/80\",\n \"overflow-hidden\",\n \"shadow-sm\",\n \"h-full flex flex-col\"\n )}\n >\n {/* Breadcrumb navigation - inside the expanded tile for locality */}\n <Breadcrumbs\n variant=\"embedded\"\n expandedRuleName={expandedRule?.label ?? null}\n expandedFileName={expandedFile?.label ?? null}\n onCollapseToRoot={collapseRule}\n onCollapseFile={collapseFileInRule}\n />\n\n {/* Content area */}\n <div className=\"flex-1 flex flex-col overflow-hidden\">\n {/* Rule description & config popover */}\n <RuleHeader\n ruleFilter={{ type: \"rule\", id: item.id, label: item.label }}\n description={ruleMetadata?.description ?? getRuleDescription(item.id)}\n category={ruleMetadata?.category ?? getRuleCategory(item.id)}\n docsUrl={ruleMetadata?.docs ?? getRuleDocsUrl(item.id)}\n onClear={collapseRule}\n showCloseButton={false}\n highestSeverity={expandedRule?.data.highestSeverity}\n issueCount={expandedRule?.count}\n // Config props for popover\n currentSeverity={currentRuleSeverity}\n onSeverityChange={handleSeverityChange}\n optionSchema={ruleMetadata?.optionSchema}\n currentOptions={ruleConfig?.options}\n defaultOptions={defaultOptions}\n onOptionChange={handleOptionChange}\n onResetOptions={handleResetOptions}\n isUpdating={isRuleUpdating}\n />\n\n {/* Content: either file tiles or file content */}\n {!isFileExpanded ? (\n /* File tiles grid - when no file is expanded */\n <div className=\"p-3\">\n <TileGrid\n items={children}\n onTileClick={(fileItem) => {\n const fileNode = fileNodes.find((f) => f.id === fileItem.id);\n if (fileNode) {\n expandFileInRule(fileNode.data.filePath);\n }\n }}\n selectedIndex={-1}\n availableWidth={tileAvailableWidth - 24} // Account for padding\n padding={{ top: 0, right: 0, bottom: 0, left: 0 }}\n />\n </div>\n ) : !showFullSource ? (\n /* Issue summary view - when file is expanded but not showing full source */\n <div className=\"flex-1 overflow-auto\">\n <IssueSummaryView\n issues={expandedFileIssues}\n selectedIssueId={selectedIssueId}\n onIssueClick={(issue) => {\n selectIssue(issue.id);\n // After selecting, go to full source view\n showFullSourceView();\n }}\n onShowFullSource={showFullSourceView}\n />\n </div>\n ) : (\n /* Full source view - when file is expanded and showing full source */\n <div className=\"flex-1 overflow-auto p-3\">\n <FileSourceView\n filePath={expandedFilePath}\n issues={expandedFileIssues}\n contextLines={2}\n selectedIssueId={selectedIssueId}\n onIssueSelect={handleIssueSelect}\n enabled={true}\n />\n </div>\n )}\n </div>\n </motion.div>\n );\n },\n [\n collapseRule,\n ruleMetadata,\n currentRuleSeverity,\n handleSeverityChange,\n ruleConfig?.options,\n defaultOptions,\n handleOptionChange,\n handleResetOptions,\n isRuleUpdating,\n fileNodes,\n expandFileInRule,\n expandedFilePath,\n showFullSource,\n expandedFileIssues,\n selectedIssueId,\n selectIssue,\n showFullSourceView,\n handleIssueSelect,\n expandedRule,\n ]\n );\n\n return (\n <div className={cn(\"flex flex-col h-full\", className)}>\n {/* Main content - mosaic tile grid with in-place expansion */}\n {/* File views are now rendered INSIDE the expanded rule tile via renderExpandedContent */}\n <div ref={scrollContainerRef} className=\"flex-1 p-4 overflow-auto\">\n {fileGroups.length === 0 ? (\n <EmptyState />\n ) : (\n <ExpandableTileGrid\n items={ruleTileItems}\n expandedId={expandedRuleId}\n expandedChildren={fileTileItems}\n onTileClick={(item) => expandRule(item.id)}\n onExpandedChildClick={(item) => {\n // Find the original file node to get the filePath\n const fileNode = fileNodes.find((f) => f.id === item.id);\n if (fileNode) {\n expandFileInRule(fileNode.data.filePath);\n }\n }}\n onBack={collapseRule}\n availableWidth={availableWidth}\n extraExpandedHeight={extraExpandedHeight}\n padding={{ top: 0, right: 0, bottom: 0, left: 0 }}\n renderExpandedContent={renderExpandedRuleContent}\n />\n )}\n </div>\n </div>\n );\n}\n\n// ============================================================================\n// Helpers (placeholder - will need rule metadata integration)\n// ============================================================================\n\n/**\n * Get rule description from metadata.\n * TODO: Integrate with ESLint available rules\n */\nfunction getRuleDescription(ruleId: string): string | undefined {\n // Placeholder descriptions for common rules\n const descriptions: Record<string, string> = {\n \"no-unused-vars\": \"Disallow variables that are declared but never used in the code.\",\n \"@typescript-eslint/no-unused-vars\": \"Disallow variables that are declared but never used in the code.\",\n \"no-console\": \"Disallow the use of console methods.\",\n \"react-hooks/exhaustive-deps\": \"Checks effect dependencies and warns when dependencies are missing.\",\n \"react-hooks/rules-of-hooks\": \"Enforces the Rules of Hooks.\",\n \"no-explicit-any\": \"Disallow the any type to encourage more precise typing.\",\n \"@typescript-eslint/no-explicit-any\": \"Disallow the any type to encourage more precise typing.\",\n };\n return descriptions[ruleId];\n}\n\n/**\n * Get rule category from metadata.\n * TODO: Integrate with ESLint available rules\n */\nfunction getRuleCategory(ruleId: string): string | undefined {\n if (ruleId.startsWith(\"@typescript-eslint/\")) return \"TypeScript\";\n if (ruleId.startsWith(\"react-hooks/\")) return \"React Hooks\";\n if (ruleId.startsWith(\"react/\")) return \"React\";\n return \"ESLint\";\n}\n\n/**\n * Get rule documentation URL.\n */\nfunction getRuleDocsUrl(ruleId: string): string | undefined {\n if (ruleId.startsWith(\"@typescript-eslint/\")) {\n const shortName = ruleId.replace(\"@typescript-eslint/\", \"\");\n return `https://typescript-eslint.io/rules/${shortName}`;\n }\n if (ruleId.startsWith(\"react-hooks/\")) {\n return \"https://reactjs.org/docs/hooks-rules.html\";\n }\n if (ruleId.startsWith(\"react/\")) {\n const shortName = ruleId.replace(\"react/\", \"\");\n return `https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/${shortName}.md`;\n }\n // Default ESLint core rules\n return `https://eslint.org/docs/latest/rules/${ruleId}`;\n}\n\nexport default IssuesList;\n","export type DedentResult = {\n lines: string[];\n /** Number of leading whitespace characters removed */\n removed: number;\n};\n\nfunction leadingWhitespace(s: string): string {\n const match = s.match(/^[\\t ]+/);\n return match ? match[0] : \"\";\n}\n\n/**\n * Dedent a set of source lines by removing the minimum common leading indentation.\n *\n * - Ignores empty/whitespace-only lines when computing the minimum indent\n * - Removes up to that many leading whitespace characters from all lines\n * - Does not trim non-whitespace content\n */\nexport function dedentLines(lines: string[]): DedentResult {\n if (!lines.length) return { lines, removed: 0 };\n\n const nonEmpty = lines.filter((l) => l.trim().length > 0);\n if (!nonEmpty.length) return { lines, removed: 0 };\n\n let min = Infinity;\n for (const l of nonEmpty) {\n min = Math.min(min, leadingWhitespace(l).length);\n if (min === 0) break;\n }\n\n if (!Number.isFinite(min) || min <= 0) return { lines, removed: 0 };\n\n return {\n removed: min,\n lines: lines.map((l) => (l.length >= min ? l.slice(min) : \"\")),\n };\n}\n","/**\n * SourceViewer - Displays source code with line highlighting\n *\n * Features:\n * - Shows context lines around the issue\n * - Highlights the issue line with accent color\n * - Line numbers in gutter\n * - Collapsible\n * - Handles loading/error states\n */\nimport React, { useState } from \"react\";\nimport { ChevronDownIcon, ChevronRightIcon } from \"../../icons\";\nimport { useSourceCode } from \"../../hooks/useSourceCode\";\nimport { dedentLines } from \"../../../components/ui-lint/code-formatting\";\nimport { cn } from \"../../../lib/utils\";\n\ninterface SourceViewerProps {\n filePath: string;\n line: number;\n column?: number;\n contextLines?: number;\n defaultExpanded?: boolean;\n}\n\nexport function SourceViewer({\n filePath,\n line,\n column,\n contextLines = 5,\n defaultExpanded = true,\n}: SourceViewerProps) {\n const [expanded, setExpanded] = useState(defaultExpanded);\n\n const { context, isLoading, error } = useSourceCode({\n filePath,\n line,\n contextAbove: contextLines,\n contextBelow: contextLines,\n enabled: expanded,\n });\n\n // Dedent for cleaner display\n const dedented = context ? dedentLines(context.lines) : null;\n\n // Calculate gutter width based on max line number\n const maxLineNumber = context\n ? context.startLine + context.lines.length - 1\n : 0;\n const gutterWidth = Math.max(3, String(maxLineNumber).length) * 8 + 16;\n\n return (\n <div className=\"bg-background rounded-lg overflow-hidden border border-border\">\n {/* Header */}\n <button\n onClick={() => setExpanded(!expanded)}\n className={cn(\n \"w-full flex items-center gap-2 py-2 px-3 bg-surface-elevated border-none cursor-pointer text-text-primary text-xs font-inherit\",\n expanded && \"border-b border-border\"\n )}\n >\n {expanded ? (\n <ChevronDownIcon size={14} />\n ) : (\n <ChevronRightIcon size={14} />\n )}\n <span className=\"font-medium\">Source</span>\n <span className=\"text-text-muted ml-auto font-mono\">\n L{line}\n {column ? `:${column}` : \"\"}\n </span>\n </button>\n\n {/* Content */}\n {expanded && (\n <div className=\"p-0\">\n {isLoading && (\n <div className=\"p-6 text-text-muted text-center text-xs\">\n Loading...\n </div>\n )}\n\n {error && (\n <div className=\"p-6 text-error text-center text-xs\">{error}</div>\n )}\n\n {dedented && context && (\n <div className=\"overflow-x-auto text-xs font-mono leading-relaxed\">\n {dedented.lines.map((lineContent, index) => {\n const lineNumber = context.startLine + index;\n const isHighlighted = lineNumber === line;\n\n return (\n <div\n key={lineNumber}\n className={cn(\n \"flex border-l-[3px]\",\n isHighlighted\n ? \"bg-warning-bg border-l-warning\"\n : \"bg-transparent border-l-transparent\"\n )}\n >\n <span\n className={cn(\n \"py-0 px-2 text-right bg-surface-elevated select-none shrink-0 border-r border-border\",\n isHighlighted\n ? \"text-text-primary\"\n : \"text-text-disabled\"\n )}\n style={{\n width: gutterWidth,\n minWidth: gutterWidth,\n }}\n >\n {lineNumber}\n </span>\n <code\n className={cn(\n \"py-0 px-3 whitespace-pre flex-1\",\n isHighlighted\n ? \"text-text-primary\"\n : \"text-text-secondary\"\n )}\n >\n {lineContent || \" \"}\n </code>\n </div>\n );\n })}\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n","/**\n * IssueDetail - Shows details for a single issue\n *\n * Clean, elegant UI with:\n * - Header: severity icon + message + rule ID\n * - Source code viewer with highlighted line\n * - Compact metadata footer\n */\nimport React from \"react\";\nimport { WarningIcon, ErrorIcon, InfoIcon } from \"../../icons\";\nimport { SourceViewer } from \"./SourceViewer\";\nimport { Badge } from \"../primitives\";\nimport type { Issue } from \"../../types\";\n\ninterface IssueDetailProps {\n issue: Issue;\n}\n\n/**\n * Extract filename from path\n */\nfunction getFileName(filePath: string): string {\n const parts = filePath.split(\"/\");\n return parts[parts.length - 1] || filePath;\n}\n\nexport function IssueDetail({ issue }: IssueDetailProps) {\n const SeverityIcon =\n issue.severity === \"error\"\n ? ErrorIcon\n : issue.severity === \"warning\"\n ? WarningIcon\n : InfoIcon;\n\n return (\n <div className=\"p-4 flex flex-col gap-4\">\n {/* Header: Severity Badge + Message + Rule */}\n <div className=\"flex items-start gap-2.5\">\n <Badge\n variant={issue.severity === \"error\" ? \"error\" : issue.severity === \"warning\" ? \"warning\" : \"info\"}\n size=\"sm\"\n disableAnimation\n className=\"shrink-0 mt-0.5\"\n >\n <SeverityIcon\n size={12}\n color=\"currentColor\"\n className=\"mr-1\"\n />\n {issue.severity}\n </Badge>\n <div className=\"flex-1 min-w-0\">\n <div className=\"text-sm font-medium text-text-primary leading-snug\">\n {issue.message}\n </div>\n <Badge\n variant=\"outline\"\n size=\"sm\"\n disableAnimation\n className=\"mt-1.5 font-mono\"\n >\n {issue.ruleId}\n </Badge>\n </div>\n </div>\n\n {/* Source Viewer */}\n <SourceViewer\n filePath={issue.filePath}\n line={issue.line}\n column={issue.column}\n contextLines={5}\n />\n\n {/* Compact Metadata Footer */}\n <div className=\"flex flex-wrap gap-y-1 gap-x-3 text-[11px] text-text-muted font-mono\">\n <span title={issue.filePath}>\n {getFileName(issue.filePath)}:{issue.line}\n {issue.column ? `:${issue.column}` : \"\"}\n </span>\n <span className=\"opacity-50\">|</span>\n <span>{issue.pluginId}</span>\n </div>\n </div>\n );\n}\n","/**\n * ElementDetail - Shows issues for a specific element (dataLoc)\n */\nimport React from \"react\";\nimport { useIssues } from \"../../hooks\";\nimport { WarningIcon, ErrorIcon, InfoIcon } from \"../../icons\";\nimport { Badge, Card } from \"../primitives\";\nimport { cn } from \"../../../lib/utils\";\nimport type { Issue } from \"../../types\";\n\ninterface ElementDetailProps {\n dataLoc: string;\n onSelectIssue: (issue: Issue) => void;\n}\n\nexport function ElementDetail({ dataLoc, onSelectIssue }: ElementDetailProps) {\n const { getIssuesForDataLoc } = useIssues();\n const issues = getIssuesForDataLoc(dataLoc);\n\n if (issues.length === 0) {\n return (\n <div className=\"p-4 text-center text-text-muted\">\n No issues for this element\n </div>\n );\n }\n\n return (\n <div className=\"p-4\">\n <div className=\"text-sm font-semibold text-text-primary mb-3\">\n {issues.length} issue{issues.length !== 1 ? \"s\" : \"\"} at this location\n </div>\n\n <Card variant=\"elevated\" className=\"overflow-hidden\">\n {issues.map((issue, index) => {\n const SeverityIcon = issue.severity === \"error\" ? ErrorIcon\n : issue.severity === \"warning\" ? WarningIcon\n : InfoIcon;\n\n return (\n <div\n key={issue.id}\n onClick={() => onSelectIssue(issue)}\n className={cn(\n \"flex items-start gap-2.5 p-3 cursor-pointer\",\n index < issues.length - 1 && \"border-b border-border\"\n )}\n >\n <Badge\n variant={issue.severity === \"error\" ? \"error\" : issue.severity === \"warning\" ? \"warning\" : \"info\"}\n size=\"sm\"\n disableAnimation\n className=\"shrink-0\"\n >\n <SeverityIcon size={12} color=\"currentColor\" />\n </Badge>\n <div className=\"flex-1\">\n <div className=\"text-[13px] text-text-primary\">\n {issue.message}\n </div>\n <div className=\"text-[11px] text-text-muted mt-0.5\">\n {issue.ruleId}\n </div>\n </div>\n </div>\n );\n })}\n </Card>\n\n <div className=\"mt-3 text-[11px] text-text-disabled break-all\">\n {dataLoc}\n </div>\n </div>\n );\n}\n","/**\n * ResizeHandle - Reusable resize handle for inspector sidebar\n *\n * Supports horizontal (docked sidebar width), vertical (height), and corner (both) resize.\n */\nimport React, { useCallback, useRef, useEffect } from \"react\";\n\ninterface ResizeHandleProps {\n /** Direction of resize */\n direction: \"horizontal\" | \"vertical\" | \"corner\";\n /** Called during resize with delta values */\n onResize: (deltaX: number, deltaY: number) => void;\n /** Called when resize starts */\n onResizeStart?: () => void;\n /** Called when resize ends */\n onResizeEnd?: () => void;\n}\n\nexport function ResizeHandle({\n direction,\n onResize,\n onResizeStart,\n onResizeEnd,\n}: ResizeHandleProps) {\n const isDragging = useRef(false);\n const lastPos = useRef({ x: 0, y: 0 });\n\n const handleMouseDown = useCallback(\n (e: React.MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n isDragging.current = true;\n lastPos.current = { x: e.clientX, y: e.clientY };\n onResizeStart?.();\n },\n [onResizeStart]\n );\n\n useEffect(() => {\n const handleMouseMove = (e: MouseEvent) => {\n if (!isDragging.current) return;\n\n const deltaX = e.clientX - lastPos.current.x;\n const deltaY = e.clientY - lastPos.current.y;\n lastPos.current = { x: e.clientX, y: e.clientY };\n\n onResize(deltaX, deltaY);\n };\n\n const handleMouseUp = () => {\n if (isDragging.current) {\n isDragging.current = false;\n onResizeEnd?.();\n }\n };\n\n document.addEventListener(\"mousemove\", handleMouseMove);\n document.addEventListener(\"mouseup\", handleMouseUp);\n\n return () => {\n document.removeEventListener(\"mousemove\", handleMouseMove);\n document.removeEventListener(\"mouseup\", handleMouseUp);\n };\n }, [onResize, onResizeEnd]);\n\n const baseStyle: React.CSSProperties = {\n position: \"absolute\",\n zIndex: 10,\n };\n\n const directionStyles: Record<typeof direction, React.CSSProperties> = {\n horizontal: {\n ...baseStyle,\n top: 0,\n left: 0,\n width: 4,\n height: \"100%\",\n cursor: \"col-resize\",\n },\n vertical: {\n ...baseStyle,\n bottom: 0,\n left: 0,\n width: \"100%\",\n height: 4,\n cursor: \"row-resize\",\n },\n corner: {\n ...baseStyle,\n bottom: 0,\n right: 0,\n width: 12,\n height: 12,\n cursor: \"nwse-resize\",\n },\n };\n\n return (\n <div\n onMouseDown={handleMouseDown}\n style={{\n ...directionStyles[direction],\n background: \"transparent\",\n }}\n onMouseEnter={(e) => {\n (e.target as HTMLDivElement).style.background = \"rgba(59, 130, 246, 0.2)\";\n }}\n onMouseLeave={(e) => {\n if (!isDragging.current) {\n (e.target as HTMLDivElement).style.background = \"transparent\";\n }\n }}\n />\n );\n}\n","/**\n * InspectorSidebar - Docked or floating panel showing issues\n *\n * Two modes:\n * - Docked: Fixed to right edge, pushes page content via document margin\n * - Floating: Draggable, resizable popup window\n *\n * Now uses the unified IssuesList component as the primary content,\n * with the same filter model as tiles and heatmap.\n *\n * Legacy panel support (issue, element, plugin panels) is preserved\n * for backwards compatibility but deprecated.\n *\n * Drag state is managed by the centralized drag-slice in the store.\n * Auto-undock on mobile is handled by the subscription system (initializeInspectorAutoUndock).\n */\nimport React, { useMemo, useCallback, useEffect, useLayoutEffect, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { AnimatePresence, motion } from \"motion/react\";\nimport { useComposedStore, getPluginServices } from \"../../../core/store\";\nimport { pluginRegistry } from \"../../../core/plugin-system/registry\";\nimport { IssuesList } from \"./IssuesList\";\nimport { IssueDetail } from \"./IssueDetail\";\nimport { ElementDetail } from \"./ElementDetail\";\nimport { ResizeHandle } from \"./ResizeHandle\";\nimport { CloseIcon, MaximizeIcon, DockIcon } from \"../../icons\";\nimport { IconButton, getGlassStyles } from \"../primitives\";\nimport { cn } from \"../../../lib/utils\";\nimport type { Issue } from \"../../types\";\n\nconst MIN_WIDTH = 320;\nconst MAX_WIDTH = 800;\nconst DEFAULT_FLOATING_WIDTH = 450;\nconst DEFAULT_FLOATING_HEIGHT = 500;\n\nexport function InspectorSidebar() {\n const isOpen = useComposedStore((s) => s.inspector.open);\n const panelId = useComposedStore((s) => s.inspector.panelId);\n const panelData = useComposedStore((s) => s.inspector.data);\n const docked = useComposedStore((s) => s.inspector.docked);\n const width = useComposedStore((s) => s.inspector.width);\n const floatingPosition = useComposedStore((s) => s.inspector.floatingPosition);\n const floatingSize = useComposedStore((s) => s.inspector.floatingSize);\n\n const closeInspector = useComposedStore((s) => s.closeInspector);\n const openInspector = useComposedStore((s) => s.openInspector);\n const toggleInspectorDocked = useComposedStore((s) => s.toggleInspectorDocked);\n const setInspectorWidth = useComposedStore((s) => s.setInspectorWidth);\n const setInspectorFloatingPosition = useComposedStore((s) => s.setInspectorFloatingPosition);\n const setInspectorFloatingSize = useComposedStore((s) => s.setInspectorFloatingSize);\n\n // Track if component is mounted (for SSR safety)\n const [mounted, setMounted] = useState(false);\n\n // Mobile detection from store (updated by subscription system)\n const isMobile = useComposedStore((s) => s.mobile.isMobile);\n\n // Drag state from store (managed by subscription system)\n const activeDrag = useComposedStore((s) => s.activeDrag);\n const startDrag = useComposedStore((s) => s.startDrag);\n const isDragging = activeDrag?.type === \"inspector-floating\";\n\n // Get all inspector panels from plugins\n const pluginPanels = useMemo(() => {\n return pluginRegistry.getAllInspectorPanels();\n }, []);\n\n const handleSelectIssue = useCallback((issue: Issue) => {\n openInspector(\"issue\", { issue });\n }, [openInspector]);\n\n // Determine which view to show\n // Default is now the unified IssuesList, with legacy panel support for backwards compatibility\n const { content, title } = useMemo(() => {\n let content: React.ReactNode = null;\n let title = \"Issues\";\n\n // Check for legacy plugin panel first (backwards compatibility)\n const pluginPanel = pluginPanels.find((p) => p.id === panelId);\n if (pluginPanel) {\n const services = getPluginServices();\n const PanelComponent = pluginPanel.component;\n const data = panelData ?? undefined;\n title = typeof pluginPanel.title === \"function\"\n ? pluginPanel.title({ data, services: services! })\n : pluginPanel.title;\n content = services ? (\n <PanelComponent data={data} services={services} />\n ) : (\n <div className=\"p-4 text-text-muted text-center\">\n Loading...\n </div>\n );\n } else if (panelId === \"issue\" && panelData?.issue) {\n // Legacy: single issue detail view\n const issue = panelData.issue as Issue;\n const ruleContribution = issue.ruleId\n ? pluginRegistry.getRuleContribution(issue.ruleId) ||\n pluginRegistry.getRuleContribution(issue.ruleId.replace(\"uilint/\", \"\"))\n : undefined;\n\n if (ruleContribution?.inspectorPanel) {\n const services = getPluginServices();\n const CustomPanel = ruleContribution.inspectorPanel;\n title = \"Issue Details\";\n content = services ? (\n <CustomPanel data={panelData} services={services} />\n ) : (\n <div className=\"p-4 text-text-muted text-center\">\n Loading...\n </div>\n );\n } else {\n title = \"Issue Details\";\n content = <IssueDetail issue={issue} />;\n }\n } else if (panelId === \"element\" && panelData?.dataLoc) {\n // Legacy: element detail view\n title = \"Element Issues\";\n content = (\n <ElementDetail\n dataLoc={panelData.dataLoc as string}\n onSelectIssue={handleSelectIssue}\n />\n );\n } else {\n // Default: Unified issues list (new primary view)\n // IssuesList reads layoutAvailableWidth directly from store\n title = \"Issues\";\n content = <IssuesList />;\n }\n\n return { content, title };\n }, [panelId, panelData, pluginPanels, handleSelectIssue]);\n\n // Mount effect\n useEffect(() => {\n setMounted(true);\n }, []);\n\n // Note: Auto-undock on mobile is handled by initializeInspectorAutoUndock\n // in the subscription system (subscriptions.ts). No useEffect needed here.\n\n // Manage document margin for docked mode (useLayoutEffect for DOM manipulation)\n useLayoutEffect(() => {\n if (!mounted) return;\n\n const root = document.documentElement;\n\n if (isOpen && docked) {\n // Reserve space on the right for the docked sidebar\n root.style.marginRight = `${width}px`;\n root.style.transition = \"margin-right 0.2s ease-out\";\n } else {\n // Remove the margin when closed or floating\n root.style.marginRight = \"\";\n root.style.transition = \"margin-right 0.2s ease-out\";\n }\n\n // Cleanup on unmount\n return () => {\n root.style.marginRight = \"\";\n root.style.transition = \"\";\n };\n }, [mounted, isOpen, docked, width]);\n\n // Update floating position during drag\n // The subscription system handles mouse/touch move events and updates activeDrag.currentPos\n useLayoutEffect(() => {\n if (!isDragging || !activeDrag || !activeDrag.elementStartPos) return;\n\n const { currentPos, startPos, elementStartPos } = activeDrag;\n const deltaX = currentPos.x - startPos.x;\n const deltaY = currentPos.y - startPos.y;\n setInspectorFloatingPosition({\n x: elementStartPos.x + deltaX,\n y: elementStartPos.y + deltaY,\n });\n }, [isDragging, activeDrag, setInspectorFloatingPosition]);\n\n // Handle docked resize\n const handleDockedResize = useCallback(\n (deltaX: number) => {\n const newWidth = Math.min(MAX_WIDTH, Math.max(MIN_WIDTH, width - deltaX));\n setInspectorWidth(newWidth);\n },\n [width, setInspectorWidth]\n );\n\n // Handle floating resize\n const handleFloatingResize = useCallback(\n (deltaX: number, deltaY: number) => {\n const currentSize = floatingSize ?? { width: DEFAULT_FLOATING_WIDTH, height: DEFAULT_FLOATING_HEIGHT };\n const newWidth = Math.min(MAX_WIDTH, Math.max(MIN_WIDTH, currentSize.width + deltaX));\n const newHeight = Math.max(300, currentSize.height + deltaY);\n setInspectorFloatingSize({ width: newWidth, height: newHeight });\n },\n [floatingSize, setInspectorFloatingSize]\n );\n\n // Drag handlers - just start the drag, the subscription system handles move/end\n const handleDragStart = useCallback(\n (e: React.MouseEvent) => {\n if (!floatingPosition || isMobile) return;\n e.preventDefault();\n const startPos = { x: e.clientX, y: e.clientY };\n // Use offset of {0, 0} since we track element start position directly\n startDrag(\"inspector-floating\", startPos, { x: 0, y: 0 }, floatingPosition);\n },\n [floatingPosition, isMobile, startDrag]\n );\n\n const handleTouchDragStart = useCallback(\n (e: React.TouchEvent) => {\n if (!floatingPosition || isMobile) return;\n const touch = e.touches[0];\n const startPos = { x: touch.clientX, y: touch.clientY };\n startDrag(\"inspector-floating\", startPos, { x: 0, y: 0 }, floatingPosition);\n },\n [floatingPosition, isMobile, startDrag]\n );\n\n // Note: Global mouse/touch move and end events are handled by the subscription system\n // in subscriptions.ts (initializeDragHandlers). This eliminates the need for\n // useEffect-based event listener management.\n\n // Initialize floating position if not set\n useEffect(() => {\n if (!docked && !floatingPosition && mounted) {\n setInspectorFloatingPosition({\n x: window.innerWidth - DEFAULT_FLOATING_WIDTH - 20,\n y: 80,\n });\n }\n }, [docked, floatingPosition, setInspectorFloatingPosition, mounted]);\n\n const portalRoot = document.getElementById(\"uilint-portal\") || document.body;\n\n // Shared header component\n const Header = ({ isDraggable = false }: { isDraggable?: boolean }) => (\n <div\n className={cn(\n \"flex items-center justify-between border-b border-border bg-surface-elevated select-none\",\n isMobile ? \"px-4 py-4\" : \"px-4 py-3\",\n isDraggable && !isMobile ? \"cursor-move\" : \"cursor-default\"\n )}\n style={{\n paddingTop: isMobile ? \"calc(16px + env(safe-area-inset-top, 0px))\" : undefined,\n }}\n onMouseDown={isDraggable && !isMobile ? handleDragStart : undefined}\n onTouchStart={isDraggable && !isMobile ? handleTouchDragStart : undefined}\n >\n <span className=\"font-semibold text-text-primary\">\n {title}\n </span>\n {/* Stop mousedown propagation so header drag doesn't capture button clicks */}\n <div\n className={cn(\"flex items-center\", isMobile ? \"gap-2\" : \"gap-1\")}\n onMouseDown={(e) => e.stopPropagation()}\n onTouchStart={(e) => e.stopPropagation()}\n >\n {/* Hide dock/undock toggle on mobile - not useful in fullscreen mode */}\n {!isMobile && (\n <IconButton\n variant=\"ghost\"\n size=\"sm\"\n onClick={toggleInspectorDocked}\n title={docked ? \"Undock to floating window\" : \"Dock to side\"}\n >\n {docked ? <MaximizeIcon size={16} /> : <DockIcon size={16} />}\n </IconButton>\n )}\n <IconButton\n variant=\"ghost\"\n size={isMobile ? \"default\" : \"sm\"}\n onClick={closeInspector}\n title=\"Close\"\n className={isMobile ? \"min-w-[44px] min-h-[44px]\" : undefined}\n >\n <CloseIcon size={isMobile ? 20 : 16} />\n </IconButton>\n </div>\n </div>\n );\n\n // Glass morphism styles - uses design system primitives\n const glassStyle = getGlassStyles(\"heavy\", \"none\", false);\n\n return createPortal(\n <AnimatePresence>\n {isOpen && docked && (\n // Docked mode - fixed to right edge\n <motion.div\n key=\"docked\"\n initial={{ x: width, opacity: 0 }}\n animate={{ x: 0, opacity: 1 }}\n exit={{ x: width, opacity: 0 }}\n transition={{\n duration: 0.15,\n ease: [0.25, 0.1, 0.25, 1], // cubic-bezier for smooth deceleration\n }}\n className=\"fixed inset-y-0 right-0 flex flex-col border-l border-glass-border shadow-default z-[99997] pointer-events-auto\"\n style={{\n width: width,\n ...glassStyle,\n }}\n >\n <ResizeHandle\n direction=\"horizontal\"\n onResize={(deltaX) => handleDockedResize(deltaX)}\n />\n <Header />\n <div className=\"flex-1 overflow-y-auto\">\n {content}\n </div>\n </motion.div>\n )}\n\n {isOpen && !docked && (\n // Floating mode - draggable, resizable popup (fullscreen on mobile)\n <motion.div\n key=\"floating\"\n initial={{ opacity: 0, scale: isMobile ? 1 : 0.95 }}\n animate={{ opacity: 1, scale: 1 }}\n exit={{ opacity: 0, scale: isMobile ? 1 : 0.95 }}\n transition={{ duration: 0.15 }}\n style={isMobile ? {\n // Mobile: fullscreen overlay\n position: \"fixed\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n ...glassStyle,\n border: \"none\",\n borderRadius: 0,\n boxShadow: \"none\",\n zIndex: 99997,\n display: \"flex\",\n flexDirection: \"column\",\n overflow: \"hidden\",\n pointerEvents: \"auto\",\n } : {\n // Desktop: positioned floating window\n position: \"fixed\",\n left: floatingPosition?.x ?? window.innerWidth - DEFAULT_FLOATING_WIDTH - 20,\n top: floatingPosition?.y ?? 80,\n width: floatingSize?.width ?? DEFAULT_FLOATING_WIDTH,\n height: floatingSize?.height ?? DEFAULT_FLOATING_HEIGHT,\n ...glassStyle,\n border: \"1px solid var(--uilint-glass-border)\",\n borderRadius: 12,\n boxShadow: \"var(--uilint-shadow)\",\n zIndex: 99997,\n display: \"flex\",\n flexDirection: \"column\",\n overflow: \"hidden\",\n pointerEvents: \"auto\",\n }}\n >\n <Header isDraggable />\n <div\n className=\"flex-1 overflow-y-auto min-h-0\"\n style={{\n paddingBottom: isMobile ? \"env(safe-area-inset-bottom, 0px)\" : undefined,\n }}\n >\n {content}\n </div>\n {/* Hide resize handle on mobile - not needed in fullscreen mode */}\n {!isMobile && (\n <ResizeHandle\n direction=\"corner\"\n onResize={handleFloatingResize}\n />\n )}\n </motion.div>\n )}\n </AnimatePresence>,\n portalRoot\n );\n}\n","/* eslint-disable uilint/prefer-tailwind */\n/**\n * PluginToolbar - Renders toolbar action groups contributed by plugins\n *\n * Sits alongside the InspectorToggle in the floating toolbar area.\n * Each plugin toolbar group renders as a button that expands into a menu\n * of actions (e.g., vision capture buttons).\n */\nimport React, { useState, useCallback, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { motion, AnimatePresence } from \"motion/react\";\nimport { useComposedStore, getPluginServices } from \"../../core/store\";\nimport { pluginRegistry } from \"../../core/plugin-system/registry\";\nimport type { ToolbarActionGroup, ToolbarAction } from \"../../core/plugin-system/types\";\nimport { ChevronDown } from \"lucide-react\";\nimport { getGlassStyles } from \"./primitives\";\n\n// ============================================================================\n// ToolbarGroupButton - A single toolbar group with dropdown\n// ============================================================================\n\ninterface ToolbarGroupButtonProps {\n group: ToolbarActionGroup;\n isMobile: boolean;\n disabled?: boolean;\n}\n\nfunction ToolbarGroupButton({ group, isMobile, disabled }: ToolbarGroupButtonProps) {\n const [menuOpen, setMenuOpen] = useState(false);\n const buttonSize = isMobile ? 44 : 36;\n\n const handleToggle = useCallback(() => {\n setMenuOpen((prev) => !prev);\n }, []);\n\n const handleActionClick = useCallback(\n (action: ToolbarAction) => {\n const services = getPluginServices();\n if (services && action.onClick) {\n action.onClick(services);\n }\n setMenuOpen(false);\n },\n []\n );\n\n const portalRoot =\n typeof document !== \"undefined\"\n ? document.getElementById(\"uilint-portal\") || document.body\n : null;\n\n // If there's only one action, render as a direct button (no dropdown)\n if (group.actions.length === 1) {\n const action = group.actions[0];\n return (\n <motion.button\n whileHover={disabled ? undefined : { scale: 1.05 }}\n whileTap={disabled ? undefined : { scale: 0.95 }}\n onClick={disabled ? undefined : () => handleActionClick(action)}\n disabled={disabled}\n aria-label={action.tooltip}\n title={disabled ? `${action.tooltip} (unavailable)` : action.tooltip}\n style={{\n width: buttonSize,\n height: buttonSize,\n borderRadius: buttonSize / 2,\n border: \"none\",\n cursor: disabled ? \"default\" : \"pointer\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: disabled ? 0.4 : 1,\n color: \"var(--uilint-text-secondary)\",\n ...getGlassStyles(\"medium\", \"md\", false),\n borderTop:\n \"1px solid var(--uilint-glass-border-light, rgba(255, 255, 255, 0.8))\",\n borderBottom:\n \"1px solid var(--uilint-glass-border, rgba(255, 255, 255, 0.5))\",\n borderLeft:\n \"1px solid var(--uilint-glass-border-light, rgba(255, 255, 255, 0.8))\",\n borderRight:\n \"1px solid var(--uilint-glass-border, rgba(255, 255, 255, 0.5))\",\n }}\n >\n {action.icon as ReactNode}\n </motion.button>\n );\n }\n\n // Multiple actions: render as button with dropdown\n return (\n <div style={{ position: \"relative\" }}>\n <motion.button\n whileHover={disabled ? undefined : { scale: 1.05 }}\n whileTap={disabled ? undefined : { scale: 0.95 }}\n onClick={disabled ? undefined : handleToggle}\n disabled={disabled}\n aria-label={group.tooltip}\n title={disabled ? `${group.tooltip} (unavailable)` : group.tooltip}\n aria-expanded={menuOpen}\n style={{\n height: buttonSize,\n padding: \"0 10px\",\n borderRadius: buttonSize / 2,\n border: \"none\",\n cursor: disabled ? \"default\" : \"pointer\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: 4,\n opacity: disabled ? 0.4 : 1,\n color: \"var(--uilint-text-secondary)\",\n ...getGlassStyles(\"medium\", \"md\", false),\n borderTop:\n \"1px solid var(--uilint-glass-border-light, rgba(255, 255, 255, 0.8))\",\n borderBottom:\n \"1px solid var(--uilint-glass-border, rgba(255, 255, 255, 0.5))\",\n borderLeft:\n \"1px solid var(--uilint-glass-border-light, rgba(255, 255, 255, 0.8))\",\n borderRight:\n \"1px solid var(--uilint-glass-border, rgba(255, 255, 255, 0.5))\",\n }}\n >\n {group.icon as ReactNode}\n <ChevronDown\n size={12}\n style={{\n opacity: 0.5,\n transform: menuOpen ? \"rotate(180deg)\" : \"rotate(0deg)\",\n transition: \"transform 0.15s ease\",\n }}\n />\n </motion.button>\n\n {/* Dropdown menu */}\n {portalRoot &&\n createPortal(\n <AnimatePresence>\n {menuOpen && (\n <>\n {/* Backdrop to close on click outside */}\n <div\n style={{\n position: \"fixed\",\n inset: 0,\n zIndex: 99991,\n pointerEvents: \"auto\",\n }}\n onClick={() => setMenuOpen(false)}\n />\n <DropdownMenu\n actions={group.actions}\n onAction={handleActionClick}\n buttonSize={buttonSize}\n />\n </>\n )}\n </AnimatePresence>,\n portalRoot\n )}\n </div>\n );\n}\n\n// ============================================================================\n// DropdownMenu - Floating menu for toolbar group actions\n// ============================================================================\n\ninterface DropdownMenuProps {\n actions: ToolbarAction[];\n onAction: (action: ToolbarAction) => void;\n buttonSize: number;\n}\n\nfunction DropdownMenu({ actions, onAction, buttonSize }: DropdownMenuProps) {\n return (\n <motion.div\n initial={{ opacity: 0, scale: 0.95, y: -4 }}\n animate={{ opacity: 1, scale: 1, y: 0 }}\n exit={{ opacity: 0, scale: 0.95, y: -4 }}\n transition={{ duration: 0.15, ease: [0.32, 0.72, 0, 1] }}\n style={{\n position: \"fixed\",\n top: 16 + buttonSize + 8,\n right: 16,\n zIndex: 99992,\n minWidth: 180,\n borderRadius: 12,\n overflow: \"hidden\",\n pointerEvents: \"auto\",\n ...getGlassStyles(\"heavy\", \"lg\", true),\n border:\n \"1px solid var(--uilint-glass-border, rgba(255, 255, 255, 0.5))\",\n boxShadow: \"0 8px 32px rgba(0, 0, 0, 0.12)\",\n }}\n >\n <div style={{ padding: 4 }}>\n {actions.map((action) => (\n <motion.button\n key={action.id}\n whileHover={{\n backgroundColor: \"var(--uilint-hover, rgba(0, 0, 0, 0.05))\",\n }}\n onClick={() => onAction(action)}\n title={action.tooltip}\n style={{\n width: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n padding: \"8px 12px\",\n border: \"none\",\n borderRadius: 8,\n background: \"transparent\",\n cursor: \"pointer\",\n color: \"var(--uilint-text-secondary)\",\n fontFamily:\n '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif',\n fontSize: 13,\n fontWeight: 500,\n textAlign: \"left\",\n }}\n >\n <span\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: 20,\n height: 20,\n opacity: 0.7,\n }}\n >\n {action.icon as ReactNode}\n </span>\n <span>{action.tooltip}</span>\n {action.shortcut && (\n <span\n style={{\n marginLeft: \"auto\",\n fontSize: 11,\n opacity: 0.4,\n fontWeight: 400,\n }}\n >\n {action.shortcut}\n </span>\n )}\n </motion.button>\n ))}\n </div>\n </motion.div>\n );\n}\n\n// ============================================================================\n// PluginToolbar - Main export\n// ============================================================================\n\n/**\n * Renders toolbar action groups from all registered plugins.\n * Each group becomes a button (or button+dropdown) in the floating toolbar.\n */\nexport function PluginToolbar() {\n const isMobile = useComposedStore((s) => s.mobile.isMobile);\n const isInspectorOpen = useComposedStore((s) => s.inspector.open);\n const isCommandPaletteOpen = useComposedStore((s) => s.commandPalette.open);\n\n // Subscribe to plugin state changes to re-evaluate visibility\n const _pluginState = useComposedStore((s) => s.plugins);\n\n // Get all toolbar action groups from the registry\n const allGroups = pluginRegistry.getAllToolbarActionGroups();\n\n // Filter by visibility\n const storeState = useComposedStore();\n const visibleGroups = allGroups.filter((group) => {\n if (!group.isVisible) return true;\n return group.isVisible(storeState);\n });\n\n // Debug: log what we find (only on change)\n if (process.env.NODE_ENV === \"development\" && allGroups.length > 0) {\n console.debug(\n `[PluginToolbar] ${allGroups.length} group(s) registered, ${visibleGroups.length} visible`\n );\n }\n\n // Hide when inspector or command palette is open, or no groups\n if (isInspectorOpen || isCommandPaletteOpen || allGroups.length === 0) {\n return null;\n }\n\n // Render all groups, marking non-visible ones as disabled\n const visibleIds = new Set(visibleGroups.map((g) => g.id));\n\n return (\n <>\n {allGroups.map((group) => (\n <ToolbarGroupButton\n key={group.id}\n group={group}\n isMobile={isMobile}\n disabled={!visibleIds.has(group.id)}\n />\n ))}\n </>\n );\n}\n","/* eslint-disable uilint/prefer-tailwind */\n/**\n * InspectorToggle - Main UI anchor for UILint\n *\n * Positioned at the top-right of the window, serves as the primary entry point\n * to the UILint interface. Includes a keyboard shortcut hint for command palette.\n */\nimport React from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { motion, AnimatePresence } from \"motion/react\";\nimport { useComposedStore } from \"../../core/store\";\nimport { UILintInspectorIcon, SearchIcon } from \"../icons\";\nimport { getGlassStyles } from \"./primitives\";\nimport { PluginToolbar } from \"./PluginToolbar\";\n\n/** Detect macOS for showing correct modifier key symbol */\nfunction isMac(): boolean {\n if (typeof navigator === \"undefined\") return false;\n return navigator.platform.toUpperCase().indexOf(\"MAC\") >= 0;\n}\n\nexport function InspectorToggle() {\n const isInspectorOpen = useComposedStore((s) => s.inspector.open);\n const isCommandPaletteOpen = useComposedStore((s) => s.commandPalette.open);\n const openInspectorPanel = useComposedStore((s) => s.openInspectorPanel);\n const openCommandPalette = useComposedStore((s) => s.openCommandPalette);\n const isMobile = useComposedStore((s) => s.mobile.isMobile);\n const isTouchDevice = useComposedStore((s) => s.mobile.isTouchDevice);\n const wsConnected = useComposedStore((s) => s.wsConnected);\n const connectionMode = useComposedStore((s) => s.connectionStatus.mode);\n\n const portalRoot = document.getElementById(\"uilint-portal\") || document.body;\n\n // Hide when inspector or command palette is open\n if (isInspectorOpen || isCommandPaletteOpen) {\n return null;\n }\n\n const buttonSize = isMobile ? 44 : 36;\n const modKey = isMac() ? \"⌘\" : \"Ctrl+\";\n const showShortcutHint = !isTouchDevice;\n\n // Show status indicator only in websocket mode when disconnected\n const showStatusIndicator = connectionMode === \"websocket\" && !wsConnected;\n\n return createPortal(\n <AnimatePresence>\n <motion.div\n initial={{ opacity: 0, scale: 0.9 }}\n animate={{ opacity: 1, scale: 1 }}\n exit={{ opacity: 0, scale: 0.9 }}\n transition={{ duration: 0.15, ease: [0.32, 0.72, 0, 1] }}\n style={{\n position: \"fixed\",\n top: 16,\n right: 16,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n pointerEvents: \"auto\",\n }}\n >\n {/* Plugin toolbar action groups (e.g., Vision Capture) */}\n <PluginToolbar />\n\n {/* Keyboard shortcut hint - shown on non-touch devices */}\n {showShortcutHint && (\n <motion.div\n initial={{ opacity: 0, x: 10 }}\n animate={{ opacity: 1, x: 0 }}\n transition={{ duration: 0.2, delay: 0.1 }}\n style={{\n height: buttonSize,\n padding: \"0 12px\",\n borderRadius: buttonSize / 2,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontFamily: '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif',\n fontSize: 12,\n fontWeight: 500,\n color: \"var(--uilint-text-muted)\",\n ...getGlassStyles(\"medium\", \"md\", false),\n borderTop: \"1px solid var(--uilint-glass-border-light, rgba(255, 255, 255, 0.8))\",\n borderBottom: \"1px solid var(--uilint-glass-border, rgba(255, 255, 255, 0.5))\",\n borderLeft: \"1px solid var(--uilint-glass-border-light, rgba(255, 255, 255, 0.8))\",\n borderRight: \"1px solid var(--uilint-glass-border, rgba(255, 255, 255, 0.5))\",\n }}\n >\n <span style={{ opacity: 0.7 }}>{modKey}K</span>\n <span style={{ marginLeft: 6, opacity: 0.5 }}>to search</span>\n </motion.div>\n )}\n\n {/* Search button - shown on touch devices (mobile) */}\n {isTouchDevice && (\n <motion.button\n initial={{ opacity: 0, x: 10 }}\n animate={{ opacity: 1, x: 0 }}\n whileHover={{ scale: 1.05 }}\n whileTap={{ scale: 0.95 }}\n transition={{ duration: 0.15, ease: [0.32, 0.72, 0, 1] }}\n onClick={openCommandPalette}\n aria-label=\"Open search\"\n title=\"Search issues\"\n style={{\n width: buttonSize,\n height: buttonSize,\n borderRadius: buttonSize / 2,\n border: \"none\",\n cursor: \"pointer\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: \"var(--uilint-text-secondary)\",\n ...getGlassStyles(\"medium\", \"md\", false),\n borderTop: \"1px solid var(--uilint-glass-border-light, rgba(255, 255, 255, 0.8))\",\n borderBottom: \"1px solid var(--uilint-glass-border, rgba(255, 255, 255, 0.5))\",\n borderLeft: \"1px solid var(--uilint-glass-border-light, rgba(255, 255, 255, 0.8))\",\n borderRight: \"1px solid var(--uilint-glass-border, rgba(255, 255, 255, 0.5))\",\n }}\n >\n <SearchIcon size={isMobile ? 20 : 18} />\n </motion.button>\n )}\n\n {/* Inspector toggle button */}\n <div style={{ position: \"relative\" }}>\n <motion.button\n whileHover={{ scale: 1.05 }}\n whileTap={{ scale: 0.95 }}\n onClick={openInspectorPanel}\n aria-label=\"Open inspector\"\n title={showStatusIndicator ? \"Server not connected - click to see setup instructions\" : \"Open inspector\"}\n style={{\n width: buttonSize,\n height: buttonSize,\n borderRadius: buttonSize / 2,\n border: \"none\",\n cursor: \"pointer\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: \"var(--uilint-text-secondary)\",\n ...getGlassStyles(\"medium\", \"md\", false),\n borderTop: \"1px solid var(--uilint-glass-border-light, rgba(255, 255, 255, 0.8))\",\n borderBottom: \"1px solid var(--uilint-glass-border, rgba(255, 255, 255, 0.5))\",\n borderLeft: \"1px solid var(--uilint-glass-border-light, rgba(255, 255, 255, 0.8))\",\n borderRight: \"1px solid var(--uilint-glass-border, rgba(255, 255, 255, 0.5))\",\n }}\n >\n <UILintInspectorIcon size={isMobile ? 20 : 18} />\n </motion.button>\n\n {/* Status indicator dot - shows when not connected */}\n {showStatusIndicator && (\n <motion.div\n initial={{ scale: 0 }}\n animate={{ scale: 1 }}\n style={{\n position: \"absolute\",\n top: -2,\n right: -2,\n width: 10,\n height: 10,\n borderRadius: \"50%\",\n background: \"var(--uilint-warning, #fbbf24)\",\n border: \"2px solid var(--uilint-surface, #fff)\",\n boxShadow: \"0 1px 3px rgba(0, 0, 0, 0.15)\",\n }}\n title=\"Server not connected\"\n />\n )}\n </div>\n </motion.div>\n </AnimatePresence>,\n portalRoot\n );\n}\n","/* eslint-disable uilint/prefer-tailwind */\n\"use client\";\n\n/**\n * RegionSelector Component\n *\n * Full-screen overlay that allows users to click and drag to select a region\n * for vision capture. Shows a live selection rectangle with dimensions.\n */\n\nimport React, { useEffect, useLayoutEffect, useCallback, useReducer } from \"react\";\nimport { createPortal } from \"react-dom\";\n\nexport interface SelectedRegion {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface RegionSelectorProps {\n /** Whether the selector is active */\n active: boolean;\n /** Called when a region is selected (on mouse up) */\n onRegionSelected: (region: SelectedRegion) => void;\n /** Called when selection is cancelled (Escape key or too small selection) */\n onCancel: () => void;\n}\n\n// Minimum selection size (selection must be larger than this)\nconst MIN_SELECTION_SIZE = 10;\n\n/** Point coordinates */\ninterface Point {\n x: number;\n y: number;\n}\n\n/** Local UI state for region selection */\ninterface SelectionState {\n isSelecting: boolean;\n startPoint: Point | null;\n currentPoint: Point | null;\n mounted: boolean;\n}\n\ntype SelectionAction =\n | { type: \"MOUNT\" }\n | { type: \"START_SELECTION\"; point: Point }\n | { type: \"UPDATE_SELECTION\"; point: Point }\n | { type: \"COMPLETE_SELECTION\" };\n\nconst initialSelectionState: SelectionState = {\n isSelecting: false,\n startPoint: null,\n currentPoint: null,\n mounted: false,\n};\n\nfunction selectionReducer(\n state: SelectionState,\n action: SelectionAction\n): SelectionState {\n switch (action.type) {\n case \"MOUNT\":\n return { ...state, mounted: true };\n case \"START_SELECTION\":\n return {\n ...state,\n isSelecting: true,\n startPoint: action.point,\n currentPoint: action.point,\n };\n case \"UPDATE_SELECTION\":\n return { ...state, currentPoint: action.point };\n case \"COMPLETE_SELECTION\":\n return {\n ...state,\n isSelecting: false,\n startPoint: null,\n currentPoint: null,\n };\n default:\n return state;\n }\n}\n\n// Design tokens\nconst TOKENS = {\n overlayBg: \"rgba(0, 0, 0, 0.5)\",\n selectionBorder: \"var(--uilint-accent, #fbbf24)\",\n selectionBg: \"transparent\",\n textBg: \"var(--uilint-backdrop, rgba(0, 0, 0, 0.8))\",\n textColor: \"var(--uilint-text-primary, #ffffff)\",\n fontFamily: `-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif`,\n fontMono: `\"SF Mono\", Monaco, \"Cascadia Code\", monospace`,\n} as const;\n\nexport function RegionSelector({\n active,\n onRegionSelected,\n onCancel,\n}: RegionSelectorProps) {\n // Consolidated local UI state using reducer\n const [state, dispatch] = useReducer(selectionReducer, initialSelectionState);\n const { isSelecting, startPoint, currentPoint, mounted } = state;\n\n // Mount state for portal\n useEffect(() => {\n dispatch({ type: \"MOUNT\" });\n }, []);\n\n // Calculate selection rectangle\n const getSelectionRect = useCallback((): SelectedRegion | null => {\n if (!startPoint || !currentPoint) return null;\n\n const x = Math.min(startPoint.x, currentPoint.x);\n const y = Math.min(startPoint.y, currentPoint.y);\n const width = Math.abs(currentPoint.x - startPoint.x);\n const height = Math.abs(currentPoint.y - startPoint.y);\n\n return { x, y, width, height };\n }, [startPoint, currentPoint]);\n\n // Handle mouse down - start selection\n const handleMouseDown = useCallback((e: React.MouseEvent) => {\n // Only start selection on left click\n if (e.button !== 0) return;\n\n dispatch({ type: \"START_SELECTION\", point: { x: e.clientX, y: e.clientY } });\n }, []);\n\n // Handle mouse move - update selection\n const handleMouseMove = useCallback(\n (e: React.MouseEvent) => {\n if (!isSelecting || !startPoint) return;\n\n dispatch({ type: \"UPDATE_SELECTION\", point: { x: e.clientX, y: e.clientY } });\n },\n [isSelecting, startPoint]\n );\n\n // Handle mouse up - complete selection\n const handleMouseUp = useCallback(() => {\n if (!isSelecting || !startPoint) return;\n\n const rect = getSelectionRect();\n if (rect && rect.width > MIN_SELECTION_SIZE && rect.height > MIN_SELECTION_SIZE) {\n // Valid selection - notify parent\n onRegionSelected(rect);\n } else {\n // Selection too small - cancel\n onCancel();\n }\n\n // Reset state\n dispatch({ type: \"COMPLETE_SELECTION\" });\n }, [isSelecting, startPoint, getSelectionRect, onRegionSelected, onCancel]);\n\n // Handle escape key\n useEffect(() => {\n if (!active) return;\n\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n e.preventDefault();\n e.stopPropagation();\n onCancel();\n }\n };\n\n document.addEventListener(\"keydown\", handleKeyDown, true);\n return () => {\n document.removeEventListener(\"keydown\", handleKeyDown, true);\n };\n }, [active, onCancel]);\n\n // Prevent page scroll while selecting\n // useLayoutEffect for synchronous DOM style changes to prevent visual flashing\n useLayoutEffect(() => {\n if (!active) return;\n\n const preventScroll = (e: Event) => {\n e.preventDefault();\n };\n\n document.body.style.overflow = \"hidden\";\n document.addEventListener(\"wheel\", preventScroll, { passive: false });\n document.addEventListener(\"touchmove\", preventScroll, { passive: false });\n\n return () => {\n document.body.style.overflow = \"\";\n document.removeEventListener(\"wheel\", preventScroll);\n document.removeEventListener(\"touchmove\", preventScroll);\n };\n }, [active]);\n\n if (!active || !mounted) return null;\n\n const selectionRect = getSelectionRect();\n\n // Get portal root\n const portalRoot = typeof document !== \"undefined\"\n ? document.getElementById(\"uilint-portal\") || document.body\n : null;\n\n if (!portalRoot) return null;\n\n const content = (\n <div\n data-testid=\"region-selector-overlay\"\n data-ui-lint\n onMouseDown={handleMouseDown}\n onMouseMove={handleMouseMove}\n onMouseUp={handleMouseUp}\n style={{\n position: \"fixed\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n zIndex: 999999,\n cursor: \"crosshair\",\n backgroundColor: TOKENS.overlayBg,\n fontFamily: TOKENS.fontFamily,\n }}\n >\n {/* Instructions */}\n <div\n style={{\n position: \"absolute\",\n top: \"20px\",\n left: \"50%\",\n transform: \"translateX(-50%)\",\n padding: \"12px 20px\",\n borderRadius: \"12px\",\n backgroundColor: TOKENS.textBg,\n color: TOKENS.textColor,\n fontSize: \"14px\",\n fontWeight: 500,\n boxShadow: \"0 4px 20px rgba(0, 0, 0, 0.4)\",\n backdropFilter: \"blur(16px)\",\n WebkitBackdropFilter: \"blur(16px)\",\n pointerEvents: \"none\",\n userSelect: \"none\",\n }}\n >\n Click and drag to select a region{\" \"}\n <kbd\n style={{\n padding: \"2px 6px\",\n borderRadius: \"4px\",\n backgroundColor: \"rgba(255, 255, 255, 0.1)\",\n border: \"1px solid rgba(255, 255, 255, 0.2)\",\n fontSize: \"11px\",\n fontFamily: TOKENS.fontMono,\n marginLeft: \"4px\",\n }}\n >\n Esc\n </kbd>{\" \"}\n to cancel\n </div>\n\n {/* Selection rectangle */}\n {selectionRect && selectionRect.width > 0 && selectionRect.height > 0 && (\n <>\n {/* Selection box */}\n <div\n data-testid=\"selection-rectangle\"\n style={{\n position: \"absolute\",\n left: `${selectionRect.x}px`,\n top: `${selectionRect.y}px`,\n width: `${selectionRect.width}px`,\n height: `${selectionRect.height}px`,\n border: `2px solid ${TOKENS.selectionBorder}`,\n backgroundColor: TOKENS.selectionBg,\n pointerEvents: \"none\",\n boxShadow: `0 0 0 9999px ${TOKENS.overlayBg}`,\n }}\n />\n\n {/* Dimensions label */}\n <div\n data-testid=\"dimensions-label\"\n style={{\n position: \"absolute\",\n left: `${selectionRect.x}px`,\n top: `${selectionRect.y - 32}px`,\n padding: \"6px 10px\",\n borderRadius: \"6px\",\n backgroundColor: TOKENS.textBg,\n color: TOKENS.textColor,\n fontSize: \"12px\",\n fontFamily: TOKENS.fontMono,\n fontWeight: 500,\n boxShadow: \"0 2px 8px rgba(0, 0, 0, 0.3)\",\n pointerEvents: \"none\",\n userSelect: \"none\",\n whiteSpace: \"nowrap\",\n }}\n >\n {Math.round(selectionRect.width)} x {Math.round(selectionRect.height)}\n </div>\n </>\n )}\n </div>\n );\n\n return createPortal(content, portalRoot);\n}\n\nexport default RegionSelector;\n","/**\n * UILint - Root component for the UILint overlay UI\n *\n * Renders:\n * - InspectorToggle: Button to open inspector (anchor for UI)\n * - HeatmapOverlay: Colored borders on elements with issues\n * - CommandPalette: Search interface for issues\n * - InspectorSidebar: Detail panel for issues/elements\n * - RegionSelector: Full-screen overlay for plugin-driven region capture\n *\n * Note: Keyboard shortcuts are handled by the subscription system\n * (initializeKeyboardShortcuts in subscriptions.ts) when the store is created.\n */\nimport React, { useEffect, useCallback } from \"react\";\nimport { HeatmapOverlay } from \"./components/HeatmapOverlay\";\nimport { CommandPalette } from \"./components/CommandPalette\";\nimport { InspectorSidebar } from \"./components/Inspector\";\nimport { InspectorToggle } from \"./components/InspectorToggle\";\nimport { RegionSelector } from \"./components/RegionSelector\";\nimport { useComposedStore } from \"../core/store\";\n\n// Track if we created the portal (for cleanup)\nlet portalCreatedByUs = false;\n\n// Create portal container for overlays\nfunction ensurePortalContainer(): HTMLElement | undefined {\n if (typeof document === \"undefined\") return;\n\n let container = document.getElementById(\"uilint-portal\");\n if (!container) {\n container = document.createElement(\"div\");\n container.id = \"uilint-portal\";\n container.style.cssText = \"position: fixed; top: 0; left: 0; z-index: 99990; pointer-events: none;\";\n document.body.appendChild(container);\n portalCreatedByUs = true;\n }\n return container;\n}\n\n// Clean up portal if we created it\nfunction cleanupPortalContainer() {\n if (!portalCreatedByUs) return;\n const container = document.getElementById(\"uilint-portal\");\n if (container) {\n container.remove();\n portalCreatedByUs = false;\n }\n}\n\nexport interface UILintProps {\n /** Whether the UI is enabled */\n enabled?: boolean;\n}\n\n/**\n * Main UILint component\n * Add this to your app to enable the UILint overlay\n */\nexport function UILint({ enabled = true }: UILintProps) {\n // Note: Keyboard shortcuts are handled by the subscription system\n // (initializeKeyboardShortcuts) when the store is created. No hook needed here.\n\n // Get generic overlay interaction state from the core slice\n const overlayInteraction = useComposedStore((s) => s.overlayInteraction);\n const completeOverlayInteraction = useComposedStore((s) => s.completeOverlayInteraction);\n const cancelOverlayInteraction = useComposedStore((s) => s.cancelOverlayInteraction);\n\n const regionSelectionActive = overlayInteraction?.type === \"region-select\";\n\n // Handle region selection completed\n const handleRegionSelected = useCallback(\n (region: { x: number; y: number; width: number; height: number }) => {\n completeOverlayInteraction(region);\n },\n [completeOverlayInteraction]\n );\n\n // Handle region selection cancelled\n const handleRegionCancel = useCallback(() => {\n cancelOverlayInteraction();\n }, [cancelOverlayInteraction]);\n\n // Ensure portal container exists\n useEffect(() => {\n if (enabled) {\n ensurePortalContainer();\n }\n return () => {\n cleanupPortalContainer();\n };\n }, [enabled]);\n\n if (!enabled) {\n return null;\n }\n\n return (\n <>\n <InspectorToggle />\n <HeatmapOverlay />\n <CommandPalette />\n <InspectorSidebar />\n <RegionSelector\n active={regionSelectionActive}\n onRegionSelected={handleRegionSelected}\n onCancel={handleRegionCancel}\n />\n </>\n );\n}\n\nexport default UILint;\n","/**\n * Types for UILint Source Visualization\n */\n\n/**\n * Source location from data-loc attribute\n */\nexport interface SourceLocation {\n fileName: string;\n lineNumber: number;\n columnNumber?: number;\n}\n\n/**\n * A scanned DOM element with its source information\n * Source is always present from data-loc attribute\n */\nexport interface ScannedElement {\n /**\n * Unique per-instance ID derived from data-loc.\n * Format: \"loc:path:line:column#occurrence\"\n */\n id: string;\n element: Element;\n tagName: string;\n className: string;\n /** Source location (always present from data-loc) */\n source: SourceLocation;\n rect: DOMRect;\n}\n\n/**\n * A source file with all its associated elements\n */\nexport interface SourceFile {\n path: string;\n displayName: string;\n color: string;\n elements: ScannedElement[];\n}\n\n/**\n * User-configurable settings for the overlay\n */\nexport interface UILintSettings {\n hideNodeModules: boolean;\n autoScanEnabled: boolean;\n}\n\n/**\n * Auto-scan settings for ESLint analysis.\n * Plugin-specific auto-scan settings are managed by the plugins themselves.\n * Persisted to localStorage.\n */\nexport interface AutoScanSettings {\n eslint: {\n /** Auto-scan when page first loads */\n onPageLoad: boolean;\n /** Re-scan when files change (existing behavior) */\n onFileChange: boolean;\n };\n}\n\n/**\n * Default auto-scan settings\n */\nexport const DEFAULT_AUTO_SCAN_SETTINGS: AutoScanSettings = {\n eslint: {\n onPageLoad: false,\n onFileChange: true,\n },\n};\n\n/**\n * Screenshot capture entry for the gallery.\n * Plugin-specific issue data is stored in the plugin's own state.\n */\nexport interface ScreenshotCapture {\n /** Unique ID for this capture */\n id: string;\n /** Route where the capture was taken */\n route: string;\n /** Base64 data URL of the screenshot (for in-memory captures) */\n dataUrl?: string;\n /** Filename for persisted screenshots (used to fetch from API) */\n filename?: string;\n /** Unix timestamp when captured */\n timestamp: number;\n /** Type of capture */\n type: \"full\" | \"region\";\n /** Region bounds if type is 'region' */\n region?: { x: number; y: number; width: number; height: number };\n /** Whether this is a persisted screenshot loaded from disk */\n persisted?: boolean;\n /** Plugin-specific issues for this capture (opaque to the core) */\n issues?: unknown[];\n}\n\n/**\n * State for the auto-scan feature\n */\nexport interface AutoScanState {\n status: \"idle\" | \"scanning\" | \"paused\" | \"complete\";\n currentIndex: number;\n totalElements: number;\n elements: ScannedElement[];\n}\n\n/**\n * ESLint issue from WebSocket server (uilint serve)\n */\nexport interface ESLintIssue {\n /** Line number in source file */\n line: number;\n /** Column number */\n column?: number;\n /** Issue description */\n message: string;\n /** ESLint rule ID (e.g., \"uilint/semantic\", \"uilint/consistent-dark-mode\") */\n ruleId?: string;\n /** data-loc value to match to DOM element */\n dataLoc?: string;\n}\n\n/**\n * Cached issue data for a source location (dataLoc)\n * Multiple DOM elements can share the same dataLoc (e.g., list items),\n * so we key by dataLoc (path:line:column) rather than element ID.\n */\nexport interface ElementIssue {\n /** The dataLoc key (format: \"path:line:column\") */\n dataLoc: string;\n /** ESLint rule violations from uilint-eslint (including semantic rule) */\n issues: ESLintIssue[];\n status: \"pending\" | \"scanning\" | \"complete\" | \"error\";\n}\n\n/**\n * Element detected under the cursor during Alt-key locator mode\n */\nexport interface LocatorTarget {\n element: Element;\n source: SourceLocation;\n rect: DOMRect;\n}\n\n/**\n * Element being inspected in the sidebar\n */\nexport interface InspectedElement {\n element: Element;\n source: SourceLocation;\n rect: DOMRect;\n /** Optional ID from auto-scan to link to cached results */\n scannedElementId?: string;\n}\n\n/**\n * File-level issue (not mapped to a specific DOM element)\n */\nexport interface FileIssue {\n filePath: string;\n issues: ESLintIssue[];\n}\n\n/**\n * Response from the source API\n */\nexport interface SourceApiResponse {\n content: string;\n relativePath: string;\n}\n\n/**\n * Cached source file content\n */\nexport interface CachedSource {\n content: string;\n relativePath: string;\n fetchedAt: number;\n}\n\n/**\n * Color palette for source file differentiation\n */\nexport const FILE_COLORS = [\n \"#3B82F6\", // blue\n \"#8B5CF6\", // violet\n \"#EC4899\", // pink\n \"#10B981\", // emerald\n \"#F59E0B\", // amber\n \"#06B6D4\", // cyan\n \"#EF4444\", // red\n \"#84CC16\", // lime\n \"#6366F1\", // indigo\n \"#F97316\", // orange\n \"#14B8A6\", // teal\n \"#A855F7\", // purple\n] as const;\n\n/**\n * Default settings\n */\nexport const DEFAULT_SETTINGS: UILintSettings = {\n hideNodeModules: true,\n autoScanEnabled: false,\n};\n\n/**\n * Construct a dataLoc string from a source location\n * Format: \"path:line:column\"\n */\nexport function getDataLocFromSource(source: SourceLocation): string {\n return `${source.fileName}:${source.lineNumber}:${source.columnNumber ?? 0}`;\n}\n\n/**\n * Default auto-scan state\n */\nexport const DEFAULT_AUTO_SCAN_STATE: AutoScanState = {\n status: \"idle\",\n currentIndex: 0,\n totalElements: 0,\n elements: [],\n};\n\n/**\n * Data attribute used to mark scanned elements\n */\nexport const DATA_UILINT_ID = \"data-loc\";\n\n","/**\n * DOM utilities for UILint source file visualization\n *\n * Uses data-loc attributes injected by the jsx-loc-plugin build transform.\n * This works uniformly for both server and client components in Next.js 15+.\n */\n\nimport type { SourceLocation, ScannedElement, SourceFile } from \"./types\";\n\nimport { DATA_UILINT_ID } from \"./types\";\n\n// Color palette for source file differentiation\nconst COLORS = [\n \"#3B82F6\",\n \"#8B5CF6\",\n \"#EC4899\",\n \"#10B981\",\n \"#F59E0B\",\n \"#06B6D4\",\n \"#EF4444\",\n \"#84CC16\",\n \"#6366F1\",\n \"#F97316\",\n \"#14B8A6\",\n \"#A855F7\",\n];\n\n/** Tags to skip during DOM traversal */\nconst SKIP_TAGS = new Set([\n \"SCRIPT\",\n \"STYLE\",\n \"SVG\",\n \"NOSCRIPT\",\n \"TEMPLATE\",\n \"HEAD\",\n \"META\",\n \"LINK\",\n]);\n\n/**\n * Parse source location from data-loc attribute\n * Format: \"path/to/file.tsx:line:column\" (injected by jsx-loc-plugin)\n * Also supports:\n * - Legacy format: \"path/to/file.tsx:line\"\n * - Runtime ID format: \"loc:path/to/file.tsx:line:column#occurrence\"\n */\nexport function getSourceFromDataLoc(element: Element): SourceLocation | null {\n let loc = element.getAttribute(DATA_UILINT_ID);\n if (!loc) return null;\n\n // Handle runtime ID format: \"loc:path:line:column#occurrence\"\n if (loc.startsWith(\"loc:\")) {\n loc = loc.slice(4); // Remove \"loc:\" prefix\n const hashIndex = loc.lastIndexOf(\"#\");\n if (hashIndex !== -1) {\n loc = loc.slice(0, hashIndex); // Remove \"#occurrence\" suffix\n }\n }\n\n // Split by colon - need to handle paths that may contain colons (Windows)\n // Format is: path:line:column or path:line\n // We parse from the end since line and column are always numbers\n const parts = loc.split(\":\");\n\n if (parts.length < 2) return null;\n\n // Check if we have path:line:column format\n const lastPart = parts[parts.length - 1];\n const secondLastPart = parts[parts.length - 2];\n\n const lastIsNumber = /^\\d+$/.test(lastPart);\n const secondLastIsNumber = /^\\d+$/.test(secondLastPart);\n\n if (lastIsNumber && secondLastIsNumber) {\n // Format: path:line:column\n const columnNumber = parseInt(lastPart, 10);\n const lineNumber = parseInt(secondLastPart, 10);\n const fileName = parts.slice(0, -2).join(\":\");\n\n if (isNaN(lineNumber) || isNaN(columnNumber) || !fileName) return null;\n\n return { fileName, lineNumber, columnNumber };\n } else if (lastIsNumber) {\n // Format: path:line (legacy)\n const lineNumber = parseInt(lastPart, 10);\n const fileName = parts.slice(0, -1).join(\":\");\n\n if (isNaN(lineNumber) || !fileName) return null;\n\n return { fileName, lineNumber };\n }\n\n return null;\n}\n\n/**\n * Check if a file path is from node_modules\n */\nexport function isNodeModulesPath(path: string): boolean {\n return path.includes(\"node_modules\");\n}\n\n/**\n * Get display name from a file path (just the filename)\n */\nexport function getDisplayName(path: string): string {\n const parts = path.split(\"/\");\n return parts[parts.length - 1] || path;\n}\n\n/**\n * Check if an element should be skipped during scanning\n */\nfunction shouldSkipElement(element: Element): boolean {\n // Skip by tag\n if (SKIP_TAGS.has(element.tagName.toUpperCase())) return true;\n\n // Skip elements already marked by UILint\n if (element.hasAttribute(\"data-ui-lint\")) return true;\n\n // Skip aria-hidden elements\n if (element.getAttribute(\"aria-hidden\") === \"true\") return true;\n\n // Skip invisible elements\n const styles = window.getComputedStyle(element);\n if (styles.display === \"none\" || styles.visibility === \"hidden\") return true;\n\n // Skip zero-size elements\n const rect = element.getBoundingClientRect();\n if (rect.width === 0 || rect.height === 0) return true;\n\n return false;\n}\n\n/**\n * Scan the DOM tree and extract elements with data-loc attributes\n */\nexport function scanDOMForSources(\n root: Element = document.body,\n hideNodeModules: boolean = true\n): ScannedElement[] {\n const elements: ScannedElement[] = [];\n\n // data-loc values are not guaranteed to be unique across the DOM (e.g. the same\n // component line rendered in a list). Track occurrences so we can produce a\n // stable, unique per-instance id.\n const occurrenceByDataLoc = new Map<string, number>();\n\n // Clean up previous scan - reset IDs to source locations only\n cleanupDataAttributes();\n\n // Query all elements with data-loc attribute\n const locElements = root.querySelectorAll(`[${DATA_UILINT_ID}]`);\n\n for (const el of locElements) {\n if (shouldSkipElement(el)) continue;\n\n const source = getSourceFromDataLoc(el);\n if (!source) continue;\n\n // Skip node_modules if setting enabled\n if (hideNodeModules && isNodeModulesPath(source.fileName)) {\n continue;\n }\n\n // Get the raw source location from the attribute (before any runtime modification)\n let dataLoc = el.getAttribute(DATA_UILINT_ID)!;\n // If it's already a runtime ID, extract the source location\n if (dataLoc.startsWith(\"loc:\")) {\n dataLoc = dataLoc.slice(4);\n const hashIndex = dataLoc.lastIndexOf(\"#\");\n if (hashIndex !== -1) {\n dataLoc = dataLoc.slice(0, hashIndex);\n }\n }\n\n const occurrence = (occurrenceByDataLoc.get(dataLoc) ?? 0) + 1;\n occurrenceByDataLoc.set(dataLoc, occurrence);\n const id = `loc:${dataLoc}#${occurrence}`;\n\n // Update the attribute with the unique runtime ID\n el.setAttribute(DATA_UILINT_ID, id);\n\n elements.push({\n id,\n element: el,\n tagName: el.tagName.toLowerCase(),\n className: typeof el.className === \"string\" ? el.className : \"\",\n source,\n rect: el.getBoundingClientRect(),\n });\n }\n\n return elements;\n}\n\n/**\n * Group scanned elements by their source file\n */\nexport function groupBySourceFile(elements: ScannedElement[]): SourceFile[] {\n const fileMap = new Map<string, ScannedElement[]>();\n\n for (const element of elements) {\n if (!element.source) continue;\n const path = element.source.fileName;\n const existing = fileMap.get(path) || [];\n existing.push(element);\n fileMap.set(path, existing);\n }\n\n // Convert to array and assign colors\n const sourceFiles: SourceFile[] = [];\n let colorIndex = 0;\n\n for (const [path, fileElements] of fileMap) {\n sourceFiles.push({\n path,\n displayName: getDisplayName(path),\n color: COLORS[colorIndex % COLORS.length],\n elements: fileElements,\n });\n colorIndex++;\n }\n\n // Sort by element count (most elements first)\n sourceFiles.sort((a, b) => b.elements.length - a.elements.length);\n\n return sourceFiles;\n}\n\n/**\n * Clean up runtime IDs from previous scans, restoring to source location only\n * Elements with data-loc in \"loc:...\" format will have the ID reset\n */\nexport function cleanupDataAttributes(): void {\n const elements = document.querySelectorAll(`[${DATA_UILINT_ID}]`);\n elements.forEach((el) => {\n const value = el.getAttribute(DATA_UILINT_ID);\n if (value && value.startsWith(\"loc:\")) {\n // Extract source location and reset to original format\n let loc = value.slice(4); // Remove \"loc:\" prefix\n const hashIndex = loc.lastIndexOf(\"#\");\n if (hashIndex !== -1) {\n loc = loc.slice(0, hashIndex); // Remove \"#occurrence\" suffix\n }\n el.setAttribute(DATA_UILINT_ID, loc);\n }\n });\n}\n\n/**\n * Get an element by its UILint ID\n */\nexport function getElementById(id: string): Element | null {\n return document.querySelector(`[${DATA_UILINT_ID}=\"${id}\"]`);\n}\n\n/**\n * Update element rects (for scroll/resize handling)\n */\nexport function updateElementRects(\n elements: ScannedElement[]\n): ScannedElement[] {\n return elements.map((el) => ({\n ...el,\n rect: el.element.getBoundingClientRect(),\n }));\n}\n\n/**\n * Identify the top-level (first declared) element for each source file.\n * The top-level element is determined by the earliest line number within each file.\n * This is used to display file-level issues on the appropriate element in heatmap mode.\n *\n * @returns Map of filePath -> elementId for the top-level element\n */\nexport function identifyTopLevelElements(\n elements: ScannedElement[]\n): Map<string, string> {\n const topLevelByFile = new Map<string, string>();\n\n // Group elements by file\n const byFile = new Map<string, ScannedElement[]>();\n for (const el of elements) {\n const path = el.source.fileName;\n const existing = byFile.get(path) || [];\n existing.push(el);\n byFile.set(path, existing);\n }\n\n // For each file, find the element with the earliest line number\n for (const [filePath, fileElements] of byFile) {\n if (fileElements.length === 0) continue;\n\n // Sort by line number, then column number for determinism\n const sorted = [...fileElements].sort((a, b) => {\n const lineDiff = a.source.lineNumber - b.source.lineNumber;\n if (lineDiff !== 0) return lineDiff;\n return (a.source.columnNumber ?? 0) - (b.source.columnNumber ?? 0);\n });\n\n topLevelByFile.set(filePath, sorted[0].id);\n }\n\n return topLevelByFile;\n}\n\n/**\n * Build an \"Open in Editor\" URL\n * @param source - The source location (fileName may be relative or absolute)\n * @param editor - The editor to open in (cursor or vscode)\n * @param workspaceRoot - Optional workspace root to prepend for relative paths\n */\nexport function buildEditorUrl(\n source: SourceLocation,\n editor: \"cursor\" | \"vscode\" = \"cursor\",\n workspaceRoot?: string | null\n): string {\n const { fileName, lineNumber, columnNumber } = source;\n const column = columnNumber ?? 1;\n\n // Build absolute file path\n let absolutePath = fileName;\n if (workspaceRoot && !fileName.startsWith(\"/\")) {\n // Ensure workspace root ends without slash for clean concatenation\n const root = workspaceRoot.endsWith(\"/\")\n ? workspaceRoot.slice(0, -1)\n : workspaceRoot;\n absolutePath = `${root}/${fileName}`;\n }\n\n if (editor === \"cursor\") {\n return `cursor://file/${encodeURIComponent(\n absolutePath\n )}:${lineNumber}:${column}`;\n }\n\n return `vscode://file/${encodeURIComponent(\n absolutePath\n )}:${lineNumber}:${column}`;\n}\n","/**\n * Client for fetching source code from the dev API\n */\n\nimport { devWarn, devError } from \"uilint-core\";\nimport type { SourceApiResponse, CachedSource, SourceLocation } from \"./types\";\n\n// Cache for fetched source files\nconst sourceCache = new Map<string, CachedSource>();\n\n// Cache TTL in milliseconds (5 minutes)\nconst CACHE_TTL = 5 * 60 * 1000;\n\n/**\n * API endpoint for source fetching\n */\nconst API_ENDPOINT = \"/api/.uilint/source\";\n\n/**\n * Fetch source code for a file\n */\nexport async function fetchSource(\n filePath: string\n): Promise<SourceApiResponse | null> {\n // Check cache first\n const cached = sourceCache.get(filePath);\n if (cached && Date.now() - cached.fetchedAt < CACHE_TTL) {\n return {\n content: cached.content,\n relativePath: cached.relativePath,\n };\n }\n\n try {\n const response = await fetch(\n `${API_ENDPOINT}?path=${encodeURIComponent(filePath)}`\n );\n\n if (!response.ok) {\n devWarn(`[UILint] Failed to fetch source: ${response.statusText}`);\n return null;\n }\n\n const data: SourceApiResponse = await response.json();\n\n // Cache the result\n sourceCache.set(filePath, {\n ...data,\n fetchedAt: Date.now(),\n });\n\n return data;\n } catch (error) {\n devError(\"[UILint] Error fetching source:\", error);\n return null;\n }\n}\n\n/**\n * Fetch source and extract lines around a specific location\n */\nexport async function fetchSourceWithContext(\n source: SourceLocation,\n contextLines: number = 5\n): Promise<{\n lines: string[];\n startLine: number;\n highlightLine: number;\n relativePath: string;\n} | null> {\n const result = await fetchSource(source.fileName);\n if (!result) return null;\n\n const allLines = result.content.split(\"\\n\");\n const targetLine = source.lineNumber - 1; // 0-indexed\n const startLine = Math.max(0, targetLine - contextLines);\n const endLine = Math.min(allLines.length, targetLine + contextLines + 1);\n\n return {\n lines: allLines.slice(startLine, endLine),\n startLine: startLine + 1, // Back to 1-indexed\n highlightLine: source.lineNumber,\n relativePath: result.relativePath,\n };\n}\n\n/**\n * Fetch source and extract an asymmetric window around a specific location.\n * This supports expanding above/below independently in the UI.\n */\nexport async function fetchSourceWithWindow(\n source: SourceLocation,\n window: { linesAbove: number; linesBelow: number }\n): Promise<{\n lines: string[];\n startLine: number;\n highlightLine: number;\n relativePath: string;\n} | null> {\n const result = await fetchSource(source.fileName);\n if (!result) return null;\n\n const allLines = result.content.split(\"\\n\");\n const targetLine = source.lineNumber - 1; // 0-indexed\n const startLine = Math.max(0, targetLine - Math.max(0, window.linesAbove));\n const endLine = Math.min(\n allLines.length,\n targetLine + Math.max(0, window.linesBelow) + 1\n );\n\n return {\n lines: allLines.slice(startLine, endLine),\n startLine: startLine + 1, // Back to 1-indexed\n highlightLine: source.lineNumber,\n relativePath: result.relativePath,\n };\n}\n\n/**\n * Clear the source cache\n */\nexport function clearSourceCache(): void {\n sourceCache.clear();\n}\n\n/**\n * Get cached source without fetching\n */\nexport function getCachedSource(filePath: string): SourceApiResponse | null {\n const cached = sourceCache.get(filePath);\n if (!cached) return null;\n if (Date.now() - cached.fetchedAt >= CACHE_TTL) {\n sourceCache.delete(filePath);\n return null;\n }\n return {\n content: cached.content,\n relativePath: cached.relativePath,\n };\n}\n\n/**\n * Prefetch source files for a list of paths\n */\nexport async function prefetchSources(filePaths: string[]): Promise<void> {\n // Deduplicate and filter already cached\n const uniquePaths = [...new Set(filePaths)].filter((path) => {\n const cached = sourceCache.get(path);\n return !cached || Date.now() - cached.fetchedAt >= CACHE_TTL;\n });\n\n // Fetch in parallel with a limit\n const BATCH_SIZE = 5;\n for (let i = 0; i < uniquePaths.length; i += BATCH_SIZE) {\n const batch = uniquePaths.slice(i, i + BATCH_SIZE);\n await Promise.all(batch.map(fetchSource));\n }\n}\n","/**\n * DOM snapshotting for consistency analysis\n */\n\nimport type {\n ElementSnapshot,\n ElementRole,\n StyleSnapshot,\n GroupedSnapshot,\n} from \"./types\";\n\n/** Data attribute used to mark elements for highlight lookup */\nconst DATA_ELEMENTS_ATTR = \"data-elements\";\n\n/** Elements to skip during DOM walk */\nconst SKIP_TAGS = new Set([\"SCRIPT\", \"STYLE\", \"SVG\", \"NOSCRIPT\", \"TEMPLATE\"]);\n\n/** Semantic context elements */\nconst CONTEXT_ELEMENTS = new Set([\n \"HEADER\",\n \"NAV\",\n \"MAIN\",\n \"FOOTER\",\n \"SECTION\",\n \"ARTICLE\",\n \"ASIDE\",\n]);\n\n/** Class patterns for role inference */\nconst CLASS_PATTERNS: Record<string, RegExp> = {\n button: /\\b(btn|button)\\b/i,\n card: /\\b(card)\\b/i,\n input: /\\b(input|field|form-control)\\b/i,\n link: /\\b(link)\\b/i,\n};\n\nlet elementCounter = 0;\n\n/**\n * Cleans up data-elements attributes from previous scans\n */\nexport function cleanupDataElements(): void {\n const elements = document.querySelectorAll(`[${DATA_ELEMENTS_ATTR}]`);\n elements.forEach((el) => el.removeAttribute(DATA_ELEMENTS_ATTR));\n elementCounter = 0;\n}\n\n/**\n * Generates a unique element ID\n */\nfunction generateElementId(): string {\n return `el-${++elementCounter}`;\n}\n\n/**\n * Truncates text to max length\n */\nfunction truncateText(text: string, maxLen: number = 50): string {\n const cleaned = text.trim().replace(/\\s+/g, \" \");\n if (cleaned.length <= maxLen) return cleaned;\n return cleaned.slice(0, maxLen - 3) + \"...\";\n}\n\n/**\n * Infers element role from various sources\n * Order: ARIA role > tag name > data-ui-component > class patterns\n */\nfunction inferRole(el: Element, styles: CSSStyleDeclaration): ElementRole {\n // Check ARIA role\n const ariaRole = el.getAttribute(\"role\");\n if (ariaRole) {\n if (ariaRole === \"button\") return \"button\";\n if (ariaRole === \"link\") return \"link\";\n if (ariaRole === \"textbox\" || ariaRole === \"searchbox\") return \"input\";\n if (ariaRole === \"heading\") return \"heading\";\n }\n\n // Check tag name\n const tag = el.tagName.toUpperCase();\n if (tag === \"BUTTON\") return \"button\";\n if (tag === \"A\") return \"link\";\n if (tag === \"INPUT\" || tag === \"TEXTAREA\" || tag === \"SELECT\") return \"input\";\n if (/^H[1-6]$/.test(tag)) return \"heading\";\n\n // Check data-ui-component\n const component = el.getAttribute(\"data-ui-component\");\n if (component) {\n const lower = component.toLowerCase();\n if (lower.includes(\"button\")) return \"button\";\n if (lower.includes(\"card\")) return \"card\";\n if (lower.includes(\"input\") || lower.includes(\"field\")) return \"input\";\n if (lower.includes(\"link\")) return \"link\";\n }\n\n // Check class patterns\n const className = el.className;\n if (typeof className === \"string\") {\n if (CLASS_PATTERNS.button.test(className)) return \"button\";\n if (CLASS_PATTERNS.card.test(className)) return \"card\";\n if (CLASS_PATTERNS.input.test(className)) return \"input\";\n if (CLASS_PATTERNS.link.test(className)) return \"link\";\n }\n\n // Check if it's a card-like element\n if (isCard(el, styles)) return \"card\";\n\n // Check if it's a container\n if (isContainer(styles)) return \"container\";\n\n // Check if it has meaningful text (not just whitespace)\n const text = el.textContent?.trim() || \"\";\n if (text.length > 0 && text.length < 200) return \"text\";\n\n return \"other\";\n}\n\n/**\n * Detects card-like elements\n * Heuristic: has children AND (has box-shadow OR (has background + border-radius) OR (has border + border-radius))\n */\nfunction isCard(el: Element, styles: CSSStyleDeclaration): boolean {\n if (el.children.length === 0) return false;\n\n const hasBoxShadow =\n styles.boxShadow && styles.boxShadow !== \"none\";\n const hasBg =\n styles.backgroundColor &&\n styles.backgroundColor !== \"transparent\" &&\n styles.backgroundColor !== \"rgba(0, 0, 0, 0)\";\n const hasBorder =\n styles.border && styles.border !== \"none\" && !styles.border.includes(\"0px\");\n const hasRadius =\n styles.borderRadius && styles.borderRadius !== \"0px\";\n\n return Boolean(hasBoxShadow || ((hasBg || hasBorder) && hasRadius));\n}\n\n/**\n * Detects container elements\n * Heuristic: display flex/grid with gap or notable padding\n */\nfunction isContainer(styles: CSSStyleDeclaration): boolean {\n const display = styles.display;\n if (display !== \"flex\" && display !== \"grid\") return false;\n\n const gap = styles.gap;\n if (gap && gap !== \"normal\" && gap !== \"0px\") return true;\n\n const padding = styles.padding;\n if (padding && padding !== \"0px\") {\n // Check if padding is significant (> 8px)\n const match = padding.match(/(\\d+)px/);\n if (match && parseInt(match[1], 10) > 8) return true;\n }\n\n return false;\n}\n\n/**\n * Builds context string from ancestor semantic elements\n */\nfunction buildContext(el: Element): string {\n const parts: string[] = [];\n let current = el.parentElement;\n\n while (current && parts.length < 3) {\n const tag = current.tagName.toUpperCase();\n if (CONTEXT_ELEMENTS.has(tag)) {\n parts.unshift(tag.toLowerCase());\n }\n current = current.parentElement;\n }\n\n return parts.join(\" > \") || \"root\";\n}\n\n/**\n * Extracts relevant computed styles\n */\nfunction extractStyles(styles: CSSStyleDeclaration): StyleSnapshot {\n return {\n fontSize: styles.fontSize || undefined,\n fontWeight: styles.fontWeight || undefined,\n color: styles.color || undefined,\n backgroundColor:\n styles.backgroundColor === \"rgba(0, 0, 0, 0)\"\n ? undefined\n : styles.backgroundColor || undefined,\n padding: styles.padding === \"0px\" ? undefined : styles.padding || undefined,\n borderRadius:\n styles.borderRadius === \"0px\"\n ? undefined\n : styles.borderRadius || undefined,\n border:\n styles.border === \"none\" || styles.border?.includes(\"0px\")\n ? undefined\n : styles.border || undefined,\n boxShadow:\n styles.boxShadow === \"none\" ? undefined : styles.boxShadow || undefined,\n gap:\n styles.gap === \"normal\" || styles.gap === \"0px\"\n ? undefined\n : styles.gap || undefined,\n };\n}\n\n/**\n * Checks if an element should be skipped\n */\nfunction shouldSkip(el: Element): boolean {\n // Skip by tag\n if (SKIP_TAGS.has(el.tagName.toUpperCase())) return true;\n\n // Skip elements with data-ui-lint-ignore\n if (el.hasAttribute(\"data-ui-lint-ignore\")) return true;\n\n // Skip aria-hidden elements\n if (el.getAttribute(\"aria-hidden\") === \"true\") return true;\n\n // Skip hidden elements\n const styles = window.getComputedStyle(el);\n if (styles.display === \"none\" || styles.visibility === \"hidden\") return true;\n\n return false;\n}\n\n/**\n * Creates a snapshot of a single element\n */\nfunction snapshotElement(el: Element): ElementSnapshot | null {\n if (shouldSkip(el)) return null;\n\n const styles = window.getComputedStyle(el);\n const role = inferRole(el, styles);\n\n // Only capture elements with meaningful roles\n if (role === \"other\") return null;\n\n const id = generateElementId();\n el.setAttribute(DATA_ELEMENTS_ATTR, id);\n\n const rect = el.getBoundingClientRect();\n const text =\n el.textContent?.trim().slice(0, 100) ||\n el.getAttribute(\"aria-label\") ||\n \"\";\n\n return {\n id,\n tag: el.tagName.toLowerCase(),\n role,\n text: truncateText(text),\n component: el.getAttribute(\"data-ui-component\") || undefined,\n context: buildContext(el),\n styles: extractStyles(styles),\n rect: {\n width: Math.round(rect.width),\n height: Math.round(rect.height),\n },\n };\n}\n\n/**\n * Creates a grouped snapshot of DOM elements for consistency analysis\n */\nexport function createSnapshot(root?: Element): GroupedSnapshot {\n // Clean up previous scan\n cleanupDataElements();\n\n const targetRoot = root || document.body;\n const snapshot: GroupedSnapshot = {\n buttons: [],\n headings: [],\n cards: [],\n links: [],\n inputs: [],\n containers: [],\n };\n\n // Walk the DOM\n const walker = document.createTreeWalker(\n targetRoot,\n NodeFilter.SHOW_ELEMENT,\n {\n acceptNode: (node) => {\n const el = node as Element;\n if (shouldSkip(el)) return NodeFilter.FILTER_REJECT;\n return NodeFilter.FILTER_ACCEPT;\n },\n }\n );\n\n let node: Node | null = walker.currentNode;\n while (node) {\n if (node instanceof Element) {\n const elementSnapshot = snapshotElement(node);\n if (elementSnapshot) {\n // Add to appropriate group\n switch (elementSnapshot.role) {\n case \"button\":\n snapshot.buttons.push(elementSnapshot);\n break;\n case \"heading\":\n snapshot.headings.push(elementSnapshot);\n break;\n case \"card\":\n snapshot.cards.push(elementSnapshot);\n break;\n case \"link\":\n snapshot.links.push(elementSnapshot);\n break;\n case \"input\":\n snapshot.inputs.push(elementSnapshot);\n break;\n case \"container\":\n snapshot.containers.push(elementSnapshot);\n break;\n }\n }\n }\n node = walker.nextNode();\n }\n\n return snapshot;\n}\n\n/**\n * Gets an element by its data-elements ID\n */\nexport function getElementBySnapshotId(id: string): Element | null {\n return document.querySelector(`[${DATA_ELEMENTS_ATTR}=\"${id}\"]`);\n}\n","/* eslint-disable uilint/prefer-tailwind */\n\"use client\";\n\nimport React, { useEffect, useState, useCallback } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport type { Violation } from \"./types\";\nimport { getElementBySnapshotId } from \"./snapshot\";\n\n/** Get portal host element for rendering overlays */\nfunction getUILintPortalHost(): HTMLElement {\n if (typeof document === \"undefined\") {\n throw new Error(\"getUILintPortalHost() called outside of a DOM environment\");\n }\n const root = document.querySelector<HTMLElement>(\".uilint-devtool-root\");\n return root ?? document.body;\n}\n\ninterface HighlightRect {\n top: number;\n left: number;\n width: number;\n height: number;\n}\n\ninterface ElementHighlight {\n id: string;\n rect: HighlightRect;\n badgeNumber?: number;\n}\n\ninterface ConsistencyHighlighterProps {\n violations: Violation[];\n selectedViolation: Violation | null;\n lockedViolation: Violation | null;\n}\n\nconst HIGHLIGHT_COLOR = \"#3b82f6\"; // Blue\nconst PLUS_SIZE = 14; // Size of plus icon\nconst PLUS_SIZE_HOVER = 22; // Expanded size on hover\nconst PLUS_THICKNESS = 2; // Thickness of plus arms\nconst PLUS_THICKNESS_HOVER = 3; // Thickness when hovered\nconst BORDER_WIDTH = 2;\n\n/**\n * Calculates highlight rects for a set of element IDs\n */\nfunction calculateHighlights(\n elementIds: string[],\n withBadges: boolean = false\n): ElementHighlight[] {\n const highlights: ElementHighlight[] = [];\n\n elementIds.forEach((id, index) => {\n const el = getElementBySnapshotId(id);\n if (!el) return;\n\n const rect = el.getBoundingClientRect();\n highlights.push({\n id,\n rect: {\n top: rect.top,\n left: rect.left,\n width: rect.width,\n height: rect.height,\n },\n badgeNumber: withBadges && elementIds.length > 1 ? index + 1 : undefined,\n });\n });\n\n return highlights;\n}\n\n/**\n * Gets all unique element IDs from violations\n */\nfunction getAllViolatingIds(violations: Violation[]): Set<string> {\n const ids = new Set<string>();\n violations.forEach((v) => {\n v.elementIds.forEach((id) => ids.add(id));\n });\n return ids;\n}\n\n/**\n * Overview plus icon component - indicator for violating elements\n * Expands and fills in on hover for better clickability\n */\nfunction OverviewPlusIcon({ rect }: { rect: HighlightRect }) {\n const [isHovered, setIsHovered] = useState(false);\n\n const size = isHovered ? PLUS_SIZE_HOVER : PLUS_SIZE;\n const thickness = isHovered ? PLUS_THICKNESS_HOVER : PLUS_THICKNESS;\n const armLength = isHovered ? 10 : 6;\n\n return (\n <div\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n style={{\n position: \"fixed\",\n top: rect.top - size / 2,\n left: rect.left + rect.width - size / 2,\n width: size,\n height: size,\n borderRadius: isHovered ? 4 : 3,\n backgroundColor: isHovered\n ? HIGHLIGHT_COLOR\n : \"rgba(59, 130, 246, 0.15)\",\n border: `${thickness}px solid ${HIGHLIGHT_COLOR}`,\n pointerEvents: \"auto\",\n cursor: \"pointer\",\n zIndex: 99997,\n boxShadow: isHovered\n ? \"0 2px 8px rgba(59, 130, 246, 0.4)\"\n : \"0 0 4px rgba(59, 130, 246, 0.3)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n transition: \"all 0.15s ease-out\",\n }}\n >\n {/* Horizontal arm of plus */}\n <div\n style={{\n position: \"absolute\",\n width: armLength,\n height: thickness,\n backgroundColor: isHovered ? \"white\" : HIGHLIGHT_COLOR,\n borderRadius: 1,\n transition: \"all 0.15s ease-out\",\n }}\n />\n {/* Vertical arm of plus */}\n <div\n style={{\n position: \"absolute\",\n width: thickness,\n height: armLength,\n backgroundColor: isHovered ? \"white\" : HIGHLIGHT_COLOR,\n borderRadius: 1,\n transition: \"all 0.15s ease-out\",\n }}\n />\n </div>\n );\n}\n\n/**\n * Full highlight rectangle with optional badge\n */\nfunction HighlightRect({\n rect,\n badgeNumber,\n}: {\n rect: HighlightRect;\n badgeNumber?: number;\n}) {\n return (\n <>\n {/* Border rectangle */}\n <div\n style={{\n position: \"fixed\",\n top: rect.top - BORDER_WIDTH,\n left: rect.left - BORDER_WIDTH,\n width: rect.width + BORDER_WIDTH * 2,\n height: rect.height + BORDER_WIDTH * 2,\n border: `${BORDER_WIDTH}px solid ${HIGHLIGHT_COLOR}`,\n borderRadius: 4,\n backgroundColor: `${HIGHLIGHT_COLOR}10`,\n pointerEvents: \"none\",\n zIndex: 99998,\n transition: \"all 0.15s ease-out\",\n }}\n />\n\n {/* Badge number */}\n {badgeNumber !== undefined && (\n <div\n style={{\n position: \"fixed\",\n top: rect.top - 12,\n left: rect.left - 4,\n minWidth: 20,\n height: 20,\n borderRadius: 10,\n backgroundColor: HIGHLIGHT_COLOR,\n color: \"white\",\n fontSize: 11,\n fontWeight: 600,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: \"0 6px\",\n pointerEvents: \"none\",\n zIndex: 99999,\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n }}\n >\n {badgeNumber}\n </div>\n )}\n </>\n );\n}\n\n/**\n * Main consistency highlighter component\n * Renders highlights via Portal to document.body\n */\nexport function ConsistencyHighlighter({\n violations,\n selectedViolation,\n lockedViolation,\n}: ConsistencyHighlighterProps) {\n const [overviewHighlights, setOverviewHighlights] = useState<\n ElementHighlight[]\n >([]);\n const [activeHighlights, setActiveHighlights] = useState<ElementHighlight[]>(\n []\n );\n const [mounted, setMounted] = useState(false);\n\n // Determine which violation to show\n const activeViolation = lockedViolation || selectedViolation;\n\n // Calculate overview highlights (dots for all violating elements)\n const updateOverviewHighlights = useCallback(() => {\n if (activeViolation) {\n setOverviewHighlights([]);\n return;\n }\n\n const allIds = getAllViolatingIds(violations);\n const highlights: ElementHighlight[] = [];\n\n allIds.forEach((id) => {\n const el = getElementBySnapshotId(id);\n if (!el) return;\n\n const rect = el.getBoundingClientRect();\n highlights.push({\n id,\n rect: {\n top: rect.top,\n left: rect.left,\n width: rect.width,\n height: rect.height,\n },\n });\n });\n\n setOverviewHighlights(highlights);\n }, [violations, activeViolation]);\n\n // Calculate active highlights (rectangles for selected violation)\n const updateActiveHighlights = useCallback(() => {\n if (!activeViolation) {\n setActiveHighlights([]);\n return;\n }\n\n const highlights = calculateHighlights(activeViolation.elementIds, true);\n setActiveHighlights(highlights);\n }, [activeViolation]);\n\n // Set mounted state\n useEffect(() => {\n setMounted(true);\n return () => setMounted(false);\n }, []);\n\n // Update highlights on mount, violation change, and scroll/resize\n useEffect(() => {\n updateOverviewHighlights();\n updateActiveHighlights();\n\n const handleUpdate = () => {\n updateOverviewHighlights();\n updateActiveHighlights();\n };\n\n window.addEventListener(\"scroll\", handleUpdate, true);\n window.addEventListener(\"resize\", handleUpdate);\n\n return () => {\n window.removeEventListener(\"scroll\", handleUpdate, true);\n window.removeEventListener(\"resize\", handleUpdate);\n };\n }, [updateOverviewHighlights, updateActiveHighlights]);\n\n // Don't render until mounted (SSR safety)\n if (!mounted) return null;\n\n // No violations, no highlights\n if (violations.length === 0) return null;\n\n const content = (\n <>\n {/* Overview plus icons when no violation selected */}\n {!activeViolation &&\n overviewHighlights.map((h) => (\n <OverviewPlusIcon key={h.id} rect={h.rect} />\n ))}\n\n {/* Active highlights for selected violation */}\n {activeViolation &&\n activeHighlights.map((h) => (\n <HighlightRect key={h.id} rect={h.rect} badgeNumber={h.badgeNumber} />\n ))}\n </>\n );\n\n return createPortal(content, getUILintPortalHost());\n}\n","/**\n * DOM Observer Service\n *\n * A shared service that watches for elements with data-loc attributes.\n * Used to track DOM elements for source visualization and scanning.\n *\n * Features:\n * - MutationObserver-based tracking of data-loc elements\n * - Debounced reconciliation for handling streaming/suspense\n * - Subscribe/unsubscribe pattern for add/remove notifications\n * - Filtering for node_modules and UILint's own UI\n * - Dependency injection for testability\n */\n\nimport { devError } from \"uilint-core\";\n\n// =============================================================================\n// Constants\n// =============================================================================\n\n/** The attribute used to identify source-mapped elements */\nexport const DATA_LOC_ATTR = \"data-loc\";\n\n/** Debounce delay for reconciliation to handle rapid DOM changes */\nexport const RECONCILE_DEBOUNCE_MS = 100;\n\n// =============================================================================\n// Pure Functions (Testable without DOM)\n// =============================================================================\n\n/**\n * Generate a unique element ID from data-loc and occurrence number\n * @param dataLoc - The parsed data-loc value (path:line:column)\n * @param occurrence - The occurrence number (1-based) for elements with same dataLoc\n * @returns Unique ID in format \"loc:path:line:column#occurrence\"\n */\nexport function generateElementId(dataLoc: string, occurrence: number): string {\n return `loc:${dataLoc}#${occurrence}`;\n}\n\n/**\n * Parse a raw data-loc attribute value, normalizing runtime ID format if present\n * @param rawDataLoc - The raw data-loc attribute value\n * @returns The normalized data-loc value (path:line:column) or null if invalid\n */\nexport function parseDataLoc(rawDataLoc: string): string | null {\n if (!rawDataLoc) {\n return null;\n }\n\n let dataLoc = rawDataLoc;\n\n // Normalize data-loc: strip runtime ID format if present\n // Runtime format: \"loc:path:line:column#occurrence\"\n if (dataLoc.startsWith(\"loc:\")) {\n dataLoc = dataLoc.slice(4); // Remove \"loc:\" prefix\n const hashIndex = dataLoc.lastIndexOf(\"#\");\n if (hashIndex !== -1) {\n dataLoc = dataLoc.slice(0, hashIndex); // Remove \"#occurrence\" suffix\n }\n }\n\n return dataLoc || null;\n}\n\n/**\n * Check if a path should be filtered based on node_modules presence\n * @param path - The file path to check\n * @param hideNodeModules - Whether to filter node_modules paths\n * @returns True if the path should be filtered out\n */\nexport function shouldFilterPath(\n path: string,\n hideNodeModules: boolean\n): boolean {\n return hideNodeModules && path.includes(\"node_modules\");\n}\n\n// =============================================================================\n// Types\n// =============================================================================\n\n/**\n * Options for creating a DOMObserverService instance\n * Enables dependency injection for testing\n */\nexport interface DOMObserverOptions {\n /** Root element to observe (defaults to document.body) */\n root?: Element;\n /** MutationObserver implementation (defaults to window.MutationObserver) */\n MutationObserverImpl?: typeof MutationObserver;\n /** Custom querySelectorAll function (defaults to document.querySelectorAll) */\n querySelectorAll?: (selector: string) => NodeListOf<Element>;\n}\n\n/**\n * Information about a scanned DOM element with data-loc attribute\n */\nexport interface ScannedElementInfo {\n /**\n * Unique per-instance ID derived from data-loc.\n * Format: \"loc:path:line:column#occurrence\"\n */\n id: string;\n /** The raw data-loc attribute value (path:line:column) */\n dataLoc: string;\n /** Reference to the DOM element */\n element: Element;\n /** Lowercase tag name of the element */\n tagName: string;\n /** Current bounding client rect */\n rect: DOMRect;\n}\n\n/** Handler called when new elements with data-loc are detected */\nexport type ElementAddedHandler = (elements: ScannedElementInfo[]) => void;\n\n/** Handler called when elements with data-loc are removed */\nexport type ElementRemovedHandler = (elementIds: string[]) => void;\n\n/**\n * Interface for the DOM Observer Service\n */\nexport interface DOMObserverService {\n /** Configure whether to filter out node_modules paths */\n setHideNodeModules(hide: boolean): void;\n /** Start observing the DOM */\n start(): void;\n /** Stop observing and clear state */\n stop(): void;\n /** Subscribe to element addition events, returns unsubscribe function */\n onElementsAdded(handler: ElementAddedHandler): () => void;\n /** Subscribe to element removal events, returns unsubscribe function */\n onElementsRemoved(handler: ElementRemovedHandler): () => void;\n /** Get all currently tracked elements */\n getElements(): ScannedElementInfo[];\n}\n\n// =============================================================================\n// Implementation\n// =============================================================================\n\n/**\n * DOM Observer Service Implementation\n *\n * Service that tracks data-loc elements in the DOM.\n * Supports dependency injection for testability.\n */\nexport class DOMObserverServiceImpl implements DOMObserverService {\n // ---------------------------------------------------------------------------\n // Private State\n // ---------------------------------------------------------------------------\n\n private observer: MutationObserver | null = null;\n private reconcileTimeout: ReturnType<typeof setTimeout> | null = null;\n private knownElements: Map<string, Element> = new Map();\n private addedHandlers: Set<ElementAddedHandler> = new Set();\n private removedHandlers: Set<ElementRemovedHandler> = new Set();\n private isRunning: boolean = false;\n private hideNodeModules: boolean = true;\n\n // Injected dependencies\n private readonly options: DOMObserverOptions;\n\n // ---------------------------------------------------------------------------\n // Constructor\n // ---------------------------------------------------------------------------\n\n /**\n * Create a new DOMObserverService instance\n * @param options - Optional configuration for dependency injection\n */\n constructor(options: DOMObserverOptions = {}) {\n this.options = options;\n }\n\n // ---------------------------------------------------------------------------\n // Public Methods\n // ---------------------------------------------------------------------------\n\n /**\n * Configure whether to filter out elements from node_modules\n */\n setHideNodeModules(hide: boolean): void {\n this.hideNodeModules = hide;\n // Re-reconcile if running to apply the new filter\n if (this.isRunning) {\n this.reconcile();\n }\n }\n\n /**\n * Start observing the DOM for data-loc elements\n */\n start(): void {\n // SSR guard - skip if no window/document and no injected dependencies\n if (typeof window === \"undefined\" && !this.options.root) {\n return;\n }\n\n if (this.isRunning) {\n return;\n }\n\n this.isRunning = true;\n\n // Get MutationObserver implementation (injected or global)\n const MutationObserverImpl =\n this.options.MutationObserverImpl ??\n (typeof window !== \"undefined\" ? window.MutationObserver : undefined);\n\n // Get root element (injected or document.body)\n const root =\n this.options.root ??\n (typeof document !== \"undefined\" ? document.body : undefined);\n\n // Create MutationObserver if implementation is available\n if (MutationObserverImpl && root) {\n this.observer = new MutationObserverImpl(\n this.handleMutations.bind(this)\n );\n\n // Observe root element for child additions/removals\n this.observer.observe(root, {\n childList: true,\n subtree: true,\n });\n }\n\n // Run initial scan\n this.reconcile();\n }\n\n /**\n * Stop observing and clear all state\n */\n stop(): void {\n this.isRunning = false;\n\n // Disconnect observer\n if (this.observer) {\n this.observer.disconnect();\n this.observer = null;\n }\n\n // Clear debounce timeout\n if (this.reconcileTimeout) {\n clearTimeout(this.reconcileTimeout);\n this.reconcileTimeout = null;\n }\n\n // Clear known elements\n this.knownElements.clear();\n }\n\n /**\n * Subscribe to element addition events\n * @returns Unsubscribe function\n */\n onElementsAdded(handler: ElementAddedHandler): () => void {\n this.addedHandlers.add(handler);\n return () => {\n this.addedHandlers.delete(handler);\n };\n }\n\n /**\n * Subscribe to element removal events\n * @returns Unsubscribe function\n */\n onElementsRemoved(handler: ElementRemovedHandler): () => void {\n this.removedHandlers.add(handler);\n return () => {\n this.removedHandlers.delete(handler);\n };\n }\n\n /**\n * Get all currently tracked elements\n */\n getElements(): ScannedElementInfo[] {\n return this.scanElements();\n }\n\n // ---------------------------------------------------------------------------\n // Private Methods\n // ---------------------------------------------------------------------------\n\n /**\n * Handle MutationObserver callbacks\n */\n private handleMutations(mutations: MutationRecord[]): void {\n let hasRelevantChanges = false;\n\n for (const mutation of mutations) {\n // Check added nodes\n for (const node of mutation.addedNodes) {\n if (this.hasDataLocElements(node)) {\n hasRelevantChanges = true;\n break;\n }\n }\n\n if (hasRelevantChanges) break;\n\n // Check removed nodes\n for (const node of mutation.removedNodes) {\n if (this.hasDataLocElements(node)) {\n hasRelevantChanges = true;\n break;\n }\n }\n\n if (hasRelevantChanges) break;\n }\n\n if (hasRelevantChanges) {\n this.debouncedReconcile();\n }\n }\n\n /**\n * Check if a node or its descendants have data-loc attributes\n */\n private hasDataLocElements(node: Node): boolean {\n if (!(node instanceof Element)) {\n return false;\n }\n\n // Check the node itself\n if (node.hasAttribute(DATA_LOC_ATTR)) {\n return true;\n }\n\n // Check descendants\n if (node.querySelector(`[${DATA_LOC_ATTR}]`)) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Debounced reconciliation to handle rapid DOM updates\n */\n private debouncedReconcile(): void {\n if (this.reconcileTimeout) {\n clearTimeout(this.reconcileTimeout);\n }\n\n this.reconcileTimeout = setTimeout(() => {\n this.reconcile();\n this.reconcileTimeout = null;\n }, RECONCILE_DEBOUNCE_MS);\n }\n\n /**\n * Full reconciliation: scan DOM, diff with known elements, emit events\n */\n private reconcile(): void {\n // SSR guard\n if (typeof window === \"undefined\") {\n return;\n }\n\n // Scan current state\n const currentElements = this.scanElements();\n const currentById = new Map(currentElements.map((el) => [el.id, el]));\n const currentIds = new Set(currentById.keys());\n const knownIds = new Set(this.knownElements.keys());\n\n // Find added elements (in current but not known)\n const addedElements: ScannedElementInfo[] = [];\n for (const el of currentElements) {\n if (!knownIds.has(el.id)) {\n addedElements.push(el);\n }\n }\n\n // Find removed elements (in known but not current)\n const removedIds: string[] = [];\n for (const id of knownIds) {\n if (!currentIds.has(id)) {\n removedIds.push(id);\n }\n }\n\n // Update known elements map\n this.knownElements.clear();\n for (const el of currentElements) {\n this.knownElements.set(el.id, el.element);\n }\n\n // Emit added events\n if (addedElements.length > 0) {\n for (const handler of this.addedHandlers) {\n try {\n handler(addedElements);\n } catch (error) {\n devError(\"[DOMObserverService] Error in added handler:\", error);\n }\n }\n }\n\n // Emit removed events\n if (removedIds.length > 0) {\n for (const handler of this.removedHandlers) {\n try {\n handler(removedIds);\n } catch (error) {\n devError(\n \"[DOMObserverService] Error in removed handler:\",\n error\n );\n }\n }\n }\n }\n\n /**\n * Scan the DOM for all elements with data-loc attributes\n */\n private scanElements(): ScannedElementInfo[] {\n // Get querySelectorAll function (injected or from document)\n const querySelectorAllFn =\n this.options.querySelectorAll ??\n (typeof document !== \"undefined\"\n ? document.querySelectorAll.bind(document)\n : undefined);\n\n // SSR guard - skip if no query function available\n if (!querySelectorAllFn) {\n return [];\n }\n\n const elements: ScannedElementInfo[] = [];\n\n // Track occurrences of each dataLoc to generate unique IDs\n const occurrenceByDataLoc = new Map<string, number>();\n\n // Query all elements with data-loc attribute\n const locElements = querySelectorAllFn(`[${DATA_LOC_ATTR}]`);\n\n for (const el of locElements) {\n // Skip elements inside UILint's own UI\n if (this.isInsideUILintUI(el)) {\n continue;\n }\n\n // Get and parse the data-loc value using pure function\n const rawDataLoc = el.getAttribute(DATA_LOC_ATTR);\n const dataLoc = parseDataLoc(rawDataLoc ?? \"\");\n if (!dataLoc) continue;\n\n // Skip node_modules if filtering is enabled using pure function\n if (shouldFilterPath(dataLoc, this.hideNodeModules)) {\n continue;\n }\n\n // Calculate occurrence number for this dataLoc\n const occurrence = (occurrenceByDataLoc.get(dataLoc) ?? 0) + 1;\n occurrenceByDataLoc.set(dataLoc, occurrence);\n\n // Generate unique ID using pure function\n const id = generateElementId(dataLoc, occurrence);\n\n elements.push({\n id,\n dataLoc,\n element: el,\n tagName: el.tagName.toLowerCase(),\n rect: el.getBoundingClientRect(),\n });\n }\n\n return elements;\n }\n\n /**\n * Check if an element is inside UILint's own UI\n */\n private isInsideUILintUI(element: Element): boolean {\n return element.closest(\"[data-ui-lint]\") !== null;\n }\n}\n\n// =============================================================================\n// Factory Function\n// =============================================================================\n\n/**\n * Create a new DOMObserverService instance with optional dependency injection\n * @param options - Optional configuration for dependency injection (useful for testing)\n * @returns A new DOMObserverService instance\n */\nexport function createDOMObserverService(\n options?: DOMObserverOptions\n): DOMObserverService {\n return new DOMObserverServiceImpl(options);\n}\n\n// =============================================================================\n// Singleton Export (Backward Compatibility)\n// =============================================================================\n\n/**\n * Shared DOM observer service instance\n * @deprecated Use createDOMObserverService() for new code that needs testability\n */\nexport const domObserver: DOMObserverService = new DOMObserverServiceImpl();\n","/**\n * Icon Map\n *\n * Maps IconName strings from uilint-core to Lucide React icons.\n */\n\nimport type { IconName } from \"uilint-core\";\nimport {\n Target,\n Link,\n ExternalLink,\n ChevronRight,\n ChevronDown,\n ChevronUp,\n X,\n Check,\n AlertTriangle,\n AlertCircle,\n Info,\n HelpCircle,\n Eye,\n Camera,\n Crop,\n ScanLine,\n Search,\n Filter,\n Brain,\n Sparkles,\n Code,\n File,\n FileCode,\n Folder,\n GitBranch,\n Copy,\n Clipboard,\n Play,\n Pause,\n RefreshCw,\n Trash2,\n Edit,\n Settings,\n Plus,\n Minus,\n Loader2,\n CheckCircle,\n XCircle,\n Clock,\n type LucideIcon,\n} from \"lucide-react\";\n\n/**\n * Maps IconName to Lucide icon component\n */\nconst iconMap: Record<IconName, LucideIcon> = {\n // UI Navigation\n target: Target,\n link: Link,\n \"external-link\": ExternalLink,\n \"chevron-right\": ChevronRight,\n \"chevron-down\": ChevronDown,\n \"chevron-up\": ChevronUp,\n x: X,\n check: Check,\n \"alert-triangle\": AlertTriangle,\n \"alert-circle\": AlertCircle,\n info: Info,\n \"help-circle\": HelpCircle,\n // Analysis\n eye: Eye,\n camera: Camera,\n crop: Crop,\n scan: ScanLine,\n search: Search,\n filter: Filter,\n brain: Brain,\n sparkles: Sparkles,\n // Code\n code: Code,\n file: File,\n \"file-code\": FileCode,\n folder: Folder,\n \"git-branch\": GitBranch,\n copy: Copy,\n clipboard: Clipboard,\n // Actions\n play: Play,\n pause: Pause,\n refresh: RefreshCw,\n trash: Trash2,\n edit: Edit,\n settings: Settings,\n plus: Plus,\n minus: Minus,\n // Status\n loader: Loader2,\n \"check-circle\": CheckCircle,\n \"x-circle\": XCircle,\n clock: Clock,\n};\n\n/**\n * Gets the Lucide icon component for an IconName\n */\nexport function getIcon(name: IconName): LucideIcon {\n return iconMap[name] || Info;\n}\n\n/**\n * Renders an icon by name\n */\nexport function Icon({\n name,\n size = 16,\n className,\n style,\n}: {\n name: IconName;\n size?: number;\n className?: string;\n style?: React.CSSProperties;\n}) {\n const IconComponent = getIcon(name);\n return <IconComponent size={size} className={className} style={style} />;\n}\n","/**\n * Plugin Adapter\n *\n * Adapts declarative PluginWithHandlers (from uilint-core) to imperative\n * Plugin (for uilint-react). This allows plugin packages to export pure\n * TypeScript definitions while the React host renders the appropriate UI.\n *\n * Browser actions are registered by plugins during onLoad — no hardcoded\n * plugin-specific imports.\n */\n\nimport React from \"react\";\nimport type {\n PluginWithHandlers,\n PluginContext,\n ActionReference,\n CommandDefinition,\n ToolbarGroupDefinition,\n ToolbarActionDefinition,\n DataBinding,\n ExpressionBinding,\n BrowserActionResult,\n} from \"uilint-core\";\nimport {\n isDataBinding,\n isExpressionBinding,\n} from \"uilint-core\";\nimport type {\n Plugin,\n PluginServices,\n Command,\n ToolbarAction,\n ToolbarActionGroup,\n IssueContribution,\n} from \"./types\";\nimport { getIcon } from \"../../ui/components/Schema/icon-map\";\n\n// =============================================================================\n// BROWSER ACTION REGISTRY\n// =============================================================================\n\ntype BrowserActionHandler = (payload?: unknown) => Promise<BrowserActionResult>;\n\n/**\n * Global registry of browser action handlers.\n * Plugins register their handlers during onLoad via ctx.registerBrowserAction().\n */\nconst browserActionRegistry = new Map<string, BrowserActionHandler>();\n\n/**\n * Register a browser action handler.\n */\nexport function registerBrowserAction(type: string, handler: BrowserActionHandler): void {\n browserActionRegistry.set(type, handler);\n}\n\n/**\n * Execute a registered browser action.\n */\nasync function executeBrowserAction(type: string, payload?: unknown): Promise<BrowserActionResult> {\n const handler = browserActionRegistry.get(type);\n if (!handler) {\n return { success: false, error: `Unknown browser action: ${type}` };\n }\n return handler(payload);\n}\n\n/**\n * Clear all registered browser actions (for testing).\n */\nexport function clearBrowserActionRegistry(): void {\n browserActionRegistry.clear();\n}\n\n// =============================================================================\n// PLUGIN CONTEXT FACTORY\n// =============================================================================\n\n/**\n * Creates a PluginContext from PluginServices\n */\nfunction createPluginContext<TState>(\n services: PluginServices,\n pluginId: string,\n actionHandlers: PluginWithHandlers<TState>[\"actions\"]\n): PluginContext<TState> {\n return {\n getState: () => {\n const fullState = services.getState<{\n plugins?: Record<string, TState>;\n }>();\n return fullState.plugins?.[pluginId] as TState;\n },\n setState: (partial: Partial<TState>) => {\n services.setState(partial);\n },\n dispatch: (actionType: string, payload?: unknown) => {\n if (actionHandlers && actionHandlers[actionType]) {\n const ctx = createPluginContext(services, pluginId, actionHandlers);\n return actionHandlers[actionType](ctx, payload);\n }\n },\n websocket: services.websocket,\n getCurrentRoute: () => {\n return window.location.pathname;\n },\n requestBrowserAction: async (type: string, payload?: unknown) => {\n return executeBrowserAction(type, payload);\n },\n registerBrowserAction: (type: string, handler: (payload?: unknown) => Promise<BrowserActionResult>) => {\n registerBrowserAction(type, handler);\n },\n openInEditor: (dataLoc: string) => {\n // Parse dataLoc and open in editor\n const [filePath, line] = dataLoc.split(\":\");\n const url = `vscode://file/${filePath}:${line}`;\n window.open(url, \"_self\");\n },\n setHeatmapFilter: (dataLocs: string[], label?: string) => {\n const state = services.getState<{\n setHeatmapFilter?: (locs: string[], label?: string) => void;\n }>();\n state.setHeatmapFilter?.(dataLocs, label);\n },\n clearHeatmapFilter: () => {\n const state = services.getState<{\n clearHeatmapFilter?: () => void;\n }>();\n state.clearHeatmapFilter?.();\n },\n openInspector: (panelId: string, data?: Record<string, unknown>) => {\n // Open inspector using the panel ID directly.\n // The inspector system routes to the correct panel by ID.\n services.openInspector(panelId, { ...data });\n },\n closeInspector: () => {\n services.closeInspector();\n },\n requestOverlayInteraction: (type, _options) => {\n return new Promise((resolve, reject) => {\n // Delegate to the store's overlay interaction system\n const fullState = services.getState<{\n startOverlayInteraction?: (interaction: {\n type: string;\n pluginId: string;\n onComplete: (result: unknown) => void;\n onCancel: () => void;\n }) => void;\n }>();\n if (!fullState.startOverlayInteraction) {\n reject(new Error(\"Overlay interactions not supported by host\"));\n return;\n }\n fullState.startOverlayInteraction({\n type,\n pluginId,\n onComplete: resolve,\n onCancel: () => reject(new Error(\"Overlay interaction cancelled\")),\n });\n });\n },\n };\n}\n\n// =============================================================================\n// CONDITION EVALUATION\n// =============================================================================\n\n/**\n * Evaluates a DataBinding or ExpressionBinding against state\n */\nfunction evaluateCondition(\n condition: DataBinding | ExpressionBinding | undefined,\n state: unknown\n): boolean {\n if (!condition) return true;\n\n if (isDataBinding(condition)) {\n // Navigate the binding path\n const parts = condition.binding.split(\".\");\n let value: unknown = state;\n for (const part of parts) {\n if (value && typeof value === \"object\") {\n value = (value as Record<string, unknown>)[part];\n } else {\n return false;\n }\n }\n return Boolean(value);\n }\n\n if (isExpressionBinding(condition)) {\n // Simple expression evaluation (for basic cases)\n // For security, we only support specific patterns\n const expr = condition.expression;\n\n // Handle \"property === value\" patterns\n const equalMatch = expr.match(/^(\\w+(?:\\.\\w+)*)\\s*===?\\s*(.+)$/);\n if (equalMatch) {\n const [, path, expectedStr] = equalMatch;\n let value: unknown = state;\n for (const part of path.split(\".\")) {\n if (value && typeof value === \"object\") {\n value = (value as Record<string, unknown>)[part];\n } else {\n value = undefined;\n break;\n }\n }\n const expected = expectedStr.trim();\n if (expected === \"true\") return value === true;\n if (expected === \"false\") return value === false;\n if (expected === \"null\") return value === null;\n if (expected === \"0\") return value === 0;\n if (expected.startsWith('\"') && expected.endsWith('\"')) {\n return value === expected.slice(1, -1);\n }\n return String(value) === expected;\n }\n\n // Handle \"property.length === 0\" patterns\n const lengthMatch = expr.match(/^(\\w+(?:\\.\\w+)*)\\.length\\s*===?\\s*(\\d+)$/);\n if (lengthMatch) {\n const [, path, expectedLength] = lengthMatch;\n let value: unknown = state;\n for (const part of path.split(\".\")) {\n if (value && typeof value === \"object\") {\n value = (value as Record<string, unknown>)[part];\n } else {\n value = undefined;\n break;\n }\n }\n if (Array.isArray(value) || typeof value === \"string\" || value instanceof Map) {\n const len = value instanceof Map ? value.size : (value as unknown[]).length;\n return len === parseInt(expectedLength, 10);\n }\n return false;\n }\n\n // Default to false for unsupported expressions\n return false;\n }\n\n return true;\n}\n\n// =============================================================================\n// COMMAND ADAPTATION\n// =============================================================================\n\n/**\n * Adapts a declarative CommandDefinition to an imperative Command\n */\nfunction adaptCommand<TState>(\n cmd: CommandDefinition,\n pluginId: string,\n actionHandlers: PluginWithHandlers<TState>[\"actions\"]\n): Command {\n return {\n id: cmd.id,\n title: cmd.title,\n keywords: cmd.keywords,\n category: cmd.category,\n subtitle: cmd.subtitle,\n icon: cmd.icon ? React.createElement(getIcon(cmd.icon), { size: 16 }) : undefined,\n shortcut: cmd.shortcut,\n hideFromAllCategory: cmd.hideFromAllCategory,\n isAvailable: cmd.isAvailable\n ? (state: unknown) => {\n const pluginState = (state as { plugins?: Record<string, TState> })?.plugins?.[pluginId];\n return evaluateCondition(cmd.isAvailable, pluginState);\n }\n : undefined,\n execute: (services: PluginServices) => {\n const ctx = createPluginContext(services, pluginId, actionHandlers);\n return executeAction(cmd.action, ctx, actionHandlers);\n },\n };\n}\n\n// =============================================================================\n// TOOLBAR ADAPTATION\n// =============================================================================\n\n/**\n * Adapts a declarative ToolbarActionDefinition to an imperative ToolbarAction\n */\nfunction adaptToolbarAction<TState>(\n action: ToolbarActionDefinition,\n pluginId: string,\n actionHandlers: PluginWithHandlers<TState>[\"actions\"]\n): ToolbarAction {\n return {\n id: action.id,\n icon: React.createElement(getIcon(action.icon), { size: 16 }),\n tooltip: action.tooltip,\n isVisible: action.isVisible\n ? (state: unknown) => {\n const pluginState = (state as { plugins?: Record<string, TState> })?.plugins?.[pluginId];\n return evaluateCondition(action.isVisible, pluginState);\n }\n : undefined,\n isEnabled: action.isEnabled\n ? (state: unknown) => {\n const pluginState = (state as { plugins?: Record<string, TState> })?.plugins?.[pluginId];\n return evaluateCondition(action.isEnabled, pluginState);\n }\n : undefined,\n onClick: (services: PluginServices) => {\n const ctx = createPluginContext(services, pluginId, actionHandlers);\n return executeAction(action.action, ctx, actionHandlers);\n },\n };\n}\n\n/**\n * Adapts a declarative ToolbarGroupDefinition to an imperative ToolbarActionGroup\n */\nfunction adaptToolbarGroup<TState>(\n group: ToolbarGroupDefinition,\n pluginId: string,\n actionHandlers: PluginWithHandlers<TState>[\"actions\"]\n): ToolbarActionGroup {\n return {\n id: group.id,\n icon: React.createElement(getIcon(group.icon), { size: 16 }),\n tooltip: group.tooltip,\n priority: group.priority,\n isVisible: group.isVisible\n ? (state: unknown) => {\n const pluginState = (state as { plugins?: Record<string, TState> })?.plugins?.[pluginId];\n return evaluateCondition(group.isVisible, pluginState);\n }\n : undefined,\n actions: group.actions.map((action) =>\n adaptToolbarAction(action, pluginId, actionHandlers)\n ),\n };\n}\n\n// =============================================================================\n// ACTION EXECUTION\n// =============================================================================\n\n/**\n * Executes an ActionReference using the plugin's action handlers\n */\nfunction executeAction<TState>(\n action: ActionReference,\n ctx: PluginContext<TState>,\n actionHandlers: PluginWithHandlers<TState>[\"actions\"]\n): void | Promise<void> {\n if (!actionHandlers || !actionHandlers[action.type]) {\n console.warn(`No handler found for action: ${action.type}`);\n return;\n }\n\n // Build payload from static payload and bindings\n const payload: Record<string, unknown> = action.payload ? { ...action.payload } : {};\n\n if (action.payloadBindings) {\n const state = ctx.getState();\n for (const [key, binding] of Object.entries(action.payloadBindings)) {\n const parts = binding.split(\".\");\n let value: unknown = state;\n for (const part of parts) {\n if (value && typeof value === \"object\") {\n value = (value as Record<string, unknown>)[part];\n } else {\n value = undefined;\n break;\n }\n }\n payload[key] = value;\n }\n }\n\n return actionHandlers[action.type](ctx, payload);\n}\n\n// =============================================================================\n// MAIN ADAPTER FUNCTION\n// =============================================================================\n\n/**\n * Adapts a declarative PluginWithHandlers to an imperative Plugin\n *\n * This is the main entry point for converting plugin definitions from\n * uilint-core's declarative format to uilint-react's imperative format.\n */\nexport function adaptPlugin<TState>(\n source: PluginWithHandlers<TState>\n): Plugin<TState> {\n const pluginId = source.id;\n const actionHandlers = source.actions;\n\n // Build the adapted plugin\n const adapted: Plugin<TState> = {\n // Metadata\n id: source.id,\n name: source.name,\n version: source.version,\n description: source.description,\n icon: source.icon ? React.createElement(getIcon(source.icon), { size: 16 }) : undefined,\n dependencies: source.dependencies,\n\n // State slice\n createSlice: (services: PluginServices) => {\n // Create initial state with setters\n const initialState = source.state.initialState as Record<string, unknown>;\n\n // Add setter functions for each state property\n const stateWithSetters: Record<string, unknown> = { ...initialState };\n for (const key of Object.keys(initialState)) {\n const setterName = `set${key.charAt(0).toUpperCase()}${key.slice(1)}`;\n stateWithSetters[setterName] = (value: unknown) => {\n services.setState({ [key]: value } as Partial<TState>);\n };\n }\n\n return stateWithSetters as TState;\n },\n\n // Commands\n commands: source.commands?.map((cmd) =>\n adaptCommand(cmd, pluginId, actionHandlers)\n ),\n\n // Toolbar\n toolbarActionGroups: source.toolbarGroups?.map((group) =>\n adaptToolbarGroup(group, pluginId, actionHandlers)\n ),\n\n // Inspector panels (schema-based, rendered by SchemaPanel)\n inspectorPanels: source.panels?.map((panel) => ({\n id: panel.id,\n title: typeof panel.title === \"string\"\n ? panel.title\n : (panel.title as { binding: string }).binding,\n priority: panel.priority,\n component: React.lazy(() =>\n import(\"../../ui/components/Schema/SchemaPanel\").then((m) => ({\n default: (props: { data?: Record<string, unknown>; services: PluginServices }) => {\n // Get plugin state from services\n const fullState = props.services.getState<{\n plugins?: Record<string, TState>;\n }>();\n const pluginState = (fullState.plugins?.[pluginId] ?? {}) as Record<string, unknown>;\n\n // Create action handler\n const onAction = (type: string, payload: Record<string, unknown>) => {\n const ctx = createPluginContext(props.services, pluginId, actionHandlers);\n executeAction({ type, payload }, ctx, actionHandlers);\n };\n\n const SchemaPanel = m.SchemaPanel;\n return React.createElement(SchemaPanel, {\n panel,\n data: props.data || {},\n state: pluginState,\n onAction,\n });\n },\n }))\n ),\n })),\n\n // Rule handling\n handlesRules: source.handlesRuleCategories\n ? (ruleMeta) =>\n Boolean(\n ruleMeta.category &&\n source.handlesRuleCategories?.includes(ruleMeta.category)\n )\n : undefined,\n\n // Issue aggregation\n getIssues: source.getIssues\n ? (state: unknown): IssueContribution => {\n const result = source.getIssues!(state as TState);\n return {\n pluginId: result.pluginId,\n issues: result.issues,\n };\n }\n : undefined,\n\n // Lifecycle\n initialize: (services: PluginServices): void | (() => void) => {\n const ctx = createPluginContext(services, pluginId, actionHandlers);\n const unsubscribes: (() => void)[] = [];\n\n // Set up WebSocket message handlers\n if (source.messageHandlers) {\n for (const [messageType, handler] of Object.entries(source.messageHandlers)) {\n const unsub = services.websocket.on(messageType, (message) => {\n handler(ctx, message);\n });\n unsubscribes.push(unsub);\n }\n\n // Handle connection changes — re-trigger onLoad on reconnect\n const unsubConnection = services.websocket.onConnectionChange((connected) => {\n if (connected && source.onLoad) {\n source.onLoad(ctx);\n }\n });\n unsubscribes.push(unsubConnection);\n }\n\n // Call onLoad if defined (synchronously - ignore async cleanup)\n if (source.onLoad) {\n source.onLoad(ctx);\n }\n\n // Return cleanup function if we have any subscriptions\n if (unsubscribes.length > 0) {\n return () => {\n unsubscribes.forEach((unsub) => unsub());\n };\n }\n },\n\n dispose: source.onUnload\n ? (services: PluginServices) => {\n const ctx = createPluginContext(services, pluginId, actionHandlers);\n return source.onUnload!(ctx);\n }\n : undefined,\n };\n\n return adapted;\n}\n\n/**\n * Adapts multiple plugins from the uilint-core registry\n */\nexport function adaptPlugins(\n sources: PluginWithHandlers[]\n): Plugin[] {\n return sources.map((source) => adaptPlugin(source));\n}\n","import { devWarn, devError, devLog, pluginRegistry as corePluginRegistry } from \"uilint-core\";\nimport type { Plugin } from \"./types\";\nimport { sortByDependencies } from \"./registry\";\nimport { adaptPlugin } from \"./adapter\";\n\n/**\n * Plugin manifest for dynamic loading\n *\n * Note: The load function returns Plugin without a type parameter because\n * dynamic imports load plugins with various slice types. The registry\n * handles type-safe access to plugin-specific state.\n */\nexport interface PluginManifest {\n id: string;\n name: string;\n /** Dynamic import function - returns a module with a default Plugin export */\n load: () => Promise<{ default: Plugin }>;\n /** Whether plugin is enabled */\n enabled: boolean;\n}\n\n/**\n * Local plugin manifests (plugins that stay in uilint-react)\n * These are plugins too tightly coupled to React to be externalized.\n */\nexport const LOCAL_PLUGINS: PluginManifest[] = [\n {\n id: \"eslint\",\n name: \"ESLint Analysis\",\n load: () => import(\"../../plugins/eslint\"),\n enabled: true,\n },\n];\n\n/**\n * External plugin imports (side-effect imports that register with pluginRegistry).\n *\n * Populated by consumers via `registerExternalPlugin()`. This allows the\n * host's entry point to control which plugins are loaded, rather than\n * hardcoding plugin imports here.\n */\nconst externalPluginImports: Array<() => Promise<unknown>> = [];\n\n/**\n * Register an external plugin import function.\n *\n * External plugins auto-register with uilint-core's pluginRegistry when\n * imported. Call this from your app's entry point to make plugins available.\n *\n * @example\n * ```typescript\n * // In your app's entry point:\n * import { registerExternalPlugin } from \"uilint-react\";\n * registerExternalPlugin(() => import(\"uilint-vision/plugin\"));\n * registerExternalPlugin(() => import(\"uilint-semantic/plugin\"));\n * ```\n */\nexport function registerExternalPlugin(importFn: () => Promise<unknown>): void {\n externalPluginImports.push(importFn);\n}\n\n/**\n * @deprecated Use LOCAL_PLUGINS instead. This is kept for backward compatibility.\n */\nexport const BUILT_IN_PLUGINS: PluginManifest[] = LOCAL_PLUGINS;\n\n/**\n * Load a single plugin from its manifest\n * @param manifest - The plugin manifest to load\n * @returns The loaded plugin or null on failure\n */\nexport async function loadPlugin(\n manifest: PluginManifest\n): Promise<Plugin | null> {\n try {\n const module = await manifest.load();\n return module.default;\n } catch (error) {\n devError(`Failed to load plugin \"${manifest.id}\":`, error);\n return null;\n }\n}\n\n/**\n * Load external plugins from the uilint-core plugin registry.\n * These are imported via side-effect imports which auto-register with the registry.\n */\nasync function loadExternalPlugins(): Promise<Plugin[]> {\n // Import all registered external plugins (triggers their auto-registration)\n const importPromises = externalPluginImports.map(async (importFn) => {\n try {\n await importFn();\n } catch (error) {\n // External plugins may not be installed - this is fine\n devWarn(\"Failed to import external plugin:\", error);\n }\n });\n\n await Promise.all(importPromises);\n\n // Get all registered plugins from the core registry\n const registeredPlugins = corePluginRegistry.getAll();\n devLog(`[Loader] Found ${registeredPlugins.length} plugins in core registry`);\n\n // Adapt each declarative plugin to the imperative interface\n const adaptedPlugins: Plugin[] = [];\n for (const plugin of registeredPlugins) {\n try {\n const adapted = adaptPlugin(plugin);\n adaptedPlugins.push(adapted);\n devLog(`[Loader] Adapted plugin: ${plugin.id}`);\n } catch (error) {\n devError(`[Loader] Failed to adapt plugin \"${plugin.id}\":`, error);\n }\n }\n\n return adaptedPlugins;\n}\n\n/**\n * Load multiple plugins from manifests\n * @param manifests - Array of plugin manifests to load (defaults to LOCAL_PLUGINS)\n * @param onProgress - Optional callback for progress updates\n * @returns Array of loaded plugins sorted by dependencies\n */\nexport async function loadPlugins(\n manifests: PluginManifest[] = LOCAL_PLUGINS,\n onProgress?: (loaded: number, total: number, pluginId: string) => void\n): Promise<Plugin[]> {\n const allPlugins: Plugin[] = [];\n\n // Load external plugins first (from uilint-core registry)\n const externalPlugins = await loadExternalPlugins();\n allPlugins.push(...externalPlugins);\n\n // Filter to only enabled local plugins\n const enabledManifests = manifests.filter((m) => m.enabled);\n const total = enabledManifests.length + externalPlugins.length;\n\n // Load local plugins in parallel\n const loadPromises = enabledManifests.map(async (manifest, index) => {\n const plugin = await loadPlugin(manifest);\n\n if (onProgress) {\n onProgress(externalPlugins.length + index + 1, total, manifest.id);\n }\n\n return plugin;\n });\n\n const results = await Promise.all(loadPromises);\n\n // Filter out null results and validate plugins\n const loadedLocalPlugins = results.filter((plugin): plugin is Plugin => {\n if (!plugin) {\n return false;\n }\n\n if (!plugin.id) {\n devWarn(\"Plugin missing id, skipping:\", plugin);\n return false;\n }\n\n return true;\n });\n\n allPlugins.push(...loadedLocalPlugins);\n\n // Sort by dependencies\n return sortByDependencies(allPlugins);\n}\n\n/**\n * Get a plugin manifest by ID\n * @param id - The plugin ID to find\n * @returns The plugin manifest or undefined if not found\n */\nexport function getPluginManifest(id: string): PluginManifest | undefined {\n return LOCAL_PLUGINS.find((manifest) => manifest.id === id);\n}\n","/**\n * ESLint Plugin Commands\n *\n * Commands for the command palette related to ESLint functionality.\n */\n\nimport { devWarn } from \"uilint-core\";\nimport type { Command, PluginServices } from \"../../core/plugin-system/types\";\nimport type { ScanStatus } from \"./slice\";\n\n/**\n * Toggle ESLint scanning on/off\n */\nconst toggleScanCommand: Command = {\n id: \"eslint:toggle-scan\",\n title: \"Toggle ESLint Scan\",\n keywords: [\"eslint\", \"scan\", \"toggle\", \"enable\", \"disable\", \"start\", \"stop\"],\n category: \"eslint\",\n subtitle: \"Enable or disable real-time ESLint analysis\",\n icon: undefined,\n hideFromAllCategory: true,\n execute: (services: PluginServices) => {\n const state = services.getState<{\n plugins: {\n eslint?: {\n scanStatus: ScanStatus;\n startScanning: () => void;\n stopScanning: () => void;\n };\n };\n }>();\n\n const eslint = state.plugins.eslint;\n if (!eslint) {\n devWarn(\"[ESLint Command] ESLint plugin slice not found\");\n return;\n }\n\n if (eslint.scanStatus === \"scanning\") {\n eslint.stopScanning();\n } else {\n eslint.startScanning();\n }\n\n services.closeCommandPalette();\n },\n isAvailable: (state: unknown) => {\n const s = state as { wsConnected?: boolean };\n return s.wsConnected === true;\n },\n};\n\n/**\n * Open the fixes inspector to show all fixable issues\n */\nconst openFixesInspectorCommand: Command = {\n id: \"eslint:open-fixes\",\n title: \"Fix All Issues\",\n keywords: [\"eslint\", \"fix\", \"fixes\", \"autofix\", \"repair\", \"issues\"],\n category: \"eslint\",\n subtitle: \"Open the fixes inspector panel\",\n hideFromAllCategory: true,\n execute: (services: PluginServices) => {\n services.openInspector(\"fixes\", {});\n services.closeCommandPalette();\n },\n isAvailable: (state: unknown) => {\n const s = state as {\n plugins?: {\n eslint?: {\n scanStatus?: ScanStatus;\n issues?: Map<string, unknown[]>;\n };\n };\n };\n const eslint = s.plugins?.eslint;\n // Available when scanning and there are issues\n if (eslint?.scanStatus !== \"scanning\") return false;\n if (!eslint?.issues) return false;\n return eslint.issues.size > 0;\n },\n};\n\n/**\n * Start ESLint scan\n */\nconst startScanCommand: Command = {\n id: \"eslint:start-scan\",\n title: \"Start ESLint Scan\",\n keywords: [\"eslint\", \"scan\", \"start\", \"analyze\", \"lint\", \"check\"],\n category: \"eslint\",\n subtitle: \"Scan all elements on the current page\",\n hideFromAllCategory: true,\n execute: (services: PluginServices) => {\n const state = services.getState<{\n plugins: {\n eslint?: {\n scanStatus: ScanStatus;\n startScanning: () => void;\n };\n };\n }>();\n\n const eslint = state.plugins.eslint;\n if (!eslint) {\n devWarn(\"[ESLint Command] ESLint plugin slice not found\");\n return;\n }\n\n if (eslint.scanStatus !== \"scanning\") {\n eslint.startScanning();\n }\n\n services.closeCommandPalette();\n },\n isAvailable: (state: unknown) => {\n const s = state as { wsConnected?: boolean; plugins?: { eslint?: { scanStatus?: ScanStatus } } };\n return s.wsConnected === true && s.plugins?.eslint?.scanStatus !== \"scanning\";\n },\n};\n\n/**\n * Stop ESLint scan\n */\nconst stopScanCommand: Command = {\n id: \"eslint:stop-scan\",\n title: \"Stop ESLint Scan\",\n keywords: [\"eslint\", \"scan\", \"stop\", \"disable\", \"off\"],\n category: \"eslint\",\n subtitle: \"Stop scanning and clear results\",\n hideFromAllCategory: true,\n execute: (services: PluginServices) => {\n const state = services.getState<{\n plugins: {\n eslint?: {\n stopScanning: () => void;\n };\n };\n }>();\n\n const eslint = state.plugins.eslint;\n if (!eslint) {\n devWarn(\"[ESLint Command] ESLint plugin slice not found\");\n return;\n }\n\n eslint.stopScanning();\n services.closeCommandPalette();\n },\n isAvailable: (state: unknown) => {\n const s = state as { plugins?: { eslint?: { scanStatus?: ScanStatus } } };\n return s.plugins?.eslint?.scanStatus === \"scanning\";\n },\n};\n\n/**\n * Clear ESLint results and re-scan\n */\nconst clearAndRescanCommand: Command = {\n id: \"eslint:clear-rescan\",\n title: \"Clear & Rescan\",\n keywords: [\"eslint\", \"cache\", \"clear\", \"refresh\", \"reset\", \"rescan\"],\n category: \"eslint\",\n subtitle: \"Clear cached results and re-scan all files\",\n hideFromAllCategory: true,\n execute: (services: PluginServices) => {\n const state = services.getState<{\n plugins: {\n eslint?: {\n scanStatus: ScanStatus;\n clearIssues: () => void;\n startScanning: () => void;\n };\n };\n }>();\n\n const eslint = state.plugins.eslint;\n if (!eslint) {\n devWarn(\"[ESLint Command] ESLint plugin slice not found\");\n return;\n }\n\n // Clear issues and restart scanning\n eslint.clearIssues();\n eslint.startScanning();\n\n services.closeCommandPalette();\n },\n isAvailable: (state: unknown) => {\n const s = state as { wsConnected?: boolean };\n return s.wsConnected === true;\n },\n};\n\n/**\n * All ESLint commands exported for the plugin\n */\nexport const eslintCommands: Command[] = [\n toggleScanCommand,\n startScanCommand,\n stopScanCommand,\n openFixesInspectorCommand,\n clearAndRescanCommand,\n];\n","/**\n * ESLint Plugin State Slice (Simplified)\n *\n * Uses unified Issue type - single cache, minimal state.\n */\n\nimport type { PluginServices } from \"../../core/plugin-system/types\";\nimport type { Issue } from \"../../ui/types\";\nimport type { AvailableRule, RuleConfig } from \"./types\";\n\n/** Scan status - single source of truth for scanning state */\nexport type ScanStatus = \"idle\" | \"scanning\" | \"complete\" | \"error\";\n\n/**\n * Workspace capabilities from server\n */\nexport interface WorkspaceCapabilities {\n postToolUseHook: {\n enabled: boolean;\n provider: \"claude\" | \"cursor\" | null;\n };\n}\n\n/**\n * Linting progress info for a file\n */\nexport interface LintingProgress {\n /** Current phase description from server */\n phase: string;\n /** Timestamp when linting started */\n startedAt: number;\n}\n\n/**\n * ESLint plugin state\n */\nexport interface ESLintSlice {\n /** Issues keyed by dataLoc */\n issues: Map<string, Issue[]>;\n /** DataLocs that have been scanned */\n scannedDataLocs: Set<string>;\n /** File paths that have been requested for linting (to avoid duplicates) */\n requestedFiles: Set<string>;\n /** Current scan status - \"scanning\" means live scan is active */\n scanStatus: ScanStatus;\n /** Files currently being linted with their progress info */\n lintingFiles: Map<string, LintingProgress>;\n /** Available rules from server */\n availableRules: AvailableRule[];\n /** Disabled rules (visual filtering) */\n disabledRules: Set<string>;\n /** Workspace root path */\n workspaceRoot: string | null;\n /** Current rule configurations (severity + options) */\n ruleConfigs: Map<string, RuleConfig>;\n /** Rules currently being updated */\n ruleConfigUpdating: Map<string, boolean>;\n /** Workspace capabilities (hook availability, etc.) */\n workspaceCapabilities: WorkspaceCapabilities | null;\n}\n\n/**\n * ESLint plugin actions\n */\nexport interface ESLintActions {\n /** Start live scanning */\n startScanning: () => void;\n /** Stop scanning and clear results */\n stopScanning: () => void;\n /** Set issues for a dataLoc */\n setIssues: (dataLoc: string, issues: Issue[]) => void;\n /** Clear all issues */\n clearIssues: () => void;\n /** Toggle a rule on/off */\n toggleRule: (ruleId: string) => void;\n /** Set available rules */\n setAvailableRules: (rules: AvailableRule[]) => void;\n /** Set workspace root */\n setWorkspaceRoot: (root: string | null) => void;\n /** Mark a dataLoc as scanned */\n markScanned: (dataLoc: string) => void;\n /** Mark a file as requested for linting */\n markFileRequested: (filePath: string) => void;\n /** Set scan status */\n setScanStatus: (status: ScanStatus) => void;\n}\n\n/** Combined slice type */\nexport type ESLintPluginSlice = ESLintSlice & ESLintActions;\n\n/**\n * Helper to check if scanning is active\n */\nexport function isScanning(status: ScanStatus): boolean {\n return status === \"scanning\";\n}\n\n/**\n * Initial state - scanning by default\n */\nexport const initialESLintState: ESLintSlice = {\n issues: new Map(),\n scannedDataLocs: new Set(),\n requestedFiles: new Set(),\n scanStatus: \"scanning\", // Start scanning by default\n lintingFiles: new Map(),\n availableRules: [],\n disabledRules: new Set(),\n workspaceRoot: null,\n ruleConfigs: new Map(),\n ruleConfigUpdating: new Map(),\n workspaceCapabilities: null,\n};\n\n/**\n * Create ESLint slice state\n */\nexport function createESLintSlice(_services: PluginServices): ESLintSlice {\n return { ...initialESLintState };\n}\n\n/**\n * Create ESLint slice actions\n */\nexport function createESLintActions(\n _services: PluginServices,\n getSlice: () => ESLintSlice,\n setSlice: (partial: Partial<ESLintSlice>) => void\n): ESLintActions {\n return {\n startScanning: () => {\n setSlice({ scanStatus: \"scanning\" });\n },\n\n stopScanning: () => {\n setSlice({\n scanStatus: \"idle\",\n issues: new Map(),\n scannedDataLocs: new Set(),\n requestedFiles: new Set(),\n });\n },\n\n setIssues: (dataLoc: string, issues: Issue[]) => {\n const current = getSlice();\n const newIssues = new Map(current.issues);\n if (issues.length > 0) {\n newIssues.set(dataLoc, issues);\n } else {\n newIssues.delete(dataLoc);\n }\n setSlice({ issues: newIssues });\n },\n\n clearIssues: () => {\n setSlice({\n issues: new Map(),\n scannedDataLocs: new Set(),\n requestedFiles: new Set(),\n });\n },\n\n toggleRule: (ruleId: string) => {\n const current = getSlice();\n const newDisabled = new Set(current.disabledRules);\n if (newDisabled.has(ruleId)) {\n newDisabled.delete(ruleId);\n } else {\n newDisabled.add(ruleId);\n }\n setSlice({ disabledRules: newDisabled });\n },\n\n setAvailableRules: (rules: AvailableRule[]) => {\n setSlice({ availableRules: rules });\n },\n\n setWorkspaceRoot: (root: string | null) => {\n setSlice({ workspaceRoot: root });\n },\n\n markScanned: (dataLoc: string) => {\n const current = getSlice();\n const newScanned = new Set(current.scannedDataLocs);\n newScanned.add(dataLoc);\n setSlice({ scannedDataLocs: newScanned });\n },\n\n markFileRequested: (filePath: string) => {\n const current = getSlice();\n const newRequested = new Set(current.requestedFiles);\n newRequested.add(filePath);\n setSlice({ requestedFiles: newRequested });\n },\n\n setScanStatus: (status: ScanStatus) => {\n setSlice({ scanStatus: status });\n },\n };\n}\n\n/**\n * Filter issues by disabled rules\n */\nexport function filterByDisabledRules(\n issues: Issue[],\n disabledRules: Set<string>\n): Issue[] {\n if (disabledRules.size === 0) return issues;\n return issues.filter((issue) => !disabledRules.has(issue.ruleId));\n}\n","/**\n * ESLint Plugin Scanner Utilities\n *\n * Utilities for extracting file paths from dataLoc attributes\n * and managing lint request deduplication.\n */\n\n/**\n * Parse a dataLoc string to extract the file path.\n *\n * DataLoc format: \"path/to/file.tsx:line:column\"\n * Examples:\n * - \"app/page.tsx:10:5\" → \"app/page.tsx\"\n * - \"src/components/Button.tsx:42:8\" → \"src/components/Button.tsx\"\n * - \"/home/user/project/src/App.tsx:10:5\" → \"/home/user/project/src/App.tsx\"\n *\n * @param dataLoc - The dataLoc string to parse\n * @returns The file path, or null if the format is invalid\n */\nexport function parseFilePathFromDataLoc(dataLoc: string): string | null {\n if (!dataLoc) {\n return null;\n }\n\n // DataLoc format: \"path:line:column\"\n // We need to find the last two colons that separate line:column\n // and extract everything before them as the file path\n\n // Find the last colon (separates column)\n const lastColonIndex = dataLoc.lastIndexOf(\":\");\n if (lastColonIndex === -1) {\n return null;\n }\n\n // Find the second-to-last colon (separates line)\n const secondLastColonIndex = dataLoc.lastIndexOf(\":\", lastColonIndex - 1);\n if (secondLastColonIndex === -1) {\n return null;\n }\n\n // Extract the file path (everything before the line number)\n const filePath = dataLoc.substring(0, secondLastColonIndex);\n\n if (!filePath) {\n return null;\n }\n\n return filePath;\n}\n\n/**\n * Extract unique file paths from an array of dataLoc strings.\n *\n * This deduplicates file paths so we only lint each file once,\n * even if multiple elements on the page come from the same file.\n *\n * @param dataLocs - Array of dataLoc strings\n * @returns Set of unique file paths\n */\nexport function extractUniqueFilePaths(dataLocs: string[]): Set<string> {\n const filePaths = new Set<string>();\n\n for (const dataLoc of dataLocs) {\n const filePath = parseFilePathFromDataLoc(dataLoc);\n if (filePath) {\n filePaths.add(filePath);\n }\n }\n\n return filePaths;\n}\n","/* eslint-disable uilint/prefer-tailwind */\n/**\n * RulePanel - Inspector panel for viewing and configuring ESLint rules\n *\n * Uses CSS variables from the design system for consistent theming\n * with the devtools overlay.\n */\nimport React, { useCallback } from \"react\";\nimport type { InspectorPanelProps } from \"../../../core/plugin-system/types\";\nimport { pluginRegistry } from \"../../../core/plugin-system/registry\";\nimport { useComposedStore } from \"../../../core/store\";\nimport type { AvailableRule } from \"../types\";\nimport type { ESLintPluginSlice } from \"../slice\";\n\n/**\n * Severity toggle component\n */\nfunction SeverityToggle({\n value,\n onChange,\n disabled,\n}: {\n value: \"error\" | \"warning\" | \"off\";\n onChange: (severity: \"error\" | \"warning\" | \"off\") => void;\n disabled?: boolean;\n}) {\n const options: Array<{ value: \"error\" | \"warning\" | \"off\"; label: string; color: string }> = [\n { value: \"error\", label: \"E\", color: \"var(--uilint-error, oklch(0.72 0.17 25))\" },\n { value: \"warning\", label: \"W\", color: \"var(--uilint-warning, oklch(0.82 0.165 80))\" },\n { value: \"off\", label: \"Off\", color: \"#6b7280\" },\n ];\n\n return (\n <div style={{ display: \"flex\", gap: 4 }}>\n {options.map((opt) => (\n <button\n key={opt.value}\n onClick={() => onChange(opt.value)}\n disabled={disabled}\n style={{\n padding: \"4px 8px\",\n fontSize: 12,\n fontWeight: 500,\n border: \"none\",\n borderRadius: 4,\n cursor: disabled ? \"not-allowed\" : \"pointer\",\n background: value === opt.value ? opt.color : \"var(--uilint-surface-elevated)\",\n color: value === opt.value ? \"white\" : \"var(--uilint-text-disabled)\",\n opacity: disabled ? 0.5 : 1,\n }}\n >\n {opt.label}\n </button>\n ))}\n </div>\n );\n}\n\nexport function RulePanel({ data }: InspectorPanelProps) {\n const ruleId = data?.ruleId as string | undefined;\n\n // Get rule data from store (rule IDs are always full form: \"uilint/...\")\n const rule = useComposedStore((s) => {\n const eslintState = s.plugins?.eslint as ESLintPluginSlice | undefined;\n if (!eslintState?.availableRules || !ruleId) return null;\n return eslintState.availableRules.find((r: AvailableRule) => r.id === ruleId);\n });\n\n const config = useComposedStore((s) => {\n const eslintState = s.plugins?.eslint as ESLintPluginSlice | undefined;\n if (!eslintState?.ruleConfigs) return null;\n return eslintState.ruleConfigs.get(ruleId || \"\");\n });\n\n const isUpdating = useComposedStore((s) => {\n const eslintState = s.plugins?.eslint as ESLintPluginSlice | undefined;\n if (!eslintState?.ruleConfigUpdating) return false;\n return eslintState.ruleConfigUpdating.get(ruleId || \"\") ?? false;\n });\n\n // Get issue count for this rule\n const issueCount = useComposedStore((s) => {\n const eslintState = s.plugins?.eslint as ESLintPluginSlice | undefined;\n if (!eslintState?.issues) return 0;\n let count = 0;\n eslintState.issues.forEach((issues) => {\n count += issues.filter((issue) => issue.ruleId === ruleId).length;\n });\n return count;\n });\n\n const handleSeverityChange = useCallback(\n (severity: \"error\" | \"warning\" | \"off\") => {\n if (!ruleId) return;\n pluginRegistry.setRuleSeverity(ruleId, severity);\n },\n [ruleId]\n );\n\n if (!ruleId) {\n return (\n <div style={{ padding: 16, color: \"var(--uilint-text-muted)\", textAlign: \"center\" }}>\n No rule selected\n </div>\n );\n }\n\n if (!rule) {\n return (\n <div style={{ padding: 16, color: \"var(--uilint-text-muted)\", textAlign: \"center\" }}>\n Rule not found: {ruleId}\n </div>\n );\n }\n\n // Map ESLint severity to display value\n const currentSeverity = config?.severity\n ? config.severity === \"warn\"\n ? \"warning\"\n : config.severity\n : rule.currentSeverity === \"warn\"\n ? \"warning\"\n : rule.currentSeverity ?? \"off\";\n\n return (\n <div style={{ padding: 16 }}>\n {/* Rule header */}\n <div style={{ marginBottom: 16 }}>\n <div\n style={{\n fontSize: 16,\n fontWeight: 600,\n color: \"var(--uilint-text-primary)\",\n marginBottom: 4,\n }}\n >\n {rule.name}\n </div>\n <div\n style={{\n fontSize: 12,\n color: \"var(--uilint-text-muted)\",\n fontFamily: \"monospace\",\n }}\n >\n {rule.id}\n </div>\n </div>\n\n {/* Description */}\n <div\n style={{\n fontSize: 14,\n color: \"var(--uilint-text-secondary)\",\n marginBottom: 16,\n lineHeight: 1.5,\n }}\n >\n {rule.description}\n </div>\n\n {/* Category and issue count */}\n <div\n style={{\n display: \"flex\",\n gap: 8,\n marginBottom: 16,\n }}\n >\n <span\n style={{\n fontSize: 11,\n fontWeight: 500,\n textTransform: \"uppercase\",\n background: rule.category === \"semantic\"\n ? \"rgba(59, 130, 246, 0.1)\"\n : \"var(--uilint-surface-elevated)\",\n color: rule.category === \"semantic\"\n ? \"var(--uilint-accent)\"\n : \"var(--uilint-text-muted)\",\n padding: \"2px 6px\",\n borderRadius: 4,\n }}\n >\n {rule.category}\n </span>\n {issueCount > 0 && (\n <span\n style={{\n fontSize: 11,\n fontWeight: 500,\n background: \"rgba(239, 68, 68, 0.1)\",\n color: \"#dc2626\",\n padding: \"2px 6px\",\n borderRadius: 4,\n }}\n >\n {issueCount} issue{issueCount !== 1 ? \"s\" : \"\"}\n </span>\n )}\n </div>\n\n {/* Severity control */}\n <div style={{ marginBottom: 16 }}>\n <div\n style={{\n fontSize: 12,\n fontWeight: 500,\n color: \"var(--uilint-text-muted)\",\n marginBottom: 8,\n }}\n >\n Severity\n </div>\n <SeverityToggle\n value={currentSeverity as \"error\" | \"warning\" | \"off\"}\n onChange={handleSeverityChange}\n disabled={isUpdating}\n />\n {isUpdating && (\n <div style={{ fontSize: 11, color: \"var(--uilint-text-muted)\", marginTop: 4 }}>\n Updating...\n </div>\n )}\n </div>\n\n {/* Documentation link */}\n {rule.docs && (\n <div style={{ marginTop: 16 }}>\n <a\n href={rule.docs}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n style={{\n fontSize: 12,\n color: \"var(--uilint-accent)\",\n textDecoration: \"none\",\n }}\n >\n View documentation\n </a>\n </div>\n )}\n </div>\n );\n}\n","/**\n * ESLint Tile Provider\n *\n * Helper functions for generating tile data for the masonry grid view.\n * Provides aggregation by rule and by file, with severity breakdowns.\n */\n\nimport type {\n TileItem,\n TileFilter,\n TileSeverityCounts,\n PluginServices,\n} from \"../../core/plugin-system/types\";\nimport type { Issue } from \"../../ui/types\";\nimport type { ESLintPluginSlice } from \"./slice\";\nimport type { AvailableRule } from \"./types\";\n\n/**\n * Tile type for distinguishing rule tiles from file tiles\n */\nexport type TileType = \"rule\" | \"file\";\n\n/**\n * Count issues by severity level.\n *\n * @param issues - Array of issues to count\n * @returns Object with error, warning, and info counts\n */\nexport function countSeverities(issues: Issue[]): TileSeverityCounts {\n const counts: TileSeverityCounts = {\n error: 0,\n warning: 0,\n info: 0,\n };\n\n for (const issue of issues) {\n if (issue.severity === \"error\") {\n counts.error++;\n } else if (issue.severity === \"warning\") {\n counts.warning++;\n } else if (issue.severity === \"info\") {\n counts.info++;\n }\n }\n\n return counts;\n}\n\n/**\n * Aggregate issues by rule.\n * Returns tiles for each rule with issue counts and severity breakdowns.\n *\n * @param issues - Flat array of all issues\n * @param availableRules - Available rule metadata for descriptions\n * @returns Array of TileItem objects, one per rule\n */\nexport function aggregateByRule(\n issues: Issue[],\n availableRules: AvailableRule[] = []\n): TileItem[] {\n // Group issues by ruleId\n const issuesByRule = new Map<string, Issue[]>();\n\n for (const issue of issues) {\n const ruleId = issue.ruleId;\n const existing = issuesByRule.get(ruleId) || [];\n issuesByRule.set(ruleId, [...existing, issue]);\n }\n\n // Create a lookup map for rule metadata\n const ruleMetadata = new Map<string, AvailableRule>();\n for (const rule of availableRules) {\n ruleMetadata.set(rule.id, rule);\n }\n\n // Convert to tiles\n const tiles: TileItem[] = [];\n\n for (const [ruleId, ruleIssues] of issuesByRule) {\n const meta = ruleMetadata.get(ruleId);\n const severityCounts = countSeverities(ruleIssues);\n\n // Extract short rule name (e.g., \"no-unused-vars\" from \"@typescript-eslint/no-unused-vars\")\n const shortName = ruleId.includes(\"/\") ? ruleId.split(\"/\").pop()! : ruleId;\n\n tiles.push({\n id: `rule:${ruleId}`,\n label: meta?.name || shortName,\n subtitle: meta?.description || ruleId,\n count: ruleIssues.length,\n severityCounts,\n metadata: {\n isRule: true,\n ruleId,\n tileType: \"rule\" as TileType,\n },\n });\n }\n\n // Sort by count (descending), then by errors (descending)\n tiles.sort((a, b) => {\n // First by error count\n const aErrors = a.severityCounts?.error ?? 0;\n const bErrors = b.severityCounts?.error ?? 0;\n if (aErrors !== bErrors) return bErrors - aErrors;\n\n // Then by total count\n return b.count - a.count;\n });\n\n return tiles;\n}\n\n/**\n * Aggregate issues by file for a specific rule.\n * Returns tiles for each file that has issues for the given rule.\n *\n * @param issues - Flat array of all issues\n * @param ruleId - Rule ID to filter by\n * @returns Array of TileItem objects, one per file\n */\nexport function aggregateByFile(issues: Issue[], ruleId: string): TileItem[] {\n // Filter issues to only those for the specified rule\n const ruleIssues = issues.filter((issue) => issue.ruleId === ruleId);\n\n // Group by file path\n const issuesByFile = new Map<string, Issue[]>();\n\n for (const issue of ruleIssues) {\n const filePath = issue.filePath;\n const existing = issuesByFile.get(filePath) || [];\n issuesByFile.set(filePath, [...existing, issue]);\n }\n\n // Convert to tiles\n const tiles: TileItem[] = [];\n\n for (const [filePath, fileIssues] of issuesByFile) {\n const severityCounts = countSeverities(fileIssues);\n\n // Extract filename for display\n const parts = filePath.split(\"/\");\n const fileName = parts.pop() || filePath;\n\n tiles.push({\n id: `file:${filePath}:${ruleId}`,\n label: fileName,\n subtitle: filePath,\n count: fileIssues.length,\n severityCounts,\n metadata: {\n isFile: true,\n filePath,\n ruleId,\n tileType: \"file\" as TileType,\n },\n });\n }\n\n // Sort by count (descending), then by errors (descending)\n tiles.sort((a, b) => {\n const aErrors = a.severityCounts?.error ?? 0;\n const bErrors = b.severityCounts?.error ?? 0;\n if (aErrors !== bErrors) return bErrors - aErrors;\n\n return b.count - a.count;\n });\n\n return tiles;\n}\n\n/**\n * Aggregate all issues by file globally (across all rules).\n * Returns a single tile per file showing total issues.\n *\n * @param issues - Flat array of all issues\n * @returns Array of TileItem objects, one per unique file\n */\nexport function aggregateByFileGlobal(issues: Issue[]): TileItem[] {\n // Group all issues by file path\n const issuesByFile = new Map<string, Issue[]>();\n\n for (const issue of issues) {\n const filePath = issue.filePath;\n const existing = issuesByFile.get(filePath) || [];\n issuesByFile.set(filePath, [...existing, issue]);\n }\n\n // Convert to tiles\n const tiles: TileItem[] = [];\n\n for (const [filePath, fileIssues] of issuesByFile) {\n const severityCounts = countSeverities(fileIssues);\n\n // Extract filename for display\n const parts = filePath.split(\"/\");\n const fileName = parts.pop() || filePath;\n\n // Get unique rule count for this file\n const uniqueRules = new Set(fileIssues.map((i) => i.ruleId));\n\n tiles.push({\n id: `file:${filePath}`,\n label: fileName,\n subtitle: filePath,\n count: fileIssues.length,\n severityCounts,\n metadata: {\n isFile: true,\n filePath,\n tileType: \"file\" as TileType,\n ruleCount: uniqueRules.size,\n // Store issues for search filtering\n issues: fileIssues,\n },\n });\n }\n\n // Sort by count (descending), then by errors (descending)\n tiles.sort((a, b) => {\n const aErrors = a.severityCounts?.error ?? 0;\n const bErrors = b.severityCounts?.error ?? 0;\n if (aErrors !== bErrors) return bErrors - aErrors;\n\n return b.count - a.count;\n });\n\n return tiles;\n}\n\n/**\n * Get all tiles (rules + files) in a flat list, sorted by issue count.\n * This is the new primary method for the redesigned command palette.\n *\n * @param issues - Flat array of all issues\n * @param availableRules - Available rule metadata for descriptions\n * @returns Array of TileItem objects (both rules and files), sorted by count\n */\nexport function getAllTilesFlat(\n issues: Issue[],\n availableRules: AvailableRule[] = []\n): TileItem[] {\n if (issues.length === 0) {\n return [];\n }\n\n // Get rule tiles (with issues stored for search filtering)\n const ruleTiles = aggregateByRuleWithIssues(issues, availableRules);\n\n // Get global file tiles\n const fileTiles = aggregateByFileGlobal(issues);\n\n // Combine all tiles\n const allTiles = [...ruleTiles, ...fileTiles];\n\n // Sort by count (descending), then by errors (descending)\n allTiles.sort((a, b) => {\n const aErrors = a.severityCounts?.error ?? 0;\n const bErrors = b.severityCounts?.error ?? 0;\n if (aErrors !== bErrors) return bErrors - aErrors;\n\n return b.count - a.count;\n });\n\n return allTiles;\n}\n\n/**\n * Aggregate issues by rule, including issues in metadata for search filtering.\n * Internal helper for getAllTilesFlat.\n *\n * @param issues - Flat array of all issues\n * @param availableRules - Available rule metadata for descriptions\n * @returns Array of TileItem objects, one per rule\n */\nfunction aggregateByRuleWithIssues(\n issues: Issue[],\n availableRules: AvailableRule[] = []\n): TileItem[] {\n // Group issues by ruleId\n const issuesByRule = new Map<string, Issue[]>();\n\n for (const issue of issues) {\n const ruleId = issue.ruleId;\n const existing = issuesByRule.get(ruleId) || [];\n issuesByRule.set(ruleId, [...existing, issue]);\n }\n\n // Create a lookup map for rule metadata\n const ruleMetadata = new Map<string, AvailableRule>();\n for (const rule of availableRules) {\n ruleMetadata.set(rule.id, rule);\n }\n\n // Convert to tiles\n const tiles: TileItem[] = [];\n\n for (const [ruleId, ruleIssues] of issuesByRule) {\n const meta = ruleMetadata.get(ruleId);\n const severityCounts = countSeverities(ruleIssues);\n\n // Extract short rule name (e.g., \"no-unused-vars\" from \"@typescript-eslint/no-unused-vars\")\n const shortName = ruleId.includes(\"/\") ? ruleId.split(\"/\").pop()! : ruleId;\n\n // Get unique file count for this rule\n const uniqueFiles = new Set(ruleIssues.map((i) => i.filePath));\n\n tiles.push({\n id: `rule:${ruleId}`,\n label: meta?.name || shortName,\n subtitle: meta?.description || ruleId,\n count: ruleIssues.length,\n severityCounts,\n fileCount: uniqueFiles.size,\n metadata: {\n isRule: true,\n ruleId,\n tileType: \"rule\" as TileType,\n // Store issues for search filtering\n issues: ruleIssues,\n },\n });\n }\n\n return tiles;\n}\n\n/**\n * Get all issues from the ESLint plugin state as a flat array.\n * Filters out issues from disabled rules.\n *\n * @param services - Plugin services for state access\n * @returns Flat array of all issues (excluding disabled rules)\n */\nexport function getAllIssues(services: PluginServices): Issue[] {\n const fullState = services.getState<{ plugins?: { eslint?: ESLintPluginSlice } }>();\n const state = fullState?.plugins?.eslint;\n\n if (!state?.issues) {\n return [];\n }\n\n // Get disabled rules set\n const disabledRules = state.disabledRules ?? new Set<string>();\n\n // Flatten the Map<dataLoc, Issue[]> to Issue[]\n const allIssues: Issue[] = [];\n for (const issues of state.issues.values()) {\n // Filter out issues from disabled rules\n for (const issue of issues) {\n if (!disabledRules.has(issue.ruleId)) {\n allIssues.push(issue);\n }\n }\n }\n\n return allIssues;\n}\n\n/**\n * Get available rules from the ESLint plugin state.\n *\n * @param services - Plugin services for state access\n * @returns Array of available rules\n */\nexport function getAvailableRules(services: PluginServices): AvailableRule[] {\n const fullState = services.getState<{ plugins?: { eslint?: ESLintPluginSlice } }>();\n const state = fullState?.plugins?.eslint;\n\n return state?.availableRules ?? [];\n}\n\n/**\n * Get tile items based on current filter state.\n *\n * NEW BEHAVIOR (flat command palette):\n * - Always returns all tiles (rules + files) in a flat list\n * - Filters are ignored (flat design has no drill-down)\n *\n * @param services - Plugin services for state access\n * @param filters - Currently active tile filters (ignored in flat mode)\n * @returns Array of tile items (rules and files combined)\n */\nexport function getTileItems(\n services: PluginServices,\n _filters: TileFilter[]\n): TileItem[] {\n const allIssues = getAllIssues(services);\n\n if (allIssues.length === 0) {\n return [];\n }\n\n // Use the new flat tile generation\n const availableRules = getAvailableRules(services);\n return getAllTilesFlat(allIssues, availableRules);\n}\n\n/**\n * Create a filter from a clicked tile.\n *\n * @param item - The clicked tile item\n * @returns TileFilter object\n */\nexport function createFilter(item: TileItem): TileFilter {\n const metadata = item.metadata ?? {};\n\n if (metadata.isRule) {\n const ruleId = metadata.ruleId as string;\n return {\n type: \"rule\",\n id: ruleId,\n label: item.label,\n providerId: \"eslint\",\n };\n }\n\n if (metadata.isFile) {\n const filePath = metadata.filePath as string;\n // Use just the filename for the label\n const fileName = filePath.split(\"/\").pop() || filePath;\n return {\n type: \"file\",\n id: filePath,\n label: fileName,\n providerId: \"eslint\",\n };\n }\n\n // Fallback for unknown tile types\n return {\n type: \"scope\",\n id: item.id,\n label: item.label,\n providerId: \"eslint\",\n };\n}\n\n/**\n * Check if current filter state is terminal (no more drill-down).\n * Returns true if filters include both a rule AND a file.\n *\n * @param filters - Currently active filters\n * @returns True if terminal state\n */\nexport function isTerminal(filters: TileFilter[]): boolean {\n const hasRule = filters.some((f) => f.type === \"rule\");\n const hasFile = filters.some((f) => f.type === \"file\");\n\n return hasRule && hasFile;\n}\n\n/**\n * Get inspector data for a terminal tile click.\n * Returns the panel ID and data needed to open the inspector.\n *\n * @param item - The clicked tile item\n * @returns Object with panelId and data\n */\nexport function getInspectorData(item: TileItem): {\n panelId: string;\n data: Record<string, unknown>;\n} {\n const metadata = item.metadata ?? {};\n\n if (metadata.isRule) {\n return {\n panelId: \"eslint-rule\",\n data: {\n ruleId: metadata.ruleId,\n },\n };\n }\n\n if (metadata.isFile) {\n return {\n panelId: \"eslint-rule\",\n data: {\n ruleId: metadata.ruleId,\n filePath: metadata.filePath,\n },\n };\n }\n\n if (metadata.isIssue) {\n return {\n panelId: \"eslint-rule\",\n data: {\n ruleId: metadata.ruleId,\n filePath: metadata.filePath,\n issueId: metadata.issueId,\n line: metadata.line,\n },\n };\n }\n\n // Fallback\n return {\n panelId: \"eslint-rule\",\n data: {},\n };\n}\n\n// ============================================================================\n// Expandable Tile Support\n// ============================================================================\n\n/**\n * Create issue tiles for a specific file.\n * Used when expanding a file tile to show individual issues.\n *\n * @param issues - All issues\n * @param filePath - File path to filter by\n * @param ruleId - Optional rule ID to filter by\n * @returns Array of TileItem objects, one per issue\n */\nexport function aggregateIssuesForFile(\n issues: Issue[],\n filePath: string,\n ruleId?: string\n): TileItem[] {\n // Filter issues for this file (and optionally this rule)\n let fileIssues = issues.filter((issue) => issue.filePath === filePath);\n if (ruleId) {\n fileIssues = fileIssues.filter((issue) => issue.ruleId === ruleId);\n }\n\n // Sort by line number\n fileIssues.sort((a, b) => a.line - b.line);\n\n // Convert to tiles\n return fileIssues.map((issue) => ({\n id: `issue:${issue.id}`,\n label: issue.message,\n subtitle: `Line ${issue.line}${issue.column ? `:${issue.column}` : \"\"}`,\n count: 1, // Each issue counts as 1\n severityCounts: {\n error: issue.severity === \"error\" ? 1 : 0,\n warning: issue.severity === \"warning\" ? 1 : 0,\n info: issue.severity === \"info\" ? 1 : 0,\n },\n metadata: {\n isIssue: true,\n issueId: issue.id,\n ruleId: issue.ruleId,\n filePath: issue.filePath,\n line: issue.line,\n column: issue.column,\n severity: issue.severity,\n issue, // Full issue object for detailed display\n },\n }));\n}\n\n/**\n * Get child items for an expanded tile (for expandable tile UI).\n *\n * - Rule tile -> returns file tiles for that rule\n * - File tile -> returns issue tiles for that file (and rule if specified)\n * - Issue tile -> returns undefined (terminal, no children)\n *\n * @param item - The expanded tile item\n * @param services - Plugin services for state access\n * @returns Array of child tile items, or undefined if not expandable\n */\nexport function getChildItems(\n item: TileItem,\n services: PluginServices\n): TileItem[] | undefined {\n const metadata = item.metadata ?? {};\n const allIssues = getAllIssues(services);\n\n if (allIssues.length === 0) {\n return undefined;\n }\n\n // Rule tile -> file tiles\n if (metadata.isRule) {\n const ruleId = metadata.ruleId as string;\n return aggregateByFile(allIssues, ruleId);\n }\n\n // File tile -> issue tiles\n if (metadata.isFile) {\n const filePath = metadata.filePath as string;\n const ruleId = metadata.ruleId as string | undefined;\n return aggregateIssuesForFile(allIssues, filePath, ruleId);\n }\n\n // Issue tile -> no children (terminal)\n if (metadata.isIssue) {\n return undefined;\n }\n\n return undefined;\n}\n\n/**\n * Check if a tile can be expanded (has children).\n *\n * @param item - The tile to check\n * @returns True if the tile can be expanded\n */\nexport function canExpand(item: TileItem): boolean {\n const metadata = item.metadata ?? {};\n\n // Rule tiles can expand to show files\n if (metadata.isRule) {\n return true;\n }\n\n // File tiles can expand to show issues\n if (metadata.isFile) {\n return true;\n }\n\n // Issue tiles cannot expand (terminal)\n return false;\n}\n","/**\n * ESLint Plugin Types\n *\n * Types extracted from the main store for ESLint-related functionality.\n */\n\n/**\n * ESLint issue from WebSocket server (uilint serve)\n */\nexport interface ESLintIssue {\n /** Line number in source file */\n line: number;\n /** Column number */\n column?: number;\n /** Issue description */\n message: string;\n /** ESLint rule ID (e.g., \"uilint/semantic\", \"uilint/consistent-dark-mode\") */\n ruleId?: string;\n /** data-loc value to match to DOM element */\n dataLoc?: string;\n}\n\n/**\n * Cached issue data for a source location (dataLoc)\n * Multiple DOM elements can share the same dataLoc (e.g., list items),\n * so we key by dataLoc (path:line:column) rather than element ID.\n */\nexport interface ElementIssue {\n /** The dataLoc key (format: \"path:line:column\") */\n dataLoc: string;\n /** ESLint rule violations from uilint-eslint (including semantic rule) */\n issues: ESLintIssue[];\n status: \"pending\" | \"scanning\" | \"complete\" | \"error\";\n}\n\n/**\n * Extended rule metadata with full configuration info\n */\nexport interface AvailableRule {\n id: string;\n name: string;\n description: string;\n category: \"static\" | \"semantic\";\n defaultSeverity: \"error\" | \"warn\" | \"off\";\n /** Current severity from ESLint config (may differ from default) */\n currentSeverity?: \"error\" | \"warn\" | \"off\";\n /** Current options from ESLint config */\n currentOptions?: Record<string, unknown>;\n docs?: string;\n optionSchema?: RuleOptionSchema;\n defaultOptions?: unknown[];\n}\n\n/**\n * Current configuration state for a rule\n */\nexport interface RuleConfig {\n severity: \"error\" | \"warn\" | \"off\";\n options?: Record<string, unknown>;\n}\n\n/**\n * Rule option schema for configuration\n */\nexport interface RuleOptionSchema {\n fields: OptionFieldSchema[];\n}\n\n/**\n * Option field schema for rule configuration UI\n */\nexport interface OptionFieldSchema {\n key: string;\n label: string;\n type: \"text\" | \"number\" | \"boolean\" | \"select\" | \"multiselect\" | \"array\";\n defaultValue: unknown;\n placeholder?: string;\n options?: Array<{ value: string | number; label: string }>;\n description?: string;\n}\n\n/**\n * Auto-scan settings for ESLint and Vision analysis\n * Persisted to localStorage\n */\nexport interface AutoScanSettings {\n eslint: {\n /** Auto-scan when page first loads */\n onPageLoad: boolean;\n /** Re-scan when files change (existing behavior) */\n onFileChange: boolean;\n };\n vision: {\n /** Auto-capture and analyze on route change */\n onRouteChange: boolean;\n /** Auto-capture and analyze on initial page load */\n onInitialLoad: boolean;\n };\n}\n\n/**\n * A scanned DOM element with its source information\n */\nexport interface ScannedElement {\n /**\n * Unique per-instance ID derived from data-loc.\n * Format: \"loc:path:line:column#occurrence\"\n */\n id: string;\n element: Element;\n tagName: string;\n className: string;\n /** Source location (always present from data-loc) */\n source: SourceLocation;\n rect: DOMRect;\n}\n\n/**\n * Source location from data-loc attribute\n */\nexport interface SourceLocation {\n fileName: string;\n lineNumber: number;\n columnNumber?: number;\n}\n\n// Note: ScanStatus is defined in slice.ts. Use `import type { ScanStatus } from \"./slice\"`\n\n/**\n * Default auto-scan settings\n */\nexport const DEFAULT_AUTO_SCAN_SETTINGS: AutoScanSettings = {\n eslint: {\n onPageLoad: false,\n onFileChange: true,\n },\n vision: {\n onRouteChange: false,\n onInitialLoad: false,\n },\n};\n","/**\n * ESLint Plugin\n *\n * Real-time ESLint analysis with heatmap visualization.\n * Extracts ESLint-related state and functionality from the main store.\n */\n\nimport { devLog, devError } from \"uilint-core\";\nimport type {\n Plugin,\n PluginServices,\n RuleMeta,\n ScannedElementInfo,\n RuleDefinition,\n PaletteItem,\n} from \"../../core/plugin-system/types\";\nimport { eslintCommands } from \"./commands\";\nimport {\n createESLintSlice,\n createESLintActions,\n type ESLintPluginSlice,\n type ESLintSlice,\n} from \"./slice\";\nimport type { AvailableRule, RuleConfig, ESLintIssue } from \"./types\";\nimport { fromESLintIssue } from \"../../ui/types\";\nimport type { Issue } from \"../../ui/types\";\nimport { extractUniqueFilePaths } from \"./scanner\";\nimport { RulePanel } from \"./panels\";\nimport { isStaticMode, initializeStaticMode } from \"./static-handler\";\nimport {\n getTileItems,\n createFilter,\n isTerminal,\n getInspectorData,\n getChildItems,\n canExpand,\n} from \"./tile-provider\";\n\n/** WebSocket message types handled by ESLint plugin */\nconst ESLINT_WS_MESSAGE_TYPES = [\n \"lint:result\",\n \"lint:progress\",\n \"file:changed\",\n \"workspace:info\",\n \"workspace:capabilities\",\n \"rules:metadata\",\n \"rule:config:result\",\n \"rule:config:changed\",\n] as const;\n\n/**\n * ESLint Plugin Definition\n */\nexport const eslintPlugin: Plugin = {\n // Top-level metadata (required)\n id: \"eslint\",\n name: \"ESLint Analysis\",\n version: \"1.0.0\",\n description: \"Real-time ESLint analysis with heatmap visualization\",\n ruleCategories: [\"static\"],\n\n // Structured metadata (optional)\n meta: {\n id: \"eslint\",\n name: \"ESLint Analysis\",\n version: \"1.0.0\",\n description: \"Real-time ESLint analysis with heatmap visualization\",\n },\n\n /**\n * Create the plugin's state slice\n */\n createSlice: (services: PluginServices): ESLintPluginSlice => {\n const initialSlice = createESLintSlice(services);\n\n // Create a getter/setter for the slice\n // In practice, these would be connected to the actual store\n let slice: ESLintSlice = initialSlice;\n\n const getSlice = () => slice;\n const setSlice = (partial: Partial<ESLintSlice>) => {\n slice = { ...slice, ...partial };\n // In the real implementation, this would update the store\n services.setState(partial);\n };\n\n const actions = createESLintActions(services, getSlice, setSlice);\n\n return {\n ...initialSlice,\n ...actions,\n };\n },\n\n /**\n * Commands contributed by this plugin\n */\n commands: eslintCommands,\n\n /**\n * Inspector panels contributed by this plugin\n */\n inspectorPanels: [\n {\n id: \"eslint-rule\",\n title: ({ data }) =>\n data?.ruleId ? `Rule: ${data.ruleId}` : \"Rule Details\",\n component: RulePanel,\n priority: 10,\n },\n ],\n\n /**\n * Tile provider for ESLint issues in command palette\n */\n tileProvider: {\n getTileItems,\n createFilter,\n isTerminal,\n getInspectorData,\n // Expandable tile support\n getChildItems,\n canExpand,\n },\n\n /**\n * Determine which rules this plugin handles\n */\n handlesRules: (ruleMeta: RuleMeta): boolean => {\n // Handle all uilint/* rules and standard ESLint rules\n if (ruleMeta.id.startsWith(\"uilint/\")) return true;\n if (ruleMeta.category === \"static\") return true;\n // Don't handle vision/semantic rules from the vision plugin\n if (ruleMeta.id === \"uilint/semantic-vision\") return false;\n return false;\n },\n\n /**\n * Get issues from the plugin's state for heatmap display\n */\n getIssues: (state: unknown) => {\n const eslintState = state as ESLintPluginSlice;\n\n // Convert unified Issue[] to PluginIssue[] format\n const pluginIssues = new Map<string, import(\"../../core/plugin-system/types\").PluginIssue[]>();\n\n eslintState.issues.forEach((issues, dataLoc) => {\n const converted = issues.map((issue) => ({\n id: issue.id,\n message: issue.message,\n severity: issue.severity,\n dataLoc: issue.dataLoc,\n line: issue.line,\n column: issue.column,\n ruleId: issue.ruleId,\n }));\n\n if (converted.length > 0) {\n pluginIssues.set(dataLoc, converted);\n }\n });\n\n return {\n pluginId: \"eslint\",\n issues: pluginIssues,\n };\n },\n\n /**\n * Get palette items for the command palette (keyword-based system).\n * Returns both issues and commands as PaletteItems.\n */\n getPaletteItems: (services: PluginServices): PaletteItem[] => {\n const items: PaletteItem[] = [];\n\n // Get the full store state to check command availability and get issues\n const fullState = services.getState<{\n wsConnected?: boolean;\n plugins?: {\n eslint?: ESLintPluginSlice;\n };\n }>();\n\n const eslintState = fullState?.plugins?.eslint;\n\n // Add issues as palette items\n if (eslintState?.issues) {\n for (const [, issueList] of eslintState.issues) {\n for (const issue of issueList) {\n const fileName = issue.filePath.split(\"/\").pop() || issue.filePath;\n const shortRuleId = issue.ruleId.includes(\"/\")\n ? issue.ruleId.split(\"/\").pop()!\n : issue.ruleId;\n\n items.push({\n id: `eslint:issue:${issue.id}`,\n title: issue.message,\n subtitle: `${fileName}:${issue.line}`,\n keywords: [\n \"Lint\",\n issue.ruleId,\n shortRuleId,\n fileName,\n issue.severity,\n ].filter((kw, i, arr) => arr.indexOf(kw) === i), // dedupe\n execute: (svc) => {\n svc.openInspector(\"issue\", { issue });\n svc.closeCommandPalette();\n },\n metadata: { issue, providerId: \"eslint\" },\n });\n }\n }\n }\n\n // Add commands as palette items\n for (const cmd of eslintCommands) {\n // Check if command is available\n if (cmd.isAvailable && !cmd.isAvailable(fullState)) {\n continue;\n }\n\n items.push({\n id: cmd.id,\n title: cmd.title,\n subtitle: cmd.subtitle,\n keywords: [\"Command\", \"ESLint\", ...cmd.keywords],\n execute: cmd.execute,\n metadata: { isCommand: true },\n });\n }\n\n return items;\n },\n\n /**\n * Get available rules from this plugin\n */\n getRules: (services: PluginServices): RuleDefinition[] => {\n // services.getState() returns the plugin's scoped slice directly\n const state = services.getState<ESLintPluginSlice>();\n\n if (!state?.availableRules) {\n return [];\n }\n\n // Get current configs for severity lookup\n const configs = state.ruleConfigs ?? new Map<string, RuleConfig>();\n\n return state.availableRules.map((rule: AvailableRule): RuleDefinition => {\n const config = configs.get(rule.id);\n // Map \"warn\" to \"warning\" for the unified interface\n const severity = config?.severity ?? rule.currentSeverity ?? rule.defaultSeverity;\n const normalizedSeverity = severity === \"warn\" ? \"warning\" : severity;\n\n return {\n id: rule.id,\n name: rule.name,\n description: rule.description,\n category: rule.category,\n severity: normalizedSeverity as \"error\" | \"warning\" | \"off\",\n fixable: false, // ESLint rules may be fixable, but we don't have this info from the server yet\n pluginId: \"eslint\",\n docs: rule.docs,\n };\n });\n },\n\n /**\n * Set severity for a rule\n */\n setRuleSeverity: (\n ruleId: string,\n severity: \"error\" | \"warning\" | \"off\",\n services: PluginServices\n ): void => {\n // Map \"warning\" back to \"warn\" for ESLint\n const eslintSeverity = severity === \"warning\" ? \"warn\" : severity;\n\n // Mark rule as updating\n const state = services.getState<{ ruleConfigUpdating: Map<string, boolean> }>();\n const updating = new Map(state.ruleConfigUpdating ?? new Map());\n updating.set(ruleId, true);\n services.setState({ ruleConfigUpdating: updating });\n\n // Send WebSocket message to update rule severity\n services.websocket.send({\n type: \"rule:config:set\",\n ruleId,\n severity: eslintSeverity,\n requestId: `rule-severity-${Date.now()}`,\n });\n\n devLog(\"[ESLint Plugin] Setting rule severity:\", ruleId, \"->\", eslintSeverity);\n },\n\n /**\n * Get configuration options for a rule\n */\n getRuleConfig: (ruleId: string, services: PluginServices): Record<string, unknown> => {\n // services.getState() returns the plugin's scoped slice directly\n const state = services.getState<ESLintPluginSlice>();\n const configs = state?.ruleConfigs ?? new Map<string, RuleConfig>();\n const config = configs.get(ruleId);\n\n return config?.options ?? {};\n },\n\n /**\n * Set configuration options for a rule\n */\n setRuleConfig: (\n ruleId: string,\n config: Record<string, unknown>,\n services: PluginServices\n ): void => {\n // Mark rule as updating\n const state = services.getState<{ ruleConfigUpdating: Map<string, boolean> }>();\n const updating = new Map(state.ruleConfigUpdating ?? new Map());\n updating.set(ruleId, true);\n services.setState({ ruleConfigUpdating: updating });\n\n // Send WebSocket message to update rule options\n services.websocket.send({\n type: \"rule:config:set\",\n ruleId,\n options: config,\n requestId: `rule-config-${Date.now()}`,\n });\n\n devLog(\"[ESLint Plugin] Setting rule config:\", ruleId, config);\n },\n\n /**\n * Initialize the plugin\n */\n initialize: (services: PluginServices) => {\n devLog(\"[ESLint Plugin] Initializing...\");\n\n // Check if static mode is configured\n if (isStaticMode()) {\n devLog(\"[ESLint Plugin] Running in STATIC mode (manifest-based)\");\n return initializeStaticMode(services);\n }\n\n // WebSocket mode (default)\n devLog(\"[ESLint Plugin] Running in WEBSOCKET mode\");\n\n // Subscribe to WebSocket messages for lint results, rules metadata, etc.\n const unsubscribers: Array<() => void> = [];\n\n for (const messageType of ESLINT_WS_MESSAGE_TYPES) {\n const unsubscribe = services.websocket.on(messageType, (message) => {\n handleWebSocketMessage(services, message as WebSocketMessage);\n });\n unsubscribers.push(unsubscribe);\n }\n\n devLog(\"[ESLint Plugin] Subscribed to\", ESLINT_WS_MESSAGE_TYPES.length, \"message types\");\n\n // Subscribe to DOM observer for element detection\n const unsubscribeDom = services.domObserver.onElementsAdded((elements: ScannedElementInfo[]) => {\n handleElementsAdded(services, elements);\n });\n unsubscribers.push(unsubscribeDom);\n\n devLog(\"[ESLint Plugin] Subscribed to DOM observer\");\n\n // Return cleanup function\n return () => {\n devLog(\"[ESLint Plugin] Disposing...\");\n unsubscribers.forEach((unsubscribe) => unsubscribe());\n };\n },\n\n /**\n * Dispose the plugin\n */\n dispose: (_services: PluginServices) => {\n devLog(\"[ESLint Plugin] Disposed\");\n },\n};\n\n/**\n * Handle new elements detected by DOM observer\n *\n * Extracts unique file paths and sends lint:file requests for new files.\n */\nfunction handleElementsAdded(\n services: PluginServices,\n elements: ScannedElementInfo[]\n): void {\n // Get current state - services.getState() returns the plugin's scoped slice directly\n const state = services.getState<ESLintPluginSlice>();\n\n devLog(\"[ESLint Plugin] handleElementsAdded called with\", elements.length, \"elements\");\n devLog(\"[ESLint Plugin] State check - scanStatus:\", state?.scanStatus, \"wsConnected:\", services.websocket.isConnected);\n\n // Check if scanning is active\n if (state.scanStatus !== \"scanning\") {\n devLog(\"[ESLint Plugin] Scanning not active (status:\", state.scanStatus, \"), skipping lint requests\");\n return;\n }\n\n // Check if WebSocket is connected\n if (!services.websocket.isConnected) {\n devLog(\"[ESLint Plugin] WebSocket not connected, skipping lint requests\");\n return;\n }\n\n // Extract unique file paths from the detected elements\n const dataLocs = elements.map((el) => el.dataLoc);\n const filePaths = extractUniqueFilePaths(dataLocs);\n\n if (filePaths.size === 0) {\n devLog(\"[ESLint Plugin] No file paths extracted from\", elements.length, \"elements\");\n return;\n }\n\n devLog(\"[ESLint Plugin] Detected\", elements.length, \"elements from\", filePaths.size, \"unique files:\", Array.from(filePaths).slice(0, 3));\n\n // Get already-requested files from state\n const requestedFiles = state.requestedFiles ?? new Set<string>();\n\n // Send lint requests for new files only\n const newFiles: string[] = [];\n for (const filePath of filePaths) {\n if (!requestedFiles.has(filePath)) {\n newFiles.push(filePath);\n\n // Send lint:file request\n const requestId = `lint-${Date.now()}-${filePath.replace(/[^a-zA-Z0-9]/g, \"-\")}`;\n services.websocket.send({\n type: \"lint:file\",\n filePath,\n requestId,\n });\n\n devLog(\"[ESLint Plugin] Sent lint:file request for\", filePath);\n }\n }\n\n // Update state with newly requested files\n if (newFiles.length > 0) {\n const updatedRequestedFiles = new Set(requestedFiles);\n for (const filePath of newFiles) {\n updatedRequestedFiles.add(filePath);\n }\n // Update the eslint slice state - need to use the full path\n services.setState({ requestedFiles: updatedRequestedFiles });\n devLog(\"[ESLint Plugin] Updated requestedFiles with\", newFiles.length, \"new files\");\n } else {\n devLog(\"[ESLint Plugin] All files already requested, skipping\");\n }\n}\n\n/**\n * WebSocket message handler types\n */\ninterface LintResultMessage {\n type: \"lint:result\";\n filePath: string;\n issues: ESLintIssue[];\n requestId?: string;\n}\n\ninterface LintProgressMessage {\n type: \"lint:progress\";\n filePath: string;\n phase: string;\n requestId?: string;\n}\n\ninterface FileChangedMessage {\n type: \"file:changed\";\n filePath: string;\n}\n\ninterface WorkspaceInfoMessage {\n type: \"workspace:info\";\n appRoot: string;\n workspaceRoot: string;\n serverCwd: string;\n}\n\ninterface WorkspaceCapabilitiesMessage {\n type: \"workspace:capabilities\";\n postToolUseHook: {\n enabled: boolean;\n provider: \"claude\" | \"cursor\" | null;\n };\n}\n\ninterface RulesMetadataMessage {\n type: \"rules:metadata\";\n rules: AvailableRule[];\n}\n\ninterface RuleConfigResultMessage {\n type: \"rule:config:result\";\n ruleId: string;\n severity: \"error\" | \"warn\" | \"off\";\n options?: Record<string, unknown>;\n success: boolean;\n error?: string;\n requestId?: string;\n}\n\ninterface RuleConfigChangedMessage {\n type: \"rule:config:changed\";\n ruleId: string;\n severity: \"error\" | \"warn\" | \"off\";\n options?: Record<string, unknown>;\n}\n\ntype WebSocketMessage =\n | LintResultMessage\n | LintProgressMessage\n | FileChangedMessage\n | WorkspaceInfoMessage\n | WorkspaceCapabilitiesMessage\n | RulesMetadataMessage\n | RuleConfigResultMessage\n | RuleConfigChangedMessage;\n\n/**\n * Handle WebSocket messages\n */\nfunction handleWebSocketMessage(\n services: PluginServices,\n message: WebSocketMessage\n): void {\n switch (message.type) {\n case \"lint:result\": {\n const { filePath, issues: rawIssues } = message;\n devLog(\"[ESLint Plugin] Received lint result:\", filePath, rawIssues.length, \"issues\");\n\n // Convert raw issues to unified Issue type\n const converted = rawIssues\n .map((raw) =>\n fromESLintIssue({\n ...raw,\n dataLoc: raw.dataLoc || `${filePath}:${raw.line}:${raw.column || 0}`,\n })\n )\n .filter((issue): issue is Issue => issue !== null);\n\n // Group issues by dataLoc\n const byDataLoc = new Map<string, Issue[]>();\n for (const issue of converted) {\n const existing = byDataLoc.get(issue.dataLoc) || [];\n byDataLoc.set(issue.dataLoc, [...existing, issue]);\n }\n\n // Get current state and batch all issue updates into a single setState call\n const state = services.getState<ESLintPluginSlice>();\n const mergedIssues = new Map(state.issues);\n for (const [dataLoc, issues] of byDataLoc) {\n mergedIssues.set(dataLoc, issues);\n }\n services.setState({ issues: mergedIssues });\n break;\n }\n\n case \"lint:progress\": {\n const { filePath, phase } = message;\n devLog(\"[ESLint Plugin] Lint progress:\", filePath, phase);\n\n // Update linting progress state\n const state = services.getState<ESLintPluginSlice>();\n const lintingFiles = new Map(state.lintingFiles);\n\n // Check if linting is complete (phase starts with \"Done\")\n if (phase.startsWith(\"Done\")) {\n lintingFiles.delete(filePath);\n } else {\n // Update or add progress for this file\n const existing = lintingFiles.get(filePath);\n lintingFiles.set(filePath, {\n phase,\n startedAt: existing?.startedAt ?? Date.now(),\n });\n }\n\n services.setState({ lintingFiles });\n break;\n }\n\n case \"file:changed\": {\n const { filePath } = message;\n devLog(\"[ESLint Plugin] File changed:\", filePath);\n\n // Invalidate cache for this file - remove all issues with matching filePath\n const state = services.getState<ESLintPluginSlice>();\n const newIssues = new Map(state.issues);\n for (const [dataLoc] of newIssues) {\n if (dataLoc.startsWith(filePath + \":\")) {\n newIssues.delete(dataLoc);\n }\n }\n\n // Also clear from requestedFiles so it can be re-requested\n const newRequestedFiles = new Set(state.requestedFiles ?? new Set());\n newRequestedFiles.delete(filePath);\n\n services.setState({ issues: newIssues, requestedFiles: newRequestedFiles });\n break;\n }\n\n case \"workspace:info\": {\n const { appRoot, workspaceRoot, serverCwd } = message;\n devLog(\"[ESLint Plugin] Workspace info:\", { appRoot, workspaceRoot, serverCwd });\n services.setState({ appRoot, workspaceRoot, serverCwd });\n break;\n }\n\n case \"workspace:capabilities\": {\n const { postToolUseHook } = message;\n devLog(\"[ESLint Plugin] Workspace capabilities:\", { postToolUseHook });\n services.setState({ workspaceCapabilities: { postToolUseHook } });\n break;\n }\n\n case \"rules:metadata\": {\n const { rules } = message;\n devLog(\"[ESLint Plugin] Received rules metadata:\", rules.length, \"rules\");\n\n // Initialize rule configs from current severities\n const configs = new Map<string, RuleConfig>();\n for (const rule of rules) {\n configs.set(rule.id, {\n severity: rule.currentSeverity ?? rule.defaultSeverity,\n options:\n rule.currentOptions ??\n (rule.defaultOptions && rule.defaultOptions.length > 0\n ? (rule.defaultOptions[0] as Record<string, unknown>)\n : undefined),\n });\n }\n\n services.setState({ availableRules: rules, ruleConfigs: configs });\n break;\n }\n\n case \"rule:config:result\": {\n const { ruleId, severity, options, success, error } = message;\n\n // Clear updating state\n const state = services.getState<{ ruleConfigUpdating: Map<string, boolean> }>();\n const updating = new Map(state.ruleConfigUpdating);\n updating.delete(ruleId);\n services.setState({ ruleConfigUpdating: updating });\n\n if (success) {\n // Update local config\n const configState = services.getState<{ ruleConfigs: Map<string, RuleConfig> }>();\n const configs = new Map(configState.ruleConfigs);\n configs.set(ruleId, { severity, options });\n\n // Clear issues and requested files to trigger fresh linting\n // The DOM observer will naturally re-request linting for visible elements\n services.setState({\n ruleConfigs: configs,\n issues: new Map(),\n scannedDataLocs: new Set(),\n requestedFiles: new Set(),\n });\n devLog(\"[ESLint Plugin] Rule config updated:\", ruleId, \"->\", severity, \"- refreshing lint results\");\n } else {\n devError(\"[ESLint Plugin] Failed to update rule config:\", error);\n }\n break;\n }\n\n case \"rule:config:changed\": {\n const { ruleId, severity, options } = message;\n\n // Update local config (broadcast from another client or CLI)\n const state = services.getState<{ ruleConfigs: Map<string, RuleConfig> }>();\n const configs = new Map(state.ruleConfigs);\n configs.set(ruleId, { severity, options });\n\n // Clear issues and requested files to trigger fresh linting\n // The DOM observer will naturally re-request linting for visible elements\n services.setState({\n ruleConfigs: configs,\n issues: new Map(),\n scannedDataLocs: new Set(),\n requestedFiles: new Set(),\n });\n devLog(\"[ESLint Plugin] Rule config changed (broadcast):\", ruleId, \"->\", severity, \"- refreshing lint results\");\n break;\n }\n }\n}\n\nexport default eslintPlugin;\n\n// Re-export types for convenience\nexport * from \"./types\";\nexport * from \"./slice\";\nexport { eslintCommands } from \"./commands\";\n\n// Static mode exports\nexport {\n configureStaticMode,\n isStaticMode,\n clearStaticMode,\n getManifestMetadata,\n getFileSource,\n} from \"./static-handler\";\n\n// Export for testing - allows direct testing of message handling logic\nexport { handleWebSocketMessage as _handleWebSocketMessageForTesting };\n\n// Tile provider exports\nexport {\n aggregateByRule,\n aggregateByFile,\n countSeverities,\n getTileItems as getEslintTileItems,\n createFilter as createEslintTileFilter,\n isTerminal as isEslintTileTerminal,\n getInspectorData as getEslintInspectorData,\n} from \"./tile-provider\";\n","/**\n * FixPromptPanel - Inspector panel for displaying copyable fix prompts\n *\n * Generates a prompt that can be copied to Cursor or Claude Code\n * to fix all lint issues on the current page.\n */\n\n/* eslint-disable uilint/consistent-dark-mode -- theming handled via CSS custom properties */\nimport React, { useMemo, useState, useCallback } from \"react\";\nimport { devError } from \"uilint-core\";\nimport type { InspectorPanelProps } from \"../../core/plugin-system/types\";\nimport type { Issue } from \"../../ui/types\";\n\n/**\n * Group issues by file path\n */\nfunction groupIssuesByFile(issues: Issue[]): Map<string, Issue[]> {\n const grouped = new Map<string, Issue[]>();\n\n for (const issue of issues) {\n const filePath = issue.filePath || \"unknown\";\n const existing = grouped.get(filePath) || [];\n existing.push(issue);\n grouped.set(filePath, existing);\n }\n\n // Sort issues within each file by line number\n for (const [filePath, fileIssues] of grouped) {\n grouped.set(\n filePath,\n fileIssues.sort((a, b) => a.line - b.line)\n );\n }\n\n return grouped;\n}\n\n/**\n * Generate the fix prompt text\n * @param issuesByFile Map of file paths to issues\n * @param workspaceRoot Workspace root path for relative paths\n * @param hookAvailable Whether post-tool-use hook is configured (enables condensed format)\n */\nfunction generateFixPrompt(\n issuesByFile: Map<string, Issue[]>,\n workspaceRoot: string | null,\n hookAvailable: boolean\n): string {\n const totalIssues = Array.from(issuesByFile.values()).reduce(\n (sum, issues) => sum + issues.length,\n 0\n );\n const fileCount = issuesByFile.size;\n\n if (totalIssues === 0) {\n return \"No lint issues found on the current page.\";\n }\n\n const lines: string[] = [];\n\n // Header\n lines.push(`# Fix Lint Issues`);\n lines.push(``);\n lines.push(`There are **${totalIssues} lint issue${totalIssues === 1 ? \"\" : \"s\"}** across **${fileCount} file${fileCount === 1 ? \"\" : \"s\"}** that need to be fixed.`);\n lines.push(``);\n\n // Instructions\n lines.push(`## Instructions`);\n lines.push(``);\n lines.push(`1. Fix ALL of the lint issues in the files listed below`);\n lines.push(`2. Do NOT ignore or suppress any issues with eslint-disable comments`);\n lines.push(`3. Do NOT skip any issues - each one must be properly addressed`);\n lines.push(`4. Run the linter after fixing to verify all issues are resolved`);\n lines.push(`5. If an issue cannot be fixed without breaking functionality, explain why and propose an alternative solution`);\n lines.push(``);\n\n if (hookAvailable) {\n // CONDENSED FORMAT: Only list affected files (hook will provide details on edit)\n lines.push(`## Affected Files`);\n lines.push(``);\n lines.push(`The following files have lint issues. When you edit each file, you will receive the specific lint errors automatically.`);\n lines.push(``);\n\n for (const [filePath, issues] of issuesByFile) {\n const displayPath = workspaceRoot && filePath.startsWith(workspaceRoot)\n ? filePath.slice(workspaceRoot.length + 1)\n : filePath;\n lines.push(`- \\`${displayPath}\\` (${issues.length} issue${issues.length === 1 ? \"\" : \"s\"})`);\n }\n\n lines.push(``);\n lines.push(`---`);\n lines.push(``);\n lines.push(`Open each file above and fix all reported lint issues. The linter will provide specific error details when you edit each file.`);\n } else {\n // DETAILED FORMAT: List all issues with locations and messages\n lines.push(`## Affected Files`);\n lines.push(``);\n\n for (const [filePath, issues] of issuesByFile) {\n // Show relative path if we have workspace root\n const displayPath = workspaceRoot && filePath.startsWith(workspaceRoot)\n ? filePath.slice(workspaceRoot.length + 1)\n : filePath;\n\n lines.push(`### ${displayPath}`);\n lines.push(``);\n\n for (const issue of issues) {\n const location = issue.column\n ? `Line ${issue.line}, Column ${issue.column}`\n : `Line ${issue.line}`;\n\n const severity = issue.severity === \"error\" ? \"ERROR\" : \"WARNING\";\n const ruleId = issue.ruleId ? ` (${issue.ruleId})` : \"\";\n\n lines.push(`- **[${severity}]** ${location}${ruleId}`);\n lines.push(` ${issue.message}`);\n }\n\n lines.push(``);\n }\n\n // Summary\n lines.push(`---`);\n lines.push(``);\n lines.push(`Please fix all ${totalIssues} issues listed above. Do not use eslint-disable comments or any other method to suppress warnings. Each issue must be properly resolved.`);\n }\n\n return lines.join(\"\\n\");\n}\n\n/**\n * Copy button with feedback\n */\nfunction CopyButton({ text, onCopy }: { text: string; onCopy: () => void }) {\n const [copied, setCopied] = useState(false);\n\n const handleCopy = useCallback(async () => {\n try {\n await navigator.clipboard.writeText(text);\n setCopied(true);\n onCopy();\n setTimeout(() => setCopied(false), 2000);\n } catch (err) {\n devError(\"Failed to copy:\", err);\n }\n }, [text, onCopy]);\n\n return (\n <button\n onClick={handleCopy}\n className=\"flex items-center gap-1.5 px-4 py-2 text-white border-none rounded-md cursor-pointer font-medium text-sm transition-colors\"\n style={{\n background: copied ? \"var(--uilint-success)\" : \"var(--uilint-primary)\",\n }}\n >\n {copied ? (\n <>\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\">\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n Copied!\n </>\n ) : (\n <>\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\">\n <rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\" ry=\"2\" />\n <path d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\" />\n </svg>\n Copy to Clipboard\n </>\n )}\n </button>\n );\n}\n\n/**\n * FixPromptPanel component\n */\nexport function FixPromptPanel({ data }: InspectorPanelProps) {\n const issues = (data?.issues as Issue[]) || [];\n const workspaceRoot = (data?.workspaceRoot as string) || null;\n const hookAvailable = (data?.hookAvailable as boolean) || false;\n\n const issuesByFile = useMemo(() => groupIssuesByFile(issues), [issues]);\n const promptText = useMemo(\n () => generateFixPrompt(issuesByFile, workspaceRoot, hookAvailable),\n [issuesByFile, workspaceRoot, hookAvailable]\n );\n\n const totalIssues = issues.length;\n const fileCount = issuesByFile.size;\n\n return (\n <div className=\"flex flex-col h-full\">\n {/* Header stats */}\n <div\n className=\"p-4 border-b\"\n style={{\n borderColor: \"var(--uilint-border)\",\n background: \"var(--uilint-surface)\",\n }}\n >\n <div className=\"flex items-center justify-between\">\n <div>\n <div\n className=\"text-sm mb-1\"\n style={{ color: \"var(--uilint-text-muted)\" }}\n >\n {totalIssues === 0\n ? \"No issues found\"\n : `${totalIssues} issue${totalIssues === 1 ? \"\" : \"s\"} in ${fileCount} file${fileCount === 1 ? \"\" : \"s\"}`}\n </div>\n <div\n className=\"text-xs\"\n style={{ color: \"var(--uilint-text-muted)\" }}\n >\n {hookAvailable\n ? \"Condensed format - hook will provide issue details\"\n : \"Copy this prompt to Cursor or Claude Code\"}\n </div>\n </div>\n {totalIssues > 0 && (\n <CopyButton text={promptText} onCopy={() => {}} />\n )}\n </div>\n </div>\n\n {/* Prompt preview */}\n <div className=\"flex-1 overflow-auto p-4\">\n <pre\n className=\"m-0 p-4 rounded-lg text-sm leading-relaxed whitespace-pre-wrap break-words font-mono\"\n style={{\n background: \"var(--uilint-code-bg, #1e1e1e)\",\n color: \"var(--uilint-code-text, #d4d4d4)\",\n }}\n >\n {promptText}\n </pre>\n </div>\n\n {/* Footer with instructions */}\n <div\n className=\"px-4 py-3 border-t text-xs\"\n style={{\n borderColor: \"var(--uilint-border)\",\n background: \"var(--uilint-surface-elevated)\",\n color: \"var(--uilint-text-muted)\",\n }}\n >\n <strong>Tip:</strong> Paste this prompt into Cursor, Claude Code, or any AI assistant to get help fixing these lint issues.\n </div>\n </div>\n );\n}\n\nexport default FixPromptPanel;\n","/**\n * Fix Prompt Plugin\n *\n * Provides a toolbar action to generate a copyable prompt for fixing\n * all lint issues on the current page. The prompt can be provided to\n * Cursor or Claude Code to fix the issues.\n */\n\nimport React from \"react\";\nimport type { Plugin, PluginServices, ToolbarAction, InspectorPanel } from \"../../core/plugin-system/types\";\nimport type { Issue } from \"../../ui/types\";\nimport { FixPromptPanel } from \"./FixPromptPanel\";\n\n// Clipboard/document icon for the toolbar\nconst FixPromptIcon = React.createElement(\n \"svg\",\n {\n width: \"16\",\n height: \"16\",\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: \"2\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n },\n // Clipboard shape\n React.createElement(\"path\", {\n d: \"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2\",\n }),\n // Clipboard tab\n React.createElement(\"rect\", { x: \"8\", y: \"2\", width: \"8\", height: \"4\", rx: \"1\", ry: \"1\" }),\n // Wrench/fix indicator lines\n React.createElement(\"line\", { x1: \"8\", y1: \"12\", x2: \"16\", y2: \"12\" }),\n React.createElement(\"line\", { x1: \"8\", y1: \"16\", x2: \"14\", y2: \"16\" })\n);\n\n/**\n * Collect all issues and capabilities from the ESLint plugin state\n */\nfunction collectAllIssues(services: PluginServices): {\n issues: Issue[];\n workspaceRoot: string | null;\n hookAvailable: boolean;\n} {\n // Get the full state which includes plugin slices\n const state = services.getState<{\n plugins?: {\n eslint?: {\n issues: Map<string, Issue[]>;\n workspaceRoot: string | null;\n workspaceCapabilities?: {\n postToolUseHook?: {\n enabled: boolean;\n };\n };\n };\n };\n }>();\n\n const eslintState = state.plugins?.eslint;\n if (!eslintState?.issues) {\n return { issues: [], workspaceRoot: null, hookAvailable: false };\n }\n\n // Flatten all issues from all dataLocs\n const allIssues: Issue[] = [];\n for (const issues of eslintState.issues.values()) {\n allIssues.push(...issues);\n }\n\n // Check if post-tool-use hook is available\n const hookAvailable = eslintState.workspaceCapabilities?.postToolUseHook?.enabled ?? false;\n\n return {\n issues: allIssues,\n workspaceRoot: eslintState.workspaceRoot,\n hookAvailable,\n };\n}\n\n/**\n * Toolbar action for generating fix prompt\n */\nconst fixPromptToolbarAction: ToolbarAction = {\n id: \"fix-prompt:generate\",\n icon: FixPromptIcon,\n tooltip: \"Generate Fix Prompt\",\n priority: 50, // Lower than vision actions, higher than default\n isVisible: (state: unknown) => {\n // Always visible when there's at least one issue\n const s = state as {\n plugins?: {\n eslint?: {\n issues: Map<string, Issue[]>;\n };\n };\n };\n const issues = s.plugins?.eslint?.issues;\n if (!issues) return false;\n\n let count = 0;\n for (const arr of issues.values()) {\n count += arr.length;\n if (count > 0) return true;\n }\n return false;\n },\n onClick: (services: PluginServices) => {\n const { issues, workspaceRoot, hookAvailable } = collectAllIssues(services);\n\n // Open the inspector with the fix-prompt panel\n const state = services.getState<{\n inspector: {\n open: boolean;\n panelId: string | null;\n data: Record<string, unknown> | null;\n docked: boolean;\n width: number;\n floatingPosition: { x: number; y: number } | null;\n floatingSize: { width: number; height: number } | null;\n };\n }>();\n\n services.setState({\n inspector: {\n ...state.inspector,\n open: true,\n panelId: \"fix-prompt\",\n data: { issues, workspaceRoot, hookAvailable },\n },\n });\n },\n};\n\n/**\n * Inspector panel for displaying the fix prompt\n */\nconst fixPromptInspectorPanel: InspectorPanel = {\n id: \"fix-prompt\",\n title: \"Fix Prompt\",\n icon: FixPromptIcon,\n component: FixPromptPanel,\n priority: 10,\n};\n\n/**\n * Fix Prompt plugin definition\n */\nexport const fixPromptPlugin: Plugin = {\n id: \"fix-prompt\",\n name: \"Fix Prompt Generator\",\n version: \"1.0.0\",\n description: \"Generate copyable prompts for AI assistants to fix lint issues\",\n\n meta: {\n id: \"fix-prompt\",\n name: \"Fix Prompt Generator\",\n version: \"1.0.0\",\n description: \"Generate copyable prompts for AI assistants to fix lint issues\",\n icon: FixPromptIcon,\n },\n\n /**\n * Toolbar actions contributed by this plugin\n */\n toolbarActions: [fixPromptToolbarAction],\n\n /**\n * Inspector panels contributed by this plugin\n */\n inspectorPanels: [fixPromptInspectorPanel],\n\n /**\n * No custom state slice needed - this plugin only reads from ESLint plugin state\n */\n createSlice: undefined,\n\n /**\n * No initialization needed\n */\n initialize: undefined,\n};\n\nexport default fixPromptPlugin;\n","let injected = false;\n\nexport function injectDevToolStyles(cssText: string) {\n if (typeof document === \"undefined\") return;\n if (injected) return;\n\n const style = document.createElement(\"style\");\n style.setAttribute(\"data-uilint-devtools-styles\", \"true\");\n style.textContent = cssText;\n document.head.appendChild(style);\n\n injected = true;\n}\n","\"use client\";\n\n/**\n * Main DevTool React root\n *\n * Manages all UILint functionality:\n * - Plugin initialization\n * - WebSocket connection to ESLint server\n * - UI component rendering\n */\n\nimport React, { useState, useEffect, useRef } from \"react\";\nimport { devLog, devWarn } from \"uilint-core\";\nimport { UILint } from \"./ui\";\nimport { websocket, MAX_RECONNECT_ATTEMPTS } from \"./core/services/websocket\";\nimport { domObserver } from \"./core/services/dom-observer\";\nimport { initializePlugins, getStoreApi } from \"./core/store\";\nimport { pluginRegistry } from \"./core/plugin-system/registry\";\nimport { loadPlugins } from \"./core/plugin-system/loader\";\nimport { eslintPlugin, configureStaticMode, clearStaticMode } from \"./plugins/eslint\";\nimport { fixPromptPlugin } from \"./plugins/fix-prompt\";\nimport { injectDevToolStyles } from \"./styles/inject-styles\";\n\n/** DevTool operating mode */\nexport type DevToolMode = \"websocket\" | \"static\";\n\n// Track if plugins have been initialized\nlet pluginsInitialized = false;\n\n// Inlined CSS (compiled by Tailwind/PostCSS during Vite build)\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore - Vite handles ?inline for CSS\nimport devtoolsCss from \"./styles/globals.css?inline\";\n\n/** Portal root class name */\nconst DEVTOOL_ROOT_CLASS = \"uilint-devtool-root\";\n\nexport type DevToolProps = {\n /** Enable/disable the devtool (default: true) */\n enabled?: boolean;\n /**\n * Operating mode:\n * - \"websocket\": Connect to local uilint serve (default)\n * - \"static\": Load issues from pre-built manifest\n */\n mode?: DevToolMode;\n /**\n * URL to the lint manifest (required for mode=\"static\")\n * Example: \"/.uilint/manifest.json\"\n */\n manifestUrl?: string;\n};\n\n/**\n * Check if we're in a browser environment\n */\nfunction isBrowser(): boolean {\n return typeof window !== \"undefined\";\n}\n\n/**\n * Main devtool React root.\n *\n * Handles WebSocket connection (or static manifest loading) and UI rendering.\n */\nexport function DevTool({\n enabled = true,\n mode = \"websocket\",\n manifestUrl,\n}: DevToolProps) {\n const [isMounted, setIsMounted] = useState(false);\n const [isReady, setIsReady] = useState(pluginsInitialized);\n const portalRootRef = useRef<HTMLElement | null>(null);\n const createdPortalRootRef = useRef(false);\n\n // Validate props\n if (mode === \"static\" && !manifestUrl) {\n devWarn(\"[DevTool] Static mode requires manifestUrl prop\");\n }\n\n /**\n * Set mounted state after hydration\n */\n useEffect(() => {\n setIsMounted(true);\n }, []);\n\n /**\n * Ensure the devtool styles + portal host exist.\n */\n useEffect(() => {\n if (!isBrowser() || !enabled) return;\n\n // Inject compiled Tailwind/devtool CSS exactly once per page.\n injectDevToolStyles(devtoolsCss as string);\n\n // Ensure a stable portal host for all UILint portals.\n const existing = document.querySelector<HTMLElement>(\n `.${DEVTOOL_ROOT_CLASS}`\n );\n if (existing) {\n portalRootRef.current = existing;\n createdPortalRootRef.current = false;\n return;\n }\n\n const container = document.createElement(\"div\");\n container.className = DEVTOOL_ROOT_CLASS;\n container.setAttribute(\"data-ui-lint-root\", \"true\");\n document.body.appendChild(container);\n\n portalRootRef.current = container;\n createdPortalRootRef.current = true;\n\n return () => {\n if (createdPortalRootRef.current) {\n portalRootRef.current?.remove();\n }\n portalRootRef.current = null;\n createdPortalRootRef.current = false;\n };\n }, [enabled]);\n\n /**\n * Initialize plugins and connect to data source.\n * - WebSocket mode: Connect to local uilint serve\n * - Static mode: Load pre-built manifest\n */\n useEffect(() => {\n if (!isBrowser() || !enabled) return;\n if (!isMounted) return;\n\n let unsubscribeConnection: (() => void) | null = null;\n const isStaticMode = mode === \"static\" && manifestUrl;\n\n async function init() {\n // Configure static mode BEFORE plugin initialization\n if (isStaticMode) {\n devLog(\"[DevTool] Configuring static mode with manifest:\", manifestUrl);\n configureStaticMode(manifestUrl);\n } else {\n // Ensure static mode is cleared if switching modes\n clearStaticMode();\n }\n\n // Register and initialize plugins (only once)\n if (!pluginsInitialized) {\n // Register local plugins\n pluginRegistry.register(eslintPlugin);\n pluginRegistry.register(fixPromptPlugin);\n\n // Load external plugins (vision, semantic) — imports them,\n // triggers auto-registration with uilint-core's registry, then\n // adapts them from declarative to imperative React plugins.\n // Pass empty manifests since local plugins are already registered above.\n const externalPlugins = await loadPlugins([]);\n for (const plugin of externalPlugins) {\n pluginRegistry.register(plugin);\n }\n devLog(\n `[DevTool] Loaded ${externalPlugins.length} external plugin(s):`,\n externalPlugins.map((p) => p.id).join(\", \")\n );\n\n await initializePlugins({ websocket, domObserver });\n pluginsInitialized = true;\n devLog(\"[DevTool] Plugins initialized in\", isStaticMode ? \"static\" : \"websocket\", \"mode\");\n }\n\n // Set connection mode in the store\n const storeApi = getStoreApi();\n if (storeApi) {\n storeApi.getState().setConnectionStatus({\n mode: isStaticMode ? \"static\" : \"websocket\",\n maxReconnectAttempts: MAX_RECONNECT_ATTEMPTS,\n });\n }\n\n // Mark as ready so UI can render\n setIsReady(true);\n\n if (isStaticMode) {\n // Static mode: Start DOM observer immediately (no WebSocket needed)\n devLog(\"[DevTool] Static mode: starting DOM observer\");\n domObserver.start();\n } else {\n // WebSocket mode: Connect and wait for connection before starting observer\n websocket.connect();\n\n unsubscribeConnection = websocket.onConnectionChange((connected) => {\n if (connected) {\n devLog(\"[DevTool] WebSocket connected, starting DOM observer\");\n domObserver.start();\n } else {\n devLog(\n \"[DevTool] WebSocket disconnected, stopping DOM observer\"\n );\n domObserver.stop();\n }\n });\n }\n }\n\n init();\n\n return () => {\n unsubscribeConnection?.();\n if (!isStaticMode) {\n websocket.disconnect();\n }\n domObserver.stop();\n };\n }, [enabled, isMounted, mode, manifestUrl]);\n\n // Don't render UI until mounted AND plugins are initialized\n // This ensures the store is created with the real WebSocket service\n if (!enabled || !isMounted || !isReady) return null;\n\n return <UILint enabled={enabled} />;\n}\n"],"names":["REACT_ELEMENT_TYPE","REACT_FRAGMENT_TYPE","jsxProd","type","config","maybeKey","key","propName","reactJsxRuntime_production","getComponentNameFromType","REACT_CLIENT_REFERENCE","REACT_PROFILER_TYPE","REACT_STRICT_MODE_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_ACTIVITY_TYPE","REACT_PORTAL_TYPE","REACT_CONTEXT_TYPE","REACT_CONSUMER_TYPE","REACT_FORWARD_REF_TYPE","innerType","REACT_MEMO_TYPE","REACT_LAZY_TYPE","testStringCoercion","value","checkKeyStringCoercion","JSCompiler_inline_result","JSCompiler_temp_const","JSCompiler_inline_result$jscomp$0","getTaskName","name","getOwner","dispatcher","ReactSharedInternals","UnknownOwner","hasValidKey","hasOwnProperty","getter","defineKeyPropWarningGetter","props","displayName","warnAboutAccessingKey","specialPropKeyWarningShown","elementRefGetterWithDeprecationWarning","componentName","didWarnAboutElementRef","ReactElement","owner","debugStack","debugTask","refProp","jsxDEVImpl","isStaticChildren","children","isArrayImpl","validateChildKeys","keys","k","didWarnAboutKeySpread","node","isValidElement","object","React","require$$0","createTask","callStackForError","unknownOwnerDebugStack","unknownOwnerDebugTask","reactJsxRuntime_development","trackActualOwner","jsxRuntimeModule","require$$1","BREAKPOINTS","STORAGE_KEYS","isBrowser","getStorageValue","defaultValue","stored","e","devWarn","setStorageValue","DEFAULT_COMMAND_PALETTE_STATE","DEFAULT_HEATMAP_FILTER_STATE","DEFAULT_INSPECTOR_WIDTH","DEFAULT_FLOATING_WIDTH","LAYOUT_PADDING","computeLayoutAvailableWidth","docked","width","floatingSize","rawWidth","DEFAULT_MOBILE_STATE","DEFAULT_CONNECTION_STATUS","loadInitialInspectorState","createCoreSlice","services","set","get","held","id","current","query","index","tile","siblings","providerId","currentLevel","expandedTile","s","level","panelId","data","newDocked","position","size","filePath","isExpanded","f","ruleId","issueId","status","connectionStatus","locs","label","mobileState","interaction","result","filterByQuery","items","normalizedQuery","item","subtitle","issues","issue","dedupeItems","seen","EMPTY_SET","cachedExpandedRuleId","cachedExpandedFilePath","cachedIssuesMapForSelection","cachedSelectedDataLocs","selectSelectedDataLocs","state","expandedRuleId","expandedFilePath","issuesMap","selected","dataLoc","selectHasActiveSelection","EMPTY_FILE_GROUPS","cachedIssuesMap","cachedFileGroups","getHighestSeverity","highest","countSeverities","counts","getFileName","parts","getDirectory","getShortRuleName","severityOrder","severity","buildFileGroups","issuesByFile","allRuleIds","existing","fileGroups","totalIssues","overallSeverityCounts","sortedIssues","a","b","issuesByRule","ruleGroups","ruleIssues","severityDiff","severityCounts","summary","selectFileGroups","EMPTY_ISSUES","EMPTY_BY_FILE","EMPTY_BY_DATALOC","ZERO_SEVERITY_COUNTS","selectIssuesMap","selectAllIssues","allIssues","selectIssuesByFile","byFile","selectTotalIssueCount","count","selectSeverityCounts","createStoreImpl","createState","listeners","setState","partial","replace","nextState","previousState","listener","getState","api","initialState","createStore","identity","arg","useStore","selector","slice","createImpl","useBoundStore","create","createDragSlice","startPos","offset","elementStartPos","elementStartSize","currentPos","activeDrag","sortByDependencies","plugins","pluginMap","plugin","sorted","visited","visiting","visit","deps","depId","depPlugin","PluginRegistry","devLog","missingDeps","pluginId","registered","rp","commands","analyzers","panels","actions","groups","providers","initialized","rules","pluginRules","error","devError","ruleMeta","rc","corePlugin","firstPlugin","contribution","allPlugins","sortedPlugins","createPluginRegistry","pluginRegistry","safeMatchMedia","computeMobileState","hasTouch","prefersTouch","initializeKeyboardShortcuts","store","handleKeyDown","getPluginServices","group","action","handleKeyUp","initializeMobileDetection","updateMobileState","controller","signal","mq","initializeInspectorAutoUndock","previousIsMobile","isMobile","open","initializeDragHandlers","handleMouseMove","handleTouchMove","touch","handleMouseUp","handleTouchEnd","initializeSubscriptions","options","enableKeyboardShortcuts","enableMobileDetection","enableDragHandlers","cleanupFns","cleanup","storeInstance","pluginServicesInstance","createDefaultWebSocketService","createDefaultDOMObserverService","createStoreInternal","websocket","domObserver","mode","coreSlice","dragSlice","_removed","rest","existingSlice","connected","createComposedStore","useComposedStore","createScopedServicesForPlugin","baseServices","initializePlugins","registry","p","scopedServices","getStoreApi","useElementRects","dataLocs","rects","setRects","useState","observerRef","useRef","styleObserverRef","rafRef","transitionPollRef","updateRects","useCallback","dataLocSet","newRects","el","rect","throttledUpdate","useEffect","pollForUpdates","frames","poll","handleScroll","handleWindowResize","mutations","mutation","handleTransitionEnd","parseDataLoc","column","line","createIssueId","severityFromNumber","num","severityToColor","fromESLintIssue","raw","OverlayItem","isHovered","isSelected","isEmphasized","showDetails","onBadgeClick","onBadgeHover","useMemo","i","color","baseOpacity","finalOpacity","jsxs","jsx","HeatmapOverlay","altKeyHeld","openInspectorPanel","expandRule","expandFileInRule","selectIssue","hoveredElementId","setHoveredElementId","selectedIssueId","selectedDataLocs","hasActiveSelection","elementRects","allEntries","handleBadgeClick","elementIssues","firstIssue","handleBadgeHover","hovered","getSelectedDataLoc","dataLocIssues","portalRoot","createPortal","LayoutGroupContext","createContext","useConstant","init","ref","useIsomorphicLayoutEffect","useLayoutEffect","PresenceContext","addUniqueItem","arr","removeItem","clamp","min","max","v","formatErrorMessage","message","errorCode","warning","invariant","check","MotionGlobalConfig","isNumericalString","isObject","isZeroValueString","memo","callback","noop","any","combineFunctions","pipe","transformers","progress","from","to","toFromDifference","SubscriptionManager","handler","c","numSubscriptions","secondsToMilliseconds","seconds","millisecondsToSeconds","milliseconds","velocityPerSecond","velocity","frameDuration","warned","warnOnce","condition","calcBezier","a1","a2","subdivisionPrecision","subdivisionMaxIterations","binarySubdivide","x","lowerBound","upperBound","mX1","mX2","currentX","currentT","cubicBezier","mY1","mY2","getTForX","aX","t","mirrorEasing","easing","reverseEasing","backOut","backIn","backInOut","anticipate","circIn","circOut","circInOut","easeIn","easeOut","easeInOut","isEasingArray","ease","isBezierDefinition","easingLookup","isValidEasing","easingDefinitionToFunction","definition","x1","y1","x2","y2","stepsOrder","createRenderStep","runNextFrame","stepName","thisFrame","nextFrame","isProcessing","flushNextFrame","toKeepAlive","latestFrameData","triggerCallback","step","keepAlive","immediate","queue","frameData","maxElapsed","createRenderBatcher","scheduleNextBatch","allowKeepAlive","useDefaultElapsed","flagRunNextFrame","steps","acc","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","timestamp","wake","process","frame","cancelFrame","frameSteps","now","clearTime","time","newTime","checkStringStartsWith","token","isCSSVariableName","startsAsVariableToken","isCSSVariableToken","singleCssVariableRegex","containsCSSVariable","number","alpha","scale","sanitize","floatRegex","isNullish","singleColorRegex","isColorString","testProp","splitColor","aName","bName","cName","clampRgbUnit","rgbUnit","rgba","red","green","blue","alpha$1","parseHex","r","g","hex","createUnitType","unit","degrees","percent","px","vh","vw","progressPercentage","hsla","hue","saturation","lightness","parsed","colorRegex","test","NUMBER_TOKEN","COLOR_TOKEN","VAR_TOKEN","VAR_FUNCTION_TOKEN","SPLIT_TOKEN","complexRegex","analyseComplexValue","originalValue","values","indexes","types","split","parsedValue","parseComplexValue","createTransformer","source","numSections","output","convertNumbersToZero","getAnimatableNone","complex","hueToRgb","q","hslaToRgba","mixImmediate","mixNumber","mixLinearColor","fromExpo","expo","colorTypes","getColorType","asRGBA","model","mixColor","fromRGBA","toRGBA","blended","invisibleValues","mixVisibility","origin","target","mixNumber$1","getMixer","mixComplex","mixArray","mixObject","numValues","blendValue","matchOrder","orderedOrigin","pointers","originIndex","originValue","template","originStats","targetStats","mix","frameloopDriver","passTimestamp","generateLinearEasing","duration","resolution","points","numPoints","maxGeneratorDuration","calcGeneratorDuration","generator","timeStep","createGeneratorEasing","createGenerator","velocitySampleDuration","calcGeneratorVelocity","resolveValue","prevT","springDefaults","safeMin","findSpring","bounce","mass","envelope","derivative","dampingRatio","undampedFreq","exponentialDecay","delta","calcAngularFreq","d","initialGuess","approximateRoot","stiffness","rootIterations","durationKeys","physicsKeys","isSpringType","getSpringOptions","springOptions","visualDuration","root","damping","derived","spring","optionsOrVisualDuration","restSpeed","restDelta","isResolvedFromDuration","initialVelocity","initialDelta","undampedAngularFreq","isGranularScale","resolveSpring","angularFreq","dampedAngularFreq","freqForT","currentVelocity","isBelowVelocityThreshold","isBelowDisplacementThreshold","calculatedDuration","generatorOptions","inertia","keyframes","power","timeConstant","bounceDamping","bounceStiffness","modifyTarget","isOutOfBounds","nearestBoundary","amplitude","ideal","calcDelta","calcLatest","applyFriction","latest","timeReachedBoundary","spring$1","checkCatchBoundary","hasUpdatedFrame","createMixers","customMixer","mixers","mixerFactory","numMixers","mixer","easingFunction","interpolate","input","isClamp","inputLength","isZeroDeltaRange","interpolator","progressInRange","fillOffset","remaining","offsetProgress","defaultOffset","convertOffsetToTimes","o","defaultEasing","keyframeValues","times","easingFunctions","absoluteTimes","mapTimeToKeyframe","isNotNull","getFinalKeyframe","repeat","repeatType","finalKeyframe","speed","resolvedKeyframes","transitionTypeMap","replaceTransitionType","transition","WithPromise","resolve","onResolve","onReject","percentToProgress","JSAnimation","motionValue","repeatDelay","keyframes$1","generatorFactory","animationTime","sample","totalDuration","mixKeyframes","mirroredGenerator","resolvedDuration","delay","onUpdate","timeWithoutDelay","isInDelayPhase","elapsed","frameGenerator","currentIteration","iterationProgress","done","isAnimationFinished","reject","newSpeed","hasChanged","driver","startTime","sampleTime","timeline","fillWildcards","radToDeg","rad","rotate","angle","rebaseAngle","matrix2dParsers","rotateZ","scaleX","scaleY","matrix3dParsers","defaultTransformValue","parseValueFromTransform","transform","matrix3dMatch","parsers","match","matrix2dMatch","valueParser","convertTransformToNumber","readTransformValue","instance","transformPropOrder","transformProps","isNumOrPxType","transformKeys","nonTranslationalTransformKeys","removeNonTranslationalTransform","visualElement","removedTransforms","positionalValues","paddingLeft","paddingRight","y","paddingTop","paddingBottom","_bbox","top","left","toResolve","isScheduled","anyNeedsMeasurement","isForced","measureAllKeyframes","resolversToMeasure","resolver","elementsToMeasure","transformsToRestore","element","restore","readAllKeyframes","flushKeyframeResolvers","KeyframeResolver","unresolvedKeyframes","onComplete","isAsync","currentValue","valueAsRead","isForcedComplete","isCSSVar","setStyle","supportsScrollTimeline","supportsFlags","memoSupports","supportsFlag","memoized","supportsLinearEasing","cubicBezierAsString","supportedWaapiEasing","mapEasingToNativeEasing","segmentEasing","startWaapiAnimation","valueName","pseudoElement","keyframeOptions","isGenerator","applyGeneratorOptions","NativeAnimation","allowFlatten","keyframe","newStartTime","observe","unsupportedEasingFunctions","isUnsupportedEase","replaceStringEasing","sampleDelta","NativeAnimationExtended","sampleAnimation","isAnimatable","hasKeyframesChanged","canAnimate","originKeyframe","targetKeyframe","isOriginAnimatable","isTargetAnimatable","makeAnimationInstant","acceleratedValues","supportsWaapi","supportsBrowserAnimation","transformTemplate","MAX_RESOLVE_DELAY","AsyncMotionValueAnimation","autoplay","optionsWithDefaults","KeyframeResolver$1","forced","sync","isHandoff","resolvedOptions","animation","_onReject","splitCSSVariableRegex","parseCSSVariable","token1","token2","fallback","maxDepth","getVariableValue","depth","resolved","trimmed","getValueTransition","underDampedSpring","criticallyDampedSpring","keyframesTransition","getDefaultTransition","valueKey","isTransitionDefined","when","_delay","delayChildren","staggerChildren","staggerDirection","calcChildStagger","child","numChildren","maxStaggerDuration","animateMotionValue","valueTransition","shouldSkip","positionalKeys","MAX_VELOCITY_DELTA","isFloat","MotionValue","currentTime","dependent","prevFrameValue","subscription","eventName","unsubscribe","eventManagers","passiveEffect","stopPassiveEffect","prev","endAnimation","startAnimation","getValueState","resolveVariantFromProps","custom","resolveVariant","isKeyframesTarget","setMotionValue","resolveFinalValueInKeyframes","setTarget","transitionEnd","isMotionValue","isWillChangeMotionValue","addValueToWillChange","willChange","newWillChange","camelToDash","str","optimizedAppearDataId","optimizedAppearDataAttribute","getOptimisedAppearId","shouldBlockAnimation","protectedKeys","needsAnimating","shouldBlock","animateTarget","targetAndTransition","transitionOverride","animations","animationTypeState","valueTarget","appearId","animateVariant","variant","getAnimation","getChildAnimations","forwardDelay","animateChildren","first","last","animateVisualElement","resolvedDefinition","auto","testValueType","dimensionValueTypes","findDimensionValueType","isNone","maxDefaults","applyDefaultFilter","functionRegex","filter","functions","int","transformValueTypes","numberValueTypes","defaultValueTypes","getDefaultValueType","defaultValueType","invalidTemplates","makeNoneKeyframesAnimatable","noneKeyframeIndexes","animatableTemplate","noneIndex","DOMKeyframesResolver","originType","targetType","originHasVar","targetHasVar","measureKeyframe","finalKeyframeIndex","unsetTransformName","unsetTransformValue","resolveElements","elementOrSelector","scope","selectorCache","elements","getValueAsType","isHTMLElement","microtask","isDragging","isDragActive","setDragLock","axis","setupGesture","gestureAbortController","eventOptions","isValidHover","event","hover","onHoverStart","cancel","onPointerEnter","enterEvent","onHoverEnd","onPointerLeave","leaveEvent","isNodeOrChild","parent","isPrimaryPointer","interactiveElements","isElementKeyboardAccessible","isPressing","filterEvents","firePointerEvent","enableKeyboardPress","focusEvent","handleKeydown","handleKeyup","handleBlur","isValidPressEvent","press","targetOrSelector","onPressStart","targets","cancelEvents","startPress","startEvent","onPressEnd","onPointerEnd","endEvent","success","onPointerUp","onPointerCancel","upEvent","cancelEvent","isSVGElement","isSVGSVGElement","valueTypes","findValueType","createAxisDelta","createDelta","createAxis","createBox","prefersReducedMotion","hasReducedMotionListener","initPrefersReducedMotion","motionMediaQuery","setReducedMotionPreferences","visualElementStore","isAnimationControls","isVariantLabel","variantPriorityOrder","variantProps","isControllingVariants","isVariantNode","updateMotionValuesFromProps","next","nextValue","prevValue","existingValue","latestValue","propEventHandlers","featureDefinitions","setFeatureDefinitions","definitions","getFeatureDefinitions","VisualElement","_props","_prevProps","_visualElement","presenceContext","reducedMotionConfig","blockInitialAnimation","visualState","latestValues","renderState","initialMotionValues","remove","feature","valueIsTransform","removeOnChange","removeSyncCheck","other","featureDefinition","isEnabled","FeatureConstructor","listenerName","closestVariantNode","initial","valueFromInitial","args","Feature","DOMVisualElement","style","vars","convertBoundingBoxToBox","right","bottom","convertBoxToBoundingBox","transformBoxPoints","point","transformPoint","topLeft","bottomRight","isIdentityScale","hasScale","hasTransform","has2DTranslate","is2DTranslate","scalePoint","originPoint","distanceFromOrigin","scaled","applyPointDelta","translate","boxScale","applyAxisDelta","applyBoxDelta","box","TREE_SCALE_SNAP_MIN","TREE_SCALE_SNAP_MAX","applyTreeDeltas","treeScale","treePath","isSharedTransition","treeLength","transformBox","translateAxis","distance","transformAxis","axisTranslate","axisScale","axisOrigin","measureViewportBox","measurePageBox","rootProjectionNode","transformPagePoint","viewportBox","scroll","translateAlias","numTransforms","buildTransform","transformString","transformIsDefault","valueIsDefault","valueAsType","transformName","buildHTMLStyles","transformOrigin","hasTransformOrigin","originX","originY","originZ","renderHTML","styleProp","projection","elementStyle","pixelsToPercent","pixels","correctBorderRadius","correctBoxShadow","projectionDelta","original","shadow","xScale","yScale","averageScale","scaleCorrectors","isForcedMotionValue","layout","layoutId","scrapeMotionValuesFromProps","prevProps","prevStyle","newValues","getComputedStyle","HTMLVisualElement","computedStyle","dashKeys","camelKeys","buildSVGPath","attrs","length","spacing","useDashCase","pathLength","pathSpacing","cssMotionPathProperties","buildSVGAttrs","attrX","attrY","attrScale","pathOffset","isSVGTag","camelCaseAttributes","tag","renderSVG","_styleProp","scrapeMotionValuesFromProps$1","targetKey","SVGVisualElement","defaultType","numVariantProps","getVariantContext","context","prop","shallowCompare","prevLength","reversePriorityOrder","numAnimationTypes","createAnimateFunction","createAnimationState","animate","isInitialRender","buildResolvedTypeValues","setAnimateFunction","makeAnimator","animateChanges","changedActiveType","removedKeys","encounteredKeys","removedVariantIndex","typeState","propIsVariant","activeDelta","isInherited","variantDidChange","checkVariantsDidChange","shouldAnimateType","handledRemovedValues","definitionList","resolvedValues","prevResolvedValues","allKeys","markToAnimate","valueHasChanged","willAnimateViaParent","parentVariant","fallbackAnimation","initialTransition","fallbackTarget","shouldAnimate","setActive","isActive","createTypeState","SCALE_PRECISION","SCALE_MIN","SCALE_MAX","TRANSLATE_PRECISION","TRANSLATE_MIN","TRANSLATE_MAX","calcLength","isNear","maxDistance","calcAxisDelta","calcBoxDelta","calcRelativeAxis","relative","calcRelativeBox","calcRelativeAxisPosition","calcRelativePosition","removePointDelta","removeAxisDelta","originAxis","sourceAxis","removeAxisTransforms","transforms","scaleKey","originKey","xKeys","yKeys","removeBoxTransforms","originBox","sourceBox","copyAxisInto","copyBoxInto","copyAxisDeltaInto","originDelta","isAxisDeltaZero","isDeltaZero","axisEquals","boxEquals","axisEqualsRounded","boxEqualsRounded","aspectRatio","axisDeltaEquals","eachAxis","buildProjectionTransform","latestTransform","xTranslate","yTranslate","zTranslate","transformPerspective","rotateX","rotateY","skewX","skewY","elementScaleX","elementScaleY","borders","numBorders","asNumber","isPx","mixValues","follow","lead","shouldCrossfadeOpacity","isOnlyMember","easeCrossfadeIn","easeCrossfadeOut","borderLabel","followRadius","getRadius","leadRadius","radiusName","compress","timeout","start","checkElapsed","addDomEvent","resolveMotionValue","animateSingleValue","motionValue$1","compareByDepth","FlatTree","NodeStack","prevLead","indexOfNode","member","preserveFollowOpacity","crossfade","resumingFrom","globalProjectionState","transformAxes","animationTarget","resetDistortingTransform","sharedAnimationValues","cancelTreeOptimisedTransformAnimations","projectionNode","createProjectionNode","attachResizeListener","defaultParent","measureScroll","checkIsScrollRoot","resetTransform","propagateDirtyNodes","resolveTargetDelta","calcProjection","cleanDirtyNodes","subscriptionManager","cancelDelay","innerWidth","resizeUnblockUpdate","newInnerWidth","finishAnimation","hasLayoutChanged","hasRelativeLayoutChanged","newLayout","layoutTransition","defaultLayoutTransition","onLayoutAnimationStart","onLayoutAnimationComplete","hasTargetChanged","hasOnlyRelativeTargetChanged","animationOptions","stack","resetSkewAndRotation","shouldNotifyListeners","clearMeasurements","clearIsLayoutDirty","resetTransformStyle","updateLayout","notifyLayoutUpdate","clearSnapshot","removeLeadSnapshots","prevLayout","phase","needsMeasurement","isRoot","isResetRequested","hasProjection","transformTemplateValue","transformTemplateHasChanged","removeTransform","pageBox","layoutBox","roundBox","checkNodeWasScrollRoot","boxWithoutScroll","transformOnly","withTransforms","boxWithoutTransform","nodeBox","forceRecalculation","isShared","relativeParent","parentLayout","canSkip","prevTreeScaleX","prevTreeScaleY","notifyAll","snapshot","snapshotLatestValues","mixedValues","targetDelta","relativeLayout","snapshotSource","layoutSource","isSharedLayoutAnimation","hasOpacityCrossfade","prevRelativeTarget","mixAxisDelta","mixBox","targetWithTransforms","shouldAnimatePositionOnly","xLength","yLength","needsReset","hasDistortingTransform","resetValues","targetStyle","valuesToRender","correct","applyTo","isCSSVariable","corrected","measuredLayout","animationType","axisSnapshot","layoutDelta","visualDelta","parentSnapshot","relativeSnapshot","onExitComplete","mixAxis","userAgentContains","string","roundPoint","roundAxis","DocumentProjectionNode","notify","HTMLProjectionNode","documentNode","MotionConfigContext","setRef","composeRefs","refs","hasCleanup","cleanups","useComposedRefs","PopChildMeasure","parentWidth","PopChild","isPresent","anchorX","useId","nonce","useContext","childRef","composedRef","useInsertionEffect","height","PresenceChild","presenceAffectsLayout","presenceChildren","newChildrenMap","isReusedContext","childId","isComplete","_","usePresence","subscribe","register","safeToRemove","getChildKey","onlyElements","filtered","Children","AnimatePresence","propagate","isParentPresent","presentChildren","presentKeys","pendingPresentChildren","exitComplete","exitingComponents","diffedChildren","setDiffedChildren","renderedChildren","setRenderedChildren","exitingChildren","nextChildren","forceRender","Fragment","onExit","isEveryExitComplete","isExitComplete","LazyContext","featureProps","isInitialized","initFeatureDefinitions","initialFeatureDefinitions","getInitializedFeatureDefinitions","loadFeatures","features","validMotionProps","isValidMotionProp","shouldForward","loadExternalIsValidProp","isValidProp","filterProps","isDom","forwardMotionProps","filteredProps","MotionContext","getCurrentTreeVariants","useCreateMotionContext","variantLabelsAsDependency","createHtmlRenderState","copyRawValuesOnly","useInitialMotionValues","useStyle","useHTMLProps","htmlProps","createSvgRenderState","useSVGProps","_isStatic","Component","visualProps","rawStyles","lowercaseSVGElements","isSVGComponent","useRender","isStatic","isSVG","elementProps","createElement","makeState","createRenderState","makeLatestValues","scrapeMotionValues","motionValues","isControllingVariants$1","isVariantNode$1","isInitialAnimationBlocked","variantToSet","list","makeUseVisualState","make","useHTMLVisualState","scrapeHTMLMotionValuesFromProps","useSVGVisualState","scrapeSVGMotionValuesFromProps","motionComponentSymbol","useMotionRef","externalRef","externalRefContainer","refCleanup","SwitchLayoutGroupContext","isRefObject","useVisualElement","createVisualElement","ProjectionNodeConstructor","lazyContext","visualElementRef","initialLayoutGroupConfig","isMounted","optimisedAppearId","wantsHandoff","initialPromotionConfig","drag","dragConstraints","layoutScroll","layoutRoot","layoutCrossfade","getClosestProjectingNode","createMotionComponent","preloadedFeatures","useVisualState","MotionDOMComponent","MeasureLayout","configAndProps","useLayoutId","useStrictMode","layoutProjection","getProjectionFunctionality","ForwardRefMotionComponent","forwardRef","layoutGroupId","isStrict","strictMessage","combined","createMotionProxy","componentCache","factory","deprecatedFactoryFunction","_target","createDomVisualElement","AnimationFeature","prevAnimate","ExitAnimationFeature","prevIsPresent","exitAnimation","extractEventInfo","addPointerInfo","addPointerEvent","getContextWindow","distance2D","xDelta","yDelta","overflowStyles","PanSession","handlers","contextWindow","dragSnapToOrigin","distanceThreshold","info","getPanInfo","isPanStarted","isDistancePastThreshold","onStart","onMove","onEnd","onSessionEnd","resumeAnimation","panInfo","initialInfo","onSessionStart","isWindow","subtractPoint","history","lastDevicePoint","startDevicePoint","getVelocity","timeDelta","timestampedPoint","lastPoint","applyConstraints","elastic","calcRelativeAxisConstraints","calcRelativeConstraints","calcViewportAxisConstraints","layoutAxis","constraintsAxis","calcViewportConstraints","constraintsBox","calcOrigin","sourceLength","targetLength","rebaseAxisConstraints","constraints","relativeConstraints","defaultElastic","resolveDragElastic","dragElastic","resolveAxisElastic","minLabel","maxLabel","resolvePointElastic","elementDragControls","VisualElementDragControls","originEvent","snapToCursor","dragPropagation","onDragStart","measuredAxis","animationState","dragDirectionLock","onDirectionLock","onDrag","getCurrentDirection","finalEvent","finalPanInfo","onDragEnd","_point","shouldDrag","axisValue","prevConstraints","onMeasureDragConstraints","constraintsElement","measuredConstraints","userConstraints","dragMomentum","dragTransition","onDragTransitionEnd","momentumAnimations","dragKey","externalMotionValue","boxProgress","stopPointerListener","dragListener","measureDragConstraints","stopMeasureLayoutListener","stopResizeListener","stopLayoutUpdateListener","direction","currentDirection","lockThreshold","DragGesture","dragControls","prevDragControls","asyncHandler","PanGesture","pointerDownEvent","onPanSessionStart","onPanStart","onPan","onPanEnd","hasTakenAnySnapshot","MeasureLayoutWithContext","layoutGroup","switchLayoutGroup","layoutDependency","promoteContext","handleHoverEvent","lifecycle","HoverGesture","_element","FocusGesture","isFocusVisible","handlePressEvent","PressGesture","observerCallbacks","observers","fireObserverCallback","entry","fireAllObserverCallbacks","entries","initIntersectionObserver","lookupRoot","rootObservers","observeIntersection","rootInteresectionObserver","thresholdNames","InViewFeature","viewport","rootMargin","amount","once","onIntersectionUpdate","isIntersecting","onViewportEnter","onViewportLeave","hasViewportOptionChanged","prevViewport","gestureAnimations","featureBundle","motion","n","clsx","concatArrays","array1","array2","combinedArray","createClassValidatorObject","classGroupId","validator","createClassPartObject","nextPart","validators","CLASS_PART_SEPARATOR","EMPTY_CONFLICTS","ARBITRARY_PROPERTY_PREFIX","createClassGroupUtils","classMap","createClassMap","conflictingClassGroups","conflictingClassGroupModifiers","className","getGroupIdForArbitraryProperty","classParts","startIndex","getGroupRecursive","hasPostfixModifier","modifierConflicts","baseConflicts","classPartObject","currentClassPart","nextClassPartObject","classRest","validatorsLength","validatorObj","content","colonIndex","property","theme","classGroups","processClassGroups","processClassesRecursively","classGroup","len","classDefinition","processClassDefinition","processStringDefinition","processFunctionDefinition","processObjectDefinition","classPartObjectToEdit","getPart","isThemeGetter","path","part","func","createLruCache","maxCacheSize","cacheSize","cache","previousCache","IMPORTANT_MODIFIER","MODIFIER_SEPARATOR","EMPTY_MODIFIERS","createResultObject","modifiers","hasImportantModifier","baseClassName","maybePostfixModifierPosition","isExternal","createParseClassName","prefix","experimentalParseClassName","parseClassName","bracketDepth","parenDepth","modifierStart","postfixModifierPosition","currentCharacter","baseClassNameWithImportantModifier","fullPrefix","parseClassNameOriginal","createSortModifiers","modifierWeights","mod","currentSegment","modifier","isArbitrary","isOrderSensitive","createConfigUtils","SPLIT_CLASSES_REGEX","mergeClassList","classList","configUtils","getClassGroupId","getConflictingClassGroupIds","sortModifiers","classGroupsInConflict","classNames","originalClassName","variantModifier","modifierId","classId","conflictGroups","twJoin","classLists","argument","resolvedValue","toValue","createTailwindMerge","createConfigFirst","createConfigRest","cacheGet","cacheSet","functionToCall","initTailwindMerge","previousConfig","createConfigCurrent","tailwindMerge","cachedResult","fallbackThemeArr","fromTheme","themeGetter","arbitraryValueRegex","arbitraryVariableRegex","fractionRegex","tshirtUnitRegex","lengthUnitRegex","colorFunctionRegex","shadowRegex","imageRegex","isFraction","isNumber","isInteger","isPercent","isTshirtSize","isAny","isLengthOnly","isNever","isShadow","isImage","isAnyNonArbitrary","isArbitraryValue","isArbitraryVariable","isArbitrarySize","getIsArbitraryValue","isLabelSize","isArbitraryLength","isLabelLength","isArbitraryNumber","isLabelNumber","isArbitraryPosition","isLabelPosition","isArbitraryImage","isLabelImage","isArbitraryShadow","isLabelShadow","isArbitraryVariableLength","getIsArbitraryVariable","isArbitraryVariableFamilyName","isLabelFamilyName","isArbitraryVariablePosition","isArbitraryVariableSize","isArbitraryVariableImage","isArbitraryVariableShadow","testLabel","testValue","shouldMatchNoLabel","getDefaultConfig","themeColor","themeFont","themeText","themeFontWeight","themeTracking","themeLeading","themeBreakpoint","themeContainer","themeSpacing","themeRadius","themeShadow","themeInsetShadow","themeTextShadow","themeDropShadow","themeBlur","themePerspective","themeAspect","themeEase","themeAnimate","scaleBreak","scalePosition","scalePositionWithArbitrary","scaleOverflow","scaleOverscroll","scaleUnambiguousSpacing","scaleInset","scaleGridTemplateColsRows","scaleGridColRowStartAndEnd","scaleGridColRowStartOrEnd","scaleGridAutoColsRows","scaleAlignPrimaryAxis","scaleAlignSecondaryAxis","scaleMargin","scaleSizing","scaleColor","scaleBgPosition","scaleBgRepeat","scaleBgSize","scaleGradientStopPosition","scaleRadius","scaleBorderWidth","scaleLineStyle","scaleBlendMode","scaleMaskImagePosition","scaleBlur","scaleRotate","scaleScale","scaleSkew","scaleTranslate","twMerge","cn","inputs","useIssues","byDataLoc","totalCount","countBySeverity","getIssuesForDataLoc","DEFAULT_WS_URL","MAX_RECONNECT_ATTEMPTS","RECONNECT_BASE_DELAY","MAX_RECONNECT_DELAY","WebSocketServiceImpl","url","exhausted","typeHandlers","wildcardHandlers","CACHE_TTL_MS","pendingRequests","getCachedSource","cached","setCachedSource","totalLines","relativePath","invalidateSource","extractContext","targetLine","contextAbove","contextBelow","lineIndex","endIndex","getPendingRequest","setPendingRequest","promise","createManifestFetcher","manifestUrl","retries","retryDelay","cacheTtl","cachedAt","fetchPromise","isCacheValid","sleep","ms","fetchWithRetries","lastError","attempt","response","manifest","globalFetcher","configureManifestFetcher","convertManifestIssue","rule","convertRuleMetadata","processManifest","file","rawIssue","availableRules","ruleConfigs","getFileSource","staticModeState","fileEntry","normalizedManifest","normalizedRequest","lines","configureStaticMode","fetcher","isStaticMode","clearStaticMode","initializeStaticMode","unsubscribeDom","getManifestMetadata","useSourceCode","enabled","setContext","isLoading","setIsLoading","setError","wsConnected","requestIdRef","fetchSource","manifestSource","cachedSource","pending","requestId","unsubResult","unsubError","useTileNavigation","columns","onSelect","onBack","selectedIndex","setSelectedIndex","itemCount","currentRow","currentCol","rowStart","rowEnd","newIndex","lastRowIndex","EMPTY_ITEMS","EMPTY_FILTERS","computeTileItems","tileProviders","allItems","provider","itemsWithProvider","useTileItems","storeQuery","effectiveQuery","disabledRules","rawItems","falsyToString","cx","cva","base","_config_compoundVariants","variants","defaultVariants","getVariantClassNames","variantProp","defaultVariantProp","variantKey","propsWithoutUndefined","param","getCompoundVariantClassNames","cvClass","cvClassName","compoundVariantOptions","toKebabCase","toCamelCase","p1","p2","toPascalCase","camelCase","mergeClasses","classes","array","hasA11yProp","defaultAttributes","Icon","strokeWidth","absoluteStrokeWidth","iconNode","createLucideIcon","iconName","__iconNode","Brain","Camera","Check","ChevronDown","ChevronLeft","ChevronRight","ChevronUp","CircleAlert","CircleCheckBig","CircleQuestionMark","CircleX","Clipboard","Clock","CodeXml","Code","Copy","Crop","ExternalLink","Eye","FileCode","File","Folder","Funnel","GitBranch","Info","Layers","Link","LoaderCircle","Maximize2","Minus","PanelRight","Pause","Play","Plus","RefreshCw","ScanLine","Search","Settings","Sparkles","SquarePen","Target","Terminal","Trash2","TriangleAlert","X","UILintInspectorIcon","kbdVariants","kbdMotionVariants","Kbd","animationDuration","baseStyles","badgeVariants","crispEase","badgeMotionVariants","Badge","disableAnimation","badgeStyle","CategoryBadge","CountBadge","isError","zeroIsSuccess","use","isPromiseLike","isLazyComponent","createSlot","ownerName","SlotClone","createSlotClone","Slot2","forwardedRef","slotProps","childrenArray","slottable","isSlottable","newElement","newChildren","Slot","childrenRef","getElementRef","props2","mergeProps","SLOTTABLE_IDENTIFIER","childProps","overrideProps","slotPropValue","childPropValue","mayWarn","buttonVariants","motionVariants","motionTransition","Button","asChild","iconButtonVariants","glassMotionVariants","IconButton","disableMotion","disabled","selectedMotionVariants","inputVariants","Input","containerClassName","icon","onFocus","onBlur","isFocused","setIsFocused","handleFocus","ringColor","inputElement","cardVariants","fadeInVariants","hoverLiftVariants","transitionConfig","Card","interactive","animated","CardHeader","CardTitle","CardDescription","CardContent","CardFooter","glassPanelVariants","glassPanelMotionVariants","defaultTransition","getGlassStyles","blur","bordered","customStyle","blurValues","backgroundValues","shadowValues","blurKey","shadowKey","blurValue","shadowValue","backgroundValue","boxShadowParts","GlassPanel","show","glassStyles","variantClasses","Popover","onClose","trigger","placement","align","triggerRef","popoverRef","setPosition","actualWidth","setActualWidth","updatePosition","triggerRect","popoverRect","popoverWidth","popoverHeight","gap","padding","viewportWidth","viewportHeight","raf","handleClickOutside","handleEscape","searchContainerVariants","searchInputVariants","iconMotionVariants","clearButtonMotionVariants","hintMotionVariants","SearchInput","onChange","placeholder","autoFocus","inputRef","timer","SearchIcon","CloseIcon","tileVariants","HoverOverlay","TypeGradient","tileType","colorVar","formatIssueSummaryParts","fileCount","issueWord","getLabelFontSize","bucket","getSummaryFontSize","Tile","onClick","onOpenInInspector","setIsHovered","handleOpenInInspector","iconSize","issueCount","suffix","labelFontSize","summaryFontSize","pathFontSize","ExternalLinkIcon","DEFAULT_PADDING","DEFAULT_CONFIG","calculateIdealDimensions","safeCount","safeTotalIssues","fraction","area","labelLen","subtitleLen","maxLen","findBestSkylinePosition","skyline","tileWidth","tileHeight","containerWidth","bestX","bestY","bestIndex","maxY","j","updateSkyline","tileX","tileY","newY","tileEndX","newSkyline","nodeEndX","merged","lastEndX","packTiles","tiles","packed","pos","getBucketFromArea","calculateMosaicLayout","mergedConfig","availableWidth","sum","sizedTiles","dims","totalHeight","pattern","avgWidth","estimatedColumns","EXPANDED_HEADER_HEIGHT","EXPANDED_CONTENT_PADDING","CHILDREN_GAP","calculateExpandedLayout","expandedId","mergeConfig","originalLayout","positions","expandedOriginal","childrenLayout","calculateChildrenHeight","extraHeight","expandedHeight","expandedY","tilesAbove","tilesDisplaced","expandedPosition","displacedStartY","displacedLayout","childrenWidth","DURATIONS","childrenContainerVariants","headerVariants","headerTransition","backButtonVariants","backButtonTransition","GRID_PADDING","GRID_AVAILABLE_WIDTH","GRID_GAP","EmptyState","TileGrid","onTileClick","sortedItems","itemIndexMap","computedLayout","layoutA","layoutB","yDiff","indexMap","animIndex","tileLayout","globalIndex","CopyButton","text","copied","setCopied","handleCopy","textarea","CommandBox","command","RetryButton","OnboardingState","retryConnection","RuleToggleButton","RuleToggleBar","eslintSlice","toggleRule","issueCountsByRule","handleToggle","panelTransition","CommandPalette","isOpen","closeCommandPalette","setQuery","scanStatus","showOnboarding","onboardingVariant","tileItems","handleTileClick","execute","tileHandleKeyDown","labelStyles","inputBaseStyles","descriptionStyles","TextField","schema","handleChange","NumberField","localValue","setLocalValue","isValid","setIsValid","newValue","inputValue","numValue","defaultVal","BooleanField","SelectField","setIsOpen","containerRef","selectedOption","opt","handleSelect","optValue","option","MultiselectField","selectedValues","ArrayField","stringValue","newArray","OptionField","renderField","RuleOptionsForm","optionSchema","currentOptions","defaultOptions","onOptionChange","onReset","isUpdating","fields","getFieldValue","field","hasChanges","SeverityButton","dotClass","RuleConfig","currentSeverity","onSeverityChange","onResetOptions","RuleHeader","ruleFilter","description","category","docsUrl","onClear","showCloseButton","highestSeverity","showDescription","setShowDescription","configPopoverOpen","setConfigPopoverOpen","namespace","handleSeverityChange","handleOptionChange","hasConfig","ErrorIcon","WarningIcon","InfoIcon","SettingsIcon","useFullSourceCode","setSource","getSeverityClasses","IssueAnnotation","gutterWidth","severityClasses","getSeverityDotClass","IssueReference","firstLine","getSeverityHoverBgClass","getSeverityBorderClass","CollapsedIssueIndicator","calculateRegions","contextLines","rawRegions","end","lastRegion","regions","gaps","gapId","currentEnd","nextStart","expandGap","gapIndex","newRegions","newGaps","lastIdx","beforeRegionIdx","afterRegionIdx","mergedRegion","getIssuesForLine","lineNumber","getLineSeverity","getLineBackgroundClass","hasIssues","getLineBorderClass","CodeRegion","startLine","onIssueSelect","firstOccurrenceMap","lineContent","lineIssues","CollapsedLines","endLine","lineCount","onExpand","ChevronDownIcon","DEFAULT_CONTEXT_LINES","MIN_GUTTER_WIDTH","CHAR_WIDTH","GUTTER_PADDING","FileSourceView","expandedGapIds","setExpandedGapIds","baseResult","handleExpandGap","maxLineDigits","map","getRegionLines","regionIndex","sortedGaps","nextGap","nextRegion","regionLines","SeverityIcon","AlertCircle","AlertTriangle","IssueRow","IssueSummaryView","onIssueClick","onShowFullSource","handleIssueClick","Code2","Separator","Segment","isClickable","Breadcrumbs","expandedRuleName","expandedFileName","onCollapseToRoot","onCollapseFile","formatIssueSummary","TileHeader","DEFAULT_GAP","DefaultExpandedContent","childrenHeight","onChildClick","ExpandableTileGrid","expandedChildren","onExpandedChildClick","extraExpandedHeight","renderExpandedContent","layoutItems","childLayoutItems","layoutResult","posA","posB","expandedItem","originalLayoutItem","formatCountText","fileGroupsToRuleNodes","ruleMap","fileGroup","ruleName","previewMessages","getFileNodesForRule","ruleNode","aHighest","bHighest","ruleNodeToTileItem","fileNodeToTileItem","BREADCRUMB_HEIGHT","RULE_HEADER_HEIGHT","FILE_CONTENT_MIN_HEIGHT","IssuesList","scrollContainerRef","showFullSource","collapseRule","collapseFileInRule","showFullSourceView","ruleNodes","expandedRule","fileNodes","expandedFile","ruleTileItems","fileTileItems","expandedFileIssues","timeoutId","handleIssueSelect","ruleConfig","eslintState","ruleMetadata","isRuleUpdating","apiSeverity","newOptions","handleResetOptions","defaultOpts","currentRuleSeverity","renderExpandedRuleContent","tileAvailableWidth","isFileExpanded","getRuleDescription","getRuleCategory","getRuleDocsUrl","fileItem","fileNode","leadingWhitespace","dedentLines","nonEmpty","l","SourceViewer","defaultExpanded","expanded","setExpanded","dedented","maxLineNumber","ChevronRightIcon","isHighlighted","IssueDetail","ElementDetail","onSelectIssue","ResizeHandle","onResize","onResizeStart","onResizeEnd","lastPos","handleMouseDown","deltaX","deltaY","baseStyle","directionStyles","MIN_WIDTH","MAX_WIDTH","DEFAULT_FLOATING_HEIGHT","InspectorSidebar","panelData","floatingPosition","closeInspector","openInspector","toggleInspectorDocked","setInspectorWidth","setInspectorFloatingPosition","setInspectorFloatingSize","mounted","setMounted","startDrag","pluginPanels","handleSelectIssue","title","pluginPanel","PanelComponent","ruleContribution","CustomPanel","handleDockedResize","newWidth","handleFloatingResize","currentSize","newHeight","handleDragStart","handleTouchDragStart","Header","isDraggable","MaximizeIcon","DockIcon","glassStyle","ToolbarGroupButton","menuOpen","setMenuOpen","buttonSize","handleActionClick","DropdownMenu","onAction","PluginToolbar","isInspectorOpen","isCommandPaletteOpen","allGroups","storeState","visibleGroups","visibleIds","isMac","InspectorToggle","openCommandPalette","isTouchDevice","connectionMode","modKey","showShortcutHint","showStatusIndicator","MIN_SELECTION_SIZE","initialSelectionState","selectionReducer","TOKENS","RegionSelector","active","onRegionSelected","onCancel","dispatch","useReducer","isSelecting","startPoint","currentPoint","getSelectionRect","preventScroll","selectionRect","portalCreatedByUs","ensurePortalContainer","container","cleanupPortalContainer","UILint","overlayInteraction","completeOverlayInteraction","cancelOverlayInteraction","regionSelectionActive","handleRegionSelected","region","handleRegionCancel","FILE_COLORS","DEFAULT_SETTINGS","DATA_UILINT_ID","COLORS","SKIP_TAGS","getSourceFromDataLoc","loc","hashIndex","lastPart","secondLastPart","lastIsNumber","secondLastIsNumber","columnNumber","fileName","isNodeModulesPath","getDisplayName","shouldSkipElement","styles","scanDOMForSources","hideNodeModules","occurrenceByDataLoc","cleanupDataAttributes","locElements","occurrence","groupBySourceFile","fileMap","sourceFiles","colorIndex","fileElements","getElementById","updateElementRects","buildEditorUrl","editor","workspaceRoot","absolutePath","sourceCache","CACHE_TTL","API_ENDPOINT","fetchSourceWithContext","allLines","clearSourceCache","prefetchSources","filePaths","uniquePaths","BATCH_SIZE","batch","DATA_ELEMENTS_ATTR","CONTEXT_ELEMENTS","CLASS_PATTERNS","elementCounter","cleanupDataElements","generateElementId","truncateText","cleaned","inferRole","ariaRole","component","lower","isCard","isContainer","hasBoxShadow","hasBg","hasBorder","hasRadius","display","buildContext","extractStyles","snapshotElement","role","createSnapshot","targetRoot","walker","elementSnapshot","getElementBySnapshotId","getUILintPortalHost","HIGHLIGHT_COLOR","PLUS_SIZE","PLUS_SIZE_HOVER","PLUS_THICKNESS","PLUS_THICKNESS_HOVER","BORDER_WIDTH","calculateHighlights","elementIds","withBadges","highlights","getAllViolatingIds","violations","ids","OverviewPlusIcon","thickness","armLength","HighlightRect","badgeNumber","ConsistencyHighlighter","selectedViolation","lockedViolation","overviewHighlights","setOverviewHighlights","activeHighlights","setActiveHighlights","activeViolation","updateOverviewHighlights","allIds","updateActiveHighlights","handleUpdate","DATA_LOC_ATTR","RECONCILE_DEBOUNCE_MS","rawDataLoc","shouldFilterPath","DOMObserverServiceImpl","hide","MutationObserverImpl","hasRelevantChanges","currentElements","currentById","currentIds","knownIds","addedElements","removedIds","querySelectorAllFn","iconMap","HelpCircle","Filter","Edit","Loader2","CheckCircle","XCircle","getIcon","browserActionRegistry","registerBrowserAction","executeBrowserAction","payload","createPluginContext","actionHandlers","actionType","ctx","_options","fullState","evaluateCondition","isDataBinding","isExpressionBinding","expr","equalMatch","expectedStr","expected","lengthMatch","expectedLength","adaptCommand","cmd","pluginState","executeAction","adaptToolbarAction","adaptToolbarGroup","binding","adaptPlugin","stateWithSetters","setterName","panel","m","SchemaPanel","unsubscribes","messageType","unsub","unsubConnection","LOCAL_PLUGINS","externalPluginImports","registerExternalPlugin","importFn","loadPlugin","loadExternalPlugins","importPromises","registeredPlugins","corePluginRegistry","adaptedPlugins","adapted","loadPlugins","manifests","onProgress","externalPlugins","enabledManifests","loadPromises","loadedLocalPlugins","toggleScanCommand","eslint","openFixesInspectorCommand","startScanCommand","stopScanCommand","clearAndRescanCommand","eslintCommands","isScanning","initialESLintState","createESLintSlice","_services","createESLintActions","getSlice","setSlice","newIssues","newDisabled","newScanned","newRequested","filterByDisabledRules","parseFilePathFromDataLoc","lastColonIndex","secondLastColonIndex","extractUniqueFilePaths","SeverityToggle","RulePanel","aggregateByRule","meta","shortName","aErrors","bErrors","aggregateByFile","fileIssues","aggregateByFileGlobal","uniqueRules","getAllTilesFlat","ruleTiles","aggregateByRuleWithIssues","fileTiles","allTiles","uniqueFiles","getAllIssues","getAvailableRules","getTileItems","_filters","createFilter","metadata","isTerminal","filters","hasRule","hasFile","getInspectorData","aggregateIssuesForFile","getChildItems","canExpand","DEFAULT_AUTO_SCAN_SETTINGS","ESLINT_WS_MESSAGE_TYPES","eslintPlugin","initialSlice","pluginIssues","converted","issueList","shortRuleId","kw","svc","configs","normalizedSeverity","eslintSeverity","updating","unsubscribers","handleWebSocketMessage","handleElementsAdded","requestedFiles","newFiles","updatedRequestedFiles","rawIssues","mergedIssues","lintingFiles","newRequestedFiles","appRoot","serverCwd","postToolUseHook","configState","groupIssuesByFile","grouped","generateFixPrompt","hookAvailable","displayPath","location","onCopy","err","FixPromptPanel","promptText","FixPromptIcon","collectAllIssues","fixPromptToolbarAction","fixPromptInspectorPanel","fixPromptPlugin","injected","injectDevToolStyles","cssText","pluginsInitialized","DEVTOOL_ROOT_CLASS","DevTool","setIsMounted","isReady","setIsReady","portalRootRef","createdPortalRootRef","devtoolsCss","unsubscribeConnection","storeApi"],"mappings":";;;;;;;;;;AAWA,MAAIA,IAAqB,uBAAO,IAAI,4BAA4B,GAC9DC,IAAsB,uBAAO,IAAI,gBAAgB;AACnD,WAASC,EAAQC,GAAMC,GAAQC,GAAU;AACvC,QAAIC,IAAM;AAGV,QAFWD,MAAX,WAAwBC,IAAM,KAAKD,IACxBD,EAAO,QAAlB,WAA0BE,IAAM,KAAKF,EAAO,MACxC,SAASA,GAAQ;AACnB,MAAAC,IAAW,CAAA;AACX,eAASE,KAAYH;AACnB,QAAUG,MAAV,UAAuBF,EAASE,CAAQ,IAAIH,EAAOG,CAAQ;AAAA,IACjE,MAAS,CAAAF,IAAWD;AAClB,WAAAA,IAASC,EAAS,KACX;AAAA,MACL,UAAUL;AAAA,MACV,MAAMG;AAAA,MACN,KAAKG;AAAA,MACL,KAAgBF,MAAX,SAAoBA,IAAS;AAAA,MAClC,OAAOC;AAAA;EAEX;AACA,SAAAG,GAAA,WAAmBP,GACnBO,GAAA,MAAcN,GACdM,GAAA,OAAeN;;;;;wBCtBE,QAAQ,IAAI,aAA7B,iBACG,WAAY;AACX,aAASO,EAAyBN,GAAM;AACtC,UAAYA,KAAR,KAAc,QAAO;AACzB,UAAmB,OAAOA,KAAtB;AACF,eAAOA,EAAK,aAAaO,KACrB,OACAP,EAAK,eAAeA,EAAK,QAAQ;AACvC,UAAiB,OAAOA,KAApB,SAA0B,QAAOA;AACrC,cAAQA,GAAI;AAAA,QACV,KAAKF;AACH,iBAAO;AAAA,QACT,KAAKU;AACH,iBAAO;AAAA,QACT,KAAKC;AACH,iBAAO;AAAA,QACT,KAAKC;AACH,iBAAO;AAAA,QACT,KAAK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AAI;AAAA,QAAA,GAG5C,MAAMF,GAAkB,EAAE,WAAAb,IAAW,aAAAC,IAAa,GAClD+rF,KAAqB,IACrB/vF,EAAO,oCAAoCwxD,IAAe,WAAW,aAAa,MAAM;AAAA,MAC1F;AAGA,YAAMi/B,IAAWzrF,GAAA;AACjB,MAAIyrF,KACFA,EAAS,SAAA,EAAW,oBAAoB;AAAA,QACtC,MAAMj/B,IAAe,WAAW;AAAA,QAChC,sBAAsB1D;AAAA,MAAA,CACvB,GAIHsiC,EAAW,EAAI,GAEX5+B,KAEFxxD,EAAO,8CAA8C,GACrDgE,GAAY,MAAA,MAGZD,GAAU,QAAA,GAEVysF,IAAwBzsF,GAAU,mBAAmB,CAACQ,MAAc;AAClE,QAAIA,KACFvE,EAAO,sDAAsD,GAC7DgE,GAAY,MAAA,MAEZhE;AAAA,UACE;AAAA,QAAA,GAEFgE,GAAY,KAAA;AAAA,MAEhB,CAAC;AAAA,IAEL;AAEA,WAAA2F,EAAA,GAEO,MAAM;AACX,MAAA6mF,IAAA,GACKh/B,KACHztD,GAAU,WAAA,GAEZC,GAAY,KAAA;AAAA,IACd;AAAA,EACF,GAAG,CAAC8tD,GAASvd,GAAWtwC,GAAMurD,CAAW,CAAC,GAItC,CAACsC,KAAW,CAACvd,KAAa,CAAC47C,IAAgB,OAExCloF,gBAAAA,MAAC41E,MAAO,SAAA/rB,GAAkB;AACnC;","x_google_ignoreList":[0,1,2,8,9,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,341,342]}
|