@parca/profile 0.19.139 → 0.19.142

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 (170) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/GraphTooltipArrow/Content.js +224 -30
  3. package/dist/GraphTooltipArrow/DockedGraphTooltip/index.js +192 -33
  4. package/dist/GraphTooltipArrow/ExpandOnHoverValue.js +53 -3
  5. package/dist/GraphTooltipArrow/index.d.ts.map +1 -1
  6. package/dist/GraphTooltipArrow/index.js +86 -56
  7. package/dist/GraphTooltipArrow/useGraphTooltip/index.js +37 -37
  8. package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.js +103 -73
  9. package/dist/MatchersInput/SuggestionItem.js +91 -12
  10. package/dist/MatchersInput/SuggestionsList.d.ts +2 -1
  11. package/dist/MatchersInput/SuggestionsList.d.ts.map +1 -1
  12. package/dist/MatchersInput/SuggestionsList.js +371 -157
  13. package/dist/MatchersInput/SuggestionsList.test.d.ts +2 -0
  14. package/dist/MatchersInput/SuggestionsList.test.d.ts.map +1 -0
  15. package/dist/MatchersInput/index.js +308 -115
  16. package/dist/MetricsCircle/index.js +39 -3
  17. package/dist/MetricsGraph/MetricsContextMenu/index.js +119 -19
  18. package/dist/MetricsGraph/MetricsInfoPanel/index.js +81 -20
  19. package/dist/MetricsGraph/MetricsTooltip/index.d.ts.map +1 -1
  20. package/dist/MetricsGraph/MetricsTooltip/index.js +107 -74
  21. package/dist/MetricsGraph/index.js +552 -203
  22. package/dist/MetricsGraph/useMetricsGraphDimensions.js +46 -25
  23. package/dist/MetricsGraph/utils/colorMapping.js +24 -17
  24. package/dist/MetricsSeries/index.js +70 -7
  25. package/dist/PreSelectedMatchers/index.d.ts.map +1 -1
  26. package/dist/PreSelectedMatchers/index.js +249 -102
  27. package/dist/ProfileExplorer/ProfileExplorerCompare.js +240 -49
  28. package/dist/ProfileExplorer/ProfileExplorerSingle.js +98 -11
  29. package/dist/ProfileExplorer/index.js +183 -32
  30. package/dist/ProfileFlameChart/SamplesStrips/SamplesGraph/index.js +333 -148
  31. package/dist/ProfileFlameChart/SamplesStrips/SamplesStrips.stories.js +69 -35
  32. package/dist/ProfileFlameChart/SamplesStrips/index.js +645 -134
  33. package/dist/ProfileFlameChart/SamplesStrips/labelSetUtils.js +114 -55
  34. package/dist/ProfileFlameChart/index.js +266 -134
  35. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.js +287 -88
  36. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenuWrapper.js +56 -20
  37. package/dist/ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.js +211 -140
  38. package/dist/ProfileFlameGraph/FlameGraphArrow/MemoizedTooltip.js +133 -38
  39. package/dist/ProfileFlameGraph/FlameGraphArrow/MiniMap.js +261 -216
  40. package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.d.ts.map +1 -1
  41. package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.js +71 -45
  42. package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.d.ts.map +1 -1
  43. package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.js +58 -28
  44. package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.d.ts.map +1 -1
  45. package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.js +59 -8
  46. package/dist/ProfileFlameGraph/FlameGraphArrow/index.js +396 -179
  47. package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.d.ts.map +1 -1
  48. package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.js +68 -50
  49. package/dist/ProfileFlameGraph/FlameGraphArrow/useMappingList.js +62 -38
  50. package/dist/ProfileFlameGraph/FlameGraphArrow/useNodeColor.js +14 -6
  51. package/dist/ProfileFlameGraph/FlameGraphArrow/useScrollViewport.js +124 -82
  52. package/dist/ProfileFlameGraph/FlameGraphArrow/useVisibleNodes.js +160 -98
  53. package/dist/ProfileFlameGraph/FlameGraphArrow/useZoom.js +232 -112
  54. package/dist/ProfileFlameGraph/FlameGraphArrow/utils.js +137 -114
  55. package/dist/ProfileFlameGraph/benchmarks/benchdata/populateData.js +85 -0
  56. package/dist/ProfileFlameGraph/index.js +324 -148
  57. package/dist/ProfileMetricsGraph/hooks/useQueryRange.js +140 -32
  58. package/dist/ProfileMetricsGraph/index.js +518 -259
  59. package/dist/ProfileSelector/CompareButton.js +132 -12
  60. package/dist/ProfileSelector/MetricsGraphSection.js +234 -67
  61. package/dist/ProfileSelector/index.d.ts.map +1 -1
  62. package/dist/ProfileSelector/index.js +730 -142
  63. package/dist/ProfileSelector/useAutoQuerySelector.js +249 -130
  64. package/dist/ProfileSource.js +230 -163
  65. package/dist/ProfileTypeSelector/index.js +214 -125
  66. package/dist/ProfileView/components/ActionButtons/GroupByDropdown.js +50 -4
  67. package/dist/ProfileView/components/ActionButtons/SortByDropdown.js +139 -33
  68. package/dist/ProfileView/components/ColorStackLegend.js +184 -55
  69. package/dist/ProfileView/components/DashboardItems/index.js +87 -28
  70. package/dist/ProfileView/components/DashboardLayout/index.js +108 -16
  71. package/dist/ProfileView/components/DiffLegend.js +172 -29
  72. package/dist/ProfileView/components/GroupByLabelsDropdown/index.js +199 -55
  73. package/dist/ProfileView/components/InvertCallStack/index.js +99 -10
  74. package/dist/ProfileView/components/ProfileFilters/filterPresets.js +260 -315
  75. package/dist/ProfileView/components/ProfileFilters/index.js +518 -215
  76. package/dist/ProfileView/components/ProfileFilters/useProfileFilters.js +370 -306
  77. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.js +188 -120
  78. package/dist/ProfileView/components/ProfileHeader/index.js +105 -11
  79. package/dist/ProfileView/components/ShareButton/ResultBox.js +119 -16
  80. package/dist/ProfileView/components/ShareButton/index.js +352 -62
  81. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.d.ts.map +1 -1
  82. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.js +675 -195
  83. package/dist/ProfileView/components/Toolbars/SwitchMenuItem.js +94 -7
  84. package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.js +198 -157
  85. package/dist/ProfileView/components/Toolbars/index.js +441 -21
  86. package/dist/ProfileView/components/ViewSelector/Dropdown.js +233 -22
  87. package/dist/ProfileView/components/ViewSelector/index.js +211 -91
  88. package/dist/ProfileView/components/VisualizationContainer/index.d.ts.map +1 -1
  89. package/dist/ProfileView/components/VisualizationContainer/index.js +52 -7
  90. package/dist/ProfileView/components/VisualizationPanel.js +185 -8
  91. package/dist/ProfileView/context/DashboardContext.js +84 -28
  92. package/dist/ProfileView/context/ProfileViewContext.js +56 -15
  93. package/dist/ProfileView/hooks/useAutoSelectDimension.js +71 -41
  94. package/dist/ProfileView/hooks/useProfileMetadata.js +50 -18
  95. package/dist/ProfileView/hooks/useResetFlameGraphState.js +31 -10
  96. package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.js +72 -29
  97. package/dist/ProfileView/hooks/useResetStateOnSeriesChange.js +39 -13
  98. package/dist/ProfileView/hooks/useVisualizationState.js +262 -87
  99. package/dist/ProfileView/index.js +383 -45
  100. package/dist/ProfileView/types/visualization.js +1 -13
  101. package/dist/ProfileView/utils/colorUtils.js +8 -7
  102. package/dist/ProfileViewWithData.js +332 -237
  103. package/dist/QueryControls/index.js +418 -47
  104. package/dist/Sandwich/components/CalleesSection.js +54 -4
  105. package/dist/Sandwich/components/CallersSection.js +97 -27
  106. package/dist/Sandwich/components/TableSection.js +77 -4
  107. package/dist/Sandwich/index.js +125 -12
  108. package/dist/Sandwich/utils/processRowData.js +48 -39
  109. package/dist/SelectWithRefresh/index.js +102 -28
  110. package/dist/SimpleMatchers/Select.js +520 -187
  111. package/dist/SimpleMatchers/index.js +590 -288
  112. package/dist/SourceView/Highlighter.js +230 -70
  113. package/dist/SourceView/LineNo.js +72 -17
  114. package/dist/SourceView/index.js +177 -101
  115. package/dist/SourceView/lang-detector/ext-to-lang.json +798 -798
  116. package/dist/SourceView/lang-detector/index.js +28 -14
  117. package/dist/SourceView/useSelectedLineRange.js +97 -16
  118. package/dist/Table/ColorCell.js +42 -1
  119. package/dist/Table/ColumnsVisibility.js +114 -6
  120. package/dist/Table/MoreDropdown.js +121 -27
  121. package/dist/Table/TableContextMenu.js +150 -139
  122. package/dist/Table/TableContextMenuWrapper.js +59 -14
  123. package/dist/Table/hooks/useColorManagement.js +58 -16
  124. package/dist/Table/hooks/useTableConfiguration.d.ts.map +1 -1
  125. package/dist/Table/hooks/useTableConfiguration.js +331 -168
  126. package/dist/Table/index.js +222 -126
  127. package/dist/Table/utils/functions.js +169 -144
  128. package/dist/Table/utils/topAndBottomExpandedRowModel.js +69 -52
  129. package/dist/TimelineGuide/index.js +209 -16
  130. package/dist/TopTable/benchmarks/benchdata/populateData.js +91 -0
  131. package/dist/TopTable/index.js +340 -122
  132. package/dist/contexts/LabelsQueryProvider.js +94 -32
  133. package/dist/contexts/UnifiedLabelsContext.js +114 -49
  134. package/dist/contexts/utils.js +37 -15
  135. package/dist/hooks/useCompareModeMeta.js +157 -94
  136. package/dist/hooks/useLabels.js +295 -52
  137. package/dist/hooks/useQueryState.js +371 -330
  138. package/dist/index.js +21 -16
  139. package/dist/testdata/fg-diff.json +3750 -0
  140. package/dist/testdata/fg-simple.json +1879 -0
  141. package/dist/testdata/link_data.json +56 -0
  142. package/dist/testdata/tabular.json +30 -0
  143. package/dist/testdata/test_flamegraph.json +26846 -0
  144. package/dist/testdata/test_graph.json +53 -0
  145. package/dist/useDelayedLoader.js +32 -18
  146. package/dist/useGrpcQuery/index.js +71 -11
  147. package/dist/useHasProfileData.js +90 -12
  148. package/dist/useQuery.js +205 -64
  149. package/dist/useSumBy.d.ts.map +1 -1
  150. package/dist/useSumBy.js +294 -138
  151. package/dist/utils.js +62 -30
  152. package/package.json +9 -9
  153. package/src/GraphTooltipArrow/index.tsx +3 -0
  154. package/src/MatchersInput/SuggestionsList.test.tsx +70 -0
  155. package/src/MatchersInput/SuggestionsList.tsx +11 -10
  156. package/src/MatchersInput/index.tsx +1 -1
  157. package/src/MetricsGraph/MetricsTooltip/index.tsx +22 -34
  158. package/src/PreSelectedMatchers/index.tsx +3 -0
  159. package/src/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.tsx +3 -0
  160. package/src/ProfileFlameGraph/FlameGraphArrow/TooltipContext.tsx +3 -0
  161. package/src/ProfileFlameGraph/FlameGraphArrow/ZoomControls.tsx +3 -0
  162. package/src/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.ts +3 -0
  163. package/src/ProfileSelector/index.tsx +30 -7
  164. package/src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx +3 -0
  165. package/src/ProfileView/components/VisualizationContainer/index.tsx +3 -0
  166. package/src/Table/hooks/useTableConfiguration.tsx +7 -13
  167. package/src/useDelayedLoader.ts +10 -10
  168. package/src/useSumBy.ts +12 -18
  169. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.test.js +0 -541
  170. package/dist/hooks/useQueryState.test.js +0 -984
