@parca/profile 0.19.140 → 0.19.143

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 (182) hide show
  1. package/CHANGELOG.md +9 -1
  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 +94 -68
  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.d.ts.map +1 -1
  28. package/dist/ProfileExplorer/ProfileExplorerCompare.js +240 -45
  29. package/dist/ProfileExplorer/ProfileExplorerSingle.js +98 -11
  30. package/dist/ProfileExplorer/index.js +183 -32
  31. package/dist/ProfileFlameChart/SamplesStrips/SamplesGraph/index.js +333 -148
  32. package/dist/ProfileFlameChart/SamplesStrips/SamplesStrips.stories.js +69 -35
  33. package/dist/ProfileFlameChart/SamplesStrips/index.js +645 -134
  34. package/dist/ProfileFlameChart/SamplesStrips/labelSetUtils.js +114 -55
  35. package/dist/ProfileFlameChart/index.js +260 -126
  36. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.js +283 -85
  37. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenuWrapper.js +56 -20
  38. package/dist/ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.js +211 -140
  39. package/dist/ProfileFlameGraph/FlameGraphArrow/MemoizedTooltip.js +133 -38
  40. package/dist/ProfileFlameGraph/FlameGraphArrow/MiniMap.js +261 -216
  41. package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.d.ts.map +1 -1
  42. package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.js +71 -45
  43. package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.d.ts.map +1 -1
  44. package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.js +58 -28
  45. package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.d.ts.map +1 -1
  46. package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.js +59 -8
  47. package/dist/ProfileFlameGraph/FlameGraphArrow/index.js +396 -179
  48. package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.d.ts.map +1 -1
  49. package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.js +68 -50
  50. package/dist/ProfileFlameGraph/FlameGraphArrow/useMappingList.js +62 -38
  51. package/dist/ProfileFlameGraph/FlameGraphArrow/useNodeColor.js +14 -6
  52. package/dist/ProfileFlameGraph/FlameGraphArrow/useScrollViewport.js +124 -82
  53. package/dist/ProfileFlameGraph/FlameGraphArrow/useVisibleNodes.js +160 -98
  54. package/dist/ProfileFlameGraph/FlameGraphArrow/useZoom.js +232 -112
  55. package/dist/ProfileFlameGraph/FlameGraphArrow/utils.js +137 -114
  56. package/dist/ProfileFlameGraph/benchmarks/benchdata/populateData.js +85 -0
  57. package/dist/ProfileFlameGraph/index.js +322 -147
  58. package/dist/ProfileMetricsGraph/hooks/useQueryRange.js +140 -32
  59. package/dist/ProfileMetricsGraph/index.js +515 -256
  60. package/dist/ProfileSelector/CompareButton.js +132 -12
  61. package/dist/ProfileSelector/MetricsGraphSection.js +228 -63
  62. package/dist/ProfileSelector/index.d.ts +1 -1
  63. package/dist/ProfileSelector/index.d.ts.map +1 -1
  64. package/dist/ProfileSelector/index.js +734 -142
  65. package/dist/ProfileSelector/useAutoQuerySelector.d.ts +1 -3
  66. package/dist/ProfileSelector/useAutoQuerySelector.d.ts.map +1 -1
  67. package/dist/ProfileSelector/useAutoQuerySelector.js +280 -132
  68. package/dist/ProfileSource.js +230 -163
  69. package/dist/ProfileTypeSelector/index.js +214 -125
  70. package/dist/ProfileView/components/ActionButtons/GroupByDropdown.js +50 -4
  71. package/dist/ProfileView/components/ActionButtons/SortByDropdown.js +137 -32
  72. package/dist/ProfileView/components/ColorStackLegend.js +182 -54
  73. package/dist/ProfileView/components/DashboardItems/index.js +87 -28
  74. package/dist/ProfileView/components/DashboardLayout/index.js +108 -16
  75. package/dist/ProfileView/components/DiffLegend.js +172 -29
  76. package/dist/ProfileView/components/GroupByLabelsDropdown/index.js +199 -55
  77. package/dist/ProfileView/components/InvertCallStack/index.js +97 -9
  78. package/dist/ProfileView/components/ProfileFilters/filterPresets.js +260 -315
  79. package/dist/ProfileView/components/ProfileFilters/index.js +518 -215
  80. package/dist/ProfileView/components/ProfileFilters/useProfileFilters.js +370 -306
  81. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.js +191 -118
  82. package/dist/ProfileView/components/ProfileHeader/index.js +105 -11
  83. package/dist/ProfileView/components/ShareButton/ResultBox.js +119 -16
  84. package/dist/ProfileView/components/ShareButton/index.js +352 -62
  85. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.d.ts.map +1 -1
  86. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.js +664 -192
  87. package/dist/ProfileView/components/Toolbars/SwitchMenuItem.js +94 -7
  88. package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.js +196 -155
  89. package/dist/ProfileView/components/Toolbars/index.js +441 -21
  90. package/dist/ProfileView/components/ViewSelector/Dropdown.js +233 -22
  91. package/dist/ProfileView/components/ViewSelector/index.js +186 -82
  92. package/dist/ProfileView/components/VisualizationContainer/index.d.ts.map +1 -1
  93. package/dist/ProfileView/components/VisualizationContainer/index.js +52 -7
  94. package/dist/ProfileView/components/VisualizationPanel.js +185 -8
  95. package/dist/ProfileView/context/DashboardContext.js +74 -26
  96. package/dist/ProfileView/context/ProfileViewContext.js +56 -15
  97. package/dist/ProfileView/hooks/useAutoSelectDimension.js +71 -41
  98. package/dist/ProfileView/hooks/useProfileMetadata.js +50 -18
  99. package/dist/ProfileView/hooks/useResetFlameGraphState.js +31 -10
  100. package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.js +71 -27
  101. package/dist/ProfileView/hooks/useResetStateOnSeriesChange.js +53 -17
  102. package/dist/ProfileView/hooks/useVisualizationState.js +229 -69
  103. package/dist/ProfileView/index.js +383 -45
  104. package/dist/ProfileView/types/visualization.js +1 -13
  105. package/dist/ProfileView/utils/colorUtils.js +8 -7
  106. package/dist/ProfileViewWithData.js +319 -225
  107. package/dist/QueryControls/index.js +418 -47
  108. package/dist/Sandwich/components/CalleesSection.js +54 -4
  109. package/dist/Sandwich/components/CallersSection.js +97 -27
  110. package/dist/Sandwich/components/TableSection.js +77 -4
  111. package/dist/Sandwich/index.js +125 -12
  112. package/dist/Sandwich/utils/processRowData.js +48 -39
  113. package/dist/SelectWithRefresh/index.js +102 -28
  114. package/dist/SimpleMatchers/Select.js +520 -187
  115. package/dist/SimpleMatchers/index.js +590 -288
  116. package/dist/SourceView/Highlighter.js +230 -70
  117. package/dist/SourceView/LineNo.js +72 -17
  118. package/dist/SourceView/index.js +177 -101
  119. package/dist/SourceView/lang-detector/ext-to-lang.json +798 -798
  120. package/dist/SourceView/lang-detector/index.js +28 -14
  121. package/dist/SourceView/useSelectedLineRange.js +72 -20
  122. package/dist/Table/ColorCell.js +42 -1
  123. package/dist/Table/ColumnsVisibility.js +114 -6
  124. package/dist/Table/MoreDropdown.js +107 -21
  125. package/dist/Table/TableContextMenu.js +144 -134
  126. package/dist/Table/TableContextMenuWrapper.js +59 -14
  127. package/dist/Table/hooks/useColorManagement.js +58 -16
  128. package/dist/Table/hooks/useTableConfiguration.d.ts.map +1 -1
  129. package/dist/Table/hooks/useTableConfiguration.js +323 -167
  130. package/dist/Table/index.js +217 -123
  131. package/dist/Table/utils/functions.js +169 -144
  132. package/dist/Table/utils/topAndBottomExpandedRowModel.js +69 -52
  133. package/dist/TimelineGuide/index.js +209 -16
  134. package/dist/TopTable/benchmarks/benchdata/populateData.js +91 -0
  135. package/dist/TopTable/index.js +325 -121
  136. package/dist/contexts/LabelsQueryProvider.js +94 -32
  137. package/dist/contexts/UnifiedLabelsContext.js +114 -49
  138. package/dist/contexts/utils.js +37 -15
  139. package/dist/hooks/urlParsers.js +27 -15
  140. package/dist/hooks/useColorBy.js +47 -10
  141. package/dist/hooks/useCompareModeMeta.js +112 -62
  142. package/dist/hooks/useDashboardItems.js +52 -11
  143. package/dist/hooks/useLabels.js +295 -52
  144. package/dist/hooks/useQueryState.d.ts +1 -1
  145. package/dist/hooks/useQueryState.d.ts.map +1 -1
  146. package/dist/hooks/useQueryState.js +375 -329
  147. package/dist/index.js +11 -6
  148. package/dist/testdata/fg-diff.json +3750 -0
  149. package/dist/testdata/fg-simple.json +1879 -0
  150. package/dist/testdata/link_data.json +56 -0
  151. package/dist/testdata/tabular.json +30 -0
  152. package/dist/testdata/test_flamegraph.json +26846 -0
  153. package/dist/testdata/test_graph.json +53 -0
  154. package/dist/useDelayedLoader.js +32 -18
  155. package/dist/useGrpcQuery/index.js +71 -11
  156. package/dist/useHasProfileData.js +90 -12
  157. package/dist/useQuery.js +205 -64
  158. package/dist/useSumBy.d.ts.map +1 -1
  159. package/dist/useSumBy.js +294 -138
  160. package/dist/utils.js +62 -30
  161. package/package.json +9 -9
  162. package/src/GraphTooltipArrow/index.tsx +3 -0
  163. package/src/MatchersInput/SuggestionsList.test.tsx +70 -0
  164. package/src/MatchersInput/SuggestionsList.tsx +11 -10
  165. package/src/MatchersInput/index.tsx +1 -1
  166. package/src/MetricsGraph/MetricsTooltip/index.tsx +22 -34
  167. package/src/PreSelectedMatchers/index.tsx +3 -0
  168. package/src/ProfileExplorer/ProfileExplorerCompare.tsx +9 -2
  169. package/src/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.tsx +3 -0
  170. package/src/ProfileFlameGraph/FlameGraphArrow/TooltipContext.tsx +3 -0
  171. package/src/ProfileFlameGraph/FlameGraphArrow/ZoomControls.tsx +3 -0
  172. package/src/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.ts +3 -0
  173. package/src/ProfileSelector/index.tsx +31 -9
  174. package/src/ProfileSelector/useAutoQuerySelector.ts +64 -42
  175. package/src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx +3 -0
  176. package/src/ProfileView/components/VisualizationContainer/index.tsx +3 -0
  177. package/src/Table/hooks/useTableConfiguration.tsx +7 -13
  178. package/src/hooks/useQueryState.ts +18 -3
  179. package/src/useDelayedLoader.ts +10 -10
  180. package/src/useSumBy.ts +12 -18
  181. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.test.js +0 -455
  182. package/dist/hooks/useQueryState.test.js +0 -868
