{"version":3,"sources":["../components/widgets/dialog-manager/context.tsx"],"sourcesContent":["\"use client\";\nimport { createContext, useContext } from 'react';\nimport { TypedDialogComponent } from './types';\n\ntype DialogContextType = {\n  openDialog: <A, R>(Component: TypedDialogComponent<A, R>, args: A) => Promise<R>;\n};\n\nexport const DialogContext = createContext<DialogContextType | null>(null);\n\nexport function useDialog() {\n  const ctx = useContext(DialogContext);\n  if (!ctx) throw new Error('useDialog must be used within a DialogProvider');\n  return ctx;\n}\n\nexport function createTypedDialog<Args, Return>(\n  component: TypedDialogComponent<Args, Return>,\n): TypedDialogComponent<Args, Return> {\n  return component;\n}\n"],"mappings":";AACA,SAAS,eAAe,kBAAkB;AAOnC,IAAM,gBAAgB,cAAwC,IAAI;AAElE,SAAS,YAAY;AAC1B,QAAM,MAAM,WAAW,aAAa;AACpC,MAAI,CAAC,IAAK,OAAM,IAAI,MAAM,gDAAgD;AAC1E,SAAO;AACT;AAEO,SAAS,kBACd,WACoC;AACpC,SAAO;AACT;","names":[]}