@@ -1,4 +1,21 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ import { c as _c } from "react-compiler-runtime"; // Copyright 2022 The Parca Authors
8
+ // Licensed under the Apache License, Version 2.0 (the "License");
9
+ // you may not use this file except in compliance with the License.
10
+ // You may obtain a copy of the License at
11
+ //
12
+ // http://www.apache.org/licenses/LICENSE-2.0
13
+ //
14
+ // Unless required by applicable law or agreed to in writing, software
15
+ // distributed under the License is distributed on an "AS IS" BASIS,
16
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ // See the License for the specific language governing permissions and
18
+ // limitations under the License.
2
19
  import { Icon } from '@iconify/react';
3
20
  import { Button, useParcaContext } from '@parca/components';
4
21
  import { TEST_IDS, testId } from '@parca/test-utils';
@@ -10,30 +27,433 @@ import ShareButton from '../ShareButton';
10
27
  import ViewSelector from '../ViewSelector';
11
28
  import MultiLevelDropdown from './MultiLevelDropdown';
12
29
  import TableColumnsDropdown from './TableColumnsDropdown';
13
- export const TableToolbar = ({ profileType, total, filtered }) => {
14
- return (_jsx(_Fragment, { children: _jsx("div", { className: "flex w-full gap-2 items-end", children: _jsx(TableColumnsDropdown, { profileType: profileType, total: total, filtered: filtered }) }) }));
30
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
31
+ export var TableToolbar = function TableToolbar(t0) {
32
+ var $ = _c(4);
33
+ var profileType = t0.profileType,
34
+ total = t0.total,
35
+ filtered = t0.filtered;
36
+ var t1;
37
+ if ($[0] !== filtered || $[1] !== profileType || $[2] !== total) {
38
+ t1 = /*#__PURE__*/_jsx(_Fragment, {
39
+ children: /*#__PURE__*/_jsx("div", {
40
+ className: "flex w-full gap-2 items-end",
41
+ children: /*#__PURE__*/_jsx(TableColumnsDropdown, {
42
+ profileType: profileType,
43
+ total: total,
44
+ filtered: filtered
45
+ })
46
+ })
47
+ });
48
+ $[0] = filtered;
49
+ $[1] = profileType;
50
+ $[2] = total;
51
+ $[3] = t1;
52
+ } else {
53
+ t1 = $[3];
54
+ }
55
+ return t1;
56
+ };
57
+ export var FlameGraphToolbar = function FlameGraphToolbar(t0) {
58
+ var $ = _c(7);
59
+ var curPath = t0.curPath,
60
+ setNewCurPath = t0.setNewCurPath;
61
+ var t1;
62
+ if ($[0] !== setNewCurPath) {
63
+ t1 = function t1() {
64
+ return setNewCurPath([]);
65
+ };
66
+ $[0] = setNewCurPath;
67
+ $[1] = t1;
68
+ } else {
69
+ t1 = $[1];
70
+ }
71
+ var t2 = curPath.length === 0;
72
+ var t3;
73
+ if ($[2] === Symbol["for"]("react.memo_cache_sentinel")) {
74
+ t3 = testId(TEST_IDS.FLAMEGRAPH_RESET_BUTTON);
75
+ $[2] = t3;
76
+ } else {
77
+ t3 = $[2];
78
+ }
79
+ var t4;
80
+ if ($[3] === Symbol["for"]("react.memo_cache_sentinel")) {
81
+ t4 = /*#__PURE__*/_jsx(Icon, {
82
+ icon: "system-uicons:reset",
83
+ width: 20
84
+ });
85
+ $[3] = t4;
86
+ } else {
87
+ t4 = $[3];
88
+ }
89
+ var t5;
90
+ if ($[4] !== t1 || $[5] !== t2) {
91
+ t5 = /*#__PURE__*/_jsx(_Fragment, {
92
+ children: /*#__PURE__*/_jsx("div", {
93
+ className: "flex w-full gap-2 items-end",
94
+ children: /*#__PURE__*/_jsxs(Button, _objectSpread(_objectSpread({
95
+ variant: "neutral",
96
+ className: "gap-2 w-max h-fit",
97
+ onClick: t1,
98
+ disabled: t2,
99
+ id: "h-reset-graph"
100
+ }, t3), {}, {
101
+ children: ["Reset graph", t4]
102
+ }))
103
+ })
104
+ });
105
+ $[4] = t1;
106
+ $[5] = t2;
107
+ $[6] = t5;
108
+ } else {
109
+ t5 = $[6];
110
+ }
111
+ return t5;
15
112
  };
16
- export const FlameGraphToolbar = ({ curPath, setNewCurPath }) => {
17
- return (_jsx(_Fragment, { children: _jsx("div", { className: "flex w-full gap-2 items-end", children: _jsxs(Button, { variant: "neutral", className: "gap-2 w-max h-fit", onClick: () => setNewCurPath([]), disabled: curPath.length === 0, id: "h-reset-graph", ...testId(TEST_IDS.FLAMEGRAPH_RESET_BUTTON), children: ["Reset graph", _jsx(Icon, { icon: "system-uicons:reset", width: 20 })] }) }) }));
113
+ export var SandwichFlameGraphToolbar = function SandwichFlameGraphToolbar(t0) {
114
+ var $ = _c(5);
115
+ var resetSandwichFunctionName = t0.resetSandwichFunctionName,
116
+ sandwichFunctionName = t0.sandwichFunctionName;
117
+ var t1;
118
+ if ($[0] !== resetSandwichFunctionName) {
119
+ t1 = function t1() {
120
+ return resetSandwichFunctionName();
121
+ };
122
+ $[0] = resetSandwichFunctionName;
123
+ $[1] = t1;
124
+ } else {
125
+ t1 = $[1];
126
+ }
127
+ var t2 = sandwichFunctionName === undefined || sandwichFunctionName.length === 0;
128
+ var t3;
129
+ if ($[2] !== t1 || $[3] !== t2) {
130
+ t3 = /*#__PURE__*/_jsx(_Fragment, {
131
+ children: /*#__PURE__*/_jsx("div", {
132
+ className: "flex w-full gap-2 items-end justify-between",
133
+ children: /*#__PURE__*/_jsx(Button, {
134
+ color: "neutral",
135
+ onClick: t1,
136
+ className: "w-auto",
137
+ variant: "neutral",
138
+ disabled: t2,
139
+ children: "Reset view"
140
+ })
141
+ })
142
+ });
143
+ $[2] = t1;
144
+ $[3] = t2;
145
+ $[4] = t3;
146
+ } else {
147
+ t3 = $[4];
148
+ }
149
+ return t3;
18
150
  };
19
- export const SandwichFlameGraphToolbar = ({ resetSandwichFunctionName, sandwichFunctionName, }) => {
20
- return (_jsx(_Fragment, { children: _jsx("div", { className: "flex w-full gap-2 items-end justify-between", children: _jsx(Button, { color: "neutral", onClick: () => resetSandwichFunctionName(), className: "w-auto", variant: "neutral", disabled: sandwichFunctionName === undefined || sandwichFunctionName.length === 0, children: "Reset view" }) }) }));
151
+ var Divider = function Divider() {
152
+ var $ = _c(1);
153
+ var t0;
154
+ if ($[0] === Symbol["for"]("react.memo_cache_sentinel")) {
155
+ t0 = /*#__PURE__*/_jsx("div", {
156
+ className: "border-t mt-4 border-gray-200 dark:border-gray-700 h-[1px] w-full pb-4"
157
+ });
158
+ $[0] = t0;
159
+ } else {
160
+ t0 = $[0];
161
+ }
162
+ return t0;
21
163
  };
22
- const Divider = () => (_jsx("div", { className: "border-t mt-4 border-gray-200 dark:border-gray-700 h-[1px] w-full pb-4" }));
23
- export const VisualisationToolbar = ({ groupBy, toggleGroupBy, setGroupByLabels, flamechartDimension, setFlamechartDimension, profileType, profileSource, queryClient, onDownloadPProf, pprofdownloading, profileViewExternalSubActions, curPath, setNewCurPath, total, filtered, showVisualizationSelector = true, alignFunctionName, setAlignFunctionName, colorBy, setColorBy, metadata: { labels: groupByLabels, refetch: metadataRefetch, loading: metadataLoading }, }) => {
24
- const { dashboardItems } = useDashboard();
25
- const isTableViz = dashboardItems?.includes('table');
26
- const isTableVizOnly = dashboardItems?.length === 1 && isTableViz;
27
- const isGraphViz = dashboardItems?.includes('flamegraph');
28
- const isGraphVizOnly = dashboardItems?.length === 1 && isGraphViz;
29
- const isFlamechartViz = dashboardItems?.includes('flamechart');
30
- const isFlamechartVizOnly = dashboardItems?.length === 1 && isFlamechartViz;
31
- const { enableFlamechartFiltering } = useParcaContext();
32
- const req = profileSource?.QueryRequest();
164
+ export var VisualisationToolbar = function VisualisationToolbar(t0) {
165
+ var $ = _c(76);
166
+ var groupBy = t0.groupBy,
167
+ toggleGroupBy = t0.toggleGroupBy,
168
+ setGroupByLabels = t0.setGroupByLabels,
169
+ flamechartDimension = t0.flamechartDimension,
170
+ setFlamechartDimension = t0.setFlamechartDimension,
171
+ profileType = t0.profileType,
172
+ profileSource = t0.profileSource,
173
+ queryClient = t0.queryClient,
174
+ onDownloadPProf = t0.onDownloadPProf,
175
+ pprofdownloading = t0.pprofdownloading,
176
+ profileViewExternalSubActions = t0.profileViewExternalSubActions,
177
+ curPath = t0.curPath,
178
+ setNewCurPath = t0.setNewCurPath,
179
+ total = t0.total,
180
+ filtered = t0.filtered,
181
+ t1 = t0.showVisualizationSelector,
182
+ alignFunctionName = t0.alignFunctionName,
183
+ setAlignFunctionName = t0.setAlignFunctionName,
184
+ colorBy = t0.colorBy,
185
+ setColorBy = t0.setColorBy,
186
+ t2 = t0.metadata;
187
+ var showVisualizationSelector = t1 === undefined ? true : t1;
188
+ var groupByLabels = t2.labels,
189
+ metadataRefetch = t2.refetch,
190
+ metadataLoading = t2.loading;
191
+ var _useDashboard = useDashboard(),
192
+ dashboardItems = _useDashboard.dashboardItems;
193
+ var t3;
194
+ if ($[0] !== dashboardItems) {
195
+ t3 = dashboardItems === null || dashboardItems === void 0 ? void 0 : dashboardItems.includes("table");
196
+ $[0] = dashboardItems;
197
+ $[1] = t3;
198
+ } else {
199
+ t3 = $[1];
200
+ }
201
+ var isTableViz = t3;
202
+ var isTableVizOnly = (dashboardItems === null || dashboardItems === void 0 ? void 0 : dashboardItems.length) === 1 && isTableViz;
203
+ var t4;
204
+ if ($[2] !== dashboardItems) {
205
+ t4 = dashboardItems === null || dashboardItems === void 0 ? void 0 : dashboardItems.includes("flamegraph");
206
+ $[2] = dashboardItems;
207
+ $[3] = t4;
208
+ } else {
209
+ t4 = $[3];
210
+ }
211
+ var isGraphViz = t4;
212
+ var isGraphVizOnly = (dashboardItems === null || dashboardItems === void 0 ? void 0 : dashboardItems.length) === 1 && isGraphViz;
213
+ var t5;
214
+ if ($[4] !== dashboardItems) {
215
+ t5 = dashboardItems === null || dashboardItems === void 0 ? void 0 : dashboardItems.includes("flamechart");
216
+ $[4] = dashboardItems;
217
+ $[5] = t5;
218
+ } else {
219
+ t5 = $[5];
220
+ }
221
+ var isFlamechartViz = t5;
222
+ var isFlamechartVizOnly = (dashboardItems === null || dashboardItems === void 0 ? void 0 : dashboardItems.length) === 1 && isFlamechartViz;
223
+ var _useParcaContext = useParcaContext(),
224
+ enableFlamechartFiltering = _useParcaContext.enableFlamechartFiltering;
225
+ var req;
226
+ if ($[6] !== groupBy || $[7] !== profileSource) {
227
+ req = profileSource === null || profileSource === void 0 ? void 0 : profileSource.QueryRequest();
33
228
  if (req !== null && req !== undefined) {
34
- req.groupBy = {
35
- fields: groupBy ?? [],
229
+ var _t;
230
+ if ($[9] !== groupBy) {
231
+ _t = groupBy !== null && groupBy !== void 0 ? groupBy : [];
232
+ $[9] = groupBy;
233
+ $[10] = _t;
234
+ } else {
235
+ _t = $[10];
236
+ }
237
+ var _t2;
238
+ if ($[11] !== _t) {
239
+ _t2 = {
240
+ fields: _t
36
241
  };
242
+ $[11] = _t;
243
+ $[12] = _t2;
244
+ } else {
245
+ _t2 = $[12];
246
+ }
247
+ req.groupBy = _t2;
37
248
  }
38
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex w-full justify-between items-start gap-2", children: [_jsxs("div", { className: "flex gap-2 items-start", children: [isGraphViz && (_jsxs(_Fragment, { children: [_jsx(GroupByDropdown, { groupBy: groupBy, labels: groupByLabels, setGroupByLabels: setGroupByLabels, metadataRefetch: metadataRefetch, metadataLoading: metadataLoading }), _jsx(InvertCallStack, {})] })), isFlamechartViz && (_jsx(GroupByDropdown, { groupBy: flamechartDimension, labels: groupByLabels, setGroupByLabels: setFlamechartDimension, metadataRefetch: metadataRefetch, metadataLoading: metadataLoading, label: "Samples group by" })), _jsxs("div", { className: "flex mt-5", children: [(!isFlamechartVizOnly || enableFlamechartFiltering === true) && _jsx(ProfileFilters, {}), profileViewExternalSubActions != null ? profileViewExternalSubActions : null] })] }), _jsxs("div", { className: "flex gap-2 mt-5", children: [_jsx(MultiLevelDropdown, { groupBy: groupBy, toggleGroupBy: toggleGroupBy, profileType: profileType, onSelect: () => { }, isTableVizOnly: isTableVizOnly, alignFunctionName: alignFunctionName, setAlignFunctionName: setAlignFunctionName, colorBy: colorBy, setColorBy: setColorBy }), _jsx(ShareButton, { profileSource: profileSource, queryClient: queryClient, queryRequest: req, onDownloadPProf: onDownloadPProf, pprofdownloading: pprofdownloading ?? false, profileViewExternalSubActions: profileViewExternalSubActions }), showVisualizationSelector ? _jsx(ViewSelector, { profileSource: profileSource }) : null] })] }), isGraphVizOnly && (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsx(FlameGraphToolbar, { curPath: curPath, setNewCurPath: setNewCurPath })] })), isTableVizOnly && (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsx(TableToolbar, { profileType: profileType, total: total, filtered: filtered })] }))] }));
249
+ $[6] = groupBy;
250
+ $[7] = profileSource;
251
+ $[8] = req;
252
+ } else {
253
+ req = $[8];
254
+ }
255
+ var t6;
256
+ if ($[13] !== groupBy || $[14] !== groupByLabels || $[15] !== isGraphViz || $[16] !== metadataLoading || $[17] !== metadataRefetch || $[18] !== setGroupByLabels) {
257
+ t6 = isGraphViz && /*#__PURE__*/_jsxs(_Fragment, {
258
+ children: [/*#__PURE__*/_jsx(GroupByDropdown, {
259
+ groupBy: groupBy,
260
+ labels: groupByLabels,
261
+ setGroupByLabels: setGroupByLabels,
262
+ metadataRefetch: metadataRefetch,
263
+ metadataLoading: metadataLoading
264
+ }), /*#__PURE__*/_jsx(InvertCallStack, {})]
265
+ });
266
+ $[13] = groupBy;
267
+ $[14] = groupByLabels;
268
+ $[15] = isGraphViz;
269
+ $[16] = metadataLoading;
270
+ $[17] = metadataRefetch;
271
+ $[18] = setGroupByLabels;
272
+ $[19] = t6;
273
+ } else {
274
+ t6 = $[19];
275
+ }
276
+ var t7;
277
+ if ($[20] !== flamechartDimension || $[21] !== groupByLabels || $[22] !== isFlamechartViz || $[23] !== metadataLoading || $[24] !== metadataRefetch || $[25] !== setFlamechartDimension) {
278
+ t7 = isFlamechartViz && /*#__PURE__*/_jsx(GroupByDropdown, {
279
+ groupBy: flamechartDimension,
280
+ labels: groupByLabels,
281
+ setGroupByLabels: setFlamechartDimension,
282
+ metadataRefetch: metadataRefetch,
283
+ metadataLoading: metadataLoading,
284
+ label: "Samples group by"
285
+ });
286
+ $[20] = flamechartDimension;
287
+ $[21] = groupByLabels;
288
+ $[22] = isFlamechartViz;
289
+ $[23] = metadataLoading;
290
+ $[24] = metadataRefetch;
291
+ $[25] = setFlamechartDimension;
292
+ $[26] = t7;
293
+ } else {
294
+ t7 = $[26];
295
+ }
296
+ var t8;
297
+ if ($[27] !== enableFlamechartFiltering || $[28] !== isFlamechartVizOnly) {
298
+ t8 = (!isFlamechartVizOnly || enableFlamechartFiltering === true) && /*#__PURE__*/_jsx(ProfileFilters, {});
299
+ $[27] = enableFlamechartFiltering;
300
+ $[28] = isFlamechartVizOnly;
301
+ $[29] = t8;
302
+ } else {
303
+ t8 = $[29];
304
+ }
305
+ var t9 = profileViewExternalSubActions != null ? profileViewExternalSubActions : null;
306
+ var t10;
307
+ if ($[30] !== t8 || $[31] !== t9) {
308
+ t10 = /*#__PURE__*/_jsxs("div", {
309
+ className: "flex mt-5",
310
+ children: [t8, t9]
311
+ });
312
+ $[30] = t8;
313
+ $[31] = t9;
314
+ $[32] = t10;
315
+ } else {
316
+ t10 = $[32];
317
+ }
318
+ var t11;
319
+ if ($[33] !== t10 || $[34] !== t6 || $[35] !== t7) {
320
+ t11 = /*#__PURE__*/_jsxs("div", {
321
+ className: "flex gap-2 items-start",
322
+ children: [t6, t7, t10]
323
+ });
324
+ $[33] = t10;
325
+ $[34] = t6;
326
+ $[35] = t7;
327
+ $[36] = t11;
328
+ } else {
329
+ t11 = $[36];
330
+ }
331
+ var t12;
332
+ if ($[37] !== alignFunctionName || $[38] !== colorBy || $[39] !== groupBy || $[40] !== isTableVizOnly || $[41] !== profileType || $[42] !== setAlignFunctionName || $[43] !== setColorBy || $[44] !== toggleGroupBy) {
333
+ t12 = /*#__PURE__*/_jsx(MultiLevelDropdown, {
334
+ groupBy: groupBy,
335
+ toggleGroupBy: toggleGroupBy,
336
+ profileType: profileType,
337
+ onSelect: _temp,
338
+ isTableVizOnly: isTableVizOnly,
339
+ alignFunctionName: alignFunctionName,
340
+ setAlignFunctionName: setAlignFunctionName,
341
+ colorBy: colorBy,
342
+ setColorBy: setColorBy
343
+ });
344
+ $[37] = alignFunctionName;
345
+ $[38] = colorBy;
346
+ $[39] = groupBy;
347
+ $[40] = isTableVizOnly;
348
+ $[41] = profileType;
349
+ $[42] = setAlignFunctionName;
350
+ $[43] = setColorBy;
351
+ $[44] = toggleGroupBy;
352
+ $[45] = t12;
353
+ } else {
354
+ t12 = $[45];
355
+ }
356
+ var t13 = pprofdownloading !== null && pprofdownloading !== void 0 ? pprofdownloading : false;
357
+ var t14;
358
+ if ($[46] !== onDownloadPProf || $[47] !== profileSource || $[48] !== profileViewExternalSubActions || $[49] !== queryClient || $[50] !== req || $[51] !== t13) {
359
+ t14 = /*#__PURE__*/_jsx(ShareButton, {
360
+ profileSource: profileSource,
361
+ queryClient: queryClient,
362
+ queryRequest: req,
363
+ onDownloadPProf: onDownloadPProf,
364
+ pprofdownloading: t13,
365
+ profileViewExternalSubActions: profileViewExternalSubActions
366
+ });
367
+ $[46] = onDownloadPProf;
368
+ $[47] = profileSource;
369
+ $[48] = profileViewExternalSubActions;
370
+ $[49] = queryClient;
371
+ $[50] = req;
372
+ $[51] = t13;
373
+ $[52] = t14;
374
+ } else {
375
+ t14 = $[52];
376
+ }
377
+ var t15;
378
+ if ($[53] !== profileSource || $[54] !== showVisualizationSelector) {
379
+ t15 = showVisualizationSelector ? /*#__PURE__*/_jsx(ViewSelector, {
380
+ profileSource: profileSource
381
+ }) : null;
382
+ $[53] = profileSource;
383
+ $[54] = showVisualizationSelector;
384
+ $[55] = t15;
385
+ } else {
386
+ t15 = $[55];
387
+ }
388
+ var t16;
389
+ if ($[56] !== t12 || $[57] !== t14 || $[58] !== t15) {
390
+ t16 = /*#__PURE__*/_jsxs("div", {
391
+ className: "flex gap-2 mt-5",
392
+ children: [t12, t14, t15]
393
+ });
394
+ $[56] = t12;
395
+ $[57] = t14;
396
+ $[58] = t15;
397
+ $[59] = t16;
398
+ } else {
399
+ t16 = $[59];
400
+ }
401
+ var t17;
402
+ if ($[60] !== t11 || $[61] !== t16) {
403
+ t17 = /*#__PURE__*/_jsxs("div", {
404
+ className: "flex w-full justify-between items-start gap-2",
405
+ children: [t11, t16]
406
+ });
407
+ $[60] = t11;
408
+ $[61] = t16;
409
+ $[62] = t17;
410
+ } else {
411
+ t17 = $[62];
412
+ }
413
+ var t18;
414
+ if ($[63] !== curPath || $[64] !== isGraphVizOnly || $[65] !== setNewCurPath) {
415
+ t18 = isGraphVizOnly && /*#__PURE__*/_jsxs(_Fragment, {
416
+ children: [/*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx(FlameGraphToolbar, {
417
+ curPath: curPath,
418
+ setNewCurPath: setNewCurPath
419
+ })]
420
+ });
421
+ $[63] = curPath;
422
+ $[64] = isGraphVizOnly;
423
+ $[65] = setNewCurPath;
424
+ $[66] = t18;
425
+ } else {
426
+ t18 = $[66];
427
+ }
428
+ var t19;
429
+ if ($[67] !== filtered || $[68] !== isTableVizOnly || $[69] !== profileType || $[70] !== total) {
430
+ t19 = isTableVizOnly && /*#__PURE__*/_jsxs(_Fragment, {
431
+ children: [/*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx(TableToolbar, {
432
+ profileType: profileType,
433
+ total: total,
434
+ filtered: filtered
435
+ })]
436
+ });
437
+ $[67] = filtered;
438
+ $[68] = isTableVizOnly;
439
+ $[69] = profileType;
440
+ $[70] = total;
441
+ $[71] = t19;
442
+ } else {
443
+ t19 = $[71];
444
+ }
445
+ var t20;
446
+ if ($[72] !== t17 || $[73] !== t18 || $[74] !== t19) {
447
+ t20 = /*#__PURE__*/_jsxs(_Fragment, {
448
+ children: [t17, t18, t19]
449
+ });
450
+ $[72] = t17;
451
+ $[73] = t18;
452
+ $[74] = t19;
453
+ $[75] = t20;
454
+ } else {
455
+ t20 = $[75];
456
+ }
457
+ return t20;
39
458
  };
459
+ function _temp() {}