
import { C as Run, D as RunType } from "./flag-CiR2E5oz.js";
import { a as RunFormParamTypes, d as ViewOptionTypes, i as RegistryEntry, l as RunTypeConfig, o as RunFormProps, r as RefTypes, s as RunResultViewProps } from "./types-piNWusq2.js";
import { r as DataGridHandle } from "./ScreenshotDataGrid-CeuGj_hE.js";
import * as react2 from "react";
import { ComponentType, ForwardRefExoticComponent, ReactNode, Ref, RefAttributes } from "react";
import * as react_jsx_runtime4 from "react/jsx-runtime";
import { IconBaseProps } from "react-icons";

//#region src/components/run/RunListOss.d.ts

/**
 * RunListOss Component - OSS wrapper
 *
 * Provides the History panel with run list, integrating with OSS-specific
 * contexts, tracking, and navigation.
 *
 * @example
 * ```tsx
 * <RunListOss />
 * ```
 */
declare function RunListOss(): react_jsx_runtime4.JSX.Element;
//#endregion
//#region src/components/run/RunModal.d.ts
/**
 * Props for the RunModal component.
 *
 * @template PT - The type of form parameters used by the RunForm component
 */
interface RunModalProps$1<PT = unknown> {
  /** Whether the modal is currently open */
  isOpen: boolean;
  /** Callback when the modal is closed (via X button, backdrop click, or escape key) */
  onClose: () => void;
  /** Callback when the execute button is clicked with valid parameters */
  onExecute: (type: RunType, params: PT) => void;
  /** The title displayed in the modal header */
  title: string;
  /** The run type being configured */
  type: RunType;
  /** Initial/default parameters for the form */
  params?: PT;
  /** The initial run to display (for edit scenarios) */
  initialRun?: Run;
  /** The form component to render for configuring run parameters */
  RunForm?: ComponentType<RunFormProps<PT>>;
  /**
   * Optional callback when the modal is cancelled (X button clicked without executing).
   * Use this for analytics/tracking of form cancellations.
   */
  onCancel?: () => void;
  /**
   * Optional callback when execute is clicked.
   * Use this for analytics/tracking of form submissions.
   */
  onExecuteClick?: () => void;
  /**
   * Optional documentation URL for the run type.
   * If provided, an info icon will be shown that links to the documentation.
   */
  documentationUrl?: string | null;
  /**
   * Optional icon component to display next to the documentation link.
   * Can be any component - will be wrapped by MUI Box with fontSize styling.
   * Compatible with react-icons, custom SVG components, or MUI icons.
   */
  InfoIcon?: ComponentType<IconBaseProps>;
}
/**
 * RunModal - A dialog for configuring and executing runs.
 *
 * This component renders a modal dialog with:
 * - A title with optional documentation link
 * - A form for configuring run parameters (optional)
 * - Execute and close actions
 *
 * The modal supports dependency injection for:
 * - Form component (`RunForm`) - for run-type-specific parameter forms
 * - Tracking callbacks (`onCancel`, `onExecuteClick`) - for analytics
 * - Documentation URL (`documentationUrl`) - for help links
 * - Info icon (`InfoIcon`) - for customizing the documentation link icon
 *
 * @example
 * ```tsx
 * <RunModal
 *   isOpen={isOpen}
 *   onClose={handleClose}
 *   onExecute={handleExecute}
 *   title="Profile Diff"
 *   type="profile_diff"
 *   params={{ model: "my_model" }}
 *   RunForm={ProfileDiffForm}
 *   documentationUrl="https://docs.datarecce.io/features/lineage/#profile-diff"
 * />
 * ```
 */
declare function RunModal<PT = unknown>({
  isOpen,
  onClose,
  onExecute,
  type,
  title,
  params: defaultParams,
  RunForm,
  onCancel,
  onExecuteClick,
  documentationUrl,
  InfoIcon
}: RunModalProps$1<PT>): react_jsx_runtime4.JSX.Element;
//#endregion
//#region src/components/run/RunModalOss.d.ts
/**
 * OSS-specific props for RunModal.
 * Extends the base props with OSS form parameter types.
 */
