@datarecce/ui 1.35.0 → 1.35.1

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.
Files changed (129) hide show
  1. package/dist/AuthModal-BKt2rzcW.js +23 -0
  2. package/dist/AuthModal-BKt2rzcW.js.map +1 -0
  3. package/dist/{ResultErrorFallback-BaNIiz22.js → ResultErrorFallback-Bwq1j3pu.js} +1 -1
  4. package/dist/{ResultErrorFallback-BaNIiz22.js.map → ResultErrorFallback-Bwq1j3pu.js.map} +1 -1
  5. package/dist/{RouteConfigContext-nb4GQL4p.d.ts → RouteConfigContext-CPM6M6Q3.d.ts} +4 -4
  6. package/dist/{RouteConfigContext-nb4GQL4p.d.ts.map → RouteConfigContext-CPM6M6Q3.d.ts.map} +1 -1
  7. package/dist/{RunProgress-DeALaWs4.d.ts → RunProgress-BnkCSNvv.d.ts} +2 -2
  8. package/dist/{RunProgress-DeALaWs4.d.ts.map → RunProgress-BnkCSNvv.d.ts.map} +1 -1
  9. package/dist/{ScreenshotDataGrid-_0OXk0uO.d.ts → ScreenshotDataGrid-BaBsp-r1.d.ts} +3 -3
  10. package/dist/{ScreenshotDataGrid-_0OXk0uO.d.ts.map → ScreenshotDataGrid-BaBsp-r1.d.ts.map} +1 -1
  11. package/dist/{SplitPane-BW_0Lmst.d.ts → SplitPane-Bc3gL6c2.d.ts} +217 -32
  12. package/dist/SplitPane-Bc3gL6c2.d.ts.map +1 -0
  13. package/dist/advanced.d.ts +20 -9
  14. package/dist/advanced.d.ts.map +1 -1
  15. package/dist/advanced.js +1 -1
  16. package/dist/advanced.js.map +1 -1
  17. package/dist/{api-BeQy3HaS.d.ts → api-CHRBUwIf.d.ts} +2 -2
  18. package/dist/{api-BeQy3HaS.d.ts.map → api-CHRBUwIf.d.ts.map} +1 -1
  19. package/dist/{api-_i6BZPkM.js → api-CVxyKUGP.js} +2 -2
  20. package/dist/{api-_i6BZPkM.js.map → api-CVxyKUGP.js.map} +1 -1
  21. package/dist/api.d.ts +2 -2
  22. package/dist/api.js +1 -1
  23. package/dist/{colors-D6QQQjX4.js → colors-C4PP3M6b.js} +1 -1
  24. package/dist/{colors-D6QQQjX4.js.map → colors-C4PP3M6b.js.map} +1 -1
  25. package/dist/components-run.d.ts +6 -6
  26. package/dist/components-run.js +1 -1
  27. package/dist/components.d.ts +19 -21
  28. package/dist/components.js +1 -1
  29. package/dist/{const-BEzXEkdk.js → const-B0roUYcb.js} +1 -1
  30. package/dist/{const-BEzXEkdk.js.map → const-B0roUYcb.js.map} +1 -1
  31. package/dist/{constants-Cm-GaLU6.js → constants-BClsB-_D.js} +1 -1
  32. package/dist/{constants-Cm-GaLU6.js.map → constants-BClsB-_D.js.map} +1 -1
  33. package/dist/constants.d.ts +1 -1
  34. package/dist/constants.js +1 -1
  35. package/dist/contexts.d.ts +5 -5
  36. package/dist/contexts.js +1 -1
  37. package/dist/hooks.d.ts +13 -14
  38. package/dist/hooks.js +1 -1
  39. package/dist/{index-CARlgCqb.d.ts → index-B8yz6WXO.d.ts} +12 -12
  40. package/dist/{index-CARlgCqb.d.ts.map → index-B8yz6WXO.d.ts.map} +1 -1
  41. package/dist/{index-DSClFMFZ.d.ts → index-BhZ3YBnN.d.ts} +45 -9
  42. package/dist/index-BhZ3YBnN.d.ts.map +1 -0
  43. package/dist/{index-mB8jN_Bj.d.ts → index-ByLLTKEj.d.ts} +9 -8
  44. package/dist/index-ByLLTKEj.d.ts.map +1 -0
  45. package/dist/{index-C1JqJ_i1.d.ts → index-D4ZhCe7P.d.ts} +144 -144
  46. package/dist/index-D4ZhCe7P.d.ts.map +1 -0
  47. package/dist/{index-k65wai5N.d.ts → index-Df7yatq6.d.ts} +3 -3
  48. package/dist/{index-k65wai5N.d.ts.map → index-Df7yatq6.d.ts.map} +1 -1
  49. package/dist/{index-fHnFXjoz.d.ts → index-Dh9ISiWl.d.ts} +6 -6
  50. package/dist/{index-fHnFXjoz.d.ts.map → index-Dh9ISiWl.d.ts.map} +1 -1
  51. package/dist/{index-CH2KmtSA.d.ts → index-LvDqiNsi.d.ts} +1 -1
  52. package/dist/index-LvDqiNsi.d.ts.map +1 -0
  53. package/dist/{colors-Ci7Xp7LQ.d.ts → index-OLba92wa.d.ts} +129 -2
  54. package/dist/index-OLba92wa.d.ts.map +1 -0
  55. package/dist/{index-DCFLPx6S.d.ts → index-TrKTkpVy.d.ts} +4 -4
  56. package/dist/{index-DCFLPx6S.d.ts.map → index-TrKTkpVy.d.ts.map} +1 -1
  57. package/dist/index.d.ts +20 -23
  58. package/dist/index.js +1 -1
  59. package/dist/{flag-s0MNBVcQ.d.ts → instanceInfo-D9Pe6gIo.d.ts} +19 -19
  60. package/dist/instanceInfo-D9Pe6gIo.d.ts.map +1 -0
  61. package/dist/{keepAlive-CEzyrDfg.js → keepAlive-DHpmpKwK.js} +2 -2
  62. package/dist/keepAlive-DHpmpKwK.js.map +1 -0
  63. package/dist/lib/api/track.js +1 -1
  64. package/dist/lib/api/user.js +1 -1
  65. package/dist/lib/const.js +1 -1
  66. package/dist/lib/result/ResultErrorFallback.js +1 -1
  67. package/dist/{index-DOAZG2TB.d.ts → lineage-Dlb1kxeC.d.ts} +148 -103
  68. package/dist/lineage-Dlb1kxeC.d.ts.map +1 -0
  69. package/dist/{primitives-CUgk9o0R.d.ts → primitives-BleKrM0d.d.ts} +27 -27
  70. package/dist/{primitives-CUgk9o0R.d.ts.map → primitives-BleKrM0d.d.ts.map} +1 -1
  71. package/dist/primitives.d.ts +9 -10
  72. package/dist/primitives.js +1 -1
  73. package/dist/result.d.ts +2 -2
  74. package/dist/result.js +1 -1
  75. package/dist/src-CEozlKTg.js +67 -0
  76. package/dist/src-CEozlKTg.js.map +1 -0
  77. package/dist/{theme-7oDjt2Ob.js → theme-DXid0SHa.js} +2 -2
  78. package/dist/{theme-7oDjt2Ob.js.map → theme-DXid0SHa.js.map} +1 -1
  79. package/dist/theme.d.ts +1 -2
  80. package/dist/theme.js +1 -1
  81. package/dist/{track-Bh1oUc4K.js → track-DV9xFZGy.js} +1 -1
  82. package/dist/{track-Bh1oUc4K.js.map → track-DV9xFZGy.js.map} +1 -1
  83. package/dist/{types-DtbGtILc.d.ts → types-BfldLa8_.d.ts} +3 -3
  84. package/dist/{types-DtbGtILc.d.ts.map → types-BfldLa8_.d.ts.map} +1 -1
  85. package/dist/{types-BtXBu8r6.d.ts → types-O5C1mYdz.d.ts} +2 -2
  86. package/dist/{types-BtXBu8r6.d.ts.map → types-O5C1mYdz.d.ts.map} +1 -1
  87. package/dist/types.d.ts +10 -13
  88. package/dist/{useThemeColors-D5cl0qVS.d.ts → useThemeColors-DG_7-mWH.d.ts} +1 -1
  89. package/dist/{useThemeColors-D5cl0qVS.d.ts.map → useThemeColors-DG_7-mWH.d.ts.map} +1 -1
  90. package/dist/{user-Bhq2W6Wv.js → user-CYVsmhqS.js} +1 -1
  91. package/dist/{user-Bhq2W6Wv.js.map → user-CYVsmhqS.js.map} +1 -1
  92. package/dist/utils-Bwpgu6nv.js +3 -0
  93. package/dist/utils-Bwpgu6nv.js.map +1 -0
  94. package/dist/utils-DjxzJ8eH.js +5 -0
  95. package/dist/utils-DjxzJ8eH.js.map +1 -0
  96. package/dist/utils.d.ts +5 -5
  97. package/dist/utils.js +1 -1
  98. package/package.json +1 -1
  99. package/dist/AuthModal-BQwv7JWv.js +0 -23
  100. package/dist/AuthModal-BQwv7JWv.js.map +0 -1
  101. package/dist/LineageCanvas-ChaGa1FL.d.ts +0 -41
  102. package/dist/LineageCanvas-ChaGa1FL.d.ts.map +0 -1
  103. package/dist/SplitPane-BW_0Lmst.d.ts.map +0 -1
  104. package/dist/colors-Ci7Xp7LQ.d.ts.map +0 -1
  105. package/dist/flag-koeDAqr3.js +0 -3
  106. package/dist/flag-koeDAqr3.js.map +0 -1
  107. package/dist/flag-s0MNBVcQ.d.ts.map +0 -1
  108. package/dist/index-C1JqJ_i1.d.ts.map +0 -1
  109. package/dist/index-CH2KmtSA.d.ts.map +0 -1
  110. package/dist/index-D1V96oC2.d.ts +0 -130
  111. package/dist/index-D1V96oC2.d.ts.map +0 -1
  112. package/dist/index-DOAZG2TB.d.ts.map +0 -1
  113. package/dist/index-DSClFMFZ.d.ts.map +0 -1
  114. package/dist/index-DaKVp8yA.d.ts +0 -192
  115. package/dist/index-DaKVp8yA.d.ts.map +0 -1
  116. package/dist/index-mB8jN_Bj.d.ts.map +0 -1
  117. package/dist/keepAlive-CEzyrDfg.js.map +0 -1
  118. package/dist/src-BxTmufnC.js +0 -67
  119. package/dist/src-BxTmufnC.js.map +0 -1
  120. package/dist/useIsDark-CH3bsKYg.js +0 -3
  121. package/dist/useIsDark-CH3bsKYg.js.map +0 -1
  122. package/dist/useRecceServerFlag-Bg5R67J4.js +0 -3
  123. package/dist/useRecceServerFlag-Bg5R67J4.js.map +0 -1
  124. package/dist/useThemeColors-D8X-rgl4.js +0 -3
  125. package/dist/useThemeColors-D8X-rgl4.js.map +0 -1
  126. package/dist/utils-CW2skXm_.js +0 -3
  127. package/dist/utils-CW2skXm_.js.map +0 -1
  128. package/dist/utils-DqeUibB3.js +0 -5
  129. package/dist/utils-DqeUibB3.js.map +0 -1
package/dist/theme.d.ts CHANGED
@@ -1,4 +1,3 @@
1
1
 
2
- import { a as semanticVariantMap, i as colors, n as SemanticColorVariant, o as token, r as colorAliases, t as ColorShade } from "./colors-Ci7Xp7LQ.js";
3
- import { _ as getThemedPluginOptions, a as BASE_BAR_COLOR_DARK, b as dataGridThemeLight, c as CURRENT_BAR_COLOR, d as CURRENT_BAR_COLOR_WITH_ALPHA, f as ChartThemeColors, g as getChartThemeColors, h as getBarColors, i as BASE_BAR_COLOR, l as CURRENT_BAR_COLOR_DARK, m as INFO_VAL_COLOR_DARK, n as RecceTheme, o as BASE_BAR_COLOR_DARK_WITH_ALPHA, p as INFO_VAL_COLOR, r as theme, s as BASE_BAR_COLOR_WITH_ALPHA, t as Theme, u as CURRENT_BAR_COLOR_DARK_WITH_ALPHA, v as getThemedScaleOptions, y as dataGridThemeDark } from "./index-D1V96oC2.js";
2
+ import { C as getThemedPluginOptions, E as dataGridThemeLight, S as getChartThemeColors, T as dataGridThemeDark, _ as CURRENT_BAR_COLOR_WITH_ALPHA, a as SemanticColorVariant, b as INFO_VAL_COLOR_DARK, c as semanticVariantMap, d as BASE_BAR_COLOR_DARK, f as BASE_BAR_COLOR_DARK_WITH_ALPHA, g as CURRENT_BAR_COLOR_DARK_WITH_ALPHA, h as CURRENT_BAR_COLOR_DARK, i as ColorShade, l as token, m as CURRENT_BAR_COLOR, n as RecceTheme, o as colorAliases, p as BASE_BAR_COLOR_WITH_ALPHA, r as theme, s as colors, t as Theme, u as BASE_BAR_COLOR, v as ChartThemeColors, w as getThemedScaleOptions, x as getBarColors, y as INFO_VAL_COLOR } from "./index-OLba92wa.js";
4
3
  export { BASE_BAR_COLOR, BASE_BAR_COLOR_DARK, BASE_BAR_COLOR_DARK_WITH_ALPHA, BASE_BAR_COLOR_WITH_ALPHA, CURRENT_BAR_COLOR, CURRENT_BAR_COLOR_DARK, CURRENT_BAR_COLOR_DARK_WITH_ALPHA, CURRENT_BAR_COLOR_WITH_ALPHA, ChartThemeColors, ColorShade, INFO_VAL_COLOR, INFO_VAL_COLOR_DARK, RecceTheme, SemanticColorVariant, Theme, colorAliases, colors, dataGridThemeDark, dataGridThemeLight, getBarColors, getChartThemeColors, getThemedPluginOptions, getThemedScaleOptions, semanticVariantMap, theme, token };
package/dist/theme.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{_ as e,a as t,c as n,d as r,f as i,g as a,h as o,i as s,l as c,m as l,n as u,o as d,p as f,r as p,s as m,t as h,u as g}from"./theme-7oDjt2Ob.js";import{i as _,n as v,r as y,t as b}from"./colors-D6QQQjX4.js";export{u as BASE_BAR_COLOR,p as BASE_BAR_COLOR_DARK,s as BASE_BAR_COLOR_DARK_WITH_ALPHA,t as BASE_BAR_COLOR_WITH_ALPHA,d as CURRENT_BAR_COLOR,m as CURRENT_BAR_COLOR_DARK,n as CURRENT_BAR_COLOR_DARK_WITH_ALPHA,c as CURRENT_BAR_COLOR_WITH_ALPHA,g as INFO_VAL_COLOR,r as INFO_VAL_COLOR_DARK,b as colorAliases,v as colors,a as dataGridThemeDark,e as dataGridThemeLight,i as getBarColors,f as getChartThemeColors,l as getThemedPluginOptions,o as getThemedScaleOptions,y as semanticVariantMap,h as theme,_ as token};
2
+ import{_ as e,a as t,c as n,d as r,f as i,g as a,h as o,i as s,l as c,m as l,n as u,o as d,p as f,r as p,s as m,t as h,u as g}from"./theme-DXid0SHa.js";import{i as _,n as v,r as y,t as b}from"./colors-C4PP3M6b.js";export{u as BASE_BAR_COLOR,p as BASE_BAR_COLOR_DARK,s as BASE_BAR_COLOR_DARK_WITH_ALPHA,t as BASE_BAR_COLOR_WITH_ALPHA,d as CURRENT_BAR_COLOR,m as CURRENT_BAR_COLOR_DARK,n as CURRENT_BAR_COLOR_DARK_WITH_ALPHA,c as CURRENT_BAR_COLOR_WITH_ALPHA,g as INFO_VAL_COLOR,r as INFO_VAL_COLOR_DARK,b as colorAliases,v as colors,a as dataGridThemeDark,e as dataGridThemeLight,i as getBarColors,f as getChartThemeColors,l as getThemedPluginOptions,o as getThemedScaleOptions,y as semanticVariantMap,h as theme,_ as token};
@@ -1,3 +1,3 @@
1
1
  "use client";
2
2
  import{initAll as e,track as t}from"@amplitude/unified";function n(e,n,i){return r||console.log(`[Tracking]`,e,n,i),t(e,n,i)}let r=!1;function i(){function t(e){let t=document.cookie.match(`(^|;)\\s*`+e+`\\s*=\\s*([^;]+)`);return t?t.pop():``}let n=t(`recce_user_id`),i=process.env.AMPLITUDE_API_KEY;if(n&&i)try{e(i,{analytics:{userId:n,autocapture:!0},sessionReplay:{sampleRate:1}}),r=!0}catch(e){console.error(e)}r||console.log(`[Tracking] Amplitude not initialized (missing API key or user ID). Events will be logged to console instead.`)}function a(e){n(`[Web] multi_nodes_action`,e)}function o(e){n(`[Web] history_action`,e)}function s(e){n(`[Experiment] preview_change`,e)}function c(e){n(`[Experiment] preview_change`,e)}function l(e){n(`[Experiment] single_environment`,e)}function u(){return!1}function d(e){n(`[Web] column_level_lineage`,e)}function f(e){n(`[Web] share_state`,e)}function p(e){n(`[Web] state_action`,e)}function m(e){n(`[Click] copy_to_clipboard`,e)}function h(e){n(`[Web] navigation_change`,e)}function g(e){n(`[Web] lineage_view_render`,e)}function _(e){n(`[Web] environment_config`,e)}const v={ROW_COUNT:`row_count`,ROW_COUNT_DIFF:`row_count_diff`,PROFILE:`profile`,PROFILE_DIFF:`profile_diff`,VALUE_DIFF:`value_diff`,SCHEMA_DIFF:`schema_diff`,LINEAGE_DIFF:`lineage_diff`,QUERY:`query`,HISTOGRAM_DIFF:`histogram_diff`,TOP_K_DIFF:`top_k_diff`},y={LINEAGE_VIEW_TOP_BAR:`lineage_view_top_bar`,LINEAGE_VIEW_CONTEXT_MENU:`lineage_view_context_menu`,NODE_KEBAB_MENU:`node_kebab_menu`,NODE_SIDEBAR_SINGLE_ENV:`node_sidebar_single_env`,NODE_SIDEBAR_MULTI_ENV:`node_sidebar_multi_env`,SCHEMA_ROW_COUNT_BUTTON:`schema_row_count_button`,SCHEMA_COLUMN_MENU:`schema_column_menu`};function b(e){n(`[Web] explore_action`,e)}const x={EXECUTE:`execute`,CANCEL:`cancel`};function S(e){n(`[Web] explore_action_form`,e)}function C(e){return Object.values(v).includes(e)}const w={SELECT_PARENT_NODES:`select_parent_nodes`,SELECT_CHILD_NODES:`select_child_nodes`,SELECT_ALL_UPSTREAM:`select_all_upstream`,SELECT_ALL_DOWNSTREAM:`select_all_downstream`};function T(e){n(`[Web] lineage_selection`,e)}export{p as S,h as _,u as a,f as b,m as c,S as d,o as f,a as g,g as h,w as i,_ as l,T as m,x as n,C as o,i as p,y as r,d as s,v as t,b as u,s as v,l as x,c as y};
