@datarecce/ui 1.49.0 → 1.50.0-nightly.20260521
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/{RunProgress-BpuoxCQ2.d.ts → RunProgress-CtJBjBqh.d.ts} +2 -2
- package/dist/{RunProgress-BpuoxCQ2.d.ts.map → RunProgress-CtJBjBqh.d.ts.map} +1 -1
- package/dist/{SplitPane-g9BYPTwD.d.ts → SplitPane-DTMacnay.d.ts} +4 -7
- package/dist/SplitPane-DTMacnay.d.ts.map +1 -0
- package/dist/advanced.d.ts +8 -8
- package/dist/advanced.js +1 -1
- package/dist/advanced.js.map +1 -1
- package/dist/{api-ClOJriip.d.ts → api--n8qoyYH.d.ts} +2 -2
- package/dist/{api-ClOJriip.d.ts.map → api--n8qoyYH.d.ts.map} +1 -1
- package/dist/api-7U6SeSGl.js +3 -0
- package/dist/api-7U6SeSGl.js.map +1 -0
- package/dist/api.d.ts +3 -3
- package/dist/api.js +1 -1
- package/dist/components-run.d.ts +3 -3
- package/dist/components-run.js +1 -1
- package/dist/components.d.ts +8 -8
- package/dist/components.js +1 -1
- package/dist/contexts.d.ts +3 -3
- package/dist/hooks-DPUghTAA.js +7 -0
- package/dist/hooks-DPUghTAA.js.map +1 -0
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +1 -1
- package/dist/{index-DwA8G2G5.d.ts → index-C6ONGadE.d.ts} +8 -5
- package/dist/index-C6ONGadE.d.ts.map +1 -0
- package/dist/{index-CktB3OiK.d.ts → index-CicVOt6U.d.ts} +2 -2
- package/dist/{index-CktB3OiK.d.ts.map → index-CicVOt6U.d.ts.map} +1 -1
- package/dist/{index-DgCzHSWI.d.ts → index-CpMGCyel.d.ts} +9 -9
- package/dist/{index-DgCzHSWI.d.ts.map → index-CpMGCyel.d.ts.map} +1 -1
- package/dist/{index-BYRUZdPT.d.ts → index-DRdx1ka0.d.ts} +3 -3
- package/dist/{index-BYRUZdPT.d.ts.map → index-DRdx1ka0.d.ts.map} +1 -1
- package/dist/{index-BPpoSNPS.d.ts → index-_cRn1_LE.d.ts} +3 -4
- package/dist/{index-BPpoSNPS.d.ts.map → index-_cRn1_LE.d.ts.map} +1 -1
- package/dist/{index-CLBQlrI2.d.ts → index-rUB1icO3.d.ts} +3 -3
- package/dist/{index-CLBQlrI2.d.ts.map → index-rUB1icO3.d.ts.map} +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/index.js +1 -1
- package/dist/{instanceInfo-DblaeUS4.d.ts → instanceInfo-ONx18mFM.d.ts} +3 -13
- package/dist/{instanceInfo-DblaeUS4.d.ts.map → instanceInfo-ONx18mFM.d.ts.map} +1 -1
- package/dist/lib/api/track.d.ts +1 -12
- package/dist/lib/api/track.d.ts.map +1 -1
- package/dist/lib/api/track.js +1 -1
- package/dist/lib/api/track.js.map +1 -1
- package/dist/{lineage-C7C1IYts.d.ts → lineage-CuuoINxC.d.ts} +42 -41
- package/dist/lineage-CuuoINxC.d.ts.map +1 -0
- package/dist/{primitives-DZI0Q21v.d.ts → primitives-BenloJgH.d.ts} +2 -2
- package/dist/{primitives-DZI0Q21v.d.ts.map → primitives-BenloJgH.d.ts.map} +1 -1
- package/dist/primitives.d.ts +4 -4
- package/dist/primitives.js +1 -1
- package/dist/result.js +1 -1
- package/dist/src-DnHGbo7f.js +12 -0
- package/dist/src-DnHGbo7f.js.map +1 -0
- package/dist/{types-DQ-vcWQd.d.ts → types-Bb44bH3Q.d.ts} +2 -2
- package/dist/{types-DQ-vcWQd.d.ts.map → types-Bb44bH3Q.d.ts.map} +1 -1
- package/dist/{types-CjiRIU6e.d.ts → types-QIkU-j0Y.d.ts} +2 -2
- package/dist/{types-CjiRIU6e.d.ts.map → types-QIkU-j0Y.d.ts.map} +1 -1
- package/dist/types.d.ts +7 -7
- package/dist/utils.d.ts +1 -1
- package/package.json +1 -1
- package/dist/SplitPane-g9BYPTwD.d.ts.map +0 -1
- package/dist/api-Dh3uH2jm.js +0 -3
- package/dist/api-Dh3uH2jm.js.map +0 -1
- package/dist/hooks-CGdDPE14.js +0 -7
- package/dist/hooks-CGdDPE14.js.map +0 -1
- package/dist/index-DwA8G2G5.d.ts.map +0 -1
- package/dist/lineage-C7C1IYts.d.ts.map +0 -1
- package/dist/src-C3MKdhA3.js +0 -12
- package/dist/src-C3MKdhA3.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-DwA8G2G5.d.ts","names":[],"sources":["../src/components/lineage/LineageCanvas.tsx","../src/providers/contexts/CheckContext.tsx","../src/providers/contexts/QueryContext.tsx","../src/providers/contexts/RoutingContext.tsx","../src/providers/RecceProvider.tsx","../src/types/index.ts"],"mappings":";;;;;;;;;;UAsBiB,kBAAA;;EAEf,KAAA,EAAO,IAAA,CAAK,eAAA;;EAEZ,KAAA,EAAO,IAAA,CAAK,eAAA;;EAEZ,YAAA,IAAgB,MAAA;;EAEhB,iBAAA,IAAqB,MAAA;;EAErB,WAAA;;EAEA,YAAA;EAZiC;EAcjC,cAAA;EAZY;EAcZ,MAAA;EAZY;EAcZ,WAAA;EAMiB;EAJjB,OAAA;EAI+B;EAF/B,OAAA;EApBO;EAsBP,cAAA,GAAiB,cAAA;AAAA;AAAA,iBAYH,aAAA,CAAA;EACd,KAAA,EAAO,YAAA;EACP,KAAA,EAAO,YAAA;EACP,YAAA;EACA,iBAAA;EACA,WAAA;EACA,YAAA;EACA,cAAA;EACA,MAAA;EACA,WAAA;EACA,OAAA;EACA,OAAA;EACA;AAAA,GACC,kBAAA,GAAkB,oBAAA,CAAA,GAAA,CAAA,OAAA;;;UCnEJ,KAAA;EACf,QAAA;EACA,IAAA;EACA,IAAA;EACA,WAAA;EACA,UAAA;AAAA;AAAA,UAGe,gBAAA;EACf,MAAA,EAAQ,KAAA;EACR,SAAA;EACA,KAAA;EACA,eAAA;EACA,aAAA,IAAiB,OAAA;EACjB,aAAA,IAAiB,KAAA,EAAO,OAAA,CAAQ,KAAA,MAAW,OAAA,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,aAAA,GAAgB,kBAAA,mBH3ID;IG6If,eAAA,GAAkB,kBAAA,qBH7I+B;IG+IjD,aAAA;EAAA;EH9IyC;;;;EGqJ3C,KAAA;IHpJA,wBGsJE,GAAA,WHtJmC;IGwJnC,WAAA,YHvJiB;IGyJjB,KAAA,WHzJ4D;IG2J5D,UAAA,GAAa,WAAA,EHtJf;IGwJE,aAAA,GAAgB,WAAA,EHtJU;IGwJ1B,WAAA,GAAc,kBAAA,iBHxJ2B;IG0JzC,SAAA,GAAY,kBAAA,eH/ImB;IGiJ/B,QAAA,GAAW,kBAAA;EAAA;EH/IJ;;;;EGsJT,QAAA;IHhJmD,2EGkJjD,cAAA,YHlJoE;IGoJpE,iBAAA,YHnJmC;IGqJnC,aAAA,YHpJmE;IGsJnE,gBAAA,YH/JF;IGiKE,YAAA,YHhKF;IGkKE,WAAA;EAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AHhJJ;;;;;;;;;;;;;;;;;;;;iBGoNgB,aAAA,CAAA;EACd,QAAA;EACA,GAAA;EACA,KAAA;EACA,OAAA;EACA,WAAA,EAAa,iBAAA;EACb,UAAA;EACA,OAAA;EACA,MAAA;EACA,KAAA;EACA;AAAA,GACC,kBAAA,GAAkB,OAAA,CAAA,YAAA,mBAAA,OAAA,CAAA,qBAAA;;;cCtRR,iBAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lineage-C7C1IYts.d.ts","names":[],"sources":["../src/components/lineage/computeColumnLineage.ts","../src/components/lineage/config/zoomConstants.ts","../src/components/lineage/LineageTabContent.tsx","../src/components/app/EnvInfo.tsx","../src/components/app/MainLayout.tsx","../src/components/check/CheckDetailOss.tsx","../src/components/check/CheckEmptyStateOss.tsx","../src/components/check/CheckListOss.tsx","../src/components/check/CheckPageContentOss.tsx","../src/components/check/CheckPageLoadingOss.tsx","../src/components/errorboundary/ErrorBoundary.tsx","../src/components/histogram/HistogramDiffForm.tsx","../src/components/histogram/HistogramResultView.tsx","../src/components/lineage/LineagePageOss.tsx","../src/components/lineage/NodeTag.tsx","../src/components/lineage/NodeView.tsx","../src/components/lineage/styles.tsx","../src/components/notifications/LineageViewNotification.tsx","../src/components/onboarding-guide/Notification.tsx","../src/components/profile/ProfileDiffForm.tsx","../src/components/profile/ProfileResultView.tsx","../src/components/query/QueryDiffResultView.tsx","../src/components/query/QueryForm.tsx","../src/components/query/QueryPageOss.tsx","../src/components/query/QueryResultView.tsx","../src/components/query/SetupConnectionGuide.tsx","../src/components/query/SqlEditor.tsx","../src/components/rowcount/RowCountResultView.tsx","../src/components/schema/ColumnNameCell.tsx","../src/components/schema/SchemaView.tsx","../src/components/shared/HistoryToggle.tsx","../src/components/summary/types.ts","../src/components/summary/ChangeSummary.tsx","../src/components/summary/SchemaSummary.tsx","../src/components/summary/utils.ts","../src/components/timeout/IdleTimeoutBadge.tsx","../src/components/top-k/TopKDiffForm.tsx","../src/components/top-k/TopKDiffResultView.tsx","../src/components/ui/DataTypeIcon/classifyType.ts","../src/components/ui/DataTypeIcon/tooltipText.ts","../src/components/ui/DataTypeIcon/index.tsx","../src/components/ui/SquareIcon.tsx","../src/components/valuediff/ValueDiffDetailResultView.tsx","../src/components/valuediff/ValueDiffForm.tsx","../src/components/valuediff/ValueDiffResultView.tsx","../src/components/views/ChecksView.tsx","../src/providers/contexts/ThemeContext.tsx","../src/index.ts","../src/components/lineage/lineage.ts"],"mappings":";;;;;;;;;;;;;;;;;;UAEiB,gBAAA;EACf,MAAA;EACA,UAAA;EACA,kBAAA;EACA,YAAA;AAAA;;;;;;;;;;;;;;;;;;;cCWW,gBAAA;;cAGA,gBAAA;;cAGA,gBAAA;;cAGA,UAAA;;;UCiDI,sBAAA;EACf,IAAA,EAAM,gBAAA;;EAEN,SAAA,GAAY,MAAA,SAAe,gBAAA;;EAE3B,UAAA,IAAc,MAAA;;EAEd,MAAA;;EAEA,aAAA;;EAEA,YAAA;;EAEA,eAAA,IAAmB,KAAA;;;;;EAKnB,g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AAQ,UAAA;EACR,SAAA,EAAW,aAAA;EACX,KAAA,EAAO,SAAA;EACP,eAAA,EAAiB,mBAAA;EACjB,aAAA,EAAe,iBAAA;EACf,gBAAA;EACA,QAAA;EACA,SAAA;EACA,mBAAA;EACA,YAAA;EACA,aAAA;EACA,YAAA;EACA,iBAAA;EACA,mBAAA;EACA,eAAA;EACA,uBAAA;EACA,MAAA;EACA,YAAA;EACA,WAAA;EACA,WAAA;EACA,SAAA;EACA;AAAA,GACC,eAAA,GAAe,oBAAA,CAAA,GAAA,CAAA,OAAA;;;;cAuML,UAAA,EAAU,OAAA,CAAA,mBAAA,QAAA,mBAAA;;;;;;KC/YlB,SAAA;;;;UAKK,iBAAA;EACR,IAAA,EAAM,SAAA;EACN,YAAA;EACA,OAAA,GAAU,IAAA,EAAM,SAAA;AAAA;;;;;;iBAWF,aAAA,CAAA,GAAiB,iBAAA;;;cC7BpB,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;iBCoCG,WAAA,CACd,YAAA,EAAc,YAAA,EACd,OAAA;EACE,aAAA;EACA,GAAA,GAAM,iBAAA;EACN,iBAAA,GAAoB,GAAA;IAAc,CAAA;IAAW,CAAA;EAAA;EAC7C,gBAAA;EACA,cAAA,GAAiB,GAAA,SAAY,gBAAA;AAAA,KAE7B,iBAAA,IAAqB,gBAAA,IAAoB,gBAAA;;;;;A/C/B7C;;;;;AAGA;c+CqUa,MAAA,GACX,KAAA,EAAO,iBAAA,IACP,KAAA,EAAO,gBAAA,IACP,SAAA"}
|
package/dist/src-C3MKdhA3.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{A as e,B as t,E as n,F as r,J as i,K as a,M as o,N as s,P as c,Q as l,S as u,T as d,X as f,a as p,c as m,d as h,dt as g,gt as _,h as v,it as y,j as b,k as x,l as S,m as C,n as w,nt as T,o as E,ot as D,p as O,q as k,s as ee,tt as A,u as te,vt as ne,w as re,x as ie,yt as j}from"./api-Dh3uH2jm.js";import{c as ae,f as M}from"./keepAlive-DbC0X4zr.js";import{n as oe,r as se,t as ce}from"./fetchClient-BVyYwVMf.js";import{C as N,O as P,T as le,_ as F,a as ue,b as de,d as fe,f as pe,g as me,h as he,j as ge,k as _e,l as ve,m as ye,o as be,p as xe,s as Se,u as Ce,v as we,w as Te,y as Ee}from"./utils-COgjW7er.js";import{i as De,n as Oe}from"./colors-BbPSDR1X.js";import{$ as ke,$t as Ae,A as je,An as Me,Bt as I,C as Ne,Cn as Pe,D as Fe,Dn as Ie,E as Le,En as Re,F as L,Fn as ze,Ft as Be,Ht as R,In as Ve,It as He,Jt as Ue,Nt as We,O as Ge,On as Ke,Pt as qe,Qt as Je,Rn as Ye,Rt as Xe,S as Ze,Sn as Qe,Tn as $e,Ut as et,Vt as tt,Xt as nt,Yt as rt,Zt as it,_n as at,_t as ot,a as st,an as ct,b as lt,bn as ut,cn as dt,ct as ft,d as pt,dt as mt,f as ht,gn as gt,hn as _t,ht as vt,i as yt,in as bt,jt as xt,k as St,kn as Ct,l as wt,lt as Tt,n as Et,nn as Dt,o as Ot,qt as kt,rn as At,sn as jt,st as Mt,t as Nt,tn as Pt,u as Ft,vn as It,vt as Lt,w as Rt,wn as zt,xn as Bt,yn as Vt,z,zn as Ht,zt as Ut}from"./hooks-CGdDPE14.js";import{Ft as Wt,Pt as Gt,a as Kt,ct as qt,dt as Jt,i as Yt,m as Xt,o as Zt,r as Qt,s as $t,t as en}from"./utils-Cpt1f5aU.js";import{fetchGitHubAvatar as tn,fetchUser as nn}from"./lib/api/user.js";import{PUBLIC_API_URL as rn,PUBLIC_CLOUD_WEB_URL as an,RECCE_SUPPORT_CALENDAR_URL as on}from"./lib/const.js";import{EXPLORE_ACTION as sn,EXPLORE_SOURCE as cn,trackArtifactUploadStarted as ln,trackColumnLevelLineage as un,trackCopyToClipboard as dn,trackDwSetupCompleted as fn,trackDwSetupShown as pn,trackDwSetupSkipped as mn,trackEnvironmentConfig as hn,trackExploreAction as gn,trackHistoryAction as _n,trackInit as vn,trackLineageSelection as yn,trackLineageViewRender as bn,trackMultiNodesAction as xn,trackNavigation as Sn,trackOssShareButtonClicked as Cn,trackPreviewChange as wn,trackPreviewChangeFeedback as Tn,trackRedirectToCloudSession as En,trackSignupCompleted as Dn,trackSignupRedirectInitiated as On,trackSingleEnvironment as kn,trackStateAction as An}from"./lib/api/track.js";import{t as jn}from"./constants-D-hOGDbU.js";import{QueryClient as Mn,QueryClientProvider as Nn,useMutation as Pn,useQuery as Fn,useQueryClient as In}from"@tanstack/react-query";import{Suspense as Ln,createContext as Rn,forwardRef as zn,memo as Bn,useCallback as B,useContext as Vn,useEffect as V,useImperativeHandle as Hn,useLayoutEffect as Un,useMemo as H,useRef as Wn,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 Gn from"@mui/material/Dialog";import Kn from"@mui/material/DialogActions";import qn from"@mui/material/DialogContent";import Jn from"@mui/material/DialogTitle";import Yn from"@mui/material/Link";import Y from"@mui/material/Stack";import X from"@mui/material/Typography";import Xn from"js-cookie";import{LuExternalLink as Zn,LuSave as Qn}from"react-icons/lu";import{alpha as $n,useTheme as er}from"@mui/material/styles";import{useTheme as tr}from"next-themes";import Z from"@mui/material/IconButton";import nr from"next/link";import{IoBookmarksOutline as rr,IoClose as ir,IoSync as ar,IoWarning as or}from"react-icons/io5";import sr from"@mui/material/Divider";import cr from"@mui/material/CircularProgress";import Q from"@mui/material/Tooltip";import{FaCloud as lr,FaExpandArrowsAlt as ur,FaGithub as dr,FaQuestionCircle as fr,FaRegDotCircle as pr,FaSlack as mr,FaUser as hr}from"react-icons/fa";import{PiBookmarkSimple as gr,PiCaretDown as _r,PiChatText as vr,PiCheckCircle as yr,PiCircle as br,PiCopy as xr,PiExport as Sr,PiInfo as Cr,PiInfoFill as wr,PiMoon as Tr,PiNotePencil as Er,PiPencil as Dr,PiPencilSimple as Or,PiPlusCircle as kr,PiRepeat as Ar,PiSun as jr,PiTrashFill as Mr,PiTrashSimple as Nr,PiUserPlus as Pr,PiX as Fr}from"react-icons/pi";import Ir from"@mui/material/Chip";import{Background as Lr,BackgroundVariant as Rr,BaseEdge as zr,ControlButton as Br,Controls as Vr,MiniMap as Hr,Panel as Ur,Position as Wr,ReactFlow as Gr,ReactFlowProvider as Kr,getBezierPath as qr,getNodesBounds as Jr,useEdgesState as Yr,useNodesState as Xr,useReactFlow as Zr,useStore as Qr}from"@xyflow/react";import $r from"file-saver";import ei from"@mui/material/Checkbox";import ti from"@mui/material/FormControlLabel";import ni from"@mui/material/Alert";import ri from"@mui/material/InputBase";import ii from"@mui/material/Menu";import $ from"@mui/material/MenuItem";import{isEmpty as ai}from"lodash";import{VscCircleLarge as oi,VscFeedback as si,VscGitPullRequest as ci,VscHistory as li,VscKebabVertical as ui}from"react-icons/vsc";import di from"@mui/material/ListSubheader";import fi from"@mui/material/FormControl";import pi from"@mui/material/TextField";import{format as mi,formatDistanceToNow as hi,parseISO as gi}from"date-fns";import _i from"@mui/material/Tab";import vi from"@mui/material/Tabs";import yi from"@mui/material/List";import bi from"@mui/material/ListItem";import"@xyflow/react/dist/style.css";import{Box as xi,Typography as Si}from"@mui/material";import Ci from"@mui/material/Avatar";import wi from"@mui/material/Popover";import{usePathname as Ti,useRouter as Ei,useSearchParams as Di}from"next/navigation";import{MdArrowBack as Oi,MdArrowDownward as ki,MdArrowUpward as Ai,MdGpsFixed as ji,MdInfo as Mi,MdSearch as Ni}from"react-icons/md";import{TbChecklist as Pi,TbEdit as Fi}from"react-icons/tb";import Ii from"@mui/material/ListItemIcon";import Li from"@mui/material/ListItemText";import{FiArrowRight as Ri,FiCopy as zi,FiInfo as Bi,FiPackage as Vi}from"react-icons/fi";import Hi from"@mui/material/Switch";import{RiArrowDownSFill as Ui,RiArrowUpSFill as Wi,RiMindMap as Gi,RiSwapLine as Ki,RiTerminalBoxLine as qi}from"react-icons/ri";import{FaBookmark as Ji,FaFileImport as Yi}from"react-icons/fa6";import{BiArrowFromBottom as Xi,BiArrowToBottom as Zi}from"react-icons/bi";import Qi from"@dagrejs/dagre";import $i from"@mui/material/Skeleton";import{AiOutlineExperiment as ea}from"react-icons/ai";import ta from"@mui/material/Radio";import na from"@mui/material/RadioGroup";import ra from"@mui/material/Table";import ia from"@mui/material/TableBody";import aa from"@mui/material/TableCell";import oa from"@mui/material/TableContainer";import sa from"@mui/material/TableHead";import ca from"@mui/material/TableRow";import la from"@mui/material/InputLabel";import ua from"@mui/material/Select";import da from"@mui/material/Badge";import fa from"@mui/material/Grid";import{stripIndents as pa}from"common-tags";import{IoMdCodeWorking as ma}from"react-icons/io";import{DragDropContext as ha,Draggable as ga,Droppable as _a}from"@hello-pangea/dnd";import va from"@mui/material/Card";import ya from"@mui/material/CardContent";import ba from"@mui/material/CardHeader";const xa=Rn(null);xa.displayName=`RecceRoutingContext`;function Sa(){return Vn(xa)||{basePath:``,buildPath:e=>e,pathname:``,navigate:e=>{typeof window<`u`&&(window.location.href=e)}}}function Ca(){let{pathname:e,navigate:t}=Sa();return[e,t]}function wa({children:e,config:t}){let n=t?.basePath??``,r=t?.pathname??``,i=t?.onNavigate,a=B(e=>n?`${n}${e.startsWith(`/`)?e:`/${e}`}`:e,[n]),o=B((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(xa.Provider,{value:s,children:e})}const Ta=e=>new Mn({defaultOptions:{queries:{staleTime:e?.staleTime??1e3*60,gcTime:e?.gcTime??1e3*60*5,retry:1,refetchOnWindowFocus:!1}}});function Ea({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(()=>Ta({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(wa,{config:r,children:y}),y=G(Wt,{defaultMode:n,children:y}),y=G(ae,{config:t,children:y}),y=G(Nn,{client:f,children:y}),v&&(y=G(Ve,{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(Ye,{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(P,{onRunAction:a?.onRunAction,onShowRunId:a?.onShowRunId,initialRunId:a?.initialRunId,initialHistoryOpen:a?.initialHistoryOpen,children:y})),h&&(y=G(me,{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(Ee,{children:y})),p&&(y=G(N,{children:y})),y}function Da({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(sr,{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 Oa=({lineageGraph:e,cllInput:t,onCenterNode:n})=>{let r={cursor:`pointer`,fontFamily:`monospace`,bgcolor:Gt()?`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]})]})},ka=({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(pr,{}),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(Oa,{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:Cr,sx:{color:`error.main`,fontSize:`14px`}})})}),e.isPending?G(cr,{size:12,sx:{ml:`2px`}}):G(Z,{size:`small`,sx:{ml:`2px`},"aria-label":`Reset Column Level Lineage`,onClick:()=>{s()},children:G(Fr,{size:`10px`})})]})]})};function Aa({onClose:e}){let{cancel:t,actionState:n}=he();return G(Da,{actionState:n,onCancel:t,onClose:e})}const ja=({action:e})=>{let{showColumnLevelLineage:t,resetColumnLevelLineage:n,interactive:r,viewOptions:i,centerNode:a,setChangeAnalysisMode:o,newCllExperience:s,changeAnalysisMode:c}=he(),{data:l}=Ce(),u=l?.single_env_onboarding??!1,{lineageGraph:d,isActionAvailable:f}=F();return G(ka,{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 Ma(e){let{id:t,data:n}=e,{id:r}=n.node,{column:i,type:a,transformationType:o,changeStatus:s,isImpacted:c}=n,l=Qr(e=>e.transform[2]>.3),{isDark:u}=Nt(),{viewOptions:d,showContextMenu:f,isNodeHighlighted:p,isNodeShowingChangeAnalysis:m,newCllExperience:h}=he(),g=d.column_level_lineage?.node_id,_=i===d.column_level_lineage?.column&&r===g,v=p(t),y=m(r);return G(_t,{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 Na=Bn(Ma);Na.displayName=`GraphColumnNode`;function Pa(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=$e(d.changeStatus).hexColor,p.strokeDasharray=`5`),!f||f(t,n)||(p.filter=Ie);let[m]=qr({sourceX:r,sourceY:i,sourcePosition:s,targetX:a,targetY:o,targetPosition:c});return G(W,{children:G(zr,{path:m,markerEnd:u,style:{...p,...l}})})}const Fa=Bn(Pa);Fa.displayName=`GraphEdge`;function Ia(e){let{isEdgeHighlighted:t}=he();return G(Fa,{...e,isEdgeHighlighted:t})}const La=()=>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`})}),Ra=()=>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 za({skipReason:e}){return G(Ir,{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(La,{})})})]}),sx:{bgcolor:`grey.100`}})}function Ba({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(Ra,{})})})]})}function Va({result:e}){let{mismatchedColumns:t}=e,n=t>0;return G(Ir,{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 Ha({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(Ir,{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 Ua({status:e,skipReason:t,errorMessage:n,progress:r,valueDiffResult:i,rowCountDiffResult:a,runId:o,"data-testid":s}){return e===`pending`?G(cr,{size:16,"data-testid":s,"data-status":`pending`}):e===`skipped`?G(q,{"data-testid":s,"data-status":`skipped`,children:G(za,{skipReason:t})}):e===`running`?r?.percentage===void 0?G(cr,{size:16,"data-testid":s,"data-status":`running`}):G(cr,{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(Ba,{errorMessage:n})}):i?G(q,{"data-testid":s,"data-status":`success`,children:G(Va,{result:i})}):a?G(q,{"data-testid":s,"data-status":`success`,children:G(Ha,{result:a})}):G(q,{"data-testid":s,"data-status":`success`,children:o||`Complete`})}const Wa=Bn(Ua);Wa.displayName=`ActionTag`;const Ga={success:`#059669`,failure:`#ef4444`,error:`#ef4444`,warning:`#f59e0b`},Ka={success:`PASSED`,failure:`FAILED`,error:`ERROR`,warning:`WARNING`};function qa(e){return Ga[e]??`#6b7280`}function Ja(e){return Ka[e]??e.toUpperCase()}function Ya({run:e,index:t,onClick:n}){let r=qa(e.status),i=Ja(e.status),a=hi(new Date(e.run_at),{addSuffix:!0}),o=!!n;return K(xi,{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(Si,{variant:`body2`,sx:{fontWeight:600,fontSize:`0.75rem`},children:[`Run #`,t,` — `,i,e.triggered_by===`recce_ai`&&G(Si,{component:`span`,sx:{ml:.75,fontSize:`0.65rem`,fontWeight:500,color:`#7c3aed`},children:`by AI`})]}),e.summary&&G(Si,{variant:`body2`,sx:{color:`text.secondary`,fontSize:`0.7rem`,mt:.25},children:e.summary}),G(Si,{variant:`body2`,sx:{color:`text.secondary`,fontSize:`0.65rem`,mt:.25},children:a})]})}function Xa({event:e}){let n=t(e),r={create:kr,comment:vr,approve:yr,unapprove:br,edit:Er,preset:gr},i={create:`primary.main`,comment:`grey.500`,approve:`success.main`,unapprove:`grey.400`,edit:`warning.main`,preset:`secondary.main`},a=r[n],o=i[n];return G(q,{component:a,sx:{color:o,fontSize:16}})}function Za({event:e}){let{actor:t}=e,{avatarUrl:n}=Ut({userId:t.user_id}),r=(t.fullname||t.login||`User`).charAt(0).toUpperCase();return G(Ci,{src:n||void 0,sx:{width:24,height:24,fontSize:`0.75rem`},children:r})}function Qa({event:e}){let{actor:t}=e,n=t.fullname||t.login||`Someone`,r=hi(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(Xa,{event:e})}),G(q,{sx:{flex:1},children:K(Y,{direction:`row`,spacing:.5,sx:{flexWrap:`wrap`,alignItems:`center`},children:[G(Za,{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 $a({event:e,currentUserId:t,onEdit:n,onDelete:r}){let i=Gt(),[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=hi(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(Xa,{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(Xa,{event:e})}),K(q,{sx:{flex:1},children:[K(Y,{direction:`row`,spacing:.5,sx:{flexWrap:`wrap`,alignItems:`center`,mb:.5},children:[G(Za,{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(pi,{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(mt,{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(Or,{})})}),r&&K(W,{children:[G(Q,{title:`Delete comment`,children:G(Z,{"aria-label":`Delete comment`,size:`small`,color:`error`,onClick:w,children:G(Nr,{})})}),G(wi,{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 eo({event:e,currentUserId:t,onEdit:n,onDelete:r}){return e.event_type===`comment`?G($a,{event:e,currentUserId:t,onEdit:n,onDelete:r}):G(Qa,{event:e})}function to(e,t){let n=e?.toLowerCase();return n===`finished`?t?`error`:`success`:n===`failed`?`error`:e??`unknown`}function no(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 ro({checkId:e}){let t=Gt(),{apiClient:n,authToken:r}=I(),{events:i,isLoading:a,error:o,createComment:s,isCreatingComment:c,updateComment:u,deleteComment:d}=wt(e),{data:f}=Fn({queryKey:M.user(),queryFn:()=>nn(n),retry:!1}),{data:p}=Fn({queryKey:[`check-runs`,e],queryFn:async()=>(await l(n)).filter(t=>t.check_id===e).map(e=>({run_id:e.run_id,run_at:e.run_at,status:to(e.status,e.error),summary:e.error||void 0,triggered_by:e.triggered_by})),enabled:!!r,staleTime:3e4}),m=H(()=>no(i,p),[i,p]),h=e=>{s(e)},g=async(e,t)=>{await u({eventId:e,content:t})},_=async e=>{await d(e)};return a?G(q,{sx:{height:`100%`,p:4,display:`flex`,justifyContent:`center`,alignItems:`center`},children:G(cr,{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(eo,{event:e.event,currentUserId:f?.id,onEdit:g,onDelete:_}):G(Ya,{run:e.run,index:e.index}),n<m.length-1&&G(sr,{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(Xe,{onSubmit:h,isSubmitting:c})})]})}function io({color:e}){return G(q,{component:`span`,sx:{display:`inline-block`,width:`10px`,height:`10px`,bgcolor:e,mr:1,borderRadius:`4px`}})}const ao=({defaultPrimaryKeys:e,onPrimaryKeysChange:t,...n})=>{let{isActionAvailable:r}=F(),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(Cr,{fontSize:`0.75rem`})})})]}),G(dt,{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 oo({supportCalendarUrl:e=`https://cal.com/team/recce/chat`}){let{data:t}=le();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:qi,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(en(t,e),`_blank`)},children:`Connect to Data Warehouse`})})]})})}const so=()=>{let{isCustomQueries:e,setCustomQueries:t,sqlQuery:n,setBaseSqlQuery:r}=lt();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(wr,{fontSize:`1rem`})})})]}),G(Hi,{size:`small`,checked:e,onChange:()=>{!e&&r&&r(n),t(!e)},color:`primary`})]})},co=()=>{let{sqlQuery:e,baseSqlQuery:t,setSqlQuery:n,setBaseSqlQuery:r,primaryKeys:o,setPrimaryKeys:s,isCustomQueries:c}=lt(),{lineageGraph:l,envInfo:u}=F(),{featureToggles:d,singleEnv:f}=Te(),p=e;u?.adapterType===`sqlmesh`&&e===`select * from {{ ref("mymodel") }}`&&(p=`select * from db.mymodel`),d.mode===`read only`&&(p=`--- Would like to do query here? Book a demo with us at ${on}\n${p}`);let{showRunId:m}=_e(),{apiClient:h}=I(),{mutate:g,isPending:_}=Pn({mutationFn:async e=>{function n(e){switch(e){case`query`:return a;case`query_base`:return k;case`query_diff`:return i;default:throw Error(`Unknown query type: ${e}`)}}let r=e===`query_base`?t??``:p,s=n(e),l={sql_template:r},u={nowait:!0};e===`query_diff`&&(l.primary_keys=o,c&&(l.base_sql_template=t));let{run_id:d}=await s(l,u,h);return m(d),await T(d,void 0,h)}}),v=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 f||d.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(Xs,{}),G(q,{sx:{flexGrow:1}}),f?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(nl,{display:d.mode===`metadata only`,children:G(J,{variant:`contained`,disabled:!0,size:`small`,sx:{fontSize:`14px`,mt:`16px`},children:`Run Diff`})})]}),G(Fe,{value:p,onChange:n,onRun:()=>{g(`query`)},labels:[`base (production)`,`current (${v})`],SetupGuide:d.mode===`metadata only`?G(oo,{}):G(Gs,{})})]}):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(Xs,{}),G(so,{}),G(q,{sx:{flexGrow:1}}),G(ao,{defaultPrimaryKeys:o,onPrimaryKeysChange:s}),G(J,{variant:`contained`,onClick:()=>{g(`query_diff`)},disabled:_||d.disableDatabaseQuery,size:`small`,children:`Run Diff`})]}),G(q,{sx:{width:`100%`,flex:1,overflowY:`auto`},children:c?G(Fe,{value:p,baseValue:t,onChange:n,onChangeBase:r,onRun:()=>{g(`query`)},onRunBase:()=>{g(`query_base`)},onRunDiff:()=>{g(`query_diff`)}}):G(Ge,{value:p,onChange:n,onRun:()=>{g(`query`)},onRunDiff:()=>{g(`query_diff`)}})})]})};function lo({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=`${Xt(t,n)} Rows`,o=t<n?`success`:`error`);let s=z(`row_count_diff`).icon;return G(Ir,{size:`small`,color:o,icon:s?G(s,{}):void 0,label:a,sx:{height:20,fontSize:`0.7rem`}})}function uo({id:e,inverted:t}){let{lineageGraph:n,runsAggregated:r}=F(),{text:i,isDark:a}=Nt(),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:$e(`modified`).color,d=t?i.secondary:a?`grey.700`:`grey.100`,f=z(`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(lo,{rowCount:o.row_count_diff.result})})})]})}function fo({nodeId:e,nodeName:t}){let{getNodeAction:n}=he(),r=n(e);if(!r)return null;let{status:i,skipReason:a,run:o}=r;if(i===`pending`)return G(Wa,{status:`pending`});if(i===`skipped`)return G(Wa,{status:`skipped`,skipReason:a});if(!o)return G(Wa,{status:`pending`});let{error:s,run_id:c,progress:l}=o;if(i===`running`)return G(Wa,{status:`running`,progress:{percentage:l?.percentage}});if(s)return G(Wa,{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(Wa,{status:`success`,valueDiffResult:{mismatchedColumns:t,totalColumns:n}})}if(g(o)&&o.result){let e=o.result[t];if(e)return G(lo,{rowCount:e})}if(o.type===`row_count`&&o.result){let e=o.result[t];if(e?.curr!==void 0&&e.curr!==null)return G(Ir,{size:`small`,label:`${e.curr.toLocaleString()} Rows`,sx:{height:20,fontSize:`0.7rem`}})}return G(Wa,{status:`success`,runId:c})}function po(e){let{data:t}=e,{id:n,resourceType:r,changeStatus:i,name:a}=t,o=Qr(e=>e.transform[2]>.3),{isDark:s}=Nt(),{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}=he(),{isActionAvailable:w}=F(),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,A=g(n),te=p(t.id),ne=u===`action_result`?f(t.id):void 0,re=i,ie=u,j=u===`action_result`&&ne?G(fo,{nodeId:n,nodeName:a}):void 0,ae=u!==`action_result`&&t.resourceType===`model`?G(uo,{id:t.id,inverted:u===`selecting`&&O}):void 0;return G(bt,{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:A,changeCategory:E,runsAggregatedTag:ae,hasParents:Object.keys(t.parents).length>0,hasChildren:Object.keys(t.children).length>0,columnCount:te.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 mo=Bn(po);mo.displayName=`GraphNode`;const ho={lineageGraphNode:mo,lineageGraphColumnNode:Na},go={lineageGraphEdge:Ia},_o=[],vo=e=>e.data.changeStatus?$e(e.data.changeStatus).hexColor:Oe.neutral[400],yo={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`},bo={LINEAGE_VIEW_CONTEXT_MENU:`lineage_view_context_menu`},xo={SELECT_PARENT_NODES:`select_parent_nodes`,SELECT_CHILD_NODES:`select_child_nodes`,SELECT_ALL_UPSTREAM:`select_all_upstream`,SELECT_ALL_DOWNSTREAM:`select_all_downstream`},So=({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(ii,{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(sr,{},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})})},Co=({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,A=E?Array.from(E(i.id)):[],te={source:`lineage_model_node`},ne=k.changeStatus,re=v?.(k.name);if(ne===`modified`&&d.push({label:`Show Impact Radius`,itemIcon:G(pr,{}),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=Zt(t,t),r=`select * from {{ ref("${k.name}") }}`;if(n.length&&(r=`select \n ${n.join(`
|
|
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`)}}),A.length>0&&e)if(x!==void 0){let t=new Set;re&&t.add(re),A.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
|
-
`)}\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
|
-
`)}\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?yo.ROW_COUNT:yo.ROW_COUNT_DIFF,source:bo.LINEAGE_VIEW_CONTEXT_MENU,node_count:1}),f?.(a,{node_names:[k.name]},{showForm:!1,trackProps:te})}});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?yo.PROFILE:yo.PROFILE_DIFF,source:bo.LINEAGE_VIEW_CONTEXT_MENU,node_count:1}),f?.(s,{model:k.name,columns:e},{showForm:!0,trackProps:te})}}),!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:yo.VALUE_DIFF,source:bo.LINEAGE_VIEW_CONTEXT_MENU,node_count:1}),f?.(`value_diff`,{model:k.name,columns:e},{showForm:!0,trackProps:te})}})}}return D||(d.length>0&&d.push({label:`select group two`,isSeparator:!0}),d.push({label:`Select Parent Nodes`,itemIcon:G(Xi,{}),action:()=>{m?.(`lineage_selection`,{action:xo.SELECT_PARENT_NODES}),w?.(i.id,1)}}),d.push({label:`Select Child Nodes`,itemIcon:G(Zi,{}),action:()=>{m?.(`lineage_selection`,{action:xo.SELECT_CHILD_NODES}),T?.(i.id,1)}}),d.push({label:`Select All Upstream Nodes`,itemIcon:G(Xi,{}),action:()=>{m?.(`lineage_selection`,{action:xo.SELECT_ALL_UPSTREAM}),w?.(i.id)}}),d.push({label:`Select All Downstream Nodes`,itemIcon:G(Zi,{}),action:()=>{m?.(`lineage_selection`,{action:xo.SELECT_ALL_DOWNSTREAM}),T?.(i.id)}})),G(So,{x:n,y:r,menuItems:d,open:e,onClose:t,featureToggles:s,DisabledItemWrapper:y})},wo=({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:yo.PROFILE_DIFF,source:bo.LINEAGE_VIEW_CONTEXT_MENU,node_count:1}),u?.(`profile_diff`,{model:v.name,columns:[y]},{showForm:!1,trackProps:x})},C=()=>{d?.(`explore_action`,{action:yo.HISTOGRAM_DIFF,source:bo.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:yo.TOP_K_DIFF,source:bo.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:yo.VALUE_DIFF,source:bo.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(So,{x:n,y:r,menuItems:l,open:e,onClose:t,featureToggles:o,DisabledItemWrapper:m})},To=({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(So,{menuItems:[],open:e,onClose:t,x:n,y:r,featureToggles:s,DisabledItemWrapper:a.DisabledItemWrapper}):i&&pe(i)?G(Co,{x:n,y:r,isOpen:e,onClose:t,node:i,deps:a,viewOptions:o,featureToggles:s,serverFlags:c,noCatalogCurrent:l,isActionAvailable:u}):i&&fe(i)?G(wo,{x:n,y:r,isOpen:e,onClose:t,node:i,deps:a,featureToggles:s,serverFlags:c,isActionAvailable:u}):null,Eo=()=>{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()}}},Do=()=>{let{isDark:e}=Nt(),{successToast:t,failToast:n}=qt();return pt({imageType:`png`,shadowEffect:!0,backgroundColor:e?Oe.neutral[900]:Oe.neutral[50],ignoreElements:e=>{try{return e.classList.contains(Ft)}catch{return e.className?e.className.includes(Ft):!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)}})},Oo=()=>{let e=Ei(),{basePath:t}=ge();return B(n=>{n.check_id&&e.push(`${t}/checks/?id=${n.check_id}`)},[e.push,t])};function ko(){let[e,t]=U(()=>new Set),[n,r]=U(()=>new Set);return{impactedNodeIds:e,impactedColumnIds:n,publish:B(e=>{t(e.nodeIds),r(e.columnIds)},[])}}const Ao=(e,t)=>{let n=Wn({width:0,height:0});V(()=>{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])},jo=()=>B((e,t,n,r,i)=>{let a=e.filter(pe),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),bn(c)},[]),Mo={row_count:sn.ROW_COUNT,row_count_diff:sn.ROW_COUNT_DIFF,value_diff:sn.VALUE_DIFF},No=e=>{let t=Mo[e.action];t&&gn({action:t,source:cn.LINEAGE_VIEW_TOP_BAR,node_count:e.node_count})},Po=(e,t)=>Ne(e,{...t,onTrackAction:No,trackingSource:cn.LINEAGE_VIEW_TOP_BAR});function Fo({notification:e,type:t}){let n=E.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(ir,{})})]})}function Io(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 Lo(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 Ro(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 zo=e=>{let{runAction:t}=_e(),{setSqlQuery:n,setPrimaryKeys:r}=lt(),i=Ei(),{primaryKey:a}=yt(e),{basePath:o}=ge();return{runAction:(e,n,r)=>{t(e,n,r)},onNavigate:e=>{i.push(`${o}${e}`)},onTrack:(e,t)=>{e===`explore_action`?gn({action:t.action,source:bo.LINEAGE_VIEW_CONTEXT_MENU,node_count:t.node_count}):e===`lineage_selection`&&yn({action:t.action})},supportsHistogramDiff:jt,findByRunType:e=>{let t=z(e);return t?{title:t.title,icon:t.icon}:void 0},setSqlQuery:n,setPrimaryKeys:r,getPrimaryKey:()=>a,DisabledItemWrapper:nl}},Bo=({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}=he(),{featureToggles:f}=Te(),{isActionAvailable:p,lineageGraph:m}=F(),{data:h}=Ce(),g=!m?.catalogMetadata.current;return G(To,{x:n,y:r,node:i,isOpen:e,onClose:t,deps:zo(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})},Vo=Eo;function Ho(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:Wr.Left,sourcePosition:Wr.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:Wr.Left,sourcePosition:Wr.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&&Uo(n,r,c,a,f),n.some(e=>e.type===`lineageGraphNode`&&!o?.has(e.id))&&Wo(n,r),[n,r,l]}function Uo(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:Wr.Left,sourcePosition:Wr.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?Bt.impacted:Bt.unchanged}})}}}const Wo=(e,t,n=`LR`)=>{ue(Qi,e,t,n)};function Go(){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 Ko({current:e,showMenu:t=!0},n){let r=ye(),[i,a]=U(null),[o,s]=U(new Map),{columns:c,rows:l}=H(()=>ke({type:`schema_single`,columns:e?.columns},{node:e,cllRunningMap:o,showMenu:t}),[e,o,t]),{lineageGraph:u,isActionAvailable:d}=F(),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;un({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=B(t=>`${e?.id}-${t.data.name}`,[e?.id]),y=r?.viewOptions.column_level_lineage,b=y?`${y.node_id}-${y.column}`:null;V(()=>{if(i&&(i.deselectAll(),b)){let e=i.getRowNode(b);e&&e.setSelected(!0)}},[i,b]);let x=B(e=>{a(e.api)},[]);return K(q,{sx:{display:`flex`,flexDirection:`column`,height:`100%`},children:[m?G(ni,{severity:`warning`,sx:{fontSize:`12px`,p:1},children:m}):g?G(ni,{severity:`warning`,sx:{fontSize:`12px`,p:1},children:g}):G(W,{}),l.length>0&&G(Lt,{style:{blockSize:`auto`,maxHeight:`100%`,overflow:`auto`,fontSize:`10pt`,borderWidth:1},columns:c,rows:l,renderers:{noRowsFallback:G(ot,{})},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 qo({base:e,current:t,showMenu:n=!0,columnChanges:r,onViewCode:i},a){let o=ye(),{data:s}=Ce(),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 ke({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:_}=F(),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;un({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=B(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;V(()=>{if(l&&(l.deselectAll(),O)){let e=l.getRowNode(O);e&&e.setSelected(!0)}},[l,O]);let k=B(e=>{u(e.api)},[]);return K(q,{sx:{display:`flex`,flexDirection:`column`,height:`100%`},children:[x?G(ni,{severity:`warning`,sx:{fontSize:`12px`,p:1},children:x}):w?G(ni,{severity:`warning`,sx:{fontSize:`12px`,p:1},children:w}):G(W,{}),G(Go,{}),h.length>0&&G(Lt,{style:{blockSize:`auto`,maxHeight:`100%`,overflow:`auto`,fontSize:`0.8rem`,borderWidth:1},columns:m,rows:h,rowHeight:35,renderers:{noRowsFallback:G(ot,{})},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 Jo=zn(qo),Yo=zn(Ko);function Xo(e){let t=e?.current.nodes;if(!t)return{impactingNodeIds:void 0,impactedNodeIds:void 0};let n=new Set,r=new Set;for(let[e,i]of Object.entries(t))i.impacted===!0?(r.add(e),n.add(e)):(i.change_category===`partial_breaking`||i.change_status===`removed`)&&n.add(e);return{impactingNodeIds:n,impactedNodeIds:r}}const Zo={light:`rgb(252 211 77 / 0.18)`,dark:`rgb(252 211 77 / 0.10)`};function Qo(e){return e?zt.dark:zt.light}function $o(e){return e?.data.changeStatus??`unchanged`}function es(e,t){return e===`unchanged`&&t?`impacted`:e}function ts(e){return e===`impacted`?Bt.impacted:ut[e]}function ns(e,t){return t?.[e]?.data.name??e}function rs(e,t,n){let r=t.trim().toLowerCase();return r?e.filter(e=>ns(e,n).toLowerCase().includes(r)):e}function is(e,t){return e?`Show all models`:t?`Show only impacting models`:`Show only impacted models`}function as({status:e,cllImpacted:t}){let n=es(e,t);return G(q,{component:`span`,"data-testid":`lineage-status-dot`,"data-status":n,sx:{width:`8px`,height:`8px`,borderRadius:`2px`,backgroundColor:ts(n),flex:`0 0 auto`}})}function os({name:e,status:t,direction:n,decorateAsImpacted:r,dotImpacted:i,onClick:a}){let{isDark:o}=Nt(),s=n===`up`?`Impacts this model`:`Impacted by this model`;return K(q,{onClick:a,sx:{position:`relative`,display:`flex`,alignItems:`center`,gap:.75,pl:1.5,pr:1.25,py:.5,cursor:a?`pointer`:`default`,fontSize:`12px`,fontFamily:`ui-monospace, 'IBM Plex Mono', monospace`,lineHeight:1.3,color:`text.primary`,minWidth:0,backgroundColor:r?o?Zo.dark:Zo.light:void 0,"&:hover":a?{backgroundColor:`action.hover`}:void 0},children:[r&&G(q,{"aria-hidden":`true`,sx:{position:`absolute`,left:0,top:0,bottom:0,width:`3px`,backgroundColor:Bt.impacted}}),G(as,{status:t,cllImpacted:i}),G(q,{component:`span`,sx:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,minWidth:0,flex:1},title:e,children:e}),r&&G(Q,{title:s,placement:`top`,arrow:!0,children:G(q,{component:`span`,"aria-label":s,"data-testid":`lineage-impact-mark`,sx:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:`16px`,height:`16px`,color:Qo(o),flex:`0 0 auto`},children:G(ki,{size:12})})})]})}function ss({isDark:e,active:t}){return t?Qe.dark:e?Pe.dark:Pe.light}function cs({isDark:e,active:t}){return t?`#fff`:e?zt.dark:zt.light}const ls={display:`inline-flex`,alignItems:`center`,gap:`4px`,ml:.75,px:`7px`,py:`1px`,borderRadius:`999px`,fontSize:`10px`,fontWeight:600,letterSpacing:`0.02em`};function us({color:e}){return G(q,{component:`span`,"aria-hidden":`true`,sx:{width:`5px`,height:`5px`,borderRadius:`50%`,backgroundColor:e}})}function ds({label:e,title:t,active:n,isDark:r,onClick:i}){let a={isDark:r,active:n};return G(Q,{title:t,placement:`top`,arrow:!0,children:K(q,{component:`button`,type:`button`,"data-testid":`lineage-impact-chip`,"aria-pressed":n,"aria-label":t,onClick:i,sx:{...ls,backgroundColor:ss(a),color:cs(a),border:`none`,font:`inherit`,cursor:`pointer`,"&:hover":{filter:n?`brightness(0.95)`:`brightness(0.97)`}},children:[G(us,{color:cs(a)}),e]})})}function fs({direction:e,directCount:t,impactCount:n,onlyImpact:r,onToggleOnlyImpact:i}){let a=e===`up`,o=a?Ai:ki,{isDark:s,background:c}=Nt(),l=n??0,u=l>0,d=a?`${l} impacting`:`${l} impacted`;return K(Y,{direction:`row`,spacing:.75,sx:{alignItems:`center`,px:1.5,py:.875,backgroundColor:c.subtle,borderTop:`1px solid`,borderBottom:`1px solid`,borderColor:`divider`,fontSize:`11px`,color:`text.secondary`,fontWeight:600},children:[G(o,{size:11}),G(q,{component:`span`,sx:{textTransform:`uppercase`,letterSpacing:`0.06em`},children:a?`Upstream`:`Downstream`}),K(q,{component:`span`,sx:{color:`text.disabled`,fontWeight:500},children:[`· `,t,` direct`]}),u&&G(ds,{label:d,title:is(r,a),active:r,isDark:s,onClick:i})]})}function ps({label:e}){return G(q,{sx:{px:1.5,py:1,fontSize:`11px`,color:`text.disabled`,fontStyle:`italic`},children:e})}function ms({direction:e,query:t,onChange:n}){return G(q,{sx:{px:1.25,py:.75,borderBottom:`1px solid`,borderColor:`divider`,backgroundColor:`background.paper`},children:K(Y,{direction:`row`,spacing:.5,sx:{alignItems:`center`,border:`1px solid`,borderColor:`divider`,borderRadius:`4px`,px:.875,py:.25},children:[G(Ni,{size:12,color:`currentColor`,opacity:.55}),G(ri,{value:t,onChange:e=>{n(e.target.value)},placeholder:`filter…`,inputProps:{"aria-label":`Filter ${e===`up`?`Upstream`:`Downstream`}`,style:{padding:0,fontSize:`11px`,fontFamily:`ui-monospace, 'IBM Plex Mono', monospace`}},sx:{flex:1,fontSize:`11px`}})]})})}function hs({hidden:e,onClick:t}){return K(q,{onClick:t,role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},sx:{px:1.5,py:.75,fontSize:`11px`,color:`info.main`,cursor:`pointer`,userSelect:`none`,"&:hover":{backgroundColor:`action.hover`}},children:[`+ show `,Math.min(20,e),` more`,` `,K(q,{component:`span`,sx:{color:`text.disabled`,ml:.5},children:[`(`,e,` hidden)`]})]})}function gs({node:e,onCenterFocus:t,cllImpacted:n}){let r=es($o(e),n),{isDark:i,background:a}=Nt(),o=ts(r),s=r===`impacted`?Qo(i):o,c=r===`impacted`?Qo(i):`divider`;return K(Y,{direction:`row`,spacing:1,sx:{alignItems:`center`,px:1.5,py:1.25,backgroundColor:i?a.emphasized:`rgb(255 245 241)`,borderTop:`1px solid`,borderBottom:`1px solid`,borderColor:`divider`},children:[G(q,{component:`span`,sx:{width:`4px`,height:`26px`,borderRadius:`2px`,backgroundColor:o,flex:`0 0 auto`}}),G(q,{component:`span`,sx:{flex:1,minWidth:0,fontFamily:`ui-monospace, 'IBM Plex Mono', monospace`,fontSize:`13px`,fontWeight:700,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},title:e.data.name,children:e.data.name}),t&&G(Q,{title:`Center on canvas`,placement:`top`,children:G(Z,{size:`small`,"aria-label":`Center on canvas`,onClick:t,sx:{p:.5,color:`text.secondary`,flex:`0 0 auto`},children:G(ji,{size:14})})}),G(q,{component:`span`,sx:{fontSize:`10px`,fontWeight:600,px:.875,py:`2px`,borderRadius:`3px`,color:s,backgroundColor:`background.paper`,border:`1px solid`,borderColor:c,textTransform:`capitalize`,flex:`0 0 auto`},children:r})]})}function _s({previousName:e,currentName:t,onJumpBack:n}){let{isDark:r}=Nt();return K(Y,{direction:`row`,spacing:.75,sx:{alignItems:`center`,minWidth:0,flex:1,overflow:`hidden`,fontFamily:`ui-monospace, 'IBM Plex Mono', monospace`,fontSize:`12px`},children:[G(q,{component:`span`,sx:{color:`text.secondary`,fontFamily:`inherit`,flex:`0 0 auto`},children:`Path`}),G(q,{component:`span`,role:n?`button`:void 0,tabIndex:n?0:void 0,onClick:n,onKeyDown:n?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())}:void 0,sx:{color:`text.primary`,cursor:n?`pointer`:`default`,textDecoration:`underline`,textDecorationColor:r?`rgb(255 255 255 / 0.35)`:`rgb(0 0 0 / 0.25)`,textUnderlineOffset:`2px`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,minWidth:0,"&:hover":n?{textDecorationColor:`currentColor`}:void 0},title:e,children:e}),G(q,{component:`span`,"aria-hidden":`true`,sx:{color:`text.disabled`,flex:`0 0 auto`},children:`›`}),G(q,{component:`span`,sx:{color:`primary.main`,fontWeight:700,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,minWidth:0},title:t,children:t})]})}function vs({node:e,nodesById:t,onNavigate:n,onBack:r,onCenterFocus:i,historyTrail:a,onJumpToHistory:o,impactingNodeIds:s,impactedNodeIds:c}){let{background:l}=Nt(),[u,d]=U(``),[f,p]=U(``),[m,h]=U(8),[g,_]=U(8),[v,y]=U(!1),[b,x]=U(!1);V(()=>{d(``),p(``),h(8),_(8),y(!1),x(!1)},[e.id]);let S=H(()=>Object.keys(e.data.parents??{}),[e.data.parents]),C=H(()=>Object.keys(e.data.children??{}),[e.data.children]),w=H(()=>rs(S,u,t),[S,u,t]),T=H(()=>rs(C,f,t),[C,f,t]),E=((s?.size??0)>0||(c?.size??0)>0)&&((s?.has(e.id)??!1)||(c?.has(e.id)??!1)),D=(e,t)=>E?(t===`up`?s:c)?.has(e)??!1:!1,O=E?S.filter(e=>s?.has(e)).length:0,k=E?C.filter(e=>c?.has(e)).length:0,ee=e=>{let r=e===`up`,i=r?S:C,a=r?w:T,o=(r?v:b)?a.filter(t=>D(t,e)):a,s=r?u:f,l=r?d:p,y=r?m:g,x=r?h:_,E=i.length>8,O=o.slice(0,y),k=o.length-O.length,ee=r?`(source — no upstream)`:`(leaf — no downstream)`;return K(W,{children:[E&&G(ms,{direction:e,query:s,onChange:e=>{l(e),x(8)}}),i.length===0?G(ps,{label:ee}):o.length===0?G(ps,{label:`no matches`}):O.map(r=>G(os,{name:ns(r,t),status:$o(t?.[r]),direction:e,decorateAsImpacted:D(r,e),dotImpacted:c?.has(r)??!1,onClick:n?()=>n(r):void 0},`${e}-${r}`)),k>0&&G(hs,{hidden:k,onClick:()=>x(e=>Math.min(o.length,e+20))})]})},A=(a?.length??0)>0;return K(q,{sx:{height:`100%`,display:`flex`,flexDirection:`column`,backgroundColor:`background.paper`},"data-testid":`lineage-tab-content`,children:[(!!r||A)&&K(Y,{direction:`row`,spacing:1,sx:{alignItems:`center`,px:1.25,py:.75,borderBottom:`1px solid`,borderColor:`divider`,backgroundColor:l.subtle,minWidth:0},children:[r&&G(Q,{title:`Back to previous node`,placement:`top`,children:G(Z,{size:`small`,"aria-label":`Back to previous node`,onClick:r,sx:{flex:`0 0 auto`,border:`1px solid`,borderColor:`divider`,borderRadius:`6px`,px:1,py:.375,color:`text.secondary`,backgroundColor:`background.paper`,"&:hover":{backgroundColor:`action.hover`}},children:G(Oi,{size:14})})}),A&&a?G(_s,{previousName:ns(a[a.length-1],t),currentName:e.data.name,onJumpBack:o?()=>o(a.length-1):r}):G(q,{sx:{flex:1}})]}),K(q,{sx:{flex:1,overflowY:`auto`,minHeight:0},children:[G(fs,{direction:`up`,directCount:S.length,impactCount:O,onlyImpact:v,onToggleOnlyImpact:()=>{y(e=>!e),h(8)}}),ee(`up`),G(gs,{node:e,onCenterFocus:i,cllImpacted:c?.has(e.id)??!1}),G(fs,{direction:`down`,directCount:C.length,impactCount:k,onlyImpact:b,onToggleOnlyImpact:()=>{x(e=>!e),_(8)}}),ee(`down`)]})]})}const ys=({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(ur,{})}),K(Gn,{open:o,onClose:()=>s(!1),maxWidth:`sm`,fullWidth:!0,slotProps:{paper:{sx:{height:`75%`,overflowY:`auto`}}},children:[K(Jn,{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(ir,{})})]}),G(qn,{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`})})]})]})},bs=({node:e})=>{let{data:t,isLoading:n}=Ce(),r=Gt(),{apiClient:i}=I(),a=e.data.resourceType,o=a===`model`||a===`snapshot`,{data:s,isLoading:c}=Fn({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($i,{variant:`rectangular`,height:`100%`,animation:`wave`})}):G(ys,{node:e,modelDetail:s?.model,isSingleEnv:t?.single_env_onboarding??!1,CodeEditor:et,DiffEditor:vt,isDark:r})};function xs({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(Ri,{}),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(Ki,{})}),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(Wi,{})}),G(X,{variant:`body2`,component:`span`,sx:{color:`success.main`},children:Xt(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(Ui,{})}),G(X,{variant:`body2`,component:`span`,sx:{color:`error.main`},children:Xt(t,n)})]})}function Ss({rowCount:e,node:t,onRefresh:n,isFetching:r}){let i=Gt(),{featureToggles:a}=Te(),{runsAggregated:o}=F(),s=o?.[t.id]?.row_count_diff.result,c=z(`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(nl,{display:a.mode===`metadata only`,children:K(q,{component:`span`,sx:{...Dt(i),gap:.5},children:[G(c,{}),u!=null||r?r?G($i,{width:30,height:16}):u==null?G(X,{variant:`caption`,children:`row count`}):G(xs,{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(Ar,{size:12})})]})})})}function Cs({rowCount:e,node:t,onRefresh:n,isFetching:r}){let i=Gt(),{runsAggregated:a}=F(),o=a?.[t.id]?.row_count.result,s=z(`row_count`).icon,c,l=e??o;return l&&(c=`${l.curr??`N/A`} rows`),K(q,{component:`span`,sx:Dt(i),children:[G(q,{component:`span`,sx:At,children:G(s,{})}),l||r?r?G($i,{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(Ar,{size:12})})]})}function ws({children:e,value:t,index:n}){return t===n?G(W,{children:e}):null}const Ts=()=>G(`span`,{}),Es=({children:e})=>G(W,{children:e}),Ds=()=>!0;function Os(e,t,n){return e?jn.add_or_remove:n(t)?``:`This action is not supported yet.`}function ks({node:e,actionCallbacks:t,runTypeIcons:n,isActionAvailable:r}){let i=e.data.changeStatus===`added`||e.data.changeStatus===`removed`,a=n?.query??Ts,o=n?.row_count??Ts,s=n?.profile??Ts;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:Os(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 As({actionCallbacks:e,runTypeIcons:t,featureToggles:n,ConnectionPopoverWrapper:r}){let i=n?.mode===`metadata only`,a=t?.schema_diff??Ts,o=t?.sandbox??Ts;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 js({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??Ts,l=n?.row_count_diff??Ts,u=n?.profile_diff??Ts,d=n?.value_diff??Ts,f=n?.top_k_diff??Ts,p=n?.histogram_diff??Ts,m=(e,t)=>o?G(a,{display:!0,children:e}):G(Q,{title:Os(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 Ms({node:e,onCloseNode:t,isSingleEnv:n,featureToggles:r,modelDetail:i,lineageTabContent:a,SchemaView:o,SingleEnvSchemaView:s,NodeSqlView:c,RowCountDiffTag:l,RowCountTag:u,ResourceTypeTag:d,NotificationComponent:f,ConnectionPopoverWrapper:p=Es,SandboxDialog:m,runTypeIcons:h,actionCallbacks:g,isActionAvailable:_=Ds}){let v=e.data.resourceType===`model`||e.data.resourceType===`seed`||e.data.resourceType===`source`||e.data.resourceType===`snapshot`,[y,b]=U(!1),[x,S]=U(!0),[C,w]=U(0),{base:T,current:E}=i??{},D=!n&&e.data.change?.columns!=null&&Object.keys(e.data.change.columns).length>0,O=!n&&e.data.changeStatus===`modified`,k=e.data.resourceType===`model`||e.data.resourceType===`seed`||e.data.resourceType===`snapshot`,ee={...g,onSandboxClick:()=>{g?.onSandboxClick?.(),b(!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&&k&&G(As,{node:e,actionCallbacks:ee,runTypeIcons:h,featureToggles:r,ConnectionPopoverWrapper:p}),G(q,{sx:{flex:`0 1 1%`},children:G(Z,{size:`small`,onClick:t,children:G(ir,{})})})]}),G(q,{sx:{color:`text.secondary`,pl:2},children:K(Y,{direction:`row`,spacing:1,children:[d&&G(d,{node:e}),k&&(n?u&&G(u,{node:e,onRefresh:g?.onRowCountClick}):l&&G(l,{node:e,onRefresh:g?.onRowCountDiffClick}))]})}),k&&G(q,{sx:{pl:2,py:1},children:n?G(ks,{node:e,actionCallbacks:g,runTypeIcons:h,isActionAvailable:_}):G(js,{node:e,actionCallbacks:ee,runTypeIcons:h,featureToggles:r,isActionAvailable:_,ConnectionPopoverWrapper:p})}),v&&K(q,{sx:{overflow:`auto`,display:`flex`,flexDirection:`column`,flex:1,minHeight:0},children:[n&&x&&f&&G(q,{sx:{p:1.5},children:G(f,{onClose:()=>S(!1),children:G(X,{variant:`body2`,children:`Enable the Recce Checklist and start adding checks for better data validation and review.`})})}),(()=>{let t=a?2:-1;return K(W,{children:[K(vi,{value:C,onChange:(e,t)=>w(t),sx:{borderBottom:1,borderColor:`divider`},children:[G(_i,{label:K(q,{component:`span`,sx:{display:`flex`,alignItems:`center`,gap:.75},children:[`Columns`,D&&G(q,{component:`span`,sx:{color:`amber.main`,fontSize:`0.5rem`,lineHeight:1},children:`●`})]})}),G(_i,{label:K(q,{component:`span`,sx:{display:`flex`,alignItems:`center`,gap:.75},children:[`Code`,O&&G(q,{component:`span`,sx:{color:`amber.main`,fontSize:`0.5rem`,lineHeight:1},children:`●`})]})}),a&&G(_i,{label:`Lineage`})]}),K(q,{sx:{overflow:`auto`,height:`calc(100% - 48px)`},children:[G(ws,{value:C,index:0,children:G(q,{sx:{overflowY:`auto`,height:`100%`},children:n?s&&G(s,{current:E}):o&&G(o,{base:T,current:E,columnChanges:e.data.change?.columns,onViewCode:()=>w(1)})})}),G(ws,{value:C,index:1,children:G(q,{sx:{height:`100%`},children:c&&G(c,{node:e})})}),a&&G(ws,{value:C,index:t,children:G(q,{sx:{height:`100%`},children:a})})]})]})})()]}),m&&G(m,{isOpen:y,onClose:()=>b(!1),current:E})]})}function Ns(e){return mi(gi(e),`yyyy-MM-dd'T'HH:mm:ss`)}function Ps({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:ea,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 Fs({currentModelID:e,height:t=`32px`,flex:n=`0 0 auto`,isDark:r=!1}){let{lineageGraph:i,envInfo:a}=F(),o=`0 16px`,s=hi(Ns(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:$n(r?Oe.neutral[700]:Oe.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 Is({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($i,{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 Ls({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(Gn,{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(Ir,{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(ir,{})})]}),G(qn,{sx:{p:0},children:K(ft,{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(Ps,{current:n,primaryKeys:s,onPrimaryKeysChange:e=>{c?.(e)},onRunResultOpen:x,runQuery:S,isPending:l,isCodeLoading:_,QueryForm:i}),G(Fs,{height:`32px`,flex:`0 0 auto`,currentModelID:n?.id??``,isDark:o}),G(Is,{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(si,{})})})})]})}function Rs({isOpen:e,onClose:t,current:n}){let{showRunId:r,clearRunResult:a}=_e(),{primaryKeys:o,setPrimaryKeys:s}=lt(),{data:c,isLoading:l}=Ce(),{apiClient:d}=I(),f=Gt(),m=n?.raw_code,h=e&&!!n?.id&&m==null,{data:g,isLoading:_}=Fn({queryKey:[`modelDetail`,n?.id??``],queryFn:()=>u(n?.id??``,d),enabled:h&&!!d,staleTime:300*1e3,retry:1}),v=H(()=>m??g?.model.current?.raw_code??g?.model.base?.raw_code??void 0,[m,g]),y=H(()=>{if(n)return v===n.raw_code?n:{...n,raw_code:v}},[n,v]),[b,x]=U(``),[S,C]=U(e),[w,E]=U(v),D=Wn(!1),O=B(e=>{D.current=!0,x(e)},[]);e===S?e&&v!==w&&!D.current&&(E(v),x(v??``)):(C(e),e&&(D.current=!1,x(v??``),E(v)));let{mutate:k,isPending:ee}=Pn({mutationFn:async()=>{let e=b,{run_id:t}=await i({current_model:n?.name??``,primary_keys:o,sql_template:e},{nowait:!0},d);return r(t),await T(t,void 0,d)},onSuccess(e){e.error?wn({action:`run`,node:n?.name,status:`failure`}):(wn({action:`run`,node:n?.name,status:`success`}),setTimeout(()=>{A()},1e3),!l&&c?.single_env_onboarding&&setTimeout(()=>{ne()},2e3))}}),{feedbackToast:A,closeToast:te}=Ot({feedbackId:p.previewChangeFeedbackID,description:`Enjoy preview change?`,onFeedbackSubmit:e=>{switch(e){case`like`:Tn({feedback:`like`,node:n?.name});break;case`dislike`:Tn({feedback:`dislike`,node:n?.name});break;case`link`:Tn({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}=st({guideId:p.prepareEnvGuideID,description:`Want to compare data changes with production data?`,externalLink:`https://docs.reccehq.com/get-started/#prepare-dbt-artifacts`,externalLinkText:`Learn how.`,onExternalLinkClick:()=>{kn({action:`external_link`,from:`preview_changes`,node:n?.name})}});return G(Ls,{isOpen:e,onClose:()=>{t(),a(),te(),re()},current:y,DiffEditor:vt,QueryForm:ao,RunResultPane:Le,isDark:f,primaryKeys:o??[],onPrimaryKeysChange:s,isPending:ee,isCodeLoading:h&&_,onRunQuery:k,onModifiedCodeChange:O,onShowFeedback:()=>A(!0),tracking:{onPreviewChange:wn}})}const zs=({node:e})=>G(Pt,{resourceType:e.data.resourceType,materialized:e.data.materialized});function Bs({onClose:e}){return G(je,{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(St,{})]})})}function Vs({node:e,onCloseNode:t,onNavigateToNode:n,onBack:r,onCenterFocused:i,historyTrail:a,onJumpToHistory:o}){let s=Ei(),{runAction:c}=_e(),{isActionAvailable:l,envInfo:d,lineageGraph:f}=F(),p=ye(),{impactingNodeIds:m,impactedNodeIds:h}=H(()=>Xo(p?.cll),[p?.cll]),{singleEnv:g,featureToggles:_}=Te(),{setSqlQuery:y,setPrimaryKeys:b}=lt(),{primaryKey:x}=yt(e.data.name),{apiClient:S}=I(),{basePath:C}=ge(),{data:w}=Fn({queryKey:[`modelDetail`,e.id],queryFn:()=>u(e.id,S),enabled:!!S,staleTime:300*1e3}),T=w?.model,E=H(()=>({query:z(`query`).icon,row_count:z(`row_count`).icon,row_count_diff:z(`row_count_diff`).icon,profile:z(`profile`).icon,profile_diff:z(`profile_diff`).icon,query_diff:z(`query_diff`).icon,value_diff:z(`value_diff`).icon,top_k_diff:z(`top_k_diff`).icon,histogram_diff:z(`histogram_diff`).icon,schema_diff:z(`schema_diff`).icon,sandbox:z(`sandbox`).icon}),[]),D=Zt(Object.keys(T?.base?.columns??{}),Object.keys(T?.current?.columns??{})),O=H(()=>D.length?`select \n ${D.join(`
|
|
6
|
-
`)}\nfrom {{ ref("${e.data.name}") }}`:`select * from {{ ref("${e.data.name}") }}`,[D,e.data.name]),k=H(()=>({onQueryClick:()=>{d?.adapterType===`dbt`?y(O):d?.adapterType===`sqlmesh`&&y(`select * from ${e.data.name}`),s.push(`${C}/query`)},onRowCountClick:()=>{gn({action:sn.ROW_COUNT,source:cn.SCHEMA_ROW_COUNT_BUTTON,node_count:1}),c(`row_count`,{node_names:[e.data.name]},{showForm:!1,showLast:!1})},onRowCountDiffClick:()=>{gn({action:sn.ROW_COUNT_DIFF,source:cn.SCHEMA_ROW_COUNT_BUTTON,node_count:1}),c(`row_count_diff`,{node_names:[e.data.name]},{showForm:!1,showLast:!1})},onProfileClick:()=>{gn({action:sn.PROFILE,source:cn.NODE_SIDEBAR_SINGLE_ENV,node_count:1}),c(`profile`,{model:e.data.name},{showForm:!0,showLast:!1})},onProfileDiffClick:()=>{gn({action:sn.PROFILE_DIFF,source:cn.NODE_SIDEBAR_MULTI_ENV,node_count:1}),c(`profile_diff`,{model:e.data.name},{showForm:!0,showLast:!1})},onQueryDiffClick:()=>{d?.adapterType===`dbt`?y(O):d?.adapterType===`sqlmesh`&&y(`select * from ${e.data.name}`),l(`query_diff_with_primary_key`)&&b(x===void 0?void 0:[x]),s.push(`${C}/query`)},onValueDiffClick:()=>{gn({action:sn.VALUE_DIFF,source:cn.NODE_SIDEBAR_MULTI_ENV,node_count:1}),c(`value_diff`,{model:e.data.name},{showForm:!0,showLast:!1})},onTopKDiffClick:()=>{gn({action:sn.TOP_K_DIFF,source:cn.NODE_SIDEBAR_MULTI_ENV,node_count:1}),c(`top_k_diff`,{model:e.data.name,column_name:``,k:50},{showForm:!0})},onHistogramDiffClick:()=>{gn({action:sn.HISTOGRAM_DIFF,source:cn.NODE_SIDEBAR_MULTI_ENV,node_count:1}),c(`histogram_diff`,{model:e.data.name,column_name:``,column_type:``},{showForm:!0})},onAddSchemaDiffClick:async()=>{let t=await v({node_id:e.id},S);s.push(`${C}/checks/?id=${t.check_id}`)},onSandboxClick:()=>{l(`query_diff_with_primary_key`)&&b(x===void 0?void 0:[x]),wn({action:`explore`,node:e.data.name})}}),[e,O,d,y,c,l,b,x,S,s.push,C]);return G(Ms,{node:e,onCloseNode:t,isSingleEnv:g??!1,featureToggles:_,modelDetail:(()=>{if(!T)return;let t=!!T.base&&Object.keys(T.base).length>0,n=!!T.current&&Object.keys(T.current).length>0;if(!(!t&&!n))return{base:t?{id:e.id,unique_id:e.id,name:e.data.name,resource_type:e.data.resourceType,package_name:e.data.packageName,...T.base}:void 0,current:n?{id:e.id,unique_id:e.id,name:e.data.name,resource_type:e.data.resourceType,package_name:e.data.packageName,...T.current}:void 0}})(),SchemaView:Jo,SingleEnvSchemaView:Yo,NodeSqlView:bs,ResourceTypeTag:zs,RowCountDiffTag:Ss,RowCountTag:Cs,NotificationComponent:Bs,ConnectionPopoverWrapper:nl,SandboxDialog:Rs,runTypeIcons:E,actionCallbacks:k,isActionAvailable:l,lineageTabContent:n?G(vs,{node:e,nodesById:f?.nodes,onNavigate:n,onBack:r,onCenterFocus:i,historyTrail:a,onJumpToHistory:o,impactingNodeIds:m,impactedNodeIds:h}):void 0})}function Hs(e,t){let n={...e.nodes};for(let[e,r]of Object.entries(t.current.nodes)){if(!r.change_status)continue;let t=n[e];if(!t)continue;let i;if(r.columns){let e={},t=!1;for(let n of Object.values(r.columns))n.change_status&&(e[n.name]=n.change_status,t=!0);t&&(i=e)}n[e]={...t,change_status:r.change_status,change:r.change_category?{category:r.change_category,columns:i}:t.change}}return{...e,nodes:n}}function Us({featureToggles:e,settingsUrl:t}){return e.mode===`metadata only`?G(q,{sx:{display:`flex`,alignItems:`center`,width:`100%`,px:1,py:.25,bgcolor:`cyan.50`},children:K(Y,{direction:`row`,spacing:1,sx:{alignItems:`center`,flex:1,fontSize:`0.875rem`,color:`cyan.600`},children:[G(q,{component:Cr}),G(X,{sx:{fontSize:`inherit`,color:`inherit`},children:`Query functions disabled without a data warehouse connection.`}),G(J,{sx:{bgcolor:`iochmara.400`},size:`small`,variant:`contained`,onClick:()=>{window.open(t,`_blank`)},children:`Connect to Data Warehouse`})]})}):null}function Ws(e){let{featureToggles:t}=Te(),{data:n}=le();return G(Us,{featureToggles:e.featureToggles??t,settingsUrl:e.settingsUrl??en(n,on)})}function Gs({docsUrl:e=`https://docs.reccehq.com/get-started/#prepare-dbt-artifacts`,onStartClick:t}={}){return G(Y,{sx:{flex:1,height:`100%`,minHeight:0,m:1,p:2,bgcolor:`iochmara.50`,borderRadius:2,boxShadow:2,justifyContent:`center`},children:K(Y,{sx:{alignSelf:`center`,width:`80%`,overflowY:`auto`,gap:3,px:4,pb:4},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:qi,sx:{fontSize:28,color:`iochmara.500`}})}),G(X,{variant:`h5`,sx:{mt:2},children:`Wait, there's more!`}),K(X,{sx:{textAlign:`center`},children:[`Recce is currently running in`,` `,G(X,{component:`span`,sx:{fontWeight:`bold`},children:`limited functionality mode`}),` `,`so you can run queries but`,` `,G(X,{component:`span`,sx:{fontWeight:`bold`},children:`can't diff the results yet!`})]})]}),K(Y,{spacing:1,children:[G(X,{children:`To unlock the full power of Recce, set up a base environment of dbt artifacts for comparison.`}),G(X,{children:`Once configured, you'll be able to:`}),K(yi,{sx:{listStyleType:`disc`,pl:2},children:[G(bi,{sx:{display:`list-item`,p:0},children:G(X,{children:`Run statistical data diffs`})}),G(bi,{sx:{display:`list-item`,p:0},children:G(X,{children:`Run query diffs`})}),G(bi,{sx:{display:`list-item`,p:0},children:G(X,{children:`Save checks to your Recce Checklist`})}),G(bi,{sx:{display:`list-item`,p:0},children:G(X,{children:`...and more!`})})]}),G(X,{children:`Take the next step toward better data impact assessment.`})]}),G(Y,{sx:{width:`100%`,mt:3},children:G(J,{color:`iochmara`,variant:`contained`,size:`large`,onClick:()=>{t?t():window.open(e,`_blank`)},children:`Start Now`})})]})})}function Ks({docsUrl:e=`https://docs.reccehq.com/configure-diff/`}={}){return K(Y,{direction:`row`,spacing:`10px`,sx:{alignItems:`flex-start`},children:[G(q,{component:Gi,sx:{color:`iochmara.main`,fontSize:20}}),K(Y,{spacing:`5px`,children:[K(X,{sx:{fontWeight:700},children:[`Single Environment Mode`,` `,G(X,{component:`span`,sx:{color:`error.main`,fontWeight:600},children:`Limited Functionality`})]}),G(X,{sx:{fontSize:`0.875rem`},children:`Single Environment Mode allows you to explore your dbt project but won't show data comparisons between environments.`}),G(X,{sx:{fontSize:`0.875rem`},children:`To set up full environment comparison:`}),K(yi,{sx:{pl:2},children:[G(bi,{sx:{p:0,display:`list-item`},children:G(X,{sx:{fontSize:`0.875rem`},children:"Run `recce debug` for setup assistance"})}),G(bi,{sx:{p:0,display:`list-item`},children:K(X,{sx:{fontSize:`0.875rem`},children:[`Visit`,` `,G(Yn,{sx:{color:`primary.main`,fontWeight:500},target:`_blank`,href:e,children:`docs`}),` `,`for configuration details`]})})]})]})]})}function qs(){return G(q,{sx:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:G(cr,{size:48})})}function Js({error:e,onRetry:t}){return G(q,{sx:{height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:K(Y,{spacing:1,sx:{alignItems:`center`},children:[G(q,{children:`Failed to load lineage data. This could be because the server has been terminated or there is a network error.`}),K(q,{children:[`[Reason: `,e,`]`]}),G(J,{color:`iochmara`,variant:`contained`,onClick:()=>{t&&t()},children:`Retry`})]})})}function Ys({viewOptions:e,onViewOptionsChanged:t}){return G(q,{sx:{height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:K(Y,{spacing:1,sx:{alignItems:`center`},children:[G(W,{children:`No change detected`}),G(J,{color:`iochmara`,variant:`contained`,onClick:async()=>{await t({...e,view_mode:`all`})},children:`Show all nodes`})]})})}function Xs(){let{isHistoryOpen:e,showHistory:t}=_e();if(!e)return K(q,{children:[G(q,{sx:{fontSize:`8pt`},children:`History`}),G(J,{size:`xsmall`,variant:`outlined`,color:`neutral`,startIcon:G(li,{}),onClick:()=>{_n({name:e?`hide`:`show`}),t()},children:`Show`})]})}const Zs=e=>({fontSize:`8pt`,bgcolor:e?`grey.700`:`grey.100`,px:.5,borderRadius:1}),Qs=()=>{let e=Zs(Gt());return K(Y,{spacing:0,sx:{alignItems:`flex-start`},children:[G(X,{sx:{fontSize:`10pt`,color:`text.secondary`,pb:1},children:`Select nodes by dbt node selector syntax`}),K(X,{sx:{fontSize:`8pt`},children:[G(q,{component:`code`,sx:e,children:`model_name`}),` `,`Select a node`]}),K(X,{sx:{fontSize:`8pt`},children:[G(q,{component:`code`,sx:e,children:`model_name+`}),` `,`Select downstream nodes`]}),K(X,{sx:{fontSize:`8pt`},children:[G(q,{component:`code`,sx:e,children:`+model_name`}),` `,`Select upstream nodes`]}),K(X,{sx:{fontSize:`8pt`},children:[G(q,{component:`code`,sx:e,children:`model*`}),` `,`Select by wildcard`]})]})},$s=({isDisabled:e,viewOptions:t,onViewOptionsChanged:n})=>{let[r,i]=U(null),a=!!r,o=t.view_mode??`changed_models`,s=o===`changed_models`?`Changed Models`:`All`,c=e=>{i(e.currentTarget)},l=()=>{i(null)},u=e=>{n({...t,view_mode:e}),l()},d=Re(`model`).icon;return K(W,{children:[G(J,{size:`xsmall`,variant:`outlined`,color:`neutral`,onClick:c,disabled:e,startIcon:d&&G(d,{}),endIcon:G(_r,{}),sx:{minWidth:100,textTransform:`none`,fontSize:`0.75rem`},children:s}),K(ii,{anchorEl:r,open:a,onClose:l,children:[G(di,{sx:{lineHeight:`32px`,bgcolor:`transparent`},children:`mode`}),K(na,{value:o,children:[G($,{onClick:()=>u(`changed_models`),children:G(ti,{value:`changed_models`,control:G(ta,{size:`small`,sx:{py:0}}),label:`Changed Models`,sx:{m:0}})}),G($,{onClick:()=>u(`all`),children:G(ti,{value:`all`,control:G(ta,{size:`small`,sx:{py:0}}),label:`All`,sx:{m:0}})})]})]})]})},ec=({isDisabled:e,viewOptions:t,onViewOptionsChanged:n,lineageGraph:r})=>{let[i,a]=U(null),o=!!i,s=new Set,c=Object.values(r?.nodes??{});for(let e of c)e.data.packageName&&s.add(e.data.packageName);let l=r?.manifestMetadata.current?.project_name,u=t.packages?new Set(t.packages):l?new Set([l]):s,d=u.size===s.size,f=u.size===0,p=u.size===1?Array.from(u)[0]:d?`All Packages`:f?`No Package`:`${u.size} Packages`,m=e=>{a(e.currentTarget)},h=()=>{a(null)},g=()=>{n(d?{...t,packages:[]}:{...t,packages:Array.from(s)})},_=e=>{let r=new Set(u);r.has(e)?r.delete(e):r.add(e),n({...t,packages:Array.from(r)})};return K(W,{children:[G(J,{size:`xsmall`,variant:`outlined`,color:`neutral`,onClick:m,disabled:e,startIcon:G(Vi,{}),endIcon:G(_r,{}),sx:{minWidth:100,textTransform:`none`,fontSize:`0.75rem`},children:p}),K(ii,{anchorEl:i,open:o,onClose:h,children:[G(di,{sx:{lineHeight:`32px`,bgcolor:`transparent`},children:`Select Packages`}),K($,{onClick:g,children:[G(ei,{checked:d,indeterminate:!d&&!f,size:`small`,sx:{py:0}}),G(Li,{children:`Select All`})]}),G(sr,{}),Array.from(s).map(e=>K($,{onClick:()=>_(e),children:[G(ei,{checked:u.has(e),size:`small`,sx:{py:0}}),G(Li,{className:`no-track-pii-safe`,children:e})]},e))]})]})},tc=({value:e,onChange:t,isDisabled:n,tooltipComponent:r,showTooltip:i=!0})=>{let[a,o]=U(e),s=Wn(null);return V(()=>{s.current&&(s.current.value=e)},[e]),G(Q,{title:i?r:``,placement:`bottom-start`,slotProps:{tooltip:{sx:{width:`18.75rem`,p:2,boxShadow:3,border:1,borderRadius:1,color:`text.primary`,bgcolor:`background.paper`}}},children:G(pi,{inputRef:s,size:`small`,placeholder:`with selectors`,disabled:n,value:a,onChange:e=>{o(e.target.value)},onKeyUp:n=>{n.key===`Enter`?t(a):n.key===`Escape`&&(n.preventDefault(),o(e),s.current&&s.current.blur())},onBlur:()=>{o(e)},sx:{"& .MuiInputBase-root":{width:`18.75rem`,height:24,fontSize:`0.75rem`},"& .MuiInputBase-input":{py:.5,px:1}}})})},nc=({isDisabled:e,viewOptions:t,onViewOptionsChanged:n,showTooltip:r})=>G(tc,{isDisabled:e,value:t.select??``,onChange:e=>{n({...t,select:e||void 0})},tooltipComponent:G(Qs,{}),showTooltip:r}),rc=({isDisabled:e,viewOptions:t,onViewOptionsChanged:n})=>G(tc,{isDisabled:e,value:t.exclude??``,onChange:e=>{n({...t,exclude:e||void 0})}}),ic=({label:e,children:t,style:n})=>K(q,{style:n,sx:{maxWidth:300},children:[G(X,{sx:{fontSize:`8pt`},children:(e??``).trim()||G(W,{children:`\xA0`})}),t]}),ac=({children:e})=>G(W,{children:e}),oc=({viewOptions:e,onViewOptionsChanged:t,lineageGraph:n,featureToggles:r,serverFlags:i,focusedNode:a,selectedNodes:o,onDeselect:s,onRunRowCount:c,onRunRowCountDiff:l,onRunValueDiff:u,onAddLineageDiffCheck:d,onAddSchemaDiffCheck:f,runTypeIcons:p,historyToggleSlot:m,SetupConnectionPopoverSlot:h=ac})=>{let g=i?.single_env_onboarding,[_,v]=U(null),y=!!_,b=o.length>0,x=b,S=e=>{v(e.currentTarget)},C=()=>{v(null)},w=p.rowCountDiff,T=p.valueDiff,E=p.lineageDiff,D=p.schemaDiff;return G(Y,{direction:`row`,sx:{alignItems:`center`,borderBottom:1,borderColor:`neutral.light`,width:`100%`,p:`4pt 8pt`,gap:`0.5rem`},children:K(Y,{direction:`row`,sx:{alignItems:`center`,flex:1,gap:`0.5rem`},children:[m,G(ic,{label:`Mode`,style:{flexShrink:1},children:G($s,{isDisabled:x,viewOptions:e,onViewOptionsChanged:t})}),G(ic,{label:`Package`,style:{flexShrink:1},children:G(ec,{isDisabled:x,viewOptions:e,onViewOptionsChanged:t,lineageGraph:n})}),G(ic,{label:`Select`,style:{flexShrink:1},children:G(nc,{isDisabled:x,viewOptions:e,onViewOptionsChanged:t,showTooltip:g})}),G(ic,{label:`Exclude`,style:{flexShrink:1},children:G(rc,{isDisabled:x,viewOptions:e,onViewOptionsChanged:t})}),G(q,{sx:{flexGrow:1}}),b&&K(W,{children:[G(ic,{label:``,style:{flexShrink:0},children:G(X,{sx:{fontSize:`9pt`,color:`text.secondary`},children:o.length>1?`${o.length} nodes selected`:`${o.length} node selected`})}),G(ic,{label:``,children:G(J,{variant:`outlined`,color:`neutral`,size:`xsmall`,onClick:()=>{s()},sx:{textTransform:`none`,fontSize:`9pt`},children:`Deselect`})}),g&&G(ic,{label:`Explore`,children:K(q,{sx:{display:`inline-flex`},children:[G(J,{size:`xsmall`,color:`neutral`,variant:`outlined`,onClick:S,endIcon:G(_r,{}),sx:{textTransform:`none`,fontSize:`0.75rem`},children:`Actions`}),G(ii,{anchorEl:_,open:y,onClose:C,anchorOrigin:{vertical:`bottom`,horizontal:`right`},transformOrigin:{vertical:`top`,horizontal:`right`},children:K($,{disabled:r.disableDatabaseQuery,onClick:async()=>{await c?.(),C()},children:[G(Ii,{children:G(w,{fontSize:`small`})}),G(Li,{children:`Row Count`})]})})]})})]}),!g&&G(ic,{label:`Explore`,children:K(q,{sx:{display:`inline-flex`},children:[G(J,{size:`xsmall`,color:`neutral`,variant:`outlined`,disabled:r.disableViewActionDropdown,onClick:S,endIcon:G(_r,{}),sx:{textTransform:`none`,fontSize:`0.75rem`},children:`Actions`}),K(ii,{anchorEl:_,open:y,onClose:C,anchorOrigin:{vertical:`bottom`,horizontal:`right`},transformOrigin:{vertical:`top`,horizontal:`right`},children:[G(di,{sx:{lineHeight:`32px`,bgcolor:`transparent`},children:`Diff`}),G(h,{display:r.mode===`metadata only`,children:K($,{disabled:r.disableDatabaseQuery,onClick:async()=>{await l?.(),C()},children:[G(Ii,{children:G(w,{fontSize:`small`})}),G(Li,{children:`Row Count Diff`})]})}),G(h,{display:r.mode===`metadata only`,children:K($,{disabled:r.disableDatabaseQuery,onClick:async()=>{await u?.(),C()},children:[G(Ii,{children:G(T,{fontSize:`small`})}),G(Li,{children:`Value Diff`})]})}),(!r.disableUpdateChecklist||r.checklistPermissionDenied)&&[G(sr,{},`checklist-divider`),G(di,{sx:{lineHeight:`32px`,bgcolor:`transparent`},children:`Add to Checklist`},`checklist-header`),G(Q,{title:r.checklistPermissionDenied?`You don't have permission to add checks`:``,placement:`left`,children:G(`span`,{children:K($,{disabled:r.checklistPermissionDenied,onClick:()=>{r.checklistPermissionDenied||(d?.(e.view_mode),C())},children:[G(Ii,{children:G(E,{fontSize:`small`})}),G(Li,{children:`Lineage Diff`})]})})},`add-lineage-diff`),G(Q,{title:r.checklistPermissionDenied?`You don't have permission to add checks`:``,placement:`left`,children:G(`span`,{children:K($,{disabled:r.checklistPermissionDenied,onClick:()=>{r.checklistPermissionDenied||(f?.(),C())},children:[G(Ii,{children:G(D,{fontSize:`small`})}),G(Li,{children:`Schema Diff`})]})})},`add-schema-diff`)]]})]})})]})})},sc=({display:e,children:t})=>G(nl,{display:e,children:t}),cc=()=>{let{deselect:e,focusedNode:t,selectedNodes:n,viewOptions:r,onViewOptionsChanged:i,runRowCount:a,runRowCountDiff:o,runValueDiff:s,addLineageDiffCheck:c,addSchemaDiffCheck:l}=he(),{lineageGraph:u}=F(),{featureToggles:d}=Te(),{data:f}=Ce();return G(oc,{viewOptions:r,onViewOptionsChanged:i,lineageGraph:u,featureToggles:d,serverFlags:f,focusedNode:t,selectedNodes:n,onDeselect:e,onRunRowCount:a,onRunRowCountDiff:o,onRunValueDiff:s,onAddLineageDiffCheck:c,onAddSchemaDiffCheck:l,runTypeIcons:{rowCountDiff:z(`row_count_diff`).icon,valueDiff:z(`value_diff`).icon,lineageDiff:z(`lineage_diff`).icon,schemaDiff:z(`schema_diff`).icon},historyToggleSlot:G(Xs,{}),SetupConnectionPopoverSlot:sc})};function lc(e,t){let n=Lo(t),r=new Set;for(let i of Object.keys(e.nodes)){let a=e.nodes[i];Ro(i,t,a.data.changeStatus,n)&&r.add(i)}return{nodeIds:r,columnIds:n}}function uc(e,t,n,r){return e&&t&&n?.node_id&&n?.column?Io(t,n.node_id,n.column,r??new Set):void 0}async function dc(e,t,n,r,i){let a={...e,change_analysis:e.change_analysis??t},o=await n.mutateAsync(a);return a.change_analysis&&o&&(r.current={pending:!0,cllData:o},i.setQueryData(M.lineage(),e=>e&&{...e,lineage:Hs(e.lineage,o)})),o}function fc({interactive:e=!1,...t},r){let{isDark:i}=Nt(),{apiClient:a}=I(),o=In(),s=Zr(),c=Wn(null),{copyToClipboard:l,ImageDownloadModal:u,ref:d}=Do(),[f,p,m]=Xr(_o),[h,g,b]=Yr([]),{lineageGraph:x,refetchLineageGraph:S,isLoading:w,error:T,refetchRunsAggregated:E}=F(),{featureToggles:O,singleEnv:k}=Te(),{data:ee}=Ce(),A=ee?.new_cll_experience??!1,{runId:te,showRunId:re,closeRunResult:ae,runAction:oe,isRunResultOpen:se}=_e(),{run:N}=Et(te),[P,le]=U({...t.viewOptions}),ue=jo(),de=Wn([]).current,[me,he]=U(void 0),[ge,ye]=U(!1),we=Wn(!1);we.current=ge;let Ee=Pn({mutationFn:e=>n(e,a)}),De=Wn({pending:!1}),[ke,Ae]=U({}),je=B(e=>f.filter(pe).find(t=>t.data.name===e),[f]);Hn(r,()=>({copyToClipboard:l}));let Ne=H(()=>!!(x&&x.modifiedSet.length>0),[x]),Pe=P.view_mode??`changed_models`,Fe=H(()=>f.filter(e=>e.type===`lineageGraphNode`).map(e=>e.id),[f]),Ie=H(()=>x?Fe.map(e=>x.nodes[e]):[],[x,Fe]),[Le,Re]=U(),L=Le?x?.nodes[Le]:void 0,[ze,Be]=U([]),[R,Ve]=U(),[He,Ue]=U(new Set),We=H(()=>x?Array.from(He).map(e=>x.nodes[e]):[],[x,He]),Ge=Po(We.length>0?We:Ie,{onActionStarted:()=>{Ve(`action_result`)},onActionNodeUpdated:e=>{p(t=>t.map(t=>t.id===e.id?{...t}:t))},onActionCompleted:()=>{}}),qe=B(()=>{let e=new Map,t=s.getNodes();for(let n of t)!n.parentId&&n.position&&e.set(n.id,{x:n.position.x,y:n.position.y});return e},[s]),Je=H(()=>{if(!x)return new Set;let e=new Set;if(me){for(let[t,n]of Object.entries(me.current.nodes))n.impacted!==!1&&e.add(t);for(let t of Object.keys(me.current.columns))e.add(t)}else if(R===`action_result`){let t=Object.keys(Ge.actionState.actions);e=new Set(t)}else e=L?ve(Se(x,[L.id]),be(x,[L.id])):Ne?be(x,x.modifiedSet):new Set(Fe);return new Set(e)},[x,me,R,L,Ne,Ge.actionState.actions,Fe]),Ye=Vo(),Xe=()=>{Ye.closeContextMenu()},Ze=Wn(!1),{impactedNodeIds:Qe,impactedColumnIds:$e,publish:et}=ko();Un(()=>{(async()=>{let e;if(!x)return;if(P.node_ids)e=P.node_ids;else{let n=x.manifestMetadata.current?.project_name,r={view_mode:P.view_mode??(Ne?`changed_models`:`all`),packages:n?[n]:void 0,...t.viewOptions};try{e=(await C({select:r.select,exclude:r.exclude,packages:r.packages,view_mode:r.view_mode},a)).nodes}catch{r.view_mode=`all`,e=(await C({select:r.select,exclude:r.exclude,packages:r.packages,view_mode:r.view_mode},a)).nodes}le(r)}let n=P.column_level_lineage,r=!1;ee?.impact_at_startup&&!Ze.current&&!n&&(Ze.current=!0,r=!0,we.current=!0,ye(!0),n={change_analysis:!0,no_upstream:!0},le(e=>({...e,column_level_lineage:n})));let i;if(n)if(De.current.pending)i=De.current.cllData,De.current={pending:!1};else try{i=await dc(n,we.current,Ee,De,o)}catch(e){if(r&&(we.current=!1,ye(!1),le(e=>({...e,column_level_lineage:void 0})),n=void 0),e instanceof ce){Jt.create({title:`Column Level Lineage error`,description:e.data?.detail??e.message,type:`error`,closable:!0});return}}else De.current={pending:!1};let s=A&&i?lc(x,i):void 0,[c,l,u]=await Ho(x,{selectedNodes:e,cll:i,newCllExperience:A,columnAncestry:uc(A,i,n,s?.columnIds)});p(c),g(l),Ae(u),he(i),s&&n?.change_analysis&&!n?.column&&et(s),ue(c,P.view_mode??`changed_models`,we.current,!!n?.column,!!Le||!!N)})()},[x,ee?.impact_at_startup]);let tt=()=>{Re(void 0),Be([])},nt=e=>{x?.nodes[e]&&(Le&&Le!==e&&Be(e=>[...e,Le]),Re(e))},rt=()=>{if(ze.length===0)return;let e=ze[ze.length-1];x?.nodes[e]&&(Re(e),Be(e=>e.slice(0,-1)))},it=e=>{if(e<0||e>=ze.length)return;let t=ze[e];x?.nodes[t]&&(Re(t),Be(t=>t.slice(0,e)))},at=()=>{Le&&ot(Le)},ot=async e=>{let t=f.find(t=>t.id===e);if(t){if(t.parentId){let e=t.parentId;t=f.find(t=>t.id===e)??t}if(t.measured!=null){let{width:e,height:n}=t.measured;if(e&&n){let r=t.position.x+e/2,i=t.position.y+n/2,a=s.getZoom();await s.setCenter(r,i,{zoom:a,duration:200})}}}},st=Oo();Ao(c,async()=>{R!==`selecting`&&(Le?await ot(Le):await s.fitView({nodes:f,duration:200,padding:Ct,minZoom:Me,maxZoom:1}))});let lt=async(e,t=!1)=>{let n=P.column_level_lineage;!e&&!A&&ye(!1);let r=n!==void 0;await mt({...P,column_level_lineage:e},!1,r),t||de.push(n),e?.node_id?Re(e.node_id):e||Re(void 0)},ut=async e=>{if(e){if(de.length===0)return;let e=de.pop();e?await lt(e,!0):await lt(void 0,!0)}else A&&ge?await lt({change_analysis:!0,no_upstream:!0},!0):await lt(void 0,!0)},dt=(e,t)=>{R||lt({node_id:t.data.node.id,column:t.data.column})},ft=(t,n)=>{if(e&&x){if(fe(n)){dt(t,n);return}if(Xe(),!R)Re(n.id),Be([]);else if(R===`action_result`){let e=Ge.actionState.actions[n.id];e.run?.run_id&&re(e.run.run_id),Re(n.id),Be([])}else{let e=new Set(He);He.has(n.id)?e.delete(n.id):e.add(n.id),Ue(e),e.size===0&&Ve(void 0)}}},pt=async e=>{let{viewOptions:t=P}=e,{fitView:n,preservePositions:r=!1}=e,i;if(!x)return;if(P.select!==t.select||P.exclude!==t.exclude||P.packages!==t.packages||P.view_mode!==t.view_mode){try{let e=await C({select:t.select,exclude:t.exclude,packages:t.packages,view_mode:t.view_mode},a);t={...t,column_level_lineage:void 0},i=e.nodes}catch(e){e instanceof ce&&Jt.create({title:`Select node error`,description:e.data?.detail??e.message,type:`error`,closable:!0});return}Re(void 0)}else i=f.map(e=>e.id);let c;if(t.column_level_lineage)try{c=await dc(t.column_level_lineage,ge,Ee,De,o)}catch(e){if(e instanceof ce){Jt.create({title:`Column Level Lineage error`,description:e.data?.detail??e.message,type:`error`,closable:!0});return}}else A||ye(!1);let l;(r||A)&&(l=qe());let u=t.column_level_lineage,d=A&&c?lc(x,c):void 0,[m,h,v]=await Ho(x,{selectedNodes:i,cll:c,existingPositions:l,newCllExperience:A,columnAncestry:uc(A,c,u,d?.columnIds)});p(m),g(h),Ae(v),he(c),d&&!u?.column&&et(d),ue(m,t.view_mode??`changed_models`,ge,!!t.column_level_lineage?.column,!!Le||!!N),N&&(_(N)||D(N)||y(N)||j(N)||ne(N))&&N.params?.model&&!je(N.params.model)&&ae(),n&&(await new Promise(e=>setTimeout(e,1)),s.fitView({nodes:m,duration:200,padding:Ct,minZoom:Me,maxZoom:1}))},mt=async(e,t=!0,n=!1)=>{le(e),await pt({viewOptions:e,fitView:t,preservePositions:n})};V(()=>{let t=N?.type;if(e&&se&&!(!t||[`query_diff`,`query`,`row_count`,`row_count_diff`].includes(t))&&!R){let e;(_(N)||D(N)||y(N)||j(N)||ne(N))&&(e=N.params?.model);let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0,view:window});if(e){let n=je(e);n?pe(n)&&L?.id!==n.id&&ft(t,n):mt({...P,view_mode:`all`})}else tt()}},[N,P,se,R,je,L,e]);let ht=(e,t=1e3)=>{R===`action_result`||x===void 0||(R||(Ve(`selecting`),Ge.reset(),P.column_level_lineage&&mt({...P,column_level_lineage:void 0})),Ue(ve(He,Se(x,[e],t))))},gt=(e,t=1e3)=>{R===`action_result`||x===void 0||(R||(Ve(`selecting`),Ge.reset(),P.column_level_lineage&&mt({...P,column_level_lineage:void 0})),Ue(ve(He,be(x,[e],t))))},_t=(t,n)=>{if(!e||R===`action_result`)return;t.preventDefault();let r=d.current,i=r.getBoundingClientRect(),a=t.clientX-i.left,o=t.clientY-i.top+r.offsetTop;Ye.showContextMenu(a,o,n)},vt=e=>{if(!R){if(!x)return;Ue(new Set([e])),Ve(`selecting`),Re(void 0),Ge.reset()}else if(R===`selecting`){let t=new Set(He);He.has(e)?t.delete(e):t.add(e),Ue(t),t.size===0&&Ve(void 0)}},yt=()=>{Ve(void 0),Ue(new Set),Re(void 0),ae(),E?.()},bt={interactive:e,nodes:f,focusedNode:L,selectedNodes:We,viewOptions:P,showContextMenu:_t,onViewOptionsChanged:mt,selectMode:R,selectNode:vt,selectParentNodes:ht,selectChildNodes:gt,deselect:yt,impactedNodeIds:Qe,impactedColumnIds:$e,isNodeHighlighted:e=>Je.has(e),isNodeSelected:e=>He.has(e),isEdgeHighlighted:(e,t)=>me?e in me.current.parent_map?t in me.current.parent_map[e]:!1:Je.has(e)&&Je.has(t),isNodeShowingChangeAnalysis:e=>{if(!x||!ge)return!1;let t=e in x.nodes?x.nodes[e]:void 0,n=P.column_level_lineage;return n?.node_id&&!n.column?n.node_id===e&&!!t?.data.changeStatus:!!t?.data.changeStatus},changeAnalysisMode:ge,newCllExperience:A,setChangeAnalysisMode:ye,getNodeAction:e=>Ge.actionState.actions[e],getNodeColumnSet:e=>e in ke?new Set(ke[e]):new Set,runRowCount:async()=>{R===`selecting`?(await Ge.runRowCount(),xn({type:`row_count`,selected:`multi`})):L?(oe(`row_count`,{node_names:[L.data.name]},{showForm:!1,showLast:!1}),xn({type:`row_count`,selected:`single`})):(oe(`row_count`,{select:P.select,exclude:P.exclude,packages:P.packages,view_mode:P.view_mode}),xn({type:`row_count`,selected:`none`}))},runRowCountDiff:async()=>{R===`selecting`?(await Ge.runRowCountDiff(),xn({type:`row_count_diff`,selected:`multi`})):L?(oe(`row_count_diff`,{node_names:[L.data.name]},{showForm:!1,showLast:!1}),xn({type:`row_count_diff`,selected:`single`})):(oe(`row_count_diff`,{select:P.select,exclude:P.exclude,packages:P.packages,view_mode:P.view_mode}),xn({type:`row_count_diff`,selected:`none`}))},runValueDiff:async()=>{L?(oe(`value_diff`,{model:L.data.name},{showForm:!0,showLast:!1}),xn({type:`value_diff`,selected:`single`})):(await Ge.runValueDiff(),xn({type:`value_diff`,selected:R===`selecting`?`multi`:`none`}))},addLineageDiffCheck:async()=>{let e=await ie(P,a),t;t=R===`selecting`?`multi`:L?`single`:`none`,xn({type:`lineage_diff`,selected:t}),e&&(await o.invalidateQueries({queryKey:M.checks()}),st(e))},addSchemaDiffCheck:async()=>{let e;R===`selecting`?We.length>0&&(e=await Ge.addSchemaDiffCheck(),yt(),xn({type:`schema_diff`,selected:`multi`})):L?(e=await v({node_id:L.id},a),xn({type:`schema_diff`,selected:`single`})):(e=await v({select:P.select,exclude:P.exclude,packages:P.packages,view_mode:P.view_mode},a),xn({type:`schema_diff`,selected:`none`})),e&&(await o.invalidateQueries({queryKey:M.checks()}),st(e))},cancel:Ge.cancel,actionState:Ge.actionState,centerNode:ot,cll:me,showColumnLevelLineage:lt,resetColumnLevelLineage:ut};return w?G(qs,{}):T?G(Js,{error:T,onRetry:S}):!x||f==_o?G(W,{}):Pe===`changed_models`&&!x.modifiedSet.length?G(Ys,{viewOptions:P,onViewOptionsChanged:mt}):G(xe.Provider,{value:bt,children:K(Mt,{sizes:L?[70,30]:[100,0],minSize:0,gutterSize:5,className:L?void 0:`split-gutter-hidden`,style:{height:`100%`,width:`100%`},children:[K(Y,{ref:c,divider:G(sr,{sx:{borderColor:`grey.200`}}),spacing:0,sx:{contain:`strict`,position:`relative`},children:[e&&K(W,{children:[G(cc,{}),O.mode===`metadata only`&&G(Ws,{})]}),K(Gr,{proOptions:{hideAttribution:!0},nodeTypes:ho,edgeTypes:go,nodes:f,edges:h,onNodesChange:m,onEdgesChange:b,onNodeClick:ft,onNodeContextMenu:_t,onClick:Xe,onInit:async()=>{if(Ne){let e=f.filter(e=>pe(e)&&e.data.changeStatus!==void 0),t=e.length>0?e:f;await s.fitView({nodes:t,duration:200,padding:Ct,minZoom:Me,maxZoom:1})}else{let e=Jr(f,{});await s.setCenter(e.x+e.width/2,e.y+e.height/2,{zoom:1})}},maxZoom:1,minZoom:Ke,nodesDraggable:e,ref:d,colorMode:i?`dark`:`light`,children:[G(Lr,{id:`lineage-bg`,variant:Rr.Dots,color:i?Oe.neutral[700]:Oe.neutral[300],gap:20,size:2}),G(Vr,{showInteractive:!1,position:`top-right`,className:Ft,style:{backgroundColor:i?Oe.neutral[700]:void 0,borderColor:i?Oe.neutral[600]:void 0},children:G(Br,{title:`copy image`,onClick:async()=>{await l(),dn({type:Pe,from:`lineage_view`})},style:{backgroundColor:i?Oe.neutral[700]:void 0,color:i?Oe.neutral[200]:void 0},children:G(q,{component:zi})})}),G(u,{}),G(Ur,{position:`bottom-left`,children:K(Y,{spacing:`5px`,children:[Ne&&G(ct,{variant:`changeStatus`,newCllExperience:A}),P.column_level_lineage&&G(ct,{variant:`transformation`})]})}),G(Ur,{position:`top-center`,children:G(Fo,{notification:k?G(Ks,{}):null,type:`info`})}),G(Ur,{position:`top-left`,children:K(Y,{spacing:`5px`,children:[G(ja,{action:Ee}),f.length==0&&G(X,{sx:{fontSize:`1.25rem`,color:`grey`,opacity:.5},children:`No nodes`})]})}),f.length<=500&&G(Hr,{nodeColor:vo,nodeStrokeWidth:3,zoomable:!0,pannable:!0,bgColor:i?Oe.neutral[800]:void 0,maskColor:i?`${Oe.neutral[900]}99`:`${Oe.neutral[100]}99`}),R===`action_result`&&G(Ur,{position:`bottom-center`,className:`ignore-screenshot`,children:G(Aa,{onClose:()=>{yt()}})})]}),G(Bo,{...Ye.props})]}),L?G(q,{sx:{borderLeft:`solid 1px`,borderColor:`divider`,height:`100%`},children:G(Vs,{node:L,onCloseNode:tt,onNavigateToNode:nt,onBack:ze.length>0?rt:void 0,onCenterFocused:at,historyTrail:ze,onJumpToHistory:it})}):G(q,{})]})})}const pc=zn(fc);function mc(){return G(Kr,{children:G(pc,{interactive:!0})})}const hc=oe({baseURL:rn??``});async function gc(e=hc){return(await e.post(`/api/connect`)).data}function _c({handleParentClose:e,parentOpen:t=!1,ignoreCookie:n=!1,variant:r=`auth`}){let{authed:i}=Te(),{apiClient:a}=I(),[o,s]=U(t||!i),c=Xn.get(`authState`)??`pending`,[l,u]=U(n?`pending`:c);if(l===`ignored`&&!n||i)return null;let d={auth:{title:`Configure Cloud Token`,action:`Get token and configure`},"enable-share":{title:`Enable Sharing with Cloud`,action:`Enable sharing`},"user-profile":{title:`Configure Cloud Token`,action:`Get token and configure`}}[r],f=()=>{s(!1),e&&e(!1)};return K(Gn,{open:o,onClose:f,maxWidth:`sm`,fullWidth:!0,slotProps:{paper:{sx:{borderRadius:`1rem`}}},children:[l!==`authenticating`&&G(Jn,{sx:{textAlign:`center`,fontSize:`1.5rem`},children:d.title}),l===`authenticating`?K(W,{children:[G(qn,{className:`space-y-2 self-center font-light`,children:K(Y,{spacing:2,sx:{alignItems:`center`,pt:`1rem`},children:[G(q,{component:`img`,sx:{height:`6rem`,objectFit:`contain`,mx:`auto`,mb:1},src:`/imgs/reload-image.svg`,alt:`Reload`}),G(X,{sx:{fontSize:`1.5rem`,fontWeight:500},children:`Reload to Finish`}),G(X,{children:`Reload to complete connection to Recce Cloud`})]})}),G(Kn,{sx:{px:3,pb:3},children:G(J,{fullWidth:!0,color:`brand`,variant:`contained`,onClick:()=>{window.location.reload()},children:`Reload`})})]}):K(W,{children:[K(qn,{className:`space-y-2 font-light`,children:[G(X,{children:`To enable sharing, get your token from Recce Cloud and launch your local instance with it.`}),K(`ul`,{className:`list-inside list-disc`,children:[G(`li`,{children:`Share your instance with teammates via Recce Cloud.`}),G(`li`,{children:`Your instance will be securely and freely hosted for sharing.`}),r===`auth`&&G(`li`,{children:`This step is recommended but optional.`})]}),K(q,{sx:{display:`flex`,gap:1},children:[`More directions`,K(Yn,{underline:`always`,sx:{color:`primary.main`,"&:focus":{outline:`none`}},href:new URL(`/connect-to-cloud`,an).href,target:`_blank`,children:[`here `,G(Zn,{style:{display:`inline`}})]})]})]}),K(Kn,{sx:{flexDirection:`column`,gap:1,px:3,pb:3},children:[K(J,{fullWidth:!0,color:`brand`,variant:`contained`,sx:{borderRadius:2,fontWeight:500},onClick:async()=>{u(`authenticating`);let{connection_url:e}=await gc(a);window.open(e,`_blank`)},children:[d.action,` `,G(Zn,{style:{marginLeft:4}})]}),G(J,{fullWidth:!0,color:`neutral`,variant:`text`,size:`small`,sx:{borderRadius:2,fontWeight:500},onClick:f,children:r===`auth`?`Skip`:`Cancel`}),r===`auth`&&G(J,{fullWidth:!0,variant:`text`,size:`small`,sx:{borderRadius:2,fontWeight:500,color:`text.primary`},onClick:()=>{Xn.set(`authState`,`ignored`,{expires:30}),u(`ignored`),f()},children:`Snooze for 30 days`})]})]})]})}function vc(){let{apiClient:e}=I(),{data:t,isLoading:n,error:r}=Fn({queryKey:M.user(),queryFn:()=>nn(e),retry:!1}),{data:i}=Fn({queryKey:[`github-avatar`,t?.id],queryFn:()=>t?tn(t.id):Promise.resolve(null),enabled:!!t?.id&&t.login_type===`github`,retry:!1,staleTime:300*1e3}),[a,o]=U(null),s=!!a,c=e=>{o(e.currentTarget)},l=()=>{o(null)},u=!n&&!r&&t;return K(W,{children:[n?G(q,{onClick:c,sx:{width:32,height:32,borderRadius:`50%`,bgcolor:`background.paper`,color:`primary.main`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`},children:G(cr,{size:16})}):G(Ci,{onClick:c,src:i||void 0,sx:{width:28,height:28,cursor:`pointer`,outline:`1px solid white`,fontSize:`0.875rem`},children:(e=>e?e.charAt(0).toUpperCase():`U`)(t?.login)}),K(ii,{anchorEl:a,open:s,onClose:l,slotProps:{paper:{sx:{bgcolor:`background.paper`,borderColor:`divider`,boxShadow:3,minWidth:180}}},children:[K(q,{sx:{px:2,py:1.5},children:[n&&K(q,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[G(X,{variant:`body2`,sx:{color:`text.primary`},children:`Loading...`}),G(cr,{size:16})]}),r&&G(X,{variant:`caption`,color:`error`,children:`Failed to load user information`}),u&&K(W,{children:[G(X,{variant:`body2`,sx:{fontWeight:`600`,color:`text.primary`},children:t.login}),t.email&&G(X,{variant:`caption`,sx:{color:`text.secondary`},children:t.email})]})]}),G(sr,{}),K($,{onClick:()=>{window.open(an,`_blank`),l()},children:[G(Ii,{children:G(lr,{})}),G(Li,{children:`Recce Cloud`})]}),K($,{onClick:()=>{window.open(on,`_blank`),l()},children:[G(Ii,{children:G(hr,{})}),G(Li,{children:`Get live support`})]})]})]})}const yc=()=>{let{setTheme:e,resolvedTheme:t}=tr(),[n,r]=U(!1);V(()=>{r(!0)},[]);let i=()=>{e(t===`dark`?`light`:`dark`)};if(!n)return G(Z,{size:`small`,sx:{color:`rgba(255, 255, 255, 0.8)`,"&:hover":{bgcolor:`rgba(255, 255, 255, 0.1)`}},disabled:!0,children:G(jr,{style:{width:18,height:18}})});let a=t===`dark`;return G(Q,{title:a?`Switch to light mode`:`Switch to dark mode`,children:G(Z,{size:`small`,onClick:i,sx:{color:`rgba(255, 255, 255, 0.8)`,"&:hover":{bgcolor:`rgba(255, 255, 255, 0.1)`}},"aria-label":a?`Switch to light mode`:`Switch to dark mode`,children:G(a?jr:Tr,{style:{width:18,height:18}})})})};function bc(e,t,n,r){let i=e?.git,a=e?.pullRequest,o=e?.dbt?.base,s=e?.dbt?.current,c={review_mode:t||!1,adapter_type:e?.adapterType||null,has_git_info:!ai(i),has_pr_info:!ai(a)};return e?.adapterType===`dbt`&&(c.base={schema_count:n.size,dbt_version:o?.dbt_version||null,timestamp:o?.generated_at||null},c.current={schema_count:r.size,dbt_version:s?.dbt_version||null,timestamp:s?.generated_at||null},c.schemas_match=n.size===r.size&&Array.from(n).every(e=>r.has(e))),e?.adapterType===`sqlmesh`&&(c.base={has_env:!!e.sqlmesh?.base_env},c.current={has_env:!!e.sqlmesh?.current_env}),c}function xc(e){return Object.values(e).every(e=>e===null)?[G(q,{sx:{ml:`10px`},children:`No information`},`no info`)]:Object.entries(e).filter(([e,t])=>e!==`url`&&t!=null).map(([e,t])=>K(`li`,{style:{marginLeft:`10px`},children:[e,`: `,t]},e))}function Sc(){let{envInfo:e,reviewMode:t,lineageGraph:n}=F(),[r,i]=U(!1),a=e?.git,o=e?.pullRequest,s={...a,...o},c=e?.dbt?.base,l=e?.dbt?.current,u=c?.generated_at?Kt(c.generated_at):``,d=l?.generated_at?Kt(l.generated_at):``,f=``,p=``;c&&(f=c.generated_at?Yt(c.generated_at):``),l&&(p=l.generated_at?Yt(l.generated_at):``);let[m,h]=$t(n),g=Wn(!1);V(()=>{!g.current&&e&&(g.current=!0,hn(bc(e,t,m,h)))},[e,t,m,h]);let _=()=>i(!0),v=()=>i(!1);return K(W,{children:[G(Q,{title:`Environment Info`,placement:`bottom-end`,children:K(q,{sx:{display:`flex`,alignItems:`center`,cursor:`pointer`,"&:hover":{color:`text.primary`}},onClick:_,children:[K(Y,{direction:`column`,sx:{display:{xs:`none`,lg:`flex`},fontSize:`0.875rem`},children:[K(q,{sx:{display:`flex`,alignItems:`baseline`,gap:.5},children:[G(X,{component:`span`,noWrap:!0,sx:{color:`warning.main`,maxWidth:128},className:`no-track-pii-safe`,children:Array.from(m).join(`, `)}),K(X,{component:`span`,noWrap:!0,children:[`(`,f,`)`]})]}),K(q,{sx:{display:`flex`,alignItems:`baseline`,gap:.5},children:[G(X,{component:`span`,noWrap:!0,sx:{color:`primary.main`,maxWidth:128},className:`no-track-pii-safe`,children:Array.from(h).join(`, `)}),K(X,{component:`span`,noWrap:!0,children:[`(`,p,`)`]})]})]}),G(Z,{size:`small`,"aria-label":`Environment Info`,children:G(q,{component:Cr,sx:{fontSize:16,verticalAlign:`middle`}})})]})}),K(Gn,{open:r,onClose:v,maxWidth:`sm`,fullWidth:!0,children:[K(Jn,{sx:{display:`flex`,alignItems:`center`},children:[`Environment Information`,G(q,{sx:{flexGrow:1}}),G(Z,{size:`small`,onClick:v,children:G(ir,{})})]}),G(qn,{children:K(Y,{direction:`column`,spacing:1,children:[t?K(Y,{direction:`column`,spacing:.5,children:[G(X,{variant:`h6`,sx:{fontSize:`1rem`},children:`Review Information`}),K(`ul`,{style:{margin:0,paddingLeft:`20px`},children:[s.url&&K(`li`,{style:{marginLeft:`10px`},children:[`url:`,` `,K(Yn,{href:s.url,target:`_blank`,sx:{color:`primary.main`},children:[s.url,` `,G(Zn,{})]})]}),!ai(s)&&xc(s)]})]}):K(Y,{direction:`column`,spacing:.5,children:[G(X,{variant:`h6`,sx:{fontSize:`1rem`},children:`Dev Information`}),G(`ul`,{style:{margin:0,paddingLeft:`20px`},children:a&&xc(a)})]}),G(sr,{}),e?.adapterType===`dbt`&&K(Y,{direction:`column`,spacing:.5,children:[G(X,{variant:`h6`,sx:{fontSize:`1rem`},children:`DBT`}),G(oa,{sx:{border:1,borderColor:`divider`,maxHeight:`30rem`},children:K(ra,{size:`small`,stickyHeader:!0,children:[G(sa,{children:K(ca,{children:[G(aa,{}),G(aa,{children:`base`}),G(aa,{children:`current`})]})}),K(ia,{children:[K(ca,{children:[G(aa,{children:`schema`}),G(aa,{className:`no-track-pii-safe`,children:Array.from(m).map(e=>G(Q,{title:e,placement:`bottom`,children:G(`div`,{className:`max-w-72 truncate`,children:e})},e))}),G(aa,{className:`no-track-pii-safe`,children:Array.from(h).map(e=>G(Q,{title:e,placement:`bottom`,children:G(`div`,{className:`max-w-72 truncate`,children:e})},e))})]}),K(ca,{children:[G(aa,{children:`version`}),G(aa,{children:c?.dbt_version}),G(aa,{children:l?.dbt_version})]}),K(ca,{children:[G(aa,{children:`timestamp`}),G(aa,{children:u}),G(aa,{children:d})]})]})]})})]}),e?.adapterType===`sqlmesh`&&K(Y,{direction:`column`,spacing:.5,children:[G(X,{variant:`h6`,sx:{fontSize:`1rem`},children:`SQLMesh`}),G(oa,{sx:{border:1,borderColor:`divider`,maxHeight:`30rem`},children:K(ra,{stickyHeader:!0,children:[G(sa,{children:K(ca,{children:[G(aa,{}),G(aa,{children:`base`}),G(aa,{children:`current`})]})}),G(ia,{children:K(ca,{children:[G(aa,{children:`Environment`}),G(aa,{className:`no-track-pii-safe`,children:e.sqlmesh?.base_env}),G(aa,{className:`no-track-pii-safe`,children:e.sqlmesh?.current_env})]})})]})})]})]})}),G(Kn,{children:G(J,{color:`iochmara`,onClick:v,children:`Close`})})]})]})}const Cc=()=>({toastSuccess:e=>{Jt.create({description:e,type:`success`,duration:5e3,closable:!0})},toastError:(e,t)=>{let n=e;t!=null&&(n=se(t)?`${e}. ${String(t.data?.detail)}`:`${e}. ${t}`),Jt.create({description:n,type:`error`,duration:5e3,closable:!0})}}),wc=e=>{V(()=>{let t=e=>{e.preventDefault()};return e&&window.addEventListener(`beforeunload`,t),()=>{e&&window.removeEventListener(`beforeunload`,t)}},[e])},Tc=()=>{let{featureToggles:e}=Te(),{fileName:t,cloudMode:n,isDemoSite:i,envInfo:a}=F(),{apiClient:o}=I(),[s,c]=U(!1),[l,u]=U(!1),d=!t&&!n&&!i,{data:f}=r(d),m=f!=null&&f.filter(e=>!e.is_preset).length>0;wc(d&&m);let[{newFileName:g,errorMessage:_,modified:v,overwriteWithMethod:y,bypass:b},x]=U({newFileName:t??`recce_state.json`,bypass:!1}),S=Wn(null),{toastSuccess:C,toastError:w}=Cc(),T=In(),E=()=>{x({newFileName:t??`recce_state.json`,modified:!t,bypass:!1}),c(!0)},D=()=>c(!1),O=()=>u(!1),k=async(e,t)=>{if(!g)return;let n=localStorage.getItem(p.bypassSaveOverwrite)===`true`;try{e===`save`?await h({filename:g,overwrite:t??n},o):await te({filename:g,overwrite:t??n},o),C(e===`save`?`Save file successfully`:`Rename file successfully`),await T.invalidateQueries({queryKey:M.lineage()}),b&&localStorage.setItem(p.bypassSaveOverwrite,`true`)}catch(t){if(se(t)&&t.status===409){x(t=>({...t,overwriteWithMethod:e})),u(!0);return}w(e===`save`?`Save file failed`:`Rename file failed`,t)}finally{D()}},ee=()=>{O(),c(!0),x(e=>({...e,overwriteWithMethod:void 0}))};if(n||i)return G(W,{});let A=`New Instance`+(m?` (unsaved)`:``),ne;if(e.disableSaveToFile&&t){let e=a?.stateMetadata?.generated_at,n=e?xt(new Date(e)):null;ne=n?`${t} (${n})`:null}return K(W,{children:[K(Y,{direction:`row`,sx:{alignItems:`center`,justifyContent:`center`},children:[G(q,{sx:{fontWeight:600},children:ne??t??A}),!e.disableSaveToFile&&G(Q,{title:t?`Change Filename`:`Save`,enterDelay:1e3,children:G(Z,{onClick:E,"aria-label":t?`Change Filename`:`Save`,size:`small`,children:G(q,{component:t?Dr:Qn,sx:{fontSize:16,verticalAlign:`middle`}})})})]}),K(Gn,{open:s,onClose:D,children:[K(Jn,{sx:{display:`flex`,alignItems:`center`},children:[t?`Change Filename`:`Save File`,G(q,{sx:{flexGrow:1}}),G(Z,{size:`small`,onClick:D,children:G(ir,{})})]}),G(qn,{onKeyDown:e=>{e.stopPropagation()},children:G(pi,{inputRef:S,value:g,label:`File name`,placeholder:`Enter filename`,error:!!_,helperText:_,fullWidth:!0,size:`small`,sx:{mt:1},onChange:e=>{let n=e.target.value,r;n?n.endsWith(`.json`)?/^[a-zA-Z0-9 _-]+\.json$/.test(n)?t&&n===t&&(r=`Filename is the same as the current one.`):r=`Invalid filename. Only alphanumeric, space, _ and - are allowed.`:r=`Filename must end with .json.`:r=`Filename cannot be empty.`,x(e=>({...e,modified:!0,newFileName:n,errorMessage:r}))},onKeyDown:e=>{if(e.key===`Enter`){if(_)return;k(t?`rename`:`save`)}else e.key===`Escape`&&D()}})}),K(Kn,{sx:{gap:`5px`},children:[G(J,{size:`small`,color:t?`inherit`:`iochmara`,variant:`contained`,onClick:async()=>{await k(`save`)},disabled:!g||!!_||!v,children:t?`Save as New File`:`Confirm`}),t&&G(J,{size:`small`,color:`iochmara`,variant:`contained`,onClick:async()=>{await k(`rename`)},disabled:!g||!!_||!v,children:`Rename`})]})]}),K(Gn,{open:l,onClose:O,children:[K(Jn,{sx:{display:`flex`,alignItems:`center`},children:[`Overwrite File?`,G(q,{sx:{flexGrow:1}}),G(Z,{size:`small`,onClick:O,children:G(ir,{})})]}),K(qn,{sx:{borderTop:`solid 1px`,borderBottom:`solid 1px`,borderColor:`divider`},onKeyDown:e=>{e.stopPropagation()},children:[G(X,{sx:{fontSize:`12pt`},children:y===`save`?`Saving a file with this name will overwrite the existing file. Are you sure you wish to continue?`:`Renaming the file with this name will overwrite the existing file. Are you sure you wish to continue?`}),G(ti,{control:G(ei,{size:`small`,checked:b,onChange:e=>{x(t=>({...t,bypass:e.target.checked}))}}),label:G(X,{sx:{fontWeight:`bold`,pt:`8px`},children:`Don't show this again`})})]}),K(Kn,{sx:{gap:`5px`},children:[G(J,{variant:`outlined`,onClick:ee,size:`small`,children:`Back`}),G(J,{size:`small`,color:`iochmara`,variant:`contained`,onClick:()=>{y&&(k(y,!0),O())},children:`Overwrite`})]})]})]})};function Ec({anchorEl:e}){let[t,n]=U(!1),r=Wn(!1);V(()=>{if(!r.current){r.current=!0;try{localStorage.getItem(p.snapshotBaseIntroSeen)||n(!0)}catch{}}},[]);let i=B(()=>{try{localStorage.setItem(p.snapshotBaseIntroSeen,`1`)}catch{}n(!1)},[]);return K(wi,{open:t&&e!==null,anchorEl:e,onClose:i,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},disableAutoFocus:!0,slotProps:{paper:{sx:{bgcolor:`grey.800`,color:`white`,p:2,maxWidth:360}}},children:[G(X,{variant:`body2`,sx:{mb:1.5},children:`New: Recce now snapshots your base data when each PR is created. We'll let you know when production has changed since then so your comparisons stay accurate.`}),G(J,{size:`small`,variant:`contained`,onClick:i,sx:{bgcolor:`grey.600`,"&:hover":{bgcolor:`grey.500`}},children:`Got it`})]})}function Dc(){let{cloudMode:e}=F(),{apiClient:t}=I(),[n,r]=U(!1),i=Wn(null),[a,o]=U(null),{data:s}=Ze({select:e=>e.session_staleness}),c=Wn(null),l=s==null?!1:re(s);if(V(()=>{c.current===!0&&!l&&(Jt.success({description:`Base refreshed. If you've saved checks in this session, you may want to re-run them against the new base.`,duration:8e3,closable:!0}),r(!1),i.current&&=(clearTimeout(i.current),null)),c.current=l},[l]),V(()=>()=>{i.current&&clearTimeout(i.current)},[]),!e||!s||!l)return null;let u=s.current_base_session_id===null,f=async()=>{r(!0),i.current=setTimeout(()=>{r(!1),Jt.error({description:`Refresh failed — try again.`,duration:5e3,closable:!0}),i.current=null},3e4);try{await d(t)}catch{if(!i.current)return;clearTimeout(i.current),i.current=null,r(!1),Jt.error({description:`Refresh failed — try again.`,duration:5e3,closable:!0})}};return K(q,{ref:o,role:`status`,sx:{bgcolor:`warning.light`,borderBottom:1,borderColor:`warning.main`,px:2,py:.75},children:[K(Y,{direction:`row`,spacing:1,sx:{alignItems:`center`},children:[G(Mi,{color:`inherit`,size:16}),G(X,{variant:`body2`,sx:{flex:1},children:u?`This PR's base snapshot may be out of date, and no shared base is currently configured for this project. Comparisons may not reflect current state.`:`Production data has changed since this PR's base was captured. Comparisons may not reflect current state.`}),G(Q,{title:u?`No shared base configured for this project.`:``,disableHoverListener:!u,children:G(`span`,{children:G(J,{size:`small`,variant:`outlined`,onClick:()=>void f(),disabled:n||u,startIcon:n?G(cr,{size:12}):void 0,sx:{whiteSpace:`nowrap`},children:n?`Refreshing…`:`Refresh base`})})})]}),G(Ec,{anchorEl:a})]})}async function Oc(e){return(await e.get(`/api/cloud/organizations`)).data.organizations}async function kc(e,t){return(await e.get(`/api/cloud/organizations/${t}/projects`)).data.projects}async function Ac(e,t,n){return(await e.get(`/api/cloud/organizations/${t}/projects/${n}/base-status`)).data}async function jc(e,t){return(await e.post(`/api/cloud/upload`,t)).data}async function Mc(e){return(await e.get(`/api/connection-info`)).data.connection_info}async function Nc(e,t){return(await e.post(`/api/cloud/warehouse-setup`,t)).data}const Pc={snowflake:{type:`snowflake`,label:`Snowflake`,commonFields:[{name:`account`,label:`Account`,type:`text`,isCredential:!1,required:!0},{name:`user`,label:`User`,type:`text`,isCredential:!1,required:!0},{name:`warehouse`,label:`Warehouse`,type:`text`,isCredential:!1,required:!0},{name:`database`,label:`Database`,type:`text`,isCredential:!1,required:!0},{name:`schema`,label:`Schema`,type:`text`,isCredential:!1,required:!0}],authMethods:[{value:`user-password`,label:`User & Password`,fields:[{name:`password`,label:`Password`,type:`password`,isCredential:!0,required:!0}]},{value:`key-pair`,label:`Key Pair`,fields:[{name:`private_key`,label:`Private Key`,type:`textarea`,isCredential:!0,required:!0,placeholder:`Paste PEM-encoded private key`},{name:`private_key_passphrase`,label:`Private Key Passphrase`,type:`password`,isCredential:!0,required:!1}]}]},databricks:{type:`databricks`,label:`Databricks`,commonFields:[{name:`host`,label:`Host`,type:`text`,isCredential:!1,required:!0},{name:`http_path`,label:`HTTP Path`,type:`text`,isCredential:!1,required:!0},{name:`catalog`,label:`Catalog`,type:`text`,isCredential:!1,required:!1,prefillFrom:`database`},{name:`schema`,label:`Schema`,type:`text`,isCredential:!1,required:!0}],authMethods:[{value:`token`,label:`Token`,fields:[{name:`token`,label:`Access Token`,type:`password`,isCredential:!0,required:!0}]},{value:`oauth`,label:`OAuth (M2M)`,fields:[{name:`client_id`,label:`Client ID`,type:`text`,isCredential:!0,required:!0},{name:`client_secret`,label:`Client Secret`,type:`password`,isCredential:!0,required:!0}]}]},bigquery:{type:`bigquery`,label:`BigQuery`,commonFields:[{name:`project`,label:`Project`,type:`text`,isCredential:!1,required:!0,prefillFrom:`database`},{name:`dataset`,label:`Dataset`,type:`text`,isCredential:!1,required:!0,prefillFrom:`schema`}],authMethods:[{value:`service-account-json`,label:`Service Account JSON`,fields:[{name:`keyfile_json`,label:`Service Account Key (JSON)`,type:`textarea`,isCredential:!0,required:!0,placeholder:`Paste service account JSON`}]}]},redshift:{type:`redshift`,label:`Redshift`,commonFields:[{name:`host`,label:`Host`,type:`text`,isCredential:!1,required:!0},{name:`user`,label:`User`,type:`text`,isCredential:!1,required:!0},{name:`port`,label:`Port`,type:`number`,isCredential:!1,required:!0},{name:`dbname`,label:`Database`,type:`text`,isCredential:!1,required:!0,prefillFrom:`database`},{name:`schema`,label:`Schema`,type:`text`,isCredential:!1,required:!0}],authMethods:[{value:`password`,label:`Password`,fields:[{name:`password`,label:`Password`,type:`password`,isCredential:!0,required:!0}]}]}};function Fc(e){return e in Pc}function Ic(e){return Pc[e]?.authMethods[0]?.value??``}function Lc(e,t){let n=Pc[e];if(!n)return[];let r=n.authMethods.find(e=>e.value===t);return[...n.commonFields,...r?.fields??[]]}function Rc(e,t){let n=Pc[e];if(!n)return{};let r={};for(let e of n.commonFields){if(e.isCredential)continue;let n=t[e.prefillFrom??e.name];n!=null&&(r[e.name]=String(n))}return r}function zc({open:e,onClose:t}){let{apiClient:n}=I(),[r,i]=U(`select`),[a,o]=U([]),[s,c]=U([]),[l,u]=U(``),[d,f]=U(``),[p,m]=U(``),[h,g]=U(!1),[_,v]=U(!1),[y,b]=U(``),[x,S]=U(!1),[C,w]=U(``),[T,E]=U(null),[D,O]=U({}),[k,ee]=U(``),[A,te]=U(null);V(()=>{e&&(i(`select`),m(`dev-${new Date().toISOString().slice(0,16).replace(`T`,`-`).replace(`:`,``)}`),g(!0),Oc(n).then(e=>{o(e),e.length===1&&u(String(e[0].id))}).catch(()=>o([])).finally(()=>g(!1)))},[e,n]),V(()=>{if(!l){c([]),f(``);return}v(!0),f(``),kc(n,l).then(e=>{c(e),e.length===1&&f(String(e[0].id))}).catch(()=>c([])).finally(()=>v(!1))},[l,n]),V(()=>{if(!l||!d){S(!1);return}Ac(n,l,d).then(e=>S(e.base_needs_upload)).catch(()=>S(!1))},[l,d,n]);let ne=async()=>{if(!(!l||!d||!p.trim())){ln(),i(`uploading`);try{let e=await jc(n,{org_id:l,project_id:d,session_name:p.trim()});if(e.status===`success`&&e.session_url){te({sessionUrl:e.session_url,baseUploaded:x});let t=ae?.warehouse_connection?null:await Mc(n);t&&Fc(t.type)?(E(t),O(Rc(t.type,t)),ee(Ic(t.type)),pn(),i(`dw_setup`)):(b(e.session_url),i(`success`),En(),window.open(e.session_url,`_blank`))}else w(e.message||`Upload failed`),i(`error`)}catch(e){w(e instanceof Error?e.message:`An error occurred during upload`),i(`error`)}}},re=async()=>{if(!T||!A)return;let e=Lc(T.type,k),t=[];for(let n of e){let e=D[n.name]?.trim();if(n.required&&!e)t.push(`${n.label} is required`);else if(n.type===`number`&&e){let r=Number(e);Number.isFinite(r)||t.push(`${n.label} must be a valid number`)}}if(t.length>0){w(t.join(`. `)),i(`dw_error`);return}i(`dw_saving`);try{let t={type:T.type};T.type===`databricks`&&k===`oauth`&&(t.auth_type=`oauth`),T.type===`bigquery`&&(t.method=`service-account-json`);for(let n of e){let e=D[n.name];e&&(t[n.name]=n.type===`number`?Number(e):e)}await Nc(n,{org_id:l,project_id:d,connection_name:`${ae?.display_name||ae?.name||`Project`} DW`,config:t}),fn(),b(A.sessionUrl),i(`success`),En(),window.open(A.sessionUrl,`_blank`)}catch(e){w(e instanceof Error?e.message:`Failed to set up warehouse connection`),i(`dw_error`)}},ie=()=>{A&&(mn(),b(A.sessionUrl),i(`success`),En(),window.open(A.sessionUrl,`_blank`))},j=a.find(e=>String(e.id)===l),ae=s.find(e=>String(e.id)===d),M=j&&ae?`${an}/${j.name}/${ae.name}`:void 0,oe=l&&d&&p.trim()&&!h;return K(Gn,{open:e,onClose:r===`uploading`||r===`dw_saving`?void 0:t,maxWidth:`sm`,fullWidth:!0,slotProps:{paper:{sx:{borderRadius:`1rem`}}},children:[r===`select`&&K(W,{children:[G(Jn,{sx:{textAlign:`center`,fontSize:`1.25rem`,pb:.5},children:`Upload to Recce Cloud`}),G(qn,{children:K(Y,{spacing:2,sx:{pt:.5},children:[G(X,{variant:`body2`,sx:{color:`text.secondary`},children:`Upload your local artifacts to Recce Cloud so your team can review and query the data.`}),K(fi,{fullWidth:!0,size:`small`,children:[G(la,{children:`Organization`}),G(ua,{value:l,label:`Organization`,onChange:e=>u(e.target.value),disabled:h,children:a.map(e=>G($,{value:String(e.id),children:e.display_name||e.name},e.id))})]}),K(fi,{fullWidth:!0,size:`small`,children:[G(la,{children:`Project`}),G(ua,{value:d,label:`Project`,onChange:e=>f(e.target.value),disabled:!l||_,children:s.map(e=>G($,{value:String(e.id),children:e.display_name||e.name},e.id))})]}),G(pi,{fullWidth:!0,size:`small`,label:`Session Name`,value:p,onChange:e=>m(e.target.value),placeholder:`e.g., my-feature-review`}),x&&G(X,{variant:`body2`,sx:{color:`text.secondary`},children:`Base artifacts will also be uploaded to set up the project's base environment for diffing.`})]})}),G(Kn,{sx:{px:3,pb:3},children:G(J,{fullWidth:!0,variant:`contained`,color:`primary`,onClick:ne,disabled:!oe,sx:{borderRadius:2,fontWeight:500},children:`Upload`})})]}),r===`uploading`&&G(qn,{children:K(Y,{spacing:1.5,sx:{alignItems:`center`,py:3},children:[G(cr,{size:36}),G(X,{sx:{fontWeight:500,fontSize:`1rem`},children:`Uploading artifacts...`}),G(X,{variant:`body2`,sx:{color:`text.secondary`,textAlign:`center`},children:x?`Uploading base and current artifacts. This may take a moment.`:`This may take a moment.`})]})}),r===`dw_setup`&&T&&(()=>{let e=Pc[T.type];if(!e)return null;let t=e.authMethods.length>1,n=e.authMethods.find(e=>e.value===k);return K(W,{children:[G(Jn,{sx:{textAlign:`center`,fontSize:`1.25rem`,pb:.5},children:`Set Up Data Warehouse`}),G(qn,{children:K(Y,{spacing:2,sx:{pt:.5},children:[K(X,{variant:`body2`,sx:{color:`text.secondary`},children:[`Connect your `,e.label,` warehouse so Recce Cloud can query your data. You can skip this and set it up later.`]}),e.commonFields.map(e=>G(pi,{fullWidth:!0,size:`small`,label:e.label,type:e.type===`textarea`?`text`:e.type,multiline:e.type===`textarea`,minRows:e.type===`textarea`?3:void 0,required:e.required,placeholder:e.placeholder,value:D[e.name]??``,onChange:t=>O(n=>({...n,[e.name]:t.target.value}))},e.name)),t&&K(fi,{fullWidth:!0,size:`small`,children:[G(la,{children:`Authentication`}),G(ua,{value:k,label:`Authentication`,onChange:t=>{ee(t.target.value),O(t=>{let n={...t};for(let t of e.authMethods)for(let e of t.fields)delete n[e.name];return n})},children:e.authMethods.map(e=>G($,{value:e.value,children:e.label},e.value))})]}),n?.fields.map(e=>G(pi,{fullWidth:!0,size:`small`,label:e.label,type:e.type===`textarea`?`text`:e.type,multiline:e.type===`textarea`,minRows:e.type===`textarea`?3:void 0,required:e.required,placeholder:e.placeholder,value:D[e.name]??``,onChange:t=>O(n=>({...n,[e.name]:t.target.value}))},e.name))]})}),K(Kn,{sx:{px:3,pb:3,gap:1},children:[G(J,{fullWidth:!0,variant:`outlined`,color:`neutral`,onClick:ie,sx:{borderRadius:2,fontWeight:500},children:`Skip`}),G(J,{fullWidth:!0,variant:`contained`,color:`primary`,onClick:re,sx:{borderRadius:2,fontWeight:500},children:`Setup & Continue`})]})]})})(),r===`dw_saving`&&G(qn,{children:K(Y,{spacing:1.5,sx:{alignItems:`center`,py:3},children:[G(cr,{size:36}),G(X,{sx:{fontWeight:500,fontSize:`1rem`},children:`Setting up warehouse connection...`})]})}),r===`success`&&K(qn,{sx:{position:`relative`},children:[G(Z,{size:`small`,onClick:t,sx:{position:`absolute`,top:8,right:8},"aria-label":`Close`,children:G(Fr,{})}),K(Y,{spacing:1.5,sx:{alignItems:`center`,pt:2,pb:1},children:[G(q,{component:yr,sx:{fontSize:36,color:`success.main`}}),G(X,{sx:{fontWeight:600,fontSize:`1rem`},children:`Upload Complete`}),G(X,{variant:`body2`,sx:{color:`text.secondary`,textAlign:`center`},children:`Your artifacts have been uploaded to Recce Cloud.`}),G(J,{variant:`contained`,color:`primary`,href:y,target:`_blank`,component:`a`,sx:{borderRadius:2,textTransform:`none`,fontWeight:600,mt:1},children:`Open in Recce Cloud`}),M&&K(Yn,{href:M,target:`_blank`,sx:{display:`flex`,alignItems:`center`,gap:.5,fontSize:`0.8125rem`,mt:1},children:[`Go to project page `,G(Zn,{size:12})]})]})]}),r===`dw_error`&&K(W,{children:[G(qn,{children:K(Y,{spacing:1.5,sx:{alignItems:`center`,py:2},children:[G(X,{sx:{fontWeight:500,fontSize:`1rem`},children:`Warehouse Setup Failed`}),G(X,{variant:`body2`,sx:{color:`text.secondary`,textAlign:`center`},children:C})]})}),K(Kn,{sx:{px:3,pb:2,gap:1},children:[G(J,{fullWidth:!0,variant:`outlined`,color:`neutral`,onClick:ie,sx:{borderRadius:2,fontWeight:500},children:`Skip`}),G(J,{fullWidth:!0,variant:`contained`,color:`primary`,onClick:()=>i(`dw_setup`),sx:{borderRadius:2,fontWeight:500},children:`Retry Setup`})]})]}),r===`error`&&K(W,{children:[G(qn,{children:K(Y,{spacing:1.5,sx:{alignItems:`center`,py:2},children:[G(X,{sx:{fontWeight:500,fontSize:`1rem`},children:`Upload Failed`}),G(X,{variant:`body2`,sx:{color:`text.secondary`,textAlign:`center`},children:C})]})}),G(Kn,{sx:{px:3,pb:2},children:G(J,{fullWidth:!0,variant:`outlined`,color:`neutral`,onClick:()=>i(`select`),sx:{borderRadius:2,fontWeight:500},children:`Try Again`})})]})]})}function Bc(){let{authed:e}=Te(),{apiClient:t}=I(),[n,r]=U(null),[i,a]=U(`signup`),[o,s]=U(!1),c=Wn(!1),l=B(async()=>{if(c.current)try{await nn(t),c.current=!1,Dn(),a(`reload`)}catch{}},[t]);if(V(()=>{let e=()=>{document.visibilityState===`visible`&&l()};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[l]),e)return K(W,{children:[G(J,{variant:`contained`,color:`primary`,size:`small`,startIcon:G(Pr,{}),onClick:()=>{Cn({authed:!0}),s(!0)},sx:{borderRadius:`100px`,textTransform:`none`,fontWeight:600,px:2,py:.5,mr:1,whiteSpace:`nowrap`},children:`Share`}),G(zc,{open:o,onClose:()=>s(!1)})]});let u=e=>{Cn({authed:!1}),a(`signup`),c.current=!1,r(e.currentTarget)},d=()=>{r(null),c.current=!1},f=async()=>{On();let e=window.open(``,`_blank`);try{let{connection_url:n}=await gc(t);e&&!e.closed?e.location.href=n:window.open(n,`_blank`),c.current=!0,a(`waiting`)}catch{e?.close(),a(`error`)}};return K(W,{children:[G(J,{variant:`contained`,color:`primary`,size:`small`,startIcon:G(Pr,{}),onClick:u,sx:{borderRadius:`100px`,textTransform:`none`,fontWeight:600,px:2,py:.5,mr:1,whiteSpace:`nowrap`},children:`Share`}),G(wi,{open:!!n,anchorEl:n,onClose:d,anchorOrigin:{vertical:`bottom`,horizontal:`right`},transformOrigin:{vertical:`top`,horizontal:`right`},slotProps:{paper:{sx:{borderRadius:`12px`,p:3,maxWidth:360,mt:1}}},children:K(q,{sx:{position:`relative`},children:[G(Z,{size:`small`,onClick:d,sx:{position:`absolute`,top:-12,right:-12},"aria-label":`Close`,children:G(Fr,{})}),i===`signup`&&K(W,{children:[G(X,{sx:{mb:3,pr:2},children:`Sign up to Recce Cloud so your team members can see and query your instance directly`}),G(J,{variant:`contained`,color:`primary`,onClick:f,sx:{borderRadius:`8px`,textTransform:`none`,fontWeight:600,px:4,py:1},children:`Sign up`})]}),i===`waiting`&&K(Y,{spacing:2,sx:{alignItems:`center`,py:1},children:[G(cr,{size:40}),G(X,{sx:{fontWeight:500,fontSize:`1.1rem`},children:`Waiting for signup...`}),G(X,{sx:{color:`text.secondary`,textAlign:`center`},children:`Complete signup in the browser tab.`}),G(J,{fullWidth:!0,variant:`text`,color:`primary`,size:`small`,onClick:f,sx:{textTransform:`none`},children:`Retry`})]}),i===`reload`&&K(Y,{spacing:2,sx:{alignItems:`center`,py:1},children:[G(q,{component:`img`,sx:{height:`5rem`,objectFit:`contain`},src:`/imgs/reload-image.svg`,alt:`Reload`}),G(X,{sx:{fontWeight:500,fontSize:`1.1rem`},children:`Reload to Finish`}),G(X,{sx:{color:`text.secondary`,textAlign:`center`},children:`Signup complete! Reload to connect to Recce Cloud.`}),G(J,{fullWidth:!0,variant:`contained`,color:`primary`,onClick:()=>window.location.reload(),sx:{borderRadius:`8px`,textTransform:`none`,fontWeight:600},children:`Reload`})]}),i===`error`&&K(Y,{spacing:2,sx:{alignItems:`center`,py:1},children:[G(X,{sx:{fontWeight:500,fontSize:`1.1rem`},children:`Connection Failed`}),G(X,{sx:{color:`text.secondary`,textAlign:`center`},children:`Could not connect to Recce Cloud. Please try again.`}),G(J,{fullWidth:!0,variant:`contained`,color:`primary`,onClick:f,sx:{borderRadius:`8px`,textTransform:`none`,fontWeight:600},children:`Retry`})]})]})})]})}function Vc(){let{featureToggles:e}=Te(),{apiClient:t}=I(),n=async()=>{try{let e=await ee(t),n=JSON.stringify(e,null,2);$r(new Blob([n],{type:`application/json`}),`recce-state-${mi(new Date,`yyyy-MM-dd-HH-mm-ss`)}.json`)}catch(e){console.error(`Export failed`,e),Jt.create({title:`Export failed`,description:String(e),type:`error`,duration:5e3,closable:!0})}};return G(Q,{title:`Export`,children:G(Z,{size:`small`,"aria-label":`Export state`,onClick:async()=>{await n(),An({name:`export`})},disabled:e.disableExportStateFile,children:G(q,{component:Sr,sx:{verticalAlign:`middle`,width:`16px`,height:`16px`}})})})}function Hc(e){return/^\/checks\/([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/.test(e)}function Uc(){return G(Q,{title:`Syncing`,children:G(q,{sx:{mx:`10px`},children:G(cr,{size:20})})})}function Wc(){let[e,t]=U(!1),n=In(),{apiClient:r}=I(),i=Ei(),a=Ti(),{basePath:o}=ge(),[s,c]=U(!1),[l,u]=U(``),{data:d}=le(),f=()=>c(!1),p=B(async e=>{if(c(!1),t(!0),(await O(e,r)).status===`conflict`){c(!0),t(!1);return}for(;await S(r);)await new Promise(e=>setTimeout(e,1e3));Jt.create({description:`Sync Completed`,type:`success`,duration:5e3,closable:!0}),t(!1),u(``),await n.invalidateQueries({queryKey:M.lineage()}),await n.invalidateQueries({queryKey:M.checks()}),await n.invalidateQueries({queryKey:M.runs()}),Hc(a)&&i.push(`${o}/checks`)},[n,a,r,i.push,o]);return e?G(Uc,{}):K(W,{children:[G(Q,{title:`Sync with Cloud`,children:G(Z,{size:`small`,"aria-label":`Sync state`,onClick:()=>p(d?.session_id?{method:`merge`}:{}),children:G(q,{component:ar,sx:{fontSize:16,verticalAlign:`middle`}})})}),K(Gn,{open:s,onClose:f,children:[K(Jn,{sx:{display:`flex`,alignItems:`center`,fontWeight:`bold`},children:[`Sync with Cloud`,G(q,{sx:{flexGrow:1}}),G(Z,{size:`small`,onClick:f,children:G(ir,{})})]}),K(qn,{children:[G(X,{children:`New changes have been detected in the cloud. Please choose a method to sync your state`}),G(q,{sx:{mt:`5px`},children:G(na,{value:l,onChange:e=>{u(e.target.value)},children:K(Y,{direction:`column`,children:[G(ti,{value:`merge`,control:G(ta,{}),label:K(Y,{direction:`row`,sx:{alignItems:`center`},children:[`Merge`,G(Q,{title:`This will merge the local and remote states.`,children:G(q,{component:Cr,sx:{ml:2,cursor:`pointer`}})})]})}),G(ti,{value:`overwrite`,control:G(ta,{}),label:K(Y,{direction:`row`,sx:{alignItems:`center`},children:[`Overwrite`,G(Q,{title:`This will overwrite the remote state file with the local state.`,children:G(q,{component:Cr,sx:{ml:2,cursor:`pointer`}})})]})}),G(ti,{value:`revert`,control:G(ta,{}),label:K(Y,{direction:`row`,sx:{alignItems:`center`},children:[`Revert`,G(Q,{title:`This will discard local changes and revert to the cloud state.`,children:G(q,{component:Cr,sx:{ml:2,cursor:`pointer`}})})]})})]})})})]}),K(Kn,{children:[G(J,{onClick:f,sx:{mr:1},children:`Cancel`}),G(J,{color:`iochmara`,variant:`contained`,onClick:()=>p({method:l||void 0}),disabled:!l,children:`Sync`})]})]})]})}const Gc=[{path:`/lineage`,name:`Lineage`},{path:`/query`,name:`Query`},{path:`/checks`,name:`Checklist`}];function Kc({queryKey:e,fetchCallback:t,selectCallback:n}){let{data:r,isLoading:i,error:a}=Fn({queryKey:e,queryFn:t,select:n});return i||a||r===0?G(W,{}):G(q,{sx:{bgcolor:`brand.main`,display:`flex`,justifyContent:`center`,alignItems:`center`,p:1,borderRadius:`100%`,color:`white`,fontWeight:700,fontSize:`0.75rem`},children:G(`span`,{children:r})})}function qc(){let{apiClient:e}=I();return G(Kc,{queryKey:M.checks(),fetchCallback:()=>b(e),selectCallback:e=>e.filter(e=>!e.is_checked).length})}const Jc=()=>{let e=Ti(),{isDemoSite:t,isLoading:n,cloudMode:r}=F(),{featureToggles:i}=Te(),{data:a,isLoading:o}=Ce(),s=Wn(null);return V(()=>{s.current&&s.current!==e&&Sn({from:s.current,to:e}),s.current=e},[e]),G(q,{sx:{borderBottom:`1px solid lightgray`,px:`12px`},children:K(q,{sx:{display:`grid`,gridTemplateColumns:`1fr auto 1fr`,width:`100%`,alignItems:`center`},children:[G(vi,{value:H(()=>e.startsWith(`/checks`)?`/checks`:e.startsWith(`/query`)?`/query`:e.startsWith(`/runs`)?`/runs`:`/lineage`,[e]),sx:{borderBottom:`none`,minHeight:`auto`},children:Gc.map(({path:e,name:t})=>t===`Query`&&a?.single_env_onboarding?null:t===`Checklist`&&qc?G(_i,{value:e,disabled:n||o,sx:{p:0},label:G(q,{sx:{display:`flex`,alignItems:`center`,gap:`4px`},children:K(nr,{href:e,style:{textDecoration:`none`,color:`inherit`,padding:`0.875rem 1.1875rem`,display:`flex`,gap:3,alignItems:`center`},children:[t,` `,G(qc,{})]})})},e):G(_i,{value:e,disabled:n||o,sx:{p:0},label:G(q,{sx:{display:`flex`,alignItems:`center`,gap:`4px`},children:G(nr,{href:e,style:{textDecoration:`none`,color:`inherit`,padding:`0.875rem 1.1875rem`},children:t})})},e))}),G(q,{sx:{display:`flex`,alignItems:`center`,gap:`12px`,justifyContent:`center`},children:!n&&!t&&G(Tc,{})}),!n&&K(q,{sx:{display:`flex`,justifyContent:`right`,alignItems:`center`,mr:`8px`},children:[!t&&!a?.single_env_onboarding&&!i.disableShare&&G(Bc,{}),G(Sc,{}),r&&G(Wc,{}),G(Vc,{})]})]})})};function Yc(){let{remainingSeconds:e,isEnabled:t}=de();return!t||e===null||e>60?null:K(da,{color:`warning`,variant:`standard`,sx:{display:`flex`,alignItems:`center`,gap:1,fontSize:`0.75rem`,mr:2},children:[G(q,{component:or,sx:{display:`inline-flex`}}),`Idle timeout: `,Qt(e,`compact`)]})}const Xc=()=>{let{version:e,latestVersion:t}=w(),n=H(()=>RegExp(`^\\d+\\.\\d+\\.\\d+$`),[]);return V(()=>{if(n.test(e)&&e!==t){let e=`recce-update-toast-shown`;if(sessionStorage.getItem(e))return;setTimeout(()=>{Jt.create({id:`recce-update-available`,title:`Update available`,description:K(`span`,{children:[`A new version of Recce (v`,t,`) is available.`,G(`br`,{}),`Please run`,` `,G(q,{component:`code`,sx:{bgcolor:`grey.200`,px:.5,py:.25,borderRadius:.5,fontFamily:`monospace`,fontSize:`0.875em`},children:`pip install --upgrade recce`}),` `,`to update Recce.`,G(`br`,{}),G(Yn,{sx:{color:`primary.main`,fontWeight:`bold`,"&:hover":{textDecoration:`underline`}},href:`https://github.com/DataRecce/recce/releases/tag/v${t}`,target:`_blank`,children:`Click here to view the detail of latest release`})]}),duration:60*1e3,closable:!0}),sessionStorage.setItem(e,`true`)},0)}},[e,t,n]),n.test(e)?G(Yn,{href:`https://github.com/DataRecce/recce/releases/tag/v${e}`,sx:{"&:hover":{textDecoration:`none`},fontSize:`sm`,color:`rgba(255,255,255,0.8)`,textTransform:`uppercase`,borderWidth:1,px:1,borderRadius:.75},target:`_blank`,children:e}):G(X,{component:`span`,sx:{fontSize:`sm`,color:`rgba(255,255,255,0.8)`,textTransform:`uppercase`,borderWidth:1,px:1,borderRadius:.75},children:e})};function Zc({icon:e,href:t,sx:n,...r}){let i=er();return G(Yn,{sx:{height:`20px`,color:`common.white`,...n},href:t,target:`_blank`,...r,children:G(e,{style:{color:i.palette.common.white,width:20,height:20}})})}const Qc=()=>{let{reviewMode:e,isDemoSite:t,envInfo:n,cloudMode:r}=F(),{featureToggles:i,authed:a}=Te(),{url:o,id:s}=n?.pullRequest??{},c=o?o.split(`/`).pop():null,l=r||a?an:`https://reccehq.com/`,[u,d]=U(!1);return K(q,{sx:{display:`flex`,gap:`10px`,minHeight:`40px`,alignItems:`center`,bgcolor:Oe.brand[400]},children:[G(Yn,{href:l,target:`_blank`,sx:{"&:hover":{textDecoration:`none`}},children:K(q,{sx:{display:`flex`,gap:`10px`,alignItems:`center`},children:[G(q,{component:`img`,sx:{width:20,height:20,ml:`18px`},src:`/logo/recce-logo-white.png`,alt:`recce-logo-white`}),G(X,{variant:`h4`,sx:{fontFamily:`"Montserrat", sans-serif`,color:`common.white`,fontSize:`1.25rem`},children:`RECCE`})]})}),G(yc,{}),G(Xc,{}),(i.mode??e)&&G(da,{sx:{fontSize:`0.875rem`,color:`rgba(255,255,255,0.8)`,textTransform:`uppercase`,borderWidth:1,px:1,borderRadius:.75,borderColor:`rgba(255,255,255,0.8)`},children:i.mode??`review mode`}),r&&s&&G(da,{sx:{fontSize:`0.875rem`,color:`rgba(255,255,255,0.8)`,textTransform:`uppercase`,borderWidth:1,px:1,borderRadius:.75,borderColor:`rgba(255,255,255,0.8)`},children:K(Y,{direction:`row`,spacing:1,sx:{alignItems:`center`},children:[G(q,{children:`cloud mode`}),G(q,{sx:{borderLeft:`1px solid rgba(255,255,255,0.8)`,pl:`8px`},children:K(Yn,{href:o,sx:{"&:hover":{textDecoration:`none`}},target:`_blank`,children:[G(ci,{style:{color:`rgba(255,255,255,0.8)`,width:12,height:12,marginRight:2,display:`inline`,verticalAlign:`middle`}}),G(X,{component:`span`,sx:{color:`rgba(255,255,255,0.8)`,display:`inline`},children:`#${String(s)}`})]})})]})}),t&&o&&c&&G(da,{sx:{fontSize:`0.875rem`,color:`rgba(255,255,255,0.8)`,textTransform:`uppercase`,borderWidth:1,px:1,borderRadius:.75,borderColor:`rgba(255,255,255,0.8)`},children:K(Y,{direction:`row`,spacing:1,sx:{alignItems:`center`},children:[G(q,{children:`demo mode`}),G(q,{sx:{borderLeft:`1px solid rgba(255,255,255,0.8)`,pl:`8px`},children:K(Yn,{href:o,sx:{"&:hover":{textDecoration:`none`}},target:`_blank`,children:[G(ci,{style:{color:`rgba(255,255,255,0.8)`,width:12,height:12,marginRight:2,display:`inline`,verticalAlign:`middle`}}),G(X,{component:`span`,sx:{color:`rgba(255,255,255,0.8)`,display:`inline`},children:`#${c}`})]})})]})}),G(q,{sx:{flex:1}}),(t||i.mode===`read only`)&&K(W,{children:[G(Zc,{icon:dr,href:`https://github.com/DataRecce/recce`}),G(Zc,{icon:mr,href:`https://getdbt.slack.com/archives/C05C28V7CPP`}),G(Zc,{sx:{mr:2},icon:fr,href:`https://docs.reccehq.com`})]}),!t&&i.mode!==`read only`&&K(W,{children:[G(Yc,{}),a||r?G(q,{sx:{mr:2},children:G(vc,{})}):K(W,{children:[G(q,{component:`button`,sx:{color:`common.white`,fontSize:`0.875rem`,fontWeight:600,bgcolor:`brand.700`,borderRadius:1,px:3,py:1,mr:2,cursor:`pointer`,border:`none`},onClick:()=>{d(!0)},children:`Connect to Cloud`}),u&&G(_c,{parentOpen:u,handleParentClose:d,ignoreCookie:!0,variant:`user-profile`})]})]})]})};function $c(){return G(q,{sx:{display:`flex`,height:`100%`,alignItems:`center`,justifyContent:`center`,contain:`size`},children:G(q,{sx:{display:`flex`,alignItems:`center`,justifyContent:`center`,height:`100%`},children:G(cr,{size:48})})})}function el({children:e,lineage:t}){let n=Ti(),{isDemoSite:r,isLoading:i,isCodespace:a}=F(),{featureToggles:o}=Te(),s=n.replace(/\/$/,``)||`/`,c=s===`/lineage`||s===`/`;return V(()=>{vn()},[]),K(q,{sx:{display:`flex`,flexDirection:`column`,height:`100vh`,overflow:`hidden`},children:[G(Dc,{}),G(Qc,{}),G(Jc,{}),G(tl,{isLineageRoute:c,lineage:t,children:e}),!i&&!r&&!a&&o.mode===null&&G(_c,{})]})}function tl({children:e,lineage:t,isLineageRoute:n,disableInternalHistory:r=!1}){let{isRunResultOpen:i,isHistoryOpen:a,closeRunResult:o}=_e(),{basePath:s}=ge(),{data:c}=Ce(),l=Ti(),u=Gt(),d=i&&!l.startsWith(`${s}/checks`),f=r?!1:a&&!l.startsWith(`${s}/checks`);return K(Mt,{sizes:f?[20,80]:[0,100],minSize:0,gutterSize:5,className:f?void 0:`split-gutter-hidden`,style:{height:`100%`},children:[G(q,{style:{contain:`size`},suppressHydrationWarning:!0,children:f&&G(L,{})}),K(ft,{sizes:d?[50,50]:[100,0],minSize:0,gutterSize:5,className:d?void 0:`split-gutter-hidden`,style:{flex:`1`,contain:`size`},children:[G(Ln,{fallback:G($c,{}),children:K(q,{sx:{p:0,contain:`content`,height:`100%`,position:`relative`},suppressHydrationWarning:!0,children:[G(q,{sx:{display:n?`block`:`none`,height:`100%`,position:n?`relative`:`absolute`,inset:0},children:t}),!n&&e]})}),G(q,{sx:{height:`100%`,bgcolor:u?`grey.900`:`grey.50`},suppressHydrationWarning:!0,children:d?G(Le,{onClose:o,isSingleEnvironment:!!c?.single_env_onboarding}):null})]})]})}function nl({children:e,display:t}){let[n,r]=U(!1),i=Wn(null),a=Wn(null),o=B(()=>{i.current&&=(clearTimeout(i.current),null),r(!0)},[]),s=B(()=>{i.current=setTimeout(()=>{r(!1)},100)},[]);return t?K(W,{children:[G(q,{ref:a,onMouseEnter:o,onMouseLeave:s,sx:{display:`contents`},children:e}),K(wi,{open:n,anchorEl:a.current,onClose:()=>r(!1),anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},disableAutoFocus:!0,disableEnforceFocus:!0,sx:{pointerEvents:`none`},slotProps:{paper:{onMouseEnter:o,onMouseLeave:s,sx:{bgcolor:`grey.600`,color:`white`,p:1.5,pointerEvents:`auto`}}},children:[`Connect to a data warehouse to unlock Diff.`,` `,G(Yn,{href:on,target:`_blank`,sx:{color:`white`,textDecoration:`underline`},children:`Learn more`}),`.`]})]}):e}function rl({checksOnly:e=!0}){let t=Gt(),{featureToggles:n}=Te(),r=In(),{apiClient:i}=I(),a=Wn(null),o=Wn(null),[s,c]=U(null),[l,u]=U(!1),d=Ei(),f=Ti(),{basePath:p}=ge(),[,h]=we(),g=B(async()=>{if(s){try{let{runs:t,checks:n}=await m(s,e,i);h?.(),await r.invalidateQueries({queryKey:M.checks()}),await r.invalidateQueries({queryKey:M.runs()}),f.includes(`/checks`)&&d.push(`${p}/checks`);let a=e?`${n} checks imported successfully`:`${t} runs and ${n} checks imported successfully`;Jt.create({description:a,type:`info`,duration:5e3,closable:!0})}catch(e){console.error(`Import failed`,e),Jt.create({title:`Import failed`,description:String(e),type:`error`,duration:5e3,closable:!0})}u(!1)}},[r,s,f,h,e,i,d.push,p]),_=()=>{a.current&&a.current.click()},v=e=>{e.target.files?.length===1&&(c(e.target.files[0]),u(!0)),a.current&&(a.current.value=``)},y=()=>u(!1),b=e?`checks`:`runs and checks`,{isDemoSite:x}=F();return K(W,{children:[G(Q,{title:`Import Checklist from State File`+(x?` (Disabled in the demo site)`:``),children:G(Z,{sx:{pt:`6px`,color:t?`grey.300`:`grey.600`,"&:hover":{color:t?`grey.100`:`grey.800`},fontSize:20},"aria-label":`Import state`,onClick:()=>{_(),An({name:`import`})},disabled:n.disableImportStateFile||x,children:G(Yi,{})})}),G(`input`,{type:`file`,style:{display:`none`},ref:a,onChange:v}),K(Gn,{open:l,onClose:y,maxWidth:`sm`,fullWidth:!0,"aria-labelledby":`import-dialog-title`,children:[K(Jn,{id:`import-dialog-title`,sx:{display:`flex`,alignItems:`center`,fontWeight:`bold`},children:[`Import state`,G(q,{sx:{flexGrow:1}}),G(Z,{size:`small`,onClick:y,children:G(ir,{})})]}),G(qn,{children:K(Y,{direction:`column`,spacing:1,sx:{px:`5px`,borderRadius:1},children:[K(Y,{direction:`row`,spacing:.5,sx:{alignItems:`center`},children:[G(q,{component:Cr,sx:{color:`error.main`}}),G(X,{component:`span`,sx:{fontWeight:500,color:`error.main`},children:`Caution!`})]}),K(X,{children:[`The current `,b,` will be`,` `,G(X,{component:`span`,sx:{fontWeight:600},children:`merged`}),` `,`with the imported state`]})]})}),K(Kn,{children:[G(J,{ref:o,onClick:y,children:`Cancel`}),G(J,{color:`iochmara`,variant:`contained`,onClick:g,sx:{ml:`5px`},children:`Import`})]})]})]})}function il({check:e},t){return G(q,{sx:{display:`flex`,flexDirection:`column`,height:`100%`},children:G(Kr,{children:G(pc,{viewOptions:{...e.params,...e.view_options},interactive:!1,ref:t})})})}const al=zn(il),ol=({node:e,selected:t,onSelect:n,schemaChanged:r,isDark:i})=>{let{icon:a}=Re(e.data.resourceType),o,s;return r?(o=z(`schema_diff`).icon,s=$e(`modified`).color):e.data.changeStatus===`added`?(o=$e(`added`).icon,s=$e(`added`).color):e.data.changeStatus===`removed`&&(o=$e(`removed`).icon,s=$e(`removed`).color),G(bi,{disablePadding:!0,children:K(q,{sx:{display:`flex`,width:`100%`,fontSize:`10pt`,p:`5px 8px`,cursor:`pointer`,"&:hover":{bgcolor:i?`grey.700`:`grey.200`},bgcolor:t?i?`grey.800`:`grey.100`:`inherit`,alignItems:`center`,gap:`5px`},onClick:()=>{n(e.id)},children:[a&&G(q,{component:a}),G(q,{sx:{flex:1,textOverflow:`ellipsis`,whiteSpace:`nowrap`,overflow:`hidden`},children:e.data.name}),o&&s&&G(q,{component:o,sx:{color:s}})]})})};function sl({check:e},t){let n=Gt(),{apiClient:r}=I(),{lineageGraph:i}=F(),a=e.params,{isLoading:o,error:s,data:c}=Fn({queryKey:[...M.check(e.check_id),`select`],queryFn:async()=>C({select:a.select,exclude:a.exclude,packages:a.packages,view_mode:a.view_mode},r),refetchOnMount:!0,enabled:!a.node_id}),[l,d]=H(()=>{let e=[],t=[],n=[],r=[];if(a.node_id){let t=a.node_id instanceof Array?a.node_id:[a.node_id];for(let n of t){let t=i?.nodes[n];t&&e.push(t)}}else for(let t of c?.nodes??[]){let n=i?.nodes[t];n&&e.push(n)}let o=e.filter(e=>e.data.resourceType===`model`||e.data.resourceType===`seed`||e.data.resourceType===`source`||e.data.resourceType===`snapshot`);for(let e of o)e.data.change?.columns&&Object.keys(e.data.change.columns).length>0?t.push(e.id):e.data.changeStatus===`added`?n.push(e.id):e.data.changeStatus===`removed`&&r.push(e.id);function s(e){return t.includes(e.id)?3:n.includes(e.id)?2:+!!r.includes(e.id)}return o.sort((e,t)=>{let n=s(e),r=s(t);return n===r?e.data.name.localeCompare(t.data.name):r-n}),[o,t]},[a.node_id,c?.nodes,i]),[f,p]=U(0),m=f<l.length?l[f]:void 0,{data:h}=Fn({queryKey:[`modelDetail`,m?.id],queryFn:()=>u(m?.id??``,r),enabled:!!m&&!!r,staleTime:300*1e3});if(o)return G(q,{sx:{display:`flex`,alignItems:`center`,justifyContent:`center`,bgcolor:n?`grey.900`:`grey.50`,height:`100%`},children:`Loading...`});if(s)return K(q,{sx:{display:`flex`,alignItems:`center`,justifyContent:`center`,bgcolor:n?`grey.900`:`grey.50`,height:`100%`},className:`no-track-pii-safe`,children:[`Error: `,s.message]});if(l.length==0)return G(q,{sx:{display:`flex`,alignItems:`center`,justifyContent:`center`,bgcolor:n?`grey.900`:`grey.50`,height:`100%`},children:`No nodes matched`});if(f<l.length){let e=l[f];return K(Mt,{sizes:[80,20],minSize:30,style:{height:`100%`},children:[G(Jo,{base:h?.model?.base&&Object.keys(h.model.base).length>0?{id:e.id,unique_id:e.id,name:e.data.name,...h.model.base}:void 0,current:h?.model?.current&&Object.keys(h.model.current).length>0?{id:e.id,unique_id:e.id,name:e.data.name,...h.model.current}:void 0,columnChanges:e.data.change?.columns,enableScreenshot:!0,showMenu:!1,ref:t}),G(yi,{sx:{overflow:`auto`,bgcolor:`background.paper`,listStyle:`none`},children:l.map((e,t)=>G(ol,{node:e,schemaChanged:d.includes(e.id),selected:t===f,isDark:n,onSelect:()=>{p(t)}},e.id))})]})}return G(W,{})}const cl=zn(sl);function ll({checkId:t,refreshCheckList:n}){let r=er(),i=Gt(),{apiClient:a}=I(),{featureToggles:s,sessionId:l}=Te(),{setLatestSelectedCheckId:u}=ze(),{cloudMode:d}=F(),p=In(),m=Ei(),{basePath:h}=ge(),{setSqlQuery:g,setBaseSqlQuery:_,setCustomQueries:v,setPrimaryKeys:y}=lt(),{successToast:b,failToast:S}=qt(),[C,w]=U(),[T]=U(),[E,D]=U(!1),[O,k]=U(!1),[ee,te]=U(null),ne=!!ee,{isLoading:re,error:ie,data:j}=Fn({queryKey:M.check(t),queryFn:async()=>e(t,a),refetchOnMount:!0}),ae=C??j?.last_run?.run_id,{run:oe,error:se}=Et(ae),ce=C?!oe||oe.status===`Running`:oe?.status===`Running`,N=j?.type?z(j.type):void 0,P;N&&(P=N.RunResultView);let le=j?.is_preset??!1,ue=Wn(null),{mutate:de}=Pn({mutationFn:e=>c(t,e,a),onSuccess:async()=>{await p.invalidateQueries({queryKey:M.check(t)}),await p.invalidateQueries({queryKey:M.checks()})}}),{mutate:fe}=Pn({mutationFn:()=>x(t,a),onSuccess:async()=>{u(``),await p.invalidateQueries({queryKey:M.checks()}),m.push(`${h}/checks`)}}),{mutate:pe,isPending:me}=Pn({mutationFn:async()=>{if(!j)throw Error(`Check not found`);return await o(t,a)},onSuccess:async()=>{b(`Check marked as preset successfully`),await p.invalidateQueries({queryKey:M.check(t)})},onError:e=>{S(`Failed to mark check as preset`,e)}}),he=B(async()=>{j?.type&&(w((await A(t,{nowait:!0},a)).run_id),await p.invalidateQueries({queryKey:M.check(t)}),n&&n())},[j,t,p,n,a]),_e=B(async()=>{if(D(!0),ae)return await f(ae,a)},[ae,a]),ve=async()=>{if(!j)return;let e=ul(j);if(!window.isSecureContext){S(`Failed to copy the check to clipboard`,Error(`Copy to clipboard is available only in secure contexts (HTTPS)`));return}try{await navigator.clipboard.writeText(e),b(`Copied the check to the clipboard`)}catch(e){S(`Failed to copy the check to clipboard`,e)}},ye=B(()=>{let e=j?.is_checked;de({is_checked:!e}),e||Jt.create({title:`Marked as approved`,type:`success`,duration:2e3})},[j?.is_checked,de]),be=e=>{de({view_options:e})},xe=e=>{de({description:e})},Se=e=>{te(e.currentTarget)},Ce=()=>{te(null)},we=B(()=>{if(!j)return;let e=j.params;g(e?.sql_template||``),`base_sql_template`in e&&e.base_sql_template?(_(e.base_sql_template),v(!0)):(_(``),v(!1)),`primary_keys`in e&&e.primary_keys?y(e.primary_keys):y(void 0),m.push(`${h}/query`)},[j,m,h,g,_,v,y]),[Ee,De]=U(`result`),{ref:Oe,onCopyToClipboard:ke,onMouseEnter:je,onMouseLeave:Me}=ht(),Ne=R({name:j?.name??``,description:j?.description??``,type:j?.type??``,params:j?.params,viewOptions:j?.view_options});if(re)return G(q,{sx:{display:`flex`,alignItems:`center`,justifyContent:`center`,height:`100%`},children:`Loading`});if(ie)return K(q,{sx:{display:`flex`,alignItems:`center`,justifyContent:`center`,height:`100%`},children:[`Error: `,G(`span`,{className:`no-track-pii-safe`,children:ie.message})]});if(!j)return G(ft,{minSize:100,sizes:[30,70],style:{height:`100%`,width:`100%`,maxHeight:`100%`},children:G(q,{style:{contain:`strict`},sx:{display:`flex`,flexDirection:`column`},children:G(q,{sx:{display:`flex`,p:`0px 16px`,alignItems:`center`,height:40},children:G(Ae,{name:`Check not found`,disabled:!0})})})});let Pe=oe?.run_at?hi(new Date(oe.run_at),{addSuffix:!0}):null,Ie=N?.icon;return K(fa,{spacing:0,container:!0,sx:{height:`100%`,width:`100%`},children:[G(fa,{size:{xs:12,md:d?9:12},sx:{height:`100%`},children:K(ft,{minSize:100,sizes:[40,60],style:{height:`100%`,width:`100%`,maxHeight:`100%`},children:[G(q,{sx:{height:`100%`,contain:`strict`,display:`flex`,flexDirection:`row`},children:K(q,{sx:{flex:1,height:`100%`,display:`flex`,flexDirection:`column`,overflow:`hidden`,minWidth:0},children:[K(q,{sx:{display:`flex`,p:`0px 16px`,alignItems:`center`,height:40,borderBottom:`2px solid`,borderColor:i?`grey.700`:`grey.300`},children:[Ie&&G(q,{component:Ie,sx:{fontSize:20,mr:1,flexShrink:0}}),G(Ae,{name:j.name,onNameChange:e=>{de({name:e})}}),G(q,{sx:{flexGrow:1}}),K(Y,{direction:`row`,spacing:2,sx:{mr:`10px`},children:[le&&G(Q,{title:`This is a preset check`,children:G(q,{sx:{display:`flex`,alignItems:`center`,justifyContent:`center`},children:G(Ji,{size:`1rem`,color:r.palette.iochmara.dark})})}),j?.actor_type&&!j.is_preset&&it[j.actor_type]&&G(Ir,{label:it[j.actor_type].label,size:`small`,sx:{height:20,fontSize:`0.65rem`,fontWeight:500,backgroundColor:it[j.actor_type].bg,color:it[j.actor_type].color,flexShrink:0,"& .MuiChip-label":{px:.75}}}),G(Z,{size:`small`,onClick:Se,children:G(ui,{})}),K(ii,{anchorEl:ee,open:ne,onClose:Ce,children:[l&&K($,{onClick:()=>{pe(),Ce()},disabled:me||le,children:[G(Ii,{children:G(rr,{})}),G(Li,{children:`Mark as Preset Check`})]}),K($,{onClick:()=>{k(!0),Ce()},children:[G(Ii,{children:G(ma,{})}),G(Li,{children:`Get Preset Check Template`})]}),K($,{onClick:()=>{ve(),Ce()},children:[G(Ii,{children:G(xr,{})}),G(Li,{children:`Copy Markdown`})]}),G(sr,{}),K($,{onClick:()=>{fe(),Ce()},disabled:s.disableUpdateChecklist,sx:{color:`error.main`},children:[G(Ii,{sx:{color:`error.main`},children:G(Mr,{})}),G(Li,{children:`Delete`})]})]}),G(Q,{title:He({type:j.type,hasResult:!!oe?.result,hasError:!!oe?.error})?`Run the check first`:j.is_checked?`Remove approval`:`Mark as approved`,placement:`bottom-end`,children:G(J,{size:`small`,color:j.is_checked?`success`:`neutral`,variant:j.is_checked?`contained`:`outlined`,onClick:()=>{ye()},disabled:He({type:j.type,hasResult:!!oe?.result,hasError:!!oe?.error})||s.disableUpdateChecklist,startIcon:j.is_checked?G(yr,{}):G(oi,{style:{color:i?r.palette.grey[600]:r.palette.grey[400]}}),sx:{flex:`0 0 auto`,textTransform:`none`},children:j.is_checked?`Approved`:`Pending`})})]})]}),G(q,{sx:{flex:1,p:`8px 16px`,minHeight:100},children:G(nt,{value:j.description,onChange:xe,disabled:s.disableUpdateChecklist},j.check_id)})]})}),G(q,{style:{contain:`strict`},children:K(q,{sx:{height:`100%`,display:`flex`,flexDirection:`column`},children:[K(q,{sx:{display:`flex`,alignItems:`center`,borderBottom:1,borderColor:`divider`,height:50},children:[K(vi,{value:Ee,onChange:(e,t)=>De(t),children:[G(_i,{label:`Result`,value:`result`,sx:{fontSize:`0.75rem`,textTransform:`none`}}),(j.type===`query`||j.type===`query_diff`)&&G(_i,{label:`Query`,value:`query`,sx:{fontSize:`0.75rem`,textTransform:`none`}})]}),Pe&&G(X,{variant:`caption`,sx:{color:`text.secondary`,ml:1,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,minWidth:0,display:`flex`,alignItems:`center`},children:Pe}),G(q,{sx:{flexGrow:1}}),K(Y,{direction:`row`,spacing:1,sx:{mr:`10px`},children:[(j.type===`query`||j.type===`query_base`||j.type===`query_diff`)&&G(Q,{title:`Open in Query tab`,children:G(J,{variant:`outlined`,color:`neutral`,size:`small`,onClick:we,disabled:s.disableDatabaseQuery,startIcon:G(Fi,{}),sx:{textTransform:`none`},children:`Open Query`})}),P&&G(Q,{title:`Rerun`,children:G(J,{variant:`outlined`,color:`neutral`,size:`small`,onClick:()=>he(),disabled:s.disableDatabaseQuery||ce,startIcon:G(Ar,{}),sx:{textTransform:`none`},children:ce?`Running...`:`Rerun`})}),G(J,{variant:`outlined`,color:`neutral`,disabled:He({type:j.type,hasResult:!!oe?.result,hasError:!!oe?.error})||Ee!==`result`,onMouseEnter:je,onMouseLeave:Me,size:`small`,onClick:async()=>{j.type===`lineage_diff`?ue.current?.copyToClipboard():await ke(),dn({type:j.type,from:`check`})},startIcon:G(xr,{}),sx:{textTransform:`none`},children:`Copy to Clipboard`})]})]}),K(q,{sx:{flex:1,contain:`strict`},children:[Ee===`result`&&K(q,{sx:{width:`100%`,height:`100%`},children:[P&&(j.last_run||ae?G(Rt,{ref:Oe,isRunning:ce,isAborting:E,run:ae?oe:j.last_run,error:se,progress:T,RunResultView:P,viewOptions:j.view_options,onViewOptionsChanged:be,onCancel:_e,onExecuteRun:he}):G(q,{sx:{display:`flex`,alignItems:`center`,justifyContent:`center`,bgcolor:i?`grey.900`:`grey.50`,height:`100%`},children:K(Y,{spacing:2,sx:{alignItems:`center`},children:[G(q,{children:`This action is part of the initial preset and has not been performed yet. Once performed, the result will be shown here.`}),G(nl,{display:s.mode===`metadata only`,children:G(J,{onClick:he,variant:`contained`,size:`small`,disabled:s.disableDatabaseQuery,children:`Run Query`})})]})})),j.type===`schema_diff`&&G(cl,{check:j,ref:Oe},j.check_id),j.type===`lineage_diff`&&G(al,{check:j,ref:ue},j.check_id)]}),Ee===`query`&&(j.type===`query`||j.type===`query_diff`||j.type===`query_base`)&&G(q,{sx:{height:`100%`,width:`100%`},children:j.params.base_sql_template?G(Fe,{value:j.params.sql_template||``,baseValue:j.params.base_sql_template??``,options:{readOnly:!0}}):G(Ge,{value:j.params.sql_template||``,options:{readOnly:!0}})})]})]})}),K(Gn,{open:O,onClose:()=>k(!1),maxWidth:`md`,fullWidth:!0,children:[G(Jn,{children:`Preset Check Template`}),K(qn,{children:[K(X,{variant:`subtitle2`,sx:{fontWeight:`bold`,mb:2},children:[`Please`,` `,G(X,{component:`span`,sx:{cursor:`pointer`,"&:hover":{textDecoration:`underline`},color:`primary.main`},onClick:async()=>{await navigator.clipboard.writeText(Ne),b(`Copied the template to the clipboard`)},children:`copy`}),` `,`the following template and paste it into the`,` `,G(q,{component:`span`,sx:{px:.5,bgcolor:`error.light`,borderRadius:.5},children:`recce.yml`}),` `,`file.`]}),G(tt,{yamlTemplate:Ne})]}),G(Kn,{children:G(Z,{size:`small`,onClick:()=>k(!1),sx:{position:`absolute`,top:8,right:8},children:G(ir,{})})})]})]})}),d&&G(fa,{size:3,sx:{height:`100%`,overflow:`hidden`,flexShrink:0,display:{xs:`none`,md:`block`}},children:G(ro,{checkId:t})})]})}function ul(e){return pa`
|
|
7
|
-
<details><summary>${qe({name:e.name,isChecked:e.is_checked})}</summary>
|
|
8
|
-
|
|
9
|
-
${dl(e)}
|
|
10
|
-
|
|
11
|
-
</details>`}function dl(e){let t=We({description:e.description});if(e.type===`query`||e.type===`query_diff`){let n=e.params;return`${t}\n\n${Be({sql:n&&`sql_template`in n?n.sql_template:``})}`}return t}const fl=()=>{let e=In(),t=Ei(),{apiClient:n}=I(),{basePath:r}=ge(),{mutate:i,isPending:a}=Pn({mutationFn:()=>v({select:`state:modified`},n),onSuccess:async n=>{await e.invalidateQueries({queryKey:M.checks()}),t.push(`${r}/checks/?id=${n.check_id}`)}});return G(Ue,{title:`No checks yet`,description:`Checks help you validate data quality and catch issues.`,icon:G(Pi,{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.`})},pl=({check:e,selected:t,onSelect:n,onApprovalChange:r})=>{let{featureToggles:i}=Te(),a=e.last_run?.run_id,{run:o}=Et(a),s=He({type:e.type,hasResult:!!o?.result,hasError:!!o?.error}),c=s||i.disableUpdateChecklist;return G(Je,{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})},ml=({checks:e,selectedItem:t,onCheckSelected:n,onChecksReordered:r})=>{let[i,a]=U(!1),[o,s]=U(!1),[l,u]=U(null),d=In(),{apiClient:f}=I(),{mutate:p}=Pn({mutationFn:({checkId:e,isChecked:t})=>c(e,{is_checked:t},f),onSuccess:async(e,{checkId:t})=>{await d.invalidateQueries({queryKey:M.check(t)}),await d.invalidateQueries({queryKey:M.checks()})}}),m=e=>{e.destination&&r(e.source.index,e.destination.index)},h=()=>s(!0),g=()=>{s(!1),u(null)},_=()=>{Jt.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(ha,{onDragEnd:m,children:G(_a,{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(ga,{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(pl,{check:e,selected:e.check_id===t,onSelect:n,onApprovalChange:v},e.check_id)})}},e.check_id)),r.placeholder]})})}),K(Gn,{open:o,onClose:g,maxWidth:`xs`,fullWidth:!0,children:[K(Jn,{sx:{display:`flex`,alignItems:`center`},children:[`Mark as Approved?`,G(q,{sx:{flexGrow:1}}),G(Z,{size:`small`,onClick:g,children:G(ir,{})})]}),G(sr,{}),K(qn,{sx:{fontSize:`0.875rem`},children:[G(X,{children:`Please ensure you have reviewed the contents of this check before marking it as approved.`}),G(ti,{control:G(ei,{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(sr,{}),K(Kn,{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`})]})]})]})},hl=()=>{let e=er().palette.mode===`dark`?`grey.700`:`grey.300`,t=Ei(),n=Di().get(`id`),{latestSelectedCheckId:r,setLatestSelectedCheckId:i}=ze(),a=In(),{apiClient:o}=I(),{basePath:c}=ge(),l=n;V(()=>{l&&i(l)},[l,i]);let{isLoading:u,error:d,data:f,status:p,refetch:m}=Fn({queryKey:M.checks(),queryFn:()=>b(o),refetchOnMount:!0}),h=B(e=>{t.push(`${c}/checks/?id=${e}`)},[t.push,c]),[g,_]=U(f??[]),[v,y]=U(f);f!==v&&(y(f),_(f??[]));let{mutate:x}=Pn({mutationFn:e=>s(e,o),onSuccess:async()=>{await a.invalidateQueries({queryKey:M.checks()})}}),S=B((e,t)=>{let n=[...g],[r]=n.splice(e,1);n.splice(t,0,r),x({source:e,destination:t}),_(n)},[g,x]),C=H(()=>!!(l&&f?.some(e=>e.check_id===l)),[l,f]);return V(()=>{p!==`success`||f.length===0||C||(r&&f.some(e=>e.check_id===r)?t.replace(`${c}/checks/?id=${r}`):t.replace(`${c}/checks/?id=${f[0].check_id}`))},[p,C,f,r,t.replace,c]),u?null:d?K(q,{children:[`Error: `,G(`span`,{className:`no-track-pii-safe`,children:d.message})]}):f?.length?K(Mt,{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(rl,{checksOnly:!0})}),G(sr,{}),G(ml,{checks:g,selectedItem:l,onCheckSelected:h,onChecksReordered:S})]})}),G(q,{sx:{height:`100%`},children:C&&l&&G(ll,{checkId:l,refreshCheckList:m},l)})]}):K(Mt,{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(rl,{checksOnly:!0})}),G(sr,{}),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(fl,{})})})]})},gl=()=>K(Mt,{style:{height:`100%`},minSize:50,sizes:[20,80],children:[G(q,{sx:{borderRight:`1px solid`,borderRightColor:er().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(cr,{size:20})})}),G(q,{children:G(q,{sx:{height:`100%`,display:`flex`,justifyContent:`center`,alignItems:`center`},children:G(cr,{size:20})})})]}),_l={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 vl(e){let t=String(De(`colors.green.solid`)),n=String(De(`colors.red.solid`)),r=String(De(`colors.amber.emphasized`));return e===`added`?{color:t,icon:gt}:e===`removed`?{color:n,icon:Vt}:e===`modified`?{color:r,icon:It}:e===`col_added`?{color:t,icon:gt}:e===`col_removed`?{color:n,icon:Vt}:e===`col_changed`?{color:r,icon:It}:e===`folder_changed`?{color:r,icon:at}:{color:`inherit`,icon:void 0}}function yl(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 bl(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 xl({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:Bi,sx:{mx:`2px`,fontSize:12,verticalAlign:`middle`}})})})]}),t]})}function Sl({changeStatus:e,value:t}){let[n]=e?_l[e]:[``],{icon:r,color:i}=vl(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 Cl({lineageGraph:e}){let{adds:t,removes:n,modifies:r,col_added:i,col_removed:a,col_changed:o}=bl(e);return K(fa,{container:!0,sx:{mb:`10px`,borderTop:`1px solid`,borderColor:`divider`,p:`2.5vw`},children:[G(fa,{size:6,sx:{borderColor:`divider`},children:G(xl,{name:`Code Changes`,value:K(fa,{container:!0,sx:{width:`100%`},children:[G(fa,{size:4,children:G(Sl,{changeStatus:`added`,value:t})}),G(fa,{size:4,children:G(Sl,{changeStatus:`removed`,value:n})}),G(fa,{size:4,children:G(Sl,{changeStatus:`modified`,value:r})})]})})}),G(fa,{size:6,sx:{borderLeft:`1px solid`,borderLeftColor:`divider`,pl:`12px`},children:G(xl,{name:`Column Changes`,value:K(fa,{container:!0,sx:{width:`100%`},children:[G(fa,{size:4,children:G(Sl,{changeStatus:`col_added`,value:i})}),G(fa,{size:4,children:G(Sl,{changeStatus:`col_removed`,value:a})}),G(fa,{size:4,children:G(Sl,{changeStatus:`col_changed`,value:o})})]})})})]})}function wl({node:e,...t}){let{apiClient:n}=I(),{data:r,isLoading:i}=Fn({queryKey:[`modelDetail`,e.id],queryFn:()=>u(e.id,n),enabled:!!n,staleTime:300*1e3}),a=r?.model;return K(va,{sx:{maxWidth:500},children:[G(ba,{title:G(X,{sx:{fontSize:18,fontWeight:`bold`},children:t.title}),subheader:K(Y,{direction:`row`,spacing:`8px`,sx:{p:`16px`},children:[G(Pt,{resourceType:e.data.resourceType,materialized:e.data.materialized}),e.data.resourceType===`model`&&G(Ss,{node:e})]})}),G(ya,{children:G(q,{sx:{display:`flex`},children:i?G($i,{variant:`rectangular`,width:`100%`,height:100}):G(Jo,{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 Tl(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 El({lineageGraph:e}){let[t,n]=U([]);return V(()=>{n(Tl(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(wl,{title:e.data.name,node:e},e.id))})})]})}function Dl({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=Ht(),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=B(e=>{D?.(e)},[D]),A=B((e,t)=>{o?.(e,t)},[o]),te=B(e=>{E&&c?.(E,e)},[E,c]),ne=B(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(cr,{})});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(Ue,{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(Tt,{direction:`horizontal`,sizes:[_,100-_],minSizes:[v,200],maxSizes:[y,1/0],children:[G(q,{sx:{height:`100%`,overflow:`auto`},children:G(kt,{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(rt,{checkId:k.check_id,name:k.name,type:k.type,description:k.description,isApproved:k.is_checked,tabs:re,primaryActions:ie,secondaryActions:j,onAction:A,onDescriptionChange:te,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 Ol=Bn(Dl);Ol.displayName=`ChecksView`;const kl=`0.2.0`;export{Lo as A,vs as C,Wo as D,Yo as E,io as F,Ea as I,Ca as L,co as M,oo as N,Ho as O,ao as P,Sa as R,Cs as S,Jo as T,Sc as _,bl as a,Ms as b,_l as c,ml as d,fl as f,Yc as g,el as h,Cl as i,Fo as j,Ro as k,gl as l,tl as m,Ol as n,yl as o,ll as p,El as r,vl as s,kl as t,hl as u,mc as v,Go as w,Ss as x,Xs as y};
|
|
12
|
-
//# sourceMappingURL=src-C3MKdhA3.js.map
|