interface RunModalProps {
  /** Whether the modal is currently open */
  isOpen: boolean;
  /** Callback when the modal is closed */
  onClose: () => void;
  /** Callback when the execute button is clicked */
  onExecute: (type: RunType, params: RunFormParamTypes) => void;
  /** The title displayed in the modal header */
  title: string;
  /** The run type being configured */
  type: RunType;
  /** Initial/default parameters for the form */
  params?: RunFormParamTypes;
  /** The initial run to display (for edit scenarios) */
  initialRun?: Run;
  /** The form component to render for configuring run parameters */
  RunForm?: ComponentType<RunFormProps<RunFormParamTypes>>;
}
/**
 * OSS RunModal - Wraps @datarecce/ui's RunModal with OSS-specific behavior.
 *
 * This wrapper:
 * - Injects tracking callbacks for form cancellation and execution
 * - Provides documentation URLs based on run type
 * - Uses the OSS IconInfo component for the documentation link
 *
 * @example
 * ```tsx
 * <RunModal
 *   isOpen={isOpen}
 *   onClose={handleClose}
 *   onExecute={handleExecute}
 *   title="Profile Diff"
 *   type="profile_diff"
 *   params={{ model: "my_model" }}
 *   RunForm={ProfileDiffForm}
 * />
 * ```
 */
declare function RunModalOss({
  isOpen,
  onClose,
  onExecute,
  type,
  title,
  params,
  initialRun,
  RunForm
}: RunModalProps): react_jsx_runtime4.JSX.Element;
//#endregion
//#region src/components/run/RunResultPane.d.ts
/**
 * Tab values for the run result pane
 */
type RunResultPaneTabValue = "result" | "params" | "query";
/**
 * Props for CSV export functionality
 */
interface CSVExportProps {
  /** Whether CSV export is available */
  canExportCSV: boolean;
  /** Copy data as CSV to clipboard */
  copyAsCSV: () => Promise<void>;
  /** Download data as CSV file */
  downloadAsCSV: () => void;
}
/**
 * Props for the export menu component
 */
interface RunResultExportMenuProps {
  /** The current run */
  run?: Run;
  /** Whether export is disabled */
  disableExport: boolean;
  /** Handler for copy as image */
  onCopyAsImage: () => Promise<void>;
  /** Handler for mouse enter (for highlight effect) */
  onMouseEnter?: () => void;
  /** Handler for mouse leave (for highlight effect) */
  onMouseLeave?: () => void;
  /** CSV export functionality */
  csvExport?: CSVExportProps;
}
/**
 * Props for the share menu component
 */
interface RunResultShareMenuProps extends RunResultExportMenuProps {
  /** Whether user is authenticated */
  authed?: boolean;
  /** Handler for share to cloud */
  onShareToCloud?: () => Promise<void>;
  /** Handler for showing auth modal when not authenticated */
  onShowAuthModal?: () => void;
}
/**
 * Props for the Add to Check button
 */
interface AddToCheckButtonProps {
  /** The current run ID */
  runId?: string;
  /** The current run */
  run?: Run;
  /** Whether the button is disabled due to feature toggle */
  disableUpdateChecklist?: boolean;
  /** Whether there's an error */
  hasError?: boolean;
  /** Handler for navigating to existing check */
  onGoToCheck?: (checkId: string) => void;
  /** Handler for adding run to checklist */
  onAddToChecklist?: () => Promise<void>;
}
/**
 * Props for the single environment setup notification
 */
interface SingleEnvironmentNotificationProps {
  /** The run type */
  runType?: string;
  /** Component to render the notification */
  NotificationComponent?: ComponentType<{
    runType?: string;
    onClose: () => void;
  }>;
}
/**
 * Props for the SQL editor components
 */
interface SqlEditorProps {
  /** SQL query value */
  value: string;
  /** Base SQL query value (for diff views) */
  baseValue?: string;
  /** Whether the editor is read-only */
  readOnly?: boolean;
}
/**
 * Props for RunResultPane component.
 * Uses dependency injection for OSS-specific behavior.
 */
