@k2b/ui 0.39.0 → 0.40.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 +1 @@
1
- {"version":3,"names":[],"sources":["layout/AppWorkspace.tsx"],"sourcesContent":["import { Link, type LinkNavigateEvent, type NavigationScrollMode } from \"@k2b/ssr/nav\";\nimport {\n children,\n createContext,\n createEffect,\n createMemo,\n createRoot,\n createSignal,\n createUniqueId,\n For,\n getOwner,\n type JSX,\n mergeProps,\n on,\n onCleanup,\n onMount,\n Show,\n useContext,\n} from \"solid-js\";\nimport { Dynamic, isServer } from \"solid-js/web\";\nimport { Button, ButtonLink, IconButton, IconButtonLink } from \"../actions/Button\";\nimport { useFilterMessages } from \"../actions/filter-messages\";\nimport { dialogCore } from \"../feedback/dialog-core\";\nimport { Tooltip } from \"../feedback/Tooltip\";\nimport { RenderErrorBoundary } from \"../internal/render-error\";\nimport {\n APP_WORKSPACE_DETAIL_CLOSE_EVENT,\n APP_WORKSPACE_DETAIL_OPEN_EVENT,\n APP_WORKSPACE_DETAIL_STEP_EVENT,\n APP_WORKSPACE_SIDEBAR_HIDE_EVENT,\n type AppWorkspaceDetailStep,\n installAppWorkspaceController,\n} from \"./app-workspace-controller\";\nimport {\n APP_WORKSPACE_DETAIL_DEFAULT,\n APP_WORKSPACE_DETAIL_MAX,\n APP_WORKSPACE_DETAIL_MIN,\n APP_WORKSPACE_DRAWER_DEFAULT,\n APP_WORKSPACE_DRAWER_MAX,\n APP_WORKSPACE_DRAWER_MIN,\n APP_WORKSPACE_MAIN_MIN,\n APP_WORKSPACE_PANE_DEFAULT,\n APP_WORKSPACE_PANE_MAX,\n APP_WORKSPACE_PANE_MIN,\n APP_WORKSPACE_SIDEBAR_COLLAPSED,\n APP_WORKSPACE_SIDEBAR_DEFAULT,\n APP_WORKSPACE_SIDEBAR_MAX,\n APP_WORKSPACE_SIDEBAR_MIN,\n type AppWorkspaceLayoutState,\n appWorkspaceLayoutStyle,\n appWorkspacePanelVariable,\n} from \"./app-workspace-state\";\nimport {\n type AppWorkspaceWidthShare,\n appWorkspaceInverseWidthCss,\n appWorkspaceWidthCss,\n appWorkspaceWidthToken,\n isAppWorkspaceWidthShare,\n} from \"./app-workspace-width\";\nimport BottomSheet, { bottomSheetAdaptiveOptions } from \"./BottomSheet\";\nimport { PageTitle, usePageTrail } from \"./PageTitle\";\nimport type { ScrollAreaProps } from \"./ScrollArea\";\nimport { SidebarItemPreview } from \"./SidebarItemPreview\";\nimport { inSidebarRail, SidebarRailHint } from \"./SidebarRailHint\";\nimport { AppWorkspaceSidebarSwitcher, type AppWorkspaceSidebarSwitcherProps } from \"./SidebarSwitcher\";\nimport { createScrollFade, scrollFadeEdges } from \"./scroll-fade\";\nimport { rememberSidebarScroll } from \"./sidebar-scroll-memory\";\nimport { assertStableUiId, assertUniqueStableUiIds } from \"./stable-id\";\nimport { useWorkspaceMessages } from \"./workspace-messages\";\n\nexport type { AppWorkspaceWidthShare } from \"./app-workspace-width\";\n\n/** The narrowest container of each levels width class, as the stylesheet's breakpoints define them (48rem, 80rem). */\nconst LEVEL_CLASS_WIDTH = { 1: 0, 2: 768, 3: 1280 } as const;\n/** The last shown level's minimum width when the level does not declare one; the stylesheet uses the same value. */\nconst LEVEL_LAST_MIN = 320;\n/** The width the last shown level keeps at least: its declared minimum, never below the default. */\nconst levelLastMin = (minSize: number | undefined) => Math.max(minSize ?? 0, LEVEL_LAST_MIN);\nconst nonEmptyStyle = (style: Record<string, string>) => (Object.keys(style).length ? style : undefined);\nconst ResizeContext = createContext(true);\n/** The enclosing workspace: its head names the sidebar, and a nested workspace leaves the page title to it. */\nconst WorkspaceContext = createContext<{\n sidebarId: string;\n setSidebarId: (id: string) => void;\n initialLayoutState: () => AppWorkspaceLayoutState | null | undefined;\n}>();\nconst LayoutStateContext = createContext<AppWorkspaceLayoutState | null>(null);\nconst HEAD = Symbol(\"AppWorkspace.Head\");\ntype HeadSlot = { kind: typeof HEAD; props: AppWorkspaceHeadProps };\nconst headSlot = (value: unknown): value is HeadSlot => !!value && typeof value === \"object\" && \"kind\" in value && value.kind === HEAD;\nconst MAIN_PANE = Symbol(\"AppWorkspace.MainPane\");\nconst SIDEBAR_DESKTOP = Symbol(\"AppWorkspace.SidebarDesktop\");\nconst SIDEBAR_ITEM_ICON = Symbol(\"AppWorkspace.SidebarItemIcon\");\nconst SIDEBAR_ITEM_LABEL = Symbol(\"AppWorkspace.SidebarItemLabel\");\nconst SIDEBAR_ITEM_META = Symbol(\"AppWorkspace.SidebarItemMeta\");\nconst SIDEBAR_ITEM_ACTION = Symbol(\"AppWorkspace.SidebarItemAction\");\nconst NAV_TREE_ITEM = Symbol(\"AppWorkspace.NavTree.Item\");\n\ntype MainPaneSlot = {\n kind: typeof MAIN_PANE;\n props: AppWorkspaceMainPaneProps;\n domId: string;\n};\ntype SidebarChildSlot = { kind: typeof SIDEBAR_DESKTOP; children: JSX.Element };\ntype SidebarItemSlot =\n | (AppWorkspaceSidebarItemIconProps & { kind: typeof SIDEBAR_ITEM_ICON })\n | (AppWorkspaceSidebarItemLabelProps & { kind: typeof SIDEBAR_ITEM_LABEL })\n | (AppWorkspaceSidebarItemMetaProps & { kind: typeof SIDEBAR_ITEM_META })\n | (AppWorkspaceSidebarItemActionProps & { kind: typeof SIDEBAR_ITEM_ACTION });\ntype NavTreeItemSlot = AppWorkspaceNavTreeItemProps & { kind: typeof NAV_TREE_ITEM };\n\nconst flatten = (value: unknown): unknown[] => {\n // Solid control-flow components such as <For> expose their rendered value\n // through an accessor. Compound slots may therefore be nested behind a\n // function even after `children()` resolves the outer collection.\n if (typeof value === \"function\") return flatten(value());\n if (Array.isArray(value)) return value.flatMap(flatten);\n return value === null || value === undefined || typeof value === \"boolean\" ? [] : [value];\n};\nconst mainPaneSlot = (value: unknown): value is MainPaneSlot =>\n Boolean(value && typeof value === \"object\" && \"kind\" in value && (value as MainPaneSlot).kind === MAIN_PANE);\nconst sidebarChildSlot = (value: unknown): value is SidebarChildSlot =>\n Boolean(value && typeof value === \"object\" && \"kind\" in value && (value as SidebarChildSlot).kind === SIDEBAR_DESKTOP);\nconst sidebarItemSlot = (value: unknown): value is SidebarItemSlot =>\n Boolean(\n value &&\n typeof value === \"object\" &&\n \"kind\" in value &&\n [SIDEBAR_ITEM_ICON, SIDEBAR_ITEM_LABEL, SIDEBAR_ITEM_META, SIDEBAR_ITEM_ACTION].includes((value as SidebarItemSlot).kind),\n );\nconst navTreeItemSlot = (value: unknown): value is NavTreeItemSlot =>\n Boolean(value && typeof value === \"object\" && \"kind\" in value && (value as NavTreeItemSlot).kind === NAV_TREE_ITEM);\n\nexport type AppWorkspaceHeadProps = {\n /** Below 48rem, show this head only with this active Main region. Unsplit Mains keep their head. */\n mobilePane?: string;\n /** View tabs, usually a ViewTabs. */\n views?: JSX.Element;\n /** Filter chips, usually FilterChip elements. */\n filters?: JSX.Element;\n /** Any filter is active: shows Reset and the quiet result count. */\n filtered?: boolean;\n /** Reset target while filtered: a URL (works without JavaScript) and/or a callback. */\n resetHref?: string;\n onReset?: () => void;\n /** Quiet result count shown only while filtered; CSS drops it first when space is short. */\n count?: JSX.Element;\n /** Secondary actions at the end of the row. Never a filled button. */\n actions?: JSX.Element;\n /** The one filled primary action. Below 48rem it becomes a round icon button beside the host's bottom bar. */\n primary?: { label: string; icon: string; href?: string; onClick?: (event: MouseEvent) => void };\n};\n\n/** Head row slot. Must be a direct child of AppWorkspace; its parts may be islands. */\nfunction AppWorkspaceHeadSlot(props: AppWorkspaceHeadProps): JSX.Element {\n return { kind: HEAD, props } satisfies HeadSlot as unknown as JSX.Element;\n}\n\ntype ResizeHandleProps = {\n kind: \"sidebar\" | \"pane\" | \"detail\" | \"drawer\";\n edge: \"start\" | \"end\";\n controls?: string;\n panelId?: string;\n defaultSize: number | AppWorkspaceWidthShare;\n minSize: number;\n maxSize: number;\n shadow?: boolean;\n label?: string;\n style?: JSX.CSSProperties;\n levelShown?: string;\n};\n\nfunction ResizeHandle(props: ResizeHandleProps): JSX.Element {\n const workspaceMessages = useWorkspaceMessages();\n const workspace = useContext(WorkspaceContext);\n const providerState = useContext(LayoutStateContext);\n const initialSize = () => {\n const state = workspace?.initialLayoutState() ?? providerState;\n const id = props.panelId ?? \"primary\";\n const size =\n props.kind === \"sidebar\"\n ? state?.sidebarCollapsed\n ? APP_WORKSPACE_SIDEBAR_COLLAPSED\n : state?.sidebarWidth\n : props.kind === \"pane\"\n ? state?.paneWidths?.[id]\n : props.kind === \"detail\"\n ? state?.detailWidths?.[id]\n : state?.drawerHeights?.[id];\n return Math.min(\n props.maxSize,\n Math.max(props.minSize, size ?? (typeof props.defaultSize === \"number\" ? props.defaultSize : props.defaultSize.min)),\n );\n };\n return (\n <button\n type=\"button\"\n class=\"k2b-app-workspace__resize\"\n role=\"separator\"\n aria-label={\n props.label ??\n (props.kind === \"sidebar\"\n ? workspaceMessages().resizeNavigation\n : props.kind === \"pane\"\n ? workspaceMessages().resizeWorkspacePane\n : props.kind === \"detail\"\n ? workspaceMessages().resizeDetailPanel\n : workspaceMessages().resizeBottomDrawer)\n }\n aria-controls={props.controls}\n aria-orientation={props.kind === \"drawer\" ? \"horizontal\" : \"vertical\"}\n aria-valuemin={props.minSize}\n aria-valuemax={props.maxSize}\n aria-valuenow={initialSize()}\n data-workspace-level-shown={props.levelShown}\n data-app-workspace-resize={props.kind}\n data-workspace-panel-id={props.panelId}\n data-workspace-resize-edge={props.edge}\n data-workspace-resize-shadow={props.shadow ? \"true\" : undefined}\n data-workspace-default-size={appWorkspaceWidthToken(props.defaultSize)}\n data-workspace-min-size={props.minSize}\n data-workspace-max-size={props.maxSize}\n style={props.style}\n >\n <span aria-hidden=\"true\" />\n </button>\n );\n}\n\nexport type AppWorkspaceProps = {\n children: JSX.Element;\n class?: string;\n /** A host with its own phone chrome can use the full canvas below 48rem (768 px). */\n mobileSurface?: \"contained\" | \"flush\";\n /** Removes the workspace's own border, radius, and shadow for an overview that is the page itself.\n * A host may frame the outermost workspace as its app card, as Cloud does from 1024 px on signed-in pages. */\n flat?: boolean;\n resizable?: boolean;\n /**\n * Restores a persisted layout when the workspace mounts. Persistence itself\n * stays app-owned — the package reads and writes nothing on its own — but\n * the resize handles work without it.\n */\n layoutState?: () => AppWorkspaceLayoutState | null | undefined;\n /** Called with the full layout whenever a resize settles. Persist it here. */\n onLayoutChange?: (state: AppWorkspaceLayoutState) => void;\n /**\n * Opt out of the built-in controller. Only needed when the application calls\n * `installAppWorkspaceController` itself — installing twice would double up\n * every listener.\n */\n controller?: false;\n};\nexport type AppWorkspaceLayoutStateProviderProps = {\n children: JSX.Element;\n state: AppWorkspaceLayoutState | null | undefined;\n};\nexport type AppWorkspaceContentProps = { children: JSX.Element; class?: string };\nexport type AppWorkspaceMainProps = {\n children: JSX.Element;\n class?: string;\n /** `\"content\"` centers the children as one reading column with the shared page width on large screens. */\n width?: \"full\" | \"content\";\n /**\n * The width in px or a workspace width share that Main keeps beside the sidebar and an open Detail,\n * from 48rem (768 px); at least the default 320. A Detail that does not fit\n * beside it waits behind the head's Details button, and from 64rem of host\n * width a sidebar that does not fit becomes the overlay. CSS decides, so\n * the server renders the first frame.\n */\n minWidth?: number | AppWorkspaceWidthShare;\n mobilePane?: string;\n /** Levels in DOM order, shallowest first. The URL selects the deepest level by id. */\n level?: string;\n /** Enhanced navigation for the back step; otherwise it is a document link. */\n onLevelNavigate?: (event: LinkNavigateEvent) => void | Promise<void>;\n scroll?: boolean;\n scrollFade?: boolean;\n scrollPreserveKey?: string | false;\n \"aria-busy\"?: boolean | \"true\" | \"false\";\n};\nexport type AppWorkspaceMainPaneProps = {\n id: string;\n label: string;\n /** Levels mode: URL selecting this level. Required except on the last level. */\n href?: string;\n /** Quiet one-line text below the level title. */\n description?: JSX.Element;\n /** Levels mode: a small mark before the level title, such as the colour dot of the object's container. */\n lead?: JSX.Element;\n /** Controls at the end of the level head. */\n actions?: JSX.Element;\n surface?: \"default\" | \"navigation\";\n open?: boolean;\n resizable?: boolean;\n resizeShadow?: boolean;\n defaultSize?: number | AppWorkspaceWidthShare;\n /**\n * The narrowest width in px, also for a person resizing it. Levels mode: the level needs it to be shown; when the\n * deepest levels do not fit side by side at their minimum widths, the shallowest of them gives way, so a wide list\n * pushes earlier columns aside.\n */\n minSize?: number;\n maxSize?: number;\n class?: string;\n scroll?: boolean;\n scrollFade?: boolean;\n children: JSX.Element;\n};\nexport type AppWorkspaceDetailWidth = \"sm\" | \"md\" | \"lg\" | \"xl\";\nexport type AppWorkspaceDetailProps = {\n children: JSX.Element;\n open: boolean;\n /** Keeps the shared head control reachable while closed; set the app's existing open state synchronously. */\n onOpen?: () => void;\n /** Whether the current object may show details. False disables reopening and hides the panel. */\n available?: boolean;\n /**\n * Whether choosing an item in Main opens this Detail as the drawer while it waits.\n * Set false when Main itself shows the chosen item, such as a reader beside a list:\n * the drawer then opens only from Details or from a toggle in Main.\n */\n openOnChoice?: boolean;\n id: string;\n class?: string;\n width?: AppWorkspaceDetailWidth;\n /** Below 48rem, a full page without sheet gestures for a destination such as chat info; defaults to \"sheet\". */\n phone?: \"sheet\" | \"page\";\n viewTransitionName?: string;\n resizable?: boolean;\n minWidth?: number;\n maxWidth?: number;\n /**\n * Closes the column with Escape, or the phone sheet with a downward drag.\n * With onOpen, the shared head control also closes the column or phone sheet.\n * Server-rendered panels mark their close control with\n * `data-workspace-detail-close` instead; those gestures click it.\n * Escape and a rightward touch swipe park an open waiting drawer without\n * calling onClose, so its Details button can open it again.\n */\n onClose?: () => void;\n /**\n * Shows the previous (`-1`) or next (`1`) item; J and K call it while the\n * panel is open. Return the Main element that now shows the selection,\n * usually its link: Escape and F6 then go there, and the workspace reveals\n * it beside the panel or above the phone sheet. Returning nothing keeps the\n * previous item.\n */\n onStep?: (direction: 1 | -1) => HTMLElement | null | undefined | void;\n};\nexport type AppWorkspaceBottomDrawerHeight = \"sm\" | \"md\" | \"lg\";\nexport type AppWorkspaceBottomDrawerProps = {\n children: JSX.Element;\n open: boolean;\n id: string;\n class?: string;\n height?: AppWorkspaceBottomDrawerHeight;\n minHeight?: number;\n maxHeight?: number;\n viewTransitionName?: string;\n resizable?: boolean;\n};\nexport type AppWorkspaceSidebarProps = {\n /** Stable element id, for a toggle elsewhere that names the sidebar in `aria-controls`. */\n id?: string;\n label?: string;\n children: JSX.Element;\n class?: string;\n /**\n * Below 48rem (768 px) the sidebar is hidden and the host's mobile\n * navigation takes over; from 48 to 64rem it is an overlay that a button in\n * the workspace's head opens. `\"stacked\"` is for overviews whose sidebar is\n * the primary object list: below 64rem its items become one row of chips\n * above the content, and \"All\" at the end of the row opens the complete\n * sidebar in a sheet (a centered dialog from 48rem). From 64rem it is the\n * regular sidebar column; the element is a `nav` landmark either way.\n */\n mobile?: \"hidden\" | \"stacked\";\n resizable?: boolean;\n resizeShadow?: boolean;\n collapsible?: boolean;\n defaultSize?: number;\n minSize?: number;\n maxSize?: number;\n /**\n * Hides the desktop navigation completely: the sidebar renders none of its\n * children and no resize handle, and main panes with `surface=\"navigation\"`\n * hide with it. The state is application-owned, like a persisted layout.\n */\n hidden?: boolean;\n /**\n * Makes the sidebar hideable by dragging its resize handle below half its\n * minimum width. The controller then requests `true`; showing it again is\n * the application's control.\n */\n onHiddenChange?: (hidden: boolean) => void;\n};\nexport type AppWorkspaceSidebarVisibility = \"always\" | \"expanded\" | \"collapsed\";\nexport type AppWorkspaceSidebarAccessoryVisibility = \"always\" | \"hover\";\ntype AppWorkspaceSidebarContentProps = {\n children: JSX.Element;\n class?: string;\n scrollPreserveKey?: string | false;\n sidebarMode?: AppWorkspaceSidebarVisibility;\n};\nexport type AppWorkspaceSidebarBodyProps = AppWorkspaceSidebarContentProps & { scrollFade?: boolean };\nexport type AppWorkspaceSidebarSectionProps = AppWorkspaceSidebarContentProps & {\n title?: string;\n icon?: string;\n count?: number;\n collapsible?: boolean;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n actions?: JSX.Element;\n};\nexport type AppWorkspaceSidebarItemTone = \"default\" | \"success\" | \"danger\";\nexport type AppWorkspaceSidebarIconActionTone = \"default\" | \"success\" | \"danger\";\nexport type AppWorkspaceSidebarItemProps = {\n children: JSX.Element;\n /**\n * Card rows add a quiet context header above the main label. Object rows\n * present one resource with a title, a description line, and stacked\n * trailing counts; use them for the objects an overview navigates into.\n */\n variant?: \"row\" | \"card\" | \"object\";\n context?: JSX.Element;\n contextMeta?: JSX.Element;\n /** Passive second line; keep controls in actions or preview. */\n description?: JSX.Element;\n /**\n * A third line with the one fact about the row that needs attention, such as \"3 deliveries failed\". `noteTone`\n * colours it; the words carry the meaning, the colour only repeats it.\n */\n note?: JSX.Element;\n noteTone?: \"neutral\" | \"warning\" | \"danger\";\n /** Interactive details, also reachable through a dedicated button. */\n preview?: {\n label: string;\n content: JSX.Element | ((close: () => void) => JSX.Element);\n trigger?: \"action\" | \"row\";\n align?: \"center\" | \"end\";\n viewportSize?: ScrollAreaProps[\"viewportSize\"];\n onOpenChange?: (open: boolean) => void;\n };\n href?: string;\n /** Document navigation by default; opt into enhanced navigation only when the owning island applies the target state. */\n navigation?: \"enhanced\" | \"document\";\n replace?: boolean;\n scroll?: NavigationScrollMode;\n onNavigate?: (event: LinkNavigateEvent) => void | Promise<void>;\n onClick?: (event: MouseEvent) => void;\n /**\n * Marks the current page (`aria-current=\"page\"`). On a page deeper than the\n * sidebar lists, pass `\"ancestor\"` for the item that contains it: it keeps\n * the highlight, and the page keeps its back link.\n */\n active?: boolean | \"ancestor\";\n activeClass?: string;\n disabled?: boolean;\n icon?: string;\n meta?: JSX.Element;\n metaVisibility?: AppWorkspaceSidebarAccessoryVisibility;\n actions?: JSX.Element;\n tone?: AppWorkspaceSidebarItemTone;\n title?: string;\n viewTransitionName?: string;\n class?: string;\n depth?: number;\n actionIcon?: string;\n actionLabel?: string;\n onActionClick?: (event: MouseEvent) => void;\n data?: Record<string, string | number | boolean | null | undefined>;\n sidebarMode?: AppWorkspaceSidebarVisibility;\n};\nexport type AppWorkspaceSidebarIconGridProps = AppWorkspaceSidebarContentProps & { title?: string; columns?: 2 | 3 };\nexport type AppWorkspaceSidebarIconActionProps = {\n href?: string | null;\n /** Document navigation by default; opt into enhanced navigation only when the owning island applies the target state. */\n navigation?: \"enhanced\" | \"document\";\n replace?: boolean;\n scroll?: NavigationScrollMode;\n onNavigate?: (event: LinkNavigateEvent) => void | Promise<void>;\n icon: string;\n label: string;\n active?: boolean;\n disabled?: boolean;\n tone?: AppWorkspaceSidebarIconActionTone;\n viewTransitionName?: string;\n onClick?: (event: MouseEvent) => void;\n sidebarMode?: AppWorkspaceSidebarVisibility;\n};\nexport type AppWorkspaceSidebarItemIconProps = { icon?: string; children?: JSX.Element };\nexport type AppWorkspaceSidebarItemLabelProps = {\n children: JSX.Element;\n /** False keeps one line that fades out; rows wrap long labels onto a second line by default. */\n marquee?: boolean;\n};\nexport type AppWorkspaceSidebarItemMetaProps = {\n children: JSX.Element;\n visibility?: AppWorkspaceSidebarAccessoryVisibility;\n};\nexport type AppWorkspaceSidebarItemActionProps = {\n icon?: string;\n label: string;\n disabled?: boolean;\n /** Hide the action on fine pointers until the row is hovered or keyboard-focused. */\n visibility?: AppWorkspaceSidebarAccessoryVisibility;\n href?: string;\n navigation?: \"enhanced\" | \"document\";\n onSelect?: (event: MouseEvent) => void;\n children?: JSX.Element;\n};\nexport type AppWorkspaceSidebarItemActionsProps = {\n children: JSX.Element;\n visibility?: AppWorkspaceSidebarAccessoryVisibility;\n};\n/**\n * Unread state for the trailing `meta` slot. Every mark keeps a fixed width,\n * so the row keeps its height and the label its start in every state.\n */\nexport type AppWorkspaceSidebarItemStatusProps = {\n /**\n * A positive number shows a count (above 99 as \"99+\") and sets the label in\n * a stronger weight; `true` shows a quiet dot for new activity that should\n * not draw attention, such as in a muted conversation.\n */\n unread?: number | boolean;\n /** Marks unread items that mention the person with \"@\". */\n mention?: boolean;\n /**\n * Shows a muted bell, and the item reads as set aside: its label in the muted ink without unread weight, and a\n * mention count without its fill.\n */\n muted?: boolean;\n /**\n * Items that wait for the person, such as requests to approve, in the unread slot instead of `unread`. `label` is\n * the phrase a screen reader hears, for example \"3 waiting\". `0` stays as a muted count, for a count that dropped\n * to zero while the row is still shown; leave the prop out when nothing waits.\n */\n waiting?: { count: number; label: string };\n};\nexport type AppWorkspaceNavTreeProps = {\n children: JSX.Element;\n ariaLabel: string;\n selectedId?: string | null;\n expandedIds?: readonly string[];\n defaultExpandedIds?: readonly string[];\n onSelectedIdChange?: (id: string) => void;\n onExpandedIdsChange?: (ids: readonly string[]) => void;\n indented?: boolean;\n /**\n * Lets people reorder `movable` items among their siblings: by dragging on\n * fine pointers and with Alt+ArrowUp/ArrowDown on a focused item. The tree\n * only reports the requested place; the application saves it and renders\n * the new order, and the tree then keeps focus on the moved item.\n */\n onMove?: (move: AppWorkspaceNavTreeMove) => void;\n class?: string;\n};\n/** One requested place for an item among its unchanged siblings. */\nexport type AppWorkspaceNavTreeMove = {\n id: string;\n /** The parent item, unchanged by the move; `null` on the top level. */\n parentId: string | null;\n /** The sibling the item now precedes; `null` when it becomes the last. */\n beforeId: string | null;\n /** The sibling the item now follows; `null` when it becomes the first. */\n afterId: string | null;\n};\nexport type AppWorkspaceNavTreeItemProps = {\n id: string;\n label: JSX.Element;\n /** Passive second line under the label, such as a date; keep controls in actions. */\n description?: JSX.Element;\n children?: JSX.Element;\n href?: string;\n /** Document navigation by default; opt into enhanced navigation only when the owning island applies the target state. */\n navigation?: \"enhanced\" | \"document\";\n replace?: boolean;\n scroll?: NavigationScrollMode;\n onNavigate?: (event: LinkNavigateEvent) => void | Promise<void>;\n onSelect?: (event: MouseEvent) => void;\n disabled?: boolean;\n icon?: string;\n /** Names a meaningful icon for screen readers, such as \"Homepage\"; without it the icon is decorative. */\n iconLabel?: string;\n /** Replaces `icon` while this branch is expanded and makes the icon the disclosure target. */\n expandedIcon?: string;\n meta?: JSX.Element;\n metaVisibility?: AppWorkspaceSidebarAccessoryVisibility;\n actions?: JSX.Element;\n tone?: AppWorkspaceSidebarItemTone;\n title?: string;\n viewTransitionName?: string;\n class?: string;\n /** With the tree's `onMove`, the item can change its place among its siblings. Other items keep theirs, and no item moves past them. */\n movable?: boolean;\n /**\n * Shows the item as a branch before its children are rendered, for a tree that loads a branch when it opens. The\n * application renders the children, or a row that says they load, once the item is expanded.\n */\n hasChildren?: boolean;\n onDragEnter?: JSX.EventHandlerUnion<HTMLDivElement, DragEvent>;\n onDragOver?: JSX.EventHandlerUnion<HTMLDivElement, DragEvent>;\n onDragLeave?: JSX.EventHandlerUnion<HTMLDivElement, DragEvent>;\n onDrop?: JSX.EventHandlerUnion<HTMLDivElement, DragEvent>;\n};\ntype AppWorkspaceNavTreeComponent = ((props: AppWorkspaceNavTreeProps) => JSX.Element) & {\n Item: (props: AppWorkspaceNavTreeItemProps) => JSX.Element;\n};\n\nconst modeAttrs = (mode?: AppWorkspaceSidebarVisibility) => (mode && mode !== \"always\" ? { \"data-sidebar-mode\": mode } : {});\n/** Same rule as `modeAttrs`, for the un-prefixed `data` bag on sidebar items. */\nconst modeData = (mode?: AppWorkspaceSidebarVisibility) => (mode && mode !== \"always\" ? { \"sidebar-mode\": mode } : {});\nconst scrollAttrs = (key?: string | false) => (key ? { \"data-scroll-preserve\": key } : {});\nconst iconClass = (icon: string | undefined, fallback = \"ti-circle\") => (icon?.startsWith(\"ti \") ? icon : `ti ${icon || fallback}`);\n/** A named icon is an image screen readers announce; any other icon is decoration. */\nconst iconAccessibility = (label: string | undefined) => (label ? { role: \"img\" as const, \"aria-label\": label } : { \"aria-hidden\": true });\n\nfunction AppWorkspaceMainPane(props: AppWorkspaceMainPaneProps): JSX.Element {\n return {\n kind: MAIN_PANE,\n props,\n domId: `k2b-workspace-pane-${createUniqueId()}`,\n } satisfies MainPaneSlot as unknown as JSX.Element;\n}\n\n/** A level's head; `children` is its back step. It mounts and cleans up with its open pane. */\nfunction LevelHead(props: {\n label: string;\n description?: JSX.Element;\n actions?: JSX.Element;\n lead?: JSX.Element;\n children: JSX.Element;\n}): JSX.Element {\n // Read each slot once: every read of a JSX prop builds it again, and the\n // server and the client would then disagree on hydration keys.\n const description = children(() => props.description);\n const actions = children(() => props.actions);\n const lead = children(() => props.lead);\n return (\n <header class=\"k2b-app-workspace__level-head\">\n {props.children}\n <div class=\"k2b-app-workspace__level-title\">\n <h2 tabIndex={-1}>\n <Show when={lead()}>\n <span class=\"k2b-app-workspace__level-lead\">{lead()}</span>\n </Show>\n <span class=\"k2b-truncate-fade\">{props.label}</span>\n </h2>\n <Show when={description()}>\n <p class=\"k2b-truncate-fade\">{description()}</p>\n </Show>\n </div>\n <Show when={actions()}>\n <div class=\"k2b-app-workspace__level-actions\">{actions()}</div>\n </Show>\n </header>\n );\n}\n\nfunction AppWorkspaceMain(props: AppWorkspaceMainProps): JSX.Element {\n const rootResizable = useContext(ResizeContext);\n const workspaceMessages = useWorkspaceMessages();\n const levelsMode = createMemo(() => props.level !== undefined);\n const resolved = children(() => props.children);\n const values = createMemo(() => {\n const all = flatten(resolved());\n if (levelsMode() && all.some((value) => !mainPaneSlot(value))) {\n throw new Error(\"AppWorkspace.Main level requires only AppWorkspace.MainPane children.\");\n }\n return all;\n });\n const paneIds = createMemo(() => {\n const ids = values()\n .filter(mainPaneSlot)\n .map((slot) => slot.props.id);\n assertUniqueStableUiIds(ids, \"AppWorkspace.MainPane id\");\n return ids;\n });\n const regions = createMemo(() => {\n const all = values();\n const primary = all.filter((value) => !mainPaneSlot(value));\n const primaryIndex = all.findIndex((value) => !mainPaneSlot(value));\n let inserted = false;\n const result: Array<{ type: \"primary\"; index: number; children: unknown[] } | { type: \"pane\"; index: number; slot: MainPaneSlot }> = [];\n all.forEach((value, index) => {\n if (mainPaneSlot(value)) {\n result.push({ type: \"pane\", index, slot: value });\n } else if (!inserted) {\n inserted = true;\n result.push({ type: \"primary\", index: primaryIndex, children: primary });\n }\n });\n return result;\n });\n const levels = createMemo(() => {\n const open = values()\n .filter(mainPaneSlot)\n .filter((slot) => slot.props.open !== false);\n if (levelsMode()) {\n for (const pane of open.slice(0, -1)) {\n if (!pane.props.href) throw new Error(`AppWorkspace.MainPane \"${pane.props.id}\" requires href before the last level.`);\n }\n }\n return open;\n });\n const depth = () => Math.max(1, levels().findIndex((pane) => pane.props.id === props.level) + 1);\n /** How many of the deepest levels a width class shows: up to its count, as long as their minimum widths fit. */\n const levelCount = (widthClass: 1 | 2 | 3) => {\n const all = levels();\n let count = Math.min(widthClass, all.length);\n while (count > 1) {\n const end = Math.max(depth(), count);\n const needed = all\n .slice(end - count, end)\n .reduce(\n (sum, pane, offset) =>\n sum + (end - count + offset + 1 === end ? levelLastMin(pane.props.minSize) : (pane.props.minSize ?? APP_WORKSPACE_PANE_MIN)),\n 0,\n );\n if (needed <= LEVEL_CLASS_WIDTH[widthClass]) break;\n count--;\n }\n return count;\n };\n const levelClasses = (index: number, kind: \"shown\" | \"first\" | \"last\" | \"handle\") =>\n ([1, 2, 3] as const)\n .filter((widthClass) => {\n const count = levelCount(widthClass);\n const end = Math.max(depth(), count);\n const start = end - count + 1;\n return kind === \"first\"\n ? index === start && index > 1\n : kind === \"last\"\n ? index === end\n : kind === \"handle\"\n ? index >= start && index + 1 <= end\n : index >= start && index <= end;\n })\n .join(\" \");\n const anchorRegion = createMemo(\n () =>\n (levelsMode() ? regions().find((candidate) => candidate.type === \"pane\" && candidate.slot === levels().at(-1)) : undefined) ??\n regions().find((candidate) => candidate.type === \"primary\") ??\n regions().find((candidate) => candidate.type === \"pane\" && candidate.slot.props.open !== false),\n );\n // A level change can hide the control that made it: the back step, or a row\n // of a list that a phone no longer shows. Focus then moves to the title of\n // the selected level, so keyboard and screen reader users keep their place.\n // The back step to the first level unmounts, and focus has left with it by\n // the time the level changes, so pressing it is remembered.\n let mainElement: HTMLDivElement | undefined;\n let backStepFocused = false;\n const navigateBack = (event: LinkNavigateEvent) => {\n backStepFocused = Boolean(mainElement?.contains(document.activeElement));\n return props.onLevelNavigate?.(event);\n };\n createEffect(\n on(\n () => (levelsMode() ? depth() : 0),\n (current) => {\n const pressedBack = backStepFocused;\n backStepFocused = false;\n const focused = document.activeElement;\n if (!current || !mainElement) return;\n const lost = pressedBack && (!focused || focused === document.body);\n const hidden = focused instanceof HTMLElement && mainElement.contains(focused) && focused.getClientRects().length === 0;\n if (!lost && !hidden) return;\n mainElement\n .querySelector<HTMLElement>(`:scope > [data-workspace-level=\"${current}\"] > .k2b-app-workspace__level-head h2`)\n ?.focus({ preventScroll: true });\n },\n { defer: true },\n ),\n );\n // Presence of a MainPane slot — not of an *open* one — decides the split\n // layout. Deriving it from `regions()` made a workspace whose panes are all\n // closed fall back to `resolved()`, which renders the raw slot objects.\n const hasPanes = createMemo(() => paneIds().length > 0);\n // The workspace's tracks and queries read Main's minimum on the workspace\n // itself, which cannot read Main's own variables, so this rule hands it up,\n // as `AppWorkspace.Detail` does with its width.\n const minWidth = () => {\n const value = props.minWidth;\n return isAppWorkspaceWidthShare(value)\n ? value\n : typeof value === \"number\" && Number.isFinite(value) && value > APP_WORKSPACE_MAIN_MIN\n ? Math.round(value)\n : undefined;\n };\n const minWidthRule = (value: number | AppWorkspaceWidthShare) => {\n const main = `.k2b-app-workspace__main[data-workspace-main-min=\"${appWorkspaceWidthToken(value)}\"]`;\n const inverse =\n typeof value === \"number\"\n ? \"\"\n : `;--k2b-workspace-main-min-grid:${appWorkspaceInverseWidthCss(value, \"100%\")};--k2b-workspace-main-min-cq:${appWorkspaceInverseWidthCss(value, \"100cqi\")}`;\n return `.k2b-app-workspace:has(> .k2b-app-workspace__content > ${main}, > .k2b-app-workspace__content > :is(solid-island, solid-client) > ${main}){--k2b-workspace-main-min:${appWorkspaceWidthCss(value, \"100%\")}${inverse}}`;\n };\n\n return (\n <>\n <Show when={minWidth()}>{(value) => <style innerHTML={minWidthRule(value())} />}</Show>\n <div\n ref={mainElement}\n class={`k2b-app-workspace__main ${hasPanes() ? \"has-panes\" : \"\"} ${props.class ?? \"\"}`}\n data-workspace-main-min={minWidth() === undefined ? undefined : appWorkspaceWidthToken(minWidth()!)}\n data-workspace-levels={levelsMode() ? \"\" : undefined}\n data-workspace-level-count={levelsMode() ? levels().length : undefined}\n data-mobile-pane={levelsMode() ? undefined : props.mobilePane}\n data-width={props.width === \"content\" ? \"content\" : undefined}\n data-scroll-fade-mode={!hasPanes() && props.scroll !== false && props.scrollFade !== false ? \"both\" : undefined}\n data-scroll={props.scroll === false ? \"false\" : undefined}\n aria-busy={props[\"aria-busy\"]}\n {...scrollAttrs(props.scrollPreserveKey)}\n >\n <Show when={hasPanes()} fallback={resolved() as JSX.Element}>\n <For each={regions()}>\n {(region) => {\n const activeMobilePane = () => {\n const anchor = anchorRegion();\n return props.mobilePane ?? (anchor?.type === \"pane\" ? anchor.slot.props.id : \"main\");\n };\n if (region.type === \"primary\") {\n return (\n <div\n class=\"k2b-app-workspace__main-primary\"\n data-workspace-main-region=\"main\"\n data-workspace-mobile-active={activeMobilePane() === \"main\" ? \"true\" : \"false\"}\n >\n {region.children as JSX.Element}\n </div>\n );\n }\n const pane = region.slot;\n const levelIndex = () => levels().indexOf(pane) + 1;\n const levelAttr = (kind: \"shown\" | \"first\" | \"last\" | \"handle\") =>\n levelsMode() ? levelClasses(levelIndex(), kind) : undefined;\n const panelId = assertStableUiId(pane.props.id, \"AppWorkspace.MainPane id\");\n const variable = appWorkspacePanelVariable(\"pane\", panelId);\n const isAnchor = () => region === anchorRegion();\n const resizable = () => !isAnchor() && (pane.props.resizable ?? rootResizable);\n const defaultSize = () => {\n const value = pane.props.defaultSize;\n return typeof value === \"number\" || isAppWorkspaceWidthShare(value) ? value : APP_WORKSPACE_PANE_DEFAULT;\n };\n const minSize = () => pane.props.minSize ?? APP_WORKSPACE_PANE_MIN;\n const maxSize = () => Math.max(minSize(), pane.props.maxSize ?? APP_WORKSPACE_PANE_MAX);\n const before = () => levelsMode() || region.index < (anchorRegion()?.index ?? 0);\n const handle = () => (\n <ResizeHandle\n kind=\"pane\"\n levelShown={levelAttr(\"handle\")}\n edge={before() ? \"end\" : \"start\"}\n controls={pane.domId}\n panelId={panelId}\n defaultSize={defaultSize()}\n minSize={minSize()}\n maxSize={maxSize()}\n shadow={pane.props.resizeShadow !== false}\n label={`Resize ${pane.props.label}`}\n />\n );\n return (\n <Show when={pane.props.open !== false}>\n <Show when={resizable() && !before()}>{handle()}</Show>\n <section\n id={pane.domId}\n class={`k2b-app-workspace__main-pane ${isAnchor() ? \"is-primary\" : \"\"} ${pane.props.class ?? \"\"}`}\n aria-label={pane.props.label}\n data-workspace-level={levelsMode() ? levelIndex() : undefined}\n data-workspace-level-shown={levelAttr(\"shown\")}\n data-workspace-level-first={levelAttr(\"first\")}\n data-workspace-level-last={levelAttr(\"last\")}\n data-workspace-main-region={pane.props.id}\n data-workspace-mobile-active={\n (levelsMode() ? levelClasses(levelIndex(), \"shown\").split(\" \").includes(\"1\") : activeMobilePane() === pane.props.id)\n ? \"true\"\n : \"false\"\n }\n data-workspace-panel-id={panelId}\n data-workspace-resizable={resizable() ? \"true\" : \"false\"}\n data-surface={pane.props.surface === \"navigation\" ? \"navigation\" : undefined}\n data-scroll={!levelsMode() && pane.props.scroll === false ? \"false\" : undefined}\n data-scroll-fade-mode={\n !levelsMode() && pane.props.scroll !== false && pane.props.scrollFade !== false ? \"both\" : undefined\n }\n style={nonEmptyStyle({\n ...(isAnchor()\n ? {}\n : {\n // A stored width keeps to this pane's limits before the controller attaches.\n \"--k2b-workspace-panel-size\": `clamp(${minSize()}px, var(${variable}, ${appWorkspaceWidthCss(defaultSize(), \"var(--k2b-workspace-width)\")}), ${maxSize()}px)`,\n \"--k2b-workspace-panel-min\": `${minSize()}px`,\n }),\n // The last shown level fills the rest, but never below its minimum; set on every level, so a workspace\n // nested in a wide level does not inherit that minimum.\n ...(levelsMode() ? { \"--k2b-workspace-level-min\": `${levelLastMin(pane.props.minSize)}px` } : {}),\n })}\n >\n {levelsMode() ? (\n <>\n <LevelHead\n label={pane.props.label}\n description={pane.props.description}\n actions={pane.props.actions}\n lead={pane.props.lead}\n >\n <Show when={levelIndex() > 1 && depth() > 1}>\n <IconButtonLink\n class=\"k2b-app-workspace__level-back\"\n href={levels()[depth() - 2]?.props.href}\n label={workspaceMessages().backTo({ page: levels()[levelIndex() - 2]?.props.label ?? \"\" })}\n navigation={props.onLevelNavigate ? \"enhanced\" : \"document\"}\n onNavigate={props.onLevelNavigate ? navigateBack : undefined}\n >\n <i class=\"ti ti-chevron-left\" aria-hidden=\"true\" />\n </IconButtonLink>\n </Show>\n </LevelHead>\n <div\n class=\"k2b-app-workspace__level-body\"\n data-scroll={pane.props.scroll === false ? \"false\" : undefined}\n data-scroll-fade-mode={pane.props.scroll !== false && pane.props.scrollFade !== false ? \"both\" : undefined}\n >\n {pane.props.children}\n </div>\n </>\n ) : (\n pane.props.children\n )}\n </section>\n <Show when={resizable() && before()}>{handle()}</Show>\n </Show>\n );\n }}\n </For>\n </Show>\n </div>\n </>\n );\n}\n\n/** The Detail region's DOM id, for application controls that target it with aria-controls. */\nexport const appWorkspaceDetailElementId = (id: string): string => `k2b-workspace-detail-${assertStableUiId(id, \"AppWorkspace.Detail id\")}`;\n\nfunction AppWorkspaceDetail(props: AppWorkspaceDetailProps): JSX.Element {\n const workspaceMessages = useWorkspaceMessages();\n const rootResizable = useContext(ResizeContext);\n const panelId = () => assertStableUiId(props.id, \"AppWorkspace.Detail id\");\n const domId = () => appWorkspaceDetailElementId(props.id);\n const variable = () => appWorkspacePanelVariable(\"detail\", panelId());\n // Start widths of 20, 26, 30, and 34 rem. They feed `aria-valuenow` and the\n // `var(…, Npx)` first-paint fallback, so they are behaviour, not taste.\n const widths = { sm: 320, md: 416, lg: 480, xl: 544 };\n const defaultWidth = () => widths[props.width ?? \"md\"] ?? APP_WORKSPACE_DETAIL_DEFAULT;\n const minWidth = () => props.minWidth ?? APP_WORKSPACE_DETAIL_MIN;\n const maxWidth = () => Math.max(minWidth(), props.maxWidth ?? APP_WORKSPACE_DETAIL_MAX);\n const resizable = () => props.resizable ?? rootResizable;\n const size = () => (resizable() ? `var(${variable()}, ${defaultWidth()}px)` : `${defaultWidth()}px`);\n const sizeStyle = () => ({\n \"--k2b-workspace-panel-size\": size(),\n \"--k2b-workspace-panel-min\": `${minWidth()}px`,\n \"--k2b-workspace-panel-max\": `${maxWidth()}px`,\n });\n // An open panel takes a column at the workspace's end, sized in CSS alone,\n // so a server-rendered page arrives in its final geometry. The workspace\n // cannot read the panel's own variables, so this rule hands the open\n // panel's size to its workspace.\n const workspaceRule = () => {\n const open = `#${domId()}:not([hidden])`;\n return `.k2b-app-workspace:has(> .k2b-app-workspace__content > ${open}, > .k2b-app-workspace__content > :is(solid-island, solid-client) > ${open}){--k2b-detail-size:${size()};--k2b-detail-min:${minWidth()}px;--k2b-detail-max:${maxWidth()}px}`;\n };\n let aside: HTMLElement | undefined;\n onMount(() => {\n const close = () => props.onClose?.();\n const open = () => {\n if (props.available !== false) props.onOpen?.();\n };\n const isStep = (detail: unknown): detail is AppWorkspaceDetailStep =>\n typeof detail === \"object\" && detail !== null && \"direction\" in detail && (detail.direction === 1 || detail.direction === -1);\n const step = (event: Event) => {\n if (!(event instanceof CustomEvent) || !isStep(event.detail)) return;\n const item = props.onStep?.(event.detail.direction);\n if (item instanceof HTMLElement) event.detail.item = item;\n };\n aside?.addEventListener(APP_WORKSPACE_DETAIL_OPEN_EVENT, open);\n aside?.addEventListener(APP_WORKSPACE_DETAIL_CLOSE_EVENT, close);\n aside?.addEventListener(APP_WORKSPACE_DETAIL_STEP_EVENT, step);\n onCleanup(() => {\n aside?.removeEventListener(APP_WORKSPACE_DETAIL_OPEN_EVENT, open);\n aside?.removeEventListener(APP_WORKSPACE_DETAIL_CLOSE_EVENT, close);\n aside?.removeEventListener(APP_WORKSPACE_DETAIL_STEP_EVENT, step);\n });\n });\n return (\n <>\n <style innerHTML={workspaceRule()} />\n <Button\n type=\"button\"\n variant=\"ghost\"\n aria-controls={domId()}\n aria-expanded=\"false\"\n data-app-workspace-detail-toggle=\"\"\n data-workspace-detail-reopen={props.onOpen ? \"true\" : undefined}\n disabled={props.available === false}\n class=\"k2b-app-workspace__detail-toggle\"\n >\n <i class=\"ti ti-layout-sidebar-right\" aria-hidden=\"true\" />\n {workspaceMessages().details}\n </Button>\n <Show when={resizable()}>\n <ResizeHandle\n kind=\"detail\"\n edge=\"start\"\n controls={domId()}\n panelId={panelId()}\n defaultSize={defaultWidth()}\n minSize={minWidth()}\n maxSize={maxWidth()}\n shadow\n style={sizeStyle()}\n />\n </Show>\n <aside\n ref={aside}\n id={domId()}\n class={`k2b-app-workspace__detail ${props.class ?? \"\"}`}\n data-width={props.width ?? \"md\"}\n data-workspace-detail-phone={props.phone === \"page\" ? \"page\" : undefined}\n data-workspace-detail-choice={props.openOnChoice === false ? \"request\" : undefined}\n data-workspace-panel-id={panelId()}\n data-workspace-resizable={resizable() ? \"true\" : \"false\"}\n data-workspace-detail-reopen={props.onOpen ? \"true\" : undefined}\n data-workspace-detail-closable={props.onClose ? \"true\" : undefined}\n data-workspace-detail-steppable={props.onStep ? \"true\" : undefined}\n hidden={!props.open || props.available === false}\n style={{ ...sizeStyle(), \"view-transition-name\": props.viewTransitionName }}\n >\n {/* Only the phone sheet shows the grabber: a tap switches between half and full height. */}\n <button\n type=\"button\"\n class=\"k2b-app-workspace__detail-grabber\"\n aria-label={workspaceMessages().detailFullHeight}\n aria-pressed=\"false\"\n >\n <span aria-hidden=\"true\" />\n </button>\n {props.children}\n </aside>\n </>\n );\n}\n\nfunction AppWorkspaceBottomDrawer(props: AppWorkspaceBottomDrawerProps): JSX.Element {\n const rootResizable = useContext(ResizeContext);\n const panelId = () => assertStableUiId(props.id, \"AppWorkspace.BottomDrawer id\");\n const domId = () => `k2b-workspace-drawer-${panelId()}`;\n const variable = () => appWorkspacePanelVariable(\"drawer\", panelId());\n // Cloud's `drawerDefaultHeight`.\n const heights = { sm: 192, md: 240, lg: 320 };\n const defaultHeight = () => heights[props.height ?? \"md\"] ?? APP_WORKSPACE_DRAWER_DEFAULT;\n const minHeight = () => props.minHeight ?? APP_WORKSPACE_DRAWER_MIN;\n const maxHeight = () => Math.max(minHeight(), props.maxHeight ?? APP_WORKSPACE_DRAWER_MAX);\n const resizable = () => props.resizable ?? rootResizable;\n return (\n <>\n <Show when={resizable()}>\n <ResizeHandle\n kind=\"drawer\"\n edge=\"start\"\n controls={domId()}\n panelId={panelId()}\n defaultSize={defaultHeight()}\n minSize={minHeight()}\n maxSize={maxHeight()}\n shadow\n style={{ \"--k2b-workspace-panel-size\": `var(${variable()}, ${defaultHeight()}px)` }}\n />\n </Show>\n <aside\n id={domId()}\n class={`k2b-app-workspace__drawer ${props.class ?? \"\"}`}\n data-height={props.height ?? \"md\"}\n data-workspace-panel-id={panelId()}\n data-workspace-resizable={resizable() ? \"true\" : \"false\"}\n hidden={!props.open}\n style={{\n \"--k2b-workspace-panel-size\": `var(${variable()}, ${defaultHeight()}px)`,\n \"view-transition-name\": props.viewTransitionName,\n }}\n >\n {props.children}\n </aside>\n </>\n );\n}\n\nfunction AppWorkspaceSidebar(props: AppWorkspaceSidebarProps): JSX.Element {\n const rootResizable = useContext(ResizeContext);\n const resizable = () => props.resizable ?? rootResizable;\n const defaultSize = () => props.defaultSize ?? APP_WORKSPACE_SIDEBAR_DEFAULT;\n const minSize = () => props.minSize ?? (props.collapsible ? APP_WORKSPACE_SIDEBAR_COLLAPSED : APP_WORKSPACE_SIDEBAR_MIN);\n const maxSize = () => props.maxSize ?? APP_WORKSPACE_SIDEBAR_MAX;\n const workspace = useContext(WorkspaceContext);\n const generatedId = createUniqueId();\n const domId = () => props.id ?? workspace?.sidebarId ?? `k2b-workspace-sidebar-${generatedId}`;\n // The head's navigation button names this sidebar.\n createEffect(() => workspace?.setSidebarId(domId()));\n // Hidden navigation is not rendered at all, so its labels are neither shown\n // nor reachable; reading the children lazily keeps them from being created.\n const resolved = children(() => (props.hidden ? undefined : props.children));\n const slots = createMemo(() => flatten(resolved()).filter(sidebarChildSlot));\n const desktop = createMemo(() => slots().find((slot) => slot.kind === SIDEBAR_DESKTOP));\n const stacked = () => props.mobile === \"stacked\";\n const workspaceMessages = useWorkspaceMessages();\n const owner = getOwner();\n const [sheetOpen, setSheetOpen] = createSignal(false);\n let aside: HTMLElement | undefined;\n let row: HTMLDivElement | undefined;\n // Fades mark the row's cut edges; the sidebar column never scrolls sideways, so it never shows one.\n createScrollFade(\n () => row,\n () => stacked(),\n );\n onMount(() => {\n const requestHide = () => props.onHiddenChange?.(true);\n aside?.addEventListener(APP_WORKSPACE_SIDEBAR_HIDE_EVENT, requestHide);\n onCleanup(() => aside?.removeEventListener(APP_WORKSPACE_SIDEBAR_HIDE_EVENT, requestHide));\n // A client-rendered row settles here; server markup settled in its inline script.\n if (stacked() && row) settleChipRow(row, scrollFadeEdges);\n });\n /**\n * The complete sidebar for a chip row: a second rendering of the same\n * children in a sheet. It shares the application's state through its\n * signals, inherits this sidebar's context and accent, and is disposed with\n * the sheet. A chosen link runs its own handlers in the sheet and closes it.\n */\n const openAll = (button: HTMLButtonElement) => {\n if (sheetOpen() || !aside) return;\n setSheetOpen(true);\n const computed = getComputedStyle(aside);\n const accent = Object.fromEntries(\n [\"--k2b-app-workspace-active\", \"--k2b-app-workspace-selected\", \"--k2b-link-accent\", \"--k2b-detail-panel-accent\"]\n .map((name) => [name, computed.getPropertyValue(name).trim()])\n .filter(([, value]) => value),\n );\n // The sheet belongs to the chip row: when the workspace widens into the sidebar column, All disappears and the sheet closes.\n const leave = new AbortController();\n const watch = new ResizeObserver(() => {\n if (button.getClientRects().length === 0) leave.abort();\n });\n watch.observe(button);\n /** A chosen link closes the sheet once its own handlers ran, an enhanced navigation's included. */\n const choose = (event: MouseEvent, close: () => void) => {\n const target = event.target as Element | null;\n if (!target?.closest?.(\"a[href]\")) return;\n if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;\n // A tree branch's disclosure inside its link only expands the branch.\n if (target.closest(\"[data-k2b-nav-tree-toggle]\")) return;\n // A task, not a microtask: the document's delegated handlers run later in this dispatch.\n setTimeout(close);\n };\n void dialogCore\n .open<void>(\n (close, context) => {\n let dispose: (() => void) | undefined;\n const view = createRoot((disposeRoot) => {\n dispose = disposeRoot;\n return (\n <BottomSheet onDismiss={context.requestDismiss}>\n <BottomSheet.Header title={props.label} close={() => void context.requestDismiss()} />\n <BottomSheet.Body>\n {/* The sheet keeps its own failure: the application's boundary around the sidebar stays untouched. */}\n <RenderErrorBoundary\n onClose={() => void context.requestDismiss()}\n content={() => {\n const resolved = children(\n () =>\n flatten(props.hidden ? undefined : props.children)\n .filter(sidebarChildSlot)\n .find((slot) => slot.kind === SIDEBAR_DESKTOP)?.children,\n );\n // Pre-resolved children belong to the row; inserting them here would move its nodes into the sheet.\n if (resolved.toArray().some((node) => node instanceof Node && aside?.contains(node))) {\n console.error(\n \"AppWorkspace.Sidebar: write the sidebar children as JSX inside AppWorkspace.Sidebar so they can render a second time in the All sheet; pre-resolved children cannot be reused.\",\n );\n return null;\n }\n return (\n <nav\n class=\"k2b-app-workspace__sidebar-sheet\"\n aria-label={props.label}\n style={accent}\n on:click={(event) => choose(event, () => close())}\n >\n {resolved()}\n </nav>\n );\n }}\n />\n </BottomSheet.Body>\n </BottomSheet>\n );\n }, owner);\n onCleanup(() => dispose?.());\n return view;\n },\n // No history entry: an application may replace the URL from inside the sidebar, such as a search, and an\n // entry of the sheet would then outlive it. So Back leaves the page here, unlike other phone sheets.\n { ...bottomSheetAdaptiveOptions, ariaLabel: props.label, signal: leave.signal },\n )\n .finally(() => {\n watch.disconnect();\n setSheetOpen(false);\n if (button.isConnected && !aside?.contains(document.activeElement)) {\n if (button.getClientRects().length) button.focus({ preventScroll: true });\n else {\n const current = aside?.querySelector<HTMLElement>(\"[aria-current], .k2b-app-workspace__sidebar-item.is-active\");\n const link = current?.matches(\"a[href]\") ? current : current?.querySelector<HTMLElement>(\"a[href]\");\n (link ?? aside?.querySelector<HTMLElement>(\"a[href]\"))?.focus({ preventScroll: true });\n }\n }\n });\n };\n return (\n <>\n <Dynamic\n component={stacked() ? \"nav\" : \"aside\"}\n ref={aside}\n id={domId()}\n class={`k2b-app-workspace__sidebar ${props.class ?? \"\"}`}\n aria-label={props.label}\n hidden={props.hidden || undefined}\n data-mobile={stacked() ? \"stacked\" : undefined}\n data-workspace-resizable={resizable() ? \"true\" : \"false\"}\n data-workspace-collapsible={props.collapsible ? \"true\" : \"false\"}\n data-workspace-hideable={props.onHiddenChange ? \"true\" : undefined}\n >\n <Show when={!props.hidden}>\n <div\n ref={row}\n class=\"k2b-app-workspace__sidebar-desktop\"\n data-scroll-fade-mode={stacked() ? \"both\" : undefined}\n data-scroll-fade-axis={stacked() ? \"horizontal\" : undefined}\n >\n {desktop()?.children}\n </div>\n <Show when={stacked()}>\n <button\n type=\"button\"\n class=\"k2b-app-workspace__sidebar-all\"\n aria-haspopup=\"dialog\"\n aria-expanded={sheetOpen()}\n aria-label={props.label ? workspaceMessages().sidebarAllLabel({ label: props.label }) : undefined}\n onClick={(event) => openAll(event.currentTarget)}\n >\n <span>{workspaceMessages().sidebarAll}</span>\n <i class=\"ti ti-chevron-down\" aria-hidden=\"true\" />\n </button>\n {/* After All, which takes its room in the row first. */}\n <script innerHTML={CHIP_ROW_SCRIPT} />\n </Show>\n </Show>\n </Dynamic>\n <Show when={resizable() && !props.hidden}>\n <ResizeHandle\n kind=\"sidebar\"\n edge=\"end\"\n controls={domId()}\n defaultSize={defaultSize()}\n minSize={minSize()}\n maxSize={maxSize()}\n shadow={props.resizeShadow !== false}\n />\n </Show>\n </>\n );\n}\n\n/**\n * A chip row that overflows shows the current object, centered when it is\n * not in view from the row's start, and fades its cut edges. Self-contained, because the inline script after server markup\n * embeds its source and runs it before the first paint; at 64 rem the column\n * does not overflow sideways and nothing changes.\n */\nfunction settleChipRow(row: Element | null, edges: (element: HTMLElement) => string | undefined) {\n if (!(row instanceof HTMLElement) || row.scrollWidth - row.clientWidth <= 1) return;\n const current = row.querySelector(\".k2b-app-workspace__sidebar-item.is-active, [aria-current]\");\n const chip = current && (current.closest(\".k2b-app-workspace__sidebar-item\") || current);\n if (chip) {\n // From the row's start, whatever scrolled it before (a body's own restore\n // runs first on the client, last on the server), so both paths agree.\n row.scrollLeft = 0;\n const bounds = row.getBoundingClientRect();\n const item = chip.getBoundingClientRect();\n if (item.left < bounds.left || item.right > bounds.right) row.scrollLeft += item.left - bounds.left - (bounds.width - item.width) / 2;\n }\n const fade = edges(row);\n if (fade) row.setAttribute(\"data-scroll-fade\", fade);\n}\nconst CHIP_ROW_SCRIPT = `(${settleChipRow})(document.currentScript&&document.currentScript.parentElement.querySelector(\":scope>.k2b-app-workspace__sidebar-desktop\"),${scrollFadeEdges})`;\n\nconst AppWorkspaceSidebarDesktop = (props: { children: JSX.Element }): JSX.Element =>\n ({ kind: SIDEBAR_DESKTOP, children: props.children }) as unknown as JSX.Element;\n// The inline script restores server markup while parsing; onMount restores a\n// client-rendered sidebar when an island replaces it. Both paths keep the\n// current item in view and set the fade before paint, repeating the restore\n// in the first frame when the whole document has its final layout. Only\n// pagehide stores the offset: restores before final layout can be clamped,\n// and remembering those programmatic scrolls would shrink the stored offset.\n// Memory is per scroll-preserve key (or page path) and sidebar position and\n// ends with the tab.\nconst SIDEBAR_SCROLL_MEMORY_SCRIPT = `(${rememberSidebarScroll})(document.currentScript&&document.currentScript.previousElementSibling,${scrollFadeEdges})`;\n\nconst AppWorkspaceSidebarBody = (props: AppWorkspaceSidebarBodyProps) => {\n let body!: HTMLDivElement;\n onMount(() => onCleanup(rememberSidebarScroll(body, scrollFadeEdges)));\n createScrollFade(\n () => body,\n () => props.scrollFade !== false,\n );\n return (\n <>\n <div\n ref={body}\n class={`k2b-app-workspace__sidebar-body ${props.class ?? \"\"}`}\n data-scroll-fade-mode={props.scrollFade !== false ? \"both\" : undefined}\n {...scrollAttrs(props.scrollPreserveKey)}\n {...modeAttrs(props.sidebarMode)}\n >\n {props.children}\n </div>\n <script innerHTML={SIDEBAR_SCROLL_MEMORY_SCRIPT} />\n </>\n );\n};\nconst AppWorkspaceSidebarFooter = (props: AppWorkspaceSidebarContentProps) => (\n <footer class={`k2b-app-workspace__sidebar-footer ${props.class ?? \"\"}`} {...modeAttrs(props.sidebarMode)}>\n {props.children}\n </footer>\n);\nconst AppWorkspaceSidebarSection = (props: AppWorkspaceSidebarSectionProps) => {\n const [expanded, setExpanded] = createSignal(props.defaultOpen ?? true);\n const open = () => !props.collapsible || (props.open ?? expanded());\n const id = `sidebar-section-${createUniqueId()}`;\n const title = () => (\n <>\n <Show when={props.icon}>\n <span aria-hidden=\"true\">\n <i class={iconClass(props.icon)} />\n </span>\n </Show>\n {props.title}\n <Show when={props.count !== undefined}>\n <span class=\"k2b-app-workspace__sidebar-section-count\">{props.count}</span>\n </Show>\n </>\n );\n return (\n <section\n class={`k2b-app-workspace__sidebar-section ${props.class ?? \"\"}`}\n data-collapsible={props.collapsible ? \"true\" : undefined}\n {...modeAttrs(props.sidebarMode)}\n >\n <Show when={props.title || props.actions}>\n <header class=\"k2b-app-workspace__sidebar-section-header\">\n <Show\n when={props.collapsible}\n fallback={\n <Show when={props.title}>\n <h2>{title()}</h2>\n </Show>\n }\n >\n <button\n type=\"button\"\n class=\"k2b-app-workspace__sidebar-section-toggle\"\n aria-expanded={open()}\n aria-controls={id}\n onClick={() => {\n const next = !open();\n setExpanded(next);\n props.onOpenChange?.(next);\n }}\n >\n {title()}\n <i class={open() ? \"ti ti-chevron-down\" : \"ti ti-chevron-right\"} aria-hidden=\"true\" />\n </button>\n </Show>\n <Show when={props.actions}>\n <div class=\"k2b-app-workspace__sidebar-section-actions\">{props.actions}</div>\n </Show>\n </header>\n </Show>\n <div id={id} hidden={!open()} class=\"k2b-app-workspace__sidebar-section-content\">\n {props.children}\n </div>\n </section>\n );\n};\n\nconst AppWorkspaceSidebarItemIcon = (props: AppWorkspaceSidebarItemIconProps): JSX.Element =>\n mergeProps({ kind: SIDEBAR_ITEM_ICON }, props) as unknown as JSX.Element;\nconst AppWorkspaceSidebarItemLabel = (props: AppWorkspaceSidebarItemLabelProps): JSX.Element =>\n mergeProps({ kind: SIDEBAR_ITEM_LABEL }, props) as unknown as JSX.Element;\nconst AppWorkspaceSidebarItemMeta = (props: AppWorkspaceSidebarItemMetaProps): JSX.Element =>\n mergeProps({ kind: SIDEBAR_ITEM_META }, props) as unknown as JSX.Element;\nconst AppWorkspaceSidebarItemAction = (props: AppWorkspaceSidebarItemActionProps): JSX.Element =>\n mergeProps({ kind: SIDEBAR_ITEM_ACTION }, props) as unknown as JSX.Element;\nconst AppWorkspaceSidebarItemActions = (props: AppWorkspaceSidebarItemActionsProps): JSX.Element => (\n <div class=\"k2b-app-workspace__sidebar-item-actions\" data-visibility={props.visibility === \"hover\" ? \"hover\" : undefined}>\n {props.children}\n </div>\n);\nconst AppWorkspaceSidebarItemStatus = (props: AppWorkspaceSidebarItemStatusProps): JSX.Element => {\n const workspaceMessages = useWorkspaceMessages();\n const waiting = () => (props.waiting && Number.isFinite(props.waiting.count) ? Math.max(0, Math.floor(props.waiting.count)) : null);\n const count = () => waiting() ?? (typeof props.unread === \"number\" && props.unread >= 1 ? Math.floor(props.unread) : 0);\n const dot = () => waiting() === null && props.unread === true;\n // The marks are decorative; the row's accessible name gets one phrase instead,\n // which says no more than the \"99+\" a capped count shows.\n const description = () =>\n [\n waiting() !== null\n ? (props.waiting?.label ?? \"\")\n : count() > 99\n ? workspaceMessages().sidebarUnreadMany\n : count()\n ? workspaceMessages().sidebarUnread({ count: count() })\n : dot()\n ? workspaceMessages().sidebarNewActivity\n : \"\",\n props.mention ? workspaceMessages().sidebarMentioned : \"\",\n props.muted ? workspaceMessages().sidebarMuted : \"\",\n ]\n .filter(Boolean)\n .join(\", \");\n // The unread slot stays reserved at the end, and the marks that change most\n // often sit outermost, so new activity or a mention never moves another mark.\n // The element itself stays when there is nothing to show: empty, it takes no\n // space, and it still keeps the row's label on one line, so the first count\n // never re-wraps the label and moves the rows below.\n return (\n <span\n class=\"k2b-app-workspace__sidebar-status\"\n data-unread={waiting() !== null ? undefined : count() ? \"count\" : dot() ? \"dot\" : undefined}\n data-waiting={waiting() === null ? undefined : waiting() ? \"count\" : \"zero\"}\n data-muted={props.muted ? \"true\" : undefined}\n >\n <Show when={description()}>\n <Show when={props.mention}>\n <span class=\"k2b-app-workspace__sidebar-status-mention\" aria-hidden=\"true\">\n @\n </span>\n </Show>\n <Show when={props.muted}>\n <span class=\"k2b-app-workspace__sidebar-status-muted\" aria-hidden=\"true\">\n <i class=\"ti ti-bell-off\" />\n </span>\n </Show>\n <span class=\"k2b-app-workspace__sidebar-status-unread\" aria-hidden=\"true\">\n <Show\n when={count() || waiting() === 0}\n fallback={\n <Show when={dot()}>\n <span class=\"k2b-app-workspace__sidebar-status-dot\" />\n </Show>\n }\n >\n <span class=\"k2b-app-workspace__sidebar-status-count\" data-mention={props.mention ? \"true\" : undefined}>\n {count() > 99 ? \"99+\" : count()}\n </span>\n </Show>\n </span>\n <span class=\"k2b-sr-only\">, {description()}</span>\n </Show>\n </span>\n );\n};\n\ntype AppWorkspaceSidebarRowProps = {\n children: JSX.Element;\n actions?: JSX.Element;\n hasActions: boolean;\n href?: string;\n navigation?: \"enhanced\" | \"document\";\n replace?: boolean;\n scroll?: NavigationScrollMode;\n onNavigate?: (event: LinkNavigateEvent) => void | Promise<void>;\n onClick?: (event: MouseEvent) => void;\n active?: boolean | \"ancestor\";\n activeClass?: string;\n disabled?: boolean;\n tone?: AppWorkspaceSidebarItemTone;\n title?: string;\n /** The plain label, which names the row in the collapsed rail when it has no `title`. */\n hint?: string;\n /** The element that holds keyboard focus for this row, when that is not the row itself. */\n focusTarget?: () => HTMLElement | undefined;\n viewTransitionName?: string;\n class?: string;\n depth?: number;\n tabIndex?: number;\n data?: Record<string, string | number | boolean | null | undefined>;\n};\n\n/**\n * Hover actions overlay a row's end, so the label and count under them fade\n * out while they show. The row measures how far the overlay reaches into its\n * count (`--k2b-sidebar-item-cover`) and how much of that the count and gap\n * after the label already take (`--k2b-sidebar-item-label-trail`), so the\n * label keeps all the width the overlay leaves it. The stylesheet applies\n * both only while the overlay shows, and assumes its usual size until then.\n */\nfunction observeSidebarRowCover(row: HTMLElement): void {\n if (isServer || typeof ResizeObserver === \"undefined\") return;\n // A hidden count, such as an empty status, or hidden actions have no box to measure from.\n const laidOut = (element: Element | null | undefined): element is Element => Boolean(element?.getClientRects().length);\n const measure = () => {\n const main = row.querySelector(\":scope > .k2b-app-workspace__sidebar-item-main\");\n const label = main?.querySelector(\":scope > :is(.k2b-app-workspace__sidebar-item-copy, .k2b-app-workspace__sidebar-item-label)\");\n const overlays = Array.from(\n row.querySelectorAll(\n ':scope > .k2b-app-workspace__sidebar-item-actions[data-visibility=\"hover\"]:last-child, :scope > .k2b-app-workspace__sidebar-item-action[data-visibility=\"hover\"]',\n ),\n ).filter((element) => laidOut(element) && getComputedStyle(element).position === \"absolute\");\n if (!main || !laidOut(label) || !overlays.length) {\n row.style.removeProperty(\"--k2b-sidebar-item-cover\");\n row.style.removeProperty(\"--k2b-sidebar-item-label-trail\");\n return;\n }\n // Lengths along the inline axis, measured toward the row's end.\n const rtl = getComputedStyle(row).direction === \"rtl\";\n const end = (element: Element) => {\n const box = element.getBoundingClientRect();\n return rtl ? -box.left : box.right;\n };\n const start = Math.min(\n ...overlays.map((element) => {\n const box = element.getBoundingClientRect();\n return rtl ? -box.right : box.left;\n }),\n );\n const meta = main.querySelector(\":scope > .k2b-app-workspace__sidebar-item-meta\");\n const content = end(laidOut(meta) ? meta : label);\n row.style.setProperty(\"--k2b-sidebar-item-cover\", `${Math.max(0, content - start)}px`);\n row.style.setProperty(\"--k2b-sidebar-item-label-trail\", `${Math.max(0, content - end(label))}px`);\n };\n const resized = new ResizeObserver(measure);\n // The label, the count, and the actions can be replaced while the row stays.\n const replaced = new MutationObserver(() => observe());\n const observe = () => {\n const main = row.querySelector(\":scope > .k2b-app-workspace__sidebar-item-main\");\n if (main) replaced.observe(main, { childList: true });\n resized.disconnect();\n resized.observe(row);\n for (const element of row.querySelectorAll(\n \":scope > .k2b-app-workspace__sidebar-item-main > :is(.k2b-app-workspace__sidebar-item-copy, .k2b-app-workspace__sidebar-item-label, .k2b-app-workspace__sidebar-item-meta), :scope > :is(.k2b-app-workspace__sidebar-item-actions, .k2b-app-workspace__sidebar-item-action)\",\n ))\n resized.observe(element);\n };\n replaced.observe(row, { childList: true });\n observe();\n onCleanup(() => {\n replaced.disconnect();\n resized.disconnect();\n });\n}\n\n/** Shared visual and semantic row frame for flat sidebar items and tree items. */\nfunction AppWorkspaceSidebarRow(props: AppWorkspaceSidebarRowProps): JSX.Element {\n const [link, setLink] = createSignal<HTMLElement>();\n const [hinted, setHinted] = createSignal(false);\n const className = () =>\n `k2b-app-workspace__sidebar-item ${props.hasActions ? \"has-action\" : \"\"} ${props.active ? (props.activeClass ?? \"is-active\") : \"\"} ${props.class ?? \"\"}`;\n const data = () =>\n Object.fromEntries(\n Object.entries(props.data ?? {})\n .filter(([, value]) => value !== undefined && value !== null)\n .map(([key, value]) => [`data-${key}`, String(value)]),\n );\n const common = () => ({\n class: className(),\n title: hinted() ? undefined : props.title,\n \"data-tone\": props.tone,\n style: {\n \"view-transition-name\": props.viewTransitionName,\n \"--k2b-sidebar-item-depth\": props.depth === undefined ? undefined : String(Math.max(0, props.depth)),\n },\n ...data(),\n });\n const current = (): \"page\" | \"true\" | undefined => (props.active === \"ancestor\" ? \"true\" : props.active ? \"page\" : undefined);\n\n const Control = (control: { grouped: boolean }) => {\n const attrs = () => ({\n ...(control.grouped ? { class: \"k2b-app-workspace__sidebar-item-main\" } : common()),\n ref: setLink,\n });\n return (\n <Show\n when={Boolean(props.href && !props.disabled)}\n fallback={\n <button type=\"button\" {...attrs()} tabIndex={props.tabIndex} disabled={props.disabled} onClick={props.onClick}>\n {props.children}\n </button>\n }\n >\n <Show\n when={props.navigation === \"enhanced\" && Boolean(props.onNavigate)}\n fallback={\n <a href={props.href} {...attrs()} tabIndex={props.tabIndex} aria-current={current()} onClick={props.onClick}>\n {props.children}\n </a>\n }\n >\n <Link\n href={props.href!}\n {...attrs()}\n tabIndex={props.tabIndex}\n aria-current={current()}\n replace={props.replace}\n scroll={props.scroll}\n onNavigate={props.onNavigate}\n onClick={props.onClick}\n >\n {props.children}\n </Link>\n </Show>\n </Show>\n );\n };\n return (\n <>\n <Show when={props.hasActions} fallback={<Control grouped={false} />}>\n <div {...common()} ref={(row) => onMount(() => observeSidebarRowCover(row))} data-disabled={props.disabled ? \"true\" : undefined}>\n <Control grouped />\n {props.actions}\n </div>\n </Show>\n {/* The hint follows the row's link or button, also when actions or `disabled` replace it, and leaves the\n row's own actions their own hints. */}\n <Show when={link()} keyed>\n {(element) => (\n <SidebarRailHint\n target={() => element}\n label={props.title ?? props.hint}\n focusTarget={props.focusTarget ?? (() => element)}\n labelSelector=\".k2b-app-workspace__sidebar-item-label-text\"\n titled={props.title !== undefined}\n onArm={() => setHinted(true)}\n />\n )}\n </Show>\n </>\n );\n}\n\nfunction AppWorkspaceSidebarItem(props: AppWorkspaceSidebarItemProps): JSX.Element {\n const workspaceMessages = useWorkspaceMessages();\n const resolved = children(() => props.children);\n const resolvedActions = children(() => props.actions);\n const values = createMemo(() => flatten(resolved()));\n const slots = createMemo(() => values().filter(sidebarItemSlot));\n const iconSlot = createMemo(\n () =>\n slots().find((slot) => slot.kind === SIDEBAR_ITEM_ICON) as\n | (AppWorkspaceSidebarItemIconProps & { kind: typeof SIDEBAR_ITEM_ICON })\n | undefined,\n );\n const labelSlot = createMemo(\n () =>\n slots().find((slot) => slot.kind === SIDEBAR_ITEM_LABEL) as\n | (AppWorkspaceSidebarItemLabelProps & { kind: typeof SIDEBAR_ITEM_LABEL })\n | undefined,\n );\n const metaSlot = createMemo(\n () =>\n slots().find((slot) => slot.kind === SIDEBAR_ITEM_META) as\n | (AppWorkspaceSidebarItemMetaProps & { kind: typeof SIDEBAR_ITEM_META })\n | undefined,\n );\n const actionSlot = createMemo(\n () =>\n slots().find((slot) => slot.kind === SIDEBAR_ITEM_ACTION) as\n | (AppWorkspaceSidebarItemActionProps & { kind: typeof SIDEBAR_ITEM_ACTION })\n | undefined,\n );\n const legacy = createMemo(() => values().filter((value) => !sidebarItemSlot(value)));\n const label = () => labelSlot()?.children ?? (legacy().length === 1 ? legacy()[0] : legacy());\n const oneLine = () => !(labelSlot()?.marquee ?? (props.variant ?? \"row\") === \"row\");\n const icon = () => iconSlot()?.icon ?? props.icon;\n const iconContent = () => iconSlot()?.children;\n // Resolved first, so metadata that renders nothing leaves no empty slot. An\n // empty status still renders its element; the stylesheet hides that slot.\n const meta = children(() => metaSlot()?.children ?? props.meta);\n const hasMeta = () => meta.toArray().some(Boolean);\n const metaId = createUniqueId();\n const metaVisibility = () => metaSlot()?.visibility ?? props.metaVisibility;\n const customActions = () => resolvedActions();\n const hasCustomActions = () => Boolean(customActions());\n const hasAction = () => Boolean(actionSlot() || props.actionIcon || hasCustomActions() || props.preview);\n const mainContent = (\n <>\n <Show when={iconContent() || icon()}>\n <span\n class={\n // An object row's own glyph sits in a soft chip of the app colour; custom content such as an avatar keeps\n // its own look.\n props.variant === \"object\" && !iconContent()\n ? \"k2b-app-workspace__sidebar-item-icon k2b-icon-tile\"\n : \"k2b-app-workspace__sidebar-item-icon\"\n }\n aria-hidden=\"true\"\n >\n {iconContent() ?? <i class={iconClass(icon())} />}\n </span>\n </Show>\n {/* Plain labels reserve the selected text weight so selection keeps their line count. */}\n <span class=\"k2b-app-workspace__sidebar-item-copy\">\n <Show when={props.context || props.contextMeta}>\n <span class=\"k2b-app-workspace__sidebar-item-context\">\n <span class=\"k2b-app-workspace__sidebar-item-context-label k2b-truncate-fade\">{props.context}</span>\n <Show when={props.contextMeta}>\n <span class=\"k2b-app-workspace__sidebar-item-context-meta\">{props.contextMeta}</span>\n </Show>\n </span>\n </Show>\n <span\n class=\"k2b-app-workspace__sidebar-item-label\"\n data-lines={oneLine() ? \"1\" : undefined}\n data-label={!oneLine() && typeof label() === \"string\" ? label() : undefined}\n >\n <span class=\"k2b-app-workspace__sidebar-item-label-text k2b-truncate-fade-lines\">{label() as JSX.Element}</span>\n </span>\n <Show when={props.description}>\n <span class=\"k2b-app-workspace__sidebar-item-description k2b-truncate-fade\">{props.description}</span>\n </Show>\n <Show when={props.note}>\n <span class=\"k2b-app-workspace__sidebar-item-note k2b-truncate-fade\" data-tone={props.noteTone ?? \"neutral\"}>\n {props.note}\n </span>\n </Show>\n </span>\n <Show when={hasMeta()}>\n <span\n class=\"k2b-app-workspace__sidebar-item-meta\"\n id={props.preview?.trigger === \"row\" ? metaId : undefined}\n data-visibility={metaVisibility() === \"hover\" ? \"hover\" : undefined}\n >\n {meta()}\n </span>\n </Show>\n </>\n );\n const singleAction = () => {\n const label = () => actionSlot()?.label ?? props.actionLabel ?? workspaceMessages().rowAction;\n const select = (event: MouseEvent) => {\n event.stopPropagation();\n if (actionSlot()?.disabled) {\n event.preventDefault();\n return;\n }\n if (!actionSlot()?.href) event.preventDefault();\n actionSlot()?.onSelect?.(event);\n props.onActionClick?.(event);\n };\n const content = () => actionSlot()?.children ?? <i class={iconClass(actionSlot()?.icon ?? props.actionIcon, \"ti-dots\")} />;\n return (\n <Show when={Boolean(actionSlot() || props.actionIcon)}>\n <Show\n when={actionSlot()?.href && !actionSlot()?.disabled}\n fallback={\n <button\n type=\"button\"\n class=\"k2b-app-workspace__sidebar-item-action\"\n disabled={actionSlot()?.disabled}\n data-visibility={actionSlot()?.visibility === \"hover\" ? \"hover\" : undefined}\n aria-label={label()}\n onClick={select}\n >\n {content()}\n </button>\n }\n >\n <a\n href={actionSlot()?.href}\n class=\"k2b-app-workspace__sidebar-item-action\"\n data-visibility={actionSlot()?.visibility === \"hover\" ? \"hover\" : undefined}\n aria-label={label()}\n onClick={select}\n >\n {content()}\n </a>\n </Show>\n </Show>\n );\n };\n const actions = () => (\n <>\n {customActions()}\n {singleAction()}\n <Show when={props.preview}>\n {(preview) => (\n <SidebarItemPreview\n label={preview().label}\n trigger={preview().trigger}\n align={preview().align}\n viewportSize={preview().viewportSize}\n describedBy={hasMeta() ? metaId : undefined}\n onOpenChange={preview().onOpenChange}\n >\n {preview().content}\n </SidebarItemPreview>\n )}\n </Show>\n </>\n );\n return (\n <AppWorkspaceSidebarRow\n hasActions={hasAction()}\n href={props.href}\n navigation={props.navigation}\n replace={props.replace}\n scroll={props.scroll}\n onNavigate={props.onNavigate}\n onClick={props.onClick}\n active={props.active}\n activeClass={props.activeClass}\n disabled={props.disabled}\n tone={props.tone}\n title={props.title}\n hint={typeof label() === \"string\" ? (label() as string) : undefined}\n viewTransitionName={props.viewTransitionName}\n class={props.class}\n depth={props.depth}\n actions={actions()}\n data={{\n ...props.data,\n ...modeData(props.sidebarMode),\n variant: props.variant ?? \"row\",\n \"has-actions\": hasCustomActions() ? \"true\" : undefined,\n \"action-visibility\": actionSlot()?.visibility === \"hover\" ? \"hover\" : undefined,\n }}\n >\n {mainContent}\n </AppWorkspaceSidebarRow>\n );\n}\n\nconst navTreeItems = (value: unknown): NavTreeItemSlot[] => flatten(value).filter(navTreeItemSlot);\n\nconst AppWorkspaceNavTreeItem = (props: AppWorkspaceNavTreeItemProps): JSX.Element =>\n ({ kind: NAV_TREE_ITEM, ...props }) as unknown as JSX.Element;\n\ntype NavTreeDragEvent = DragEvent & { currentTarget: HTMLDivElement; target: Element };\nconst NAV_TREE_DRAG_TYPE = \"application/x-k2b-nav-tree-item\";\n\nconst callDragHandler = (handler: JSX.EventHandlerUnion<HTMLDivElement, DragEvent> | undefined, event: NavTreeDragEvent) => {\n if (typeof handler === \"function\") handler(event);\n else handler?.[0](handler[1], event);\n};\n\n/**\n * The move that puts the sibling at `from` into the gap before `slot`\n * (`siblings.length` is the gap after the last one), or `null` when its place\n * would not change or it would pass an item that is not movable.\n */\nconst navTreeMove = (\n siblings: readonly NavTreeItemSlot[],\n from: number,\n slot: number,\n parentId: string | null,\n): AppWorkspaceNavTreeMove | null => {\n if (from < 0 || slot < 0 || slot > siblings.length || slot === from || slot === from + 1) return null;\n const passed = slot < from ? siblings.slice(slot, from) : siblings.slice(from + 1, slot);\n if (passed.some((sibling) => !sibling.movable)) return null;\n return { id: siblings[from]!.id, parentId, beforeId: siblings[slot]?.id ?? null, afterId: siblings[slot - 1]?.id ?? null };\n};\n\nconst AppWorkspaceNavTree = ((props: AppWorkspaceNavTreeProps) => {\n let root: HTMLDivElement | undefined;\n const resolved = children(() => props.children);\n const roots = createMemo(() => navTreeItems(resolved()));\n const [uncontrolledExpandedIds, setUncontrolledExpandedIds] = createSignal<string[]>([...new Set(props.defaultExpandedIds ?? [])]);\n const [focusedId, setFocusedId] = createSignal<string | null>(props.selectedId ?? null);\n const expandedIds = createMemo(() => new Set(props.expandedIds ?? uncontrolledExpandedIds()));\n const isExpanded = (id: string) => expandedIds().has(id);\n\n const setExpanded = (id: string, expanded: boolean) => {\n const next = new Set(expandedIds());\n if (expanded) next.add(id);\n else next.delete(id);\n const value = [...next];\n if (props.expandedIds === undefined) setUncontrolledExpandedIds(value);\n props.onExpandedIdsChange?.(value);\n };\n\n const visibleIds = createMemo(() => {\n const result: string[] = [];\n const visit = (items: readonly NavTreeItemSlot[]) => {\n for (const item of items) {\n if (item.disabled) continue;\n result.push(item.id);\n const nested = navTreeItems(item.children);\n if (nested.length > 0 && isExpanded(item.id)) visit(nested);\n }\n };\n visit(roots());\n return result;\n });\n\n const tabStopId = () => {\n const visible = visibleIds();\n const focused = focusedId();\n if (focused && visible.includes(focused)) return focused;\n if (props.selectedId && visible.includes(props.selectedId)) return props.selectedId;\n return visible[0] ?? null;\n };\n\n const treeItemElements = () =>\n Array.from(root?.querySelectorAll<HTMLElement>(\"[data-k2b-nav-tree-id]\") ?? []).filter(\n (element) => element.getAttribute(\"aria-disabled\") !== \"true\",\n );\n const focusItem = (id: string | null) => {\n if (!id) return;\n const element = treeItemElements().find((candidate) => candidate.dataset.k2bNavTreeId === id);\n element?.focus({ preventScroll: true });\n };\n\n // Reordering: the dragged item and the gap the pointer marks. The application renders the new\n // order; the item moved by keyboard takes focus back when its row mounts or changes place.\n const [dragged, setDragged] = createSignal<{ id: string; parentId: string | null } | null>(null);\n const [dropTarget, setDropTarget] = createSignal<{ id: string; side: \"before\" | \"after\" } | null>(null);\n let claimedDragOver: DragEvent | null = null;\n let refocusId: string | null = null;\n const endDrag = () => {\n setDragged(null);\n setDropTarget(null);\n };\n const requestMove = (move: AppWorkspaceNavTreeMove | null, keepFocus: boolean) => {\n if (!move || !props.onMove) return;\n refocusId = keepFocus ? move.id : null;\n props.onMove(move);\n };\n\n // Items arrive through an accessor so a changed nested list reconciles rows by identity instead of rebuilding the list.\n const renderItems = (siblings: () => NavTreeItemSlot[], depth: number, parentId?: string): JSX.Element => (\n <For each={siblings()}>\n {(item, place) => {\n const nested = createMemo(() => navTreeItems(item.children));\n const hasChildren = () => item.hasChildren ?? nested().length > 0;\n const selected = () => props.selectedId === item.id;\n const siblingIndex = (id: string) => siblings().findIndex((sibling) => sibling.id === id);\n const movable = () => Boolean(props.onMove && item.movable && !item.disabled);\n // A folder that nobody selects: its row only expands and collapses it.\n const disclosureOnly = () => hasChildren() && !item.href && !item.onSelect && !props.onSelectedIdChange;\n let treeItem: HTMLDivElement | undefined;\n const ownRow = () => treeItem?.firstElementChild as HTMLElement | null | undefined;\n\n // A new row for the moved item, or the same row at its new place: moving a focused row drops its focus.\n createEffect(() => {\n place();\n if (refocusId !== item.id) return;\n queueMicrotask(() => {\n if (refocusId !== item.id || !treeItem?.isConnected) return;\n const active = treeItem.ownerDocument.activeElement;\n if (!active || active === treeItem.ownerDocument.body) treeItem.focus({ preventScroll: true });\n });\n });\n\n const activate = (event: MouseEvent) => {\n if (item.disabled) return;\n treeItem?.focus({ preventScroll: true });\n setFocusedId(item.id);\n if (disclosureOnly()) {\n setExpanded(item.id, !isExpanded(item.id));\n return;\n }\n props.onSelectedIdChange?.(item.id);\n item.onSelect?.(event);\n };\n const toggle = (event: MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n if (!item.disabled && hasChildren()) setExpanded(item.id, !isExpanded(item.id));\n };\n const onRowClick = (event: MouseEvent) => {\n if ((event.target as Element | null)?.closest(\"[data-k2b-nav-tree-toggle]\")) {\n toggle(event);\n return;\n }\n activate(event);\n };\n const rowControl = () => {\n const firstChild = treeItem?.firstElementChild as HTMLElement | null | undefined;\n if (!firstChild?.classList.contains(\"has-action\")) return firstChild;\n return firstChild.firstElementChild as HTMLElement | null;\n };\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.target !== event.currentTarget) return;\n if (\n event.altKey &&\n !event.ctrlKey &&\n !event.metaKey &&\n !event.shiftKey &&\n (event.key === \"ArrowUp\" || event.key === \"ArrowDown\")\n ) {\n if (!movable()) return;\n event.preventDefault();\n const from = siblingIndex(item.id);\n requestMove(navTreeMove(siblings(), from, event.key === \"ArrowUp\" ? from - 1 : from + 2, parentId ?? null), true);\n return;\n }\n if (event.altKey || event.ctrlKey || event.metaKey) return;\n const items = treeItemElements();\n const index = items.indexOf(event.currentTarget as HTMLElement);\n if (event.key === \"ArrowDown\" && index >= 0) {\n event.preventDefault();\n items[Math.min(items.length - 1, index + 1)]?.focus({ preventScroll: true });\n return;\n }\n if (event.key === \"ArrowUp\" && index >= 0) {\n event.preventDefault();\n items[Math.max(0, index - 1)]?.focus({ preventScroll: true });\n return;\n }\n if (event.key === \"Home\") {\n event.preventDefault();\n items[0]?.focus({ preventScroll: true });\n return;\n }\n if (event.key === \"End\") {\n event.preventDefault();\n items.at(-1)?.focus({ preventScroll: true });\n return;\n }\n if (event.key === \"ArrowRight\" && hasChildren()) {\n event.preventDefault();\n if (!isExpanded(item.id)) setExpanded(item.id, true);\n else queueMicrotask(() => focusItem(nested()[0]?.id ?? null));\n return;\n }\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n if (hasChildren() && isExpanded(item.id)) setExpanded(item.id, false);\n else focusItem(parentId ?? null);\n return;\n }\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n rowControl()?.click();\n }\n };\n const usesIconDisclosure = () => hasChildren() && Boolean(item.icon && item.expandedIcon);\n const rowIcon = () => (usesIconDisclosure() && isExpanded(item.id) ? item.expandedIcon : item.icon);\n const rowContent = (\n <>\n <Show when={rowIcon()}>\n <span\n class=\"k2b-app-workspace__sidebar-item-icon\"\n data-k2b-nav-tree-toggle={usesIconDisclosure() ? \"\" : undefined}\n {...iconAccessibility(item.iconLabel)}\n >\n <i class={iconClass(rowIcon())} />\n </span>\n </Show>\n <Show\n when={item.description !== undefined}\n fallback={\n <span class=\"k2b-app-workspace__sidebar-item-label\" data-label={typeof item.label === \"string\" ? item.label : undefined}>\n <span class=\"k2b-app-workspace__sidebar-item-label-text k2b-truncate-fade-lines\">{item.label}</span>\n </span>\n }\n >\n <span class=\"k2b-app-workspace__sidebar-item-copy\">\n <span class=\"k2b-app-workspace__sidebar-item-label\" data-label={typeof item.label === \"string\" ? item.label : undefined}>\n <span class=\"k2b-app-workspace__sidebar-item-label-text k2b-truncate-fade-lines\">{item.label}</span>\n </span>\n <span class=\"k2b-app-workspace__sidebar-item-description k2b-truncate-fade\">{item.description}</span>\n </span>\n </Show>\n <Show when={item.meta !== undefined}>\n <span\n class={`k2b-app-workspace__sidebar-item-meta ${hasChildren() ? \"\" : \"k2b-app-workspace__nav-tree-leaf-meta\"}`}\n data-visibility={item.metaVisibility === \"hover\" ? \"hover\" : undefined}\n >\n {item.meta}\n </span>\n </Show>\n <Show when={hasChildren() && !usesIconDisclosure()}>\n <span class=\"k2b-app-workspace__nav-tree-toggle\" data-k2b-nav-tree-toggle aria-hidden=\"true\">\n <i class={`ti ${isExpanded(item.id) ? \"ti-chevron-down\" : \"ti-chevron-right\"}`} />\n </span>\n </Show>\n </>\n );\n const row = () => (\n <AppWorkspaceSidebarRow\n hasActions={Boolean(item.actions)}\n href={item.href}\n navigation={item.navigation}\n replace={item.replace}\n scroll={item.scroll}\n onNavigate={item.onNavigate}\n onClick={onRowClick}\n active={selected()}\n disabled={item.disabled}\n tone={item.tone}\n title={item.title}\n hint={typeof item.label === \"string\" ? item.label : undefined}\n focusTarget={() => treeItem}\n viewTransitionName={item.viewTransitionName}\n class={`k2b-app-workspace__nav-tree-row ${item.class ?? \"\"}`}\n depth={props.indented === false ? 0 : depth}\n tabIndex={-1}\n actions={item.actions}\n // The marker tells the workspace controller that choosing this row is no destination.\n data={{ \"has-actions\": item.actions ? \"true\" : undefined, \"k2b-nav-tree-disclosure\": disclosureOnly() ? \"true\" : undefined }}\n >\n {rowContent}\n </AppWorkspaceSidebarRow>\n );\n\n // A gap is offered only next to a sibling's own row, never over its sub-items.\n const dropMove = (event: DragEvent): { side: \"before\" | \"after\"; move: AppWorkspaceNavTreeMove } | null => {\n const drag = dragged();\n const row = ownRow();\n if (!drag || !event.dataTransfer?.types.includes(NAV_TREE_DRAG_TYPE)) return null;\n if (drag.parentId !== (parentId ?? null) || drag.id === item.id || !row?.contains(event.target as Node)) return null;\n const rect = row.getBoundingClientRect();\n const side = event.clientY < rect.top + rect.height / 2 ? \"before\" : \"after\";\n const slot = siblingIndex(item.id) + (side === \"after\" ? 1 : 0);\n const move = navTreeMove(siblings(), siblingIndex(drag.id), slot, parentId ?? null);\n return move ? { side, move } : null;\n };\n const onDragStart = (event: DragEvent) => {\n const row = ownRow();\n if (!movable() || !row?.contains(event.target as Node)) return;\n event.stopPropagation();\n setDragged({ id: item.id, parentId: parentId ?? null });\n if (!event.dataTransfer) return;\n event.dataTransfer.effectAllowed = \"move\";\n event.dataTransfer.setData(NAV_TREE_DRAG_TYPE, item.id);\n const rect = row.getBoundingClientRect();\n event.dataTransfer.setDragImage(row, event.clientX - rect.left, event.clientY - rect.top);\n };\n const onDragOver = (event: NavTreeDragEvent) => {\n callDragHandler(item.onDragOver, event);\n const target = dropMove(event);\n if (!target) return;\n event.preventDefault();\n if (event.dataTransfer) event.dataTransfer.dropEffect = \"move\";\n claimedDragOver = event;\n setDropTarget({ id: item.id, side: target.side });\n };\n const onDrop = (event: NavTreeDragEvent) => {\n callDragHandler(item.onDrop, event);\n const target = dropMove(event);\n if (!target) return;\n event.preventDefault();\n event.stopPropagation();\n endDrag();\n requestMove(target.move, false);\n };\n\n return (\n <div\n ref={treeItem}\n class=\"k2b-app-workspace__nav-tree-node\"\n role=\"treeitem\"\n aria-level={depth + 1}\n aria-setsize={siblings().length}\n aria-posinset={place() + 1}\n aria-selected={selected()}\n aria-expanded={hasChildren() ? isExpanded(item.id) : undefined}\n aria-disabled={item.disabled ? \"true\" : undefined}\n tabIndex={item.disabled ? -1 : tabStopId() === item.id ? 0 : -1}\n draggable={movable() ? true : undefined}\n data-k2b-nav-tree-id={item.id}\n data-k2b-nav-tree-parent-id={parentId}\n data-k2b-nav-tree-dragging={dragged()?.id === item.id ? \"\" : undefined}\n data-k2b-nav-tree-drop={dropTarget()?.id === item.id ? dropTarget()!.side : undefined}\n style={{ \"--k2b-nav-tree-depth\": String(props.indented === false ? 0 : depth) }}\n onFocus={() => setFocusedId(item.id)}\n onKeyDown={onKeyDown}\n onDragStart={onDragStart}\n onDragEnter={item.onDragEnter}\n onDragOver={onDragOver}\n onDragLeave={item.onDragLeave}\n onDrop={onDrop}\n >\n {row()}\n <Show when={hasChildren() && isExpanded(item.id)}>\n <div class=\"k2b-app-workspace__nav-tree-group\" role=\"group\">\n {renderItems(nested, depth + 1, item.id)}\n </div>\n </Show>\n </div>\n );\n }}\n </For>\n );\n\n // Any other click or focus is the person's choice; only the moved item itself keeps its claim.\n const forgetRefocus = (event: Event) => {\n if (event.type === \"pointerdown\" || (event.target as HTMLElement | null)?.dataset?.k2bNavTreeId !== refocusId) refocusId = null;\n };\n // A row replaced during a drag never receives its dragend; the next pointer movement means the drag is over.\n const forgetDrag = () => {\n if (dragged()) endDrag();\n };\n onMount(() => {\n const doc = root?.ownerDocument;\n doc?.addEventListener(\"pointerdown\", forgetRefocus, true);\n doc?.addEventListener(\"focusin\", forgetRefocus, true);\n doc?.addEventListener(\"pointermove\", forgetDrag, true);\n onCleanup(() => {\n doc?.removeEventListener(\"pointerdown\", forgetRefocus, true);\n doc?.removeEventListener(\"focusin\", forgetRefocus, true);\n doc?.removeEventListener(\"pointermove\", forgetDrag, true);\n });\n });\n\n return (\n <div\n ref={root}\n class={`k2b-app-workspace__nav-tree ${props.class ?? \"\"}`}\n role=\"tree\"\n aria-label={props.ariaLabel}\n onDragOver={(event) => {\n // Runs after the rows: a position no row claimed shows no gap.\n if (claimedDragOver !== event) setDropTarget(null);\n }}\n onDragLeave={(event) => {\n if (!root?.contains(event.relatedTarget as Node | null)) setDropTarget(null);\n }}\n onDragEnd={endDrag}\n >\n {renderItems(roots, 0)}\n </div>\n );\n}) as AppWorkspaceNavTreeComponent;\n\nAppWorkspaceNavTree.Item = AppWorkspaceNavTreeItem;\n\nconst AppWorkspaceSidebarIconGrid = (props: AppWorkspaceSidebarIconGridProps) => (\n <section class={`k2b-app-workspace__sidebar-icon-grid-wrap ${props.class ?? \"\"}`} {...modeAttrs(props.sidebarMode)}>\n <Show when={props.title}>{(title) => <h2>{title()}</h2>}</Show>\n <div class=\"k2b-app-workspace__sidebar-icon-grid\" data-columns={props.columns ?? 2}>\n {props.children}\n </div>\n </section>\n);\n\nconst AppWorkspaceSidebarIconAction = (props: AppWorkspaceSidebarIconActionProps) => {\n let target: HTMLElement | undefined;\n const content = <i class={iconClass(props.icon)} aria-hidden=\"true\" />;\n const attrs = () => ({\n ref: (element: HTMLElement) => (target = element),\n class: `k2b-app-workspace__sidebar-icon-action ${props.active ? \"is-active\" : \"\"}`,\n \"aria-label\": props.label,\n \"data-tone\": props.tone,\n style: { \"view-transition-name\": props.viewTransitionName },\n ...modeAttrs(props.sidebarMode),\n });\n // The icon never shows its label, so the hint names it in every state; in the collapsed rail it sits beside the\n // icon like the rail's other entries.\n const hint = <Tooltip target={() => target} content={props.label} placement={inSidebarRail(target) ? \"right\" : undefined} delay={0} />;\n if (!props.href || props.disabled)\n return (\n <>\n <button type=\"button\" {...attrs()} disabled={props.disabled} onClick={props.onClick}>\n {content}\n </button>\n {hint}\n </>\n );\n if (props.navigation !== \"enhanced\" || !props.onNavigate)\n return (\n <>\n <a href={props.href} {...attrs()} onClick={props.onClick}>\n {content}\n </a>\n {hint}\n </>\n );\n return (\n <>\n <Link\n href={props.href}\n {...attrs()}\n replace={props.replace}\n scroll={props.scroll}\n onNavigate={props.onNavigate}\n onClick={props.onClick}\n >\n {content}\n </Link>\n {hint}\n </>\n );\n};\n\ntype AppWorkspaceComponent = ((props: AppWorkspaceProps) => JSX.Element) & {\n LayoutStateProvider: (props: AppWorkspaceLayoutStateProviderProps) => JSX.Element;\n Head: (props: AppWorkspaceHeadProps) => JSX.Element;\n Content: (props: AppWorkspaceContentProps) => JSX.Element;\n Main: (props: AppWorkspaceMainProps) => JSX.Element;\n MainPane: (props: AppWorkspaceMainPaneProps) => JSX.Element;\n Detail: (props: AppWorkspaceDetailProps) => JSX.Element;\n BottomDrawer: (props: AppWorkspaceBottomDrawerProps) => JSX.Element;\n Sidebar: (props: AppWorkspaceSidebarProps) => JSX.Element;\n SidebarDesktop: (props: { children: JSX.Element }) => JSX.Element;\n SidebarSwitcher: (props: AppWorkspaceSidebarSwitcherProps) => JSX.Element;\n SidebarSection: (props: AppWorkspaceSidebarSectionProps) => JSX.Element;\n SidebarBody: (props: AppWorkspaceSidebarBodyProps) => JSX.Element;\n SidebarFooter: (props: AppWorkspaceSidebarContentProps) => JSX.Element;\n SidebarItem: (props: AppWorkspaceSidebarItemProps) => JSX.Element;\n SidebarItemIcon: (props: AppWorkspaceSidebarItemIconProps) => JSX.Element;\n SidebarItemLabel: (props: AppWorkspaceSidebarItemLabelProps) => JSX.Element;\n SidebarItemMeta: (props: AppWorkspaceSidebarItemMetaProps) => JSX.Element;\n SidebarItemAction: (props: AppWorkspaceSidebarItemActionProps) => JSX.Element;\n SidebarItemActions: (props: AppWorkspaceSidebarItemActionsProps) => JSX.Element;\n SidebarItemStatus: (props: AppWorkspaceSidebarItemStatusProps) => JSX.Element;\n NavTree: AppWorkspaceNavTreeComponent;\n SidebarIconGrid: (props: AppWorkspaceSidebarIconGridProps) => JSX.Element;\n SidebarIconAction: (props: AppWorkspaceSidebarIconActionProps) => JSX.Element;\n};\n\n/**\n * The row above the work area. From 48 to 64 rem it holds the button that\n * opens the overlay sidebar. On a page with a page above it, it shows the\n * host's page title with the way up (see `PageTitle`); the page's own\n * `PageTitle` takes its place. The visible title is no heading, because many\n * pages render their own `h1`. From 64 rem a sidebar that marks the current\n * page names it already: the title and the way up hide, and only on a page\n * without its own `h1` its heading stays for assistive technology. With an\n * `AppWorkspace.Head` slot the row is always there and also carries the\n * views, the filters, the result count, and the actions; only its title\n * follows the rules above. It draws no line; CSS decides what shows and when\n * the filters wrap, so the server-rendered page already has its final\n * geometry.\n */\nfunction AppWorkspaceHead(props: { sidebarId: () => string; nested: boolean; head?: AppWorkspaceHeadProps }): JSX.Element {\n const messages = useWorkspaceMessages();\n const filters = useFilterMessages();\n // JSX prop getters construct their elements on every read. Share each\n // resolved slot between its presence check and its rendered content.\n const resolvedViews = children(() => props.head?.views);\n const resolvedFilters = children(() => props.head?.filters);\n const resolvedActions = children(() => props.head?.actions);\n const resolvedCount = children(() => props.head?.count);\n // A nested workspace is part of a page that already shows its title.\n const trail = props.nested ? () => undefined : usePageTrail();\n // Main already publishes the active region in SSR and on each selection.\n // Scope both sides to this workspace, including transparent island hosts;\n // a nested Main must never decide whether its parent's head is visible.\n const mobilePane = () =>\n props.head?.mobilePane === undefined ? undefined : assertStableUiId(props.head.mobilePane, \"AppWorkspace.Head mobilePane\");\n const mobilePaneRule = (pane: string) => {\n const main = `.k2b-app-workspace__main.has-panes:not([data-workspace-levels]) > [data-workspace-mobile-active=\"true\"]:not([data-workspace-main-region=\"${pane}\"])`;\n const host = `.k2b-ui .k2b-app-workspace:has(> .k2b-app-workspace__head[data-workspace-head-pane=\"${pane}\"]):has(> .k2b-app-workspace__content > ${main}, > .k2b-app-workspace__content > :is(solid-island, solid-client) > ${main})`;\n return `@media not all and (min-width:48rem){${host} > .k2b-app-workspace__head,${host} > .k2b-app-workspace__content > .k2b-app-workspace__detail-toggle,${host} > .k2b-app-workspace__content > :is(solid-island, solid-client) > .k2b-app-workspace__detail-toggle{display:none}}`;\n };\n const resetContent = () => filters().reset;\n const primaryContent = () => (\n <>\n <i class={props.head?.primary?.icon} aria-hidden=\"true\" />\n <span class=\"k2b-app-workspace__head-primary-label\">{props.head?.primary?.label}</span>\n </>\n );\n return (\n <div\n class=\"k2b-app-workspace__head\"\n data-trail={trail()?.ancestors.length ? \"up\" : trail() ? \"title\" : undefined}\n data-row={props.head ? \"\" : undefined}\n data-workspace-head-pane={mobilePane()}\n >\n <Show when={mobilePane()}>{(pane) => <style innerHTML={mobilePaneRule(pane())} />}</Show>\n <div class=\"k2b-app-workspace__head-lead\">\n <IconButton\n class=\"k2b-app-workspace__head-toggle\"\n label={messages().showNavigation}\n aria-controls={props.sidebarId()}\n aria-expanded=\"false\"\n data-app-workspace-sidebar-toggle=\"\"\n >\n <i class=\"ti ti-layout-sidebar\" aria-hidden=\"true\" />\n </IconButton>\n <Show when={trail()}>\n {(current) => (\n <>\n <PageTitle trail={current()} as=\"p\" fallback />\n {/* A head that never hydrates follows a new trail through followPageTrail. */}\n <h1 class=\"k2b-app-workspace__head-heading\" data-k2b-page-trail-title=\"\" data-k2b-server={isServer ? \"\" : undefined}>\n {current().title}\n </h1>\n </>\n )}\n </Show>\n <Show when={resolvedViews.toArray().some(Boolean)}>\n <div class=\"k2b-app-workspace__head-views\">{resolvedViews()}</div>\n </Show>\n <Show when={resolvedFilters.toArray().some(Boolean) || props.head?.filtered}>\n <div class=\"k2b-app-workspace__head-filters\" role=\"group\" aria-label={filters().filters}>\n {resolvedFilters()}\n <Show when={props.head?.filtered}>\n <Show\n when={props.head?.resetHref}\n fallback={\n <Button variant=\"ghost\" size=\"sm\" class=\"k2b-app-workspace__head-reset\" onClick={() => props.head?.onReset?.()}>\n {resetContent()}\n </Button>\n }\n >\n {(href) => (\n <ButtonLink\n variant=\"ghost\"\n size=\"sm\"\n class=\"k2b-app-workspace__head-reset\"\n href={href()}\n onClick={\n props.head?.onReset\n ? (event) => {\n if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;\n event.preventDefault();\n props.head?.onReset?.();\n }\n : undefined\n }\n >\n {resetContent()}\n </ButtonLink>\n )}\n </Show>\n </Show>\n </div>\n </Show>\n <Show\n when={props.head?.filtered && resolvedCount.toArray().some((value) => value !== undefined && value !== null && value !== false)}\n >\n <span class=\"k2b-app-workspace__head-count\">\n <span>{resolvedCount()}</span>\n </span>\n </Show>\n </div>\n <Show when={resolvedActions.toArray().some(Boolean) || props.head?.primary}>\n <div class=\"k2b-app-workspace__head-actions\">\n {resolvedActions()}\n <Show when={props.head?.primary}>\n {(primary) => (\n <Show\n when={primary().href}\n fallback={\n <Button\n variant=\"primary\"\n size=\"sm\"\n class=\"k2b-app-workspace__head-primary\"\n data-workspace-primary=\"\"\n onClick={primary().onClick}\n >\n {primaryContent()}\n </Button>\n }\n >\n {(href) => (\n <ButtonLink\n variant=\"primary\"\n size=\"sm\"\n class=\"k2b-app-workspace__head-primary\"\n data-workspace-primary=\"\"\n href={href()}\n onClick={primary().onClick}\n >\n {primaryContent()}\n </ButtonLink>\n )}\n </Show>\n )}\n </Show>\n </div>\n </Show>\n </div>\n );\n}\n\nconst AppWorkspace = ((props: AppWorkspaceProps) => {\n let root: HTMLDivElement | undefined;\n const serverLayoutState = useContext(LayoutStateContext);\n const nested = Boolean(useContext(WorkspaceContext));\n const [sidebarId, setSidebarId] = createSignal(`k2b-workspace-sidebar-${createUniqueId()}`);\n const initialLayoutState = () => props.layoutState?.() ?? serverLayoutState;\n const workspace = { sidebarId: sidebarId(), setSidebarId, initialLayoutState };\n\n // The resize handles are inert markup until the controller is attached, so\n // the workspace attaches it itself and scopes it to this root. `onMount`\n // never runs during SSR, and the disposer removes every listener. A host\n // shell may own one document-level controller for SSR and hydrated roots;\n // its marker keeps controller ownership singular without app-level props.\n onMount(() => {\n if (props.controller === false || !root || root.closest(\"[data-k2b-app-workspace-controller]\")) return;\n onCleanup(\n installAppWorkspaceController({\n root,\n readState: () => (props.layoutState ? props.layoutState() : serverLayoutState),\n writeState: (state) => props.onLayoutChange?.(state),\n }),\n );\n });\n\n const contents = () => {\n const resolved = children(() => props.children);\n const slots = createMemo(() => flatten(resolved()));\n // Same props object, same memo value: a sibling change must not rebuild the head's slots.\n const head = createMemo(() => slots().find(headSlot)?.props);\n // Keep one head instance at the explicit slot's position. Object links\n // before it must also precede its view controls in SSR and keyboard order.\n // Callers without a slot retain the automatic leading head.\n const renderedHead = <AppWorkspaceHead sidebarId={sidebarId} nested={nested} head={head()} />;\n return (\n <>\n {\n (head()\n ? slots().map((value) => (headSlot(value) ? (value.props === head() ? renderedHead : null) : value))\n : [renderedHead, ...slots()]) as JSX.Element\n }\n </>\n );\n };\n\n return (\n <ResizeContext.Provider value={props.resizable !== false}>\n <WorkspaceContext.Provider value={workspace}>\n <div\n ref={root}\n class={`k2b-app-workspace ${props.class ?? \"\"}`}\n data-k2b-app-workspace\n data-mobile-surface={props.mobileSurface}\n data-flat={props.flat ? \"true\" : undefined}\n data-sidebar-collapsed={\n initialLayoutState()?.sidebarCollapsed === undefined ? undefined : String(initialLayoutState()?.sidebarCollapsed)\n }\n data-workspace-resizable={props.resizable === false ? \"false\" : \"true\"}\n style={appWorkspaceLayoutStyle(initialLayoutState())}\n >\n {contents()}\n </div>\n </WorkspaceContext.Provider>\n </ResizeContext.Provider>\n );\n}) as AppWorkspaceComponent;\n\nAppWorkspace.LayoutStateProvider = (props) => (\n <LayoutStateContext.Provider value={props.state ?? null}>{props.children}</LayoutStateContext.Provider>\n);\nAppWorkspace.Head = AppWorkspaceHeadSlot;\nAppWorkspace.Content = (props) => <div class={`k2b-app-workspace__content ${props.class ?? \"\"}`}>{props.children}</div>;\nAppWorkspace.Main = AppWorkspaceMain;\nAppWorkspace.MainPane = AppWorkspaceMainPane;\nAppWorkspace.Detail = AppWorkspaceDetail;\nAppWorkspace.BottomDrawer = AppWorkspaceBottomDrawer;\nAppWorkspace.Sidebar = AppWorkspaceSidebar;\nAppWorkspace.SidebarDesktop = AppWorkspaceSidebarDesktop;\nAppWorkspace.SidebarSwitcher = AppWorkspaceSidebarSwitcher;\nAppWorkspace.SidebarSection = AppWorkspaceSidebarSection;\nAppWorkspace.SidebarBody = AppWorkspaceSidebarBody;\nAppWorkspace.SidebarFooter = AppWorkspaceSidebarFooter;\nAppWorkspace.SidebarItem = AppWorkspaceSidebarItem;\nAppWorkspace.SidebarItemIcon = AppWorkspaceSidebarItemIcon;\nAppWorkspace.SidebarItemLabel = AppWorkspaceSidebarItemLabel;\nAppWorkspace.SidebarItemMeta = AppWorkspaceSidebarItemMeta;\nAppWorkspace.SidebarItemAction = AppWorkspaceSidebarItemAction;\nAppWorkspace.SidebarItemActions = AppWorkspaceSidebarItemActions;\nAppWorkspace.SidebarItemStatus = AppWorkspaceSidebarItemStatus;\nAppWorkspace.NavTree = AppWorkspaceNavTree;\nAppWorkspace.SidebarIconGrid = AppWorkspaceSidebarIconGrid;\nAppWorkspace.SidebarIconAction = AppWorkspaceSidebarIconAction;\n\nexport default AppWorkspace;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,IAAI,QAA2D,cAAc;AACtF,SACE,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,UAAU,EACV,UAAU,EACV,YAAY,EACZ,cAAc,EACd,GAAG,EACH,QAAQ,EAER,UAAU,EACV,EAAE,EACF,SAAS,EACT,OAAO,EACP,IAAI,EACJ,UAAU,QACL,UAAU;AACjB,SAAS,OAAO,EAAE,QAAQ,QAAQ,cAAc;AAChD,SAAS,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,QAAQ,mBAAmB;AAClF,SAAS,iBAAiB,QAAQ,4BAA4B;AAC9D,SAAS,UAAU,QAAQ,yBAAyB;AACpD,SAAS,OAA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,eAAe,GAAG,2BAA2B;AAC1D,YAAY,CAAC,cAAc,GAAG,0BAA0B;AACxD,YAAY,CAAC,WAAW,GAAG,uBAAuB;AAClD,YAAY,CAAC,aAAa,GAAG,yBAAyB;AACtD,YAAY,CAAC,WAAW,GAAG,uBAAuB;AAClD,YAAY,CAAC,eAAe,GAAG,2BAA2B;AAC1D,YAAY,CAAC,gBAAgB,GAAG,4BAA4B;AAC5D,YAAY,CAAC,eAAe,GAAG,2BAA2B;AAC1D,YAAY,CAAC,iBAAiB,GAAG,6BAA6B;AAC9D,YAAY,CAAC,kBAAkB,GAAG,8BAA8B;AAChE,YAAY,CAAC,iBAAiB,GAAG,6BAA6B;AAC9D,YAAY,CAAC,OAAO,GAAG,mBAAmB;AAC1C,YAAY,CAAC,eAAe,GAAG,2BAA2B;AAC1D,YAAY,CAAC,iBAAiB,GAAG,6BAA6B;AAE9D,eAAe,YAAY","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["layout/AppWorkspace.tsx"],"sourcesContent":["import { Link, type LinkNavigateEvent, type NavigationScrollMode } from \"@k2b/ssr/nav\";\nimport {\n children,\n createContext,\n createEffect,\n createMemo,\n createRoot,\n createSignal,\n createUniqueId,\n For,\n getOwner,\n type JSX,\n mergeProps,\n on,\n onCleanup,\n onMount,\n Show,\n useContext,\n} from \"solid-js\";\nimport { Dynamic, isServer } from \"solid-js/web\";\nimport { Button, ButtonLink, IconButton, IconButtonLink } from \"../actions/Button\";\nimport { useFilterMessages } from \"../actions/filter-messages\";\nimport { dialogCore } from \"../feedback/dialog-core\";\nimport { Tooltip } from \"../feedback/Tooltip\";\nimport { RenderErrorBoundary } from \"../internal/render-error\";\nimport {\n APP_WORKSPACE_DETAIL_CLOSE_EVENT,\n APP_WORKSPACE_DETAIL_OPEN_EVENT,\n APP_WORKSPACE_DETAIL_STEP_EVENT,\n APP_WORKSPACE_SIDEBAR_HIDE_EVENT,\n APP_WORKSPACE_SIDEBAR_SHOW_EVENT,\n type AppWorkspaceDetailStep,\n installAppWorkspaceController,\n} from \"./app-workspace-controller\";\nimport {\n APP_WORKSPACE_DETAIL_DEFAULT,\n APP_WORKSPACE_DETAIL_MAX,\n APP_WORKSPACE_DETAIL_MIN,\n APP_WORKSPACE_DRAWER_DEFAULT,\n APP_WORKSPACE_DRAWER_MAX,\n APP_WORKSPACE_DRAWER_MIN,\n APP_WORKSPACE_MAIN_MIN,\n APP_WORKSPACE_PANE_DEFAULT,\n APP_WORKSPACE_PANE_MAX,\n APP_WORKSPACE_PANE_MIN,\n APP_WORKSPACE_SIDEBAR_COLLAPSED,\n APP_WORKSPACE_SIDEBAR_DEFAULT,\n APP_WORKSPACE_SIDEBAR_MAX,\n APP_WORKSPACE_SIDEBAR_MIN,\n type AppWorkspaceLayoutState,\n appWorkspaceLayoutStyle,\n appWorkspacePanelVariable,\n} from \"./app-workspace-state\";\nimport {\n type AppWorkspaceWidthShare,\n appWorkspaceInverseWidthCss,\n appWorkspaceWidthCss,\n appWorkspaceWidthToken,\n isAppWorkspaceWidthShare,\n} from \"./app-workspace-width\";\nimport BottomSheet, { bottomSheetAdaptiveOptions } from \"./BottomSheet\";\nimport { PageTitle, usePageTrail } from \"./PageTitle\";\nimport type { ScrollAreaProps } from \"./ScrollArea\";\nimport { SidebarItemPreview } from \"./SidebarItemPreview\";\nimport { inSidebarRail, SidebarRailHint } from \"./SidebarRailHint\";\nimport { AppWorkspaceSidebarSwitcher, type AppWorkspaceSidebarSwitcherProps } from \"./SidebarSwitcher\";\nimport { createScrollFade, scrollFadeEdges } from \"./scroll-fade\";\nimport { rememberSidebarScroll } from \"./sidebar-scroll-memory\";\nimport { assertStableUiId, assertUniqueStableUiIds } from \"./stable-id\";\nimport { useWorkspaceMessages } from \"./workspace-messages\";\n\nexport type { AppWorkspaceWidthShare } from \"./app-workspace-width\";\n\n/** The narrowest container of each levels width class, as the stylesheet's breakpoints define them (48rem, 80rem). */\nconst LEVEL_CLASS_WIDTH = { 1: 0, 2: 768, 3: 1280 } as const;\n/** The last shown level's minimum width when the level does not declare one; the stylesheet uses the same value. */\nconst LEVEL_LAST_MIN = 320;\n/** The width the last shown level keeps at least: its declared minimum, never below the default. */\nconst levelLastMin = (minSize: number | undefined) => Math.max(minSize ?? 0, LEVEL_LAST_MIN);\nconst nonEmptyStyle = (style: Record<string, string>) => (Object.keys(style).length ? style : undefined);\nconst ResizeContext = createContext(true);\n/** The enclosing workspace: its head names the sidebar, and a nested workspace leaves the page title to it. */\nconst WorkspaceContext = createContext<{\n sidebarId: string;\n setSidebarId: (id: string) => void;\n initialLayoutState: () => AppWorkspaceLayoutState | null | undefined;\n}>();\nconst LayoutStateContext = createContext<AppWorkspaceLayoutState | null>(null);\nconst HEAD = Symbol(\"AppWorkspace.Head\");\ntype HeadSlot = { kind: typeof HEAD; props: AppWorkspaceHeadProps };\nconst headSlot = (value: unknown): value is HeadSlot => !!value && typeof value === \"object\" && \"kind\" in value && value.kind === HEAD;\nconst MAIN_PANE = Symbol(\"AppWorkspace.MainPane\");\nconst SIDEBAR_DESKTOP = Symbol(\"AppWorkspace.SidebarDesktop\");\nconst SIDEBAR_ITEM_ICON = Symbol(\"AppWorkspace.SidebarItemIcon\");\nconst SIDEBAR_ITEM_LABEL = Symbol(\"AppWorkspace.SidebarItemLabel\");\nconst SIDEBAR_ITEM_META = Symbol(\"AppWorkspace.SidebarItemMeta\");\nconst SIDEBAR_ITEM_ACTION = Symbol(\"AppWorkspace.SidebarItemAction\");\nconst NAV_TREE_ITEM = Symbol(\"AppWorkspace.NavTree.Item\");\n\ntype MainPaneSlot = {\n kind: typeof MAIN_PANE;\n props: AppWorkspaceMainPaneProps;\n domId: string;\n};\ntype SidebarChildSlot = { kind: typeof SIDEBAR_DESKTOP; children: JSX.Element };\ntype SidebarItemSlot =\n | (AppWorkspaceSidebarItemIconProps & { kind: typeof SIDEBAR_ITEM_ICON })\n | (AppWorkspaceSidebarItemLabelProps & { kind: typeof SIDEBAR_ITEM_LABEL })\n | (AppWorkspaceSidebarItemMetaProps & { kind: typeof SIDEBAR_ITEM_META })\n | (AppWorkspaceSidebarItemActionProps & { kind: typeof SIDEBAR_ITEM_ACTION });\ntype NavTreeItemSlot = AppWorkspaceNavTreeItemProps & { kind: typeof NAV_TREE_ITEM };\n\nconst flatten = (value: unknown): unknown[] => {\n // Solid control-flow components such as <For> expose their rendered value\n // through an accessor. Compound slots may therefore be nested behind a\n // function even after `children()` resolves the outer collection.\n if (typeof value === \"function\") return flatten(value());\n if (Array.isArray(value)) return value.flatMap(flatten);\n return value === null || value === undefined || typeof value === \"boolean\" ? [] : [value];\n};\nconst mainPaneSlot = (value: unknown): value is MainPaneSlot =>\n Boolean(value && typeof value === \"object\" && \"kind\" in value && (value as MainPaneSlot).kind === MAIN_PANE);\nconst sidebarChildSlot = (value: unknown): value is SidebarChildSlot =>\n Boolean(value && typeof value === \"object\" && \"kind\" in value && (value as SidebarChildSlot).kind === SIDEBAR_DESKTOP);\nconst sidebarItemSlot = (value: unknown): value is SidebarItemSlot =>\n Boolean(\n value &&\n typeof value === \"object\" &&\n \"kind\" in value &&\n [SIDEBAR_ITEM_ICON, SIDEBAR_ITEM_LABEL, SIDEBAR_ITEM_META, SIDEBAR_ITEM_ACTION].includes((value as SidebarItemSlot).kind),\n );\nconst navTreeItemSlot = (value: unknown): value is NavTreeItemSlot =>\n Boolean(value && typeof value === \"object\" && \"kind\" in value && (value as NavTreeItemSlot).kind === NAV_TREE_ITEM);\n\nexport type AppWorkspaceHeadProps = {\n /** Below 48rem, show this head only with this active Main region. Unsplit Mains keep their head. */\n mobilePane?: string;\n /** View tabs, usually a ViewTabs. */\n views?: JSX.Element;\n /** Filter chips, usually FilterChip elements. */\n filters?: JSX.Element;\n /** Any filter is active: shows Reset and the quiet result count. */\n filtered?: boolean;\n /** Reset target while filtered: a URL (works without JavaScript) and/or a callback. */\n resetHref?: string;\n onReset?: () => void;\n /** Quiet result count shown only while filtered; CSS drops it first when space is short. */\n count?: JSX.Element;\n /** Secondary actions at the end of the row. Never a filled button. */\n actions?: JSX.Element;\n /** The one filled primary action. Below 48rem it becomes a round icon button beside the host's bottom bar. */\n primary?: { label: string; icon: string; href?: string; onClick?: (event: MouseEvent) => void };\n};\n\n/** Head row slot. Must be a direct child of AppWorkspace; its parts may be islands. */\nfunction AppWorkspaceHeadSlot(props: AppWorkspaceHeadProps): JSX.Element {\n return { kind: HEAD, props } satisfies HeadSlot as unknown as JSX.Element;\n}\n\ntype ResizeHandleProps = {\n kind: \"sidebar\" | \"pane\" | \"detail\" | \"drawer\";\n edge: \"start\" | \"end\";\n controls?: string;\n panelId?: string;\n defaultSize: number | AppWorkspaceWidthShare;\n minSize: number;\n maxSize: number;\n shadow?: boolean;\n label?: string;\n style?: JSX.CSSProperties;\n levelShown?: string;\n};\n\nfunction ResizeHandle(props: ResizeHandleProps): JSX.Element {\n const workspaceMessages = useWorkspaceMessages();\n const workspace = useContext(WorkspaceContext);\n const providerState = useContext(LayoutStateContext);\n const initialSize = () => {\n const state = workspace?.initialLayoutState() ?? providerState;\n const id = props.panelId ?? \"primary\";\n const size =\n props.kind === \"sidebar\"\n ? state?.sidebarCollapsed\n ? APP_WORKSPACE_SIDEBAR_COLLAPSED\n : state?.sidebarWidth\n : props.kind === \"pane\"\n ? state?.paneWidths?.[id]\n : props.kind === \"detail\"\n ? state?.detailWidths?.[id]\n : state?.drawerHeights?.[id];\n return Math.min(\n props.maxSize,\n Math.max(props.minSize, size ?? (typeof props.defaultSize === \"number\" ? props.defaultSize : props.defaultSize.min)),\n );\n };\n return (\n <button\n type=\"button\"\n class=\"k2b-app-workspace__resize\"\n role=\"separator\"\n aria-label={\n props.label ??\n (props.kind === \"sidebar\"\n ? workspaceMessages().resizeNavigation\n : props.kind === \"pane\"\n ? workspaceMessages().resizeWorkspacePane\n : props.kind === \"detail\"\n ? workspaceMessages().resizeDetailPanel\n : workspaceMessages().resizeBottomDrawer)\n }\n aria-controls={props.controls}\n aria-orientation={props.kind === \"drawer\" ? \"horizontal\" : \"vertical\"}\n aria-valuemin={props.minSize}\n aria-valuemax={props.maxSize}\n aria-valuenow={initialSize()}\n data-workspace-level-shown={props.levelShown}\n data-app-workspace-resize={props.kind}\n data-workspace-panel-id={props.panelId}\n data-workspace-resize-edge={props.edge}\n data-workspace-resize-shadow={props.shadow ? \"true\" : undefined}\n data-workspace-default-size={appWorkspaceWidthToken(props.defaultSize)}\n data-workspace-min-size={props.minSize}\n data-workspace-max-size={props.maxSize}\n style={props.style}\n >\n <span aria-hidden=\"true\" />\n </button>\n );\n}\n\nexport type AppWorkspaceProps = {\n children: JSX.Element;\n class?: string;\n /** A host with its own phone chrome can use the full canvas below 48rem (768 px). */\n mobileSurface?: \"contained\" | \"flush\";\n /** Removes the workspace's own border, radius, and shadow for an overview that is the page itself.\n * A host may frame the outermost workspace as its app card, as Cloud does from 1024 px on signed-in pages. */\n flat?: boolean;\n resizable?: boolean;\n /**\n * Restores a persisted layout when the workspace mounts. Persistence itself\n * stays app-owned — the package reads and writes nothing on its own — but\n * the resize handles work without it.\n */\n layoutState?: () => AppWorkspaceLayoutState | null | undefined;\n /** Called with the full layout whenever a resize settles. Persist it here. */\n onLayoutChange?: (state: AppWorkspaceLayoutState) => void;\n /**\n * `false` draws no head row. The application then shows the page's title itself and gives people the sidebar and\n * Detail buttons the head would hold: a control with `data-app-workspace-sidebar-toggle` (it opens the overlay\n * sidebar, and shows or hides a sidebar with `onHiddenChange` where it is a column) and, for each Detail with\n * `toggle={false}`, a control with `data-app-workspace-detail-toggle` and `aria-controls` set to\n * `appWorkspaceDetailElementId(id)`. The controller runs both and keeps their `aria-expanded` current.\n */\n head?: false;\n /**\n * Opt out of the built-in controller. Only needed when the application calls\n * `installAppWorkspaceController` itself — installing twice would double up\n * every listener.\n */\n controller?: false;\n};\nexport type AppWorkspaceLayoutStateProviderProps = {\n children: JSX.Element;\n state: AppWorkspaceLayoutState | null | undefined;\n};\nexport type AppWorkspaceContentProps = { children: JSX.Element; class?: string };\nexport type AppWorkspaceMainProps = {\n children: JSX.Element;\n class?: string;\n /** `\"content\"` centers the children as one reading column with the shared page width on large screens. */\n width?: \"full\" | \"content\";\n /**\n * The width in px or a workspace width share that Main keeps beside the sidebar and an open Detail,\n * from 48rem (768 px); at least the default 320. A Detail that does not fit\n * beside it waits behind the head's Details button, and from 64rem of host\n * width a sidebar that does not fit becomes the overlay. CSS decides, so\n * the server renders the first frame.\n */\n minWidth?: number | AppWorkspaceWidthShare;\n mobilePane?: string;\n /** Levels in DOM order, shallowest first. The URL selects the deepest level by id. */\n level?: string;\n /** Enhanced navigation for the back step; otherwise it is a document link. */\n onLevelNavigate?: (event: LinkNavigateEvent) => void | Promise<void>;\n scroll?: boolean;\n scrollFade?: boolean;\n scrollPreserveKey?: string | false;\n \"aria-busy\"?: boolean | \"true\" | \"false\";\n};\nexport type AppWorkspaceMainPaneProps = {\n id: string;\n label: string;\n /** Levels mode: URL selecting this level. Required except on the last level. */\n href?: string;\n /** Quiet one-line text below the level title. */\n description?: JSX.Element;\n /** Levels mode: a small mark before the level title, such as the colour dot of the object's container. */\n lead?: JSX.Element;\n /** Controls at the end of the level head. */\n actions?: JSX.Element;\n surface?: \"default\" | \"navigation\";\n open?: boolean;\n resizable?: boolean;\n resizeShadow?: boolean;\n defaultSize?: number | AppWorkspaceWidthShare;\n /**\n * The narrowest width in px, also for a person resizing it. Levels mode: the level needs it to be shown; when the\n * deepest levels do not fit side by side at their minimum widths, the shallowest of them gives way, so a wide list\n * pushes earlier columns aside.\n */\n minSize?: number;\n maxSize?: number;\n class?: string;\n scroll?: boolean;\n scrollFade?: boolean;\n children: JSX.Element;\n};\nexport type AppWorkspaceDetailWidth = \"sm\" | \"md\" | \"lg\" | \"xl\";\nexport type AppWorkspaceDetailProps = {\n children: JSX.Element;\n open: boolean;\n /** Keeps the shared head control reachable while closed; set the app's existing open state synchronously. */\n onOpen?: () => void;\n /**\n * `false` draws no Details button of the workspace's own: the application gives one with\n * `data-app-workspace-detail-toggle` and `aria-controls` set to `appWorkspaceDetailElementId(id)`, as with\n * `AppWorkspace head={false}`.\n */\n toggle?: false;\n /** Whether the current object may show details. False disables reopening and hides the panel. */\n available?: boolean;\n /**\n * Whether choosing an item in Main opens this Detail as the drawer while it waits.\n * Set false when Main itself shows the chosen item, such as a reader beside a list:\n * the drawer then opens only from Details or from a toggle in Main.\n */\n openOnChoice?: boolean;\n id: string;\n class?: string;\n width?: AppWorkspaceDetailWidth;\n /** Below 48rem, a full page without sheet gestures for a destination such as chat info; defaults to \"sheet\". */\n phone?: \"sheet\" | \"page\";\n viewTransitionName?: string;\n resizable?: boolean;\n minWidth?: number;\n maxWidth?: number;\n /**\n * Closes the column with Escape, or the phone sheet with a downward drag.\n * With onOpen, the shared head control also closes the column or phone sheet.\n * Server-rendered panels mark their close control with\n * `data-workspace-detail-close` instead; those gestures click it.\n * Escape and a rightward touch swipe park an open waiting drawer without\n * calling onClose, so its Details button can open it again.\n */\n onClose?: () => void;\n /**\n * Shows the previous (`-1`) or next (`1`) item; J and K call it while the\n * panel is open. Return the Main element that now shows the selection,\n * usually its link: Escape and F6 then go there, and the workspace reveals\n * it beside the panel or above the phone sheet. Returning nothing keeps the\n * previous item.\n */\n onStep?: (direction: 1 | -1) => HTMLElement | null | undefined | void;\n};\nexport type AppWorkspaceBottomDrawerHeight = \"sm\" | \"md\" | \"lg\";\nexport type AppWorkspaceBottomDrawerProps = {\n children: JSX.Element;\n open: boolean;\n id: string;\n class?: string;\n height?: AppWorkspaceBottomDrawerHeight;\n minHeight?: number;\n maxHeight?: number;\n viewTransitionName?: string;\n resizable?: boolean;\n};\nexport type AppWorkspaceSidebarProps = {\n /** Stable element id, for a toggle elsewhere that names the sidebar in `aria-controls`. */\n id?: string;\n label?: string;\n children: JSX.Element;\n class?: string;\n /**\n * Below 48rem (768 px) the sidebar is hidden and the host's mobile\n * navigation takes over; from 48 to 64rem it is an overlay that a button in\n * the workspace's head opens. `\"stacked\"` is for overviews whose sidebar is\n * the primary object list: below 64rem its items become one row of chips\n * above the content, and \"All\" at the end of the row opens the complete\n * sidebar in a sheet (a centered dialog from 48rem). From 64rem it is the\n * regular sidebar column; the element is a `nav` landmark either way.\n */\n mobile?: \"hidden\" | \"stacked\";\n resizable?: boolean;\n resizeShadow?: boolean;\n collapsible?: boolean;\n defaultSize?: number;\n minSize?: number;\n maxSize?: number;\n /**\n * Hides the desktop navigation completely: the sidebar renders none of its\n * children and no resize handle, and main panes with `surface=\"navigation\"`\n * hide with it. The state is application-owned, like a persisted layout.\n */\n hidden?: boolean;\n /**\n * Makes the sidebar hideable by dragging its resize handle below half its\n * minimum width. The controller then requests `true`; showing it again is\n * the application's control.\n */\n onHiddenChange?: (hidden: boolean) => void;\n};\nexport type AppWorkspaceSidebarVisibility = \"always\" | \"expanded\" | \"collapsed\";\nexport type AppWorkspaceSidebarAccessoryVisibility = \"always\" | \"hover\";\ntype AppWorkspaceSidebarContentProps = {\n children: JSX.Element;\n class?: string;\n scrollPreserveKey?: string | false;\n sidebarMode?: AppWorkspaceSidebarVisibility;\n};\nexport type AppWorkspaceSidebarBodyProps = AppWorkspaceSidebarContentProps & { scrollFade?: boolean };\nexport type AppWorkspaceSidebarSectionProps = AppWorkspaceSidebarContentProps & {\n title?: string;\n icon?: string;\n count?: number;\n collapsible?: boolean;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n actions?: JSX.Element;\n};\nexport type AppWorkspaceSidebarItemTone = \"default\" | \"success\" | \"danger\";\nexport type AppWorkspaceSidebarIconActionTone = \"default\" | \"success\" | \"danger\";\nexport type AppWorkspaceSidebarItemProps = {\n children: JSX.Element;\n /**\n * Card rows add a quiet context header above the main label. Object rows\n * present one resource with a title, a description line, and stacked\n * trailing counts; use them for the objects an overview navigates into.\n */\n variant?: \"row\" | \"card\" | \"object\";\n context?: JSX.Element;\n contextMeta?: JSX.Element;\n /** Passive second line; keep controls in actions or preview. */\n description?: JSX.Element;\n /**\n * A third line with the one fact about the row that needs attention, such as \"3 deliveries failed\". `noteTone`\n * colours it; the words carry the meaning, the colour only repeats it.\n */\n note?: JSX.Element;\n noteTone?: \"neutral\" | \"warning\" | \"danger\";\n /** Interactive details, also reachable through a dedicated button. */\n preview?: {\n label: string;\n content: JSX.Element | ((close: () => void) => JSX.Element);\n trigger?: \"action\" | \"row\";\n align?: \"center\" | \"end\";\n viewportSize?: ScrollAreaProps[\"viewportSize\"];\n onOpenChange?: (open: boolean) => void;\n };\n href?: string;\n /** Document navigation by default; opt into enhanced navigation only when the owning island applies the target state. */\n navigation?: \"enhanced\" | \"document\";\n replace?: boolean;\n scroll?: NavigationScrollMode;\n onNavigate?: (event: LinkNavigateEvent) => void | Promise<void>;\n onClick?: (event: MouseEvent) => void;\n /**\n * Marks the current page (`aria-current=\"page\"`). On a page deeper than the\n * sidebar lists, pass `\"ancestor\"` for the item that contains it: it keeps\n * the highlight, and the page keeps its back link.\n */\n active?: boolean | \"ancestor\";\n activeClass?: string;\n disabled?: boolean;\n icon?: string;\n meta?: JSX.Element;\n metaVisibility?: AppWorkspaceSidebarAccessoryVisibility;\n actions?: JSX.Element;\n tone?: AppWorkspaceSidebarItemTone;\n title?: string;\n viewTransitionName?: string;\n class?: string;\n depth?: number;\n actionIcon?: string;\n actionLabel?: string;\n onActionClick?: (event: MouseEvent) => void;\n data?: Record<string, string | number | boolean | null | undefined>;\n sidebarMode?: AppWorkspaceSidebarVisibility;\n};\nexport type AppWorkspaceSidebarIconGridProps = AppWorkspaceSidebarContentProps & { title?: string; columns?: 2 | 3 };\nexport type AppWorkspaceSidebarIconActionProps = {\n href?: string | null;\n /** Document navigation by default; opt into enhanced navigation only when the owning island applies the target state. */\n navigation?: \"enhanced\" | \"document\";\n replace?: boolean;\n scroll?: NavigationScrollMode;\n onNavigate?: (event: LinkNavigateEvent) => void | Promise<void>;\n icon: string;\n label: string;\n active?: boolean;\n disabled?: boolean;\n tone?: AppWorkspaceSidebarIconActionTone;\n viewTransitionName?: string;\n onClick?: (event: MouseEvent) => void;\n sidebarMode?: AppWorkspaceSidebarVisibility;\n};\nexport type AppWorkspaceSidebarItemIconProps = { icon?: string; children?: JSX.Element };\nexport type AppWorkspaceSidebarItemLabelProps = {\n children: JSX.Element;\n /** False keeps one line that fades out; rows wrap long labels onto a second line by default. */\n marquee?: boolean;\n};\nexport type AppWorkspaceSidebarItemMetaProps = {\n children: JSX.Element;\n visibility?: AppWorkspaceSidebarAccessoryVisibility;\n};\nexport type AppWorkspaceSidebarItemActionProps = {\n icon?: string;\n label: string;\n disabled?: boolean;\n /** Hide the action on fine pointers until the row is hovered or keyboard-focused. */\n visibility?: AppWorkspaceSidebarAccessoryVisibility;\n href?: string;\n navigation?: \"enhanced\" | \"document\";\n onSelect?: (event: MouseEvent) => void;\n children?: JSX.Element;\n};\nexport type AppWorkspaceSidebarItemActionsProps = {\n children: JSX.Element;\n visibility?: AppWorkspaceSidebarAccessoryVisibility;\n};\n/**\n * Unread state for the trailing `meta` slot. Every mark keeps a fixed width,\n * so the row keeps its height and the label its start in every state.\n */\nexport type AppWorkspaceSidebarItemStatusProps = {\n /**\n * A positive number shows a count (above 99 as \"99+\") and sets the label in\n * a stronger weight; `true` shows a quiet dot for new activity that should\n * not draw attention, such as in a muted conversation.\n */\n unread?: number | boolean;\n /** Marks unread items that mention the person with \"@\". */\n mention?: boolean;\n /**\n * Shows a muted bell, and the item reads as set aside: its label in the muted ink without unread weight, and a\n * mention count without its fill.\n */\n muted?: boolean;\n /**\n * Items that wait for the person, such as requests to approve, in the unread slot instead of `unread`. `label` is\n * the phrase a screen reader hears, for example \"3 waiting\". `0` stays as a muted count, for a count that dropped\n * to zero while the row is still shown; leave the prop out when nothing waits.\n */\n waiting?: { count: number; label: string };\n};\nexport type AppWorkspaceNavTreeProps = {\n children: JSX.Element;\n ariaLabel: string;\n selectedId?: string | null;\n expandedIds?: readonly string[];\n defaultExpandedIds?: readonly string[];\n onSelectedIdChange?: (id: string) => void;\n onExpandedIdsChange?: (ids: readonly string[]) => void;\n indented?: boolean;\n /**\n * Lets people reorder `movable` items among their siblings: by dragging on\n * fine pointers and with Alt+ArrowUp/ArrowDown on a focused item. The tree\n * only reports the requested place; the application saves it and renders\n * the new order, and the tree then keeps focus on the moved item.\n */\n onMove?: (move: AppWorkspaceNavTreeMove) => void;\n class?: string;\n};\n/** One requested place for an item among its unchanged siblings. */\nexport type AppWorkspaceNavTreeMove = {\n id: string;\n /** The parent item, unchanged by the move; `null` on the top level. */\n parentId: string | null;\n /** The sibling the item now precedes; `null` when it becomes the last. */\n beforeId: string | null;\n /** The sibling the item now follows; `null` when it becomes the first. */\n afterId: string | null;\n};\nexport type AppWorkspaceNavTreeItemProps = {\n id: string;\n label: JSX.Element;\n /** Passive second line under the label, such as a date; keep controls in actions. */\n description?: JSX.Element;\n children?: JSX.Element;\n href?: string;\n /** Document navigation by default; opt into enhanced navigation only when the owning island applies the target state. */\n navigation?: \"enhanced\" | \"document\";\n replace?: boolean;\n scroll?: NavigationScrollMode;\n onNavigate?: (event: LinkNavigateEvent) => void | Promise<void>;\n onSelect?: (event: MouseEvent) => void;\n disabled?: boolean;\n icon?: string;\n /** Names a meaningful icon for screen readers, such as \"Homepage\"; without it the icon is decorative. */\n iconLabel?: string;\n /** Replaces `icon` while this branch is expanded and makes the icon the disclosure target. */\n expandedIcon?: string;\n meta?: JSX.Element;\n metaVisibility?: AppWorkspaceSidebarAccessoryVisibility;\n actions?: JSX.Element;\n tone?: AppWorkspaceSidebarItemTone;\n title?: string;\n viewTransitionName?: string;\n class?: string;\n /** With the tree's `onMove`, the item can change its place among its siblings. Other items keep theirs, and no item moves past them. */\n movable?: boolean;\n /**\n * Shows the item as a branch before its children are rendered, for a tree that loads a branch when it opens. The\n * application renders the children, or a row that says they load, once the item is expanded.\n */\n hasChildren?: boolean;\n onDragEnter?: JSX.EventHandlerUnion<HTMLDivElement, DragEvent>;\n onDragOver?: JSX.EventHandlerUnion<HTMLDivElement, DragEvent>;\n onDragLeave?: JSX.EventHandlerUnion<HTMLDivElement, DragEvent>;\n onDrop?: JSX.EventHandlerUnion<HTMLDivElement, DragEvent>;\n};\ntype AppWorkspaceNavTreeComponent = ((props: AppWorkspaceNavTreeProps) => JSX.Element) & {\n Item: (props: AppWorkspaceNavTreeItemProps) => JSX.Element;\n};\n\nconst modeAttrs = (mode?: AppWorkspaceSidebarVisibility) => (mode && mode !== \"always\" ? { \"data-sidebar-mode\": mode } : {});\n/** Same rule as `modeAttrs`, for the un-prefixed `data` bag on sidebar items. */\nconst modeData = (mode?: AppWorkspaceSidebarVisibility) => (mode && mode !== \"always\" ? { \"sidebar-mode\": mode } : {});\nconst scrollAttrs = (key?: string | false) => (key ? { \"data-scroll-preserve\": key } : {});\nconst iconClass = (icon: string | undefined, fallback = \"ti-circle\") => (icon?.startsWith(\"ti \") ? icon : `ti ${icon || fallback}`);\n/** A named icon is an image screen readers announce; any other icon is decoration. */\nconst iconAccessibility = (label: string | undefined) => (label ? { role: \"img\" as const, \"aria-label\": label } : { \"aria-hidden\": true });\n\nfunction AppWorkspaceMainPane(props: AppWorkspaceMainPaneProps): JSX.Element {\n return {\n kind: MAIN_PANE,\n props,\n domId: `k2b-workspace-pane-${createUniqueId()}`,\n } satisfies MainPaneSlot as unknown as JSX.Element;\n}\n\n/** A level's head; `children` is its back step. It mounts and cleans up with its open pane. */\nfunction LevelHead(props: {\n label: string;\n description?: JSX.Element;\n actions?: JSX.Element;\n lead?: JSX.Element;\n children: JSX.Element;\n}): JSX.Element {\n // Read each slot once: every read of a JSX prop builds it again, and the\n // server and the client would then disagree on hydration keys.\n const description = children(() => props.description);\n const actions = children(() => props.actions);\n const lead = children(() => props.lead);\n return (\n <header class=\"k2b-app-workspace__level-head\">\n {props.children}\n <div class=\"k2b-app-workspace__level-title\">\n <h2 tabIndex={-1}>\n <Show when={lead()}>\n <span class=\"k2b-app-workspace__level-lead\">{lead()}</span>\n </Show>\n <span class=\"k2b-truncate-fade\">{props.label}</span>\n </h2>\n <Show when={description()}>\n <p class=\"k2b-truncate-fade\">{description()}</p>\n </Show>\n </div>\n <Show when={actions()}>\n <div class=\"k2b-app-workspace__level-actions\">{actions()}</div>\n </Show>\n </header>\n );\n}\n\nfunction AppWorkspaceMain(props: AppWorkspaceMainProps): JSX.Element {\n const rootResizable = useContext(ResizeContext);\n const workspaceMessages = useWorkspaceMessages();\n const levelsMode = createMemo(() => props.level !== undefined);\n const resolved = children(() => props.children);\n const values = createMemo(() => {\n const all = flatten(resolved());\n if (levelsMode() && all.some((value) => !mainPaneSlot(value))) {\n throw new Error(\"AppWorkspace.Main level requires only AppWorkspace.MainPane children.\");\n }\n return all;\n });\n const paneIds = createMemo(() => {\n const ids = values()\n .filter(mainPaneSlot)\n .map((slot) => slot.props.id);\n assertUniqueStableUiIds(ids, \"AppWorkspace.MainPane id\");\n return ids;\n });\n const regions = createMemo(() => {\n const all = values();\n const primary = all.filter((value) => !mainPaneSlot(value));\n const primaryIndex = all.findIndex((value) => !mainPaneSlot(value));\n let inserted = false;\n const result: Array<{ type: \"primary\"; index: number; children: unknown[] } | { type: \"pane\"; index: number; slot: MainPaneSlot }> = [];\n all.forEach((value, index) => {\n if (mainPaneSlot(value)) {\n result.push({ type: \"pane\", index, slot: value });\n } else if (!inserted) {\n inserted = true;\n result.push({ type: \"primary\", index: primaryIndex, children: primary });\n }\n });\n return result;\n });\n const levels = createMemo(() => {\n const open = values()\n .filter(mainPaneSlot)\n .filter((slot) => slot.props.open !== false);\n if (levelsMode()) {\n for (const pane of open.slice(0, -1)) {\n if (!pane.props.href) throw new Error(`AppWorkspace.MainPane \"${pane.props.id}\" requires href before the last level.`);\n }\n }\n return open;\n });\n const depth = () => Math.max(1, levels().findIndex((pane) => pane.props.id === props.level) + 1);\n /** How many of the deepest levels a width class shows: up to its count, as long as their minimum widths fit. */\n const levelCount = (widthClass: 1 | 2 | 3) => {\n const all = levels();\n let count = Math.min(widthClass, all.length);\n while (count > 1) {\n const end = Math.max(depth(), count);\n const needed = all\n .slice(end - count, end)\n .reduce(\n (sum, pane, offset) =>\n sum + (end - count + offset + 1 === end ? levelLastMin(pane.props.minSize) : (pane.props.minSize ?? APP_WORKSPACE_PANE_MIN)),\n 0,\n );\n if (needed <= LEVEL_CLASS_WIDTH[widthClass]) break;\n count--;\n }\n return count;\n };\n const levelClasses = (index: number, kind: \"shown\" | \"first\" | \"last\" | \"handle\") =>\n ([1, 2, 3] as const)\n .filter((widthClass) => {\n const count = levelCount(widthClass);\n const end = Math.max(depth(), count);\n const start = end - count + 1;\n return kind === \"first\"\n ? index === start && index > 1\n : kind === \"last\"\n ? index === end\n : kind === \"handle\"\n ? index >= start && index + 1 <= end\n : index >= start && index <= end;\n })\n .join(\" \");\n const anchorRegion = createMemo(\n () =>\n (levelsMode() ? regions().find((candidate) => candidate.type === \"pane\" && candidate.slot === levels().at(-1)) : undefined) ??\n regions().find((candidate) => candidate.type === \"primary\") ??\n regions().find((candidate) => candidate.type === \"pane\" && candidate.slot.props.open !== false),\n );\n // A level change can hide the control that made it: the back step, or a row\n // of a list that a phone no longer shows. Focus then moves to the title of\n // the selected level, so keyboard and screen reader users keep their place.\n // The back step to the first level unmounts, and focus has left with it by\n // the time the level changes, so pressing it is remembered.\n let mainElement: HTMLDivElement | undefined;\n let backStepFocused = false;\n const navigateBack = (event: LinkNavigateEvent) => {\n backStepFocused = Boolean(mainElement?.contains(document.activeElement));\n return props.onLevelNavigate?.(event);\n };\n createEffect(\n on(\n () => (levelsMode() ? depth() : 0),\n (current) => {\n const pressedBack = backStepFocused;\n backStepFocused = false;\n const focused = document.activeElement;\n if (!current || !mainElement) return;\n const lost = pressedBack && (!focused || focused === document.body);\n const hidden = focused instanceof HTMLElement && mainElement.contains(focused) && focused.getClientRects().length === 0;\n if (!lost && !hidden) return;\n mainElement\n .querySelector<HTMLElement>(`:scope > [data-workspace-level=\"${current}\"] > .k2b-app-workspace__level-head h2`)\n ?.focus({ preventScroll: true });\n },\n { defer: true },\n ),\n );\n // Presence of a MainPane slot — not of an *open* one — decides the split\n // layout. Deriving it from `regions()` made a workspace whose panes are all\n // closed fall back to `resolved()`, which renders the raw slot objects.\n const hasPanes = createMemo(() => paneIds().length > 0);\n // The workspace's tracks and queries read Main's minimum on the workspace\n // itself, which cannot read Main's own variables, so this rule hands it up,\n // as `AppWorkspace.Detail` does with its width.\n const minWidth = () => {\n const value = props.minWidth;\n return isAppWorkspaceWidthShare(value)\n ? value\n : typeof value === \"number\" && Number.isFinite(value) && value > APP_WORKSPACE_MAIN_MIN\n ? Math.round(value)\n : undefined;\n };\n const minWidthRule = (value: number | AppWorkspaceWidthShare) => {\n const main = `.k2b-app-workspace__main[data-workspace-main-min=\"${appWorkspaceWidthToken(value)}\"]`;\n const inverse =\n typeof value === \"number\"\n ? \"\"\n : `;--k2b-workspace-main-min-grid:${appWorkspaceInverseWidthCss(value, \"100%\")};--k2b-workspace-main-min-cq:${appWorkspaceInverseWidthCss(value, \"100cqi\")}`;\n return `.k2b-app-workspace:has(> .k2b-app-workspace__content > ${main}, > .k2b-app-workspace__content > :is(solid-island, solid-client) > ${main}){--k2b-workspace-main-min:${appWorkspaceWidthCss(value, \"100%\")}${inverse}}`;\n };\n\n return (\n <>\n <Show when={minWidth()}>{(value) => <style innerHTML={minWidthRule(value())} />}</Show>\n <div\n ref={mainElement}\n class={`k2b-app-workspace__main ${hasPanes() ? \"has-panes\" : \"\"} ${props.class ?? \"\"}`}\n data-workspace-main-min={minWidth() === undefined ? undefined : appWorkspaceWidthToken(minWidth()!)}\n data-workspace-levels={levelsMode() ? \"\" : undefined}\n data-workspace-level-count={levelsMode() ? levels().length : undefined}\n data-mobile-pane={levelsMode() ? undefined : props.mobilePane}\n data-width={props.width === \"content\" ? \"content\" : undefined}\n data-scroll-fade-mode={!hasPanes() && props.scroll !== false && props.scrollFade !== false ? \"both\" : undefined}\n data-scroll={props.scroll === false ? \"false\" : undefined}\n aria-busy={props[\"aria-busy\"]}\n {...scrollAttrs(props.scrollPreserveKey)}\n >\n <Show when={hasPanes()} fallback={resolved() as JSX.Element}>\n <For each={regions()}>\n {(region) => {\n const activeMobilePane = () => {\n const anchor = anchorRegion();\n return props.mobilePane ?? (anchor?.type === \"pane\" ? anchor.slot.props.id : \"main\");\n };\n if (region.type === \"primary\") {\n return (\n <div\n class=\"k2b-app-workspace__main-primary\"\n data-workspace-main-region=\"main\"\n data-workspace-mobile-active={activeMobilePane() === \"main\" ? \"true\" : \"false\"}\n >\n {region.children as JSX.Element}\n </div>\n );\n }\n const pane = region.slot;\n const levelIndex = () => levels().indexOf(pane) + 1;\n const levelAttr = (kind: \"shown\" | \"first\" | \"last\" | \"handle\") =>\n levelsMode() ? levelClasses(levelIndex(), kind) : undefined;\n const panelId = assertStableUiId(pane.props.id, \"AppWorkspace.MainPane id\");\n const variable = appWorkspacePanelVariable(\"pane\", panelId);\n const isAnchor = () => region === anchorRegion();\n const resizable = () => !isAnchor() && (pane.props.resizable ?? rootResizable);\n const defaultSize = () => {\n const value = pane.props.defaultSize;\n return typeof value === \"number\" || isAppWorkspaceWidthShare(value) ? value : APP_WORKSPACE_PANE_DEFAULT;\n };\n const minSize = () => pane.props.minSize ?? APP_WORKSPACE_PANE_MIN;\n const maxSize = () => Math.max(minSize(), pane.props.maxSize ?? APP_WORKSPACE_PANE_MAX);\n const before = () => levelsMode() || region.index < (anchorRegion()?.index ?? 0);\n const handle = () => (\n <ResizeHandle\n kind=\"pane\"\n levelShown={levelAttr(\"handle\")}\n edge={before() ? \"end\" : \"start\"}\n controls={pane.domId}\n panelId={panelId}\n defaultSize={defaultSize()}\n minSize={minSize()}\n maxSize={maxSize()}\n shadow={pane.props.resizeShadow !== false}\n label={`Resize ${pane.props.label}`}\n />\n );\n return (\n <Show when={pane.props.open !== false}>\n <Show when={resizable() && !before()}>{handle()}</Show>\n <section\n id={pane.domId}\n class={`k2b-app-workspace__main-pane ${isAnchor() ? \"is-primary\" : \"\"} ${pane.props.class ?? \"\"}`}\n aria-label={pane.props.label}\n data-workspace-level={levelsMode() ? levelIndex() : undefined}\n data-workspace-level-shown={levelAttr(\"shown\")}\n data-workspace-level-first={levelAttr(\"first\")}\n data-workspace-level-last={levelAttr(\"last\")}\n data-workspace-main-region={pane.props.id}\n data-workspace-mobile-active={\n (levelsMode() ? levelClasses(levelIndex(), \"shown\").split(\" \").includes(\"1\") : activeMobilePane() === pane.props.id)\n ? \"true\"\n : \"false\"\n }\n data-workspace-panel-id={panelId}\n data-workspace-resizable={resizable() ? \"true\" : \"false\"}\n data-surface={pane.props.surface === \"navigation\" ? \"navigation\" : undefined}\n data-scroll={!levelsMode() && pane.props.scroll === false ? \"false\" : undefined}\n data-scroll-fade-mode={\n !levelsMode() && pane.props.scroll !== false && pane.props.scrollFade !== false ? \"both\" : undefined\n }\n style={nonEmptyStyle({\n ...(isAnchor()\n ? {}\n : {\n // A stored width keeps to this pane's limits before the controller attaches.\n \"--k2b-workspace-panel-size\": `clamp(${minSize()}px, var(${variable}, ${appWorkspaceWidthCss(defaultSize(), \"var(--k2b-workspace-width)\")}), ${maxSize()}px)`,\n \"--k2b-workspace-panel-min\": `${minSize()}px`,\n }),\n // The last shown level fills the rest, but never below its minimum; set on every level, so a workspace\n // nested in a wide level does not inherit that minimum.\n ...(levelsMode() ? { \"--k2b-workspace-level-min\": `${levelLastMin(pane.props.minSize)}px` } : {}),\n })}\n >\n {levelsMode() ? (\n <>\n <LevelHead\n label={pane.props.label}\n description={pane.props.description}\n actions={pane.props.actions}\n lead={pane.props.lead}\n >\n <Show when={levelIndex() > 1 && depth() > 1}>\n <IconButtonLink\n class=\"k2b-app-workspace__level-back\"\n href={levels()[depth() - 2]?.props.href}\n label={workspaceMessages().backTo({ page: levels()[levelIndex() - 2]?.props.label ?? \"\" })}\n navigation={props.onLevelNavigate ? \"enhanced\" : \"document\"}\n onNavigate={props.onLevelNavigate ? navigateBack : undefined}\n >\n <i class=\"ti ti-chevron-left\" aria-hidden=\"true\" />\n </IconButtonLink>\n </Show>\n </LevelHead>\n <div\n class=\"k2b-app-workspace__level-body\"\n data-scroll={pane.props.scroll === false ? \"false\" : undefined}\n data-scroll-fade-mode={pane.props.scroll !== false && pane.props.scrollFade !== false ? \"both\" : undefined}\n >\n {pane.props.children}\n </div>\n </>\n ) : (\n pane.props.children\n )}\n </section>\n <Show when={resizable() && before()}>{handle()}</Show>\n </Show>\n );\n }}\n </For>\n </Show>\n </div>\n </>\n );\n}\n\n/** The Detail region's DOM id, for application controls that target it with aria-controls. */\nexport const appWorkspaceDetailElementId = (id: string): string => `k2b-workspace-detail-${assertStableUiId(id, \"AppWorkspace.Detail id\")}`;\n\nfunction AppWorkspaceDetail(props: AppWorkspaceDetailProps): JSX.Element {\n const workspaceMessages = useWorkspaceMessages();\n const rootResizable = useContext(ResizeContext);\n const panelId = () => assertStableUiId(props.id, \"AppWorkspace.Detail id\");\n const domId = () => appWorkspaceDetailElementId(props.id);\n const variable = () => appWorkspacePanelVariable(\"detail\", panelId());\n // Start widths of 20, 26, 30, and 34 rem. They feed `aria-valuenow` and the\n // `var(…, Npx)` first-paint fallback, so they are behaviour, not taste.\n const widths = { sm: 320, md: 416, lg: 480, xl: 544 };\n const defaultWidth = () => widths[props.width ?? \"md\"] ?? APP_WORKSPACE_DETAIL_DEFAULT;\n const minWidth = () => props.minWidth ?? APP_WORKSPACE_DETAIL_MIN;\n const maxWidth = () => Math.max(minWidth(), props.maxWidth ?? APP_WORKSPACE_DETAIL_MAX);\n const resizable = () => props.resizable ?? rootResizable;\n const size = () => (resizable() ? `var(${variable()}, ${defaultWidth()}px)` : `${defaultWidth()}px`);\n const sizeStyle = () => ({\n \"--k2b-workspace-panel-size\": size(),\n \"--k2b-workspace-panel-min\": `${minWidth()}px`,\n \"--k2b-workspace-panel-max\": `${maxWidth()}px`,\n });\n // An open panel takes a column at the workspace's end, sized in CSS alone,\n // so a server-rendered page arrives in its final geometry. The workspace\n // cannot read the panel's own variables, so this rule hands the open\n // panel's size to its workspace.\n const workspaceRule = () => {\n const open = `#${domId()}:not([hidden])`;\n return `.k2b-app-workspace:has(> .k2b-app-workspace__content > ${open}, > .k2b-app-workspace__content > :is(solid-island, solid-client) > ${open}){--k2b-detail-size:${size()};--k2b-detail-min:${minWidth()}px;--k2b-detail-max:${maxWidth()}px}`;\n };\n let aside: HTMLElement | undefined;\n onMount(() => {\n const close = () => props.onClose?.();\n const open = () => {\n if (props.available !== false) props.onOpen?.();\n };\n const isStep = (detail: unknown): detail is AppWorkspaceDetailStep =>\n typeof detail === \"object\" && detail !== null && \"direction\" in detail && (detail.direction === 1 || detail.direction === -1);\n const step = (event: Event) => {\n if (!(event instanceof CustomEvent) || !isStep(event.detail)) return;\n const item = props.onStep?.(event.detail.direction);\n if (item instanceof HTMLElement) event.detail.item = item;\n };\n aside?.addEventListener(APP_WORKSPACE_DETAIL_OPEN_EVENT, open);\n aside?.addEventListener(APP_WORKSPACE_DETAIL_CLOSE_EVENT, close);\n aside?.addEventListener(APP_WORKSPACE_DETAIL_STEP_EVENT, step);\n onCleanup(() => {\n aside?.removeEventListener(APP_WORKSPACE_DETAIL_OPEN_EVENT, open);\n aside?.removeEventListener(APP_WORKSPACE_DETAIL_CLOSE_EVENT, close);\n aside?.removeEventListener(APP_WORKSPACE_DETAIL_STEP_EVENT, step);\n });\n });\n return (\n <>\n <style innerHTML={workspaceRule()} />\n <Show when={props.toggle !== false}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n aria-controls={domId()}\n aria-expanded=\"false\"\n data-app-workspace-detail-toggle=\"\"\n data-workspace-detail-reopen={props.onOpen ? \"true\" : undefined}\n disabled={props.available === false}\n class=\"k2b-app-workspace__detail-toggle\"\n >\n <i class=\"ti ti-layout-sidebar-right\" aria-hidden=\"true\" />\n {workspaceMessages().details}\n </Button>\n </Show>\n <Show when={resizable()}>\n <ResizeHandle\n kind=\"detail\"\n edge=\"start\"\n controls={domId()}\n panelId={panelId()}\n defaultSize={defaultWidth()}\n minSize={minWidth()}\n maxSize={maxWidth()}\n shadow\n style={sizeStyle()}\n />\n </Show>\n <aside\n ref={aside}\n id={domId()}\n class={`k2b-app-workspace__detail ${props.class ?? \"\"}`}\n data-width={props.width ?? \"md\"}\n data-workspace-detail-phone={props.phone === \"page\" ? \"page\" : undefined}\n data-workspace-detail-choice={props.openOnChoice === false ? \"request\" : undefined}\n data-workspace-panel-id={panelId()}\n data-workspace-resizable={resizable() ? \"true\" : \"false\"}\n data-workspace-detail-reopen={props.onOpen ? \"true\" : undefined}\n data-workspace-detail-closable={props.onClose ? \"true\" : undefined}\n data-workspace-detail-steppable={props.onStep ? \"true\" : undefined}\n hidden={!props.open || props.available === false}\n style={{ ...sizeStyle(), \"view-transition-name\": props.viewTransitionName }}\n >\n {/* Only the phone sheet shows the grabber: a tap switches between half and full height. */}\n <button\n type=\"button\"\n class=\"k2b-app-workspace__detail-grabber\"\n aria-label={workspaceMessages().detailFullHeight}\n aria-pressed=\"false\"\n >\n <span aria-hidden=\"true\" />\n </button>\n {props.children}\n </aside>\n </>\n );\n}\n\nfunction AppWorkspaceBottomDrawer(props: AppWorkspaceBottomDrawerProps): JSX.Element {\n const rootResizable = useContext(ResizeContext);\n const panelId = () => assertStableUiId(props.id, \"AppWorkspace.BottomDrawer id\");\n const domId = () => `k2b-workspace-drawer-${panelId()}`;\n const variable = () => appWorkspacePanelVariable(\"drawer\", panelId());\n // Cloud's `drawerDefaultHeight`.\n const heights = { sm: 192, md: 240, lg: 320 };\n const defaultHeight = () => heights[props.height ?? \"md\"] ?? APP_WORKSPACE_DRAWER_DEFAULT;\n const minHeight = () => props.minHeight ?? APP_WORKSPACE_DRAWER_MIN;\n const maxHeight = () => Math.max(minHeight(), props.maxHeight ?? APP_WORKSPACE_DRAWER_MAX);\n const resizable = () => props.resizable ?? rootResizable;\n return (\n <>\n <Show when={resizable()}>\n <ResizeHandle\n kind=\"drawer\"\n edge=\"start\"\n controls={domId()}\n panelId={panelId()}\n defaultSize={defaultHeight()}\n minSize={minHeight()}\n maxSize={maxHeight()}\n shadow\n style={{ \"--k2b-workspace-panel-size\": `var(${variable()}, ${defaultHeight()}px)` }}\n />\n </Show>\n <aside\n id={domId()}\n class={`k2b-app-workspace__drawer ${props.class ?? \"\"}`}\n data-height={props.height ?? \"md\"}\n data-workspace-panel-id={panelId()}\n data-workspace-resizable={resizable() ? \"true\" : \"false\"}\n hidden={!props.open}\n style={{\n \"--k2b-workspace-panel-size\": `var(${variable()}, ${defaultHeight()}px)`,\n \"view-transition-name\": props.viewTransitionName,\n }}\n >\n {props.children}\n </aside>\n </>\n );\n}\n\nfunction AppWorkspaceSidebar(props: AppWorkspaceSidebarProps): JSX.Element {\n const rootResizable = useContext(ResizeContext);\n const resizable = () => props.resizable ?? rootResizable;\n const defaultSize = () => props.defaultSize ?? APP_WORKSPACE_SIDEBAR_DEFAULT;\n const minSize = () => props.minSize ?? (props.collapsible ? APP_WORKSPACE_SIDEBAR_COLLAPSED : APP_WORKSPACE_SIDEBAR_MIN);\n const maxSize = () => props.maxSize ?? APP_WORKSPACE_SIDEBAR_MAX;\n const workspace = useContext(WorkspaceContext);\n const generatedId = createUniqueId();\n const domId = () => props.id ?? workspace?.sidebarId ?? `k2b-workspace-sidebar-${generatedId}`;\n // The head's navigation button names this sidebar.\n createEffect(() => workspace?.setSidebarId(domId()));\n // Hidden navigation is not rendered at all, so its labels are neither shown\n // nor reachable; reading the children lazily keeps them from being created.\n const resolved = children(() => (props.hidden ? undefined : props.children));\n const slots = createMemo(() => flatten(resolved()).filter(sidebarChildSlot));\n const desktop = createMemo(() => slots().find((slot) => slot.kind === SIDEBAR_DESKTOP));\n const stacked = () => props.mobile === \"stacked\";\n const workspaceMessages = useWorkspaceMessages();\n const owner = getOwner();\n const [sheetOpen, setSheetOpen] = createSignal(false);\n let aside: HTMLElement | undefined;\n let row: HTMLDivElement | undefined;\n // Fades mark the row's cut edges; the sidebar column never scrolls sideways, so it never shows one.\n createScrollFade(\n () => row,\n () => stacked(),\n );\n onMount(() => {\n const requestHide = () => props.onHiddenChange?.(true);\n const requestShow = () => props.onHiddenChange?.(false);\n aside?.addEventListener(APP_WORKSPACE_SIDEBAR_HIDE_EVENT, requestHide);\n aside?.addEventListener(APP_WORKSPACE_SIDEBAR_SHOW_EVENT, requestShow);\n onCleanup(() => {\n aside?.removeEventListener(APP_WORKSPACE_SIDEBAR_HIDE_EVENT, requestHide);\n aside?.removeEventListener(APP_WORKSPACE_SIDEBAR_SHOW_EVENT, requestShow);\n });\n // A client-rendered row settles here; server markup settled in its inline script.\n if (stacked() && row) settleChipRow(row, scrollFadeEdges);\n });\n /**\n * The complete sidebar for a chip row: a second rendering of the same\n * children in a sheet. It shares the application's state through its\n * signals, inherits this sidebar's context and accent, and is disposed with\n * the sheet. A chosen link runs its own handlers in the sheet and closes it.\n */\n const openAll = (button: HTMLButtonElement) => {\n if (sheetOpen() || !aside) return;\n setSheetOpen(true);\n const computed = getComputedStyle(aside);\n const accent = Object.fromEntries(\n [\"--k2b-app-workspace-active\", \"--k2b-app-workspace-selected\", \"--k2b-link-accent\", \"--k2b-detail-panel-accent\"]\n .map((name) => [name, computed.getPropertyValue(name).trim()])\n .filter(([, value]) => value),\n );\n // The sheet belongs to the chip row: when the workspace widens into the sidebar column, All disappears and the sheet closes.\n const leave = new AbortController();\n const watch = new ResizeObserver(() => {\n if (button.getClientRects().length === 0) leave.abort();\n });\n watch.observe(button);\n /** A chosen link closes the sheet once its own handlers ran, an enhanced navigation's included. */\n const choose = (event: MouseEvent, close: () => void) => {\n const target = event.target as Element | null;\n if (!target?.closest?.(\"a[href]\")) return;\n if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;\n // A tree branch's disclosure inside its link only expands the branch.\n if (target.closest(\"[data-k2b-nav-tree-toggle]\")) return;\n // A task, not a microtask: the document's delegated handlers run later in this dispatch.\n setTimeout(close);\n };\n void dialogCore\n .open<void>(\n (close, context) => {\n let dispose: (() => void) | undefined;\n const view = createRoot((disposeRoot) => {\n dispose = disposeRoot;\n return (\n <BottomSheet onDismiss={context.requestDismiss}>\n <BottomSheet.Header title={props.label} close={() => void context.requestDismiss()} />\n <BottomSheet.Body>\n {/* The sheet keeps its own failure: the application's boundary around the sidebar stays untouched. */}\n <RenderErrorBoundary\n onClose={() => void context.requestDismiss()}\n content={() => {\n const resolved = children(\n () =>\n flatten(props.hidden ? undefined : props.children)\n .filter(sidebarChildSlot)\n .find((slot) => slot.kind === SIDEBAR_DESKTOP)?.children,\n );\n // Pre-resolved children belong to the row; inserting them here would move its nodes into the sheet.\n if (resolved.toArray().some((node) => node instanceof Node && aside?.contains(node))) {\n console.error(\n \"AppWorkspace.Sidebar: write the sidebar children as JSX inside AppWorkspace.Sidebar so they can render a second time in the All sheet; pre-resolved children cannot be reused.\",\n );\n return null;\n }\n return (\n <nav\n class=\"k2b-app-workspace__sidebar-sheet\"\n aria-label={props.label}\n style={accent}\n on:click={(event) => choose(event, () => close())}\n >\n {resolved()}\n </nav>\n );\n }}\n />\n </BottomSheet.Body>\n </BottomSheet>\n );\n }, owner);\n onCleanup(() => dispose?.());\n return view;\n },\n // No history entry: an application may replace the URL from inside the sidebar, such as a search, and an\n // entry of the sheet would then outlive it. So Back leaves the page here, unlike other phone sheets.\n { ...bottomSheetAdaptiveOptions, ariaLabel: props.label, signal: leave.signal },\n )\n .finally(() => {\n watch.disconnect();\n setSheetOpen(false);\n if (button.isConnected && !aside?.contains(document.activeElement)) {\n if (button.getClientRects().length) button.focus({ preventScroll: true });\n else {\n const current = aside?.querySelector<HTMLElement>(\"[aria-current], .k2b-app-workspace__sidebar-item.is-active\");\n const link = current?.matches(\"a[href]\") ? current : current?.querySelector<HTMLElement>(\"a[href]\");\n (link ?? aside?.querySelector<HTMLElement>(\"a[href]\"))?.focus({ preventScroll: true });\n }\n }\n });\n };\n return (\n <>\n <Dynamic\n component={stacked() ? \"nav\" : \"aside\"}\n ref={aside}\n id={domId()}\n class={`k2b-app-workspace__sidebar ${props.class ?? \"\"}`}\n aria-label={props.label}\n hidden={props.hidden || undefined}\n data-mobile={stacked() ? \"stacked\" : undefined}\n data-workspace-resizable={resizable() ? \"true\" : \"false\"}\n data-workspace-collapsible={props.collapsible ? \"true\" : \"false\"}\n data-workspace-hideable={props.onHiddenChange ? \"true\" : undefined}\n >\n <Show when={!props.hidden}>\n <div\n ref={row}\n class=\"k2b-app-workspace__sidebar-desktop\"\n data-scroll-fade-mode={stacked() ? \"both\" : undefined}\n data-scroll-fade-axis={stacked() ? \"horizontal\" : undefined}\n >\n {desktop()?.children}\n </div>\n <Show when={stacked()}>\n <button\n type=\"button\"\n class=\"k2b-app-workspace__sidebar-all\"\n aria-haspopup=\"dialog\"\n aria-expanded={sheetOpen()}\n aria-label={props.label ? workspaceMessages().sidebarAllLabel({ label: props.label }) : undefined}\n onClick={(event) => openAll(event.currentTarget)}\n >\n <span>{workspaceMessages().sidebarAll}</span>\n <i class=\"ti ti-chevron-down\" aria-hidden=\"true\" />\n </button>\n {/* After All, which takes its room in the row first. */}\n <script innerHTML={CHIP_ROW_SCRIPT} />\n </Show>\n </Show>\n </Dynamic>\n <Show when={resizable() && !props.hidden}>\n <ResizeHandle\n kind=\"sidebar\"\n edge=\"end\"\n controls={domId()}\n defaultSize={defaultSize()}\n minSize={minSize()}\n maxSize={maxSize()}\n shadow={props.resizeShadow !== false}\n />\n </Show>\n </>\n );\n}\n\n/**\n * A chip row that overflows shows the current object, centered when it is\n * not in view from the row's start, and fades its cut edges. Self-contained, because the inline script after server markup\n * embeds its source and runs it before the first paint; at 64 rem the column\n * does not overflow sideways and nothing changes.\n */\nfunction settleChipRow(row: Element | null, edges: (element: HTMLElement) => string | undefined) {\n if (!(row instanceof HTMLElement) || row.scrollWidth - row.clientWidth <= 1) return;\n const current = row.querySelector(\".k2b-app-workspace__sidebar-item.is-active, [aria-current]\");\n const chip = current && (current.closest(\".k2b-app-workspace__sidebar-item\") || current);\n if (chip) {\n // From the row's start, whatever scrolled it before (a body's own restore\n // runs first on the client, last on the server), so both paths agree.\n row.scrollLeft = 0;\n const bounds = row.getBoundingClientRect();\n const item = chip.getBoundingClientRect();\n if (item.left < bounds.left || item.right > bounds.right) row.scrollLeft += item.left - bounds.left - (bounds.width - item.width) / 2;\n }\n const fade = edges(row);\n if (fade) row.setAttribute(\"data-scroll-fade\", fade);\n}\nconst CHIP_ROW_SCRIPT = `(${settleChipRow})(document.currentScript&&document.currentScript.parentElement.querySelector(\":scope>.k2b-app-workspace__sidebar-desktop\"),${scrollFadeEdges})`;\n\nconst AppWorkspaceSidebarDesktop = (props: { children: JSX.Element }): JSX.Element =>\n ({ kind: SIDEBAR_DESKTOP, children: props.children }) as unknown as JSX.Element;\n// The inline script restores server markup while parsing; onMount restores a\n// client-rendered sidebar when an island replaces it. Both paths keep the\n// current item in view and set the fade before paint, repeating the restore\n// in the first frame when the whole document has its final layout. Only\n// pagehide stores the offset: restores before final layout can be clamped,\n// and remembering those programmatic scrolls would shrink the stored offset.\n// Memory is per scroll-preserve key (or page path) and sidebar position and\n// ends with the tab.\nconst SIDEBAR_SCROLL_MEMORY_SCRIPT = `(${rememberSidebarScroll})(document.currentScript&&document.currentScript.previousElementSibling,${scrollFadeEdges})`;\n\nconst AppWorkspaceSidebarBody = (props: AppWorkspaceSidebarBodyProps) => {\n let body!: HTMLDivElement;\n onMount(() => onCleanup(rememberSidebarScroll(body, scrollFadeEdges)));\n createScrollFade(\n () => body,\n () => props.scrollFade !== false,\n );\n return (\n <>\n <div\n ref={body}\n class={`k2b-app-workspace__sidebar-body ${props.class ?? \"\"}`}\n data-scroll-fade-mode={props.scrollFade !== false ? \"both\" : undefined}\n {...scrollAttrs(props.scrollPreserveKey)}\n {...modeAttrs(props.sidebarMode)}\n >\n {props.children}\n </div>\n <script innerHTML={SIDEBAR_SCROLL_MEMORY_SCRIPT} />\n </>\n );\n};\nconst AppWorkspaceSidebarFooter = (props: AppWorkspaceSidebarContentProps) => (\n <footer class={`k2b-app-workspace__sidebar-footer ${props.class ?? \"\"}`} {...modeAttrs(props.sidebarMode)}>\n {props.children}\n </footer>\n);\nconst AppWorkspaceSidebarSection = (props: AppWorkspaceSidebarSectionProps) => {\n const [expanded, setExpanded] = createSignal(props.defaultOpen ?? true);\n const open = () => !props.collapsible || (props.open ?? expanded());\n const id = `sidebar-section-${createUniqueId()}`;\n const title = () => (\n <>\n <Show when={props.icon}>\n <span aria-hidden=\"true\">\n <i class={iconClass(props.icon)} />\n </span>\n </Show>\n {props.title}\n <Show when={props.count !== undefined}>\n <span class=\"k2b-app-workspace__sidebar-section-count\">{props.count}</span>\n </Show>\n </>\n );\n return (\n <section\n class={`k2b-app-workspace__sidebar-section ${props.class ?? \"\"}`}\n data-collapsible={props.collapsible ? \"true\" : undefined}\n {...modeAttrs(props.sidebarMode)}\n >\n <Show when={props.title || props.actions}>\n <header class=\"k2b-app-workspace__sidebar-section-header\">\n <Show\n when={props.collapsible}\n fallback={\n <Show when={props.title}>\n <h2>{title()}</h2>\n </Show>\n }\n >\n <button\n type=\"button\"\n class=\"k2b-app-workspace__sidebar-section-toggle\"\n aria-expanded={open()}\n aria-controls={id}\n onClick={() => {\n const next = !open();\n setExpanded(next);\n props.onOpenChange?.(next);\n }}\n >\n {title()}\n <i class={open() ? \"ti ti-chevron-down\" : \"ti ti-chevron-right\"} aria-hidden=\"true\" />\n </button>\n </Show>\n <Show when={props.actions}>\n <div class=\"k2b-app-workspace__sidebar-section-actions\">{props.actions}</div>\n </Show>\n </header>\n </Show>\n <div id={id} hidden={!open()} class=\"k2b-app-workspace__sidebar-section-content\">\n {props.children}\n </div>\n </section>\n );\n};\n\nconst AppWorkspaceSidebarItemIcon = (props: AppWorkspaceSidebarItemIconProps): JSX.Element =>\n mergeProps({ kind: SIDEBAR_ITEM_ICON }, props) as unknown as JSX.Element;\nconst AppWorkspaceSidebarItemLabel = (props: AppWorkspaceSidebarItemLabelProps): JSX.Element =>\n mergeProps({ kind: SIDEBAR_ITEM_LABEL }, props) as unknown as JSX.Element;\nconst AppWorkspaceSidebarItemMeta = (props: AppWorkspaceSidebarItemMetaProps): JSX.Element =>\n mergeProps({ kind: SIDEBAR_ITEM_META }, props) as unknown as JSX.Element;\nconst AppWorkspaceSidebarItemAction = (props: AppWorkspaceSidebarItemActionProps): JSX.Element =>\n mergeProps({ kind: SIDEBAR_ITEM_ACTION }, props) as unknown as JSX.Element;\nconst AppWorkspaceSidebarItemActions = (props: AppWorkspaceSidebarItemActionsProps): JSX.Element => (\n <div class=\"k2b-app-workspace__sidebar-item-actions\" data-visibility={props.visibility === \"hover\" ? \"hover\" : undefined}>\n {props.children}\n </div>\n);\nconst AppWorkspaceSidebarItemStatus = (props: AppWorkspaceSidebarItemStatusProps): JSX.Element => {\n const workspaceMessages = useWorkspaceMessages();\n const waiting = () => (props.waiting && Number.isFinite(props.waiting.count) ? Math.max(0, Math.floor(props.waiting.count)) : null);\n const count = () => waiting() ?? (typeof props.unread === \"number\" && props.unread >= 1 ? Math.floor(props.unread) : 0);\n const dot = () => waiting() === null && props.unread === true;\n // The marks are decorative; the row's accessible name gets one phrase instead,\n // which says no more than the \"99+\" a capped count shows.\n const description = () =>\n [\n waiting() !== null\n ? (props.waiting?.label ?? \"\")\n : count() > 99\n ? workspaceMessages().sidebarUnreadMany\n : count()\n ? workspaceMessages().sidebarUnread({ count: count() })\n : dot()\n ? workspaceMessages().sidebarNewActivity\n : \"\",\n props.mention ? workspaceMessages().sidebarMentioned : \"\",\n props.muted ? workspaceMessages().sidebarMuted : \"\",\n ]\n .filter(Boolean)\n .join(\", \");\n // The unread slot stays reserved at the end, and the marks that change most\n // often sit outermost, so new activity or a mention never moves another mark.\n // The element itself stays when there is nothing to show: empty, it takes no\n // space, and it still keeps the row's label on one line, so the first count\n // never re-wraps the label and moves the rows below.\n return (\n <span\n class=\"k2b-app-workspace__sidebar-status\"\n data-unread={waiting() !== null ? undefined : count() ? \"count\" : dot() ? \"dot\" : undefined}\n data-waiting={waiting() === null ? undefined : waiting() ? \"count\" : \"zero\"}\n data-muted={props.muted ? \"true\" : undefined}\n >\n <Show when={description()}>\n <Show when={props.mention}>\n <span class=\"k2b-app-workspace__sidebar-status-mention\" aria-hidden=\"true\">\n @\n </span>\n </Show>\n <Show when={props.muted}>\n <span class=\"k2b-app-workspace__sidebar-status-muted\" aria-hidden=\"true\">\n <i class=\"ti ti-bell-off\" />\n </span>\n </Show>\n <span class=\"k2b-app-workspace__sidebar-status-unread\" aria-hidden=\"true\">\n <Show\n when={count() || waiting() === 0}\n fallback={\n <Show when={dot()}>\n <span class=\"k2b-app-workspace__sidebar-status-dot\" />\n </Show>\n }\n >\n <span class=\"k2b-app-workspace__sidebar-status-count\" data-mention={props.mention ? \"true\" : undefined}>\n {count() > 99 ? \"99+\" : count()}\n </span>\n </Show>\n </span>\n <span class=\"k2b-sr-only\">, {description()}</span>\n </Show>\n </span>\n );\n};\n\ntype AppWorkspaceSidebarRowProps = {\n children: JSX.Element;\n actions?: JSX.Element;\n hasActions: boolean;\n href?: string;\n navigation?: \"enhanced\" | \"document\";\n replace?: boolean;\n scroll?: NavigationScrollMode;\n onNavigate?: (event: LinkNavigateEvent) => void | Promise<void>;\n onClick?: (event: MouseEvent) => void;\n active?: boolean | \"ancestor\";\n activeClass?: string;\n disabled?: boolean;\n tone?: AppWorkspaceSidebarItemTone;\n title?: string;\n /** The plain label, which names the row in the collapsed rail when it has no `title`. */\n hint?: string;\n /** The element that holds keyboard focus for this row, when that is not the row itself. */\n focusTarget?: () => HTMLElement | undefined;\n viewTransitionName?: string;\n class?: string;\n depth?: number;\n tabIndex?: number;\n data?: Record<string, string | number | boolean | null | undefined>;\n};\n\n/**\n * Hover actions overlay a row's end, so the label and count under them fade\n * out while they show. The row measures how far the overlay reaches into its\n * count (`--k2b-sidebar-item-cover`) and how much of that the count and gap\n * after the label already take (`--k2b-sidebar-item-label-trail`), so the\n * label keeps all the width the overlay leaves it. The stylesheet applies\n * both only while the overlay shows, and assumes its usual size until then.\n */\nfunction observeSidebarRowCover(row: HTMLElement): void {\n if (isServer || typeof ResizeObserver === \"undefined\") return;\n // A hidden count, such as an empty status, or hidden actions have no box to measure from.\n const laidOut = (element: Element | null | undefined): element is Element => Boolean(element?.getClientRects().length);\n const measure = () => {\n const main = row.querySelector(\":scope > .k2b-app-workspace__sidebar-item-main\");\n const label = main?.querySelector(\":scope > :is(.k2b-app-workspace__sidebar-item-copy, .k2b-app-workspace__sidebar-item-label)\");\n const overlays = Array.from(\n row.querySelectorAll(\n ':scope > .k2b-app-workspace__sidebar-item-actions[data-visibility=\"hover\"]:last-child, :scope > .k2b-app-workspace__sidebar-item-action[data-visibility=\"hover\"]',\n ),\n ).filter((element) => laidOut(element) && getComputedStyle(element).position === \"absolute\");\n if (!main || !laidOut(label) || !overlays.length) {\n row.style.removeProperty(\"--k2b-sidebar-item-cover\");\n row.style.removeProperty(\"--k2b-sidebar-item-label-trail\");\n return;\n }\n // Lengths along the inline axis, measured toward the row's end.\n const rtl = getComputedStyle(row).direction === \"rtl\";\n const end = (element: Element) => {\n const box = element.getBoundingClientRect();\n return rtl ? -box.left : box.right;\n };\n const start = Math.min(\n ...overlays.map((element) => {\n const box = element.getBoundingClientRect();\n return rtl ? -box.right : box.left;\n }),\n );\n const meta = main.querySelector(\":scope > .k2b-app-workspace__sidebar-item-meta\");\n const content = end(laidOut(meta) ? meta : label);\n row.style.setProperty(\"--k2b-sidebar-item-cover\", `${Math.max(0, content - start)}px`);\n row.style.setProperty(\"--k2b-sidebar-item-label-trail\", `${Math.max(0, content - end(label))}px`);\n };\n const resized = new ResizeObserver(measure);\n // The label, the count, and the actions can be replaced while the row stays.\n const replaced = new MutationObserver(() => observe());\n const observe = () => {\n const main = row.querySelector(\":scope > .k2b-app-workspace__sidebar-item-main\");\n if (main) replaced.observe(main, { childList: true });\n resized.disconnect();\n resized.observe(row);\n for (const element of row.querySelectorAll(\n \":scope > .k2b-app-workspace__sidebar-item-main > :is(.k2b-app-workspace__sidebar-item-copy, .k2b-app-workspace__sidebar-item-label, .k2b-app-workspace__sidebar-item-meta), :scope > :is(.k2b-app-workspace__sidebar-item-actions, .k2b-app-workspace__sidebar-item-action)\",\n ))\n resized.observe(element);\n };\n replaced.observe(row, { childList: true });\n observe();\n onCleanup(() => {\n replaced.disconnect();\n resized.disconnect();\n });\n}\n\n/** Shared visual and semantic row frame for flat sidebar items and tree items. */\nfunction AppWorkspaceSidebarRow(props: AppWorkspaceSidebarRowProps): JSX.Element {\n const [link, setLink] = createSignal<HTMLElement>();\n const [hinted, setHinted] = createSignal(false);\n const className = () =>\n `k2b-app-workspace__sidebar-item ${props.hasActions ? \"has-action\" : \"\"} ${props.active ? (props.activeClass ?? \"is-active\") : \"\"} ${props.class ?? \"\"}`;\n const data = () =>\n Object.fromEntries(\n Object.entries(props.data ?? {})\n .filter(([, value]) => value !== undefined && value !== null)\n .map(([key, value]) => [`data-${key}`, String(value)]),\n );\n const common = () => ({\n class: className(),\n title: hinted() ? undefined : props.title,\n \"data-tone\": props.tone,\n style: {\n \"view-transition-name\": props.viewTransitionName,\n \"--k2b-sidebar-item-depth\": props.depth === undefined ? undefined : String(Math.max(0, props.depth)),\n },\n ...data(),\n });\n const current = (): \"page\" | \"true\" | undefined => (props.active === \"ancestor\" ? \"true\" : props.active ? \"page\" : undefined);\n\n const Control = (control: { grouped: boolean }) => {\n const attrs = () => ({\n ...(control.grouped ? { class: \"k2b-app-workspace__sidebar-item-main\" } : common()),\n ref: setLink,\n });\n return (\n <Show\n when={Boolean(props.href && !props.disabled)}\n fallback={\n <button type=\"button\" {...attrs()} tabIndex={props.tabIndex} disabled={props.disabled} onClick={props.onClick}>\n {props.children}\n </button>\n }\n >\n <Show\n when={props.navigation === \"enhanced\" && Boolean(props.onNavigate)}\n fallback={\n <a href={props.href} {...attrs()} tabIndex={props.tabIndex} aria-current={current()} onClick={props.onClick}>\n {props.children}\n </a>\n }\n >\n <Link\n href={props.href!}\n {...attrs()}\n tabIndex={props.tabIndex}\n aria-current={current()}\n replace={props.replace}\n scroll={props.scroll}\n onNavigate={props.onNavigate}\n onClick={props.onClick}\n >\n {props.children}\n </Link>\n </Show>\n </Show>\n );\n };\n return (\n <>\n <Show when={props.hasActions} fallback={<Control grouped={false} />}>\n <div {...common()} ref={(row) => onMount(() => observeSidebarRowCover(row))} data-disabled={props.disabled ? \"true\" : undefined}>\n <Control grouped />\n {props.actions}\n </div>\n </Show>\n {/* The hint follows the row's link or button, also when actions or `disabled` replace it, and leaves the\n row's own actions their own hints. */}\n <Show when={link()} keyed>\n {(element) => (\n <SidebarRailHint\n target={() => element}\n label={props.title ?? props.hint}\n focusTarget={props.focusTarget ?? (() => element)}\n labelSelector=\".k2b-app-workspace__sidebar-item-label-text\"\n titled={props.title !== undefined}\n onArm={() => setHinted(true)}\n />\n )}\n </Show>\n </>\n );\n}\n\nfunction AppWorkspaceSidebarItem(props: AppWorkspaceSidebarItemProps): JSX.Element {\n const workspaceMessages = useWorkspaceMessages();\n const resolved = children(() => props.children);\n const resolvedActions = children(() => props.actions);\n const values = createMemo(() => flatten(resolved()));\n const slots = createMemo(() => values().filter(sidebarItemSlot));\n const iconSlot = createMemo(\n () =>\n slots().find((slot) => slot.kind === SIDEBAR_ITEM_ICON) as\n | (AppWorkspaceSidebarItemIconProps & { kind: typeof SIDEBAR_ITEM_ICON })\n | undefined,\n );\n const labelSlot = createMemo(\n () =>\n slots().find((slot) => slot.kind === SIDEBAR_ITEM_LABEL) as\n | (AppWorkspaceSidebarItemLabelProps & { kind: typeof SIDEBAR_ITEM_LABEL })\n | undefined,\n );\n const metaSlot = createMemo(\n () =>\n slots().find((slot) => slot.kind === SIDEBAR_ITEM_META) as\n | (AppWorkspaceSidebarItemMetaProps & { kind: typeof SIDEBAR_ITEM_META })\n | undefined,\n );\n const actionSlot = createMemo(\n () =>\n slots().find((slot) => slot.kind === SIDEBAR_ITEM_ACTION) as\n | (AppWorkspaceSidebarItemActionProps & { kind: typeof SIDEBAR_ITEM_ACTION })\n | undefined,\n );\n const legacy = createMemo(() => values().filter((value) => !sidebarItemSlot(value)));\n const label = () => labelSlot()?.children ?? (legacy().length === 1 ? legacy()[0] : legacy());\n const oneLine = () => !(labelSlot()?.marquee ?? (props.variant ?? \"row\") === \"row\");\n const icon = () => iconSlot()?.icon ?? props.icon;\n const iconContent = () => iconSlot()?.children;\n // Resolved first, so metadata that renders nothing leaves no empty slot. An\n // empty status still renders its element; the stylesheet hides that slot.\n const meta = children(() => metaSlot()?.children ?? props.meta);\n const hasMeta = () => meta.toArray().some(Boolean);\n const metaId = createUniqueId();\n const metaVisibility = () => metaSlot()?.visibility ?? props.metaVisibility;\n const customActions = () => resolvedActions();\n const hasCustomActions = () => Boolean(customActions());\n const hasAction = () => Boolean(actionSlot() || props.actionIcon || hasCustomActions() || props.preview);\n const mainContent = (\n <>\n <Show when={iconContent() || icon()}>\n <span\n class={\n // An object row's own glyph sits in a soft chip of the app colour; custom content such as an avatar keeps\n // its own look.\n props.variant === \"object\" && !iconContent()\n ? \"k2b-app-workspace__sidebar-item-icon k2b-icon-tile\"\n : \"k2b-app-workspace__sidebar-item-icon\"\n }\n aria-hidden=\"true\"\n >\n {iconContent() ?? <i class={iconClass(icon())} />}\n </span>\n </Show>\n {/* Plain labels reserve the selected text weight so selection keeps their line count. */}\n <span class=\"k2b-app-workspace__sidebar-item-copy\">\n <Show when={props.context || props.contextMeta}>\n <span class=\"k2b-app-workspace__sidebar-item-context\">\n <span class=\"k2b-app-workspace__sidebar-item-context-label k2b-truncate-fade\">{props.context}</span>\n <Show when={props.contextMeta}>\n <span class=\"k2b-app-workspace__sidebar-item-context-meta\">{props.contextMeta}</span>\n </Show>\n </span>\n </Show>\n <span\n class=\"k2b-app-workspace__sidebar-item-label\"\n data-lines={oneLine() ? \"1\" : undefined}\n data-label={!oneLine() && typeof label() === \"string\" ? label() : undefined}\n >\n <span class=\"k2b-app-workspace__sidebar-item-label-text k2b-truncate-fade-lines\">{label() as JSX.Element}</span>\n </span>\n <Show when={props.description}>\n <span class=\"k2b-app-workspace__sidebar-item-description k2b-truncate-fade\">{props.description}</span>\n </Show>\n <Show when={props.note}>\n <span class=\"k2b-app-workspace__sidebar-item-note k2b-truncate-fade\" data-tone={props.noteTone ?? \"neutral\"}>\n {props.note}\n </span>\n </Show>\n </span>\n <Show when={hasMeta()}>\n <span\n class=\"k2b-app-workspace__sidebar-item-meta\"\n id={props.preview?.trigger === \"row\" ? metaId : undefined}\n data-visibility={metaVisibility() === \"hover\" ? \"hover\" : undefined}\n >\n {meta()}\n </span>\n </Show>\n </>\n );\n const singleAction = () => {\n const label = () => actionSlot()?.label ?? props.actionLabel ?? workspaceMessages().rowAction;\n const select = (event: MouseEvent) => {\n event.stopPropagation();\n if (actionSlot()?.disabled) {\n event.preventDefault();\n return;\n }\n if (!actionSlot()?.href) event.preventDefault();\n actionSlot()?.onSelect?.(event);\n props.onActionClick?.(event);\n };\n const content = () => actionSlot()?.children ?? <i class={iconClass(actionSlot()?.icon ?? props.actionIcon, \"ti-dots\")} />;\n return (\n <Show when={Boolean(actionSlot() || props.actionIcon)}>\n <Show\n when={actionSlot()?.href && !actionSlot()?.disabled}\n fallback={\n <button\n type=\"button\"\n class=\"k2b-app-workspace__sidebar-item-action\"\n disabled={actionSlot()?.disabled}\n data-visibility={actionSlot()?.visibility === \"hover\" ? \"hover\" : undefined}\n aria-label={label()}\n onClick={select}\n >\n {content()}\n </button>\n }\n >\n <a\n href={actionSlot()?.href}\n class=\"k2b-app-workspace__sidebar-item-action\"\n data-visibility={actionSlot()?.visibility === \"hover\" ? \"hover\" : undefined}\n aria-label={label()}\n onClick={select}\n >\n {content()}\n </a>\n </Show>\n </Show>\n );\n };\n const actions = () => (\n <>\n {customActions()}\n {singleAction()}\n <Show when={props.preview}>\n {(preview) => (\n <SidebarItemPreview\n label={preview().label}\n trigger={preview().trigger}\n align={preview().align}\n viewportSize={preview().viewportSize}\n describedBy={hasMeta() ? metaId : undefined}\n onOpenChange={preview().onOpenChange}\n >\n {preview().content}\n </SidebarItemPreview>\n )}\n </Show>\n </>\n );\n return (\n <AppWorkspaceSidebarRow\n hasActions={hasAction()}\n href={props.href}\n navigation={props.navigation}\n replace={props.replace}\n scroll={props.scroll}\n onNavigate={props.onNavigate}\n onClick={props.onClick}\n active={props.active}\n activeClass={props.activeClass}\n disabled={props.disabled}\n tone={props.tone}\n title={props.title}\n hint={typeof label() === \"string\" ? (label() as string) : undefined}\n viewTransitionName={props.viewTransitionName}\n class={props.class}\n depth={props.depth}\n actions={actions()}\n data={{\n ...props.data,\n ...modeData(props.sidebarMode),\n variant: props.variant ?? \"row\",\n \"has-actions\": hasCustomActions() ? \"true\" : undefined,\n \"action-visibility\": actionSlot()?.visibility === \"hover\" ? \"hover\" : undefined,\n }}\n >\n {mainContent}\n </AppWorkspaceSidebarRow>\n );\n}\n\nconst navTreeItems = (value: unknown): NavTreeItemSlot[] => flatten(value).filter(navTreeItemSlot);\n\nconst AppWorkspaceNavTreeItem = (props: AppWorkspaceNavTreeItemProps): JSX.Element =>\n ({ kind: NAV_TREE_ITEM, ...props }) as unknown as JSX.Element;\n\ntype NavTreeDragEvent = DragEvent & { currentTarget: HTMLDivElement; target: Element };\nconst NAV_TREE_DRAG_TYPE = \"application/x-k2b-nav-tree-item\";\n\nconst callDragHandler = (handler: JSX.EventHandlerUnion<HTMLDivElement, DragEvent> | undefined, event: NavTreeDragEvent) => {\n if (typeof handler === \"function\") handler(event);\n else handler?.[0](handler[1], event);\n};\n\n/**\n * The move that puts the sibling at `from` into the gap before `slot`\n * (`siblings.length` is the gap after the last one), or `null` when its place\n * would not change or it would pass an item that is not movable.\n */\nconst navTreeMove = (\n siblings: readonly NavTreeItemSlot[],\n from: number,\n slot: number,\n parentId: string | null,\n): AppWorkspaceNavTreeMove | null => {\n if (from < 0 || slot < 0 || slot > siblings.length || slot === from || slot === from + 1) return null;\n const passed = slot < from ? siblings.slice(slot, from) : siblings.slice(from + 1, slot);\n if (passed.some((sibling) => !sibling.movable)) return null;\n return { id: siblings[from]!.id, parentId, beforeId: siblings[slot]?.id ?? null, afterId: siblings[slot - 1]?.id ?? null };\n};\n\nconst AppWorkspaceNavTree = ((props: AppWorkspaceNavTreeProps) => {\n let root: HTMLDivElement | undefined;\n const resolved = children(() => props.children);\n const roots = createMemo(() => navTreeItems(resolved()));\n const [uncontrolledExpandedIds, setUncontrolledExpandedIds] = createSignal<string[]>([...new Set(props.defaultExpandedIds ?? [])]);\n const [focusedId, setFocusedId] = createSignal<string | null>(props.selectedId ?? null);\n const expandedIds = createMemo(() => new Set(props.expandedIds ?? uncontrolledExpandedIds()));\n const isExpanded = (id: string) => expandedIds().has(id);\n\n const setExpanded = (id: string, expanded: boolean) => {\n const next = new Set(expandedIds());\n if (expanded) next.add(id);\n else next.delete(id);\n const value = [...next];\n if (props.expandedIds === undefined) setUncontrolledExpandedIds(value);\n props.onExpandedIdsChange?.(value);\n };\n\n const visibleIds = createMemo(() => {\n const result: string[] = [];\n const visit = (items: readonly NavTreeItemSlot[]) => {\n for (const item of items) {\n if (item.disabled) continue;\n result.push(item.id);\n const nested = navTreeItems(item.children);\n if (nested.length > 0 && isExpanded(item.id)) visit(nested);\n }\n };\n visit(roots());\n return result;\n });\n\n const tabStopId = () => {\n const visible = visibleIds();\n const focused = focusedId();\n if (focused && visible.includes(focused)) return focused;\n if (props.selectedId && visible.includes(props.selectedId)) return props.selectedId;\n return visible[0] ?? null;\n };\n\n const treeItemElements = () =>\n Array.from(root?.querySelectorAll<HTMLElement>(\"[data-k2b-nav-tree-id]\") ?? []).filter(\n (element) => element.getAttribute(\"aria-disabled\") !== \"true\",\n );\n const focusItem = (id: string | null) => {\n if (!id) return;\n const element = treeItemElements().find((candidate) => candidate.dataset.k2bNavTreeId === id);\n element?.focus({ preventScroll: true });\n };\n\n // Reordering: the dragged item and the gap the pointer marks. The application renders the new\n // order; the item moved by keyboard takes focus back when its row mounts or changes place.\n const [dragged, setDragged] = createSignal<{ id: string; parentId: string | null } | null>(null);\n const [dropTarget, setDropTarget] = createSignal<{ id: string; side: \"before\" | \"after\" } | null>(null);\n let claimedDragOver: DragEvent | null = null;\n let refocusId: string | null = null;\n const endDrag = () => {\n setDragged(null);\n setDropTarget(null);\n };\n const requestMove = (move: AppWorkspaceNavTreeMove | null, keepFocus: boolean) => {\n if (!move || !props.onMove) return;\n refocusId = keepFocus ? move.id : null;\n props.onMove(move);\n };\n\n // Items arrive through an accessor so a changed nested list reconciles rows by identity instead of rebuilding the list.\n const renderItems = (siblings: () => NavTreeItemSlot[], depth: number, parentId?: string): JSX.Element => (\n <For each={siblings()}>\n {(item, place) => {\n const nested = createMemo(() => navTreeItems(item.children));\n const hasChildren = () => item.hasChildren ?? nested().length > 0;\n const selected = () => props.selectedId === item.id;\n const siblingIndex = (id: string) => siblings().findIndex((sibling) => sibling.id === id);\n const movable = () => Boolean(props.onMove && item.movable && !item.disabled);\n // A folder that nobody selects: its row only expands and collapses it.\n const disclosureOnly = () => hasChildren() && !item.href && !item.onSelect && !props.onSelectedIdChange;\n let treeItem: HTMLDivElement | undefined;\n const ownRow = () => treeItem?.firstElementChild as HTMLElement | null | undefined;\n\n // A new row for the moved item, or the same row at its new place: moving a focused row drops its focus.\n createEffect(() => {\n place();\n if (refocusId !== item.id) return;\n queueMicrotask(() => {\n if (refocusId !== item.id || !treeItem?.isConnected) return;\n const active = treeItem.ownerDocument.activeElement;\n if (!active || active === treeItem.ownerDocument.body) treeItem.focus({ preventScroll: true });\n });\n });\n\n const activate = (event: MouseEvent) => {\n if (item.disabled) return;\n treeItem?.focus({ preventScroll: true });\n setFocusedId(item.id);\n if (disclosureOnly()) {\n setExpanded(item.id, !isExpanded(item.id));\n return;\n }\n props.onSelectedIdChange?.(item.id);\n item.onSelect?.(event);\n };\n const toggle = (event: MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n if (!item.disabled && hasChildren()) setExpanded(item.id, !isExpanded(item.id));\n };\n const onRowClick = (event: MouseEvent) => {\n if ((event.target as Element | null)?.closest(\"[data-k2b-nav-tree-toggle]\")) {\n toggle(event);\n return;\n }\n activate(event);\n };\n const rowControl = () => {\n const firstChild = treeItem?.firstElementChild as HTMLElement | null | undefined;\n if (!firstChild?.classList.contains(\"has-action\")) return firstChild;\n return firstChild.firstElementChild as HTMLElement | null;\n };\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.target !== event.currentTarget) return;\n if (\n event.altKey &&\n !event.ctrlKey &&\n !event.metaKey &&\n !event.shiftKey &&\n (event.key === \"ArrowUp\" || event.key === \"ArrowDown\")\n ) {\n if (!movable()) return;\n event.preventDefault();\n const from = siblingIndex(item.id);\n requestMove(navTreeMove(siblings(), from, event.key === \"ArrowUp\" ? from - 1 : from + 2, parentId ?? null), true);\n return;\n }\n if (event.altKey || event.ctrlKey || event.metaKey) return;\n const items = treeItemElements();\n const index = items.indexOf(event.currentTarget as HTMLElement);\n if (event.key === \"ArrowDown\" && index >= 0) {\n event.preventDefault();\n items[Math.min(items.length - 1, index + 1)]?.focus({ preventScroll: true });\n return;\n }\n if (event.key === \"ArrowUp\" && index >= 0) {\n event.preventDefault();\n items[Math.max(0, index - 1)]?.focus({ preventScroll: true });\n return;\n }\n if (event.key === \"Home\") {\n event.preventDefault();\n items[0]?.focus({ preventScroll: true });\n return;\n }\n if (event.key === \"End\") {\n event.preventDefault();\n items.at(-1)?.focus({ preventScroll: true });\n return;\n }\n if (event.key === \"ArrowRight\" && hasChildren()) {\n event.preventDefault();\n if (!isExpanded(item.id)) setExpanded(item.id, true);\n else queueMicrotask(() => focusItem(nested()[0]?.id ?? null));\n return;\n }\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n if (hasChildren() && isExpanded(item.id)) setExpanded(item.id, false);\n else focusItem(parentId ?? null);\n return;\n }\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n rowControl()?.click();\n }\n };\n const usesIconDisclosure = () => hasChildren() && Boolean(item.icon && item.expandedIcon);\n const rowIcon = () => (usesIconDisclosure() && isExpanded(item.id) ? item.expandedIcon : item.icon);\n const rowContent = (\n <>\n <Show when={rowIcon()}>\n <span\n class=\"k2b-app-workspace__sidebar-item-icon\"\n data-k2b-nav-tree-toggle={usesIconDisclosure() ? \"\" : undefined}\n {...iconAccessibility(item.iconLabel)}\n >\n <i class={iconClass(rowIcon())} />\n </span>\n </Show>\n <Show\n when={item.description !== undefined}\n fallback={\n <span class=\"k2b-app-workspace__sidebar-item-label\" data-label={typeof item.label === \"string\" ? item.label : undefined}>\n <span class=\"k2b-app-workspace__sidebar-item-label-text k2b-truncate-fade-lines\">{item.label}</span>\n </span>\n }\n >\n <span class=\"k2b-app-workspace__sidebar-item-copy\">\n <span class=\"k2b-app-workspace__sidebar-item-label\" data-label={typeof item.label === \"string\" ? item.label : undefined}>\n <span class=\"k2b-app-workspace__sidebar-item-label-text k2b-truncate-fade-lines\">{item.label}</span>\n </span>\n <span class=\"k2b-app-workspace__sidebar-item-description k2b-truncate-fade\">{item.description}</span>\n </span>\n </Show>\n <Show when={item.meta !== undefined}>\n <span\n class={`k2b-app-workspace__sidebar-item-meta ${hasChildren() ? \"\" : \"k2b-app-workspace__nav-tree-leaf-meta\"}`}\n data-visibility={item.metaVisibility === \"hover\" ? \"hover\" : undefined}\n >\n {item.meta}\n </span>\n </Show>\n <Show when={hasChildren() && !usesIconDisclosure()}>\n <span class=\"k2b-app-workspace__nav-tree-toggle\" data-k2b-nav-tree-toggle aria-hidden=\"true\">\n <i class={`ti ${isExpanded(item.id) ? \"ti-chevron-down\" : \"ti-chevron-right\"}`} />\n </span>\n </Show>\n </>\n );\n const row = () => (\n <AppWorkspaceSidebarRow\n hasActions={Boolean(item.actions)}\n href={item.href}\n navigation={item.navigation}\n replace={item.replace}\n scroll={item.scroll}\n onNavigate={item.onNavigate}\n onClick={onRowClick}\n active={selected()}\n disabled={item.disabled}\n tone={item.tone}\n title={item.title}\n hint={typeof item.label === \"string\" ? item.label : undefined}\n focusTarget={() => treeItem}\n viewTransitionName={item.viewTransitionName}\n class={`k2b-app-workspace__nav-tree-row ${item.class ?? \"\"}`}\n depth={props.indented === false ? 0 : depth}\n tabIndex={-1}\n actions={item.actions}\n // The marker tells the workspace controller that choosing this row is no destination.\n data={{ \"has-actions\": item.actions ? \"true\" : undefined, \"k2b-nav-tree-disclosure\": disclosureOnly() ? \"true\" : undefined }}\n >\n {rowContent}\n </AppWorkspaceSidebarRow>\n );\n\n // A gap is offered only next to a sibling's own row, never over its sub-items.\n const dropMove = (event: DragEvent): { side: \"before\" | \"after\"; move: AppWorkspaceNavTreeMove } | null => {\n const drag = dragged();\n const row = ownRow();\n if (!drag || !event.dataTransfer?.types.includes(NAV_TREE_DRAG_TYPE)) return null;\n if (drag.parentId !== (parentId ?? null) || drag.id === item.id || !row?.contains(event.target as Node)) return null;\n const rect = row.getBoundingClientRect();\n const side = event.clientY < rect.top + rect.height / 2 ? \"before\" : \"after\";\n const slot = siblingIndex(item.id) + (side === \"after\" ? 1 : 0);\n const move = navTreeMove(siblings(), siblingIndex(drag.id), slot, parentId ?? null);\n return move ? { side, move } : null;\n };\n const onDragStart = (event: DragEvent) => {\n const row = ownRow();\n if (!movable() || !row?.contains(event.target as Node)) return;\n event.stopPropagation();\n setDragged({ id: item.id, parentId: parentId ?? null });\n if (!event.dataTransfer) return;\n event.dataTransfer.effectAllowed = \"move\";\n event.dataTransfer.setData(NAV_TREE_DRAG_TYPE, item.id);\n const rect = row.getBoundingClientRect();\n event.dataTransfer.setDragImage(row, event.clientX - rect.left, event.clientY - rect.top);\n };\n const onDragOver = (event: NavTreeDragEvent) => {\n callDragHandler(item.onDragOver, event);\n const target = dropMove(event);\n if (!target) return;\n event.preventDefault();\n if (event.dataTransfer) event.dataTransfer.dropEffect = \"move\";\n claimedDragOver = event;\n setDropTarget({ id: item.id, side: target.side });\n };\n const onDrop = (event: NavTreeDragEvent) => {\n callDragHandler(item.onDrop, event);\n const target = dropMove(event);\n if (!target) return;\n event.preventDefault();\n event.stopPropagation();\n endDrag();\n requestMove(target.move, false);\n };\n\n return (\n <div\n ref={treeItem}\n class=\"k2b-app-workspace__nav-tree-node\"\n role=\"treeitem\"\n aria-level={depth + 1}\n aria-setsize={siblings().length}\n aria-posinset={place() + 1}\n aria-selected={selected()}\n aria-expanded={hasChildren() ? isExpanded(item.id) : undefined}\n aria-disabled={item.disabled ? \"true\" : undefined}\n tabIndex={item.disabled ? -1 : tabStopId() === item.id ? 0 : -1}\n draggable={movable() ? true : undefined}\n data-k2b-nav-tree-id={item.id}\n data-k2b-nav-tree-parent-id={parentId}\n data-k2b-nav-tree-dragging={dragged()?.id === item.id ? \"\" : undefined}\n data-k2b-nav-tree-drop={dropTarget()?.id === item.id ? dropTarget()!.side : undefined}\n style={{ \"--k2b-nav-tree-depth\": String(props.indented === false ? 0 : depth) }}\n onFocus={() => setFocusedId(item.id)}\n onKeyDown={onKeyDown}\n onDragStart={onDragStart}\n onDragEnter={item.onDragEnter}\n onDragOver={onDragOver}\n onDragLeave={item.onDragLeave}\n onDrop={onDrop}\n >\n {row()}\n <Show when={hasChildren() && isExpanded(item.id)}>\n <div class=\"k2b-app-workspace__nav-tree-group\" role=\"group\">\n {renderItems(nested, depth + 1, item.id)}\n </div>\n </Show>\n </div>\n );\n }}\n </For>\n );\n\n // Any other click or focus is the person's choice; only the moved item itself keeps its claim.\n const forgetRefocus = (event: Event) => {\n if (event.type === \"pointerdown\" || (event.target as HTMLElement | null)?.dataset?.k2bNavTreeId !== refocusId) refocusId = null;\n };\n // A row replaced during a drag never receives its dragend; the next pointer movement means the drag is over.\n const forgetDrag = () => {\n if (dragged()) endDrag();\n };\n onMount(() => {\n const doc = root?.ownerDocument;\n doc?.addEventListener(\"pointerdown\", forgetRefocus, true);\n doc?.addEventListener(\"focusin\", forgetRefocus, true);\n doc?.addEventListener(\"pointermove\", forgetDrag, true);\n onCleanup(() => {\n doc?.removeEventListener(\"pointerdown\", forgetRefocus, true);\n doc?.removeEventListener(\"focusin\", forgetRefocus, true);\n doc?.removeEventListener(\"pointermove\", forgetDrag, true);\n });\n });\n\n return (\n <div\n ref={root}\n class={`k2b-app-workspace__nav-tree ${props.class ?? \"\"}`}\n role=\"tree\"\n aria-label={props.ariaLabel}\n onDragOver={(event) => {\n // Runs after the rows: a position no row claimed shows no gap.\n if (claimedDragOver !== event) setDropTarget(null);\n }}\n onDragLeave={(event) => {\n if (!root?.contains(event.relatedTarget as Node | null)) setDropTarget(null);\n }}\n onDragEnd={endDrag}\n >\n {renderItems(roots, 0)}\n </div>\n );\n}) as AppWorkspaceNavTreeComponent;\n\nAppWorkspaceNavTree.Item = AppWorkspaceNavTreeItem;\n\nconst AppWorkspaceSidebarIconGrid = (props: AppWorkspaceSidebarIconGridProps) => (\n <section class={`k2b-app-workspace__sidebar-icon-grid-wrap ${props.class ?? \"\"}`} {...modeAttrs(props.sidebarMode)}>\n <Show when={props.title}>{(title) => <h2>{title()}</h2>}</Show>\n <div class=\"k2b-app-workspace__sidebar-icon-grid\" data-columns={props.columns ?? 2}>\n {props.children}\n </div>\n </section>\n);\n\nconst AppWorkspaceSidebarIconAction = (props: AppWorkspaceSidebarIconActionProps) => {\n let target: HTMLElement | undefined;\n const content = <i class={iconClass(props.icon)} aria-hidden=\"true\" />;\n const attrs = () => ({\n ref: (element: HTMLElement) => (target = element),\n class: `k2b-app-workspace__sidebar-icon-action ${props.active ? \"is-active\" : \"\"}`,\n \"aria-label\": props.label,\n \"data-tone\": props.tone,\n style: { \"view-transition-name\": props.viewTransitionName },\n ...modeAttrs(props.sidebarMode),\n });\n // The icon never shows its label, so the hint names it in every state; in the collapsed rail it sits beside the\n // icon like the rail's other entries.\n const hint = <Tooltip target={() => target} content={props.label} placement={inSidebarRail(target) ? \"right\" : undefined} delay={0} />;\n if (!props.href || props.disabled)\n return (\n <>\n <button type=\"button\" {...attrs()} disabled={props.disabled} onClick={props.onClick}>\n {content}\n </button>\n {hint}\n </>\n );\n if (props.navigation !== \"enhanced\" || !props.onNavigate)\n return (\n <>\n <a href={props.href} {...attrs()} onClick={props.onClick}>\n {content}\n </a>\n {hint}\n </>\n );\n return (\n <>\n <Link\n href={props.href}\n {...attrs()}\n replace={props.replace}\n scroll={props.scroll}\n onNavigate={props.onNavigate}\n onClick={props.onClick}\n >\n {content}\n </Link>\n {hint}\n </>\n );\n};\n\ntype AppWorkspaceComponent = ((props: AppWorkspaceProps) => JSX.Element) & {\n LayoutStateProvider: (props: AppWorkspaceLayoutStateProviderProps) => JSX.Element;\n Head: (props: AppWorkspaceHeadProps) => JSX.Element;\n Content: (props: AppWorkspaceContentProps) => JSX.Element;\n Main: (props: AppWorkspaceMainProps) => JSX.Element;\n MainPane: (props: AppWorkspaceMainPaneProps) => JSX.Element;\n Detail: (props: AppWorkspaceDetailProps) => JSX.Element;\n BottomDrawer: (props: AppWorkspaceBottomDrawerProps) => JSX.Element;\n Sidebar: (props: AppWorkspaceSidebarProps) => JSX.Element;\n SidebarDesktop: (props: { children: JSX.Element }) => JSX.Element;\n SidebarSwitcher: (props: AppWorkspaceSidebarSwitcherProps) => JSX.Element;\n SidebarSection: (props: AppWorkspaceSidebarSectionProps) => JSX.Element;\n SidebarBody: (props: AppWorkspaceSidebarBodyProps) => JSX.Element;\n SidebarFooter: (props: AppWorkspaceSidebarContentProps) => JSX.Element;\n SidebarItem: (props: AppWorkspaceSidebarItemProps) => JSX.Element;\n SidebarItemIcon: (props: AppWorkspaceSidebarItemIconProps) => JSX.Element;\n SidebarItemLabel: (props: AppWorkspaceSidebarItemLabelProps) => JSX.Element;\n SidebarItemMeta: (props: AppWorkspaceSidebarItemMetaProps) => JSX.Element;\n SidebarItemAction: (props: AppWorkspaceSidebarItemActionProps) => JSX.Element;\n SidebarItemActions: (props: AppWorkspaceSidebarItemActionsProps) => JSX.Element;\n SidebarItemStatus: (props: AppWorkspaceSidebarItemStatusProps) => JSX.Element;\n NavTree: AppWorkspaceNavTreeComponent;\n SidebarIconGrid: (props: AppWorkspaceSidebarIconGridProps) => JSX.Element;\n SidebarIconAction: (props: AppWorkspaceSidebarIconActionProps) => JSX.Element;\n};\n\n/**\n * The row above the work area. From 48 to 64 rem it holds the button that\n * opens the overlay sidebar. On a page with a page above it, it shows the\n * host's page title with the way up (see `PageTitle`); the page's own\n * `PageTitle` takes its place. The visible title is no heading, because many\n * pages render their own `h1`. From 64 rem a sidebar that marks the current\n * page names it already: the title and the way up hide, and only on a page\n * without its own `h1` its heading stays for assistive technology. With an\n * `AppWorkspace.Head` slot the row is always there and also carries the\n * views, the filters, the result count, and the actions; only its title\n * follows the rules above. It draws no line; CSS decides what shows and when\n * the filters wrap, so the server-rendered page already has its final\n * geometry.\n */\nfunction AppWorkspaceHead(props: { sidebarId: () => string; nested: boolean; head?: AppWorkspaceHeadProps }): JSX.Element {\n const messages = useWorkspaceMessages();\n const filters = useFilterMessages();\n // JSX prop getters construct their elements on every read. Share each\n // resolved slot between its presence check and its rendered content.\n const resolvedViews = children(() => props.head?.views);\n const resolvedFilters = children(() => props.head?.filters);\n const resolvedActions = children(() => props.head?.actions);\n const resolvedCount = children(() => props.head?.count);\n // A nested workspace is part of a page that already shows its title.\n const trail = props.nested ? () => undefined : usePageTrail();\n // Main already publishes the active region in SSR and on each selection.\n // Scope both sides to this workspace, including transparent island hosts;\n // a nested Main must never decide whether its parent's head is visible.\n const mobilePane = () =>\n props.head?.mobilePane === undefined ? undefined : assertStableUiId(props.head.mobilePane, \"AppWorkspace.Head mobilePane\");\n const mobilePaneRule = (pane: string) => {\n const main = `.k2b-app-workspace__main.has-panes:not([data-workspace-levels]) > [data-workspace-mobile-active=\"true\"]:not([data-workspace-main-region=\"${pane}\"])`;\n const host = `.k2b-ui .k2b-app-workspace:has(> .k2b-app-workspace__head[data-workspace-head-pane=\"${pane}\"]):has(> .k2b-app-workspace__content > ${main}, > .k2b-app-workspace__content > :is(solid-island, solid-client) > ${main})`;\n return `@media not all and (min-width:48rem){${host} > .k2b-app-workspace__head,${host} > .k2b-app-workspace__content > .k2b-app-workspace__detail-toggle,${host} > .k2b-app-workspace__content > :is(solid-island, solid-client) > .k2b-app-workspace__detail-toggle{display:none}}`;\n };\n const resetContent = () => filters().reset;\n const primaryContent = () => (\n <>\n <i class={props.head?.primary?.icon} aria-hidden=\"true\" />\n <span class=\"k2b-app-workspace__head-primary-label\">{props.head?.primary?.label}</span>\n </>\n );\n return (\n <div\n class=\"k2b-app-workspace__head\"\n data-trail={trail()?.ancestors.length ? \"up\" : trail() ? \"title\" : undefined}\n data-row={props.head ? \"\" : undefined}\n data-workspace-head-pane={mobilePane()}\n >\n <Show when={mobilePane()}>{(pane) => <style innerHTML={mobilePaneRule(pane())} />}</Show>\n <div class=\"k2b-app-workspace__head-lead\">\n <IconButton\n class=\"k2b-app-workspace__head-toggle\"\n label={messages().showNavigation}\n aria-controls={props.sidebarId()}\n aria-expanded=\"false\"\n data-app-workspace-sidebar-toggle=\"\"\n >\n <i class=\"ti ti-layout-sidebar\" aria-hidden=\"true\" />\n </IconButton>\n <Show when={trail()}>\n {(current) => (\n <>\n <PageTitle trail={current()} as=\"p\" fallback />\n {/* A head that never hydrates follows a new trail through followPageTrail. */}\n <h1 class=\"k2b-app-workspace__head-heading\" data-k2b-page-trail-title=\"\" data-k2b-server={isServer ? \"\" : undefined}>\n {current().title}\n </h1>\n </>\n )}\n </Show>\n <Show when={resolvedViews.toArray().some(Boolean)}>\n <div class=\"k2b-app-workspace__head-views\">{resolvedViews()}</div>\n </Show>\n <Show when={resolvedFilters.toArray().some(Boolean) || props.head?.filtered}>\n <div class=\"k2b-app-workspace__head-filters\" role=\"group\" aria-label={filters().filters}>\n {resolvedFilters()}\n <Show when={props.head?.filtered}>\n <Show\n when={props.head?.resetHref}\n fallback={\n <Button variant=\"ghost\" size=\"sm\" class=\"k2b-app-workspace__head-reset\" onClick={() => props.head?.onReset?.()}>\n {resetContent()}\n </Button>\n }\n >\n {(href) => (\n <ButtonLink\n variant=\"ghost\"\n size=\"sm\"\n class=\"k2b-app-workspace__head-reset\"\n href={href()}\n onClick={\n props.head?.onReset\n ? (event) => {\n if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;\n event.preventDefault();\n props.head?.onReset?.();\n }\n : undefined\n }\n >\n {resetContent()}\n </ButtonLink>\n )}\n </Show>\n </Show>\n </div>\n </Show>\n <Show\n when={props.head?.filtered && resolvedCount.toArray().some((value) => value !== undefined && value !== null && value !== false)}\n >\n <span class=\"k2b-app-workspace__head-count\">\n <span>{resolvedCount()}</span>\n </span>\n </Show>\n </div>\n <Show when={resolvedActions.toArray().some(Boolean) || props.head?.primary}>\n <div class=\"k2b-app-workspace__head-actions\">\n {resolvedActions()}\n <Show when={props.head?.primary}>\n {(primary) => (\n <Show\n when={primary().href}\n fallback={\n <Button\n variant=\"primary\"\n size=\"sm\"\n class=\"k2b-app-workspace__head-primary\"\n data-workspace-primary=\"\"\n onClick={primary().onClick}\n >\n {primaryContent()}\n </Button>\n }\n >\n {(href) => (\n <ButtonLink\n variant=\"primary\"\n size=\"sm\"\n class=\"k2b-app-workspace__head-primary\"\n data-workspace-primary=\"\"\n href={href()}\n onClick={primary().onClick}\n >\n {primaryContent()}\n </ButtonLink>\n )}\n </Show>\n )}\n </Show>\n </div>\n </Show>\n </div>\n );\n}\n\nconst AppWorkspace = ((props: AppWorkspaceProps) => {\n let root: HTMLDivElement | undefined;\n const serverLayoutState = useContext(LayoutStateContext);\n const nested = Boolean(useContext(WorkspaceContext));\n const [sidebarId, setSidebarId] = createSignal(`k2b-workspace-sidebar-${createUniqueId()}`);\n const initialLayoutState = () => props.layoutState?.() ?? serverLayoutState;\n const workspace = { sidebarId: sidebarId(), setSidebarId, initialLayoutState };\n\n // The resize handles are inert markup until the controller is attached, so\n // the workspace attaches it itself and scopes it to this root. `onMount`\n // never runs during SSR, and the disposer removes every listener. A host\n // shell may own one document-level controller for SSR and hydrated roots;\n // its marker keeps controller ownership singular without app-level props.\n onMount(() => {\n if (props.controller === false || !root || root.closest(\"[data-k2b-app-workspace-controller]\")) return;\n onCleanup(\n installAppWorkspaceController({\n root,\n readState: () => (props.layoutState ? props.layoutState() : serverLayoutState),\n writeState: (state) => props.onLayoutChange?.(state),\n }),\n );\n });\n\n const contents = () => {\n const resolved = children(() => props.children);\n const slots = createMemo(() => flatten(resolved()));\n // Same props object, same memo value: a sibling change must not rebuild the head's slots.\n const head = createMemo(() => slots().find(headSlot)?.props);\n // Keep one head instance at the explicit slot's position. Object links\n // before it must also precede its view controls in SSR and keyboard order.\n // Callers without a slot retain the automatic leading head.\n const renderedHead = <AppWorkspaceHead sidebarId={sidebarId} nested={nested} head={head()} />;\n // Without a head row its slot draws nothing either.\n if (props.head === false) return <>{slots().filter((value) => !headSlot(value)) as JSX.Element}</>;\n return (\n <>\n {\n (head()\n ? slots().map((value) => (headSlot(value) ? (value.props === head() ? renderedHead : null) : value))\n : [renderedHead, ...slots()]) as JSX.Element\n }\n </>\n );\n };\n\n return (\n <ResizeContext.Provider value={props.resizable !== false}>\n <WorkspaceContext.Provider value={workspace}>\n <div\n ref={root}\n class={`k2b-app-workspace ${props.class ?? \"\"}`}\n data-k2b-app-workspace\n data-mobile-surface={props.mobileSurface}\n data-flat={props.flat ? \"true\" : undefined}\n data-sidebar-collapsed={\n initialLayoutState()?.sidebarCollapsed === undefined ? undefined : String(initialLayoutState()?.sidebarCollapsed)\n }\n data-workspace-resizable={props.resizable === false ? \"false\" : \"true\"}\n style={appWorkspaceLayoutStyle(initialLayoutState())}\n >\n {contents()}\n </div>\n </WorkspaceContext.Provider>\n </ResizeContext.Provider>\n );\n}) as AppWorkspaceComponent;\n\nAppWorkspace.LayoutStateProvider = (props) => (\n <LayoutStateContext.Provider value={props.state ?? null}>{props.children}</LayoutStateContext.Provider>\n);\nAppWorkspace.Head = AppWorkspaceHeadSlot;\nAppWorkspace.Content = (props) => <div class={`k2b-app-workspace__content ${props.class ?? \"\"}`}>{props.children}</div>;\nAppWorkspace.Main = AppWorkspaceMain;\nAppWorkspace.MainPane = AppWorkspaceMainPane;\nAppWorkspace.Detail = AppWorkspaceDetail;\nAppWorkspace.BottomDrawer = AppWorkspaceBottomDrawer;\nAppWorkspace.Sidebar = AppWorkspaceSidebar;\nAppWorkspace.SidebarDesktop = AppWorkspaceSidebarDesktop;\nAppWorkspace.SidebarSwitcher = AppWorkspaceSidebarSwitcher;\nAppWorkspace.SidebarSection = AppWorkspaceSidebarSection;\nAppWorkspace.SidebarBody = AppWorkspaceSidebarBody;\nAppWorkspace.SidebarFooter = AppWorkspaceSidebarFooter;\nAppWorkspace.SidebarItem = AppWorkspaceSidebarItem;\nAppWorkspace.SidebarItemIcon = AppWorkspaceSidebarItemIcon;\nAppWorkspace.SidebarItemLabel = AppWorkspaceSidebarItemLabel;\nAppWorkspace.SidebarItemMeta = AppWorkspaceSidebarItemMeta;\nAppWorkspace.SidebarItemAction = AppWorkspaceSidebarItemAction;\nAppWorkspace.SidebarItemActions = AppWorkspaceSidebarItemActions;\nAppWorkspace.SidebarItemStatus = AppWorkspaceSidebarItemStatus;\nAppWorkspace.NavTree = AppWorkspaceNavTree;\nAppWorkspace.SidebarIconGrid = AppWorkspaceSidebarIconGrid;\nAppWorkspace.SidebarIconAction = AppWorkspaceSidebarIconAction;\n\nexport default AppWorkspace;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,IAAI,QAA2D,cAAc;AACtF,SACE,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,UAAU,EACV,UAAU,EACV,YAAY,EACZ,cAAc,EACd,GAAG,EACH,QAAQ,EAER,UAAU,EACV,EAAE,EACF,SAAS,EACT,OAAO,EACP,IAAI,EACJ,UAAU,QACL,UAAU;AACjB,SAAS,OAAO,EAAE,QAAQ,QAAQ,cAAc;AAChD,SAAS,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,QAAQ,mBAAmB;AAClF,SAAS,iBAAiB,QAAQ,4BAA4B;AAC9D,SAAS,UAAU,QAAQ,yBAAyB;AACpD,SAAS,OAAO,QAAQ,qBAAqB;AAC7C,SAAS,mBAAmB,QAAQ,0BAA0B;AAC9D,SACE,gCAAgC,EAChC,+BAA+B,EAC/B,+B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