@@ -1,4 +1,16 @@
1
- import { Fragment as _Fragment, jsx as _jsx, 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
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
8
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
10
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
11
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
12
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13
+ import { c as _c } from "react-compiler-runtime";
2
14
  // Copyright 2022 The Parca Authors
3
15
  // Licensed under the Apache License, Version 2.0 (the "License");
4
16
  // you may not use this file except in compliance with the License.
@@ -11,6 +23,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
11
23
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
24
  // See the License for the specific language governing permissions and
13
25
  // limitations under the License.
26
+
14
27
  import { useCallback } from 'react';
15
28
  import { Icon } from '@iconify/react';
16
29
  import cx from 'classnames';
@@ -19,221 +32,511 @@ import { TEST_IDS, testId } from '@parca/test-utils';
19
32
  import { useProfileViewContext } from '../../context/ProfileViewContext';
20
33
  import { getPresetByKey, getPresetsForProfileType, isPresetKey } from './filterPresets';
21
34
  import { useProfileFilters } from './useProfileFilters';
22
- export const isFilterComplete = (filter) => {
23
- // For preset filters, only need type and value
24
- if (filter.type != null && isPresetKey(filter.type)) {
25
- return filter.value !== '' && filter.type != null;
35
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
36
+ export var isFilterComplete = function isFilterComplete(filter) {
37
+ // For preset filters, only need type and value
38
+ if (filter.type != null && isPresetKey(filter.type)) {
39
+ return filter.value !== '' && filter.type != null;
40
+ }
41
+ // For regular filters, need all fields
42
+ return filter.value !== '' && filter.type != null && filter.field != null && filter.matchType != null;
43
+ };
44
+ var getFilterTypeItems = function getFilterTypeItems(currentProfileType) {
45
+ return [{
46
+ key: 'stack',
47
+ element: {
48
+ active: /*#__PURE__*/_jsx(_Fragment, {
49
+ children: "Stack Filter"
50
+ }),
51
+ expanded: /*#__PURE__*/_jsxs(_Fragment, {
52
+ children: [/*#__PURE__*/_jsx("span", {
53
+ children: "Stack Filter"
54
+ }), /*#__PURE__*/_jsx("br", {}), /*#__PURE__*/_jsx("span", {
55
+ className: "text-xs",
56
+ children: "Filters entire call stacks"
57
+ })]
58
+ })
26
59
  }
27
- // For regular filters, need all fields
28
- return (filter.value !== '' && filter.type != null && filter.field != null && filter.matchType != null);
60
+ }, {
61
+ key: 'frame',
62
+ element: {
63
+ active: /*#__PURE__*/_jsx(_Fragment, {
64
+ children: "Frame Filter"
65
+ }),
66
+ expanded: /*#__PURE__*/_jsxs(_Fragment, {
67
+ children: [/*#__PURE__*/_jsx("span", {
68
+ children: "Frame Filter"
69
+ }), /*#__PURE__*/_jsx("br", {}), /*#__PURE__*/_jsx("span", {
70
+ className: "text-xs",
71
+ children: "Filters individual frames"
72
+ })]
73
+ })
74
+ }
75
+ }].concat(_toConsumableArray(getPresetsForProfileType(currentProfileType).map(function (preset) {
76
+ return {
77
+ key: preset.key,
78
+ element: {
79
+ active: /*#__PURE__*/_jsx(_Fragment, {
80
+ children: preset.name
81
+ }),
82
+ expanded: /*#__PURE__*/_jsxs(_Fragment, {
83
+ children: [/*#__PURE__*/_jsx("span", {
84
+ children: preset.name
85
+ }), /*#__PURE__*/_jsx("br", {}), /*#__PURE__*/_jsx("span", {
86
+ className: "text-xs",
87
+ children: preset.description
88
+ })]
89
+ })
90
+ }
91
+ };
92
+ })));
29
93
  };
30
- const getFilterTypeItems = (currentProfileType) => [
31
- {
32
- key: 'stack',
33
- element: {
34
- active: _jsx(_Fragment, { children: "Stack Filter" }),
35
- expanded: (_jsxs(_Fragment, { children: [_jsx("span", { children: "Stack Filter" }), _jsx("br", {}), _jsx("span", { className: "text-xs", children: "Filters entire call stacks" })] })),
36
- },
37
- },
38
- {
39
- key: 'frame',
40
- element: {
41
- active: _jsx(_Fragment, { children: "Frame Filter" }),
42
- expanded: (_jsxs(_Fragment, { children: [_jsx("span", { children: "Frame Filter" }), _jsx("br", {}), _jsx("span", { className: "text-xs", children: "Filters individual frames" })] })),
43
- },
44
- },
45
- ...getPresetsForProfileType(currentProfileType).map(preset => ({
46
- key: preset.key,
47
- element: {
48
- active: _jsx(_Fragment, { children: preset.name }),
49
- expanded: (_jsxs(_Fragment, { children: [_jsx("span", { children: preset.name }), _jsx("br", {}), _jsx("span", { className: "text-xs", children: preset.description })] })),
50
- },
51
- })),
52
- ];
53
- const fieldItems = [
54
- {
55
- key: 'function_name',
56
- element: {
57
- active: _jsx(_Fragment, { children: "Function" }),
58
- expanded: _jsx(_Fragment, { children: "Function Name" }),
59
- },
60
- },
61
- {
62
- key: 'binary',
63
- element: {
64
- active: _jsx(_Fragment, { children: "Binary" }),
65
- expanded: _jsx(_Fragment, { children: "Binary/Executable Name" }),
66
- },
67
- },
68
- {
69
- key: 'system_name',
70
- element: {
71
- active: _jsx(_Fragment, { children: "System Name" }),
72
- expanded: _jsx(_Fragment, { children: "System Name" }),
73
- },
74
- },
75
- {
76
- key: 'filename',
77
- element: {
78
- active: _jsx(_Fragment, { children: "Filename" }),
79
- expanded: _jsx(_Fragment, { children: "Source Filename" }),
80
- },
81
- },
82
- {
83
- key: 'address',
84
- element: {
85
- active: _jsx(_Fragment, { children: "Address" }),
86
- expanded: _jsx(_Fragment, { children: "Memory Address" }),
87
- },
88
- },
89
- {
90
- key: 'line_number',
91
- element: {
92
- active: _jsx(_Fragment, { children: "Line Number" }),
93
- expanded: _jsx(_Fragment, { children: "Source Line Number" }),
94
- },
95
- },
96
- ];
97
- const stringMatchTypeItems = [
98
- {
99
- key: 'equal',
100
- element: {
101
- active: _jsx(_Fragment, { children: "Equals" }),
102
- expanded: _jsx(_Fragment, { children: "Equals" }),
103
- },
104
- },
105
- {
106
- key: 'not_equal',
107
- element: {
108
- active: _jsx(_Fragment, { children: "Not Equals" }),
109
- expanded: _jsx(_Fragment, { children: "Not Equals" }),
110
- },
111
- },
112
- {
113
- key: 'contains',
114
- element: {
115
- active: _jsx(_Fragment, { children: "Contains" }),
116
- expanded: _jsx(_Fragment, { children: "Contains" }),
117
- },
118
- },
119
- {
120
- key: 'not_contains',
121
- element: {
122
- active: _jsx(_Fragment, { children: "Not Contains" }),
123
- expanded: _jsx(_Fragment, { children: "Not Contains" }),
124
- },
125
- },
126
- {
127
- key: 'starts_with',
128
- element: {
129
- active: _jsx(_Fragment, { children: "Starts With" }),
130
- expanded: _jsx(_Fragment, { children: "Starts With" }),
131
- },
132
- },
133
- {
134
- key: 'not_starts_with',
135
- element: {
136
- active: _jsx(_Fragment, { children: "Not Starts With" }),
137
- expanded: _jsx(_Fragment, { children: "Not Starts With" }),
138
- },
139
- },
140
- ];
141
- const numberMatchTypeItems = [
142
- {
143
- key: 'equal',
144
- element: {
145
- active: _jsx(_Fragment, { children: "Equals" }),
146
- expanded: _jsx(_Fragment, { children: "Equals" }),
147
- },
148
- },
149
- {
150
- key: 'not_equal',
151
- element: {
152
- active: _jsx(_Fragment, { children: "Not Equals" }),
153
- expanded: _jsx(_Fragment, { children: "Not Equals" }),
154
- },
155
- },
156
- ];
157
- const ProfileFilters = ({ readOnly = false } = {}) => {
158
- const { profileSource } = useProfileViewContext();
159
- const currentProfileType = profileSource?.ProfileType()?.toString();
160
- const filterTypeItems = getFilterTypeItems(currentProfileType);
161
- const { localFilters, appliedFilters, hasUnsavedChanges, onApplyFilters, addFilter, removeFilter, updateFilter, resetFilters, } = useProfileFilters();
162
- const handleKeyDown = useCallback((e) => {
163
- if (e.key === 'Enter') {
164
- e.preventDefault();
165
- if (e.currentTarget.value.trim() === '') {
166
- return;
167
- }
168
- onApplyFilters();
94
+ var fieldItems = [{
95
+ key: 'function_name',
96
+ element: {
97
+ active: /*#__PURE__*/_jsx(_Fragment, {
98
+ children: "Function"
99
+ }),
100
+ expanded: /*#__PURE__*/_jsx(_Fragment, {
101
+ children: "Function Name"
102
+ })
103
+ }
104
+ }, {
105
+ key: 'binary',
106
+ element: {
107
+ active: /*#__PURE__*/_jsx(_Fragment, {
108
+ children: "Binary"
109
+ }),
110
+ expanded: /*#__PURE__*/_jsx(_Fragment, {
111
+ children: "Binary/Executable Name"
112
+ })
113
+ }
114
+ }, {
115
+ key: 'system_name',
116
+ element: {
117
+ active: /*#__PURE__*/_jsx(_Fragment, {
118
+ children: "System Name"
119
+ }),
120
+ expanded: /*#__PURE__*/_jsx(_Fragment, {
121
+ children: "System Name"
122
+ })
123
+ }
124
+ }, {
125
+ key: 'filename',
126
+ element: {
127
+ active: /*#__PURE__*/_jsx(_Fragment, {
128
+ children: "Filename"
129
+ }),
130
+ expanded: /*#__PURE__*/_jsx(_Fragment, {
131
+ children: "Source Filename"
132
+ })
133
+ }
134
+ }, {
135
+ key: 'address',
136
+ element: {
137
+ active: /*#__PURE__*/_jsx(_Fragment, {
138
+ children: "Address"
139
+ }),
140
+ expanded: /*#__PURE__*/_jsx(_Fragment, {
141
+ children: "Memory Address"
142
+ })
143
+ }
144
+ }, {
145
+ key: 'line_number',
146
+ element: {
147
+ active: /*#__PURE__*/_jsx(_Fragment, {
148
+ children: "Line Number"
149
+ }),
150
+ expanded: /*#__PURE__*/_jsx(_Fragment, {
151
+ children: "Source Line Number"
152
+ })
153
+ }
154
+ }];
155
+ var stringMatchTypeItems = [{
156
+ key: 'equal',
157
+ element: {
158
+ active: /*#__PURE__*/_jsx(_Fragment, {
159
+ children: "Equals"
160
+ }),
161
+ expanded: /*#__PURE__*/_jsx(_Fragment, {
162
+ children: "Equals"
163
+ })
164
+ }
165
+ }, {
166
+ key: 'not_equal',
167
+ element: {
168
+ active: /*#__PURE__*/_jsx(_Fragment, {
169
+ children: "Not Equals"
170
+ }),
171
+ expanded: /*#__PURE__*/_jsx(_Fragment, {
172
+ children: "Not Equals"
173
+ })
174
+ }
175
+ }, {
176
+ key: 'contains',
177
+ element: {
178
+ active: /*#__PURE__*/_jsx(_Fragment, {
179
+ children: "Contains"
180
+ }),
181
+ expanded: /*#__PURE__*/_jsx(_Fragment, {
182
+ children: "Contains"
183
+ })
184
+ }
185
+ }, {
186
+ key: 'not_contains',
187
+ element: {
188
+ active: /*#__PURE__*/_jsx(_Fragment, {
189
+ children: "Not Contains"
190
+ }),
191
+ expanded: /*#__PURE__*/_jsx(_Fragment, {
192
+ children: "Not Contains"
193
+ })
194
+ }
195
+ }, {
196
+ key: 'starts_with',
197
+ element: {
198
+ active: /*#__PURE__*/_jsx(_Fragment, {
199
+ children: "Starts With"
200
+ }),
201
+ expanded: /*#__PURE__*/_jsx(_Fragment, {
202
+ children: "Starts With"
203
+ })
204
+ }
205
+ }, {
206
+ key: 'not_starts_with',
207
+ element: {
208
+ active: /*#__PURE__*/_jsx(_Fragment, {
209
+ children: "Not Starts With"
210
+ }),
211
+ expanded: /*#__PURE__*/_jsx(_Fragment, {
212
+ children: "Not Starts With"
213
+ })
214
+ }
215
+ }];
216
+ var numberMatchTypeItems = [{
217
+ key: 'equal',
218
+ element: {
219
+ active: /*#__PURE__*/_jsx(_Fragment, {
220
+ children: "Equals"
221
+ }),
222
+ expanded: /*#__PURE__*/_jsx(_Fragment, {
223
+ children: "Equals"
224
+ })
225
+ }
226
+ }, {
227
+ key: 'not_equal',
228
+ element: {
229
+ active: /*#__PURE__*/_jsx(_Fragment, {
230
+ children: "Not Equals"
231
+ }),
232
+ expanded: /*#__PURE__*/_jsx(_Fragment, {
233
+ children: "Not Equals"
234
+ })
235
+ }
236
+ }];
237
+ var ProfileFilters = function ProfileFilters(t0) {
238
+ var $ = _c(49);
239
+ var t1;
240
+ if ($[0] !== t0) {
241
+ t1 = t0 === undefined ? {} : t0;
242
+ $[0] = t0;
243
+ $[1] = t1;
244
+ } else {
245
+ t1 = $[1];
246
+ }
247
+ var _t = t1,
248
+ t2 = _t.readOnly;
249
+ var readOnly = t2 === undefined ? false : t2;
250
+ var _useProfileViewContex = useProfileViewContext(),
251
+ profileSource = _useProfileViewContex.profileSource;
252
+ var t3;
253
+ if ($[2] !== profileSource) {
254
+ var _profileSource$Profil;
255
+ var currentProfileType = profileSource === null || profileSource === void 0 || (_profileSource$Profil = profileSource.ProfileType()) === null || _profileSource$Profil === void 0 ? void 0 : _profileSource$Profil.toString();
256
+ t3 = getFilterTypeItems(currentProfileType);
257
+ $[2] = profileSource;
258
+ $[3] = t3;
259
+ } else {
260
+ t3 = $[3];
261
+ }
262
+ var filterTypeItems = t3;
263
+ var _useProfileFilters = useProfileFilters(),
264
+ localFilters = _useProfileFilters.localFilters,
265
+ appliedFilters = _useProfileFilters.appliedFilters,
266
+ hasUnsavedChanges = _useProfileFilters.hasUnsavedChanges,
267
+ onApplyFilters = _useProfileFilters.onApplyFilters,
268
+ addFilter = _useProfileFilters.addFilter,
269
+ removeFilter = _useProfileFilters.removeFilter,
270
+ updateFilter = _useProfileFilters.updateFilter,
271
+ resetFilters = _useProfileFilters.resetFilters;
272
+ var t4;
273
+ if ($[4] !== onApplyFilters) {
274
+ t4 = function t4(e) {
275
+ if (e.key === "Enter") {
276
+ e.preventDefault();
277
+ if (e.currentTarget.value.trim() === "") {
278
+ return;
169
279
  }
170
- }, [onApplyFilters]);
171
- const filtersToRender = localFilters.length > 0 ? localFilters : appliedFilters ?? [];
172
- return (_jsxs("div", { className: "flex gap-2 w-full items-start", ...testId(TEST_IDS.PROFILE_FILTERS_CONTAINER), children: [_jsxs("div", { className: "flex-1 flex flex-wrap gap-2", children: [filtersToRender.map(filter => {
173
- const isNumberField = filter.field === 'address' || filter.field === 'line_number';
174
- const matchTypeItems = isNumberField ? numberMatchTypeItems : stringMatchTypeItems;
175
- const isPresetFilter = filter.type != null && isPresetKey(filter.type);
176
- return (_jsxs("div", { className: "flex items-center gap-0", children: [_jsx(Select, { items: filterTypeItems, selectedKey: filter.type, placeholder: "Select Filter", disabled: readOnly, ...testId(TEST_IDS.FILTER_TYPE_SELECT), flyoutTestId: "filter-type-select-flyout", onSelection: key => {
177
- // Check if this is a preset selection
178
- if (isPresetKey(key)) {
179
- const preset = getPresetByKey(key);
180
- if (preset != null) {
181
- updateFilter(filter.id, {
182
- type: preset.key,
183
- field: undefined,
184
- matchType: undefined,
185
- value: preset.name,
186
- });
187
- }
188
- }
189
- else {
190
- const newType = key;
191
- // Check if we're converting a preset filter to a regular filter
192
- if (filter.type != null && isPresetKey(filter.type)) {
193
- updateFilter(filter.id, {
194
- type: newType,
195
- field: 'function_name',
196
- matchType: 'contains',
197
- value: '',
198
- });
199
- }
200
- else {
201
- updateFilter(filter.id, {
202
- type: newType,
203
- field: filter.field ?? 'function_name',
204
- matchType: filter.matchType ?? 'contains',
205
- });
206
- }
207
- }
208
- }, className: cx('gap-0 focus:z-50 focus:relative focus:outline-1', readOnly ? '' : 'pr-1', readOnly && isPresetFilter ? 'rounded-md' : 'rounded-l-md rounded-r-none', !readOnly && (isPresetFilter ? 'rounded-r-none border-r-0' : 'rounded-r-none'), readOnly ? 'w-auto' : filter.type != null ? 'border-r-0 w-auto' : 'w-32'), hideCaretDropdown: readOnly }), filter.type != null && !isPresetFilter && (_jsxs(_Fragment, { children: [_jsx(Select, { items: fieldItems, selectedKey: filter.field ?? '', disabled: readOnly, ...testId(TEST_IDS.FILTER_FIELD_SELECT), flyoutTestId: "filter-field-select-flyout", onSelection: key => {
209
- const newField = key;
210
- const isNewFieldNumber = newField === 'address' || newField === 'line_number';
211
- const isCurrentFieldNumber = filter.field === 'address' || filter.field === 'line_number';
212
- if (isNewFieldNumber !== isCurrentFieldNumber) {
213
- updateFilter(filter.id, {
214
- field: newField,
215
- matchType: 'equal',
216
- });
217
- }
218
- else {
219
- updateFilter(filter.id, { field: newField });
220
- }
221
- }, className: cx('rounded-none border-r-0 w-32 gap-0 focus:z-50 focus:relative focus:outline-1', readOnly ? '' : 'pr-1'), hideCaretDropdown: readOnly }), _jsx(Select, { items: matchTypeItems, selectedKey: filter.matchType ?? '', disabled: readOnly, ...testId(TEST_IDS.FILTER_MATCH_TYPE_SELECT), flyoutTestId: "filter-match-type-select-flyout", onSelection: key => updateFilter(filter.id, { matchType: key }), className: cx('rounded-none border-r-0 gap-0 focus:z-50 focus:relative focus:outline-1', readOnly ? '' : 'pr-1'), hideCaretDropdown: readOnly }), _jsx(Input, { placeholder: "Value", value: filter.value, disabled: readOnly, onChange: e => updateFilter(filter.id, { value: e.target.value }), onKeyDown: handleKeyDown, className: "rounded-none w-36 text-sm focus:outline-1", ...testId(TEST_IDS.FILTER_VALUE_INPUT) })] })), !readOnly && (_jsx(Button, { variant: "neutral", ...testId(TEST_IDS.FILTER_REMOVE_BUTTON), onClick: () => {
222
- // If we're displaying local filters and this is the last one, reset everything
223
- if (localFilters.length > 0 && localFilters.length === 1) {
224
- resetFilters();
225
- }
226
- // If we're displaying applied filters and this is the last one, reset everything
227
- else if (localFilters.length === 0 && filtersToRender.length === 1) {
228
- resetFilters();
229
- }
230
- // Otherwise, just remove this specific filter
231
- else {
232
- removeFilter(filter.id);
233
- }
234
- }, className: cx('h-[38px] p-3', filter.type != null
235
- ? 'rounded-none rounded-r-md'
236
- : 'rounded-l-none rounded-r-md'), children: _jsx(Icon, { icon: "mdi:close", className: "h-4 w-4" }) }))] }, filter.id));
237
- }), !readOnly && localFilters.length > 0 && (_jsx(Button, { variant: "neutral", onClick: addFilter, className: "p-3 h-[38px]", ...testId(TEST_IDS.ADD_FILTER_BUTTON), children: _jsx(Icon, { icon: "mdi:filter-plus-outline", className: "h-4 w-4" }) })), !readOnly && localFilters.length === 0 && (appliedFilters?.length ?? 0) === 0 && (_jsxs(Button, { variant: "neutral", onClick: addFilter, className: "flex items-center gap-2", ...testId(TEST_IDS.ADD_FILTER_BUTTON), children: [_jsx(Icon, { icon: "mdi:filter-outline", className: "h-4 w-4" }), _jsx("span", { children: "Filter" })] }))] }), !readOnly && localFilters.length > 0 && (_jsx(Button, { variant: "primary", onClick: onApplyFilters, disabled: !hasUnsavedChanges || !localFilters.some(isFilterComplete), className: cx('flex items-center gap-2 sticky top-0'), ...testId(TEST_IDS.APPLY_FILTERS_BUTTON), children: _jsx("span", { children: "Apply" }) }))] }));
280
+ onApplyFilters();
281
+ }
282
+ };
283
+ $[4] = onApplyFilters;
284
+ $[5] = t4;
285
+ } else {
286
+ t4 = $[5];
287
+ }
288
+ var handleKeyDown = t4;
289
+ var t5;
290
+ if ($[6] !== appliedFilters || $[7] !== localFilters) {
291
+ t5 = localFilters.length > 0 ? localFilters : appliedFilters !== null && appliedFilters !== void 0 ? appliedFilters : [];
292
+ $[6] = appliedFilters;
293
+ $[7] = localFilters;
294
+ $[8] = t5;
295
+ } else {
296
+ t5 = $[8];
297
+ }
298
+ var filtersToRender = t5;
299
+ var t6;
300
+ if ($[9] === Symbol["for"]("react.memo_cache_sentinel")) {
301
+ t6 = testId(TEST_IDS.PROFILE_FILTERS_CONTAINER);
302
+ $[9] = t6;
303
+ } else {
304
+ t6 = $[9];
305
+ }
306
+ var t7;
307
+ if ($[10] !== filterTypeItems || $[11] !== filtersToRender || $[12] !== handleKeyDown || $[13] !== localFilters.length || $[14] !== readOnly || $[15] !== removeFilter || $[16] !== resetFilters || $[17] !== updateFilter) {
308
+ var _t2;
309
+ if ($[19] !== filterTypeItems || $[20] !== filtersToRender.length || $[21] !== handleKeyDown || $[22] !== localFilters.length || $[23] !== readOnly || $[24] !== removeFilter || $[25] !== resetFilters || $[26] !== updateFilter) {
310
+ _t2 = function _t2(filter) {
311
+ var _filter$field2, _filter$matchType2;
312
+ var isNumberField = filter.field === "address" || filter.field === "line_number";
313
+ var matchTypeItems = isNumberField ? numberMatchTypeItems : stringMatchTypeItems;
314
+ var isPresetFilter = filter.type != null && isPresetKey(filter.type);
315
+ return /*#__PURE__*/_jsxs("div", {
316
+ className: "flex items-center gap-0",
317
+ children: [/*#__PURE__*/_jsx(Select, _objectSpread(_objectSpread({
318
+ items: filterTypeItems,
319
+ selectedKey: filter.type,
320
+ placeholder: "Select Filter",
321
+ disabled: readOnly
322
+ }, testId(TEST_IDS.FILTER_TYPE_SELECT)), {}, {
323
+ flyoutTestId: "filter-type-select-flyout",
324
+ onSelection: function onSelection(key) {
325
+ if (isPresetKey(key)) {
326
+ var preset = getPresetByKey(key);
327
+ if (preset != null) {
328
+ updateFilter(filter.id, {
329
+ type: preset.key,
330
+ field: undefined,
331
+ matchType: undefined,
332
+ value: preset.name
333
+ });
334
+ }
335
+ } else {
336
+ var newType = key;
337
+ if (filter.type != null && isPresetKey(filter.type)) {
338
+ updateFilter(filter.id, {
339
+ type: newType,
340
+ field: "function_name",
341
+ matchType: "contains",
342
+ value: ""
343
+ });
344
+ } else {
345
+ var _filter$field, _filter$matchType;
346
+ updateFilter(filter.id, {
347
+ type: newType,
348
+ field: (_filter$field = filter.field) !== null && _filter$field !== void 0 ? _filter$field : "function_name",
349
+ matchType: (_filter$matchType = filter.matchType) !== null && _filter$matchType !== void 0 ? _filter$matchType : "contains"
350
+ });
351
+ }
352
+ }
353
+ },
354
+ className: cx("gap-0 focus:z-50 focus:relative focus:outline-1", readOnly ? "" : "pr-1", readOnly && isPresetFilter ? "rounded-md" : "rounded-l-md rounded-r-none", !readOnly && (isPresetFilter ? "rounded-r-none border-r-0" : "rounded-r-none"), readOnly ? "w-auto" : filter.type != null ? "border-r-0 w-auto" : "w-32"),
355
+ hideCaretDropdown: readOnly
356
+ })), filter.type != null && !isPresetFilter && /*#__PURE__*/_jsxs(_Fragment, {
357
+ children: [/*#__PURE__*/_jsx(Select, _objectSpread(_objectSpread({
358
+ items: fieldItems,
359
+ selectedKey: (_filter$field2 = filter.field) !== null && _filter$field2 !== void 0 ? _filter$field2 : "",
360
+ disabled: readOnly
361
+ }, testId(TEST_IDS.FILTER_FIELD_SELECT)), {}, {
362
+ flyoutTestId: "filter-field-select-flyout",
363
+ onSelection: function onSelection(key_0) {
364
+ var newField = key_0;
365
+ var isNewFieldNumber = newField === "address" || newField === "line_number";
366
+ var isCurrentFieldNumber = filter.field === "address" || filter.field === "line_number";
367
+ if (isNewFieldNumber !== isCurrentFieldNumber) {
368
+ updateFilter(filter.id, {
369
+ field: newField,
370
+ matchType: "equal"
371
+ });
372
+ } else {
373
+ updateFilter(filter.id, {
374
+ field: newField
375
+ });
376
+ }
377
+ },
378
+ className: cx("rounded-none border-r-0 w-32 gap-0 focus:z-50 focus:relative focus:outline-1", readOnly ? "" : "pr-1"),
379
+ hideCaretDropdown: readOnly
380
+ })), /*#__PURE__*/_jsx(Select, _objectSpread(_objectSpread({
381
+ items: matchTypeItems,
382
+ selectedKey: (_filter$matchType2 = filter.matchType) !== null && _filter$matchType2 !== void 0 ? _filter$matchType2 : "",
383
+ disabled: readOnly
384
+ }, testId(TEST_IDS.FILTER_MATCH_TYPE_SELECT)), {}, {
385
+ flyoutTestId: "filter-match-type-select-flyout",
386
+ onSelection: function onSelection(key_1) {
387
+ return updateFilter(filter.id, {
388
+ matchType: key_1
389
+ });
390
+ },
391
+ className: cx("rounded-none border-r-0 gap-0 focus:z-50 focus:relative focus:outline-1", readOnly ? "" : "pr-1"),
392
+ hideCaretDropdown: readOnly
393
+ })), /*#__PURE__*/_jsx(Input, _objectSpread({
394
+ placeholder: "Value",
395
+ value: filter.value,
396
+ disabled: readOnly,
397
+ onChange: function onChange(e_0) {
398
+ return updateFilter(filter.id, {
399
+ value: e_0.target.value
400
+ });
401
+ },
402
+ onKeyDown: handleKeyDown,
403
+ className: "rounded-none w-36 text-sm focus:outline-1"
404
+ }, testId(TEST_IDS.FILTER_VALUE_INPUT)))]
405
+ }), !readOnly && /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
406
+ variant: "neutral"
407
+ }, testId(TEST_IDS.FILTER_REMOVE_BUTTON)), {}, {
408
+ onClick: function onClick() {
409
+ if (localFilters.length > 0 && localFilters.length === 1) {
410
+ resetFilters();
411
+ } else {
412
+ if (localFilters.length === 0 && filtersToRender.length === 1) {
413
+ resetFilters();
414
+ } else {
415
+ removeFilter(filter.id);
416
+ }
417
+ }
418
+ },
419
+ className: cx("h-[38px] p-3", filter.type != null ? "rounded-none rounded-r-md" : "rounded-l-none rounded-r-md"),
420
+ children: /*#__PURE__*/_jsx(Icon, {
421
+ icon: "mdi:close",
422
+ className: "h-4 w-4"
423
+ })
424
+ }))]
425
+ }, filter.id);
426
+ };
427
+ $[19] = filterTypeItems;
428
+ $[20] = filtersToRender.length;
429
+ $[21] = handleKeyDown;
430
+ $[22] = localFilters.length;
431
+ $[23] = readOnly;
432
+ $[24] = removeFilter;
433
+ $[25] = resetFilters;
434
+ $[26] = updateFilter;
435
+ $[27] = _t2;
436
+ } else {
437
+ _t2 = $[27];
438
+ }
439
+ t7 = filtersToRender.map(_t2);
440
+ $[10] = filterTypeItems;
441
+ $[11] = filtersToRender;
442
+ $[12] = handleKeyDown;
443
+ $[13] = localFilters.length;
444
+ $[14] = readOnly;
445
+ $[15] = removeFilter;
446
+ $[16] = resetFilters;
447
+ $[17] = updateFilter;
448
+ $[18] = t7;
449
+ } else {
450
+ t7 = $[18];
451
+ }
452
+ var t8;
453
+ if ($[28] !== addFilter || $[29] !== localFilters.length || $[30] !== readOnly) {
454
+ t8 = !readOnly && localFilters.length > 0 && /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
455
+ variant: "neutral",
456
+ onClick: addFilter,
457
+ className: "p-3 h-[38px]"
458
+ }, testId(TEST_IDS.ADD_FILTER_BUTTON)), {}, {
459
+ children: /*#__PURE__*/_jsx(Icon, {
460
+ icon: "mdi:filter-plus-outline",
461
+ className: "h-4 w-4"
462
+ })
463
+ }));
464
+ $[28] = addFilter;
465
+ $[29] = localFilters.length;
466
+ $[30] = readOnly;
467
+ $[31] = t8;
468
+ } else {
469
+ t8 = $[31];
470
+ }
471
+ var t9;
472
+ if ($[32] !== addFilter || $[33] !== (appliedFilters === null || appliedFilters === void 0 ? void 0 : appliedFilters.length) || $[34] !== localFilters.length || $[35] !== readOnly) {
473
+ var _appliedFilters$lengt;
474
+ t9 = !readOnly && localFilters.length === 0 && ((_appliedFilters$lengt = appliedFilters === null || appliedFilters === void 0 ? void 0 : appliedFilters.length) !== null && _appliedFilters$lengt !== void 0 ? _appliedFilters$lengt : 0) === 0 && /*#__PURE__*/_jsxs(Button, _objectSpread(_objectSpread({
475
+ variant: "neutral",
476
+ onClick: addFilter,
477
+ className: "flex items-center gap-2"
478
+ }, testId(TEST_IDS.ADD_FILTER_BUTTON)), {}, {
479
+ children: [/*#__PURE__*/_jsx(Icon, {
480
+ icon: "mdi:filter-outline",
481
+ className: "h-4 w-4"
482
+ }), /*#__PURE__*/_jsx("span", {
483
+ children: "Filter"
484
+ })]
485
+ }));
486
+ $[32] = addFilter;
487
+ $[33] = appliedFilters === null || appliedFilters === void 0 ? void 0 : appliedFilters.length;
488
+ $[34] = localFilters.length;
489
+ $[35] = readOnly;
490
+ $[36] = t9;
491
+ } else {
492
+ t9 = $[36];
493
+ }
494
+ var t10;
495
+ if ($[37] !== t7 || $[38] !== t8 || $[39] !== t9) {
496
+ t10 = /*#__PURE__*/_jsxs("div", {
497
+ className: "flex-1 flex flex-wrap gap-2",
498
+ children: [t7, t8, t9]
499
+ });
500
+ $[37] = t7;
501
+ $[38] = t8;
502
+ $[39] = t9;
503
+ $[40] = t10;
504
+ } else {
505
+ t10 = $[40];
506
+ }
507
+ var t11;
508
+ if ($[41] !== hasUnsavedChanges || $[42] !== localFilters || $[43] !== onApplyFilters || $[44] !== readOnly) {
509
+ t11 = !readOnly && localFilters.length > 0 && /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
510
+ variant: "primary",
511
+ onClick: onApplyFilters,
512
+ disabled: !hasUnsavedChanges || !localFilters.some(isFilterComplete),
513
+ className: cx("flex items-center gap-2 sticky top-0")
514
+ }, testId(TEST_IDS.APPLY_FILTERS_BUTTON)), {}, {
515
+ children: /*#__PURE__*/_jsx("span", {
516
+ children: "Apply"
517
+ })
518
+ }));
519
+ $[41] = hasUnsavedChanges;
520
+ $[42] = localFilters;
521
+ $[43] = onApplyFilters;
522
+ $[44] = readOnly;
523
+ $[45] = t11;
524
+ } else {
525
+ t11 = $[45];
526
+ }
527
+ var t12;
528
+ if ($[46] !== t10 || $[47] !== t11) {
529
+ t12 = /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
530
+ className: "flex gap-2 w-full items-start"
531
+ }, t6), {}, {
532
+ children: [t10, t11]
533
+ }));
534
+ $[46] = t10;
535
+ $[47] = t11;
536
+ $[48] = t12;
537
+ } else {
538
+ t12 = $[48];
539
+ }
540
+ return t12;
238
541
  };
239
- export default ProfileFilters;
542
+ export default ProfileFilters;