interface RunResultPaneProps<VO = unknown, RefType = unknown> {
  /** The run ID */
  runId?: string;
  /** The run object */
  run?: Run;
  /** Whether the run is currently executing */
  isRunning?: boolean;
  /** Error object if run failed */
  error?: Error | null;
  /** Current view options */
  viewOptions?: VO;
  /** Callback when view options change */
  onViewOptionsChanged?: (viewOptions: VO) => void;
  /** Whether this is a single environment (base not configured) */
  isSingleEnvironment?: boolean;
  /** Disable database query execution */
  disableDatabaseQuery?: boolean;
  /** Disable share functionality (show export menu instead) */
  disableShare?: boolean;
  /** Disable update checklist functionality */
  disableUpdateChecklist?: boolean;
  /** Handler for closing the pane */
  onClose?: () => void;
  /** Handler for cancelling a running query */
  onCancel?: () => void;
  /** Handler for re-running the query */
  onRerun?: () => void;
  /** Handler for copying as image */
  onCopyAsImage?: () => Promise<void>;
  /** Mouse enter handler for copy button highlight */
  onCopyMouseEnter?: () => void;
  /** Mouse leave handler for copy button highlight */
  onCopyMouseLeave?: () => void;
  /** CSV export functionality */
  csvExport?: CSVExportProps;
  /** Whether user is authenticated (for share menu) */
  authed?: boolean;
  /** Handler for share to cloud */
  onShareToCloud?: () => Promise<void>;
  /** Handler for showing auth modal */
  onShowAuthModal?: () => void;
  /** Optional tracking callback for copy to clipboard */
  onTrackCopyToClipboard?: (type: string, from: string) => void;
  /** Handler for navigating to existing check */
  onGoToCheck?: (checkId: string) => void;
  /** Handler for adding run to checklist */
  onAddToChecklist?: () => Promise<void>;
  /** Custom notification component for single environment setup */
  SingleEnvironmentNotification?: ComponentType<{
    runType?: string;
    onClose: () => void;
  }>;
  /** Custom SQL editor component */
  SqlEditorComponent?: ComponentType<SqlEditorProps>;
  /** Custom dual SQL editor component (for query diff) */
  DualSqlEditorComponent?: ComponentType<SqlEditorProps>;
  /** Custom auth modal component */
  AuthModalComponent?: ComponentType<{
    open: boolean;
    onClose: () => void;
  }>;
  /** Result view component from registry */
  RunResultView?: ForwardRefExoticComponent<RunResultViewProps<VO> & RefAttributes<RefType>>;
  /** Ref for the result view (for screenshots) */
  resultViewRef?: Ref<RefType>;
  /** Custom result renderer */
  children?: (props: {
    run: Run;
    viewOptions?: VO;
    onViewOptionsChanged?: (viewOptions: VO) => void;
  }) => ReactNode;
}
/**
 * RunResultPane Component
 *
 * A reusable component for displaying run results with tabs for Result, Params, and Query.
 * Uses dependency injection for OSS-specific behaviors like tracking, sharing, and checklist.
 *
 * @example Basic usage with run data
 * ```tsx
 * import { RunResultPane } from '@datarecce/ui/components/run';
 *
 * function MyRunView({ run }) {
 *   return (
 *     <RunResultPane
 *       run={run}
 *       runId={run.run_id}
 *       onClose={() => handleClose()}
 *       onRerun={() => handleRerun()}
 *       RunResultView={MyResultView}
 *     />
 *   );
 * }
 * ```
 *
 * @example With OSS-specific injections
 * ```tsx
 * <RunResultPane
 *   run={run}
 *   runId={run.run_id}
 *   onCopyAsImage={handleCopyAsImage}
 *   csvExport={{ canExportCSV: true, copyAsCSV, downloadAsCSV }}
 *   onShareToCloud={handleShare}
 *   onTrackCopyToClipboard={(type, from) => trackCopyToClipboard({ type, from })}
 *   onAddToChecklist={handleAddToChecklist}
 *   authed={isAuthenticated}
 *   RunResultView={QueryResultView}
 * />
 * ```
 */
