@datarecce/ui 1.45.0-nightly.20260426 → 1.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/hooks.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
 
2
2
  import { n as useThemeColors, t as ThemeColors } from "./useThemeColors-OwCMwSrx.js";
3
- import { A as useCopyToClipboard, B as defaultSqlQuery, C as useCheckEvents, D as ApiConfigContextType, E as useAvatar, F as RecceContextProvider, G as useRecceCheckContext, H as LineageGraphAdapter, I as RecceActionAdapter, K as MuiProvider, L as RecceActionOptions, M as useImageDownloadModal, N as RecceShareStateContextProvider, O as useApiConfig, P as useRecceShareStateContext, R as OSSQueryContext, S as useClipBoardToast, T as UseAvatarResult, U as CheckContextAdapter, V as useRecceQueryContext, W as OSSCheckContext, _ as useIsDark, a as useRun, b as useCSVExport, c as MultiNodesActionTracking, d as UseMultiNodesActionReturn, f as useMultiNodesAction, g as useModelColumns, h as unionColumns, i as UseRunResult, j as useCopyToClipboardButton, k as IGNORE_SCREENSHOT_CLASS, l as MultiNodesActionType, m as extractColumns, n as UseValueDiffAlertDialogReturn, o as MultiNodesActionCallbacks, p as UseModelColumnsReturn, r as useValueDiffAlertDialog, s as MultiNodesActionTrackProps, t as UseValueDiffAlertDialogOptions, u as UseMultiNodesActionOptions, v as useGuideToast, w as UseAvatarOptions, x as useCountdownToast, y as useFeedbackCollectionToast, z as QueryContextAdapter } from "./index-D43mT_z1.js";
3
+ import { A as useCopyToClipboard, B as defaultSqlQuery, C as useCheckEvents, D as ApiConfigContextType, E as useAvatar, F as RecceContextProvider, G as useRecceCheckContext, H as LineageGraphAdapter, I as RecceActionAdapter, K as MuiProvider, L as RecceActionOptions, M as useImageDownloadModal, N as RecceShareStateContextProvider, O as useApiConfig, P as useRecceShareStateContext, R as OSSQueryContext, S as useClipBoardToast, T as UseAvatarResult, U as CheckContextAdapter, V as useRecceQueryContext, W as OSSCheckContext, _ as useIsDark, a as useRun, b as useCSVExport, c as MultiNodesActionTracking, d as UseMultiNodesActionReturn, f as useMultiNodesAction, g as useModelColumns, h as unionColumns, i as UseRunResult, j as useCopyToClipboardButton, k as IGNORE_SCREENSHOT_CLASS, l as MultiNodesActionType, m as extractColumns, n as UseValueDiffAlertDialogReturn, o as MultiNodesActionCallbacks, p as UseModelColumnsReturn, r as useValueDiffAlertDialog, s as MultiNodesActionTrackProps, t as UseValueDiffAlertDialogOptions, u as UseMultiNodesActionOptions, v as useGuideToast, w as UseAvatarOptions, x as useCountdownToast, y as useFeedbackCollectionToast, z as QueryContextAdapter } from "./index-CvaSvmdN.js";
4
4
  export { ApiConfigContextType, CheckContextAdapter, IGNORE_SCREENSHOT_CLASS, LineageGraphAdapter, MuiProvider, MultiNodesActionCallbacks, MultiNodesActionTrackProps, MultiNodesActionTracking, MultiNodesActionType, OSSCheckContext, OSSQueryContext, QueryContextAdapter, RecceActionAdapter, RecceActionOptions, RecceContextProvider, RecceShareStateContextProvider, ThemeColors, UseAvatarOptions, UseAvatarResult, UseModelColumnsReturn, UseMultiNodesActionOptions, UseMultiNodesActionReturn, UseRunResult, UseValueDiffAlertDialogOptions, UseValueDiffAlertDialogReturn, defaultSqlQuery, extractColumns, unionColumns, useApiConfig, useAvatar, useCSVExport, useCheckEvents, useClipBoardToast, useCopyToClipboard, useCopyToClipboardButton, useCountdownToast, useFeedbackCollectionToast, useGuideToast, useImageDownloadModal, useIsDark, useModelColumns, useMultiNodesAction, useRecceCheckContext, useRecceQueryContext, useRecceShareStateContext, useRun, useThemeColors, useValueDiffAlertDialog };