3
- //# sourceMappingURL=track-Bh1oUc4K.js.map
3
+ //# sourceMappingURL=track-DV9xFZGy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"track-Bh1oUc4K.js","names":["track","trk"],"sources":["../src/lib/api/track.ts"],"sourcesContent":["import {\n AmplitudeReturn,\n BaseEvent,\n EventOptions,\n Result,\n} from \"@amplitude/analytics-core\";\nimport { initAll, track as trk } from \"@amplitude/unified\";\n\nfunction track(\n eventInput: string | BaseEvent,\n // biome-ignore lint/suspicious/noExplicitAny: Amplitude library uses any for event properties\n eventProperties?: Record<string, any> | undefined,\n eventOptions?: EventOptions | undefined,\n): AmplitudeReturn<Result> {\n // If Amplitude isn't initialized, log to console instead (but not during tests)\n if (!amplitudeInitialized && process.env.NODE_ENV !== \"test\") {\n console.log(\"[Tracking]\", eventInput, eventProperties, eventOptions);\n }\n return trk(eventInput, eventProperties, eventOptions);\n}\n\nlet amplitudeInitialized = false;\n\nexport function trackInit() {\n function getCookie(key: string) {\n const b = document.cookie.match(\"(^|;)\\\\s*\" + key + \"\\\\s*=\\\\s*([^;]+)\");\n return b ? b.pop() : \"\";\n }\n\n const userId =\n process.env.NODE_ENV === \"development\"\n ? \"web_dev\"\n : getCookie(\"recce_user_id\");\n const apiKey = process.env.AMPLITUDE_API_KEY;\n if (userId && apiKey) {\n try {\n void initAll(apiKey, {\n analytics: {\n userId,\n autocapture: true,\n },\n sessionReplay: {\n sampleRate: 1,\n },\n });\n amplitudeInitialized = true;\n } catch (e) {\n console.error(e);\n }\n }\n\n // Log when Amplitude is not initialized (for development/debugging)\n if (!amplitudeInitialized) {\n console.log(\n \"[Tracking] Amplitude not initialized (missing API key or user ID). Events will be logged to console instead.\",\n );\n }\n}\n\ninterface MultiNodeActionProps {\n type:\n | \"row_count\"\n | \"row_count_diff\"\n | \"value_diff\"\n | \"schema_diff\"\n | \"lineage_diff\";\n selected: \"single\" | \"multi\" | \"none\";\n}\n\nexport function trackMultiNodesAction(props: MultiNodeActionProps) {\n track(\"[Web] multi_nodes_action\", props);\n}\n\ninterface HistoryActionProps {\n name: \"show\" | \"hide\" | \"click_run\" | \"add_to_checklist\" | \"go_to_check\";\n}\n\nexport function trackHistoryAction(props: HistoryActionProps) {\n track(\"[Web] history_action\", props);\n}\n\ninterface PreviewChangeProps {\n action: \"explore\" | \"run\" | \"close\";\n node?: string;\n status?: \"success\" | \"failure\";\n}\n\nexport function trackPreviewChange(props: PreviewChangeProps) {\n track(\"[Experiment] preview_change\", props);\n}\n\ninterface PreviewChangeFeedbackProps {\n feedback: \"like\" | \"dislike\" | \"form\";\n node?: string;\n}\n\nexport function trackPreviewChangeFeedback(props: PreviewChangeFeedbackProps) {\n track(\"[Experiment] preview_change\", props);\n}\n\ninterface SingleEnvironmentProps {\n action:\n | \"onboarding\"\n | \"external_link\"\n | \"preview_changes\"\n | `target_base_added`;\n from?: \"onboarding\" | \"preview_changes\";\n node?: string;\n}\n\nexport function trackSingleEnvironment(props: SingleEnvironmentProps) {\n track(\"[Experiment] single_environment\", props);\n}\n\nexport function getExperimentTrackingBreakingChangeEnabled() {\n return false;\n}\n\ninterface ColumnLevelLineageProps {\n action: \"view\";\n source: \"schema_column\" | \"changed_column\" | \"cll_column\";\n}\n\nexport function trackColumnLevelLineage(props: ColumnLevelLineageProps) {\n track(\"[Web] column_level_lineage\", props);\n}\n\ninterface ShareStateProps {\n name: \"enable\" | \"create\" | \"copy\";\n}\n\nexport function trackShareState(props: ShareStateProps) {\n track(\"[Web] share_state\", props);\n}\n\ninterface StateActionProps {\n name: \"import\" | \"export\";\n}\n\nexport function trackStateAction(props: StateActionProps) {\n track(\"[Web] state_action\", props);\n}\n\ninterface CopyToClipboardProps {\n from: \"run\" | \"check\" | \"lineage_view\";\n type: string;\n}\n\nexport function trackCopyToClipboard(props: CopyToClipboardProps) {\n track(\"[Click] copy_to_clipboard\", props);\n}\n\ninterface TrackNavProps {\n from: string;\n to: string;\n}\n\nexport function trackNavigation(props: TrackNavProps) {\n track(\"[Web] navigation_change\", props);\n}\n\nexport interface LineageViewRenderProps {\n node_count: number;\n view_mode: string;\n impact_radius_enabled: boolean;\n cll_column_active?: boolean;\n right_sidebar_open: boolean;\n [status: string]: number | string | boolean | undefined;\n}\n\nexport function trackLineageViewRender(props: LineageViewRenderProps) {\n track(\"[Web] lineage_view_render\", props);\n}\n\nexport interface EnvironmentConfigProps {\n review_mode: boolean;\n adapter_type: string | null;\n has_git_info: boolean;\n has_pr_info: boolean;\n // Adapter-specific (shape varies by adapter_type)\n base?: {\n schema_count?: number;\n dbt_version?: string | null;\n timestamp?: string | null;\n has_env?: boolean;\n };\n current?: {\n schema_count?: number;\n dbt_version?: string | null;\n timestamp?: string | null;\n has_env?: boolean;\n };\n schemas_match?: boolean;\n}\n\nexport function trackEnvironmentConfig(props: EnvironmentConfigProps) {\n track(\"[Web] environment_config\", props);\n}\n\n// Explore action types\nexport const EXPLORE_ACTION = {\n ROW_COUNT: \"row_count\",\n ROW_COUNT_DIFF: \"row_count_diff\",\n PROFILE: \"profile\",\n PROFILE_DIFF: \"profile_diff\",\n VALUE_DIFF: \"value_diff\",\n SCHEMA_DIFF: \"schema_diff\",\n LINEAGE_DIFF: \"lineage_diff\",\n QUERY: \"query\",\n HISTOGRAM_DIFF: \"histogram_diff\",\n TOP_K_DIFF: \"top_k_diff\",\n} as const;\n\n// Explore action sources\nexport const EXPLORE_SOURCE = {\n LINEAGE_VIEW_TOP_BAR: \"lineage_view_top_bar\",\n LINEAGE_VIEW_CONTEXT_MENU: \"lineage_view_context_menu\",\n NODE_KEBAB_MENU: \"node_kebab_menu\",\n NODE_SIDEBAR_SINGLE_ENV: \"node_sidebar_single_env\",\n NODE_SIDEBAR_MULTI_ENV: \"node_sidebar_multi_env\",\n SCHEMA_ROW_COUNT_BUTTON: \"schema_row_count_button\",\n SCHEMA_COLUMN_MENU: \"schema_column_menu\",\n} as const;\n\nexport type ExploreActionType =\n (typeof EXPLORE_ACTION)[keyof typeof EXPLORE_ACTION];\nexport type ExploreSourceType =\n (typeof EXPLORE_SOURCE)[keyof typeof EXPLORE_SOURCE];\n\ninterface ExploreActionProps {\n action: ExploreActionType;\n source: ExploreSourceType;\n node_count?: number;\n}\n\nexport function trackExploreAction(props: ExploreActionProps) {\n track(\"[Web] explore_action\", props);\n}\n\n// Explore action form events\nexport const EXPLORE_FORM_EVENT = {\n EXECUTE: \"execute\",\n CANCEL: \"cancel\",\n} as const;\n\nexport type ExploreFormEventType =\n (typeof EXPLORE_FORM_EVENT)[keyof typeof EXPLORE_FORM_EVENT];\n\ninterface ExploreActionFormProps {\n action: ExploreActionType;\n event: ExploreFormEventType;\n}\n\nexport function trackExploreActionForm(props: ExploreActionFormProps) {\n track(\"[Web] explore_action_form\", props);\n}\n\n// Helper to check if a run type is an explore action\nexport function isExploreAction(type: string): type is ExploreActionType {\n return Object.values(EXPLORE_ACTION).includes(type as ExploreActionType);\n}\n\n// Lineage selection action types\nexport const LINEAGE_SELECTION_ACTION = {\n SELECT_PARENT_NODES: \"select_parent_nodes\",\n SELECT_CHILD_NODES: \"select_child_nodes\",\n SELECT_ALL_UPSTREAM: \"select_all_upstream\",\n SELECT_ALL_DOWNSTREAM: \"select_all_downstream\",\n} as const;\n\nexport type LineageSelectionActionType =\n (typeof LINEAGE_SELECTION_ACTION)[keyof typeof LINEAGE_SELECTION_ACTION];\n\ninterface LineageSelectionProps {\n action: LineageSelectionActionType;\n node_count?: number;\n}\n\nexport function trackLineageSelection(props: LineageSelectionProps) {\n track(\"[Web] lineage_selection\", props);\n}\n"],"mappings":";wDAQA,SAASA,EACP,EAEA,EACA,EACyB,CAKzB,OAHK,GACH,QAAQ,IAAI,aAAc,EAAY,EAAiB,EAAa,CAE/DC,EAAI,EAAY,EAAiB,EAAa,CAGvD,IAAI,EAAuB,GAE3B,SAAgB,GAAY,CAC1B,SAAS,EAAU,EAAa,CAC9B,IAAM,EAAI,SAAS,OAAO,MAAM,YAAc,EAAM,mBAAmB,CACvE,OAAO,EAAI,EAAE,KAAK,CAAG,GAGvB,IAAM,EAGA,EAAU,gBAAgB,CAC1B,EAAS,QAAQ,IAAI,kBAC3B,GAAI,GAAU,EACZ,GAAI,CACG,EAAQ,E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T,CAUD,SAAgB,EAAuB,EAA+B,CACpE,EAAM,4BAA6B,EAAM,CAI3C,SAAgB,EAAgB,EAAyC,CACvE,OAAO,OAAO,OAAO,EAAe,CAAC,SAAS,EAA0B,CAI1E,MAAa,EAA2B,CACtC,oBAAqB,sBACrB,mBAAoB,qBACpB,oBAAqB,sBACrB,sBAAuB,wBACxB,CAUD,SAAgB,EAAsB,EAA8B,CAClE,EAAM,0BAA2B,EAAM"}
1
+ {"version":3,"file":"track-DV9xFZGy.js","names":["track","trk"],"sources":["../src/lib/api/track.ts"],"sourcesContent":["import {\n AmplitudeReturn,\n BaseEvent,\n EventOptions,\n Result,\n} from \"@amplitude/analytics-core\";\nimport { initAll, track as trk } from \"@amplitude/unified\";\n\nfunction track(\n eventInput: string | BaseEvent,\n // biome-ignore lint/suspicious/noExplicitAny: Amplitude library uses any for event properties\n eventProperties?: Record<string, any> | undefined,\n eventOptions?: EventOptions | undefined,\n): AmplitudeReturn<Result> {\n // If Amplitude isn't initialized, log to console instead (but not during tests)\n if (!amplitudeInitialized && process.env.NODE_ENV !== \"test\") {\n console.log(\"[Tracking]\", eventInput, eventProperties, eventOptions);\n }\n return trk(eventInput, eventProperties, eventOptions);\n}\n\nlet amplitudeInitialized = false;\n\nexport function trackInit() {\n function getCookie(key: string) {\n const b = document.cookie.match(\"(^|;)\\\\s*\" + key + \"\\\\s*=\\\\s*([^;]+)\");\n return b ? b.pop() : \"\";\n }\n\n const userId =\n process.env.NODE_ENV === \"development\"\n ? \"web_dev\"\n : getCookie(\"recce_user_id\");\n const apiKey = process.env.AMPLITUDE_API_KEY;\n if (userId && apiKey) {\n try {\n void initAll(apiKey, {\n analytics: {\n userId,\n autocapture: true,\n },\n sessionReplay: {\n sampleRate: 1,\n },\n });\n amplitudeInitialized = true;\n } catch (e) {\n console.error(e);\n }\n }\n\n // Log when Amplitude is not initialized (for development/debugging)\n if (!amplitudeInitialized) {\n console.log(\n \"[Tracking] Amplitude not initialized (missing API key or user ID). Events will be logged to console instead.\",\n );\n }\n}\n\ninterface MultiNodeActionProps {\n type:\n | \"row_count\"\n | \"row_count_diff\"\n | \"value_diff\"\n | \"schema_diff\"\n | \"lineage_diff\";\n selected: \"single\" | \"multi\" | \"none\";\n}\n\nexport function trackMultiNodesAction(props: MultiNodeActionProps) {\n track(\"[Web] multi_nodes_action\", props);\n}\n\ninterface HistoryActionProps {\n name: \"show\" | \"hide\" | \"click_run\" | \"add_to_checklist\" | \"go_to_check\";\n}\n\nexport function trackHistoryAction(props: HistoryActionProps) {\n track(\"[Web] history_action\", props);\n}\n\ninterface PreviewChangeProps {\n action: \"explore\" | \"run\" | \"close\";\n node?: string;\n status?: \"success\" | \"failure\";\n}\n\nexport function trackPreviewChange(props: PreviewChangeProps) {\n track(\"[Experiment] preview_change\", props);\n}\n\ninterface PreviewChangeFeedbackProps {\n feedback: \"like\" | \"dislike\" | \"form\";\n node?: string;\n}\n\nexport function trackPreviewChangeFeedback(props: PreviewChangeFeedbackProps) {\n track(\"[Experiment] preview_change\", props);\n}\n\ninterface SingleEnvironmentProps {\n action:\n | \"onboarding\"\n | \"external_link\"\n | \"preview_changes\"\n | `target_base_added`;\n from?: \"onboarding\" | \"preview_changes\";\n node?: string;\n}\n\nexport function trackSingleEnvironment(props: SingleEnvironmentProps) {\n track(\"[Experiment] single_environment\", props);\n}\n\nexport function getExperimentTrackingBreakingChangeEnabled() {\n return false;\n}\n\ninterface ColumnLevelLineageProps {\n action: \"view\";\n source: \"schema_column\" | \"changed_column\" | \"cll_column\";\n}\n\nexport function trackColumnLevelLineage(props: ColumnLevelLineageProps) {\n track(\"[Web] column_level_lineage\", props);\n}\n\ninterface ShareStateProps {\n name: \"enable\" | \"create\" | \"copy\";\n}\n\nexport function trackShareState(props: ShareStateProps) {\n track(\"[Web] share_state\", props);\n}\n\ninterface StateActionProps {\n name: \"import\" | \"export\";\n}\n\nexport function trackStateAction(props: StateActionProps) {\n track(\"[Web] state_action\", props);\n}\n\ninterface CopyToClipboardProps {\n from: \"run\" | \"check\" | \"lineage_view\";\n type: string;\n}\n\nexport function trackCopyToClipboard(props: CopyToClipboardProps) {\n track(\"[Click] copy_to_clipboard\", props);\n}\n\ninterface TrackNavProps {\n from: string;\n to: string;\n}\n\nexport function trackNavigation(props: TrackNavProps) {\n track(\"[Web] navigation_change\", props);\n}\n\nexport interface LineageViewRenderProps {\n node_count: number;\n view_mode: string;\n impact_radius_enabled: boolean;\n cll_column_active?: boolean;\n right_sidebar_open: boolean;\n [status: string]: number | string | boolean | undefined;\n}\n\nexport function trackLineageViewRender(props: LineageViewRenderProps) {\n track(\"[Web] lineage_view_render\", props);\n}\n\nexport interface EnvironmentConfigProps {\n review_mode: boolean;\n adapter_type: string | null;\n has_git_info: boolean;\n has_pr_info: boolean;\n // Adapter-specific (shape varies by adapter_type)\n base?: {\n schema_count?: number;\n dbt_version?: string | null;\n timestamp?: string | null;\n has_env?: boolean;\n };\n current?: {\n schema_count?: number;\n dbt_version?: string | null;\n timestamp?: string | null;\n has_env?: boolean;\n };\n schemas_match?: boolean;\n}\n\nexport function trackEnvironmentConfig(props: EnvironmentConfigProps) {\n track(\"[Web] environment_config\", props);\n}\n\n// Explore action types\nexport const EXPLORE_ACTION = {\n ROW_COUNT: \"row_count\",\n ROW_COUNT_DIFF: \"row_count_diff\",\n PROFILE: \"profile\",\n PROFILE_DIFF: \"profile_diff\",\n VALUE_DIFF: \"value_diff\",\n SCHEMA_DIFF: \"schema_diff\",\n LINEAGE_DIFF: \"lineage_diff\",\n QUERY: \"query\",\n HISTOGRAM_DIFF: \"histogram_diff\",\n TOP_K_DIFF: \"top_k_diff\",\n} as const;\n\n// Explore action sources\nexport const EXPLORE_SOURCE = {\n LINEAGE_VIEW_TOP_BAR: \"lineage_view_top_bar\",\n LINEAGE_VIEW_CONTEXT_MENU: \"lineage_view_context_menu\",\n NODE_KEBAB_MENU: \"node_kebab_menu\",\n NODE_SIDEBAR_SINGLE_ENV: \"node_sidebar_single_env\",\n NODE_SIDEBAR_MULTI_ENV: \"node_sidebar_multi_env\",\n SCHEMA_ROW_COUNT_BUTTON: \"schema_row_count_button\",\n SCHEMA_COLUMN_MENU: \"schema_column_menu\",\n} as const;\n\nexport type ExploreActionType =\n (typeof EXPLORE_ACTION)[keyof typeof EXPLORE_ACTION];\nexport type ExploreSourceType =\n (typeof EXPLORE_SOURCE)[keyof typeof EXPLORE_SOURCE];\n\ninterface ExploreActionProps {\n action: ExploreActionType;\n source: ExploreSourceType;\n node_count?: number;\n}\n\nexport function trackExploreAction(props: ExploreActionProps) {\n track(\"[Web] explore_action\", props);\n}\n\n// Explore action form events\nexport const EXPLORE_FORM_EVENT = {\n EXECUTE: \"execute\",\n CANCEL: \"cancel\",\n} as const;\n\nexport type ExploreFormEventType =\n (typeof EXPLORE_FORM_EVENT)[keyof typeof EXPLORE_FORM_EVENT];\n\ninterface ExploreActionFormProps {\n action: ExploreActionType;\n event: ExploreFormEventType;\n}\n\nexport function trackExploreActionForm(props: ExploreActionFormProps) {\n track(\"[Web] explore_action_form\", props);\n}\n\n// Helper to check if a run type is an explore action\nexport function isExploreAction(type: string): type is ExploreActionType {\n return Object.values(EXPLORE_ACTION).includes(type as ExploreActionType);\n}\n\n// Lineage selection action types\nexport const LINEAGE_SELECTION_ACTION = {\n SELECT_PARENT_NODES: \"select_parent_nodes\",\n SELECT_CHILD_NODES: \"select_child_nodes\",\n SELECT_ALL_UPSTREAM: \"select_all_upstream\",\n SELECT_ALL_DOWNSTREAM: \"select_all_downstream\",\n} as const;\n\nexport type LineageSelectionActionType =\n (typeof LINEAGE_SELECTION_ACTION)[keyof typeof LINEAGE_SELECTION_ACTION];\n\ninterface LineageSelectionProps {\n action: LineageSelectionActionType;\n node_count?: number;\n}\n\nexport function trackLineageSelection(props: LineageSelectionProps) {\n track(\"[Web] lineage_selection\", props);\n}\n"],"mappings":";wDAQA,SAASA,EACP,EAEA,EACA,EACyB,CAKzB,OAHK,GACH,QAAQ,IAAI,aAAc,EAAY,EAAiB,EAA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WAAY,aACZ,YAAa,cACb,aAAc,eACd,MAAO,QACP,eAAgB,iBAChB,WAAY,aACb,CAGY,EAAiB,CAC5B,qBAAsB,uBACtB,0BAA2B,4BAC3B,gBAAiB,kBACjB,wBAAyB,0BACzB,uBAAwB,yBACxB,wBAAyB,0BACzB,mBAAoB,qBACrB,CAaD,SAAgB,EAAmB,EAA2B,CAC5D,EAAM,uBAAwB,EAAM,CAItC,MAAa,EAAqB,CAChC,QAAS,UACT,OAAQ,SACT,CAUD,SAAgB,EAAuB,EAA+B,CACpE,EAAM,4BAA6B,EAAM,CAI3C,SAAgB,EAAgB,EAAyC,CACvE,OAAO,OAAO,OAAO,EAAe,CAAC,SAAS,EAA0B,CAI1E,MAAa,EAA2B,CACtC,oBAAqB,sBACrB,mBAAoB,qBACpB,oBAAqB,sBACrB,sBAAuB,wBACxB,CAUD,SAAgB,EAAsB,EAA8B,CAClE,EAAM,0BAA2B,EAAM"}
@@ -1,6 +1,6 @@
1
1
 
2
- import { C as Run, D as RunType, J as ValueDiffDetailViewOptions, Y as ValueDiffParams, dt as ProfileDiffViewOptions, ft as TopKDiffParams, ht as TopKViewOptions, lt as ProfileDiffParams, ot as HistogramDiffParams, s as LineageDiffViewOptions, wt as QueryViewOptions, yt as QueryDiffViewOptions, zt as AxiosQueryParams } from "./flag-s0MNBVcQ.js";
3
- import { r as DataGridHandle } from "./ScreenshotDataGrid-_0OXk0uO.js";
2
+ import { C as Run, D as RunType, J as ValueDiffDetailViewOptions, Y as ValueDiffParams, dt as ProfileDiffViewOptions, ft as TopKDiffParams, ht as TopKViewOptions, lt as ProfileDiffParams, ot as HistogramDiffParams, s as LineageDiffViewOptions, wt as QueryViewOptions, yt as QueryDiffViewOptions, zt as AxiosQueryParams } from "./instanceInfo-D9Pe6gIo.js";
3
+ import { r as DataGridHandle } from "./ScreenshotDataGrid-BaBsp-r1.js";
4
4
  import * as react16 from "react";
5
5
  import { ComponentType, ForwardRefExoticComponent, ReactNode, Ref, RefAttributes } from "react";
6
6
  import * as react_jsx_runtime14 from "react/jsx-runtime";
@@ -168,4 +168,4 @@ type RunFormParamTypes = ProfileDiffParams | ValueDiffParams | TopKDiffParams |
168
168
  type RegistryEntry<RefType = RefTypes, ViewOptions = ViewOptionTypes, FormParams = RunFormParamTypes> = RunTypeConfig<RefType, ViewOptions, FormParams>;
169
169
  //#endregion
170
170
  export { RunFormParamTypes as a, RunResultViewRef as c, ViewOptionTypes as d, DiffViewOptions as f, RegistryEntry as i, RunTypeConfig as l, RunToolbarProps as m, PartialRunTypeRegistry as n, RunFormProps as o, RunToolbar as p, RefTypes as r, RunResultViewProps as s, IconComponent as t, RunTypeRegistry as u };
171
- //# sourceMappingURL=types-DtbGtILc.d.ts.map
171
+ //# sourceMappingURL=types-BfldLa8_.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types-DtbGtILc.d.ts","names":[],"sources":["../src/components/run/RunToolbar.tsx","../src/components/run/types.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;UAYiB,eAAA;;EAAA,YAAA,CAAA,EAAA,OAAe;AAQhC;AAOC;;;AAgCC,UAvCe,eAAA,CAuCf;EACC;EAAe,QAAA,CAAA,EAAA,MAAA,EAAA;EAAA;EAmDL,QAAA,CAAA,EAvFA,SAuFsC;;;;ACpEnD;;;;;;AAoBA;;;;;AAqBA;AAcA;;;;;;;;;;;AAkCA;AAaA;AAUA;;iBDnGS,mBAAA,CCmGyC;EAAA,QAAA;EAAA,QAAA;EAAA;AAAA,CAAA,ED/F/C,eC+F+C,CAAA,ED/FhC,mBAAA,CAAA,GAAA,CAAA,OC+FgC;AAAJ,cD5CjC,UC4CiC,ED5CvB,OAAA,CAAA,mBC4CuB,CAAA,OD5CvB,mBC4CuB,CAAA;;;ADhI7C;;;;;;;AAoFY,UCpEI,YDoEkC,CAA5B,KAAA,OAAA,CAAA,CAAA;;UClEb,QAAQ;;EAFD,eAAY,EAAA,CAAA,MAAA,EAID,OAJC,CAIO,EAJP,CAAA,EAAA,GAAA,IAAA;EAEX;EAAR,mBAAA,EAAA,CAAA,gBAAA,EAAA,OAAA,EAAA,GAAA,IAAA;;;;AAkBV;;;;;AAqBY,UArBK,kBAqBW,CAAA,KAAA,OAAa,CAAA,CAAA;EAcxB;EAST,GAAA,EA1CD,GA0CC;EAIe;EAAnB,WAAA,CAAA,EA5CY,EA4CZ;EAAgD;EAAd,oBAAA,CAAA,EAAA,CAAA,WAAA,EA1CC,EA0CD,EAAA,GAAA,IAAA;;;;;;AAqBtC;AAaA;AAUA;AAA+B,KAvEnB,aAAA,GAAgB,aAuEG,CAAA,GAAA,CAAA;;;;AAU/B;;;;;AAKI,UAxEa,aAwEb,CAAA,UAAA,OAAA,EAAA,cAAA,OAAA,EAAA,aAAA,OAAA,CAAA,CAAA;EACA;EACA,KAAA,EAAA,MAAA;EAAe;EAMP,IAAA,EAvEJ,aAuEY;EAAO;EAAJ,aAAA,CAAA,EApEL,yBAoEK,CAnEnB,kBAmEmB,CAnEA,WAmEA,CAAA,GAnEe,aAmEf,CAnE6B,OAmE7B,CAAA,CAAA;EAA0B;EAAJ,OAAA,CAAA,EA/DjC,aA+DiC,CA/DnB,YA+DmB,CA/DN,UA+DM,CAAA,CAAA;;AAM7C;;;;;;;AAeA;;;AAGe,KAtEH,eAAA,GAsEG,QArEP,OAsEU,GAtEA,aAsEA,EAAS;;;;;;;;;;KA1Df,sBAAA,GAAyB,QAAQ;;;;;KAUjC,gBAAA,GAAmB,eAAe,IAAI;;;;;KAUtC,eAAA,GACR,yBACA,kBACA,mBACA,uBACA,yBACA,6BACA;;;;;KAMQ,QAAA,GAAW,IAAI,kBAAkB,IAAI;;;;;KAMrC,iBAAA,GACR,oBACA,kBACA,iBACA,sBACA;;;;;;;;;KAUQ,wBACA,wBACI,8BACD,qBACX,cAAc,SAAS,aAAa"}
1
+ {"version":3,"file":"types-BfldLa8_.d.ts","names":[],"sources":["../src/components/run/RunToolbar.tsx","../src/components/run/types.ts"],"sourcesContent":[],"mappings":";;;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WAmEA,CAAA,GAnEe,aAmEf,CAnE6B,OAmE7B,CAAA,CAAA;EAA0B;EAAJ,OAAA,CAAA,EA/DjC,aA+DiC,CA/DnB,YA+DmB,CA/DN,UA+DM,CAAA,CAAA;;AAM7C;;;;;;;AAeA;;;AAGe,KAtEH,eAAA,GAsEG,QArEP,OAsEU,GAtEA,aAsEA,EAAS;;;;;;;;;;KA1Df,sBAAA,GAAyB,QAAQ;;;;;KAUjC,gBAAA,GAAmB,eAAe,IAAI;;;;;KAUtC,eAAA,GACR,yBACA,kBACA,mBACA,uBACA,yBACA,6BACA;;;;;KAMQ,QAAA,GAAW,IAAI,kBAAkB,IAAI;;;;;KAMrC,iBAAA,GACR,oBACA,kBACA,iBACA,sBACA;;;;;;;;;KAUQ,wBACA,wBACI,8BACD,qBACX,cAAc,SAAS,aAAa"}
@@ -1,5 +1,5 @@
1
1
 