declare function RunResultPaneComponent<VO = unknown, RefType = unknown>({
  runId,
  run,
  isRunning,
  error,
  viewOptions,
  onViewOptionsChanged,
  isSingleEnvironment,
  disableDatabaseQuery,
  disableShare,
  disableUpdateChecklist,
  onClose,
  onCancel: _onCancel,
  onRerun,
  onCopyAsImage,
  onCopyMouseEnter,
  onCopyMouseLeave,
  csvExport,
  authed,
  onShareToCloud,
  onShowAuthModal,
  onTrackCopyToClipboard,
  onGoToCheck,
  onAddToChecklist,
  SingleEnvironmentNotification,
  SqlEditorComponent,
  DualSqlEditorComponent,
  AuthModalComponent,
  RunResultView,
  resultViewRef,
  children
}: RunResultPaneProps<VO, RefType>): react_jsx_runtime4.JSX.Element;
declare const RunResultPane: <VO = unknown, RefType = unknown>(props: RunResultPaneProps<VO, RefType>) => ReturnType<typeof RunResultPaneComponent>;
//#endregion
//#region src/components/run/RunResultPaneOss.d.ts
interface RunPageProps {
  onClose?: () => void;
  disableAddToChecklist?: boolean;
  isSingleEnvironment?: boolean;
}
/**
 * OSS implementation that loads run data and injects OSS-specific behavior
 * into the RunResultPane component.
 */

/**
 * OSS RunResultPane Component
 *
 * A thin wrapper around RunResultPane that injects OSS-specific
 * context and behavior including:
 * - Analytics tracking (Amplitude)
 * - Share state context
 * - API client configuration
 * - Screenshot/clipboard functionality
 * - CSV export functionality
 *
 * @example
 * ```tsx
 * import { RunResultPaneOss } from "@datarecce/ui/components/run";
 *
 * function MyRunView() {
 *   return (
 *     <RunResultPaneOss
 *       onClose={() => handleClose()}
 *       isSingleEnvironment={isSingleEnv}
 *     />
 *   );
 * }
 * ```
 */
declare const RunResultPaneOss: ({
  onClose,
  isSingleEnvironment
}: RunPageProps) => react_jsx_runtime4.JSX.Element;
//#endregion
//#region src/components/run/RunView.d.ts
/**
 * Props for the error boundary wrapper component.
 * Compatible with Sentry ErrorBoundary and custom implementations.
 */
interface ErrorBoundaryWrapperProps {
  /** The content to wrap with error boundary */
  children: ReactNode;
  /** Fallback to display when an error occurs */
  fallback?: any;
}
/**
 * Props for the RunView component.
 *
 * Uses permissive types to support various run result view components.
 * Consumers can pass typed RunResultView components and the types will
 * be inferred correctly at the call site.
 */