package/dist/hooks.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{Bt as e,C as t,Ln as n,Mn as r,S as i,Vt as a,_ as o,a as s,b as c,c as l,d as u,f as d,g as f,h as p,i as m,jn as h,l as g,m as _,n as v,o as y,p as b,r as x,s as S,t as C,u as w,v as T,w as E,x as D,y as O}from"./hooks-DR9IY-Bd.js";import{Pt as k,ct as A}from"./utils-BLuXatE_.js";export{h as CheckContextAdapter,u as IGNORE_SCREENSHOT_CLASS,i as LineageGraphAdapter,n as MuiProvider,O as QueryContextAdapter,T as RecceActionAdapter,p as RecceContextProvider,f as RecceShareStateContextProvider,c as defaultSqlQuery,x as extractColumns,m as unionColumns,a as useApiConfig,e as useAvatar,l as useCSVExport,w as useCheckEvents,A as useClipBoardToast,d as useCopyToClipboard,b as useCopyToClipboardButton,g as useCountdownToast,S as useFeedbackCollectionToast,y as useGuideToast,_ as useImageDownloadModal,k as useIsDark,s as useModelColumns,E as useMultiNodesAction,r as useRecceCheckContext,D as useRecceQueryContext,o as useRecceShareStateContext,v as useRun,C as useThemeColors,t as useValueDiffAlertDialog};
2
+ import{Bt as e,C as t,Ln as n,Mn as r,S as i,Vt as a,_ as o,a as s,b as c,c as l,d as u,f as d,g as f,h as p,i as m,jn as h,l as g,m as _,n as v,o as y,p as b,r as x,s as S,t as C,u as w,v as T,w as E,x as D,y as O}from"./hooks-AAVgIiqs.js";import{Pt as k,ct as A}from"./utils-Cpt1f5aU.js";export{h as CheckContextAdapter,u as IGNORE_SCREENSHOT_CLASS,i as LineageGraphAdapter,n as MuiProvider,O as QueryContextAdapter,T as RecceActionAdapter,p as RecceContextProvider,f as RecceShareStateContextProvider,c as defaultSqlQuery,x as extractColumns,m as unionColumns,a as useApiConfig,e as useAvatar,l as useCSVExport,w as useCheckEvents,A as useClipBoardToast,d as useCopyToClipboard,b as useCopyToClipboardButton,g as useCountdownToast,S as useFeedbackCollectionToast,y as useGuideToast,_ as useImageDownloadModal,k as useIsDark,s as useModelColumns,E as useMultiNodesAction,r as useRecceCheckContext,D as useRecceQueryContext,o as useRecceShareStateContext,v as useRun,C as useThemeColors,t as useValueDiffAlertDialog};
@@ -236,7 +236,7 @@ declare function useCopyToClipboard({
236
236
  onError,
237
237
  ignoreElements
238
238
  }: HookOptions): {
239
- status: "success" | "error" | "loading" | "idle";
239
+ status: "success" | "error" | "idle" | "loading";
240
240
  isLoading: boolean;
241
241
  isErrored: boolean;
242
242
  isSuccess: boolean;
@@ -747,4 +747,4 @@ interface UseValueDiffAlertDialogReturn {
747
747
  declare function useValueDiffAlertDialog(options?: UseValueDiffAlertDialogOptions): UseValueDiffAlertDialogReturn;
748
748
  //#endregion
749
749
  export { useCopyToClipboard as A, defaultSqlQuery as B, useCheckEvents as C, ApiConfigContextType as D, useAvatar as E, RecceContextProvider as F, useRecceCheckContext as G, LineageGraphAdapter as H, RecceActionAdapter as I, MuiProvider as K, RecceActionOptions as L, useImageDownloadModal as M, RecceShareStateContextProvider as N, useApiConfig as O, useRecceShareStateContext as P, OSSQueryContext as R, useClipBoardToast as S, UseAvatarResult as T, CheckContextAdapter as U, useRecceQueryContext as V, OSSCheckContext as W, useIsDark as _, useRun as a, useCSVExport as b, MultiNodesActionTracking as c, UseMultiNodesActionReturn as d, useMultiNodesAction as f, useModelColumns as g, unionColumns as h, UseRunResult as i, useCopyToClipboardButton as j, IGNORE_SCREENSHOT_CLASS as k, MultiNodesActionType as l, extractColumns as m, UseValueDiffAlertDialogReturn as n, MultiNodesActionCallbacks as o, UseModelColumnsReturn as p, useValueDiffAlertDialog as r, MultiNodesActionTrackProps as s, UseValueDiffAlertDialogOptions as t, UseMultiNodesActionOptions as u, useGuideToast as v, UseAvatarOptions as w, useCountdownToast as x, useFeedbackCollectionToast as y, QueryContextAdapter as z };
750
- //# sourceMappingURL=index-D43mT_z1.d.ts.map
750
+ //# sourceMappingURL=index-CvaSvmdN.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-D43mT_z1.d.ts","names":[],"sources":["../src/components/ui/mui-provider.tsx","../src/hooks/CheckContextAdapter.tsx","../src/hooks/LineageGraphAdapter.tsx","../src/hooks/QueryContextAdapter.tsx","../src/hooks/RecceActionAdapter.tsx","../src/hooks/RecceContextProvider.tsx","../src/hooks/RecceShareStateContext.tsx","../src/hooks/ScreenShot.tsx","../src/hooks/useApiConfig.ts","../src/hooks/useAvatar.ts","../src/hooks/useCheckEvents.ts","../src/hooks/useClipBoardToast.tsx","../src/hooks/useCountdownToast.tsx","../src/hooks/useCSVExport.ts","../src/hooks/useFeedbackCollectionToast.tsx","../src/hooks/useGuideToast.tsx","../src/hooks/useIsDark.ts","../src/hooks/useModelColumns.tsx","../src/hooks/useMultiNodesAction.ts","../src/hooks/useRun.tsx","../src/hooks/useValueDiffAlertDialog.tsx"],"mappings":"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"}
1
+ {"version":3,"file":"index-CvaSvmdN.d.ts","names":[],"sources":["../src/components/ui/mui-provider.tsx","../src/hooks/CheckContextAdapter.tsx","../src/hooks/LineageGraphAdapter.tsx","../src/hooks/QueryContextAdapter.tsx","../src/hooks/RecceActionAdapter.tsx","../src/hooks/RecceContextProvider.tsx","../src/hooks/RecceShareStateContext.tsx","../src/hooks/ScreenShot.tsx","../src/hooks/useApiConfig.ts","../src/hooks/useAvatar.ts","../src/hooks/useCheckEvents.ts","../src/hooks/useClipBoardToast.tsx","../src/hooks/useCountdownToast.tsx","../src/hooks/useCSVExport.ts","../src/hooks/useFeedbackCollectionToast.tsx","../src/hooks/useGuideToast.tsx","../src/hooks/useIsDark.ts","../src/hooks/useModelColumns.tsx","../src/hooks/useMultiNodesAction.ts","../src/hooks/useRun.tsx","../src/hooks/useValueDiffAlertDialog.tsx"],"mappings":"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"}
package/dist/index.d.ts CHANGED
@@ -12,7 +12,7 @@ import { _ as RecceFeatureMode, a as useIdleTimeoutSafe, b as defaultInstanceInf
12
12
  import { n as useThemeColors, t as ThemeColors } from "./useThemeColors-OwCMwSrx.js";
13
13
  import { r as theme, s as colors, t as Theme } from "./index-CHJ0PCEg.js";
14
14
  import { c as useApiClient, l as useApiConfig, u as useApiConfigOptional } from "./RouteConfigContext-DWFg6bll.js";
15
- import { A as useCopyToClipboard, B as defaultSqlQuery, C as useCheckEvents, G as useRecceCheckContext, H as LineageGraphAdapter, I as RecceActionAdapter, L as RecceActionOptions, M as useImageDownloadModal, N as RecceShareStateContextProvider, P as useRecceShareStateContext, R as OSSQueryContext, U as CheckContextAdapter, V as useRecceQueryContext, W as OSSCheckContext, _ as useIsDark, a as useRun, b as useCSVExport, c as MultiNodesActionTracking, d as UseMultiNodesActionReturn, f as useMultiNodesAction, g as useModelColumns, h as unionColumns, i as UseRunResult, j as useCopyToClipboardButton, k as IGNORE_SCREENSHOT_CLASS, l as MultiNodesActionType, m as extractColumns, o as MultiNodesActionCallbacks, p as UseModelColumnsReturn, s as MultiNodesActionTrackProps, u as UseMultiNodesActionOptions, y as useFeedbackCollectionToast, z as QueryContextAdapter } from "./index-D43mT_z1.js";
15
+ import { A as useCopyToClipboard, B as defaultSqlQuery, C as useCheckEvents, G as useRecceCheckContext, H as LineageGraphAdapter, I as RecceActionAdapter, L as RecceActionOptions, M as useImageDownloadModal, N as RecceShareStateContextProvider, P as useRecceShareStateContext, R as OSSQueryContext, U as CheckContextAdapter, V as useRecceQueryContext, W as OSSCheckContext, _ as useIsDark, a as useRun, b as useCSVExport, c as MultiNodesActionTracking, d as UseMultiNodesActionReturn, f as useMultiNodesAction, g as useModelColumns, h as unionColumns, i as UseRunResult, j as useCopyToClipboardButton, k as IGNORE_SCREENSHOT_CLASS, l as MultiNodesActionType, m as extractColumns, o as MultiNodesActionCallbacks, p as UseModelColumnsReturn, s as MultiNodesActionTrackProps, u as UseMultiNodesActionOptions, y as useFeedbackCollectionToast, z as QueryContextAdapter } from "./index-CvaSvmdN.js";
16
16
  import { n as DisableTooltipMessages, t as DisableTooltipMessageKey } from "./index-CZ7gueQV.js";
17
17
  import { _ as formatTimestamp, b as deltaPercentageString, g as formatTimeToNow, s as isSchemaChanged, y as extractSchemas } from "./index-Bx7VdwcX.js";
18
18
  export { ActionMode, ActionState, AxiosQueryParams, COLUMN_HEIGHT, CatalogMetadata, Check, CheckContextAdapter, CheckContextType, CheckProvider, CheckProviderProps, ChecksView, ChecksViewProps, ColumnTooltipInput, CreatedResultViewProps, DataTypeIcon, DataTypeIconProps, DiffText, DiffTextProps, DisableTooltipMessageKey, DisableTooltipMessages, EnvInfo, GitInfo, HSplit, IGNORE_SCREENSHOT_CLASS, IdleTimeoutContextType, IdleTimeoutProvider, InstanceInfoType, LineageCanvas, LineageCanvasProps, LineageData, LineageDataFromMetadata, LineageGraph, LineageGraphAdapter, LineageGraphColumnNode, LineageGraphContextType, LineageGraphEdge, LineageGraphNode, LineageGraphNodes, LineageGraphProvider, LineageGraphProviderProps, LineageView, LineageViewContextType, LineageViewProps, LineageViewRef, ManifestMetadata, MergedEdgeData, MergedLineageEnvMetadata, MergedLineageResponse, MergedNodeData, ModelEnvDetail, ModelInfoResult, MultiNodesActionCallbacks, MultiNodesActionTrackProps, MultiNodesActionTracking, MultiNodesActionType, NavigateOptions, NodeAction, NodeColumnData, NodeColumnSetMap, NodeData, OSSCheckContext, OSSQueryContext, RecceActionOptions as OSSRecceActionOptions, PullRequestInfo, QueryContextAdapter, QueryContextType, QueryProvider, QueryProviderProps, QueryResult, RecceActionAdapter, RecceActionContextType, RecceActionOptions$1 as RecceActionOptions, RecceActionProvider, RecceActionProviderProps, RecceFeatureMode, RecceFeatureToggles, RecceInstanceInfo, RecceInstanceInfoProvider, RecceProvider, RecceProviderProps, RecceServerFlags, RecceShareStateContextProvider, ResultViewConfig, ResultViewData, ResultViewProps, ResultViewRef, ResultViewTransformOptions, RoutingConfig, RoutingContextValue, RunsAggregated, SQLMeshInfo, SchemaDataGridOptions, SchemaDataGridResult, SchemaDiffRow, SchemaRow, ScreenshotWrapperType, SelectMode, ServerInfoResult, ServerMode, SingleEnvSchemaDataGridResult, SplitProps, SquareIcon, SquareIconProps, StateMetadata, SubmitRunTrackProps, Theme, ThemeColors, TypeCategory, UseModelColumnsReturn, UseMultiNodesActionOptions, UseMultiNodesActionReturn, UseRunResult, VERSION, VSplit, aggregateRuns, buildColumnTooltip, buildLineageGraph, cacheKeys, classifyType, colors, createResultView, defaultFeatureToggles, defaultInstanceInfo, defaultSqlQuery, deltaPercentageString, extractColumns, extractSchemas, formatTimeToNow, formatTimestamp, getLastKeepAliveTime, getModelInfo, getNeighborSet, getRecceInstanceInfo, getServerFlag, getServerInfo, intersect, isLineageGraphColumnNode, isLineageGraphNode, isSchemaChanged, layoutWithDagre, markRelaunchHintCompleted, mergeColumns, reorderChecks, resetKeepAliveState, selectDownstream, selectUpstream, sendKeepAlive, setKeepAliveCallback, theme, toReactFlowBasic, toSchemaDataGrid, toSingleEnvDataGrid, union, unionColumns, useApiClient, useApiConfig, useApiConfigOptional, useAppLocation, useCSVExport, useCheckContext, useCheckEvents, useChecks, useCopyToClipboard, useCopyToClipboardButton, useFeedbackCollectionToast, useIdleDetection, useIdleTimeout, useIdleTimeoutSafe, useImageDownloadModal, useIsDark, useLineageGraphContext, useModelColumns, useMultiNodesAction, useQueryContext, useRecceActionContext, useRecceCheckContext, useRecceInstanceContext, useRecceInstanceInfo, useRecceQueryContext, useRecceServerFlag, useRecceShareStateContext, useRecceTheme, useRouting, useRun, useRunsAggregated, useThemeColors };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{C as e,N as t,S as n,j as r,q as i}from"./api-BqrSvFO2.js";import{a,d as o,f as s,i as c,l,n as u,o as d,r as f,s as p,t as m,u as h}from"./keepAlive-DbC0X4zr.js";import{C as g,D as _,E as v,O as y,S as b,T as x,_ as S,a as C,b as w,c as T,d as E,f as D,g as O,i as k,k as A,l as j,n as M,o as N,r as P,s as F,t as I,u as L,v as R,w as z,x as B,y as V}from"./utils-COgjW7er.js";import{t as H}from"./theme-CB8KNGMx.js";import{n as U}from"./colors-BbPSDR1X.js";import{An as W,Fn as G,In as K,Kt as q,Mn as J,Nn as Y,On as X,Pn as Z,S as Q,_ as $,a as ee,b as te,c as ne,ct as re,d as ie,f as ae,g as oe,i as se,jn as ce,kn as le,lt as ue,m as de,n as fe,nt as pe,p as me,qt as he,r as ge,rt as _e,s as ve,st as ye,t as be,tt as xe,u as Se,v as Ce,w as we,x as Te,y as Ee}from"./hooks-DR9IY-Bd.js";import{F as De,M as Oe,N as ke,P as Ae,n as je,t as Me}from"./src-C1DeoO4F.js";import{It as Ne,Pt as Pe,a as Fe,i as Ie,m as Le,n as Re,pt as ze,s as Be}from"./utils-BLuXatE_.js";import{t as Ve}from"./constants-D-hOGDbU.js";export{I as COLUMN_HEIGHT,ce as CheckContextAdapter,G as CheckProvider,je as ChecksView,X as DataTypeIcon,ze as DiffText,Ve as DisableTooltipMessages,re as HSplit,ie as IGNORE_SCREENSHOT_CLASS,V as IdleTimeoutProvider,he as LineageCanvas,Q as LineageGraphAdapter,O as LineageGraphProvider,q as LineageView,Ee as QueryContextAdapter,Y as QueryProvider,Ce as RecceActionAdapter,y as RecceActionProvider,g as RecceInstanceInfoProvider,ke as RecceProvider,oe as RecceShareStateContextProvider,Oe as SquareIcon,Me as VERSION,ue as VSplit,i as aggregateRuns,le as buildColumnTooltip,M as buildLineageGraph,s as cacheKeys,W as classifyType,U as colors,ye as createResultView,v as defaultFeatureToggles,_ as defaultInstanceInfo,te as defaultSqlQuery,Le as deltaPercentageString,ge as extractColumns,Be as extractSchemas,Ie as formatTimeToNow,Fe as formatTimestamp,m as getLastKeepAliveTime,n as getModelInfo,P as getNeighborSet,a as getRecceInstanceInfo,d as getServerFlag,e as getServerInfo,k as intersect,E as isLineageGraphColumnNode,D as isLineageGraphNode,Re as isSchemaChanged,C as layoutWithDagre,p as markRelaunchHintCompleted,xe as mergeColumns,r as reorderChecks,u as resetKeepAliveState,N as selectDownstream,F as selectUpstream,f as sendKeepAlive,c as setKeepAliveCallback,H as theme,T as toReactFlowBasic,pe as toSchemaDataGrid,_e as toSingleEnvDataGrid,j as union,se as unionColumns,l as useApiClient,h as useApiConfig,o as useApiConfigOptional,Ae as useAppLocation,ne as useCSVExport,K as useCheckContext,Se as useCheckEvents,t as useChecks,ae as useCopyToClipboard,me as useCopyToClipboardButton,ve as useFeedbackCollectionToast,B as useIdleDetection,w as useIdleTimeout,b as useIdleTimeoutSafe,de as useImageDownloadModal,Pe as useIsDark,S as useLineageGraphContext,ee as useModelColumns,we as useMultiNodesAction,Z as useQueryContext,A as useRecceActionContext,J as useRecceCheckContext,z as useRecceInstanceContext,x as useRecceInstanceInfo,Te as useRecceQueryContext,L as useRecceServerFlag,$ as useRecceShareStateContext,Ne as useRecceTheme,De as useRouting,fe as useRun,R as useRunsAggregated,be as useThemeColors};
2
+ import{C as e,N as t,S as n,j as r,q as i}from"./api-BqrSvFO2.js";import{a,d as o,f as s,i as c,l,n as u,o as d,r as f,s as p,t as m,u as h}from"./keepAlive-DbC0X4zr.js";import{C as g,D as _,E as v,O as y,S as b,T as x,_ as S,a as C,b as w,c as T,d as E,f as D,g as O,i as k,k as A,l as j,n as M,o as N,r as P,s as F,t as I,u as L,v as R,w as z,x as B,y as V}from"./utils-COgjW7er.js";import{t as H}from"./theme-CB8KNGMx.js";import{n as U}from"./colors-BbPSDR1X.js";import{An as W,Fn as G,In as K,Kt as q,Mn as J,Nn as Y,On as X,Pn as Z,S as Q,_ as $,a as ee,b as te,c as ne,ct as re,d as ie,f as ae,g as oe,i as se,jn as ce,kn as le,lt as ue,m as de,n as fe,nt as pe,p as me,qt as he,r as ge,rt as _e,s as ve,st as ye,t as be,tt as xe,u as Se,v as Ce,w as we,x as Te,y as Ee}from"./hooks-AAVgIiqs.js";import{F as De,M as Oe,N as ke,P as Ae,n as je,t as Me}from"./src-DJN3ojqS.js";import{It as Ne,Pt as Pe,a as Fe,i as Ie,m as Le,n as Re,pt as ze,s as Be}from"./utils-Cpt1f5aU.js";import{t as Ve}from"./constants-D-hOGDbU.js";export{I as COLUMN_HEIGHT,ce as CheckContextAdapter,G as CheckProvider,je as ChecksView,X as DataTypeIcon,ze as DiffText,Ve as DisableTooltipMessages,re as HSplit,ie as IGNORE_SCREENSHOT_CLASS,V as IdleTimeoutProvider,he as LineageCanvas,Q as LineageGraphAdapter,O as LineageGraphProvider,q as LineageView,Ee as QueryContextAdapter,Y as QueryProvider,Ce as RecceActionAdapter,y as RecceActionProvider,g as RecceInstanceInfoProvider,ke as RecceProvider,oe as RecceShareStateContextProvider,Oe as SquareIcon,Me as VERSION,ue as VSplit,i as aggregateRuns,le as buildColumnTooltip,M as buildLineageGraph,s as cacheKeys,W as classifyType,U as colors,ye as createResultView,v as defaultFeatureToggles,_ as defaultInstanceInfo,te as defaultSqlQuery,Le as deltaPercentageString,ge as extractColumns,Be as extractSchemas,Ie as formatTimeToNow,Fe as formatTimestamp,m as getLastKeepAliveTime,n as getModelInfo,P as getNeighborSet,a as getRecceInstanceInfo,d as getServerFlag,e as getServerInfo,k as intersect,E as isLineageGraphColumnNode,D as isLineageGraphNode,Re as isSchemaChanged,C as layoutWithDagre,p as markRelaunchHintCompleted,xe as mergeColumns,r as reorderChecks,u as resetKeepAliveState,N as selectDownstream,F as selectUpstream,f as sendKeepAlive,c as setKeepAliveCallback,H as theme,T as toReactFlowBasic,pe as toSchemaDataGrid,_e as toSingleEnvDataGrid,j as union,se as unionColumns,l as useApiClient,h as useApiConfig,o as useApiConfigOptional,Ae as useAppLocation,ne as useCSVExport,K as useCheckContext,Se as useCheckEvents,t as useChecks,ae as useCopyToClipboard,me as useCopyToClipboardButton,ve as useFeedbackCollectionToast,B as useIdleDetection,w as useIdleTimeout,b as useIdleTimeoutSafe,de as useImageDownloadModal,Pe as useIsDark,S as useLineageGraphContext,ee as useModelColumns,we as useMultiNodesAction,Z as useQueryContext,A as useRecceActionContext,J as useRecceCheckContext,z as useRecceInstanceContext,x as useRecceInstanceInfo,Te as useRecceQueryContext,L as useRecceServerFlag,$ as useRecceShareStateContext,Ne as useRecceTheme,De as useRouting,fe as useRun,R as useRunsAggregated,be as useThemeColors};
@@ -1 +1 @@
1
- {"version":3,"file":"keepAlive-DbC0X4zr.js","names":[],"sources":["../src/api/cacheKeys.ts","../src/providers/contexts/ApiContext.tsx","../src/api/flag.ts","../src/api/instanceInfo.ts","../src/api/keepAlive.ts"],"sourcesContent":["\"use client\";\n\n/**\n * Cache keys for TanStack Query.\n * Provides consistent query keys for API caching.\n */\nexport const cacheKeys = {\n rowCount: (model: string) => [\"row_count\", model],\n lineage: () => [\"lineage\"],\n checks: () => [\"checks\", \"list\"],\n check: (checkId: string) => [\"checks\", checkId],\n checkEvents: (checkId: string) => [\"checks\", checkId, \"events\"],\n runs: () => [\"runs\"],\n run: (runId: string) => [\"runs\", runId],\n runsAggregated: () => [\"runs_aggregated\"],\n flag: () => [\"flag\"],\n instanceInfo: () => [\"instance_info\"],\n user: () => [\"user\"],\n};\n","\"use client\";\n\nimport {\n createContext,\n type ReactNode,\n useContext,\n useMemo,\n useRef,\n} from \"react\";\nimport { type ApiClient, createFetchClient } from \"../../lib/fetchClient\";\n\n/**\n * API Configuration\n *\n * baseUrl: Base URL for all requests\n * apiPrefix: Replaces /api in URLs (for cloud mode sessions)\n * authToken: Bearer token for Authorization header\n * headers: Additional headers\n * timeout: Request timeout in ms\n */\n/**\n * API configuration inputs for {@link ApiProvider}.\n */\ninterface ApiConfig {\n baseUrl: string;\n apiPrefix?: string;\n authToken?: string;\n headers?: Record<string, string>;\n timeout?: number;\n}\n\n/**\n * Resolved API context values exposed by {@link useApiConfig}.\n */\ninterface ApiContextValue {\n apiClient: ApiClient;\n apiPrefix: string;\n authToken?: string;\n baseUrl: string;\n}\n\nconst ApiContext = createContext<ApiContextValue | null>(null);\nApiContext.displayName = \"RecceApiContext\";\n\n/**\n * Access the API configuration, including the configured API client.\n *\n * @returns The API context values (client, baseUrl, apiPrefix, authToken).\n * @throws Error if used outside {@link RecceProvider}.\n */\nexport function useApiConfig(): ApiContextValue {\n const context = useContext(ApiContext);\n if (!context) {\n throw new Error(\"useApiConfig must be used within RecceProvider\");\n }\n return context;\n}\n\n/**\n * Non-throwing version of {@link useApiConfig}.\n *\n * @returns The API context values, or null if outside {@link RecceProvider}.\n */\nexport function useApiConfigOptional(): ApiContextValue | null {\n return useContext(ApiContext);\n}\n\n/**\n * Convenience hook for the configured API client.\n *\n * @returns ApiClient configured with API prefix and auth token.\n * @throws Error if used outside {@link RecceProvider}.\n */\nexport function useApiClient() {\n return useApiConfig().apiClient;\n}\n\n/**\n * Custom client config that allows passing a pre-configured API client\n * along with the API configuration values for context.\n */\n/**\n * Custom client configuration for {@link ApiProvider}.\n */\ninterface CustomClientConfig {\n client: ApiClient;\n apiPrefix?: string;\n authToken?: string;\n baseUrl?: string;\n}\n\n/**\n * Props for {@link ApiProvider}.\n */\ninterface ApiProviderProps {\n children: ReactNode;\n config: ApiConfig | CustomClientConfig;\n}\n\n// Hook to memoize headers by value (JSON comparison) instead of reference\nfunction useStableHeaders(\n headers: Record<string, string> | undefined,\n): Record<string, string> | undefined {\n const headersRef = useRef(headers);\n const keyRef = useRef(headers ? JSON.stringify(headers) : \"\");\n\n const currentKey = headers ? JSON.stringify(headers) : \"\";\n if (currentKey !== keyRef.current) {\n headersRef.current = headers;\n keyRef.current = currentKey;\n }\n\n return headersRef.current;\n}\n\n/**\n * Creates an ApiClient configured with the given API config.\n *\n * Uses middleware to:\n * 1. Replace /api prefix with the configured apiPrefix (if provided)\n * 2. Add Authorization header with Bearer token (if authToken provided)\n */\nfunction createApiClient(\n baseUrl: string,\n apiPrefix: string,\n authToken: string | undefined,\n headers: Record<string, string> | undefined,\n timeout: number,\n): ApiClient {\n return createFetchClient({\n baseURL: baseUrl,\n headers: headers,\n timeout: timeout,\n middleware:\n apiPrefix || authToken\n ? (url, init) => {\n try {\n let resolvedUrl = url;\n\n // Replace /api prefix with configured apiPrefix (only if apiPrefix is non-empty).\n // Middleware runs on the relative path (before baseURL is prepended),\n // matching Axios interceptor ordering.\n if (apiPrefix) {\n const apiExact = resolvedUrl.endsWith(\"/api\")\n ? resolvedUrl.lastIndexOf(\"/api\")\n : -1;\n const apiSlash = resolvedUrl.indexOf(\"/api/\");\n\n if (apiExact >= 0) {\n // Exact \"/api\" at end of URL\n resolvedUrl = resolvedUrl.slice(0, apiExact) + apiPrefix;\n } else if (apiSlash >= 0) {\n // \"/api/...\" — replace /api with apiPrefix, keep the rest\n resolvedUrl =\n resolvedUrl.slice(0, apiSlash) +\n apiPrefix +\n resolvedUrl.slice(apiSlash + 4);\n }\n }\n\n // Add auth header if token is provided\n if (authToken) {\n init.headers.set(\"Authorization\", `Bearer ${authToken}`);\n }\n\n return { url: resolvedUrl, init };\n } catch (error) {\n // If anything goes wrong in the middleware, fall back to the original config\n // to avoid breaking all API requests.\n console.warn(\n \"API request middleware error, proceeding with unmodified request:\",\n error,\n );\n return { url, init };\n }\n }\n : undefined,\n });\n}\n\n/**\n * Provides API configuration and an API client to the subtree.\n */\nexport function ApiProvider({ children, config }: ApiProviderProps) {\n // Extract primitive values to stabilize dependency - prevents client recreation\n // when parent re-renders with new object reference but same values\n const isCustomClient = \"client\" in config;\n const customClient = isCustomClient ? config.client : null;\n const baseUrl = isCustomClient ? (config.baseUrl ?? \"\") : config.baseUrl;\n const timeout = !isCustomClient ? config.timeout : undefined;\n const headersFromConfig = !isCustomClient ? config.headers : undefined;\n const apiPrefix = config.apiPrefix ?? \"\";\n const authToken = config.authToken;\n\n // Use stable headers reference (compared by value, not reference)\n const headers = useStableHeaders(headersFromConfig);\n\n const client = useMemo(() => {\n if (customClient) {\n return customClient;\n }\n return createApiClient(\n baseUrl,\n apiPrefix,\n authToken,\n headers,\n timeout ?? 30000,\n );\n }, [customClient, baseUrl, apiPrefix, authToken, headers, timeout]);\n\n const contextValue: ApiContextValue = useMemo(\n () => ({\n apiClient: client,\n apiPrefix,\n authToken,\n baseUrl,\n }),\n [client, apiPrefix, authToken, baseUrl],\n );\n\n return (\n <ApiContext.Provider value={contextValue}>{children}</ApiContext.Provider>\n );\n}\n","import type { ApiClient, ApiResponse } from \"../lib/fetchClient\";\n\n/**\n * Server-side feature flags\n */\nexport interface RecceServerFlags {\n single_env_onboarding: boolean;\n show_relaunch_hint: boolean;\n disable_cll_cache: boolean;\n impact_at_startup: boolean;\n new_cll_experience: boolean;\n}\n\n/**\n * Fetch server flags from API\n */\nexport async function getServerFlag(\n client: ApiClient,\n): Promise<RecceServerFlags> {\n const response = await client.get<never, ApiResponse<RecceServerFlags>>(\n \"/api/flag\",\n );\n return response.data;\n}\n\n/**\n * Mark relaunch hint as completed\n */\nexport async function markRelaunchHintCompleted(\n client: ApiClient,\n): Promise<void> {\n try {\n await client.post<never, ApiResponse<never>>(\n \"/api/relaunch-hint/completed\",\n );\n } catch {\n // Skip any errors\n }\n}\n","\"use client\";\n\nimport type { ApiClient, ApiResponse } from \"../lib/fetchClient\";\n\n/**\n * Server mode for the Recce instance.\n * - \"server\": Full read-write mode\n * - \"preview\": Metadata only mode (no database queries)\n * - \"read-only\": Read-only mode (no modifications allowed)\n */\nexport type ServerMode = \"server\" | \"preview\" | \"read-only\";\n\n/**\n * Information about the Recce instance returned from the server.\n */\nexport interface RecceInstanceInfo {\n server_mode: ServerMode;\n single_env: boolean;\n authed: boolean;\n cloud_instance: boolean;\n lifetime_expired_at?: Date;\n idle_timeout?: number;\n share_url?: string;\n session_id?: string;\n organization_name?: string;\n web_url?: string;\n python_version?: string;\n user_role?: string;\n}\n\n/**\n * Fetches instance information from the Recce server.\n *\n * @param client - Axios instance to use for the request\n * @returns Promise resolving to RecceInstanceInfo\n */\nexport async function getRecceInstanceInfo(\n client: ApiClient,\n): Promise<RecceInstanceInfo> {\n return (\n await client.get<never, ApiResponse<RecceInstanceInfo>>(\n \"/api/instance-info\",\n )\n ).data;\n}\n","\"use client\";\n\nimport type { ApiClient } from \"../lib/fetchClient\";\n\n/**\n * Check if debug logging is enabled via window.RECCE_DEBUG_IDLE\n */\nfunction isDebugEnabled(): boolean {\n // biome-ignore lint/suspicious/noExplicitAny: window flag for debug logging\n return typeof window !== \"undefined\" && !!(window as any).RECCE_DEBUG_IDLE;\n}\n\n/**\n * Minimum interval between keep-alive API calls (3 seconds)\n * This prevents excessive API calls while still maintaining responsive idle detection\n */\nconst MIN_KEEP_ALIVE_INTERVAL_MS = 3 * 1000;\n\n/**\n * State for API-layer throttling\n * - lastKeepAliveTime: timestamp of last SUCCESSFUL keep-alive sent to server\n * - isSending: lock to prevent concurrent API calls\n */\nlet lastKeepAliveTime = 0;\nlet isSending = false;\n\n/** Callback to notify listeners when keep-alive is successfully sent */\ntype KeepAliveCallback = (timestamp: number) => void;\nlet onKeepAliveSuccess: KeepAliveCallback | null = null;\n\n/**\n * Register a callback to be notified when keep-alive is successfully sent\n * Used by IdleTimeoutContext to track server sync time\n */\nexport function setKeepAliveCallback(callback: KeepAliveCallback | null): void {\n onKeepAliveSuccess = callback;\n}\n\n/**\n * Send a keep-alive signal to the server to reset the idle timeout timer.\n * This prevents the server from shutting down due to inactivity.\n *\n * Includes built-in throttling at the API layer:\n * - Minimum 3 seconds between API calls\n * - Prevents concurrent API calls with a lock\n *\n * @param client - API client instance (required)\n * @returns true if keep-alive was sent, false if throttled/skipped\n */\nexport async function sendKeepAlive(client: ApiClient): Promise<boolean> {\n const now = Date.now();\n const elapsed = now - lastKeepAliveTime;\n\n // Throttle: skip if called within minimum interval\n if (elapsed < MIN_KEEP_ALIVE_INTERVAL_MS) {\n return false;\n }\n\n // Prevent concurrent sends\n if (isSending) {\n return false;\n }\n\n try {\n // Acquire lock inside try to ensure finally always releases it\n isSending = true;\n await client.post(\"/api/keep-alive\");\n // Update timestamp only on SUCCESS\n lastKeepAliveTime = Date.now();\n // Notify listeners\n if (onKeepAliveSuccess) {\n onKeepAliveSuccess(lastKeepAliveTime);\n }\n return true;\n } catch (error) {\n // Silent fail - don't disrupt user experience if keep-alive fails\n if (isDebugEnabled()) {\n const errorMessage =\n error instanceof Error ? error.message : String(error);\n console.log(\"[Keep-Alive] Failed to send\", {\n error: errorMessage,\n timestamp: new Date().toISOString(),\n willRetryOnNextActivity: true,\n });\n }\n return false;\n } finally {\n isSending = false;\n }\n}\n\n/**\n * Get the last successful keep-alive timestamp\n * This represents the last time the server confirmed it received our keep-alive\n */\nexport function getLastKeepAliveTime(): number {\n return lastKeepAliveTime;\n}\n\n/**\n * Reset all module state (for testing purposes)\n */\nexport function resetKeepAliveState(): void {\n lastKeepAliveTime = 0;\n isSending = false;\n onKeepAliveSuccess = null;\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"keepAlive-DbC0X4zr.js","names":[],"sources":["../src/api/cacheKeys.ts","../src/providers/contexts/ApiContext.tsx","../src/api/flag.ts","../src/api/instanceInfo.ts","../src/api/keepAlive.ts"],"sourcesContent":["\"use client\";\n\n/**\n * Cache keys for TanStack Query.\n * Provides consistent query keys for API caching.\n */\nexport const cacheKeys = {\n rowCount: (model: string) => [\"row_count\", model],\n lineage: () => [\"lineage\"],\n checks: () => [\"checks\", \"list\"],\n check: (checkId: string) => [\"checks\", checkId],\n checkEvents: (checkId: string) => [\"checks\", checkId, \"events\"],\n runs: () => [\"runs\"],\n run: (runId: string) => [\"runs\", runId],\n runsAggregated: () => [\"runs_aggregated\"],\n flag: () => [\"flag\"],\n instanceInfo: () => [\"instance_info\"],\n user: () => [\"user\"],\n};\n","\"use client\";\n\nimport {\n createContext,\n type ReactNode,\n useContext,\n useMemo,\n useRef,\n} from \"react\";\nimport { type ApiClient, createFetchClient } from \"../../lib/fetchClient\";\n\n/**\n * API Configuration\n *\n * baseUrl: Base URL for all requests\n * apiPrefix: Replaces /api in URLs (for cloud mode sessions)\n * authToken: Bearer token for Authorization header\n * headers: Additional headers\n * timeout: Request timeout in ms\n */\n/**\n * API configuration inputs for {@link ApiProvider}.\n */\ninterface ApiConfig {\n baseUrl: string;\n apiPrefix?: string;\n authToken?: string;\n headers?: Record<string, string>;\n timeout?: number;\n}\n\n/**\n * Resolved API context values exposed by {@link useApiConfig}.\n */\ninterface ApiContextValue {\n apiClient: ApiClient;\n apiPrefix: string;\n authToken?: string;\n baseUrl: string;\n}\n\nconst ApiContext = createContext<ApiContextValue | null>(null);\nApiContext.displayName = \"RecceApiContext\";\n\n/**\n * Access the API configuration, including the configured API client.\n *\n * @returns The API context values (client, baseUrl, apiPrefix, authToken).\n * @throws Error if used outside {@link RecceProvider}.\n */\nexport function useApiConfig(): ApiContextValue {\n const context = useContext(ApiContext);\n if (!context) {\n throw new Error(\"useApiConfig must be used within RecceProvider\");\n }\n return context;\n}\n\n/**\n * Non-throwing version of {@link useApiConfig}.\n *\n * @returns The API context values, or null if outside {@link RecceProvider}.\n */\nexport function useApiConfigOptional(): ApiContextValue | null {\n return useContext(ApiContext);\n}\n\n/**\n * Convenience hook for the configured API client.\n *\n * @returns ApiClient configured with API prefix and auth token.\n * @throws Error if used outside {@link RecceProvider}.\n */\nexport function useApiClient() {\n return useApiConfig().apiClient;\n}\n\n/**\n * Custom client config that allows passing a pre-configured API client\n * along with the API configuration values for context.\n */\n/**\n * Custom client configuration for {@link ApiProvider}.\n */\ninterface CustomClientConfig {\n client: ApiClient;\n apiPrefix?: string;\n authToken?: string;\n baseUrl?: string;\n}\n\n/**\n * Props for {@link ApiProvider}.\n */\ninterface ApiProviderProps {\n children: ReactNode;\n config: ApiConfig | CustomClientConfig;\n}\n\n// Hook to memoize headers by value (JSON comparison) instead of reference\nfunction useStableHeaders(\n headers: Record<string, string> | undefined,\n): Record<string, string> | undefined {\n const headersRef = useRef(headers);\n const keyRef = useRef(headers ? JSON.stringify(headers) : \"\");\n\n const currentKey = headers ? JSON.stringify(headers) : \"\";\n if (currentKey !== keyRef.current) {\n headersRef.current = headers;\n keyRef.current = currentKey;\n }\n\n return headersRef.current;\n}\n\n/**\n * Creates an ApiClient configured with the given API config.\n *\n * Uses middleware to:\n * 1. Replace /api prefix with the configured apiPrefix (if provided)\n * 2. Add Authorization header with Bearer token (if authToken provided)\n */\nfunction createApiClient(\n baseUrl: string,\n apiPrefix: string,\n authToken: string | undefined,\n headers: Record<string, string> | undefined,\n timeout: number,\n): ApiClient {\n return createFetchClient({\n baseURL: baseUrl,\n headers: headers,\n timeout: timeout,\n middleware:\n apiPrefix || authToken\n ? (url, init) => {\n try {\n let resolvedUrl = url;\n\n // Replace /api prefix with configured apiPrefix (only if apiPrefix is non-empty).\n // Middleware runs on the relative path (before baseURL is prepended),\n // matching Axios interceptor ordering.\n if (apiPrefix) {\n const apiExact = resolvedUrl.endsWith(\"/api\")\n ? resolvedUrl.lastIndexOf(\"/api\")\n : -1;\n const apiSlash = resolvedUrl.indexOf(\"/api/\");\n\n if (apiExact >= 0) {\n // Exact \"/api\" at end of URL\n resolvedUrl = resolvedUrl.slice(0, apiExact) + apiPrefix;\n } else if (apiSlash >= 0) {\n // \"/api/...\" — replace /api with apiPrefix, keep the rest\n resolvedUrl =\n resolvedUrl.slice(0, apiSlash) +\n apiPrefix +\n resolvedUrl.slice(apiSlash + 4);\n }\n }\n\n // Add auth header if token is provided\n if (authToken) {\n init.headers.set(\"Authorization\", `Bearer ${authToken}`);\n }\n\n return { url: resolvedUrl, init };\n } catch (error) {\n // If anything goes wrong in the middleware, fall back to the original config\n // to avoid breaking all API requests.\n console.warn(\n \"API request middleware error, proceeding with unmodified request:\",\n error,\n );\n return { url, init };\n }\n }\n : undefined,\n });\n}\n\n/**\n * Provides API configuration and an API client to the subtree.\n */\nexport function ApiProvider({ children, config }: ApiProviderProps) {\n // Extract primitive values to stabilize dependency - prevents client recreation\n // when parent re-renders with new object reference but same values\n const isCustomClient = \"client\" in config;\n const customClient = isCustomClient ? config.client : null;\n const baseUrl = isCustomClient ? (config.baseUrl ?? \"\") : config.baseUrl;\n const timeout = !isCustomClient ? config.timeout : undefined;\n const headersFromConfig = !isCustomClient ? config.headers : undefined;\n const apiPrefix = config.apiPrefix ?? \"\";\n const authToken = config.authToken;\n\n // Use stable headers reference (compared by value, not reference)\n const headers = useStableHeaders(headersFromConfig);\n\n const client = useMemo(() => {\n if (customClient) {\n return customClient;\n }\n return createApiClient(\n baseUrl,\n apiPrefix,\n authToken,\n headers,\n timeout ?? 30000,\n );\n }, [customClient, baseUrl, apiPrefix, authToken, headers, timeout]);\n\n const contextValue: ApiContextValue = useMemo(\n () => ({\n apiClient: client,\n apiPrefix,\n authToken,\n baseUrl,\n }),\n [client, apiPrefix, authToken, baseUrl],\n );\n\n return (\n <ApiContext.Provider value={contextValue}>{children}</ApiContext.Provider>\n );\n}\n","import type { ApiClient, ApiResponse } from \"../lib/fetchClient\";\n\n/**\n * Server-side feature flags\n */\nexport interface RecceServerFlags {\n single_env_onboarding: boolean;\n show_relaunch_hint: boolean;\n disable_cll_cache: boolean;\n impact_at_startup: boolean;\n new_cll_experience: boolean;\n}\n\n/**\n * Fetch server flags from API\n */\nexport async function getServerFlag(\n client: ApiClient,\n): Promise<RecceServerFlags> {\n const response = await client.get<never, ApiResponse<RecceServerFlags>>(\n \"/api/flag\",\n );\n return response.data;\n}\n\n/**\n * Mark relaunch hint as completed\n */\nexport async function markRelaunchHintCompleted(\n client: ApiClient,\n): Promise<void> {\n try {\n await client.post<never, ApiResponse<never>>(\n \"/api/relaunch-hint/completed\",\n );\n } catch {\n // Skip any errors\n }\n}\n","\"use client\";\n\nimport type { ApiClient, ApiResponse } from \"../lib/fetchClient\";\n\n/**\n * Server mode for the Recce instance.\n * - \"server\": Full read-write mode\n * - \"preview\": Metadata only mode (no database queries)\n * - \"read-only\": Read-only mode (no modifications allowed)\n */\nexport type ServerMode = \"server\" | \"preview\" | \"read-only\";\n\n/**\n * Information about the Recce instance returned from the server.\n */\nexport interface RecceInstanceInfo {\n server_mode: ServerMode;\n single_env: boolean;\n authed: boolean;\n cloud_instance: boolean;\n lifetime_expired_at?: Date;\n idle_timeout?: number;\n share_url?: string;\n session_id?: string;\n organization_name?: string;\n web_url?: string;\n python_version?: string;\n user_role?: string;\n}\n\n/**\n * Fetches instance information from the Recce server.\n *\n * @param client - Axios instance to use for the request\n * @returns Promise resolving to RecceInstanceInfo\n */\nexport async function getRecceInstanceInfo(\n client: ApiClient,\n): Promise<RecceInstanceInfo> {\n return (\n await client.get<never, ApiResponse<RecceInstanceInfo>>(\n \"/api/instance-info\",\n )\n ).data;\n}\n","\"use client\";\n\nimport type { ApiClient } from \"../lib/fetchClient\";\n\n/**\n * Check if debug logging is enabled via window.RECCE_DEBUG_IDLE\n */\nfunction isDebugEnabled(): boolean {\n // biome-ignore lint/suspicious/noExplicitAny: window flag for debug logging\n return typeof window !== \"undefined\" && !!(window as any).RECCE_DEBUG_IDLE;\n}\n\n/**\n * Minimum interval between keep-alive API calls (3 seconds)\n * This prevents excessive API calls while still maintaining responsive idle detection\n */\nconst MIN_KEEP_ALIVE_INTERVAL_MS = 3 * 1000;\n\n/**\n * State for API-layer throttling\n * - lastKeepAliveTime: timestamp of last SUCCESSFUL keep-alive sent to server\n * - isSending: lock to prevent concurrent API calls\n */\nlet lastKeepAliveTime = 0;\nlet isSending = false;\n\n/** Callback to notify listeners when keep-alive is successfully sent */\ntype KeepAliveCallback = (timestamp: number) => void;\nlet onKeepAliveSuccess: KeepAliveCallback | null = null;\n\n/**\n * Register a callback to be notified when keep-alive is successfully sent\n * Used by IdleTimeoutContext to track server sync time\n */\nexport function setKeepAliveCallback(callback: KeepAliveCallback | null): void {\n onKeepAliveSuccess = callback;\n}\n\n/**\n * Send a keep-alive signal to the server to reset the idle timeout timer.\n * This prevents the server from shutting down due to inactivity.\n *\n * Includes built-in throttling at the API layer:\n * - Minimum 3 seconds between API calls\n * - Prevents concurrent API calls with a lock\n *\n * @param client - API client instance (required)\n * @returns true if keep-alive was sent, false if throttled/skipped\n */\nexport async function sendKeepAlive(client: ApiClient): Promise<boolean> {\n const now = Date.now();\n const elapsed = now - lastKeepAliveTime;\n\n // Throttle: skip if called within minimum interval\n if (elapsed < MIN_KEEP_ALIVE_INTERVAL_MS) {\n return false;\n }\n\n // Prevent concurrent sends\n if (isSending) {\n return false;\n }\n\n try {\n // Acquire lock inside try to ensure finally always releases it\n isSending = true;\n await client.post(\"/api/keep-alive\");\n // Update timestamp only on SUCCESS\n lastKeepAliveTime = Date.now();\n // Notify listeners\n if (onKeepAliveSuccess) {\n onKeepAliveSuccess(lastKeepAliveTime);\n }\n return true;\n } catch (error) {\n // Silent fail - don't disrupt user experience if keep-alive fails\n if (isDebugEnabled()) {\n const errorMessage =\n error instanceof Error ? error.message : String(error);\n console.log(\"[Keep-Alive] Failed to send\", {\n error: errorMessage,\n timestamp: new Date().toISOString(),\n willRetryOnNextActivity: true,\n });\n }\n return false;\n } finally {\n isSending = false;\n }\n}\n\n/**\n * Get the last successful keep-alive timestamp\n * This represents the last time the server confirmed it received our keep-alive\n */\nexport function getLastKeepAliveTime(): number {\n return lastKeepAliveTime;\n}\n\n/**\n * Reset all module state (for testing purposes)\n */\nexport function resetKeepAliveState(): void {\n lastKeepAliveTime = 0;\n isSending = false;\n onKeepAliveSuccess = null;\n}\n"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"user.js","names":[],"sources":["../../../src/lib/api/user.ts"],"sourcesContent":["import {\n type ApiClient,\n type ApiResponse,\n createFetchClient,\n} from \"../fetchClient\";\n\nexport interface User {\n id: string;\n login: string;\n login_type: string;\n email: string;\n onboarding_state: string;\n}\n\ninterface GitHubUser {\n login: string;\n id: number;\n avatar_url: string;\n}\n\nconst defaultClient = createFetchClient({ baseURL: \"\" });\nconst githubClient = createFetchClient({ baseURL: \"https://api.github.com\" });\n\nexport async function fetchUser(\n client: ApiClient = defaultClient,\n): Promise<User> {\n try {\n const response = await client.get<never, ApiResponse<User>>(\"/api/users\");\n return response.data;\n } catch (error) {\n if (process.env.NODE_ENV !== \"test\") {\n console.error(\"Error fetching user data:\", error);\n }\n throw error;\n }\n}\n\nexport async function fetchGitHubAvatar(\n userId: string,\n): Promise<string | null> {\n try {\n const response = await githubClient.get<never, ApiResponse<GitHubUser>>(\n `/user/${userId}`,\n );\n return response.data.avatar_url;\n } catch (error) {\n if (process.env.NODE_ENV !== \"test\") {\n console.warn(\"Failed to fetch GitHub avatar:\", error);\n }\n return null;\n }\n}\n"],"mappings":";kDAoBA,MAAM,EAAgB,EAAkB,CAAE,QAAS,GAAI,CAAC,CAClD,EAAe,EAAkB,CAAE,QAAS,yBAA0B,CAAC,CAE7E,eAAsB,EACpB,EAAoB,EACL,CACf,GAAI,CAEF,OADiB,MAAM,EAAO,IAA8B,aAAa,EACzD,WACT,EAAO,CAId,MAFE,QAAQ,MAAM,4BAA6B,EAAM,CAE7C,GAIV,eAAsB,EACpB,EACwB,CACxB,GAAI,CAIF,OAHiB,MAAM,EAAa,IAClC,SAAS,IACV,EACe,KAAK,iBACd,EAAO,CAId,OAFE,QAAQ,KAAK,iCAAkC,EAAM,CAEhD"}
1
+ {"version":3,"file":"user.js","names":[],"sources":["../../../src/lib/api/user.ts"],"sourcesContent":["import {\n type ApiClient,\n type ApiResponse,\n createFetchClient,\n} from \"../fetchClient\";\n\nexport interface User {\n id: string;\n login: string;\n login_type: string;\n email: string;\n onboarding_state: string;\n}\n\ninterface GitHubUser {\n login: string;\n id: number;\n avatar_url: string;\n}\n\nconst defaultClient = createFetchClient({ baseURL: \"\" });\nconst githubClient = createFetchClient({ baseURL: \"https://api.github.com\" });\n\nexport async function fetchUser(\n client: ApiClient = defaultClient,\n): Promise<User> {\n try {\n const response = await client.get<never, ApiResponse<User>>(\"/api/users\");\n return response.data;\n } catch (error) {\n if (process.env.NODE_ENV !== \"test\") {\n console.error(\"Error fetching user data:\", error);\n }\n throw error;\n }\n}\n\nexport async function fetchGitHubAvatar(\n userId: string,\n): Promise<string | null> {\n try {\n const response = await githubClient.get<never, ApiResponse<GitHubUser>>(\n `/user/${userId}`,\n );\n return response.data.avatar_url;\n } catch (error) {\n if (process.env.NODE_ENV !== \"test\") {\n console.warn(\"Failed to fetch GitHub avatar:\", error);\n }\n return null;\n }\n}\n"],"mappings":";kDAoBA,MAAM,EAAgB,EAAkB,CAAE,QAAS,GAAI,CAAC,CAClD,EAAe,EAAkB,CAAE,QAAS,yBAA0B,CAAC,CAE7E,eAAsB,EACpB,EAAoB,EACL,CACf,GAAI,CAEF,OAAO,MADgB,EAAO,IAA8B,aAAa,EACzD,WACT,EAAO,CAId,MAFE,QAAQ,MAAM,4BAA6B,EAAM,CAE7C,GAIV,eAAsB,EACpB,EACwB,CACxB,GAAI,CAIF,OAAO,MAHgB,EAAa,IAClC,SAAS,IACV,EACe,KAAK,iBACd,EAAO,CAId,OAFE,QAAQ,KAAK,iCAAkC,EAAM,CAEhD"}
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use client";import{$t as e,At as t,Ct as n,Dt as r,Et as i,Ft as a,Gt as o,Ht as s,It as c,Jt as l,Lt as u,Mt as d,Nt as f,Ot as p,Pt as m,Rt as h,St as g,Tt as _,Ut as v,Wt as y,Xt as b,Yt as x,Zt as S,_t as C,an as w,bt as T,ct as E,dn as D,dt as O,en as k,fn as A,ft as j,gn as M,gt as N,hn as P,ht as F,jt as I,kt as L,ln as R,lt as z,mn as B,mt as V,nn as H,on as U,ot as W,pn as G,pt as K,st as q,tn as J,un as Y,ut as X,vt as Z,wt as Q,xt as $,yt as ee,zt as te}from"./hooks-DR9IY-Bd.js";import{dt as ne,ft as re,lt as ie,pt as ae,st as oe,ut as se}from"./utils-BLuXatE_.js";export{B as COLUMN_NODE_HEIGHT,P as COLUMN_NODE_WIDTH,A as ChangedOnlyCheckbox,J as CheckActions,k as CheckBreadcrumb,e as CheckCard,S as CheckDescription,b as CheckDetail,x as CheckEmptyState,l as CheckList,y as CodeEditor,te as CommentInput,Y as DiffDisplayModeSwitch,N as DiffEditor,ae as DiffText,oe as DiffTextWithToast,R as DropdownValuesInput,Z as EmptyRowsRenderer,F as EmptyState,K as ExternalLinkConfirmDialog,E as HSplit,T as HistogramChart,M as LineageColumnNode,o as LineageDiffView,G as LineageEdge,U as LineageLegend,w as LineageNode,j as MarkdownContent,H as NodeTag,W as PRIMITIVES_API_VERSION,s as PresetCheckTemplateView,i as RunList,r as RunListItem,Q as RunProgress,_ as RunProgressOverlay,p as RunStatusAndDate,L as RunStatusBadge,t as RunStatusWithDate,n as RunToolbar,O as ScreenshotBox,ee as ScreenshotDataGrid,X as SplitPane,h as TimelineEvent,ie as Toaster,se as ToasterProvider,D as ToggleSwitch,C as TopKBarChart,z as VSplit,m as buildCheckDescription,a as buildCheckTitle,q as createResultView,I as formatRunDate,d as formatRunDateTime,c as formatSqlAsMarkdown,v as generateCheckTemplate,$ as getChartBarColors,g as getChartThemeColors,f as inferRunStatus,u as isDisabledByNoResult,ne as toaster,V as truncateUrl,re as useToaster};
2
+ "use client";import{$t as e,At as t,Ct as n,Dt as r,Et as i,Ft as a,Gt as o,Ht as s,It as c,Jt as l,Lt as u,Mt as d,Nt as f,Ot as p,Pt as m,Rt as h,St as g,Tt as _,Ut as v,Wt as y,Xt as b,Yt as x,Zt as S,_t as C,an as w,bt as T,ct as E,dn as D,dt as O,en as k,fn as A,ft as j,gn as M,gt as N,hn as P,ht as F,jt as I,kt as L,ln as R,lt as z,mn as B,mt as V,nn as H,on as U,ot as W,pn as G,pt as K,st as q,tn as J,un as Y,ut as X,vt as Z,wt as Q,xt as $,yt as ee,zt as te}from"./hooks-AAVgIiqs.js";import{dt as ne,ft as re,lt as ie,pt as ae,st as oe,ut as se}from"./utils-Cpt1f5aU.js";export{B as COLUMN_NODE_HEIGHT,P as COLUMN_NODE_WIDTH,A as ChangedOnlyCheckbox,J as CheckActions,k as CheckBreadcrumb,e as CheckCard,S as CheckDescription,b as CheckDetail,x as CheckEmptyState,l as CheckList,y as CodeEditor,te as CommentInput,Y as DiffDisplayModeSwitch,N as DiffEditor,ae as DiffText,oe as DiffTextWithToast,R as DropdownValuesInput,Z as EmptyRowsRenderer,F as EmptyState,K as ExternalLinkConfirmDialog,E as HSplit,T as HistogramChart,M as LineageColumnNode,o as LineageDiffView,G as LineageEdge,U as LineageLegend,w as LineageNode,j as MarkdownContent,H as NodeTag,W as PRIMITIVES_API_VERSION,s as PresetCheckTemplateView,i as RunList,r as RunListItem,Q as RunProgress,_ as RunProgressOverlay,p as RunStatusAndDate,L as RunStatusBadge,t as RunStatusWithDate,n as RunToolbar,O as ScreenshotBox,ee as ScreenshotDataGrid,X as SplitPane,h as TimelineEvent,ie as Toaster,se as ToasterProvider,D as ToggleSwitch,C as TopKBarChart,z as VSplit,m as buildCheckDescription,a as buildCheckTitle,q as createResultView,I as formatRunDate,d as formatRunDateTime,c as formatSqlAsMarkdown,v as generateCheckTemplate,$ as getChartBarColors,g as getChartThemeColors,f as inferRunStatus,u as isDisabledByNoResult,ne as toaster,V as truncateUrl,re as useToaster};
package/dist/result.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use client";import{st as e}from"./hooks-DR9IY-Bd.js";export{e as createResultView};
2
+ "use client";import{st as e}from"./hooks-AAVgIiqs.js";export{e as createResultView};
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import{$ as e,A as t,D as n,G as r,J as i,K as a,M as o,N as s,O as c,R as l,S as u,W as d,X as f,_t as p,a as m,c as h,d as g,et as _,gt as v,h as y,it as b,j as x,k as S,l as C,lt as w,m as T,mt as E,n as D,nt as O,o as k,p as ee,s as te,u as A,w as ne,x as re}from"./api-BqrSvFO2.js";import{c as ie,f as j}from"./keepAlive-DbC0X4zr.js";import{n as M,r as ae,t as oe}from"./fetchClient-BVyYwVMf.js";import{C as se,O as ce,T as N,_ as P,a as F,b as le,d as ue,f as de,g as fe,h as pe,j as me,k as he,l as ge,m as _e,o as ve,p as ye,s as be,u as xe,v as Se,w as Ce,y as we}from"./utils-COgjW7er.js";import{i as Te,n as I}from"./colors-BbPSDR1X.js";import{$t as Ee,A as De,B as L,Bt as Oe,C as ke,Cn as Ae,D as je,Dn as Me,En as Ne,Fn as Pe,Ft as Fe,Ht as Ie,I as Le,In as R,It as z,Jt as Re,Lt as ze,Mn as Be,Mt as Ve,Nn as He,O as Ue,Pt as We,Qt as Ge,Sn as Ke,T as qe,Tn as Je,Ut as Ye,Vt as B,Wt as Xe,Xt as Ze,Yt as Qe,Zt as $e,_n as et,a as tt,an as nt,bn as rt,cn as it,ct as at,d as ot,en as st,et as ct,f as lt,ft as ut,gn as dt,gt as ft,in as pt,j as mt,k as ht,ln as gt,lt as _t,n as vt,nn as yt,o as bt,on as xt,p as St,rn as Ct,s as wt,t as Tt,u as Et,ut as Dt,vn as Ot,vt as kt,w as At,wn as jt,x as Mt,xn as Nt,yn as Pt,yt as Ft,zt as It}from"./hooks-DR9IY-Bd.js";import{Ft as Lt,Pt as Rt,a as zt,ct as Bt,dt as Vt,i as Ht,m as Ut,o as Wt,r as Gt,s as Kt,t as qt}from"./utils-BLuXatE_.js";import{fetchGitHubAvatar as Jt,fetchUser as Yt}from"./lib/api/user.js";import{PUBLIC_API_URL as Xt,PUBLIC_CLOUD_WEB_URL as Zt,RECCE_SUPPORT_CALENDAR_URL as Qt}from"./lib/const.js";import{EXPLORE_ACTION as $t,EXPLORE_FORM_EVENT as en,EXPLORE_SOURCE as tn,trackArtifactUploadStarted as nn,trackColumnLevelLineage as rn,trackCopyToClipboard as an,trackDwSetupCompleted as on,trackDwSetupShown as sn,trackDwSetupSkipped as cn,trackEnvironmentConfig as ln,trackExploreAction as un,trackExploreActionForm as dn,trackHistoryAction as fn,trackInit as pn,trackLineageSelection as mn,trackLineageViewRender as hn,trackMultiNodesAction as gn,trackNavigation as _n,trackOssShareButtonClicked as vn,trackPreviewChange as yn,trackPreviewChangeFeedback as bn,trackRedirectToCloudSession as xn,trackSignupCompleted as Sn,trackSignupRedirectInitiated as Cn,trackSingleEnvironment as wn,trackStateAction as Tn}from"./lib/api/track.js";import{t as En}from"./constants-D-hOGDbU.js";import{QueryClient as Dn,QueryClientProvider as On,useMutation as kn,useQuery as An,useQueryClient as jn}from"@tanstack/react-query";import{Suspense as Mn,createContext as Nn,forwardRef as Pn,memo as Fn,useCallback as V,useContext as In,useEffect as Ln,useImperativeHandle as Rn,useLayoutEffect as zn,useMemo as H,useRef as Bn,useState as U}from"react";import{Fragment as W,jsx as G,jsxs as K}from"react/jsx-runtime";import q from"@mui/material/Box";import J from"@mui/material/Button";import Vn from"@mui/material/Dialog";import Hn from"@mui/material/DialogActions";import Un from"@mui/material/DialogContent";import Wn from"@mui/material/DialogTitle";import Gn from"@mui/material/Link";import Y from"@mui/material/Stack";import X from"@mui/material/Typography";import Kn from"js-cookie";import{LuExternalLink as qn,LuSave as Jn}from"react-icons/lu";import{alpha as Yn,useTheme as Xn}from"@mui/material/styles";import{useTheme as Zn}from"next-themes";import Z from"@mui/material/IconButton";import Qn from"next/link";import{IoBookmarksOutline as $n,IoClose as er,IoSync as tr,IoWarning as nr}from"react-icons/io5";import rr from"@mui/material/Divider";import ir from"@mui/material/CircularProgress";import Q from"@mui/material/Tooltip";import{FaCloud as ar,FaExpandArrowsAlt as or,FaGithub as sr,FaQuestionCircle as cr,FaRegDotCircle as lr,FaSlack as ur,FaUser as dr}from"react-icons/fa";import{PiBookmarkSimple as fr,PiCaretDown as pr,PiChatText as mr,PiCheckCircle as hr,PiCircle as gr,PiCopy as _r,PiExport as vr,PiInfo as yr,PiInfoFill as br,PiMoon as xr,PiNotePencil as Sr,PiPencil as Cr,PiPencilSimple as wr,PiPlusCircle as Tr,PiRepeat as Er,PiSun as Dr,PiTrashFill as Or,PiTrashSimple as kr,PiUserPlus as Ar,PiX as jr}from"react-icons/pi";import Mr from"@mui/material/Chip";import{Background as Nr,BackgroundVariant as Pr,BaseEdge as Fr,ControlButton as Ir,Controls as Lr,MiniMap as Rr,Panel as zr,Position as Br,ReactFlow as Vr,ReactFlowProvider as Hr,getBezierPath as Ur,getNodesBounds as Wr,useEdgesState as Gr,useNodesState as Kr,useReactFlow as qr,useStore as Jr}from"@xyflow/react";import Yr from"file-saver";import Xr from"@mui/material/Checkbox";import Zr from"@mui/material/FormControlLabel";import Qr from"@mui/material/Alert";import $r from"@mui/material/Menu";import $ from"@mui/material/MenuItem";import{isEmpty as ei}from"lodash";import{VscCircleLarge as ti,VscFeedback as ni,VscGitPullRequest as ri,VscHistory as ii,VscKebabVertical as ai}from"react-icons/vsc";import oi from"@mui/material/ListSubheader";import si from"@mui/material/FormControl";import ci from"@mui/material/TextField";import{format as li,formatDistanceToNow as ui,parseISO as di}from"date-fns";import fi from"@mui/material/Tab";import pi from"@mui/material/Tabs";import mi from"@mui/material/List";import hi from"@mui/material/ListItem";import"@xyflow/react/dist/style.css";import{Box as gi,Typography as _i}from"@mui/material";import vi from"@mui/material/Avatar";import yi from"@mui/material/Popover";import{usePathname as bi,useRouter as xi,useSearchParams as Si}from"next/navigation";import{TbChecklist as Ci,TbEdit as wi}from"react-icons/tb";import Ti from"@mui/material/ListItemIcon";import Ei from"@mui/material/ListItemText";import{FiArrowRight as Di,FiCopy as Oi,FiInfo as ki,FiPackage as Ai}from"react-icons/fi";import ji from"@mui/material/Switch";import{RiArrowDownSFill as Mi,RiArrowUpSFill as Ni,RiMindMap as Pi,RiSwapLine as Fi,RiTerminalBoxLine as Ii}from"react-icons/ri";import{FaBookmark as Li,FaFileImport as Ri}from"react-icons/fa6";import{BiArrowFromBottom as zi,BiArrowToBottom as Bi}from"react-icons/bi";import Vi from"@dagrejs/dagre";import Hi from"@mui/material/Skeleton";import{AiOutlineExperiment as Ui}from"react-icons/ai";import Wi from"@mui/material/Radio";import Gi from"@mui/material/RadioGroup";import Ki from"@mui/material/Table";import qi from"@mui/material/TableBody";import Ji from"@mui/material/TableCell";import Yi from"@mui/material/TableContainer";import Xi from"@mui/material/TableHead";import Zi from"@mui/material/TableRow";import Qi from"@mui/material/InputLabel";import $i from"@mui/material/Select";import ea from"@mui/material/Badge";import ta from"@mui/material/Grid";import{stripIndents as na}from"common-tags";import{IoMdCodeWorking as ra}from"react-icons/io";import{DragDropContext as ia,Draggable as aa,Droppable as oa}from"@hello-pangea/dnd";import sa from"@mui/material/Card";import ca from"@mui/material/CardContent";import la from"@mui/material/CardHeader";const ua=Nn(null);ua.displayName=`RecceRoutingContext`;function da(){return In(ua)||{basePath:``,buildPath:e=>e,pathname:``,navigate:e=>{typeof window<`u`&&(window.location.href=e)}}}function fa(){let{pathname:e,navigate:t}=da();return[e,t]}function pa({children:e,config:t}){let n=t?.basePath??``,r=t?.pathname??``,i=t?.onNavigate,a=V(e=>n?`${n}${e.startsWith(`/`)?e:`/${e}`}`:e,[n]),o=V((e,t)=>{i?i(e,t):typeof window<`u`&&(t?.replace?(window.history.replaceState(null,``,e),window.dispatchEvent(new PopStateEvent(`popstate`))):window.location.href=e)},[i]),s=H(()=>({basePath:n,buildPath:a,pathname:r,navigate:o}),[n,a,r,o]);return G(ua.Provider,{value:s,children:e})}const ma=e=>new Dn({defaultOptions:{queries:{staleTime:e?.staleTime??1e3*60,gcTime:e?.gcTime??1e3*60*5,retry:1,refetchOnWindowFocus:!1}}});function ha({children:e,api:t,theme:n=`system`,routing:r,queryClient:i,runActions:a,lineage:o,checks:s,query:c,features:l={}}){let u=i?.staleTime,d=i?.gcTime,f=H(()=>ma({staleTime:u,gcTime:d}),[u,d]),{enableInstance:p=!0,enableIdleTimeout:m=!0,enableLineage:h=!0,enableRunActions:g=!0,enableChecks:_=!0,enableQuery:v=!0}=l,y=e;return y=G(pa,{config:r,children:y}),y=G(Lt,{defaultMode:n,children:y}),y=G(ie,{config:t,children:y}),y=G(On,{client:f,children:y}),v&&(y=G(He,{sql:c?.sql,isExecuting:c?.isExecuting,error:c?.error,baseResult:c?.baseResult,currentResult:c?.currentResult,onSqlChange:c?.onSqlChange,onExecute:c?.onExecute,onCancel:c?.onCancel,children:y})),_&&(y=G(Pe,{checks:s?.checks,isLoading:s?.isLoading,error:s?.error,selectedCheckId:s?.selectedCheckId,onSelectCheck:s?.onSelectCheck,onCreateCheck:s?.onCreateCheck,onUpdateCheck:s?.onUpdateCheck,onDeleteCheck:s?.onDeleteCheck,onReorderChecks:s?.onReorderChecks,refetchChecks:s?.refetchChecks,children:y})),g&&(y=G(ce,{onRunAction:a?.onRunAction,onShowRunId:a?.onShowRunId,initialRunId:a?.initialRunId,initialHistoryOpen:a?.initialHistoryOpen,children:y})),h&&(y=G(fe,{lineageGraph:o?.lineageGraph,envInfo:o?.envInfo,reviewMode:o?.reviewMode,cloudMode:o?.cloudMode,fileMode:o?.fileMode,fileName:o?.fileName,isDemoSite:o?.isDemoSite,isCodespace:o?.isCodespace,isLoading:o?.isLoading,error:o?.error,supportTasks:o?.supportTasks,onRefetchLineageGraph:o?.onRefetchLineageGraph,runsAggregated:o?.runsAggregated,onRefetchRunsAggregated:o?.onRefetchRunsAggregated,children:y})),m&&(y=G(we,{children:y})),p&&(y=G(se,{children:y})),y}function ga({actionState:e,onCancel:t,onClose:n}){let r=()=>e.mode===`per_node`?`${e.completed} / ${e.total}`:e.currentRun?.progress?.percentage?`${e.currentRun.progress.percentage*100}%`:e.status===`completed`?`100%`:`0%`,i=e.status===`running`||e.status===`canceling`;return G(q,{sx:{bgcolor:`background.paper`,borderRadius:1,boxShadow:6},children:K(Y,{direction:`row`,divider:G(rr,{orientation:`vertical`,flexItem:!0}),spacing:2,sx:{p:`5px 15px`,mt:2},children:[K(q,{sx:{fontSize:`10pt`},children:[`Progress: `,r(),` `,e.status===`canceled`?` (canceled)`:``]}),i?G(J,{size:`small`,variant:`outlined`,onClick:t,disabled:e.status===`canceling`,children:e.status===`canceling`?`Canceling`:`Cancel`}):G(Y,{direction:`row`,children:G(J,{size:`small`,variant:`outlined`,onClick:n,children:`Close`})})]})})}const _a=({lineageGraph:e,cllInput:t,onCenterNode:n})=>{let r={cursor:`pointer`,fontFamily:`monospace`,bgcolor:Rt()?`grey.700`:`grey.100`,px:.5,borderRadius:.5};if(!e)return G(W,{});if(!t)return G(W,{children:`Default View`});if(t.node_id===void 0)return G(X,{component:`span`,children:`Impact Radius for All Changed Models`});let i=t.node_id in e.nodes?e.nodes[t.node_id].data.name:t.node_id;if(!t.column){let e=t.node_id;return K(W,{children:[G(X,{component:`span`,sx:{mr:`5px`},children:`Impact Radius for`}),G(q,{component:`code`,onClick:()=>{n(e)},sx:r,children:i})]})}let a=`${t.node_id}_${t.column}`;return K(W,{children:[K(X,{component:`span`,sx:{mr:`5px`},children:[`Column Lineage for`,` `]}),K(q,{component:`code`,onClick:()=>{n(a)},sx:r,children:[i,`.`,t.column]})]})},va=({action:e,interactive:t,viewOptions:n,lineageGraph:r,singleEnvMode:i=!1,changeAnalysisAvailable:a=!0,onShowCll:o,onResetCll:s,onCenterNode:c,setChangeAnalysisMode:l,newCllExperience:u=!1,changeAnalysisMode:d=!1})=>{let f=n.column_level_lineage,p=!r?.catalogMetadata.current,m=u&&d,h=f&&!(u&&!f.column);return K(Y,{direction:`row`,spacing:`5px`,children:[!i&&!m&&G(q,{sx:{borderRadius:1,boxShadow:3},children:G(Q,{enterDelay:50,title:a?p?`Please provide catalog.json to enable Impact Radius`:``:`Requires warehouse connection`,placement:`top`,children:G(`span`,{children:G(J,{size:`small`,variant:`outlined`,color:`neutral`,sx:{whiteSpace:`nowrap`,display:`inline-flex`,bgcolor:`background.paper`},disabled:!t||p||!a||e.isPending,startIcon:G(lr,{}),onClick:()=>{l?.(!0),o({no_upstream:!0,change_analysis:!0})},children:`Impact Radius`})})})}),h&&K(Y,{direction:`row`,sx:{alignItems:`center`,borderRadius:1,boxShadow:3,border:`1px solid`,borderColor:`divider`,bgcolor:`background.paper`,fontSize:`0.8rem`,p:`0 0.625rem`},children:[G(_a,{lineageGraph:r,cllInput:f,onCenterNode:c}),e.isError&&G(Q,{title:`Error: ${e.error.message}`,placement:`bottom`,children:G(X,{component:`span`,sx:{color:`error.main`,ml:`2px`,display:`inline-flex`,alignItems:`center`},children:G(q,{component:yr,sx:{color:`error.main`,fontSize:`14px`}})})}),e.isPending?G(ir,{size:12,sx:{ml:`2px`}}):G(Z,{size:`small`,sx:{ml:`2px`},"aria-label":`Reset Column Level Lineage`,onClick:()=>{s()},children:G(jr,{size:`10px`})})]})]})};function ya({onClose:e}){let{cancel:t,actionState:n}=pe();return G(ga,{actionState:n,onCancel:t,onClose:e})}const ba=({action:e})=>{let{showColumnLevelLineage:t,resetColumnLevelLineage:n,interactive:r,viewOptions:i,centerNode:a,setChangeAnalysisMode:o,newCllExperience:s,changeAnalysisMode:c}=pe(),{data:l}=xe(),u=l?.single_env_onboarding??!1,{lineageGraph:d,isActionAvailable:f}=P();return G(va,{action:e,interactive:r,viewOptions:i,lineageGraph:d,singleEnvMode:u,changeAnalysisAvailable:f(`change_analysis`),onShowCll:t,onResetCll:()=>n(),onCenterNode:a,setChangeAnalysisMode:o,newCllExperience:s,changeAnalysisMode:c})};function xa(e){let{id:t,data:n}=e,{id:r}=n.node,{column:i,type:a,transformationType:o,changeStatus:s,isImpacted:c}=n,l=Jr(e=>e.transform[2]>.3),{isDark:u}=Tt(),{viewOptions:d,showContextMenu:f,isNodeHighlighted:p,isNodeShowingChangeAnalysis:m,newCllExperience:h}=pe(),g=d.column_level_lineage?.node_id,_=i===d.column_level_lineage?.column&&r===g,v=p(t),y=m(r);return G(dt,{id:t,data:{column:i,type:a,nodeId:r,transformationType:o,changeStatus:s,isHighlighted:v,isFocused:_,isImpacted:c},showContent:l,showChangeAnalysis:y,isDark:u,newCllExperience:h,onContextMenu:(t,n)=>{f(t,e)}})}const Sa=Fn(xa);Sa.displayName=`GraphColumnNode`;function Ca(e){let{source:t,target:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,style:l={},markerEnd:u,data:d,isEdgeHighlighted:f}=e,p={...l};d?.changeStatus&&(p.stroke=Ke(d.changeStatus).hexColor,p.strokeDasharray=`5`),!f||f(t,n)||(p.filter=jt);let[m]=Ur({sourceX:r,sourceY:i,sourcePosition:s,targetX:a,targetY:o,targetPosition:c});return G(W,{children:G(Fr,{path:m,markerEnd:u,style:{...p,...l}})})}const wa=Fn(Ca);wa.displayName=`GraphEdge`;function Ta(e){let{isEdgeHighlighted:t}=pe();return G(wa,{...e,isEdgeHighlighted:t})}const Ea=()=>G(`svg`,{stroke:`currentColor`,fill:`currentColor`,strokeWidth:`0`,viewBox:`0 0 256 256`,height:`1em`,width:`1em`,xmlns:`http://www.w3.org/2000/svg`,children:G(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z`})}),Da=()=>G(`svg`,{stroke:`currentColor`,fill:`currentColor`,strokeWidth:`0`,viewBox:`0 0 256 256`,height:`1em`,width:`1em`,xmlns:`http://www.w3.org/2000/svg`,children:G(`path`,{d:`M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z`})});function Oa({skipReason:e}){return G(Mr,{size:`small`,label:K(Y,{direction:`row`,sx:{fontSize:`10pt`,color:`grey.500`,alignItems:`center`,gap:`3px`},children:[G(q,{children:`Skipped`}),e&&G(Q,{title:e,children:G(q,{component:`span`,sx:{display:`flex`},children:G(Ea,{})})})]}),sx:{bgcolor:`grey.100`}})}function ka({errorMessage:e}){return K(Y,{direction:`row`,sx:{fontSize:`10pt`,color:`gray`,alignItems:`center`},children:[G(q,{children:`Error`}),e&&G(Q,{title:e,children:G(q,{component:`span`,sx:{display:`flex`},children:G(Da,{})})})]})}function Aa({result:e}){let{mismatchedColumns:t}=e,n=t>0;return G(Mr,{size:`small`,sx:{bgcolor:n?`error.light`:`success.light`},label:G(Y,{direction:`row`,sx:{fontSize:`10pt`,color:n?`error.main`:`success.main`,alignItems:`center`,gap:`3px`},children:n?`${t} columns mismatched`:`All columns match`})})}function ja({result:e}){let{base:t,current:n}=e,r=t===null?`N/A`:t.toLocaleString(),i=n===null?`N/A`:n.toLocaleString(),a=``,o=`grey.500`;return t!==null&&n!==null&&(n>t?(a=`↑`,o=`success.main`):n<t?(a=`↓`,o=`error.main`):a=`=`),G(Mr,{size:`small`,sx:{bgcolor:`grey.100`},label:K(Y,{direction:`row`,sx:{fontSize:`10pt`,alignItems:`center`,gap:`3px`},children:[G(q,{children:r}),G(q,{children:`→`}),G(q,{children:i}),a&&G(q,{component:`span`,sx:{color:o,ml:.5},children:a})]})})}function Ma({status:e,skipReason:t,errorMessage:n,progress:r,valueDiffResult:i,rowCountDiffResult:a,runId:o,"data-testid":s}){return e===`pending`?G(ir,{size:16,"data-testid":s,"data-status":`pending`}):e===`skipped`?G(q,{"data-testid":s,"data-status":`skipped`,children:G(Oa,{skipReason:t})}):e===`running`?r?.percentage===void 0?G(ir,{size:16,"data-testid":s,"data-status":`running`}):G(ir,{variant:`determinate`,value:r.percentage*100,size:16,"data-testid":s,"data-status":`running`}):e===`error`?G(q,{"data-testid":s,"data-status":`error`,children:G(ka,{errorMessage:n})}):i?G(q,{"data-testid":s,"data-status":`success`,children:G(Aa,{result:i})}):a?G(q,{"data-testid":s,"data-status":`success`,children:G(ja,{result:a})}):G(q,{"data-testid":s,"data-status":`success`,children:o||`Complete`})}const Na=Fn(Ma);Na.displayName=`ActionTag`;const Pa={success:`#059669`,failure:`#ef4444`,error:`#ef4444`,warning:`#f59e0b`},Fa={success:`PASSED`,failure:`FAILED`,error:`ERROR`,warning:`WARNING`};function Ia(e){return Pa[e]??`#6b7280`}function La(e){return Fa[e]??e.toUpperCase()}function Ra({run:e,index:t,onClick:n}){let r=Ia(e.status),i=La(e.status),a=ui(new Date(e.run_at),{addSuffix:!0}),o=!!n;return K(gi,{component:o?`button`:`div`,type:o?`button`:void 0,onClick:o?()=>n?.(e.run_id):void 0,"aria-label":o?`View run #${t} — ${i}`:void 0,sx:{p:1,border:`none`,borderLeft:`3px solid ${r}`,borderRadius:1,bgcolor:`action.hover`,cursor:o?`pointer`:`default`,"&:hover":o?{bgcolor:`action.selected`}:{},textAlign:`left`,width:`100%`,font:`inherit`,color:`inherit`},children:[K(_i,{variant:`body2`,sx:{fontWeight:600,fontSize:`0.75rem`},children:[`Run #`,t,` — `,i,e.triggered_by===`recce_ai`&&G(_i,{component:`span`,sx:{ml:.75,fontSize:`0.65rem`,fontWeight:500,color:`#7c3aed`},children:`by AI`})]}),e.summary&&G(_i,{variant:`body2`,sx:{color:`text.secondary`,fontSize:`0.7rem`,mt:.25},children:e.summary}),G(_i,{variant:`body2`,sx:{color:`text.secondary`,fontSize:`0.65rem`,mt:.25},children:a})]})}function za({event:e}){let t=l(e),n={create:Tr,comment:mr,approve:hr,unapprove:gr,edit:Sr,preset:fr},r={create:`primary.main`,comment:`grey.500`,approve:`success.main`,unapprove:`grey.400`,edit:`warning.main`,preset:`secondary.main`},i=n[t],a=r[t];return G(q,{component:i,sx:{color:a,fontSize:16}})}function Ba({event:e}){let{actor:t}=e,{avatarUrl:n}=Oe({userId:t.user_id}),r=(t.fullname||t.login||`User`).charAt(0).toUpperCase();return G(vi,{src:n||void 0,sx:{width:24,height:24,fontSize:`0.75rem`},children:r})}function Va({event:e}){let{actor:t}=e,n=t.fullname||t.login||`Someone`,r=ui(new Date(e.created_at),{addSuffix:!0}),i=``;switch(e.event_type){case`check_created`:i=`created this check`;break;case`approval_change`:i=e.new_value===`true`?`approved this check`:`unapproved this check`;break;case`description_change`:i=`updated the description`;break;case`name_change`:i=`renamed this check`;break;case`preset_applied`:i=`applied a preset`;break;default:i=`made a change`}return K(q,{sx:{display:`flex`,gap:1,alignItems:`flex-start`,py:1},children:[G(q,{sx:{pt:`2px`},children:G(za,{event:e})}),G(q,{sx:{flex:1},children:K(Y,{direction:`row`,spacing:.5,sx:{flexWrap:`wrap`,alignItems:`center`},children:[G(Ba,{event:e}),G(X,{variant:`body2`,sx:{fontWeight:`500`},children:n}),G(X,{variant:`body2`,sx:{color:`text.secondary`},children:i}),G(X,{variant:`caption`,sx:{color:`text.disabled`},children:r})]})})]})}function Ha({event:e,currentUserId:t,onEdit:n,onDelete:r}){let i=Rt(),[a,o]=U(!1),[s,c]=U(e.content||``),[l,u]=U(!1),[d,f]=U(!1),[p,m]=U(null),h=!!p,{actor:g}=e,_=g.fullname||g.login||`Someone`,v=ui(new Date(e.created_at),{addSuffix:!0}),y=t&&String(g.user_id)===String(t),b=()=>{c(e.content||``),o(!0)},x=()=>{c(e.content||``),o(!1)},S=async()=>{let t=s.trim();if(!t||t===e.content){x();return}if(n){u(!0);try{await n(e.id,t),o(!1)}finally{u(!1)}}},C=e=>{e.key===`Escape`?x():e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),S())},w=e=>{m(e.currentTarget)},T=()=>{m(null)};return e.is_deleted?K(q,{sx:{display:`flex`,gap:1,alignItems:`center`,py:1},children:[G(q,{sx:{pt:`2px`,display:`flex`,alignItems:`center`},children:G(za,{event:e})}),G(q,{sx:{display:`flex`,flex:1,alignItems:`center`},children:G(X,{variant:`body2`,sx:{color:`text.disabled`,fontStyle:`italic`},children:`Comment deleted`})})]}):K(q,{sx:{display:`flex`,gap:1,alignItems:`flex-start`,py:1},children:[G(q,{sx:{pt:`2px`},children:G(za,{event:e})}),K(q,{sx:{flex:1},children:[K(Y,{direction:`row`,spacing:.5,sx:{flexWrap:`wrap`,alignItems:`center`,mb:.5},children:[G(Ba,{event:e}),K(X,{variant:`body2`,sx:{fontWeight:`500`},children:[_,y&&K(X,{component:`span`,variant:`body2`,sx:{color:`text.secondary`},children:[` `,`(Author)`]})]}),G(X,{variant:`caption`,sx:{color:`text.disabled`},children:v}),e.is_edited&&G(X,{variant:`caption`,sx:{color:`text.disabled`},children:`(edited)`})]}),a?K(q,{children:[G(ci,{value:s,onChange:e=>c(e.target.value),onKeyDown:C,size:`small`,multiline:!0,minRows:3,fullWidth:!0,disabled:l,autoFocus:!0,sx:{"& .MuiOutlinedInput-root":{bgcolor:`background.paper`,"&:focus-within":{borderColor:`primary.main`}}}}),K(Y,{direction:`row`,spacing:1,sx:{justifyContent:`flex-end`,mt:1},children:[G(J,{size:`small`,variant:`text`,onClick:x,disabled:l,children:`Cancel`}),G(J,{size:`small`,variant:`contained`,onClick:S,disabled:!s.trim()||l,children:l?`Saving...`:`Save`})]})]}):K(q,{sx:{bgcolor:i?`grey.800`:`grey.50`,borderRadius:1,p:1,border:`1px solid`,borderColor:i?`grey.700`:`grey.200`,position:`relative`,"&:hover .comment-actions":{opacity:1}},children:[G(ut,{content:e.content||``,fontSize:`sm`}),y&&(n||r)&&K(Y,{className:`comment-actions`,direction:`row`,spacing:0,sx:{position:`absolute`,top:4,right:4,opacity:0,transition:`opacity 0.2s`},children:[n&&G(Q,{title:`Edit comment`,children:G(Z,{"aria-label":`Edit comment`,size:`small`,onClick:b,children:G(wr,{})})}),r&&K(W,{children:[G(Q,{title:`Delete comment`,children:G(Z,{"aria-label":`Delete comment`,size:`small`,color:`error`,onClick:w,children:G(kr,{})})}),G(yi,{open:h,anchorEl:p,onClose:T,anchorOrigin:{vertical:`bottom`,horizontal:`center`},transformOrigin:{vertical:`top`,horizontal:`center`},children:K(q,{sx:{p:2},children:[G(X,{variant:`body2`,sx:{mb:2},children:`Delete this comment?`}),K(Y,{direction:`row`,spacing:1,sx:{justifyContent:`flex-end`},children:[G(J,{size:`small`,variant:`text`,onClick:T,disabled:d,children:`Cancel`}),G(J,{size:`small`,variant:`contained`,color:`error`,onClick:async()=>{if(r){f(!0);try{await r(e.id),T()}finally{f(!1)}}},disabled:d,children:d?`Deleting...`:`Delete`})]})]})})]})]})]})]})]})}function Ua({event:e,currentUserId:t,onEdit:n,onDelete:r}){return e.event_type===`comment`?G(Ha,{event:e,currentUserId:t,onEdit:n,onDelete:r}):G(Va,{event:e})}function Wa(e,t){let n=e?.toLowerCase();return n===`finished`?t?`error`:`success`:n===`failed`?`error`:e??`unknown`}function Ga(e,t){let n=[];for(let t of e)n.push({kind:`event`,event:t,at:t.created_at});if(t){let e=[...t].sort((e,t)=>new Date(e.run_at).getTime()-new Date(t.run_at).getTime());for(let t=0;t<e.length;t++)n.push({kind:`run`,run:e[t],index:t+1,at:e[t].run_at})}return n.sort((e,t)=>new Date(t.at).getTime()-new Date(e.at).getTime()),n}function Ka({checkId:e}){let t=Rt(),{apiClient:n,authToken:r}=B(),{events:i,isLoading:a,error:o,createComment:s,isCreatingComment:c,updateComment:l,deleteComment:u}=Et(e),{data:d}=An({queryKey:j.user(),queryFn:()=>Yt(n),retry:!1}),{data:p}=An({queryKey:[`check-runs`,e],queryFn:async()=>(await f(n)).filter(t=>t.check_id===e).map(e=>({run_id:e.run_id,run_at:e.run_at,status:Wa(e.status,e.error),summary:e.error||void 0,triggered_by:e.triggered_by})),enabled:!!r,staleTime:3e4}),m=H(()=>Ga(i,p),[i,p]),h=e=>{s(e)},g=async(e,t)=>{await l({eventId:e,content:t})},_=async e=>{await u(e)};return a?G(q,{sx:{height:`100%`,p:4,display:`flex`,justifyContent:`center`,alignItems:`center`},children:G(ir,{size:20})}):o?G(q,{sx:{height:`100%`,p:4,display:`flex`,justifyContent:`center`,alignItems:`center`},children:G(X,{sx:{fontSize:`0.875rem`,color:`error.main`},children:`Failed to load timeline`})}):K(Y,{sx:{height:`100%`,alignItems:`stretch`,borderLeft:`1px solid`,borderColor:t?`grey.700`:`grey.200`},spacing:0,children:[G(q,{sx:{px:3,py:2,borderBottom:`1px solid`,borderColor:t?`grey.700`:`grey.200`},children:G(X,{variant:`subtitle2`,sx:{fontWeight:500},children:`Activity`})}),G(q,{sx:{flex:1,overflowY:`auto`,px:3,py:2},children:m.length===0?G(X,{sx:{fontSize:`0.875rem`,color:`grey.500`},children:`No activity yet`}):G(Y,{sx:{alignItems:`stretch`},spacing:0,children:m.map((e,n)=>K(q,{children:[e.kind===`event`?G(Ua,{event:e.event,currentUserId:d?.id,onEdit:g,onDelete:_}):G(Ra,{run:e.run,index:e.index}),n<m.length-1&&G(rr,{sx:{borderColor:t?`grey.700`:`grey.100`}})]},e.kind===`event`?e.event.id:e.run.run_id))})}),G(q,{sx:{px:3,py:3,borderTop:`1px solid`,borderColor:t?`grey.700`:`grey.200`,bgcolor:t?`grey.900`:`grey.50`},children:G(It,{onSubmit:h,isSubmitting:c})})]})}function qa({color:e}){return G(q,{component:`span`,sx:{display:`inline-block`,width:`10px`,height:`10px`,bgcolor:e,mr:1,borderRadius:`4px`}})}const Ja=({defaultPrimaryKeys:e,onPrimaryKeysChange:t,...n})=>{let{isActionAvailable:r}=P(),i=H(()=>[],[]);return G(q,{sx:{display:`flex`},...n,children:K(Y,{spacing:0,sx:{m:`0 0.5rem`},children:[K(Y,{direction:`row`,spacing:.5,sx:{alignItems:`center`},children:[G(X,{component:`label`,sx:{fontSize:`0.625rem`,color:`text.secondary`},children:`Diff with Primary Key(s) (suggested)`}),G(Q,{title:`Provide a primary key to perform query diff in data warehouse and only return changed rows.`,placement:`bottom-end`,children:G(q,{component:`span`,sx:{display:`flex`,color:`grey.600`,cursor:`help`},children:G(yr,{fontSize:`0.75rem`})})})]}),G(gt,{className:`no-track-pii-safe`,unitName:`key`,defaultValues:e,suggestionList:i,onValuesChange:t,size:`2xs`,width:`240px`,placeholder:`Select or type to add keys`,disabled:!r(`query_diff_with_primary_key`)})]})})};function Ya({supportCalendarUrl:e=`https://cal.com/team/recce/chat`}){let{data:t}=N();return G(`div`,{className:`flex flex-1 h-full min-h-0 m-2 p-4 bg-blue-50 rounded-lg shadow-md justify-center`,children:K(`div`,{className:`w-4/5 flex flex-col overflow-y-auto gap-6 px-8 pb-8`,children:[K(Y,{spacing:2,sx:{alignItems:`center`},children:[G(q,{sx:{p:1,bgcolor:`background.paper`,borderRadius:`50%`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:2},children:G(q,{component:Ii,sx:{fontSize:28,color:`iochmara.500`}})}),G(X,{variant:`h5`,sx:{mt:2},children:`Wait, there's more!`}),K(X,{sx:{fontSize:`1rem`,textAlign:`center`},children:[`Query functions disabled without a`,` `,G(X,{component:`span`,sx:{fontWeight:`bold`},children:`data warehouse connection`})]})]}),G(Y,{sx:{width:`50%`,mt:3,mx:`auto`},children:G(J,{color:`iochmara`,variant:`contained`,size:`large`,onClick:()=>{window.open(qt(t,e),`_blank`)},children:`Connect to Data Warehouse`})})]})})}const Xa=()=>{let{isCustomQueries:e,setCustomQueries:t,sqlQuery:n,setBaseSqlQuery:r}=Mt();return K(q,{children:[K(Y,{direction:`row`,spacing:.5,sx:{alignItems:`center`,fontSize:`0.75rem`},children:[G(X,{variant:`body2`,sx:{fontSize:`0.75rem`},children:`Custom Queries`}),G(Q,{title:`Custom queries allow you to use two SQL queries to compare results between current and base environments.`,children:G(q,{component:`span`,sx:{display:`flex`,color:`grey.600`},children:G(br,{fontSize:`1rem`})})})]}),G(ji,{size:`small`,checked:e,onChange:()=>{!e&&r&&r(n),t(!e)},color:`primary`})]})},Za=()=>{let{sqlQuery:e,baseSqlQuery:t,setSqlQuery:n,setBaseSqlQuery:i,primaryKeys:o,setPrimaryKeys:s,isCustomQueries:c}=Mt(),{lineageGraph:l,envInfo:u}=P(),{featureToggles:f,singleEnv:p}=Ce(),m=e;u?.adapterType===`sqlmesh`&&e===`select * from {{ ref("mymodel") }}`&&(m=`select * from db.mymodel`),f.mode===`read only`&&(m=`--- Would like to do query here? Book a demo with us at ${Qt}\n${m}`);let{showRunId:h}=he(),{apiClient:g}=B(),{mutate:v,isPending:y}=kn({mutationFn:async e=>{function n(e){switch(e){case`query`:return d;case`query_base`:return r;case`query_diff`:return a;default:throw Error(`Unknown query type: ${e}`)}}let i=e===`query_base`?t??``:m,s=n(e),l={sql_template:i},u={nowait:!0};e===`query_diff`&&(l.primary_keys=o,c&&(l.base_sql_template=t));let{run_id:f}=await s(l,u,g);return h(f),await _(f,void 0,g)}}),b=H(()=>{let e={};if(!l)return`N/A`;for(let t in l.nodes){let n=l.nodes[t].data.schema;n&&(e[n]=(e[n]||0)+1)}return Object.keys(e).reduce((t,n)=>e[n]>(e[t]||0)?n:t,`N/A`)},[l]);return p||f.mode===`metadata only`?K(q,{sx:{display:`flex`,flexDirection:`column`,height:`100%`},children:[K(q,{sx:{display:`flex`,justifyContent:`right`,alignItems:`center`,padding:`4pt 8pt`,gap:`5px`,height:`54px`,borderBottom:`1px solid`,borderColor:`divider`},children:[G(_s,{}),G(q,{sx:{flexGrow:1}}),p?G(Q,{title:`Please configure the base environment before running the diff`,placement:`left`,children:G(`span`,{children:G(J,{variant:`contained`,disabled:!0,size:`small`,sx:{fontSize:`14px`,mt:`16px`},children:`Run Diff`})})}):G(xc,{display:f.mode===`metadata only`,children:G(J,{variant:`contained`,disabled:!0,size:`small`,sx:{fontSize:`14px`,mt:`16px`},children:`Run Diff`})})]}),G(Ue,{value:m,onChange:n,onRun:()=>{v(`query`)},labels:[`base (production)`,`current (${b})`],SetupGuide:f.mode===`metadata only`?G(Ya,{}):G(fs,{})})]}):K(q,{sx:{display:`flex`,flexDirection:`column`,height:`100%`},children:[K(q,{sx:{display:`flex`,justifyContent:`right`,alignItems:`flex-end`,padding:`4pt 8pt`,gap:`5px`,height:`54px`,borderBottom:`1px solid`,borderColor:`divider`,flex:`0 0 54px`},children:[G(_s,{}),G(Xa,{}),G(q,{sx:{flexGrow:1}}),G(Ja,{defaultPrimaryKeys:o,onPrimaryKeysChange:s}),G(J,{variant:`contained`,onClick:()=>{v(`query_diff`)},disabled:y||f.disableDatabaseQuery,size:`small`,children:`Run Diff`})]}),G(q,{sx:{width:`100%`,flex:1,overflowY:`auto`},children:c?G(Ue,{value:m,baseValue:t,onChange:n,onChangeBase:i,onRun:()=>{v(`query`)},onRunBase:()=>{v(`query_base`)},onRunDiff:()=>{v(`query_diff`)}}):G(ht,{value:m,onChange:n,onRun:()=>{v(`query`)},onRunDiff:()=>{v(`query_diff`)}})})]})};function Qa({rowCount:e}){let t=e.base,n=e.curr,r=e.base===null?`N/A`:`${e.base} Rows`,i=e.curr===null?`N/A`:`${e.curr} Rows`,a,o;t===null&&n===null?(a=`Failed to load`,o=`default`):t===null||n===null?(a=`${r} -> ${i}`,o=t===null?`success`:`error`):t===n?(a=`=`,o=`default`):(a=`${Ut(t,n)} Rows`,o=t<n?`success`:`error`);let s=L(`row_count_diff`).icon;return G(Mr,{size:`small`,color:o,icon:s?G(s,{}):void 0,label:a,sx:{height:20,fontSize:`0.7rem`}})}function $a({id:e,inverted:t}){let{lineageGraph:n,runsAggregated:r}=P(),{text:i,isDark:a}=Tt(),o=r?.[e],s=n?.nodes[e];if(!o&&!s)return null;let c;s?.data.change?.columns&&(c=Object.keys(s.data.change.columns).length>0);let l;if(o?.row_count_diff){let e=o.row_count_diff.result;l=e.curr!==e.base}let u=t?i.inverted:Ke(`modified`).color,d=t?i.secondary:a?`grey.700`:`grey.100`,f=L(`schema_diff`).icon;return K(q,{sx:{display:`flex`,flex:1,alignItems:`center`},children:[c!==void 0&&G(Q,{title:`Schema (${c?`changed`:`no change`})`,enterDelay:500,children:G(q,{sx:{height:16},children:f&&G(q,{component:f,sx:{color:c?u:d}})})}),G(q,{sx:{flexGrow:1}}),o?.row_count_diff&&l!==void 0&&G(Q,{title:`Row count (${l?`changed`:`=`})`,enterDelay:500,children:G(q,{children:G(Qa,{rowCount:o.row_count_diff.result})})})]})}function eo({nodeId:e,nodeName:t}){let{getNodeAction:n}=pe(),r=n(e);if(!r)return null;let{status:i,skipReason:a,run:o}=r;if(i===`pending`)return G(Na,{status:`pending`});if(i===`skipped`)return G(Na,{status:`skipped`,skipReason:a});if(!o)return G(Na,{status:`pending`});let{error:s,run_id:c,progress:l}=o;if(i===`running`)return G(Na,{status:`running`,progress:{percentage:l?.percentage}});if(s)return G(Na,{status:`error`,errorMessage:s});if(o.type===`value_diff`&&o.result){let e=o.result,t=0,n=e.data.data.length;for(let n of e.data.data)n[2]<1&&t++;return G(Na,{status:`success`,valueDiffResult:{mismatchedColumns:t,totalColumns:n}})}if(w(o)&&o.result){let e=o.result[t];if(e)return G(Qa,{rowCount:e})}if(o.type===`row_count`&&o.result){let e=o.result[t];if(e?.curr!==void 0&&e.curr!==null)return G(Mr,{size:`small`,label:`${e.curr.toLocaleString()} Rows`,sx:{height:20,fontSize:`0.7rem`}})}return G(Na,{status:`success`,runId:c})}function to(e){let{data:t}=e,{id:n,resourceType:r,changeStatus:i,name:a}=t,o=Jr(e=>e.transform[2]>.3),{isDark:s}=Tt(),{interactive:c,selectNode:l,selectMode:u,focusedNode:d,getNodeAction:f,getNodeColumnSet:p,isNodeHighlighted:m,isNodeSelected:h,isNodeShowingChangeAnalysis:g,showContextMenu:_,viewOptions:v,cll:y,impactedNodeIds:b,newCllExperience:x,showColumnLevelLineage:S,setChangeAnalysisMode:C}=pe(),{isActionAvailable:w}=P(),T=x?b.has(n):!1,E=y?.current.nodes[n]?.change_category,D=m(n),O=h(n),k=v.column_level_lineage?.node_id===n&&v.column_level_lineage.column===void 0,ee=d?.id===n||k,te=g(n),A=p(t.id),ne=u===`action_result`?f(t.id):void 0,re=i,ie=u,j=u===`action_result`&&ne?G(eo,{nodeId:n,nodeName:a}):void 0,M=u!==`action_result`&&t.resourceType===`model`?G($a,{id:t.id,inverted:u===`selecting`&&O}):void 0;return G(nt,{id:n,data:{label:a,changeStatus:re,resourceType:r,materialized:t.materialized},newCllExperience:x,isImpacted:T,interactive:c,selectMode:ie,isNodeSelected:O,isFocused:ee,isHighlighted:D,showContent:o,actionTag:j,showChangeAnalysis:te,changeCategory:E,runsAggregatedTag:M,hasParents:Object.keys(t.parents).length>0,hasChildren:Object.keys(t.children).length>0,columnCount:A.size,columnHeight:24,isDark:s,onSelect:e=>{l(e)},onContextMenu:(t,n)=>{_(t,e)},onShowImpactRadius:i===`modified`&&w(`change_analysis`)?e=>{C(!0),S({node_id:e,change_analysis:!0,no_upstream:!0})}:void 0})}const no=Fn(to);no.displayName=`GraphNode`;const ro={lineageGraphNode:no,lineageGraphColumnNode:Sa},io={lineageGraphEdge:Ta},ao=[],oo=e=>e.data.changeStatus?Ke(e.data.changeStatus).hexColor:I.neutral[400],so={ROW_COUNT:`row_count`,ROW_COUNT_DIFF:`row_count_diff`,PROFILE:`profile`,PROFILE_DIFF:`profile_diff`,VALUE_DIFF:`value_diff`,HISTOGRAM_DIFF:`histogram_diff`,TOP_K_DIFF:`top_k_diff`},co={LINEAGE_VIEW_CONTEXT_MENU:`lineage_view_context_menu`},lo={SELECT_PARENT_NODES:`select_parent_nodes`,SELECT_CHILD_NODES:`select_child_nodes`,SELECT_ALL_UPSTREAM:`select_all_upstream`,SELECT_ALL_DOWNSTREAM:`select_all_downstream`},uo=({menuItems:e,open:t,onClose:n,x:r,y:i,featureToggles:a,DisabledItemWrapper:o})=>{let s=o??(({children:e})=>G(W,{children:e})),c=a?.mode===`metadata only`;return G($r,{open:t,onClose:n,anchorReference:`anchorPosition`,anchorPosition:{top:i,left:r},slotProps:{paper:{sx:{fontSize:`0.85rem`,width:`250px`}}},children:e.length===0?G($,{disabled:!0,children:`No action available`},`no action`):e.map(({isSeparator:e,label:t,isDisabled:r,action:i,itemIcon:a})=>{if(e)return G(rr,{},t);let l=K($,{disabled:r,onClick:()=>{i&&i(),n()},children:[a,` `,t]},t);return r&&o?G(s,{display:c,children:l},t):l})})},fo=({isOpen:e,onClose:t,x:n,y:r,node:i,deps:a={},viewOptions:o={},featureToggles:s={},serverFlags:c={},noCatalogCurrent:l=!1,isActionAvailable:u=()=>!0})=>{let d=[],{runAction:f,onNavigate:p,onTrack:m,findByRunType:h,setSqlQuery:g,setPrimaryKeys:_,getPrimaryKey:v,DisabledItemWrapper:y}=a,{selectMode:b,cll:x,showColumnLevelLineage:S,setChangeAnalysisMode:C,selectParentNodes:w,selectChildNodes:T,getNodeColumnSet:E}=o,D=c.single_env_onboarding??!1,O=s.disableDatabaseQuery??!1;if(!i?.data)return G(W,{});let k=i.data,ee=k.resourceType,te=E?Array.from(E(i.id)):[],A={source:`lineage_model_node`},ne=k.changeStatus,re=v?.(k.name);if(ne===`modified`&&d.push({label:`Show Impact Radius`,itemIcon:G(lr,{}),isDisabled:l||!u(`change_analysis`),action:()=>{C?.(!0),S?.({node_id:i.id,change_analysis:!0,no_upstream:!0})}}),!b&&ee&&[`model`,`seed`,`snapshot`].includes(ee)){d.length>0&&d.push({label:`select group one`,isSeparator:!0});let e=h?.(D?`query`:`query_diff`),t=k.change?.columns?Object.keys(k.change.columns):[],n=Wt(t,t),r=`select * from {{ ref("${k.name}") }}`;if(n.length&&(r=`select \n ${n.join(`
2
+ import{$ as e,A as t,D as n,G as r,J as i,K as a,M as o,N as s,O as c,R as l,S as u,W as d,X as f,_t as p,a as m,c as h,d as g,et as _,gt as v,h as y,it as b,j as x,k as S,l as C,lt as w,m as T,mt as E,n as D,nt as O,o as k,p as ee,s as te,u as A,w as ne,x as re}from"./api-BqrSvFO2.js";import{c as ie,f as j}from"./keepAlive-DbC0X4zr.js";import{n as M,r as ae,t as oe}from"./fetchClient-BVyYwVMf.js";import{C as se,O as ce,T as N,_ as P,a as F,b as le,d as ue,f as de,g as fe,h as pe,j as me,k as he,l as ge,m as _e,o as ve,p as ye,s as be,u as xe,v as Se,w as Ce,y as we}from"./utils-COgjW7er.js";import{i as Te,n as I}from"./colors-BbPSDR1X.js";import{$t as Ee,A as De,B as L,Bt as Oe,C as ke,Cn as Ae,D as je,Dn as Me,En as Ne,Fn as Pe,Ft as Fe,Ht as Ie,I as Le,In as R,It as z,Jt as Re,Lt as ze,Mn as Be,Mt as Ve,Nn as He,O as Ue,Pt as We,Qt as Ge,Sn as Ke,T as qe,Tn as Je,Ut as Ye,Vt as B,Wt as Xe,Xt as Ze,Yt as Qe,Zt as $e,_n as et,a as tt,an as nt,bn as rt,cn as it,ct as at,d as ot,en as st,et as ct,f as lt,ft as ut,gn as dt,gt as ft,in as pt,j as mt,k as ht,ln as gt,lt as _t,n as vt,nn as yt,o as bt,on as xt,p as St,rn as Ct,s as wt,t as Tt,u as Et,ut as Dt,vn as Ot,vt as kt,w as At,wn as jt,x as Mt,xn as Nt,yn as Pt,yt as Ft,zt as It}from"./hooks-AAVgIiqs.js";import{Ft as Lt,Pt as Rt,a as zt,ct as Bt,dt as Vt,i as Ht,m as Ut,o as Wt,r as Gt,s as Kt,t as qt}from"./utils-Cpt1f5aU.js";import{fetchGitHubAvatar as Jt,fetchUser as Yt}from"./lib/api/user.js";import{PUBLIC_API_URL as Xt,PUBLIC_CLOUD_WEB_URL as Zt,RECCE_SUPPORT_CALENDAR_URL as Qt}from"./lib/const.js";import{EXPLORE_ACTION as $t,EXPLORE_FORM_EVENT as en,EXPLORE_SOURCE as tn,trackArtifactUploadStarted as nn,trackColumnLevelLineage as rn,trackCopyToClipboard as an,trackDwSetupCompleted as on,trackDwSetupShown as sn,trackDwSetupSkipped as cn,trackEnvironmentConfig as ln,trackExploreAction as un,trackExploreActionForm as dn,trackHistoryAction as fn,trackInit as pn,trackLineageSelection as mn,trackLineageViewRender as hn,trackMultiNodesAction as gn,trackNavigation as _n,trackOssShareButtonClicked as vn,trackPreviewChange as yn,trackPreviewChangeFeedback as bn,trackRedirectToCloudSession as xn,trackSignupCompleted as Sn,trackSignupRedirectInitiated as Cn,trackSingleEnvironment as wn,trackStateAction as Tn}from"./lib/api/track.js";import{t as En}from"./constants-D-hOGDbU.js";import{QueryClient as Dn,QueryClientProvider as On,useMutation as kn,useQuery as An,useQueryClient as jn}from"@tanstack/react-query";import{Suspense as Mn,createContext as Nn,forwardRef as Pn,memo as Fn,useCallback as V,useContext as In,useEffect as Ln,useImperativeHandle as Rn,useLayoutEffect as zn,useMemo as H,useRef as Bn,useState as U}from"react";import{Fragment as W,jsx as G,jsxs as K}from"react/jsx-runtime";import q from"@mui/material/Box";import J from"@mui/material/Button";import Vn from"@mui/material/Dialog";import Hn from"@mui/material/DialogActions";import Un from"@mui/material/DialogContent";import Wn from"@mui/material/DialogTitle";import Gn from"@mui/material/Link";import Y from"@mui/material/Stack";import X from"@mui/material/Typography";import Kn from"js-cookie";import{LuExternalLink as qn,LuSave as Jn}from"react-icons/lu";import{alpha as Yn,useTheme as Xn}from"@mui/material/styles";import{useTheme as Zn}from"next-themes";import Z from"@mui/material/IconButton";import Qn from"next/link";import{IoBookmarksOutline as $n,IoClose as er,IoSync as tr,IoWarning as nr}from"react-icons/io5";import rr from"@mui/material/Divider";import ir from"@mui/material/CircularProgress";import Q from"@mui/material/Tooltip";import{FaCloud as ar,FaExpandArrowsAlt as or,FaGithub as sr,FaQuestionCircle as cr,FaRegDotCircle as lr,FaSlack as ur,FaUser as dr}from"react-icons/fa";import{PiBookmarkSimple as fr,PiCaretDown as pr,PiChatText as mr,PiCheckCircle as hr,PiCircle as gr,PiCopy as _r,PiExport as vr,PiInfo as yr,PiInfoFill as br,PiMoon as xr,PiNotePencil as Sr,PiPencil as Cr,PiPencilSimple as wr,PiPlusCircle as Tr,PiRepeat as Er,PiSun as Dr,PiTrashFill as Or,PiTrashSimple as kr,PiUserPlus as Ar,PiX as jr}from"react-icons/pi";import Mr from"@mui/material/Chip";import{Background as Nr,BackgroundVariant as Pr,BaseEdge as Fr,ControlButton as Ir,Controls as Lr,MiniMap as Rr,Panel as zr,Position as Br,ReactFlow as Vr,ReactFlowProvider as Hr,getBezierPath as Ur,getNodesBounds as Wr,useEdgesState as Gr,useNodesState as Kr,useReactFlow as qr,useStore as Jr}from"@xyflow/react";import Yr from"file-saver";import Xr from"@mui/material/Checkbox";import Zr from"@mui/material/FormControlLabel";import Qr from"@mui/material/Alert";import $r from"@mui/material/Menu";import $ from"@mui/material/MenuItem";import{isEmpty as ei}from"lodash";import{VscCircleLarge as ti,VscFeedback as ni,VscGitPullRequest as ri,VscHistory as ii,VscKebabVertical as ai}from"react-icons/vsc";import oi from"@mui/material/ListSubheader";import si from"@mui/material/FormControl";import ci from"@mui/material/TextField";import{format as li,formatDistanceToNow as ui,parseISO as di}from"date-fns";import fi from"@mui/material/Tab";import pi from"@mui/material/Tabs";import mi from"@mui/material/List";import hi from"@mui/material/ListItem";import"@xyflow/react/dist/style.css";import{Box as gi,Typography as _i}from"@mui/material";import vi from"@mui/material/Avatar";import yi from"@mui/material/Popover";import{usePathname as bi,useRouter as xi,useSearchParams as Si}from"next/navigation";import{TbChecklist as Ci,TbEdit as wi}from"react-icons/tb";import Ti from"@mui/material/ListItemIcon";import Ei from"@mui/material/ListItemText";import{FiArrowRight as Di,FiCopy as Oi,FiInfo as ki,FiPackage as Ai}from"react-icons/fi";import ji from"@mui/material/Switch";import{RiArrowDownSFill as Mi,RiArrowUpSFill as Ni,RiMindMap as Pi,RiSwapLine as Fi,RiTerminalBoxLine as Ii}from"react-icons/ri";import{FaBookmark as Li,FaFileImport as Ri}from"react-icons/fa6";import{BiArrowFromBottom as zi,BiArrowToBottom as Bi}from"react-icons/bi";import Vi from"@dagrejs/dagre";import Hi from"@mui/material/Skeleton";import{AiOutlineExperiment as Ui}from"react-icons/ai";import Wi from"@mui/material/Radio";import Gi from"@mui/material/RadioGroup";import Ki from"@mui/material/Table";import qi from"@mui/material/TableBody";import Ji from"@mui/material/TableCell";import Yi from"@mui/material/TableContainer";import Xi from"@mui/material/TableHead";import Zi from"@mui/material/TableRow";import Qi from"@mui/material/InputLabel";import $i from"@mui/material/Select";import ea from"@mui/material/Badge";import ta from"@mui/material/Grid";import{stripIndents as na}from"common-tags";import{IoMdCodeWorking as ra}from"react-icons/io";import{DragDropContext as ia,Draggable as aa,Droppable as oa}from"@hello-pangea/dnd";import sa from"@mui/material/Card";import ca from"@mui/material/CardContent";import la from"@mui/material/CardHeader";const ua=Nn(null);ua.displayName=`RecceRoutingContext`;function da(){return In(ua)||{basePath:``,buildPath:e=>e,pathname:``,navigate:e=>{typeof window<`u`&&(window.location.href=e)}}}function fa(){let{pathname:e,navigate:t}=da();return[e,t]}function pa({children:e,config:t}){let n=t?.basePath??``,r=t?.pathname??``,i=t?.onNavigate,a=V(e=>n?`${n}${e.startsWith(`/`)?e:`/${e}`}`:e,[n]),o=V((e,t)=>{i?i(e,t):typeof window<`u`&&(t?.replace?(window.history.replaceState(null,``,e),window.dispatchEvent(new PopStateEvent(`popstate`))):window.location.href=e)},[i]),s=H(()=>({basePath:n,buildPath:a,pathname:r,navigate:o}),[n,a,r,o]);return G(ua.Provider,{value:s,children:e})}const ma=e=>new Dn({defaultOptions:{queries:{staleTime:e?.staleTime??1e3*60,gcTime:e?.gcTime??1e3*60*5,retry:1,refetchOnWindowFocus:!1}}});function ha({children:e,api:t,theme:n=`system`,routing:r,queryClient:i,runActions:a,lineage:o,checks:s,query:c,features:l={}}){let u=i?.staleTime,d=i?.gcTime,f=H(()=>ma({staleTime:u,gcTime:d}),[u,d]),{enableInstance:p=!0,enableIdleTimeout:m=!0,enableLineage:h=!0,enableRunActions:g=!0,enableChecks:_=!0,enableQuery:v=!0}=l,y=e;return y=G(pa,{config:r,children:y}),y=G(Lt,{defaultMode:n,children:y}),y=G(ie,{config:t,children:y}),y=G(On,{client:f,children:y}),v&&(y=G(He,{sql:c?.sql,isExecuting:c?.isExecuting,error:c?.error,baseResult:c?.baseResult,currentResult:c?.currentResult,onSqlChange:c?.onSqlChange,onExecute:c?.onExecute,onCancel:c?.onCancel,children:y})),_&&(y=G(Pe,{checks:s?.checks,isLoading:s?.isLoading,error:s?.error,selectedCheckId:s?.selectedCheckId,onSelectCheck:s?.onSelectCheck,onCreateCheck:s?.onCreateCheck,onUpdateCheck:s?.onUpdateCheck,onDeleteCheck:s?.onDeleteCheck,onReorderChecks:s?.onReorderChecks,refetchChecks:s?.refetchChecks,children:y})),g&&(y=G(ce,{onRunAction:a?.onRunAction,onShowRunId:a?.onShowRunId,initialRunId:a?.initialRunId,initialHistoryOpen:a?.initialHistoryOpen,children:y})),h&&(y=G(fe,{lineageGraph:o?.lineageGraph,envInfo:o?.envInfo,reviewMode:o?.reviewMode,cloudMode:o?.cloudMode,fileMode:o?.fileMode,fileName:o?.fileName,isDemoSite:o?.isDemoSite,isCodespace:o?.isCodespace,isLoading:o?.isLoading,error:o?.error,supportTasks:o?.supportTasks,onRefetchLineageGraph:o?.onRefetchLineageGraph,runsAggregated:o?.runsAggregated,onRefetchRunsAggregated:o?.onRefetchRunsAggregated,children:y})),m&&(y=G(we,{children:y})),p&&(y=G(se,{children:y})),y}function ga({actionState:e,onCancel:t,onClose:n}){let r=()=>e.mode===`per_node`?`${e.completed} / ${e.total}`:e.currentRun?.progress?.percentage?`${e.currentRun.progress.percentage*100}%`:e.status===`completed`?`100%`:`0%`,i=e.status===`running`||e.status===`canceling`;return G(q,{sx:{bgcolor:`background.paper`,borderRadius:1,boxShadow:6},children:K(Y,{direction:`row`,divider:G(rr,{orientation:`vertical`,flexItem:!0}),spacing:2,sx:{p:`5px 15px`,mt:2},children:[K(q,{sx:{fontSize:`10pt`},children:[`Progress: `,r(),` `,e.status===`canceled`?` (canceled)`:``]}),i?G(J,{size:`small`,variant:`outlined`,onClick:t,disabled:e.status===`canceling`,children:e.status===`canceling`?`Canceling`:`Cancel`}):G(Y,{direction:`row`,children:G(J,{size:`small`,variant:`outlined`,onClick:n,children:`Close`})})]})})}const _a=({lineageGraph:e,cllInput:t,onCenterNode:n})=>{let r={cursor:`pointer`,fontFamily:`monospace`,bgcolor:Rt()?`grey.700`:`grey.100`,px:.5,borderRadius:.5};if(!e)return G(W,{});if(!t)return G(W,{children:`Default View`});if(t.node_id===void 0)return G(X,{component:`span`,children:`Impact Radius for All Changed Models`});let i=t.node_id in e.nodes?e.nodes[t.node_id].data.name:t.node_id;if(!t.column){let e=t.node_id;return K(W,{children:[G(X,{component:`span`,sx:{mr:`5px`},children:`Impact Radius for`}),G(q,{component:`code`,onClick:()=>{n(e)},sx:r,children:i})]})}let a=`${t.node_id}_${t.column}`;return K(W,{children:[K(X,{component:`span`,sx:{mr:`5px`},children:[`Column Lineage for`,` `]}),K(q,{component:`code`,onClick:()=>{n(a)},sx:r,children:[i,`.`,t.column]})]})},va=({action:e,interactive:t,viewOptions:n,lineageGraph:r,singleEnvMode:i=!1,changeAnalysisAvailable:a=!0,onShowCll:o,onResetCll:s,onCenterNode:c,setChangeAnalysisMode:l,newCllExperience:u=!1,changeAnalysisMode:d=!1})=>{let f=n.column_level_lineage,p=!r?.catalogMetadata.current,m=u&&d,h=f&&!(u&&!f.column);return K(Y,{direction:`row`,spacing:`5px`,children:[!i&&!m&&G(q,{sx:{borderRadius:1,boxShadow:3},children:G(Q,{enterDelay:50,title:a?p?`Please provide catalog.json to enable Impact Radius`:``:`Requires warehouse connection`,placement:`top`,children:G(`span`,{children:G(J,{size:`small`,variant:`outlined`,color:`neutral`,sx:{whiteSpace:`nowrap`,display:`inline-flex`,bgcolor:`background.paper`},disabled:!t||p||!a||e.isPending,startIcon:G(lr,{}),onClick:()=>{l?.(!0),o({no_upstream:!0,change_analysis:!0})},children:`Impact Radius`})})})}),h&&K(Y,{direction:`row`,sx:{alignItems:`center`,borderRadius:1,boxShadow:3,border:`1px solid`,borderColor:`divider`,bgcolor:`background.paper`,fontSize:`0.8rem`,p:`0 0.625rem`},children:[G(_a,{lineageGraph:r,cllInput:f,onCenterNode:c}),e.isError&&G(Q,{title:`Error: ${e.error.message}`,placement:`bottom`,children:G(X,{component:`span`,sx:{color:`error.main`,ml:`2px`,display:`inline-flex`,alignItems:`center`},children:G(q,{component:yr,sx:{color:`error.main`,fontSize:`14px`}})})}),e.isPending?G(ir,{size:12,sx:{ml:`2px`}}):G(Z,{size:`small`,sx:{ml:`2px`},"aria-label":`Reset Column Level Lineage`,onClick:()=>{s()},children:G(jr,{size:`10px`})})]})]})};function ya({onClose:e}){let{cancel:t,actionState:n}=pe();return G(ga,{actionState:n,onCancel:t,onClose:e})}const ba=({action:e})=>{let{showColumnLevelLineage:t,resetColumnLevelLineage:n,interactive:r,viewOptions:i,centerNode:a,setChangeAnalysisMode:o,newCllExperience:s,changeAnalysisMode:c}=pe(),{data:l}=xe(),u=l?.single_env_onboarding??!1,{lineageGraph:d,isActionAvailable:f}=P();return G(va,{action:e,interactive:r,viewOptions:i,lineageGraph:d,singleEnvMode:u,changeAnalysisAvailable:f(`change_analysis`),onShowCll:t,onResetCll:()=>n(),onCenterNode:a,setChangeAnalysisMode:o,newCllExperience:s,changeAnalysisMode:c})};function xa(e){let{id:t,data:n}=e,{id:r}=n.node,{column:i,type:a,transformationType:o,changeStatus:s,isImpacted:c}=n,l=Jr(e=>e.transform[2]>.3),{isDark:u}=Tt(),{viewOptions:d,showContextMenu:f,isNodeHighlighted:p,isNodeShowingChangeAnalysis:m,newCllExperience:h}=pe(),g=d.column_level_lineage?.node_id,_=i===d.column_level_lineage?.column&&r===g,v=p(t),y=m(r);return G(dt,{id:t,data:{column:i,type:a,nodeId:r,transformationType:o,changeStatus:s,isHighlighted:v,isFocused:_,isImpacted:c},showContent:l,showChangeAnalysis:y,isDark:u,newCllExperience:h,onContextMenu:(t,n)=>{f(t,e)}})}const Sa=Fn(xa);Sa.displayName=`GraphColumnNode`;function Ca(e){let{source:t,target:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,style:l={},markerEnd:u,data:d,isEdgeHighlighted:f}=e,p={...l};d?.changeStatus&&(p.stroke=Ke(d.changeStatus).hexColor,p.strokeDasharray=`5`),!f||f(t,n)||(p.filter=jt);let[m]=Ur({sourceX:r,sourceY:i,sourcePosition:s,targetX:a,targetY:o,targetPosition:c});return G(W,{children:G(Fr,{path:m,markerEnd:u,style:{...p,...l}})})}const wa=Fn(Ca);wa.displayName=`GraphEdge`;function Ta(e){let{isEdgeHighlighted:t}=pe();return G(wa,{...e,isEdgeHighlighted:t})}const Ea=()=>G(`svg`,{stroke:`currentColor`,fill:`currentColor`,strokeWidth:`0`,viewBox:`0 0 256 256`,height:`1em`,width:`1em`,xmlns:`http://www.w3.org/2000/svg`,children:G(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z`})}),Da=()=>G(`svg`,{stroke:`currentColor`,fill:`currentColor`,strokeWidth:`0`,viewBox:`0 0 256 256`,height:`1em`,width:`1em`,xmlns:`http://www.w3.org/2000/svg`,children:G(`path`,{d:`M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z`})});function Oa({skipReason:e}){return G(Mr,{size:`small`,label:K(Y,{direction:`row`,sx:{fontSize:`10pt`,color:`grey.500`,alignItems:`center`,gap:`3px`},children:[G(q,{children:`Skipped`}),e&&G(Q,{title:e,children:G(q,{component:`span`,sx:{display:`flex`},children:G(Ea,{})})})]}),sx:{bgcolor:`grey.100`}})}function ka({errorMessage:e}){return K(Y,{direction:`row`,sx:{fontSize:`10pt`,color:`gray`,alignItems:`center`},children:[G(q,{children:`Error`}),e&&G(Q,{title:e,children:G(q,{component:`span`,sx:{display:`flex`},children:G(Da,{})})})]})}function Aa({result:e}){let{mismatchedColumns:t}=e,n=t>0;return G(Mr,{size:`small`,sx:{bgcolor:n?`error.light`:`success.light`},label:G(Y,{direction:`row`,sx:{fontSize:`10pt`,color:n?`error.main`:`success.main`,alignItems:`center`,gap:`3px`},children:n?`${t} columns mismatched`:`All columns match`})})}function ja({result:e}){let{base:t,current:n}=e,r=t===null?`N/A`:t.toLocaleString(),i=n===null?`N/A`:n.toLocaleString(),a=``,o=`grey.500`;return t!==null&&n!==null&&(n>t?(a=`↑`,o=`success.main`):n<t?(a=`↓`,o=`error.main`):a=`=`),G(Mr,{size:`small`,sx:{bgcolor:`grey.100`},label:K(Y,{direction:`row`,sx:{fontSize:`10pt`,alignItems:`center`,gap:`3px`},children:[G(q,{children:r}),G(q,{children:`→`}),G(q,{children:i}),a&&G(q,{component:`span`,sx:{color:o,ml:.5},children:a})]})})}function Ma({status:e,skipReason:t,errorMessage:n,progress:r,valueDiffResult:i,rowCountDiffResult:a,runId:o,"data-testid":s}){return e===`pending`?G(ir,{size:16,"data-testid":s,"data-status":`pending`}):e===`skipped`?G(q,{"data-testid":s,"data-status":`skipped`,children:G(Oa,{skipReason:t})}):e===`running`?r?.percentage===void 0?G(ir,{size:16,"data-testid":s,"data-status":`running`}):G(ir,{variant:`determinate`,value:r.percentage*100,size:16,"data-testid":s,"data-status":`running`}):e===`error`?G(q,{"data-testid":s,"data-status":`error`,children:G(ka,{errorMessage:n})}):i?G(q,{"data-testid":s,"data-status":`success`,children:G(Aa,{result:i})}):a?G(q,{"data-testid":s,"data-status":`success`,children:G(ja,{result:a})}):G(q,{"data-testid":s,"data-status":`success`,children:o||`Complete`})}const Na=Fn(Ma);Na.displayName=`ActionTag`;const Pa={success:`#059669`,failure:`#ef4444`,error:`#ef4444`,warning:`#f59e0b`},Fa={success:`PASSED`,failure:`FAILED`,error:`ERROR`,warning:`WARNING`};function Ia(e){return Pa[e]??`#6b7280`}function La(e){return Fa[e]??e.toUpperCase()}function Ra({run:e,index:t,onClick:n}){let r=Ia(e.status),i=La(e.status),a=ui(new Date(e.run_at),{addSuffix:!0}),o=!!n;return K(gi,{component:o?`button`:`div`,type:o?`button`:void 0,onClick:o?()=>n?.(e.run_id):void 0,"aria-label":o?`View run #${t} — ${i}`:void 0,sx:{p:1,border:`none`,borderLeft:`3px solid ${r}`,borderRadius:1,bgcolor:`action.hover`,cursor:o?`pointer`:`default`,"&:hover":o?{bgcolor:`action.selected`}:{},textAlign:`left`,width:`100%`,font:`inherit`,color:`inherit`},children:[K(_i,{variant:`body2`,sx:{fontWeight:600,fontSize:`0.75rem`},children:[`Run #`,t,` — `,i,e.triggered_by===`recce_ai`&&G(_i,{component:`span`,sx:{ml:.75,fontSize:`0.65rem`,fontWeight:500,color:`#7c3aed`},children:`by AI`})]}),e.summary&&G(_i,{variant:`body2`,sx:{color:`text.secondary`,fontSize:`0.7rem`,mt:.25},children:e.summary}),G(_i,{variant:`body2`,sx:{color:`text.secondary`,fontSize:`0.65rem`,mt:.25},children:a})]})}function za({event:e}){let t=l(e),n={create:Tr,comment:mr,approve:hr,unapprove:gr,edit:Sr,preset:fr},r={create:`primary.main`,comment:`grey.500`,approve:`success.main`,unapprove:`grey.400`,edit:`warning.main`,preset:`secondary.main`},i=n[t],a=r[t];return G(q,{component:i,sx:{color:a,fontSize:16}})}function Ba({event:e}){let{actor:t}=e,{avatarUrl:n}=Oe({userId:t.user_id}),r=(t.fullname||t.login||`User`).charAt(0).toUpperCase();return G(vi,{src:n||void 0,sx:{width:24,height:24,fontSize:`0.75rem`},children:r})}function Va({event:e}){let{actor:t}=e,n=t.fullname||t.login||`Someone`,r=ui(new Date(e.created_at),{addSuffix:!0}),i=``;switch(e.event_type){case`check_created`:i=`created this check`;break;case`approval_change`:i=e.new_value===`true`?`approved this check`:`unapproved this check`;break;case`description_change`:i=`updated the description`;break;case`name_change`:i=`renamed this check`;break;case`preset_applied`:i=`applied a preset`;break;default:i=`made a change`}return K(q,{sx:{display:`flex`,gap:1,alignItems:`flex-start`,py:1},children:[G(q,{sx:{pt:`2px`},children:G(za,{event:e})}),G(q,{sx:{flex:1},children:K(Y,{direction:`row`,spacing:.5,sx:{flexWrap:`wrap`,alignItems:`center`},children:[G(Ba,{event:e}),G(X,{variant:`body2`,sx:{fontWeight:`500`},children:n}),G(X,{variant:`body2`,sx:{color:`text.secondary`},children:i}),G(X,{variant:`caption`,sx:{color:`text.disabled`},children:r})]})})]})}function Ha({event:e,currentUserId:t,onEdit:n,onDelete:r}){let i=Rt(),[a,o]=U(!1),[s,c]=U(e.content||``),[l,u]=U(!1),[d,f]=U(!1),[p,m]=U(null),h=!!p,{actor:g}=e,_=g.fullname||g.login||`Someone`,v=ui(new Date(e.created_at),{addSuffix:!0}),y=t&&String(g.user_id)===String(t),b=()=>{c(e.content||``),o(!0)},x=()=>{c(e.content||``),o(!1)},S=async()=>{let t=s.trim();if(!t||t===e.content){x();return}if(n){u(!0);try{await n(e.id,t),o(!1)}finally{u(!1)}}},C=e=>{e.key===`Escape`?x():e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),S())},w=e=>{m(e.currentTarget)},T=()=>{m(null)};return e.is_deleted?K(q,{sx:{display:`flex`,gap:1,alignItems:`center`,py:1},children:[G(q,{sx:{pt:`2px`,display:`flex`,alignItems:`center`},children:G(za,{event:e})}),G(q,{sx:{display:`flex`,flex:1,alignItems:`center`},children:G(X,{variant:`body2`,sx:{color:`text.disabled`,fontStyle:`italic`},children:`Comment deleted`})})]}):K(q,{sx:{display:`flex`,gap:1,alignItems:`flex-start`,py:1},children:[G(q,{sx:{pt:`2px`},children:G(za,{event:e})}),K(q,{sx:{flex:1},children:[K(Y,{direction:`row`,spacing:.5,sx:{flexWrap:`wrap`,alignItems:`center`,mb:.5},children:[G(Ba,{event:e}),K(X,{variant:`body2`,sx:{fontWeight:`500`},children:[_,y&&K(X,{component:`span`,variant:`body2`,sx:{color:`text.secondary`},children:[` `,`(Author)`]})]}),G(X,{variant:`caption`,sx:{color:`text.disabled`},children:v}),e.is_edited&&G(X,{variant:`caption`,sx:{color:`text.disabled`},children:`(edited)`})]}),a?K(q,{children:[G(ci,{value:s,onChange:e=>c(e.target.value),onKeyDown:C,size:`small`,multiline:!0,minRows:3,fullWidth:!0,disabled:l,autoFocus:!0,sx:{"& .MuiOutlinedInput-root":{bgcolor:`background.paper`,"&:focus-within":{borderColor:`primary.main`}}}}),K(Y,{direction:`row`,spacing:1,sx:{justifyContent:`flex-end`,mt:1},children:[G(J,{size:`small`,variant:`text`,onClick:x,disabled:l,children:`Cancel`}),G(J,{size:`small`,variant:`contained`,onClick:S,disabled:!s.trim()||l,children:l?`Saving...`:`Save`})]})]}):K(q,{sx:{bgcolor:i?`grey.800`:`grey.50`,borderRadius:1,p:1,border:`1px solid`,borderColor:i?`grey.700`:`grey.200`,position:`relative`,"&:hover .comment-actions":{opacity:1}},children:[G(ut,{content:e.content||``,fontSize:`sm`}),y&&(n||r)&&K(Y,{className:`comment-actions`,direction:`row`,spacing:0,sx:{position:`absolute`,top:4,right:4,opacity:0,transition:`opacity 0.2s`},children:[n&&G(Q,{title:`Edit comment`,children:G(Z,{"aria-label":`Edit comment`,size:`small`,onClick:b,children:G(wr,{})})}),r&&K(W,{children:[G(Q,{title:`Delete comment`,children:G(Z,{"aria-label":`Delete comment`,size:`small`,color:`error`,onClick:w,children:G(kr,{})})}),G(yi,{open:h,anchorEl:p,onClose:T,anchorOrigin:{vertical:`bottom`,horizontal:`center`},transformOrigin:{vertical:`top`,horizontal:`center`},children:K(q,{sx:{p:2},children:[G(X,{variant:`body2`,sx:{mb:2},children:`Delete this comment?`}),K(Y,{direction:`row`,spacing:1,sx:{justifyContent:`flex-end`},children:[G(J,{size:`small`,variant:`text`,onClick:T,disabled:d,children:`Cancel`}),G(J,{size:`small`,variant:`contained`,color:`error`,onClick:async()=>{if(r){f(!0);try{await r(e.id),T()}finally{f(!1)}}},disabled:d,children:d?`Deleting...`:`Delete`})]})]})})]})]})]})]})]})}function Ua({event:e,currentUserId:t,onEdit:n,onDelete:r}){return e.event_type===`comment`?G(Ha,{event:e,currentUserId:t,onEdit:n,onDelete:r}):G(Va,{event:e})}function Wa(e,t){let n=e?.toLowerCase();return n===`finished`?t?`error`:`success`:n===`failed`?`error`:e??`unknown`}function Ga(e,t){let n=[];for(let t of e)n.push({kind:`event`,event:t,at:t.created_at});if(t){let e=[...t].sort((e,t)=>new Date(e.run_at).getTime()-new Date(t.run_at).getTime());for(let t=0;t<e.length;t++)n.push({kind:`run`,run:e[t],index:t+1,at:e[t].run_at})}return n.sort((e,t)=>new Date(t.at).getTime()-new Date(e.at).getTime()),n}function Ka({checkId:e}){let t=Rt(),{apiClient:n,authToken:r}=B(),{events:i,isLoading:a,error:o,createComment:s,isCreatingComment:c,updateComment:l,deleteComment:u}=Et(e),{data:d}=An({queryKey:j.user(),queryFn:()=>Yt(n),retry:!1}),{data:p}=An({queryKey:[`check-runs`,e],queryFn:async()=>(await f(n)).filter(t=>t.check_id===e).map(e=>({run_id:e.run_id,run_at:e.run_at,status:Wa(e.status,e.error),summary:e.error||void 0,triggered_by:e.triggered_by})),enabled:!!r,staleTime:3e4}),m=H(()=>Ga(i,p),[i,p]),h=e=>{s(e)},g=async(e,t)=>{await l({eventId:e,content:t})},_=async e=>{await u(e)};return a?G(q,{sx:{height:`100%`,p:4,display:`flex`,justifyContent:`center`,alignItems:`center`},children:G(ir,{size:20})}):o?G(q,{sx:{height:`100%`,p:4,display:`flex`,justifyContent:`center`,alignItems:`center`},children:G(X,{sx:{fontSize:`0.875rem`,color:`error.main`},children:`Failed to load timeline`})}):K(Y,{sx:{height:`100%`,alignItems:`stretch`,borderLeft:`1px solid`,borderColor:t?`grey.700`:`grey.200`},spacing:0,children:[G(q,{sx:{px:3,py:2,borderBottom:`1px solid`,borderColor:t?`grey.700`:`grey.200`},children:G(X,{variant:`subtitle2`,sx:{fontWeight:500},children:`Activity`})}),G(q,{sx:{flex:1,overflowY:`auto`,px:3,py:2},children:m.length===0?G(X,{sx:{fontSize:`0.875rem`,color:`grey.500`},children:`No activity yet`}):G(Y,{sx:{alignItems:`stretch`},spacing:0,children:m.map((e,n)=>K(q,{children:[e.kind===`event`?G(Ua,{event:e.event,currentUserId:d?.id,onEdit:g,onDelete:_}):G(Ra,{run:e.run,index:e.index}),n<m.length-1&&G(rr,{sx:{borderColor:t?`grey.700`:`grey.100`}})]},e.kind===`event`?e.event.id:e.run.run_id))})}),G(q,{sx:{px:3,py:3,borderTop:`1px solid`,borderColor:t?`grey.700`:`grey.200`,bgcolor:t?`grey.900`:`grey.50`},children:G(It,{onSubmit:h,isSubmitting:c})})]})}function qa({color:e}){return G(q,{component:`span`,sx:{display:`inline-block`,width:`10px`,height:`10px`,bgcolor:e,mr:1,borderRadius:`4px`}})}const Ja=({defaultPrimaryKeys:e,onPrimaryKeysChange:t,...n})=>{let{isActionAvailable:r}=P(),i=H(()=>[],[]);return G(q,{sx:{display:`flex`},...n,children:K(Y,{spacing:0,sx:{m:`0 0.5rem`},children:[K(Y,{direction:`row`,spacing:.5,sx:{alignItems:`center`},children:[G(X,{component:`label`,sx:{fontSize:`0.625rem`,color:`text.secondary`},children:`Diff with Primary Key(s) (suggested)`}),G(Q,{title:`Provide a primary key to perform query diff in data warehouse and only return changed rows.`,placement:`bottom-end`,children:G(q,{component:`span`,sx:{display:`flex`,color:`grey.600`,cursor:`help`},children:G(yr,{fontSize:`0.75rem`})})})]}),G(gt,{className:`no-track-pii-safe`,unitName:`key`,defaultValues:e,suggestionList:i,onValuesChange:t,size:`2xs`,width:`240px`,placeholder:`Select or type to add keys`,disabled:!r(`query_diff_with_primary_key`)})]})})};function Ya({supportCalendarUrl:e=`https://cal.com/team/recce/chat`}){let{data:t}=N();return G(`div`,{className:`flex flex-1 h-full min-h-0 m-2 p-4 bg-blue-50 rounded-lg shadow-md justify-center`,children:K(`div`,{className:`w-4/5 flex flex-col overflow-y-auto gap-6 px-8 pb-8`,children:[K(Y,{spacing:2,sx:{alignItems:`center`},children:[G(q,{sx:{p:1,bgcolor:`background.paper`,borderRadius:`50%`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:2},children:G(q,{component:Ii,sx:{fontSize:28,color:`iochmara.500`}})}),G(X,{variant:`h5`,sx:{mt:2},children:`Wait, there's more!`}),K(X,{sx:{fontSize:`1rem`,textAlign:`center`},children:[`Query functions disabled without a`,` `,G(X,{component:`span`,sx:{fontWeight:`bold`},children:`data warehouse connection`})]})]}),G(Y,{sx:{width:`50%`,mt:3,mx:`auto`},children:G(J,{color:`iochmara`,variant:`contained`,size:`large`,onClick:()=>{window.open(qt(t,e),`_blank`)},children:`Connect to Data Warehouse`})})]})})}const Xa=()=>{let{isCustomQueries:e,setCustomQueries:t,sqlQuery:n,setBaseSqlQuery:r}=Mt();return K(q,{children:[K(Y,{direction:`row`,spacing:.5,sx:{alignItems:`center`,fontSize:`0.75rem`},children:[G(X,{variant:`body2`,sx:{fontSize:`0.75rem`},children:`Custom Queries`}),G(Q,{title:`Custom queries allow you to use two SQL queries to compare results between current and base environments.`,children:G(q,{component:`span`,sx:{display:`flex`,color:`grey.600`},children:G(br,{fontSize:`1rem`})})})]}),G(ji,{size:`small`,checked:e,onChange:()=>{!e&&r&&r(n),t(!e)},color:`primary`})]})},Za=()=>{let{sqlQuery:e,baseSqlQuery:t,setSqlQuery:n,setBaseSqlQuery:i,primaryKeys:o,setPrimaryKeys:s,isCustomQueries:c}=Mt(),{lineageGraph:l,envInfo:u}=P(),{featureToggles:f,singleEnv:p}=Ce(),m=e;u?.adapterType===`sqlmesh`&&e===`select * from {{ ref("mymodel") }}`&&(m=`select * from db.mymodel`),f.mode===`read only`&&(m=`--- Would like to do query here? Book a demo with us at ${Qt}\n${m}`);let{showRunId:h}=he(),{apiClient:g}=B(),{mutate:v,isPending:y}=kn({mutationFn:async e=>{function n(e){switch(e){case`query`:return d;case`query_base`:return r;case`query_diff`:return a;default:throw Error(`Unknown query type: ${e}`)}}let i=e===`query_base`?t??``:m,s=n(e),l={sql_template:i},u={nowait:!0};e===`query_diff`&&(l.primary_keys=o,c&&(l.base_sql_template=t));let{run_id:f}=await s(l,u,g);return h(f),await _(f,void 0,g)}}),b=H(()=>{let e={};if(!l)return`N/A`;for(let t in l.nodes){let n=l.nodes[t].data.schema;n&&(e[n]=(e[n]||0)+1)}return Object.keys(e).reduce((t,n)=>e[n]>(e[t]||0)?n:t,`N/A`)},[l]);return p||f.mode===`metadata only`?K(q,{sx:{display:`flex`,flexDirection:`column`,height:`100%`},children:[K(q,{sx:{display:`flex`,justifyContent:`right`,alignItems:`center`,padding:`4pt 8pt`,gap:`5px`,height:`54px`,borderBottom:`1px solid`,borderColor:`divider`},children:[G(_s,{}),G(q,{sx:{flexGrow:1}}),p?G(Q,{title:`Please configure the base environment before running the diff`,placement:`left`,children:G(`span`,{children:G(J,{variant:`contained`,disabled:!0,size:`small`,sx:{fontSize:`14px`,mt:`16px`},children:`Run Diff`})})}):G(xc,{display:f.mode===`metadata only`,children:G(J,{variant:`contained`,disabled:!0,size:`small`,sx:{fontSize:`14px`,mt:`16px`},children:`Run Diff`})})]}),G(Ue,{value:m,onChange:n,onRun:()=>{v(`query`)},labels:[`base (production)`,`current (${b})`],SetupGuide:f.mode===`metadata only`?G(Ya,{}):G(fs,{})})]}):K(q,{sx:{display:`flex`,flexDirection:`column`,height:`100%`},children:[K(q,{sx:{display:`flex`,justifyContent:`right`,alignItems:`flex-end`,padding:`4pt 8pt`,gap:`5px`,height:`54px`,borderBottom:`1px solid`,borderColor:`divider`,flex:`0 0 54px`},children:[G(_s,{}),G(Xa,{}),G(q,{sx:{flexGrow:1}}),G(Ja,{defaultPrimaryKeys:o,onPrimaryKeysChange:s}),G(J,{variant:`contained`,onClick:()=>{v(`query_diff`)},disabled:y||f.disableDatabaseQuery,size:`small`,children:`Run Diff`})]}),G(q,{sx:{width:`100%`,flex:1,overflowY:`auto`},children:c?G(Ue,{value:m,baseValue:t,onChange:n,onChangeBase:i,onRun:()=>{v(`query`)},onRunBase:()=>{v(`query_base`)},onRunDiff:()=>{v(`query_diff`)}}):G(ht,{value:m,onChange:n,onRun:()=>{v(`query`)},onRunDiff:()=>{v(`query_diff`)}})})]})};function Qa({rowCount:e}){let t=e.base,n=e.curr,r=e.base===null?`N/A`:`${e.base} Rows`,i=e.curr===null?`N/A`:`${e.curr} Rows`,a,o;t===null&&n===null?(a=`Failed to load`,o=`default`):t===null||n===null?(a=`${r} -> ${i}`,o=t===null?`success`:`error`):t===n?(a=`=`,o=`default`):(a=`${Ut(t,n)} Rows`,o=t<n?`success`:`error`);let s=L(`row_count_diff`).icon;return G(Mr,{size:`small`,color:o,icon:s?G(s,{}):void 0,label:a,sx:{height:20,fontSize:`0.7rem`}})}function $a({id:e,inverted:t}){let{lineageGraph:n,runsAggregated:r}=P(),{text:i,isDark:a}=Tt(),o=r?.[e],s=n?.nodes[e];if(!o&&!s)return null;let c;s?.data.change?.columns&&(c=Object.keys(s.data.change.columns).length>0);let l;if(o?.row_count_diff){let e=o.row_count_diff.result;l=e.curr!==e.base}let u=t?i.inverted:Ke(`modified`).color,d=t?i.secondary:a?`grey.700`:`grey.100`,f=L(`schema_diff`).icon;return K(q,{sx:{display:`flex`,flex:1,alignItems:`center`},children:[c!==void 0&&G(Q,{title:`Schema (${c?`changed`:`no change`})`,enterDelay:500,children:G(q,{sx:{height:16},children:f&&G(q,{component:f,sx:{color:c?u:d}})})}),G(q,{sx:{flexGrow:1}}),o?.row_count_diff&&l!==void 0&&G(Q,{title:`Row count (${l?`changed`:`=`})`,enterDelay:500,children:G(q,{children:G(Qa,{rowCount:o.row_count_diff.result})})})]})}function eo({nodeId:e,nodeName:t}){let{getNodeAction:n}=pe(),r=n(e);if(!r)return null;let{status:i,skipReason:a,run:o}=r;if(i===`pending`)return G(Na,{status:`pending`});if(i===`skipped`)return G(Na,{status:`skipped`,skipReason:a});if(!o)return G(Na,{status:`pending`});let{error:s,run_id:c,progress:l}=o;if(i===`running`)return G(Na,{status:`running`,progress:{percentage:l?.percentage}});if(s)return G(Na,{status:`error`,errorMessage:s});if(o.type===`value_diff`&&o.result){let e=o.result,t=0,n=e.data.data.length;for(let n of e.data.data)n[2]<1&&t++;return G(Na,{status:`success`,valueDiffResult:{mismatchedColumns:t,totalColumns:n}})}if(w(o)&&o.result){let e=o.result[t];if(e)return G(Qa,{rowCount:e})}if(o.type===`row_count`&&o.result){let e=o.result[t];if(e?.curr!==void 0&&e.curr!==null)return G(Mr,{size:`small`,label:`${e.curr.toLocaleString()} Rows`,sx:{height:20,fontSize:`0.7rem`}})}return G(Na,{status:`success`,runId:c})}function to(e){let{data:t}=e,{id:n,resourceType:r,changeStatus:i,name:a}=t,o=Jr(e=>e.transform[2]>.3),{isDark:s}=Tt(),{interactive:c,selectNode:l,selectMode:u,focusedNode:d,getNodeAction:f,getNodeColumnSet:p,isNodeHighlighted:m,isNodeSelected:h,isNodeShowingChangeAnalysis:g,showContextMenu:_,viewOptions:v,cll:y,impactedNodeIds:b,newCllExperience:x,showColumnLevelLineage:S,setChangeAnalysisMode:C}=pe(),{isActionAvailable:w}=P(),T=x?b.has(n):!1,E=y?.current.nodes[n]?.change_category,D=m(n),O=h(n),k=v.column_level_lineage?.node_id===n&&v.column_level_lineage.column===void 0,ee=d?.id===n||k,te=g(n),A=p(t.id),ne=u===`action_result`?f(t.id):void 0,re=i,ie=u,j=u===`action_result`&&ne?G(eo,{nodeId:n,nodeName:a}):void 0,M=u!==`action_result`&&t.resourceType===`model`?G($a,{id:t.id,inverted:u===`selecting`&&O}):void 0;return G(nt,{id:n,data:{label:a,changeStatus:re,resourceType:r,materialized:t.materialized},newCllExperience:x,isImpacted:T,interactive:c,selectMode:ie,isNodeSelected:O,isFocused:ee,isHighlighted:D,showContent:o,actionTag:j,showChangeAnalysis:te,changeCategory:E,runsAggregatedTag:M,hasParents:Object.keys(t.parents).length>0,hasChildren:Object.keys(t.children).length>0,columnCount:A.size,columnHeight:24,isDark:s,onSelect:e=>{l(e)},onContextMenu:(t,n)=>{_(t,e)},onShowImpactRadius:i===`modified`&&w(`change_analysis`)?e=>{C(!0),S({node_id:e,change_analysis:!0,no_upstream:!0})}:void 0})}const no=Fn(to);no.displayName=`GraphNode`;const ro={lineageGraphNode:no,lineageGraphColumnNode:Sa},io={lineageGraphEdge:Ta},ao=[],oo=e=>e.data.changeStatus?Ke(e.data.changeStatus).hexColor:I.neutral[400],so={ROW_COUNT:`row_count`,ROW_COUNT_DIFF:`row_count_diff`,PROFILE:`profile`,PROFILE_DIFF:`profile_diff`,VALUE_DIFF:`value_diff`,HISTOGRAM_DIFF:`histogram_diff`,TOP_K_DIFF:`top_k_diff`},co={LINEAGE_VIEW_CONTEXT_MENU:`lineage_view_context_menu`},lo={SELECT_PARENT_NODES:`select_parent_nodes`,SELECT_CHILD_NODES:`select_child_nodes`,SELECT_ALL_UPSTREAM:`select_all_upstream`,SELECT_ALL_DOWNSTREAM:`select_all_downstream`},uo=({menuItems:e,open:t,onClose:n,x:r,y:i,featureToggles:a,DisabledItemWrapper:o})=>{let s=o??(({children:e})=>G(W,{children:e})),c=a?.mode===`metadata only`;return G($r,{open:t,onClose:n,anchorReference:`anchorPosition`,anchorPosition:{top:i,left:r},slotProps:{paper:{sx:{fontSize:`0.85rem`,width:`250px`}}},children:e.length===0?G($,{disabled:!0,children:`No action available`},`no action`):e.map(({isSeparator:e,label:t,isDisabled:r,action:i,itemIcon:a})=>{if(e)return G(rr,{},t);let l=K($,{disabled:r,onClick:()=>{i&&i(),n()},children:[a,` `,t]},t);return r&&o?G(s,{display:c,children:l},t):l})})},fo=({isOpen:e,onClose:t,x:n,y:r,node:i,deps:a={},viewOptions:o={},featureToggles:s={},serverFlags:c={},noCatalogCurrent:l=!1,isActionAvailable:u=()=>!0})=>{let d=[],{runAction:f,onNavigate:p,onTrack:m,findByRunType:h,setSqlQuery:g,setPrimaryKeys:_,getPrimaryKey:v,DisabledItemWrapper:y}=a,{selectMode:b,cll:x,showColumnLevelLineage:S,setChangeAnalysisMode:C,selectParentNodes:w,selectChildNodes:T,getNodeColumnSet:E}=o,D=c.single_env_onboarding??!1,O=s.disableDatabaseQuery??!1;if(!i?.data)return G(W,{});let k=i.data,ee=k.resourceType,te=E?Array.from(E(i.id)):[],A={source:`lineage_model_node`},ne=k.changeStatus,re=v?.(k.name);if(ne===`modified`&&d.push({label:`Show Impact Radius`,itemIcon:G(lr,{}),isDisabled:l||!u(`change_analysis`),action:()=>{C?.(!0),S?.({node_id:i.id,change_analysis:!0,no_upstream:!0})}}),!b&&ee&&[`model`,`seed`,`snapshot`].includes(ee)){d.length>0&&d.push({label:`select group one`,isSeparator:!0});let e=h?.(D?`query`:`query_diff`),t=k.change?.columns?Object.keys(k.change.columns):[],n=Wt(t,t),r=`select * from {{ ref("${k.name}") }}`;if(n.length&&(r=`select \n ${n.join(`
3
3
  `)}\nfrom {{ ref("${k.name}") }}`),e&&d.push({label:`Query`,itemIcon:G(q,{component:e.icon,sx:{display:`inline-flex`}}),isDisabled:O,action:()=>{g?.(r),u(`query_diff_with_primary_key`)&&_?.(re===void 0?void 0:[re]),p?.(`/query`)}}),te.length>0&&e)if(x!==void 0){let t=new Set;re&&t.add(re),te.forEach(e=>{t.add(e)}),d.push({label:`Query Related Columns`,itemIcon:G(q,{component:e.icon,sx:{display:`inline-flex`}}),isDisabled:O,action:()=>{let e=`select \n ${Array.from(t).join(`,
4
4
  `)}\nfrom {{ ref("${k.name}") }}`;g?.(e),u(`query_diff_with_primary_key`)&&_?.(re===void 0?void 0:[re]),p?.(`/query`)}})}else{let t=Object.entries(k.change?.columns??{}).filter(([,e])=>e===`modified`).map(([e])=>e);if(t.length>0){let n=new Set;re&&n.add(re),t.forEach(e=>{n.add(e)}),d.push({label:`Query Modified Columns`,itemIcon:G(q,{component:e.icon,sx:{display:`inline-flex`}}),isDisabled:O,action:()=>{let e=`select \n ${Array.from(n).join(`,
5
5
  `)}\nfrom {{ ref("${k.name}") }}`;g?.(e),u(`query_diff_with_primary_key`)&&_?.(re===void 0?void 0:[re]),p?.(`/query`)}})}}let a=D?`row_count`:`row_count_diff`,o=h?.(a);o&&d.push({label:o.title,itemIcon:G(q,{component:o.icon,sx:{display:`inline-flex`}}),isDisabled:O,action:()=>{m?.(`explore_action`,{action:D?so.ROW_COUNT:so.ROW_COUNT_DIFF,source:co.LINEAGE_VIEW_CONTEXT_MENU,node_count:1}),f?.(a,{node_names:[k.name]},{showForm:!1,trackProps:A})}});let s=D?`profile`:`profile_diff`,c=h?.(s);if(c&&d.push({label:c.title,itemIcon:G(q,{component:c.icon,sx:{display:`inline-flex`}}),isDisabled:O,action:()=>{let e=E?Array.from(E(i.id)):[];m?.(`explore_action`,{action:D?so.PROFILE:so.PROFILE_DIFF,source:co.LINEAGE_VIEW_CONTEXT_MENU,node_count:1}),f?.(s,{model:k.name,columns:e},{showForm:!0,trackProps:A})}}),!D){let e=h?.(`value_diff`);e&&d.push({label:e.title,itemIcon:G(q,{component:e.icon,sx:{display:`inline-flex`}}),isDisabled:O,action:()=>{let e=E?Array.from(E(i.id)):[];m?.(`explore_action`,{action:so.VALUE_DIFF,source:co.LINEAGE_VIEW_CONTEXT_MENU,node_count:1}),f?.(`value_diff`,{model:k.name,columns:e},{showForm:!0,trackProps:A})}})}}return D||(d.length>0&&d.push({label:`select group two`,isSeparator:!0}),d.push({label:`Select Parent Nodes`,itemIcon:G(zi,{}),action:()=>{m?.(`lineage_selection`,{action:lo.SELECT_PARENT_NODES}),w?.(i.id,1)}}),d.push({label:`Select Child Nodes`,itemIcon:G(Bi,{}),action:()=>{m?.(`lineage_selection`,{action:lo.SELECT_CHILD_NODES}),T?.(i.id,1)}}),d.push({label:`Select All Upstream Nodes`,itemIcon:G(zi,{}),action:()=>{m?.(`lineage_selection`,{action:lo.SELECT_ALL_UPSTREAM}),w?.(i.id)}}),d.push({label:`Select All Downstream Nodes`,itemIcon:G(Bi,{}),action:()=>{m?.(`lineage_selection`,{action:lo.SELECT_ALL_DOWNSTREAM}),T?.(i.id)}})),G(uo,{x:n,y:r,menuItems:d,open:e,onClose:t,featureToggles:s,DisabledItemWrapper:y})},po=({isOpen:e,onClose:t,x:n,y:r,node:i,deps:a={},featureToggles:o={},serverFlags:s={},isActionAvailable:c=()=>!0})=>{let l=[],{runAction:u,onTrack:d,findByRunType:f,supportsHistogramDiff:p,DisabledItemWrapper:m}=a,h=s.single_env_onboarding??!1,g=o.disableDatabaseQuery??!1;if(i?.data===void 0)return G(W,{});let _=i.data,v=_.node,y=_.column,b=_.type,x={source:`lineage_column_node`},S=()=>{d?.(`explore_action`,{action:so.PROFILE_DIFF,source:co.LINEAGE_VIEW_CONTEXT_MENU,node_count:1}),u?.(`profile_diff`,{model:v.name,columns:[y]},{showForm:!1,trackProps:x})},C=()=>{d?.(`explore_action`,{action:so.HISTOGRAM_DIFF,source:co.LINEAGE_VIEW_CONTEXT_MENU,node_count:1}),u?.(`histogram_diff`,{model:v.name,column_name:y,column_type:b},{showForm:!1,trackProps:x})},w=()=>{d?.(`explore_action`,{action:so.TOP_K_DIFF,source:co.LINEAGE_VIEW_CONTEXT_MENU,node_count:1}),u?.(`top_k_diff`,{model:v.name,column_name:y,k:50},{showForm:!1,trackProps:x})},T=()=>{d?.(`explore_action`,{action:so.VALUE_DIFF,source:co.LINEAGE_VIEW_CONTEXT_MENU,node_count:1}),u?.(`value_diff`,{model:v.name,columns:[y]},{showForm:!0,trackProps:x})},E=_.changeStatus===`added`||_.changeStatus===`removed`,D=f?.(h?`profile`:`profile_diff`);if(D&&l.push({label:D.title,itemIcon:G(q,{component:D.icon,sx:{display:`inline-flex`}}),action:S,isDisabled:E||!c(`profile_diff`)||g}),!h){let e=f?.(`histogram_diff`);if(e){let t=p?.(b)??!0;l.push({label:e.title,itemIcon:G(q,{component:e.icon,sx:{display:`inline-flex`}}),action:C,isDisabled:E||!t||g})}let t=f?.(`top_k_diff`);t&&l.push({label:t.title,itemIcon:G(q,{component:t.icon,sx:{display:`inline-flex`}}),action:w,isDisabled:E||g});let n=f?.(`value_diff`);n&&l.push({label:n.title,itemIcon:G(q,{component:n.icon,sx:{display:`inline-flex`}}),action:T,isDisabled:E||g})}return G(uo,{x:n,y:r,menuItems:l,open:e,onClose:t,featureToggles:o,DisabledItemWrapper:m})},mo=({isOpen:e,onClose:t,x:n,y:r,node:i,deps:a={},viewOptions:o={},featureToggles:s={},serverFlags:c={},noCatalogCurrent:l=!1,isActionAvailable:u=()=>!0})=>s.disableViewActionDropdown?G(uo,{menuItems:[],open:e,onClose:t,x:n,y:r,featureToggles:s,DisabledItemWrapper:a.DisabledItemWrapper}):i&&de(i)?G(fo,{x:n,y:r,isOpen:e,onClose:t,node:i,deps:a,viewOptions:o,featureToggles:s,serverFlags:c,noCatalogCurrent:l,isActionAvailable:u}):i&&ue(i)?G(po,{x:n,y:r,isOpen:e,onClose:t,node:i,deps:a,featureToggles:s,serverFlags:c,isActionAvailable:u}):null,ho=()=>{let[e,t]=U(!1),n=()=>t(!0),r=()=>t(!1),[i,a]=U({x:0,y:0}),[o,s]=U();return{props:{x:i.x,y:i.y,node:o,isOpen:e,onClose:r},showContextMenu:(e,t,r)=>{a({x:e,y:t}),s(r),n()},closeContextMenu:()=>{a({x:0,y:0}),s(void 0),r()}}},go=()=>{let{isDark:e}=Tt(),{successToast:t,failToast:n}=Bt();return lt({renderLibrary:`html-to-image`,imageType:`png`,shadowEffect:!0,backgroundColor:e?I.neutral[900]:I.neutral[50],ignoreElements:e=>{try{return e.classList.contains(ot)}catch{return e.className?e.className.includes(ot):!1}},onSuccess:()=>{t(`Copied the Lineage View as an image to clipboard`)},onError:e=>{console.error(`Error taking screenshot`,e),n(`Failed to copy image to clipboard`,e)}})},_o=()=>{let e=xi(),{basePath:t}=me();return V(n=>{n.check_id&&e.push(`${t}/checks/?id=${n.check_id}`)},[e.push,t])};function vo(){let[e,t]=U(()=>new Set),[n,r]=U(()=>new Set);return{impactedNodeIds:e,impactedColumnIds:n,publish:V(e=>{t(e.nodeIds),r(e.columnIds)},[])}}const yo=(e,t)=>{let n=Bn({width:0,height:0});Ln(()=>{let r=e.current,i=new ResizeObserver(e=>{for(let r of e){let e=r.contentRect.width,i=r.contentRect.height;(Math.abs(i-n.current.height)>10||Math.abs(e-n.current.width)>10)&&n.current.height>0&&i>0&&n.current.width>0&&e>0&&t(),n.current={width:e,height:i}}});return r&&i.observe(r),()=>{r&&i.unobserve(r)}},[t,e])},bo=()=>V((e,t,n,r,i)=>{let a=e.filter(de),o=Object.groupBy(a,e=>e.data.changeStatus??`unchanged`),s=Object.fromEntries(Object.entries(o).map(([e,t])=>[`nodes_${e}`,t?.length??0])),c={node_count:a.length,view_mode:t,impact_radius_enabled:n,right_sidebar_open:i,...s};r&&(c.cll_column_active=!0),hn(c)},[]),xo={row_count:$t.ROW_COUNT,row_count_diff:$t.ROW_COUNT_DIFF,value_diff:$t.VALUE_DIFF},So=e=>{let t=xo[e.action];t&&un({action:t,source:tn.LINEAGE_VIEW_TOP_BAR,node_count:e.node_count})},Co=(e,t)=>At(e,{...t,onTrackAction:So,trackingSource:tn.LINEAGE_VIEW_TOP_BAR});function wo(){return ke({onConfirm:()=>dn({action:$t.VALUE_DIFF,event:en.EXECUTE}),onCancel:()=>dn({action:$t.VALUE_DIFF,event:en.CANCEL})})}function To({notification:e,type:t}){let n=k.lineageNotificationDismissed,[r,i]=U(()=>sessionStorage.getItem(n)!==`true`);if(e===null||!r)return null;let a={info:`iochmara.light`,success:`success.light`,warning:`warning.light`,error:`error.light`}[t];return K(q,{sx:{width:`100%`,display:`flex`,flexDirection:`row`,p:`5px 10px`,gap:`5px`,alignItems:`flex-start`,borderRadius:1,boxShadow:4,border:`1px solid`,borderColor:`neutral.light`,bgcolor:a},children:[e,G(q,{sx:{flex:1}}),G(Z,{size:`small`,onClick:()=>{sessionStorage.setItem(n,`true`),i(!1)},children:G(er,{})})]})}function Eo(e,t,n,r){let{parent_map:i,child_map:a,columns:o}=e.current,s=new Map,c=new Set;function l(e,t){if(c.has(e))return;c.add(e);let n=o[e];if(n){let t=e.slice(0,-(n.name.length+1)),i=s.get(t)??[];i.push({column:n.name,isImpacted:r.has(e),transformationType:n.transformation_type,changeStatus:n.change_status}),s.set(t,i)}let i=t[e]??[];for(let e of i)l(e,t)}let u=`${t}_${n}`,d=o[u];if(d){let e=u.slice(0,-(d.name.length+1));s.set(e,[{column:d.name,isImpacted:r.has(u),transformationType:d.transformation_type,changeStatus:d.change_status}])}c.add(u);for(let e of i[u]??[])l(e,i);for(let e of a[u]??[])l(e,a);return s}function Do(e){let{columns:t,parent_map:n}=e.current,r=new Map;function i(e){let a=r.get(e);if(a===`pending`)return!1;if(a!==void 0)return a;if(r.set(e,`pending`),t[e]?.change_status)return r.set(e,!0),!0;let o=n[e]??[];for(let t of o)if(i(t))return r.set(e,!0),!0;return r.set(e,!1),!1}let a=new Set;for(let e of Object.keys(t))i(e)&&a.add(e);return a}function Oo(e,t,n,r){if(n)return!0;if(!t)return!1;if(t.current.nodes[e]?.impacted)return!0;let i=r,a=`${e}_`;for(let e of i)if(e.startsWith(a))return!0;return!1}const ko=e=>{let{runAction:t}=he(),{setSqlQuery:n,setPrimaryKeys:r}=Mt(),i=xi(),{primaryKey:a}=tt(e),{basePath:o}=me();return{runAction:(e,n,r)=>{t(e,n,r)},onNavigate:e=>{i.push(`${o}${e}`)},onTrack:(e,t)=>{e===`explore_action`?un({action:t.action,source:co.LINEAGE_VIEW_CONTEXT_MENU,node_count:t.node_count}):e===`lineage_selection`&&mn({action:t.action})},supportsHistogramDiff:it,findByRunType:e=>{let t=L(e);return t?{title:t.title,icon:t.icon}:void 0},setSqlQuery:n,setPrimaryKeys:r,getPrimaryKey:()=>a,DisabledItemWrapper:xc}},Ao=({isOpen:e,onClose:t,x:n,y:r,node:i})=>{let{selectParentNodes:a,selectChildNodes:o,getNodeColumnSet:s,selectMode:c,cll:l,showColumnLevelLineage:u,setChangeAnalysisMode:d}=pe(),{featureToggles:f}=Ce(),{isActionAvailable:p,lineageGraph:m}=P(),{data:h}=xe(),g=!m?.catalogMetadata.current;return G(mo,{x:n,y:r,node:i,isOpen:e,onClose:t,deps:ko(i?.type===`lineageGraphNode`?i.data?.name:i?.type===`lineageGraphColumnNode`?i.data?.node?.name:void 0),viewOptions:{selectMode:c,cll:l,showColumnLevelLineage:u,setChangeAnalysisMode:d,selectParentNodes:a,selectChildNodes:o,getNodeColumnSet:s},featureToggles:{disableDatabaseQuery:f.disableDatabaseQuery,disableViewActionDropdown:f.disableViewActionDropdown,mode:f.mode??void 0},serverFlags:{single_env_onboarding:h?.single_env_onboarding},noCatalogCurrent:g,isActionAvailable:p})},jo=ho;function Mo(e,t){let n=[],r=[],{selectedNodes:i,cll:a,existingPositions:o,newCllExperience:s,columnAncestry:c}=t??{},l={};function u(e){return e===`removed`?0:e===`added`?2:1}function d(e,t){let n=u(e.data?.changeStatus),r=u(t.data?.changeStatus);return n<r?-1:+(n>r)}let f=i===void 0?void 0:new Set(i),p=Object.values(e.nodes).sort(d);for(let e of p){if(f&&!f.has(e.id))continue;let t=new Set,i=0;if(a&&!s){let o=a.current,s=o?.parent_map[e.id]??new Set;for(let t of s){let n=t,i=e.id;r.push({id:`m2c_${n}_${i}`,source:n,target:i,style:{zIndex:9999}})}let c=Object.entries(o?.columns??{}).filter(([t])=>t.startsWith(`${e.id}_`)).map(([t])=>t.slice(e.id.length+1));for(let o of c){let s=`${e.id}_${o}`,c=a.current,l=c?.columns[s],u=c?.parent_map[s]??new Set;if(l!=null){n.push({id:s,position:{x:10,y:70+i*24},parentId:e.id,extent:`parent`,draggable:!1,className:`no-track-pii-safe`,data:{node:e.data,column:l.name,type:l.type,transformationType:l.transformation_type,changeStatus:l.change_status},style:{zIndex:9999},type:`lineageGraphColumnNode`,targetPosition:Br.Left,sourcePosition:Br.Right});for(let e of u){let t=e,n=s;r.push({id:`${t}_${n}`,source:t,target:n,style:{zIndex:9999}})}i++,t.add(l.name)}}}l[e.id]=t;let c=60;i>0&&(c+=20+i*24);let u=o?.get(e.id);n.unshift({id:e.id,position:u??{x:0,y:0},width:300,height:c,className:`no-track-pii-safe`,data:{...e.data},type:`lineageGraphNode`,targetPosition:Br.Left,sourcePosition:Br.Right,style:{width:300,height:c}})}let m=Object.values(e.edges).sort(d);for(let e of m)f&&(!f.has(e.source)||!f.has(e.target))||r.push({id:e.id,type:`lineageGraphEdge`,source:e.source,target:e.target,data:{...e.data}});return s&&c&&a&&No(n,r,c,a,f),n.some(e=>e.type===`lineageGraphNode`&&!o?.has(e.id))&&Po(n,r),[n,r,l]}function No(e,t,n,r,i){let a=new Set,o=new Map;for(let[t,s]of n)if(!(i&&!i.has(t))){for(let n=0;n<s.length;n++){let i=s[n],c=`${t}_${i.column}`;a.add(c),o.set(c,{modelId:t,isImpacted:i.isImpacted});let l=r.current.columns[c];e.push({id:c,position:{x:10,y:64+n*24},parentId:t,draggable:!1,className:`no-track-pii-safe`,data:{node:{id:t},column:i.column,type:l?.type,transformationType:i.transformationType,changeStatus:i.changeStatus,isHighlighted:!0,isFocused:!1,isImpacted:i.isImpacted},style:{zIndex:9999},type:`lineageGraphColumnNode`,targetPosition:Br.Left,sourcePosition:Br.Right})}if(s.length>0){let n=e.find(e=>e.id===t&&e.type===`lineageGraphNode`);n&&(n.height=80+s.length*24)}}for(let e of a){let n=r.current.parent_map[e]??[];for(let r of n)if(a.has(r)){let n=o.get(r)?.isImpacted??!1;t.push({id:`ancestry_${r}_${e}`,source:r,target:e,style:{zIndex:9999,strokeWidth:2,stroke:n?Nt.impacted:Nt.unchanged}})}}}const Po=(e,t,n=`LR`)=>{F(Vi,e,t,n)};function Fo(){return K(q,{sx:{display:`flex`,gap:2,px:1,py:.5,fontSize:`0.75rem`,color:`text.secondary`},children:[K(`span`,{children:[G(`span`,{className:`schema-change-badge schema-change-badge-added`,children:`+`}),` `,`added`]}),K(`span`,{children:[G(`span`,{className:`schema-change-badge schema-change-badge-removed`,children:`-`}),` `,`removed`]}),K(`span`,{children:[G(`span`,{className:`schema-change-badge schema-change-badge-changed`,children:`~`}),` `,`changed`]})]})}function Io({current:e,showMenu:t=!0},n){let r=_e(),[i,a]=U(null),[o,s]=U(new Map),{columns:c,rows:l}=H(()=>ct({type:`schema_single`,columns:e?.columns},{node:e,cllRunningMap:o,showMenu:t}),[e,o,t]),{lineageGraph:u,isActionAvailable:d}=P(),f=d(`change_analysis`),p=!u?.catalogMetadata.current,m;p&&(m="catalog.json not found. Run `recce debug` to troubleshoot.");let h=e&&e.columns===void 0,g;h&&(g=`Node schema not found in catalog.json. Please regenerate your catalog.json to update.`);let _=async t=>{if(!f)return;rn({action:`view`,source:`schema_column`}),s(e=>new Map(e).set(t,!0));let n=e?.id;n&&await r?.showColumnLevelLineage({node_id:n,column:t}),s(e=>new Map(e).set(t,!1))},v=V(t=>`${e?.id}-${t.data.name}`,[e?.id]),y=r?.viewOptions.column_level_lineage,b=y?`${y.node_id}-${y.column}`:null;Ln(()=>{if(i&&(i.deselectAll(),b)){let e=i.getRowNode(b);e&&e.setSelected(!0)}},[i,b]);let x=V(e=>{a(e.api)},[]);return K(q,{sx:{display:`flex`,flexDirection:`column`,height:`100%`},children:[m?G(Qr,{severity:`warning`,sx:{fontSize:`12px`,p:1},children:m}):g?G(Qr,{severity:`warning`,sx:{fontSize:`12px`,p:1},children:g}):G(W,{}),l.length>0&&G(Ft,{style:{blockSize:`auto`,maxHeight:`100%`,overflow:`auto`,fontSize:`10pt`,borderWidth:1},columns:c,rows:l,renderers:{noRowsFallback:G(kt,{})},ref:n,getRowId:v,getRowClass:e=>r!==void 0&&f?`row-normal row-selectable`:`row-normal`,onCellClicked:async e=>{if((e.event?.target)?.closest(`.row-context-menu`))return;let t=e.data;t&&await _(t.name)},onGridReady:x,rowSelection:{mode:`singleRow`,checkboxes:!1},containerClassName:`no-track-pii-safe`,rowClassName:`no-track-pii-safe`})]})}function Lo({base:e,current:t,showMenu:n=!0,columnChanges:r,onViewCode:i},a){let o=_e(),{data:s}=xe(),c=s?.new_cll_experience??!1,[l,u]=U(null),[d,f]=U(new Map),p=H(()=>{if(!c)return;let e=o?.impactedColumnIds;return e?.size?e:void 0},[c,o?.impactedColumnIds]),{columns:m,rows:h}=H(()=>{let a=t?.resource_type??e?.resource_type,o=a&&[`model`,`seed`,`snapshot`,`source`].includes(a)?t??e:void 0,s=t?.id??e?.id;return ct({type:`schema_diff`,base:e?.columns,current:t?.columns},{node:o,cllRunningMap:d,showMenu:n,columnChanges:r,onViewCode:i,impactedColumns:p,nodeId:s})},[e,t,d,n,r,i,p]),{lineageGraph:g,isActionAvailable:_}=P(),v=_(`change_analysis`),y=!g?.catalogMetadata.base,b=!g?.catalogMetadata.current,x;y&&b?x="catalog.json not found on both environments. Run `recce debug` to troubleshoot.":y?x="catalog.json not found on base environment. Run `recce debug` to troubleshoot.":b&&(x="catalog.json not found on current environment. Run `recce debug` to troubleshoot.");let S=e&&e.columns===void 0,C=t&&t.columns===void 0,w;S&&C?w=`Node schema not found in catalog.json on both environments. Please regenerate your catalog.json to update.`:C?w=`Node schema not found in catalog.json on current environment. Please regenerate your catalog.json to update.`:S&&(w=`Node schema not found in catalog.json on base environment. Please regenerate your catalog.json to update.`);let T=async n=>{if(!v)return;rn({action:`view`,source:`schema_column`}),f(e=>new Map(e).set(n,!0));let r=t?.id??e?.id;r&&await o?.showColumnLevelLineage({node_id:r,column:n}),f(e=>new Map(e).set(n,!1))},E=V(n=>`${t?.id??e?.id}-${n.data.name}`,[t?.id,e?.id]),D=o?.viewOptions.column_level_lineage,O=D?`${D.node_id}-${D.column}`:null;Ln(()=>{if(l&&(l.deselectAll(),O)){let e=l.getRowNode(O);e&&e.setSelected(!0)}},[l,O]);let k=V(e=>{u(e.api)},[]);return K(q,{sx:{display:`flex`,flexDirection:`column`,height:`100%`},children:[x?G(Qr,{severity:`warning`,sx:{fontSize:`12px`,p:1},children:x}):w?G(Qr,{severity:`warning`,sx:{fontSize:`12px`,p:1},children:w}):G(W,{}),G(Fo,{}),h.length>0&&G(Ft,{style:{blockSize:`auto`,maxHeight:`100%`,overflow:`auto`,fontSize:`0.8rem`,borderWidth:1},columns:m,rows:h,rowHeight:35,renderers:{noRowsFallback:G(kt,{})},className:`rdg-light no-track-pii-safe${c?` cll-experience`:``}`,ref:a,getRowId:E,getRowClass:e=>{let t=e.data;if(!t)return`row-normal`;let n;if(t.baseIndex===void 0)n=`row-added`;else if(t.currentIndex===void 0)return`row-removed`;else n=t.baseType!==t.currentType||t.reordered===!0||t.definitionChanged===!0?`row-changed`:t.isImpacted?`row-impacted`:`row-normal`;return o!==void 0&&v&&(n+=` row-selectable`),n},onCellClicked:async e=>{if((e.event?.target)?.closest(`.row-context-menu`))return;let t=e.data;t&&(t.baseIndex!==void 0&&t.currentIndex===void 0||await T(t.name))},onGridReady:k,rowSelection:{mode:`singleRow`,checkboxes:!1},containerClassName:`no-track-pii-safe`,rowClassName:`no-track-pii-safe`})]})}const Ro=Pn(Lo),zo=Pn(Io),Bo=({node:e,modelDetail:t,isSingleEnv:n,CodeEditor:r,DiffEditor:i,isDark:a=!1})=>{let[o,s]=U(!1),[c,l]=U(!1);if(e.data.resourceType!==`model`&&e.data.resourceType!==`snapshot`)return`Not available`;let u=t?.base?.raw_code,d=t?.current?.raw_code,f=t?.base?.name??t?.current?.name??e.data.name??``,p=u!=null||d!=null;return K(q,{className:`no-track-pii-safe`,sx:{position:`relative`,height:`100%`},onMouseEnter:()=>{l(!0)},onMouseLeave:()=>{l(!1)},children:[p?n?G(r,{language:`sql`,value:u??``,readOnly:!0,lineNumbers:!0,wordWrap:!1,theme:a?`dark`:`light`}):G(i,{original:u??``,modified:d??``,language:`sql`,readOnly:!0,lineNumbers:!0,sideBySide:!1,theme:a?`dark`:`light`,height:`100%`}):G(q,{sx:{display:`flex`,alignItems:`center`,justifyContent:`center`,height:`100%`,color:`text.secondary`},children:`No code available`}),G(Z,{onClick:()=>s(!0),size:`medium`,"aria-label":`Expand`,sx:{position:`absolute`,top:`5px`,right:`20px`,opacity:c?.5:.1,transition:`opacity 0.3s ease-in-out`},children:G(or,{})}),K(Vn,{open:o,onClose:()=>s(!1),maxWidth:`sm`,fullWidth:!0,slotProps:{paper:{sx:{height:`75%`,overflowY:`auto`}}},children:[K(Wn,{sx:{display:`flex`,alignItems:`center`},children:[n?K(W,{children:[G(`code`,{children:f}),`\xA0Model Code`]}):K(W,{children:[G(`code`,{children:f}),`\xA0Model Code Diff`]}),G(q,{sx:{flex:1}}),G(Z,{size:`small`,onClick:()=>s(!1),children:G(er,{})})]}),G(Un,{children:p?n?G(r,{language:`sql`,value:u??``,fontSize:16,readOnly:!0,lineNumbers:!0,wordWrap:!1,theme:a?`dark`:`light`}):G(i,{original:u??``,modified:d??``,language:`sql`,theme:a?`dark`:`light`,className:`text-base`}):G(q,{sx:{display:`flex`,alignItems:`center`,justifyContent:`center`,height:`100%`,color:`text.secondary`},children:`No code available`})})]})]})},Vo=({node:e})=>{let{data:t,isLoading:n}=xe(),r=Rt(),{apiClient:i}=B(),a=e.data.resourceType,o=a===`model`||a===`snapshot`,{data:s,isLoading:c}=An({queryKey:[`modelDetail`,e.id],queryFn:()=>u(e.id,i),enabled:o&&!!i,staleTime:300*1e3,retry:1});return n?G(W,{}):o&&c?G(q,{"aria-label":`Loading model code`,sx:{p:2,height:`100%`},"data-testid":`node-sql-view-loading`,children:G(Hi,{variant:`rectangular`,height:`100%`,animation:`wave`})}):G(Bo,{node:e,modelDetail:s?.model,isSingleEnv:t?.single_env_onboarding??!1,CodeEditor:Xe,DiffEditor:ft,isDark:r})};function Ho({rowCount:e}){let t=e.base,n=e.curr,r=e.base===null?`N/A`:`${e.base} rows`,i=e.curr===null?`N/A`:`${e.curr} rows`;return t===null&&n===null?G(W,{children:` Failed to load`}):t===null||n===null?K(Y,{direction:`row`,spacing:.5,sx:{alignItems:`center`},children:[G(X,{variant:`body2`,component:`span`,children:r}),G(Di,{}),G(X,{variant:`body2`,component:`span`,children:i})]}):t===n?K(Y,{direction:`row`,spacing:.5,sx:{alignItems:`center`},children:[G(X,{variant:`body2`,component:`span`,children:i}),G(q,{component:`span`,sx:{color:`grey.500`,display:`flex`},children:G(Fi,{})}),G(X,{variant:`body2`,component:`span`,sx:{color:`grey.500`},children:`No Change`})]}):t<n?K(Y,{direction:`row`,spacing:.5,sx:{alignItems:`center`},children:[G(X,{variant:`body2`,component:`span`,children:i}),G(q,{component:`span`,sx:{color:`success.main`,display:`flex`},children:G(Ni,{})}),G(X,{variant:`body2`,component:`span`,sx:{color:`success.main`},children:Ut(t,n)})]}):K(Y,{direction:`row`,spacing:.5,sx:{alignItems:`center`},children:[G(X,{variant:`body2`,component:`span`,children:i}),G(q,{component:`span`,sx:{color:`error.main`,display:`flex`},children:G(Mi,{})}),G(X,{variant:`body2`,component:`span`,sx:{color:`error.main`},children:Ut(t,n)})]})}function Uo({rowCount:e,node:t,onRefresh:n,isFetching:r}){let i=Rt(),{featureToggles:a}=Ce(),{runsAggregated:o}=P(),s=o?.[t.id]?.row_count_diff.result,c=L(`row_count_diff`).icon,l=e??s,u=l;return G(Q,{title:l?`${l.base??`N/A`} -> ${l.curr??`N/A`} rows`:``,children:G(xc,{display:a.mode===`metadata only`,children:K(q,{component:`span`,sx:{...Ct(i),gap:.5},children:[G(c,{}),u!=null||r?r?G(Hi,{width:30,height:16}):u==null?G(X,{variant:`caption`,children:`row count`}):G(Ho,{rowCount:u}):G(X,{variant:`caption`,children:`row count`}),n&&G(Z,{"aria-label":`Query Row Count`,size:`small`,onClick:n,disabled:a.disableDatabaseQuery,sx:{p:0,ml:.5},children:G(Er,{size:12})})]})})})}function Wo({rowCount:e,node:t,onRefresh:n,isFetching:r}){let i=Rt(),{runsAggregated:a}=P(),o=a?.[t.id]?.row_count.result,s=L(`row_count`).icon,c,l=e??o;return l&&(c=`${l.curr??`N/A`} rows`),K(q,{component:`span`,sx:Ct(i),children:[G(q,{component:`span`,sx:pt,children:G(s,{})}),l||r?r?G(Hi,{width:30,height:16}):G(X,{variant:`caption`,children:c}):G(X,{variant:`caption`,children:`row count`}),n&&G(Z,{"aria-label":`Query Row Count`,size:`small`,onClick:n,disabled:t.data.changeStatus===`removed`,sx:{p:0,ml:.5},children:G(Er,{size:12})})]})}function Go({children:e,value:t,index:n}){return t===n?G(W,{children:e}):null}const Ko=()=>G(`span`,{}),qo=({children:e})=>G(W,{children:e}),Jo=()=>!0;function Yo(e,t,n){return e?En.add_or_remove:n(t)?``:`This action is not supported yet.`}function Xo({node:e,actionCallbacks:t,runTypeIcons:n,isActionAvailable:r}){let i=e.data.changeStatus===`added`||e.data.changeStatus===`removed`,a=n?.query??Ko,o=n?.row_count??Ko,s=n?.profile??Ko;return K(Y,{direction:`row`,sx:{alignItems:`center`,flexWrap:`wrap`,gap:1},children:[G(J,{size:`xsmall`,variant:`outlined`,color:`neutral`,startIcon:G(a,{fontSize:`small`}),onClick:t?.onQueryClick,sx:{textTransform:`none`},children:`Query`}),G(J,{size:`xsmall`,variant:`outlined`,color:`neutral`,startIcon:G(o,{fontSize:`small`}),onClick:t?.onRowCountClick,sx:{textTransform:`none`},children:`Row Count`}),G(Q,{title:Yo(i,`profile`,r),placement:`top`,children:G(`span`,{children:G(J,{size:`xsmall`,variant:`outlined`,color:`neutral`,startIcon:G(s,{fontSize:`small`}),onClick:t?.onProfileClick,disabled:i,sx:{textTransform:`none`},children:`Profile`})})})]})}function Zo({actionCallbacks:e,runTypeIcons:t,featureToggles:n,ConnectionPopoverWrapper:r}){let i=n?.mode===`metadata only`,a=t?.schema_diff??Ko,o=t?.sandbox??Ko;return K(Y,{direction:`row`,sx:{alignItems:`center`,flexWrap:`wrap`,gap:1,mr:1},children:[G(J,{size:`xsmall`,variant:`outlined`,color:`neutral`,startIcon:G(a,{fontSize:`small`}),onClick:e?.onAddSchemaDiffClick,sx:{textTransform:`none`},children:`Add schema diff to checklist`}),G(r,{display:i,children:G(J,{size:`xsmall`,variant:`outlined`,color:`neutral`,startIcon:G(o,{fontSize:`small`}),onClick:e?.onSandboxClick,disabled:n?.disableDatabaseQuery,sx:{textTransform:`none`},children:`Sandbox`})})]})}function Qo({node:e,actionCallbacks:t,runTypeIcons:n,featureToggles:r,isActionAvailable:i,ConnectionPopoverWrapper:a}){let o=r?.mode===`metadata only`,s=e.data.changeStatus===`added`||e.data.changeStatus===`removed`,c=n?.query_diff??Ko,l=n?.row_count_diff??Ko,u=n?.profile_diff??Ko,d=n?.value_diff??Ko,f=n?.top_k_diff??Ko,p=n?.histogram_diff??Ko,m=(e,t)=>o?G(a,{display:!0,children:e}):G(Q,{title:Yo(s,t,i),placement:`top`,children:G(`span`,{children:e})});return K(Y,{direction:`row`,sx:{alignItems:`center`,flexWrap:`wrap`,gap:2},children:[G(X,{variant:`caption`,sx:{fontWeight:`bold`},children:`Diff`}),K(Y,{direction:`row`,sx:{alignItems:`center`,flexWrap:`wrap`,gap:1,width:`93%`},children:[G(a,{display:o,children:G(J,{size:`xsmall`,variant:`outlined`,color:`neutral`,startIcon:G(l,{fontSize:`small`}),onClick:t?.onRowCountDiffClick,disabled:r?.disableDatabaseQuery,sx:{textTransform:`none`},children:`Row Count`})}),m(G(J,{size:`xsmall`,variant:`outlined`,color:`neutral`,startIcon:G(u,{fontSize:`small`}),onClick:t?.onProfileDiffClick,disabled:s||r?.disableDatabaseQuery,sx:{textTransform:`none`},children:`Profile`}),`profile_diff`),m(G(J,{size:`xsmall`,variant:`outlined`,color:`neutral`,startIcon:G(d,{fontSize:`small`}),onClick:t?.onValueDiffClick,disabled:s||r?.disableDatabaseQuery,sx:{textTransform:`none`},children:`Value`}),`value_diff`),m(G(J,{size:`xsmall`,variant:`outlined`,color:`neutral`,startIcon:G(f,{fontSize:`small`}),onClick:t?.onTopKDiffClick,disabled:s||r?.disableDatabaseQuery,sx:{textTransform:`none`},children:`Top-K`}),`top_k_diff`),m(G(J,{size:`xsmall`,variant:`outlined`,color:`neutral`,startIcon:G(p,{fontSize:`small`}),onClick:t?.onHistogramDiffClick,disabled:s||r?.disableDatabaseQuery,sx:{textTransform:`none`},children:`Histogram`}),`histogram_diff`),G(a,{display:o,children:G(J,{size:`xsmall`,variant:`outlined`,color:`neutral`,startIcon:G(c,{fontSize:`small`}),onClick:t?.onQueryDiffClick,disabled:r?.disableDatabaseQuery,sx:{textTransform:`none`},children:`Query`})})]})]})}function $o({node:e,onCloseNode:t,isSingleEnv:n,featureToggles:r,modelDetail:i,SchemaView:a,SingleEnvSchemaView:o,NodeSqlView:s,RowCountDiffTag:c,RowCountTag:l,ResourceTypeTag:u,NotificationComponent:d,ConnectionPopoverWrapper:f=qo,SandboxDialog:p,runTypeIcons:m,actionCallbacks:h,isActionAvailable:g=Jo}){let _=e.data.resourceType===`model`||e.data.resourceType===`seed`||e.data.resourceType===`source`||e.data.resourceType===`snapshot`,[v,y]=U(!1),[b,x]=U(!0),[S,C]=U(0),{base:w,current:T}=i??{},E=!n&&e.data.change?.columns!=null&&Object.keys(e.data.change.columns).length>0,D=!n&&e.data.changeStatus===`modified`,O=e.data.resourceType===`model`||e.data.resourceType===`seed`||e.data.resourceType===`snapshot`,k={...h,onSandboxClick:()=>{h?.onSandboxClick?.(),y(!0)}};return K(q,{sx:{height:`100%`,display:`flex`,flexDirection:`column`},children:[K(Y,{direction:`row`,sx:{alignItems:`center`},children:[G(q,{sx:{flex:`0 1 20%`,p:2},children:G(X,{variant:`subtitle1`,className:`no-track-pii-safe`,sx:{fontWeight:600},children:e.data.name})}),G(q,{sx:{flexGrow:1}}),!n&&O&&G(Zo,{node:e,actionCallbacks:k,runTypeIcons:m,featureToggles:r,ConnectionPopoverWrapper:f}),G(q,{sx:{flex:`0 1 1%`},children:G(Z,{size:`small`,onClick:t,children:G(er,{})})})]}),G(q,{sx:{color:`text.secondary`,pl:2},children:K(Y,{direction:`row`,spacing:1,children:[u&&G(u,{node:e}),O&&(n?l&&G(l,{node:e,onRefresh:h?.onRowCountClick}):c&&G(c,{node:e,onRefresh:h?.onRowCountDiffClick}))]})}),O&&G(q,{sx:{pl:2,py:1},children:n?G(Xo,{node:e,actionCallbacks:h,runTypeIcons:m,isActionAvailable:g}):G(Qo,{node:e,actionCallbacks:k,runTypeIcons:m,featureToggles:r,isActionAvailable:g,ConnectionPopoverWrapper:f})}),_&&K(q,{sx:{overflow:`auto`,display:`flex`,flexDirection:`column`,flex:1,minHeight:0},children:[n&&b&&d&&G(q,{sx:{p:1.5},children:G(d,{onClose:()=>x(!1),children:G(X,{variant:`body2`,children:`Enable the Recce Checklist and start adding checks for better data validation and review.`})})}),K(pi,{value:S,onChange:(e,t)=>C(t),sx:{borderBottom:1,borderColor:`divider`},children:[G(fi,{label:K(q,{component:`span`,sx:{display:`flex`,alignItems:`center`,gap:.75},children:[`Columns`,E&&G(q,{component:`span`,sx:{color:`amber.main`,fontSize:`0.5rem`,lineHeight:1},children:`●`})]})}),G(fi,{label:K(q,{component:`span`,sx:{display:`flex`,alignItems:`center`,gap:.75},children:[`Code`,D&&G(q,{component:`span`,sx:{color:`amber.main`,fontSize:`0.5rem`,lineHeight:1},children:`●`})]})})]}),K(q,{sx:{overflow:`auto`,height:`calc(100% - 48px)`},children:[G(Go,{value:S,index:0,children:G(q,{sx:{overflowY:`auto`,height:`100%`},children:n?o&&G(o,{current:T}):a&&G(a,{base:w,current:T,columnChanges:e.data.change?.columns,onViewCode:()=>C(1)})})}),G(Go,{value:S,index:1,children:G(q,{sx:{height:`100%`},children:s&&G(s,{node:e})})})]})]}),p&&G(p,{isOpen:v,onClose:()=>y(!1),current:T})]})}function es(e){return li(di(e),`yyyy-MM-dd'T'HH:mm:ss`)}function ts({current:e,primaryKeys:t,onPrimaryKeysChange:n,onRunResultOpen:r,runQuery:i,isPending:a,isCodeLoading:o=!1,QueryForm:s}){let c=!!e?.raw_code,l=a||o||!c,u=o?`Loading model code...`:c?`Run diff to see the changes`:`No code available for this model`;return K(Y,{direction:`row`,sx:{justifyContent:`flex-end`,alignItems:`center`,p:`4pt 8pt`,gap:`5px`,height:`54px`,borderBottom:`1px solid`,borderBottomColor:`divider`,flex:`0 0 54px`},children:[K(q,{children:[K(X,{variant:`h6`,component:`h2`,sx:{display:`flex`,alignItems:`center`,gap:`5px`},children:[G(q,{component:Ui,sx:{fontSize:`1.2em`}}),`Sandbox`]}),K(X,{sx:{fontSize:`0.75rem`,color:`grey.500`},children:[`Compare the run results based on the modified SQL code of model`,` `,G(`b`,{children:e?.name})]})]}),G(q,{sx:{flexGrow:1}}),G(s,{defaultPrimaryKeys:t,onPrimaryKeysChange:n}),G(Q,{title:u,children:G(`span`,{children:G(J,{size:`small`,sx:{mt:`16px`,fontSize:`14px`},onClick:()=>{r(),i()},color:`iochmara`,variant:`contained`,disabled:l,children:a?`Running...`:`Run Diff`})})})]})}function ns({currentModelID:e,height:t=`32px`,flex:n=`0 0 auto`,isDark:r=!1}){let{lineageGraph:i,envInfo:a}=P(),o=`0 16px`,s=ui(es(a?.dbt?.current?.generated_at??``),{addSuffix:!0}),c=`N/A`;if(i?.nodes[e]){let t=i.nodes[e];t.data.schema&&(c=t.data.schema)}return K(Y,{direction:`row`,sx:{gap:0,height:t,flex:n,fontSize:`14px`,alignItems:`center`,m:0,bgcolor:Yn(r?I.neutral[700]:I.neutral[100],.5)},children:[G(Y,{sx:{width:`50%`},children:K(X,{sx:{fontWeight:`bold`,margin:o},children:[`ORIGINAL (Schema: `,c,`, Last Updated: `,s,`)`]})}),G(Y,{sx:{width:`50%`},children:G(X,{sx:{fontWeight:`bold`,margin:o},children:`SANDBOX EDITOR`})})]})}function rs({current:e,onChange:t,isDark:n,isCodeLoading:r=!1,DiffEditor:i}){return r?G(q,{sx:{flex:1,p:2},"data-testid":`sandbox-sql-preview-loading`,"aria-label":`Loading model code`,children:G(Hi,{variant:`rectangular`,height:`100%`,animation:`wave`})}):e?.raw_code?G(i,{original:e.raw_code,modified:e.raw_code,language:`sql`,readOnly:!1,lineNumbers:!0,sideBySide:!0,theme:n?`dark`:`light`,height:`100%`,onModifiedChange:t}):G(q,{sx:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`text.secondary`},children:`No code available for this model.`})}function is({isOpen:e,onClose:t,current:n,DiffEditor:r,QueryForm:i,RunResultPane:a,isDark:o=!1,primaryKeys:s=[],onPrimaryKeysChange:c,isPending:l=!1,onRunQuery:u,onRunResultOpen:d,onModifiedCodeChange:f,onShowFeedback:p,tracking:m,logoUrl:h=`/logo/recce-logo-white.png`,brandName:g=`RECCE`,isCodeLoading:_=!1}){let[v,y]=U(!1),b=e=>{f?.(e)},x=()=>{y(!0),d?.()},S=()=>{u?.()},C=()=>{t(),y(!1),m?.onPreviewChange?.({action:`close`,node:n?.name})};return K(Vn,{open:e,onClose:C,maxWidth:!1,fullWidth:!0,slotProps:{paper:{sx:{width:`100%`,height:`100%`,maxWidth:`100%`,maxHeight:`100%`,m:0}}},children:[K(q,{sx:{height:`40px`,bgcolor:`cyan.600`,px:0,py:2,display:`flex`,alignItems:`center`},children:[K(Y,{direction:`row`,sx:{alignItems:`center`,height:`100%`,gap:`10px`},children:[G(q,{component:`img`,sx:{width:`20px`,height:`20px`,ml:`18px`},src:h,alt:`logo`}),G(X,{variant:`h6`,component:`h1`,sx:{fontFamily:`"Montserrat", sans-serif`,fontSize:`1.125rem`,color:`common.white`},children:g}),G(Mr,{label:`Experiment`,size:`small`,variant:`outlined`,sx:{fontSize:`0.875rem`,color:`common.white`,borderColor:`rgba(255,255,255,0.5)`}})]}),G(Z,{"aria-label":`close`,onClick:C,sx:{position:`absolute`,right:8,top:4,color:`common.white`},children:G(er,{})})]}),G(Un,{sx:{p:0},children:K(_t,{sizes:v?[50,50]:[100,0],minSize:0,gutterSize:5,className:v?void 0:`split-gutter-hidden`,style:{flex:`1`,contain:`size`,height:`100%`},children:[K(Y,{sx:{height:`100%`,m:0,p:0},children:[G(ts,{current:n,primaryKeys:s,onPrimaryKeysChange:e=>{c?.(e)},onRunResultOpen:x,runQuery:S,isPending:l,isCodeLoading:_,QueryForm:i}),G(ns,{height:`32px`,flex:`0 0 auto`,currentModelID:n?.id??``,isDark:o}),G(rs,{current:n,onChange:b,isDark:o,isCodeLoading:_,DiffEditor:r})]}),v?G(a,{onClose:()=>y(!1),disableAddToChecklist:!0}):G(q,{})]})}),G(q,{sx:{position:`fixed`,bottom:16,right:16,opacity:.5},children:G(Q,{title:`Give us feedback`,children:G(Z,{"aria-label":`feedback`,size:`medium`,onClick:()=>{p?.()},children:G(ni,{})})})})]})}function as({isOpen:e,onClose:t,current:n}){let{showRunId:r,clearRunResult:i}=he(),{primaryKeys:o,setPrimaryKeys:s}=Mt(),{data:c,isLoading:l}=xe(),{apiClient:d}=B(),f=Rt(),p=n?.raw_code,h=e&&!!n?.id&&p==null,{data:g,isLoading:v}=An({queryKey:[`modelDetail`,n?.id??``],queryFn:()=>u(n?.id??``,d),enabled:h&&!!d,staleTime:300*1e3,retry:1}),y=H(()=>p??g?.model.current?.raw_code??g?.model.base?.raw_code??void 0,[p,g]),b=H(()=>{if(n)return y===n.raw_code?n:{...n,raw_code:y}},[n,y]),[x,S]=U(``),[C,w]=U(e),[T,E]=U(y),D=Bn(!1),O=V(e=>{D.current=!0,S(e)},[]);e===C?e&&y!==T&&!D.current&&(E(y),S(y??``)):(w(e),e&&(D.current=!1,S(y??``),E(y)));let{mutate:k,isPending:ee}=kn({mutationFn:async()=>{let e=x,{run_id:t}=await a({current_model:n?.name??``,primary_keys:o,sql_template:e},{nowait:!0},d);return r(t),await _(t,void 0,d)},onSuccess(e){e.error?yn({action:`run`,node:n?.name,status:`failure`}):(yn({action:`run`,node:n?.name,status:`success`}),setTimeout(()=>{te()},1e3),!l&&c?.single_env_onboarding&&setTimeout(()=>{ne()},2e3))}}),{feedbackToast:te,closeToast:A}=wt({feedbackId:m.previewChangeFeedbackID,description:`Enjoy preview change?`,onFeedbackSubmit:e=>{switch(e){case`like`:bn({feedback:`like`,node:n?.name});break;case`dislike`:bn({feedback:`dislike`,node:n?.name});break;case`link`:bn({feedback:`form`,node:n?.name});break;default:console.log(`Not support feedback type`)}},externalLink:`https://docs.google.com/forms/d/e/1FAIpQLSd7Lei7Ijwo7MinWaI0K6rzZi_21gV1BKetmiNEX254kDziDA/viewform?usp=header`,externalLinkText:`Give us feedback`}),{guideToast:ne,closeGuideToast:re}=bt({guideId:m.prepareEnvGuideID,description:`Want to compare data changes with production data?`,externalLink:`https://docs.reccehq.com/get-started/#prepare-dbt-artifacts`,externalLinkText:`Learn how.`,onExternalLinkClick:()=>{wn({action:`external_link`,from:`preview_changes`,node:n?.name})}});return G(is,{isOpen:e,onClose:()=>{t(),i(),A(),re()},current:b,DiffEditor:ft,QueryForm:Ja,RunResultPane:je,isDark:f,primaryKeys:o??[],onPrimaryKeysChange:s,isPending:ee,isCodeLoading:h&&v,onRunQuery:k,onModifiedCodeChange:O,onShowFeedback:()=>te(!0),tracking:{onPreviewChange:yn}})}const os=({node:e})=>G(yt,{resourceType:e.data.resourceType,materialized:e.data.materialized});function ss({onClose:e}){return G(mt,{onClose:e,align:`flex-start`,children:K(X,{variant:`body2`,children:[`Enable the Recce Checklist and start adding checks for better data validation and review.`,G(`br`,{}),G(De,{})]})})}function cs({node:e,onCloseNode:t}){let n=xi(),{runAction:r}=he(),{isActionAvailable:i,envInfo:a}=P(),{singleEnv:o,featureToggles:s}=Ce(),{setSqlQuery:c,setPrimaryKeys:l}=Mt(),{primaryKey:d}=tt(e.data.name),{apiClient:f}=B(),{basePath:p}=me(),{data:m}=An({queryKey:[`modelDetail`,e.id],queryFn:()=>u(e.id,f),enabled:!!f,staleTime:300*1e3}),h=m?.model,g=H(()=>({query:L(`query`).icon,row_count:L(`row_count`).icon,row_count_diff:L(`row_count_diff`).icon,profile:L(`profile`).icon,profile_diff:L(`profile_diff`).icon,query_diff:L(`query_diff`).icon,value_diff:L(`value_diff`).icon,top_k_diff:L(`top_k_diff`).icon,histogram_diff:L(`histogram_diff`).icon,schema_diff:L(`schema_diff`).icon,sandbox:L(`sandbox`).icon}),[]),_=Wt(Object.keys(h?.base?.columns??{}),Object.keys(h?.current?.columns??{})),v=H(()=>_.length?`select \n ${_.join(`
@@ -9,4 +9,4 @@ import{$ as e,A as t,D as n,G as r,J as i,K as a,M as o,N as s,O as c,R as l,S a
9
9
  ${Ac(e)}
10
10
 
11
11
  </details>`}function Ac(e){let t=We({description:e.description});if(e.type===`query`||e.type===`query_diff`){let n=e.params;return`${t}\n\n${z({sql:n&&`sql_template`in n?n.sql_template:``})}`}return t}const jc=()=>{let e=jn(),t=xi(),{apiClient:n}=B(),{basePath:r}=me(),{mutate:i,isPending:a}=kn({mutationFn:()=>y({select:`state:modified`},n),onSuccess:async n=>{await e.invalidateQueries({queryKey:j.checks()}),t.push(`${r}/checks/?id=${n.check_id}`)}});return G(Qe,{title:`No checks yet`,description:`Checks help you validate data quality and catch issues.`,icon:G(Ci,{size:48}),actionText:`Create Schema Diff Check`,onAction:()=>{i()},isLoading:a,helperText:`The schema checks compare modified models between environments to detect changes, additions, or removals.`})},Mc=({check:e,selected:t,onSelect:n,onApprovalChange:r})=>{let{featureToggles:i}=Ce(),a=e.last_run?.run_id,{run:o}=vt(a),s=ze({type:e.type,hasResult:!!o?.result,hasError:!!o?.error}),c=s||i.disableUpdateChecklist;return G(Ee,{check:{id:e.check_id,name:e.name,type:e.type,isApproved:e.is_checked,runStatus:(()=>{if(o){if(o.error)return`error`;if(o.result)return`success`}})(),isPreset:e.is_preset,isOutdated:e.is_outdated,lastRunAt:e.last_run?.run_at,actorType:e.actor_type},isSelected:t,onClick:n,onApprovalChange:r,disableApproval:c,disabledApprovalTooltip:s?`Run the check first`:void 0})},Nc=({checks:e,selectedItem:t,onCheckSelected:n,onChecksReordered:r})=>{let[i,a]=U(!1),[s,c]=U(!1),[l,u]=U(null),d=jn(),{apiClient:f}=B(),{mutate:p}=kn({mutationFn:({checkId:e,isChecked:t})=>o(e,{is_checked:t},f),onSuccess:async(e,{checkId:t})=>{await d.invalidateQueries({queryKey:j.check(t)}),await d.invalidateQueries({queryKey:j.checks()})}}),m=e=>{e.destination&&r(e.source.index,e.destination.index)},h=()=>c(!0),g=()=>{c(!1),u(null)},_=()=>{Vt.create({title:`Marked as approved`,type:`success`,duration:2e3})},v=(e,t)=>{t?localStorage.getItem(`bypassMarkAsApprovedWarning`)===`true`?(p({checkId:e,isChecked:!0}),_()):(u(e),h()):p({checkId:e,isChecked:!1})};return K(W,{children:[G(ia,{onDragEnd:m,children:G(oa,{droppableId:`checklist`,children:r=>K(Y,{...r.droppableProps,ref:r.innerRef,className:`no-track-pii-safe`,sx:{width:`100%`,flex:1,overflow:`auto`},spacing:0,children:[e.map((e,r)=>G(aa,{draggableId:e.check_id,index:r,children:(r,i)=>{let a=r.draggableProps.style;if(i.isDragging&&a&&`left`in a){let e={x:0,y:80};a={...a,left:a.left-e.x,top:a.top-e.y}}return G(q,{ref:r.innerRef,...r.draggableProps,...r.dragHandleProps,style:a,sx:{borderBottom:`1px solid`,borderColor:`divider`,width:`100%`},children:G(Mc,{check:e,selected:e.check_id===t,onSelect:n,onApprovalChange:v},e.check_id)})}},e.check_id)),r.placeholder]})})}),K(Vn,{open:s,onClose:g,maxWidth:`xs`,fullWidth:!0,children:[K(Wn,{sx:{display:`flex`,alignItems:`center`},children:[`Mark as Approved?`,G(q,{sx:{flexGrow:1}}),G(Z,{size:`small`,onClick:g,children:G(er,{})})]}),G(rr,{}),K(Un,{sx:{fontSize:`0.875rem`},children:[G(X,{children:`Please ensure you have reviewed the contents of this check before marking it as approved.`}),G(Zr,{control:G(Xr,{checked:i,onChange:e=>{a(e.target.checked)},size:`small`}),label:G(X,{sx:{fontWeight:`bold`,pt:`8px`},children:`Don't show this again`})})]}),G(rr,{}),K(Hn,{sx:{gap:0},children:[G(J,{variant:`outlined`,size:`small`,onClick:g,children:`Cancel`}),G(J,{color:`iochmara`,variant:`contained`,size:`small`,onClick:()=>{l&&(p({checkId:l,isChecked:!0}),i&&localStorage.setItem(`bypassMarkAsApprovedWarning`,`true`),_(),g(),u(null))},children:`Mark as approved`})]})]})]})},Pc=()=>{let e=Xn().palette.mode===`dark`?`grey.700`:`grey.300`,t=xi(),n=Si().get(`id`),{latestSelectedCheckId:r,setLatestSelectedCheckId:i}=Be(),a=jn(),{apiClient:o}=B(),{basePath:s}=me(),c=n;Ln(()=>{c&&i(c)},[c,i]);let{isLoading:l,error:u,data:d,status:f,refetch:p}=An({queryKey:j.checks(),queryFn:()=>S(o),refetchOnMount:!0}),m=V(e=>{t.push(`${s}/checks/?id=${e}`)},[t.push,s]),[h,g]=U(d??[]),[_,v]=U(d);d!==_&&(v(d),g(d??[]));let{mutate:y}=kn({mutationFn:e=>x(e,o),onSuccess:async()=>{await a.invalidateQueries({queryKey:j.checks()})}}),b=V((e,t)=>{let n=[...h],[r]=n.splice(e,1);n.splice(t,0,r),y({source:e,destination:t}),g(n)},[h,y]),C=H(()=>!!(c&&d?.some(e=>e.check_id===c)),[c,d]);return Ln(()=>{f!==`success`||d.length===0||C||(r&&d.some(e=>e.check_id===r)?t.replace(`${s}/checks/?id=${r}`):t.replace(`${s}/checks/?id=${d[0].check_id}`))},[f,C,d,r,t.replace,s]),l?null:u?K(q,{children:[`Error: `,G(`span`,{className:`no-track-pii-safe`,children:u.message})]}):d?.length?K(at,{style:{height:`100%`},minSize:50,sizes:[20,80],children:[G(q,{sx:{height:`100%`},style:{contain:`size`},children:K(Y,{sx:{height:`100%`,alignItems:`stretch`},style:{contain:`strict`},spacing:0,children:[G(q,{sx:{display:`flex`,justifyContent:`flex-end`,p:`0px 10px`},children:G(Sc,{checksOnly:!0})}),G(rr,{}),G(Nc,{checks:h,selectedItem:c,onCheckSelected:m,onChecksReordered:b})]})}),G(q,{sx:{height:`100%`},children:C&&c&&G(Oc,{checkId:c,refreshCheckList:p},c)})]}):K(at,{style:{height:`100%`},minSize:50,sizes:[20,80],children:[G(q,{sx:{borderRight:`1px solid`,borderRightColor:e,height:`100%`},style:{contain:`size`},children:K(Y,{sx:{height:`100%`,alignItems:`stretch`},style:{contain:`strict`},spacing:0,children:[G(q,{sx:{display:`flex`,justifyContent:`flex-end`,p:`0px 10px`},children:G(Sc,{checksOnly:!0})}),G(rr,{}),G(q,{sx:{height:`100%`,display:`flex`,justifyContent:`center`,alignItems:`center`},children:G(q,{sx:{textAlign:`center`,color:`grey.500`},children:`No checks`})})]})}),G(q,{children:G(q,{sx:{height:`100%`,display:`flex`,justifyContent:`center`,alignItems:`center`},children:G(jc,{})})})]})},Fc=()=>K(at,{style:{height:`100%`},minSize:50,sizes:[20,80],children:[G(q,{sx:{borderRight:`1px solid`,borderRightColor:Xn().palette.mode===`dark`?`grey.700`:`grey.300`,height:`100%`},style:{contain:`size`},children:G(q,{sx:{height:`100%`,display:`flex`,justifyContent:`center`,alignItems:`center`},children:G(ir,{size:20})})}),G(q,{children:G(q,{sx:{height:`100%`,display:`flex`,justifyContent:`center`,alignItems:`center`},children:G(ir,{size:20})})})]}),Ic={added:[`Model Added`,`Added resource`],removed:[`Model Removed`,`Removed resource`],modified:[`Model Modified`,`Modified resource`],col_added:[`Column Added`,`Added column`],col_removed:[`Column Removed`,`Removed column`],col_changed:[`Column Modified`,`Modified column`],folder_changed:[`Modified`,`Modified folder`]};function Lc(e){let t=String(Te(`colors.green.solid`)),n=String(Te(`colors.red.solid`)),r=String(Te(`colors.amber.emphasized`));return e===`added`?{color:t,icon:et}:e===`removed`?{color:n,icon:rt}:e===`modified`?{color:r,icon:Pt}:e===`col_added`?{color:t,icon:et}:e===`col_removed`?{color:n,icon:rt}:e===`col_changed`?{color:r,icon:Pt}:e===`folder_changed`?{color:r,icon:Ot}:{color:`inherit`,icon:void 0}}function Rc(e,t){let n=0,r=0,i=0;return!e&&!t?{adds:n,removes:r,modifies:i}:(t&&Object.keys(t.columns??{}).forEach(t=>{e?.columns?.[t]||n++}),e&&Object.keys(e.columns??{}).forEach(e=>{t?.columns?.[e]||r++}),t&&e&&Object.keys(t.columns??{}).forEach(n=>{e.columns&&t.columns?.[n]&&e.columns[n]&&e.columns[n].type!==t.columns[n].type&&i++}),{adds:n,removes:r,modifies:i})}function zc(e){let t=e.modifiedSet,n=0,r=0,i=0,a=0,o=0,s=0;return t.forEach(t=>{e.nodes[t].data.changeStatus===`added`?n++:e.nodes[t].data.changeStatus===`removed`?r++:e.nodes[t].data.changeStatus===`modified`&&i++;let c=e.nodes[t].data.change?.columns;if(c)for(let e of Object.values(c))e===`added`?a++:e===`removed`?o++:e===`modified`&&s++}),{adds:n,removes:r,modifies:i,col_added:a,col_removed:o,col_changed:s}}function Bc({name:e,value:t,tip:n}){return K(Y,{sx:{alignItems:`stretch`},children:[K(X,{sx:{fontSize:`0.875rem`,color:`grey.600`},children:[e,n&&G(Q,{title:n,children:G(q,{sx:{display:`inline-block`},children:G(q,{component:ki,sx:{mx:`2px`,fontSize:12,verticalAlign:`middle`}})})})]}),t]})}function Vc({changeStatus:e,value:t}){let[n]=e?Ic[e]:[``],{icon:r,color:i}=Lc(e);return K(Y,{sx:{alignItems:`stretch`},children:[K(Y,{direction:`row`,sx:{alignItems:`center`,fontSize:`0.875rem`,color:`grey.600`},children:[r&&G(q,{component:r,sx:{mr:`5px`,color:i,fontSize:`1rem`}}),n]}),G(X,{sx:{fontSize:`0.875rem`},children:t})]})}function Hc({lineageGraph:e}){let{adds:t,removes:n,modifies:r,col_added:i,col_removed:a,col_changed:o}=zc(e);return K(ta,{container:!0,sx:{mb:`10px`,borderTop:`1px solid`,borderColor:`divider`,p:`2.5vw`},children:[G(ta,{size:6,sx:{borderColor:`divider`},children:G(Bc,{name:`Code Changes`,value:K(ta,{container:!0,sx:{width:`100%`},children:[G(ta,{size:4,children:G(Vc,{changeStatus:`added`,value:t})}),G(ta,{size:4,children:G(Vc,{changeStatus:`removed`,value:n})}),G(ta,{size:4,children:G(Vc,{changeStatus:`modified`,value:r})})]})})}),G(ta,{size:6,sx:{borderLeft:`1px solid`,borderLeftColor:`divider`,pl:`12px`},children:G(Bc,{name:`Column Changes`,value:K(ta,{container:!0,sx:{width:`100%`},children:[G(ta,{size:4,children:G(Vc,{changeStatus:`col_added`,value:i})}),G(ta,{size:4,children:G(Vc,{changeStatus:`col_removed`,value:a})}),G(ta,{size:4,children:G(Vc,{changeStatus:`col_changed`,value:o})})]})})})]})}function Uc({node:e,...t}){let{apiClient:n}=B(),{data:r,isLoading:i}=An({queryKey:[`modelDetail`,e.id],queryFn:()=>u(e.id,n),enabled:!!n,staleTime:300*1e3}),a=r?.model;return K(sa,{sx:{maxWidth:500},children:[G(la,{title:G(X,{sx:{fontSize:18,fontWeight:`bold`},children:t.title}),subheader:K(Y,{direction:`row`,spacing:`8px`,sx:{p:`16px`},children:[G(yt,{resourceType:e.data.resourceType,materialized:e.data.materialized}),e.data.resourceType===`model`&&G(Uo,{node:e})]})}),G(ca,{children:G(q,{sx:{display:`flex`},children:i?G(Hi,{variant:`rectangular`,width:`100%`,height:100}):G(Ro,{base:a?.base&&Object.keys(a.base).length>0?{id:e.id,unique_id:e.id,name:e.data.name,...a.base}:void 0,current:a?.current&&Object.keys(a.current).length>0?{id:e.id,unique_id:e.id,name:e.data.name,...a.current}:void 0,columnChanges:e.data.change?.columns})})})]})}function Wc(e){let t=[],n=e.nodes;return e.modifiedSet.forEach(e=>{let r=n[e];r.data.change?.columns&&Object.keys(r.data.change.columns).length>0&&t.push(r)}),t}function Gc({lineageGraph:e}){let[t,n]=U([]);return Ln(()=>{n(Wc(e))},[e]),K(W,{children:[G(q,{sx:{width:`100%`,pb:`10px`,mb:`20px`,mt:`20px`},children:G(X,{variant:`h5`,sx:{fontSize:24},children:`Schema Summary`})}),G(q,{sx:{width:`100%`,pb:`10px`,mb:`20px`},children:t.length===0?G(X,{sx:{fontSize:18,color:`grey.600`},children:`No schema changes detected.`}):G(q,{sx:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(400px, 1fr))`,gap:`2vw`,p:`2.5vw`,width:`100%`,bgcolor:`lightgray`},children:t.map(e=>G(Uc,{title:e.data.name,node:e},e.id))})})]})}function Kc({checks:e,isLoading:t,error:n,selectedCheckId:r,onCheckSelect:i,onApprovalChange:a,onAction:o,onReorder:s,onDescriptionChange:c,onNameChange:l,onCreateCheck:u,getCheckTabs:d,getPrimaryActions:f,getSecondaryActions:p,disableApproval:m=!1,disabledApprovalTooltip:h,height:g=`100%`,listPaneSize:_=30,minListSize:v=200,maxListSize:y=500,listTitle:b,className:x}){let S=R(),C=e??S.checks,w=t===void 0?S.isLoading:t,T=n??S.error,E=r??S.selectedCheckId,D=i??S.onSelectCheck,O=H(()=>C.map(e=>({id:e.check_id,name:e.name,type:e.type,description:e.description,isApproved:e.is_checked})),[C]),k=H(()=>C.find(e=>e.check_id===E),[C,E]),ee=V(e=>{D?.(e)},[D]),te=V((e,t)=>{o?.(e,t)},[o]),A=V(e=>{E&&c?.(E,e)},[E,c]),ne=V(e=>{E&&l?.(E,e)},[E,l]);if(w)return G(q,{className:x,sx:{width:`100%`,height:g,display:`flex`,alignItems:`center`,justifyContent:`center`},children:G(ir,{})});if(T)return G(q,{className:x,sx:{width:`100%`,height:g,display:`flex`,alignItems:`center`,justifyContent:`center`},children:G(X,{color:`error`,children:T})});if(C.length===0)return G(q,{className:x,sx:{width:`100%`,height:g,display:`flex`,alignItems:`center`,justifyContent:`center`},children:G(Qe,{title:`No checks yet`,description:`Create your first check to start validating your data.`,actionText:`Create Check`,onAction:u})});let re=k?d?.(k):void 0,ie=k?f?.(k):void 0,j=k?p?.(k):void 0;return G(q,{className:x,sx:{width:`100%`,height:g},children:K(Dt,{direction:`horizontal`,sizes:[_,100-_],minSizes:[v,200],maxSizes:[y,1/0],children:[G(q,{sx:{height:`100%`,overflow:`auto`},children:G(Re,{checks:O,selectedId:E,onCheckSelect:ee,onApprovalChange:a,onReorder:s,disableApproval:m,disabledApprovalTooltip:h,title:b})}),G(q,{sx:{height:`100%`,overflow:`auto`},children:k?G(Ze,{checkId:k.check_id,name:k.name,type:k.type,description:k.description,isApproved:k.is_checked,tabs:re,primaryActions:ie,secondaryActions:j,onAction:te,onDescriptionChange:A,onNameChange:ne}):G(q,{sx:{height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:G(X,{sx:{color:`text.secondary`},children:`Select a check from the list to view details`})})})]})})}const qc=Fn(Kc);qc.displayName=`ChecksView`;const Jc=`0.2.0`;export{Ya as A,zo as C,Do as D,Oo as E,da as F,qa as M,ha as N,To as O,fa as P,Ro as S,Mo as T,Us as _,zc as a,$o as b,Ic as c,Nc as d,jc as f,mc as g,yc as h,Hc as i,Ja as j,Za as k,Fc as l,bc as m,qc as n,Rc as o,Oc as p,Gc as r,Lc as s,Jc as t,Pc as u,Fs as v,Po as w,Fo as x,_s as y};
12
- //# sourceMappingURL=src-C1DeoO4F.js.map
12
+ //# sourceMappingURL=src-DJN3ojqS.js.map