@ixon-cdk/iframe-adapter 1.17.0-next.1 → 1.18.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,61 +1,73 @@
1
- var Z = Object.defineProperty;
2
- var ee = (t, e, n) => e in t ? Z(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
1
+ var x = Object.defineProperty;
2
+ var ee = (t, e, n) => e in t ? x(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
3
  var p = (t, e, n) => (ee(t, typeof e != "symbol" ? e + "" : e, n), n);
4
- const d = "cdk:cmpctx:", s = {
4
+ const c = "cdk:cmpctx:", s = {
5
5
  // Lifecycle
6
- Create: `${d}create`,
7
- Created: `${d}created`,
8
- Destroy: `${d}destroy`,
6
+ Create: `${c}create`,
7
+ Created: `${c}created`,
8
+ Destroy: `${c}destroy`,
9
9
  // BackendComponentClient
10
- BackendComponentClientCreate: `${d}bcc:create`,
11
- BackendComponentClientDestroy: `${d}bcc:destroy`,
12
- BackendComponentClientCall: `${d}bcc:call`,
13
- BackendComponentClientCallResult: `${d}bcc:callresult`,
10
+ BackendComponentClientCreate: `${c}bcc:create`,
11
+ BackendComponentClientDestroy: `${c}bcc:destroy`,
12
+ BackendComponentClientCall: `${c}bcc:call`,
13
+ BackendComponentClientCallResult: `${c}bcc:callresult`,
14
14
  // LoggingDataClient
15
- LoggingDataClientCreate: `${d}ldc:create`,
16
- LoggingDataClientDestroy: `${d}ldc:destroy`,
17
- LoggingDataClientQuery: `${d}ldc:query`,
18
- LoggingDataClientQueryResult: `${d}ldc:queryresult`,
15
+ LoggingDataClientCreate: `${c}ldc:create`,
16
+ LoggingDataClientDestroy: `${c}ldc:destroy`,
17
+ LoggingDataClientQuery: `${c}ldc:query`,
18
+ LoggingDataClientQueryResult: `${c}ldc:queryresult`,
19
19
  // ResourceDataClient
20
- ResourceDataClientCreate: `${d}rdc:create`,
21
- ResourceDataClientDestroy: `${d}rdc:destroy`,
22
- ResourceDataClientQuery: `${d}rdc:query`,
23
- ResourceDataClientQueryResult: `${d}rdc:queryresult`,
24
- ResourceDataClientRender: `${d}rdc:render`,
25
- ResourceDataClientRenderResult: `${d}rdc:renderresult`,
26
- ResourceDataClientUpdate: `${d}rdc:update`,
27
- ResourceDataClientUpdated: `${d}rdc:updated`,
20
+ ResourceDataClientCreate: `${c}rdc:create`,
21
+ ResourceDataClientDestroy: `${c}rdc:destroy`,
22
+ ResourceDataClientQuery: `${c}rdc:query`,
23
+ ResourceDataClientQueryResult: `${c}rdc:queryresult`,
24
+ ResourceDataClientRender: `${c}rdc:render`,
25
+ ResourceDataClientRenderResult: `${c}rdc:renderresult`,
26
+ ResourceDataClientUpdate: `${c}rdc:update`,
27
+ ResourceDataClientUpdated: `${c}rdc:updated`,
28
28
  // ActionMenu
29
- OpenActionMenu: `${d}openactionmenu`,
30
- OpenActionMenuResult: `${d}openactionmenuresult`,
29
+ OpenActionMenu: `${c}openactionmenu`,
30
+ OpenActionMenuResult: `${c}openactionmenuresult`,
31
31
  // ActionBottomSheet
32
- OpenActionBottomSheet: `${d}openactionbottomsheet`,
33
- OpenActionBottomSheetResult: `${d}openactionbottomsheetresult`,
32
+ OpenActionBottomSheet: `${c}openactionbottomsheet`,
33
+ OpenActionBottomSheetResult: `${c}openactionbottomsheetresult`,
34
34
  // Dialogs
35
- OpenAlertDialog: `${d}openalertdialog`,
36
- OpenAlertDialogResult: `${d}openalertdialogresult`,
37
- OpenConfirmDialog: `${d}openconfirmdialog`,
38
- OpenConfirmDialogResult: `${d}openconfirmdialogresult`,
39
- OpenContentDialog: `${d}opencontentdialog`,
40
- OpenContentDialogResult: `${d}opencontentdialogresult`,
41
- OpenFormDialog: `${d}openformdialog`,
42
- OpenFormDialogResult: `${d}openformdialogresult`,
35
+ OpenAlertDialog: `${c}openalertdialog`,
36
+ OpenAlertDialogResult: `${c}openalertdialogresult`,
37
+ OpenConfirmDialog: `${c}openconfirmdialog`,
38
+ OpenConfirmDialogResult: `${c}openconfirmdialogresult`,
39
+ OpenContentDialog: `${c}opencontentdialog`,
40
+ OpenContentDialogResult: `${c}opencontentdialogresult`,
41
+ OpenFormDialog: `${c}openformdialog`,
42
+ OpenFormDialogResult: `${c}openformdialogresult`,
43
43
  // SelectPanel
44
- OpenSelectPanel: `${d}openselectpanel`,
45
- OpenSelectPanelResult: `${d}openselectpanelresult`,
44
+ OpenSelectPanel: `${c}openselectpanel`,
45
+ OpenSelectPanelResult: `${c}openselectpanelresult`,
46
46
  // Toast
47
- OpenToast: `${d}opentoast`,
48
- OpenToastResult: `${d}opentoastresult`,
47
+ OpenToast: `${c}opentoast`,
48
+ OpenToastResult: `${c}opentoastresult`,
49
49
  // VPN
50
- ShowVpnStatusDetails: `${d}showvpnstatusdetails`,
51
- ToggleVpn: `${d}togglevpn`,
52
- VpnClientStatusChange: `${d}vpnclientstatuschange`,
50
+ ShowVpnStatusDetails: `${c}showvpnstatusdetails`,
51
+ ToggleVpn: `${c}togglevpn`,
52
+ VpnClientStatusChange: `${c}vpnclientstatuschange`,
53
53
  // Miscellaneous
54
- NavigateByUrl: `${d}navigatebyurl`,
55
- SetTimeRange: `${d}settimerange`,
56
- TimeRangeChange: `${d}timerangechange`
57
- };
58
- function $t({ iframe: t, context: e }) {
54
+ NavigateByUrl: `${c}navigatebyurl`,
55
+ SetTimeRange: `${c}settimerange`,
56
+ TimeRangeChange: `${c}timerangechange`
57
+ }, te = [
58
+ "color-scheme",
59
+ "background",
60
+ "on-background",
61
+ "primary",
62
+ "on-primary",
63
+ "secondary",
64
+ "on-secondary",
65
+ "error",
66
+ "on-error",
67
+ "success",
68
+ "on-success"
69
+ ];
70
+ function Mt({ iframe: t, context: e }) {
59
71
  return window.addEventListener("message", a, !1), e.ontimerangechange = (...o) => {
60
72
  t.contentWindow && t.contentWindow.postMessage(
61
73
  {
@@ -80,6 +92,7 @@ function $t({ iframe: t, context: e }) {
80
92
  function n(o) {
81
93
  return {
82
94
  _apiLinkEntries: [...o._getApiLinks().entries()],
95
+ _designTokenEntries: te.map((r) => [r, o.getDesignToken(r)]),
83
96
  appData: o.appData,
84
97
  componentBaseUrl: o.componentBaseUrl,
85
98
  destroyed: o.destroyed,
@@ -106,8 +119,8 @@ function $t({ iframe: t, context: e }) {
106
119
  e.destroy();
107
120
  break;
108
121
  case s.BackendComponentClientCreate: {
109
- const { clientId: r } = o.data.payload, l = e.createBackendComponentClient(r);
110
- a._clients.set(r, l);
122
+ const { clientId: r } = o.data.payload, i = e.createBackendComponentClient(r);
123
+ a._clients.set(r, i);
111
124
  break;
112
125
  }
113
126
  case s.BackendComponentClientDestroy: {
@@ -116,13 +129,13 @@ function $t({ iframe: t, context: e }) {
116
129
  break;
117
130
  }
118
131
  case s.BackendComponentClientCall: {
119
- const { clientId: r, callId: l, functionName: c, functionArguments: i } = o.data.payload;
132
+ const { clientId: r, callId: i, functionName: d, functionArguments: l } = o.data.payload;
120
133
  let u = a._clients.get(r);
121
- u && !u._destroyed && u.call(c, i).then((g) => {
134
+ u && !u._destroyed && u.call(d, l).then((g) => {
122
135
  u && !u.destroyed && t.contentWindow.postMessage(
123
136
  {
124
137
  type: s.BackendComponentClientCallResult,
125
- payload: { callId: l, result: g }
138
+ payload: { callId: i, result: g }
126
139
  },
127
140
  "*"
128
141
  );
@@ -130,8 +143,8 @@ function $t({ iframe: t, context: e }) {
130
143
  break;
131
144
  }
132
145
  case s.LoggingDataClientCreate: {
133
- const { clientId: r } = o.data.payload, l = e.createLoggingDataClient(r);
134
- a._clients.set(r, l);
146
+ const { clientId: r } = o.data.payload, i = e.createLoggingDataClient(r);
147
+ a._clients.set(r, i);
135
148
  break;
136
149
  }
137
150
  case s.LoggingDataClientDestroy: {
@@ -140,13 +153,13 @@ function $t({ iframe: t, context: e }) {
140
153
  break;
141
154
  }
142
155
  case s.LoggingDataClientQuery: {
143
- const { clientId: r, queryId: l, query: c } = o.data.payload;
144
- let i = a._clients.get(r);
145
- i && !i._destroyed && i.query(c, (u) => {
146
- i._destroyed || t.contentWindow.postMessage(
156
+ const { clientId: r, queryId: i, query: d } = o.data.payload;
157
+ let l = a._clients.get(r);
158
+ l && !l._destroyed && l.query(d, (u) => {
159
+ l._destroyed || t.contentWindow.postMessage(
147
160
  {
148
161
  type: s.LoggingDataClientQueryResult,
149
- payload: { queryId: l, results: u }
162
+ payload: { queryId: i, results: u }
150
163
  },
151
164
  "*"
152
165
  );
@@ -154,8 +167,8 @@ function $t({ iframe: t, context: e }) {
154
167
  break;
155
168
  }
156
169
  case s.ResourceDataClientCreate: {
157
- const { clientId: r } = o.data.payload, l = e.createResourceDataClient(r);
158
- a._clients.set(r, l);
170
+ const { clientId: r } = o.data.payload, i = e.createResourceDataClient(r);
171
+ a._clients.set(r, i);
159
172
  break;
160
173
  }
161
174
  case s.ResourceDataClientDestroy: {
@@ -164,13 +177,13 @@ function $t({ iframe: t, context: e }) {
164
177
  break;
165
178
  }
166
179
  case s.ResourceDataClientQuery: {
167
- const { clientId: r, queryId: l, query: c } = o.data.payload;
168
- let i = a._clients.get(r);
169
- i && !i._destroyed && i.query(c, (u) => {
170
- i._destroyed || t.contentWindow.postMessage(
180
+ const { clientId: r, queryId: i, query: d } = o.data.payload;
181
+ let l = a._clients.get(r);
182
+ l && !l._destroyed && l.query(d, (u) => {
183
+ l._destroyed || t.contentWindow.postMessage(
171
184
  {
172
185
  type: s.ResourceDataClientQueryResult,
173
- payload: { queryId: l, results: u }
186
+ payload: { queryId: i, results: u }
174
187
  },
175
188
  "*"
176
189
  );
@@ -178,13 +191,13 @@ function $t({ iframe: t, context: e }) {
178
191
  break;
179
192
  }
180
193
  case s.ResourceDataClientRender: {
181
- const { clientId: r, queryId: l, query: c } = o.data.payload;
182
- let i = a._clients.get(r);
183
- i && !i._destroyed && i.render(c, (u) => {
184
- i._destroyed || t.contentWindow.postMessage(
194
+ const { clientId: r, queryId: i, query: d } = o.data.payload;
195
+ let l = a._clients.get(r);
196
+ l && !l._destroyed && l.render(d, (u) => {
197
+ l._destroyed || t.contentWindow.postMessage(
185
198
  {
186
199
  type: s.ResourceDataClientRenderResult,
187
- payload: { queryId: l, results: u }
200
+ payload: { queryId: i, results: u }
188
201
  },
189
202
  "*"
190
203
  );
@@ -192,13 +205,13 @@ function $t({ iframe: t, context: e }) {
192
205
  break;
193
206
  }
194
207
  case s.ResourceDataClientUpdate: {
195
- const { clientId: r, updateId: l, update: c } = o.data.payload;
196
- let i = a._clients.get(r);
197
- i && !i._destroyed && i.update(c).then(() => {
198
- i && !i._destroyed && t.contentWindow.postMessage(
208
+ const { clientId: r, updateId: i, update: d } = o.data.payload;
209
+ let l = a._clients.get(r);
210
+ l && !l._destroyed && l.update(d).then(() => {
211
+ l && !l._destroyed && t.contentWindow.postMessage(
199
212
  {
200
213
  type: s.ResourceDataClientUpdated,
201
- payload: { updateId: l }
214
+ payload: { updateId: i }
202
215
  },
203
216
  "*"
204
217
  );
@@ -212,18 +225,18 @@ function $t({ iframe: t, context: e }) {
212
225
  break;
213
226
  case s.OpenActionMenu:
214
227
  {
215
- const r = t.contentDocument.querySelector(o.data.payload.selector), l = {
228
+ const r = t.contentDocument.querySelector(o.data.payload.selector), i = {
216
229
  getBoundingClientRect: () => {
217
- const c = t.getBoundingClientRect(), i = r.getBoundingClientRect();
230
+ const d = t.getBoundingClientRect(), l = r.getBoundingClientRect();
218
231
  return {
219
- ...JSON.parse(JSON.stringify(i)),
220
- top: c.top + i.top,
221
- x: c.x + i.x
232
+ ...JSON.parse(JSON.stringify(l)),
233
+ top: d.top + l.top,
234
+ x: d.x + l.x
222
235
  };
223
236
  }
224
237
  };
225
- e.openActionMenu(l, o.data.payload.options).then((c) => {
226
- t.contentWindow.postMessage({ type: s.OpenActionMenuResult, payload: { result: c } }, "*");
238
+ e.openActionMenu(i, o.data.payload.options).then((d) => {
239
+ t.contentWindow.postMessage({ type: s.OpenActionMenuResult, payload: { result: d } }, "*");
227
240
  });
228
241
  }
229
242
  break;
@@ -249,25 +262,25 @@ function $t({ iframe: t, context: e }) {
249
262
  break;
250
263
  case s.OpenSelectPanel:
251
264
  {
252
- const r = t.contentDocument.querySelector(o.data.payload.selector), l = {
265
+ const r = t.contentDocument.querySelector(o.data.payload.selector), i = {
253
266
  getBoundingClientRect: () => {
254
- const c = t.getBoundingClientRect(), i = r.getBoundingClientRect();
267
+ const d = t.getBoundingClientRect(), l = r.getBoundingClientRect();
255
268
  return {
256
- ...JSON.parse(JSON.stringify(i)),
257
- top: c.top + i.top,
258
- x: c.x + i.x
269
+ ...JSON.parse(JSON.stringify(l)),
270
+ top: d.top + l.top,
271
+ x: d.x + l.x
259
272
  };
260
273
  }
261
274
  };
262
- e.openSelectPanel(l, o.data.payload.options).then((c) => {
263
- t.contentWindow.postMessage({ type: s.OpenSelectPanelResult, payload: { result: c } }, "*");
275
+ e.openSelectPanel(i, o.data.payload.options).then((d) => {
276
+ t.contentWindow.postMessage({ type: s.OpenSelectPanelResult, payload: { result: d } }, "*");
264
277
  });
265
278
  }
266
279
  break;
267
280
  case s.OpenToast:
268
281
  e.openToast(o.data.payload.options).then((r) => {
269
- const { id: l } = o.data.payload;
270
- t.contentWindow && t.contentWindow.postMessage({ type: s.OpenToastResult, payload: { id: l, result: r } }, "*");
282
+ const { id: i } = o.data.payload;
283
+ t.contentWindow && t.contentWindow.postMessage({ type: s.OpenToastResult, payload: { id: i, result: r } }, "*");
271
284
  });
272
285
  break;
273
286
  case s.ShowVpnStatusDetails:
@@ -285,7 +298,7 @@ function $t({ iframe: t, context: e }) {
285
298
  }
286
299
  }
287
300
  }
288
- class te {
301
+ class ne {
289
302
  constructor(e, n, a, o) {
290
303
  this.query = e, this.variable = n, this.tag = a, this._onCancel = o, Object.freeze(this);
291
304
  }
@@ -293,53 +306,53 @@ class te {
293
306
  this._onCancel && this._onCancel();
294
307
  }
295
308
  }
296
- var ne = typeof global == "object" && global && global.Object === Object && global;
297
- const ae = ne;
298
- var oe = typeof self == "object" && self && self.Object === Object && self, re = ae || oe || Function("return this")();
299
- const T = re;
300
- var se = T.Symbol;
301
- const O = se;
302
- var H = Object.prototype, ie = H.hasOwnProperty, le = H.toString, C = O ? O.toStringTag : void 0;
309
+ var ae = typeof global == "object" && global && global.Object === Object && global;
310
+ const oe = ae;
311
+ var re = typeof self == "object" && self && self.Object === Object && self, se = oe || re || Function("return this")();
312
+ const L = se;
313
+ var ie = L.Symbol;
314
+ const S = ie;
315
+ var H = Object.prototype, le = H.hasOwnProperty, ce = H.toString, C = S ? S.toStringTag : void 0;
303
316
  function de(t) {
304
- var e = ie.call(t, C), n = t[C];
317
+ var e = le.call(t, C), n = t[C];
305
318
  try {
306
319
  t[C] = void 0;
307
320
  var a = !0;
308
321
  } catch {
309
322
  }
310
- var o = le.call(t);
323
+ var o = ce.call(t);
311
324
  return a && (e ? t[C] = n : delete t[C]), o;
312
325
  }
313
- var ce = Object.prototype, ue = ce.toString;
314
- function pe(t) {
315
- return ue.call(t);
326
+ var ue = Object.prototype, pe = ue.toString;
327
+ function ge(t) {
328
+ return pe.call(t);
316
329
  }
317
- var ge = "[object Null]", ye = "[object Undefined]", U = O ? O.toStringTag : void 0;
318
- function fe(t) {
319
- return t == null ? t === void 0 ? ye : ge : U && U in Object(t) ? de(t) : pe(t);
330
+ var ye = "[object Null]", fe = "[object Undefined]", U = S ? S.toStringTag : void 0;
331
+ function he(t) {
332
+ return t == null ? t === void 0 ? fe : ye : U && U in Object(t) ? de(t) : ge(t);
320
333
  }
321
334
  function V(t) {
322
335
  var e = typeof t;
323
336
  return t != null && (e == "object" || e == "function");
324
337
  }
325
- var he = "[object AsyncFunction]", me = "[object Function]", we = "[object GeneratorFunction]", Ce = "[object Proxy]";
326
- function _e(t) {
338
+ var me = "[object AsyncFunction]", we = "[object Function]", Ce = "[object GeneratorFunction]", _e = "[object Proxy]";
339
+ function De(t) {
327
340
  if (!V(t))
328
341
  return !1;
329
- var e = fe(t);
330
- return e == me || e == we || e == he || e == Ce;
342
+ var e = he(t);
343
+ return e == we || e == Ce || e == me || e == _e;
331
344
  }
332
- var De = T["__core-js_shared__"];
333
- const E = De;
334
- var N = function() {
335
- var t = /[^.]+$/.exec(E && E.keys && E.keys.IE_PROTO || "");
345
+ var Re = L["__core-js_shared__"];
346
+ const v = Re;
347
+ var k = function() {
348
+ var t = /[^.]+$/.exec(v && v.keys && v.keys.IE_PROTO || "");
336
349
  return t ? "Symbol(src)_1." + t : "";
337
350
  }();
338
- function Re(t) {
339
- return !!N && N in t;
351
+ function be(t) {
352
+ return !!k && k in t;
340
353
  }
341
- var be = Function.prototype, Oe = be.toString;
342
- function Se(t) {
354
+ var Se = Function.prototype, Oe = Se.toString;
355
+ function $e(t) {
343
356
  if (t != null) {
344
357
  try {
345
358
  return Oe.call(t);
@@ -352,23 +365,23 @@ function Se(t) {
352
365
  }
353
366
  return "";
354
367
  }
355
- var $e = /[\\^$.*+?()[\]{}|]/g, Me = /^\[object .+?Constructor\]$/, ve = Function.prototype, Ee = Object.prototype, Ie = ve.toString, Le = Ee.hasOwnProperty, Te = RegExp(
356
- "^" + Ie.call(Le).replace($e, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
368
+ var Me = /[\\^$.*+?()[\]{}|]/g, Ee = /^\[object .+?Constructor\]$/, ve = Function.prototype, Te = Object.prototype, Ie = ve.toString, Le = Te.hasOwnProperty, qe = RegExp(
369
+ "^" + Ie.call(Le).replace(Me, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
357
370
  );
358
- function qe(t) {
359
- if (!V(t) || Re(t))
371
+ function Ae(t) {
372
+ if (!V(t) || be(t))
360
373
  return !1;
361
- var e = _e(t) ? Te : Me;
362
- return e.test(Se(t));
374
+ var e = De(t) ? qe : Ee;
375
+ return e.test($e(t));
363
376
  }
364
- function Ae(t, e) {
377
+ function Ue(t, e) {
365
378
  return t == null ? void 0 : t[e];
366
379
  }
367
380
  function W(t, e) {
368
- var n = Ae(t, e);
369
- return qe(n) ? n : void 0;
381
+ var n = Ue(t, e);
382
+ return Ae(n) ? n : void 0;
370
383
  }
371
- function Ue(t, e) {
384
+ function ke(t, e) {
372
385
  return t === e || t !== t && e !== e;
373
386
  }
374
387
  var Ne = W(Object, "create");
@@ -376,28 +389,28 @@ const _ = Ne;
376
389
  function Pe() {
377
390
  this.__data__ = _ ? _(null) : {}, this.size = 0;
378
391
  }
379
- function Be(t) {
392
+ function je(t) {
380
393
  var e = this.has(t) && delete this.__data__[t];
381
394
  return this.size -= e ? 1 : 0, e;
382
395
  }
383
- var je = "__lodash_hash_undefined__", ke = Object.prototype, Fe = ke.hasOwnProperty;
384
- function He(t) {
396
+ var Be = "__lodash_hash_undefined__", Fe = Object.prototype, He = Fe.hasOwnProperty;
397
+ function Ve(t) {
385
398
  var e = this.__data__;
386
399
  if (_) {
387
400
  var n = e[t];
388
- return n === je ? void 0 : n;
401
+ return n === Be ? void 0 : n;
389
402
  }
390
- return Fe.call(e, t) ? e[t] : void 0;
403
+ return He.call(e, t) ? e[t] : void 0;
391
404
  }
392
- var Ve = Object.prototype, We = Ve.hasOwnProperty;
393
- function ze(t) {
405
+ var We = Object.prototype, ze = We.hasOwnProperty;
406
+ function Qe(t) {
394
407
  var e = this.__data__;
395
- return _ ? e[t] !== void 0 : We.call(e, t);
408
+ return _ ? e[t] !== void 0 : ze.call(e, t);
396
409
  }
397
- var Qe = "__lodash_hash_undefined__";
398
- function Ge(t, e) {
410
+ var Ge = "__lodash_hash_undefined__";
411
+ function Je(t, e) {
399
412
  var n = this.__data__;
400
- return this.size += this.has(t) ? 0 : 1, n[t] = _ && e === void 0 ? Qe : e, this;
413
+ return this.size += this.has(t) ? 0 : 1, n[t] = _ && e === void 0 ? Ge : e, this;
401
414
  }
402
415
  function h(t) {
403
416
  var e = -1, n = t == null ? 0 : t.length;
@@ -407,36 +420,36 @@ function h(t) {
407
420
  }
408
421
  }
409
422
  h.prototype.clear = Pe;
410
- h.prototype.delete = Be;
411
- h.prototype.get = He;
412
- h.prototype.has = ze;
413
- h.prototype.set = Ge;
414
- function Je() {
423
+ h.prototype.delete = je;
424
+ h.prototype.get = Ve;
425
+ h.prototype.has = Qe;
426
+ h.prototype.set = Je;
427
+ function Ke() {
415
428
  this.__data__ = [], this.size = 0;
416
429
  }
417
- function S(t, e) {
430
+ function O(t, e) {
418
431
  for (var n = t.length; n--; )
419
- if (Ue(t[n][0], e))
432
+ if (ke(t[n][0], e))
420
433
  return n;
421
434
  return -1;
422
435
  }
423
- var Ke = Array.prototype, xe = Ke.splice;
424
- function Xe(t) {
425
- var e = this.__data__, n = S(e, t);
436
+ var Xe = Array.prototype, Ye = Xe.splice;
437
+ function Ze(t) {
438
+ var e = this.__data__, n = O(e, t);
426
439
  if (n < 0)
427
440
  return !1;
428
441
  var a = e.length - 1;
429
- return n == a ? e.pop() : xe.call(e, n, 1), --this.size, !0;
442
+ return n == a ? e.pop() : Ye.call(e, n, 1), --this.size, !0;
430
443
  }
431
- function Ye(t) {
432
- var e = this.__data__, n = S(e, t);
444
+ function xe(t) {
445
+ var e = this.__data__, n = O(e, t);
433
446
  return n < 0 ? void 0 : e[n][1];
434
447
  }
435
- function Ze(t) {
436
- return S(this.__data__, t) > -1;
448
+ function et(t) {
449
+ return O(this.__data__, t) > -1;
437
450
  }
438
- function et(t, e) {
439
- var n = this.__data__, a = S(n, t);
451
+ function tt(t, e) {
452
+ var n = this.__data__, a = O(n, t);
440
453
  return a < 0 ? (++this.size, n.push([t, e])) : n[a][1] = e, this;
441
454
  }
442
455
  function w(t) {
@@ -446,39 +459,39 @@ function w(t) {
446
459
  this.set(a[0], a[1]);
447
460
  }
448
461
  }
449
- w.prototype.clear = Je;
450
- w.prototype.delete = Xe;
451
- w.prototype.get = Ye;
452
- w.prototype.has = Ze;
453
- w.prototype.set = et;
454
- var tt = W(T, "Map");
455
- const nt = tt;
456
- function at() {
462
+ w.prototype.clear = Ke;
463
+ w.prototype.delete = Ze;
464
+ w.prototype.get = xe;
465
+ w.prototype.has = et;
466
+ w.prototype.set = tt;
467
+ var nt = W(L, "Map");
468
+ const at = nt;
469
+ function ot() {
457
470
  this.size = 0, this.__data__ = {
458
471
  hash: new h(),
459
- map: new (nt || w)(),
472
+ map: new (at || w)(),
460
473
  string: new h()
461
474
  };
462
475
  }
463
- function ot(t) {
476
+ function rt(t) {
464
477
  var e = typeof t;
465
478
  return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
466
479
  }
467
480
  function $(t, e) {
468
481
  var n = t.__data__;
469
- return ot(e) ? n[typeof e == "string" ? "string" : "hash"] : n.map;
482
+ return rt(e) ? n[typeof e == "string" ? "string" : "hash"] : n.map;
470
483
  }
471
- function rt(t) {
484
+ function st(t) {
472
485
  var e = $(this, t).delete(t);
473
486
  return this.size -= e ? 1 : 0, e;
474
487
  }
475
- function st(t) {
488
+ function it(t) {
476
489
  return $(this, t).get(t);
477
490
  }
478
- function it(t) {
491
+ function lt(t) {
479
492
  return $(this, t).has(t);
480
493
  }
481
- function lt(t, e) {
494
+ function ct(t, e) {
482
495
  var n = $(this, t), a = n.size;
483
496
  return n.set(t, e), this.size += n.size == a ? 0 : 1, this;
484
497
  }
@@ -489,11 +502,11 @@ function m(t) {
489
502
  this.set(a[0], a[1]);
490
503
  }
491
504
  }
492
- m.prototype.clear = at;
493
- m.prototype.delete = rt;
494
- m.prototype.get = st;
495
- m.prototype.has = it;
496
- m.prototype.set = lt;
505
+ m.prototype.clear = ot;
506
+ m.prototype.delete = st;
507
+ m.prototype.get = it;
508
+ m.prototype.has = lt;
509
+ m.prototype.set = ct;
497
510
  var dt = "Expected a function";
498
511
  function q(t, e) {
499
512
  if (typeof t != "function" || e != null && typeof e != "function")
@@ -502,13 +515,13 @@ function q(t, e) {
502
515
  var a = arguments, o = e ? e.apply(this, a) : a[0], r = n.cache;
503
516
  if (r.has(o))
504
517
  return r.get(o);
505
- var l = t.apply(this, a);
506
- return n.cache = r.set(o, l) || r, l;
518
+ var i = t.apply(this, a);
519
+ return n.cache = r.set(o, i) || r, i;
507
520
  };
508
521
  return n.cache = new (q.Cache || m)(), n;
509
522
  }
510
523
  q.Cache = m;
511
- const ct = 2, z = 1, Q = "";
524
+ const ut = 2, z = 1, Q = "";
512
525
  class M {
513
526
  constructor(e, n, a) {
514
527
  this.locale = e, this.queryRef = n, this.rawValue = a;
@@ -521,9 +534,9 @@ class M {
521
534
  * @param rawValue the raw value
522
535
  */
523
536
  static create(e, n, a) {
524
- return n.query.postAggr === "count" ? new ut(e, n, a) : new M(e, n, a);
537
+ return n.query.postAggr === "count" ? new pt(e, n, a) : new M(e, n, a);
525
538
  }
526
- getDecimals(e = ct) {
539
+ getDecimals(e = ut) {
527
540
  return this.decimals ?? this.queryRef.query.decimals ?? e;
528
541
  }
529
542
  getFactor() {
@@ -548,24 +561,24 @@ class M {
548
561
  return this.rawValue;
549
562
  }
550
563
  toString() {
551
- var a, o, r, l;
552
- const e = this.locale ?? void 0, n = q((c, i, u, g) => {
553
- const Y = {
564
+ var a, o, r, i;
565
+ const e = this.locale ?? void 0, n = q((d, l, u, g) => {
566
+ const Z = {
554
567
  style: "decimal",
555
- minimumFractionDigits: Math.floor(i),
556
- maximumFractionDigits: Math.floor(i)
568
+ minimumFractionDigits: Math.floor(l),
569
+ maximumFractionDigits: Math.floor(l)
557
570
  };
558
- return `${new Intl.NumberFormat(g, Y).format(c)}${u ? " " + u : ""}`;
571
+ return `${new Intl.NumberFormat(g, Z).format(d)}${u ? " " + u : ""}`;
559
572
  });
560
573
  return this.rawValue === null ? "" : this.queryRef.query.postAggr === "count" ? n(this.rawValue, this.getDecimals(0), this.unit ?? this.queryRef.query.unit, e) : ((a = this.queryRef.variable) == null ? void 0 : a.type) === "str" ? this.rawValue : ((o = this.queryRef.variable) == null ? void 0 : o.type) === "bool" ? this.rawValue ? "True" : "False" : ((r = this.queryRef.variable) == null ? void 0 : r.type) === "int" ? n(
561
574
  this.rawValue,
562
575
  Number.isInteger(this.getFactor()) ? this.getDecimals(0) : this.getDecimals(),
563
576
  this.getUnit(),
564
577
  e
565
- ) : ((l = this.queryRef.variable) == null ? void 0 : l.type) === "float" ? n(this.rawValue, this.getDecimals(), this.getUnit(), e) : String(this.getValue());
578
+ ) : ((i = this.queryRef.variable) == null ? void 0 : i.type) === "float" ? n(this.rawValue, this.getDecimals(), this.getUnit(), e) : String(this.getValue());
566
579
  }
567
580
  }
568
- class ut extends M {
581
+ class pt extends M {
569
582
  getFactor() {
570
583
  return this.factor ?? this.queryRef.query.factor ?? z;
571
584
  }
@@ -573,18 +586,18 @@ class ut extends M {
573
586
  return this.unit ?? this.queryRef.query.unit ?? Q;
574
587
  }
575
588
  }
576
- function P(t) {
589
+ function N(t) {
577
590
  return t.map(({ queryRef: n, time: a, value: o }) => {
578
- const r = new te(n.query, n.variable, n.tag), l = M.create(o.locale, r, o.rawValue);
591
+ const r = new ne(n.query, n.variable, n.tag), i = M.create(o.locale, r, o.rawValue);
579
592
  return {
580
593
  queryRef: r,
581
594
  time: a,
582
- value: l
595
+ value: i
583
596
  };
584
597
  });
585
598
  }
586
599
  let y, A, G;
587
- function B(t, e) {
600
+ function P(t, e) {
588
601
  if (G = /* @__PURE__ */ new Date(), t.nodeType !== Node.ELEMENT_NODE)
589
602
  throw new Error("Can't generate CSS selector for non-element node type.");
590
603
  if (t.tagName.toLowerCase() === "html")
@@ -601,44 +614,44 @@ function B(t, e) {
601
614
  maxNumberOfTries: 1e4,
602
615
  timeoutMs: void 0
603
616
  };
604
- y = { ...n, ...e }, A = pt(y.root, n);
617
+ y = { ...n, ...e }, A = gt(y.root, n);
605
618
  let a = D(t, "all", () => D(t, "two", () => D(t, "one", () => D(t, "none"))));
606
619
  if (a) {
607
- const o = x(X(a, t));
608
- return o.length > 0 && (a = o[0]), v(a);
620
+ const o = X(Y(a, t));
621
+ return o.length > 0 && (a = o[0]), E(a);
609
622
  } else
610
623
  throw new Error("Selector was not found.");
611
624
  }
612
- function pt(t, e) {
625
+ function gt(t, e) {
613
626
  return t.nodeType === Node.DOCUMENT_NODE ? t : t === e.root ? t.ownerDocument : t;
614
627
  }
615
628
  function D(t, e, n) {
616
- let a = null, o = [], r = t, l = 0;
629
+ let a = null, o = [], r = t, i = 0;
617
630
  for (; r; ) {
618
- const c = (/* @__PURE__ */ new Date()).getTime() - G.getTime();
619
- if (y.timeoutMs !== void 0 && c > y.timeoutMs)
620
- throw new Error(`Timeout: Can't find a unique selector after ${c}ms`);
621
- let i = b(gt(r)) || b(...yt(r)) || b(...ft(r)) || b(ht(r)) || [F()];
622
- const u = mt(r);
631
+ const d = (/* @__PURE__ */ new Date()).getTime() - G.getTime();
632
+ if (y.timeoutMs !== void 0 && d > y.timeoutMs)
633
+ throw new Error(`Timeout: Can't find a unique selector after ${d}ms`);
634
+ let l = b(yt(r)) || b(...ft(r)) || b(...ht(r)) || b(mt(r)) || [F()];
635
+ const u = wt(r);
623
636
  if (e == "all")
624
- u && (i = i.concat(i.filter(I).map((g) => R(g, u))));
637
+ u && (l = l.concat(l.filter(T).map((g) => R(g, u))));
625
638
  else if (e == "two")
626
- i = i.slice(0, 1), u && (i = i.concat(i.filter(I).map((g) => R(g, u))));
639
+ l = l.slice(0, 1), u && (l = l.concat(l.filter(T).map((g) => R(g, u))));
627
640
  else if (e == "one") {
628
- const [g] = i = i.slice(0, 1);
629
- u && I(g) && (i = [R(g, u)]);
641
+ const [g] = l = l.slice(0, 1);
642
+ u && T(g) && (l = [R(g, u)]);
630
643
  } else
631
- e == "none" && (i = [F()], u && (i = [R(i[0], u)]));
632
- for (let g of i)
633
- g.level = l;
634
- if (o.push(i), o.length >= y.seedMinLength && (a = j(o, n), a))
644
+ e == "none" && (l = [F()], u && (l = [R(l[0], u)]));
645
+ for (let g of l)
646
+ g.level = i;
647
+ if (o.push(l), o.length >= y.seedMinLength && (a = j(o, n), a))
635
648
  break;
636
- r = r.parentElement, l++;
649
+ r = r.parentElement, i++;
637
650
  }
638
651
  return a || (a = j(o, n)), !a && n ? n() : a;
639
652
  }
640
653
  function j(t, e) {
641
- const n = x(K(t));
654
+ const n = X(K(t));
642
655
  if (n.length > y.threshold)
643
656
  return e ? e() : null;
644
657
  for (let a of n)
@@ -646,7 +659,7 @@ function j(t, e) {
646
659
  return a;
647
660
  return null;
648
661
  }
649
- function v(t) {
662
+ function E(t) {
650
663
  let e = t[0], n = e.name;
651
664
  for (let a = 1; a < t.length; a++) {
652
665
  const o = t[a].level || 0;
@@ -654,11 +667,11 @@ function v(t) {
654
667
  }
655
668
  return n;
656
669
  }
657
- function k(t) {
670
+ function B(t) {
658
671
  return t.map((e) => e.penalty).reduce((e, n) => e + n, 0);
659
672
  }
660
673
  function J(t) {
661
- const e = v(t);
674
+ const e = E(t);
662
675
  switch (A.querySelectorAll(e).length) {
663
676
  case 0:
664
677
  throw new Error(`Can't select any node with this selector: ${e}`);
@@ -668,26 +681,26 @@ function J(t) {
668
681
  return !1;
669
682
  }
670
683
  }
671
- function gt(t) {
684
+ function yt(t) {
672
685
  const e = t.getAttribute("id");
673
686
  return e && y.idName(e) ? {
674
687
  name: "#" + CSS.escape(e),
675
688
  penalty: 0
676
689
  } : null;
677
690
  }
678
- function yt(t) {
691
+ function ft(t) {
679
692
  return Array.from(t.attributes).filter((n) => y.attr(n.name, n.value)).map((n) => ({
680
693
  name: `[${CSS.escape(n.name)}="${CSS.escape(n.value)}"]`,
681
694
  penalty: 0.5
682
695
  }));
683
696
  }
684
- function ft(t) {
697
+ function ht(t) {
685
698
  return Array.from(t.classList).filter(y.className).map((n) => ({
686
699
  name: "." + CSS.escape(n),
687
700
  penalty: 1
688
701
  }));
689
702
  }
690
- function ht(t) {
703
+ function mt(t) {
691
704
  const e = t.tagName.toLowerCase();
692
705
  return y.tagName(e) ? {
693
706
  name: e,
@@ -700,7 +713,7 @@ function F() {
700
713
  penalty: 3
701
714
  };
702
715
  }
703
- function mt(t) {
716
+ function wt(t) {
704
717
  const e = t.parentNode;
705
718
  if (!e)
706
719
  return null;
@@ -718,14 +731,14 @@ function R(t, e) {
718
731
  penalty: t.penalty + 1
719
732
  };
720
733
  }
721
- function I(t) {
734
+ function T(t) {
722
735
  return t.name !== "html" && !t.name.startsWith("#");
723
736
  }
724
737
  function b(...t) {
725
- const e = t.filter(wt);
738
+ const e = t.filter(Ct);
726
739
  return e.length > 0 ? e : null;
727
740
  }
728
- function wt(t) {
741
+ function Ct(t) {
729
742
  return t != null;
730
743
  }
731
744
  function* K(t, e = []) {
@@ -735,10 +748,10 @@ function* K(t, e = []) {
735
748
  else
736
749
  yield e;
737
750
  }
738
- function x(t) {
739
- return [...t].sort((e, n) => k(e) - k(n));
751
+ function X(t) {
752
+ return [...t].sort((e, n) => B(e) - B(n));
740
753
  }
741
- function* X(t, e, n = {
754
+ function* Y(t, e, n = {
742
755
  counter: 0,
743
756
  visited: /* @__PURE__ */ new Map()
744
757
  }) {
@@ -749,25 +762,26 @@ function* X(t, e, n = {
749
762
  n.counter += 1;
750
763
  const o = [...t];
751
764
  o.splice(a, 1);
752
- const r = v(o);
765
+ const r = E(o);
753
766
  if (n.visited.has(r))
754
767
  return;
755
- J(o) && Ct(o, e) && (yield o, n.visited.set(r, !0), yield* X(o, e, n));
768
+ J(o) && _t(o, e) && (yield o, n.visited.set(r, !0), yield* Y(o, e, n));
756
769
  }
757
770
  }
758
- function Ct(t, e) {
759
- return A.querySelector(v(t)) === e;
771
+ function _t(t, e) {
772
+ return A.querySelector(E(t)) === e;
760
773
  }
761
774
  class f extends Error {
762
775
  constructor(e = "Method is not implemented") {
763
776
  super(e), this.name = "NotImplementedError", this.message = e, this.stack = `NotImplementedError: ${e}`;
764
777
  }
765
778
  }
766
- class _t {
779
+ class Dt {
767
780
  constructor(e) {
768
781
  p(this, "ontimerangechange", null);
769
782
  p(this, "onvpnclientstatuschange", null);
770
783
  p(this, "_getApiLinks");
784
+ p(this, "_getDesignTokens");
771
785
  p(this, "appData");
772
786
  p(this, "componentBaseUrl");
773
787
  p(this, "destroyed");
@@ -777,7 +791,12 @@ class _t {
777
791
  p(this, "timeRange");
778
792
  p(this, "timeRangeIsAdjustable");
779
793
  p(this, "vpnClientStatus");
780
- this._getApiLinks = () => new Map(e._apiLinkEntries), this.appData = e.appData, this.componentBaseUrl = e.componentBaseUrl, this.destroyed = e.destroyed, this.mode = e.mode, this.inputs = e.inputs, this.inputMap = new Map(Object.entries(this.inputs)), this.timeRange = e.timeRange, this.timeRangeIsAdjustable = e.timeRangeIsAdjustable, this.vpnClientStatus = e.vpnClientStatus, this._messageHandler = this._messageHandler.bind(this), window.addEventListener("message", this._messageHandler, !1);
794
+ p(this, "getDesignToken");
795
+ this._getApiLinks = () => new Map(e._apiLinkEntries), this._getDesignTokens = () => new Map(e._designTokenEntries), this.appData = e.appData, this.componentBaseUrl = e.componentBaseUrl, this.destroyed = e.destroyed, this.mode = e.mode, this.inputs = e.inputs, this.inputMap = new Map(Object.entries(this.inputs)), this.timeRange = e.timeRange, this.timeRangeIsAdjustable = e.timeRangeIsAdjustable, this.vpnClientStatus = e.vpnClientStatus, this._messageHandler = this._messageHandler.bind(this), window.addEventListener("message", this._messageHandler, !1);
796
+ const n = (r) => this._getDesignTokens().get(r) ?? "";
797
+ n.var = (r) => `var(--uic-${r})`, this.getDesignToken = n;
798
+ const a = new CSSStyleSheet(), o = e._designTokenEntries.map(([r, i]) => `--uic-${r}:${i}`);
799
+ a.replaceSync(`:root {${o.join(";")}}`), window.document.adoptedStyleSheets.push(a);
781
800
  }
782
801
  _messageHandler(e) {
783
802
  if (e.source === window.parent)
@@ -798,7 +817,7 @@ class _t {
798
817
  payload: { clientId: e }
799
818
  },
800
819
  "*"
801
- ), new Dt(e);
820
+ ), new Rt(e);
802
821
  }
803
822
  createLoggingDataClient() {
804
823
  const e = crypto.randomUUID();
@@ -808,7 +827,7 @@ class _t {
808
827
  payload: { clientId: e }
809
828
  },
810
829
  "*"
811
- ), new Rt(e);
830
+ ), new bt(e);
812
831
  }
813
832
  createObjectStorageClient() {
814
833
  throw new f();
@@ -821,7 +840,7 @@ class _t {
821
840
  payload: { clientId: e }
822
841
  },
823
842
  "*"
824
- ), new bt(e);
843
+ ), new St(e);
825
844
  }
826
845
  createTooltip() {
827
846
  throw new f();
@@ -836,8 +855,8 @@ class _t {
836
855
  return n ? Object.keys(n).sort().reduce((o, r) => {
837
856
  if (o.includes(`{${r}}`))
838
857
  return o.replace(`{${r}}`, n[r]);
839
- const l = new URL(o);
840
- return l.searchParams.set(r, n[r]), decodeURIComponent(l.href);
858
+ const i = new URL(o);
859
+ return i.searchParams.set(r, n[r]), decodeURIComponent(i.href);
841
860
  }, a.href) : a.href;
842
861
  }
843
862
  navigateByUrl(e) {
@@ -853,7 +872,7 @@ class _t {
853
872
  }
854
873
  openActionMenu(e, n) {
855
874
  return new Promise((a) => {
856
- window.addEventListener("message", o, !1), window.parent.postMessage({ type: s.OpenActionMenu, payload: { selector: B(e), options: n } }, "*");
875
+ window.addEventListener("message", o, !1), window.parent.postMessage({ type: s.OpenActionMenu, payload: { selector: P(e), options: n } }, "*");
857
876
  function o(r) {
858
877
  r.source === window.parent && r.data.type === s.OpenActionMenuResult && (window.removeEventListener("message", o, !1), a(r.data.payload.result));
859
878
  }
@@ -907,7 +926,7 @@ class _t {
907
926
  }
908
927
  openSelectPanel(e, n) {
909
928
  return new Promise((a) => {
910
- window.addEventListener("message", o, !1), window.parent.postMessage({ type: s.OpenSelectPanel, payload: { selector: B(e), options: n } }, "*");
929
+ window.addEventListener("message", o, !1), window.parent.postMessage({ type: s.OpenSelectPanel, payload: { selector: P(e), options: n } }, "*");
911
930
  function o(r) {
912
931
  r.source === window.parent && r.data.type === s.OpenSelectPanelResult && (window.removeEventListener("message", o, !1), a(r.data.payload.result));
913
932
  }
@@ -918,8 +937,8 @@ class _t {
918
937
  window.addEventListener("message", r, !1);
919
938
  const a = crypto.randomUUID(), o = typeof e[0] == "string" ? { ...e[1], message: e[0] } : e[0];
920
939
  window.parent.postMessage({ type: s.OpenToast, payload: { id: a, options: o } }, "*");
921
- function r(l) {
922
- l.source === window.parent && l.data.type === s.OpenToastResult && l.data.payload.id === a && (window.removeEventListener("message", r, !1), n(l.data.payload.result));
940
+ function r(i) {
941
+ i.source === window.parent && i.data.type === s.OpenToastResult && i.data.payload.id === a && (window.removeEventListener("message", r, !1), n(i.data.payload.result));
923
942
  }
924
943
  });
925
944
  }
@@ -957,7 +976,7 @@ class _t {
957
976
  throw new f();
958
977
  }
959
978
  }
960
- class Dt {
979
+ class Rt {
961
980
  constructor(e) {
962
981
  this.id = e;
963
982
  }
@@ -973,8 +992,8 @@ class Dt {
973
992
  functionArguments: n
974
993
  }
975
994
  });
976
- function r(l) {
977
- l.source === window.parent && l.data.type === s.BackendComponentClientCallResult && l.data.payload.callId === o && (window.removeEventListener("message", r, !1), a(l.data.payload.result));
995
+ function r(i) {
996
+ i.source === window.parent && i.data.type === s.BackendComponentClientCallResult && i.data.payload.callId === o && (window.removeEventListener("message", r, !1), a(i.data.payload.result));
978
997
  }
979
998
  });
980
999
  }
@@ -988,7 +1007,7 @@ class Dt {
988
1007
  );
989
1008
  }
990
1009
  }
991
- class Rt {
1010
+ class bt {
992
1011
  constructor(e) {
993
1012
  this.id = e;
994
1013
  }
@@ -1005,16 +1024,16 @@ class Rt {
1005
1024
  };
1006
1025
  function o(r) {
1007
1026
  if (r.source === window.parent && r.data.type === s.LoggingDataClientQueryResult && r.data.payload.queryId === a) {
1008
- const { results: l } = r.data.payload;
1027
+ const { results: i } = r.data.payload;
1009
1028
  if (e.length)
1010
1029
  if (!e.queries || e.format !== "csv") {
1011
- const c = l.map((i) => P(i));
1012
- n(c);
1030
+ const d = i.map((l) => N(l));
1031
+ n(d);
1013
1032
  } else
1014
1033
  throw new f();
1015
1034
  else {
1016
- const c = P(l);
1017
- n(c);
1035
+ const d = N(i);
1036
+ n(d);
1018
1037
  }
1019
1038
  }
1020
1039
  }
@@ -1029,7 +1048,7 @@ class Rt {
1029
1048
  );
1030
1049
  }
1031
1050
  }
1032
- class bt {
1051
+ class St {
1033
1052
  constructor(e) {
1034
1053
  this.id = e;
1035
1054
  }
@@ -1088,17 +1107,17 @@ class bt {
1088
1107
  );
1089
1108
  }
1090
1109
  }
1091
- function L(t) {
1110
+ function I(t) {
1092
1111
  const e = !!(t && t.migrateInputs);
1093
- return !e && L.__cache__ ? Promise.resolve(L.__cache__) : new Promise((n) => {
1112
+ return !e && I.__cache__ ? Promise.resolve(I.__cache__) : new Promise((n) => {
1094
1113
  window.addEventListener(
1095
1114
  "message",
1096
1115
  function a(o) {
1097
1116
  if (o.source === window.parent && o.data && o.data.type === s.Created) {
1098
1117
  let r = o.data.payload;
1099
1118
  e && (r.inputs = t.migrateInputs(r.inputs, null));
1100
- const l = new _t(r);
1101
- n(l), e || (L.__cache__ = l), window.removeEventListener("message", a, !1);
1119
+ const i = new Dt(r);
1120
+ n(i), e || (I.__cache__ = i), window.removeEventListener("message", a, !1);
1102
1121
  }
1103
1122
  },
1104
1123
  !1
@@ -1106,6 +1125,6 @@ function L(t) {
1106
1125
  });
1107
1126
  }
1108
1127
  export {
1109
- $t as connect,
1110
- L as getComponentContext
1128
+ Mt as connect,
1129
+ I as getComponentContext
1111
1130
  };
@@ -1 +1 @@
1
- (function(p,i){typeof exports=="object"&&typeof module<"u"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(p=typeof globalThis<"u"?globalThis:p||self,i(p["@ixon-cdk/iframe-adapter"]={}))})(this,function(p){"use strict";var Ot=Object.defineProperty;var St=(p,i,s)=>i in p?Ot(p,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):p[i]=s;var g=(p,i,s)=>(St(p,typeof i!="symbol"?i+"":i,s),s);const i="cdk:cmpctx:",s={Create:`${i}create`,Created:`${i}created`,Destroy:`${i}destroy`,BackendComponentClientCreate:`${i}bcc:create`,BackendComponentClientDestroy:`${i}bcc:destroy`,BackendComponentClientCall:`${i}bcc:call`,BackendComponentClientCallResult:`${i}bcc:callresult`,LoggingDataClientCreate:`${i}ldc:create`,LoggingDataClientDestroy:`${i}ldc:destroy`,LoggingDataClientQuery:`${i}ldc:query`,LoggingDataClientQueryResult:`${i}ldc:queryresult`,ResourceDataClientCreate:`${i}rdc:create`,ResourceDataClientDestroy:`${i}rdc:destroy`,ResourceDataClientQuery:`${i}rdc:query`,ResourceDataClientQueryResult:`${i}rdc:queryresult`,ResourceDataClientRender:`${i}rdc:render`,ResourceDataClientRenderResult:`${i}rdc:renderresult`,ResourceDataClientUpdate:`${i}rdc:update`,ResourceDataClientUpdated:`${i}rdc:updated`,OpenActionMenu:`${i}openactionmenu`,OpenActionMenuResult:`${i}openactionmenuresult`,OpenActionBottomSheet:`${i}openactionbottomsheet`,OpenActionBottomSheetResult:`${i}openactionbottomsheetresult`,OpenAlertDialog:`${i}openalertdialog`,OpenAlertDialogResult:`${i}openalertdialogresult`,OpenConfirmDialog:`${i}openconfirmdialog`,OpenConfirmDialogResult:`${i}openconfirmdialogresult`,OpenContentDialog:`${i}opencontentdialog`,OpenContentDialogResult:`${i}opencontentdialogresult`,OpenFormDialog:`${i}openformdialog`,OpenFormDialogResult:`${i}openformdialogresult`,OpenSelectPanel:`${i}openselectpanel`,OpenSelectPanelResult:`${i}openselectpanelresult`,OpenToast:`${i}opentoast`,OpenToastResult:`${i}opentoastresult`,ShowVpnStatusDetails:`${i}showvpnstatusdetails`,ToggleVpn:`${i}togglevpn`,VpnClientStatusChange:`${i}vpnclientstatuschange`,NavigateByUrl:`${i}navigatebyurl`,SetTimeRange:`${i}settimerange`,TimeRangeChange:`${i}timerangechange`};function Z({iframe:t,context:e}){return window.addEventListener("message",a,!1),e.ontimerangechange=(...o)=>{t.contentWindow&&t.contentWindow.postMessage({type:s.TimeRangeChange,payload:o},"*")},e.onvpnclientstatuschange=(...o)=>{t.contentWindow&&t.contentWindow.postMessage({type:s.VpnClientStatusChange,payload:o},"*")},{destroy(){window.removeEventListener("message",a,!1)}};function n(o){return{_apiLinkEntries:[...o._getApiLinks().entries()],appData:o.appData,componentBaseUrl:o.componentBaseUrl,destroyed:o.destroyed,mode:o.mode,inputs:o.inputs,timeRange:o.timeRange,timeRangeIsAdjustable:o.timeRangeIsAdjustable,vpnClientStatus:o.vpnClientStatus}}function a(o){if(a._clients=a._clients||new Map([]),o.source===t.contentWindow)switch(o.data.type){case s.Create:t.contentWindow.postMessage({type:s.Created,payload:n(e)},"*");break;case s.Destroy:e.destroy();break;case s.BackendComponentClientCreate:{const{clientId:r}=o.data.payload,d=e.createBackendComponentClient(r);a._clients.set(r,d);break}case s.BackendComponentClientDestroy:{const{clientId:r}=o.data.payload;a._clients.has(r)&&(a._clients.get(r).destroy(),a._clients.delete(r));break}case s.BackendComponentClientCall:{const{clientId:r,callId:d,functionName:c,functionArguments:l}=o.data.payload;let u=a._clients.get(r);u&&!u._destroyed&&u.call(c,l).then(f=>{u&&!u.destroyed&&t.contentWindow.postMessage({type:s.BackendComponentClientCallResult,payload:{callId:d,result:f}},"*")});break}case s.LoggingDataClientCreate:{const{clientId:r}=o.data.payload,d=e.createLoggingDataClient(r);a._clients.set(r,d);break}case s.LoggingDataClientDestroy:{const{clientId:r}=o.data.payload;a._clients.has(r)&&(a._clients.get(r).destroy(),a._clients.delete(r));break}case s.LoggingDataClientQuery:{const{clientId:r,queryId:d,query:c}=o.data.payload;let l=a._clients.get(r);l&&!l._destroyed&&l.query(c,u=>{l._destroyed||t.contentWindow.postMessage({type:s.LoggingDataClientQueryResult,payload:{queryId:d,results:u}},"*")});break}case s.ResourceDataClientCreate:{const{clientId:r}=o.data.payload,d=e.createResourceDataClient(r);a._clients.set(r,d);break}case s.ResourceDataClientDestroy:{const{clientId:r}=o.data.payload;a._clients.has(r)&&(a._clients.get(r).destroy(),a._clients.delete(r));break}case s.ResourceDataClientQuery:{const{clientId:r,queryId:d,query:c}=o.data.payload;let l=a._clients.get(r);l&&!l._destroyed&&l.query(c,u=>{l._destroyed||t.contentWindow.postMessage({type:s.ResourceDataClientQueryResult,payload:{queryId:d,results:u}},"*")});break}case s.ResourceDataClientRender:{const{clientId:r,queryId:d,query:c}=o.data.payload;let l=a._clients.get(r);l&&!l._destroyed&&l.render(c,u=>{l._destroyed||t.contentWindow.postMessage({type:s.ResourceDataClientRenderResult,payload:{queryId:d,results:u}},"*")});break}case s.ResourceDataClientUpdate:{const{clientId:r,updateId:d,update:c}=o.data.payload;let l=a._clients.get(r);l&&!l._destroyed&&l.update(c).then(()=>{l&&!l._destroyed&&t.contentWindow.postMessage({type:s.ResourceDataClientUpdated,payload:{updateId:d}},"*")});break}case s.OpenActionBottomSheet:e.openActionBottomSheet(o.data.payload.options).then(r=>{t.contentWindow.postMessage({type:s.OpenActionBottomSheetResult,payload:{result:r}},"*")});break;case s.OpenActionMenu:{const r=t.contentDocument.querySelector(o.data.payload.selector),d={getBoundingClientRect:()=>{const c=t.getBoundingClientRect(),l=r.getBoundingClientRect();return{...JSON.parse(JSON.stringify(l)),top:c.top+l.top,x:c.x+l.x}}};e.openActionMenu(d,o.data.payload.options).then(c=>{t.contentWindow.postMessage({type:s.OpenActionMenuResult,payload:{result:c}},"*")})}break;case s.OpenAlertDialog:e.openAlertDialog(o.data.payload.options).then(r=>{t.contentWindow.postMessage({type:s.OpenAlertDialogResult,payload:{result:r}},"*")});break;case s.OpenConfirmDialog:e.openConfirmDialog(o.data.payload.options).then(r=>{t.contentWindow.postMessage({type:s.OpenConfirmDialogResult,payload:{result:r}},"*")});break;case s.OpenContentDialog:e.openContentDialog(o.data.payload.options).then(r=>{t.contentWindow.postMessage({type:s.OpenContentDialogResult,payload:{result:r}},"*")});break;case s.OpenFormDialog:e.openFormDialog(o.data.payload.options).then(r=>{t.contentWindow.postMessage({type:s.OpenFormDialogResult,payload:{result:r}},"*")});break;case s.OpenSelectPanel:{const r=t.contentDocument.querySelector(o.data.payload.selector),d={getBoundingClientRect:()=>{const c=t.getBoundingClientRect(),l=r.getBoundingClientRect();return{...JSON.parse(JSON.stringify(l)),top:c.top+l.top,x:c.x+l.x}}};e.openSelectPanel(d,o.data.payload.options).then(c=>{t.contentWindow.postMessage({type:s.OpenSelectPanelResult,payload:{result:c}},"*")})}break;case s.OpenToast:e.openToast(o.data.payload.options).then(r=>{const{id:d}=o.data.payload;t.contentWindow&&t.contentWindow.postMessage({type:s.OpenToastResult,payload:{id:d,result:r}},"*")});break;case s.ShowVpnStatusDetails:e.showVpnStatusDetails(o.data.payload.agentId);break;case s.ToggleVpn:e.toggleVpn(o.data.payload.agentId);break;case s.NavigateByUrl:e.navigateByUrl(o.data.payload.url);break;case s.SetTimeRange:e.setTimeRange(o.data.payload.timeRange);break}}}class ee{constructor(e,n,a,o){this.query=e,this.variable=n,this.tag=a,this._onCancel=o,Object.freeze(this)}cancel(){this._onCancel&&this._onCancel()}}var te=typeof global=="object"&&global&&global.Object===Object&&global;const ne=te;var ae=typeof self=="object"&&self&&self.Object===Object&&self,oe=ne||ae||Function("return this")();const L=oe;var re=L.Symbol;const R=re;var N=Object.prototype,se=N.hasOwnProperty,ie=N.toString,_=R?R.toStringTag:void 0;function le(t){var e=se.call(t,_),n=t[_];try{t[_]=void 0;var a=!0}catch{}var o=ie.call(t);return a&&(e?t[_]=n:delete t[_]),o}var de=Object.prototype,ce=de.toString;function ue(t){return ce.call(t)}var pe="[object Null]",ge="[object Undefined]",P=R?R.toStringTag:void 0;function ye(t){return t==null?t===void 0?ge:pe:P&&P in Object(t)?le(t):ue(t)}function j(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var fe="[object AsyncFunction]",he="[object Function]",me="[object GeneratorFunction]",we="[object Proxy]";function Ce(t){if(!j(t))return!1;var e=ye(t);return e==he||e==me||e==fe||e==we}var _e=L["__core-js_shared__"];const T=_e;var B=function(){var t=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function De(t){return!!B&&B in t}var Re=Function.prototype,be=Re.toString;function Oe(t){if(t!=null){try{return be.call(t)}catch{}try{return t+""}catch{}}return""}var Se=/[\\^$.*+?()[\]{}|]/g,Me=/^\[object .+?Constructor\]$/,$e=Function.prototype,ve=Object.prototype,Ee=$e.toString,Ie=ve.hasOwnProperty,Le=RegExp("^"+Ee.call(Ie).replace(Se,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Te(t){if(!j(t)||De(t))return!1;var e=Ce(t)?Le:Me;return e.test(Oe(t))}function qe(t,e){return t==null?void 0:t[e]}function k(t,e){var n=qe(t,e);return Te(n)?n:void 0}function Ae(t,e){return t===e||t!==t&&e!==e}var Ue=k(Object,"create");const D=Ue;function Ne(){this.__data__=D?D(null):{},this.size=0}function Pe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var je="__lodash_hash_undefined__",Be=Object.prototype,ke=Be.hasOwnProperty;function Fe(t){var e=this.__data__;if(D){var n=e[t];return n===je?void 0:n}return ke.call(e,t)?e[t]:void 0}var He=Object.prototype,Ve=He.hasOwnProperty;function We(t){var e=this.__data__;return D?e[t]!==void 0:Ve.call(e,t)}var ze="__lodash_hash_undefined__";function Qe(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=D&&e===void 0?ze:e,this}function m(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var a=t[e];this.set(a[0],a[1])}}m.prototype.clear=Ne,m.prototype.delete=Pe,m.prototype.get=Fe,m.prototype.has=We,m.prototype.set=Qe;function Ge(){this.__data__=[],this.size=0}function b(t,e){for(var n=t.length;n--;)if(Ae(t[n][0],e))return n;return-1}var Je=Array.prototype,xe=Je.splice;function Ke(t){var e=this.__data__,n=b(e,t);if(n<0)return!1;var a=e.length-1;return n==a?e.pop():xe.call(e,n,1),--this.size,!0}function Xe(t){var e=this.__data__,n=b(e,t);return n<0?void 0:e[n][1]}function Ye(t){return b(this.__data__,t)>-1}function Ze(t,e){var n=this.__data__,a=b(n,t);return a<0?(++this.size,n.push([t,e])):n[a][1]=e,this}function C(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var a=t[e];this.set(a[0],a[1])}}C.prototype.clear=Ge,C.prototype.delete=Ke,C.prototype.get=Xe,C.prototype.has=Ye,C.prototype.set=Ze;var et=k(L,"Map");const tt=et;function nt(){this.size=0,this.__data__={hash:new m,map:new(tt||C),string:new m}}function at(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function O(t,e){var n=t.__data__;return at(e)?n[typeof e=="string"?"string":"hash"]:n.map}function ot(t){var e=O(this,t).delete(t);return this.size-=e?1:0,e}function rt(t){return O(this,t).get(t)}function st(t){return O(this,t).has(t)}function it(t,e){var n=O(this,t),a=n.size;return n.set(t,e),this.size+=n.size==a?0:1,this}function w(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var a=t[e];this.set(a[0],a[1])}}w.prototype.clear=nt,w.prototype.delete=ot,w.prototype.get=rt,w.prototype.has=st,w.prototype.set=it;var lt="Expected a function";function q(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(lt);var n=function(){var a=arguments,o=e?e.apply(this,a):a[0],r=n.cache;if(r.has(o))return r.get(o);var d=t.apply(this,a);return n.cache=r.set(o,d)||r,d};return n.cache=new(q.Cache||w),n}q.Cache=w;const dt=2,F=1,H="";class S{constructor(e,n,a){this.locale=e,this.queryRef=n,this.rawValue=a}static create(e,n,a){return n.query.postAggr==="count"?new ct(e,n,a):new S(e,n,a)}getDecimals(e=dt){return this.decimals??this.queryRef.query.decimals??e}getFactor(){var e,n,a;return this.factor??this.queryRef.query.factor??((n=(e=this.queryRef.tag)==null?void 0:e.variable)!=null&&n.factor?parseFloat(this.queryRef.tag.variable.factor):null)??((a=this.queryRef.variable)!=null&&a.factor?parseFloat(this.queryRef.variable.factor):null)??F}getUnit(){var e,n,a;return this.unit??this.queryRef.query.unit??((n=(e=this.queryRef.tag)==null?void 0:e.variable)==null?void 0:n.unit)??((a=this.queryRef.variable)==null?void 0:a.unit)??H}setDecimals(e){this.decimals=e}setFactor(e){this.factor=e}setUnit(e){this.unit=e}getValue(){return this.rawValue}toString(){var a,o,r,d;const e=this.locale??void 0,n=q((c,l,u,f)=>{const bt={style:"decimal",minimumFractionDigits:Math.floor(l),maximumFractionDigits:Math.floor(l)};return`${new Intl.NumberFormat(f,bt).format(c)}${u?" "+u:""}`});return this.rawValue===null?"":this.queryRef.query.postAggr==="count"?n(this.rawValue,this.getDecimals(0),this.unit??this.queryRef.query.unit,e):((a=this.queryRef.variable)==null?void 0:a.type)==="str"?this.rawValue:((o=this.queryRef.variable)==null?void 0:o.type)==="bool"?this.rawValue?"True":"False":((r=this.queryRef.variable)==null?void 0:r.type)==="int"?n(this.rawValue,Number.isInteger(this.getFactor())?this.getDecimals(0):this.getDecimals(),this.getUnit(),e):((d=this.queryRef.variable)==null?void 0:d.type)==="float"?n(this.rawValue,this.getDecimals(),this.getUnit(),e):String(this.getValue())}}class ct extends S{getFactor(){return this.factor??this.queryRef.query.factor??F}getUnit(){return this.unit??this.queryRef.query.unit??H}}function V(t){return t.map(({queryRef:n,time:a,value:o})=>{const r=new ee(n.query,n.variable,n.tag),d=S.create(o.locale,r,o.rawValue);return{queryRef:r,time:a,value:d}})}let y,A,W;function z(t,e){if(W=new Date,t.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if(t.tagName.toLowerCase()==="html")return"html";const n={root:document.body,idName:o=>!0,className:o=>!0,tagName:o=>!0,attr:(o,r)=>!1,seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};y={...n,...e},A=ut(y.root,n);let a=M(t,"all",()=>M(t,"two",()=>M(t,"one",()=>M(t,"none"))));if(a){const o=X(Y(a,t));return o.length>0&&(a=o[0]),$(a)}else throw new Error("Selector was not found.")}function ut(t,e){return t.nodeType===Node.DOCUMENT_NODE?t:t===e.root?t.ownerDocument:t}function M(t,e,n){let a=null,o=[],r=t,d=0;for(;r;){const c=new Date().getTime()-W.getTime();if(y.timeoutMs!==void 0&&c>y.timeoutMs)throw new Error(`Timeout: Can't find a unique selector after ${c}ms`);let l=E(pt(r))||E(...gt(r))||E(...yt(r))||E(ft(r))||[x()];const u=ht(r);if(e=="all")u&&(l=l.concat(l.filter(U).map(f=>v(f,u))));else if(e=="two")l=l.slice(0,1),u&&(l=l.concat(l.filter(U).map(f=>v(f,u))));else if(e=="one"){const[f]=l=l.slice(0,1);u&&U(f)&&(l=[v(f,u)])}else e=="none"&&(l=[x()],u&&(l=[v(l[0],u)]));for(let f of l)f.level=d;if(o.push(l),o.length>=y.seedMinLength&&(a=Q(o,n),a))break;r=r.parentElement,d++}return a||(a=Q(o,n)),!a&&n?n():a}function Q(t,e){const n=X(K(t));if(n.length>y.threshold)return e?e():null;for(let a of n)if(J(a))return a;return null}function $(t){let e=t[0],n=e.name;for(let a=1;a<t.length;a++){const o=t[a].level||0;e.level===o-1?n=`${t[a].name} > ${n}`:n=`${t[a].name} ${n}`,e=t[a]}return n}function G(t){return t.map(e=>e.penalty).reduce((e,n)=>e+n,0)}function J(t){const e=$(t);switch(A.querySelectorAll(e).length){case 0:throw new Error(`Can't select any node with this selector: ${e}`);case 1:return!0;default:return!1}}function pt(t){const e=t.getAttribute("id");return e&&y.idName(e)?{name:"#"+CSS.escape(e),penalty:0}:null}function gt(t){return Array.from(t.attributes).filter(n=>y.attr(n.name,n.value)).map(n=>({name:`[${CSS.escape(n.name)}="${CSS.escape(n.value)}"]`,penalty:.5}))}function yt(t){return Array.from(t.classList).filter(y.className).map(n=>({name:"."+CSS.escape(n),penalty:1}))}function ft(t){const e=t.tagName.toLowerCase();return y.tagName(e)?{name:e,penalty:2}:null}function x(){return{name:"*",penalty:3}}function ht(t){const e=t.parentNode;if(!e)return null;let n=e.firstChild;if(!n)return null;let a=0;for(;n&&(n.nodeType===Node.ELEMENT_NODE&&a++,n!==t);)n=n.nextSibling;return a}function v(t,e){return{name:t.name+`:nth-child(${e})`,penalty:t.penalty+1}}function U(t){return t.name!=="html"&&!t.name.startsWith("#")}function E(...t){const e=t.filter(mt);return e.length>0?e:null}function mt(t){return t!=null}function*K(t,e=[]){if(t.length>0)for(let n of t[0])yield*K(t.slice(1,t.length),e.concat(n));else yield e}function X(t){return[...t].sort((e,n)=>G(e)-G(n))}function*Y(t,e,n={counter:0,visited:new Map}){if(t.length>2&&t.length>y.optimizedMinLength)for(let a=1;a<t.length-1;a++){if(n.counter>y.maxNumberOfTries)return;n.counter+=1;const o=[...t];o.splice(a,1);const r=$(o);if(n.visited.has(r))return;J(o)&&wt(o,e)&&(yield o,n.visited.set(r,!0),yield*Y(o,e,n))}}function wt(t,e){return A.querySelector($(t))===e}class h extends Error{constructor(e="Method is not implemented"){super(e),this.name="NotImplementedError",this.message=e,this.stack=`NotImplementedError: ${e}`}}class Ct{constructor(e){g(this,"ontimerangechange",null);g(this,"onvpnclientstatuschange",null);g(this,"_getApiLinks");g(this,"appData");g(this,"componentBaseUrl");g(this,"destroyed");g(this,"mode");g(this,"inputs");g(this,"inputMap");g(this,"timeRange");g(this,"timeRangeIsAdjustable");g(this,"vpnClientStatus");this._getApiLinks=()=>new Map(e._apiLinkEntries),this.appData=e.appData,this.componentBaseUrl=e.componentBaseUrl,this.destroyed=e.destroyed,this.mode=e.mode,this.inputs=e.inputs,this.inputMap=new Map(Object.entries(this.inputs)),this.timeRange=e.timeRange,this.timeRangeIsAdjustable=e.timeRangeIsAdjustable,this.vpnClientStatus=e.vpnClientStatus,this._messageHandler=this._messageHandler.bind(this),window.addEventListener("message",this._messageHandler,!1)}_messageHandler(e){if(e.source===window.parent)switch(e.data.type){case s.TimeRangeChange:this.ontimerangechange&&this.ontimerangechange(...e.data.payload);break;case s.VpnClientStatusChange:this.onvpnclientstatuschange&&this.onvpnclientstatuschange(...e.data.payload);break}}createBackendComponentClient(){const e=crypto.randomUUID();return window.parent.postMessage({type:s.BackendComponentClientCreate,payload:{clientId:e}},"*"),new _t(e)}createLoggingDataClient(){const e=crypto.randomUUID();return window.parent.postMessage({type:s.LoggingDataClientCreate,payload:{clientId:e}},"*"),new Dt(e)}createObjectStorageClient(){throw new h}createResourceDataClient(){const e=crypto.randomUUID();return window.parent.postMessage({type:s.ResourceDataClientCreate,payload:{clientId:e}},"*"),new Rt(e)}createTooltip(){throw new h}destroy(){window.parent.postMessage({type:s.Destroy},"*"),window.removeEventListener("message",this._messageHandler,!1),this.destroyed=!0}getApiUrl(e,n){const a=this._getApiLinks().get(e);if(!a)throw new Error("IxApiError: entry not found");return n?Object.keys(n).sort().reduce((o,r)=>{if(o.includes(`{${r}}`))return o.replace(`{${r}}`,n[r]);const d=new URL(o);return d.searchParams.set(r,n[r]),decodeURIComponent(d.href)},a.href):a.href}navigateByUrl(e){window.parent.postMessage({type:s.NavigateByUrl,payload:{url:e}},"*")}openActionBottomSheet(e){return new Promise(n=>{window.addEventListener("message",a,!1),window.parent.postMessage({type:s.OpenActionBottomSheet,payload:{options:e}},"*");function a(o){o.source===window.parent&&o.data.type===s.OpenActionBottomSheetResult&&(window.removeEventListener("message",a,!1),n(o.data.payload.result))}})}openActionMenu(e,n){return new Promise(a=>{window.addEventListener("message",o,!1),window.parent.postMessage({type:s.OpenActionMenu,payload:{selector:z(e),options:n}},"*");function o(r){r.source===window.parent&&r.data.type===s.OpenActionMenuResult&&(window.removeEventListener("message",o,!1),a(r.data.payload.result))}})}openAlertDialog(e){return new Promise(n=>{window.addEventListener("message",a,!1),window.parent.postMessage({type:s.OpenAlertDialog,payload:{options:e}},"*");function a(o){o.source===window.parent&&o.data.type===s.OpenAlertDialogResult&&(window.removeEventListener("message",a,!1),n(o.data.payload.result))}})}openConfirmDialog(e){return new Promise(n=>{window.addEventListener("message",a,!1),window.parent.postMessage({type:s.OpenConfirmDialog,payload:{options:e}},"*");function a(o){o.source===window.parent&&o.data.type===s.OpenConfirmDialogResult&&(window.removeEventListener("message",a,!1),n(o.data.payload.result))}})}openContentDialog(e){if(typeof e.onopened=="function")throw new h('The "onopened" option is not implemented');if(typeof e.onclose=="function")throw new h('The "onclose" option is not implemented');if(e.pagination)throw new h('The "pagination" option is not implemented');return new Promise(n=>{window.addEventListener("message",a,!1),window.parent.postMessage({type:s.OpenContentDialog,payload:{options:e.htmlContent&&typeof e.htmlContent!="string"?{...e,htmlContent:e.htmlContent.cloneNode(!0).outerHTML}:e}},"*");function a(o){o.source===window.parent&&o.data.type===s.OpenContentDialogResult&&(window.removeEventListener("message",a,!1),n(o.data.payload.result))}})}openFormDialog(e){return new Promise(n=>{window.addEventListener("message",a,!1),window.parent.postMessage({type:s.OpenFormDialog,payload:{options:e}},"*");function a(o){o.source===window.parent&&o.data.type===s.OpenFormDialogResult&&(window.removeEventListener("message",a,!1),n(o.data.payload.result))}})}openSelectPanel(e,n){return new Promise(a=>{window.addEventListener("message",o,!1),window.parent.postMessage({type:s.OpenSelectPanel,payload:{selector:z(e),options:n}},"*");function o(r){r.source===window.parent&&r.data.type===s.OpenSelectPanelResult&&(window.removeEventListener("message",o,!1),a(r.data.payload.result))}})}openToast(...e){return new Promise(n=>{window.addEventListener("message",r,!1);const a=crypto.randomUUID(),o=typeof e[0]=="string"?{...e[1],message:e[0]}:e[0];window.parent.postMessage({type:s.OpenToast,payload:{id:a,options:o}},"*");function r(d){d.source===window.parent&&d.data.type===s.OpenToastResult&&d.data.payload.id===a&&(window.removeEventListener("message",r,!1),n(d.data.payload.result))}})}sanitizeHtml(){throw new h}saveAsFile(){throw new h}setTimeRange(e){window.parent.postMessage({type:s.SetTimeRange,payload:{timeRange:e}},"*")}showVpnStatusDetails(e){window.parent.postMessage({type:s.ShowVpnStatusDetails,payload:{agentId:e}},"*")}testVpnAccess(){throw new h}toggleVpn(e){window.parent.postMessage({type:s.ToggleVpn,payload:{agentId:e}},"*")}translate(){throw new h}}class _t{constructor(e){this.id=e}call(e,n){return new Promise(a=>{const o=crypto.randomUUID();window.addEventListener("message",r,!1),window.parent.postMessage({type:s.BackendComponentClientCall,payload:{clientId:this.id,callId:o,functionName:e,functionArguments:n}});function r(d){d.source===window.parent&&d.data.type===s.BackendComponentClientCallResult&&d.data.payload.callId===o&&(window.removeEventListener("message",r,!1),a(d.data.payload.result))}})}destroy(){window.parent.postMessage({type:s.BackendComponentClientDestroy,payload:{clientId:this.id}},"*")}}class Dt{constructor(e){this.id=e}query(e,n){const a=crypto.randomUUID();return window.addEventListener("message",o,!1),window.parent.postMessage({type:s.LoggingDataClientQuery,payload:{clientId:this.id,queryId:a,query:e}},"*"),()=>{window.removeEventListener("message",o,!1)};function o(r){if(r.source===window.parent&&r.data.type===s.LoggingDataClientQueryResult&&r.data.payload.queryId===a){const{results:d}=r.data.payload;if(e.length)if(!e.queries||e.format!=="csv"){const c=d.map(l=>V(l));n(c)}else throw new h;else{const c=V(d);n(c)}}}}destroy(){window.parent.postMessage({type:s.LoggingDataClientDestroy,payload:{clientId:this.id}},"*")}}class Rt{constructor(e){this.id=e}query(e,n){const a=crypto.randomUUID();return window.addEventListener("message",o,!1),window.parent.postMessage({type:s.ResourceDataClientQuery,payload:{clientId:this.id,queryId:a,query:e}},"*"),()=>{window.removeEventListener("message",o,!1)};function o(r){r.source===window.parent&&r.data.type===s.ResourceDataClientQueryResult&&r.data.payload.queryId===a&&n(r.data.payload.results)}}update(e){return new Promise(n=>{const a=crypto.randomUUID();window.addEventListener("message",o,!1),window.parent.postMessage({type:s.ResourceDataClientUpdate,payload:{clientId:this.id,updateId:a,update:e}},"*");function o(r){r.source===window.parent&&r.data.type===s.ResourceDataClientUpdated&&r.data.payload.updateId===a&&(window.removeEventListener("message",o,!1),n())}})}render(e,n){const a=crypto.randomUUID();return window.addEventListener("message",o,!1),window.parent.postMessage({type:s.ResourceDataClientRender,payload:{clientId:this.id,queryId:a,query:e}},"*"),()=>{window.removeEventListener("message",o,!1)};function o(r){r.source===window.parent&&r.data.type===s.ResourceDataClientRenderResult&&r.data.payload.queryId===a&&n(r.data.payload.results)}}destroy(){window.parent.postMessage({type:s.ResourceDataClientDestroy,payload:{clientId:this.id}},"*")}}function I(t){const e=!!(t&&t.migrateInputs);return!e&&I.__cache__?Promise.resolve(I.__cache__):new Promise(n=>{window.addEventListener("message",function a(o){if(o.source===window.parent&&o.data&&o.data.type===s.Created){let r=o.data.payload;e&&(r.inputs=t.migrateInputs(r.inputs,null));const d=new Ct(r);n(d),e||(I.__cache__=d),window.removeEventListener("message",a,!1)}},!1),window.parent.postMessage({type:s.Create},"*")})}p.connect=Z,p.getComponentContext=I,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
1
+ (function(g,i){typeof exports=="object"&&typeof module<"u"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(g=typeof globalThis<"u"?globalThis:g||self,i(g["@ixon-cdk/iframe-adapter"]={}))})(this,function(g){"use strict";var Ot=Object.defineProperty;var $t=(g,i,s)=>i in g?Ot(g,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):g[i]=s;var p=(g,i,s)=>($t(g,typeof i!="symbol"?i+"":i,s),s);const i="cdk:cmpctx:",s={Create:`${i}create`,Created:`${i}created`,Destroy:`${i}destroy`,BackendComponentClientCreate:`${i}bcc:create`,BackendComponentClientDestroy:`${i}bcc:destroy`,BackendComponentClientCall:`${i}bcc:call`,BackendComponentClientCallResult:`${i}bcc:callresult`,LoggingDataClientCreate:`${i}ldc:create`,LoggingDataClientDestroy:`${i}ldc:destroy`,LoggingDataClientQuery:`${i}ldc:query`,LoggingDataClientQueryResult:`${i}ldc:queryresult`,ResourceDataClientCreate:`${i}rdc:create`,ResourceDataClientDestroy:`${i}rdc:destroy`,ResourceDataClientQuery:`${i}rdc:query`,ResourceDataClientQueryResult:`${i}rdc:queryresult`,ResourceDataClientRender:`${i}rdc:render`,ResourceDataClientRenderResult:`${i}rdc:renderresult`,ResourceDataClientUpdate:`${i}rdc:update`,ResourceDataClientUpdated:`${i}rdc:updated`,OpenActionMenu:`${i}openactionmenu`,OpenActionMenuResult:`${i}openactionmenuresult`,OpenActionBottomSheet:`${i}openactionbottomsheet`,OpenActionBottomSheetResult:`${i}openactionbottomsheetresult`,OpenAlertDialog:`${i}openalertdialog`,OpenAlertDialogResult:`${i}openalertdialogresult`,OpenConfirmDialog:`${i}openconfirmdialog`,OpenConfirmDialogResult:`${i}openconfirmdialogresult`,OpenContentDialog:`${i}opencontentdialog`,OpenContentDialogResult:`${i}opencontentdialogresult`,OpenFormDialog:`${i}openformdialog`,OpenFormDialogResult:`${i}openformdialogresult`,OpenSelectPanel:`${i}openselectpanel`,OpenSelectPanelResult:`${i}openselectpanelresult`,OpenToast:`${i}opentoast`,OpenToastResult:`${i}opentoastresult`,ShowVpnStatusDetails:`${i}showvpnstatusdetails`,ToggleVpn:`${i}togglevpn`,VpnClientStatusChange:`${i}vpnclientstatuschange`,NavigateByUrl:`${i}navigatebyurl`,SetTimeRange:`${i}settimerange`,TimeRangeChange:`${i}timerangechange`},Z=["color-scheme","background","on-background","primary","on-primary","secondary","on-secondary","error","on-error","success","on-success"];function ee({iframe:t,context:e}){return window.addEventListener("message",a,!1),e.ontimerangechange=(...o)=>{t.contentWindow&&t.contentWindow.postMessage({type:s.TimeRangeChange,payload:o},"*")},e.onvpnclientstatuschange=(...o)=>{t.contentWindow&&t.contentWindow.postMessage({type:s.VpnClientStatusChange,payload:o},"*")},{destroy(){window.removeEventListener("message",a,!1)}};function n(o){return{_apiLinkEntries:[...o._getApiLinks().entries()],_designTokenEntries:Z.map(r=>[r,o.getDesignToken(r)]),appData:o.appData,componentBaseUrl:o.componentBaseUrl,destroyed:o.destroyed,mode:o.mode,inputs:o.inputs,timeRange:o.timeRange,timeRangeIsAdjustable:o.timeRangeIsAdjustable,vpnClientStatus:o.vpnClientStatus}}function a(o){if(a._clients=a._clients||new Map([]),o.source===t.contentWindow)switch(o.data.type){case s.Create:t.contentWindow.postMessage({type:s.Created,payload:n(e)},"*");break;case s.Destroy:e.destroy();break;case s.BackendComponentClientCreate:{const{clientId:r}=o.data.payload,l=e.createBackendComponentClient(r);a._clients.set(r,l);break}case s.BackendComponentClientDestroy:{const{clientId:r}=o.data.payload;a._clients.has(r)&&(a._clients.get(r).destroy(),a._clients.delete(r));break}case s.BackendComponentClientCall:{const{clientId:r,callId:l,functionName:c,functionArguments:d}=o.data.payload;let u=a._clients.get(r);u&&!u._destroyed&&u.call(c,d).then(f=>{u&&!u.destroyed&&t.contentWindow.postMessage({type:s.BackendComponentClientCallResult,payload:{callId:l,result:f}},"*")});break}case s.LoggingDataClientCreate:{const{clientId:r}=o.data.payload,l=e.createLoggingDataClient(r);a._clients.set(r,l);break}case s.LoggingDataClientDestroy:{const{clientId:r}=o.data.payload;a._clients.has(r)&&(a._clients.get(r).destroy(),a._clients.delete(r));break}case s.LoggingDataClientQuery:{const{clientId:r,queryId:l,query:c}=o.data.payload;let d=a._clients.get(r);d&&!d._destroyed&&d.query(c,u=>{d._destroyed||t.contentWindow.postMessage({type:s.LoggingDataClientQueryResult,payload:{queryId:l,results:u}},"*")});break}case s.ResourceDataClientCreate:{const{clientId:r}=o.data.payload,l=e.createResourceDataClient(r);a._clients.set(r,l);break}case s.ResourceDataClientDestroy:{const{clientId:r}=o.data.payload;a._clients.has(r)&&(a._clients.get(r).destroy(),a._clients.delete(r));break}case s.ResourceDataClientQuery:{const{clientId:r,queryId:l,query:c}=o.data.payload;let d=a._clients.get(r);d&&!d._destroyed&&d.query(c,u=>{d._destroyed||t.contentWindow.postMessage({type:s.ResourceDataClientQueryResult,payload:{queryId:l,results:u}},"*")});break}case s.ResourceDataClientRender:{const{clientId:r,queryId:l,query:c}=o.data.payload;let d=a._clients.get(r);d&&!d._destroyed&&d.render(c,u=>{d._destroyed||t.contentWindow.postMessage({type:s.ResourceDataClientRenderResult,payload:{queryId:l,results:u}},"*")});break}case s.ResourceDataClientUpdate:{const{clientId:r,updateId:l,update:c}=o.data.payload;let d=a._clients.get(r);d&&!d._destroyed&&d.update(c).then(()=>{d&&!d._destroyed&&t.contentWindow.postMessage({type:s.ResourceDataClientUpdated,payload:{updateId:l}},"*")});break}case s.OpenActionBottomSheet:e.openActionBottomSheet(o.data.payload.options).then(r=>{t.contentWindow.postMessage({type:s.OpenActionBottomSheetResult,payload:{result:r}},"*")});break;case s.OpenActionMenu:{const r=t.contentDocument.querySelector(o.data.payload.selector),l={getBoundingClientRect:()=>{const c=t.getBoundingClientRect(),d=r.getBoundingClientRect();return{...JSON.parse(JSON.stringify(d)),top:c.top+d.top,x:c.x+d.x}}};e.openActionMenu(l,o.data.payload.options).then(c=>{t.contentWindow.postMessage({type:s.OpenActionMenuResult,payload:{result:c}},"*")})}break;case s.OpenAlertDialog:e.openAlertDialog(o.data.payload.options).then(r=>{t.contentWindow.postMessage({type:s.OpenAlertDialogResult,payload:{result:r}},"*")});break;case s.OpenConfirmDialog:e.openConfirmDialog(o.data.payload.options).then(r=>{t.contentWindow.postMessage({type:s.OpenConfirmDialogResult,payload:{result:r}},"*")});break;case s.OpenContentDialog:e.openContentDialog(o.data.payload.options).then(r=>{t.contentWindow.postMessage({type:s.OpenContentDialogResult,payload:{result:r}},"*")});break;case s.OpenFormDialog:e.openFormDialog(o.data.payload.options).then(r=>{t.contentWindow.postMessage({type:s.OpenFormDialogResult,payload:{result:r}},"*")});break;case s.OpenSelectPanel:{const r=t.contentDocument.querySelector(o.data.payload.selector),l={getBoundingClientRect:()=>{const c=t.getBoundingClientRect(),d=r.getBoundingClientRect();return{...JSON.parse(JSON.stringify(d)),top:c.top+d.top,x:c.x+d.x}}};e.openSelectPanel(l,o.data.payload.options).then(c=>{t.contentWindow.postMessage({type:s.OpenSelectPanelResult,payload:{result:c}},"*")})}break;case s.OpenToast:e.openToast(o.data.payload.options).then(r=>{const{id:l}=o.data.payload;t.contentWindow&&t.contentWindow.postMessage({type:s.OpenToastResult,payload:{id:l,result:r}},"*")});break;case s.ShowVpnStatusDetails:e.showVpnStatusDetails(o.data.payload.agentId);break;case s.ToggleVpn:e.toggleVpn(o.data.payload.agentId);break;case s.NavigateByUrl:e.navigateByUrl(o.data.payload.url);break;case s.SetTimeRange:e.setTimeRange(o.data.payload.timeRange);break}}}class te{constructor(e,n,a,o){this.query=e,this.variable=n,this.tag=a,this._onCancel=o,Object.freeze(this)}cancel(){this._onCancel&&this._onCancel()}}var ne=typeof global=="object"&&global&&global.Object===Object&&global;const ae=ne;var oe=typeof self=="object"&&self&&self.Object===Object&&self,re=ae||oe||Function("return this")();const I=re;var se=I.Symbol;const R=se;var k=Object.prototype,ie=k.hasOwnProperty,le=k.toString,_=R?R.toStringTag:void 0;function de(t){var e=ie.call(t,_),n=t[_];try{t[_]=void 0;var a=!0}catch{}var o=le.call(t);return a&&(e?t[_]=n:delete t[_]),o}var ce=Object.prototype,ue=ce.toString;function pe(t){return ue.call(t)}var ge="[object Null]",ye="[object Undefined]",N=R?R.toStringTag:void 0;function fe(t){return t==null?t===void 0?ye:ge:N&&N in Object(t)?de(t):pe(t)}function P(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var he="[object AsyncFunction]",me="[object Function]",we="[object GeneratorFunction]",Ce="[object Proxy]";function _e(t){if(!P(t))return!1;var e=fe(t);return e==me||e==we||e==he||e==Ce}var De=I["__core-js_shared__"];const L=De;var j=function(){var t=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Re(t){return!!j&&j in t}var be=Function.prototype,Se=be.toString;function Oe(t){if(t!=null){try{return Se.call(t)}catch{}try{return t+""}catch{}}return""}var $e=/[\\^$.*+?()[\]{}|]/g,Me=/^\[object .+?Constructor\]$/,Te=Function.prototype,ve=Object.prototype,Ee=Te.toString,Ie=ve.hasOwnProperty,Le=RegExp("^"+Ee.call(Ie).replace($e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function qe(t){if(!P(t)||Re(t))return!1;var e=_e(t)?Le:Me;return e.test(Oe(t))}function Ae(t,e){return t==null?void 0:t[e]}function B(t,e){var n=Ae(t,e);return qe(n)?n:void 0}function Ue(t,e){return t===e||t!==t&&e!==e}var ke=B(Object,"create");const D=ke;function Ne(){this.__data__=D?D(null):{},this.size=0}function Pe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var je="__lodash_hash_undefined__",Be=Object.prototype,Fe=Be.hasOwnProperty;function He(t){var e=this.__data__;if(D){var n=e[t];return n===je?void 0:n}return Fe.call(e,t)?e[t]:void 0}var Ve=Object.prototype,We=Ve.hasOwnProperty;function ze(t){var e=this.__data__;return D?e[t]!==void 0:We.call(e,t)}var Qe="__lodash_hash_undefined__";function Ge(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=D&&e===void 0?Qe:e,this}function m(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var a=t[e];this.set(a[0],a[1])}}m.prototype.clear=Ne,m.prototype.delete=Pe,m.prototype.get=He,m.prototype.has=ze,m.prototype.set=Ge;function Je(){this.__data__=[],this.size=0}function b(t,e){for(var n=t.length;n--;)if(Ue(t[n][0],e))return n;return-1}var Ke=Array.prototype,Xe=Ke.splice;function xe(t){var e=this.__data__,n=b(e,t);if(n<0)return!1;var a=e.length-1;return n==a?e.pop():Xe.call(e,n,1),--this.size,!0}function Ye(t){var e=this.__data__,n=b(e,t);return n<0?void 0:e[n][1]}function Ze(t){return b(this.__data__,t)>-1}function et(t,e){var n=this.__data__,a=b(n,t);return a<0?(++this.size,n.push([t,e])):n[a][1]=e,this}function C(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var a=t[e];this.set(a[0],a[1])}}C.prototype.clear=Je,C.prototype.delete=xe,C.prototype.get=Ye,C.prototype.has=Ze,C.prototype.set=et;var tt=B(I,"Map");const nt=tt;function at(){this.size=0,this.__data__={hash:new m,map:new(nt||C),string:new m}}function ot(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function S(t,e){var n=t.__data__;return ot(e)?n[typeof e=="string"?"string":"hash"]:n.map}function rt(t){var e=S(this,t).delete(t);return this.size-=e?1:0,e}function st(t){return S(this,t).get(t)}function it(t){return S(this,t).has(t)}function lt(t,e){var n=S(this,t),a=n.size;return n.set(t,e),this.size+=n.size==a?0:1,this}function w(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var a=t[e];this.set(a[0],a[1])}}w.prototype.clear=at,w.prototype.delete=rt,w.prototype.get=st,w.prototype.has=it,w.prototype.set=lt;var dt="Expected a function";function q(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(dt);var n=function(){var a=arguments,o=e?e.apply(this,a):a[0],r=n.cache;if(r.has(o))return r.get(o);var l=t.apply(this,a);return n.cache=r.set(o,l)||r,l};return n.cache=new(q.Cache||w),n}q.Cache=w;const ct=2,F=1,H="";class O{constructor(e,n,a){this.locale=e,this.queryRef=n,this.rawValue=a}static create(e,n,a){return n.query.postAggr==="count"?new ut(e,n,a):new O(e,n,a)}getDecimals(e=ct){return this.decimals??this.queryRef.query.decimals??e}getFactor(){var e,n,a;return this.factor??this.queryRef.query.factor??((n=(e=this.queryRef.tag)==null?void 0:e.variable)!=null&&n.factor?parseFloat(this.queryRef.tag.variable.factor):null)??((a=this.queryRef.variable)!=null&&a.factor?parseFloat(this.queryRef.variable.factor):null)??F}getUnit(){var e,n,a;return this.unit??this.queryRef.query.unit??((n=(e=this.queryRef.tag)==null?void 0:e.variable)==null?void 0:n.unit)??((a=this.queryRef.variable)==null?void 0:a.unit)??H}setDecimals(e){this.decimals=e}setFactor(e){this.factor=e}setUnit(e){this.unit=e}getValue(){return this.rawValue}toString(){var a,o,r,l;const e=this.locale??void 0,n=q((c,d,u,f)=>{const St={style:"decimal",minimumFractionDigits:Math.floor(d),maximumFractionDigits:Math.floor(d)};return`${new Intl.NumberFormat(f,St).format(c)}${u?" "+u:""}`});return this.rawValue===null?"":this.queryRef.query.postAggr==="count"?n(this.rawValue,this.getDecimals(0),this.unit??this.queryRef.query.unit,e):((a=this.queryRef.variable)==null?void 0:a.type)==="str"?this.rawValue:((o=this.queryRef.variable)==null?void 0:o.type)==="bool"?this.rawValue?"True":"False":((r=this.queryRef.variable)==null?void 0:r.type)==="int"?n(this.rawValue,Number.isInteger(this.getFactor())?this.getDecimals(0):this.getDecimals(),this.getUnit(),e):((l=this.queryRef.variable)==null?void 0:l.type)==="float"?n(this.rawValue,this.getDecimals(),this.getUnit(),e):String(this.getValue())}}class ut extends O{getFactor(){return this.factor??this.queryRef.query.factor??F}getUnit(){return this.unit??this.queryRef.query.unit??H}}function V(t){return t.map(({queryRef:n,time:a,value:o})=>{const r=new te(n.query,n.variable,n.tag),l=O.create(o.locale,r,o.rawValue);return{queryRef:r,time:a,value:l}})}let y,A,W;function z(t,e){if(W=new Date,t.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if(t.tagName.toLowerCase()==="html")return"html";const n={root:document.body,idName:o=>!0,className:o=>!0,tagName:o=>!0,attr:(o,r)=>!1,seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};y={...n,...e},A=pt(y.root,n);let a=$(t,"all",()=>$(t,"two",()=>$(t,"one",()=>$(t,"none"))));if(a){const o=x(Y(a,t));return o.length>0&&(a=o[0]),M(a)}else throw new Error("Selector was not found.")}function pt(t,e){return t.nodeType===Node.DOCUMENT_NODE?t:t===e.root?t.ownerDocument:t}function $(t,e,n){let a=null,o=[],r=t,l=0;for(;r;){const c=new Date().getTime()-W.getTime();if(y.timeoutMs!==void 0&&c>y.timeoutMs)throw new Error(`Timeout: Can't find a unique selector after ${c}ms`);let d=v(gt(r))||v(...yt(r))||v(...ft(r))||v(ht(r))||[K()];const u=mt(r);if(e=="all")u&&(d=d.concat(d.filter(U).map(f=>T(f,u))));else if(e=="two")d=d.slice(0,1),u&&(d=d.concat(d.filter(U).map(f=>T(f,u))));else if(e=="one"){const[f]=d=d.slice(0,1);u&&U(f)&&(d=[T(f,u)])}else e=="none"&&(d=[K()],u&&(d=[T(d[0],u)]));for(let f of d)f.level=l;if(o.push(d),o.length>=y.seedMinLength&&(a=Q(o,n),a))break;r=r.parentElement,l++}return a||(a=Q(o,n)),!a&&n?n():a}function Q(t,e){const n=x(X(t));if(n.length>y.threshold)return e?e():null;for(let a of n)if(J(a))return a;return null}function M(t){let e=t[0],n=e.name;for(let a=1;a<t.length;a++){const o=t[a].level||0;e.level===o-1?n=`${t[a].name} > ${n}`:n=`${t[a].name} ${n}`,e=t[a]}return n}function G(t){return t.map(e=>e.penalty).reduce((e,n)=>e+n,0)}function J(t){const e=M(t);switch(A.querySelectorAll(e).length){case 0:throw new Error(`Can't select any node with this selector: ${e}`);case 1:return!0;default:return!1}}function gt(t){const e=t.getAttribute("id");return e&&y.idName(e)?{name:"#"+CSS.escape(e),penalty:0}:null}function yt(t){return Array.from(t.attributes).filter(n=>y.attr(n.name,n.value)).map(n=>({name:`[${CSS.escape(n.name)}="${CSS.escape(n.value)}"]`,penalty:.5}))}function ft(t){return Array.from(t.classList).filter(y.className).map(n=>({name:"."+CSS.escape(n),penalty:1}))}function ht(t){const e=t.tagName.toLowerCase();return y.tagName(e)?{name:e,penalty:2}:null}function K(){return{name:"*",penalty:3}}function mt(t){const e=t.parentNode;if(!e)return null;let n=e.firstChild;if(!n)return null;let a=0;for(;n&&(n.nodeType===Node.ELEMENT_NODE&&a++,n!==t);)n=n.nextSibling;return a}function T(t,e){return{name:t.name+`:nth-child(${e})`,penalty:t.penalty+1}}function U(t){return t.name!=="html"&&!t.name.startsWith("#")}function v(...t){const e=t.filter(wt);return e.length>0?e:null}function wt(t){return t!=null}function*X(t,e=[]){if(t.length>0)for(let n of t[0])yield*X(t.slice(1,t.length),e.concat(n));else yield e}function x(t){return[...t].sort((e,n)=>G(e)-G(n))}function*Y(t,e,n={counter:0,visited:new Map}){if(t.length>2&&t.length>y.optimizedMinLength)for(let a=1;a<t.length-1;a++){if(n.counter>y.maxNumberOfTries)return;n.counter+=1;const o=[...t];o.splice(a,1);const r=M(o);if(n.visited.has(r))return;J(o)&&Ct(o,e)&&(yield o,n.visited.set(r,!0),yield*Y(o,e,n))}}function Ct(t,e){return A.querySelector(M(t))===e}class h extends Error{constructor(e="Method is not implemented"){super(e),this.name="NotImplementedError",this.message=e,this.stack=`NotImplementedError: ${e}`}}class _t{constructor(e){p(this,"ontimerangechange",null);p(this,"onvpnclientstatuschange",null);p(this,"_getApiLinks");p(this,"_getDesignTokens");p(this,"appData");p(this,"componentBaseUrl");p(this,"destroyed");p(this,"mode");p(this,"inputs");p(this,"inputMap");p(this,"timeRange");p(this,"timeRangeIsAdjustable");p(this,"vpnClientStatus");p(this,"getDesignToken");this._getApiLinks=()=>new Map(e._apiLinkEntries),this._getDesignTokens=()=>new Map(e._designTokenEntries),this.appData=e.appData,this.componentBaseUrl=e.componentBaseUrl,this.destroyed=e.destroyed,this.mode=e.mode,this.inputs=e.inputs,this.inputMap=new Map(Object.entries(this.inputs)),this.timeRange=e.timeRange,this.timeRangeIsAdjustable=e.timeRangeIsAdjustable,this.vpnClientStatus=e.vpnClientStatus,this._messageHandler=this._messageHandler.bind(this),window.addEventListener("message",this._messageHandler,!1);const n=r=>this._getDesignTokens().get(r)??"";n.var=r=>`var(--uic-${r})`,this.getDesignToken=n;const a=new CSSStyleSheet,o=e._designTokenEntries.map(([r,l])=>`--uic-${r}:${l}`);a.replaceSync(`:root {${o.join(";")}}`),window.document.adoptedStyleSheets.push(a)}_messageHandler(e){if(e.source===window.parent)switch(e.data.type){case s.TimeRangeChange:this.ontimerangechange&&this.ontimerangechange(...e.data.payload);break;case s.VpnClientStatusChange:this.onvpnclientstatuschange&&this.onvpnclientstatuschange(...e.data.payload);break}}createBackendComponentClient(){const e=crypto.randomUUID();return window.parent.postMessage({type:s.BackendComponentClientCreate,payload:{clientId:e}},"*"),new Dt(e)}createLoggingDataClient(){const e=crypto.randomUUID();return window.parent.postMessage({type:s.LoggingDataClientCreate,payload:{clientId:e}},"*"),new Rt(e)}createObjectStorageClient(){throw new h}createResourceDataClient(){const e=crypto.randomUUID();return window.parent.postMessage({type:s.ResourceDataClientCreate,payload:{clientId:e}},"*"),new bt(e)}createTooltip(){throw new h}destroy(){window.parent.postMessage({type:s.Destroy},"*"),window.removeEventListener("message",this._messageHandler,!1),this.destroyed=!0}getApiUrl(e,n){const a=this._getApiLinks().get(e);if(!a)throw new Error("IxApiError: entry not found");return n?Object.keys(n).sort().reduce((o,r)=>{if(o.includes(`{${r}}`))return o.replace(`{${r}}`,n[r]);const l=new URL(o);return l.searchParams.set(r,n[r]),decodeURIComponent(l.href)},a.href):a.href}navigateByUrl(e){window.parent.postMessage({type:s.NavigateByUrl,payload:{url:e}},"*")}openActionBottomSheet(e){return new Promise(n=>{window.addEventListener("message",a,!1),window.parent.postMessage({type:s.OpenActionBottomSheet,payload:{options:e}},"*");function a(o){o.source===window.parent&&o.data.type===s.OpenActionBottomSheetResult&&(window.removeEventListener("message",a,!1),n(o.data.payload.result))}})}openActionMenu(e,n){return new Promise(a=>{window.addEventListener("message",o,!1),window.parent.postMessage({type:s.OpenActionMenu,payload:{selector:z(e),options:n}},"*");function o(r){r.source===window.parent&&r.data.type===s.OpenActionMenuResult&&(window.removeEventListener("message",o,!1),a(r.data.payload.result))}})}openAlertDialog(e){return new Promise(n=>{window.addEventListener("message",a,!1),window.parent.postMessage({type:s.OpenAlertDialog,payload:{options:e}},"*");function a(o){o.source===window.parent&&o.data.type===s.OpenAlertDialogResult&&(window.removeEventListener("message",a,!1),n(o.data.payload.result))}})}openConfirmDialog(e){return new Promise(n=>{window.addEventListener("message",a,!1),window.parent.postMessage({type:s.OpenConfirmDialog,payload:{options:e}},"*");function a(o){o.source===window.parent&&o.data.type===s.OpenConfirmDialogResult&&(window.removeEventListener("message",a,!1),n(o.data.payload.result))}})}openContentDialog(e){if(typeof e.onopened=="function")throw new h('The "onopened" option is not implemented');if(typeof e.onclose=="function")throw new h('The "onclose" option is not implemented');if(e.pagination)throw new h('The "pagination" option is not implemented');return new Promise(n=>{window.addEventListener("message",a,!1),window.parent.postMessage({type:s.OpenContentDialog,payload:{options:e.htmlContent&&typeof e.htmlContent!="string"?{...e,htmlContent:e.htmlContent.cloneNode(!0).outerHTML}:e}},"*");function a(o){o.source===window.parent&&o.data.type===s.OpenContentDialogResult&&(window.removeEventListener("message",a,!1),n(o.data.payload.result))}})}openFormDialog(e){return new Promise(n=>{window.addEventListener("message",a,!1),window.parent.postMessage({type:s.OpenFormDialog,payload:{options:e}},"*");function a(o){o.source===window.parent&&o.data.type===s.OpenFormDialogResult&&(window.removeEventListener("message",a,!1),n(o.data.payload.result))}})}openSelectPanel(e,n){return new Promise(a=>{window.addEventListener("message",o,!1),window.parent.postMessage({type:s.OpenSelectPanel,payload:{selector:z(e),options:n}},"*");function o(r){r.source===window.parent&&r.data.type===s.OpenSelectPanelResult&&(window.removeEventListener("message",o,!1),a(r.data.payload.result))}})}openToast(...e){return new Promise(n=>{window.addEventListener("message",r,!1);const a=crypto.randomUUID(),o=typeof e[0]=="string"?{...e[1],message:e[0]}:e[0];window.parent.postMessage({type:s.OpenToast,payload:{id:a,options:o}},"*");function r(l){l.source===window.parent&&l.data.type===s.OpenToastResult&&l.data.payload.id===a&&(window.removeEventListener("message",r,!1),n(l.data.payload.result))}})}sanitizeHtml(){throw new h}saveAsFile(){throw new h}setTimeRange(e){window.parent.postMessage({type:s.SetTimeRange,payload:{timeRange:e}},"*")}showVpnStatusDetails(e){window.parent.postMessage({type:s.ShowVpnStatusDetails,payload:{agentId:e}},"*")}testVpnAccess(){throw new h}toggleVpn(e){window.parent.postMessage({type:s.ToggleVpn,payload:{agentId:e}},"*")}translate(){throw new h}}class Dt{constructor(e){this.id=e}call(e,n){return new Promise(a=>{const o=crypto.randomUUID();window.addEventListener("message",r,!1),window.parent.postMessage({type:s.BackendComponentClientCall,payload:{clientId:this.id,callId:o,functionName:e,functionArguments:n}});function r(l){l.source===window.parent&&l.data.type===s.BackendComponentClientCallResult&&l.data.payload.callId===o&&(window.removeEventListener("message",r,!1),a(l.data.payload.result))}})}destroy(){window.parent.postMessage({type:s.BackendComponentClientDestroy,payload:{clientId:this.id}},"*")}}class Rt{constructor(e){this.id=e}query(e,n){const a=crypto.randomUUID();return window.addEventListener("message",o,!1),window.parent.postMessage({type:s.LoggingDataClientQuery,payload:{clientId:this.id,queryId:a,query:e}},"*"),()=>{window.removeEventListener("message",o,!1)};function o(r){if(r.source===window.parent&&r.data.type===s.LoggingDataClientQueryResult&&r.data.payload.queryId===a){const{results:l}=r.data.payload;if(e.length)if(!e.queries||e.format!=="csv"){const c=l.map(d=>V(d));n(c)}else throw new h;else{const c=V(l);n(c)}}}}destroy(){window.parent.postMessage({type:s.LoggingDataClientDestroy,payload:{clientId:this.id}},"*")}}class bt{constructor(e){this.id=e}query(e,n){const a=crypto.randomUUID();return window.addEventListener("message",o,!1),window.parent.postMessage({type:s.ResourceDataClientQuery,payload:{clientId:this.id,queryId:a,query:e}},"*"),()=>{window.removeEventListener("message",o,!1)};function o(r){r.source===window.parent&&r.data.type===s.ResourceDataClientQueryResult&&r.data.payload.queryId===a&&n(r.data.payload.results)}}update(e){return new Promise(n=>{const a=crypto.randomUUID();window.addEventListener("message",o,!1),window.parent.postMessage({type:s.ResourceDataClientUpdate,payload:{clientId:this.id,updateId:a,update:e}},"*");function o(r){r.source===window.parent&&r.data.type===s.ResourceDataClientUpdated&&r.data.payload.updateId===a&&(window.removeEventListener("message",o,!1),n())}})}render(e,n){const a=crypto.randomUUID();return window.addEventListener("message",o,!1),window.parent.postMessage({type:s.ResourceDataClientRender,payload:{clientId:this.id,queryId:a,query:e}},"*"),()=>{window.removeEventListener("message",o,!1)};function o(r){r.source===window.parent&&r.data.type===s.ResourceDataClientRenderResult&&r.data.payload.queryId===a&&n(r.data.payload.results)}}destroy(){window.parent.postMessage({type:s.ResourceDataClientDestroy,payload:{clientId:this.id}},"*")}}function E(t){const e=!!(t&&t.migrateInputs);return!e&&E.__cache__?Promise.resolve(E.__cache__):new Promise(n=>{window.addEventListener("message",function a(o){if(o.source===window.parent&&o.data&&o.data.type===s.Created){let r=o.data.payload;e&&(r.inputs=t.migrateInputs(r.inputs,null));const l=new _t(r);n(l),e||(E.__cache__=l),window.removeEventListener("message",a,!1)}},!1),window.parent.postMessage({type:s.Create},"*")})}g.connect=ee,g.getComponentContext=E,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ixon-cdk/iframe-adapter",
3
- "version": "1.17.0-next.1",
3
+ "version": "1.18.0-next.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -17,7 +17,7 @@
17
17
  "@medv/finder": "3.2.0"
18
18
  },
19
19
  "peerDependencies": {
20
- "@ixon-cdk/types": "^1.17.0-next.1"
20
+ "@ixon-cdk/types": "^1.18.0-next.0"
21
21
  },
22
22
  "devDependencies": {
23
23
  "typescript": "~5.5.4",