2
- import { C as Run, Jt as ColumnLineageData, Kt as CllInput, Ot as RunsAggregated, Qt as GitInfo, Zt as CatalogMetadata, cn as SQLMeshInfo, on as NodeData, rn as ManifestMetadata, s as LineageDiffViewOptions, sn as PullRequestInfo, un as StateMetadata } from "./flag-s0MNBVcQ.js";
2
+ import { C as Run, Jt as ColumnLineageData, Kt as CllInput, Ot as RunsAggregated, Qt as GitInfo, Zt as CatalogMetadata, cn as SQLMeshInfo, on as NodeData, rn as ManifestMetadata, s as LineageDiffViewOptions, sn as PullRequestInfo, un as StateMetadata } from "./instanceInfo-D9Pe6gIo.js";
3
3
  import React from "react";
4
4
  import { Edge, Node } from "@xyflow/react";
5
5
 
@@ -228,4 +228,4 @@ interface LineageViewContextType {
228
228
  }
229
229
  //#endregion
230
230
  export { LineageGraphColumnNode as a, LineageGraphNode as c, NodeAction as d, SelectMode as f, LineageGraph as i, LineageGraphNodes as l, isLineageGraphNode as m, ActionState as n, LineageGraphContextType as o, isLineageGraphColumnNode as p, EnvInfo as r, LineageGraphEdge as s, ActionMode as t, LineageViewContextType as u };
231
- //# sourceMappingURL=types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ode, an as NodeColumnData, cn as SQLMeshInfo, en as LineageDataFromMetadata, i as RecceInstanceInfo, ln as ServerInfoResult, on as NodeData, rn as ManifestMetadata, sn as PullRequestInfo, t as RecceServerFlags, tn as LineageDiffData, un as StateMetadata } from "./flag-s0MNBVcQ.js";
3
- import { a as LineageGraphColumnNode, c as LineageGraphNode, i as LineageGraph, l as LineageGraphNodes, o as LineageGraphContextType, r as EnvInfo, s as LineageGraphEdge } from "./types-BtXBu8r6.js";
4
- import { o as LineageGraphProviderProps, u as NodeColumnSetMap } from "./index-mB8jN_Bj.js";
5
- import { a as EdgeChangeStatus, c as LineageEdgeProps, i as NodeChangeStatus, n as LineageNodeData, r as LineageNodeProps, s as LineageEdgeData } from "./index-DaKVp8yA.js";
6
- import { n as LineageCanvasProps } from "./LineageCanvas-ChaGa1FL.js";
7
- import { _ as AxiosQueryParams, a as RecceFeatureMode, b as SubmitRunTrackProps, f as IdleTimeoutContextType, h as RecceActionProviderProps, i as InstanceInfoType, o as RecceFeatureToggles, v as RecceActionContextType, y as RecceActionOptions } from "./index-C1JqJ_i1.js";
8
- import { t as ThemeColors } from "./useThemeColors-D5cl0qVS.js";
9
- import { n as SemanticColorVariant, t as ColorShade } from "./colors-Ci7Xp7LQ.js";
10
- import "./api-BeQy3HaS.js";
11
- import { $ as CheckRunStatus, A as LineageLegendProps, B as LineageViewRef, C as HistogramChartProps, H as CheckListProps, I as LineageColumnNodeData, K as CheckDetailProps, L as LineageColumnNodeProps, O as ChangeStatusLegendItem, P as ColumnTransformationType, Q as CheckCardProps, T as HistogramDataset, W as CheckEmptyStateProps, Y as CheckDescriptionProps, Z as CheckCardData, _ as TopKBarChartProps, a as EmptyStateProps, b as ChartBarColors, c as DiffEditorProps, d as SchemaDiffHandle, et as CheckType, f as SchemaDiffProps, it as CheckActionsProps, j as TransformationLegendItem, l as DiffEditorTheme, m as SchemaDiffStatus, nt as CheckActionType, p as SchemaDiffRow, q as CheckDetailTab, r as SplitPaneProps, s as DiffEditorLanguage, t as SplitDirection, tt as CheckAction, v as TopKDataset, w as HistogramDataType, x as ChartThemeColors, y as TopKItem, z as LineageViewProps } from "./SplitPane-BW_0Lmst.js";
12
- import { _ as RunStatusWithDateProps, a as RunProgressVariant, c as RunListItemData, d as RunStatus, h as RunStatusBadgeProps, i as RunProgressProps, l as RunListItemProps, r as RunProgressOverlayProps, u as RunListProps } from "./RunProgress-DeALaWs4.js";
13
- import { _ as CheckProviderProps, a as RoutingConfig, d as QueryProviderProps, f as QueryResult, h as CheckContextType, i as NavigateOptions, l as QueryContextType, m as Check, o as RoutingContextValue, r as RecceProviderProps, t as TYPES_API_VERSION } from "./index-DSClFMFZ.js";
14
- import { t as Theme } from "./index-D1V96oC2.js";
2
+ import { $t as LineageData, Ot as RunsAggregated, Qt as GitInfo, Zt as CatalogMetadata, an as NodeColumnData, cn as SQLMeshInfo, en as LineageDataFromMetadata, i as RecceServerFlags, ln as ServerInfoResult, n as ServerMode, on as NodeData, rn as ManifestMetadata, sn as PullRequestInfo, t as RecceInstanceInfo, tn as LineageDiffData, un as StateMetadata } from "./instanceInfo-D9Pe6gIo.js";
3
+ import { a as LineageGraphColumnNode, c as LineageGraphNode, i as LineageGraph, l as LineageGraphNodes, o as LineageGraphContextType, r as EnvInfo, s as LineageGraphEdge } from "./types-O5C1mYdz.js";
4
+ import { o as LineageGraphProviderProps, u as NodeColumnSetMap } from "./index-ByLLTKEj.js";
5
+ import { $ as CheckRunStatus, A as LineageLegendProps, B as LineageViewRef, C as HistogramChartProps, H as CheckListProps, I as LineageColumnNodeData, K as CheckDetailProps, L as LineageColumnNodeProps, O as ChangeStatusLegendItem, P as ColumnTransformationType, Q as CheckCardProps, T as HistogramDataset, W as CheckEmptyStateProps, Y as CheckDescriptionProps, Z as CheckCardData, _ as TopKBarChartProps, a as EmptyStateProps, b as ChartBarColors, c as DiffEditorProps, ct as NodeChangeStatus, d as SchemaDiffHandle, dt as LineageEdgeData, et as CheckType, f as SchemaDiffProps, ft as LineageEdgeProps, it as CheckActionsProps, j as TransformationLegendItem, l as DiffEditorTheme, lt as EdgeChangeStatus, m as SchemaDiffStatus, nt as CheckActionType, ot as LineageNodeData, p as SchemaDiffRow, q as CheckDetailTab, r as SplitPaneProps, s as DiffEditorLanguage, st as LineageNodeProps, t as SplitDirection, tt as CheckAction, v as TopKDataset, w as HistogramDataType, x as ChartThemeColors, y as TopKItem, z as LineageViewProps } from "./SplitPane-Bc3gL6c2.js";
6
+ import { _ as CheckProviderProps, a as RoutingConfig, b as LineageCanvasProps, d as QueryProviderProps, f as QueryResult, h as CheckContextType, i as NavigateOptions, l as QueryContextType, m as Check, o as RoutingContextValue, r as RecceProviderProps, t as TYPES_API_VERSION } from "./index-BhZ3YBnN.js";
7
+ import "./api-CHRBUwIf.js";
8
+ import { _ as RunStatusWithDateProps, a as RunProgressVariant, c as RunListItemData, d as RunStatus, h as RunStatusBadgeProps, i as RunProgressProps, l as RunListItemProps, r as RunProgressOverlayProps, u as RunListProps } from "./RunProgress-BnkCSNvv.js";
9
+ import { _ as RecceFeatureMode, d as RecceActionOptions, f as SubmitRunTrackProps, g as InstanceInfoType, i as IdleTimeoutContextType, l as AxiosQueryParams, s as RecceActionProviderProps, u as RecceActionContextType, v as RecceFeatureToggles } from "./index-D4ZhCe7P.js";
10
+ import { t as ThemeColors } from "./useThemeColors-DG_7-mWH.js";
11
+ import { a as SemanticColorVariant, i as ColorShade, t as Theme } from "./index-OLba92wa.js";
15
12
  export { AxiosQueryParams, CatalogMetadata, ChangeStatusLegendItem, ChartBarColors, ChartThemeColors, Check, CheckAction, CheckActionType, CheckActionsProps, CheckCardData, CheckCardProps, CheckContextType, CheckDescriptionProps, CheckDetailProps, CheckDetailTab, CheckEmptyStateProps, CheckListProps, CheckProviderProps, CheckRunStatus, CheckType, ColorShade, ColumnTransformationType, DiffEditorLanguage, DiffEditorProps, DiffEditorTheme, EdgeChangeStatus, EmptyStateProps, EnvInfo, GitInfo, HistogramChartProps, HistogramDataType, HistogramDataset, IdleTimeoutContextType, InstanceInfoType, LineageCanvasProps, LineageColumnNodeData, LineageColumnNodeProps, LineageData, LineageDataFromMetadata, LineageDiffData, LineageEdgeData, LineageEdgeProps, LineageGraph, LineageGraphColumnNode, LineageGraphContextType, LineageGraphEdge, LineageGraphNode, LineageGraphNodes, LineageGraphProviderProps, LineageLegendProps, LineageNodeData, LineageNodeProps, LineageViewProps, LineageViewRef, ManifestMetadata, NavigateOptions, NodeChangeStatus, NodeColumnData, NodeColumnSetMap, NodeData, PullRequestInfo, QueryContextType, QueryProviderProps, QueryResult, RecceActionContextType, RecceActionOptions, RecceActionProviderProps, RecceFeatureMode, RecceFeatureToggles, RecceInstanceInfo, RecceProviderProps, RecceServerFlags, RoutingConfig, RoutingContextValue, RunListItemData, RunListItemProps, RunListProps, RunProgressOverlayProps, RunProgressProps, RunProgressVariant, RunStatus, RunStatusBadgeProps, RunStatusWithDateProps, RunsAggregated, SQLMeshInfo, SchemaDiffHandle, SchemaDiffProps, SchemaDiffRow, SchemaDiffStatus, SemanticColorVariant, ServerInfoResult, ServerMode, SplitDirection, SplitPaneProps, StateMetadata, SubmitRunTrackProps, TYPES_API_VERSION, Theme, ThemeColors, TopKBarChartProps, TopKDataset, TopKItem, TransformationLegendItem };