interface RunViewProps {
  /** Whether a run is currently executing */
  isRunning?: boolean;
  /** The run object containing execution state and results */
  run?: Run;
  /** Error that occurred during run execution */
  error?: Error | null;
  /** Progress information for the current run */
  progress?: Run["progress"];
  /** Whether the run is being aborted */
  isAborting?: boolean;
  /**
   * Whether this is a check detail view.
   * @deprecated This prop may be removed in future versions.
   */
  isCheckDetail?: boolean;
  /** Callback when user cancels the run */
  onCancel?: () => void;
  /** Callback to execute/re-execute the run */
  onExecuteRun?: () => void;
  /** Current view options for result display */
  viewOptions?: any;
  /** Callback when view options change */
  onViewOptionsChanged?: (viewOptions: any) => void;
  /**
   * Component to render run results.
   * Either RunResultView or children is required.
   */
  RunResultView?: ForwardRefExoticComponent<RunResultViewProps<any> & RefAttributes<any>>;
  /**
   * Render prop for custom result rendering.
   * Either RunResultView or children is required.
   */
  children?: (params: RunResultViewProps<any>) => ReactNode;
  /**
   * Error boundary component to wrap the result view.
   * If not provided, results are rendered without error boundary.
   *
   * @example Using Sentry ErrorBoundary
   * ```tsx
   * import { ErrorBoundary } from "@sentry/react";
   * <RunView ErrorBoundary={ErrorBoundary} />
   * ```
   */
  ErrorBoundary?: ComponentType<ErrorBoundaryWrapperProps>;
  /**
   * Fallback element/render function for the error boundary.
   * Type depends on the ErrorBoundary implementation used.
   *
   * @example Using Sentry FallbackRender
   * ```tsx
   * import ResultErrorFallback from "@datarecce/ui/lib/result/ResultErrorFallback";
   * <RunView errorBoundaryFallback={ResultErrorFallback} />
   * ```
   */
  errorBoundaryFallback?: any;
}
/**
 * Generic run view component that displays run execution state and results.
 *
 * States:
 * 1. **Error state**: Shows error message from API response or run.error
 * 2. **Running state**: Shows loading spinner with progress and cancel button
 * 3. **Loading state**: Shows spinner when run is undefined
 * 4. **Result state**: Renders RunResultView or children with run results
 *
 * @remarks
 * The component uses forwardRef to pass refs to the RunResultView component,
 * enabling features like screenshot capture for data grids.
 *
 * @example
 * ```tsx
 * const ref = useRef<DataGridHandle>(null);
 *
 * <RunView
 *   ref={ref}
 *   run={run}
 *   RunResultView={QueryResultView}
 *   viewOptions={viewOptions}
 *   onViewOptionsChanged={setViewOptions}
 * />
 * ```
 */
declare const RunView: ForwardRefExoticComponent<RunViewProps & RefAttributes<unknown>>;
//#endregion
//#region src/components/run/RunViewOss.d.ts
/**
 * OSS-specific RunView props using OSS types for backward compatibility.
 *
 * @typeParam VO - View options type (defaults to ViewOptionTypes union)
 */
interface RunViewOssProps<VO = ViewOptionTypes> {
  /** Whether a run is currently executing */
  isRunning?: boolean;
  /** The run object containing execution state and results */
  run?: Run;
  /** Error that occurred during run execution */
  error?: Error | null;
  /** Progress information for the current run */
  progress?: Run["progress"];
  /** Whether the run is being aborted */
  isAborting?: boolean;
  /**
   * Whether this is a check detail view.
   * @deprecated This prop may be removed in future versions.
   */
  isCheckDetail?: boolean;
  /** Callback when user cancels the run */
  onCancel?: () => void;
  /** Callback to execute/re-execute the run */
  onExecuteRun?: () => void;
  /** Current view options for result display */
  viewOptions?: VO;
  /** Callback when view options change */
  onViewOptionsChanged?: (viewOptions: VO) => void;
  /**
   * Component to render run results.
   * Either RunResultView or children is required.
   */
  RunResultView?: RegistryEntry["RunResultView"];
  /**
   * Render prop for custom result rendering.
   * Either RunResultView or children is required.
   */
  children?: (params: RunResultViewProps<ViewOptionTypes>) => ReactNode;
}
/**
 * OSS RunView component with Sentry error boundary pre-injected.
 *
 * This is a thin wrapper around the base RunView from @datarecce/ui that
 * injects OSS-specific error handling via Sentry.
 *
 * States:
 * 1. **Error state**: Shows error message from API response or run.error
 * 2. **Running state**: Shows loading spinner with progress and cancel button
 * 3. **Loading state**: Shows spinner when run is undefined
 * 4. **Result state**: Renders RunResultView or children with run results,
 *    wrapped in Sentry error boundary for crash reporting
 *
 * @example
 * ```tsx
 * const ref = useRef<DataGridHandle>(null);
 *
 * <RunViewOss
 *   ref={ref}
 *   run={run}
 *   RunResultView={QueryResultView}
 *   viewOptions={viewOptions}
 *   onViewOptionsChanged={setViewOptions}
 * />
 * ```
 */
