{"version":3,"file":"chat-panel-context.cjs","sources":["../../../components/chat-panel/chat-panel-context.tsx"],"sourcesContent":["'use client';\n\nimport type { DraggableSyntheticListeners } from '@dnd-kit/core';\nimport { createContext, RefObject, useContext } from 'react';\n\nexport type ChatPanelMode = 'docked' | 'floating' | 'minimized';\nexport type ChatPanelSide = 'left' | 'right';\n\nexport interface ChatPanelContextValue {\n  mode: ChatPanelMode;\n  side: ChatPanelSide;\n  setMode: (mode: ChatPanelMode) => void;\n  minimize: () => void;\n  restore: () => void;\n  toggleFloating: () => void;\n  /** dnd-kit activator ref for the drag handle (the header). */\n  dragHandleRef: (element: HTMLElement | null) => void;\n  /** dnd-kit activator listeners; undefined while dragging is disabled. */\n  dragListeners: DraggableSyntheticListeners;\n  /** dnd-kit id of the minimized bubble's draggable. */\n  bubbleDraggableId: string;\n  /** The bubble element, so the root can measure it when a drag starts. */\n  bubbleElementRef: RefObject<HTMLElement | null>;\n}\n\nexport const ChatPanelContext = createContext<ChatPanelContextValue | null>(\n  null\n);\n\nexport function useChatPanelContext(part: string): ChatPanelContextValue {\n  const context = useContext(ChatPanelContext);\n  if (!context) {\n    throw new Error(`ChatPanel.${part} must be used within <ChatPanel>`);\n  }\n  return context;\n}\n"],"names":[],"mappings":";;;;;;AA6BM;AACJ;;AAEE;;AAEF;AACF;;;"}