@grafana/scenes 5.5.2--canary.830.10005065313.0 → 5.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/esm/index.js +1 -0
  3. package/dist/esm/index.js.map +1 -1
  4. package/dist/esm/querying/SceneQueryRunner.js +2 -1
  5. package/dist/esm/querying/SceneQueryRunner.js.map +1 -1
  6. package/dist/esm/querying/layers/annotations/AnnotationsDataLayer.js +4 -1
  7. package/dist/esm/querying/layers/annotations/AnnotationsDataLayer.js.map +1 -1
  8. package/dist/esm/querying/layers/annotations/standardAnnotationQuery.js +2 -1
  9. package/dist/esm/querying/layers/annotations/standardAnnotationQuery.js.map +1 -1
  10. package/dist/esm/utils/SafeSerializableSceneObject.js +39 -0
  11. package/dist/esm/utils/SafeSerializableSceneObject.js.map +1 -0
  12. package/dist/esm/variables/adhoc/AdHocFilterRenderer.js +4 -1
  13. package/dist/esm/variables/adhoc/AdHocFilterRenderer.js.map +1 -1
  14. package/dist/esm/variables/adhoc/AdHocFiltersVariable.js +6 -13
  15. package/dist/esm/variables/adhoc/AdHocFiltersVariable.js.map +1 -1
  16. package/dist/esm/variables/groupby/GroupByVariable.js +8 -5
  17. package/dist/esm/variables/groupby/GroupByVariable.js.map +1 -1
  18. package/dist/esm/variables/variants/query/QueryVariable.js +3 -2
  19. package/dist/esm/variables/variants/query/QueryVariable.js.map +1 -1
  20. package/dist/index.d.ts +12 -5
  21. package/dist/index.js +276 -798
  22. package/dist/index.js.map +1 -1
  23. package/package.json +2 -3
  24. package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersCombobox.js +0 -406
  25. package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersCombobox.js.map +0 -1
  26. package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersComboboxEditSwitch.js +0 -113
  27. package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersComboboxEditSwitch.js.map +0 -1
  28. package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersComboboxRenderer.js +0 -63
  29. package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersComboboxRenderer.js.map +0 -1
package/dist/index.js CHANGED
@@ -14,8 +14,6 @@ var ui = require('@grafana/ui');
14
14
  var e2eSelectors = require('@grafana/e2e-selectors');
15
15
  var css = require('@emotion/css');
16
16
  var uFuzzy = require('@leeoniya/ufuzzy');
17
- var react = require('@floating-ui/react');
18
- var reactDom = require('react-dom');
19
17
  var reactUse = require('react-use');
20
18
  var operators = require('rxjs/operators');
21
19
  var ReactGridLayout = require('react-grid-layout');
@@ -43,19 +41,19 @@ var uFuzzy__default = /*#__PURE__*/_interopDefaultLegacy(uFuzzy);
43
41
  var ReactGridLayout__default = /*#__PURE__*/_interopDefaultLegacy(ReactGridLayout);
44
42
  var AutoSizer__default = /*#__PURE__*/_interopDefaultLegacy(AutoSizer);
45
43
 
