@vizejs/fresco 0.720.0 → 0.721.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- {"version":3,"file":"components-DgDohiXo.mjs","names":["finiteInteger"],"sources":["../src/components/Box.ts","../src/components/FrescoSpacer.vue","../src/components/FrescoSpacer.vue","../src/components/FrescoDivider.vue","../src/components/FrescoDivider.vue","../src/components/layout-primitive-types.ts","../src/components/FrescoStack.vue","../src/components/FrescoStack.vue","../src/components/FrescoHStack.vue","../src/components/FrescoHStack.vue","../src/components/FrescoVStack.vue","../src/components/FrescoVStack.vue","../src/components/Grid.ts","../src/components/FrescoCard.vue","../src/components/FrescoCard.vue","../src/utils/text.ts","../src/components/Text.ts","../src/components/ScrollBar.vue","../src/components/ScrollBar.vue","../src/components/ScrollBox.vue","../src/components/ScrollBox.vue","../src/components/FrescoNewline.vue","../src/components/FrescoNewline.vue","../src/components/FrescoStatic.vue","../src/components/FrescoStatic.vue","../src/components/FrescoTransform.vue","../src/components/FrescoTransform.vue","../src/components/LineNumber.ts","../src/components/code-buffer.ts","../src/components/Code.ts","../src/components/markdown.ts","../src/components/FrescoMarkdown.vue","../src/components/FrescoMarkdown.vue","../src/components/FrescoFrameBuffer.vue","../src/components/FrescoFrameBuffer.vue","../src/components/diff-algorithm.ts","../src/components/Diff.ts","../src/components/FrescoLink.vue","../src/components/FrescoLink.vue","../src/components/text-editing.ts","../src/components/TextInput.ts","../src/components/textarea-editing.ts","../src/components/TextArea.ts","../src/components/collection-navigation.ts","../src/components/Select.ts","../src/components/Checkbox.ts","../src/components/RadioGroup.ts","../src/components/Confirm.ts","../src/components/slider-types.ts","../src/components/FrescoSlider.vue","../src/components/FrescoSlider.vue","../src/components/Form.ts","../src/components/display-primitive-types.ts","../src/components/FrescoSpinner.vue","../src/components/FrescoSpinner.vue","../src/components/ProgressBar.ts","../src/components/presentational-primitive-types.ts","../src/components/FrescoAlert.vue","../src/components/FrescoAlert.vue","../src/components/FrescoBadge.vue","../src/components/FrescoBadge.vue","../src/components/Timer.ts","../src/components/FrescoTooltip.vue","../src/components/FrescoTooltip.vue","../src/components/List.ts","../src/components/table-utils.ts","../src/components/Table.ts","../src/components/Tree.ts","../src/components/Menu.ts","../src/components/Tabs.ts","../src/components/FrescoBreadcrumb.vue","../src/components/FrescoBreadcrumb.vue","../src/components/Stepper.ts","../src/components/FrescoModal.vue","../src/components/FrescoModal.vue","../src/components/FrescoPopover.vue","../src/components/FrescoPopover.vue","../src/components/StatusBar.ts","../src/components/FrescoHeader.vue","../src/components/FrescoHeader.vue","../src/components/KeyHint.ts","../src/components/FrescoAvatar.vue","../src/components/FrescoAvatar.vue"],"sourcesContent":["/**\n * Box Component - Container with flexbox layout\n */\n\nimport { defineComponent, h, type PropType } from \"vue\";\nimport type { AriaRole, AriaState } from \"../accessibility.js\";\nimport { useIsScreenReaderEnabled } from \"../composables/useIsScreenReaderEnabled.js\";\nimport type {\n FrescoBorderStyle,\n FrescoCanonicalStyle,\n FrescoDimension,\n FrescoRenderStyle,\n} from \"../protocol.js\";\n\nexport type DimensionValue = FrescoDimension;\nexport type BorderStyleName = FrescoBorderStyle | \"round\" | \"bold\";\n\nexport interface BoxProps extends FrescoCanonicalStyle {\n /** Logical useFocus target routed to this host node. */\n focusId?: string;\n /** Padding X (left and right) */\n paddingX?: number;\n /** Padding Y (top and bottom) */\n paddingY?: number;\n /** Margin X (left and right) */\n marginX?: number;\n /** Margin Y (top and bottom) */\n marginY?: number;\n /** Border style (Fresco alias) */\n border?: BorderStyleName;\n /** Border style (Ink alias) */\n borderStyle?: BorderStyleName;\n borderTop?: boolean;\n borderRight?: boolean;\n borderBottom?: boolean;\n borderLeft?: boolean;\n borderColor?: string;\n borderTopColor?: string;\n borderRightColor?: string;\n borderBottomColor?: string;\n borderLeftColor?: string;\n borderDimColor?: boolean;\n borderTopDimColor?: boolean;\n borderRightDimColor?: boolean;\n borderBottomDimColor?: boolean;\n borderLeftDimColor?: boolean;\n borderBackgroundColor?: string;\n borderTopBackgroundColor?: string;\n borderRightBackgroundColor?: string;\n borderBottomBackgroundColor?: string;\n borderLeftBackgroundColor?: string;\n /** Foreground color */\n fg?: string;\n /** Foreground color alias */\n color?: string;\n /** Background color */\n bg?: string;\n /** Ink-compatible background color */\n backgroundColor?: string;\n /** Accessibility label, accepted for Ink API parity */\n \"aria-label\"?: string;\n /** Hide from screen readers, accepted for Ink API parity */\n \"aria-hidden\"?: boolean;\n /** Accessibility role, accepted for Ink API parity */\n \"aria-role\"?: AriaRole;\n /** Accessibility state, accepted for Ink API parity */\n \"aria-state\"?: AriaState;\n}\n\nconst dimensionProp = [Number, String] as PropType<DimensionValue>;\n\nfunction normalizeBorderStyle(style: BorderStyleName | undefined): BorderStyleName | undefined {\n if (style === \"round\") return \"rounded\";\n if (style === \"bold\") return \"heavy\";\n return style;\n}\n\nexport const Box = defineComponent({\n name: \"Box\",\n props: {\n display: String as PropType<BoxProps[\"display\"]>,\n position: String as PropType<BoxProps[\"position\"]>,\n top: dimensionProp,\n right: dimensionProp,\n bottom: dimensionProp,\n left: dimensionProp,\n flexDirection: String as PropType<BoxProps[\"flexDirection\"]>,\n flexWrap: String as PropType<BoxProps[\"flexWrap\"]>,\n justifyContent: String as PropType<BoxProps[\"justifyContent\"]>,\n alignItems: String as PropType<BoxProps[\"alignItems\"]>,\n alignSelf: String as PropType<BoxProps[\"alignSelf\"]>,\n alignContent: String as PropType<BoxProps[\"alignContent\"]>,\n flexGrow: Number,\n flexShrink: Number,\n flexBasis: dimensionProp,\n width: dimensionProp,\n height: dimensionProp,\n minWidth: dimensionProp,\n minHeight: dimensionProp,\n maxWidth: dimensionProp,\n maxHeight: dimensionProp,\n aspectRatio: Number,\n padding: Number,\n paddingX: Number,\n paddingY: Number,\n paddingTop: Number,\n paddingRight: Number,\n paddingBottom: Number,\n paddingLeft: Number,\n margin: Number,\n marginX: Number,\n marginY: Number,\n marginTop: Number,\n marginRight: Number,\n marginBottom: Number,\n marginLeft: Number,\n gap: Number,\n columnGap: Number,\n rowGap: Number,\n overflow: String as PropType<BoxProps[\"overflow\"]>,\n overflowX: String as PropType<BoxProps[\"overflowX\"]>,\n overflowY: String as PropType<BoxProps[\"overflowY\"]>,\n focusId: String,\n border: String as PropType<BoxProps[\"border\"]>,\n borderStyle: String as PropType<BoxProps[\"borderStyle\"]>,\n borderTop: Boolean,\n borderRight: Boolean,\n borderBottom: Boolean,\n borderLeft: Boolean,\n borderColor: String,\n borderTopColor: String,\n borderRightColor: String,\n borderBottomColor: String,\n borderLeftColor: String,\n borderDimColor: Boolean,\n borderTopDimColor: Boolean,\n borderRightDimColor: Boolean,\n borderBottomDimColor: Boolean,\n borderLeftDimColor: Boolean,\n borderBackgroundColor: String,\n borderTopBackgroundColor: String,\n borderRightBackgroundColor: String,\n borderBottomBackgroundColor: String,\n borderLeftBackgroundColor: String,\n fg: String,\n color: String,\n bg: String,\n backgroundColor: String,\n // Declared camelCase so the runtime props object (which Vue camelizes)\n // matches these keys; templates and h() may still pass \"aria-label\" etc.\n ariaLabel: String,\n ariaHidden: Boolean,\n ariaRole: String as PropType<BoxProps[\"aria-role\"]>,\n ariaState: Object as PropType<BoxProps[\"aria-state\"]>,\n },\n setup(props, { slots }) {\n const isScreenReaderEnabled = useIsScreenReaderEnabled();\n\n return () => {\n if (isScreenReaderEnabled && props.ariaHidden) return null;\n\n const style: FrescoRenderStyle = {};\n\n if (props.display) style.display = props.display;\n if (props.position) style.position = props.position;\n if (props.top !== undefined) style.top = String(props.top);\n if (props.right !== undefined) style.right = String(props.right);\n if (props.bottom !== undefined) style.bottom = String(props.bottom);\n if (props.left !== undefined) style.left = String(props.left);\n\n if (props.flexDirection) style.flexDirection = props.flexDirection;\n if (props.flexWrap) style.flexWrap = props.flexWrap;\n if (props.justifyContent) style.justifyContent = props.justifyContent;\n if (props.alignItems) style.alignItems = props.alignItems;\n if (props.alignSelf) style.alignSelf = props.alignSelf;\n if (props.alignContent) style.alignContent = props.alignContent;\n if (props.flexGrow !== undefined) style.flexGrow = props.flexGrow;\n if (props.flexShrink !== undefined) style.flexShrink = props.flexShrink;\n if (props.flexBasis !== undefined) style.flexBasis = String(props.flexBasis);\n\n if (props.width !== undefined) style.width = String(props.width);\n if (props.height !== undefined) style.height = String(props.height);\n if (props.minWidth !== undefined) style.minWidth = String(props.minWidth);\n if (props.minHeight !== undefined) style.minHeight = String(props.minHeight);\n if (props.maxWidth !== undefined) style.maxWidth = String(props.maxWidth);\n if (props.maxHeight !== undefined) style.maxHeight = String(props.maxHeight);\n if (props.aspectRatio !== undefined) style.aspectRatio = props.aspectRatio;\n\n if (props.padding !== undefined) style.padding = props.padding;\n if (props.paddingTop !== undefined || props.paddingY !== undefined) {\n style.paddingTop = props.paddingTop ?? props.paddingY ?? props.padding;\n }\n if (props.paddingRight !== undefined || props.paddingX !== undefined) {\n style.paddingRight = props.paddingRight ?? props.paddingX ?? props.padding;\n }\n if (props.paddingBottom !== undefined || props.paddingY !== undefined) {\n style.paddingBottom = props.paddingBottom ?? props.paddingY ?? props.padding;\n }\n if (props.paddingLeft !== undefined || props.paddingX !== undefined) {\n style.paddingLeft = props.paddingLeft ?? props.paddingX ?? props.padding;\n }\n\n if (props.margin !== undefined) style.margin = props.margin;\n if (props.marginTop !== undefined || props.marginY !== undefined) {\n style.marginTop = props.marginTop ?? props.marginY ?? props.margin;\n }\n if (props.marginRight !== undefined || props.marginX !== undefined) {\n style.marginRight = props.marginRight ?? props.marginX ?? props.margin;\n }\n if (props.marginBottom !== undefined || props.marginY !== undefined) {\n style.marginBottom = props.marginBottom ?? props.marginY ?? props.margin;\n }\n if (props.marginLeft !== undefined || props.marginX !== undefined) {\n style.marginLeft = props.marginLeft ?? props.marginX ?? props.margin;\n }\n\n if (props.gap !== undefined) style.gap = props.gap;\n if (props.columnGap !== undefined) style.columnGap = props.columnGap;\n if (props.rowGap !== undefined) style.rowGap = props.rowGap;\n if (props.overflow) style.overflow = props.overflow;\n if (props.overflowX) style.overflowX = props.overflowX;\n if (props.overflowY) style.overflowY = props.overflowY;\n\n const children =\n isScreenReaderEnabled && props.ariaLabel\n ? [h(\"text\", { text: props.ariaLabel })]\n : slots.default?.();\n\n return h(\n \"box\",\n {\n style,\n border: normalizeBorderStyle(props.borderStyle ?? props.border),\n borderColor: props.borderColor,\n borderTopColor: props.borderTopColor,\n borderRightColor: props.borderRightColor,\n borderBottomColor: props.borderBottomColor,\n borderLeftColor: props.borderLeftColor,\n borderDimColor: props.borderDimColor,\n borderBackgroundColor: props.borderBackgroundColor,\n fg: props.fg ?? props.color,\n bg: props.bg ?? props.backgroundColor,\n \"aria-label\": props.ariaLabel,\n \"aria-hidden\": props.ariaHidden,\n \"aria-role\": props.ariaRole,\n \"aria-state\": props.ariaState,\n focusId: props.focusId,\n },\n children,\n );\n };\n },\n});\n","<script setup lang=\"ts\">\nimport { Box } from \"./Box.js\";\n\ndefineOptions({ name: \"FrescoSpacer\" });\n</script>\n\n<template>\n <Box :flex-grow=\"1\" :flex-shrink=\"1\" />\n</template>\n","<script setup lang=\"ts\">\nimport { Box } from \"./Box.js\";\n\ndefineOptions({ name: \"FrescoSpacer\" });\n</script>\n\n<template>\n <Box :flex-grow=\"1\" :flex-shrink=\"1\" />\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\nimport type { DividerProps } from \"./layout-primitive-types.js\";\n\nconst { direction = \"horizontal\", char, title, fg = \"gray\", titleFg } = defineProps<DividerProps>();\n\ndefineOptions({ name: \"FrescoDivider\" });\n\nconst dividerChar = computed(() => char ?? (direction === \"horizontal\" ? \"─\" : \"│\"));\nconst titleLabel = computed(() => ` ${title} `);\nconst titleRowStyle = { flexDirection: \"row\", alignItems: \"center\" } as const;\n</script>\n\n<template>\n <text v-if=\"direction === 'vertical'\" :fg>{{ dividerChar }}</text>\n <div v-else-if=\"title\" :style=\"titleRowStyle\">\n <text :fg>{{ dividerChar.repeat(3) }}</text>\n <text :fg=\"titleFg ?? fg\" :bold=\"true\">{{ titleLabel }}</text>\n <text :fg>{{ dividerChar.repeat(3) }}</text>\n </div>\n <text v-else :fg>{{ dividerChar.repeat(40) }}</text>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\nimport type { DividerProps } from \"./layout-primitive-types.js\";\n\nconst { direction = \"horizontal\", char, title, fg = \"gray\", titleFg } = defineProps<DividerProps>();\n\ndefineOptions({ name: \"FrescoDivider\" });\n\nconst dividerChar = computed(() => char ?? (direction === \"horizontal\" ? \"─\" : \"│\"));\nconst titleLabel = computed(() => ` ${title} `);\nconst titleRowStyle = { flexDirection: \"row\", alignItems: \"center\" } as const;\n</script>\n\n<template>\n <text v-if=\"direction === 'vertical'\" :fg>{{ dividerChar }}</text>\n <div v-else-if=\"title\" :style=\"titleRowStyle\">\n <text :fg>{{ dividerChar.repeat(3) }}</text>\n <text :fg=\"titleFg ?? fg\" :bold=\"true\">{{ titleLabel }}</text>\n <text :fg>{{ dividerChar.repeat(3) }}</text>\n </div>\n <text v-else :fg>{{ dividerChar.repeat(40) }}</text>\n</template>\n","import type { CSSProperties } from \"vue\";\n\nexport interface DividerProps {\n /** Divider direction */\n direction?: \"horizontal\" | \"vertical\";\n /** Divider character */\n char?: string;\n /** Title in the middle of the divider */\n title?: string;\n /** Foreground color */\n fg?: string;\n /** Title foreground color */\n titleFg?: string;\n}\n\nexport interface StackProps {\n /** Stack direction */\n direction?: \"horizontal\" | \"vertical\";\n /** Gap between children */\n gap?: number;\n /** Align items */\n align?: \"start\" | \"center\" | \"end\" | \"stretch\";\n /** Justify content */\n justify?: \"start\" | \"center\" | \"end\" | \"between\" | \"around\" | \"evenly\";\n /** Wrap children */\n wrap?: boolean;\n}\n\nexport type ConvenienceStackProps = Pick<StackProps, \"gap\" | \"align\" | \"justify\">;\n\nexport const stackAlignValues: Record<\n NonNullable<StackProps[\"align\"]>,\n NonNullable<CSSProperties[\"alignItems\"]>\n> = {\n start: \"flex-start\",\n center: \"center\",\n end: \"flex-end\",\n stretch: \"stretch\",\n};\n\nexport const stackJustifyValues: Record<\n NonNullable<StackProps[\"justify\"]>,\n NonNullable<CSSProperties[\"justifyContent\"]>\n> = {\n start: \"flex-start\",\n center: \"center\",\n end: \"flex-end\",\n between: \"space-between\",\n around: \"space-around\",\n evenly: \"space-evenly\",\n};\n","<script setup lang=\"ts\">\nimport { computed, type CSSProperties } from \"vue\";\n\nimport { stackAlignValues, stackJustifyValues, type StackProps } from \"./layout-primitive-types.js\";\n\nconst {\n direction = \"vertical\",\n gap = 0,\n align = \"stretch\",\n justify = \"start\",\n wrap = false,\n} = defineProps<StackProps>();\n\ndefineOptions({ name: \"FrescoStack\" });\n\nconst stackStyle = computed<CSSProperties>(() => ({\n flexDirection: direction === \"horizontal\" ? \"row\" : \"column\",\n gap,\n alignItems: stackAlignValues[align],\n justifyContent: stackJustifyValues[justify],\n flexWrap: wrap ? \"wrap\" : \"nowrap\",\n}));\n</script>\n\n<template>\n <div :style=\"stackStyle\"><slot /></div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, type CSSProperties } from \"vue\";\n\nimport { stackAlignValues, stackJustifyValues, type StackProps } from \"./layout-primitive-types.js\";\n\nconst {\n direction = \"vertical\",\n gap = 0,\n align = \"stretch\",\n justify = \"start\",\n wrap = false,\n} = defineProps<StackProps>();\n\ndefineOptions({ name: \"FrescoStack\" });\n\nconst stackStyle = computed<CSSProperties>(() => ({\n flexDirection: direction === \"horizontal\" ? \"row\" : \"column\",\n gap,\n alignItems: stackAlignValues[align],\n justifyContent: stackJustifyValues[justify],\n flexWrap: wrap ? \"wrap\" : \"nowrap\",\n}));\n</script>\n\n<template>\n <div :style=\"stackStyle\"><slot /></div>\n</template>\n","<script setup lang=\"ts\">\nimport FrescoStack from \"./FrescoStack.vue\";\nimport type { ConvenienceStackProps } from \"./layout-primitive-types.js\";\n\nconst { gap = 1, align, justify } = defineProps<ConvenienceStackProps>();\n\ndefineOptions({ name: \"FrescoHStack\" });\n</script>\n\n<template>\n <FrescoStack direction=\"horizontal\" :gap :align :justify><slot /></FrescoStack>\n</template>\n","<script setup lang=\"ts\">\nimport FrescoStack from \"./FrescoStack.vue\";\nimport type { ConvenienceStackProps } from \"./layout-primitive-types.js\";\n\nconst { gap = 1, align, justify } = defineProps<ConvenienceStackProps>();\n\ndefineOptions({ name: \"FrescoHStack\" });\n</script>\n\n<template>\n <FrescoStack direction=\"horizontal\" :gap :align :justify><slot /></FrescoStack>\n</template>\n","<script setup lang=\"ts\">\nimport FrescoStack from \"./FrescoStack.vue\";\nimport type { ConvenienceStackProps } from \"./layout-primitive-types.js\";\n\nconst { gap = 0, align, justify } = defineProps<ConvenienceStackProps>();\n\ndefineOptions({ name: \"FrescoVStack\" });\n</script>\n\n<template>\n <FrescoStack direction=\"vertical\" :gap :align :justify><slot /></FrescoStack>\n</template>\n","<script setup lang=\"ts\">\nimport FrescoStack from \"./FrescoStack.vue\";\nimport type { ConvenienceStackProps } from \"./layout-primitive-types.js\";\n\nconst { gap = 0, align, justify } = defineProps<ConvenienceStackProps>();\n\ndefineOptions({ name: \"FrescoVStack\" });\n</script>\n\n<template>\n <FrescoStack direction=\"vertical\" :gap :align :justify><slot /></FrescoStack>\n</template>\n","/**\n * Grid Component - Grid layout helper\n */\n\nimport { defineComponent, h, type VNode } from \"vue\";\n\nexport interface GridProps {\n /** Number of columns */\n columns?: number;\n /** Gap between cells */\n gap?: number;\n /** Row gap */\n rowGap?: number;\n /** Column gap */\n columnGap?: number;\n}\n\nexport const Grid = defineComponent({\n name: \"Grid\",\n props: {\n columns: {\n type: Number,\n default: 2,\n },\n gap: {\n type: Number,\n default: 1,\n },\n rowGap: Number,\n columnGap: Number,\n },\n setup(props, { slots }) {\n return () => {\n const children = slots.default?.() ?? [];\n const flatChildren = Array.isArray(children) ? children.flat() : [children];\n\n const rows: VNode[][] = [];\n let currentRow: VNode[] = [];\n\n flatChildren.forEach((child, index) => {\n currentRow.push(child);\n if (currentRow.length === props.columns || index === flatChildren.length - 1) {\n rows.push([...currentRow]);\n currentRow = [];\n }\n });\n\n const rowGap = props.rowGap ?? props.gap;\n const columnGap = props.columnGap ?? props.gap;\n\n return h(\n \"box\",\n {\n style: {\n flex_direction: \"column\",\n gap: rowGap,\n },\n },\n rows.map((row, rowIndex) =>\n h(\n \"box\",\n {\n key: `row-${rowIndex}`,\n style: {\n flex_direction: \"row\",\n gap: columnGap,\n },\n },\n row.map((cell, cellIndex) =>\n h(\n \"box\",\n {\n key: `cell-${rowIndex}-${cellIndex}`,\n style: { flex_grow: 1 },\n },\n [cell],\n ),\n ),\n ),\n ),\n );\n };\n },\n});\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\nimport type { CardProps } from \"./presentational-primitive-types.js\";\n\nconst {\n title,\n subtitle,\n footer,\n border = \"rounded\",\n padding = 1,\n titleFg = \"white\",\n borderFg,\n bg,\n} = defineProps<CardProps>();\n\ndefineOptions({ name: \"FrescoCard\" });\n\nconst slots = defineSlots<{\n default?(): unknown;\n footer?(): unknown;\n}>();\nconst hasHeader = computed(() => Boolean(title || subtitle));\nconst hasFooter = computed(() => Boolean(footer || slots.footer));\nconst containerStyle = computed(() => ({ flexDirection: \"column\" as const, padding }));\nconst headerStyle = { flexDirection: \"row\", marginBottom: 1 } as const;\nconst contentStyle = { flexGrow: 1 } as const;\nconst footerStyle = { marginTop: 1 } as const;\nconst subtitleLabel = computed(() => (subtitle ? (title ? ` - ${subtitle}` : subtitle) : \"\"));\n</script>\n\n<template>\n <div :border=\"border === 'none' ? undefined : border\" :fg=\"borderFg\" :bg :style=\"containerStyle\">\n <div v-if=\"hasHeader\" :style=\"headerStyle\">\n <text v-if=\"title\" :fg=\"titleFg\" :bold=\"true\">{{ title }}</text>\n <text v-if=\"subtitle\" :dim=\"true\">{{ subtitleLabel }}</text>\n </div>\n <div :style=\"contentStyle\"><slot /></div>\n <div v-if=\"hasFooter\" :style=\"footerStyle\">\n <slot name=\"footer\"\n ><text :dim=\"true\">{{ footer }}</text></slot\n >\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\nimport type { CardProps } from \"./presentational-primitive-types.js\";\n\nconst {\n title,\n subtitle,\n footer,\n border = \"rounded\",\n padding = 1,\n titleFg = \"white\",\n borderFg,\n bg,\n} = defineProps<CardProps>();\n\ndefineOptions({ name: \"FrescoCard\" });\n\nconst slots = defineSlots<{\n default?(): unknown;\n footer?(): unknown;\n}>();\nconst hasHeader = computed(() => Boolean(title || subtitle));\nconst hasFooter = computed(() => Boolean(footer || slots.footer));\nconst containerStyle = computed(() => ({ flexDirection: \"column\" as const, padding }));\nconst headerStyle = { flexDirection: \"row\", marginBottom: 1 } as const;\nconst contentStyle = { flexGrow: 1 } as const;\nconst footerStyle = { marginTop: 1 } as const;\nconst subtitleLabel = computed(() => (subtitle ? (title ? ` - ${subtitle}` : subtitle) : \"\"));\n</script>\n\n<template>\n <div :border=\"border === 'none' ? undefined : border\" :fg=\"borderFg\" :bg :style=\"containerStyle\">\n <div v-if=\"hasHeader\" :style=\"headerStyle\">\n <text v-if=\"title\" :fg=\"titleFg\" :bold=\"true\">{{ title }}</text>\n <text v-if=\"subtitle\" :dim=\"true\">{{ subtitleLabel }}</text>\n </div>\n <div :style=\"contentStyle\"><slot /></div>\n <div v-if=\"hasFooter\" :style=\"footerStyle\">\n <slot name=\"footer\"\n ><text :dim=\"true\">{{ footer }}</text></slot\n >\n </div>\n </div>\n</template>\n","/**\n * Unicode-aware text helpers shared by input and text components.\n */\n\nconst segmenter =\n typeof Intl !== \"undefined\" && \"Segmenter\" in Intl\n ? new Intl.Segmenter(undefined, { granularity: \"grapheme\" })\n : null;\n\nexport function graphemes(value: string): string[] {\n if (!value) return [];\n\n if (segmenter) {\n return Array.from(segmenter.segment(value), (segment) => segment.segment);\n }\n\n return Array.from(value);\n}\n\nexport function graphemeLength(value: string): number {\n return graphemes(value).length;\n}\n\nexport function sliceGraphemes(value: string, start: number, end?: number): string {\n return graphemes(value).slice(start, end).join(\"\");\n}\n\nexport function insertAtGrapheme(value: string, index: number, text: string): string {\n return `${sliceGraphemes(value, 0, index)}${text}${sliceGraphemes(value, index)}`;\n}\n\nexport function deleteGraphemeBefore(value: string, index: number): string {\n if (index <= 0) return value;\n return `${sliceGraphemes(value, 0, index - 1)}${sliceGraphemes(value, index)}`;\n}\n\nexport function deleteGraphemeAt(value: string, index: number): string {\n const length = graphemeLength(value);\n if (index < 0 || index >= length) return value;\n return `${sliceGraphemes(value, 0, index)}${sliceGraphemes(value, index + 1)}`;\n}\n\nexport function stringifyChildren(children: unknown): string {\n if (children == null || typeof children === \"boolean\") return \"\";\n if (typeof children === \"string\" || typeof children === \"number\") return String(children);\n if (Array.isArray(children)) return children.map((child) => stringifyChildren(child)).join(\"\");\n\n if (typeof children === \"object\") {\n const vnode = children as {\n children?: unknown;\n props?: Record<string, unknown> | null;\n type?: { name?: string } | string;\n };\n const typeName = typeof vnode.type === \"string\" ? vnode.type : vnode.type?.name;\n\n if (typeName === \"Newline\") {\n const count = typeof vnode.props?.count === \"number\" ? vnode.props.count : 1;\n return \"\\n\".repeat(Math.max(0, count));\n }\n\n if (typeof vnode.props?.text === \"string\" || typeof vnode.props?.text === \"number\") {\n return String(vnode.props.text);\n }\n\n if (typeof vnode.props?.content === \"string\" || typeof vnode.props?.content === \"number\") {\n return String(vnode.props.content);\n }\n\n return stringifyChildren(vnode.children);\n }\n\n return \"\";\n}\n","/* eslint-disable script/one-component-per-file -- this module defines more than one component */\n/**\n * Text Component - Text display\n */\n\nimport { defineComponent, h, type PropType } from \"vue\";\nimport { useIsScreenReaderEnabled } from \"../composables/useIsScreenReaderEnabled.js\";\nimport type { FrescoAppearance } from \"../protocol.js\";\nimport { stringifyChildren } from \"../utils/text.js\";\n\nexport type TextWrap =\n | boolean\n | \"wrap\"\n | \"hard\"\n | \"truncate\"\n | \"truncate-start\"\n | \"truncate-middle\"\n | \"truncate-end\"\n | \"end\"\n | \"middle\";\n\nexport interface TextProps extends FrescoAppearance {\n /** Text content (alternative to slot) */\n content?: string;\n /** Ink-compatible text wrapping/truncation mode */\n wrap?: TextWrap;\n /** Foreground color (Ink alias) */\n color?: string;\n /** Background color (Ink alias) */\n backgroundColor?: string;\n /** Dim text (Ink alias) */\n dimColor?: boolean;\n /** Accessibility label, accepted for Ink API parity */\n \"aria-label\"?: string;\n /** Hide from screen readers, accepted for Ink API parity */\n \"aria-hidden\"?: boolean;\n}\n\nexport const Text = defineComponent({\n name: \"Text\",\n props: {\n content: String,\n wrap: [Boolean, String] as PropType<TextProps[\"wrap\"]>,\n fg: String,\n color: String,\n bg: String,\n backgroundColor: String,\n bold: Boolean,\n dim: Boolean,\n dimColor: Boolean,\n italic: Boolean,\n underline: Boolean,\n strikethrough: Boolean,\n inverse: Boolean,\n blink: Boolean,\n hidden: Boolean,\n // Declared camelCase so the runtime props object (which Vue camelizes)\n // matches these keys; templates and h() may still pass \"aria-label\" etc.\n ariaLabel: String,\n ariaHidden: Boolean,\n },\n setup(props, { slots }) {\n const isScreenReaderEnabled = useIsScreenReaderEnabled();\n\n return () => {\n if (isScreenReaderEnabled && props.ariaHidden) return null;\n\n const text =\n isScreenReaderEnabled && props.ariaLabel\n ? props.ariaLabel\n : (props.content ?? stringifyChildren(slots.default?.()));\n\n return h(\"text\", {\n text,\n wrap: props.wrap,\n fg: props.fg ?? props.color,\n bg: props.bg ?? props.backgroundColor,\n bold: props.bold,\n dim: props.dim || props.dimColor,\n italic: props.italic,\n underline: props.underline,\n strikethrough: props.strikethrough,\n inverse: props.inverse,\n ...(props.blink ? { blink: true } : {}),\n ...(props.hidden ? { hidden: true } : {}),\n \"aria-label\": props.ariaLabel,\n \"aria-hidden\": props.ariaHidden,\n });\n };\n },\n});\n\n/**\n * Convenience components for common text styles\n */\n\nexport const ErrorText = defineComponent({\n name: \"ErrorText\",\n props: {\n content: String,\n },\n setup(props, { slots }) {\n return () => h(Text, { fg: \"red\", ...props }, slots);\n },\n});\n\nexport const WarningText = defineComponent({\n name: \"WarningText\",\n props: {\n content: String,\n },\n setup(props, { slots }) {\n return () => h(Text, { fg: \"yellow\", ...props }, slots);\n },\n});\n\nexport const SuccessText = defineComponent({\n name: \"SuccessText\",\n props: {\n content: String,\n },\n setup(props, { slots }) {\n return () => h(Text, { fg: \"green\", ...props }, slots);\n },\n});\n\nexport const InfoText = defineComponent({\n name: \"InfoText\",\n props: {\n content: String,\n },\n setup(props, { slots }) {\n return () => h(Text, { fg: \"blue\", ...props }, slots);\n },\n});\n\nexport const MutedText = defineComponent({\n name: \"MutedText\",\n props: {\n content: String,\n },\n setup(props, { slots }) {\n return () => h(Text, { dim: true, ...props }, slots);\n },\n});\n","<script setup lang=\"ts\">\nimport { computed, ref, useTemplateRef, watch } from \"vue\";\n\nimport { useMouse } from \"../composables/useMouse.js\";\nimport { getLastRenderLayout, type DOMElement } from \"../layoutMetrics.js\";\nimport type { MouseEvent } from \"../protocol.js\";\nimport { Box } from \"./Box.js\";\nimport { Text } from \"./Text.js\";\nimport type { ScrollBarProps } from \"./scroll-types.js\";\n\nconst {\n itemCount,\n viewportSize,\n offset,\n length,\n orientation = \"vertical\",\n track = \"│\",\n thumb = \"█\",\n fg,\n thumbFg,\n disabled = false,\n} = defineProps<ScrollBarProps>();\n\nconst emit = defineEmits<{\n \"update:offset\": [offset: number];\n}>();\n\nconst root = useTemplateRef<DOMElement>(\"root\");\nconst dragGrabOffset = ref<number | null>(null);\n\nwatch(\n () => disabled,\n (value) => {\n if (value) dragGrabOffset.value = null;\n },\n);\n\nfunction nonNegativeInteger(value: number): number {\n const floored = Math.floor(value);\n return Number.isSafeInteger(floored) && floored >= 0 ? floored : 0;\n}\n\nconst metrics = computed(() => {\n const trackLength = nonNegativeInteger(length ?? viewportSize);\n const boundedViewportSize = nonNegativeInteger(viewportSize);\n const boundedItemCount = nonNegativeInteger(itemCount);\n const maxOffset = Math.max(0, boundedItemCount - boundedViewportSize);\n const boundedOffset = Number.isFinite(offset) ? Math.min(maxOffset, Math.max(0, offset)) : 0;\n const thumbSize =\n maxOffset === 0\n ? trackLength\n : Math.max(\n 1,\n Math.min(trackLength, Math.floor((trackLength * boundedViewportSize) / boundedItemCount)),\n );\n const travel = trackLength - thumbSize;\n const thumbStart = maxOffset === 0 ? 0 : Math.round((boundedOffset / maxOffset) * travel);\n return {\n trackLength,\n boundedViewportSize,\n boundedItemCount,\n maxOffset,\n boundedOffset,\n thumbSize,\n travel,\n thumbStart,\n };\n});\n\nconst cells = computed(() => {\n const { trackLength, thumbSize, thumbStart } = metrics.value;\n if (trackLength === 0) return [];\n return Array.from({ length: trackLength }, (_, position) => ({\n position,\n symbol: position >= thumbStart && position < thumbStart + thumbSize ? thumb : track,\n thumb: position >= thumbStart && position < thumbStart + thumbSize,\n }));\n});\n\nconst ariaState = computed(() => ({\n orientation,\n valueMin: 0,\n valueMax: metrics.value.maxOffset,\n valueNow: metrics.value.boundedOffset,\n disabled,\n}));\nconst accessibilityProps = computed(() => ({\n ariaRole: \"scrollbar\" as const,\n ariaState: ariaState.value,\n}));\nconst cellAccessibilityProps = { ariaHidden: true } as const;\n\nfunction pointerPosition(event: MouseEvent, allowOutsideTrack: boolean): number | undefined {\n const layout = getLastRenderLayout(root.value);\n if (!layout) return undefined;\n\n const along = orientation === \"vertical\" ? event.y - layout.y : event.x - layout.x;\n const across = orientation === \"vertical\" ? event.x - layout.x : event.y - layout.y;\n const acrossSize = orientation === \"vertical\" ? layout.width : layout.height;\n if (!allowOutsideTrack && (across < 0 || across >= acrossSize)) return undefined;\n if (!allowOutsideTrack && (along < 0 || along >= metrics.value.trackLength)) return undefined;\n return along;\n}\n\nfunction offsetAt(pointer: number, grabOffset: number): number {\n const { maxOffset, travel } = metrics.value;\n if (maxOffset === 0 || travel === 0) return 0;\n const thumbStart = Math.min(travel, Math.max(0, pointer - grabOffset));\n return Math.round((thumbStart / travel) * maxOffset);\n}\n\nfunction publishPointerOffset(pointer: number, grabOffset: number): void {\n const { travel, thumbStart, boundedOffset } = metrics.value;\n const targetStart = Math.min(travel, Math.max(0, pointer - grabOffset));\n if (targetStart === thumbStart) return;\n const nextOffset = offsetAt(pointer, grabOffset);\n if (nextOffset !== boundedOffset) emit(\"update:offset\", nextOffset);\n}\n\nuseMouse(\n (event) => {\n if (disabled) {\n dragGrabOffset.value = null;\n return;\n }\n if (event.kind === \"up\") {\n dragGrabOffset.value = null;\n return;\n }\n if (event.button !== \"left\") return;\n\n if (event.kind === \"down\") {\n const pointer = pointerPosition(event, false);\n if (pointer === undefined) {\n dragGrabOffset.value = null;\n return;\n }\n const { thumbStart, thumbSize } = metrics.value;\n const insideThumb = pointer >= thumbStart && pointer < thumbStart + thumbSize;\n const grabOffset = insideThumb ? pointer - thumbStart : Math.floor(thumbSize / 2);\n dragGrabOffset.value = grabOffset;\n publishPointerOffset(pointer, grabOffset);\n return;\n }\n\n if (event.kind === \"drag\" && dragGrabOffset.value !== null) {\n const pointer = pointerPosition(event, true);\n if (pointer !== undefined) publishPointerOffset(pointer, dragGrabOffset.value);\n return;\n }\n },\n { isActive: computed(() => !disabled) },\n);\n</script>\n\n<template>\n <Box\n ref=\"root\"\n :flex-direction=\"orientation === 'vertical' ? 'column' : 'row'\"\n v-bind=\"accessibilityProps\"\n >\n <Text\n v-for=\"cell in cells\"\n :key=\"cell.position\"\n :content=\"cell.symbol\"\n :fg=\"cell.thumb ? (thumbFg ?? fg) : fg\"\n v-bind=\"cellAccessibilityProps\"\n />\n </Box>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref, useTemplateRef, watch } from \"vue\";\n\nimport { useMouse } from \"../composables/useMouse.js\";\nimport { getLastRenderLayout, type DOMElement } from \"../layoutMetrics.js\";\nimport type { MouseEvent } from \"../protocol.js\";\nimport { Box } from \"./Box.js\";\nimport { Text } from \"./Text.js\";\nimport type { ScrollBarProps } from \"./scroll-types.js\";\n\nconst {\n itemCount,\n viewportSize,\n offset,\n length,\n orientation = \"vertical\",\n track = \"│\",\n thumb = \"█\",\n fg,\n thumbFg,\n disabled = false,\n} = defineProps<ScrollBarProps>();\n\nconst emit = defineEmits<{\n \"update:offset\": [offset: number];\n}>();\n\nconst root = useTemplateRef<DOMElement>(\"root\");\nconst dragGrabOffset = ref<number | null>(null);\n\nwatch(\n () => disabled,\n (value) => {\n if (value) dragGrabOffset.value = null;\n },\n);\n\nfunction nonNegativeInteger(value: number): number {\n const floored = Math.floor(value);\n return Number.isSafeInteger(floored) && floored >= 0 ? floored : 0;\n}\n\nconst metrics = computed(() => {\n const trackLength = nonNegativeInteger(length ?? viewportSize);\n const boundedViewportSize = nonNegativeInteger(viewportSize);\n const boundedItemCount = nonNegativeInteger(itemCount);\n const maxOffset = Math.max(0, boundedItemCount - boundedViewportSize);\n const boundedOffset = Number.isFinite(offset) ? Math.min(maxOffset, Math.max(0, offset)) : 0;\n const thumbSize =\n maxOffset === 0\n ? trackLength\n : Math.max(\n 1,\n Math.min(trackLength, Math.floor((trackLength * boundedViewportSize) / boundedItemCount)),\n );\n const travel = trackLength - thumbSize;\n const thumbStart = maxOffset === 0 ? 0 : Math.round((boundedOffset / maxOffset) * travel);\n return {\n trackLength,\n boundedViewportSize,\n boundedItemCount,\n maxOffset,\n boundedOffset,\n thumbSize,\n travel,\n thumbStart,\n };\n});\n\nconst cells = computed(() => {\n const { trackLength, thumbSize, thumbStart } = metrics.value;\n if (trackLength === 0) return [];\n return Array.from({ length: trackLength }, (_, position) => ({\n position,\n symbol: position >= thumbStart && position < thumbStart + thumbSize ? thumb : track,\n thumb: position >= thumbStart && position < thumbStart + thumbSize,\n }));\n});\n\nconst ariaState = computed(() => ({\n orientation,\n valueMin: 0,\n valueMax: metrics.value.maxOffset,\n valueNow: metrics.value.boundedOffset,\n disabled,\n}));\nconst accessibilityProps = computed(() => ({\n ariaRole: \"scrollbar\" as const,\n ariaState: ariaState.value,\n}));\nconst cellAccessibilityProps = { ariaHidden: true } as const;\n\nfunction pointerPosition(event: MouseEvent, allowOutsideTrack: boolean): number | undefined {\n const layout = getLastRenderLayout(root.value);\n if (!layout) return undefined;\n\n const along = orientation === \"vertical\" ? event.y - layout.y : event.x - layout.x;\n const across = orientation === \"vertical\" ? event.x - layout.x : event.y - layout.y;\n const acrossSize = orientation === \"vertical\" ? layout.width : layout.height;\n if (!allowOutsideTrack && (across < 0 || across >= acrossSize)) return undefined;\n if (!allowOutsideTrack && (along < 0 || along >= metrics.value.trackLength)) return undefined;\n return along;\n}\n\nfunction offsetAt(pointer: number, grabOffset: number): number {\n const { maxOffset, travel } = metrics.value;\n if (maxOffset === 0 || travel === 0) return 0;\n const thumbStart = Math.min(travel, Math.max(0, pointer - grabOffset));\n return Math.round((thumbStart / travel) * maxOffset);\n}\n\nfunction publishPointerOffset(pointer: number, grabOffset: number): void {\n const { travel, thumbStart, boundedOffset } = metrics.value;\n const targetStart = Math.min(travel, Math.max(0, pointer - grabOffset));\n if (targetStart === thumbStart) return;\n const nextOffset = offsetAt(pointer, grabOffset);\n if (nextOffset !== boundedOffset) emit(\"update:offset\", nextOffset);\n}\n\nuseMouse(\n (event) => {\n if (disabled) {\n dragGrabOffset.value = null;\n return;\n }\n if (event.kind === \"up\") {\n dragGrabOffset.value = null;\n return;\n }\n if (event.button !== \"left\") return;\n\n if (event.kind === \"down\") {\n const pointer = pointerPosition(event, false);\n if (pointer === undefined) {\n dragGrabOffset.value = null;\n return;\n }\n const { thumbStart, thumbSize } = metrics.value;\n const insideThumb = pointer >= thumbStart && pointer < thumbStart + thumbSize;\n const grabOffset = insideThumb ? pointer - thumbStart : Math.floor(thumbSize / 2);\n dragGrabOffset.value = grabOffset;\n publishPointerOffset(pointer, grabOffset);\n return;\n }\n\n if (event.kind === \"drag\" && dragGrabOffset.value !== null) {\n const pointer = pointerPosition(event, true);\n if (pointer !== undefined) publishPointerOffset(pointer, dragGrabOffset.value);\n return;\n }\n },\n { isActive: computed(() => !disabled) },\n);\n</script>\n\n<template>\n <Box\n ref=\"root\"\n :flex-direction=\"orientation === 'vertical' ? 'column' : 'row'\"\n v-bind=\"accessibilityProps\"\n >\n <Text\n v-for=\"cell in cells\"\n :key=\"cell.position\"\n :content=\"cell.symbol\"\n :fg=\"cell.thumb ? (thumbFg ?? fg) : fg\"\n v-bind=\"cellAccessibilityProps\"\n />\n </Box>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, watch } from \"vue\";\n\nimport { useInput } from \"../composables/useInput.js\";\nimport { useMouse } from \"../composables/useMouse.js\";\nimport {\n createVirtualViewport,\n type VirtualScrollAlignment,\n type VirtualViewportRange,\n} from \"../composables/useVirtualViewport.js\";\nimport { Box } from \"./Box.js\";\nimport ScrollBar from \"./ScrollBar.vue\";\nimport type { ScrollBoxExposed, ScrollBoxItemSlot, ScrollBoxProps } from \"./scroll-types.js\";\n\nconst {\n itemCount,\n viewportSize,\n modelValue,\n overscan = 2,\n focused = false,\n disabled = false,\n wheelStep = 3,\n showScrollbar = true,\n followOutput = false,\n scrollbarTrack = \"│\",\n scrollbarThumb = \"█\",\n} = defineProps<ScrollBoxProps>();\n\nconst emit = defineEmits<{\n \"update:modelValue\": [offset: number];\n \"scroll\": [range: VirtualViewportRange];\n}>();\n\ndefineSlots<{\n /** Rows retained by the virtual viewport. */\n default(props: ScrollBoxItemSlot): unknown;\n /** Content kept mounted before the viewport. */\n start(): unknown;\n /** Content kept mounted after the viewport. */\n end(): unknown;\n}>();\n\nconst viewport = createVirtualViewport({\n itemCount,\n viewportSize,\n overscan,\n initialOffset: modelValue ?? 0,\n});\nconst isActive = computed(() => focused && !disabled);\nconst normalizedWheelStep = computed(() => {\n const truncated = Math.trunc(wheelStep);\n return Number.isSafeInteger(truncated) && truncated > 0 ? truncated : 1;\n});\nconst retainedIndexes = computed(() => {\n const range = viewport.range.value;\n return Array.from(\n { length: range.overscanEnd - range.overscanStart },\n (_, index) => range.overscanStart + index,\n );\n});\nconst rootAriaState = computed(() => ({\n disabled,\n}));\nconst rootAccessibilityProps = computed(() => ({\n ariaRole: \"list\" as const,\n ariaState: rootAriaState.value,\n}));\n\nfunction publish(changed: boolean): boolean {\n if (!changed) return false;\n emit(\"update:modelValue\", viewport.offset.value);\n emit(\"scroll\", viewport.range.value);\n return true;\n}\n\nfunction scrollTo(offset: number): boolean {\n return publish(viewport.scrollTo(offset));\n}\n\nfunction scrollBy(delta: number): boolean {\n return publish(viewport.scrollBy(delta));\n}\n\nfunction scrollIntoView(index: number, alignment: VirtualScrollAlignment = \"nearest\"): boolean {\n return publish(viewport.scrollIntoView(index, alignment));\n}\n\nfunction isVisible(index: number): boolean {\n const range = viewport.range.value;\n return index >= range.visibleStart && index < range.visibleEnd;\n}\n\nfunction itemSlot(index: number): ScrollBoxItemSlot {\n return { ...viewport.range.value, index, visible: isVisible(index) };\n}\n\nwatch(\n [() => itemCount, () => viewportSize, () => modelValue],\n (\n [itemCount, viewportSize, modelValue],\n [previousItemCount, previousViewportSize, previousModelValue],\n ) => {\n const itemCountChanged = itemCount !== previousItemCount;\n const viewportSizeChanged = viewportSize !== previousViewportSize;\n const modelValueChanged = modelValue !== previousModelValue;\n const followedEnd = itemCountChanged && followOutput && viewport.atEnd.value;\n const previousOffset = viewport.offset.value;\n\n if (itemCountChanged) viewport.setItemCount(itemCount);\n if (viewportSizeChanged) viewport.setViewportSize(viewportSize);\n if (followedEnd && !modelValueChanged) viewport.scrollTo(viewport.maxOffset.value);\n if (\n modelValue !== undefined &&\n (modelValueChanged || ((itemCountChanged || viewportSizeChanged) && !followedEnd))\n ) {\n viewport.scrollTo(modelValue);\n }\n\n const offsetChanged = previousOffset !== viewport.offset.value;\n const requestedOffsetWasClamped =\n modelValue !== undefined && modelValue !== viewport.offset.value;\n if (requestedOffsetWasClamped || (offsetChanged && !modelValueChanged)) {\n emit(\"update:modelValue\", viewport.offset.value);\n }\n if (offsetChanged && (itemCountChanged || viewportSizeChanged || requestedOffsetWasClamped)) {\n emit(\"scroll\", viewport.range.value);\n }\n },\n);\nwatch(\n () => overscan,\n (value) => viewport.setOverscan(value),\n);\n\nuseInput(\n (_input, key) => {\n if (key.eventType === \"release\") return;\n if (key.upArrow) scrollBy(-1);\n else if (key.downArrow) scrollBy(1);\n else if (key.pageUp) scrollBy(-Math.max(1, viewportSize - 1));\n else if (key.pageDown) scrollBy(Math.max(1, viewportSize - 1));\n else if (key.home) scrollTo(0);\n else if (key.end) scrollTo(viewport.maxOffset.value);\n },\n { isActive },\n);\nuseMouse(\n (event) => {\n if (event.kind === \"scroll-up\") scrollBy(-normalizedWheelStep.value);\n else if (event.kind === \"scroll-down\") scrollBy(normalizedWheelStep.value);\n },\n { isActive },\n);\n\nconst exposed: ScrollBoxExposed = {\n scrollTo,\n scrollBy,\n scrollIntoView,\n range: () => viewport.range.value,\n};\ndefineExpose(exposed);\n</script>\n\n<template>\n <Box flex-direction=\"column\" v-bind=\"rootAccessibilityProps\">\n <slot name=\"start\" />\n <Box :flex-direction=\"showScrollbar ? 'row' : 'column'\">\n <Box flex-direction=\"column\" :height=\"viewportSize\" overflow=\"hidden\">\n <Box\n v-for=\"index in retainedIndexes\"\n :key=\"index\"\n :display=\"isVisible(index) ? 'flex' : 'none'\"\n :aria-hidden=\"!isVisible(index)\"\n :data-scroll-index=\"index\"\n >\n <slot v-bind=\"itemSlot(index)\" />\n </Box>\n </Box>\n <ScrollBar\n v-if=\"showScrollbar && itemCount > viewportSize\"\n :item-count\n :viewport-size\n :offset=\"viewport.offset.value\"\n :track=\"scrollbarTrack\"\n :thumb=\"scrollbarThumb\"\n :disabled\n @update:offset=\"scrollTo\"\n />\n </Box>\n <slot name=\"end\" />\n </Box>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, watch } from \"vue\";\n\nimport { useInput } from \"../composables/useInput.js\";\nimport { useMouse } from \"../composables/useMouse.js\";\nimport {\n createVirtualViewport,\n type VirtualScrollAlignment,\n type VirtualViewportRange,\n} from \"../composables/useVirtualViewport.js\";\nimport { Box } from \"./Box.js\";\nimport ScrollBar from \"./ScrollBar.vue\";\nimport type { ScrollBoxExposed, ScrollBoxItemSlot, ScrollBoxProps } from \"./scroll-types.js\";\n\nconst {\n itemCount,\n viewportSize,\n modelValue,\n overscan = 2,\n focused = false,\n disabled = false,\n wheelStep = 3,\n showScrollbar = true,\n followOutput = false,\n scrollbarTrack = \"│\",\n scrollbarThumb = \"█\",\n} = defineProps<ScrollBoxProps>();\n\nconst emit = defineEmits<{\n \"update:modelValue\": [offset: number];\n \"scroll\": [range: VirtualViewportRange];\n}>();\n\ndefineSlots<{\n /** Rows retained by the virtual viewport. */\n default(props: ScrollBoxItemSlot): unknown;\n /** Content kept mounted before the viewport. */\n start(): unknown;\n /** Content kept mounted after the viewport. */\n end(): unknown;\n}>();\n\nconst viewport = createVirtualViewport({\n itemCount,\n viewportSize,\n overscan,\n initialOffset: modelValue ?? 0,\n});\nconst isActive = computed(() => focused && !disabled);\nconst normalizedWheelStep = computed(() => {\n const truncated = Math.trunc(wheelStep);\n return Number.isSafeInteger(truncated) && truncated > 0 ? truncated : 1;\n});\nconst retainedIndexes = computed(() => {\n const range = viewport.range.value;\n return Array.from(\n { length: range.overscanEnd - range.overscanStart },\n (_, index) => range.overscanStart + index,\n );\n});\nconst rootAriaState = computed(() => ({\n disabled,\n}));\nconst rootAccessibilityProps = computed(() => ({\n ariaRole: \"list\" as const,\n ariaState: rootAriaState.value,\n}));\n\nfunction publish(changed: boolean): boolean {\n if (!changed) return false;\n emit(\"update:modelValue\", viewport.offset.value);\n emit(\"scroll\", viewport.range.value);\n return true;\n}\n\nfunction scrollTo(offset: number): boolean {\n return publish(viewport.scrollTo(offset));\n}\n\nfunction scrollBy(delta: number): boolean {\n return publish(viewport.scrollBy(delta));\n}\n\nfunction scrollIntoView(index: number, alignment: VirtualScrollAlignment = \"nearest\"): boolean {\n return publish(viewport.scrollIntoView(index, alignment));\n}\n\nfunction isVisible(index: number): boolean {\n const range = viewport.range.value;\n return index >= range.visibleStart && index < range.visibleEnd;\n}\n\nfunction itemSlot(index: number): ScrollBoxItemSlot {\n return { ...viewport.range.value, index, visible: isVisible(index) };\n}\n\nwatch(\n [() => itemCount, () => viewportSize, () => modelValue],\n (\n [itemCount, viewportSize, modelValue],\n [previousItemCount, previousViewportSize, previousModelValue],\n ) => {\n const itemCountChanged = itemCount !== previousItemCount;\n const viewportSizeChanged = viewportSize !== previousViewportSize;\n const modelValueChanged = modelValue !== previousModelValue;\n const followedEnd = itemCountChanged && followOutput && viewport.atEnd.value;\n const previousOffset = viewport.offset.value;\n\n if (itemCountChanged) viewport.setItemCount(itemCount);\n if (viewportSizeChanged) viewport.setViewportSize(viewportSize);\n if (followedEnd && !modelValueChanged) viewport.scrollTo(viewport.maxOffset.value);\n if (\n modelValue !== undefined &&\n (modelValueChanged || ((itemCountChanged || viewportSizeChanged) && !followedEnd))\n ) {\n viewport.scrollTo(modelValue);\n }\n\n const offsetChanged = previousOffset !== viewport.offset.value;\n const requestedOffsetWasClamped =\n modelValue !== undefined && modelValue !== viewport.offset.value;\n if (requestedOffsetWasClamped || (offsetChanged && !modelValueChanged)) {\n emit(\"update:modelValue\", viewport.offset.value);\n }\n if (offsetChanged && (itemCountChanged || viewportSizeChanged || requestedOffsetWasClamped)) {\n emit(\"scroll\", viewport.range.value);\n }\n },\n);\nwatch(\n () => overscan,\n (value) => viewport.setOverscan(value),\n);\n\nuseInput(\n (_input, key) => {\n if (key.eventType === \"release\") return;\n if (key.upArrow) scrollBy(-1);\n else if (key.downArrow) scrollBy(1);\n else if (key.pageUp) scrollBy(-Math.max(1, viewportSize - 1));\n else if (key.pageDown) scrollBy(Math.max(1, viewportSize - 1));\n else if (key.home) scrollTo(0);\n else if (key.end) scrollTo(viewport.maxOffset.value);\n },\n { isActive },\n);\nuseMouse(\n (event) => {\n if (event.kind === \"scroll-up\") scrollBy(-normalizedWheelStep.value);\n else if (event.kind === \"scroll-down\") scrollBy(normalizedWheelStep.value);\n },\n { isActive },\n);\n\nconst exposed: ScrollBoxExposed = {\n scrollTo,\n scrollBy,\n scrollIntoView,\n range: () => viewport.range.value,\n};\ndefineExpose(exposed);\n</script>\n\n<template>\n <Box flex-direction=\"column\" v-bind=\"rootAccessibilityProps\">\n <slot name=\"start\" />\n <Box :flex-direction=\"showScrollbar ? 'row' : 'column'\">\n <Box flex-direction=\"column\" :height=\"viewportSize\" overflow=\"hidden\">\n <Box\n v-for=\"index in retainedIndexes\"\n :key=\"index\"\n :display=\"isVisible(index) ? 'flex' : 'none'\"\n :aria-hidden=\"!isVisible(index)\"\n :data-scroll-index=\"index\"\n >\n <slot v-bind=\"itemSlot(index)\" />\n </Box>\n </Box>\n <ScrollBar\n v-if=\"showScrollbar && itemCount > viewportSize\"\n :item-count\n :viewport-size\n :offset=\"viewport.offset.value\"\n :track=\"scrollbarTrack\"\n :thumb=\"scrollbarThumb\"\n :disabled\n @update:offset=\"scrollTo\"\n />\n </Box>\n <slot name=\"end\" />\n </Box>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\nimport type { NewlineProps } from \"./text-utility-types.js\";\n\nconst { count = 1 } = defineProps<NewlineProps>();\n\ndefineOptions({ name: \"Newline\" });\n\nconst content = computed(() => \"\\n\".repeat(Math.max(0, count)));\n</script>\n\n<template>\n <text :text=\"content\" />\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\nimport type { NewlineProps } from \"./text-utility-types.js\";\n\nconst { count = 1 } = defineProps<NewlineProps>();\n\ndefineOptions({ name: \"Newline\" });\n\nconst content = computed(() => \"\\n\".repeat(Math.max(0, count)));\n</script>\n\n<template>\n <text :text=\"content\" />\n</template>\n","<script setup lang=\"ts\" generic=\"T = unknown\">\nimport { computed } from \"vue\";\n\nimport type { FrescoStyle } from \"../protocol.js\";\n\nconst { items = [], style } = defineProps<{\n items?: T[];\n style?: FrescoStyle;\n}>();\n\ndefineSlots<{\n default?: (props: { item: T; index: number }) => unknown;\n}>();\n\ndefineOptions({ name: \"Static\" });\n\nconst containerStyle = computed(() => ({\n position: \"absolute\" as const,\n flexDirection: \"column\" as const,\n ...style,\n}));\n\nconst itemStyle = { flexDirection: \"column\" } as const;\nconst renderedItems = computed(() =>\n items.map((item, index) => ({ item, index, key: `static-${index}` })),\n);\n</script>\n\n<template>\n <div :internal_static=\"true\" :style=\"containerStyle\">\n <div\n v-for=\"entry in renderedItems\"\n :key=\"entry.key\"\n :internal_static_item=\"true\"\n :style=\"itemStyle\"\n >\n <slot :item=\"entry.item\" :index=\"entry.index\" />\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\" generic=\"T = unknown\">\nimport { computed } from \"vue\";\n\nimport type { FrescoStyle } from \"../protocol.js\";\n\nconst { items = [], style } = defineProps<{\n items?: T[];\n style?: FrescoStyle;\n}>();\n\ndefineSlots<{\n default?: (props: { item: T; index: number }) => unknown;\n}>();\n\ndefineOptions({ name: \"Static\" });\n\nconst containerStyle = computed(() => ({\n position: \"absolute\" as const,\n flexDirection: \"column\" as const,\n ...style,\n}));\n\nconst itemStyle = { flexDirection: \"column\" } as const;\nconst renderedItems = computed(() =>\n items.map((item, index) => ({ item, index, key: `static-${index}` })),\n);\n</script>\n\n<template>\n <div :internal_static=\"true\" :style=\"containerStyle\">\n <div\n v-for=\"entry in renderedItems\"\n :key=\"entry.key\"\n :internal_static_item=\"true\"\n :style=\"itemStyle\"\n >\n <slot :item=\"entry.item\" :index=\"entry.index\" />\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\nimport { useIsScreenReaderEnabled } from \"../composables/useIsScreenReaderEnabled.js\";\nimport { stringifyChildren } from \"../utils/text.js\";\nimport type { TransformProps } from \"./text-utility-types.js\";\n\nconst props = defineProps<TransformProps>();\nconst slots = defineSlots<{ default?: () => unknown }>();\n\ndefineOptions({ name: \"Transform\" });\n\nconst isScreenReaderEnabled = useIsScreenReaderEnabled();\n\nconst content = computed(() => {\n const text = stringifyChildren(slots.default?.());\n return isScreenReaderEnabled && props.accessibilityLabel\n ? props.accessibilityLabel\n : text\n .split(\"\\n\")\n .map((line, index) => props.transform(line, index))\n .join(\"\\n\");\n});\n</script>\n\n<template>\n <text :text=\"content\" :aria-label=\"accessibilityLabel\" />\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\nimport { useIsScreenReaderEnabled } from \"../composables/useIsScreenReaderEnabled.js\";\nimport { stringifyChildren } from \"../utils/text.js\";\nimport type { TransformProps } from \"./text-utility-types.js\";\n\nconst props = defineProps<TransformProps>();\nconst slots = defineSlots<{ default?: () => unknown }>();\n\ndefineOptions({ name: \"Transform\" });\n\nconst isScreenReaderEnabled = useIsScreenReaderEnabled();\n\nconst content = computed(() => {\n const text = stringifyChildren(slots.default?.());\n return isScreenReaderEnabled && props.accessibilityLabel\n ? props.accessibilityLabel\n : text\n .split(\"\\n\")\n .map((line, index) => props.transform(line, index))\n .join(\"\\n\");\n});\n</script>\n\n<template>\n <text :text=\"content\" :aria-label=\"accessibilityLabel\" />\n</template>\n","/**\n * Standalone line-number gutter for code, diagnostics, and diff views.\n */\n\nimport { computed, defineComponent, h } from \"vue\";\n\nexport interface LineNumberProps {\n /** Line number displayed in the gutter. */\n value: number;\n /** Minimum character width reserved for the number. */\n width?: number;\n /** Text placed between the number and its content. */\n separator?: string;\n /** Spaces rendered on each side of the separator. */\n padding?: number;\n /** Default foreground color. */\n fg?: string;\n /** Whether this line is the active line. */\n active?: boolean;\n /** Foreground color used for the active line. */\n activeFg?: string;\n /** Background color used for the active line. */\n activeBg?: string;\n}\n\nfunction normalizeInteger(value: number, minimum: number): number {\n if (!Number.isFinite(value)) return minimum;\n return Math.max(minimum, Math.trunc(value));\n}\n\nexport const LineNumber = defineComponent({\n name: \"LineNumber\",\n props: {\n value: {\n type: Number,\n required: true,\n },\n width: {\n type: Number,\n default: 0,\n },\n separator: {\n type: String,\n default: \"│\",\n },\n padding: {\n type: Number,\n default: 1,\n },\n fg: {\n type: String,\n default: \"gray\",\n },\n active: Boolean,\n activeFg: {\n type: String,\n default: \"white\",\n },\n activeBg: String,\n },\n setup(props) {\n const line = computed(() => (Number.isFinite(props.value) ? Math.trunc(props.value) : 0));\n const text = computed(() => {\n const width = Math.max(normalizeInteger(props.width, 0), String(line.value).length);\n const padding = \" \".repeat(normalizeInteger(props.padding, 0));\n return `${String(line.value).padStart(width)}${padding}${props.separator}${padding}`;\n });\n\n return () =>\n h(\"text\", {\n text: text.value,\n fg: props.active ? props.activeFg : props.fg,\n bg: props.active ? props.activeBg : undefined,\n bold: props.active,\n \"aria-label\": `Line ${line.value}`,\n });\n },\n});\n","import { ref } from \"vue\";\nimport type { CodeBuffer } from \"./code-types.js\";\n\nfunction normalizeLimit(maxLines: number | undefined): number | undefined {\n if (maxLines === undefined || !Number.isFinite(maxLines)) return undefined;\n return Math.max(1, Math.trunc(maxLines));\n}\n\nfunction retainLastLines(content: string, maxLines: number | undefined): string {\n const limit = normalizeLimit(maxLines);\n if (limit === undefined) return content;\n const lines = content.split(\"\\n\");\n return lines.length <= limit ? content : lines.slice(-limit).join(\"\\n\");\n}\n\n/** Create a reactive stream buffer with optional bounded line retention. */\nexport function createCodeBuffer(initial = \"\", options: { maxLines?: number } = {}): CodeBuffer {\n const content = ref(retainLastLines(initial, options.maxLines));\n return {\n content,\n append: (chunk) => {\n content.value = retainLastLines(`${content.value}${chunk}`, options.maxLines);\n },\n replace: (next) => {\n content.value = retainLastLines(next, options.maxLines);\n },\n clear: () => {\n content.value = \"\";\n },\n };\n}\n","/** Bounded code viewer with streaming, selection, diagnostics, and syntax providers. */\n\nimport { computed, defineComponent, h, ref, type PropType, watch } from \"vue\";\nimport { useInput } from \"../composables/useInput.js\";\nimport { graphemes } from \"../utils/text.js\";\nimport { LineNumber } from \"./LineNumber.js\";\nimport type {\n CodeBuffer,\n CodeDiagnostic,\n CodePosition,\n CodeProps,\n CodeSelection,\n CodeSyntaxToken,\n} from \"./code-types.js\";\n\nexport { createCodeBuffer } from \"./code-buffer.js\";\nexport type {\n CodeBuffer,\n CodeDiagnostic,\n CodeDiagnosticSeverity,\n CodePosition,\n CodeProps,\n CodeSelection,\n CodeSyntaxContext,\n CodeSyntaxProvider,\n CodeSyntaxToken,\n} from \"./code-types.js\";\n\nfunction finiteInteger(value: number, fallback = 0): number {\n return Number.isFinite(value) ? Math.trunc(value) : fallback;\n}\n\nfunction comparePositions(left: CodePosition, right: CodePosition): number {\n return left.line === right.line ? left.column - right.column : left.line - right.line;\n}\n\nfunction position(line: number, column: number, lines: readonly string[]): CodePosition {\n const clampedLine = Math.min(Math.max(0, finiteInteger(line)), Math.max(0, lines.length - 1));\n return {\n line: clampedLine,\n column: Math.min(\n Math.max(0, finiteInteger(column)),\n graphemes(lines[clampedLine] ?? \"\").length,\n ),\n };\n}\n\nfunction normalizedSelection(selection: CodeSelection, lines: readonly string[]): CodeSelection {\n return {\n anchor: position(selection.anchor.line, selection.anchor.column, lines),\n focus: position(selection.focus.line, selection.focus.column, lines),\n };\n}\n\nfunction orderedSelection(selection: CodeSelection): readonly [CodePosition, CodePosition] {\n return comparePositions(selection.anchor, selection.focus) <= 0\n ? [selection.anchor, selection.focus]\n : [selection.focus, selection.anchor];\n}\n\nfunction selectedColumns(\n selection: CodeSelection,\n line: number,\n lineLength: number,\n): readonly [number, number] | undefined {\n const [start, end] = orderedSelection(selection);\n if (comparePositions(start, end) === 0 || line < start.line || line > end.line) return undefined;\n const from = line === start.line ? start.column : 0;\n const to = line === end.line ? end.column : lineLength;\n return from < to ? [from, to] : undefined;\n}\n\nfunction tokensForLine(\n line: string,\n lineIndex: number,\n lineNumber: number,\n props: Readonly<CodeProps>,\n): readonly CodeSyntaxToken[] {\n const tokens = props.syntaxProvider?.tokenize(line, {\n language: props.language,\n line: lineIndex,\n lineNumber,\n });\n if (!tokens || tokens.map(({ text }) => text).join(\"\") !== line) return [{ text: line }];\n return tokens;\n}\n\ninterface RenderedCodeSpan extends CodeSyntaxToken {\n readonly selected?: boolean;\n readonly diagnostic?: boolean;\n}\n\nfunction diagnosticAtColumn(diagnostics: readonly CodeDiagnostic[], column: number): boolean {\n return diagnostics.some((diagnostic) => {\n const start = Math.max(0, finiteInteger(diagnostic.startColumn ?? 0));\n const end = Math.max(\n start,\n finiteInteger(diagnostic.endColumn ?? Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER),\n );\n return column >= start && column < end;\n });\n}\n\nfunction renderedSpans(\n tokens: readonly CodeSyntaxToken[],\n selection: CodeSelection,\n line: number,\n diagnostics: readonly CodeDiagnostic[],\n): RenderedCodeSpan[] {\n const text = tokens.map(({ text: value }) => value).join(\"\");\n const selected = selectedColumns(selection, line, graphemes(text).length);\n const spans: RenderedCodeSpan[] = [];\n let column = 0;\n for (const token of tokens) {\n const parts = graphemes(token.text);\n let start = 0;\n while (start < parts.length) {\n const absolute = column + start;\n const isSelected =\n selected !== undefined && absolute >= selected[0] && absolute < selected[1];\n const hasDiagnostic = diagnosticAtColumn(diagnostics, absolute);\n let end = start + 1;\n while (end < parts.length) {\n const nextAbsolute = column + end;\n const nextSelected =\n selected !== undefined && nextAbsolute >= selected[0] && nextAbsolute < selected[1];\n if (\n nextSelected !== isSelected ||\n diagnosticAtColumn(diagnostics, nextAbsolute) !== hasDiagnostic\n ) {\n break;\n }\n end += 1;\n }\n spans.push({\n ...token,\n text: parts.slice(start, end).join(\"\"),\n selected: isSelected,\n diagnostic: hasDiagnostic,\n });\n start = end;\n }\n column += parts.length;\n }\n return spans.length > 0 ? spans : [{ text: \" \" }];\n}\n\nexport const Code = defineComponent({\n name: \"Code\",\n props: {\n code: { type: String, default: \"\" },\n buffer: Object as PropType<CodeBuffer>,\n language: String,\n lineNumbers: { type: Boolean, default: true },\n startLine: { type: Number, default: 1 },\n highlightLines: { type: Array as PropType<readonly number[]>, default: () => [] },\n border: { type: String as PropType<CodeProps[\"border\"]>, default: \"single\" },\n fg: { type: String, default: \"white\" },\n lineNumberFg: { type: String, default: \"gray\" },\n highlightBg: { type: String, default: \"blue\" },\n selectionBg: { type: String, default: \"blue\" },\n diagnostics: { type: Array as PropType<readonly CodeDiagnostic[]>, default: () => [] },\n syntaxProvider: Object as PropType<CodeProps[\"syntaxProvider\"]>,\n selection: Object as PropType<CodeSelection>,\n selectable: { type: Boolean, default: true },\n focused: { type: Boolean, default: false },\n offset: { type: Number, default: 0 },\n viewportSize: Number,\n overscan: { type: Number, default: 2 },\n },\n emits: [\"update:selection\", \"update:offset\", \"select\"],\n setup(props, { emit }) {\n const source = computed(() => props.buffer?.content.value ?? props.code);\n const lines = computed(() => source.value.split(\"\\n\"));\n const internalSelection = ref<CodeSelection>({\n anchor: { line: 0, column: 0 },\n focus: { line: 0, column: 0 },\n });\n watch(\n [() => props.selection, lines],\n ([requested]) => {\n internalSelection.value = normalizedSelection(\n requested ?? internalSelection.value,\n lines.value,\n );\n },\n { immediate: true },\n );\n\n const viewport = computed(() => {\n const count = lines.value.length;\n const size = Math.min(\n count,\n props.viewportSize === undefined ? count : Math.max(0, finiteInteger(props.viewportSize)),\n );\n const visibleStart = Math.min(\n Math.max(0, count - size),\n Math.max(0, finiteInteger(props.offset)),\n );\n const visibleEnd = Math.min(count, visibleStart + size);\n const overscan = Math.max(0, finiteInteger(props.overscan));\n return {\n visibleStart,\n visibleEnd,\n retainedStart: Math.max(0, visibleStart - overscan),\n retainedEnd: Math.min(count, visibleEnd + overscan),\n };\n });\n\n const publishSelection = (next: CodeSelection) => {\n const normalized = normalizedSelection(next, lines.value);\n internalSelection.value = normalized;\n emit(\"update:selection\", normalized);\n emit(\"select\", normalized);\n const size = props.viewportSize;\n if (size === undefined || size <= 0) return;\n if (normalized.focus.line < props.offset) emit(\"update:offset\", normalized.focus.line);\n else if (normalized.focus.line >= props.offset + size) {\n emit(\"update:offset\", normalized.focus.line - size + 1);\n }\n };\n\n const move = (key: string, extend: boolean) => {\n const current = internalSelection.value.focus;\n let next: CodePosition;\n const currentParts = graphemes(lines.value[current.line] ?? \"\");\n if (key === \"left\") {\n next =\n current.column > 0\n ? { line: current.line, column: current.column - 1 }\n : current.line > 0\n ? {\n line: current.line - 1,\n column: graphemes(lines.value[current.line - 1] ?? \"\").length,\n }\n : current;\n } else if (key === \"right\") {\n next =\n current.column < currentParts.length\n ? { line: current.line, column: current.column + 1 }\n : current.line < lines.value.length - 1\n ? { line: current.line + 1, column: 0 }\n : current;\n } else if (key === \"up\" || key === \"down\") {\n const delta = key === \"up\" ? -1 : 1;\n next = position(current.line + delta, current.column, lines.value);\n } else if (key === \"home\") next = { line: current.line, column: 0 };\n else if (key === \"end\") next = { line: current.line, column: currentParts.length };\n else if (key === \"pageup\" || key === \"pagedown\") {\n const delta = Math.max(1, (props.viewportSize ?? 2) - 1) * (key === \"pageup\" ? -1 : 1);\n next = position(current.line + delta, current.column, lines.value);\n } else return;\n publishSelection({\n anchor: extend ? internalSelection.value.anchor : next,\n focus: next,\n });\n };\n\n useInput({\n isActive: computed(() => props.focused && props.selectable),\n onKey: (key, modifiers) => {\n if ((modifiers.ctrl || modifiers.meta) && key.toLowerCase() === \"a\") {\n const lastLine = Math.max(0, lines.value.length - 1);\n publishSelection({\n anchor: { line: 0, column: 0 },\n focus: { line: lastLine, column: graphemes(lines.value[lastLine] ?? \"\").length },\n });\n return;\n }\n move(key.toLowerCase(), modifiers.shift);\n },\n onEscape: () => {\n publishSelection({\n anchor: internalSelection.value.focus,\n focus: internalSelection.value.focus,\n });\n },\n });\n\n return () => {\n const maxLineNumber = props.startLine + lines.value.length - 1;\n const lineNumberWidth = String(maxLineNumber).length;\n const children = [];\n if (props.language) {\n children.push(\n h(\n \"text\",\n { key: \"language\", dim: true, style: { marginBottom: 1 } },\n `// ${props.language}`,\n ),\n );\n }\n\n for (\n let lineIndex = viewport.value.retainedStart;\n lineIndex < viewport.value.retainedEnd;\n lineIndex += 1\n ) {\n const line = lines.value[lineIndex] ?? \"\";\n const lineNumber = props.startLine + lineIndex;\n const isVisible =\n lineIndex >= viewport.value.visibleStart && lineIndex < viewport.value.visibleEnd;\n const lineDiagnostics = props.diagnostics.filter(\n ({ line: diagnosticLine }) => diagnosticLine === lineIndex,\n );\n const parts = [];\n if (props.lineNumbers) {\n parts.push(\n h(LineNumber, {\n key: `line-number-${lineNumber}`,\n value: lineNumber,\n width: lineNumberWidth,\n fg: props.lineNumberFg,\n active: props.focused && internalSelection.value.focus.line === lineIndex,\n }),\n );\n }\n const spans = renderedSpans(\n tokensForLine(line, lineIndex, lineNumber, props),\n internalSelection.value,\n lineIndex,\n lineDiagnostics,\n );\n spans.forEach((span, spanIndex) => {\n parts.push(\n h(\n \"text\",\n {\n key: `code-${lineNumber}-${spanIndex}`,\n fg: span.fg ?? props.fg,\n bg: span.selected\n ? props.selectionBg\n : props.highlightLines.includes(lineNumber)\n ? props.highlightBg\n : span.bg,\n bold: span.bold,\n dim: span.dim,\n italic: span.italic,\n underline: span.underline || span.diagnostic,\n },\n span.text,\n ),\n );\n });\n if (lineDiagnostics.length > 0) {\n parts.push(\n h(\n \"text\",\n { key: `diagnostic-${lineNumber}`, fg: \"red\" },\n ` ! ${lineDiagnostics.map(({ message }) => message).join(\"; \")}`,\n ),\n );\n }\n children.push(\n h(\n \"box\",\n {\n key: `line-${lineNumber}`,\n style: { display: isVisible ? \"flex\" : \"none\", flexDirection: \"row\" },\n \"aria-hidden\": !isVisible,\n \"aria-label\":\n lineDiagnostics.length > 0\n ? `Line ${lineNumber}: ${lineDiagnostics.map(({ message }) => message).join(\"; \")}`\n : undefined,\n \"data-code-line\": lineIndex,\n },\n parts,\n ),\n );\n }\n\n return h(\n \"box\",\n {\n border: props.border === \"none\" ? undefined : props.border,\n style: {\n flexDirection: \"column\",\n overflow: \"hidden\",\n padding: props.border !== \"none\" ? 1 : 0,\n },\n \"aria-label\": props.language ? `${props.language} code` : \"Code\",\n \"aria-state\": { readonly: true, multiselectable: props.selectable },\n },\n children,\n );\n };\n },\n});\n","import type {\n MarkdownBlock,\n MarkdownListItem,\n MarkdownRenderLine,\n MarkdownRenderer,\n MarkdownRenderOptions,\n MarkdownSpan,\n} from \"./markdown-types.js\";\n\nconst fencePattern = /^ {0,3}(`{3,}|~{3,})(.*)$/u;\nconst headingPattern = /^ {0,3}(#{1,6})(?:[ \\t]+|$)(.*)$/u;\nconst quotePattern = /^ {0,3}>[ \\t]?(.*)$/u;\nconst unorderedListPattern = /^ {0,3}[-+*][ \\t]+(.*)$/u;\nconst orderedListPattern = /^ {0,3}(\\d{1,9})[.)][ \\t]+(.*)$/u;\nconst setextPattern = /^ {0,3}(=+|-+)[ \\t]*$/u;\n\nfunction isThematicBreak(line: string): boolean {\n const compact = line.trim().replaceAll(/[ \\t]/gu, \"\");\n return compact.length >= 3 && /^(?:\\*+|-+|_+)$/u.test(compact);\n}\n\nfunction parseFenceOpening(line: string): RegExpExecArray | null {\n const match = fencePattern.exec(line);\n if (!match) return null;\n const marker = match[1] ?? \"\";\n const info = match[2] ?? \"\";\n return marker.startsWith(\"`\") && info.includes(\"`\") ? null : match;\n}\n\nfunction isBlockStart(line: string): boolean {\n return (\n line.trim().length === 0 ||\n parseFenceOpening(line) !== null ||\n headingPattern.test(line) ||\n quotePattern.test(line) ||\n unorderedListPattern.test(line) ||\n orderedListPattern.test(line) ||\n /^ {4}/u.test(line) ||\n isThematicBreak(line)\n );\n}\n\nfunction parseTaskItem(content: string): MarkdownListItem {\n const task = /^\\[([ xX])\\][ \\t]+(.*)$/u.exec(content);\n return task\n ? { content: task[2] ?? \"\", checked: (task[1] ?? \"\").toLowerCase() === \"x\" }\n : { content };\n}\n\n/** Parse the block-level subset of CommonMark used by Fresco Markdown. */\nexport function parseMarkdown(source: string): readonly MarkdownBlock[] {\n const lines = source.replaceAll(\"\\r\\n\", \"\\n\").replaceAll(\"\\r\", \"\\n\").split(\"\\n\");\n const blocks: MarkdownBlock[] = [];\n let index = 0;\n\n while (index < lines.length) {\n const line = lines[index] ?? \"\";\n if (line.trim().length === 0) {\n index += 1;\n continue;\n }\n\n const fence = parseFenceOpening(line);\n if (fence) {\n const marker = fence[1] ?? \"```\";\n const markerChar = marker[0] ?? \"`\";\n const info = (fence[2] ?? \"\").trim();\n const content: string[] = [];\n const start = index;\n index += 1;\n while (index < lines.length) {\n const candidate = lines[index] ?? \"\";\n const closing = new RegExp(`^ {0,3}${markerChar}{${marker.length},}[ \\\\t]*$`, \"u\");\n if (closing.test(candidate)) {\n index += 1;\n break;\n }\n content.push(candidate);\n index += 1;\n }\n blocks.push({\n type: \"code\",\n line: start + 1,\n ...(info ? { info } : {}),\n content: content.join(\"\\n\"),\n });\n continue;\n }\n\n const heading = headingPattern.exec(line);\n if (heading) {\n const content = (heading[2] ?? \"\").replace(/[ \\t]+#+[ \\t]*$/u, \"\");\n blocks.push({\n type: \"heading\",\n line: index + 1,\n level: (heading[1] ?? \"#\").length,\n content,\n });\n index += 1;\n continue;\n }\n\n if (isThematicBreak(line)) {\n blocks.push({ type: \"thematic-break\", line: index + 1 });\n index += 1;\n continue;\n }\n\n const quote = quotePattern.exec(line);\n if (quote) {\n const start = index;\n const content: string[] = [];\n while (index < lines.length) {\n const part = quotePattern.exec(lines[index] ?? \"\");\n if (!part) break;\n content.push(part[1] ?? \"\");\n index += 1;\n }\n blocks.push({ type: \"quote\", line: start + 1, content: content.join(\" \") });\n continue;\n }\n\n const unordered = unorderedListPattern.exec(line);\n const ordered = orderedListPattern.exec(line);\n if (unordered || ordered) {\n const start = index;\n const orderedList = Boolean(ordered);\n const first = ordered ? Number(ordered[1]) : undefined;\n const items: MarkdownListItem[] = [];\n while (index < lines.length) {\n const candidate = lines[index] ?? \"\";\n const match = orderedList\n ? orderedListPattern.exec(candidate)\n : unorderedListPattern.exec(candidate);\n if (!match) break;\n items.push(parseTaskItem(match[orderedList ? 2 : 1] ?? \"\"));\n index += 1;\n }\n blocks.push({\n type: \"list\",\n line: start + 1,\n ordered: orderedList,\n ...(first === undefined ? {} : { start: first }),\n items,\n });\n continue;\n }\n\n if (/^ {4}/u.test(line)) {\n const start = index;\n const content: string[] = [];\n while (index < lines.length && (/^ {4}/u.test(lines[index] ?? \"\") || !lines[index])) {\n content.push((lines[index] ?? \"\").replace(/^ {4}/u, \"\"));\n index += 1;\n }\n blocks.push({ type: \"code\", line: start + 1, content: content.join(\"\\n\") });\n continue;\n }\n\n const start = index;\n const paragraph = [line.trim()];\n index += 1;\n const setext = setextPattern.exec(lines[index] ?? \"\");\n if (setext) {\n blocks.push({\n type: \"heading\",\n line: start + 1,\n level: (setext[1] ?? \"-\").startsWith(\"=\") ? 1 : 2,\n content: paragraph[0] ?? \"\",\n });\n index += 1;\n continue;\n }\n while (index < lines.length && !isBlockStart(lines[index] ?? \"\")) {\n paragraph.push((lines[index] ?? \"\").trim());\n index += 1;\n }\n blocks.push({ type: \"paragraph\", line: start + 1, content: paragraph.join(\" \") });\n }\n\n return blocks;\n}\n\nfunction mergeAdjacentSpans(spans: readonly MarkdownSpan[]): MarkdownSpan[] {\n const merged: MarkdownSpan[] = [];\n for (const span of spans) {\n const previous = merged.at(-1);\n if (\n previous &&\n previous.fg === span.fg &&\n previous.bold === span.bold &&\n previous.italic === span.italic &&\n previous.underline === span.underline &&\n previous.dim === span.dim\n ) {\n previous.text += span.text;\n } else {\n merged.push({ ...span });\n }\n }\n return merged;\n}\n\nfunction parseInline(content: string, options: Readonly<MarkdownRenderOptions>): MarkdownSpan[] {\n const spans: MarkdownSpan[] = [];\n let plain = \"\";\n const flush = () => {\n if (plain) spans.push({ text: plain });\n plain = \"\";\n };\n\n for (let index = 0; index < content.length;) {\n const rest = content.slice(index);\n const escape = /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@[\\]^_`{|}~])/u.exec(rest);\n if (escape) {\n plain += escape[1] ?? \"\";\n index += escape[0].length;\n continue;\n }\n\n const code = /^(`+)([\\s\\S]*?)\\1/u.exec(rest);\n if (code) {\n flush();\n spans.push({ text: (code[2] ?? \"\").replaceAll(/\\s+/gu, \" \"), fg: options.codeFg });\n index += code[0].length;\n continue;\n }\n\n const link = /^\\[([^\\]]+)\\]\\(([^\\s)]+)(?:\\s+\"[^\"]*\")?\\)/u.exec(rest);\n if (link) {\n flush();\n spans.push({ text: link[1] ?? \"\", fg: options.linkFg, underline: true });\n spans.push({ text: ` (${link[2] ?? \"\"})`, dim: true });\n index += link[0].length;\n continue;\n }\n\n const strong = /^(\\*\\*|__)(.+?)\\1/u.exec(rest);\n if (strong) {\n flush();\n spans.push({ text: strong[2] ?? \"\", bold: true });\n index += strong[0].length;\n continue;\n }\n\n const emphasis = /^(\\*|_)(.+?)\\1/u.exec(rest);\n if (emphasis) {\n flush();\n spans.push({ text: emphasis[2] ?? \"\", italic: true });\n index += emphasis[0].length;\n continue;\n }\n\n plain += content[index] ?? \"\";\n index += 1;\n }\n flush();\n return mergeAdjacentSpans(spans);\n}\n\nfunction defaultBlockLines(\n block: Readonly<MarkdownBlock>,\n options: Readonly<MarkdownRenderOptions>,\n): readonly MarkdownRenderLine[] {\n const key = `markdown-${block.line}`;\n switch (block.type) {\n case \"heading\":\n return [\n {\n key,\n spans: [\n { text: `${\"#\".repeat(block.level)} `, fg: options.headingFg, dim: true },\n ...parseInline(block.content, options).map((span) => ({\n ...span,\n fg: span.fg ?? options.headingFg,\n bold: true,\n })),\n ],\n },\n ];\n case \"paragraph\":\n return [{ key, spans: parseInline(block.content, options) }];\n case \"quote\":\n return [\n {\n key,\n spans: [\n { text: \"│ \", fg: options.quoteFg, dim: true },\n ...parseInline(block.content, options),\n ],\n },\n ];\n case \"code\": {\n const lines = block.content.split(\"\\n\");\n return [\n ...(block.info\n ? [{ key: `${key}-info`, spans: [{ text: block.info, fg: options.codeFg, dim: true }] }]\n : []),\n ...lines.map((line, index) => ({\n key: `${key}-code-${index}`,\n spans: [\n { text: \"│ \", fg: options.codeFg, dim: true },\n { text: line || \" \", fg: options.codeFg },\n ],\n })),\n ];\n }\n case \"list\":\n return block.items.map((item, index) => {\n const ordinal = (block.start ?? 1) + index;\n const marker = block.ordered ? `${ordinal}. ` : \"• \";\n const task = item.checked === undefined ? undefined : item.checked ? \"[x] \" : \"[ ] \";\n return {\n key: `${key}-item-${index}`,\n spans: [\n { text: marker, dim: true },\n ...(task ? [{ text: task, dim: item.checked === false }] : []),\n ...parseInline(item.content, options),\n ],\n };\n });\n case \"thematic-break\":\n return [{ key, spans: [{ text: \"─\".repeat(40), dim: true }] }];\n }\n}\n\nfunction renderWithProviders(\n block: Readonly<MarkdownBlock>,\n options: Readonly<MarkdownRenderOptions>,\n): readonly MarkdownRenderLine[] {\n for (const provider of options.providers ?? []) {\n const rendered = provider.render(block, options);\n if (rendered) return rendered;\n }\n return defaultBlockLines(block, options);\n}\n\n/** Built-in source renderer with per-block provider delegation. */\nexport const defaultMarkdownRenderer: MarkdownRenderer = {\n render(source, options) {\n return parseMarkdown(source).flatMap((block) => renderWithProviders(block, options));\n },\n};\n\n/** Render Markdown with either the built-in renderer or a complete replacement. */\nexport function renderMarkdown(\n source: string,\n options: Readonly<MarkdownRenderOptions> = {},\n renderer: MarkdownRenderer = defaultMarkdownRenderer,\n): readonly MarkdownRenderLine[] {\n return renderer.render(source, options);\n}\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\nimport { renderMarkdown } from \"./markdown.js\";\nimport type { MarkdownProps } from \"./markdown-types.js\";\n\nconst props = defineProps<MarkdownProps>();\n\ndefineOptions({ name: \"Markdown\" });\n\nconst lines = computed(() =>\n renderMarkdown(\n props.source,\n {\n headingFg: props.headingFg,\n linkFg: props.linkFg,\n quoteFg: props.quoteFg,\n codeFg: props.codeFg,\n providers: props.providers,\n },\n props.renderer,\n ),\n);\nconst containerStyle = { flexDirection: \"column\" } as const;\nconst lineStyle = { flexDirection: \"row\" } as const;\n</script>\n\n<template>\n <div :style=\"containerStyle\">\n <div v-for=\"line in lines\" :key=\"line.key\" :style=\"lineStyle\">\n <text\n v-for=\"(span, index) in line.spans\"\n :key=\"`${line.key}-${index}`\"\n :text=\"span.text\"\n :fg=\"span.fg\"\n :bold=\"span.bold\"\n :italic=\"span.italic\"\n :underline=\"span.underline\"\n :dim=\"span.dim\"\n />\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\nimport { renderMarkdown } from \"./markdown.js\";\nimport type { MarkdownProps } from \"./markdown-types.js\";\n\nconst props = defineProps<MarkdownProps>();\n\ndefineOptions({ name: \"Markdown\" });\n\nconst lines = computed(() =>\n renderMarkdown(\n props.source,\n {\n headingFg: props.headingFg,\n linkFg: props.linkFg,\n quoteFg: props.quoteFg,\n codeFg: props.codeFg,\n providers: props.providers,\n },\n props.renderer,\n ),\n);\nconst containerStyle = { flexDirection: \"column\" } as const;\nconst lineStyle = { flexDirection: \"row\" } as const;\n</script>\n\n<template>\n <div :style=\"containerStyle\">\n <div v-for=\"line in lines\" :key=\"line.key\" :style=\"lineStyle\">\n <text\n v-for=\"(span, index) in line.spans\"\n :key=\"`${line.key}-${index}`\"\n :text=\"span.text\"\n :fg=\"span.fg\"\n :bold=\"span.bold\"\n :italic=\"span.italic\"\n :underline=\"span.underline\"\n :dim=\"span.dim\"\n />\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport type { FrameBufferProps } from \"./frame-buffer-types.js\";\n\ndefineProps<FrameBufferProps>();\n\ndefineOptions({ name: \"FrameBuffer\" });\n\nconst rawElement = \"raw\";\n</script>\n\n<template>\n <component\n :is=\"rawElement\"\n :lines\n :style\n :fg\n :bg\n :bold\n :dim\n :italic\n :underline\n :inverse\n :border\n />\n</template>\n","<script setup lang=\"ts\">\nimport type { FrameBufferProps } from \"./frame-buffer-types.js\";\n\ndefineProps<FrameBufferProps>();\n\ndefineOptions({ name: \"FrameBuffer\" });\n\nconst rawElement = \"raw\";\n</script>\n\n<template>\n <component\n :is=\"rawElement\"\n :lines\n :style\n :fg\n :bg\n :bold\n :dim\n :italic\n :underline\n :inverse\n :border\n />\n</template>\n","/** Internal, dependency-free line and token diffing for the Diff component. */\n\nexport type DiffLineKind = \"context\" | \"added\" | \"removed\";\n\nexport interface DiffSegment {\n text: string;\n changed: boolean;\n}\n\nexport interface DiffLine {\n kind: DiffLineKind;\n text: string;\n oldLine?: number;\n newLine?: number;\n segments: DiffSegment[];\n}\n\nexport interface DiffHunkHeader {\n kind: \"hunk\";\n oldStart: number;\n oldCount: number;\n newStart: number;\n newCount: number;\n text: string;\n}\n\nexport type UnifiedDiffRow = DiffLine | DiffHunkHeader;\n\nexport interface SplitDiffLine {\n kind: \"split\";\n oldLine?: DiffLine;\n newLine?: DiffLine;\n}\n\nexport type SplitDiffRow = SplitDiffLine | DiffHunkHeader;\n\ninterface SequenceEdit<Value> {\n kind: \"equal\" | \"added\" | \"removed\";\n value: Value;\n}\n\nfunction diagonalValue(diagonals: ReadonlyMap<number, number>, diagonal: number): number {\n return diagonals.get(diagonal) ?? Number.NEGATIVE_INFINITY;\n}\n\n/** Compute a shortest edit script with Myers' O((N + M)D) algorithm. */\nfunction diffSequence<Value>(\n previous: readonly Value[],\n next: readonly Value[],\n): SequenceEdit<Value>[] {\n if (previous.length === 0) return next.map((value) => ({ kind: \"added\", value }));\n if (next.length === 0) return previous.map((value) => ({ kind: \"removed\", value }));\n\n const maximumDistance = previous.length + next.length;\n const trace: Map<number, number>[] = [];\n const diagonals = new Map<number, number>([[1, 0]]);\n\n for (let distance = 0; distance <= maximumDistance; distance += 1) {\n trace.push(new Map(diagonals));\n for (let diagonal = -distance; diagonal <= distance; diagonal += 2) {\n const followsInsertion =\n diagonal === -distance ||\n (diagonal !== distance &&\n diagonalValue(diagonals, diagonal - 1) < diagonalValue(diagonals, diagonal + 1));\n let previousIndex = followsInsertion\n ? diagonalValue(diagonals, diagonal + 1)\n : diagonalValue(diagonals, diagonal - 1) + 1;\n if (!Number.isFinite(previousIndex)) previousIndex = 0;\n let nextIndex = previousIndex - diagonal;\n\n while (\n previousIndex < previous.length &&\n nextIndex < next.length &&\n Object.is(previous[previousIndex], next[nextIndex])\n ) {\n previousIndex += 1;\n nextIndex += 1;\n }\n diagonals.set(diagonal, previousIndex);\n\n if (previousIndex >= previous.length && nextIndex >= next.length) {\n return backtrack(trace, previous, next, distance);\n }\n }\n }\n\n return [];\n}\n\nfunction backtrack<Value>(\n trace: readonly ReadonlyMap<number, number>[],\n previous: readonly Value[],\n next: readonly Value[],\n distance: number,\n): SequenceEdit<Value>[] {\n const edits: SequenceEdit<Value>[] = [];\n let previousIndex = previous.length;\n let nextIndex = next.length;\n\n for (let step = distance; step > 0; step -= 1) {\n const diagonals = trace[step];\n if (!diagonals) break;\n const diagonal = previousIndex - nextIndex;\n const followsInsertion =\n diagonal === -step ||\n (diagonal !== step &&\n diagonalValue(diagonals, diagonal - 1) < diagonalValue(diagonals, diagonal + 1));\n const previousDiagonal = followsInsertion ? diagonal + 1 : diagonal - 1;\n const previousSnakeIndex = diagonals.get(previousDiagonal) ?? 0;\n const nextSnakeIndex = previousSnakeIndex - previousDiagonal;\n\n while (previousIndex > previousSnakeIndex && nextIndex > nextSnakeIndex) {\n previousIndex -= 1;\n nextIndex -= 1;\n edits.push({ kind: \"equal\", value: previous[previousIndex] as Value });\n }\n\n if (followsInsertion) {\n nextIndex -= 1;\n edits.push({ kind: \"added\", value: next[nextIndex] as Value });\n } else {\n previousIndex -= 1;\n edits.push({ kind: \"removed\", value: previous[previousIndex] as Value });\n }\n }\n\n while (previousIndex > 0 && nextIndex > 0) {\n previousIndex -= 1;\n nextIndex -= 1;\n edits.push({ kind: \"equal\", value: previous[previousIndex] as Value });\n }\n while (previousIndex > 0) {\n previousIndex -= 1;\n edits.push({ kind: \"removed\", value: previous[previousIndex] as Value });\n }\n while (nextIndex > 0) {\n nextIndex -= 1;\n edits.push({ kind: \"added\", value: next[nextIndex] as Value });\n }\n\n return edits.reverse();\n}\n\nfunction splitLines(value: string): string[] {\n if (value.length === 0) return [];\n return value.replaceAll(\"\\r\\n\", \"\\n\").replaceAll(\"\\r\", \"\\n\").split(\"\\n\");\n}\n\nfunction tokenize(value: string): string[] {\n return value.match(/\\s+|[\\p{L}\\p{N}_]+|[^\\s\\p{L}\\p{N}_]+/gu) ?? [];\n}\n\nfunction mergeSegments(segments: DiffSegment[]): DiffSegment[] {\n const merged: DiffSegment[] = [];\n for (const segment of segments) {\n const last = merged.at(-1);\n if (last?.changed === segment.changed) last.text += segment.text;\n else merged.push({ ...segment });\n }\n return merged;\n}\n\nfunction wordSegments(previous: string, next: string): [DiffSegment[], DiffSegment[]] {\n const edits = diffSequence(tokenize(previous), tokenize(next));\n const removed: DiffSegment[] = [];\n const added: DiffSegment[] = [];\n\n for (const edit of edits) {\n if (edit.kind !== \"added\") {\n removed.push({ text: edit.value, changed: edit.kind === \"removed\" });\n }\n if (edit.kind !== \"removed\") {\n added.push({ text: edit.value, changed: edit.kind === \"added\" });\n }\n }\n return [mergeSegments(removed), mergeSegments(added)];\n}\n\nfunction pairChangedLines(lines: DiffLine[]): void {\n for (let index = 0; index < lines.length;) {\n if (lines[index]?.kind === \"context\") {\n index += 1;\n continue;\n }\n const blockStart = index;\n while (index < lines.length && lines[index]?.kind !== \"context\") index += 1;\n const block = lines.slice(blockStart, index);\n const removed = block.filter((line) => line.kind === \"removed\");\n const added = block.filter((line) => line.kind === \"added\");\n\n for (let pairIndex = 0; pairIndex < Math.min(removed.length, added.length); pairIndex += 1) {\n const previous = removed[pairIndex];\n const next = added[pairIndex];\n if (!previous || !next) continue;\n [previous.segments, next.segments] = wordSegments(previous.text, next.text);\n }\n }\n}\n\nfunction normalizeChangeBlocks(lines: DiffLine[]): DiffLine[] {\n const normalized: DiffLine[] = [];\n for (let index = 0; index < lines.length;) {\n if (lines[index]?.kind === \"context\") {\n normalized.push(lines[index] as DiffLine);\n index += 1;\n continue;\n }\n const block: DiffLine[] = [];\n while (index < lines.length && lines[index]?.kind !== \"context\") {\n block.push(lines[index] as DiffLine);\n index += 1;\n }\n normalized.push(...block.filter((line) => line.kind === \"removed\"));\n normalized.push(...block.filter((line) => line.kind === \"added\"));\n }\n return normalized;\n}\n\n/** Build numbered line edits and word-level highlight segments. */\nexport function createDiffLines(previous: string, next: string): DiffLine[] {\n let oldLine = 1;\n let newLine = 1;\n const lines = diffSequence(splitLines(previous), splitLines(next)).map((edit): DiffLine => {\n if (edit.kind === \"equal\") {\n const line: DiffLine = {\n kind: \"context\",\n text: edit.value,\n oldLine,\n newLine,\n segments: [{ text: edit.value, changed: false }],\n };\n oldLine += 1;\n newLine += 1;\n return line;\n }\n if (edit.kind === \"removed\") {\n const line: DiffLine = {\n kind: \"removed\",\n text: edit.value,\n oldLine,\n segments: [{ text: edit.value, changed: true }],\n };\n oldLine += 1;\n return line;\n }\n const line: DiffLine = {\n kind: \"added\",\n text: edit.value,\n newLine,\n segments: [{ text: edit.value, changed: true }],\n };\n newLine += 1;\n return line;\n });\n const normalized = normalizeChangeBlocks(lines);\n pairChangedLines(normalized);\n return normalized;\n}\n\nfunction hunkHeader(lines: readonly DiffLine[], start: number, end: number): DiffHunkHeader {\n const prior = lines.slice(0, start);\n const body = lines.slice(start, end);\n const oldStart = prior.filter((line) => line.oldLine !== undefined).length + 1;\n const newStart = prior.filter((line) => line.newLine !== undefined).length + 1;\n const oldCount = body.filter((line) => line.oldLine !== undefined).length;\n const newCount = body.filter((line) => line.newLine !== undefined).length;\n return {\n kind: \"hunk\",\n oldStart,\n oldCount,\n newStart,\n newCount,\n text: `@@ -${oldStart},${oldCount} +${newStart},${newCount} @@`,\n };\n}\n\n/** Retain only requested context around changes and insert stable hunk headers. */\nexport function createUnifiedRows(\n previous: string,\n next: string,\n context: number,\n): UnifiedDiffRow[] {\n const lines = createDiffLines(previous, next);\n const changed = lines.flatMap((line, index) => (line.kind === \"context\" ? [] : [index]));\n if (changed.length === 0) return lines;\n\n const retainedContext = Number.isFinite(context) ? Math.max(0, Math.trunc(context)) : 3;\n const ranges: Array<{ start: number; end: number }> = [];\n for (const index of changed) {\n const start = Math.max(0, index - retainedContext);\n const end = Math.min(lines.length, index + retainedContext + 1);\n const previousRange = ranges.at(-1);\n if (previousRange && start <= previousRange.end)\n previousRange.end = Math.max(previousRange.end, end);\n else ranges.push({ start, end });\n }\n\n return ranges.flatMap(({ start, end }) => [\n hunkHeader(lines, start, end),\n ...lines.slice(start, end),\n ]);\n}\n\n/** Pair removed and added lines for a side-by-side view. */\nexport function createSplitRows(rows: readonly UnifiedDiffRow[]): SplitDiffRow[] {\n const split: SplitDiffRow[] = [];\n for (let index = 0; index < rows.length;) {\n const row = rows[index];\n if (!row) break;\n if (row.kind === \"hunk\") {\n split.push(row);\n index += 1;\n continue;\n }\n if (row.kind === \"context\") {\n split.push({ kind: \"split\", oldLine: row, newLine: row });\n index += 1;\n continue;\n }\n\n const changed: DiffLine[] = [];\n while (index < rows.length && rows[index]?.kind !== \"context\" && rows[index]?.kind !== \"hunk\") {\n changed.push(rows[index] as DiffLine);\n index += 1;\n }\n const removed = changed.filter((line) => line.kind === \"removed\");\n const added = changed.filter((line) => line.kind === \"added\");\n for (let pairIndex = 0; pairIndex < Math.max(removed.length, added.length); pairIndex += 1) {\n split.push({ kind: \"split\", oldLine: removed[pairIndex], newLine: added[pairIndex] });\n }\n }\n return split;\n}\n","/** Unified and side-by-side text diff with bounded viewport rendering. */\n\nimport { computed, defineComponent, h, type PropType, type VNode } from \"vue\";\n\nimport {\n createSplitRows,\n createUnifiedRows,\n type DiffHunkHeader,\n type DiffLine,\n type DiffSegment,\n type SplitDiffLine,\n} from \"./diff-algorithm.js\";\nimport { LineNumber } from \"./LineNumber.js\";\n\nexport type DiffView = \"unified\" | \"split\";\n\nexport interface DiffProps {\n oldText: string;\n newText: string;\n view?: DiffView;\n context?: number;\n showLineNumbers?: boolean;\n viewportStart?: number;\n viewportSize?: number;\n overscan?: number;\n oldLabel?: string;\n newLabel?: string;\n contextFg?: string;\n addedFg?: string;\n addedBg?: string;\n removedFg?: string;\n removedBg?: string;\n hunkFg?: string;\n lineNumberFg?: string;\n addedHighlightBg?: string;\n removedHighlightBg?: string;\n}\n\nfunction normalizedInteger(value: number | undefined, fallback: number): number {\n if (value === undefined || !Number.isFinite(value)) return fallback;\n return Math.max(0, Math.trunc(value));\n}\n\nexport const Diff = defineComponent({\n name: \"Diff\",\n props: {\n oldText: { type: String, required: true },\n newText: { type: String, required: true },\n view: { type: String as PropType<DiffView>, default: \"unified\" },\n context: { type: Number, default: 3 },\n showLineNumbers: { type: Boolean, default: true },\n viewportStart: { type: Number, default: 0 },\n viewportSize: Number,\n overscan: { type: Number, default: 2 },\n oldLabel: String,\n newLabel: String,\n contextFg: { type: String, default: \"white\" },\n addedFg: { type: String, default: \"green\" },\n addedBg: String,\n removedFg: { type: String, default: \"red\" },\n removedBg: String,\n hunkFg: { type: String, default: \"cyan\" },\n lineNumberFg: { type: String, default: \"gray\" },\n addedHighlightBg: { type: String, default: \"darkgreen\" },\n removedHighlightBg: { type: String, default: \"darkred\" },\n },\n setup(props) {\n const unifiedRows = computed(() =>\n createUnifiedRows(props.oldText, props.newText, props.context),\n );\n const rows = computed(() =>\n props.view === \"split\" ? createSplitRows(unifiedRows.value) : unifiedRows.value,\n );\n const visibleRows = computed(() => {\n if (props.viewportSize === undefined) return rows.value;\n const start = normalizedInteger(props.viewportStart, 0);\n const size = normalizedInteger(props.viewportSize, 0);\n const overscan = normalizedInteger(props.overscan, 2);\n return rows.value.slice(Math.max(0, start - overscan), start + size + overscan);\n });\n const oldLineWidth = computed(\n () => String(Math.max(1, props.oldText.split(/\\r?\\n/u).length)).length,\n );\n const newLineWidth = computed(\n () => String(Math.max(1, props.newText.split(/\\r?\\n/u).length)).length,\n );\n\n const blankGutter = (width: number) =>\n h(\"text\", { text: \" \".repeat(width + 3), \"aria-hidden\": true });\n const gutter = (line: number | undefined, width: number) => {\n if (!props.showLineNumbers) return undefined;\n return line === undefined\n ? blankGutter(width)\n : h(LineNumber, { value: line, width, fg: props.lineNumberFg });\n };\n const prefix = (line: DiffLine | undefined) => {\n const text = line?.kind === \"added\" ? \"+ \" : line?.kind === \"removed\" ? \"- \" : \" \";\n return h(\"text\", { text, bold: line?.kind !== \"context\" });\n };\n const lineColors = (line: DiffLine | undefined) => {\n if (line?.kind === \"added\") return { fg: props.addedFg, bg: props.addedBg };\n if (line?.kind === \"removed\") return { fg: props.removedFg, bg: props.removedBg };\n return { fg: props.contextFg, bg: undefined };\n };\n const segmentNodes = (line: DiffLine | undefined): VNode[] => {\n if (!line) return [h(\"text\", { text: \" \" })];\n const colors = lineColors(line);\n return line.segments.map((segment: DiffSegment, index) =>\n h(\"text\", {\n key: index,\n text: segment.text || \" \",\n fg: colors.fg,\n bg: segment.changed\n ? line.kind === \"added\"\n ? props.addedHighlightBg\n : line.kind === \"removed\"\n ? props.removedHighlightBg\n : colors.bg\n : colors.bg,\n underline: segment.changed && line.kind !== \"context\",\n }),\n );\n };\n const renderHunk = (row: DiffHunkHeader) =>\n h(\"text\", { text: row.text, fg: props.hunkFg, bold: true, \"aria-label\": \"Diff hunk\" });\n const renderUnifiedLine = (line: DiffLine) =>\n h(\n \"box\",\n { style: { flexDirection: \"row\" }, \"aria-label\": `${line.kind} diff line` },\n [\n gutter(line.oldLine, oldLineWidth.value),\n gutter(line.newLine, newLineWidth.value),\n prefix(line),\n ...segmentNodes(line),\n ].filter((node): node is VNode => node !== undefined),\n );\n const renderSplitPane = (line: DiffLine | undefined, width: number, side: \"old\" | \"new\") =>\n h(\n \"box\",\n {\n style: { flexDirection: \"row\", flexGrow: 1 },\n \"aria-label\": `${side} diff pane`,\n },\n [\n gutter(side === \"old\" ? line?.oldLine : line?.newLine, width),\n prefix(line),\n ...segmentNodes(line),\n ].filter((node): node is VNode => node !== undefined),\n );\n const renderSplitLine = (line: SplitDiffLine) =>\n h(\"box\", { style: { flexDirection: \"row\", gap: 1 } }, [\n renderSplitPane(line.oldLine, oldLineWidth.value, \"old\"),\n renderSplitPane(line.newLine, newLineWidth.value, \"new\"),\n ]);\n const renderLabels = () => {\n if (!props.oldLabel && !props.newLabel) return undefined;\n return h(\"box\", { style: { flexDirection: \"row\", gap: 1 }, \"aria-label\": \"Diff labels\" }, [\n h(\"text\", { text: props.oldLabel ? `--- ${props.oldLabel}` : \"\" }),\n h(\"text\", { text: props.newLabel ? `+++ ${props.newLabel}` : \"\" }),\n ]);\n };\n\n return () =>\n h(\n \"box\",\n {\n style: { flexDirection: \"column\" },\n \"aria-label\": `${props.view} diff, ${rows.value.length} rows`,\n },\n [\n renderLabels(),\n ...visibleRows.value.map((row) =>\n row.kind === \"hunk\"\n ? renderHunk(row)\n : props.view === \"split\"\n ? renderSplitLine(row as SplitDiffLine)\n : renderUnifiedLine(row as DiffLine),\n ),\n ].filter((node): node is VNode => node !== undefined),\n );\n },\n});\n","<script setup lang=\"ts\">\nimport type { LinkProps } from \"./display-primitive-types.js\";\n\nconst { text, url, fg = \"blue\", underline = true, showUrl = false } = defineProps<LinkProps>();\n\ndefineOptions({ name: \"FrescoLink\" });\n\nconst rowStyle = { flexDirection: \"row\" } as const;\n</script>\n\n<template>\n <div :style=\"rowStyle\">\n <text :fg :underline>{{ text }}</text>\n <text v-if=\"showUrl && url\" :dim=\"true\"> ({{ url }})</text>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport type { LinkProps } from \"./display-primitive-types.js\";\n\nconst { text, url, fg = \"blue\", underline = true, showUrl = false } = defineProps<LinkProps>();\n\ndefineOptions({ name: \"FrescoLink\" });\n\nconst rowStyle = { flexDirection: \"row\" } as const;\n</script>\n\n<template>\n <div :style=\"rowStyle\">\n <text :fg :underline>{{ text }}</text>\n <text v-if=\"showUrl && url\" :dim=\"true\"> ({{ url }})</text>\n </div>\n</template>\n","import { graphemeLength, graphemes, sliceGraphemes } from \"../utils/text.js\";\n\nexport interface TextSelection {\n readonly anchor: number;\n readonly focus: number;\n}\n\ninterface TextSnapshot {\n readonly value: string;\n readonly selection: TextSelection;\n}\n\nexport interface TextEditingState extends TextSnapshot {\n readonly undo: readonly TextSnapshot[];\n readonly redo: readonly TextSnapshot[];\n}\n\nconst HISTORY_LIMIT = 100;\n\nfunction clampPosition(value: string, position: number): number {\n return Math.max(0, Math.min(Math.trunc(position), graphemeLength(value)));\n}\n\nfunction snapshot(state: TextEditingState): TextSnapshot {\n return { value: state.value, selection: state.selection };\n}\n\nfunction normalizeSelection(value: string, selection: TextSelection): TextSelection {\n return {\n anchor: clampPosition(value, selection.anchor),\n focus: clampPosition(value, selection.focus),\n };\n}\n\nfunction withSnapshot(\n state: TextEditingState,\n value: string,\n selection: TextSelection,\n): TextEditingState {\n const undo = [...state.undo, snapshot(state)].slice(-HISTORY_LIMIT);\n return { value, selection: normalizeSelection(value, selection), undo, redo: [] };\n}\n\nfunction isWordGrapheme(value: string): boolean {\n return /[\\p{L}\\p{N}_]/u.test(value);\n}\n\nfunction isWhitespace(value: string): boolean {\n return /^\\s+$/u.test(value);\n}\n\nexport function createTextEditingState(\n value: string,\n cursor = graphemeLength(value),\n): TextEditingState {\n const position = clampPosition(value, cursor);\n return { value, selection: { anchor: position, focus: position }, undo: [], redo: [] };\n}\n\nexport function selectionBounds(selection: TextSelection): readonly [number, number] {\n return selection.anchor <= selection.focus\n ? [selection.anchor, selection.focus]\n : [selection.focus, selection.anchor];\n}\n\nexport function hasSelection(state: TextEditingState): boolean {\n return state.selection.anchor !== state.selection.focus;\n}\n\nexport function setTextSelection(\n state: TextEditingState,\n focus: number,\n extend = false,\n): TextEditingState {\n const nextFocus = clampPosition(state.value, focus);\n return {\n ...state,\n selection: {\n anchor: extend ? state.selection.anchor : nextFocus,\n focus: nextFocus,\n },\n };\n}\n\nexport function selectAllText(state: TextEditingState): TextEditingState {\n return {\n ...state,\n selection: { anchor: 0, focus: graphemeLength(state.value) },\n };\n}\n\nexport function previousWordBoundary(value: string, position: number): number {\n const parts = graphemes(value);\n let cursor = Math.max(0, Math.min(position, parts.length));\n while (cursor > 0 && isWhitespace(parts[cursor - 1]!)) cursor--;\n if (cursor > 0 && isWordGrapheme(parts[cursor - 1]!)) {\n while (cursor > 0 && isWordGrapheme(parts[cursor - 1]!)) cursor--;\n } else {\n while (cursor > 0 && !isWhitespace(parts[cursor - 1]!) && !isWordGrapheme(parts[cursor - 1]!)) {\n cursor--;\n }\n }\n return cursor;\n}\n\nexport function nextWordBoundary(value: string, position: number): number {\n const parts = graphemes(value);\n let cursor = Math.max(0, Math.min(position, parts.length));\n if (cursor < parts.length && isWordGrapheme(parts[cursor]!)) {\n while (cursor < parts.length && isWordGrapheme(parts[cursor]!)) cursor++;\n } else if (cursor < parts.length && !isWhitespace(parts[cursor]!)) {\n while (\n cursor < parts.length &&\n !isWhitespace(parts[cursor]!) &&\n !isWordGrapheme(parts[cursor]!)\n ) {\n cursor++;\n }\n }\n while (cursor < parts.length && isWhitespace(parts[cursor]!)) cursor++;\n return cursor;\n}\n\nexport function replaceTextSelection(state: TextEditingState, text: string): TextEditingState {\n const [start, end] = selectionBounds(state.selection);\n const value = `${sliceGraphemes(state.value, 0, start)}${text}${sliceGraphemes(state.value, end)}`;\n const cursor = start + graphemeLength(text);\n if (value === state.value && start === end) return state;\n return withSnapshot(state, value, { anchor: cursor, focus: cursor });\n}\n\nexport function deleteTextBackward(state: TextEditingState, byWord = false): TextEditingState {\n if (hasSelection(state)) return replaceTextSelection(state, \"\");\n const end = state.selection.focus;\n const start = byWord ? previousWordBoundary(state.value, end) : Math.max(0, end - 1);\n if (start === end) return state;\n return replaceTextSelection({ ...state, selection: { anchor: start, focus: end } }, \"\");\n}\n\nexport function deleteTextForward(state: TextEditingState, byWord = false): TextEditingState {\n if (hasSelection(state)) return replaceTextSelection(state, \"\");\n const start = state.selection.focus;\n const end = byWord\n ? nextWordBoundary(state.value, start)\n : Math.min(graphemeLength(state.value), start + 1);\n if (start === end) return state;\n return replaceTextSelection({ ...state, selection: { anchor: start, focus: end } }, \"\");\n}\n\nexport function undoTextEdit(state: TextEditingState): TextEditingState {\n const previous = state.undo.at(-1);\n if (!previous) return state;\n return {\n ...previous,\n undo: state.undo.slice(0, -1),\n redo: [...state.redo, snapshot(state)].slice(-HISTORY_LIMIT),\n };\n}\n\nexport function redoTextEdit(state: TextEditingState): TextEditingState {\n const next = state.redo.at(-1);\n if (!next) return state;\n return {\n ...next,\n undo: [...state.undo, snapshot(state)].slice(-HISTORY_LIMIT),\n redo: state.redo.slice(0, -1),\n };\n}\n\nexport function replaceExternalText(state: TextEditingState, value: string): TextEditingState {\n if (value === state.value) return state;\n return {\n value,\n selection: normalizeSelection(value, state.selection),\n undo: [],\n redo: [],\n };\n}\n","/* eslint-disable script/one-component-per-file -- this module defines more than one component */\n/**\n * TextInput Component - Text input with builtin cursor management and IME support\n */\n\nimport { computed, defineComponent, h, ref, shallowRef, watch, type PropType } from \"vue\";\nimport { useInput } from \"../composables/useInput.js\";\nimport type { FrescoDimension, FrescoRenderStyle } from \"../protocol.js\";\nimport {\n deleteGraphemeAt,\n deleteGraphemeBefore,\n graphemeLength,\n sliceGraphemes,\n} from \"../utils/text.js\";\nimport {\n createTextEditingState,\n deleteTextBackward,\n deleteTextForward,\n hasSelection,\n nextWordBoundary,\n previousWordBoundary,\n redoTextEdit,\n replaceExternalText,\n replaceTextSelection,\n selectAllText,\n selectionBounds,\n setTextSelection,\n undoTextEdit,\n type TextEditingState,\n} from \"./text-editing.js\";\n\nexport interface TextInputProps {\n /** Input value (v-model) */\n modelValue?: string;\n /** Initial value when the input is uncontrolled. */\n defaultValue?: string;\n /** Placeholder text */\n placeholder?: string;\n /** Whether input is focused */\n focus?: boolean;\n /** Whether input is focused (Ink-style alias used by native nodes) */\n focused?: boolean;\n /** Password mode (mask input) */\n mask?: boolean;\n /** Mask character */\n maskChar?: string;\n /** Input width */ width?: FrescoDimension;\n /** Foreground color */\n fg?: string;\n /** Background color */\n bg?: string;\n /** Validate a candidate value; a string is exposed as its error message. */\n validate?: (value: string) => boolean | string | null | undefined;\n /** Called when value changes */\n \"onUpdate:modelValue\"?: (value: string) => void;\n /** Called when submitted (Enter) */\n onSubmit?: (value: string) => void;\n /** Called when escape is pressed */\n onCancel?: () => void;\n /** Called whenever the selected grapheme range changes. */\n onSelectionChange?: (start: number, end: number) => void;\n /** Called when the active selection is copied. */\n onCopy?: (value: string) => void;\n /** Called when the active selection is cut. */\n onCut?: (value: string) => void;\n /** Called when the current validation state changes. */\n onValidationChange?: (valid: boolean, message?: string) => void;\n /** Called when IME composition starts */\n onCompositionStart?: () => void;\n /** Called when IME composition updates */\n onCompositionUpdate?: (text: string, cursor: number) => void;\n /** Called when IME composition ends */\n onCompositionEnd?: (text: string) => void;\n}\n\nexport const TextInput = defineComponent({\n name: \"TextInput\",\n props: {\n modelValue: {\n type: String,\n default: undefined,\n },\n defaultValue: {\n type: String,\n default: \"\",\n },\n placeholder: {\n type: String,\n default: \"\",\n },\n focus: {\n type: Boolean,\n default: false,\n },\n focused: {\n type: Boolean,\n default: undefined,\n },\n mask: {\n type: Boolean,\n default: false,\n },\n maskChar: {\n type: String,\n default: \"*\",\n },\n width: [Number, String] as PropType<FrescoDimension>,\n fg: String,\n bg: String,\n validate: Function as PropType<TextInputProps[\"validate\"]>,\n },\n emits: [\n \"update:modelValue\",\n \"submit\",\n \"cancel\",\n \"compositionstart\",\n \"compositionupdate\",\n \"compositionend\",\n \"selectionChange\",\n \"copy\",\n \"cut\",\n \"validationChange\",\n ],\n setup(props, { emit }) {\n const initialValue = props.modelValue ?? props.defaultValue;\n const editing = shallowRef(createTextEditingState(initialValue));\n const internalValue = computed(() => editing.value.value);\n const cursorPos = computed(() => editing.value.selection.focus);\n const isComposing = ref(false);\n const compositionAnchor = ref(cursorPos.value);\n const preedit = ref(\"\");\n const preeditCursor = ref(0);\n\n const focused = computed(() => props.focused ?? props.focus);\n const validation = computed(() => {\n const result = props.validate?.(internalValue.value);\n return {\n valid: result !== false && typeof result !== \"string\",\n message: typeof result === \"string\" ? result : undefined,\n };\n });\n\n watch(validation, ({ valid, message }) => emit(\"validationChange\", valid, message), {\n immediate: true,\n });\n\n // Sync with v-model\n watch(\n () => props.modelValue,\n (newValue) => {\n if (newValue === undefined) return;\n editing.value = replaceExternalText(editing.value, newValue);\n },\n );\n\n const applyEditing = (next: TextEditingState) => {\n const previous = editing.value;\n if (next === previous) return;\n editing.value = next;\n if (next.value !== previous.value) emit(\"update:modelValue\", next.value);\n if (\n next.selection.anchor !== previous.selection.anchor ||\n next.selection.focus !== previous.selection.focus\n ) {\n emit(\"selectionChange\", ...selectionBounds(next.selection));\n }\n };\n\n // Insert text at cursor position\n const insertText = (text: string) => {\n applyEditing(replaceTextSelection(editing.value, text));\n };\n\n // Delete character before cursor (Backspace)\n const deleteBack = (byWord = false) => {\n applyEditing(deleteTextBackward(editing.value, byWord));\n };\n\n // Delete character at cursor (Delete)\n const deleteForward = (byWord = false) => {\n applyEditing(deleteTextForward(editing.value, byWord));\n };\n\n const moveLeft = (extend = false, byWord = false) => {\n const [start] = selectionBounds(editing.value.selection);\n const target =\n hasSelection(editing.value) && !extend\n ? start\n : byWord\n ? previousWordBoundary(internalValue.value, cursorPos.value)\n : cursorPos.value - 1;\n applyEditing(setTextSelection(editing.value, target, extend));\n };\n\n const moveRight = (extend = false, byWord = false) => {\n const [, end] = selectionBounds(editing.value.selection);\n const target =\n hasSelection(editing.value) && !extend\n ? end\n : byWord\n ? nextWordBoundary(internalValue.value, cursorPos.value)\n : cursorPos.value + 1;\n applyEditing(setTextSelection(editing.value, target, extend));\n };\n\n // Move cursor to start\n const moveToStart = (extend = false) => {\n applyEditing(setTextSelection(editing.value, 0, extend));\n };\n\n // Move cursor to end\n const moveToEnd = (extend = false) => {\n applyEditing(setTextSelection(editing.value, graphemeLength(internalValue.value), extend));\n };\n\n const updatePreedit = (text: string, cursor = graphemeLength(text)) => {\n if (!isComposing.value) {\n isComposing.value = true;\n compositionAnchor.value = cursorPos.value;\n emit(\"compositionstart\");\n }\n\n preedit.value = text;\n preeditCursor.value = Math.max(0, Math.min(cursor, graphemeLength(text)));\n emit(\"compositionupdate\", preedit.value, preeditCursor.value);\n };\n\n const finishComposition = (text = preedit.value) => {\n if (!isComposing.value) return;\n\n editing.value = setTextSelection(editing.value, compositionAnchor.value);\n isComposing.value = false;\n preedit.value = \"\";\n preeditCursor.value = 0;\n if (text) {\n insertText(text);\n }\n emit(\"compositionend\", text);\n };\n\n const cancelComposition = () => {\n if (!isComposing.value) return false;\n\n isComposing.value = false;\n preedit.value = \"\";\n preeditCursor.value = 0;\n editing.value = setTextSelection(editing.value, compositionAnchor.value);\n emit(\"compositionend\", \"\");\n return true;\n };\n\n const deletePreeditBack = () => {\n if (!isComposing.value || preeditCursor.value === 0) return false;\n\n preedit.value = deleteGraphemeBefore(preedit.value, preeditCursor.value);\n preeditCursor.value--;\n emit(\"compositionupdate\", preedit.value, preeditCursor.value);\n return true;\n };\n\n const deletePreeditForward = () => {\n if (!isComposing.value || preeditCursor.value >= graphemeLength(preedit.value)) {\n return false;\n }\n\n preedit.value = deleteGraphemeAt(preedit.value, preeditCursor.value);\n emit(\"compositionupdate\", preedit.value, preeditCursor.value);\n return true;\n };\n\n const movePreeditLeft = () => {\n if (!isComposing.value || preeditCursor.value === 0) return false;\n\n preeditCursor.value--;\n emit(\"compositionupdate\", preedit.value, preeditCursor.value);\n return true;\n };\n\n const movePreeditRight = () => {\n if (!isComposing.value || preeditCursor.value >= graphemeLength(preedit.value)) {\n return false;\n }\n\n preeditCursor.value++;\n emit(\"compositionupdate\", preedit.value, preeditCursor.value);\n return true;\n };\n\n const movePreeditToStart = () => {\n if (!isComposing.value) return false;\n\n preeditCursor.value = 0;\n emit(\"compositionupdate\", preedit.value, preeditCursor.value);\n return true;\n };\n\n const movePreeditToEnd = () => {\n if (!isComposing.value) return false;\n\n preeditCursor.value = graphemeLength(preedit.value);\n emit(\"compositionupdate\", preedit.value, preeditCursor.value);\n return true;\n };\n\n const displayValue = computed(() => {\n if (!isComposing.value) return internalValue.value;\n return [\n sliceGraphemes(internalValue.value, 0, compositionAnchor.value),\n preedit.value,\n sliceGraphemes(internalValue.value, compositionAnchor.value),\n ].join(\"\");\n });\n\n const displayCursor = computed(() => {\n if (!isComposing.value) return cursorPos.value;\n return compositionAnchor.value + preeditCursor.value;\n });\n\n // Use focus prop to control input handling\n const isActive = computed(() => focused.value);\n\n // Handle keyboard input when focused\n useInput({\n isActive,\n captureCtrlC: true,\n onChar: (char) => {\n if (isComposing.value) return;\n insertText(char);\n },\n onKey: (key, modifiers) => {\n const modifiedWord = modifiers.ctrl || modifiers.alt;\n if (key === \"left\") {\n if (!movePreeditLeft()) moveLeft(modifiers.shift, modifiedWord);\n } else if (key === \"right\") {\n if (!movePreeditRight()) moveRight(modifiers.shift, modifiedWord);\n } else if (key === \"backspace\") {\n if (!deletePreeditBack()) deleteBack(modifiedWord);\n } else if (key === \"delete\") {\n if (!deletePreeditForward()) deleteForward(modifiedWord);\n } else if (key === \"home\") {\n if (!movePreeditToStart()) moveToStart(modifiers.shift);\n } else if (key === \"end\") {\n if (!movePreeditToEnd()) moveToEnd(modifiers.shift);\n } else if (key === \"a\" && modifiers.ctrl) {\n if (!movePreeditToEnd()) applyEditing(selectAllText(editing.value));\n } else if (key === \"z\" && modifiers.ctrl) {\n applyEditing(modifiers.shift ? redoTextEdit(editing.value) : undoTextEdit(editing.value));\n } else if (key === \"y\" && modifiers.ctrl) {\n applyEditing(redoTextEdit(editing.value));\n } else if ((key === \"c\" || key === \"x\") && (modifiers.ctrl || modifiers.meta)) {\n if (!hasSelection(editing.value)) return;\n const [start, end] = selectionBounds(editing.value.selection);\n const selected = sliceGraphemes(internalValue.value, start, end);\n emit(key === \"c\" ? \"copy\" : \"cut\", selected);\n if (key === \"x\") applyEditing(replaceTextSelection(editing.value, \"\"));\n }\n },\n onSubmit: () => {\n if (isComposing.value) {\n finishComposition();\n return;\n }\n emit(\"submit\", internalValue.value);\n },\n onEscape: () => {\n if (cancelComposition()) return;\n emit(\"cancel\");\n },\n onCompositionStart: () => {\n isComposing.value = true;\n compositionAnchor.value = cursorPos.value;\n preedit.value = \"\";\n preeditCursor.value = 0;\n emit(\"compositionstart\");\n },\n onCompositionUpdate: updatePreedit,\n onCompositionEnd: finishComposition,\n });\n\n return () => {\n const style: FrescoRenderStyle = {};\n const [selectionStart, selectionEnd] = selectionBounds(editing.value.selection);\n if (props.width !== undefined) {\n style.width = String(props.width);\n }\n\n return h(\"input\", {\n value: displayValue.value,\n placeholder: props.placeholder,\n focused: focused.value,\n cursor: displayCursor.value,\n selectionStart: isComposing.value ? displayCursor.value : selectionStart,\n selectionEnd: isComposing.value ? displayCursor.value : selectionEnd,\n invalid: !validation.value.valid,\n validationMessage: validation.value.message,\n mask: props.mask,\n maskChar: props.maskChar,\n style,\n fg: props.fg,\n bg: props.bg,\n });\n };\n },\n});\n\n/**\n * Password input variant\n */\nexport const PasswordInput = defineComponent({\n name: \"PasswordInput\",\n props: {\n modelValue: {\n type: String,\n default: \"\",\n },\n placeholder: {\n type: String,\n default: \"Enter password...\",\n },\n focus: Boolean,\n width: [Number, String] as PropType<FrescoDimension>,\n fg: String,\n bg: String,\n },\n emits: [\"update:modelValue\", \"submit\", \"cancel\"],\n setup(props, { emit }) {\n return () =>\n h(TextInput, {\n ...props,\n mask: true,\n \"onUpdate:modelValue\": (v: string) => emit(\"update:modelValue\", v),\n onSubmit: (v: string) => emit(\"submit\", v),\n onCancel: () => emit(\"cancel\"),\n });\n },\n});\n","import { graphemes } from \"../utils/text.js\";\n\n/** Zero-based logical location in a multiline grapheme string. */\nexport interface TextAreaPoint {\n readonly line: number;\n readonly column: number;\n}\n\nfunction boundedPosition(value: string, position: number): number {\n const length = graphemes(value).length;\n return Math.max(0, Math.min(Number.isFinite(position) ? Math.trunc(position) : 0, length));\n}\n\n/** Convert a global grapheme position into its line and column. */\nexport function positionToTextAreaPoint(value: string, position: number): TextAreaPoint {\n const parts = graphemes(value);\n const end = boundedPosition(value, position);\n let line = 0;\n let column = 0;\n for (let index = 0; index < end; index++) {\n if (parts[index] === \"\\n\") {\n line++;\n column = 0;\n } else {\n column++;\n }\n }\n return { line, column };\n}\n\n/** Convert a line and column into a clamped global grapheme position. */\nexport function textAreaPointToPosition(value: string, line: number, column: number): number {\n const targetLine = Math.max(0, Number.isFinite(line) ? Math.trunc(line) : 0);\n const targetColumn = Math.max(0, Number.isFinite(column) ? Math.trunc(column) : 0);\n const parts = graphemes(value);\n let currentLine = 0;\n let currentColumn = 0;\n\n for (let index = 0; index < parts.length; index++) {\n if (currentLine === targetLine && currentColumn >= targetColumn) return index;\n if (parts[index] === \"\\n\") {\n if (currentLine === targetLine) return index;\n currentLine++;\n currentColumn = 0;\n } else {\n currentColumn++;\n }\n }\n return parts.length;\n}\n\n/** Find the start or end position of the line containing a global position. */\nexport function lineBoundary(value: string, position: number, edge: \"start\" | \"end\"): number {\n const point = positionToTextAreaPoint(value, position);\n return textAreaPointToPosition(value, point.line, edge === \"start\" ? 0 : Number.MAX_SAFE_INTEGER);\n}\n\n/** Move between logical lines while retaining the caller's preferred column. */\nexport function moveTextAreaCursorVertically(\n value: string,\n position: number,\n lineDelta: number,\n preferredColumn: number,\n): number {\n const point = positionToTextAreaPoint(value, position);\n const lastLine = value.split(\"\\n\").length - 1;\n const targetLine = Math.max(0, Math.min(lastLine, point.line + Math.trunc(lineDelta)));\n return textAreaPointToPosition(value, targetLine, preferredColumn);\n}\n","/**\n * TextArea Component - controlled or uncontrolled multiline text editing.\n */\n\nimport { computed, defineComponent, h, ref, shallowRef, watch, type PropType } from \"vue\";\nimport { useInput } from \"../composables/useInput.js\";\nimport {\n deleteGraphemeAt,\n deleteGraphemeBefore,\n graphemeLength,\n sliceGraphemes,\n} from \"../utils/text.js\";\nimport {\n createTextEditingState,\n deleteTextBackward,\n deleteTextForward,\n hasSelection,\n nextWordBoundary,\n previousWordBoundary,\n redoTextEdit,\n replaceExternalText,\n replaceTextSelection,\n selectAllText,\n selectionBounds,\n setTextSelection,\n undoTextEdit,\n type TextEditingState,\n} from \"./text-editing.js\";\nimport {\n lineBoundary,\n moveTextAreaCursorVertically,\n positionToTextAreaPoint,\n textAreaPointToPosition,\n} from \"./textarea-editing.js\";\n\nexport interface TextAreaProps {\n /** Controlled text value. */\n modelValue?: string;\n /** Initial value used when modelValue is omitted. */\n defaultValue?: string;\n /** Placeholder text. */\n placeholder?: string;\n /** Number of retained visible rows. */\n rows?: number;\n /** Whether the textarea owns keyboard input. */\n focused?: boolean;\n /** Prevent editing and render dimmed text. */\n disabled?: boolean;\n /** Show one-based line numbers. */\n lineNumbers?: boolean;\n /** Border style. */\n border?: \"single\" | \"double\" | \"rounded\" | \"none\";\n /** Foreground color. */\n fg?: string;\n /** Placeholder foreground color. */\n placeholderFg?: string;\n /** Line number foreground color. */\n lineNumberFg?: string;\n /** Controlled cursor line, zero based. */\n cursorLine?: number;\n /** Controlled cursor column, in graphemes. */\n cursorColumn?: number;\n /** Glyph rendered at the focused cursor. */\n cursor?: string;\n /** Validate the current value; a string becomes the error message. */\n validate?: (value: string) => boolean | string | null | undefined;\n}\n\nexport const TextArea = defineComponent({\n name: \"TextArea\",\n props: {\n modelValue: { type: String, default: undefined },\n defaultValue: { type: String, default: \"\" },\n placeholder: String,\n rows: { type: Number, default: 5 },\n focused: { type: Boolean, default: false },\n disabled: { type: Boolean, default: false },\n lineNumbers: { type: Boolean, default: false },\n border: {\n type: String as PropType<TextAreaProps[\"border\"]>,\n default: \"single\",\n },\n fg: String,\n placeholderFg: { type: String, default: \"gray\" },\n lineNumberFg: { type: String, default: \"gray\" },\n cursorLine: Number,\n cursorColumn: Number,\n cursor: { type: String, default: \"│\" },\n validate: Function as PropType<TextAreaProps[\"validate\"]>,\n },\n emits: [\n \"update:modelValue\",\n \"update:cursorLine\",\n \"update:cursorColumn\",\n \"submit\",\n \"cancel\",\n \"selectionChange\",\n \"copy\",\n \"cut\",\n \"validationChange\",\n \"compositionstart\",\n \"compositionupdate\",\n \"compositionend\",\n ],\n setup(props, { emit }) {\n const initialValue = props.modelValue ?? props.defaultValue;\n const initialCursor =\n props.cursorLine !== undefined || props.cursorColumn !== undefined\n ? textAreaPointToPosition(initialValue, props.cursorLine ?? 0, props.cursorColumn ?? 0)\n : graphemeLength(initialValue);\n const editing = shallowRef(createTextEditingState(initialValue, initialCursor));\n const internalValue = computed(() => editing.value.value);\n const cursorPosition = computed(() => editing.value.selection.focus);\n const isActive = computed(() => props.focused && !props.disabled);\n const isComposing = ref(false);\n const compositionAnchor = ref(cursorPosition.value);\n const preedit = ref(\"\");\n const preeditCursor = ref(0);\n const preferredColumn = ref(positionToTextAreaPoint(initialValue, initialCursor).column);\n const viewportStart = ref(0);\n\n const rowCount = computed(() => {\n const rows = Math.floor(props.rows);\n return Number.isSafeInteger(rows) && rows > 0 ? rows : 1;\n });\n const validation = computed(() => {\n const result = props.validate?.(internalValue.value);\n return {\n valid: result !== false && typeof result !== \"string\",\n message: typeof result === \"string\" ? result : undefined,\n };\n });\n\n watch(validation, ({ valid, message }) => emit(\"validationChange\", valid, message), {\n immediate: true,\n });\n watch(\n () => props.modelValue,\n (next) => {\n if (next !== undefined) editing.value = replaceExternalText(editing.value, next);\n },\n );\n watch([() => props.cursorLine, () => props.cursorColumn], ([line, column]) => {\n if (line === undefined && column === undefined) return;\n const current = positionToTextAreaPoint(internalValue.value, cursorPosition.value);\n editing.value = setTextSelection(\n editing.value,\n textAreaPointToPosition(\n internalValue.value,\n line ?? current.line,\n column ?? current.column,\n ),\n );\n });\n\n const displayValue = computed(() => {\n if (!isComposing.value) return internalValue.value;\n return [\n sliceGraphemes(internalValue.value, 0, compositionAnchor.value),\n preedit.value,\n sliceGraphemes(internalValue.value, compositionAnchor.value),\n ].join(\"\");\n });\n const displayCursor = computed(() =>\n isComposing.value\n ? compositionAnchor.value + preeditCursor.value\n : editing.value.selection.focus,\n );\n const cursorPoint = computed(() =>\n positionToTextAreaPoint(displayValue.value, displayCursor.value),\n );\n const allLines = computed(() => displayValue.value.split(\"\\n\"));\n\n watch(\n [() => cursorPoint.value.line, rowCount],\n ([line, rows]) => {\n if (line < viewportStart.value) viewportStart.value = line;\n else if (line >= viewportStart.value + rows) viewportStart.value = line - rows + 1;\n },\n { immediate: true },\n );\n\n const visibleLines = computed(() =>\n Array.from({ length: rowCount.value }, (_, offset) => {\n const line = viewportStart.value + offset;\n return { line, content: allLines.value[line] ?? \"\" };\n }),\n );\n\n const applyEditing = (next: TextEditingState, preservePreferredColumn = false) => {\n const previous = editing.value;\n if (next === previous) return;\n editing.value = next;\n if (next.value !== previous.value) emit(\"update:modelValue\", next.value);\n if (\n next.selection.anchor !== previous.selection.anchor ||\n next.selection.focus !== previous.selection.focus\n ) {\n const [start, end] = selectionBounds(next.selection);\n const point = positionToTextAreaPoint(next.value, next.selection.focus);\n emit(\"selectionChange\", start, end);\n emit(\"update:cursorLine\", point.line);\n emit(\"update:cursorColumn\", point.column);\n if (!preservePreferredColumn) preferredColumn.value = point.column;\n }\n };\n\n const insertText = (text: string) => applyEditing(replaceTextSelection(editing.value, text));\n const moveHorizontal = (delta: -1 | 1, extend: boolean, byWord: boolean) => {\n const [start, end] = selectionBounds(editing.value.selection);\n const current = editing.value.selection.focus;\n const target =\n hasSelection(editing.value) && !extend\n ? delta < 0\n ? start\n : end\n : byWord\n ? delta < 0\n ? previousWordBoundary(internalValue.value, current)\n : nextWordBoundary(internalValue.value, current)\n : current + delta;\n applyEditing(setTextSelection(editing.value, target, extend));\n };\n const moveVertical = (lines: number, extend: boolean) => {\n applyEditing(\n setTextSelection(\n editing.value,\n moveTextAreaCursorVertically(\n internalValue.value,\n editing.value.selection.focus,\n lines,\n preferredColumn.value,\n ),\n extend,\n ),\n true,\n );\n };\n\n const updatePreedit = (text: string, cursor = graphemeLength(text)) => {\n if (!isComposing.value) {\n isComposing.value = true;\n compositionAnchor.value = cursorPosition.value;\n emit(\"compositionstart\");\n }\n preedit.value = text;\n preeditCursor.value = Math.max(0, Math.min(cursor, graphemeLength(text)));\n emit(\"compositionupdate\", preedit.value, preeditCursor.value);\n };\n const finishComposition = (text = preedit.value) => {\n if (!isComposing.value) return;\n editing.value = setTextSelection(editing.value, compositionAnchor.value);\n isComposing.value = false;\n preedit.value = \"\";\n preeditCursor.value = 0;\n if (text) insertText(text);\n emit(\"compositionend\", text);\n };\n const cancelComposition = () => {\n if (!isComposing.value) return false;\n isComposing.value = false;\n preedit.value = \"\";\n preeditCursor.value = 0;\n editing.value = setTextSelection(editing.value, compositionAnchor.value);\n emit(\"compositionend\", \"\");\n return true;\n };\n const movePreedit = (delta: -1 | 1) => {\n if (!isComposing.value) return false;\n const next = preeditCursor.value + delta;\n if (next < 0 || next > graphemeLength(preedit.value)) return true;\n preeditCursor.value = next;\n emit(\"compositionupdate\", preedit.value, next);\n return true;\n };\n const deletePreedit = (forward: boolean) => {\n if (!isComposing.value) return false;\n if (forward) {\n preedit.value = deleteGraphemeAt(preedit.value, preeditCursor.value);\n } else if (preeditCursor.value > 0) {\n preedit.value = deleteGraphemeBefore(preedit.value, preeditCursor.value);\n preeditCursor.value--;\n }\n emit(\"compositionupdate\", preedit.value, preeditCursor.value);\n return true;\n };\n\n useInput({\n isActive,\n captureCtrlC: true,\n handler: (_input, key) => {\n if (!key.return) return;\n if (isComposing.value) {\n finishComposition();\n } else if (key.ctrl || key.meta) {\n emit(\"submit\", internalValue.value);\n } else {\n insertText(\"\\n\");\n }\n },\n onChar: (character) => {\n if (!isComposing.value) insertText(character);\n },\n onKey: (key, modifiers) => {\n const byWord = modifiers.ctrl || modifiers.alt;\n if (key === \"left\") {\n if (!movePreedit(-1)) moveHorizontal(-1, modifiers.shift, byWord);\n } else if (key === \"right\") {\n if (!movePreedit(1)) moveHorizontal(1, modifiers.shift, byWord);\n } else if (key === \"up\") {\n if (!isComposing.value) moveVertical(-1, modifiers.shift);\n } else if (key === \"down\") {\n if (!isComposing.value) moveVertical(1, modifiers.shift);\n } else if (key === \"pageup\") {\n if (!isComposing.value) moveVertical(-rowCount.value, modifiers.shift);\n } else if (key === \"pagedown\") {\n if (!isComposing.value) moveVertical(rowCount.value, modifiers.shift);\n } else if (key === \"backspace\") {\n if (!deletePreedit(false)) applyEditing(deleteTextBackward(editing.value, byWord));\n } else if (key === \"delete\") {\n if (!deletePreedit(true)) applyEditing(deleteTextForward(editing.value, byWord));\n } else if (key === \"home\") {\n const target = modifiers.ctrl\n ? 0\n : lineBoundary(internalValue.value, cursorPosition.value, \"start\");\n applyEditing(setTextSelection(editing.value, target, modifiers.shift));\n } else if (key === \"end\") {\n const target = modifiers.ctrl\n ? graphemeLength(internalValue.value)\n : lineBoundary(internalValue.value, cursorPosition.value, \"end\");\n applyEditing(setTextSelection(editing.value, target, modifiers.shift));\n } else if (key === \"tab\") {\n insertText(\"\\t\");\n } else if (key === \"a\" && modifiers.ctrl) {\n applyEditing(selectAllText(editing.value));\n } else if (key === \"z\" && modifiers.ctrl) {\n applyEditing(modifiers.shift ? redoTextEdit(editing.value) : undoTextEdit(editing.value));\n } else if (key === \"y\" && modifiers.ctrl) {\n applyEditing(redoTextEdit(editing.value));\n } else if ((key === \"c\" || key === \"x\") && (modifiers.ctrl || modifiers.meta)) {\n if (!hasSelection(editing.value)) return;\n const [start, end] = selectionBounds(editing.value.selection);\n const selected = sliceGraphemes(internalValue.value, start, end);\n emit(key === \"c\" ? \"copy\" : \"cut\", selected);\n if (key === \"x\") applyEditing(replaceTextSelection(editing.value, \"\"));\n }\n },\n onEscape: () => {\n if (!cancelComposition()) emit(\"cancel\");\n },\n onCompositionStart: () => updatePreedit(\"\", 0),\n onCompositionUpdate: updatePreedit,\n onCompositionEnd: finishComposition,\n });\n\n return () => {\n const lineNumberWidth = String(Math.max(allLines.value.length, 1)).length;\n const showPlaceholder = !displayValue.value && props.placeholder && !props.focused;\n const children = visibleLines.value.map(({ line, content }) => {\n const isCursorLine = props.focused && line === cursorPoint.value.line;\n const parts = [];\n\n if (props.lineNumbers) {\n parts.push(\n h(\"text\", {\n key: `ln-${line}`,\n text: `${String(line + 1).padStart(lineNumberWidth)} │ `,\n fg: props.lineNumberFg,\n dim: !isCursorLine,\n }),\n );\n }\n\n const placeholder = showPlaceholder && line === 0;\n const renderedContent = placeholder\n ? props.placeholder\n : isCursorLine\n ? `${sliceGraphemes(content, 0, cursorPoint.value.column)}${props.cursor}${sliceGraphemes(content, cursorPoint.value.column)}`\n : content || \" \";\n parts.push(\n h(\"text\", {\n key: `content-${line}`,\n text: renderedContent,\n fg: placeholder ? props.placeholderFg : props.fg,\n dim: props.disabled,\n bold: isCursorLine,\n }),\n );\n\n return h(\n \"box\",\n {\n key: `line-${line}`,\n style: { flexDirection: \"row\" },\n bg: isCursorLine ? \"gray\" : undefined,\n },\n parts,\n );\n });\n\n return h(\n \"box\",\n {\n border: props.border === \"none\" ? undefined : props.border,\n invalid: !validation.value.valid,\n validationMessage: validation.value.message,\n style: {\n flexDirection: \"column\",\n padding: props.border !== \"none\" ? 1 : 0,\n height: String(rowCount.value + (props.border !== \"none\" ? 2 : 0)),\n },\n },\n children,\n );\n };\n },\n});\n","/** Minimal shape shared by keyboard-navigable collection items. */\nexport interface NavigableCollectionItem {\n readonly disabled?: boolean;\n}\n\n/** Stateful incremental query used by keyboard typeahead interactions. */\nexport interface TypeaheadBuffer {\n /** Add a character and return the normalized query. */\n push(character: string): string;\n /** Clear the buffered query before the next character. */\n reset(): void;\n}\n\n/** Create a typeahead buffer with repeated-character cycling and an idle timeout. */\nexport function createTypeaheadBuffer(\n timeoutMs = 700,\n now: () => number = Date.now,\n): TypeaheadBuffer {\n let query = \"\";\n let lastInputAt = 0;\n\n return {\n push(character) {\n const inputAt = now();\n const normalized = character.toLocaleLowerCase();\n query =\n inputAt - lastInputAt > timeoutMs || query === normalized ? normalized : query + normalized;\n lastInputAt = inputAt;\n return query;\n },\n reset() {\n query = \"\";\n lastInputAt = 0;\n },\n };\n}\n\n/** Return the first enabled item, or -1 when the collection cannot be focused. */\nexport function firstEnabledIndex(items: readonly NavigableCollectionItem[]): number {\n return items.findIndex((item) => !item.disabled);\n}\n\n/** Return the last enabled item, or -1 when the collection cannot be focused. */\nexport function lastEnabledIndex(items: readonly NavigableCollectionItem[]): number {\n for (let index = items.length - 1; index >= 0; index--) {\n if (!items[index]?.disabled) return index;\n }\n return -1;\n}\n\n/**\n * Move to the next enabled item, wrapping at collection boundaries.\n *\n * A missing current index starts before the first item when moving forward and\n * after the last item when moving backward.\n */\nexport function adjacentEnabledIndex(\n items: readonly NavigableCollectionItem[],\n current: number,\n direction: -1 | 1,\n): number {\n if (items.length === 0) return -1;\n\n const start = current >= 0 && current < items.length ? current : direction > 0 ? -1 : 0;\n for (let distance = 1; distance <= items.length; distance++) {\n const index = (start + direction * distance + items.length) % items.length;\n if (!items[index]?.disabled) return index;\n }\n return -1;\n}\n\n/** Find the next enabled item whose label starts with the typeahead query. */\nexport function typeaheadIndex<T extends NavigableCollectionItem>(\n items: readonly T[],\n current: number,\n query: string,\n label: (item: T) => string,\n): number {\n const normalizedQuery = query.trim().toLocaleLowerCase();\n if (!normalizedQuery || items.length === 0) return current;\n\n const firstDistance = normalizedQuery.length > 1 && current >= 0 ? 0 : 1;\n for (let distance = firstDistance; distance < firstDistance + items.length; distance++) {\n const index = (Math.max(current, -1) + distance) % items.length;\n const item = items[index];\n if (!item || item.disabled) continue;\n if (label(item).toLocaleLowerCase().startsWith(normalizedQuery)) return index;\n }\n return current;\n}\n\n/** Keep a highlighted item inside a bounded visible window. */\nexport function visibleCollectionOffset(\n highlightedIndex: number,\n currentOffset: number,\n windowSize: number | undefined,\n itemCount: number,\n): number {\n if (!windowSize || windowSize <= 0 || itemCount <= windowSize || highlightedIndex < 0) return 0;\n\n const maximumOffset = itemCount - windowSize;\n if (highlightedIndex < currentOffset) return highlightedIndex;\n if (highlightedIndex >= currentOffset + windowSize) {\n return Math.min(highlightedIndex - windowSize + 1, maximumOffset);\n }\n return Math.min(currentOffset, maximumOffset);\n}\n","/**\n * Select Component - Dropdown/menu selection\n */\n\nimport { computed, defineComponent, h, ref, type PropType, type VNode, watch } from \"vue\";\nimport { useInput } from \"../composables/useInput.js\";\nimport {\n adjacentEnabledIndex,\n createTypeaheadBuffer,\n firstEnabledIndex,\n lastEnabledIndex,\n typeaheadIndex,\n visibleCollectionOffset,\n} from \"./collection-navigation.js\";\n\nexport interface SelectOption {\n label: string;\n value: string;\n disabled?: boolean;\n}\n\nexport interface SelectProps {\n /** Options to display */\n options: SelectOption[];\n /** Currently selected value */\n modelValue?: string;\n /** Placeholder text */\n placeholder?: string;\n /** Maximum visible options before the selection window scrolls */\n maxHeight?: number;\n /** Whether the select is focused */\n focused?: boolean;\n /** Indicator for selected item */\n indicator?: string;\n /** Indicator for unselected item */\n indicatorEmpty?: string;\n /** Foreground color */\n fg?: string;\n /** Background color */\n bg?: string;\n /** Selected item foreground color */\n selectedFg?: string;\n /** Selected item background color */\n selectedBg?: string;\n}\n\nexport const Select = defineComponent({\n name: \"Select\",\n props: {\n options: {\n type: Array as PropType<SelectOption[]>,\n required: true,\n },\n modelValue: String,\n placeholder: {\n type: String,\n default: \"Select an option\",\n },\n maxHeight: Number,\n focused: {\n type: Boolean,\n default: false,\n },\n indicator: {\n type: String,\n default: \"> \",\n },\n indicatorEmpty: {\n type: String,\n default: \" \",\n },\n fg: String,\n bg: String,\n selectedFg: {\n type: String,\n default: \"cyan\",\n },\n selectedBg: String,\n },\n emits: [\"update:modelValue\", \"select\"],\n setup(props, { emit }) {\n const scrollOffset = ref(0);\n const highlightedIndex = ref(-1);\n const typeahead = createTypeaheadBuffer();\n const viewportSize = computed(() => {\n if (props.maxHeight === undefined || !Number.isFinite(props.maxHeight)) return undefined;\n return props.maxHeight > 0 ? Math.max(1, Math.floor(props.maxHeight)) : undefined;\n });\n\n // Find initial index based on modelValue\n watch(\n () => props.modelValue,\n (value) => {\n const selectedIndex = props.options.findIndex(\n (option) => option.value === value && !option.disabled,\n );\n highlightedIndex.value =\n selectedIndex >= 0 ? selectedIndex : firstEnabledIndex(props.options);\n },\n { immediate: true },\n );\n\n watch(\n () => props.options,\n (options) => {\n if (\n highlightedIndex.value < 0 ||\n highlightedIndex.value >= options.length ||\n options[highlightedIndex.value]?.disabled\n ) {\n highlightedIndex.value = firstEnabledIndex(options);\n }\n },\n { deep: true },\n );\n\n watch(\n [highlightedIndex, viewportSize, () => props.options.length],\n ([index, windowSize]) => {\n scrollOffset.value = visibleCollectionOffset(\n index,\n scrollOffset.value,\n windowSize,\n props.options.length,\n );\n },\n { immediate: true },\n );\n\n const activate = () => {\n const option = props.options[highlightedIndex.value];\n if (!option || option.disabled) return;\n emit(\"update:modelValue\", option.value);\n emit(\"select\", option.value);\n };\n\n useInput({\n isActive: computed(() => props.focused),\n onArrow: (direction) => {\n if (direction !== \"up\" && direction !== \"down\") return;\n highlightedIndex.value = adjacentEnabledIndex(\n props.options,\n highlightedIndex.value,\n direction === \"up\" ? -1 : 1,\n );\n },\n onKey: (key) => {\n if (key === \"home\") highlightedIndex.value = firstEnabledIndex(props.options);\n if (key === \"end\") highlightedIndex.value = lastEnabledIndex(props.options);\n },\n onChar: (character) => {\n highlightedIndex.value = typeaheadIndex(\n props.options,\n highlightedIndex.value,\n typeahead.push(character),\n (option) => option.label,\n );\n },\n onSubmit: activate,\n });\n\n const visibleOptions = computed(() => {\n const windowSize = viewportSize.value;\n const start = windowSize === undefined ? 0 : scrollOffset.value;\n const end = windowSize === undefined ? props.options.length : start + windowSize;\n return props.options.slice(start, end).map((option, visibleIndex) => ({\n option,\n index: start + visibleIndex,\n }));\n });\n\n const scrollIndicator = computed(() => {\n const windowSize = viewportSize.value;\n if (windowSize === undefined || props.options.length <= windowSize) {\n return { showUp: false, showDown: false };\n }\n return {\n showUp: scrollOffset.value > 0,\n showDown: scrollOffset.value + windowSize < props.options.length,\n };\n });\n\n return () => {\n const children: VNode[] = [];\n if (scrollIndicator.value.showUp) {\n children.push(h(\"text\", { key: \"scroll-up\", dim: true }, \" ...\"));\n }\n\n for (const { option, index } of visibleOptions.value) {\n const isHighlighted = index === highlightedIndex.value;\n const isSelected = option.value === props.modelValue;\n const indicator = isHighlighted ? props.indicator : props.indicatorEmpty;\n\n children.push(\n h(\n \"box\",\n {\n key: option.value,\n style: { flex_direction: \"row\" },\n },\n [\n h(\n \"text\",\n {\n fg: isHighlighted ? props.selectedFg : props.fg,\n bg: isHighlighted ? props.selectedBg : props.bg,\n dim: option.disabled,\n },\n `${indicator}${option.label}${isSelected ? \" (selected)\" : \"\"}`,\n ),\n ],\n ),\n );\n }\n\n if (scrollIndicator.value.showDown) {\n children.push(h(\"text\", { key: \"scroll-down\", dim: true }, \" ...\"));\n }\n\n return h(\n \"box\",\n {\n style: { flex_direction: \"column\" },\n fg: props.fg,\n bg: props.bg,\n },\n children,\n );\n };\n },\n});\n","/**\n * Checkbox Component - Toggle checkbox\n */\n\nimport { computed, defineComponent, h } from \"vue\";\nimport { useInput } from \"../composables/useInput.js\";\n\nexport interface CheckboxProps {\n /** Whether the checkbox is checked */\n modelValue?: boolean;\n /** Label text */\n label?: string;\n /** Whether the checkbox is focused */\n focused?: boolean;\n /** Whether the checkbox is disabled */\n disabled?: boolean;\n /** Checked indicator */\n checked?: string;\n /** Unchecked indicator */\n unchecked?: string;\n /** Foreground color */\n fg?: string;\n /** Checked foreground color */\n checkedFg?: string;\n}\n\nexport const Checkbox = defineComponent({\n name: \"Checkbox\",\n props: {\n modelValue: {\n type: Boolean,\n default: false,\n },\n label: String,\n focused: {\n type: Boolean,\n default: false,\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n checked: {\n type: String,\n default: \"[x]\",\n },\n unchecked: {\n type: String,\n default: \"[ ]\",\n },\n fg: String,\n checkedFg: {\n type: String,\n default: \"green\",\n },\n },\n emits: [\"update:modelValue\", \"change\"],\n setup(props, { emit }) {\n const toggle = () => {\n if (props.disabled) return;\n const next = !props.modelValue;\n emit(\"update:modelValue\", next);\n emit(\"change\", next);\n };\n\n useInput({\n isActive: computed(() => props.focused && !props.disabled),\n onChar: (character) => {\n if (character === \" \") toggle();\n },\n onSubmit: toggle,\n });\n\n return () => {\n const indicator = props.modelValue ? props.checked : props.unchecked;\n const color = props.modelValue ? props.checkedFg : props.fg;\n\n return h(\n \"box\",\n {\n style: { flex_direction: \"row\" },\n },\n [\n h(\n \"text\",\n {\n fg: color,\n dim: props.disabled,\n bold: props.focused,\n },\n `${indicator} ${props.label ?? \"\"}`,\n ),\n ],\n );\n };\n },\n});\n","/**\n * RadioGroup Component - Radio button group selection\n */\n\nimport { computed, defineComponent, h, ref, type PropType, watch } from \"vue\";\nimport { useInput } from \"../composables/useInput.js\";\nimport {\n adjacentEnabledIndex,\n createTypeaheadBuffer,\n firstEnabledIndex,\n lastEnabledIndex,\n typeaheadIndex,\n} from \"./collection-navigation.js\";\n\nexport interface RadioOption {\n label: string;\n value: string;\n disabled?: boolean;\n}\n\nexport interface RadioGroupProps {\n /** Radio options */\n options: RadioOption[];\n /** Currently selected value */\n modelValue?: string;\n /** Layout direction */\n direction?: \"horizontal\" | \"vertical\";\n /** Focused option index */\n focusedIndex?: number;\n /** Whether the radio group owns keyboard input */\n focused?: boolean;\n /** Selected indicator */\n selected?: string;\n /** Unselected indicator */\n unselected?: string;\n /** Foreground color */\n fg?: string;\n /** Selected foreground color */\n selectedFg?: string;\n}\n\nexport const RadioGroup = defineComponent({\n name: \"RadioGroup\",\n props: {\n options: {\n type: Array as PropType<RadioOption[]>,\n required: true,\n },\n modelValue: String,\n direction: {\n type: String as PropType<\"horizontal\" | \"vertical\">,\n default: \"vertical\",\n },\n focusedIndex: Number,\n focused: {\n type: Boolean,\n default: false,\n },\n selected: {\n type: String,\n default: \"◉\",\n },\n unselected: {\n type: String,\n default: \"○\",\n },\n fg: String,\n selectedFg: {\n type: String,\n default: \"green\",\n },\n },\n emits: [\"update:modelValue\", \"change\", \"update:focusedIndex\"],\n setup(props, { emit }) {\n const highlightedIndex = ref(-1);\n const typeahead = createTypeaheadBuffer();\n\n const syncHighlight = () => {\n const requested = props.focusedIndex;\n const requestedOption = requested === undefined ? undefined : props.options[requested];\n const selectedIndex = props.options.findIndex(\n (option) => option.value === props.modelValue && !option.disabled,\n );\n highlightedIndex.value =\n requestedOption && !requestedOption.disabled\n ? (requested ?? -1)\n : selectedIndex >= 0\n ? selectedIndex\n : firstEnabledIndex(props.options);\n };\n\n watch([() => props.focusedIndex, () => props.modelValue, () => props.options], syncHighlight, {\n deep: true,\n immediate: true,\n });\n\n const setHighlight = (index: number) => {\n if (index < 0 || index === highlightedIndex.value) return;\n highlightedIndex.value = index;\n emit(\"update:focusedIndex\", index);\n };\n\n const activate = () => {\n const option = props.options[highlightedIndex.value];\n if (!option || option.disabled) return;\n emit(\"update:modelValue\", option.value);\n emit(\"change\", option.value);\n };\n\n useInput({\n isActive: computed(() => props.focused),\n onArrow: (direction) => {\n const delta =\n props.direction === \"horizontal\"\n ? direction === \"left\"\n ? -1\n : direction === \"right\"\n ? 1\n : 0\n : direction === \"up\"\n ? -1\n : direction === \"down\"\n ? 1\n : 0;\n if (delta !== 0) {\n setHighlight(\n adjacentEnabledIndex(props.options, highlightedIndex.value, delta as -1 | 1),\n );\n }\n },\n onKey: (key) => {\n if (key === \"home\") setHighlight(firstEnabledIndex(props.options));\n if (key === \"end\") setHighlight(lastEnabledIndex(props.options));\n },\n onChar: (character) => {\n if (character === \" \") {\n activate();\n return;\n }\n setHighlight(\n typeaheadIndex(\n props.options,\n highlightedIndex.value,\n typeahead.push(character),\n (option) => option.label,\n ),\n );\n },\n onSubmit: activate,\n });\n\n return () => {\n const children = props.options.map((option, index) => {\n const isSelected = option.value === props.modelValue;\n const isFocused = index === highlightedIndex.value;\n const indicator = isSelected ? props.selected : props.unselected;\n\n return h(\n \"text\",\n {\n key: option.value,\n fg: isSelected ? props.selectedFg : props.fg,\n bold: isFocused,\n dim: option.disabled,\n },\n `${indicator} ${option.label}`,\n );\n });\n\n return h(\n \"box\",\n {\n style: {\n flex_direction: props.direction === \"horizontal\" ? \"row\" : \"column\",\n gap: props.direction === \"horizontal\" ? 2 : 0,\n },\n },\n children,\n );\n };\n },\n});\n","/**\n * Confirm Component - Confirmation dialog\n */\n\nimport { computed, defineComponent, h, ref } from \"vue\";\nimport { useInput } from \"../composables/useInput.js\";\n\nexport interface ConfirmProps {\n /** Confirmation message */\n message: string;\n /** Confirm button text */\n confirmText?: string;\n /** Cancel button text */\n cancelText?: string;\n /** Whether confirm is initially selected */\n defaultConfirm?: boolean;\n /** Whether the confirmation owns keyboard input */\n focused?: boolean;\n /** Confirm button foreground color */\n confirmFg?: string;\n /** Cancel button foreground color */\n cancelFg?: string;\n /** Selected button foreground color */\n selectedFg?: string;\n}\n\nexport const Confirm = defineComponent({\n name: \"Confirm\",\n props: {\n message: {\n type: String,\n required: true,\n },\n confirmText: {\n type: String,\n default: \"Yes\",\n },\n cancelText: {\n type: String,\n default: \"No\",\n },\n defaultConfirm: {\n type: Boolean,\n default: true,\n },\n focused: {\n type: Boolean,\n default: false,\n },\n confirmFg: {\n type: String,\n default: \"green\",\n },\n cancelFg: {\n type: String,\n default: \"red\",\n },\n selectedFg: {\n type: String,\n default: \"cyan\",\n },\n },\n emits: [\"confirm\", \"cancel\", \"select\"],\n setup(props, { emit }) {\n const isConfirmSelected = ref(props.defaultConfirm);\n\n const toggle = () => {\n isConfirmSelected.value = !isConfirmSelected.value;\n };\n const activate = () => {\n emit(\"select\", isConfirmSelected.value);\n emit(isConfirmSelected.value ? \"confirm\" : \"cancel\");\n };\n\n useInput({\n isActive: computed(() => props.focused),\n onArrow: toggle,\n onKey: (key) => {\n if (key === \"tab\" || key === \"backtab\") toggle();\n },\n onChar: (character) => {\n if (character === \" \") activate();\n },\n onSubmit: activate,\n onEscape: () => emit(\"cancel\"),\n });\n\n return () => {\n return h(\n \"box\",\n {\n style: { flex_direction: \"column\" },\n },\n [\n // Message\n h(\"text\", { key: \"message\" }, props.message),\n // Buttons\n h(\n \"box\",\n {\n key: \"buttons\",\n style: {\n flex_direction: \"row\",\n gap: 2,\n margin_top: 1,\n },\n },\n [\n h(\n \"text\",\n {\n key: \"confirm\",\n fg: isConfirmSelected.value ? props.selectedFg : props.confirmFg,\n bold: isConfirmSelected.value,\n },\n `[${props.confirmText}]`,\n ),\n h(\n \"text\",\n {\n key: \"cancel\",\n fg: !isConfirmSelected.value ? props.selectedFg : props.cancelFg,\n bold: !isConfirmSelected.value,\n },\n `[${props.cancelText}]`,\n ),\n ],\n ),\n ],\n );\n };\n },\n});\n","/** Slider layout axis. */\nexport type SliderOrientation = \"horizontal\" | \"vertical\";\n\n/** Public props for the controlled Fresco Slider. */\nexport interface SliderProps {\n /** Current controlled value. */\n modelValue?: number;\n /** Inclusive lower bound. */\n min?: number;\n /** Inclusive upper bound. */\n max?: number;\n /** Arrow-key and wheel increment. */\n step?: number;\n /** PageUp/PageDown increment. Defaults to ten steps. */\n pageStep?: number;\n /** Number of terminal cells in the track. */\n length?: number;\n /** Track direction. */\n orientation?: SliderOrientation;\n /** Whether the slider owns keyboard and mouse input. */\n focused?: boolean;\n /** Prevent value changes and render a dimmed track. */\n disabled?: boolean;\n /** Glyph before the thumb. */\n filled?: string;\n /** Glyph after the thumb. */\n empty?: string;\n /** Thumb glyph. */\n thumb?: string;\n /** Unfilled track color. */\n fg?: string;\n /** Filled track color. */\n filledFg?: string;\n /** Thumb color. */\n thumbFg?: string;\n /** Accessible label for the slider. */\n label?: string;\n /** Format the current value in the accessible label. */\n formatValue?: (value: number) => string;\n}\n\n/** Finite, ordered numeric bounds used internally by Slider. */\nexport interface SliderRange {\n readonly min: number;\n readonly max: number;\n readonly step: number;\n}\n\nfunction finiteOr(value: number | undefined, fallback: number): number {\n return value !== undefined && Number.isFinite(value) ? value : fallback;\n}\n\n/** Normalize malformed public range inputs without producing NaN or infinities. */\nexport function normalizeSliderRange(\n min: number | undefined,\n max: number | undefined,\n step: number | undefined,\n): SliderRange {\n const lower = finiteOr(min, 0);\n const requestedUpper = finiteOr(max, 100);\n const upper = Math.max(lower, requestedUpper);\n const requestedStep = finiteOr(step, 1);\n return { min: lower, max: upper, step: requestedStep > 0 ? requestedStep : 1 };\n}\n\nfunction decimalPlaces(value: number): number {\n const text = value.toString().toLowerCase();\n const [coefficient = \"\", exponentText] = text.split(\"e\");\n const exponent = Number(exponentText ?? 0);\n const fractionLength = coefficient.split(\".\")[1]?.length ?? 0;\n return Math.max(0, fractionLength - exponent);\n}\n\n/** Clamp and step-align a candidate while preserving exact inclusive endpoints. */\nexport function normalizeSliderValue(value: number, range: SliderRange): number {\n const finiteValue = Number.isFinite(value) ? value : range.min;\n if (finiteValue <= range.min || range.min === range.max) return range.min;\n if (finiteValue >= range.max) return range.max;\n\n const steps = Math.round((finiteValue - range.min) / range.step);\n const snapped = range.min + steps * range.step;\n const precision = Math.min(12, Math.max(decimalPlaces(range.min), decimalPlaces(range.step)));\n return Math.min(range.max, Math.max(range.min, Number(snapped.toFixed(precision))));\n}\n\n/** Map a normalized track fraction onto the public range. */\nexport function sliderValueAtRatio(ratio: number, range: SliderRange): number {\n const boundedRatio = Number.isFinite(ratio) ? Math.min(1, Math.max(0, ratio)) : 0;\n return normalizeSliderValue(range.min + boundedRatio * (range.max - range.min), range);\n}\n","<script setup lang=\"ts\">\nimport { computed, useTemplateRef } from \"vue\";\n\nimport { useBoxMetrics, type MetricTarget } from \"../composables/useBoxMetrics.js\";\nimport { useInput } from \"../composables/useInput.js\";\nimport { useMouse } from \"../composables/useMouse.js\";\nimport type { MouseEvent } from \"../protocol.js\";\nimport { Box } from \"./Box.js\";\nimport {\n normalizeSliderRange,\n normalizeSliderValue,\n sliderValueAtRatio,\n type SliderProps,\n} from \"./slider-types.js\";\nimport { Text } from \"./Text.js\";\n\nconst {\n modelValue = 0,\n min = 0,\n max = 100,\n step = 1,\n pageStep,\n length = 20,\n orientation = \"horizontal\",\n focused = false,\n disabled = false,\n filled = \"━\",\n empty = \"─\",\n thumb = \"●\",\n fg = \"gray\",\n filledFg = \"green\",\n thumbFg = \"cyan\",\n label = \"Slider\",\n formatValue = (value: number) => String(value),\n} = defineProps<SliderProps>();\n\nconst emit = defineEmits<{\n \"update:modelValue\": [value: number];\n \"change\": [value: number];\n}>();\n\ndefineOptions({ name: \"FrescoSlider\" });\n\nconst trackRef = useTemplateRef<MetricTarget>(\"trackRef\");\nconst metrics = useBoxMetrics(trackRef);\nconst range = computed(() => normalizeSliderRange(min, max, step));\nconst value = computed(() => normalizeSliderValue(modelValue, range.value));\nconst cellCount = computed(() => {\n const cells = Math.floor(length);\n return Number.isSafeInteger(cells) && cells > 0 ? cells : 1;\n});\nconst thumbIndex = computed(() => {\n const span = range.value.max - range.value.min;\n const ratio = span === 0 ? 0 : (value.value - range.value.min) / span;\n return Math.round(ratio * (cellCount.value - 1));\n});\nconst cells = computed(() =>\n Array.from({ length: cellCount.value }, (_, index) => ({\n index,\n content: index === thumbIndex.value ? thumb : index < thumbIndex.value ? filled : empty,\n fg: index === thumbIndex.value ? thumbFg : index < thumbIndex.value ? filledFg : fg,\n })),\n);\nconst isActive = computed(() => focused && !disabled);\nconst effectivePageStep = computed(() => {\n const requested = pageStep ?? range.value.step * 10;\n return Number.isFinite(requested) && requested > 0 ? requested : range.value.step * 10;\n});\nconst ariaState = computed(() => ({\n orientation,\n valueMin: range.value.min,\n valueMax: range.value.max,\n valueNow: value.value,\n}));\nconst accessibleLabel = computed(() => `${label}: ${formatValue(value.value)}`);\nconst accessibilityProps = computed(() => ({\n ariaRole: \"slider\" as const,\n ariaLabel: accessibleLabel.value,\n ariaState: ariaState.value,\n}));\n\nfunction commit(candidate: number): void {\n if (disabled) return;\n const next = normalizeSliderValue(candidate, range.value);\n if (Object.is(next, value.value)) return;\n emit(\"update:modelValue\", next);\n emit(\"change\", next);\n}\n\nfunction adjust(delta: number): void {\n commit(value.value + delta);\n}\n\nuseInput({\n isActive,\n onArrow: (direction) => {\n if (direction === \"left\" || direction === \"down\") adjust(-range.value.step);\n if (direction === \"right\" || direction === \"up\") adjust(range.value.step);\n },\n onKey: (key) => {\n if (key === \"home\") commit(range.value.min);\n if (key === \"end\") commit(range.value.max);\n if (key === \"pageup\") adjust(effectivePageStep.value);\n if (key === \"pagedown\") adjust(-effectivePageStep.value);\n },\n});\n\nfunction containsPoint(event: MouseEvent): boolean {\n return (\n metrics.hasMeasured &&\n event.x >= metrics.left &&\n event.x < metrics.left + metrics.width &&\n event.y >= metrics.top &&\n event.y < metrics.top + metrics.height\n );\n}\n\nfunction handleMouse(event: MouseEvent): void {\n metrics.refresh();\n if (!containsPoint(event)) return;\n if (event.kind === \"scroll-up\" || event.kind === \"scroll-right\") {\n adjust(range.value.step);\n return;\n }\n if (event.kind === \"scroll-down\" || event.kind === \"scroll-left\") {\n adjust(-range.value.step);\n return;\n }\n if (event.kind !== \"down\" && event.kind !== \"drag\") return;\n\n const horizontal = orientation === \"horizontal\";\n const extent = Math.max(1, (horizontal ? metrics.width : metrics.height) - 1);\n const position = horizontal ? event.x - metrics.left : event.y - metrics.top;\n const ratio = horizontal ? position / extent : 1 - position / extent;\n commit(sliderValueAtRatio(ratio, range.value));\n}\n\nuseMouse(handleMouse, { isActive });\n</script>\n\n<template>\n <Box\n ref=\"trackRef\"\n :flex-direction=\"orientation === 'horizontal' ? 'row' : 'column'\"\n :width=\"orientation === 'horizontal' ? cellCount : 1\"\n :height=\"orientation === 'vertical' ? cellCount : 1\"\n v-bind=\"accessibilityProps\"\n >\n <Text\n v-for=\"cell in cells\"\n :key=\"cell.index\"\n :content=\"cell.content\"\n :fg=\"cell.fg\"\n :bold=\"focused && cell.index === thumbIndex\"\n :dim=\"disabled\"\n aria-hidden\n />\n </Box>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, useTemplateRef } from \"vue\";\n\nimport { useBoxMetrics, type MetricTarget } from \"../composables/useBoxMetrics.js\";\nimport { useInput } from \"../composables/useInput.js\";\nimport { useMouse } from \"../composables/useMouse.js\";\nimport type { MouseEvent } from \"../protocol.js\";\nimport { Box } from \"./Box.js\";\nimport {\n normalizeSliderRange,\n normalizeSliderValue,\n sliderValueAtRatio,\n type SliderProps,\n} from \"./slider-types.js\";\nimport { Text } from \"./Text.js\";\n\nconst {\n modelValue = 0,\n min = 0,\n max = 100,\n step = 1,\n pageStep,\n length = 20,\n orientation = \"horizontal\",\n focused = false,\n disabled = false,\n filled = \"━\",\n empty = \"─\",\n thumb = \"●\",\n fg = \"gray\",\n filledFg = \"green\",\n thumbFg = \"cyan\",\n label = \"Slider\",\n formatValue = (value: number) => String(value),\n} = defineProps<SliderProps>();\n\nconst emit = defineEmits<{\n \"update:modelValue\": [value: number];\n \"change\": [value: number];\n}>();\n\ndefineOptions({ name: \"FrescoSlider\" });\n\nconst trackRef = useTemplateRef<MetricTarget>(\"trackRef\");\nconst metrics = useBoxMetrics(trackRef);\nconst range = computed(() => normalizeSliderRange(min, max, step));\nconst value = computed(() => normalizeSliderValue(modelValue, range.value));\nconst cellCount = computed(() => {\n const cells = Math.floor(length);\n return Number.isSafeInteger(cells) && cells > 0 ? cells : 1;\n});\nconst thumbIndex = computed(() => {\n const span = range.value.max - range.value.min;\n const ratio = span === 0 ? 0 : (value.value - range.value.min) / span;\n return Math.round(ratio * (cellCount.value - 1));\n});\nconst cells = computed(() =>\n Array.from({ length: cellCount.value }, (_, index) => ({\n index,\n content: index === thumbIndex.value ? thumb : index < thumbIndex.value ? filled : empty,\n fg: index === thumbIndex.value ? thumbFg : index < thumbIndex.value ? filledFg : fg,\n })),\n);\nconst isActive = computed(() => focused && !disabled);\nconst effectivePageStep = computed(() => {\n const requested = pageStep ?? range.value.step * 10;\n return Number.isFinite(requested) && requested > 0 ? requested : range.value.step * 10;\n});\nconst ariaState = computed(() => ({\n orientation,\n valueMin: range.value.min,\n valueMax: range.value.max,\n valueNow: value.value,\n}));\nconst accessibleLabel = computed(() => `${label}: ${formatValue(value.value)}`);\nconst accessibilityProps = computed(() => ({\n ariaRole: \"slider\" as const,\n ariaLabel: accessibleLabel.value,\n ariaState: ariaState.value,\n}));\n\nfunction commit(candidate: number): void {\n if (disabled) return;\n const next = normalizeSliderValue(candidate, range.value);\n if (Object.is(next, value.value)) return;\n emit(\"update:modelValue\", next);\n emit(\"change\", next);\n}\n\nfunction adjust(delta: number): void {\n commit(value.value + delta);\n}\n\nuseInput({\n isActive,\n onArrow: (direction) => {\n if (direction === \"left\" || direction === \"down\") adjust(-range.value.step);\n if (direction === \"right\" || direction === \"up\") adjust(range.value.step);\n },\n onKey: (key) => {\n if (key === \"home\") commit(range.value.min);\n if (key === \"end\") commit(range.value.max);\n if (key === \"pageup\") adjust(effectivePageStep.value);\n if (key === \"pagedown\") adjust(-effectivePageStep.value);\n },\n});\n\nfunction containsPoint(event: MouseEvent): boolean {\n return (\n metrics.hasMeasured &&\n event.x >= metrics.left &&\n event.x < metrics.left + metrics.width &&\n event.y >= metrics.top &&\n event.y < metrics.top + metrics.height\n );\n}\n\nfunction handleMouse(event: MouseEvent): void {\n metrics.refresh();\n if (!containsPoint(event)) return;\n if (event.kind === \"scroll-up\" || event.kind === \"scroll-right\") {\n adjust(range.value.step);\n return;\n }\n if (event.kind === \"scroll-down\" || event.kind === \"scroll-left\") {\n adjust(-range.value.step);\n return;\n }\n if (event.kind !== \"down\" && event.kind !== \"drag\") return;\n\n const horizontal = orientation === \"horizontal\";\n const extent = Math.max(1, (horizontal ? metrics.width : metrics.height) - 1);\n const position = horizontal ? event.x - metrics.left : event.y - metrics.top;\n const ratio = horizontal ? position / extent : 1 - position / extent;\n commit(sliderValueAtRatio(ratio, range.value));\n}\n\nuseMouse(handleMouse, { isActive });\n</script>\n\n<template>\n <Box\n ref=\"trackRef\"\n :flex-direction=\"orientation === 'horizontal' ? 'row' : 'column'\"\n :width=\"orientation === 'horizontal' ? cellCount : 1\"\n :height=\"orientation === 'vertical' ? cellCount : 1\"\n v-bind=\"accessibilityProps\"\n >\n <Text\n v-for=\"cell in cells\"\n :key=\"cell.index\"\n :content=\"cell.content\"\n :fg=\"cell.fg\"\n :bold=\"focused && cell.index === thumbIndex\"\n :dim=\"disabled\"\n aria-hidden\n />\n </Box>\n</template>\n","/**\n * Form Component - Form container with labels\n */\n\nimport { computed, defineComponent, h, ref, type PropType, type VNode, watch } from \"vue\";\nimport { useInput } from \"../composables/useInput.js\";\nimport {\n adjacentEnabledIndex,\n firstEnabledIndex,\n lastEnabledIndex,\n} from \"./collection-navigation.js\";\n\n/** Values submitted and validated by Form, keyed by field key. */\nexport type FormValues = Readonly<Record<string, unknown>>;\n\n/** Validation messages keyed by field key. */\nexport type FormErrors = Readonly<Record<string, string>>;\n\n/** Metadata and validation contract for one named Form slot. */\nexport interface FormField {\n key: string;\n label: string;\n required?: boolean;\n disabled?: boolean;\n hint?: string;\n validate?: (value: unknown, values: FormValues) => boolean | string | null | undefined;\n}\n\n/** Props passed to each named field slot. */\nexport interface FormSlotProps {\n readonly field: FormField;\n readonly focused: boolean;\n readonly error?: string;\n}\n\n/** Public props for the focus- and validation-aware Form container. */\nexport interface FormProps {\n /** Form fields metadata */\n fields?: FormField[];\n /** Label width */\n labelWidth?: number;\n /** Gap between fields */\n gap?: number;\n /** Label position */\n labelPosition?: \"left\" | \"top\";\n /** Label foreground color */\n labelFg?: string;\n /** Required indicator */\n requiredIndicator?: string;\n /** Hint foreground color */\n hintFg?: string;\n /** Validation error foreground color */\n errorFg?: string;\n /** Current field values keyed by field key */\n modelValue?: FormValues;\n /** Field key that owns focus */\n focusedKey?: string;\n /** Whether the form owns keyboard focus navigation and submission */\n focused?: boolean;\n}\n\nexport const Form = defineComponent({\n name: \"Form\",\n props: {\n fields: {\n type: Array as PropType<FormField[]>,\n default: () => [],\n },\n labelWidth: {\n type: Number,\n default: 15,\n },\n gap: {\n type: Number,\n default: 1,\n },\n labelPosition: {\n type: String as PropType<\"left\" | \"top\">,\n default: \"left\",\n },\n labelFg: String,\n requiredIndicator: {\n type: String,\n default: \"*\",\n },\n hintFg: {\n type: String,\n default: \"gray\",\n },\n errorFg: {\n type: String,\n default: \"red\",\n },\n modelValue: {\n type: Object as PropType<FormValues>,\n default: () => ({}),\n },\n focusedKey: String,\n focused: {\n type: Boolean,\n default: false,\n },\n },\n emits: [\"update:focusedKey\", \"submit\", \"invalid\"],\n setup(props, { emit, slots }) {\n const enabledFields = computed(() => props.fields.filter((field) => !field.disabled));\n const highlightedIndex = ref(-1);\n\n const validationErrors = computed<Record<string, string>>(() => {\n const errors: Record<string, string> = {};\n for (const field of props.fields) {\n if (field.disabled) continue;\n const value = props.modelValue[field.key];\n const empty =\n value === undefined ||\n value === null ||\n value === \"\" ||\n (Array.isArray(value) && value.length === 0);\n if (field.required && empty) {\n errors[field.key] = `${field.label} is required.`;\n continue;\n }\n if (empty || !field.validate) continue;\n const result = field.validate(value, props.modelValue);\n if (result === false) errors[field.key] = `${field.label} is invalid.`;\n else if (typeof result === \"string\") errors[field.key] = result;\n }\n return errors;\n });\n\n const syncHighlight = () => {\n const requestedIndex = enabledFields.value.findIndex(\n (field) => field.key === props.focusedKey,\n );\n highlightedIndex.value =\n requestedIndex >= 0\n ? requestedIndex\n : highlightedIndex.value >= 0 && highlightedIndex.value < enabledFields.value.length\n ? highlightedIndex.value\n : firstEnabledIndex(enabledFields.value);\n };\n\n watch([() => props.focusedKey, enabledFields], syncHighlight, {\n deep: true,\n immediate: true,\n });\n\n const setHighlight = (index: number) => {\n const field = enabledFields.value[index];\n if (!field || index === highlightedIndex.value) return;\n highlightedIndex.value = index;\n emit(\"update:focusedKey\", field.key);\n };\n\n const submit = () => {\n const errors = validationErrors.value;\n const firstInvalidKey = Object.keys(errors).at(0);\n if (firstInvalidKey) {\n emit(\"invalid\", errors);\n setHighlight(enabledFields.value.findIndex((field) => field.key === firstInvalidKey));\n return;\n }\n emit(\"submit\", props.modelValue);\n };\n\n useInput({\n isActive: computed(() => props.focused),\n onArrow: (direction) => {\n if (direction !== \"up\" && direction !== \"down\") return;\n setHighlight(\n adjacentEnabledIndex(\n enabledFields.value,\n highlightedIndex.value,\n direction === \"up\" ? -1 : 1,\n ),\n );\n },\n onKey: (key, modifiers) => {\n if (key === \"tab\" || key === \"backtab\") {\n setHighlight(\n adjacentEnabledIndex(\n enabledFields.value,\n highlightedIndex.value,\n key === \"backtab\" || modifiers.shift ? -1 : 1,\n ),\n );\n }\n if (key === \"home\") setHighlight(firstEnabledIndex(enabledFields.value));\n if (key === \"end\") setHighlight(lastEnabledIndex(enabledFields.value));\n },\n onSubmit: submit,\n });\n\n return () => {\n const children: VNode[] = [];\n\n props.fields.forEach((field, _index) => {\n const enabledIndex = enabledFields.value.findIndex(\n (candidate) => candidate.key === field.key,\n );\n const isFocused = enabledIndex >= 0 && enabledIndex === highlightedIndex.value;\n const error = validationErrors.value[field.key];\n const labelContent = [\n h(\n \"text\",\n {\n fg: props.labelFg,\n bold: props.focused && isFocused,\n dim: field.disabled,\n },\n field.label.padEnd(props.labelWidth),\n ),\n ];\n\n if (field.required) {\n labelContent.push(h(\"text\", { fg: \"red\" }, props.requiredIndicator));\n }\n\n const slotProps: FormSlotProps = { field, focused: isFocused, error };\n const fieldSlot = slots[field.key]?.(slotProps);\n\n if (props.labelPosition === \"top\") {\n children.push(\n h(\n \"box\",\n {\n key: field.key,\n style: { flex_direction: \"column\", margin_bottom: props.gap },\n },\n [\n h(\"box\", { style: { flex_direction: \"row\" } }, labelContent),\n fieldSlot ? h(\"box\", { style: { margin_top: 0.5 } }, fieldSlot) : null,\n field.hint ? h(\"text\", { fg: props.hintFg, dim: true }, field.hint) : null,\n error ? h(\"text\", { fg: props.errorFg }, error) : null,\n ].filter(Boolean),\n ),\n );\n } else {\n children.push(\n h(\n \"box\",\n {\n key: field.key,\n style: {\n flex_direction: \"row\",\n align_items: \"center\",\n margin_bottom: props.gap,\n },\n },\n [\n h(\n \"box\",\n { style: { width: String(props.labelWidth), flex_direction: \"row\" } },\n labelContent,\n ),\n h(\"box\", { style: { flex_grow: 1 } }, fieldSlot),\n ],\n ),\n );\n\n if (field.hint) {\n children.push(\n h(\n \"text\",\n {\n key: `hint-${field.key}`,\n fg: props.hintFg,\n dim: true,\n style: { margin_left: props.labelWidth, margin_bottom: props.gap },\n },\n field.hint,\n ),\n );\n }\n if (error) {\n children.push(\n h(\n \"text\",\n {\n key: `error-${field.key}`,\n fg: props.errorFg,\n style: { margin_left: props.labelWidth, margin_bottom: props.gap },\n },\n error,\n ),\n );\n }\n }\n });\n\n return h(\"box\", { style: { flex_direction: \"column\" } }, children);\n };\n },\n});\n","import type { FrescoStyle } from \"../protocol.js\";\n\n/** Public props for the Static output component. */\nexport interface StaticProps<T = unknown> {\n /** Items to render. */\n items: T[];\n /** Optional container style. */\n style?: FrescoStyle;\n /** Render item callback retained for Ink API parity. */\n children?: (item: T, index: number) => unknown;\n}\n\n/** Public props for the terminal Link component. */\nexport interface LinkProps {\n /** Link text. */\n text: string;\n /** URL displayed alongside the text when requested. */\n url?: string;\n /** Foreground color. Defaults to blue. */\n fg?: string;\n /** Whether to underline the link text. Defaults to true. */\n underline?: boolean;\n /** Whether to show the URL in parentheses. Defaults to false. */\n showUrl?: boolean;\n}\n\n/** Visual variant supported by Badge. */\nexport type BadgeVariant = \"default\" | \"success\" | \"warning\" | \"error\" | \"info\";\n\n/** Public props for the Badge component. */\nexport interface BadgeProps {\n /** Badge text. */\n label: string;\n /** Badge variant. Defaults to default. */\n variant?: BadgeVariant;\n /** Custom foreground color that overrides the variant. */\n fg?: string;\n /** Custom background color that overrides the variant. */\n bg?: string;\n /** Whether to show a border. Defaults to false. */\n border?: boolean;\n}\n\n/** Default foreground and background colors for each Badge variant. */\nexport const badgeVariantColors: Record<BadgeVariant, { fg: string; bg?: string }> = {\n default: { fg: \"white\" },\n success: { fg: \"green\" },\n warning: { fg: \"yellow\" },\n error: { fg: \"red\" },\n info: { fg: \"cyan\" },\n};\n\n/** Built-in animation frame sets for Spinner. */\nexport const spinnerTypes = {\n dots: [\"⠋\", \"⠙\", \"⠹\", \"⠸\", \"⠼\", \"⠴\", \"⠦\", \"⠧\", \"⠇\", \"⠏\"],\n dots2: [\"⣾\", \"⣽\", \"⣻\", \"⢿\", \"⡿\", \"⣟\", \"⣯\", \"⣷\"],\n line: [\"-\", \"\\\\\", \"|\", \"/\"],\n arc: [\"◜\", \"◠\", \"◝\", \"◞\", \"◡\", \"◟\"],\n circle: [\"◐\", \"◓\", \"◑\", \"◒\"],\n bounce: [\"⠁\", \"⠂\", \"⠄\", \"⡀\", \"⢀\", \"⠠\", \"⠐\", \"⠈\"],\n box: [\"▖\", \"▘\", \"▝\", \"▗\"],\n arrow: [\"←\", \"↖\", \"↑\", \"↗\", \"→\", \"↘\", \"↓\", \"↙\"],\n clock: [\"🕛\", \"🕐\", \"🕑\", \"🕒\", \"🕓\", \"🕔\", \"🕕\", \"🕖\", \"🕗\", \"🕘\", \"🕙\", \"🕚\"],\n moon: [\"🌑\", \"🌒\", \"🌓\", \"🌔\", \"🌕\", \"🌖\", \"🌗\", \"🌘\"],\n earth: [\"🌍\", \"🌎\", \"🌏\"],\n} as const;\n\n/** Name of a built-in Spinner frame set. */\nexport type SpinnerType = keyof typeof spinnerTypes;\n\n/** Public props for the Spinner component. */\nexport interface SpinnerProps {\n /** Built-in frame set. Defaults to dots. */\n type?: SpinnerType;\n /** Custom animation frames. */\n frames?: string[];\n /** Animation interval in milliseconds. Defaults to 80. */\n interval?: number;\n /** Optional label rendered after the frame. */\n label?: string;\n /** Foreground color. */\n fg?: string;\n}\n","<script setup lang=\"ts\">\nimport { computed, onMounted, onUnmounted, ref } from \"vue\";\n\nimport { Text } from \"./Text.js\";\nimport { spinnerTypes, type SpinnerProps } from \"./display-primitive-types.js\";\n\nconst {\n type = \"dots\",\n interval = 80,\n frames: customFrames,\n label,\n fg,\n} = defineProps<SpinnerProps>();\n\ndefineOptions({ name: \"Spinner\" });\n\nconst frameIndex = ref(0);\nconst frames = computed(() => {\n const selectedFrames = customFrames ?? spinnerTypes[type] ?? spinnerTypes.dots;\n return selectedFrames.length > 0 ? selectedFrames : spinnerTypes.dots;\n});\nconst content = computed(() => {\n const frame = frames.value[frameIndex.value % frames.value.length];\n return label ? `${frame} ${label}` : frame;\n});\n\nlet timer: ReturnType<typeof setInterval> | null = null;\n\nonMounted(() => {\n timer = setInterval(() => {\n frameIndex.value = (frameIndex.value + 1) % frames.value.length;\n }, interval);\n});\n\nonUnmounted(() => {\n if (timer) clearInterval(timer);\n});\n</script>\n\n<template>\n <Text :content :fg />\n</template>\n","<script setup lang=\"ts\">\nimport { computed, onMounted, onUnmounted, ref } from \"vue\";\n\nimport { Text } from \"./Text.js\";\nimport { spinnerTypes, type SpinnerProps } from \"./display-primitive-types.js\";\n\nconst {\n type = \"dots\",\n interval = 80,\n frames: customFrames,\n label,\n fg,\n} = defineProps<SpinnerProps>();\n\ndefineOptions({ name: \"Spinner\" });\n\nconst frameIndex = ref(0);\nconst frames = computed(() => {\n const selectedFrames = customFrames ?? spinnerTypes[type] ?? spinnerTypes.dots;\n return selectedFrames.length > 0 ? selectedFrames : spinnerTypes.dots;\n});\nconst content = computed(() => {\n const frame = frames.value[frameIndex.value % frames.value.length];\n return label ? `${frame} ${label}` : frame;\n});\n\nlet timer: ReturnType<typeof setInterval> | null = null;\n\nonMounted(() => {\n timer = setInterval(() => {\n frameIndex.value = (frameIndex.value + 1) % frames.value.length;\n }, interval);\n});\n\nonUnmounted(() => {\n if (timer) clearInterval(timer);\n});\n</script>\n\n<template>\n <Text :content :fg />\n</template>\n","/* eslint-disable script/one-component-per-file -- this module defines more than one component */\n/**\n * ProgressBar Component - Progress indicator\n */\n\nimport { defineComponent, h, computed, type PropType } from \"vue\";\nimport { Box } from \"./Box.js\";\nimport { Text } from \"./Text.js\";\n\nexport interface ProgressBarProps {\n /** Progress value (0-100) */\n value: number;\n /** Total width in characters */\n width?: number;\n /** Show percentage label */\n showLabel?: boolean;\n /** Label position */\n labelPosition?: \"left\" | \"right\" | \"inside\";\n /** Filled character */\n filledChar?: string;\n /** Empty character */\n emptyChar?: string;\n /** Left border character */\n leftBorder?: string;\n /** Right border character */\n rightBorder?: string;\n /** Filled color */\n filledFg?: string;\n /** Empty color */\n emptyFg?: string;\n}\n\nexport const ProgressBar = defineComponent({\n name: \"ProgressBar\",\n props: {\n value: {\n type: Number,\n required: true,\n validator: (v: number) => v >= 0 && v <= 100,\n },\n width: {\n type: Number,\n default: 20,\n },\n showLabel: {\n type: Boolean,\n default: true,\n },\n labelPosition: {\n type: String as PropType<\"left\" | \"right\" | \"inside\">,\n default: \"right\",\n },\n filledChar: {\n type: String,\n default: \"█\",\n },\n emptyChar: {\n type: String,\n default: \"░\",\n },\n leftBorder: {\n type: String,\n default: \"\",\n },\n rightBorder: {\n type: String,\n default: \"\",\n },\n filledFg: {\n type: String,\n default: \"green\",\n },\n emptyFg: {\n type: String,\n default: \"gray\",\n },\n },\n setup(props) {\n const normalizedValue = computed(() => Math.max(0, Math.min(100, props.value)));\n\n const filledWidth = computed(() => Math.round((normalizedValue.value / 100) * props.width));\n\n const emptyWidth = computed(() => props.width - filledWidth.value);\n\n const label = computed(() => `${Math.round(normalizedValue.value)}%`);\n\n return () => {\n const filled = props.filledChar.repeat(filledWidth.value);\n const empty = props.emptyChar.repeat(emptyWidth.value);\n\n const barContent = [\n props.leftBorder && h(Text, {}, () => props.leftBorder),\n h(Text, { fg: props.filledFg }, () => filled),\n h(Text, { fg: props.emptyFg }, () => empty),\n props.rightBorder && h(Text, {}, () => props.rightBorder),\n ].filter(Boolean);\n\n if (!props.showLabel) {\n return h(Box, { flexDirection: \"row\" }, () => barContent);\n }\n\n const labelElement = h(Text, { dim: true }, () => label.value);\n\n switch (props.labelPosition) {\n case \"left\":\n return h(Box, { flexDirection: \"row\", gap: 1 }, () => [labelElement, ...barContent]);\n case \"inside\":\n // For inside, we'd need more complex rendering\n // For now, show on right\n return h(Box, { flexDirection: \"row\", gap: 1 }, () => [...barContent, labelElement]);\n case \"right\":\n default:\n return h(Box, { flexDirection: \"row\", gap: 1 }, () => [...barContent, labelElement]);\n }\n };\n },\n});\n\n/**\n * Indeterminate progress bar (animated)\n */\nexport const IndeterminateProgressBar = defineComponent({\n name: \"IndeterminateProgressBar\",\n props: {\n width: {\n type: Number,\n default: 20,\n },\n fg: {\n type: String,\n default: \"cyan\",\n },\n },\n setup(props) {\n // This would need animation support\n // For now, show a static pattern\n return () => {\n const pattern = \"▓▒░░░░░░░░░░░░░░░░░░\";\n const display = pattern.slice(0, props.width);\n\n return h(Text, { fg: props.fg }, () => display);\n };\n },\n});\n","export type AlertType = \"info\" | \"success\" | \"warning\" | \"error\";\n\nexport interface AlertProps {\n /** Alert message */\n message: string;\n /** Alert type */\n type?: AlertType;\n /** Alert title */\n title?: string;\n /** Show icon */\n showIcon?: boolean;\n /** Border style */\n border?: \"single\" | \"double\" | \"rounded\" | \"none\";\n}\n\n/** Visual defaults for each alert type. */\nexport const alertConfigs: Record<AlertType, { icon: string; fg: string; title: string }> = {\n info: { icon: \"ℹ\", fg: \"cyan\", title: \"Info\" },\n success: { icon: \"✓\", fg: \"green\", title: \"Success\" },\n warning: { icon: \"⚠\", fg: \"yellow\", title: \"Warning\" },\n error: { icon: \"✗\", fg: \"red\", title: \"Error\" },\n};\n\nexport type AvatarStatus = \"online\" | \"offline\" | \"away\" | \"busy\";\n\nexport interface AvatarProps {\n /** User name used to generate initials */\n name?: string;\n /** Custom initials */\n initials?: string;\n /** Avatar size */\n size?: \"sm\" | \"md\" | \"lg\";\n /** Background color */\n bg?: string;\n /** Foreground color */\n fg?: string;\n /** Show border */\n border?: boolean;\n /** Status indicator */\n status?: AvatarStatus;\n}\n\n/** Foreground colors for avatar statuses. */\nexport const avatarStatusColors: Record<AvatarStatus, string> = {\n online: \"green\",\n offline: \"gray\",\n away: \"yellow\",\n busy: \"red\",\n};\n\n/** Glyphs for avatar statuses. */\nexport const avatarStatusIcons: Record<AvatarStatus, string> = {\n online: \"●\",\n offline: \"○\",\n away: \"◐\",\n busy: \"⊘\",\n};\n\nexport interface BreadcrumbItem {\n /** Stable item key */\n key: string;\n /** Visible label */\n label: string;\n /** Optional leading icon */\n icon?: string;\n}\n\nexport interface BreadcrumbProps {\n /** Breadcrumb items */\n items: BreadcrumbItem[];\n /** Separator */\n separator?: string;\n /** Foreground color */\n fg?: string;\n /** Active item foreground color */\n activeFg?: string;\n /** Separator foreground color */\n separatorFg?: string;\n}\n\nexport interface CardProps {\n /** Card title */\n title?: string;\n /** Card subtitle */\n subtitle?: string;\n /** Footer text */\n footer?: string;\n /** Border style */\n border?: \"single\" | \"double\" | \"rounded\" | \"heavy\" | \"none\";\n /** Padding */\n padding?: number;\n /** Title foreground color */\n titleFg?: string;\n /** Border foreground color */\n borderFg?: string;\n /** Background color */\n bg?: string;\n}\n\nexport interface HeaderProps {\n /** Header title */\n title: string;\n /** Subtitle */\n subtitle?: string;\n /** Left fallback content */\n left?: string;\n /** Right fallback content */\n right?: string;\n /** Background color */\n bg?: string;\n /** Title foreground color */\n titleFg?: string;\n /** Subtitle foreground color */\n subtitleFg?: string;\n /** Show a bottom border */\n borderBottom?: boolean;\n}\n\nexport type TooltipPosition = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nexport interface TooltipProps {\n /** Tooltip text */\n text: string;\n /** Whether the tooltip is visible */\n visible?: boolean;\n /** Tooltip position */\n position?: TooltipPosition;\n /** Gap in terminal cells between the anchor and tooltip. */\n offset?: number;\n /** Border style */\n border?: \"single\" | \"rounded\" | \"none\";\n /** Background color */\n bg?: string;\n /** Foreground color */\n fg?: string;\n}\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\nimport { alertConfigs, type AlertProps } from \"./presentational-primitive-types.js\";\n\nconst {\n message,\n type = \"info\",\n title,\n showIcon = true,\n border = \"rounded\",\n} = defineProps<AlertProps>();\n\ndefineOptions({ name: \"FrescoAlert\" });\n\nconst config = computed(() => alertConfigs[type]);\nconst heading = computed(() => title ?? config.value.title);\nconst iconLabel = computed(() => `${config.value.icon} `);\nconst containerStyle = { flexDirection: \"column\", padding: 1 } as const;\nconst headerStyle = { flexDirection: \"row\" } as const;\nconst messageStyle = { marginTop: 1 } as const;\n</script>\n\n<template>\n <div :border=\"border === 'none' ? undefined : border\" :fg=\"config.fg\" :style=\"containerStyle\">\n <div :style=\"headerStyle\">\n <text v-if=\"showIcon\" :fg=\"config.fg\">{{ iconLabel }}</text>\n <text :fg=\"config.fg\" :bold=\"true\">{{ heading }}</text>\n </div>\n <text :style=\"messageStyle\">{{ message }}</text>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\nimport { alertConfigs, type AlertProps } from \"./presentational-primitive-types.js\";\n\nconst {\n message,\n type = \"info\",\n title,\n showIcon = true,\n border = \"rounded\",\n} = defineProps<AlertProps>();\n\ndefineOptions({ name: \"FrescoAlert\" });\n\nconst config = computed(() => alertConfigs[type]);\nconst heading = computed(() => title ?? config.value.title);\nconst iconLabel = computed(() => `${config.value.icon} `);\nconst containerStyle = { flexDirection: \"column\", padding: 1 } as const;\nconst headerStyle = { flexDirection: \"row\" } as const;\nconst messageStyle = { marginTop: 1 } as const;\n</script>\n\n<template>\n <div :border=\"border === 'none' ? undefined : border\" :fg=\"config.fg\" :style=\"containerStyle\">\n <div :style=\"headerStyle\">\n <text v-if=\"showIcon\" :fg=\"config.fg\">{{ iconLabel }}</text>\n <text :fg=\"config.fg\" :bold=\"true\">{{ heading }}</text>\n </div>\n <text :style=\"messageStyle\">{{ message }}</text>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\nimport { badgeVariantColors, type BadgeProps } from \"./display-primitive-types.js\";\n\nconst { label, variant = \"default\", border = false, fg, bg } = defineProps<BadgeProps>();\n\ndefineOptions({ name: \"Badge\" });\n\nconst colors = computed(() => badgeVariantColors[variant]);\nconst foreground = computed(() => fg ?? colors.value.fg);\nconst background = computed(() => bg ?? colors.value.bg);\nconst borderStyle = { paddingLeft: 1, paddingRight: 1 } as const;\n</script>\n\n<template>\n <div v-if=\"border\" border=\"single\" :fg=\"foreground\" :bg=\"background\" :style=\"borderStyle\">\n <text :fg=\"foreground\" :bg=\"background\">{{ label }}</text>\n </div>\n <text v-else :fg=\"foreground\" :bg=\"background\" :bold=\"true\">[{{ label }}]</text>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\nimport { badgeVariantColors, type BadgeProps } from \"./display-primitive-types.js\";\n\nconst { label, variant = \"default\", border = false, fg, bg } = defineProps<BadgeProps>();\n\ndefineOptions({ name: \"Badge\" });\n\nconst colors = computed(() => badgeVariantColors[variant]);\nconst foreground = computed(() => fg ?? colors.value.fg);\nconst background = computed(() => bg ?? colors.value.bg);\nconst borderStyle = { paddingLeft: 1, paddingRight: 1 } as const;\n</script>\n\n<template>\n <div v-if=\"border\" border=\"single\" :fg=\"foreground\" :bg=\"background\" :style=\"borderStyle\">\n <text :fg=\"foreground\" :bg=\"background\">{{ label }}</text>\n </div>\n <text v-else :fg=\"foreground\" :bg=\"background\" :bold=\"true\">[{{ label }}]</text>\n</template>\n","/**\n * Timer Component - Countdown/stopwatch timer\n */\n\nimport { defineComponent, h, ref, onMounted, onUnmounted, type PropType, computed } from \"vue\";\n\nexport type TimerMode = \"countdown\" | \"stopwatch\";\n\nexport interface TimerProps {\n /** Timer mode */\n mode?: TimerMode;\n /** Initial seconds (for countdown) */\n initialSeconds?: number;\n /** Auto start */\n autoStart?: boolean;\n /** Show hours */\n showHours?: boolean;\n /** Show milliseconds */\n showMilliseconds?: boolean;\n /** Foreground color */\n fg?: string;\n /** Warning color (when < 10 seconds in countdown) */\n warningFg?: string;\n /** Danger color (when < 5 seconds in countdown) */\n dangerFg?: string;\n}\n\nexport const Timer = defineComponent({\n name: \"Timer\",\n props: {\n mode: {\n type: String as PropType<TimerMode>,\n default: \"stopwatch\",\n },\n initialSeconds: {\n type: Number,\n default: 0,\n },\n autoStart: {\n type: Boolean,\n default: true,\n },\n showHours: {\n type: Boolean,\n default: false,\n },\n showMilliseconds: {\n type: Boolean,\n default: false,\n },\n fg: {\n type: String,\n default: \"white\",\n },\n warningFg: {\n type: String,\n default: \"yellow\",\n },\n dangerFg: {\n type: String,\n default: \"red\",\n },\n },\n emits: [\"tick\", \"complete\"],\n setup(props, { emit, expose }) {\n const elapsed = ref(0); // milliseconds\n const isRunning = ref(false);\n let intervalId: ReturnType<typeof setInterval> | null = null;\n\n const totalMs = computed(() => {\n if (props.mode === \"countdown\") {\n return Math.max(0, props.initialSeconds * 1000 - elapsed.value);\n }\n return elapsed.value;\n });\n\n const formatted = computed(() => {\n const ms = totalMs.value;\n const totalSeconds = Math.floor(ms / 1000);\n const hours = Math.floor(totalSeconds / 3600);\n const minutes = Math.floor((totalSeconds % 3600) / 60);\n const seconds = totalSeconds % 60;\n const milliseconds = Math.floor((ms % 1000) / 10);\n\n let result = \"\";\n if (props.showHours || hours > 0) {\n result += `${String(hours).padStart(2, \"0\")}:`;\n }\n result += `${String(minutes).padStart(2, \"0\")}:${String(seconds).padStart(2, \"0\")}`;\n if (props.showMilliseconds) {\n result += `.${String(milliseconds).padStart(2, \"0\")}`;\n }\n return result;\n });\n\n const color = computed(() => {\n if (props.mode === \"countdown\") {\n const seconds = totalMs.value / 1000;\n if (seconds <= 5) return props.dangerFg;\n if (seconds <= 10) return props.warningFg;\n }\n return props.fg;\n });\n\n const start = () => {\n if (isRunning.value) return;\n isRunning.value = true;\n intervalId = setInterval(() => {\n elapsed.value += 100;\n emit(\"tick\", totalMs.value);\n\n if (props.mode === \"countdown\" && totalMs.value <= 0) {\n stop();\n emit(\"complete\");\n }\n }, 100);\n };\n\n const stop = () => {\n isRunning.value = false;\n if (intervalId) {\n clearInterval(intervalId);\n intervalId = null;\n }\n };\n\n const reset = () => {\n elapsed.value = 0;\n };\n\n const toggle = () => {\n if (isRunning.value) {\n stop();\n } else {\n start();\n }\n };\n\n expose({ start, stop, reset, toggle, isRunning });\n\n onMounted(() => {\n if (props.autoStart) {\n start();\n }\n });\n\n onUnmounted(() => {\n stop();\n });\n\n return () => {\n return h(\n \"text\",\n {\n fg: color.value,\n bold: true,\n },\n formatted.value,\n );\n };\n },\n});\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\nimport { Box } from \"./Box.js\";\nimport type { TooltipProps } from \"./presentational-primitive-types.js\";\nimport { Text } from \"./Text.js\";\n\ninterface TooltipPanelPosition {\n readonly top?: string;\n readonly right?: string;\n readonly bottom?: string;\n readonly left?: string;\n readonly marginTop?: number;\n readonly marginRight?: number;\n readonly marginBottom?: number;\n readonly marginLeft?: number;\n}\n\nconst {\n text,\n visible = true,\n position = \"top\",\n offset = 0,\n border = \"rounded\",\n bg = \"white\",\n fg = \"black\",\n} = defineProps<TooltipProps>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\ndefineOptions({ name: \"FrescoTooltip\" });\n\nconst panelPosition = computed<TooltipPanelPosition>(() => {\n const gap = Number.isFinite(offset) ? Math.max(0, offset) : 0;\n switch (position) {\n case \"bottom\":\n return { top: \"100%\", marginTop: gap };\n case \"right\":\n return { left: \"100%\", marginLeft: gap };\n case \"left\":\n return { right: \"100%\", marginRight: gap };\n case \"top\":\n default:\n return { bottom: \"100%\", marginBottom: gap };\n }\n});\n</script>\n\n<template>\n <Box position=\"relative\">\n <slot />\n <Box\n v-if=\"visible\"\n position=\"absolute\"\n :top=\"panelPosition.top\"\n :right=\"panelPosition.right\"\n :bottom=\"panelPosition.bottom\"\n :left=\"panelPosition.left\"\n :margin-top=\"panelPosition.marginTop\"\n :margin-right=\"panelPosition.marginRight\"\n :margin-bottom=\"panelPosition.marginBottom\"\n :margin-left=\"panelPosition.marginLeft\"\n :border=\"border === 'none' ? undefined : border\"\n :bg\n :fg\n :padding-x=\"1\"\n >\n <Text :content=\"text\" :fg :bg />\n </Box>\n </Box>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\nimport { Box } from \"./Box.js\";\nimport type { TooltipProps } from \"./presentational-primitive-types.js\";\nimport { Text } from \"./Text.js\";\n\ninterface TooltipPanelPosition {\n readonly top?: string;\n readonly right?: string;\n readonly bottom?: string;\n readonly left?: string;\n readonly marginTop?: number;\n readonly marginRight?: number;\n readonly marginBottom?: number;\n readonly marginLeft?: number;\n}\n\nconst {\n text,\n visible = true,\n position = \"top\",\n offset = 0,\n border = \"rounded\",\n bg = \"white\",\n fg = \"black\",\n} = defineProps<TooltipProps>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\ndefineOptions({ name: \"FrescoTooltip\" });\n\nconst panelPosition = computed<TooltipPanelPosition>(() => {\n const gap = Number.isFinite(offset) ? Math.max(0, offset) : 0;\n switch (position) {\n case \"bottom\":\n return { top: \"100%\", marginTop: gap };\n case \"right\":\n return { left: \"100%\", marginLeft: gap };\n case \"left\":\n return { right: \"100%\", marginRight: gap };\n case \"top\":\n default:\n return { bottom: \"100%\", marginBottom: gap };\n }\n});\n</script>\n\n<template>\n <Box position=\"relative\">\n <slot />\n <Box\n v-if=\"visible\"\n position=\"absolute\"\n :top=\"panelPosition.top\"\n :right=\"panelPosition.right\"\n :bottom=\"panelPosition.bottom\"\n :left=\"panelPosition.left\"\n :margin-top=\"panelPosition.marginTop\"\n :margin-right=\"panelPosition.marginRight\"\n :margin-bottom=\"panelPosition.marginBottom\"\n :margin-left=\"panelPosition.marginLeft\"\n :border=\"border === 'none' ? undefined : border\"\n :bg\n :fg\n :padding-x=\"1\"\n >\n <Text :content=\"text\" :fg :bg />\n </Box>\n </Box>\n</template>\n","/**\n * List Component - Scrollable list of items\n */\n\nimport { computed, defineComponent, h, ref, type PropType, type VNode, watch } from \"vue\";\nimport { useInput } from \"../composables/useInput.js\";\nimport {\n adjacentEnabledIndex,\n createTypeaheadBuffer,\n firstEnabledIndex,\n lastEnabledIndex,\n typeaheadIndex,\n visibleCollectionOffset,\n} from \"./collection-navigation.js\";\n\nexport interface ListItem {\n key: string;\n label: string;\n disabled?: boolean;\n}\n\nexport interface ListProps {\n /** List items */\n items: ListItem[];\n /** Currently selected key */\n modelValue?: string;\n /** Maximum visible items (enables scrolling) */\n maxHeight?: number;\n /** Whether the list is focused */\n focused?: boolean;\n /** Item indicator */\n indicator?: string;\n /** Empty indicator */\n indicatorEmpty?: string;\n /** Foreground color */\n fg?: string;\n /** Selected foreground color */\n selectedFg?: string;\n /** Selected background color */\n selectedBg?: string;\n}\n\nexport const List = defineComponent({\n name: \"List\",\n props: {\n items: {\n type: Array as PropType<ListItem[]>,\n required: true,\n },\n modelValue: String,\n maxHeight: Number,\n focused: {\n type: Boolean,\n default: false,\n },\n indicator: {\n type: String,\n default: \"> \",\n },\n indicatorEmpty: {\n type: String,\n default: \" \",\n },\n fg: String,\n selectedFg: {\n type: String,\n default: \"cyan\",\n },\n selectedBg: String,\n },\n emits: [\"update:modelValue\", \"select\"],\n setup(props, { emit }) {\n const scrollOffset = ref(0);\n const highlightedIndex = ref(-1);\n const typeahead = createTypeaheadBuffer();\n\n const syncHighlight = () => {\n const selectedIndex = props.items.findIndex(\n (item) => item.key === props.modelValue && !item.disabled,\n );\n if (selectedIndex >= 0) {\n highlightedIndex.value = selectedIndex;\n } else if (\n highlightedIndex.value < 0 ||\n highlightedIndex.value >= props.items.length ||\n props.items[highlightedIndex.value]?.disabled\n ) {\n highlightedIndex.value = firstEnabledIndex(props.items);\n }\n };\n\n watch([() => props.modelValue, () => props.items], syncHighlight, {\n deep: true,\n immediate: true,\n });\n\n watch(\n [highlightedIndex, () => props.maxHeight, () => props.items.length],\n ([index]) => {\n scrollOffset.value = visibleCollectionOffset(\n index,\n scrollOffset.value,\n props.maxHeight,\n props.items.length,\n );\n },\n { immediate: true },\n );\n\n const moveBy = (direction: -1 | 1, distance = 1, wrap = true) => {\n let next = highlightedIndex.value;\n for (let step = 0; step < distance; step++) {\n const candidate = adjacentEnabledIndex(props.items, next, direction);\n if (candidate === next) break;\n if (!wrap && (direction > 0 ? candidate < next : candidate > next)) break;\n next = candidate;\n }\n highlightedIndex.value = next;\n };\n\n const activate = () => {\n const item = props.items[highlightedIndex.value];\n if (!item || item.disabled) return;\n emit(\"update:modelValue\", item.key);\n emit(\"select\", item.key);\n };\n\n useInput({\n isActive: computed(() => props.focused),\n onArrow: (direction) => {\n if (direction === \"up\") moveBy(-1);\n if (direction === \"down\") moveBy(1);\n },\n onKey: (key) => {\n if (key === \"home\") highlightedIndex.value = firstEnabledIndex(props.items);\n if (key === \"end\") highlightedIndex.value = lastEnabledIndex(props.items);\n if (key === \"pageup\" || key === \"pageUp\") moveBy(-1, props.maxHeight ?? 5, false);\n if (key === \"pagedown\" || key === \"pageDown\") moveBy(1, props.maxHeight ?? 5, false);\n },\n onChar: (character) => {\n highlightedIndex.value = typeaheadIndex(\n props.items,\n highlightedIndex.value,\n typeahead.push(character),\n (item) => item.label,\n );\n },\n onSubmit: activate,\n });\n\n const visibleItems = computed(() => {\n if (!props.maxHeight) {\n return props.items;\n }\n const start = scrollOffset.value;\n const end = start + props.maxHeight;\n return props.items.slice(start, end);\n });\n\n const scrollIndicator = computed(() => {\n if (!props.maxHeight || props.items.length <= props.maxHeight) {\n return { showUp: false, showDown: false };\n }\n return {\n showUp: scrollOffset.value > 0,\n showDown: scrollOffset.value + props.maxHeight < props.items.length,\n };\n });\n\n return () => {\n const children: VNode[] = [];\n\n // Scroll up indicator\n if (scrollIndicator.value.showUp) {\n children.push(h(\"text\", { key: \"scroll-up\", dim: true }, \" ...\"));\n }\n\n // Visible items\n visibleItems.value.forEach((item, visibleIndex) => {\n const actualIndex = scrollOffset.value + visibleIndex;\n const isHighlighted = actualIndex === highlightedIndex.value;\n const isSelected = item.key === props.modelValue;\n const indicator = isHighlighted ? props.indicator : props.indicatorEmpty;\n\n children.push(\n h(\n \"text\",\n {\n key: item.key,\n fg: isHighlighted ? props.selectedFg : props.fg,\n bg: isHighlighted ? props.selectedBg : undefined,\n dim: item.disabled,\n bold: isSelected,\n },\n `${indicator}${item.label}`,\n ),\n );\n });\n\n // Scroll down indicator\n if (scrollIndicator.value.showDown) {\n children.push(h(\"text\", { key: \"scroll-down\", dim: true }, \" ...\"));\n }\n\n return h(\n \"box\",\n {\n style: { flex_direction: \"column\" },\n fg: props.fg,\n },\n children,\n );\n };\n },\n});\n","import { graphemes } from \"../utils/text.js\";\nimport type {\n TableAlignment,\n TableColumn,\n TableRow,\n TableSortDirection,\n TableViewportRange,\n} from \"./table-types.js\";\n\nexport interface IndexedTableRow<Row extends TableRow = TableRow> {\n readonly row: Row;\n readonly sourceIndex: number;\n}\n\nfunction finiteInteger(value: number, fallback: number): number {\n return Number.isFinite(value) ? Math.trunc(value) : fallback;\n}\n\n/** Resolve a controlled or declared numeric width inside the column limits. */\nexport function tableColumnWidth(\n column: TableColumn,\n widths: Readonly<Record<string, number>> | undefined,\n): number | undefined {\n const requested = widths?.[String(column.key)] ?? column.width;\n if (typeof requested !== \"number\" || !Number.isFinite(requested)) return undefined;\n const minimum = Math.max(1, finiteInteger(column.minWidth ?? 1, 1));\n const maximum = Math.max(\n minimum,\n finiteInteger(column.maxWidth ?? Number.MAX_SAFE_INTEGER, minimum),\n );\n return Math.min(maximum, Math.max(minimum, Math.trunc(requested)));\n}\n\n/** Convert supported primitive values and structured values into table text. */\nexport function stringifyTableCell(value: unknown): string {\n if (value == null) return \"\";\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\" || typeof value === \"bigint\") {\n return String(value);\n }\n try {\n return JSON.stringify(value) ?? \"\";\n } catch {\n return \"\";\n }\n}\n\n/** Truncate and align a cell without splitting a Unicode grapheme cluster. */\nexport function fitTableCell(\n value: string,\n width: number | undefined,\n alignment: TableAlignment = \"left\",\n): string {\n if (width === undefined) return value;\n const size = Math.max(0, Math.trunc(width));\n const parts = graphemes(value);\n if (parts.length >= size) return parts.slice(0, size).join(\"\");\n const padding = size - parts.length;\n if (alignment === \"right\") return `${\" \".repeat(padding)}${value}`;\n if (alignment === \"center\") {\n const left = Math.floor(padding / 2);\n return `${\" \".repeat(left)}${value}${\" \".repeat(padding - left)}`;\n }\n return `${value}${\" \".repeat(padding)}`;\n}\n\nfunction compareTableValues(left: unknown, right: unknown): number {\n if (Object.is(left, right)) return 0;\n if (left == null) return -1;\n if (right == null) return 1;\n if (typeof left === \"number\" && typeof right === \"number\") {\n if (Number.isNaN(left)) return Number.isNaN(right) ? 0 : -1;\n if (Number.isNaN(right)) return 1;\n return left - right;\n }\n return stringifyTableCell(left).localeCompare(stringifyTableCell(right));\n}\n\n/** Stable controlled sorting that retains each row's original source index. */\nexport function sortTableRows<Row extends TableRow>(\n rows: readonly Row[],\n columns: readonly TableColumn<Row>[],\n sortKey: string | undefined,\n direction: TableSortDirection,\n): IndexedTableRow<Row>[] {\n const indexed = rows.map((row, sourceIndex) => ({ row, sourceIndex }));\n if (sortKey === undefined) return indexed;\n const column = columns.find(({ key }) => String(key) === sortKey);\n if (!column) return indexed;\n const factor = direction === \"descending\" ? -1 : 1;\n return indexed.toSorted((left, right) => {\n const compared = column.compare\n ? column.compare(left.row, right.row)\n : compareTableValues(left.row[sortKey], right.row[sortKey]);\n return compared === 0 ? left.sourceIndex - right.sourceIndex : compared * factor;\n });\n}\n\n/** Clamp visible and retained row ranges for bounded rendering. */\nexport function tableViewportRange(\n itemCount: number,\n offset: number,\n viewportSize: number | undefined,\n overscan: number,\n): TableViewportRange {\n const count = Math.max(0, finiteInteger(itemCount, 0));\n const visibleSize =\n viewportSize === undefined\n ? count\n : Math.min(count, Math.max(0, finiteInteger(viewportSize, 0)));\n const visibleStart = Math.min(\n Math.max(0, count - visibleSize),\n Math.max(0, finiteInteger(offset, 0)),\n );\n const visibleEnd = Math.min(count, visibleStart + visibleSize);\n const retainedMargin = Math.max(0, finiteInteger(overscan, 0));\n return {\n visibleStart,\n visibleEnd,\n retainedStart: Math.max(0, visibleStart - retainedMargin),\n retainedEnd: Math.min(count, visibleEnd + retainedMargin),\n };\n}\n","/** Table Component - sortable, resizable, bounded tabular data. */\n\nimport { computed, defineComponent, h, ref, type PropType, type VNode, watch } from \"vue\";\nimport { useInput } from \"../composables/useInput.js\";\nimport {\n fitTableCell,\n sortTableRows,\n stringifyTableCell,\n tableColumnWidth,\n tableViewportRange,\n} from \"./table-utils.js\";\nimport type {\n TableCellSlotProps,\n TableColumn,\n TableProps,\n TableRow,\n TableSortDirection,\n} from \"./table-types.js\";\n\nexport type {\n TableAlignment,\n TableCellSlotProps,\n TableColumn,\n TableProps,\n TableRow,\n TableSortDirection,\n TableViewportRange,\n} from \"./table-types.js\";\n\nexport const Table = defineComponent({\n name: \"Table\",\n props: {\n columns: { type: Array as PropType<readonly TableColumn[]>, required: true },\n data: { type: Array as PropType<readonly TableRow[]>, required: true },\n showHeader: { type: Boolean, default: true },\n border: { type: String as PropType<TableProps[\"border\"]>, default: \"single\" },\n headerFg: { type: String, default: \"white\" },\n headerBg: String,\n rowFg: String,\n stripedBg: String,\n cellPadding: { type: Number, default: 1 },\n sortKey: String,\n sortDirection: {\n type: String as PropType<TableSortDirection>,\n default: \"ascending\",\n },\n offset: { type: Number, default: 0 },\n viewportSize: Number,\n overscan: { type: Number, default: 2 },\n focused: { type: Boolean, default: false },\n focusedColumn: Number,\n columnWidths: Object as PropType<Readonly<Record<string, number>>>,\n resizeStep: { type: Number, default: 1 },\n },\n emits: [\n \"update:sortKey\",\n \"update:sortDirection\",\n \"update:offset\",\n \"update:focusedColumn\",\n \"update:columnWidths\",\n \"sortChange\",\n \"resize\",\n ],\n setup(props, { emit, slots }) {\n const activeColumn = ref(0);\n watch(\n [() => props.focusedColumn, () => props.columns.length],\n ([requested, count]) => {\n activeColumn.value = Math.min(\n Math.max(0, requested ?? activeColumn.value),\n Math.max(0, count - 1),\n );\n },\n { immediate: true },\n );\n\n const sortedRows = computed(() =>\n sortTableRows(props.data, props.columns, props.sortKey, props.sortDirection),\n );\n const viewport = computed(() =>\n tableViewportRange(sortedRows.value.length, props.offset, props.viewportSize, props.overscan),\n );\n const retainedRows = computed(() =>\n sortedRows.value.slice(viewport.value.retainedStart, viewport.value.retainedEnd),\n );\n\n const setActiveColumn = (index: number) => {\n const next = Math.min(Math.max(0, index), Math.max(0, props.columns.length - 1));\n if (next === activeColumn.value) return;\n activeColumn.value = next;\n emit(\"update:focusedColumn\", next);\n };\n const activateSort = () => {\n const column = props.columns[activeColumn.value];\n if (!column?.sortable) return;\n const key = String(column.key);\n const direction: TableSortDirection =\n props.sortKey === key && props.sortDirection === \"ascending\" ? \"descending\" : \"ascending\";\n emit(\"update:sortKey\", key);\n emit(\"update:sortDirection\", direction);\n emit(\"sortChange\", key, direction);\n };\n const resizeColumn = (delta: number) => {\n const column = props.columns[activeColumn.value];\n if (!column) return;\n const current = tableColumnWidth(column, props.columnWidths) ?? 10;\n const requested = current + delta;\n const next = tableColumnWidth({ ...column, width: requested }, undefined) ?? current;\n if (next === current) return;\n const widths = { ...props.columnWidths, [String(column.key)]: next };\n emit(\"update:columnWidths\", widths);\n emit(\"resize\", String(column.key), next);\n };\n const scrollBy = (delta: number) => {\n const size = props.viewportSize ?? sortedRows.value.length;\n const maxOffset = Math.max(0, sortedRows.value.length - Math.max(0, Math.floor(size)));\n const next = Math.min(maxOffset, Math.max(0, Math.floor(props.offset) + delta));\n if (next !== props.offset) emit(\"update:offset\", next);\n };\n\n useInput({\n isActive: computed(() => props.focused),\n onKey: (key, modifiers) => {\n if (key === \"left\") {\n if (modifiers.shift) resizeColumn(-Math.max(1, Math.floor(props.resizeStep)));\n else setActiveColumn(activeColumn.value - 1);\n } else if (key === \"right\") {\n if (modifiers.shift) resizeColumn(Math.max(1, Math.floor(props.resizeStep)));\n else setActiveColumn(activeColumn.value + 1);\n } else if (key === \"home\") setActiveColumn(0);\n else if (key === \"end\") setActiveColumn(props.columns.length - 1);\n else if (key === \"up\") scrollBy(-1);\n else if (key === \"down\") scrollBy(1);\n else if (key === \"pageup\") scrollBy(-Math.max(1, (props.viewportSize ?? 1) - 1));\n else if (key === \"pagedown\") scrollBy(Math.max(1, (props.viewportSize ?? 1) - 1));\n },\n onSubmit: activateSort,\n });\n\n const renderCell = (\n row: TableRow,\n sourceIndex: number,\n column: TableColumn,\n rowIndex: number,\n ): VNode => {\n const raw = row[String(column.key)];\n const formatted = column.format?.(raw, row, sourceIndex) ?? stringifyTableCell(raw);\n const content = fitTableCell(\n formatted,\n tableColumnWidth(column, props.columnWidths),\n column.align,\n );\n const slotProps: TableCellSlotProps = {\n row,\n rowIndex: sourceIndex,\n column,\n value: raw,\n content,\n };\n const cellProps = {\n key: String(column.key),\n fg: props.rowFg,\n bg: rowIndex % 2 === 1 ? props.stripedBg : undefined,\n };\n const slot = slots.cell?.(slotProps);\n return slot ? h(\"box\", cellProps, slot) : h(\"text\", { ...cellProps, text: content });\n };\n\n return () => {\n const rows: VNode[] = [];\n if (props.showHeader) {\n rows.push(\n h(\n \"box\",\n { key: \"header\", style: { flexDirection: \"row\", gap: props.cellPadding } },\n props.columns.map((column, index) => {\n const indicator =\n props.sortKey === String(column.key)\n ? props.sortDirection === \"descending\"\n ? \" ▼\"\n : \" ▲\"\n : column.sortable\n ? \" ↕\"\n : \"\";\n return h(\"text\", {\n key: String(column.key),\n text: fitTableCell(\n `${column.header}${indicator}`,\n tableColumnWidth(column, props.columnWidths),\n column.align,\n ),\n bold: props.focused && index === activeColumn.value,\n fg: props.headerFg,\n bg: props.headerBg,\n });\n }),\n ),\n );\n }\n\n retainedRows.value.forEach(({ row, sourceIndex }, retainedIndex) => {\n const sortedIndex = viewport.value.retainedStart + retainedIndex;\n const visible =\n sortedIndex >= viewport.value.visibleStart && sortedIndex < viewport.value.visibleEnd;\n rows.push(\n h(\n \"box\",\n {\n key: `row-${sourceIndex}`,\n style: {\n display: visible ? \"flex\" : \"none\",\n flexDirection: \"row\",\n gap: props.cellPadding,\n },\n \"aria-hidden\": !visible,\n \"data-table-index\": sortedIndex,\n },\n props.columns.map((column) => renderCell(row, sourceIndex, column, sortedIndex)),\n ),\n );\n });\n\n return h(\n \"box\",\n {\n border: props.border === \"none\" ? undefined : props.border,\n style: { flexDirection: \"column\", overflow: \"hidden\" },\n \"aria-role\": \"table\",\n \"aria-colcount\": props.columns.length,\n \"aria-rowcount\": sortedRows.value.length,\n },\n rows,\n );\n };\n },\n});\n","/**\n * Tree Component - Tree view for hierarchical data\n */\n\nimport { computed, defineComponent, h, ref, type PropType, watch } from \"vue\";\nimport { useInput } from \"../composables/useInput.js\";\nimport {\n adjacentEnabledIndex,\n createTypeaheadBuffer,\n firstEnabledIndex,\n lastEnabledIndex,\n typeaheadIndex,\n} from \"./collection-navigation.js\";\n\nexport interface TreeNode {\n key: string;\n label: string;\n children?: TreeNode[];\n icon?: string;\n disabled?: boolean;\n}\n\nexport interface TreeProps {\n /** Tree data */\n data: TreeNode[];\n /** Expanded node keys */\n expanded?: string[];\n /** Selected node key */\n selected?: string;\n /** Whether the tree owns keyboard input */\n focused?: boolean;\n /** Show lines */\n showLines?: boolean;\n /** Indent size */\n indent?: number;\n /** Expanded icon */\n expandedIcon?: string;\n /** Collapsed icon */\n collapsedIcon?: string;\n /** Leaf icon */\n leafIcon?: string;\n /** Foreground color */\n fg?: string;\n /** Selected foreground color */\n selectedFg?: string;\n}\n\nexport const Tree = defineComponent({\n name: \"Tree\",\n props: {\n data: {\n type: Array as PropType<TreeNode[]>,\n required: true,\n },\n expanded: {\n type: Array as PropType<string[]>,\n default: () => [],\n },\n selected: String,\n focused: {\n type: Boolean,\n default: false,\n },\n showLines: {\n type: Boolean,\n default: true,\n },\n indent: {\n type: Number,\n default: 2,\n },\n expandedIcon: {\n type: String,\n default: \"▼\",\n },\n collapsedIcon: {\n type: String,\n default: \"▶\",\n },\n leafIcon: {\n type: String,\n default: \"•\",\n },\n fg: String,\n selectedFg: {\n type: String,\n default: \"cyan\",\n },\n },\n emits: [\"select\", \"toggle\", \"update:selected\", \"update:expanded\"],\n setup(props, { emit }) {\n interface VisibleTreeNode {\n readonly node: TreeNode;\n readonly parentKey?: string;\n readonly prefix: string;\n readonly icon: string;\n }\n\n const visibleNodes = computed<VisibleTreeNode[]>(() => {\n const expanded = new Set(props.expanded);\n const visible: VisibleTreeNode[] = [];\n\n const append = (\n nodes: readonly TreeNode[],\n depth: number,\n prefix: string,\n parentKey?: string,\n ) => {\n nodes.forEach((node, index) => {\n const isLast = index === nodes.length - 1;\n const hasChildren = (node.children?.length ?? 0) > 0;\n const isExpanded = expanded.has(node.key);\n const line = props.showLines && depth > 0 ? (isLast ? \"└─\" : \"├─\") : \"\";\n const icon =\n node.icon ??\n (hasChildren\n ? isExpanded\n ? props.expandedIcon\n : props.collapsedIcon\n : props.leafIcon);\n\n visible.push({ node, parentKey, prefix: `${prefix}${line}`, icon });\n\n if (!hasChildren || !isExpanded) return;\n const branch = props.showLines && depth > 0 ? (isLast ? \" \" : \"│ \") : \"\";\n append(\n node.children ?? [],\n depth + 1,\n `${prefix}${branch}${\" \".repeat(props.indent)}`,\n node.key,\n );\n });\n };\n\n append(props.data, 0, \"\");\n return visible;\n });\n\n const highlightedKey = ref<string>();\n const typeahead = createTypeaheadBuffer();\n\n const navigableNodes = computed(() =>\n visibleNodes.value.map(({ node }) => ({ disabled: node.disabled })),\n );\n const highlightedIndex = computed(() =>\n visibleNodes.value.findIndex(({ node }) => node.key === highlightedKey.value),\n );\n\n const syncVisibleHighlight = () => {\n const currentIndex = highlightedIndex.value;\n if (currentIndex >= 0 && !visibleNodes.value[currentIndex]?.node.disabled) return;\n\n const selectedIndex = visibleNodes.value.findIndex(\n ({ node }) => node.key === props.selected && !node.disabled,\n );\n const nextIndex =\n selectedIndex >= 0 ? selectedIndex : firstEnabledIndex(navigableNodes.value);\n highlightedKey.value = visibleNodes.value[nextIndex]?.node.key;\n };\n\n watch(\n () => props.selected,\n (selected) => {\n const selectedIndex = visibleNodes.value.findIndex(\n ({ node }) => node.key === selected && !node.disabled,\n );\n if (selectedIndex >= 0) {\n highlightedKey.value = visibleNodes.value[selectedIndex]?.node.key;\n } else syncVisibleHighlight();\n },\n { immediate: true },\n );\n watch(visibleNodes, syncVisibleHighlight, { deep: true });\n\n const setHighlight = (index: number) => {\n const entry = visibleNodes.value[index];\n if (!entry || entry.node.disabled) return;\n highlightedKey.value = entry.node.key;\n };\n\n const setExpanded = (key: string, expanded: boolean) => {\n const next = new Set(props.expanded);\n if (expanded) next.add(key);\n else next.delete(key);\n emit(\"update:expanded\", [...next]);\n emit(\"toggle\", key, expanded);\n };\n\n const activate = () => {\n const entry = visibleNodes.value[highlightedIndex.value];\n if (!entry || entry.node.disabled) return;\n emit(\"update:selected\", entry.node.key);\n emit(\"select\", entry.node.key);\n };\n\n const moveToParent = (parentKey: string | undefined) => {\n let key = parentKey;\n while (key) {\n const index = visibleNodes.value.findIndex(({ node }) => node.key === key);\n const entry = visibleNodes.value[index];\n if (entry && !entry.node.disabled) {\n setHighlight(index);\n return;\n }\n key = entry?.parentKey;\n }\n };\n\n useInput({\n isActive: computed(() => props.focused),\n onArrow: (direction) => {\n const currentIndex = highlightedIndex.value;\n if (direction === \"up\" || direction === \"down\") {\n setHighlight(\n adjacentEnabledIndex(navigableNodes.value, currentIndex, direction === \"up\" ? -1 : 1),\n );\n return;\n }\n\n const entry = visibleNodes.value[currentIndex];\n if (!entry) return;\n const hasChildren = (entry.node.children?.length ?? 0) > 0;\n const isExpanded = props.expanded.includes(entry.node.key);\n if (direction === \"right\" && hasChildren) {\n if (!isExpanded) {\n setExpanded(entry.node.key, true);\n } else {\n const childIndex = visibleNodes.value.findIndex(\n (candidate) => candidate.parentKey === entry.node.key && !candidate.node.disabled,\n );\n setHighlight(childIndex);\n }\n } else if (direction === \"left\") {\n if (hasChildren && isExpanded) setExpanded(entry.node.key, false);\n else moveToParent(entry.parentKey);\n }\n },\n onKey: (key) => {\n if (key === \"home\") setHighlight(firstEnabledIndex(navigableNodes.value));\n if (key === \"end\") setHighlight(lastEnabledIndex(navigableNodes.value));\n },\n onChar: (character) => {\n if (character === \" \") {\n activate();\n return;\n }\n setHighlight(\n typeaheadIndex(\n visibleNodes.value.map(({ node }) => node),\n highlightedIndex.value,\n typeahead.push(character),\n (node) => node.label,\n ),\n );\n },\n onSubmit: activate,\n });\n\n return () =>\n h(\n \"box\",\n { style: { flex_direction: \"column\" } },\n visibleNodes.value.map(({ node, prefix, icon }) => {\n const isSelected = node.key === props.selected;\n const isHighlighted = node.key === highlightedKey.value;\n return h(\n \"text\",\n {\n key: node.key,\n fg: isSelected || isHighlighted ? props.selectedFg : props.fg,\n bold: isSelected,\n underline: props.focused && isHighlighted,\n dim: node.disabled,\n },\n `${prefix}${icon} ${node.label}`,\n );\n }),\n );\n },\n});\n","/**\n * Menu Component - Command menu/palette\n */\n\nimport { computed, defineComponent, h, ref, type PropType, type VNode, watch } from \"vue\";\nimport { useInput } from \"../composables/useInput.js\";\nimport {\n adjacentEnabledIndex,\n createTypeaheadBuffer,\n firstEnabledIndex,\n lastEnabledIndex,\n typeaheadIndex,\n} from \"./collection-navigation.js\";\n\nexport interface MenuItem {\n key: string;\n label: string;\n shortcut?: string;\n icon?: string;\n disabled?: boolean;\n separator?: boolean;\n}\n\nexport interface MenuProps {\n /** Menu items */\n items: MenuItem[];\n /** Focused item index */\n focusedIndex?: number;\n /** Whether the menu owns keyboard input */\n focused?: boolean;\n /** Show border */\n border?: \"single\" | \"double\" | \"rounded\" | \"none\";\n /** Width */\n width?: number;\n /** Foreground color */\n fg?: string;\n /** Focused foreground color */\n focusedFg?: string;\n /** Focused background color */\n focusedBg?: string;\n /** Shortcut foreground color */\n shortcutFg?: string;\n}\n\nexport const Menu = defineComponent({\n name: \"Menu\",\n props: {\n items: {\n type: Array as PropType<MenuItem[]>,\n required: true,\n },\n focusedIndex: {\n type: Number,\n default: 0,\n },\n focused: {\n type: Boolean,\n default: false,\n },\n border: {\n type: String as PropType<MenuProps[\"border\"]>,\n default: \"single\",\n },\n width: Number,\n fg: String,\n focusedFg: {\n type: String,\n default: \"black\",\n },\n focusedBg: {\n type: String,\n default: \"cyan\",\n },\n shortcutFg: {\n type: String,\n default: \"gray\",\n },\n },\n emits: [\"select\", \"update:focusedIndex\"],\n setup(props, { emit }) {\n const highlightedIndex = ref(-1);\n const typeahead = createTypeaheadBuffer();\n\n const syncHighlight = () => {\n const requested = props.focusedIndex;\n const requestedItem = props.items[requested];\n highlightedIndex.value =\n requestedItem && !requestedItem.disabled && !requestedItem.separator\n ? requested\n : firstEnabledIndex(\n props.items.map((item) => ({ disabled: item.disabled || item.separator })),\n );\n };\n\n watch([() => props.focusedIndex, () => props.items], syncHighlight, {\n deep: true,\n immediate: true,\n });\n\n const setHighlight = (index: number) => {\n if (index < 0 || index === highlightedIndex.value) return;\n highlightedIndex.value = index;\n emit(\"update:focusedIndex\", index);\n };\n\n const activate = () => {\n const item = props.items[highlightedIndex.value];\n if (!item || item.disabled || item.separator) return;\n emit(\"select\", item.key);\n };\n\n useInput({\n isActive: computed(() => props.focused),\n onArrow: (direction) => {\n if (direction !== \"up\" && direction !== \"down\") return;\n setHighlight(\n adjacentEnabledIndex(\n props.items.map((item) => ({ disabled: item.disabled || item.separator })),\n highlightedIndex.value,\n direction === \"up\" ? -1 : 1,\n ),\n );\n },\n onKey: (key) => {\n const navigableItems = props.items.map((item) => ({\n disabled: item.disabled || item.separator,\n }));\n if (key === \"home\") setHighlight(firstEnabledIndex(navigableItems));\n if (key === \"end\") setHighlight(lastEnabledIndex(navigableItems));\n },\n onChar: (character) => {\n setHighlight(\n typeaheadIndex(\n props.items.map((item) => ({\n ...item,\n disabled: item.disabled || item.separator,\n })),\n highlightedIndex.value,\n typeahead.push(character),\n (item) => item.label,\n ),\n );\n },\n onSubmit: activate,\n });\n return () => {\n const children: VNode[] = [];\n\n props.items.forEach((item, index) => {\n if (item.separator) {\n children.push(\n h(\"text\", { key: `sep-${index}`, dim: true }, \"─\".repeat(props.width ?? 20)),\n );\n return;\n }\n\n const isFocused = index === highlightedIndex.value;\n const itemContent: VNode[] = [];\n\n // Icon\n if (item.icon) {\n itemContent.push(h(\"text\", { key: \"icon\" }, `${item.icon} `));\n }\n\n // Label\n itemContent.push(\n h(\n \"text\",\n {\n key: \"label\",\n fg: isFocused ? props.focusedFg : props.fg,\n bg: isFocused ? props.focusedBg : undefined,\n dim: item.disabled,\n style: { flex_grow: 1 },\n },\n item.label,\n ),\n );\n\n // Shortcut\n if (item.shortcut) {\n itemContent.push(\n h(\n \"text\",\n {\n key: \"shortcut\",\n fg: props.shortcutFg,\n dim: true,\n },\n ` ${item.shortcut}`,\n ),\n );\n }\n\n children.push(\n h(\n \"box\",\n {\n key: item.key,\n style: {\n flex_direction: \"row\",\n padding_left: 1,\n padding_right: 1,\n },\n bg: isFocused ? props.focusedBg : undefined,\n },\n itemContent,\n ),\n );\n });\n\n return h(\n \"box\",\n {\n border: props.border === \"none\" ? undefined : props.border,\n style: {\n flex_direction: \"column\",\n width: props.width ? String(props.width) : undefined,\n },\n },\n children,\n );\n };\n },\n});\n","/**\n * Tabs Component - Tab navigation\n */\n\nimport { computed, defineComponent, h, ref, type PropType, type VNode, watch } from \"vue\";\nimport { useInput } from \"../composables/useInput.js\";\nimport {\n adjacentEnabledIndex,\n createTypeaheadBuffer,\n firstEnabledIndex,\n lastEnabledIndex,\n typeaheadIndex,\n} from \"./collection-navigation.js\";\n\nexport interface Tab {\n key: string;\n label: string;\n disabled?: boolean;\n}\n\nexport interface TabsProps {\n /** Tab definitions */\n tabs: Tab[];\n /** Currently active tab key */\n modelValue?: string;\n /** Whether the tab list owns keyboard input */\n focused?: boolean;\n /** Tab bar position */\n position?: \"top\" | \"bottom\";\n /** Separator between tabs */\n separator?: string;\n /** Active tab foreground color */\n activeFg?: string;\n /** Active tab background color */\n activeBg?: string;\n /** Inactive tab foreground color */\n inactiveFg?: string;\n /** Show underline for active tab */\n underline?: boolean;\n}\n\nexport const Tabs = defineComponent({\n name: \"Tabs\",\n props: {\n tabs: {\n type: Array as PropType<Tab[]>,\n required: true,\n },\n modelValue: String,\n focused: {\n type: Boolean,\n default: false,\n },\n position: {\n type: String as PropType<\"top\" | \"bottom\">,\n default: \"top\",\n },\n separator: {\n type: String,\n default: \" | \",\n },\n activeFg: {\n type: String,\n default: \"cyan\",\n },\n activeBg: String,\n inactiveFg: String,\n underline: {\n type: Boolean,\n default: true,\n },\n },\n emits: [\"update:modelValue\", \"change\"],\n setup(props, { slots, emit }) {\n const highlightedIndex = ref(-1);\n const typeahead = createTypeaheadBuffer();\n\n const syncHighlight = () => {\n const activeIndex = props.tabs.findIndex(\n (tab) => tab.key === props.modelValue && !tab.disabled,\n );\n if (activeIndex >= 0) {\n highlightedIndex.value = activeIndex;\n } else if (\n highlightedIndex.value < 0 ||\n highlightedIndex.value >= props.tabs.length ||\n props.tabs[highlightedIndex.value]?.disabled\n ) {\n highlightedIndex.value = firstEnabledIndex(props.tabs);\n }\n };\n\n watch([() => props.modelValue, () => props.tabs], syncHighlight, {\n deep: true,\n immediate: true,\n });\n\n const activate = () => {\n const tab = props.tabs[highlightedIndex.value];\n if (!tab || tab.disabled) return;\n emit(\"update:modelValue\", tab.key);\n emit(\"change\", tab.key);\n };\n\n useInput({\n isActive: computed(() => props.focused),\n onArrow: (direction) => {\n if (direction !== \"left\" && direction !== \"right\") return;\n highlightedIndex.value = adjacentEnabledIndex(\n props.tabs,\n highlightedIndex.value,\n direction === \"left\" ? -1 : 1,\n );\n },\n onKey: (key) => {\n if (key === \"home\") highlightedIndex.value = firstEnabledIndex(props.tabs);\n if (key === \"end\") highlightedIndex.value = lastEnabledIndex(props.tabs);\n },\n onChar: (character) => {\n if (character === \" \") {\n activate();\n return;\n }\n highlightedIndex.value = typeaheadIndex(\n props.tabs,\n highlightedIndex.value,\n typeahead.push(character),\n (tab) => tab.label,\n );\n },\n onSubmit: activate,\n });\n\n return () => {\n // Tab bar\n const tabItems: VNode[] = [];\n\n props.tabs.forEach((tab, index) => {\n if (index > 0) {\n tabItems.push(h(\"text\", { key: `sep-${index}`, dim: true }, props.separator));\n }\n\n const isActive = tab.key === props.modelValue;\n const isHighlighted = index === highlightedIndex.value;\n\n tabItems.push(\n h(\n \"text\",\n {\n key: tab.key,\n fg: isActive || (props.focused && isHighlighted) ? props.activeFg : props.inactiveFg,\n bg: isActive || (props.focused && isHighlighted) ? props.activeBg : undefined,\n bold: isActive,\n underline: (isActive && props.underline) || (props.focused && isHighlighted),\n dim: tab.disabled,\n },\n tab.label,\n ),\n );\n });\n\n const tabBar = h(\n \"box\",\n {\n key: \"tab-bar\",\n style: {\n flex_direction: \"row\",\n padding_bottom: props.position === \"top\" ? 1 : 0,\n padding_top: props.position === \"bottom\" ? 1 : 0,\n },\n },\n tabItems,\n );\n\n // Content area\n const content = h(\n \"box\",\n {\n key: \"content\",\n style: { flex_grow: 1 },\n },\n slots.default?.(),\n );\n\n // Arrange based on position\n const children = props.position === \"top\" ? [tabBar, content] : [content, tabBar];\n\n return h(\n \"box\",\n {\n style: { flex_direction: \"column\", flex_grow: 1 },\n },\n children,\n );\n };\n },\n});\n","<script setup lang=\"ts\">\nimport type { BreadcrumbItem, BreadcrumbProps } from \"./presentational-primitive-types.js\";\n\nconst {\n items,\n separator = \" > \",\n fg = \"gray\",\n activeFg = \"white\",\n separatorFg = \"gray\",\n} = defineProps<BreadcrumbProps>();\ndefineEmits<{ select: [key: string] }>();\n\ndefineOptions({ name: \"FrescoBreadcrumb\" });\n\nconst rowStyle = { flexDirection: \"row\" } as const;\nconst iconLabel = (item: BreadcrumbItem) => (item.icon ? `${item.icon} ` : \"\");\n</script>\n\n<template>\n <div :style=\"rowStyle\">\n <template v-for=\"(item, index) in items\" :key=\"item.key\">\n <text v-if=\"item.icon\" :fg=\"index === items.length - 1 ? activeFg : fg\">{{\n iconLabel(item)\n }}</text>\n <text\n :fg=\"index === items.length - 1 ? activeFg : fg\"\n :bold=\"index === items.length - 1\"\n :underline=\"index !== items.length - 1\"\n >{{ item.label }}</text\n >\n <text v-if=\"index !== items.length - 1\" :fg=\"separatorFg\">{{ separator }}</text>\n </template>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport type { BreadcrumbItem, BreadcrumbProps } from \"./presentational-primitive-types.js\";\n\nconst {\n items,\n separator = \" > \",\n fg = \"gray\",\n activeFg = \"white\",\n separatorFg = \"gray\",\n} = defineProps<BreadcrumbProps>();\ndefineEmits<{ select: [key: string] }>();\n\ndefineOptions({ name: \"FrescoBreadcrumb\" });\n\nconst rowStyle = { flexDirection: \"row\" } as const;\nconst iconLabel = (item: BreadcrumbItem) => (item.icon ? `${item.icon} ` : \"\");\n</script>\n\n<template>\n <div :style=\"rowStyle\">\n <template v-for=\"(item, index) in items\" :key=\"item.key\">\n <text v-if=\"item.icon\" :fg=\"index === items.length - 1 ? activeFg : fg\">{{\n iconLabel(item)\n }}</text>\n <text\n :fg=\"index === items.length - 1 ? activeFg : fg\"\n :bold=\"index === items.length - 1\"\n :underline=\"index !== items.length - 1\"\n >{{ item.label }}</text\n >\n <text v-if=\"index !== items.length - 1\" :fg=\"separatorFg\">{{ separator }}</text>\n </template>\n </div>\n</template>\n","/**\n * Stepper Component - Step indicator for wizards\n */\n\nimport { defineComponent, h, type PropType } from \"vue\";\n\nexport interface Step {\n key: string;\n label: string;\n description?: string;\n}\n\nexport type StepStatus = \"pending\" | \"current\" | \"completed\" | \"error\";\n\nexport interface StepperProps {\n /** Steps */\n steps: Step[];\n /** Current step index */\n current?: number;\n /** Completed steps (indices) */\n completed?: number[];\n /** Error steps (indices) */\n errors?: number[];\n /** Direction */\n direction?: \"horizontal\" | \"vertical\";\n /** Show step numbers */\n showNumbers?: boolean;\n /** Completed icon */\n completedIcon?: string;\n /** Error icon */\n errorIcon?: string;\n /** Current icon */\n currentIcon?: string;\n /** Pending icon */\n pendingIcon?: string;\n}\n\nexport const Stepper = defineComponent({\n name: \"Stepper\",\n props: {\n steps: {\n type: Array as PropType<Step[]>,\n required: true,\n },\n current: {\n type: Number,\n default: 0,\n },\n completed: {\n type: Array as PropType<number[]>,\n default: () => [],\n },\n errors: {\n type: Array as PropType<number[]>,\n default: () => [],\n },\n direction: {\n type: String as PropType<\"horizontal\" | \"vertical\">,\n default: \"horizontal\",\n },\n showNumbers: {\n type: Boolean,\n default: true,\n },\n completedIcon: {\n type: String,\n default: \"✓\",\n },\n errorIcon: {\n type: String,\n default: \"✗\",\n },\n currentIcon: {\n type: String,\n default: \"●\",\n },\n pendingIcon: {\n type: String,\n default: \"○\",\n },\n },\n setup(props) {\n const getStatus = (index: number): StepStatus => {\n if (props.errors?.includes(index)) return \"error\";\n if (props.completed?.includes(index)) return \"completed\";\n if (index === props.current) return \"current\";\n return \"pending\";\n };\n\n const getIcon = (index: number, status: StepStatus): string => {\n if (props.showNumbers && status === \"pending\") {\n return String(index + 1);\n }\n switch (status) {\n case \"completed\":\n return props.completedIcon;\n case \"error\":\n return props.errorIcon;\n case \"current\":\n return props.currentIcon;\n default:\n return props.pendingIcon;\n }\n };\n\n const getColor = (status: StepStatus): string => {\n switch (status) {\n case \"completed\":\n return \"green\";\n case \"error\":\n return \"red\";\n case \"current\":\n return \"cyan\";\n default:\n return \"gray\";\n }\n };\n\n return () => {\n const isHorizontal = props.direction === \"horizontal\";\n const connector = isHorizontal ? \"───\" : \"│\";\n\n const children = props.steps.flatMap((step, index) => {\n const status = getStatus(index);\n const icon = getIcon(index, status);\n const color = getColor(status);\n const isLast = index === props.steps.length - 1;\n\n const stepContent = [\n h(\n \"box\",\n {\n key: `step-${step.key}`,\n style: {\n flex_direction: isHorizontal ? \"column\" : \"row\",\n align_items: \"center\",\n },\n },\n [\n h(\n \"text\",\n {\n fg: color,\n bold: status === \"current\",\n },\n `[${icon}]`,\n ),\n h(\n \"text\",\n {\n fg: status === \"current\" ? \"white\" : \"gray\",\n bold: status === \"current\",\n style: isHorizontal ? { margin_top: 0.5 } : { margin_left: 1 },\n },\n step.label,\n ),\n ],\n ),\n ];\n\n if (!isLast) {\n stepContent.push(\n h(\n \"text\",\n {\n key: `connector-${index}`,\n dim: true,\n style: isHorizontal\n ? { margin_left: 1, margin_right: 1 }\n : { margin_top: 0.5, margin_bottom: 0.5, margin_left: 1 },\n },\n connector,\n ),\n );\n }\n\n return stepContent;\n });\n\n return h(\n \"box\",\n {\n style: {\n flex_direction: isHorizontal ? \"row\" : \"column\",\n align_items: isHorizontal ? \"flex-start\" : \"stretch\",\n },\n },\n children,\n );\n };\n },\n});\n","<script setup lang=\"ts\">\nimport { computed, nextTick, onMounted, ref, watch } from \"vue\";\n\nimport { provideFocusScope, useFocus, useFocusManager } from \"../composables/useFocus.js\";\nimport { useInput } from \"../composables/useInput.js\";\nimport { Box } from \"./Box.js\";\nimport type { ModalProps } from \"./modal-types.js\";\nimport { Text } from \"./Text.js\";\n\nconst {\n visible = true,\n title,\n width = \"50%\",\n height = \"auto\",\n border = \"rounded\",\n titleFg = \"white\",\n borderFg,\n bg,\n focusId = `modal-${Math.random().toString(36).slice(2)}`,\n initialFocusId,\n trapFocus = true,\n restoreFocus = true,\n closeOnEscape = true,\n accessibilityLabel,\n} = defineProps<ModalProps>();\n\nconst emit = defineEmits<{\n close: [];\n}>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\ndefineOptions({ name: \"FrescoModal\" });\n\nconst manager = useFocusManager();\nconst wasFocusedBeforeOpen = ref<string>();\nconst isVisible = computed(() => visible);\nconst trapsFocus = computed(() => visible && trapFocus);\n\nif (visible) wasFocusedBeforeOpen.value = manager.activeId.value;\nwatch(\n isVisible,\n (next, previous) => {\n if (next && !previous) wasFocusedBeforeOpen.value = manager.activeId.value;\n },\n { flush: \"sync\" },\n);\n\nconst modalFocus = useFocus({\n id: focusId,\n isActive: isVisible,\n autoFocus: true,\n delegateFocusTo: computed(() => initialFocusId),\n trapFocus: trapsFocus,\n});\nprovideFocusScope(modalFocus.id);\n\nfunction focusInitialTarget(): void {\n if (!visible || !initialFocusId || !manager.focusableIds.value.includes(initialFocusId)) return;\n manager.focus(initialFocusId);\n}\n\nwatch(\n [isVisible, manager.focusableIds],\n () => {\n void nextTick(focusInitialTarget);\n },\n { deep: true, flush: \"post\" },\n);\nwatch(\n isVisible,\n (next, previous) => {\n if (next || !previous || !restoreFocus) return;\n const target = wasFocusedBeforeOpen.value;\n if (target && manager.focusableIds.value.includes(target)) manager.focus(target);\n wasFocusedBeforeOpen.value = undefined;\n },\n { flush: \"post\" },\n);\nonMounted(() => void nextTick(focusInitialTarget));\n\nuseInput({\n isActive: computed(() => visible && closeOnEscape),\n onEscape: () => emit(\"close\"),\n});\n\nconst accessibilityProps = computed(() => ({\n ariaRole: \"dialog\" as const,\n ariaLabel: accessibilityLabel ?? title ?? \"Dialog\",\n ariaHidden: !visible,\n ariaState: { expanded: visible },\n}));\n</script>\n\n<template>\n <Box\n :display=\"visible ? 'flex' : 'none'\"\n justify-content=\"center\"\n align-items=\"center\"\n width=\"100%\"\n height=\"100%\"\n :focus-id=\"modalFocus.id\"\n v-bind=\"accessibilityProps\"\n >\n <Box\n v-if=\"visible\"\n flex-direction=\"column\"\n :width\n :height\n :border\n :fg=\"borderFg\"\n :bg\n :padding=\"1\"\n >\n <Box v-if=\"title\" justify-content=\"center\" :padding-bottom=\"1\">\n <Text :content=\"title\" :fg=\"titleFg\" bold />\n </Box>\n <Box :flex-grow=\"1\">\n <slot />\n </Box>\n </Box>\n </Box>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, nextTick, onMounted, ref, watch } from \"vue\";\n\nimport { provideFocusScope, useFocus, useFocusManager } from \"../composables/useFocus.js\";\nimport { useInput } from \"../composables/useInput.js\";\nimport { Box } from \"./Box.js\";\nimport type { ModalProps } from \"./modal-types.js\";\nimport { Text } from \"./Text.js\";\n\nconst {\n visible = true,\n title,\n width = \"50%\",\n height = \"auto\",\n border = \"rounded\",\n titleFg = \"white\",\n borderFg,\n bg,\n focusId = `modal-${Math.random().toString(36).slice(2)}`,\n initialFocusId,\n trapFocus = true,\n restoreFocus = true,\n closeOnEscape = true,\n accessibilityLabel,\n} = defineProps<ModalProps>();\n\nconst emit = defineEmits<{\n close: [];\n}>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\ndefineOptions({ name: \"FrescoModal\" });\n\nconst manager = useFocusManager();\nconst wasFocusedBeforeOpen = ref<string>();\nconst isVisible = computed(() => visible);\nconst trapsFocus = computed(() => visible && trapFocus);\n\nif (visible) wasFocusedBeforeOpen.value = manager.activeId.value;\nwatch(\n isVisible,\n (next, previous) => {\n if (next && !previous) wasFocusedBeforeOpen.value = manager.activeId.value;\n },\n { flush: \"sync\" },\n);\n\nconst modalFocus = useFocus({\n id: focusId,\n isActive: isVisible,\n autoFocus: true,\n delegateFocusTo: computed(() => initialFocusId),\n trapFocus: trapsFocus,\n});\nprovideFocusScope(modalFocus.id);\n\nfunction focusInitialTarget(): void {\n if (!visible || !initialFocusId || !manager.focusableIds.value.includes(initialFocusId)) return;\n manager.focus(initialFocusId);\n}\n\nwatch(\n [isVisible, manager.focusableIds],\n () => {\n void nextTick(focusInitialTarget);\n },\n { deep: true, flush: \"post\" },\n);\nwatch(\n isVisible,\n (next, previous) => {\n if (next || !previous || !restoreFocus) return;\n const target = wasFocusedBeforeOpen.value;\n if (target && manager.focusableIds.value.includes(target)) manager.focus(target);\n wasFocusedBeforeOpen.value = undefined;\n },\n { flush: \"post\" },\n);\nonMounted(() => void nextTick(focusInitialTarget));\n\nuseInput({\n isActive: computed(() => visible && closeOnEscape),\n onEscape: () => emit(\"close\"),\n});\n\nconst accessibilityProps = computed(() => ({\n ariaRole: \"dialog\" as const,\n ariaLabel: accessibilityLabel ?? title ?? \"Dialog\",\n ariaHidden: !visible,\n ariaState: { expanded: visible },\n}));\n</script>\n\n<template>\n <Box\n :display=\"visible ? 'flex' : 'none'\"\n justify-content=\"center\"\n align-items=\"center\"\n width=\"100%\"\n height=\"100%\"\n :focus-id=\"modalFocus.id\"\n v-bind=\"accessibilityProps\"\n >\n <Box\n v-if=\"visible\"\n flex-direction=\"column\"\n :width\n :height\n :border\n :fg=\"borderFg\"\n :bg\n :padding=\"1\"\n >\n <Box v-if=\"title\" justify-content=\"center\" :padding-bottom=\"1\">\n <Text :content=\"title\" :fg=\"titleFg\" bold />\n </Box>\n <Box :flex-grow=\"1\">\n <slot />\n </Box>\n </Box>\n </Box>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, nextTick, onMounted, ref, watch } from \"vue\";\n\nimport { provideFocusScope, useFocus, useFocusManager } from \"../composables/useFocus.js\";\nimport { useInput } from \"../composables/useInput.js\";\nimport { Box } from \"./Box.js\";\nimport type { PopoverPlacement, PopoverProps } from \"./popover-types.js\";\n\ninterface PopoverPanelPosition {\n readonly top?: string;\n readonly right?: string;\n readonly bottom?: string;\n readonly left?: string;\n readonly marginTop?: number;\n readonly marginRight?: number;\n readonly marginBottom?: number;\n readonly marginLeft?: number;\n}\n\nconst {\n open = false,\n placement = \"bottom\",\n offset = 0,\n width,\n height,\n border = \"rounded\",\n fg,\n bg,\n focusId = `popover-${Math.random().toString(36).slice(2)}`,\n initialFocusId,\n trapFocus = true,\n restoreFocus = true,\n closeOnEscape = true,\n accessibilityRole = \"dialog\",\n accessibilityLabel = \"Popover\",\n} = defineProps<PopoverProps>();\n\nconst emit = defineEmits<{\n close: [];\n}>();\n\ndefineSlots<{\n anchor?: () => unknown;\n default?: () => unknown;\n}>();\n\ndefineOptions({ name: \"FrescoPopover\" });\n\nconst manager = useFocusManager();\nconst wasFocusedBeforeOpen = ref<string>();\nconst isOpen = computed(() => open);\nconst trapsFocus = computed(() => open && trapFocus);\n\nif (open) wasFocusedBeforeOpen.value = manager.activeId.value;\nwatch(\n isOpen,\n (next, previous) => {\n if (next && !previous) wasFocusedBeforeOpen.value = manager.activeId.value;\n },\n { flush: \"sync\" },\n);\n\nconst popoverFocus = useFocus({\n id: focusId,\n isActive: isOpen,\n autoFocus: true,\n delegateFocusTo: computed(() => initialFocusId),\n trapFocus: trapsFocus,\n});\nprovideFocusScope(popoverFocus.id);\n\nfunction focusInitialTarget(): void {\n if (!open || !initialFocusId || !manager.focusableIds.value.includes(initialFocusId)) return;\n manager.focus(initialFocusId);\n}\n\nwatch(\n [isOpen, manager.focusableIds],\n () => {\n void nextTick(focusInitialTarget);\n },\n { deep: true, flush: \"post\" },\n);\nwatch(\n isOpen,\n (next, previous) => {\n if (next || !previous || !restoreFocus) return;\n const target = wasFocusedBeforeOpen.value;\n if (target && manager.focusableIds.value.includes(target)) manager.focus(target);\n wasFocusedBeforeOpen.value = undefined;\n },\n { flush: \"post\" },\n);\nonMounted(() => void nextTick(focusInitialTarget));\n\nuseInput({\n isActive: computed(() => open && closeOnEscape),\n onEscape: () => emit(\"close\"),\n});\n\nfunction panelPosition(selected: PopoverPlacement): PopoverPanelPosition {\n const gap = Number.isFinite(offset) ? Math.max(0, offset) : 0;\n switch (selected) {\n case \"top\":\n return { bottom: \"100%\", marginBottom: gap };\n case \"right\":\n return { left: \"100%\", marginLeft: gap };\n case \"left\":\n return { right: \"100%\", marginRight: gap };\n case \"bottom\":\n default:\n return { top: \"100%\", marginTop: gap };\n }\n}\n\nconst position = computed(() => panelPosition(placement));\nconst accessibilityProps = computed(() => ({\n ariaRole: accessibilityRole,\n ariaLabel: accessibilityLabel,\n ariaState: { expanded: open },\n}));\n</script>\n\n<template>\n <Box position=\"relative\">\n <slot name=\"anchor\" />\n <Box\n v-if=\"open\"\n position=\"absolute\"\n :top=\"position.top\"\n :right=\"position.right\"\n :bottom=\"position.bottom\"\n :left=\"position.left\"\n :margin-top=\"position.marginTop\"\n :margin-right=\"position.marginRight\"\n :margin-bottom=\"position.marginBottom\"\n :margin-left=\"position.marginLeft\"\n :width\n :height\n :border=\"border === 'none' ? undefined : border\"\n :fg\n :bg\n :padding=\"1\"\n :focus-id=\"popoverFocus.id\"\n v-bind=\"accessibilityProps\"\n >\n <slot />\n </Box>\n </Box>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, nextTick, onMounted, ref, watch } from \"vue\";\n\nimport { provideFocusScope, useFocus, useFocusManager } from \"../composables/useFocus.js\";\nimport { useInput } from \"../composables/useInput.js\";\nimport { Box } from \"./Box.js\";\nimport type { PopoverPlacement, PopoverProps } from \"./popover-types.js\";\n\ninterface PopoverPanelPosition {\n readonly top?: string;\n readonly right?: string;\n readonly bottom?: string;\n readonly left?: string;\n readonly marginTop?: number;\n readonly marginRight?: number;\n readonly marginBottom?: number;\n readonly marginLeft?: number;\n}\n\nconst {\n open = false,\n placement = \"bottom\",\n offset = 0,\n width,\n height,\n border = \"rounded\",\n fg,\n bg,\n focusId = `popover-${Math.random().toString(36).slice(2)}`,\n initialFocusId,\n trapFocus = true,\n restoreFocus = true,\n closeOnEscape = true,\n accessibilityRole = \"dialog\",\n accessibilityLabel = \"Popover\",\n} = defineProps<PopoverProps>();\n\nconst emit = defineEmits<{\n close: [];\n}>();\n\ndefineSlots<{\n anchor?: () => unknown;\n default?: () => unknown;\n}>();\n\ndefineOptions({ name: \"FrescoPopover\" });\n\nconst manager = useFocusManager();\nconst wasFocusedBeforeOpen = ref<string>();\nconst isOpen = computed(() => open);\nconst trapsFocus = computed(() => open && trapFocus);\n\nif (open) wasFocusedBeforeOpen.value = manager.activeId.value;\nwatch(\n isOpen,\n (next, previous) => {\n if (next && !previous) wasFocusedBeforeOpen.value = manager.activeId.value;\n },\n { flush: \"sync\" },\n);\n\nconst popoverFocus = useFocus({\n id: focusId,\n isActive: isOpen,\n autoFocus: true,\n delegateFocusTo: computed(() => initialFocusId),\n trapFocus: trapsFocus,\n});\nprovideFocusScope(popoverFocus.id);\n\nfunction focusInitialTarget(): void {\n if (!open || !initialFocusId || !manager.focusableIds.value.includes(initialFocusId)) return;\n manager.focus(initialFocusId);\n}\n\nwatch(\n [isOpen, manager.focusableIds],\n () => {\n void nextTick(focusInitialTarget);\n },\n { deep: true, flush: \"post\" },\n);\nwatch(\n isOpen,\n (next, previous) => {\n if (next || !previous || !restoreFocus) return;\n const target = wasFocusedBeforeOpen.value;\n if (target && manager.focusableIds.value.includes(target)) manager.focus(target);\n wasFocusedBeforeOpen.value = undefined;\n },\n { flush: \"post\" },\n);\nonMounted(() => void nextTick(focusInitialTarget));\n\nuseInput({\n isActive: computed(() => open && closeOnEscape),\n onEscape: () => emit(\"close\"),\n});\n\nfunction panelPosition(selected: PopoverPlacement): PopoverPanelPosition {\n const gap = Number.isFinite(offset) ? Math.max(0, offset) : 0;\n switch (selected) {\n case \"top\":\n return { bottom: \"100%\", marginBottom: gap };\n case \"right\":\n return { left: \"100%\", marginLeft: gap };\n case \"left\":\n return { right: \"100%\", marginRight: gap };\n case \"bottom\":\n default:\n return { top: \"100%\", marginTop: gap };\n }\n}\n\nconst position = computed(() => panelPosition(placement));\nconst accessibilityProps = computed(() => ({\n ariaRole: accessibilityRole,\n ariaLabel: accessibilityLabel,\n ariaState: { expanded: open },\n}));\n</script>\n\n<template>\n <Box position=\"relative\">\n <slot name=\"anchor\" />\n <Box\n v-if=\"open\"\n position=\"absolute\"\n :top=\"position.top\"\n :right=\"position.right\"\n :bottom=\"position.bottom\"\n :left=\"position.left\"\n :margin-top=\"position.marginTop\"\n :margin-right=\"position.marginRight\"\n :margin-bottom=\"position.marginBottom\"\n :margin-left=\"position.marginLeft\"\n :width\n :height\n :border=\"border === 'none' ? undefined : border\"\n :fg\n :bg\n :padding=\"1\"\n :focus-id=\"popoverFocus.id\"\n v-bind=\"accessibilityProps\"\n >\n <slot />\n </Box>\n </Box>\n</template>\n","/**\n * StatusBar Component - Status bar (typically at bottom of screen)\n */\n\nimport { defineComponent, h, type PropType, type VNode } from \"vue\";\n\nexport interface StatusBarItem {\n key: string;\n content: string;\n fg?: string;\n bg?: string;\n bold?: boolean;\n align?: \"left\" | \"right\";\n}\n\nexport interface StatusBarProps {\n /** Status bar items */\n items: StatusBarItem[];\n /** Background color */\n bg?: string;\n /** Foreground color */\n fg?: string;\n /** Separator between items */\n separator?: string;\n}\n\nexport const StatusBar = defineComponent({\n name: \"StatusBar\",\n props: {\n items: {\n type: Array as PropType<StatusBarItem[]>,\n required: true,\n },\n bg: {\n type: String,\n default: \"blue\",\n },\n fg: {\n type: String,\n default: \"white\",\n },\n separator: {\n type: String,\n default: \" │ \",\n },\n },\n setup(props) {\n return () => {\n const leftItems = props.items.filter((item) => item.align !== \"right\");\n const rightItems = props.items.filter((item) => item.align === \"right\");\n\n const renderItems = (items: StatusBarItem[]): VNode[] => {\n const result: VNode[] = [];\n items.forEach((item, index) => {\n if (index > 0) {\n result.push(\n h(\n \"text\",\n { key: `sep-${item.key}`, fg: props.fg, bg: props.bg, dim: true },\n props.separator,\n ),\n );\n }\n result.push(\n h(\n \"text\",\n {\n key: item.key,\n fg: item.fg ?? props.fg,\n bg: item.bg ?? props.bg,\n bold: item.bold,\n },\n item.content,\n ),\n );\n });\n return result;\n };\n\n return h(\n \"box\",\n {\n bg: props.bg,\n style: {\n flex_direction: \"row\",\n justify_content: \"space-between\",\n width: \"100%\",\n padding_left: 1,\n padding_right: 1,\n },\n },\n [\n h(\"box\", { key: \"left\", style: { flex_direction: \"row\" } }, renderItems(leftItems)),\n h(\"box\", { key: \"right\", style: { flex_direction: \"row\" } }, renderItems(rightItems)),\n ],\n );\n };\n },\n});\n","<script setup lang=\"ts\">\nimport type { HeaderProps } from \"./presentational-primitive-types.js\";\n\nconst {\n title,\n subtitle,\n left,\n right,\n bg,\n titleFg = \"white\",\n subtitleFg = \"gray\",\n borderBottom = false,\n} = defineProps<HeaderProps>();\n\ndefineOptions({ name: \"FrescoHeader\" });\n\nconst rootStyle = { flexDirection: \"column\" } as const;\nconst contentStyle = {\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n width: \"100%\",\n padding: 1,\n} as const;\nconst rowStyle = { flexDirection: \"row\" } as const;\nconst borderLabel = \"─\".repeat(80);\n</script>\n\n<template>\n <div :style=\"rootStyle\">\n <div :bg :style=\"contentStyle\">\n <div :style=\"rowStyle\">\n <slot name=\"left\"\n ><text v-if=\"left\">{{ left }}</text></slot\n >\n </div>\n <div :style=\"rowStyle\">\n <text :fg=\"titleFg\" :bold=\"true\">{{ title }}</text>\n <text v-if=\"subtitle\" :fg=\"subtitleFg\" :dim=\"true\"> - {{ subtitle }}</text>\n </div>\n <div :style=\"rowStyle\">\n <slot name=\"right\"\n ><text v-if=\"right\">{{ right }}</text></slot\n >\n </div>\n </div>\n <text v-if=\"borderBottom\" :dim=\"true\">{{ borderLabel }}</text>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport type { HeaderProps } from \"./presentational-primitive-types.js\";\n\nconst {\n title,\n subtitle,\n left,\n right,\n bg,\n titleFg = \"white\",\n subtitleFg = \"gray\",\n borderBottom = false,\n} = defineProps<HeaderProps>();\n\ndefineOptions({ name: \"FrescoHeader\" });\n\nconst rootStyle = { flexDirection: \"column\" } as const;\nconst contentStyle = {\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n width: \"100%\",\n padding: 1,\n} as const;\nconst rowStyle = { flexDirection: \"row\" } as const;\nconst borderLabel = \"─\".repeat(80);\n</script>\n\n<template>\n <div :style=\"rootStyle\">\n <div :bg :style=\"contentStyle\">\n <div :style=\"rowStyle\">\n <slot name=\"left\"\n ><text v-if=\"left\">{{ left }}</text></slot\n >\n </div>\n <div :style=\"rowStyle\">\n <text :fg=\"titleFg\" :bold=\"true\">{{ title }}</text>\n <text v-if=\"subtitle\" :fg=\"subtitleFg\" :dim=\"true\"> - {{ subtitle }}</text>\n </div>\n <div :style=\"rowStyle\">\n <slot name=\"right\"\n ><text v-if=\"right\">{{ right }}</text></slot\n >\n </div>\n </div>\n <text v-if=\"borderBottom\" :dim=\"true\">{{ borderLabel }}</text>\n </div>\n</template>\n","/**\n * KeyHint Component - Display keyboard shortcut hints\n */\n\nimport { defineComponent, h, type PropType } from \"vue\";\n\nexport interface KeyBinding {\n keys: string[];\n description: string;\n}\n\nexport interface KeyHintProps {\n /** Key bindings to display */\n bindings: KeyBinding[];\n /** Layout direction */\n direction?: \"horizontal\" | \"vertical\";\n /** Key foreground color */\n keyFg?: string;\n /** Key background color */\n keyBg?: string;\n /** Description foreground color */\n descFg?: string;\n /** Separator between key and description */\n separator?: string;\n}\n\nexport const KeyHint = defineComponent({\n name: \"KeyHint\",\n props: {\n bindings: {\n type: Array as PropType<KeyBinding[]>,\n required: true,\n },\n direction: {\n type: String as PropType<\"horizontal\" | \"vertical\">,\n default: \"horizontal\",\n },\n keyFg: {\n type: String,\n default: \"black\",\n },\n keyBg: {\n type: String,\n default: \"white\",\n },\n descFg: {\n type: String,\n default: \"gray\",\n },\n separator: {\n type: String,\n default: \" \",\n },\n },\n setup(props) {\n return () => {\n const children = props.bindings.map((binding, index) => {\n const keyParts = binding.keys\n .map((key, keyIndex) => [\n h(\n \"text\",\n {\n key: `key-${keyIndex}`,\n fg: props.keyFg,\n bg: props.keyBg,\n bold: true,\n },\n ` ${key} `,\n ),\n keyIndex < binding.keys.length - 1 ? h(\"text\", { key: `plus-${keyIndex}` }, \"+\") : null,\n ])\n .flat()\n .filter(Boolean);\n\n return h(\n \"box\",\n {\n key: `binding-${index}`,\n style: {\n flex_direction: \"row\",\n margin_right: props.direction === \"horizontal\" ? 2 : 0,\n },\n },\n [\n ...keyParts,\n h(\"text\", {}, props.separator),\n h(\"text\", { fg: props.descFg }, binding.description),\n ],\n );\n });\n\n return h(\n \"box\",\n {\n style: {\n flex_direction: props.direction === \"horizontal\" ? \"row\" : \"column\",\n flex_wrap: \"wrap\",\n },\n },\n children,\n );\n };\n },\n});\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\nimport {\n avatarStatusColors,\n avatarStatusIcons,\n type AvatarProps,\n} from \"./presentational-primitive-types.js\";\n\nconst {\n name,\n initials,\n size = \"md\",\n bg = \"blue\",\n fg = \"white\",\n border = true,\n status,\n} = defineProps<AvatarProps>();\n\ndefineOptions({ name: \"FrescoAvatar\" });\n\nconst takeCodePoints = (value: string, count: number) => Array.from(value).slice(0, count).join(\"\");\nconst displayInitials = computed(() => {\n if (initials) return initials;\n const parts = name?.split(\" \").filter(Boolean) ?? [];\n if (parts.length >= 2) {\n return `${takeCodePoints(parts[0], 1)}${takeCodePoints(parts[1], 1)}`.toUpperCase();\n }\n if (parts.length === 1) return takeCodePoints(parts[0], 2).toUpperCase();\n return \"??\";\n});\nconst padding = computed(() => (size === \"lg\" ? 1 : 0));\nconst containerStyle = computed(() => ({\n flexDirection: \"row\" as const,\n paddingLeft: padding.value,\n paddingRight: padding.value,\n}));\n</script>\n\n<template>\n <div :border=\"border ? 'rounded' : undefined\" :bg :style=\"containerStyle\">\n <text :fg :bg :bold=\"true\">{{ displayInitials }}</text>\n <text v-if=\"status\" :fg=\"avatarStatusColors[status]\">{{ avatarStatusIcons[status] }}</text>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\nimport {\n avatarStatusColors,\n avatarStatusIcons,\n type AvatarProps,\n} from \"./presentational-primitive-types.js\";\n\nconst {\n name,\n initials,\n size = \"md\",\n bg = \"blue\",\n fg = \"white\",\n border = true,\n status,\n} = defineProps<AvatarProps>();\n\ndefineOptions({ name: \"FrescoAvatar\" });\n\nconst takeCodePoints = (value: string, count: number) => Array.from(value).slice(0, count).join(\"\");\nconst displayInitials = computed(() => {\n if (initials) return initials;\n const parts = name?.split(\" \").filter(Boolean) ?? [];\n if (parts.length >= 2) {\n return `${takeCodePoints(parts[0], 1)}${takeCodePoints(parts[1], 1)}`.toUpperCase();\n }\n if (parts.length === 1) return takeCodePoints(parts[0], 2).toUpperCase();\n return \"??\";\n});\nconst padding = computed(() => (size === \"lg\" ? 1 : 0));\nconst containerStyle = computed(() => ({\n flexDirection: \"row\" as const,\n paddingLeft: padding.value,\n paddingRight: padding.value,\n}));\n</script>\n\n<template>\n <div :border=\"border ? 'rounded' : undefined\" :bg :style=\"containerStyle\">\n <text :fg :bg :bold=\"true\">{{ displayInitials }}</text>\n <text v-if=\"status\" :fg=\"avatarStatusColors[status]\">{{ avatarStatusIcons[status] }}</text>\n </div>\n</template>\n"],"mappings":";;;;;;;AAqEA,MAAM,gBAAgB,CAAC,QAAQ,MAAM;AAErC,SAAS,qBAAqB,OAAiE;CAC7F,IAAI,UAAU,SAAS,OAAO;CAC9B,IAAI,UAAU,QAAQ,OAAO;CAC7B,OAAO;AACT;AAEA,MAAa,MAAM,gBAAgB;CACjC,MAAM;CACN,OAAO;EACL,SAAS;EACT,UAAU;EACV,KAAK;EACL,OAAO;EACP,QAAQ;EACR,MAAM;EACN,eAAe;EACf,UAAU;EACV,gBAAgB;EAChB,YAAY;EACZ,WAAW;EACX,cAAc;EACd,UAAU;EACV,YAAY;EACZ,WAAW;EACX,OAAO;EACP,QAAQ;EACR,UAAU;EACV,WAAW;EACX,UAAU;EACV,WAAW;EACX,aAAa;EACb,SAAS;EACT,UAAU;EACV,UAAU;EACV,YAAY;EACZ,cAAc;EACd,eAAe;EACf,aAAa;EACb,QAAQ;EACR,SAAS;EACT,SAAS;EACT,WAAW;EACX,aAAa;EACb,cAAc;EACd,YAAY;EACZ,KAAK;EACL,WAAW;EACX,QAAQ;EACR,UAAU;EACV,WAAW;EACX,WAAW;EACX,SAAS;E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