@@ -101,4 +101,4 @@ declare function useThemeColors(): {
101
101
  type ThemeColors = ReturnType<typeof useThemeColors>;
102
102
  //#endregion
103
103
  export { useThemeColors as n, ThemeColors as t };
104
- //# sourceMappingURL=useThemeColors-D5cl0qVS.d.ts.map
104
+ //# sourceMappingURL=useThemeColors-DG_7-mWH.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useThemeColors-D5cl0qVS.d.ts","names":[],"sources":["../src/hooks/useThemeColors.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAuCA;AA2FA;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA3FgB,cAAA,CAAA;;;;SAAc,qBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2FlB,WAAA,GAAc,kBAAkB"}
1
+ {"version":3,"file":"useThemeColors-DG_7-mWH.d.ts","names":[],"sources":["../src/hooks/useThemeColors.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAuCA;AA2FA;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA3FgB,cAAA,CAAA;;;;SAAc,qBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2FlB,WAAA,GAAc,kBAAkB"}
@@ -1,3 +1,3 @@
1
1
  "use client";
2
2
  import e from"axios";async function t(t=e){try{return(await t.get(`/api/users`)).data}catch(e){throw console.error(`Error fetching user data:`,e),e}}async function n(t){try{return(await e.get(`https://api.github.com/user/${t}`)).data.avatar_url}catch(e){return console.warn(`Failed to fetch GitHub avatar:`,e),null}}export{t as n,n as t};
3
- //# sourceMappingURL=user-Bhq2W6Wv.js.map
3
+ //# sourceMappingURL=user-CYVsmhqS.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"user-Bhq2W6Wv.js","names":[],"sources":["../src/lib/api/user.ts"],"sourcesContent":["import axios, { AxiosInstance, AxiosResponse } from \"axios\";\n\nexport interface User {\n id: string;\n login: string;\n login_type: string;\n email: string;\n onboarding_state: string;\n}\n\ninterface GitHubUser {\n login: string;\n id: number;\n avatar_url: string;\n}\n\nexport async function fetchUser(client: AxiosInstance = axios): Promise<User> {\n try {\n const response = await client.get<never, AxiosResponse<User>>(\"/api/users\");\n return response.data;\n } catch (error) {\n if (process.env.NODE_ENV !== \"test\") {\n console.error(\"Error fetching user data:\", error);\n }\n throw error;\n }\n}\n\nexport async function fetchGitHubAvatar(\n userId: string,\n): Promise<string | null> {\n try {\n const response = await axios.get<GitHubUser>(\n `https://api.github.com/user/${userId}`,\n );\n return response.data.avatar_url;\n } catch (error) {\n if (process.env.NODE_ENV !== \"test\") {\n console.warn(\"Failed to fetch GitHub avatar:\", error);\n }\n return null;\n }\n}\n"],"mappings":";qBAgBA,eAAsB,EAAU,EAAwB,EAAsB,CAC5E,GAAI,CAEF,OADiB,MAAM,EAAO,IAAgC,aAAa,EAC3D,WACT,EAAO,CAId,MAFE,QAAQ,MAAM,4BAA6B,EAAM,CAE7C,GAIV,eAAsB,EACpB,EACwB,CACxB,GAAI,CAIF,OAHiB,MAAM,EAAM,IAC3B,+BAA+B,IAChC,EACe,KAAK,iBACd,EAAO,CAId,OAFE,QAAQ,KAAK,iCAAkC,EAAM,CAEhD"}
1
+ {"version":3,"file":"user-CYVsmhqS.js","names":[],"sources":["../src/lib/api/user.ts"],"sourcesContent":["import axios, { AxiosInstance, AxiosResponse } from \"axios\";\n\nexport interface User {\n id: string;\n login: string;\n login_type: string;\n email: string;\n onboarding_state: string;\n}\n\ninterface GitHubUser {\n login: string;\n id: number;\n avatar_url: string;\n}\n\nexport async function fetchUser(client: AxiosInstance = axios): Promise<User> {\n try {\n const response = await client.get<never, AxiosResponse<User>>(\"/api/users\");\n return response.data;\n } catch (error) {\n if (process.env.NODE_ENV !== \"test\") {\n console.error(\"Error fetching user data:\", error);\n }\n throw error;\n }\n}\n\nexport async function fetchGitHubAvatar(\n userId: string,\n): Promise<string | null> {\n try {\n const response = await axios.get<GitHubUser>(\n `https://api.github.com/user/${userId}`,\n );\n return response.data.avatar_url;\n } catch (error) {\n if (process.env.NODE_ENV !== \"test\") {\n console.warn(\"Failed to fetch GitHub avatar:\", error);\n }\n return null;\n }\n}\n"],"mappings":";qBAgBA,eAAsB,EAAU,EAAwB,EAAsB,CAC5E,GAAI,CAEF,OADiB,MAAM,EAAO,IAAgC,aAAa,EAC3D,WACT,EAAO,CAId,MAFE,QAAQ,MAAM,4BAA6B,EAAM,CAE7C,GAIV,eAAsB,EACpB,EACwB,CACxB,GAAI,CAIF,OAHiB,MAAM,EAAM,IAC3B,+BAA+B,IAChC,EACe,KAAK,iBACd,EAAO,CAId,OAFE,QAAQ,KAAK,iCAAkC,EAAM,CAEhD"}
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ import{a as e,d as t,f as n,i as r,o as i,r as a,t as o}from"./keepAlive-DHpmpKwK.js";import{useQuery as s}from"@tanstack/react-query";import c from"axios";import{createContext as l,useCallback as u,useContext as d,useEffect as f,useMemo as p,useRef as m,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";import v from"lodash/throttle";const y={basePath:``},b=l(null);b.displayName=`RouteConfigContext`;function x({children:e,basePath:t=y.basePath}){let n=u(e=>!t||e.startsWith(t)||e.match(/^https?:\/\//)||e.startsWith(`#`)?e:`${t.endsWith(`/`)?t.slice(0,-1):t}${e.startsWith(`/`)?e:`/${e}`}`,[t]),r=p(()=>({basePath:t,resolvePath:n}),[t,n]);return g(b.Provider,{value:r,children:e})}const S={basePath:``,resolvePath:e=>e};function C(){return d(b)??S}function w(){return d(b)}const T=l({runAction:()=>void 0,showRunId:()=>void 0,isRunResultOpen:!1,closeRunResult:()=>void 0,isHistoryOpen:!1,closeHistory:()=>void 0,showHistory:()=>void 0,setHistoryOpen:()=>void 0,clearRunResult:()=>void 0});T.displayName=`RecceActionContext`;function E({children:e,onRunAction:t,onShowRunId:n,initialRunId:r,initialHistoryOpen:i=!1}){let[a,o]=h(!!r),[s,c]=h(r),[l,d]=h(i),f=u(()=>{o(!1)},[]),m=u(()=>{c(void 0),o(!1)},[]),_=u(()=>{d(!0)},[]),v=u(()=>{d(!1)},[]),y=u((e,t)=>{c(e),o(!0),n?.(e,t)},[n]),b=u(async(e,n,r)=>{if(!t){console.warn(`RecceActionProvider: onRunAction not provided, cannot execute run`);return}let i=await t(e,n,r);typeof i==`string`&&y(i)},[t,y]),x=p(()=>({runAction:b,runId:s,showRunId:y,isRunResultOpen:a,closeRunResult:f,isHistoryOpen:l,closeHistory:v,showHistory:_,setHistoryOpen:d,clearRunResult:m}),[b,s,y,a,f,l,v,_,m]);return g(T.Provider,{value:x,children:e})}function D(){return d(T)}const O={mode:null,disableSaveToFile:!1,disableExportStateFile:!1,disableImportStateFile:!1,disableUpdateChecklist:!1,disableDatabaseQuery:!1,disableViewActionDropdown:!1,disableNodeActionDropdown:!1,disableShare:!1},k={singleEnv:!1,authed:!1,lifetimeExpiredAt:void 0,featureToggles:O,shareUrl:void 0,sessionId:void 0},A=c.create();function j(){let r=t()?.apiClient??A;return s({queryKey:n.instanceInfo(),queryFn:()=>e(r)})}const M=l(k);M.displayName=`RecceInstanceInfoContext`;function N({children:e}){let{data:t,isLoading:n}=j(),[r,i]=h(O),[a,o]=h(!1),[s,c]=h(!1),[l,u]=h(),[d,f]=h(),[p,m]=h(),[_,v]=h(t);if(!n&&t&&t!==_){v(t),o(t.single_env),c(t.authed),f(t.share_url),m(t.session_id),t.lifetime_expired_at&&(u(new Date(t.lifetime_expired_at)),console.log(`lifetime expired at`,t.lifetime_expired_at));let e={...O};t.server_mode===`read-only`?(e.mode=`read only`,e.disableSaveToFile=!0,e.disableExportStateFile=!0,e.disableImportStateFile=!0,e.disableUpdateChecklist=!0,e.disableDatabaseQuery=!0,e.disableViewActionDropdown=!0,e.disableNodeActionDropdown=!0,e.disableShare=!0):t.server_mode===`preview`&&(e.mode=`metadata only`,e.disableSaveToFile=!0,e.disableExportStateFile=!0,e.disableImportStateFile=!0,e.disableUpdateChecklist=!1,e.disableDatabaseQuery=!0,e.disableViewActionDropdown=!1,e.disableNodeActionDropdown=!1,e.disableShare=!0),t.single_env&&(e.disableUpdateChecklist=!0,e.disableShare=!0),t.cloud_instance&&(e.disableShare=!0),i(e)}return g(M.Provider,{value:{featureToggles:r,singleEnv:a,authed:s,lifetimeExpiredAt:l,shareUrl:d,sessionId:p},children:e})}function P(){return d(M)}const F=l(void 0);function I(){return d(F)??null}const L=c.create();function ee(){return typeof window<`u`&&!!window.RECCE_DEBUG_IDLE}function R(e,t){ee()&&(t?console.log(e,t):console.log(e))}const z={ACTIVITY_EVENTS:[`focus`,`mousemove`,`keydown`,`scroll`],EVENT_THROTTLE_MS:150};function B(){let{data:e,isLoading:n,isError:r}=j(),i=I()?.isDisconnected??!1,o=t()?.apiClient??L,s=e?.idle_timeout,c=s!==void 0&&s>0&&!i;R(`[Idle Detection] Instance info`,{isLoading:n,isError:r,hasIdleTimeout:s!==void 0,idleTimeout:s===void 0?`not configured`:`${s}s`,isDisconnected:i,isEnabled:c});let l=u(async()=>{document.hidden||await a(o)&&R(`[Idle Detection] Keep-alive sent successfully`,{timestamp:new Date().toISOString()})},[o]),d=u(e=>{c&&!document.hidden&&(R(`[Idle Detection] Activity detected`,{event:e.type,tabActive:!document.hidden}),l())},[c,l]),m=u(()=>{c&&(document.hidden||(R(`[Idle Detection] Tab became active`,{timestamp:new Date().toISOString()}),l()))},[c,l]),h=p(()=>v(d,z.EVENT_THROTTLE_MS,{leading:!0,trailing:!0}),[d]);f(()=>{if(!c){R(`[Idle Detection] Disabled`,{idleTimeout:s,reason:s===void 0?`idle_timeout not configured on server`:s===0?`idle_timeout is 0`:`disconnected`});return}return R(`[Idle Detection] Initialized`,{enabled:!0,idleTimeout:`${s}s`,eventThrottle:`${z.EVENT_THROTTLE_MS}ms`,apiThrottle:`3s (axios layer)`,monitoredEvents:z.ACTIVITY_EVENTS.join(`, `)}),z.ACTIVITY_EVENTS.forEach(e=>{window.addEventListener(e,h,{passive:!0})}),document.addEventListener(`visibilitychange`,m),()=>{R(`[Idle Detection] Cleanup - removing event listeners`),z.ACTIVITY_EVENTS.forEach(e=>{window.removeEventListener(e,h)}),document.removeEventListener(`visibilitychange`,m),h.cancel()}},[c,h,m,s])}function V({children:e}){let{data:t}=j(),n=m(Date.now()),[i,a]=h(null),[s,c]=h(!1),l=t?.idle_timeout??null,d=l!==null&&l>0,p=m(d);f(()=>{p.current=d},[d]),f(()=>{if(!d){r(null);return}r(e=>{p.current&&(n.current=e)});let e=o();return e>0&&(n.current=e),()=>{r(null)}},[d]);let v=u(()=>{c(!0)},[]),y=u(()=>{c(!1),n.current=Date.now()},[]);return f(()=>{if(!d||l===null){a(null);return}if(s)return;let e=()=>{let e=(Date.now()-n.current)/1e3;a(Math.max(0,l-e))};e();let t=setInterval(e,1e3);return()=>{clearInterval(t)}},[d,l,s]),_(F.Provider,{value:{remainingSeconds:i,idleTimeout:l,isEnabled:d,setDisconnected:v,resetConnection:y,isDisconnected:s},children:[g(H,{}),e]})}function H(){return B(),null}function U(){let e=d(F);if(!e)throw Error(`useIdleTimeout must be used within IdleTimeoutProvider`);return e}const W=l({isActionAvailable:()=>!0,isDemoSite:!1,isLoading:!0});W.displayName=`RecceLineageGraphContext`;function G({children:e,lineageGraph:t,envInfo:n,reviewMode:r,cloudMode:i,fileMode:a,fileName:o,isDemoSite:s=!1,isCodespace:c,isLoading:l,error:d,supportTasks:f,onRefetchLineageGraph:m,runsAggregated:h,onRefetchRunsAggregated:_}){let v=u(e=>f?f[e]??!0:!0,[f]),y=p(()=>({lineageGraph:t,envInfo:n,reviewMode:r,cloudMode:i,fileMode:a,fileName:o,isDemoSite:s,isCodespace:c,isLoading:l,error:d,supportTasks:f,retchLineageGraph:m,isActionAvailable:v,runsAggregated:h,refetchRunsAggregated:_}),[t,n,r,i,a,o,s,c,l,d,f,m,v,h,_]);return g(W.Provider,{value:y,children:e})}function K(){return d(W)}function q(){let{runsAggregated:e,refetchRunsAggregated:t}=K();return[e,t]}const J=l(void 0),Y=()=>{let e=d(J);if(!e)throw Error(`useLineageViewContext must be used within a LineageViewProvider`);return e},X=()=>d(J);function Z(e){return e.type===`lineageGraphNode`}function Q(e){return e.type===`lineageGraphColumnNode`}const te=c.create();function ne(){let e=t()?.apiClient??te;return s({queryKey:n.flag(),queryFn:()=>i(e)})}const re=24;function ie(...e){let t=new Set;for(let n of e)for(let e of n)t.add(e);return t}function ae(...e){if(e.length===0)return new Set;let t=new Set(e[0]);for(let n of e)t=new Set([...t].filter(e=>n.has(e)));return t}function $(e,t,n=1e3){let r=new Set,i={},a=(e,n)=>{if(n<0||i[e]!=null&&i[e]>=n)return;i[e]=n;let o=t(e);for(let e of o)a(e,n-1);r.add(e)};for(let t of e)a(t,n);return r}function oe(e,t,n){let r={},i={},a=(e,t)=>({id:e,data:{id:e,name:e,from:t,data:{base:void 0,current:void 0},parents:{},children:{}},type:`lineageGraphNode`});for(let[t,n]of Object.entries(e.nodes))r[t]=a(t,`base`),n&&(r[t].data.data.base=n,r[t].data.name=n.name,r[t].data.resourceType=n.resource_type,r[t].data.packageName=n.package_name);for(let[e,n]of Object.entries(t.nodes))r[e]?r[e].data.from=`both`:r[e]=a(e,`current`),n&&(r[e].data.data.current=t.nodes[e],r[e].data.name=n.name,r[e].data.resourceType=n.resource_type,r[e].data.packageName=n.package_name);for(let[t,n]of Object.entries(e.parent_map))for(let e of n){let n=r[t],a=r[e],o=`${e}_${t}`;if(!n||!a)continue;i[o]={id:o,source:a.id,target:n.id,data:{from:`base`}};let s=i[o];n.data.parents[e]=s,a.data.children[t]=s}for(let[e,n]of Object.entries(t.parent_map))for(let t of n){let n=r[e],a=r[t],o=`${t}_${e}`;if(!n||!a)continue;i[o]?.data&&i[o].data?i[o].data.from=`both`:i[o]={id:o,source:a.id,target:n.id,data:{from:`current`}};let s=i[o];n.data.parents[t]=s,a.data.children[e]=s}let o=[];for(let[e,t]of Object.entries(r)){let r=n?.[e];if(r)t.data.changeStatus=r.change_status,r.change&&(t.data.change={category:r.change.category,columns:r.change.columns}),o.push(e);else if(t.data.from===`base`)t.data.changeStatus=`removed`,o.push(t.id);else if(t.data.from===`current`)t.data.changeStatus=`added`,o.push(t.id);else{let e=t.data.data.base?.checksum?.checksum,n=t.data.data.current?.checksum?.checksum;e&&n&&e!==n&&(t.data.changeStatus=`modified`,o.push(t.id))}}for(let e of Object.values(i))e.data&&(e.data.from===`base`?e.data.changeStatus=`removed`:e.data.from===`current`&&(e.data.changeStatus=`added`));return{nodes:r,edges:i,modifiedSet:o,manifestMetadata:{base:e.manifest_metadata??void 0,current:t.manifest_metadata??void 0},catalogMetadata:{base:e.catalog_metadata??void 0,current:t.catalog_metadata??void 0}}}function se(e,t,n=1e3){return $(t,t=>e.nodes[t]===void 0?[]:Object.keys(e.nodes[t].data.parents),n)}function ce(e,t,n=1e3){return $(t,t=>e.nodes[t]===void 0?[]:Object.keys(e.nodes[t].data.children),n)}function le(e,t){let n=[],r=[];function i(e){return e===`base`?0:e===`current`?2:1}function a(e,t){return i(e.data?.from)-i(t.data?.from)}let o=t===void 0?void 0:new Set(t),s=Object.values(e.nodes).sort(a);for(let e of s)o&&!o.has(e.id)||n.push({id:e.id,position:{x:0,y:0},width:300,height:60,className:`no-track-pii-safe`,data:{...e.data},type:`lineageGraphNode`,targetPosition:`left`,sourcePosition:`right`,style:{width:300,height:60}});let c=Object.values(e.edges).sort(a);for(let e of c)o&&(!o.has(e.source)||!o.has(e.target))||r.push({id:e.id,type:`lineageGraphEdge`,source:e.source,target:e.target,data:{...e.data}});return[n,r]}function ue(e,t,n,r=`LR`){let i=new e.graphlib.Graph;i.setDefaultEdgeLabel(()=>({})),i.setGraph({rankdir:r,ranksep:50,nodesep:30});for(let e of t){if(!Z(e))continue;let t=300,n=60;e.style?.height&&e.style.width&&(t=parseInt(String(e.style.width),10),n=parseInt(String(e.style.height),10)),i.setNode(e.id,{width:t,height:n})}for(let e of n)i.setEdge(e.source,e.target);e.layout(i);for(let e of t){if(!Z(e))continue;let t=e.style?.width??300,n=e.style?.height??60,r=i.node(e.id);e.position={x:r.x-Number(t)/2,y:r.y-Number(n)/2}}}export{x as A,N as C,k as D,O as E,w as M,E as O,I as S,j as T,K as _,ue as a,U as b,le as c,Q as d,Z as f,G as g,Y as h,ae as i,C as j,D as k,ie as l,X as m,oe as n,ce as o,J as p,$ as r,se as s,re as t,ne as u,q as v,P as w,B as x,V as y};
3
+ //# sourceMappingURL=utils-Bwpgu6nv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils-Bwpgu6nv.js","names":["defaultConfig: RouteConfig","contextValue: RouteConfigContextType","defaultRouteConfigContext: RouteConfigContextType","defaultFeatureToggles: RecceFeatureToggles","defaultInstanceInfo: InstanceInfoType","defaultApiClient","defaultApiClient","visited: Record<string, number | undefined>","nodes: Record<string, LineageGraphNode>","edges: Record<string, LineageGraphEdge>","modifiedSet: string[]","nodes: LineageGraphNode[]","edges: LineageGraphEdge[]"],"sources":["../src/providers/contexts/RouteConfigContext.tsx","../src/contexts/action/RecceActionContext.tsx","../src/contexts/instance/types.ts","../src/contexts/instance/useRecceInstanceInfo.ts","../src/contexts/instance/RecceInstanceContext.tsx","../src/contexts/idle/types.ts","../src/contexts/idle/useIdleDetection.ts","../src/contexts/idle/IdleTimeoutContext.tsx","../src/contexts/lineage/LineageGraphContext.tsx","../src/contexts/lineage/LineageViewContext.tsx","../src/contexts/lineage/types.ts","../src/contexts/lineage/useRecceServerFlag.ts","../src/contexts/lineage/utils.ts"],"sourcesContent":["\"use client\";\n\nimport {\n createContext,\n type ReactNode,\n useCallback,\n useContext,\n useMemo,\n} from \"react\";\n\n/**\n * Route Configuration for path prefix customization.\n *\n * This context allows cloud consumers to configure a base path prefix\n * for all navigation within OSS components.\n *\n * Default behavior (OSS):\n * - basePath: \"\" (uses absolute paths like /query, /checks)\n *\n * Cloud usage example:\n * - basePath: \"/oss/abc123\" or \"/preview/abc123\"\n * - Navigation to \"/query\" becomes \"/oss/abc123/query\"\n */\n\n/**\n * Route configuration interface\n */\nexport interface RouteConfig {\n /**\n * Base path prefix for navigation.\n * For OSS: \"\" (empty string, uses absolute paths like /query)\n * For Cloud: \"/oss/<sessionId>\" or \"/preview/<sessionId>\"\n */\n basePath: string;\n}\n\n/**\n * Context value with path resolution utility\n */\nexport interface RouteConfigContextType extends RouteConfig {\n /**\n * Resolves a path with the base path prefix.\n * @param path - The path to resolve (e.g., \"/query\")\n * @returns The resolved path (e.g., \"/oss/abc123/query\")\n */\n resolvePath: (path: string) => string;\n}\n\nconst defaultConfig: RouteConfig = {\n basePath: \"\",\n};\n\nconst RouteConfigContext = createContext<RouteConfigContextType | null>(null);\nRouteConfigContext.displayName = \"RouteConfigContext\";\n\n/**\n * Props for RouteConfigProvider\n */\nexport interface RouteConfigProviderProps extends Partial<RouteConfig> {\n children: ReactNode;\n}\n\n/**\n * Provider for route configuration.\n *\n * Wrap your application (or RecceContextProvider) with this provider\n * to configure path prefixes for navigation.\n *\n * @example\n * ```tsx\n * // In cloud application\n * <RouteConfigProvider basePath={`/oss/${sessionId}`}>\n * <RecceContextProvider>\n * {children}\n * </RecceContextProvider>\n * </RouteConfigProvider>\n * ```\n */\nexport function RouteConfigProvider({\n children,\n basePath = defaultConfig.basePath,\n}: RouteConfigProviderProps) {\n const resolvePath = useCallback(\n (path: string): string => {\n // If no basePath configured, return path as-is (OSS mode)\n if (!basePath) {\n return path;\n }\n\n // Handle paths that already start with the basePath (avoid double-prefixing)\n if (path.startsWith(basePath)) {\n return path;\n }\n\n // Handle absolute URLs (http://, https://, etc.) - don't prefix\n if (path.match(/^https?:\\/\\//)) {\n return path;\n }\n\n // Handle hash-only paths - don't prefix\n if (path.startsWith(\"#\")) {\n return path;\n }\n\n // Ensure proper joining (no double slashes)\n const cleanBasePath = basePath.endsWith(\"/\")\n ? basePath.slice(0, -1)\n : basePath;\n const cleanPath = path.startsWith(\"/\") ? path : `/${path}`;\n\n return `${cleanBasePath}${cleanPath}`;\n },\n [basePath],\n );\n\n const contextValue: RouteConfigContextType = useMemo(\n () => ({\n basePath,\n resolvePath,\n }),\n [basePath, resolvePath],\n );\n\n return (\n <RouteConfigContext.Provider value={contextValue}>\n {children}\n </RouteConfigContext.Provider>\n );\n}\n\n// Default context for OSS mode (no prefix)\nconst defaultRouteConfigContext: RouteConfigContextType = {\n basePath: \"\",\n resolvePath: (path: string) => path,\n};\n\n/**\n * Hook to access route configuration.\n *\n * When used outside RouteConfigProvider, returns default config\n * (for OSS backward compatibility).\n *\n * @returns RouteConfigContextType with basePath and resolvePath function\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const { basePath, resolvePath } = useRouteConfig();\n * const fullPath = resolvePath('/checks');\n * // In cloud with basePath=\"/oss/abc123\": \"/oss/abc123/checks\"\n * // In OSS with basePath=\"\": \"/checks\"\n * }\n * ```\n */\nexport function useRouteConfig(): RouteConfigContextType {\n const context = useContext(RouteConfigContext);\n // Return default config if outside provider (OSS mode)\n return context ?? defaultRouteConfigContext;\n}\n\n/**\n * Safe hook that returns null if context not available.\n * Useful for components that need to detect if RouteConfigProvider is present.\n */\nexport function useRouteConfigSafe(): RouteConfigContextType | null {\n return useContext(RouteConfigContext);\n}\n","\"use client\";\n\nimport {\n createContext,\n type ReactNode,\n useCallback,\n useContext,\n useMemo,\n useState,\n} from \"react\";\nimport type {\n AxiosQueryParams,\n RecceActionContextType,\n RecceActionOptions,\n} from \"./types\";\n\n/**\n * Props for RecceActionProvider\n *\n * This is a props-driven provider - pass your own run execution handler.\n * The provider manages UI state (result pane, history panel) internally.\n */\nexport interface RecceActionProviderProps {\n children: ReactNode;\n\n /**\n * Handler called when a run action is requested.\n * Implement this to submit runs to your backend.\n *\n * @param type - The run type (e.g., \"row_count_diff\", \"value_diff\")\n * @param params - Query parameters for the run\n * @param options - Action options (showForm, trackProps)\n * @returns Promise that resolves to the run ID, or void if handled differently\n */\n onRunAction?: (\n type: string,\n params?: AxiosQueryParams,\n options?: RecceActionOptions,\n ) => Promise<string | undefined> | string | undefined;\n\n /**\n * Handler called when a run result should be shown.\n * Called by showRunId when displaying a specific run.\n *\n * @param runId - The run ID to display\n * @param refreshHistory - Whether to refresh the history list\n */\n onShowRunId?: (runId: string, refreshHistory?: boolean) => void;\n\n /** Initial run ID to display (optional) */\n initialRunId?: string;\n\n /** Initial state for history panel (default: false) */\n initialHistoryOpen?: boolean;\n}\n\nconst defaultContext: RecceActionContextType = {\n runAction: () => void 0,\n showRunId: () => void 0,\n isRunResultOpen: false,\n closeRunResult: () => void 0,\n isHistoryOpen: false,\n closeHistory: () => void 0,\n showHistory: () => void 0,\n setHistoryOpen: () => void 0,\n clearRunResult: () => void 0,\n};\n\nconst RecceActionContext =\n createContext<RecceActionContextType>(defaultContext);\nRecceActionContext.displayName = \"RecceActionContext\";\n\n/**\n * Provider for run action context.\n *\n * This is a props-driven provider designed for library consumers.\n * Pass your own `onRunAction` handler to execute runs.\n *\n * @example\n * ```tsx\n * const handleRunAction = async (type, params, options) => {\n * const response = await api.submitRun(type, params);\n * return response.run_id;\n * };\n *\n * <RecceActionProvider onRunAction={handleRunAction}>\n * <LineageView />\n * </RecceActionProvider>\n * ```\n */\nexport function RecceActionProvider({\n children,\n onRunAction,\n onShowRunId,\n initialRunId,\n initialHistoryOpen = false,\n}: RecceActionProviderProps) {\n // Run result pane state\n const [isRunResultOpen, setRunResultOpen] = useState(!!initialRunId);\n const [runId, setRunId] = useState<string | undefined>(initialRunId);\n\n // History panel state\n const [isHistoryOpen, setHistoryOpen] = useState(initialHistoryOpen);\n\n // Close run result pane\n const closeRunResult = useCallback(() => {\n setRunResultOpen(false);\n }, []);\n\n // Clear run result and close pane\n const clearRunResult = useCallback(() => {\n setRunId(undefined);\n setRunResultOpen(false);\n }, []);\n\n // History panel controls\n const showHistory = useCallback(() => {\n setHistoryOpen(true);\n }, []);\n\n const closeHistory = useCallback(() => {\n setHistoryOpen(false);\n }, []);\n\n // Show a specific run result\n const showRunId = useCallback(\n (newRunId: string, refreshHistory?: boolean) => {\n setRunId(newRunId);\n setRunResultOpen(true);\n onShowRunId?.(newRunId, refreshHistory);\n },\n [onShowRunId],\n );\n\n // Execute a run action\n const runAction = useCallback(\n async (\n type: string,\n params?: AxiosQueryParams,\n options?: RecceActionOptions,\n ) => {\n if (!onRunAction) {\n console.warn(\n \"RecceActionProvider: onRunAction not provided, cannot execute run\",\n );\n return;\n }\n\n const result = await onRunAction(type, params, options);\n\n // If the handler returns a run ID, show the result\n if (typeof result === \"string\") {\n showRunId(result);\n }\n },\n [onRunAction, showRunId],\n );\n\n const contextValue = useMemo<RecceActionContextType>(\n () => ({\n runAction,\n runId,\n showRunId,\n isRunResultOpen,\n closeRunResult,\n isHistoryOpen,\n closeHistory,\n showHistory,\n setHistoryOpen,\n clearRunResult,\n }),\n [\n runAction,\n runId,\n showRunId,\n isRunResultOpen,\n closeRunResult,\n isHistoryOpen,\n closeHistory,\n showHistory,\n clearRunResult,\n ],\n );\n\n return (\n <RecceActionContext.Provider value={contextValue}>\n {children}\n </RecceActionContext.Provider>\n );\n}\n\n/**\n * Hook to access the RecceAction context.\n *\n * @returns RecceActionContextType with run action methods and state\n */\nexport function useRecceActionContext(): RecceActionContextType {\n return useContext(RecceActionContext);\n}\n","\"use client\";\n\n/**\n * Feature mode for the Recce instance.\n * - \"read only\": No modifications allowed\n * - \"metadata only\": Database queries disabled\n * - null: Full functionality enabled\n */\nexport type RecceFeatureMode = \"read only\" | \"metadata only\" | null;\n\n/**\n * Feature toggles that control what actions are available in the UI.\n * These are derived from the server's instance info based on server mode.\n */\nexport interface RecceFeatureToggles {\n /** Current feature mode based on server_mode */\n mode: RecceFeatureMode;\n /** Disable saving state to file */\n disableSaveToFile: boolean;\n /** Disable exporting state file */\n disableExportStateFile: boolean;\n /** Disable importing state file */\n disableImportStateFile: boolean;\n /** Disable updating checklist */\n disableUpdateChecklist: boolean;\n /** Disable database query execution */\n disableDatabaseQuery: boolean;\n /** Disable view action dropdown menu */\n disableViewActionDropdown: boolean;\n /** Disable node action dropdown menu */\n disableNodeActionDropdown: boolean;\n /** Disable share functionality */\n disableShare: boolean;\n}\n\n/**\n * Instance information exposed through the RecceInstanceContext.\n * Contains feature toggles and session information.\n */\nexport interface InstanceInfoType {\n /** Whether running in single environment mode */\n singleEnv: boolean;\n /** Whether user is authenticated */\n authed: boolean;\n /** Feature toggles based on server mode */\n featureToggles: RecceFeatureToggles;\n /** When the instance lifetime expires */\n lifetimeExpiredAt?: Date;\n /** URL for sharing the instance */\n shareUrl?: string;\n /** Current session ID */\n sessionId?: string;\n}\n\n/**\n * Default feature toggles with all features enabled.\n */\nexport const defaultFeatureToggles: RecceFeatureToggles = {\n mode: null,\n disableSaveToFile: false,\n disableExportStateFile: false,\n disableImportStateFile: false,\n disableUpdateChecklist: false,\n disableDatabaseQuery: false,\n disableViewActionDropdown: false,\n disableNodeActionDropdown: false,\n disableShare: false,\n};\n\n/**\n * Default instance info values.\n */\nexport const defaultInstanceInfo: InstanceInfoType = {\n singleEnv: false,\n authed: false,\n lifetimeExpiredAt: undefined,\n featureToggles: defaultFeatureToggles,\n shareUrl: undefined,\n sessionId: undefined,\n};\n","\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport axios from \"axios\";\n\nimport { cacheKeys } from \"../../api/cacheKeys\";\nimport {\n getRecceInstanceInfo,\n type RecceInstanceInfo,\n} from \"../../api/instanceInfo\";\nimport { useApiConfigOptional } from \"../../providers/contexts/ApiContext\";\n\n// Default axios client for use outside RecceProvider (OSS mode)\nconst defaultApiClient = axios.create();\n\n/**\n * Hook to fetch Recce instance information from the server.\n *\n * Uses TanStack Query to cache the response and the configured API client.\n * Works both inside RecceProvider (uses configured client) and outside (uses default axios).\n *\n * @returns Query result with RecceInstanceInfo data\n *\n * @example\n * ```tsx\n * function InstanceStatus() {\n * const { data, isLoading, error } = useRecceInstanceInfo();\n *\n * if (isLoading) return <div>Loading...</div>;\n * if (error) return <div>Error loading instance info</div>;\n *\n * return <div>Server mode: {data?.server_mode}</div>;\n * }\n * ```\n */\nexport function useRecceInstanceInfo() {\n const apiConfig = useApiConfigOptional();\n const apiClient = apiConfig?.apiClient ?? defaultApiClient;\n\n return useQuery<RecceInstanceInfo>({\n queryKey: cacheKeys.instanceInfo(),\n queryFn: () => getRecceInstanceInfo(apiClient),\n });\n}\n","\"use client\";\n\nimport { createContext, type ReactNode, useContext, useState } from \"react\";\n\nimport {\n defaultFeatureToggles,\n defaultInstanceInfo,\n type InstanceInfoType,\n type RecceFeatureToggles,\n} from \"./types\";\nimport { useRecceInstanceInfo } from \"./useRecceInstanceInfo\";\n\nconst InstanceInfoContext =\n createContext<InstanceInfoType>(defaultInstanceInfo);\nInstanceInfoContext.displayName = \"RecceInstanceInfoContext\";\n\n/**\n * Provider that fetches and processes Recce instance information.\n *\n * This provider:\n * 1. Fetches instance info from the server using useRecceInstanceInfo\n * 2. Computes feature toggles based on server_mode\n * 3. Provides the processed data through context\n *\n * Feature toggles are computed based on:\n * - server_mode: \"read-only\" disables all modifications\n * - server_mode: \"preview\" disables database queries but allows metadata operations\n * - single_env: disables checklist updates and sharing\n * - cloud_instance: disables sharing\n *\n * @example\n * ```tsx\n * function App() {\n * return (\n * <RecceProvider api={{ baseUrl: \"/api\" }}>\n * <RecceInstanceInfoProvider>\n * <MyComponent />\n * </RecceInstanceInfoProvider>\n * </RecceProvider>\n * );\n * }\n * ```\n */\nexport function RecceInstanceInfoProvider({\n children,\n}: {\n children: ReactNode;\n}) {\n const { data: instanceInfo, isLoading } = useRecceInstanceInfo();\n const [featureToggles, setFeatureToggles] = useState<RecceFeatureToggles>(\n defaultFeatureToggles,\n );\n const [singleEnv, setSingleEnv] = useState<boolean>(false);\n const [authed, setAuthed] = useState<boolean>(false);\n const [lifetimeExpiredAt, setLifetimeExpiredAt] = useState<Date>();\n const [shareUrl, setShareUrl] = useState<string>();\n const [sessionId, setSessionId] = useState<string>();\n const [prevInstanceInfo, setPrevInstanceInfo] = useState(instanceInfo);\n\n // Adjust state during render when instanceInfo changes\n if (!isLoading && instanceInfo && instanceInfo !== prevInstanceInfo) {\n setPrevInstanceInfo(instanceInfo);\n\n setSingleEnv(instanceInfo.single_env);\n setAuthed(instanceInfo.authed);\n setShareUrl(instanceInfo.share_url);\n setSessionId(instanceInfo.session_id);\n\n if (instanceInfo.lifetime_expired_at) {\n setLifetimeExpiredAt(new Date(instanceInfo.lifetime_expired_at));\n console.log(\"lifetime expired at\", instanceInfo.lifetime_expired_at);\n }\n\n // Set feature toggles based on instanceInfo\n const toggles = { ...defaultFeatureToggles };\n if (instanceInfo.server_mode === \"read-only\") {\n toggles.mode = \"read only\";\n toggles.disableSaveToFile = true;\n toggles.disableExportStateFile = true;\n toggles.disableImportStateFile = true;\n toggles.disableUpdateChecklist = true;\n toggles.disableDatabaseQuery = true;\n toggles.disableViewActionDropdown = true;\n toggles.disableNodeActionDropdown = true;\n toggles.disableShare = true;\n } else if (instanceInfo.server_mode === \"preview\") {\n toggles.mode = \"metadata only\";\n toggles.disableSaveToFile = true;\n toggles.disableExportStateFile = true;\n toggles.disableImportStateFile = true;\n toggles.disableUpdateChecklist = false;\n toggles.disableDatabaseQuery = true;\n toggles.disableViewActionDropdown = false;\n toggles.disableNodeActionDropdown = false;\n toggles.disableShare = true;\n }\n if (instanceInfo.single_env) {\n toggles.disableUpdateChecklist = true;\n toggles.disableShare = true;\n }\n if (instanceInfo.cloud_instance) {\n toggles.disableShare = true;\n }\n setFeatureToggles(toggles);\n }\n\n return (\n <InstanceInfoContext.Provider\n value={{\n featureToggles,\n singleEnv,\n authed,\n lifetimeExpiredAt,\n shareUrl,\n sessionId,\n }}\n >\n {children}\n </InstanceInfoContext.Provider>\n );\n}\n\n/**\n * Hook to access the Recce instance context.\n *\n * Returns the current instance information including feature toggles,\n * authentication status, and session information.\n *\n * @returns InstanceInfoType with feature toggles and session info\n *\n * @example\n * ```tsx\n * function FeatureGate() {\n * const { featureToggles } = useRecceInstanceContext();\n *\n * if (featureToggles.disableDatabaseQuery) {\n * return <div>Database queries are disabled</div>;\n * }\n *\n * return <QueryEditor />;\n * }\n * ```\n */\nexport function useRecceInstanceContext(): InstanceInfoType {\n return useContext(InstanceInfoContext);\n}\n","\"use client\";\n\nimport { createContext, useContext } from \"react\";\n\n/**\n * Context for sharing idle timeout state across components\n *\n * IMPORTANT: The countdown is based on the last SUCCESSFUL keep-alive API call,\n * NOT on user activity. This ensures the countdown accurately reflects the\n * server's idle timeout state.\n */\nexport interface IdleTimeoutContextType {\n /** Remaining seconds until timeout (null if idle timeout not enabled) */\n remainingSeconds: number | null;\n /** Idle timeout value from server in seconds (null if not configured) */\n idleTimeout: number | null;\n /** Whether idle timeout is enabled */\n isEnabled: boolean;\n /** Mark as disconnected - stops countdown and keep-alive */\n setDisconnected: () => void;\n /** Reset connection state - restarts countdown and keep-alive after successful reconnect */\n resetConnection: () => void;\n /** Whether the connection is disconnected */\n isDisconnected: boolean;\n}\n\nexport const IdleTimeoutContext = createContext<\n IdleTimeoutContextType | undefined\n>(undefined);\n\n/**\n * Hook to access idle timeout context, returns null if outside provider\n * Used internally by useIdleDetection to avoid circular dependency\n */\nexport function useIdleTimeoutSafe(): IdleTimeoutContextType | null {\n return useContext(IdleTimeoutContext) ?? null;\n}\n","\"use client\";\n\nimport axios from \"axios\";\nimport throttle from \"lodash/throttle\";\nimport { useCallback, useEffect, useMemo } from \"react\";\nimport { sendKeepAlive } from \"../../api/keepAlive\";\nimport { useApiConfigOptional } from \"../../providers/contexts/ApiContext\";\n\nimport { useRecceInstanceInfo } from \"../instance\";\nimport { useIdleTimeoutSafe } from \"./types\";\n\n// Default axios client for use outside RecceProvider (OSS mode)\nconst defaultApiClient = axios.create();\n\n/**\n * Check if debug logging is enabled via window.RECCE_DEBUG_IDLE\n * Enable in browser console: window.RECCE_DEBUG_IDLE = true\n * Disable: delete window.RECCE_DEBUG_IDLE\n */\nfunction isDebugEnabled(): boolean {\n // biome-ignore lint/suspicious/noExplicitAny: window flag for debug logging\n return typeof window !== \"undefined\" && !!(window as any).RECCE_DEBUG_IDLE;\n}\n\n/**\n * Log function that only outputs when debug is enabled\n */\nfunction debugLog(message: string, data?: Record<string, unknown>) {\n if (isDebugEnabled()) {\n if (data) {\n console.log(message, data);\n } else {\n console.log(message);\n }\n }\n}\n\n/**\n * Configuration for idle detection behavior\n */\nconst IDLE_DETECTION_CONFIG = {\n /** Events to listen for user activity */\n ACTIVITY_EVENTS: [\"focus\", \"mousemove\", \"keydown\", \"scroll\"] as const,\n /**\n * Throttle event handler execution to reduce JS overhead (150ms).\n * Uses lodash.throttle with { leading: true, trailing: true } to ensure\n * immediate response on first activity (leading) and also capture the final\n * event in a burst (trailing), which is important for user experience.\n */\n EVENT_THROTTLE_MS: 150,\n} as const;\n\n/**\n * Hook to detect user activity and send keep-alive signals to prevent server idle timeout.\n *\n * This hook:\n * - Listens for user activities (focus, mouse, keyboard, scroll)\n * - Sends keep-alive requests (throttled at axios layer to minimum 3 seconds)\n * - Pauses when the tab is inactive (using Page Visibility API)\n * - Immediately sends a keep-alive when tab becomes active\n * - Only activates when idle_timeout is configured on the server\n *\n * Note: The countdown in IdleTimeoutContext is based on successful keep-alive\n * API calls, not on user activity. This ensures accurate server state tracking.\n */\nexport function useIdleDetection() {\n const { data: instanceInfo, isLoading, isError } = useRecceInstanceInfo();\n const idleTimeoutContext = useIdleTimeoutSafe();\n const isDisconnected = idleTimeoutContext?.isDisconnected ?? false;\n const apiConfig = useApiConfigOptional();\n const apiClient = apiConfig?.apiClient ?? defaultApiClient;\n\n // Only enable idle detection if idle_timeout is configured and not disconnected\n const idleTimeout = instanceInfo?.idle_timeout;\n const isEnabled =\n idleTimeout !== undefined && idleTimeout > 0 && !isDisconnected;\n\n // Debug: Log instance info state when debug is enabled\n debugLog(\"[Idle Detection] Instance info\", {\n isLoading,\n isError,\n hasIdleTimeout: idleTimeout !== undefined,\n idleTimeout:\n idleTimeout !== undefined ? `${idleTimeout}s` : \"not configured\",\n isDisconnected,\n isEnabled,\n });\n\n /**\n * Send keep-alive signal to server\n * Throttling is handled at the axios layer (minimum 3 seconds between API calls)\n * The successful send will notify IdleTimeoutContext to reset countdown\n */\n const sendKeepAliveNow = useCallback(async () => {\n if (document.hidden) return;\n\n const sent = await sendKeepAlive(apiClient);\n\n if (sent) {\n debugLog(\"[Idle Detection] Keep-alive sent successfully\", {\n timestamp: new Date().toISOString(),\n });\n }\n }, [apiClient]);\n\n /**\n * Handle any user activity event\n * Attempts to send keep-alive (axios layer handles throttling)\n */\n const handleActivity = useCallback(\n (event: Event) => {\n if (isEnabled && !document.hidden) {\n debugLog(\"[Idle Detection] Activity detected\", {\n event: event.type,\n tabActive: !document.hidden,\n });\n\n // Send keep-alive API call (axios layer handles throttling)\n void sendKeepAliveNow();\n }\n },\n [isEnabled, sendKeepAliveNow],\n );\n\n /**\n * Handle tab visibility changes\n * When tab becomes active, attempt to send keep-alive\n */\n const handleVisibilityChange = useCallback(() => {\n if (!isEnabled) return;\n\n if (!document.hidden) {\n debugLog(\"[Idle Detection] Tab became active\", {\n timestamp: new Date().toISOString(),\n });\n\n // Send keep-alive (axios layer handles throttling)\n void sendKeepAliveNow();\n }\n }, [isEnabled, sendKeepAliveNow]);\n\n // Create throttled handler using lodash to reduce JS overhead from high-frequency events\n // useMemo ensures stable reference and proper cleanup\n const throttledHandler = useMemo(\n () =>\n throttle(handleActivity, IDLE_DETECTION_CONFIG.EVENT_THROTTLE_MS, {\n leading: true,\n trailing: true,\n }),\n [handleActivity],\n );\n\n useEffect(() => {\n if (!isEnabled) {\n debugLog(\"[Idle Detection] Disabled\", {\n idleTimeout: idleTimeout,\n reason:\n idleTimeout === undefined\n ? \"idle_timeout not configured on server\"\n : idleTimeout === 0\n ? \"idle_timeout is 0\"\n : \"disconnected\",\n });\n return;\n }\n\n debugLog(\"[Idle Detection] Initialized\", {\n enabled: true,\n idleTimeout: `${idleTimeout}s`,\n eventThrottle: `${IDLE_DETECTION_CONFIG.EVENT_THROTTLE_MS}ms`,\n apiThrottle: \"3s (axios layer)\",\n monitoredEvents: IDLE_DETECTION_CONFIG.ACTIVITY_EVENTS.join(\", \"),\n });\n\n // Register activity event listeners with throttled handler\n IDLE_DETECTION_CONFIG.ACTIVITY_EVENTS.forEach((eventType) => {\n window.addEventListener(eventType, throttledHandler, { passive: true });\n });\n\n // Register visibility change listener (not throttled - immediate response needed)\n document.addEventListener(\"visibilitychange\", handleVisibilityChange);\n\n // Cleanup function\n return () => {\n debugLog(\"[Idle Detection] Cleanup - removing event listeners\");\n IDLE_DETECTION_CONFIG.ACTIVITY_EVENTS.forEach((eventType) => {\n window.removeEventListener(eventType, throttledHandler);\n });\n document.removeEventListener(\"visibilitychange\", handleVisibilityChange);\n throttledHandler.cancel(); // Cancel any pending throttled calls\n };\n }, [isEnabled, throttledHandler, handleVisibilityChange, idleTimeout]);\n}\n","\"use client\";\n\nimport {\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport {\n getLastKeepAliveTime,\n setKeepAliveCallback,\n} from \"../../api/keepAlive\";\nimport { useRecceInstanceInfo } from \"../instance\";\nimport { IdleTimeoutContext, type IdleTimeoutContextType } from \"./types\";\nimport { useIdleDetection } from \"./useIdleDetection\";\n\n/**\n * Provider for idle timeout state\n *\n * The countdown is based on lastServerSyncTime (when keep-alive API was last\n * successfully sent), not on user activity. This provides accurate server state.\n */\nexport function IdleTimeoutProvider({ children }: { children: ReactNode }) {\n const { data: instanceInfo } = useRecceInstanceInfo();\n // Track the last time we successfully synced with server (keep-alive sent)\n const lastServerSyncRef = useRef<number>(Date.now());\n const [remainingSeconds, setRemainingSeconds] = useState<number | null>(null);\n const [isDisconnected, setIsDisconnected] = useState(false);\n\n const idleTimeout = instanceInfo?.idle_timeout ?? null;\n const isEnabled = idleTimeout !== null && idleTimeout > 0;\n\n // Register callback to receive keep-alive success notifications\n // Use ref to track enabled state to avoid race condition in callback\n const isEnabledRef = useRef(isEnabled);\n useEffect(() => {\n isEnabledRef.current = isEnabled;\n }, [isEnabled]);\n\n useEffect(() => {\n if (!isEnabled) {\n setKeepAliveCallback(null);\n return;\n }\n\n setKeepAliveCallback((timestamp: number) => {\n // Check current enabled state to avoid updating after disabled\n if (isEnabledRef.current) {\n lastServerSyncRef.current = timestamp;\n }\n });\n\n // Initialize with current keep-alive time if available\n const currentTime = getLastKeepAliveTime();\n if (currentTime > 0) {\n lastServerSyncRef.current = currentTime;\n }\n\n return () => {\n setKeepAliveCallback(null);\n };\n }, [isEnabled]);\n\n const setDisconnected = useCallback(() => {\n setIsDisconnected(true);\n }, []);\n\n const resetConnection = useCallback(() => {\n // Reset disconnected state\n setIsDisconnected(false);\n // Reset server sync time to now (server just restarted, timer reset)\n lastServerSyncRef.current = Date.now();\n }, []);\n\n // Update remaining seconds every second based on server sync time\n useEffect(() => {\n if (!isEnabled || idleTimeout === null) {\n setRemainingSeconds(null);\n return;\n }\n\n // Stop updating countdown if disconnected\n if (isDisconnected) {\n return;\n }\n\n const updateCountdown = () => {\n const now = Date.now();\n const elapsedSeconds = (now - lastServerSyncRef.current) / 1000;\n const remaining = Math.max(0, idleTimeout - elapsedSeconds);\n setRemainingSeconds(remaining);\n };\n\n // Initial update\n updateCountdown();\n\n // Set up interval for updates\n const intervalId = setInterval(updateCountdown, 1000);\n\n return () => {\n clearInterval(intervalId);\n };\n }, [isEnabled, idleTimeout, isDisconnected]);\n\n return (\n <IdleTimeoutContext.Provider\n value={{\n remainingSeconds,\n idleTimeout,\n isEnabled,\n setDisconnected,\n resetConnection,\n isDisconnected,\n }}\n >\n <IdleDetector />\n {children}\n </IdleTimeoutContext.Provider>\n );\n}\n\n/**\n * Internal component that activates idle detection\n * Placed inside provider so it has access to context\n */\nfunction IdleDetector() {\n useIdleDetection();\n return null;\n}\n\n/**\n * Hook to access idle timeout context\n * @throws Error if used outside IdleTimeoutProvider\n */\nexport function useIdleTimeout() {\n const context = useContext(IdleTimeoutContext);\n if (!context) {\n throw new Error(\"useIdleTimeout must be used within IdleTimeoutProvider\");\n }\n return context;\n}\n\n// Re-export type and safe hook for backwards compatibility\nexport type { IdleTimeoutContextType } from \"./types\";\nexport { useIdleTimeoutSafe } from \"./types\";\n","\"use client\";\n\nimport {\n createContext,\n type ReactNode,\n useCallback,\n useContext,\n useMemo,\n} from \"react\";\nimport type { RunsAggregated } from \"../../api/runs\";\nimport type { EnvInfo, LineageGraph, LineageGraphContextType } from \"./types\";\n\n/**\n * Props for LineageGraphProvider\n *\n * This is a props-driven provider - pass data from your data fetching layer.\n * The provider does NOT fetch data internally; consumers handle data fetching\n * and pass the results via props.\n */\nexport interface LineageGraphProviderProps {\n children: ReactNode;\n\n /** The processed lineage graph data */\n lineageGraph?: LineageGraph;\n\n /** Environment information (git, dbt, sqlmesh metadata) */\n envInfo?: EnvInfo;\n\n /** Whether in review mode (read-only checks) */\n reviewMode?: boolean;\n\n /** Whether in cloud mode (recce cloud) */\n cloudMode?: boolean;\n\n /** Whether in file mode (loading from file) */\n fileMode?: boolean;\n\n /** The state file name if in file mode */\n fileName?: string;\n\n /** Whether this is the demo site */\n isDemoSite?: boolean;\n\n /** Whether running in GitHub Codespace */\n isCodespace?: boolean;\n\n /** Loading state */\n isLoading?: boolean;\n\n /** Error message if loading failed */\n error?: string;\n\n /** Supported task types from server */\n supportTasks?: Record<string, boolean>;\n\n /** Callback to refetch the lineage graph */\n onRefetchLineageGraph?: () => void;\n\n /** Pre-aggregated run results by model */\n runsAggregated?: RunsAggregated;\n\n /** Callback to refetch aggregated runs */\n onRefetchRunsAggregated?: () => void;\n}\n\nconst defaultContext: LineageGraphContextType = {\n isActionAvailable: () => true,\n isDemoSite: false,\n isLoading: true, // Default to loading state for SSR hydration safety\n};\n\nconst LineageGraphContext =\n createContext<LineageGraphContextType>(defaultContext);\nLineageGraphContext.displayName = \"RecceLineageGraphContext\";\n\n/**\n * Provider for LineageGraph context.\n *\n * This is a props-driven provider designed for library consumers.\n * Pass data from your data fetching layer (e.g., TanStack Query).\n *\n * @example\n * ```tsx\n * const { data, isLoading, error, refetch } = useQuery({\n * queryKey: ['lineage'],\n * queryFn: fetchLineageData,\n * });\n *\n * <LineageGraphProvider\n * lineageGraph={data?.lineageGraph}\n * envInfo={data?.envInfo}\n * isLoading={isLoading}\n * error={error?.message}\n * onRefetchLineageGraph={refetch}\n * >\n * <LineageView />\n * </LineageGraphProvider>\n * ```\n */\nexport function LineageGraphProvider({\n children,\n lineageGraph,\n envInfo,\n reviewMode,\n cloudMode,\n fileMode,\n fileName,\n isDemoSite = false,\n isCodespace,\n isLoading,\n error,\n supportTasks,\n onRefetchLineageGraph,\n runsAggregated,\n onRefetchRunsAggregated,\n}: LineageGraphProviderProps) {\n // Create stable isActionAvailable function\n const isActionAvailable = useCallback(\n (name: string) => {\n if (supportTasks) {\n // Default to true if action not found in supportTasks\n return supportTasks[name] ?? true;\n }\n // If supportTasks not provided, all actions are available\n return true;\n },\n [supportTasks],\n );\n\n // Memoize the context value to prevent unnecessary re-renders\n const contextValue = useMemo<LineageGraphContextType>(\n () => ({\n lineageGraph,\n envInfo,\n reviewMode,\n cloudMode,\n fileMode,\n fileName,\n isDemoSite,\n isCodespace,\n isLoading,\n error,\n supportTasks,\n retchLineageGraph: onRefetchLineageGraph,\n isActionAvailable,\n runsAggregated,\n refetchRunsAggregated: onRefetchRunsAggregated,\n }),\n [\n lineageGraph,\n envInfo,\n reviewMode,\n cloudMode,\n fileMode,\n fileName,\n isDemoSite,\n isCodespace,\n isLoading,\n error,\n supportTasks,\n onRefetchLineageGraph,\n isActionAvailable,\n runsAggregated,\n onRefetchRunsAggregated,\n ],\n );\n\n return (\n <LineageGraphContext.Provider value={contextValue}>\n {children}\n </LineageGraphContext.Provider>\n );\n}\n\n/**\n * Hook to access the LineageGraph context.\n *\n * @returns LineageGraphContextType with lineage data and utilities\n * @throws Warning in dev mode if used outside provider (returns default context)\n */\nexport function useLineageGraphContext(): LineageGraphContextType {\n const context = useContext(LineageGraphContext);\n return context;\n}\n\n/**\n * Hook to access aggregated runs data.\n * Convenience wrapper around useLineageGraphContext.\n *\n * @returns Tuple of [runsAggregated, refetchRunsAggregated]\n */\nexport function useRunsAggregated(): [\n RunsAggregated | undefined,\n (() => void) | undefined,\n] {\n const { runsAggregated, refetchRunsAggregated } = useLineageGraphContext();\n return [runsAggregated, refetchRunsAggregated];\n}\n","import { createContext, useContext } from \"react\";\nimport type { LineageViewContextType } from \"./types\";\n\nexport const LineageViewContext = createContext<\n LineageViewContextType | undefined\n>(undefined);\n\nexport const useLineageViewContextSafe = (): LineageViewContextType => {\n const context = useContext(LineageViewContext);\n if (!context) {\n throw new Error(\n \"useLineageViewContext must be used within a LineageViewProvider\",\n );\n }\n return context;\n};\n\nexport const useLineageViewContext = (): LineageViewContextType | undefined => {\n return useContext(LineageViewContext);\n};\n","import type { Edge, Node } from \"@xyflow/react\";\nimport type React from \"react\";\nimport type { CllInput, ColumnLineageData } from \"../../api/cll\";\nimport type {\n CatalogMetadata,\n GitInfo,\n ManifestMetadata,\n NodeData,\n PullRequestInfo,\n SQLMeshInfo,\n StateMetadata,\n} from \"../../api/info\";\nimport type { LineageDiffViewOptions } from \"../../api/lineagecheck\";\nimport type { RunsAggregated } from \"../../api/runs\";\nimport type { Run } from \"../../api/types\";\n\n/**\n * Environment information derived from server info\n */\nexport interface EnvInfo {\n stateMetadata?: StateMetadata;\n adapterType?: string;\n git?: GitInfo;\n pullRequest?: PullRequestInfo;\n dbt?: {\n base: ManifestMetadata | undefined | null;\n current: ManifestMetadata | undefined | null;\n };\n sqlmesh?: SQLMeshInfo | null;\n}\n\n/**\n * Which environment the node/edge comes from\n */\ntype LineageFrom = \"both\" | \"base\" | \"current\";\n\n/**\n * Lineage graph node type for React Flow\n */\nexport type LineageGraphNode = Node<\n {\n id: string;\n name: string;\n from: LineageFrom;\n data: {\n base?: NodeData;\n current?: NodeData;\n };\n changeStatus?: \"added\" | \"removed\" | \"modified\";\n change?: {\n category: \"breaking\" | \"non_breaking\" | \"partial_breaking\" | \"unknown\";\n columns: Record<string, \"added\" | \"removed\" | \"modified\"> | null;\n };\n resourceType?: string;\n packageName?: string;\n parents: Record<string, LineageGraphEdge>;\n children: Record<string, LineageGraphEdge>;\n },\n \"lineageGraphNode\"\n>;\n\n/**\n * Column-level lineage node type\n */\nexport type LineageGraphColumnNode = Node<\n {\n node: LineageGraphNode[\"data\"];\n column: string;\n type: string;\n transformationType?: string;\n changeStatus?: \"added\" | \"removed\" | \"modified\";\n },\n \"lineageGraphColumnNode\"\n>;\n\n/**\n * Lineage graph edge type for React Flow\n */\nexport type LineageGraphEdge = Edge<\n {\n from: LineageFrom;\n changeStatus?: \"added\" | \"removed\";\n },\n \"lineageGraphEdge\"\n>;\n\n/**\n * Union type for all lineage graph node types\n */\nexport type LineageGraphNodes = LineageGraphNode | LineageGraphColumnNode;\n\n/**\n * The main lineage graph data structure\n */\nexport interface LineageGraph {\n nodes: Record<string, LineageGraphNode>;\n edges: Record<string, LineageGraphEdge>;\n modifiedSet: string[];\n manifestMetadata: {\n base?: ManifestMetadata;\n current?: ManifestMetadata;\n };\n catalogMetadata: {\n base?: CatalogMetadata;\n current?: CatalogMetadata;\n };\n}\n\n/**\n * Type guard for LineageGraphNode\n */\nexport function isLineageGraphNode(\n node: LineageGraphNodes,\n): node is LineageGraphNode {\n return node.type === \"lineageGraphNode\";\n}\n\n/**\n * Type guard for LineageGraphColumnNode\n */\nexport function isLineageGraphColumnNode(\n node: LineageGraphNodes,\n): node is LineageGraphColumnNode {\n return node.type === \"lineageGraphColumnNode\";\n}\n\n/**\n * Context value exposed by LineageGraphContext\n */\nexport interface LineageGraphContextType {\n /** The processed lineage graph */\n lineageGraph?: LineageGraph;\n /** Environment metadata */\n envInfo?: EnvInfo;\n /** Whether in review mode (read-only checks) */\n reviewMode?: boolean;\n /** Whether in cloud mode (recce cloud) */\n cloudMode?: boolean;\n /** Whether in file mode (loading from file) */\n fileMode?: boolean;\n /** The state file name if in file mode */\n fileName?: string;\n /** Whether this is the demo site */\n isDemoSite: boolean;\n /** Whether running in GitHub Codespace */\n isCodespace?: boolean;\n /** Loading state */\n isLoading?: boolean;\n /** Error message if loading failed */\n error?: string;\n /** Supported task types from server */\n supportTasks?: Record<string, boolean>;\n /** Refetch the lineage graph data */\n retchLineageGraph?: () => void;\n /** Check if an action is available */\n isActionAvailable: (actionName: string) => boolean;\n /** Pre-aggregated run results by model */\n runsAggregated?: RunsAggregated;\n /** Refetch the aggregated runs */\n refetchRunsAggregated?: () => void;\n}\n\n// ============================================================================\n// LineageViewContext Types\n// ============================================================================\n\n/**\n * Action mode for node operations - single or multiple nodes\n */\nexport type ActionMode = \"per_node\" | \"multi_nodes\";\n\n/**\n * Select mode for multi-node selection\n */\nexport type SelectMode = \"selecting\" | \"action_result\" | undefined;\n\n/**\n * Action state for individual node operations\n */\nexport interface NodeAction {\n /** Whether this is a per-node or multi-node action */\n mode: ActionMode;\n /** Current status of this node's action */\n status?: \"pending\" | \"running\" | \"success\" | \"failure\" | \"skipped\";\n /** Reason why this node was skipped (if applicable) */\n skipReason?: string;\n /** The run associated with this action */\n run?: Run;\n}\n\n/**\n * Overall action state for batch operations\n */\nexport interface ActionState {\n /** Whether this is a per-node or multi-node action */\n mode: ActionMode;\n /** Overall status of the action batch */\n status: \"pending\" | \"running\" | \"canceling\" | \"canceled\" | \"completed\";\n /** Current run being executed */\n currentRun?: Partial<Run>;\n /** Number of completed actions */\n completed: number;\n /** Total number of actions */\n total: number;\n /** Per-node action state */\n actions: Record<string, NodeAction>;\n}\n\n/**\n * Context value exposed by LineageViewContext.\n * Provides state and methods for interacting with the lineage view.\n */\nexport interface LineageViewContextType {\n /** Whether the view is interactive (vs read-only) */\n interactive: boolean;\n /** All nodes in the current view */\n nodes: LineageGraphNodes[];\n /** Currently focused node (hovered/highlighted) */\n focusedNode?: LineageGraphNode;\n /** Currently selected nodes for batch operations */\n selectedNodes: LineageGraphNode[];\n /** Column-level lineage data if showing CLL */\n cll: ColumnLineageData | undefined;\n\n // Context menu\n /** Show the context menu for a node */\n showContextMenu: (event: React.MouseEvent, node: LineageGraphNodes) => void;\n\n // View options\n /** Current view options (filters, display settings) */\n viewOptions: LineageDiffViewOptions;\n /** Update view options */\n onViewOptionsChanged: (options: LineageDiffViewOptions) => void;\n\n // Multi-node selection\n /** Current selection mode */\n selectMode: SelectMode;\n /** Select/deselect a single node */\n selectNode: (nodeId: string) => void;\n /** Select all parent nodes up to a degree */\n selectParentNodes: (nodeId: string, degree?: number) => void;\n /** Select all child nodes up to a degree */\n selectChildNodes: (nodeId: string, degree?: number) => void;\n /** Clear selection */\n deselect: () => void;\n\n // Node state queries\n /** Check if a node is highlighted */\n isNodeHighlighted: (nodeId: string) => boolean;\n /** Check if a node is selected */\n isNodeSelected: (nodeId: string) => boolean;\n /** Check if an edge is highlighted */\n isEdgeHighlighted: (source: string, target: string) => boolean;\n /** Get the action state for a node */\n getNodeAction: (nodeId: string) => NodeAction;\n /** Get the columns visible for a node in CLL mode */\n getNodeColumnSet: (nodeId: string) => Set<string>;\n /** Check if a node is showing change analysis */\n isNodeShowingChangeAnalysis: (nodeId: string) => boolean;\n\n // Actions\n /** Run row count on selected nodes */\n runRowCount: () => Promise<void>;\n /** Run row count diff on selected nodes */\n runRowCountDiff: () => Promise<void>;\n /** Run value diff on selected nodes */\n runValueDiff: () => Promise<void>;\n /** Add a lineage diff check */\n addLineageDiffCheck: (viewMode?: string) => void;\n /** Add a schema diff check */\n addSchemaDiffCheck: () => void;\n /** Cancel the current action */\n cancel: () => void;\n /** Current action state */\n actionState: ActionState;\n\n // Column-level lineage\n /** Center the view on a specific node */\n centerNode: (nodeId: string) => void;\n /** Show column-level lineage for a node/column */\n showColumnLevelLineage: (cll?: CllInput) => Promise<void>;\n /** Reset column-level lineage view */\n resetColumnLevelLineage: (previous?: boolean) => Promise<void>;\n}\n","\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport axios from \"axios\";\nimport { cacheKeys } from \"../../api/cacheKeys\";\nimport { getServerFlag, type RecceServerFlags } from \"../../api/flag\";\nimport { useApiConfigOptional } from \"../../providers/contexts/ApiContext\";\n\n// Default axios client for use outside RecceProvider (OSS mode)\nconst defaultApiClient = axios.create();\n\n/**\n * Hook to fetch server-side feature flags.\n *\n * Uses TanStack Query to cache and manage flag state.\n * Works both inside RecceProvider (uses configured client) and outside (uses default axios).\n *\n * @returns TanStack Query result with RecceServerFlags data\n */\nexport function useRecceServerFlag() {\n const apiConfig = useApiConfigOptional();\n const apiClient = apiConfig?.apiClient ?? defaultApiClient;\n\n return useQuery<RecceServerFlags>({\n queryKey: cacheKeys.flag(),\n queryFn: () => getServerFlag(apiClient),\n });\n}\n","import type { Position } from \"@xyflow/react\";\nimport type { LineageDataFromMetadata, LineageDiffData } from \"../../api/info\";\nimport type {\n LineageGraph,\n LineageGraphColumnNode,\n LineageGraphEdge,\n LineageGraphNode,\n LineageGraphNodes,\n} from \"./types\";\nimport { isLineageGraphNode } from \"./types\";\n\n/**\n * Height of a column node in pixels\n * Must match COLUMN_NODE_HEIGHT in columns/LineageColumnNode.tsx\n */\nexport const COLUMN_HEIGHT = 24;\n\n/**\n * Map of node IDs to their column sets\n */\nexport type NodeColumnSetMap = Record<string, Set<string>>;\n\n// =============================================================================\n// Set Utilities\n// =============================================================================\n\n/**\n * Get the union of multiple sets\n */\nexport function union<T>(...sets: Set<T>[]): Set<T> {\n const unionSet = new Set<T>();\n for (const set of sets) {\n for (const key of set) {\n unionSet.add(key);\n }\n }\n return unionSet;\n}\n\n/**\n * Get the intersection of multiple sets\n */\nexport function intersect<T>(...sets: Set<T>[]): Set<T> {\n if (sets.length === 0) {\n return new Set<T>();\n }\n\n let intersection = new Set<T>(sets[0]);\n\n for (const set of sets) {\n intersection = new Set([...intersection].filter((x) => set.has(x)));\n }\n\n return intersection;\n}\n\n/**\n * Get a set of neighbor nodes up to a certain degree\n */\nexport function getNeighborSet(\n nodeIds: string[],\n getNeighbors: (id: string) => string[],\n degree = 1000,\n): Set<string> {\n const neighborSet = new Set<string>();\n const visited: Record<string, number | undefined> = {};\n\n const dfs = (id: string, currentDegree: number) => {\n if (currentDegree < 0) {\n return;\n }\n if (visited[id] != null && visited[id] >= currentDegree) {\n return;\n }\n visited[id] = currentDegree;\n\n const neighbors = getNeighbors(id);\n\n for (const neighborId of neighbors) {\n dfs(neighborId, currentDegree - 1);\n }\n\n neighborSet.add(id);\n };\n\n for (const nodeId of nodeIds) {\n dfs(nodeId, degree);\n }\n\n return neighborSet;\n}\n\n// =============================================================================\n// Lineage Graph Building\n// =============================================================================\n\n/**\n * Build a LineageGraph from base and current lineage data\n *\n * @param base - Base lineage data (before changes)\n * @param current - Current lineage data (after changes)\n * @param diff - Optional diff data for change status\n * @returns Processed LineageGraph structure\n *\n * @example\n * ```tsx\n * const lineageGraph = buildLineageGraph(\n * serverInfo.lineage.base,\n * serverInfo.lineage.current,\n * serverInfo.lineage.diff\n * );\n * ```\n */\nexport function buildLineageGraph(\n base: LineageDataFromMetadata,\n current: LineageDataFromMetadata,\n diff?: LineageDiffData,\n): LineageGraph {\n const nodes: Record<string, LineageGraphNode> = {};\n const edges: Record<string, LineageGraphEdge> = {};\n\n const buildNode = (\n key: string,\n from: \"base\" | \"current\",\n ): LineageGraphNode => {\n return {\n id: key,\n data: {\n id: key,\n name: key,\n from,\n data: {\n base: undefined,\n current: undefined,\n },\n parents: {},\n children: {},\n },\n type: \"lineageGraphNode\",\n } as LineageGraphNode;\n };\n\n // Process base nodes\n for (const [key, nodeData] of Object.entries(base.nodes)) {\n nodes[key] = buildNode(key, \"base\");\n if (nodeData) {\n nodes[key].data.data.base = nodeData;\n nodes[key].data.name = nodeData.name;\n nodes[key].data.resourceType = nodeData.resource_type;\n nodes[key].data.packageName = nodeData.package_name;\n }\n }\n\n // Process current nodes\n for (const [key, nodeData] of Object.entries(current.nodes)) {\n if (nodes[key] as LineageGraphNode | undefined) {\n nodes[key].data.from = \"both\";\n } else {\n nodes[key] = buildNode(key, \"current\");\n }\n if (nodeData) {\n nodes[key].data.data.current = current.nodes[key];\n nodes[key].data.name = nodeData.name;\n nodes[key].data.resourceType = nodeData.resource_type;\n nodes[key].data.packageName = nodeData.package_name;\n }\n }\n\n // Process base edges\n for (const [child, parents] of Object.entries(base.parent_map)) {\n for (const parent of parents) {\n const childNode = nodes[child] as LineageGraphNode | undefined;\n const parentNode = nodes[parent] as LineageGraphNode | undefined;\n const id = `${parent}_${child}`;\n\n if (!childNode || !parentNode) {\n continue;\n }\n edges[id] = {\n id,\n source: parentNode.id,\n target: childNode.id,\n data: {\n from: \"base\",\n },\n };\n const edge = edges[id];\n\n childNode.data.parents[parent] = edge;\n parentNode.data.children[child] = edge;\n }\n }\n\n // Process current edges\n for (const [child, parents] of Object.entries(current.parent_map)) {\n for (const parent of parents) {\n const childNode = nodes[child] as LineageGraphNode | undefined;\n const parentNode = nodes[parent] as LineageGraphNode | undefined;\n const id = `${parent}_${child}`;\n\n if (!childNode || !parentNode) {\n continue;\n }\n const existingEdge = edges[id] as LineageGraphEdge | undefined;\n if (existingEdge?.data && edges[id].data) {\n edges[id].data.from = \"both\";\n } else {\n edges[id] = {\n id,\n source: parentNode.id,\n target: childNode.id,\n data: {\n from: \"current\",\n },\n };\n }\n const edge = edges[id];\n\n childNode.data.parents[parent] = edge;\n parentNode.data.children[child] = edge;\n }\n }\n\n // Process diff and calculate modified set\n const modifiedSet: string[] = [];\n\n for (const [key, node] of Object.entries(nodes)) {\n const diffNode = diff?.[key];\n if (diffNode) {\n node.data.changeStatus = diffNode.change_status;\n if (diffNode.change) {\n node.data.change = {\n category: diffNode.change.category,\n columns: diffNode.change.columns,\n };\n }\n modifiedSet.push(key);\n } else if (node.data.from === \"base\") {\n node.data.changeStatus = \"removed\";\n modifiedSet.push(node.id);\n } else if (node.data.from === \"current\") {\n node.data.changeStatus = \"added\";\n modifiedSet.push(node.id);\n } else {\n const checksum1 = node.data.data.base?.checksum?.checksum;\n const checksum2 = node.data.data.current?.checksum?.checksum;\n\n if (checksum1 && checksum2 && checksum1 !== checksum2) {\n node.data.changeStatus = \"modified\";\n modifiedSet.push(node.id);\n }\n }\n }\n\n // Set edge change status\n for (const edge of Object.values(edges)) {\n if (edge.data) {\n if (edge.data.from === \"base\") {\n edge.data.changeStatus = \"removed\";\n } else if (edge.data.from === \"current\") {\n edge.data.changeStatus = \"added\";\n }\n }\n }\n\n return {\n nodes,\n edges,\n modifiedSet,\n manifestMetadata: {\n base: base.manifest_metadata ?? undefined,\n current: current.manifest_metadata ?? undefined,\n },\n catalogMetadata: {\n base: base.catalog_metadata ?? undefined,\n current: current.catalog_metadata ?? undefined,\n },\n };\n}\n\n// =============================================================================\n// Selection Utilities\n// =============================================================================\n\n/**\n * Select upstream nodes from the given node IDs\n *\n * @param lineageGraph - The lineage graph\n * @param nodeIds - Starting node IDs\n * @param degree - Maximum degree of separation (default: 1000)\n * @returns Set of upstream node IDs\n */\nexport function selectUpstream(\n lineageGraph: LineageGraph,\n nodeIds: string[],\n degree = 1000,\n): Set<string> {\n return getNeighborSet(\n nodeIds,\n (key) => {\n const maybeNodes = lineageGraph.nodes as unknown as Record<\n string,\n LineageGraphNode | undefined\n >;\n if (maybeNodes[key] === undefined) {\n return [];\n }\n return Object.keys(lineageGraph.nodes[key].data.parents);\n },\n degree,\n );\n}\n\n/**\n * Select downstream nodes from the given node IDs\n *\n * @param lineageGraph - The lineage graph\n * @param nodeIds - Starting node IDs\n * @param degree - Maximum degree of separation (default: 1000)\n * @returns Set of downstream node IDs\n */\nexport function selectDownstream(\n lineageGraph: LineageGraph,\n nodeIds: string[],\n degree = 1000,\n): Set<string> {\n return getNeighborSet(\n nodeIds,\n (key) => {\n if (\n (lineageGraph.nodes[key] as LineageGraphNode | undefined) === undefined\n ) {\n return [];\n }\n return Object.keys(lineageGraph.nodes[key].data.children);\n },\n degree,\n );\n}\n\n// =============================================================================\n// React Flow Conversion\n// =============================================================================\n\n/**\n * Convert a LineageGraph to React Flow nodes and edges\n *\n * This is a simplified version that converts the graph structure.\n * For full column-level lineage support, use the OSS implementation.\n *\n * @param lineageGraph - The lineage graph to convert\n * @param selectedNodes - Optional filter for which nodes to include\n * @returns Tuple of [nodes, edges]\n */\nexport function toReactFlowBasic(\n lineageGraph: LineageGraph,\n selectedNodes?: string[],\n): [LineageGraphNode[], LineageGraphEdge[]] {\n const nodes: LineageGraphNode[] = [];\n const edges: LineageGraphEdge[] = [];\n\n function getWeight(from?: string) {\n if (from === \"base\") {\n return 0;\n } else if (from === \"current\") {\n return 2;\n }\n return 1;\n }\n\n function compareFn(\n a: LineageGraphNode | LineageGraphEdge,\n b: LineageGraphNode | LineageGraphEdge,\n ) {\n const weightA = getWeight(a.data?.from);\n const weightB = getWeight(b.data?.from);\n return weightA - weightB;\n }\n\n const filterSet =\n selectedNodes !== undefined ? new Set(selectedNodes) : undefined;\n const sortedNodes = Object.values(lineageGraph.nodes).sort(compareFn);\n\n for (const node of sortedNodes) {\n if (filterSet && !filterSet.has(node.id)) {\n continue;\n }\n\n nodes.push({\n id: node.id,\n position: { x: 0, y: 0 },\n width: 300,\n height: 60,\n className: \"no-track-pii-safe\",\n data: {\n ...node.data,\n },\n type: \"lineageGraphNode\",\n targetPosition: \"left\" as Position,\n sourcePosition: \"right\" as Position,\n style: {\n width: 300,\n height: 60,\n },\n } as LineageGraphNode);\n }\n\n const sortedEdges = Object.values(lineageGraph.edges).sort(compareFn);\n for (const edge of sortedEdges) {\n if (\n filterSet &&\n (!filterSet.has(edge.source) || !filterSet.has(edge.target))\n ) {\n continue;\n }\n\n edges.push({\n id: edge.id,\n type: \"lineageGraphEdge\",\n source: edge.source,\n target: edge.target,\n data: {\n ...edge.data,\n },\n } as LineageGraphEdge);\n }\n\n return [nodes, edges];\n}\n\n/**\n * Apply dagre layout to nodes and edges\n *\n * NOTE: This function requires @dagrejs/dagre to be installed.\n * Import and call it as follows:\n *\n * @example\n * ```tsx\n * import dagre from '@dagrejs/dagre';\n * import { layoutWithDagre } from '@datarecce/ui';\n *\n * const [nodes, edges] = toReactFlowBasic(lineageGraph);\n * layoutWithDagre(dagre, nodes, edges);\n * ```\n *\n * @param dagre - The dagre library instance\n * @param nodes - Nodes to layout\n * @param edges - Edges for layout\n * @param direction - Layout direction (default: \"LR\" for left-to-right)\n */\nexport function layoutWithDagre(\n // biome-ignore lint/suspicious/noExplicitAny: dagre library is external, consumers provide their own instance\n dagre: any,\n nodes: LineageGraphNodes[],\n edges: LineageGraphEdge[],\n direction = \"LR\",\n): void {\n const dagreGraph = new dagre.graphlib.Graph();\n dagreGraph.setDefaultEdgeLabel(() => ({}));\n dagreGraph.setGraph({ rankdir: direction, ranksep: 50, nodesep: 30 });\n\n for (const node of nodes) {\n if (!isLineageGraphNode(node)) {\n continue;\n }\n let width = 300;\n let height = 60;\n if (node.style?.height && node.style.width) {\n width = parseInt(String(node.style.width), 10);\n height = parseInt(String(node.style.height), 10);\n }\n dagreGraph.setNode(node.id, { width, height });\n }\n\n for (const edge of edges) {\n dagreGraph.setEdge(edge.source, edge.target);\n }\n\n dagre.layout(dagreGraph);\n\n for (const node of nodes) {\n if (!isLineageGraphNode(node)) {\n continue;\n }\n\n const nodeWidth = node.style?.width ?? 300;\n const nodeHeight = node.style?.height ?? 60;\n const nodeWithPosition = dagreGraph.node(node.id);\n\n // Shift from center anchor to top-left anchor\n node.position = {\n x: nodeWithPosition.x - Number(nodeWidth) / 2,\n y: nodeWithPosition.y - Number(nodeHeight) / 2,\n };\n }\n}\n"],"mappings":";0WAgDA,MAAMA,EAA6B,CACjC,SAAU,GACX,CAEK,EAAqB,EAA6C,KAAK,CAC7E,EAAmB,YAAc,qBAyBjC,SAAgB,EAAoB,CAClC,WACA,WAAW,EAAc,UACE,CAC3B,IAAM,EAAc,EACjB,GAEK,CAAC,GAKD,EAAK,WAAW,EAAS,EAKzB,EAAK,MAAM,eAAe,EAK1B,EAAK,WAAW,IAAI,CACf,EASF,GALe,EAAS,SAAS,IAAI,CACxC,EAAS,MAAM,EAAG,GAAG,CACrB,IACc,EAAK,WAAW,IAAI,CAAG,EAAO,IAAI,MAItD,CAAC,EAAS,CACX,CAEKC,EAAuC,OACpC,CACL,WACA,cACD,EACD,CAAC,EAAU,EAAY,CACxB,CAED,OACE,EAAC,EAAmB,SAAA,CAAS,MAAO,EACjC,YAC2B,CAKlC,MAAMC,EAAoD,CACxD,SAAU,GACV,YAAc,GAAiB,EAChC,CAoBD,SAAgB,GAAyC,CAGvD,OAFgB,EAAW,EAAmB,EAE5B,EAOpB,SAAgB,GAAoD,CAClE,OAAO,EAAW,EAAmB,CCjGvC,MAAM,EACJ,EAb6C,CAC7C,cAAiB,IAAK,GACtB,cAAiB,IAAK,GACtB,gBAAiB,GACjB,mBAAsB,IAAK,GAC3B,cAAe,GACf,iBAAoB,IAAK,GACzB,gBAAmB,IAAK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AAS,GACT,EAAK,OAAO,QAAU,EAAK,MAAM,QACnC,EAAQ,SAAS,OAAO,EAAK,MAAM,MAAM,CAAE,GAAG,CAC9C,EAAS,SAAS,OAAO,EAAK,MAAM,OAAO,CAAE,GAAG,EAElD,EAAW,QAAQ,EAAK,GAAI,CAAE,QAAO,SAAQ,CAAC,CAGhD,IAAK,IAAM,KAAQ,EACjB,EAAW,QAAQ,EAAK,OAAQ,EAAK,OAAO,CAG9C,EAAM,OAAO,EAAW,CAExB,IAAK,IAAM,KAAQ,EAAO,CACxB,GAAI,CAAC,EAAmB,EAAK,CAC3B,SAGF,IAAM,EAAY,EAAK,OAAO,OAAS,IACjC,EAAa,EAAK,OAAO,QAAU,GACnC,EAAmB,EAAW,KAAK,EAAK,GAAG,CAGjD,EAAK,SAAW,CACd,EAAG,EAAiB,EAAI,OAAO,EAAU,CAAG,EAC5C,EAAG,EAAiB,EAAI,OAAO,EAAW,CAAG,EAC9C"}
@@ -0,0 +1,5 @@
1
+ "use client";
2
+ import{n as e}from"./colors-C4PP3M6b.js";import{createContext as t,useCallback as n,useContext as r,useEffect as i,useState as a}from"react";import{Fragment as o,jsx as s,jsxs as c}from"react/jsx-runtime";import l from"@mui/material/Box";import u from"@mui/material/Stack";import d from"@mui/material/Typography";import f from"@mui/material/IconButton";import p from"@mui/material/CircularProgress";import m from"@mui/material/Tooltip";import{PiCopy as h,PiDotsThreeVertical as g}from"react-icons/pi";import _ from"file-saver";import{useCopyToClipboard as v}from"usehooks-ts";import y from"@mui/material/Alert";import b from"@mui/material/Snackbar";import ee from"@mui/material/Menu";import te from"@mui/material/MenuItem";import x from"lodash";import{VscClose as ne,VscKebabVertical as re,VscKey as ie,VscPin as ae,VscPinned as oe}from"react-icons/vsc";import{format as S,formatDistance as se,parseISO as ce}from"date-fns";const C=t(null);C.displayName=`RecceThemeContext`;function le(){let e=r(C);if(!e)throw Error(`useRecceTheme must be used within RecceProvider`);return e}function ue(){return r(C)}function de({children:e,defaultMode:t=`system`}){let[n,r]=a(t),[o,c]=a(()=>typeof window>`u`?`light`:t===`system`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:t);return i(()=>{if(n===`system`){let e=window.matchMedia(`(prefers-color-scheme: dark)`);c(e.matches?`dark`:`light`);let t=e=>{c(e.matches?`dark`:`light`)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}else c(n)},[n]),i(()=>{typeof window>`u`||document.documentElement.classList.toggle(`dark`,o===`dark`)},[o]),s(C.Provider,{value:{mode:n,resolvedMode:o,setMode:r},children:e})}function fe(){let e=ue(),[t,n]=a(!1),[r,o]=a(!1);return i(()=>{if(n(!0),!e){let e=()=>{o(document.documentElement.classList.contains(`dark`))};e();let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()}},[e]),t?e?e.resolvedMode===`dark`:r:!1}function pe(e,t){_(new Blob([e],{type:`text/csv;charset=utf-8`}),t)}async function me(e){if(typeof navigator>`u`||!navigator.clipboard?.writeText)throw Error(`Clipboard API not available. Ensure you're using HTTPS or localhost.`);await navigator.clipboard.writeText(e)}function he(e,t){return(e==null?``:String(e))===(t==null?``:String(t))?e:`${e==null?``:`(${e})`} ${t==null?``:`(${t})`}`.trim()}function w(e){return!e||!e.columns||!e.data?null:{columns:e.columns.map(e=>e.name),rows:e.data.map(e=>[...e])}}function ge(e){return w(e)}function _e(e){return w(e)}function ve(e,t){let n=e,r=t?.displayMode??`inline`,i=t?.primaryKeys??[];return n?.diff?ye(n.diff,r,i):be(n,r)}function ye(e,t,n){if(!e?.columns||!e?.data)return null;let r=e.columns.findIndex(e=>e.key.toLowerCase()===`in_a`),i=e.columns.findIndex(e=>e.key.toLowerCase()===`in_b`),a=e.columns.filter(e=>e.key.toLowerCase()!==`in_a`&&e.key.toLowerCase()!==`in_b`),o=a.map(e=>e.name),s=a.map(t=>e.columns.findIndex(e=>e.key===t.key)),c=n.map(t=>e.columns.findIndex(e=>e.key===t)).filter(e=>e>=0),l=e=>s.map(t=>e[t]),u=e=>c.length===0?``:c.map(t=>String(e[t]??``)).join(`|||`),d=new Map,f=[];if(e.data.forEach((e,t)=>{let n=r>=0?e[r]:!0,a=i>=0?e[i]:!0,o=u(e);o===``&&(o=String(t)),d.has(o)||(d.set(o,{base:null,current:null}),f.push(o));let s=d.get(o);if(!s)return;let c=l(e);n&&(s.base=c),a&&(s.current=c)}),t===`side_by_side`){let e=[];o.forEach(t=>{e.push(`base__${t}`,`current__${t}`)});let t=[];for(let e of f){let n=d.get(e);if(!n)continue;let r=n.base,i=n.current,a=[];o.forEach((e,t)=>{a.push(r?r[t]:null),a.push(i?i[t]:null)}),t.push(a)}return{columns:e,rows:t}}let p=[...o],m=[];for(let e of f){let t=d.get(e);if(!t)continue;let n=t.base,r=t.current,i=[];o.forEach((e,t)=>{let a=n?n[t]:null,o=r?r[t]:null;i.push(he(a,o))}),m.push(i)}return{columns:p,rows:m}}function be(e,t){let n=e?.current||e?.base;if(!n)return null;if(!e?.base||!e?.current)return w(n);let r=e.current.columns.map(e=>e.name);if(t===`side_by_side`){let t=[];r.forEach(e=>{t.push(`base__${e}`,`current__${e}`)});let n=[],i=Math.max(e.base.data.length,e.current.data.length);for(let t=0;t<i;t++){let i=[],a=t<e.base.data.length?e.base.data[t]:null,o=t<e.current.data.length?e.current.data[t]:null;r.forEach((e,t)=>{i.push(a?a[t]:null),i.push(o?o[t]:null)}),n.push(i)}return{columns:t,rows:n}}let i=[...r],a=[],o=Math.max(e.base.data.length,e.current.data.length);for(let t=0;t<o;t++){let n=t<e.base.data.length?e.base.data[t]:null,i=t<e.current.data.length?e.current.data[t]:null,o=[];r.forEach((e,t)=>{let r=n?n[t]:null,a=i?i[t]:null;o.push(he(r,a))}),a.push(o)}return{columns:i,rows:a}}function xe(e){let t=e,n=t?.current||t?.base;if(!n)return null;if(t?.base&&t?.current){let e=[`_source`,...t.current.columns.map(e=>e.name)],n=[];return t.base.data.forEach(e=>{n.push([`base`,...e])}),t.current.data.forEach(e=>{n.push([`current`,...e])}),{columns:e,rows:n}}return w(n)}function Se(e){let t=e;if(!t||typeof t!=`object`)return null;let n=[`node`,`base_count`,`current_count`,`diff`,`diff_percent`],r=[];for(let[e,n]of Object.entries(t))if(n&&typeof n==`object`){let t=n.base,i=n.curr,a=t!=null&&i!=null?i-t:null,o=t&&a!==null?(a/t*100).toFixed(2)+`%`:null;r.push([e,t,i,a,o])}return{columns:n,rows:r}}function Ce(e){let t=e;return t?.data?w(t.data):null}function we(e){return w(e)}function Te(e){let t=e,n=!!t?.base?.values,r=!!t?.current?.values;if(!n&&!r)return null;let i=[`_source`,`value`,`count`],a=[];return t?.base?.values&&t.base.values.forEach((e,n)=>{a.push([`base`,e,t.base.counts[n]])}),t?.current?.values&&t.current.values.forEach((e,n)=>{a.push([`current`,e,t.current.counts[n]])}),{columns:i,rows:a}}const Ee={query:ge,query_base:_e,query_diff:ve,profile:xe,profile_diff:xe,row_count:Se,row_count_diff:Se,value_diff:Ce,value_diff_detail:we,top_k_diff:Te};function De(e,t,n){let r=Ee[e];if(!r)return null;try{return r(t,n)}catch(t){return console.error(`Failed to extract CSV data for run type "${e}":`,t),null}}function Oe(e){return e in Ee}function T(e){if(e==null)return``;let t=typeof e==`object`?JSON.stringify(e):String(e);return t.includes(`,`)||t.includes(`"`)||t.includes(`
3
+ `)||t.includes(`\r`)?`"${t.replace(/"/g,`""`)}"`:t}function ke(e,t){return``+[e.map(T).join(`,`),...t.map(e=>e.map(T).join(`,`))].join(`\r
4
+ `)}function E(){let e=new Date;return`${e.getFullYear()}${String(e.getMonth()+1).padStart(2,`0`)}${String(e.getDate()).padStart(2,`0`)}-${String(e.getHours()).padStart(2,`0`)}${String(e.getMinutes()).padStart(2,`0`)}${String(e.getSeconds()).padStart(2,`0`)}`}function Ae(e,t){let n=E(),r=e.replace(/_/g,`-`),i;return t?.node_names&&Array.isArray(t.node_names)&&t.node_names.length===1?i=String(t.node_names[0]):t?.model&&typeof t.model==`string`&&(i=t.model),i?(i=i.replace(/[^a-zA-Z0-9_.-]/g,`-`).toLowerCase(),`${r}-${i}-${n}.csv`):`${r}-result-${n}.csv`}function je(e){let{primaryKeys:t,pinnedColumns:n,allColumns:r,excludeColumns:i=[]}=e,a=[],o=new Set,s=e=>i.includes(e);return t.forEach(e=>{!o.has(e)&&!s(e)&&(a.push(e),o.add(e))}),n.forEach(e=>{!o.has(e)&&!s(e)&&(a.push(e),o.add(e))}),r.forEach(e=>{!o.has(e)&&!s(e)&&(a.push(e),o.add(e))}),a}function Me(e,t,n){return!t||!n?!0:e===`added`||e===`removed`||e===`modified`}function D(e,t){return t.includes(e)}function Ne(e,t){return t.includes(e)}function O(e,t){return t.includes(e)}function Pe(e,t){return e[t]}function k(e){let{columnMap:t,primaryKeys:n,pinnedColumns:r,columnsRenderMode:i,changedOnly:a=!1,rowStats:o,excludeColumns:s=[],strictMode:c=!1}=e,l=(o?.modified??0)>0,u=[];return n.forEach(e=>{let n=Pe(t,e);if(!n){if(c)throw Error(`Primary key column "${e}" not found in columnMap`);return}u.push({key:e,name:e,columnType:n.colType,columnStatus:n.status,columnRenderMode:i[e],frozen:!0,isPrimaryKey:!0})}),r.forEach(e=>{if(D(e,n)||O(e,s))return;let r=Pe(t,e);if(!r){if(c)throw Error(`Pinned column "${e}" not found in columnMap`);return}u.push({key:e,name:e,columnType:r.colType,columnStatus:r.status,columnRenderMode:i[e],frozen:!0})}),Object.entries(t).forEach(([e,t])=>{D(e,n)||Ne(e,r)||O(e,s)||Me(t.status,a,l)&&u.push({key:e,name:e,columnType:t.colType,columnStatus:t.status,columnRenderMode:i[e]})}),u}function Fe(e){let{columnMap:t,primaryKeys:n,pinnedColumns:r,columnsRenderMode:i,excludeColumns:a=[],strictMode:o=!1}=e,s=[];return n.forEach(e=>{let n=t[e];if(!n){if(o)throw Error(`Primary key column "${e}" not found in columnMap`);return}s.push({key:e,name:e,columnType:n.colType,columnRenderMode:i[e],frozen:!0,isPrimaryKey:!0})}),r.forEach(e=>{if(n.includes(e)||a.includes(e))return;let r=t[e];if(!r){if(o)throw Error(`Pinned column "${e}" not found in columnMap`);return}s.push({key:r.key,name:e,columnType:r.colType,columnRenderMode:i[e],frozen:!0})}),Object.entries(t).forEach(([e,t])=>{n.includes(e)||r.includes(e)||a.includes(e)||s.push({key:t.key,name:e,columnType:t.colType,columnRenderMode:i[e]})}),s}function A(e,t){return[{value:`Show raw value`,onClick:()=>{t({[e]:`raw`})}},{value:`Show 2 decimal points`,onClick:()=>{t({[e]:2})}},{value:`Show as percentage`,onClick:()=>{t({[e]:`percent`})}},{value:`Show with net change`,onClick:()=>{t({[e]:`delta`})}}]}function j({value:t,colorPalette:n,grayOut:r,noCopy:i,fontSize:o,onCopy:u}){let[d,f]=a(!1),p=fe();return c(l,{sx:{display:`flex`,p:`2px 5px`,minWidth:`30px`,maxWidth:`200px`,overflow:`hidden`,textOverflow:`ellipsis`,color:p?e[n][300]:e[n][800],bgcolor:p?e[n][900]:e[n][100],alignItems:`center`,gap:`2px`,borderRadius:`8px`,fontSize:o,flexShrink:i?0:`inherit`},onMouseEnter:()=>{f(!0)},onMouseLeave:()=>{f(!1)},children:[s(l,{sx:{overflow:`hidden`,textOverflow:`ellipsis`,color:r?`text.disabled`:`inherit`},children:t}),s(Ie,{value:t,noCopy:i,grayOut:r,isHovered:d,onCopy:u})]})}function Ie({value:e,noCopy:t,grayOut:n,isHovered:r,onCopy:i}){if(t||n||!r)return null;let a=()=>{i?i(e):typeof navigator<`u`&&navigator.clipboard&&navigator.clipboard.writeText(e)};return s(m,{title:`Copy Value`,children:s(f,{"aria-label":`Copy`,size:`small`,onClick:a,sx:{minWidth:`0.625rem`,height:`0.625rem`,display:`flex`,alignItems:`center`,justifyContent:`center`,p:0,color:`inherit`},children:s(h,{size:`0.625rem`})})})}const Le=t(null);let M=0;function Re({children:e}){let[t,r]=a([]),i=n(e=>{let t=e.id||`toast-${++M}`,n={id:t,open:!0,duration:e.type===`loading`?null:e.duration??5e3,closable:e.closable??!0,...e};return r(e=>[...e.filter(e=>e.id!==t),n]),t},[]),o=n(e=>{r(t=>t.map(t=>t.id===e?{...t,open:!1}:t)),setTimeout(()=>{r(t=>t.filter(t=>t.id!==e))},300)},[]),l={toast:i,success:e=>i({...e,type:`success`}),error:e=>i({...e,type:`error`}),warning:e=>i({...e,type:`warning`}),info:e=>i({...e,type:`info`}),loading:e=>i({...e,type:`loading`}),dismiss:o,update:n((e,t)=>{r(n=>n.map(n=>n.id===e?{...n,...t}:n))},[])};return c(Le.Provider,{value:l,children:[e,t.map(e=>s(b,{open:e.open,autoHideDuration:e.duration,onClose:()=>e.closable&&o(e.id),anchorOrigin:{vertical:`bottom`,horizontal:`right`},children:s(y,{severity:e.type===`loading`?`info`:e.type||`info`,onClose:e.closable?()=>o(e.id):void 0,icon:e.type===`loading`?s(p,{size:20,color:`inherit`}):void 0,sx:{width:`100%`,minWidth:300},children:c(u,{spacing:.5,children:[e.title&&s(d,{variant:`subtitle2`,fontWeight:`bold`,children:e.title}),e.description&&s(d,{variant:`body2`,component:`div`,children:e.description})]})})},e.id))]})}function ze(){let e=r(Le);if(!e)throw Error(`useToaster must be used within ToasterProvider`);return e}const N=new Set,P={create:e=>{let t=e.id||`toast-${++M}`;return N.forEach(n=>n({type:`create`,options:{...e,id:t}})),t},success:e=>P.create({...e,type:`success`}),error:e=>P.create({...e,type:`error`}),warning:e=>P.create({...e,type:`warning`}),info:e=>P.create({...e,type:`info`}),loading:e=>P.create({...e,type:`loading`}),dismiss:e=>{N.forEach(t=>t({type:`dismiss`,id:e}))},remove:e=>{N.forEach(t=>t({type:`dismiss`,id:e}))},update:(e,t)=>{N.forEach(n=>n({type:`update`,id:e,options:t}))},subscribe:e=>(N.add(e),()=>N.delete(e))};function Be(){let[e,t]=a([]);a(()=>P.subscribe(e=>{if(e.type===`create`&&e.options){let n={id:e.options.id||`toast-${++M}`,open:!0,duration:e.options.type===`loading`?void 0:e.options.duration??5e3,closable:e.options.closable??!0,...e.options};t(e=>[...e.filter(e=>e.id!==n.id),n])}else if(e.type===`dismiss`&&e.id){let n=e.id;t(e=>e.map(e=>e.id===n?{...e,open:!1}:e)),setTimeout(()=>{t(e=>e.filter(e=>e.id!==n))},300)}else e.type===`update`&&e.id&&e.options&&t(t=>t.map(t=>t.id===e.id?{...t,...e.options}:t))}));let n=e=>{t(t=>t.map(t=>t.id===e?{...t,open:!1}:t)),setTimeout(()=>{t(t=>t.filter(t=>t.id!==e))},300)};return s(o,{children:e.map(e=>s(b,{open:e.open,autoHideDuration:e.duration,onClose:()=>e.closable&&n(e.id),anchorOrigin:{vertical:`bottom`,horizontal:`right`},children:s(y,{severity:e.type===`loading`?`info`:e.type||`info`,onClose:e.closable?()=>n(e.id):void 0,icon:e.type===`loading`?s(p,{size:20,color:`inherit`}):void 0,sx:{width:`100%`,minWidth:300},children:c(u,{spacing:.5,children:[e.title&&s(d,{variant:`subtitle2`,fontWeight:`bold`,children:e.title}),e.description&&s(d,{variant:`body2`,component:`div`,children:e.description})]})})},e.id))})}function Ve(){function e(e){P.create({description:e,type:`info`,duration:5e3,closable:!0})}function t(e,t){P.create({title:e,description:String(t),type:`error`,duration:5e3,closable:!0})}return{successToast:e,failToast:t}}function He(e){let[,t]=v(),{successToast:n}=Ve(),r=e=>{t(e),n(`${e} copied`)};return s(j,{...e,onCopy:r})}function Ue({name:e,columnStatus:t,columnType:n,primaryKeys:r=[],onPrimaryKeyChange:i,pinnedColumns:u=[],onPinnedColumnsChange:d,onColumnsRenderModeChanged:p}){let[m,h]=a(null),g=!!m,_=e=>{h(e.currentTarget)},v=()=>{h(null)};if(e===`index`)return s(o,{});let y=r.includes(e),b=u.includes(e),x=t!==`added`&&t!==`removed`,S=[];return p&&(S=A(e,p)),c(l,{sx:{display:`flex`,alignItems:`center`,gap:`10px`,width:`100%`},className:`grid-header`,children:[y&&s(ie,{}),s(l,{sx:{flex:1,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e}),x&&i&&s(l,{component:y?ne:ie,className:y?`close-icon`:`key-icon`,sx:{display:y?`block`:`none`,cursor:`pointer`},onClick:y?()=>{i&&i(r.filter(t=>t!==e))}:()=>{i&&i([...r.filter(e=>e!==`index`),e])}}),!y&&d&&s(l,{component:b?oe:ae,className:b?`unpin-icon`:`pin-icon`,sx:{display:b?`block`:`none`,cursor:`pointer`},onClick:b?()=>{d&&d(u.filter(t=>t!==e))}:()=>{d&&d([...u,e])}}),!y&&n===`number`&&S.length>0&&c(o,{children:[s(f,{"aria-label":`Options`,size:`small`,className:`!size-4 !min-w-4`,onClick:_,children:s(re,{})}),s(ee,{anchorEl:m,open:g,onClose:v,children:S.map(e=>s(te,{onClick:()=>{e.onClick(),v()},children:e.value},e.value))})]})]})}function We({name:e,pinnedColumns:t=[],onPinnedColumnsChange:n=()=>{},columnType:r,onColumnsRenderModeChanged:i}){let[u,d]=a(null),p=!!u,m=e=>{d(e.currentTarget)},h=()=>{d(null)},_=[];i&&(_=A(e,i));let v=t.includes(e);return c(l,{sx:{display:`flex`,alignItems:`center`,width:`100%`},className:`grid-header`,children:[s(l,{sx:{flex:1},children:e}),s(l,{component:v?oe:ae,className:v?`unpin-icon`:`pin-icon`,sx:{display:v?`block`:`none`,cursor:`pointer`},onClick:v?()=>{n(t.filter(t=>t!==e))}:()=>{n([...t,e])}}),r===`number`&&c(o,{children:[s(f,{"aria-label":`Options`,size:`small`,className:`size-6!`,sx:{p:0},onClick:m,children:s(g,{})}),s(ee,{anchorEl:u,open:p,onClose:h,children:_.map(e=>s(te,{onClick:()=>{e.onClick(),h()},children:e.value},e.value))})]})]})}function F(e){return e.data.map((t,n)=>({...e.columns.reduce((e,n,r)=>(e[n.key]=t[r],e),{}),__status:void 0,_index:n+1}))}function Ge(e){let t=Number(e);return!Number.isNaN(t)&&Number.isFinite(t)?t:Ke(e)}function Ke(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r,t&=t}return Math.abs(t)}function qe(e,t){let n=t.toLowerCase();if(n in e)return e[n];let r=Object.keys(e).find(e=>e.toLowerCase()===n);return r?e[r]:void 0}function Je(e,t){let n=e[t.toLowerCase()];return n||=e[t.toUpperCase()],n||=e[t],n}function I(e,t=`en-US`,n){return typeof e==`number`?new Intl.NumberFormat(t,n).format(e):e}function Ye(e){let t=e>0&&e<=.001,n=e<1&&e>=.999,r=(t=e)=>I(t,`en-US`,{style:`percent`,minimumFractionDigits:1});return t?`<${r(.001)}`:n?`>${r(.999)}`:r()}function Xe(e){if(typeof e!=`number`)return e;{let t=Math.abs(e),n=10**-2,r=10**3,i=10**6,a=10**9,o=10**12,s=10**15,c=t>=n,l=t>=1,u=t>=r,d=t>=i,f=t>=a,p=t>=o,m=t>=s;if(m||p)return new Intl.NumberFormat(`en-US`,{style:`unit`,unit:`liter`,unitDisplay:`narrow`,maximumFractionDigits:m?0:2}).format(e/0xe8d4a51000).replace(`L`,`T`);if(f||d||u){let t={base:f?a:d?i:r,unit:f?`B`:d?`M`:`K`};return new Intl.NumberFormat(`en-US`,{style:`unit`,unit:`liter`,unitDisplay:`narrow`,maximumFractionDigits:1}).format(e/t.base).replace(`L`,t.unit)}else if(l)return new Intl.NumberFormat(`en-US`,{maximumFractionDigits:2}).format(e);else return new Intl.NumberFormat(`en-US`,{maximumFractionDigits:c?3:2,notation:c||t===0?`standard`:`scientific`}).format(e)}}function L(e,t){let n=[...e],r=[...t],i=[];for(;n.length>0&&r.length>0;)if(i.includes(n[0]))n.shift();else if(i.includes(r[0]))r.shift();else if(n[0]===r[0])i.push(n[0]),n.shift(),r.shift();else if(r.includes(n[0])){let e=r.indexOf(n[0]);for(let t=0;t<e;t++)i.includes(r[t])||i.push(r[t]);i.push(n[0]),n.shift(),r.splice(0,e+1)}else i.push(n[0]),n.shift();return n.forEach(e=>{i.includes(e)||i.push(e)}),r.forEach(e=>{i.includes(e)||i.push(e)}),i}function R(e,t){let n=L(e,t),r={};for(let i of n)e.includes(i)?t.includes(i)?r[i]=void 0:r[i]=`removed`:r[i]=`added`;let i={};e.forEach((e,t)=>{i[e]=t});let a=-1;for(let e of n){let t=i[e];t!=null&&(t>a?a=t:r[e]=`reordered`)}return r}function Ze(e){let t={};return e.columns.forEach((e,n)=>{t[e.name]={key:e.key,index:n,colType:e.type}}),t}function Qe(e){let t={};if(e.columns.forEach((e,n)=>{t[e.key]={key:e.key,index:n,colType:e.type}}),!t.in_a)throw Error(`Joined DataFrame missing required 'in_a' column`);if(!t.in_b)throw Error(`Joined DataFrame missing required 'in_b' column`);return t}function $e(e,t){let n={},r=R(e.columns.map(e=>e.key),t.columns.map(e=>e.key));return Object.entries(r).forEach(([r,i])=>{let a=e.columns.find(e=>e.key===r),o=t.columns.find(e=>e.key===r);n[r]={status:i,baseColumnKey:a?.key??`unknown`,currentColumnKey:o?.key??`unknown`,colType:a?.type??o?.type??`unknown`,key:a?.key??o?.key??`unknown`}}),n}function z(e,t){let n=[];for(let r of t){let t=e.find(e=>e.key===r);if(!t)throw Error(`Column ${r} not found`);n.push(t.key)}return n}function B(e,t,n){if(t.length===0)return String(n._index);let r=[];for(let i of t){let t=e.find(e=>e.key===i);if(!t)throw Error(`Primary Column ${i} not found`);let a=n[i];r.push(`${t.name}=${a}`)}return r.join(`|`)}function et(e,t,n,r){if(!e)return`added`;if(!t)return`removed`;let i=e===t;for(let[a,o]of Object.entries(n)){if(a===`index`||r.includes(a))continue;let n,s;if(i){let r=`base__${o.key}`,i=`current__${o.key}`;n=e[r],s=t[i]}else n=e[o.key],s=t[o.key];if(!x.isEqual(n,s))return`modified`}}function V(e,t=2){let n=I(Object.is(e,-0)?0:e,`en-US`,{maximumFractionDigits:t,roundingMode:`halfEven`})??String(e);return n===`-0`?`0`:n}function H(e,t){return Number.isNaN(e)?`NaN`:Number.isFinite(e)?t===`raw`?String(e):typeof t==`number`?V(e,t):t===`percent`?I(e,`en-US`,{style:`percent`,maximumFractionDigits:2})??String(e):V(e,2):e>0?`∞`:`-∞`}function U(e,t,n,r){let i=qe(e,t);if(i==null)return[`-`,!0];let a,o=!1;return typeof i==`boolean`?a=i.toString():i===``?(a=`(empty)`,o=!0):a=typeof i==`number`?H(i,r):n===`number`?H(parseFloat(i),r):String(i),[a,o]}function tt(e,t,n,r){let i=e.__status;if(i===`removed`)return`diff-cell-removed`;if(i===`added`)return`diff-cell-added`;if(t===`added`||t===`removed`)return;let a=`base__${n}`.toLowerCase(),o=`current__${n}`.toLowerCase();if(!x.isEqual(e[a],e[o]))return r?`diff-cell-removed`:`diff-cell-added`}function nt(e){if(e===`added`)return`diff-header-added`;if(e===`removed`)return`diff-header-removed`}const rt=e=>{let t=e.colDef,n=t?.context?.columnType,r=t?.context?.columnRenderMode,i=t?.field??``;if(!e.data)return null;let[a,o]=U(e.data,i,n,r);return s(d,{component:`span`,style:{color:o?`gray`:`inherit`},children:a})};function it(e={}){let t=e.DiffTextComponent??j;return e=>{let n=e.colDef,r=n?.context?.columnType,i=n?.context?.columnRenderMode,a=n?.field??``;if(!e.data)return null;let o=e.data,u=`base__${a}`.toLowerCase(),f=`current__${a}`.toLowerCase();if(!Object.hasOwn(o,u)&&!Object.hasOwn(o,f))return`-`;let p=Object.hasOwn(o,u),h=Object.hasOwn(o,f),[g,_]=U(o,`base__${a}`.toLowerCase(),r,i),[v,y]=U(o,`current__${a}`.toLowerCase(),r,i);if(o[u]===o[f])return s(d,{component:`span`,style:{color:y?`gray`:`inherit`},children:v});if(i===`delta`&&(r===`number`||r===`integer`)&&p&&h){let e=ot(o[u]),n=ot(o[f]);if(Number.isFinite(e)&&Number.isFinite(n)){let r=n-e,i=e===0?0:r/e*100,a=V(n),o=V(r),u=`(${r>=0?`+`:``}${o})`;return s(m,{title:`Base: ${e}\nCurrent: ${n}\nChange: ${r>=0?`+`:``}${r} (${i>=0?`+`:``}${i.toFixed(2)}%)`,slotProps:{tooltip:{sx:{whiteSpace:`pre-line`}}},enterDelay:300,placement:`top`,children:c(l,{gap:`5px`,display:`flex`,alignItems:`center`,lineHeight:`normal`,height:`100%`,children:[s(t,{value:a,colorPalette:`green`,grayOut:y}),s(d,{fontSize:`0.75rem`,color:r>=0?`green.600`:`red.600`,children:u})]})})}}return c(l,{sx:{display:`flex`,gap:`5px`,alignItems:`center`,lineHeight:`normal`,height:`100%`},children:[p&&s(t,{value:g,colorPalette:`red`,grayOut:_}),h&&s(t,{value:v,colorPalette:`green`,grayOut:y})]})}}const at=it({DiffTextComponent:He});function ot(e){if(typeof e==`number`)return e;if(typeof e==`string`){let t=Number.parseFloat(e);return Number.isNaN(t)?0:t}return 0}function st(e,t){return n=>{let r=n.data;if(!r)return;let i=r.__status;if(i===`removed`)return`diff-cell-removed`;if(i===`added`)return`diff-cell-added`;if(t===`added`||t===`removed`)return;let a=`base__${e}`.toLowerCase(),o=`current__${e}`.toLowerCase();if(!x.isEqual(r[a],r[o]))return`diff-cell-removed`}}function ct(e,t){return n=>{let r=n.data;if(!r)return;let i=r.__status;if(i===`removed`)return`diff-cell-removed`;if(i===`added`)return`diff-cell-added`;if(t===`added`||t===`removed`)return;let a=`base__${e}`.toLowerCase(),o=`current__${e}`.toLowerCase();if(!x.isEqual(r[a],r[o]))return`diff-cell-added`}}function W(e){let{name:t,columnStatus:n,columnType:r,columnRenderMode:i,displayMode:a,baseTitle:o=`Base`,currentTitle:c=`Current`,headerProps:l={},renderComponents:u}=e,{DataFrameColumnGroupHeader:d,defaultRenderCell:f,inlineRenderCell:p}=u,m=nt(n),h=()=>s(d,{name:t,columnStatus:n,columnType:r,...l});if(a===`inline`)return{field:t,headerName:t,headerClass:m,headerComponent:h,cellRenderer:p,context:{columnType:r,columnRenderMode:i}};let g=st(t,n),_=ct(t,n);return{headerName:t,headerClass:m,headerGroupComponent:h,context:{columnType:r,columnRenderMode:i},children:[{field:`base__${t}`,headerName:o,headerClass:m,cellClass:g,cellRenderer:f,context:{columnType:r,columnRenderMode:i}},{field:`current__${t}`,headerName:c,headerClass:m,cellClass:_,cellRenderer:f,context:{columnType:r,columnRenderMode:i}}]}}function lt(){return{field:`_index`,headerName:``,width:50,maxWidth:100,cellClass:`index-column`,resizable:!1,pinned:`left`}}function ut(e,t,n){let{key:r,name:i,columnType:a,columnStatus:o,columnRenderMode:c}=e,{DataFrameColumnGroupHeader:l,defaultRenderCell:u}=n;return{field:r,headerName:i,headerComponent:()=>s(l,{name:i,columnStatus:o??``,columnType:a,...t}),pinned:`left`,cellClass:e=>{if(e.data?.__status)return`diff-header-${e.data.__status}`},cellRenderer:u,context:{columnType:a,columnRenderMode:c}}}function dt(e,t,n,r,i,a){let{name:o,columnType:s,columnStatus:c,columnRenderMode:l}=e;return W({name:o,columnStatus:c??``,columnType:s,columnRenderMode:l,displayMode:t,baseTitle:i,currentTitle:a,headerProps:n,renderComponents:r})}function G(e){let{columns:t,displayMode:n,headerProps:r,baseTitle:i,currentTitle:a,allowIndexFallback:o=!1,renderComponents:s}=e,c=[],l=!1;!t.some(e=>e.isPrimaryKey)&&o&&(c.push(lt()),l=!0);for(let e of t)if(e.isPrimaryKey)c.push(ut(e,r,s));else{let t=dt(e,n,r,s,i,a);c.push({...t,pinned:e.frozen?`left`:void 0})}return{columns:c,usedIndexFallback:l}}function ft(e){return`baseColumnKey`in e&&`currentColumnKey`in e}function pt(e,t){return t.includes(e)}function mt(e){return ft(e)?{baseKey:e.baseColumnKey,currentKey:e.currentColumnKey}:{baseKey:e.key,currentKey:e.key}}function ht(e,t,n,r,i){n.forEach(n=>{let a=n.key;pt(a,i)?e[String(a).toLowerCase()]=t[a]:e[`${r}${a}`.toLowerCase()]=t[a]})}function gt(e,t,n,r){let i=!1;for(let[a,o]of Object.entries(n)){if(a===`index`||pt(a,r))continue;let{baseKey:n,currentKey:s}=mt(o);if(n===`unknown`||s===`unknown`)continue;let c=e[n],l=t[s];x.isEqual(c,l)||(i=!0,o.status=`modified`)}return i}function K(e){let{baseMap:t,currentMap:n,baseColumns:r,currentColumns:i,columnMap:a,primaryKeys:o,changedOnly:s=!1}=e,c=R(Object.keys(t),Object.keys(n)),l={added:0,removed:0,modified:0},u=Object.entries(c).map(([e])=>{let s=t[e],c=n[e],u={_index:Ge(e),__status:void 0};return s&&ht(u,s,r,`base__`,o),c&&ht(u,c,i,`current__`,o),s?c?gt(s,c,a,o)&&(u.__status=`modified`,l.modified++):(u.__status=`removed`,l.removed++):(u.__status=`added`,l.added++),u});return s&&(u=u.filter(e=>e.__status===`added`||e.__status===`removed`||e.__status===`modified`)),{rows:u,rowStats:l}}var q=class extends Error{constructor(e,t,n){super(t?`[${t}] ${e}`:e),this.context=t,this.details=n,this.name=`DataGridValidationError`}};function J(e,t=`DataFrame`){if(e!=null){if(typeof e!=`object`)throw new q(`Expected an object, got ${typeof e}`,t);if(!(`columns`in e))throw new q(`Missing 'columns' property`,t,{receivedKeys:Object.keys(e)});if(!Array.isArray(e.columns))throw new q(`'columns' must be an array, got ${typeof e.columns}`,t);if(!(`data`in e))throw new q(`Missing 'data' property`,t,{receivedKeys:Object.keys(e)});if(!Array.isArray(e.data))throw new q(`'data' must be an array, got ${typeof e.data}`,t);_t(e.columns,t),e.data.length>0&&vt(e,t)}}function _t(e,t=`DataFrame`){e.forEach((e,n)=>{if(!e||typeof e!=`object`)throw new q(`Column at index ${n} is not an object`,t,{column:e});if(typeof e.key!=`string`||e.key===``)throw new q(`Column at index ${n} has invalid 'key': expected non-empty string, got ${JSON.stringify(e.key)}`,t,{column:e});if(typeof e.name!=`string`)throw new q(`Column '${e.key}' has invalid 'name': expected string, got ${typeof e.name}`,t,{column:e});if(typeof e.type!=`string`)throw new q(`Column '${e.key}' has invalid 'type': expected string, got ${typeof e.type}`,t,{column:e})})}function vt(e,t=`DataFrame`){let n=e.columns.length;for(let r=0;r<e.data.length;r++){let i=e.data[r];if(!Array.isArray(i))throw new q(`Row at index ${r} is not an array`,t,{row:i,rowType:typeof i});if(i.length!==n)throw new q(`Row ${r} has ${i.length} values but expected ${n} (column count)`,t,{rowIndex:r,rowLength:i.length,columnCount:n,columns:e.columns.map(e=>e.key)})}}function Y(e,t,n={}){let{required:r=!1,caseInsensitive:i=!1,context:a=`primaryKeys`}=n;if(r&&(!e||e.length===0))throw new q(`Primary keys are required but none were provided`,a);if(!e||e.length===0)return;let o=t.map(e=>e.key),s=i?o.map(e=>e.toLowerCase()):o;for(let t of e){let e=i?t.toLowerCase():t;if(!(i?s.includes(e):o.includes(t)))throw new q(`Primary key column '${t}' not found in columns`,a,{requestedKey:t,availableColumns:o,caseInsensitive:i})}let c=new Set;for(let t of e){let n=i?t.toLowerCase():t;if(c.has(n))throw new q(`Duplicate primary key: '${t}'`,a,{primaryKeys:e});c.add(n)}}function yt(e,t){J(e,`dataframe`),e&&t?.primaryKeys&&Y(t.primaryKeys,e.columns,{context:`toDataGrid`})}function bt(e,t,n){if(J(e,`base`),J(t,`current`),n?.primaryKeys&&n.primaryKeys.length>0){let r=e?.columns??[],i=t?.columns??[],a=new Set([...r.map(e=>e.key),...i.map(e=>e.key)]);for(let e of n.primaryKeys)if(!a.has(e))throw new q(`Primary key column '${e}' not found in either base or current DataFrame`,`toDataDiffGrid`,{requestedKey:e,baseColumns:r.map(e=>e.key),currentColumns:i.map(e=>e.key)})}}function xt(e,t){if(!e)throw new q(`DataFrame is required for value diff`);if(J(e),!t||t.length===0)throw new q(`Primary keys are required for value diff`);Y(t,e.columns,{required:!0,context:`toValueDiffGrid`});let n=e.columns.map(e=>e.key);if(!n.includes(`in_a`))throw new q(`Value diff DataFrame must include lowercase 'in_a' column`);if(!n.includes(`in_b`))throw new q(`Value diff DataFrame must include lowercase 'in_b' column`)}function St(e,t,n,r){bt(e,t,n);let i=e??{columns:[],data:[]},a=t??{columns:[],data:[]},o=n?.primaryKeys??[],s=n?.pinnedColumns??[],c=n?.changedOnly??!1,l=n?.displayMode??`side_by_side`,u=n?.columnsRenderMode??{},d=F(i),f=F(a),p=$e(i,a),m={},h={},g=!1,_=!1;if(o.length===0)d.forEach(e=>{m[String(e._index)]=e}),f.forEach(e=>{h[String(e._index)]=e});else{let e=z(i.columns,o);d.forEach(t=>{let n=B(i.columns,e,t);n in m&&(g=!0),m[n]=t});let t=z(a.columns,o);f.forEach(e=>{let n=B(a.columns,t,e);n in h&&(_=!0),h[n]=e})}let{rows:v,rowStats:y}=K({baseMap:m,currentMap:h,baseColumns:i.columns,currentColumns:a.columns,columnMap:p,primaryKeys:o,changedOnly:c}),{columns:b}=G({columns:k({columnMap:p,primaryKeys:o,pinnedColumns:s,columnsRenderMode:u,changedOnly:c,rowStats:y,excludeColumns:[`index`],strictMode:!1}),displayMode:l,allowIndexFallback:!0,baseTitle:n?.baseTitle,currentTitle:n?.currentTitle,headerProps:{primaryKeys:o,pinnedColumns:s,onPrimaryKeyChange:n?.onPrimaryKeyChange,onPinnedColumnsChange:n?.onPinnedColumnsChange,onColumnsRenderModeChanged:n?.onColumnsRenderModeChanged},renderComponents:r?.renderComponents??{DataFrameColumnGroupHeader:()=>null,defaultRenderCell:()=>null,inlineRenderCell:()=>null}});return{columns:b,rows:v,invalidPKeyBase:g,invalidPKeyCurrent:_}}function Ct(){return{field:`_index`,headerName:``,width:50,cellClass:`index-column`,resizable:!1,pinned:`left`}}function wt(e,t,n){let{key:r,name:i,columnType:a,columnRenderMode:o}=e,{DataFrameColumnGroupHeader:c,defaultRenderCell:l}=n;return{field:r,headerName:i,headerComponent:()=>s(c,{name:i,columnStatus:``,columnType:a,pinnedColumns:t.pinnedColumns,onPinnedColumnsChange:t.onPinnedColumnsChange,onColumnsRenderModeChanged:t.onColumnsRenderModeChanged}),pinned:`left`,cellRenderer:l,context:{columnType:a,columnRenderMode:o}}}function Tt(e,t,n){let{key:r,name:i,columnType:a,columnRenderMode:o}=e,{DataFrameColumnHeader:c,defaultRenderCell:l}=n;return{field:r,headerName:i,headerComponent:()=>s(c,{name:i,columnType:a,pinnedColumns:t.pinnedColumns,onPinnedColumnsChange:t.onPinnedColumnsChange,onColumnsRenderModeChanged:t.onColumnsRenderModeChanged}),cellRenderer:l,context:{columnType:a,columnRenderMode:o}}}function X(e){let{columns:t,headerProps:n,allowIndexFallback:r=!0,renderComponents:i}=e,a=[],o=!1;!t.some(e=>e.isPrimaryKey)&&r&&(a.push(Ct()),o=!0);for(let e of t)if(e.isPrimaryKey)a.push(wt(e,n,i));else{let t=Tt(e,n,i);a.push({...t,pinned:e.frozen?`left`:void 0})}return{columns:a,usedIndexFallback:o}}function Et(e,t,n){yt(e,t);let r=t.primaryKeys??[],i=t.pinnedColumns??[],a=t.columnsRenderMode??{},{columns:o}=X({columns:Fe({columnMap:Ze(e),primaryKeys:r,pinnedColumns:i,columnsRenderMode:a}),headerProps:{pinnedColumns:i,onPinnedColumnsChange:t.onPinnedColumnsChange,onColumnsRenderModeChanged:t.onColumnsRenderModeChanged},allowIndexFallback:!0,renderComponents:n.renderComponents});return{columns:o,rows:F(e)}}function Dt(e,t,n,r){xt(e,t);let i=n?.pinnedColumns??[],a=n?.changedOnly??!1,o=n?.displayMode??`inline`,s=n?.columnsRenderMode??{},c=F(e),l=Qe(e),u={},d={},f=z(e.columns,t),p=l.in_a.key,m=l.in_b.key;c.forEach(t=>{let n=B(e.columns,f,t);t[p]&&(u[n.toLowerCase()]=t),t[m]&&(d[n.toLowerCase()]=t)});let{rows:h,rowStats:g}=K({baseMap:u,currentMap:d,baseColumns:e.columns,currentColumns:e.columns,columnMap:l,primaryKeys:t,changedOnly:a}),{columns:_}=G({columns:k({columnMap:l,primaryKeys:t,pinnedColumns:i,columnsRenderMode:s,changedOnly:a,rowStats:g,excludeColumns:[`in_a`,`in_b`],strictMode:!0}),displayMode:o,allowIndexFallback:!1,baseTitle:n?.baseTitle,currentTitle:n?.currentTitle,headerProps:{primaryKeys:t,pinnedColumns:i,onPinnedColumnsChange:n?.onPinnedColumnsChange,onColumnsRenderModeChanged:n?.onColumnsRenderModeChanged},renderComponents:r?.renderComponents??{DataFrameColumnGroupHeader:()=>null,defaultRenderCell:()=>null,inlineRenderCell:()=>null}});return{columns:_,rows:h}}const Z={DataFrameColumnGroupHeader:Ue,defaultRenderCell:rt,inlineRenderCell:at},Q={DataFrameColumnGroupHeader:Ue,DataFrameColumnHeader:We,defaultRenderCell:rt};function Ot(e){return W({...e,renderComponents:Z})}function kt(e){return G({...e,renderComponents:Z})}function At(e,t,n){return St(e,t,n,{renderComponents:Z})}function jt(e,t,n){return Dt(e,t,n,{renderComponents:Z})}function Mt(e,t){return Et(e,t,{renderComponents:Q})}function Nt(e){return X({...e,renderComponents:Q})}function $(e,t){if(e===0&&t!==0)return`N/A`;if(e<t){let n=(t-e)/e*100;return`+${n>=.1?n.toFixed(1):` <0.1 `}%`}else if(e>t){let n=(e-t)/e*100;return`-${n>=.1?n.toFixed(1):` <0.1 `}%`}else return`0`}function Pt(e,t){return e!==null&&t!==null?e===t?`0`:$(e,t):e===t?`N/A`:e===null?`Added`:t===null?`Removed`:`N/A`}function Ft(e){return{columns:[{key:`name`,name:`Name`,type:`text`},{key:`base`,name:`Base Rows`,type:`number`},{key:`current`,name:`Current Rows`,type:`number`},{key:`delta`,name:`Delta`,type:`text`}],data:Object.entries(e).map(([e,t])=>{let n=typeof t.base==`number`?t.base:null,r=typeof t.curr==`number`?t.curr:null;return[e,n,r,Pt(n,r)]})}}function It(e){return{columns:[{key:`name`,name:`Name`,type:`text`},{key:`current`,name:`Row Count`,type:`number`}],data:Object.entries(e).map(([e,t])=>[e,typeof t.curr==`number`?t.curr:null])}}function Lt(e,t){if(e===null&&t!==null)return`added`;if(e!==null&&t===null)return`removed`;if(e!==null&&t!==null&&e!==t)return`modified`}function Rt(e){return{columns:[{field:`name`,headerName:`Name`,resizable:!0},{field:`current`,headerName:`Row Count`,resizable:!0}],rows:F(It(e)).map(e=>({...e,current:e.current??`N/A`,__status:void 0}))}}function zt(){return e=>{let t=e.data;if(!t)return;let n=t.base,r=t.current,i=n===`N/A`?null:n,a=r===`N/A`?null:r;if(i!==a){if(i===null||typeof i==`number`&&typeof a==`number`&&i<a)return`diff-cell-added`;if(a===null||typeof i==`number`&&typeof a==`number`&&i>a)return`diff-cell-removed`}}}function Bt(e){let t=F(Ft(e)).map(e=>{let t=e.base,n=e.current;return{...e,base:t??`N/A`,current:n??`N/A`,__status:Lt(typeof t==`number`?t:null,typeof n==`number`?n:null)}}),n=zt();return{columns:[{field:`name`,headerName:`Name`,resizable:!0,cellClass:n},{field:`base`,headerName:`Base Rows`,resizable:!0,cellClass:n},{field:`current`,headerName:`Current Rows`,resizable:!0,cellClass:n},{field:`delta`,headerName:`Delta`,resizable:!0,cellClass:n}],rows:t}}function Vt(e){let t=new Set,n=new Set;if(e?.nodes){let r=Object.values(e.nodes);for(let e of r)e.data.data.base?.schema&&t.add(e.data.data.base.schema),e.data.data.current?.schema&&n.add(e.data.data.current.schema)}return[t,n]}function Ht(e,t){let n=L(e,t);if(n.length===0)return[];if(e.length===0||t.length===0)return n.map((e,t)=>t===n.length-1?e:e+`,`);let r=``;return n.forEach(n=>{e.includes(n)&&t.includes(n)&&(r=n)}),n.map((i,a)=>{let o;return o=e.includes(i)?t.includes(i)?i:`--- ${i} (Removed)`:`--- ${i} (Added)`,i===r||a===n.length-1?o:o+`,`})}function Ut(e){let t=Math.floor(e);return{hours:Math.floor(t/3600),minutes:Math.floor(t%3600/60),seconds:t%60}}function Wt({hours:e,minutes:t,seconds:n}){return e>0?`${e}:${t.toString().padStart(2,`0`)}:${n.toString().padStart(2,`0`)}`:`${t}:${n.toString().padStart(2,`0`)}`}function Gt({hours:e,minutes:t,seconds:n}){let r=[];return e>0&&r.push(`${e} hour${e===1?``:`s`}`),t>0&&r.push(`${t} min${t===1?``:`s`}`),e===0&&(r.length===0||n>0)&&r.push(`${n} second${n===1?``:`s`}`),r.join(` `)}function Kt(e,t=`verbose`){let n=Ut(e);return t===`compact`?Wt(n):Gt(n)}function qt(e){return S(ce(e),`yyyy-MM-dd'T'HH:mm:ss`)}function Jt(e){return se(ce(e),new Date,{addSuffix:!0})}function Yt(e,t){if(!e||!t)return;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!0;for(let e=0;e<n.length;e++)if(n[e]!==r[e])return!0;for(let n of r)if(!e[n]||e[n].type!==t[n]?.type)return!0;return!1}function Xt(e,t){return e?.organization_name&&e.web_url?`${e.web_url}/organizations/${e.organization_name}/settings`:t}export{Xe as $,J as A,de as At,Ze as B,Dt as C,E as Ct,q as D,me as Dt,St as E,Oe as Et,K as F,V as G,$e as H,G as I,B as J,tt as K,st as L,bt as M,ue as Mt,yt as N,vt as O,pe as Ot,xt as P,R as Q,ct as R,jt as S,Ae as St,X as T,De as Tt,H as U,Qe as V,et as W,z as X,U as Y,L as Z,Z as _,Fe as _t,qt as a,Ke as at,Mt as b,D as bt,Bt as c,Ve as ct,Lt as d,P as dt,Ye as et,Ft as f,ze as ft,Nt as g,k as gt,kt as h,je as ht,Jt as i,Je as it,Y as j,le as jt,_t as k,fe as kt,Rt as l,Be as lt,$ as m,A as mt,Yt as n,F as nt,Ht as o,Ge as ot,It as p,j as pt,nt as q,Kt as r,qe as rt,Vt as s,He as st,Xt as t,I as tt,Pt as u,Re as ut,Q as v,O as vt,Et as w,ke as wt,Ot as x,Me as xt,At as y,Ne as yt,W as z};
5
+ //# sourceMappingURL=utils-DjxzJ8eH.js.map