declare const RunViewOss: react2.ForwardRefExoticComponent<RunViewOssProps<ViewOptionTypes> & react2.RefAttributes<RefTypes>>;
//#endregion
//#region src/components/run/registry.d.ts
/**
 * Interface for the run registry with specific component types for each run type.
 * This provides precise typing for each entry's ref type and view options.
 */
interface RunRegistry {
  query: RegistryEntry<DataGridHandle>;
  query_base: RegistryEntry<DataGridHandle>;
  query_diff: RegistryEntry<DataGridHandle>;
  row_count: RegistryEntry<DataGridHandle>;
  row_count_diff: RegistryEntry<DataGridHandle>;
  profile: RegistryEntry<DataGridHandle>;
  profile_diff: RegistryEntry<DataGridHandle>;
  value_diff: RegistryEntry<DataGridHandle>;
  value_diff_detail: RegistryEntry<DataGridHandle>;
  top_k_diff: RegistryEntry<HTMLDivElement>;
  histogram_diff: RegistryEntry<HTMLDivElement>;
  lineage_diff: RegistryEntry<never>;
  schema_diff: RegistryEntry<never>;
  sandbox: RegistryEntry<never>;
  simple: RegistryEntry<never>;
}
/**
 * The run type registry with all icons and available components.
 *
 * Components in @datarecce/ui are included directly. Components still in
 * OSS (QueryResultView, ProfileDiffResultView, ValueDiffResultView, etc.)
 * are undefined here and should be injected by consumers.
 *
 * @example
 * ```ts
 * const entry = registry.query;
 * console.log(entry.title); // "Query"
 * console.log(entry.icon); // TbSql
 * ```
 */
declare const registry: RunRegistry;
/**
 * Find a run type configuration by run type.
 *
 * @param runType - The run type to look up
 * @returns The registry entry for the run type
 *
 * @example
 * ```ts
 * const entry = findByRunType("query");
 * console.log(entry.title); // "Query"
 * console.log(entry.icon); // TbSql
 * ```
 */
declare function findByRunType<T extends RunType>(runType: T): RunRegistry[T];
/**
 * @deprecated Use `registry` directly instead
 */
declare const defaultRunTypeConfig: RunRegistry;
/**
 * Creates a run type registry with the provided configurations.
 * Merges with defaults to ensure all run types have entries.
 *
 * @param config - Partial or full registry configuration
 * @returns Complete registry with all run types
 *
 * @example
 * ```ts
 * const customRegistry = createRunTypeRegistry({
 *   query: { ...registry.query, RunResultView: MyQueryResultView }
 * });
 * ```
 */
declare function createRunTypeRegistry(config: Partial<Record<RunType, Partial<RunTypeConfig>>>): RunRegistry;
/**
 * Creates a bound lookup function for a specific registry.
 *
 * @param reg - The registry to bind
 * @returns A function that looks up run types in the bound registry
 *
 * @example
 * ```ts
 * const customRegistry = createRunTypeRegistry({ ... });
 * const findCustomRunType = createBoundFindByRunType(customRegistry);
 * const entry = findCustomRunType("query");
 * ```
 */
declare function createBoundFindByRunType(reg: RunRegistry): <T extends RunType>(runType: T) => RunRegistry[T];
//#endregion
export { RunModalProps as C, RunListOss as E, RunModalOss as S, RunModalProps$1 as T, RunResultPaneProps as _, findByRunType as a, SingleEnvironmentNotificationProps as b, RunViewOssProps as c, RunViewProps as d, RunResultPaneOss as f, RunResultPane as g, RunResultExportMenuProps as h, defaultRunTypeConfig as i, ErrorBoundaryWrapperProps as l, CSVExportProps as m, createBoundFindByRunType as n, registry as o, AddToCheckButtonProps as p, createRunTypeRegistry as r, RunViewOss as s, RunRegistry as t, RunView as u, RunResultPaneTabValue as v, RunModal as w, SqlEditorProps as x, RunResultShareMenuProps as y };
//# sourceMappingURL=index-DlLO5r9F.d.ts.map