{"version":3,"sources":["../src/react.ts"],"sourcesContent":["/**\n * React entry point for the Vana SDK direct Data Portability flow.\n *\n * @remarks\n * Exposes {@link useDirectVanaConnect} (and the underlying framework-agnostic\n * connect-flow store) for browser apps. This entry point is browser-safe and\n * imports nothing Node-only. `react` is a peer dependency.\n *\n * @example\n * ```tsx\n * \"use client\";\n * import { useDirectVanaConnect } from \"@opendatalabs/vana-sdk/react\";\n *\n * export function ConnectNotesButton() {\n *   const connect = useDirectVanaConnect({\n *     createRequest: () => fetch(\"/api/vana/request\", { method: \"POST\" }).then((r) => r.json()),\n *     getStatus: (id) => fetch(`/api/vana/status?requestId=${id}`).then((r) => r.json()),\n *     readResult: (id) => fetch(`/api/vana/data?requestId=${id}`).then((r) => r.json()),\n *   });\n *   const { state, start } = connect;\n *   return (\n *     <div>\n *       <button disabled={state.type !== \"idle\"} onClick={start} type=\"button\">\n *         {state.type === \"idle\" ? \"Connect Apple Notes\" : \"Connecting...\"}\n *       </button>\n *       {state.type === \"awaiting_approval\" && (\n *         // Fallback link: if the browser blocked the approval popup, the user\n *         // can still open it manually instead of the flow silently hanging.\n *         <a href={state.request.approvalUrl} target=\"_blank\" rel=\"noreferrer\">\n *           {state.popupBlocked ? \"Popup blocked — open approval\" : \"Open approval\"}\n *         </a>\n *       )}\n *       {state.type === \"ready_to_open\" && (\n *         // Mobile deep Direct: render the HTTPS continuation as a primary tap.\n *         // The SDK keeps polling in this tab; if the tab is lost, restart.\n *         <a href={state.mobileContinuationUrl} target=\"_blank\" rel=\"noreferrer\">\n *           Open Vana\n *         </a>\n *       )}\n *     </div>\n *   );\n * }\n * ```\n *\n * @category Direct\n * @module react\n */\n\nexport {\n  useDirectVanaConnect,\n  type UseDirectVanaConnectOptions,\n  type UseDirectVanaConnectResult,\n} from \"./direct/use-direct-vana-connect\";\n\n// Framework-agnostic store (usable without React).\nexport {\n  createDirectConnectFlow,\n  type ConnectWindow,\n  type DirectBrowserPlatform,\n  type DirectBrowserPlatformPolicy,\n  type DirectConnectFlow,\n  type DirectConnectRetryOutcome,\n  type DirectConnectState,\n  type DirectConnectOptions,\n  type DirectConnectTransports,\n} from \"./direct/connect-flow\";\n\n// Shared types useful when typing the transports.\nexport type {\n  ForegroundDelivery,\n  AccessRequest,\n  AccessRequestStatus,\n  AccessRequestStatusValue,\n  ApprovedDataResult,\n} from \"./direct/types\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgDA,qCAIO;AAGP,0BAUO;","names":[]}