46
- var __defProp$M = Object.defineProperty;
47
- var __getOwnPropSymbols$M = Object.getOwnPropertySymbols;
48
- var __hasOwnProp$M = Object.prototype.hasOwnProperty;
49
- var __propIsEnum$M = Object.prototype.propertyIsEnumerable;
50
- var __defNormalProp$M = (obj, key, value) => key in obj ? __defProp$M(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
51
- var __spreadValues$M = (a, b) => {
44
+ var __defProp$K = Object.defineProperty;
45
+ var __getOwnPropSymbols$K = Object.getOwnPropertySymbols;
46
+ var __hasOwnProp$K = Object.prototype.hasOwnProperty;
47
+ var __propIsEnum$K = Object.prototype.propertyIsEnumerable;
48
+ var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
49
+ var __spreadValues$K = (a, b) => {
52
50
  for (var prop in b || (b = {}))
53
- if (__hasOwnProp$M.call(b, prop))
54
- __defNormalProp$M(a, prop, b[prop]);
55
- if (__getOwnPropSymbols$M)
56
- for (var prop of __getOwnPropSymbols$M(b)) {
57
- if (__propIsEnum$M.call(b, prop))
58
- __defNormalProp$M(a, prop, b[prop]);
51
+ if (__hasOwnProp$K.call(b, prop))
52
+ __defNormalProp$K(a, prop, b[prop]);
53
+ if (__getOwnPropSymbols$K)
54
+ for (var prop of __getOwnPropSymbols$K(b)) {
55
+ if (__propIsEnum$K.call(b, prop))
56
+ __defNormalProp$K(a, prop, b[prop]);
59
57
  }
60
58
  return a;
61
59
  };
@@ -64,7 +62,7 @@ function useAppQueryParams() {
64
62
  return runtime.locationSearchToObject(location.search || "");
65
63
  }
66
64
  function getUrlWithAppState(path, preserveParams) {
67
- const paramsCopy = __spreadValues$M({}, runtime.locationService.getSearchObject());
65
+ const paramsCopy = __spreadValues$K({}, runtime.locationService.getSearchObject());
68
66
  if (preserveParams) {
69
67
  for (const key of Object.keys(paramsCopy)) {
70
68
  if (!preserveParams.includes(key)) {
@@ -78,31 +76,31 @@ function renderSceneComponentWithRouteProps(sceneObject, routeProps) {
78
76
  return React__default["default"].createElement(sceneObject.Component, { model: sceneObject, routeProps });
79
77
  }
80
78
 
81
- var __defProp$L = Object.defineProperty;
82
- var __defProps$v = Object.defineProperties;
83
- var __getOwnPropDescs$v = Object.getOwnPropertyDescriptors;
84
- var __getOwnPropSymbols$L = Object.getOwnPropertySymbols;
85
- var __hasOwnProp$L = Object.prototype.hasOwnProperty;
86
- var __propIsEnum$L = Object.prototype.propertyIsEnumerable;
87
- var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
88
- var __spreadValues$L = (a, b) => {
79
+ var __defProp$J = Object.defineProperty;
80
+ var __defProps$t = Object.defineProperties;
81
+ var __getOwnPropDescs$t = Object.getOwnPropertyDescriptors;
82
+ var __getOwnPropSymbols$J = Object.getOwnPropertySymbols;
83
+ var __hasOwnProp$J = Object.prototype.hasOwnProperty;
84
+ var __propIsEnum$J = Object.prototype.propertyIsEnumerable;
85
+ var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
86
+ var __spreadValues$J = (a, b) => {
89
87
  for (var prop in b || (b = {}))
90
- if (__hasOwnProp$L.call(b, prop))
91
- __defNormalProp$L(a, prop, b[prop]);
92
- if (__getOwnPropSymbols$L)
93
- for (var prop of __getOwnPropSymbols$L(b)) {
94
- if (__propIsEnum$L.call(b, prop))
95
- __defNormalProp$L(a, prop, b[prop]);
88
+ if (__hasOwnProp$J.call(b, prop))
89
+ __defNormalProp$J(a, prop, b[prop]);
90
+ if (__getOwnPropSymbols$J)
91
+ for (var prop of __getOwnPropSymbols$J(b)) {
92
+ if (__propIsEnum$J.call(b, prop))
93
+ __defNormalProp$J(a, prop, b[prop]);
96
94
  }
97
95
  return a;
98
96
  };
99
- var __spreadProps$v = (a, b) => __defProps$v(a, __getOwnPropDescs$v(b));
97
+ var __spreadProps$t = (a, b) => __defProps$t(a, __getOwnPropDescs$t(b));
100
98
  const runtimePanelPlugins = /* @__PURE__ */ new Map();
101
99
  function registerRuntimePanelPlugin({ pluginId, plugin }) {
102
100
  if (runtimePanelPlugins.has(pluginId)) {
103
101
  throw new Error(`A runtime panel plugin with id ${pluginId} has already been registered`);
104
102
  }
105
- plugin.meta = __spreadProps$v(__spreadValues$L({}, plugin.meta), {
103
+ plugin.meta = __spreadProps$t(__spreadValues$J({}, plugin.meta), {
106
104
  id: pluginId,
107
105
  name: pluginId,
108
106
  module: "runtime plugin",
@@ -130,39 +128,39 @@ function loadPanelPluginSync(pluginId) {
130
128
  return (_a = getPanelPluginFromCache(pluginId)) != null ? _a : runtimePanelPlugins.get(pluginId);
131
129
  }
132
130
 
133
- var __defProp$K = Object.defineProperty;
134
- var __defProps$u = Object.defineProperties;
135
- var __getOwnPropDescs$u = Object.getOwnPropertyDescriptors;
136
- var __getOwnPropSymbols$K = Object.getOwnPropertySymbols;
137
- var __hasOwnProp$K = Object.prototype.hasOwnProperty;
138
- var __propIsEnum$K = Object.prototype.propertyIsEnumerable;
139
- var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
140
- var __spreadValues$K = (a, b) => {
131
+ var __defProp$I = Object.defineProperty;
132
+ var __defProps$s = Object.defineProperties;
133
+ var __getOwnPropDescs$s = Object.getOwnPropertyDescriptors;
134
+ var __getOwnPropSymbols$I = Object.getOwnPropertySymbols;
135
+ var __hasOwnProp$I = Object.prototype.hasOwnProperty;
136
+ var __propIsEnum$I = Object.prototype.propertyIsEnumerable;
137
+ var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
138
+ var __spreadValues$I = (a, b) => {
141
139
  for (var prop in b || (b = {}))
142
- if (__hasOwnProp$K.call(b, prop))
143
- __defNormalProp$K(a, prop, b[prop]);
144
- if (__getOwnPropSymbols$K)
145
- for (var prop of __getOwnPropSymbols$K(b)) {
146
- if (__propIsEnum$K.call(b, prop))
147
- __defNormalProp$K(a, prop, b[prop]);
140
+ if (__hasOwnProp$I.call(b, prop))
141
+ __defNormalProp$I(a, prop, b[prop]);
142
+ if (__getOwnPropSymbols$I)
143
+ for (var prop of __getOwnPropSymbols$I(b)) {
144
+ if (__propIsEnum$I.call(b, prop))
145
+ __defNormalProp$I(a, prop, b[prop]);
148
146
  }
149
147
  return a;
150
148
  };
151
- var __spreadProps$u = (a, b) => __defProps$u(a, __getOwnPropDescs$u(b));
152
- var __objRest$5 = (source, exclude) => {
149
+ var __spreadProps$s = (a, b) => __defProps$s(a, __getOwnPropDescs$s(b));
150
+ var __objRest$4 = (source, exclude) => {
153
151
  var target = {};
154
152
  for (var prop in source)
155
- if (__hasOwnProp$K.call(source, prop) && exclude.indexOf(prop) < 0)
153
+ if (__hasOwnProp$I.call(source, prop) && exclude.indexOf(prop) < 0)
156
154
  target[prop] = source[prop];
157
- if (source != null && __getOwnPropSymbols$K)
158
- for (var prop of __getOwnPropSymbols$K(source)) {
159
- if (exclude.indexOf(prop) < 0 && __propIsEnum$K.call(source, prop))
155
+ if (source != null && __getOwnPropSymbols$I)
156
+ for (var prop of __getOwnPropSymbols$I(source)) {
157
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$I.call(source, prop))
160
158
  target[prop] = source[prop];
161
159
  }
162
160
  return target;
163
161
  };
164
162
  function SceneComponentWrapperWithoutMemo(_a) {
165
- var _b = _a, { model } = _b, otherProps = __objRest$5(_b, ["model"]);
163
+ var _b = _a, { model } = _b, otherProps = __objRest$4(_b, ["model"]);
166
164
  var _a2;
167
165
  const Component = (_a2 = model.constructor["Component"]) != null ? _a2 : EmptyRenderer;
168
166
  const [_, setValue] = React.useState(0);
@@ -174,7 +172,7 @@ function SceneComponentWrapperWithoutMemo(_a) {
174
172
  if (!model.isActive) {
175
173
  return null;
176
174
  }
177
- return /* @__PURE__ */ React__default["default"].createElement(Component, __spreadProps$u(__spreadValues$K({}, otherProps), {
175
+ return /* @__PURE__ */ React__default["default"].createElement(Component, __spreadProps$s(__spreadValues$I({}, otherProps), {
178
176
  model
179
177
  }));
180
178
  }
@@ -190,49 +188,49 @@ class UserActionEvent extends data.BusEventWithPayload {
190
188
  }
191
189
  UserActionEvent.type = "scene-object-user-action";
192
190
 
193
- var __accessCheck$2 = (obj, member, msg) => {
191
+ var __accessCheck$3 = (obj, member, msg) => {
194
192
  if (!member.has(obj))
195
193
  throw TypeError("Cannot " + msg);
196
194
  };
197
- var __privateGet$2 = (obj, member, getter) => {
198
- __accessCheck$2(obj, member, "read from private field");
195
+ var __privateGet$3 = (obj, member, getter) => {
196
+ __accessCheck$3(obj, member, "read from private field");
199
197
  return getter ? getter.call(obj) : member.get(obj);
200
198
  };
201
- var __privateAdd$2 = (obj, member, value) => {
199
+ var __privateAdd$3 = (obj, member, value) => {
202
200
  if (member.has(obj))
203
201
  throw TypeError("Cannot add the same private member more than once");
204
202
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
205
203
  };
206
- var __privateSet$1 = (obj, member, value, setter) => {
207
- __accessCheck$2(obj, member, "write to private field");
204
+ var __privateSet$2 = (obj, member, value, setter) => {
205
+ __accessCheck$3(obj, member, "write to private field");
208
206
  setter ? setter.call(obj, value) : member.set(obj, value);
209
207
  return value;
210
208
  };
211
209
  var _ref;
212
210
  class SceneObjectRef {
213
211
  constructor(ref) {
214
- __privateAdd$2(this, _ref, void 0);
215
- __privateSet$1(this, _ref, ref);
212
+ __privateAdd$3(this, _ref, void 0);
213
+ __privateSet$2(this, _ref, ref);
216
214
  }
217
215
  resolve() {
218
- return __privateGet$2(this, _ref);
216
+ return __privateGet$3(this, _ref);
219
217
  }
220
218
  }
221
219
  _ref = new WeakMap();
222
220
 
223
- var __defProp$J = Object.defineProperty;
224
- var __getOwnPropSymbols$J = Object.getOwnPropertySymbols;
225
- var __hasOwnProp$J = Object.prototype.hasOwnProperty;
226
- var __propIsEnum$J = Object.prototype.propertyIsEnumerable;
227
- var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
228
- var __spreadValues$J = (a, b) => {
221
+ var __defProp$H = Object.defineProperty;
222
+ var __getOwnPropSymbols$H = Object.getOwnPropertySymbols;
223
+ var __hasOwnProp$H = Object.prototype.hasOwnProperty;
224
+ var __propIsEnum$H = Object.prototype.propertyIsEnumerable;
225
+ var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
226
+ var __spreadValues$H = (a, b) => {
229
227
  for (var prop in b || (b = {}))
230
- if (__hasOwnProp$J.call(b, prop))
231
- __defNormalProp$J(a, prop, b[prop]);
232
- if (__getOwnPropSymbols$J)
233
- for (var prop of __getOwnPropSymbols$J(b)) {
234
- if (__propIsEnum$J.call(b, prop))
235
- __defNormalProp$J(a, prop, b[prop]);
228
+ if (__hasOwnProp$H.call(b, prop))
229
+ __defNormalProp$H(a, prop, b[prop]);
230
+ if (__getOwnPropSymbols$H)
231
+ for (var prop of __getOwnPropSymbols$H(b)) {
232
+ if (__propIsEnum$H.call(b, prop))
233
+ __defNormalProp$H(a, prop, b[prop]);
236
234
  }
237
235
  return a;
238
236
  };
@@ -292,7 +290,7 @@ class SceneObjectBase {
292
290
  }
293
291
  setState(update) {
294
292
  const prevState = this._state;
295
- const newState = __spreadValues$J(__spreadValues$J({}, this._state), update);
293
+ const newState = __spreadValues$H(__spreadValues$H({}, this._state), update);
296
294
  this._state = Object.freeze(newState);
297
295
  this._setParent(update);
298
296
  this._handleActivationOfChangedStateProps(prevState, newState);
@@ -488,19 +486,19 @@ function forEachChild(state, callback) {
488
486
  }
489
487
  }
490
488
 
491
- var __defProp$I = Object.defineProperty;
492
- var __getOwnPropSymbols$I = Object.getOwnPropertySymbols;
493
- var __hasOwnProp$I = Object.prototype.hasOwnProperty;
494
- var __propIsEnum$I = Object.prototype.propertyIsEnumerable;
495
- var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
496
- var __spreadValues$I = (a, b) => {
489
+ var __defProp$G = Object.defineProperty;
490
+ var __getOwnPropSymbols$G = Object.getOwnPropertySymbols;
491
+ var __hasOwnProp$G = Object.prototype.hasOwnProperty;
492
+ var __propIsEnum$G = Object.prototype.propertyIsEnumerable;
493
+ var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
494
+ var __spreadValues$G = (a, b) => {
497
495
  for (var prop in b || (b = {}))
498
- if (__hasOwnProp$I.call(b, prop))
499
- __defNormalProp$I(a, prop, b[prop]);
500
- if (__getOwnPropSymbols$I)
501
- for (var prop of __getOwnPropSymbols$I(b)) {
502
- if (__propIsEnum$I.call(b, prop))
503
- __defNormalProp$I(a, prop, b[prop]);
496
+ if (__hasOwnProp$G.call(b, prop))
497
+ __defNormalProp$G(a, prop, b[prop]);
498
+ if (__getOwnPropSymbols$G)
499
+ for (var prop of __getOwnPropSymbols$G(b)) {
500
+ if (__propIsEnum$G.call(b, prop))
501
+ __defNormalProp$G(a, prop, b[prop]);
504
502
  }
505
503
  return a;
506
504
  };
@@ -509,7 +507,7 @@ function cloneSceneObject(sceneObject, withState) {
509
507
  return new sceneObject.constructor(clonedState);
510
508
  }
511
509
  function cloneSceneObjectState(sceneState, withState) {
512
- const clonedState = __spreadValues$I({}, sceneState);
510
+ const clonedState = __spreadValues$G({}, sceneState);
513
511
  for (const key in clonedState) {
514
512
  const propValue = clonedState[key];
515
513
  if (propValue instanceof SceneObjectBase) {
@@ -606,25 +604,25 @@ function lookupVariable(name, sceneObject) {
606
604
  return null;
607
605
  }
608
606
 
609
- var __defProp$H = Object.defineProperty;
610
- var __getOwnPropSymbols$H = Object.getOwnPropertySymbols;
611
- var __hasOwnProp$H = Object.prototype.hasOwnProperty;
612
- var __propIsEnum$H = Object.prototype.propertyIsEnumerable;
613
- var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
614
- var __spreadValues$H = (a, b) => {
607
+ var __defProp$F = Object.defineProperty;
608
+ var __getOwnPropSymbols$F = Object.getOwnPropertySymbols;
609
+ var __hasOwnProp$F = Object.prototype.hasOwnProperty;
610
+ var __propIsEnum$F = Object.prototype.propertyIsEnumerable;
611
+ var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
612
+ var __spreadValues$F = (a, b) => {
615
613
  for (var prop in b || (b = {}))
616
- if (__hasOwnProp$H.call(b, prop))
617
- __defNormalProp$H(a, prop, b[prop]);
618
- if (__getOwnPropSymbols$H)
619
- for (var prop of __getOwnPropSymbols$H(b)) {
620
- if (__propIsEnum$H.call(b, prop))
621
- __defNormalProp$H(a, prop, b[prop]);
614
+ if (__hasOwnProp$F.call(b, prop))
615
+ __defNormalProp$F(a, prop, b[prop]);
616
+ if (__getOwnPropSymbols$F)
617
+ for (var prop of __getOwnPropSymbols$F(b)) {
618
+ if (__propIsEnum$F.call(b, prop))
619
+ __defNormalProp$F(a, prop, b[prop]);
622
620
  }
623
621
  return a;
624
622
  };
625
623
  class SceneDataNode extends SceneObjectBase {
626
624
  constructor(state) {
627
- super(__spreadValues$H({
625
+ super(__spreadValues$F({
628
626
  data: emptyPanelData
629
627
  }, state));
630
628
  }
@@ -705,19 +703,19 @@ function evaluateTimeRange(from, to, timeZone, fiscalYearStartMonth, delay) {
705
703
  };
706
704
  }
707
705
 
708
- var __defProp$G = Object.defineProperty;
709
- var __getOwnPropSymbols$G = Object.getOwnPropertySymbols;
710
- var __hasOwnProp$G = Object.prototype.hasOwnProperty;
711
- var __propIsEnum$G = Object.prototype.propertyIsEnumerable;
712
- var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
713
- var __spreadValues$G = (a, b) => {
706
+ var __defProp$E = Object.defineProperty;
707
+ var __getOwnPropSymbols$E = Object.getOwnPropertySymbols;
708
+ var __hasOwnProp$E = Object.prototype.hasOwnProperty;
709
+ var __propIsEnum$E = Object.prototype.propertyIsEnumerable;
710
+ var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
711
+ var __spreadValues$E = (a, b) => {
714
712
  for (var prop in b || (b = {}))
715
- if (__hasOwnProp$G.call(b, prop))
716
- __defNormalProp$G(a, prop, b[prop]);
717
- if (__getOwnPropSymbols$G)
718
- for (var prop of __getOwnPropSymbols$G(b)) {
719
- if (__propIsEnum$G.call(b, prop))
720
- __defNormalProp$G(a, prop, b[prop]);
713
+ if (__hasOwnProp$E.call(b, prop))
714
+ __defNormalProp$E(a, prop, b[prop]);
715
+ if (__getOwnPropSymbols$E)
716
+ for (var prop of __getOwnPropSymbols$E(b)) {
717
+ if (__propIsEnum$E.call(b, prop))
718
+ __defNormalProp$E(a, prop, b[prop]);
721
719
  }
722
720
  return a;
723
721
  };
@@ -734,7 +732,7 @@ class SceneTimeRange extends SceneObjectBase {
734
732
  state.fiscalYearStartMonth,
735
733
  state.UNSAFE_nowDelay
736
734
  );
737
- super(__spreadValues$G({ from, to, timeZone, value }, state));
735
+ super(__spreadValues$E({ from, to, timeZone, value }, state));
738
736
  this._urlSync = new SceneObjectUrlSyncConfig(this, { keys: ["from", "to", "timezone"] });
739
737
  this.onTimeRangeChange = (timeRange) => {
740
738
  const update = {};
@@ -1365,25 +1363,25 @@ function collectAllVariables(sceneObject, record = {}) {
1365
1363
  return record;
1366
1364
  }
1367
1365
 
1368
- var __defProp$F = Object.defineProperty;
1369
- var __defProps$t = Object.defineProperties;
1370
- var __getOwnPropDescs$t = Object.getOwnPropertyDescriptors;
1371
- var __getOwnPropSymbols$F = Object.getOwnPropertySymbols;
1372
- var __hasOwnProp$F = Object.prototype.hasOwnProperty;
1373
- var __propIsEnum$F = Object.prototype.propertyIsEnumerable;
1374
- var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1375
- var __spreadValues$F = (a, b) => {
1366
+ var __defProp$D = Object.defineProperty;
1367
+ var __defProps$r = Object.defineProperties;
1368
+ var __getOwnPropDescs$r = Object.getOwnPropertyDescriptors;
1369
+ var __getOwnPropSymbols$D = Object.getOwnPropertySymbols;
1370
+ var __hasOwnProp$D = Object.prototype.hasOwnProperty;
1371
+ var __propIsEnum$D = Object.prototype.propertyIsEnumerable;
1372
+ var __defNormalProp$D = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1373
+ var __spreadValues$D = (a, b) => {
1376
1374
  for (var prop in b || (b = {}))
1377
- if (__hasOwnProp$F.call(b, prop))
1378
- __defNormalProp$F(a, prop, b[prop]);
1379
- if (__getOwnPropSymbols$F)
1380
- for (var prop of __getOwnPropSymbols$F(b)) {
1381
- if (__propIsEnum$F.call(b, prop))
1382
- __defNormalProp$F(a, prop, b[prop]);
1375
+ if (__hasOwnProp$D.call(b, prop))
1376
+ __defNormalProp$D(a, prop, b[prop]);
1377
+ if (__getOwnPropSymbols$D)
1378
+ for (var prop of __getOwnPropSymbols$D(b)) {
1379
+ if (__propIsEnum$D.call(b, prop))
1380
+ __defNormalProp$D(a, prop, b[prop]);
1383
1381
  }
1384
1382
  return a;
1385
1383
  };
1386
- var __spreadProps$t = (a, b) => __defProps$t(a, __getOwnPropDescs$t(b));
1384
+ var __spreadProps$r = (a, b) => __defProps$r(a, __getOwnPropDescs$r(b));
1387
1385
  function getTemplateProxyForField(field, frame, frames) {
1388
1386
  return new Proxy(
1389
1387
  {},
@@ -1399,7 +1397,7 @@ function getTemplateProxyForField(field, frame, frames) {
1399
1397
  if (!field.labels) {
1400
1398
  return "";
1401
1399
  }
1402
- return __spreadProps$t(__spreadValues$F({}, field.labels), {
1400
+ return __spreadProps$r(__spreadValues$D({}, field.labels), {
1403
1401
  __values: Object.values(field.labels).sort().join(", "),
1404
1402
  toString: () => {
1405
1403
  return data.formatLabels(field.labels, "", true);
@@ -1747,15 +1745,15 @@ function isDataLayer(obj) {
1747
1745
  return "isDataLayer" in obj;
1748
1746
  }
1749
1747
 
1750
- var __accessCheck$1 = (obj, member, msg) => {
1748
+ var __accessCheck$2 = (obj, member, msg) => {
1751
1749
  if (!member.has(obj))
1752
1750
  throw TypeError("Cannot " + msg);
1753
1751
  };
1754
- var __privateGet$1 = (obj, member, getter) => {
1755
- __accessCheck$1(obj, member, "read from private field");
1752
+ var __privateGet$2 = (obj, member, getter) => {
1753
+ __accessCheck$2(obj, member, "read from private field");
1756
1754
  return getter ? getter.call(obj) : member.get(obj);
1757
1755
  };
1758
- var __privateAdd$1 = (obj, member, value) => {
1756
+ var __privateAdd$2 = (obj, member, value) => {
1759
1757
  if (member.has(obj))
1760
1758
  throw TypeError("Cannot add the same private member more than once");
1761
1759
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
@@ -1768,25 +1766,25 @@ class SceneQueryController extends SceneObjectBase {
1768
1766
  constructor() {
1769
1767
  super({ isRunning: false });
1770
1768
  this.isQueryController = true;
1771
- __privateAdd$1(this, _running, /* @__PURE__ */ new Set());
1769
+ __privateAdd$2(this, _running, /* @__PURE__ */ new Set());
1772
1770
  this.addActivationHandler(() => {
1773
- return () => __privateGet$1(this, _running).clear();
1771
+ return () => __privateGet$2(this, _running).clear();
1774
1772
  });
1775
1773
  }
1776
1774
  queryStarted(entry) {
1777
- __privateGet$1(this, _running).add(entry);
1775
+ __privateGet$2(this, _running).add(entry);
1778
1776
  this.changeRunningQueryCount(1);
1779
1777
  if (!this.state.isRunning) {
1780
1778
  this.setState({ isRunning: true });
1781
1779
  }
1782
1780
  }
1783
1781
  queryCompleted(entry) {
1784
- if (!__privateGet$1(this, _running).has(entry)) {
1782
+ if (!__privateGet$2(this, _running).has(entry)) {
1785
1783
  return;
1786
1784
  }
1787
- __privateGet$1(this, _running).delete(entry);
1785
+ __privateGet$2(this, _running).delete(entry);
1788
1786
  this.changeRunningQueryCount(-1);
1789
- if (__privateGet$1(this, _running).size === 0) {
1787
+ if (__privateGet$2(this, _running).size === 0) {
1790
1788
  this.setState({ isRunning: false });
1791
1789
  }
1792
1790
  }
@@ -1796,7 +1794,7 @@ class SceneQueryController extends SceneObjectBase {
1796
1794
  }
1797
1795
  cancelAll() {
1798
1796
  var _a;
1799
- for (const entry of __privateGet$1(this, _running).values()) {
1797
+ for (const entry of __privateGet$2(this, _running).values()) {
1800
1798
  (_a = entry.cancel) == null ? void 0 : _a.call(entry);
1801
1799
  }
1802
1800
  }
@@ -2284,25 +2282,25 @@ function isExtraQueryProvider(obj) {
2284
2282
  return typeof obj === "object" && "getExtraQueries" in obj;
2285
2283
  }
2286
2284
 
2287
- var __defProp$E = Object.defineProperty;
2288
- var __defProps$s = Object.defineProperties;
2289
- var __getOwnPropDescs$s = Object.getOwnPropertyDescriptors;
2290
- var __getOwnPropSymbols$E = Object.getOwnPropertySymbols;
2291
- var __hasOwnProp$E = Object.prototype.hasOwnProperty;
2292
- var __propIsEnum$E = Object.prototype.propertyIsEnumerable;
2293
- var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2294
- var __spreadValues$E = (a, b) => {
2285
+ var __defProp$C = Object.defineProperty;
2286
+ var __defProps$q = Object.defineProperties;
2287
+ var __getOwnPropDescs$q = Object.getOwnPropertyDescriptors;
2288
+ var __getOwnPropSymbols$C = Object.getOwnPropertySymbols;
2289
+ var __hasOwnProp$C = Object.prototype.hasOwnProperty;
2290
+ var __propIsEnum$C = Object.prototype.propertyIsEnumerable;
2291
+ var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2292
+ var __spreadValues$C = (a, b) => {
2295
2293
  for (var prop in b || (b = {}))
2296
- if (__hasOwnProp$E.call(b, prop))
2297
- __defNormalProp$E(a, prop, b[prop]);
2298
- if (__getOwnPropSymbols$E)
2299
- for (var prop of __getOwnPropSymbols$E(b)) {
2300
- if (__propIsEnum$E.call(b, prop))
2301
- __defNormalProp$E(a, prop, b[prop]);
2294
+ if (__hasOwnProp$C.call(b, prop))
2295
+ __defNormalProp$C(a, prop, b[prop]);
2296
+ if (__getOwnPropSymbols$C)
2297
+ for (var prop of __getOwnPropSymbols$C(b)) {
2298
+ if (__propIsEnum$C.call(b, prop))
2299
+ __defNormalProp$C(a, prop, b[prop]);
2302
2300
  }
2303
2301
  return a;
2304
2302
  };
2305
- var __spreadProps$s = (a, b) => __defProps$s(a, __getOwnPropDescs$s(b));
2303
+ var __spreadProps$q = (a, b) => __defProps$q(a, __getOwnPropDescs$q(b));
2306
2304
  const passthroughProcessor = (_, secondary) => rxjs.of(secondary);
2307
2305
  const extraQueryProcessingOperator = (processors) => (data) => {
2308
2306
  return data.pipe(
@@ -2315,7 +2313,7 @@ const extraQueryProcessingOperator = (processors) => (data) => {
2315
2313
  }),
2316
2314
  rxjs.map(([primary, ...processedSecondaries]) => {
2317
2315
  var _a;
2318
- return __spreadProps$s(__spreadValues$E({}, primary), {
2316
+ return __spreadProps$q(__spreadValues$C({}, primary), {
2319
2317
  series: [...primary.series, ...processedSecondaries.flatMap((s) => s.series)],
2320
2318
  annotations: [...(_a = primary.annotations) != null ? _a : [], ...processedSecondaries.flatMap((s) => {
2321
2319
  var _a2;
@@ -2326,25 +2324,25 @@ const extraQueryProcessingOperator = (processors) => (data) => {
2326
2324
  );
2327
2325
  };
2328
2326
 
2329
- var __defProp$D = Object.defineProperty;
2330
- var __defProps$r = Object.defineProperties;
2331
- var __getOwnPropDescs$r = Object.getOwnPropertyDescriptors;
2332
- var __getOwnPropSymbols$D = Object.getOwnPropertySymbols;
2333
- var __hasOwnProp$D = Object.prototype.hasOwnProperty;
2334
- var __propIsEnum$D = Object.prototype.propertyIsEnumerable;
2335
- var __defNormalProp$D = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2336
- var __spreadValues$D = (a, b) => {
2327
+ var __defProp$B = Object.defineProperty;
2328
+ var __defProps$p = Object.defineProperties;
2329
+ var __getOwnPropDescs$p = Object.getOwnPropertyDescriptors;
2330
+ var __getOwnPropSymbols$B = Object.getOwnPropertySymbols;
2331
+ var __hasOwnProp$B = Object.prototype.hasOwnProperty;
2332
+ var __propIsEnum$B = Object.prototype.propertyIsEnumerable;
2333
+ var __defNormalProp$B = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2334
+ var __spreadValues$B = (a, b) => {
2337
2335
  for (var prop in b || (b = {}))
2338
- if (__hasOwnProp$D.call(b, prop))
2339
- __defNormalProp$D(a, prop, b[prop]);
2340
- if (__getOwnPropSymbols$D)
2341
- for (var prop of __getOwnPropSymbols$D(b)) {
2342
- if (__propIsEnum$D.call(b, prop))
2343
- __defNormalProp$D(a, prop, b[prop]);
2336
+ if (__hasOwnProp$B.call(b, prop))
2337
+ __defNormalProp$B(a, prop, b[prop]);
2338
+ if (__getOwnPropSymbols$B)
2339
+ for (var prop of __getOwnPropSymbols$B(b)) {
2340
+ if (__propIsEnum$B.call(b, prop))
2341
+ __defNormalProp$B(a, prop, b[prop]);
2344
2342
  }
2345
2343
  return a;
2346
2344
  };
2347
- var __spreadProps$r = (a, b) => __defProps$r(a, __getOwnPropDescs$r(b));
2345
+ var __spreadProps$p = (a, b) => __defProps$p(a, __getOwnPropDescs$p(b));
2348
2346
  function filterAnnotations(data, filters) {
2349
2347
  var _a;
2350
2348
  if (!Array.isArray(data) || data.length === 0) {
@@ -2395,11 +2393,11 @@ function filterAnnotations(data, filters) {
2395
2393
  continue;
2396
2394
  }
2397
2395
  }
2398
- fields.push(__spreadProps$r(__spreadValues$D({}, field), {
2396
+ fields.push(__spreadProps$p(__spreadValues$B({}, field), {
2399
2397
  values: buffer
2400
2398
  }));
2401
2399
  }
2402
- processed.push(__spreadProps$r(__spreadValues$D({}, frame), {
2400
+ processed.push(__spreadProps$p(__spreadValues$B({}, frame), {
2403
2401
  fields,
2404
2402
  length: frameLength
2405
2403
  }));
@@ -2825,33 +2823,33 @@ function getOptionSearcher(options, includeAll) {
2825
2823
  };
2826
2824
  }
2827
2825
 
2828
- var __defProp$C = Object.defineProperty;
2829
- var __defProps$q = Object.defineProperties;
2830
- var __getOwnPropDescs$q = Object.getOwnPropertyDescriptors;
2831
- var __getOwnPropSymbols$C = Object.getOwnPropertySymbols;
2832
- var __hasOwnProp$C = Object.prototype.hasOwnProperty;
2833
- var __propIsEnum$C = Object.prototype.propertyIsEnumerable;
2834
- var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2835
- var __spreadValues$C = (a, b) => {
2826
+ var __defProp$A = Object.defineProperty;
2827
+ var __defProps$o = Object.defineProperties;
2828
+ var __getOwnPropDescs$o = Object.getOwnPropertyDescriptors;
2829
+ var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
2830
+ var __hasOwnProp$A = Object.prototype.hasOwnProperty;
2831
+ var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
2832
+ var __defNormalProp$A = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2833
+ var __spreadValues$A = (a, b) => {
2836
2834
  for (var prop in b || (b = {}))
2837
- if (__hasOwnProp$C.call(b, prop))
2838
- __defNormalProp$C(a, prop, b[prop]);
2839
- if (__getOwnPropSymbols$C)
2840
- for (var prop of __getOwnPropSymbols$C(b)) {
2841
- if (__propIsEnum$C.call(b, prop))
2842
- __defNormalProp$C(a, prop, b[prop]);
2835
+ if (__hasOwnProp$A.call(b, prop))
2836
+ __defNormalProp$A(a, prop, b[prop]);
2837
+ if (__getOwnPropSymbols$A)
2838
+ for (var prop of __getOwnPropSymbols$A(b)) {
2839
+ if (__propIsEnum$A.call(b, prop))
2840
+ __defNormalProp$A(a, prop, b[prop]);
2843
2841
  }
2844
2842
  return a;
2845
2843
  };
2846
- var __spreadProps$q = (a, b) => __defProps$q(a, __getOwnPropDescs$q(b));
2847
- var __objRest$4 = (source, exclude) => {
2844
+ var __spreadProps$o = (a, b) => __defProps$o(a, __getOwnPropDescs$o(b));
2845
+ var __objRest$3 = (source, exclude) => {
2848
2846
  var target = {};
2849
2847
  for (var prop in source)
2850
- if (__hasOwnProp$C.call(source, prop) && exclude.indexOf(prop) < 0)
2848
+ if (__hasOwnProp$A.call(source, prop) && exclude.indexOf(prop) < 0)
2851
2849
  target[prop] = source[prop];
2852
- if (source != null && __getOwnPropSymbols$C)
2853
- for (var prop of __getOwnPropSymbols$C(source)) {
2854
- if (exclude.indexOf(prop) < 0 && __propIsEnum$C.call(source, prop))
2850
+ if (source != null && __getOwnPropSymbols$A)
2851
+ for (var prop of __getOwnPropSymbols$A(source)) {
2852
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$A.call(source, prop))
2855
2853
  target[prop] = source[prop];
2856
2854
  }
2857
2855
  return target;
@@ -2979,11 +2977,11 @@ const OptionWithCheckbox = ({
2979
2977
  renderOptionLabel
2980
2978
  }) => {
2981
2979
  var _b;
2982
- const _a = innerProps, rest = __objRest$4(_a, ["onMouseMove", "onMouseOver"]);
2980
+ const _a = innerProps, rest = __objRest$3(_a, ["onMouseMove", "onMouseOver"]);
2983
2981
  const theme = ui.useTheme2();
2984
2982
  const selectStyles = ui.getSelectStyles(theme);
2985
2983
  const optionStyles = ui.useStyles2(getOptionStyles);
2986
- return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$q(__spreadValues$C({
2984
+ return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$o(__spreadValues$A({
2987
2985
  ref: innerRef,
2988
2986
  className: css.cx(selectStyles.option, isFocused && selectStyles.optionFocused)
2989
2987
  }, rest), {
@@ -3082,31 +3080,68 @@ function getEnrichedFiltersRequest(sourceRunner) {
3082
3080
  if (isFiltersRequestEnricher(root)) {
3083
3081
  return root.enrichFiltersRequest(sourceRunner);
3084
3082
  }
3085
- return null;
3083
+ return null;
3084
+ }
3085
+
3086
+ var __accessCheck$1 = (obj, member, msg) => {
3087
+ if (!member.has(obj))
3088
+ throw TypeError("Cannot " + msg);
3089
+ };
3090
+ var __privateGet$1 = (obj, member, getter) => {
3091
+ __accessCheck$1(obj, member, "read from private field");
3092
+ return getter ? getter.call(obj) : member.get(obj);
3093
+ };
3094
+ var __privateAdd$1 = (obj, member, value) => {
3095
+ if (member.has(obj))
3096
+ throw TypeError("Cannot add the same private member more than once");
3097
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
3098
+ };
3099
+ var __privateSet$1 = (obj, member, value, setter) => {
3100
+ __accessCheck$1(obj, member, "write to private field");
3101
+ setter ? setter.call(obj, value) : member.set(obj, value);
3102
+ return value;
3103
+ };
3104
+ var _value;
3105
+ class SafeSerializableSceneObject {
3106
+ constructor(value) {
3107
+ __privateAdd$1(this, _value, void 0);
3108
+ this.text = "__sceneObject";
3109
+ __privateSet$1(this, _value, value);
3110
+ }
3111
+ toString() {
3112
+ return void 0;
3113
+ }
3114
+ valueOf() {
3115
+ return __privateGet$1(this, _value);
3116
+ }
3117
+ get value() {
3118
+ return this;
3119
+ }
3086
3120
  }
3121
+ _value = new WeakMap();
3087
3122
 
3088
- var __defProp$B = Object.defineProperty;
3089
- var __defProps$p = Object.defineProperties;
3090
- var __getOwnPropDescs$p = Object.getOwnPropertyDescriptors;
3091
- var __getOwnPropSymbols$B = Object.getOwnPropertySymbols;
3092
- var __hasOwnProp$B = Object.prototype.hasOwnProperty;
3093
- var __propIsEnum$B = Object.prototype.propertyIsEnumerable;
3094
- var __defNormalProp$B = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3095
- var __spreadValues$B = (a, b) => {
3123
+ var __defProp$z = Object.defineProperty;
3124
+ var __defProps$n = Object.defineProperties;
3125
+ var __getOwnPropDescs$n = Object.getOwnPropertyDescriptors;
3126
+ var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
3127
+ var __hasOwnProp$z = Object.prototype.hasOwnProperty;
3128
+ var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
3129
+ var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3130
+ var __spreadValues$z = (a, b) => {
3096
3131
  for (var prop in b || (b = {}))
3097
- if (__hasOwnProp$B.call(b, prop))
3098
- __defNormalProp$B(a, prop, b[prop]);
3099
- if (__getOwnPropSymbols$B)
3100
- for (var prop of __getOwnPropSymbols$B(b)) {
3101
- if (__propIsEnum$B.call(b, prop))
3102
- __defNormalProp$B(a, prop, b[prop]);
3132
+ if (__hasOwnProp$z.call(b, prop))
3133
+ __defNormalProp$z(a, prop, b[prop]);
3134
+ if (__getOwnPropSymbols$z)
3135
+ for (var prop of __getOwnPropSymbols$z(b)) {
3136
+ if (__propIsEnum$z.call(b, prop))
3137
+ __defNormalProp$z(a, prop, b[prop]);
3103
3138
  }
3104
3139
  return a;
3105
3140
  };
3106
- var __spreadProps$p = (a, b) => __defProps$p(a, __getOwnPropDescs$p(b));
3141
+ var __spreadProps$n = (a, b) => __defProps$n(a, __getOwnPropDescs$n(b));
3107
3142
  class GroupByVariable extends MultiValueVariable {
3108
3143
  constructor(initialState) {
3109
- super(__spreadProps$p(__spreadValues$B({
3144
+ super(__spreadProps$n(__spreadValues$z({
3110
3145
  isMulti: true,
3111
3146
  name: "",
3112
3147
  value: [],
@@ -3129,9 +3164,7 @@ class GroupByVariable extends MultiValueVariable {
3129
3164
  return override.values;
3130
3165
  }
3131
3166
  if (this.state.defaultOptions) {
3132
- return this.state.defaultOptions.concat(
3133
- dataFromResponse((_c = override == null ? void 0 : override.values) != null ? _c : [])
3134
- );
3167
+ return this.state.defaultOptions.concat(dataFromResponse((_c = override == null ? void 0 : override.values) != null ? _c : []));
3135
3168
  }
3136
3169
  if (!ds.getTagKeys) {
3137
3170
  return [];
@@ -3139,7 +3172,11 @@ class GroupByVariable extends MultiValueVariable {
3139
3172
  const queries = getQueriesForVariables(this);
3140
3173
  const otherFilters = this.state.baseFilters || [];
3141
3174
  const timeRange = sceneGraph.getTimeRange(this).state.value;
3142
- const response = await ds.getTagKeys(__spreadValues$B({ filters: otherFilters, queries, timeRange }, getEnrichedFiltersRequest(this)));
3175
+ const response = await ds.getTagKeys(__spreadValues$z({
3176
+ filters: otherFilters,
3177
+ queries,
3178
+ timeRange
3179
+ }, getEnrichedFiltersRequest(this)));
3143
3180
  if (responseHasError(response)) {
3144
3181
  this.setState({ error: response.error.message });
3145
3182
  }
@@ -3189,7 +3226,7 @@ class GroupByVariable extends MultiValueVariable {
3189
3226
  this.setState({ loading: true, error: null });
3190
3227
  return rxjs.from(
3191
3228
  getDataSource(this.state.datasource, {
3192
- __sceneObject: { text: "__sceneObject", value: this }
3229
+ __sceneObject: new SafeSerializableSceneObject(this)
3193
3230
  })
3194
3231
  ).pipe(
3195
3232
  rxjs.mergeMap((ds) => {
@@ -3330,7 +3367,7 @@ function LoadingIndicator(props) {
3330
3367
  }
3331
3368
 
3332
3369
  function ControlsLabel(props) {
3333
- const styles = ui.useStyles2(getStyles$c);
3370
+ const styles = ui.useStyles2(getStyles$a);
3334
3371
  const theme = ui.useTheme2();
3335
3372
  const isVertical = props.layout === "vertical";
3336
3373
  const loadingIndicator = Boolean(props.isLoading) ? /* @__PURE__ */ React__default["default"].createElement("div", {
@@ -3393,7 +3430,7 @@ function ControlsLabel(props) {
3393
3430
  }
3394
3431
  return labelElement;
3395
3432
  }
3396
- const getStyles$c = (theme) => ({
3433
+ const getStyles$a = (theme) => ({
3397
3434
  horizontalLabel: css.css({
3398
3435
  background: theme.isDark ? theme.colors.background.primary : theme.colors.background.secondary,
3399
3436
  display: `flex`,
@@ -3473,7 +3510,7 @@ function keyLabelToOption(key, label) {
3473
3510
  const filterNoOp = () => true;
3474
3511
  function AdHocFilterRenderer({ filter, model }) {
3475
3512
  var _a, _b;
3476
- const styles = ui.useStyles2(getStyles$b);
3513
+ const styles = ui.useStyles2(getStyles$9);
3477
3514
  const [keys, setKeys] = React.useState([]);
3478
3515
  const [values, setValues] = React.useState([]);
3479
3516
  const [isKeysLoading, setIsKeysLoading] = React.useState(false);
@@ -3484,7 +3521,10 @@ function AdHocFilterRenderer({ filter, model }) {
3484
3521
  const [valueHasCustomValue, setValueHasCustomValue] = React.useState(false);
3485
3522
  const keyValue = keyLabelToOption(filter.key, filter.keyLabel);
3486
3523
  const valueValue = keyLabelToOption(filter.value, filter.valueLabel);
3487
- const optionSearcher = React.useMemo(() => getAdhocOptionSearcher(values), [values]);
3524
+ const optionSearcher = React.useMemo(
3525
+ () => getAdhocOptionSearcher(values),
3526
+ [values]
3527
+ );
3488
3528
  const onValueInputChange = (value, { action }) => {
3489
3529
  if (action === "input-change") {
3490
3530
  setValueInputValue(value);
@@ -3614,7 +3654,7 @@ function AdHocFilterRenderer({ filter, model }) {
3614
3654
  onClick: () => model._removeFilter(filter)
3615
3655
  }));
3616
3656
  }
3617
- const getStyles$b = (theme) => ({
3657
+ const getStyles$9 = (theme) => ({
3618
3658
  field: css.css({
3619
3659
  marginBottom: 0
3620
3660
  }),
@@ -3752,564 +3792,6 @@ function isFilter(filter) {
3752
3792
  return filter !== null && typeof filter.key === "string" && typeof filter.value === "string";
3753
3793
  }
3754
3794
 
3755
- var __defProp$A = Object.defineProperty;
3756
- var __defProps$o = Object.defineProperties;
3757
- var __getOwnPropDescs$o = Object.getOwnPropertyDescriptors;
3758
- var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
3759
- var __hasOwnProp$A = Object.prototype.hasOwnProperty;
3760
- var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
3761
- var __defNormalProp$A = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3762
- var __spreadValues$A = (a, b) => {
3763
- for (var prop in b || (b = {}))
3764
- if (__hasOwnProp$A.call(b, prop))
3765
- __defNormalProp$A(a, prop, b[prop]);
3766
- if (__getOwnPropSymbols$A)
3767
- for (var prop of __getOwnPropSymbols$A(b)) {
3768
- if (__propIsEnum$A.call(b, prop))
3769
- __defNormalProp$A(a, prop, b[prop]);
3770
- }
3771
- return a;
3772
- };
3773
- var __spreadProps$o = (a, b) => __defProps$o(a, __getOwnPropDescs$o(b));
3774
- var __objRest$3 = (source, exclude) => {
3775
- var target = {};
3776
- for (var prop in source)
3777
- if (__hasOwnProp$A.call(source, prop) && exclude.indexOf(prop) < 0)
3778
- target[prop] = source[prop];
3779
- if (source != null && __getOwnPropSymbols$A)
3780
- for (var prop of __getOwnPropSymbols$A(source)) {
3781
- if (exclude.indexOf(prop) < 0 && __propIsEnum$A.call(source, prop))
3782
- target[prop] = source[prop];
3783
- }
3784
- return target;
3785
- };
3786
- const Item = React.forwardRef(
3787
- (_a, ref) => {
3788
- var _b = _a, { children, active } = _b, rest = __objRest$3(_b, ["children", "active"]);
3789
- const theme = ui.useTheme2();
3790
- const selectStyles = ui.getSelectStyles(theme);
3791
- const id = react.useId();
3792
- return /* @__PURE__ */ React__default["default"].createElement("div", __spreadValues$A({
3793
- ref,
3794
- role: "option",
3795
- id,
3796
- "aria-selected": active,
3797
- className: css.cx(selectStyles.option, active && selectStyles.optionFocused)
3798
- }, rest), /* @__PURE__ */ React__default["default"].createElement("div", {
3799
- className: selectStyles.optionBody,
3800
- "data-testid": `data-testid ad hoc filter option value ${children}`
3801
- }, /* @__PURE__ */ React__default["default"].createElement("span", null, children)));
3802
- }
3803
- );
3804
- const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model, wip, handleChangeViewMode }, parentRef) {
3805
- var _a;
3806
- const [open, setOpen] = React.useState(false);
3807
- const [options, setOptions] = React.useState([]);
3808
- const [optionsLoading, setOptionsLoading] = React.useState(false);
3809
- const [optionsError, setOptionsError] = React.useState(false);
3810
- const [inputValue, setInputValue] = React.useState("");
3811
- const [activeIndex, setActiveIndex] = React.useState(null);
3812
- const [inputType, setInputType] = React.useState(!wip ? "value" : "key");
3813
- const styles = ui.useStyles2(getStyles2);
3814
- const listRef = React.useRef([]);
3815
- const { _wip } = model.useState();
3816
- const handleResetWip = React.useCallback(() => {
3817
- if (wip) {
3818
- model._addWip();
3819
- setInputType("key");
3820
- setInputValue("");
3821
- }
3822
- }, [model, wip]);
3823
- const filterToUse = filter || _wip;
3824
- const operatorIdentifier = `${(_a = filterToUse == null ? void 0 : filterToUse.key) != null ? _a : ""}-operator`;
3825
- const { refs, floatingStyles, context } = react.useFloating({
3826
- whileElementsMounted: react.autoUpdate,
3827
- open,
3828
- onOpenChange: (nextOpen, _, reason) => {
3829
- setOpen(nextOpen);
3830
- if (["outside-press", "escape-key"].includes(reason || "")) {
3831
- handleResetWip();
3832
- handleChangeViewMode == null ? void 0 : handleChangeViewMode();
3833
- }
3834
- },
3835
- middleware: [
3836
- react.flip({ padding: 10 }),
3837
- react.size({
3838
- apply({ rects, availableHeight, elements }) {
3839
- Object.assign(elements.floating.style, {
3840
- width: `${rects.reference.width}px`,
3841
- maxHeight: `${availableHeight > 256 ? 256 : availableHeight}px`
3842
- });
3843
- },
3844
- padding: 10
3845
- })
3846
- ]
3847
- });
3848
- const role = react.useRole(context, { role: "listbox" });
3849
- const dismiss = react.useDismiss(context, {
3850
- outsidePress: (event) => {
3851
- return !event.currentTarget.classList.contains(
3852
- operatorIdentifier
3853
- );
3854
- }
3855
- });
3856
- const listNav = react.useListNavigation(context, {
3857
- listRef,
3858
- activeIndex,
3859
- onNavigate: setActiveIndex,
3860
- virtual: true,
3861
- loop: true
3862
- });
3863
- const { getReferenceProps, getFloatingProps, getItemProps } = react.useInteractions([role, dismiss, listNav]);
3864
- React.useImperativeHandle(parentRef, () => () => {
3865
- var _a2;
3866
- return (_a2 = refs.domReference.current) == null ? void 0 : _a2.focus();
3867
- }, [refs.domReference]);
3868
- function onChange(event) {
3869
- var _a2, _b;
3870
- if (inputType === "key") {
3871
- const lastChar = event.target.value.slice(-1);
3872
- if (["=", "!", "<", ">"].includes(lastChar)) {
3873
- const key = event.target.value.slice(0, -1);
3874
- const optionIndex = options.findIndex((option) => option.value === key);
3875
- if (optionIndex >= 0) {
3876
- model._updateFilter(filterToUse, inputType, options[optionIndex]);
3877
- setInputValue(lastChar);
3878
- }
3879
- reactDom.flushSync(() => {
3880
- setInputType("operator");
3881
- });
3882
- (_a2 = refs.domReference.current) == null ? void 0 : _a2.focus();
3883
- return;
3884
- }
3885
- }
3886
- if (inputType === "operator") {
3887
- const lastChar = event.target.value.slice(-1);
3888
- if (/\w/.test(lastChar)) {
3889
- const operator = event.target.value.slice(0, -1);
3890
- if (!/\w/.test(operator)) {
3891
- const optionIndex = options.findIndex((option) => option.value === operator);
3892
- if (optionIndex >= 0) {
3893
- model._updateFilter(filterToUse, inputType, options[optionIndex]);
3894
- setInputValue(lastChar);
3895
- }
3896
- reactDom.flushSync(() => {
3897
- setInputType("value");
3898
- });
3899
- (_b = refs.domReference.current) == null ? void 0 : _b.focus();
3900
- return;
3901
- }
3902
- }
3903
- }
3904
- const value = event.target.value;
3905
- setInputValue(value);
3906
- setActiveIndex(0);
3907
- }
3908
- const items = options.filter(
3909
- (item) => {
3910
- var _a2, _b;
3911
- return (_b = (_a2 = item.label) != null ? _a2 : item.value) == null ? void 0 : _b.toLocaleLowerCase().startsWith(inputValue.toLowerCase());
3912
- }
3913
- );
3914
- const flushInputType = React.useCallback((inputType2) => {
3915
- reactDom.flushSync(() => {
3916
- setInputType(inputType2);
3917
- });
3918
- }, []);
3919
- React.useEffect(() => {
3920
- if (wip && !_wip) {
3921
- model._addWip();
3922
- }
3923
- }, [_wip]);
3924
- React.useEffect(() => {
3925
- if (!wip && refs.domReference.current) {
3926
- setInputType("value");
3927
- setInputValue("");
3928
- refs.domReference.current.focus();
3929
- }
3930
- }, []);
3931
- const handleFetchOptions = React.useCallback(
3932
- async (inputType2) => {
3933
- setOptionsError(false);
3934
- setOptionsLoading(true);
3935
- setOptions([]);
3936
- let options2 = [];
3937
- try {
3938
- if (inputType2 === "key") {
3939
- options2 = await model._getKeys(null);
3940
- } else if (inputType2 === "operator") {
3941
- options2 = model._getOperators();
3942
- } else if (inputType2 === "value") {
3943
- options2 = await model._getValuesFor(filterToUse);
3944
- }
3945
- setOptions(options2);
3946
- } catch (e) {
3947
- setOptionsError(true);
3948
- }
3949
- setOptionsLoading(false);
3950
- },
3951
- [filterToUse, model]
3952
- );
3953
- const handleBackspaceInput = React.useCallback(
3954
- (event) => {
3955
- if (event.key === "Backspace" && !inputValue && inputType === "key") {
3956
- model._removeLastFilter();
3957
- handleFetchOptions(inputType);
3958
- }
3959
- },
3960
- [inputValue, inputType]
3961
- );
3962
- const handleTabInput = React.useCallback((event) => {
3963
- if (event.key === "Tab" && !event.shiftKey) {
3964
- handleChangeViewMode == null ? void 0 : handleChangeViewMode();
3965
- handleResetWip();
3966
- }
3967
- }, []);
3968
- const handleShiftTabInput = React.useCallback((event) => {
3969
- if (event.key === "Tab" && event.shiftKey) {
3970
- handleChangeViewMode == null ? void 0 : handleChangeViewMode();
3971
- handleResetWip();
3972
- }
3973
- }, []);
3974
- const handleEnterInput = React.useCallback(
3975
- (event) => {
3976
- var _a2;
3977
- if (event.key === "Enter" && activeIndex != null && items[activeIndex]) {
3978
- model._updateFilter(filterToUse, inputType, items[activeIndex]);
3979
- setInputValue("");
3980
- setActiveIndex(0);
3981
- if (inputType === "key") {
3982
- flushInputType("operator");
3983
- } else if (inputType === "operator") {
3984
- flushInputType("value");
3985
- } else if (inputType === "value") {
3986
- flushInputType("key");
3987
- handleChangeViewMode == null ? void 0 : handleChangeViewMode();
3988
- }
3989
- (_a2 = refs.domReference.current) == null ? void 0 : _a2.focus();
3990
- }
3991
- },
3992
- [activeIndex, filterToUse, inputType, items, model]
3993
- );
3994
- React.useEffect(() => {
3995
- if (open) {
3996
- handleFetchOptions(inputType);
3997
- }
3998
- }, [open, inputType]);
3999
- return /* @__PURE__ */ React__default["default"].createElement("div", {
4000
- className: styles.comboboxWrapper
4001
- }, filterToUse ? /* @__PURE__ */ React__default["default"].createElement("div", {
4002
- className: styles.pillWrapper
4003
- }, (filterToUse == null ? void 0 : filterToUse.key) ? /* @__PURE__ */ React__default["default"].createElement("div", {
4004
- className: css.cx(styles.basePill, styles.keyPill)
4005
- }, filterToUse.key) : null, (filterToUse == null ? void 0 : filterToUse.key) && (filterToUse == null ? void 0 : filterToUse.operator) && inputType !== "operator" ? /* @__PURE__ */ React__default["default"].createElement("div", {
4006
- className: css.cx(styles.basePill, styles.operatorPill, operatorIdentifier),
4007
- role: "button",
4008
- "aria-label": "Edit filter operator",
4009
- tabIndex: 0,
4010
- onClick: (event) => {
4011
- var _a2;
4012
- event.stopPropagation();
4013
- flushInputType("operator");
4014
- (_a2 = refs.domReference.current) == null ? void 0 : _a2.focus();
4015
- },
4016
- onKeyDown: (event) => {
4017
- var _a2;
4018
- handleShiftTabInput(event);
4019
- if (event.key === "Enter") {
4020
- flushInputType("operator");
4021
- (_a2 = refs.domReference.current) == null ? void 0 : _a2.focus();
4022
- }
4023
- }
4024
- }, filterToUse.operator) : null, (filterToUse == null ? void 0 : filterToUse.key) && (filterToUse == null ? void 0 : filterToUse.operator) && (filterToUse == null ? void 0 : filterToUse.value) && !["operator", "value"].includes(inputType) ? /* @__PURE__ */ React__default["default"].createElement("div", {
4025
- className: css.cx(styles.basePill, styles.valuePill)
4026
- }, filterToUse.value) : null) : null, /* @__PURE__ */ React__default["default"].createElement("input", __spreadProps$o(__spreadValues$A({}, getReferenceProps({
4027
- ref: refs.setReference,
4028
- onChange,
4029
- value: inputValue,
4030
- placeholder: !wip ? inputType === "operator" ? `${filterToUse[inputType]} ${filterToUse.value || ""}` : filterToUse[inputType] : "Filter by label values",
4031
- "aria-autocomplete": "list",
4032
- onKeyDown(event) {
4033
- if (inputType === "operator") {
4034
- handleShiftTabInput(event);
4035
- }
4036
- handleBackspaceInput(event);
4037
- handleTabInput(event);
4038
- handleEnterInput(event);
4039
- }
4040
- })), {
4041
- className: styles.inputStyle,
4042
- onClick: (event) => {
4043
- event.stopPropagation();
4044
- setOpen(true);
4045
- },
4046
- onFocus: () => {
4047
- setActiveIndex(0);
4048
- setOpen(true);
4049
- }
4050
- })), /* @__PURE__ */ React__default["default"].createElement(react.FloatingPortal, null, open && /* @__PURE__ */ React__default["default"].createElement(react.FloatingFocusManager, {
4051
- context,
4052
- initialFocus: -1,
4053
- visuallyHiddenDismiss: true
4054
- }, /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$o(__spreadValues$A({}, getFloatingProps({
4055
- ref: refs.setFloating,
4056
- style: __spreadProps$o(__spreadValues$A({}, floatingStyles), {
4057
- overflowY: "auto"
4058
- })
4059
- })), {
4060
- className: styles.dropdownWrapper
4061
- }), optionsLoading ? /* @__PURE__ */ React__default["default"].createElement(LoadingOptionsPlaceholder, null) : optionsError ? /* @__PURE__ */ React__default["default"].createElement(OptionsErrorPlaceholder, {
4062
- handleFetchOptions: () => handleFetchOptions(inputType)
4063
- }) : !items.length ? /* @__PURE__ */ React__default["default"].createElement(NoOptionsPlaceholder, null) : items.map((item, index) => {
4064
- var _a2;
4065
- return /* @__PURE__ */ React__default["default"].createElement(Item, __spreadProps$o(__spreadValues$A({}, getItemProps({
4066
- key: item.value,
4067
- ref(node) {
4068
- listRef.current[index] = node;
4069
- },
4070
- onClick() {
4071
- var _a3;
4072
- model._updateFilter(filterToUse, inputType, item);
4073
- setInputValue("");
4074
- if (inputType === "key") {
4075
- flushInputType("operator");
4076
- } else if (inputType === "operator") {
4077
- flushInputType("value");
4078
- } else if (inputType === "value") {
4079
- flushInputType("key");
4080
- handleChangeViewMode == null ? void 0 : handleChangeViewMode();
4081
- }
4082
- (_a3 = refs.domReference.current) == null ? void 0 : _a3.focus();
4083
- }
4084
- })), {
4085
- active: activeIndex === index
4086
- }), (_a2 = item.label) != null ? _a2 : item.value);
4087
- })))));
4088
- });
4089
- const LoadingOptionsPlaceholder = () => {
4090
- return /* @__PURE__ */ React__default["default"].createElement(Item, {
4091
- active: false
4092
- }, "Loading options...");
4093
- };
4094
- const NoOptionsPlaceholder = () => {
4095
- return /* @__PURE__ */ React__default["default"].createElement(Item, {
4096
- active: false
4097
- }, "No options found");
4098
- };
4099
- const OptionsErrorPlaceholder = ({ handleFetchOptions }) => {
4100
- return /* @__PURE__ */ React__default["default"].createElement(Item, {
4101
- active: false,
4102
- onClick: handleFetchOptions
4103
- }, "Error. Click to try again!");
4104
- };
4105
- const getStyles2 = (theme) => ({
4106
- comboboxWrapper: css.css({
4107
- display: "flex",
4108
- flexWrap: "nowrap"
4109
- }),
4110
- pillWrapper: css.css({
4111
- display: "flex",
4112
- alignItems: "center",
4113
- whiteSpace: "nowrap"
4114
- }),
4115
- basePill: css.css(__spreadProps$o(__spreadValues$A({
4116
- display: "flex",
4117
- alignItems: "center",
4118
- background: theme.colors.action.disabledBackground,
4119
- border: `1px solid ${theme.colors.border.weak}`,
4120
- padding: theme.spacing(0.125, 1, 0.125, 1),
4121
- color: theme.colors.text.primary,
4122
- overflow: "hidden",
4123
- whiteSpace: "nowrap",
4124
- minHeight: "22px"
4125
- }, theme.typography.bodySmall), {
4126
- cursor: "pointer"
4127
- })),
4128
- keyPill: css.css({
4129
- fontWeight: theme.typography.fontWeightBold,
4130
- cursor: "default"
4131
- }),
4132
- operatorPill: css.css({
4133
- "&:hover": {
4134
- background: theme.colors.action.hover
4135
- }
4136
- }),
4137
- valuePill: css.css({
4138
- background: theme.colors.action.selected
4139
- }),
4140
- dropdownWrapper: css.css({
4141
- backgroundColor: theme.colors.background.primary,
4142
- color: theme.colors.text.primary,
4143
- boxShadow: theme.shadows.z2
4144
- }),
4145
- inputStyle: css.css({
4146
- paddingBlock: 0,
4147
- "&:focus": {
4148
- outline: "none"
4149
- }
4150
- })
4151
- });
4152
-
4153
- var __defProp$z = Object.defineProperty;
4154
- var __defProps$n = Object.defineProperties;
4155
- var __getOwnPropDescs$n = Object.getOwnPropertyDescriptors;
4156
- var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
4157
- var __hasOwnProp$z = Object.prototype.hasOwnProperty;
4158
- var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
4159
- var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4160
- var __spreadValues$z = (a, b) => {
4161
- for (var prop in b || (b = {}))
4162
- if (__hasOwnProp$z.call(b, prop))
4163
- __defNormalProp$z(a, prop, b[prop]);
4164
- if (__getOwnPropSymbols$z)
4165
- for (var prop of __getOwnPropSymbols$z(b)) {
4166
- if (__propIsEnum$z.call(b, prop))
4167
- __defNormalProp$z(a, prop, b[prop]);
4168
- }
4169
- return a;
4170
- };
4171
- var __spreadProps$n = (a, b) => __defProps$n(a, __getOwnPropDescs$n(b));
4172
- function AdHocFiltersComboboxEditSwitch({
4173
- filter,
4174
- model
4175
- }) {
4176
- const styles = ui.useStyles2(getStyles$a);
4177
- const [viewMode, setViewMode] = React.useState(true);
4178
- const pillWrapperRef = React.useRef(null);
4179
- const handleChangeViewMode = React.useCallback((event) => {
4180
- var _a;
4181
- event == null ? void 0 : event.stopPropagation();
4182
- let viewMode2 = false;
4183
- reactDom.flushSync(() => {
4184
- setViewMode((mode) => {
4185
- viewMode2 = mode;
4186
- return !mode;
4187
- });
4188
- });
4189
- if (!viewMode2) {
4190
- (_a = pillWrapperRef.current) == null ? void 0 : _a.focus();
4191
- }
4192
- }, []);
4193
- if (viewMode) {
4194
- return /* @__PURE__ */ React__default["default"].createElement("div", {
4195
- className: styles.combinedFilterPill,
4196
- onClick: handleChangeViewMode,
4197
- onKeyDown: (e) => {
4198
- if (e.key === "Enter") {
4199
- handleChangeViewMode();
4200
- }
4201
- },
4202
- role: "button",
4203
- "aria-label": "Edit filter",
4204
- tabIndex: 0,
4205
- ref: pillWrapperRef
4206
- }, /* @__PURE__ */ React__default["default"].createElement("span", null, filter.key, " ", filter.operator, " ", filter.value), /* @__PURE__ */ React__default["default"].createElement(ui.IconButton, {
4207
- onClick: (e) => {
4208
- e.stopPropagation();
4209
- model._removeFilter(filter);
4210
- },
4211
- onKeyDownCapture: (e) => {
4212
- if (e.key === "Enter") {
4213
- e.preventDefault();
4214
- e.stopPropagation();
4215
- model._removeFilter(filter);
4216
- }
4217
- },
4218
- name: "times",
4219
- size: "md",
4220
- className: styles.removeButton,
4221
- tooltip: "Remove filter"
4222
- }));
4223
- }
4224
- return /* @__PURE__ */ React__default["default"].createElement(AdHocCombobox, {
4225
- filter,
4226
- model,
4227
- handleChangeViewMode
4228
- });
4229
- }
4230
- const getStyles$a = (theme) => ({
4231
- combinedFilterPill: css.css(__spreadProps$n(__spreadValues$z({
4232
- display: "flex",
4233
- alignItems: "center",
4234
- background: theme.colors.action.selected,
4235
- borderRadius: theme.shape.radius.default,
4236
- border: `1px solid ${theme.colors.border.weak}`,
4237
- padding: theme.spacing(0.125, 0, 0.125, 1),
4238
- color: theme.colors.text.primary,
4239
- overflow: "hidden",
4240
- whiteSpace: "nowrap",
4241
- minHeight: "22px"
4242
- }, theme.typography.bodySmall), {
4243
- fontWeight: theme.typography.fontWeightBold,
4244
- cursor: "pointer",
4245
- "&:hover": {
4246
- background: theme.colors.action.hover
4247
- }
4248
- })),
4249
- removeButton: css.css({
4250
- marginInline: theme.spacing(0.5),
4251
- cursor: "pointer",
4252
- "&:hover": {
4253
- color: theme.colors.text.primary
4254
- }
4255
- })
4256
- });
4257
-
4258
- const AdHocFiltersComboboxRenderer = React.memo(function AdHocFiltersComboboxRenderer2({
4259
- model
4260
- }) {
4261
- const { filters } = model.useState();
4262
- const styles = ui.useStyles2(getStyles$9);
4263
- const focusOnInputRef = React.useRef();
4264
- return /* @__PURE__ */ React__default["default"].createElement("div", {
4265
- className: styles.comboboxWrapper,
4266
- onClick: () => {
4267
- var _a;
4268
- (_a = focusOnInputRef.current) == null ? void 0 : _a.call(focusOnInputRef);
4269
- }
4270
- }, /* @__PURE__ */ React__default["default"].createElement(ui.Icon, {
4271
- name: "filter",
4272
- className: styles.filterIcon,
4273
- size: "lg"
4274
- }), filters.map((filter, index) => /* @__PURE__ */ React__default["default"].createElement(AdHocFiltersComboboxEditSwitch, {
4275
- key: index,
4276
- filter,
4277
- model
4278
- })), /* @__PURE__ */ React__default["default"].createElement(AdHocCombobox, {
4279
- model,
4280
- wip: true,
4281
- ref: focusOnInputRef
4282
- }));
4283
- });
4284
- const getStyles$9 = (theme) => ({
4285
- comboboxWrapper: css.css({
4286
- display: "flex",
4287
- flexWrap: "wrap",
4288
- alignItems: "center",
4289
- columnGap: theme.spacing(1),
4290
- rowGap: theme.spacing(0.5),
4291
- minHeight: theme.spacing(4),
4292
- backgroundColor: theme.components.input.background,
4293
- border: `1px solid ${theme.colors.border.strong}`,
4294
- borderRadius: theme.shape.radius.default,
4295
- paddingInline: theme.spacing(1),
4296
- paddingBlock: theme.spacing(0.5),
4297
- flexGrow: 1,
4298
- "&:focus-within": {
4299
- outline: "2px dotted transparent",
4300
- outlineOffset: "2px",
4301
- boxShadow: `0 0 0 2px ${theme.colors.background.canvas}, 0 0 0px 4px ${theme.colors.primary.main}`,
4302
- transitionTimingFunction: `cubic-bezier(0.19, 1, 0.22, 1)`,
4303
- transitionDuration: "0.2s",
4304
- transitionProperty: "outline, outline-offset, box-shadow"
4305
- }
4306
- }),
4307
- filterIcon: css.css({
4308
- color: theme.colors.text.secondary,
4309
- alignSelf: "center"
4310
- })
4311
- });
4312
-
4313
3795
  var __defProp$y = Object.defineProperty;
4314
3796
  var __defProps$m = Object.defineProperties;
4315
3797
  var __getOwnPropDescs$m = Object.getOwnPropertyDescriptors;
@@ -4340,7 +3822,7 @@ class AdHocFiltersVariable extends SceneObjectBase {
4340
3822
  applyMode: "auto",
4341
3823
  filterExpression: (_b = state.filterExpression) != null ? _b : renderExpression(state.expressionBuilder, state.filters)
4342
3824
  }, state));
4343
- this._scopedVars = { __sceneObject: { value: this } };
3825
+ this._scopedVars = { __sceneObject: new SafeSerializableSceneObject(this) };
4344
3826
  this._dataSourceSrv = runtime.getDataSourceSrv();
4345
3827
  this._urlSync = new AdHocFiltersVariableUrlSyncHandler(this);
4346
3828
  if (this.state.applyMode === "auto") {
@@ -4395,12 +3877,6 @@ class AdHocFiltersVariable extends SceneObjectBase {
4395
3877
  }
4396
3878
  this.setState({ filters: this.state.filters.filter((f) => f !== filter) });
4397
3879
  }
4398
- _removeLastFilter() {
4399
- const filterToRemove = this.state.filters.at(-1);
4400
- if (filterToRemove) {
4401
- this._removeFilter(filterToRemove);
4402
- }
4403
- }
4404
3880
  async _getKeys(currentKey) {
4405
3881
  var _a, _b, _c;
4406
3882
  const override = await ((_b = (_a = this.state).getTagKeysProvider) == null ? void 0 : _b.call(_a, this, currentKey));
@@ -4482,11 +3958,6 @@ function renderExpression(builder, filters) {
4482
3958
  function AdHocFiltersVariableRenderer({ model }) {
4483
3959
  const { filters, readOnly, addFilterButtonText } = model.useState();
4484
3960
  const styles = ui.useStyles2(getStyles$8);
4485
- if (model.state.layout === "combobox") {
4486
- return /* @__PURE__ */ React__default["default"].createElement(AdHocFiltersComboboxRenderer, {
4487
- model
4488
- });
4489
- }
4490
3961
  return /* @__PURE__ */ React__default["default"].createElement("div", {
4491
3962
  className: styles.wrapper
4492
3963
  }, filters.map((filter, index) => /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, {
@@ -4507,6 +3978,10 @@ const getStyles$8 = (theme) => ({
4507
3978
  alignItems: "flex-end",
4508
3979
  columnGap: theme.spacing(2),
4509
3980
  rowGap: theme.spacing(1)
3981
+ }),
3982
+ filterIcon: css.css({
3983
+ color: theme.colors.text.secondary,
3984
+ paddingRight: theme.spacing(0.5)
4510
3985
  })
4511
3986
  });
4512
3987
  function toSelectableValue(input) {
@@ -4595,7 +4070,7 @@ class SceneQueryRunner extends SceneObjectBase {
4595
4070
  this._dataLayersMerger = new DataLayersMerger();
4596
4071
  this._variableValueRecorder = new VariableValueRecorder();
4597
4072
  this._results = new rxjs.ReplaySubject(1);
4598
- this._scopedVars = { __sceneObject: { value: this, text: "__sceneObject" } };
4073
+ this._scopedVars = { __sceneObject: new SafeSerializableSceneObject(this) };
4599
4074
  this._variableDependency = new VariableDependencyConfig(this, {
4600
4075
  statePaths: ["queries", "datasource"],
4601
4076
  onVariableUpdateCompleted: this.onVariableUpdatesCompleted.bind(this),
@@ -6546,7 +6021,7 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
6546
6021
  __interval: { text: interval.interval, value: interval.interval },
6547
6022
  __interval_ms: { text: interval.intervalMs.toString(), value: interval.intervalMs },
6548
6023
  __annotation: { text: annotation.name, value: annotation },
6549
- __sceneObject: { text: "__sceneObject", value: layer }
6024
+ __sceneObject: new SafeSerializableSceneObject(layer)
6550
6025
  };
6551
6026
  const queryRequest = __spreadValues$q(__spreadProps$f(__spreadValues$q({
6552
6027
  startTime: Date.now(),
@@ -6690,7 +6165,9 @@ class AnnotationsDataLayer extends SceneDataLayerBase {
6690
6165
  }, initialState),
6691
6166
  ["query"]
6692
6167
  );
6693
- this._scopedVars = { __sceneObject: { value: this, text: "__sceneObject" } };
6168
+ this._scopedVars = {
6169
+ __sceneObject: new SafeSerializableSceneObject(this)
6170
+ };
6694
6171
  }
6695
6172
  onEnable() {
6696
6173
  const timeRange = sceneGraph.getTimeRange(this);
@@ -8013,7 +7490,7 @@ class QueryVariable extends MultiValueVariable {
8013
7490
  this.setState({ loading: true, error: null });
8014
7491
  return rxjs.from(
8015
7492
  getDataSource(this.state.datasource, {
8016
- __sceneObject: { text: "__sceneObject", value: this }
7493
+ __sceneObject: new SafeSerializableSceneObject(this)
8017
7494
  })
8018
7495
  ).pipe(
8019
7496
  rxjs.mergeMap((ds) => {
@@ -8054,7 +7531,7 @@ class QueryVariable extends MultiValueVariable {
8054
7531
  }
8055
7532
  getRequest(target, searchFilter) {
8056
7533
  const scopedVars = {
8057
- __sceneObject: { text: "__sceneObject", value: this }
7534
+ __sceneObject: new SafeSerializableSceneObject(this)
8058
7535
  };
8059
7536
  if (searchFilter) {
8060
7537
  scopedVars.__searchFilter = { value: searchFilter, text: searchFilter };
@@ -12172,6 +11649,7 @@ exports.PanelBuilders = PanelBuilders;
12172
11649
  exports.PanelOptionsBuilders = PanelOptionsBuilders;
12173
11650
  exports.QueryVariable = QueryVariable;
12174
11651
  exports.RuntimeDataSource = RuntimeDataSource;
11652
+ exports.SafeSerializableSceneObject = SafeSerializableSceneObject;
12175
11653
  exports.SceneApp = SceneApp;
12176
11654
  exports.SceneAppPage = SceneAppPage;
12177
11655
  exports.SceneByFrameRepeater = SceneByFrameRepeater;