{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "resizable",
  "type": "registry:ui",
  "title": "Resizable",
  "description": "Panels split by a draggable, keyboard-friendly divider.",
  "categories": [
    "layout"
  ],
  "dependencies": [],
  "registryDependencies": [
    "https://sprout.tulipfarm.ai/r/sprout-base.json"
  ],
  "files": [
    {
      "path": "registry/sprout/components/ui/resizable.tsx",
      "type": "registry:ui",
      "target": "components/ui/resizable.tsx",
      "content": "'use client';\n\nimport {\n  Children,\n  createContext,\n  Fragment,\n  isValidElement,\n  useCallback,\n  useContext,\n  useEffect,\n  useId,\n  useLayoutEffect,\n  useMemo,\n  useRef,\n  useState,\n  useSyncExternalStore,\n  type ComponentProps,\n  type CSSProperties,\n  type KeyboardEvent,\n  type PointerEvent,\n  type ReactNode,\n  type Ref,\n} from 'react';\nimport { cn } from '@/lib/sprout/classes';\n\nexport const resizableOrientationNames = ['horizontal', 'vertical'] as const;\n\nexport type ResizableOrientation = (typeof resizableOrientationNames)[number];\n\nexport type ResizableSize = number | string;\n\nexport type ResizableLayout = Record<string, number>;\n\nexport interface ResizableLayoutChangeDetails {\n  isUserInteraction: boolean;\n}\n\ninterface PanelEntry {\n  id: string;\n  element: HTMLElement;\n  defaultSize: ResizableSize | undefined;\n  minSize: ResizableSize | undefined;\n  maxSize: ResizableSize | undefined;\n}\n\ninterface Bounds {\n  min: number;\n  max: number;\n}\n\ninterface SeparatorLink {\n  before: string;\n  after: string;\n}\n\ninterface GroupContextValue {\n  orientation: ResizableOrientation;\n  layout: ResizableLayout;\n  autoSize: number;\n  bounds: Record<string, Bounds>;\n  links: Record<string, SeparatorLink>;\n  dragging: string | null;\n  registerPanel: (entry: PanelEntry) => () => void;\n  registerSeparator: (id: string, element: HTMLElement) => () => void;\n  startDrag: (id: string, event: PointerEvent<HTMLElement>) => void;\n  resizeWithKey: (id: string, key: string) => boolean;\n}\n\nconst GroupContext = createContext<GroupContextValue | null>(null);\n\nfunction useGroup(part: string) {\n  const context = useContext(GroupContext);\n  if (!context) throw new Error(`${part} must be used inside ResizablePanelGroup.`);\n  return context;\n}\n\nconst useIsomorphicLayoutEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect;\n\nconst KEYBOARD_STEP = 5;\nconst EPSILON = 0.001;\n\nfunction staticPercent(size: ResizableSize | undefined) {\n  if (typeof size !== 'string') return undefined;\n  const value = size.trim();\n  if (/^-?[\\d.]+%?$/.test(value)) return Number.parseFloat(value);\n  return undefined;\n}\n\nfunction toPercent(size: ResizableSize | undefined, available: number, element: HTMLElement): number | undefined {\n  if (size === undefined) return undefined;\n  const percent = staticPercent(size);\n  if (percent !== undefined) return percent;\n  if (available <= 0) return undefined;\n  let pixels: number;\n  if (typeof size === 'number') pixels = size;\n  else {\n    const value = Number.parseFloat(size);\n    const unit = size.trim().replace(/^-?[\\d.]+/, '');\n    const view = element.ownerDocument.defaultView;\n    const font = (node: Element) => Number.parseFloat(view?.getComputedStyle(node).fontSize ?? '') || 16;\n    if (unit === 'px') pixels = value;\n    else if (unit === 'rem') pixels = value * font(element.ownerDocument.documentElement);\n    else if (unit === 'em') pixels = value * font(element);\n    else if (unit === 'vw') pixels = (value * (view?.innerWidth ?? 0)) / 100;\n    else if (unit === 'vh') pixels = (value * (view?.innerHeight ?? 0)) / 100;\n    else return undefined;\n  }\n  return (pixels / available) * 100;\n}\n\nconst clamp = (value: number, { min, max }: Bounds) => Math.min(Math.max(value, min), max);\nconst total = (sizes: number[]) => sizes.reduce((sum, size) => sum + size, 0);\n\nfunction validate(sizes: number[], bounds: Bounds[]) {\n  const next = sizes.map((size, index) => clamp(size, bounds[index]!));\n  for (let pass = 0; pass < 8; pass += 1) {\n    const diff = 100 - total(next);\n    if (Math.abs(diff) < EPSILON) break;\n    const open = next.flatMap((size, index) =>\n      (diff > 0 ? size < bounds[index]!.max : size > bounds[index]!.min) ? [index] : [],\n    );\n    if (!open.length) break;\n    for (const index of open) next[index] = clamp(next[index]! + diff / open.length, bounds[index]!);\n  }\n  const sum = total(next);\n  return Math.abs(sum - 100) < EPSILON || sum <= 0 ? next : next.map(size => (size / sum) * 100);\n}\n\nfunction resize(base: number[], bounds: Bounds[], pivot: number, delta: number) {\n  const next = [...base];\n  if (Math.abs(delta) < EPSILON) return next;\n  const grow = delta > 0 ? pivot : pivot + 1;\n  const shrink =\n    delta > 0\n      ? next.map((_, index) => index).slice(pivot + 1)\n      : next\n          .map((_, index) => index)\n          .slice(0, pivot + 1)\n          .reverse();\n  const room = Math.min(bounds[grow]!.max - next[grow]!, total(shrink.map(index => next[index]! - bounds[index]!.min)));\n  let remaining = Math.max(0, Math.min(Math.abs(delta), room));\n  next[grow] = next[grow]! + remaining;\n  for (const index of shrink) {\n    const take = Math.min(remaining, next[index]! - bounds[index]!.min);\n    next[index] = next[index]! - take;\n    remaining -= take;\n    if (remaining < EPSILON) break;\n  }\n  return next;\n}\n\nfunction sameLayout(a: ResizableLayout, b: ResizableLayout) {\n  const keys = Object.keys(a);\n  return keys.length === Object.keys(b).length && keys.every(key => key in b && Math.abs(a[key]! - b[key]!) < EPSILON);\n}\n\nfunction collectPanelProps(children: ReactNode, found: ResizablePanelProps[] = []) {\n  Children.forEach(children, child => {\n    if (!isValidElement<{ children?: ReactNode }>(child)) return;\n    if (child.type === ResizablePanel) found.push(child.props as ResizablePanelProps);\n    else if (child.type === Fragment) collectPanelProps(child.props.children, found);\n  });\n  return found;\n}\n\nfunction assignRef<T>(ref: Ref<T> | undefined, value: T | null) {\n  if (typeof ref === 'function') ref(value);\n  else if (ref) ref.current = value;\n}\n\nexport interface ResizablePanelGroupProps extends ComponentProps<'div'> {\n  orientation?: ResizableOrientation;\n  defaultLayout?: ResizableLayout | undefined;\n  onLayoutChange?: ((layout: ResizableLayout) => void) | undefined;\n  onLayoutChanged?: ((layout: ResizableLayout, details: ResizableLayoutChangeDetails) => void) | undefined;\n}\n\nexport function ResizablePanelGroup({\n  orientation = 'horizontal',\n  defaultLayout,\n  onLayoutChange,\n  onLayoutChanged,\n  className,\n  children,\n  ref,\n  ...props\n}: ResizablePanelGroupProps) {\n  const element = useRef<HTMLDivElement | null>(null);\n  const panels = useRef(new Map<string, PanelEntry>());\n  const separators = useRef(new Map<string, HTMLElement>());\n  const [version, setVersion] = useState(0);\n  const [extent, setExtent] = useState(0);\n  const [layout, setLayout] = useState<ResizableLayout>({});\n  const [bounds, setBounds] = useState<Record<string, Bounds>>({});\n  const [links, setLinks] = useState<Record<string, SeparatorLink>>({});\n  const [dragging, setDragging] = useState<string | null>(null);\n  const layoutRef = useRef(layout);\n  const panelKey = useRef<string | null>(null);\n  const defaultsKey = useRef<string | null>(null);\n  const interacted = useRef(false);\n  const callbacks = useRef({ onLayoutChange, onLayoutChanged });\n  callbacks.current = { onLayoutChange, onLayoutChanged };\n  const horizontal = orientation === 'horizontal';\n\n  const autoSize = useMemo(() => {\n    const declared = collectPanelProps(children).map(panel => staticPercent(panel.defaultSize));\n    const unknown = declared.filter(size => size === undefined).length;\n    const known = total(declared.filter((size): size is number => size !== undefined));\n    return unknown ? Math.max(0, 100 - known) / unknown : 0;\n  }, [children]);\n\n  const ordered = useCallback(\n    () =>\n      [...panels.current.values()].sort((a, b) =>\n        a.element.compareDocumentPosition(b.element) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1,\n      ),\n    [],\n  );\n\n  const available = useCallback(() => {\n    const root = element.current;\n    if (!root) return 0;\n    let size = horizontal ? root.clientWidth : root.clientHeight;\n    for (const separator of separators.current.values())\n      size -= horizontal ? separator.offsetWidth : separator.offsetHeight;\n    return Math.max(0, size);\n  }, [horizontal]);\n\n  const measureBounds = useCallback(\n    (entries: PanelEntry[]) => {\n      const space = available();\n      return entries.map(entry => {\n        const min = toPercent(entry.minSize, space, entry.element) ?? 0;\n        const max = toPercent(entry.maxSize, space, entry.element) ?? 100;\n        return {\n          min: Math.min(Math.max(min, 0), 100),\n          max: Math.max(Math.min(max, 100), Math.min(Math.max(min, 0), 100)),\n        };\n      });\n    },\n    [available],\n  );\n\n  const commit = useCallback((ids: string[], sizes: number[], settled: ResizableLayoutChangeDetails | null) => {\n    const next = Object.fromEntries(ids.map((id, index) => [id, sizes[index]!]));\n    if (!sameLayout(next, layoutRef.current)) {\n      layoutRef.current = next;\n      setLayout(next);\n      callbacks.current.onLayoutChange?.(next);\n    } else if (!settled) return;\n    if (settled) callbacks.current.onLayoutChanged?.(next, settled);\n  }, []);\n\n  const defaultLayoutKey = defaultLayout ? JSON.stringify(defaultLayout) : '';\n  useIsomorphicLayoutEffect(() => {\n    const entries = ordered();\n    const ids = entries.map(entry => entry.id);\n    const key = ids.join('\\u0000');\n    const limits = measureBounds(entries);\n    const changedPanels = key !== panelKey.current;\n    const changedDefaults = defaultLayoutKey !== defaultsKey.current;\n    if (changedPanels) interacted.current = false;\n    let sizes: number[];\n    if (changedPanels || (changedDefaults && !interacted.current)) {\n      const saved =\n        defaultLayout && ids.length && ids.every(id => typeof defaultLayout[id] === 'number')\n          ? ids.map(id => defaultLayout[id]!)\n          : null;\n      if (saved) sizes = saved;\n      else {\n        const space = available();\n        const declared = entries.map(entry => toPercent(entry.defaultSize, space, entry.element));\n        const unknown = declared.filter(size => size === undefined).length;\n        const rest =\n          Math.max(0, 100 - total(declared.filter((size): size is number => size !== undefined))) /\n          Math.max(unknown, 1);\n        sizes = declared.map(size => size ?? rest);\n      }\n    } else sizes = ids.map(id => layoutRef.current[id] ?? 0);\n    const before = layoutRef.current;\n    const next = validate(sizes, limits);\n    const nextLayout = Object.fromEntries(ids.map((id, index) => [id, next[index]!]));\n    commit(ids, next, null);\n    if (changedPanels || !sameLayout(before, nextLayout))\n      callbacks.current.onLayoutChanged?.(nextLayout, {\n        isUserInteraction: false,\n      });\n    panelKey.current = key;\n    defaultsKey.current = defaultLayoutKey;\n    const nextBounds = Object.fromEntries(ids.map((id, index) => [id, limits[index]!]));\n    setBounds(current => (JSON.stringify(current) === JSON.stringify(nextBounds) ? current : nextBounds));\n    const nextLinks: Record<string, SeparatorLink> = {};\n    for (const [separatorId, separator] of separators.current) {\n      let previous: PanelEntry | undefined;\n      let following: PanelEntry | undefined;\n      for (const entry of entries) {\n        if (separator.compareDocumentPosition(entry.element) & Node.DOCUMENT_POSITION_PRECEDING) previous = entry;\n        else {\n          following = entry;\n          break;\n        }\n      }\n      if (previous && following) nextLinks[separatorId] = { before: previous.id, after: following.id };\n    }\n    setLinks(current => (JSON.stringify(current) === JSON.stringify(nextLinks) ? current : nextLinks));\n  }, [version, extent, defaultLayoutKey, ordered, measureBounds, available, commit]);\n\n  useEffect(() => {\n    const root = element.current;\n    if (!root || typeof ResizeObserver === 'undefined') return;\n    const observer = new ResizeObserver(() => setExtent(Math.round(available())));\n    observer.observe(root);\n    return () => observer.disconnect();\n  }, [available]);\n\n  const registerPanel = useCallback((entry: PanelEntry) => {\n    panels.current.set(entry.id, entry);\n    setVersion(value => value + 1);\n    return () => {\n      if (panels.current.get(entry.id) === entry) panels.current.delete(entry.id);\n      setVersion(value => value + 1);\n    };\n  }, []);\n\n  const registerSeparator = useCallback((id: string, node: HTMLElement) => {\n    separators.current.set(id, node);\n    setVersion(value => value + 1);\n    return () => {\n      separators.current.delete(id);\n      setVersion(value => value + 1);\n    };\n  }, []);\n\n  const pivotFor = useCallback(\n    (separatorId: string) => {\n      const separator = separators.current.get(separatorId);\n      if (!separator) return null;\n      const entries = ordered();\n      let pivot = -1;\n      entries.forEach((entry, index) => {\n        if (separator.compareDocumentPosition(entry.element) & Node.DOCUMENT_POSITION_PRECEDING) pivot = index;\n      });\n      if (pivot < 0 || pivot >= entries.length - 1) return null;\n      const ids = entries.map(entry => entry.id);\n      return {\n        ids,\n        pivot,\n        base: ids.map(id => layoutRef.current[id] ?? 0),\n        limits: measureBounds(entries),\n      };\n    },\n    [ordered, measureBounds],\n  );\n\n  const reversed = useCallback(\n    () => horizontal && !!element.current && getComputedStyle(element.current).direction === 'rtl',\n    [horizontal],\n  );\n\n  const startDrag = useCallback(\n    (separatorId: string, event: PointerEvent<HTMLElement>) => {\n      const target = pivotFor(separatorId);\n      if (!target) return;\n      event.preventDefault();\n      const handle = event.currentTarget;\n      const pointerId = event.pointerId;\n      const origin = horizontal ? event.clientX : event.clientY;\n      const space = available();\n      const direction = reversed() ? -1 : 1;\n      const ownerDocument = handle.ownerDocument;\n      const root = ownerDocument.documentElement;\n      const previousCursor = root.style.cursor;\n      const previousSelect = root.style.userSelect;\n      root.style.cursor = horizontal ? 'col-resize' : 'row-resize';\n      root.style.userSelect = 'none';\n      handle.setPointerCapture?.(pointerId);\n      handle.focus({ preventScroll: true });\n      setDragging(separatorId);\n      let latest = target.base;\n      const move = (moveEvent: globalThis.PointerEvent) => {\n        if (moveEvent.pointerId !== pointerId || space <= 0) return;\n        const position = horizontal ? moveEvent.clientX : moveEvent.clientY;\n        const delta = (((position - origin) * direction) / space) * 100;\n        latest = resize(target.base, target.limits, target.pivot, delta);\n        commit(target.ids, latest, null);\n      };\n      const end = (endEvent: globalThis.PointerEvent) => {\n        if (endEvent.pointerId !== pointerId) return;\n        handle.removeEventListener('pointermove', move);\n        handle.removeEventListener('pointerup', end);\n        handle.removeEventListener('pointercancel', end);\n        handle.releasePointerCapture?.(pointerId);\n        root.style.cursor = previousCursor;\n        root.style.userSelect = previousSelect;\n        setDragging(null);\n        interacted.current = true;\n        commit(target.ids, latest, { isUserInteraction: true });\n      };\n      handle.addEventListener('pointermove', move);\n      handle.addEventListener('pointerup', end);\n      handle.addEventListener('pointercancel', end);\n    },\n    [pivotFor, horizontal, available, reversed, commit],\n  );\n\n  const resizeWithKey = useCallback(\n    (separatorId: string, key: string) => {\n      const target = pivotFor(separatorId);\n      if (!target) return false;\n      const { base, limits, pivot } = target;\n      const forward = reversed() ? -KEYBOARD_STEP : KEYBOARD_STEP;\n      let delta: number;\n      if (key === (horizontal ? 'ArrowRight' : 'ArrowDown')) delta = forward;\n      else if (key === (horizontal ? 'ArrowLeft' : 'ArrowUp')) delta = -forward;\n      else if (key === 'Home') delta = limits[pivot]!.min - base[pivot]!;\n      else if (key === 'End') delta = limits[pivot]!.max - base[pivot]!;\n      else return false;\n      interacted.current = true;\n      commit(target.ids, resize(base, limits, pivot, delta), {\n        isUserInteraction: true,\n      });\n      return true;\n    },\n    [pivotFor, horizontal, reversed, commit],\n  );\n\n  const context = useMemo<GroupContextValue>(\n    () => ({\n      orientation,\n      layout,\n      autoSize,\n      bounds,\n      links,\n      dragging,\n      registerPanel,\n      registerSeparator,\n      startDrag,\n      resizeWithKey,\n    }),\n    [\n      orientation,\n      layout,\n      autoSize,\n      bounds,\n      links,\n      dragging,\n      registerPanel,\n      registerSeparator,\n      startDrag,\n      resizeWithKey,\n    ],\n  );\n\n  return (\n    <GroupContext value={context}>\n      <div\n        data-slot=\"resizable-panel-group\"\n        data-orientation={orientation}\n        data-dragging={dragging ? '' : undefined}\n        className={cn('sprout-resizable-group', className)}\n        ref={node => {\n          element.current = node;\n          assignRef(ref, node);\n        }}\n        {...props}\n      >\n        {children}\n      </div>\n    </GroupContext>\n  );\n}\n\nexport interface ResizablePanelProps extends Omit<ComponentProps<'div'>, 'id'> {\n  id?: string;\n  defaultSize?: ResizableSize | undefined;\n  minSize?: ResizableSize | undefined;\n  maxSize?: ResizableSize | undefined;\n}\n\nexport function ResizablePanel({\n  id: idProp,\n  defaultSize,\n  minSize,\n  maxSize,\n  className,\n  style,\n  ref,\n  ...props\n}: ResizablePanelProps) {\n  const group = useGroup('ResizablePanel');\n  const generated = useId();\n  const id = idProp ?? generated;\n  const element = useRef<HTMLDivElement | null>(null);\n  const { registerPanel } = group;\n  useIsomorphicLayoutEffect(() => {\n    if (!element.current) return;\n    return registerPanel({\n      id,\n      element: element.current,\n      defaultSize,\n      minSize,\n      maxSize,\n    });\n  }, [registerPanel, id, defaultSize, minSize, maxSize]);\n  const size = group.layout[id] ?? staticPercent(defaultSize) ?? group.autoSize;\n  const flex: CSSProperties = { flexGrow: size, flexShrink: 1, flexBasis: 0 };\n  return (\n    <div\n      data-slot=\"resizable-panel\"\n      data-panel-id={id}\n      id={id}\n      className={cn('sprout-resizable-panel', className)}\n      ref={node => {\n        element.current = node;\n        assignRef(ref, node);\n      }}\n      {...props}\n      style={{ ...style, ...flex }}\n    />\n  );\n}\n\nexport interface ResizableHandleProps extends ComponentProps<'div'> {\n  withHandle?: boolean;\n}\n\nexport function ResizableHandle({\n  withHandle = false,\n  className,\n  children,\n  onPointerDown,\n  onKeyDown,\n  ref,\n  ...props\n}: ResizableHandleProps) {\n  const group = useGroup('ResizableHandle');\n  const id = useId();\n  const element = useRef<HTMLDivElement | null>(null);\n  const { registerSeparator } = group;\n  useIsomorphicLayoutEffect(() => {\n    if (!element.current) return;\n    return registerSeparator(id, element.current);\n  }, [registerSeparator, id]);\n  const link = group.links[id];\n  const value = link ? group.layout[link.before] : undefined;\n  let limits: Bounds | undefined;\n  if (link && group.bounds[link.before]) {\n    const own = group.bounds[link.before]!;\n    const others = Object.entries(group.bounds).filter(([key]) => key !== link.before);\n    limits = {\n      min: Math.max(own.min, 100 - total(others.map(([, bound]) => bound.max))),\n      max: Math.min(own.max, 100 - total(others.map(([, bound]) => bound.min))),\n    };\n  }\n  const lineOrientation = group.orientation === 'horizontal' ? 'vertical' : 'horizontal';\n  return (\n    <div\n      role=\"separator\"\n      tabIndex={0}\n      aria-orientation={lineOrientation}\n      aria-controls={link?.before}\n      aria-valuenow={value === undefined ? undefined : Math.round(value)}\n      aria-valuemin={limits ? Math.round(limits.min) : 0}\n      aria-valuemax={limits ? Math.round(limits.max) : 100}\n      data-slot=\"resizable-handle\"\n      data-orientation={lineOrientation}\n      data-with-handle={withHandle ? '' : undefined}\n      data-dragging={group.dragging === id ? '' : undefined}\n      className={cn('sprout-resizable-handle', className)}\n      ref={node => {\n        element.current = node;\n        assignRef(ref, node);\n      }}\n      onPointerDown={event => {\n        onPointerDown?.(event);\n        if (event.defaultPrevented || event.button !== 0) return;\n        group.startDrag(id, event);\n      }}\n      onKeyDown={(event: KeyboardEvent<HTMLDivElement>) => {\n        onKeyDown?.(event);\n        if (event.defaultPrevented) return;\n        if (group.resizeWithKey(id, event.key)) event.preventDefault();\n      }}\n      {...props}\n    >\n      {withHandle && <span aria-hidden=\"true\" data-slot=\"resizable-handle-grip\" className=\"sprout-resizable-grip\" />}\n      {children}\n    </div>\n  );\n}\n\nexport interface UseResizableLayoutOptions {\n  id: string;\n  panelIds?: readonly string[] | undefined;\n  onlySaveAfterUserInteractions?: boolean | undefined;\n  storage?: Pick<Storage, 'getItem' | 'setItem'> | undefined;\n}\n\nexport interface ResizableLayoutStore {\n  defaultLayout: ResizableLayout | undefined;\n  onLayoutChanged: (layout: ResizableLayout, details: ResizableLayoutChangeDetails) => void;\n}\n\nconst storageListeners = new Set<() => void>();\n\nfunction browserStorage() {\n  try {\n    return typeof window === 'undefined' ? undefined : window.localStorage;\n  } catch {\n    return undefined;\n  }\n}\n\nexport function useResizableLayout({\n  id,\n  panelIds,\n  onlySaveAfterUserInteractions = false,\n  storage,\n}: UseResizableLayoutOptions): ResizableLayoutStore {\n  const key = `sprout-resizable:${id}${panelIds ? `:${panelIds.join(',')}` : ''}`;\n  const subscribe = useCallback((listener: () => void) => {\n    storageListeners.add(listener);\n    window.addEventListener('storage', listener);\n    return () => {\n      storageListeners.delete(listener);\n      window.removeEventListener('storage', listener);\n    };\n  }, []);\n  const raw = useSyncExternalStore(\n    subscribe,\n    () => {\n      try {\n        return (storage ?? browserStorage())?.getItem(key) ?? null;\n      } catch {\n        return null;\n      }\n    },\n    () => null,\n  );\n  const defaultLayout = useMemo(() => {\n    if (!raw) return undefined;\n    try {\n      const parsed: unknown = JSON.parse(raw);\n      if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) return undefined;\n      const entries = Object.entries(parsed);\n      return entries.every(([, size]) => typeof size === 'number' && Number.isFinite(size))\n        ? (Object.fromEntries(entries) as ResizableLayout)\n        : undefined;\n    } catch {\n      return undefined;\n    }\n  }, [raw]);\n  const onLayoutChanged = useCallback(\n    (layout: ResizableLayout, details: ResizableLayoutChangeDetails) => {\n      if (onlySaveAfterUserInteractions && !details.isUserInteraction) return;\n      const value = JSON.stringify(layout);\n      try {\n        const target = storage ?? browserStorage();\n        if (!target || target.getItem(key) === value) return;\n        target.setItem(key, value);\n      } catch {\n        return;\n      }\n      for (const listener of storageListeners) listener();\n    },\n    [key, onlySaveAfterUserInteractions, storage],\n  );\n  return { defaultLayout, onLayoutChanged };\n}\n"
    }
  ],
  "css": {
    "@layer components": {
      ".sprout-resizable-group": {
        "width": "100%",
        "min-width": "0",
        "height": "100%",
        "min-height": "0",
        "display": "flex",
        "overflow": "hidden"
      },
      ".sprout-resizable-group[data-orientation=\"vertical\"]": {
        "flex-direction": "column"
      },
      ".sprout-resizable-panel": {
        "min-width": "0",
        "min-height": "0",
        "position": "relative",
        "overflow": "hidden"
      },
      ".sprout-resizable-handle": {
        "z-index": "1",
        "background": "var(--sprout-line)",
        "touch-action": "none",
        "user-select": "none",
        "outline": "none",
        "flex": "none",
        "justify-content": "center",
        "align-items": "center",
        "display": "flex",
        "position": "relative"
      },
      ".sprout-resizable-handle[data-orientation=\"vertical\"]": {
        "cursor": "col-resize",
        "width": "1px"
      },
      ".sprout-resizable-handle[data-orientation=\"horizontal\"]": {
        "cursor": "row-resize",
        "height": "1px"
      },
      ".sprout-resizable-handle:after": {
        "content": "\"\"",
        "position": "absolute"
      },
      ".sprout-resizable-handle[data-orientation=\"vertical\"]:after": {
        "inset-block": "0",
        "width": "9px",
        "left": "50%",
        "transform": "translateX(-50%)"
      },
      ".sprout-resizable-handle[data-orientation=\"horizontal\"]:after": {
        "inset-inline": "0",
        "height": "9px",
        "top": "50%",
        "transform": "translateY(-50%)"
      },
      "@media (hover: hover)": {
        ".sprout-resizable-handle:hover": {
          "background": "var(--sprout-border)"
        },
        ".sprout-resizable-handle:hover .sprout-resizable-grip": {
          "background": "var(--sprout-border-strong)"
        }
      },
      ".sprout-resizable-handle[data-dragging], .sprout-resizable-handle:focus-visible": {
        "background": "var(--sprout-focus)"
      },
      ".sprout-resizable-handle:focus-visible": {
        "box-shadow": "0 0 0 1px var(--sprout-focus)"
      },
      ".sprout-resizable-grip": {
        "background": "var(--sprout-border)",
        "border-radius": "999px",
        "flex": "none"
      },
      ".sprout-resizable-handle[data-orientation=\"vertical\"] .sprout-resizable-grip": {
        "width": "6px",
        "height": "24px"
      },
      ".sprout-resizable-handle[data-orientation=\"horizontal\"] .sprout-resizable-grip": {
        "width": "24px",
        "height": "6px"
      },
      ".sprout-resizable-handle[data-dragging] .sprout-resizable-grip, .sprout-resizable-handle:focus-visible .sprout-resizable-grip": {
        "background": "var(--sprout-focus)"
      },
      "@media (pointer: coarse)": {
        ".sprout-resizable-handle[data-orientation=\"vertical\"]:after": {
          "width": "24px"
        },
        ".sprout-resizable-handle[data-orientation=\"horizontal\"]:after": {
          "height": "24px"
        }
      },
      "@media (prefers-reduced-motion: no-preference)": {
        ".sprout-resizable-handle, .sprout-resizable-grip": {
          "transition": "background-color var(--sprout-motion-fast) var(--sprout-motion-ease),\n        box-shadow var(--sprout-motion-fast) var(--sprout-motion-ease)"
        }
      }
    }
  },
  "docs": "Docs and examples: https://sprout.tulipfarm.ai/components/resizable/",
  "meta": {
    "source": "packages/sprout/src/components/resizable.tsx"
  }
}
