@ixon-cdk/iframe-adapter 1.16.0 → 1.17.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 +381 -351
- package/dist/index.umd.cjs +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var ee = (t, e, n) => e in t ?
|
|
3
|
-
var
|
|
4
|
-
const d = "cdk:cmpctx:",
|
|
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;
|
|
3
|
+
var p = (t, e, n) => (ee(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
+
const d = "cdk:cmpctx:", s = {
|
|
5
5
|
// Lifecycle
|
|
6
6
|
Create: `${d}create`,
|
|
7
7
|
Created: `${d}created`,
|
|
@@ -40,6 +40,9 @@ const d = "cdk:cmpctx:", r = {
|
|
|
40
40
|
OpenContentDialogResult: `${d}opencontentdialogresult`,
|
|
41
41
|
OpenFormDialog: `${d}openformdialog`,
|
|
42
42
|
OpenFormDialogResult: `${d}openformdialogresult`,
|
|
43
|
+
// SelectPanel
|
|
44
|
+
OpenSelectPanel: `${d}openselectpanel`,
|
|
45
|
+
OpenSelectPanelResult: `${d}openselectpanelresult`,
|
|
43
46
|
// Toast
|
|
44
47
|
OpenToast: `${d}opentoast`,
|
|
45
48
|
OpenToastResult: `${d}opentoastresult`,
|
|
@@ -56,7 +59,7 @@ function $t({ iframe: t, context: e }) {
|
|
|
56
59
|
return window.addEventListener("message", a, !1), e.ontimerangechange = (...o) => {
|
|
57
60
|
t.contentWindow && t.contentWindow.postMessage(
|
|
58
61
|
{
|
|
59
|
-
type:
|
|
62
|
+
type: s.TimeRangeChange,
|
|
60
63
|
payload: o
|
|
61
64
|
},
|
|
62
65
|
"*"
|
|
@@ -64,7 +67,7 @@ function $t({ iframe: t, context: e }) {
|
|
|
64
67
|
}, e.onvpnclientstatuschange = (...o) => {
|
|
65
68
|
t.contentWindow && t.contentWindow.postMessage(
|
|
66
69
|
{
|
|
67
|
-
type:
|
|
70
|
+
type: s.VpnClientStatusChange,
|
|
68
71
|
payload: o
|
|
69
72
|
},
|
|
70
73
|
"*"
|
|
@@ -90,111 +93,111 @@ function $t({ iframe: t, context: e }) {
|
|
|
90
93
|
function a(o) {
|
|
91
94
|
if (a._clients = a._clients || /* @__PURE__ */ new Map([]), o.source === t.contentWindow)
|
|
92
95
|
switch (o.data.type) {
|
|
93
|
-
case
|
|
96
|
+
case s.Create:
|
|
94
97
|
t.contentWindow.postMessage(
|
|
95
98
|
{
|
|
96
|
-
type:
|
|
99
|
+
type: s.Created,
|
|
97
100
|
payload: n(e)
|
|
98
101
|
},
|
|
99
102
|
"*"
|
|
100
103
|
);
|
|
101
104
|
break;
|
|
102
|
-
case
|
|
105
|
+
case s.Destroy:
|
|
103
106
|
e.destroy();
|
|
104
107
|
break;
|
|
105
|
-
case
|
|
106
|
-
const { clientId:
|
|
107
|
-
a._clients.set(
|
|
108
|
+
case s.BackendComponentClientCreate: {
|
|
109
|
+
const { clientId: r } = o.data.payload, l = e.createBackendComponentClient(r);
|
|
110
|
+
a._clients.set(r, l);
|
|
108
111
|
break;
|
|
109
112
|
}
|
|
110
|
-
case
|
|
111
|
-
const { clientId:
|
|
112
|
-
a._clients.has(
|
|
113
|
+
case s.BackendComponentClientDestroy: {
|
|
114
|
+
const { clientId: r } = o.data.payload;
|
|
115
|
+
a._clients.has(r) && (a._clients.get(r).destroy(), a._clients.delete(r));
|
|
113
116
|
break;
|
|
114
117
|
}
|
|
115
|
-
case
|
|
116
|
-
const { clientId:
|
|
117
|
-
let
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
case s.BackendComponentClientCall: {
|
|
119
|
+
const { clientId: r, callId: l, functionName: c, functionArguments: i } = o.data.payload;
|
|
120
|
+
let u = a._clients.get(r);
|
|
121
|
+
u && !u._destroyed && u.call(c, i).then((g) => {
|
|
122
|
+
u && !u.destroyed && t.contentWindow.postMessage(
|
|
120
123
|
{
|
|
121
|
-
type:
|
|
122
|
-
payload: { callId: l, result:
|
|
124
|
+
type: s.BackendComponentClientCallResult,
|
|
125
|
+
payload: { callId: l, result: g }
|
|
123
126
|
},
|
|
124
127
|
"*"
|
|
125
128
|
);
|
|
126
129
|
});
|
|
127
130
|
break;
|
|
128
131
|
}
|
|
129
|
-
case
|
|
130
|
-
const { clientId:
|
|
131
|
-
a._clients.set(
|
|
132
|
+
case s.LoggingDataClientCreate: {
|
|
133
|
+
const { clientId: r } = o.data.payload, l = e.createLoggingDataClient(r);
|
|
134
|
+
a._clients.set(r, l);
|
|
132
135
|
break;
|
|
133
136
|
}
|
|
134
|
-
case
|
|
135
|
-
const { clientId:
|
|
136
|
-
a._clients.has(
|
|
137
|
+
case s.LoggingDataClientDestroy: {
|
|
138
|
+
const { clientId: r } = o.data.payload;
|
|
139
|
+
a._clients.has(r) && (a._clients.get(r).destroy(), a._clients.delete(r));
|
|
137
140
|
break;
|
|
138
141
|
}
|
|
139
|
-
case
|
|
140
|
-
const { clientId:
|
|
141
|
-
let
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
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(
|
|
144
147
|
{
|
|
145
|
-
type:
|
|
146
|
-
payload: { queryId: l, results:
|
|
148
|
+
type: s.LoggingDataClientQueryResult,
|
|
149
|
+
payload: { queryId: l, results: u }
|
|
147
150
|
},
|
|
148
151
|
"*"
|
|
149
152
|
);
|
|
150
153
|
});
|
|
151
154
|
break;
|
|
152
155
|
}
|
|
153
|
-
case
|
|
154
|
-
const { clientId:
|
|
155
|
-
a._clients.set(
|
|
156
|
+
case s.ResourceDataClientCreate: {
|
|
157
|
+
const { clientId: r } = o.data.payload, l = e.createResourceDataClient(r);
|
|
158
|
+
a._clients.set(r, l);
|
|
156
159
|
break;
|
|
157
160
|
}
|
|
158
|
-
case
|
|
159
|
-
const { clientId:
|
|
160
|
-
a._clients.has(
|
|
161
|
+
case s.ResourceDataClientDestroy: {
|
|
162
|
+
const { clientId: r } = o.data.payload;
|
|
163
|
+
a._clients.has(r) && (a._clients.get(r).destroy(), a._clients.delete(r));
|
|
161
164
|
break;
|
|
162
165
|
}
|
|
163
|
-
case
|
|
164
|
-
const { clientId:
|
|
165
|
-
let
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
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(
|
|
168
171
|
{
|
|
169
|
-
type:
|
|
170
|
-
payload: { queryId: l, results:
|
|
172
|
+
type: s.ResourceDataClientQueryResult,
|
|
173
|
+
payload: { queryId: l, results: u }
|
|
171
174
|
},
|
|
172
175
|
"*"
|
|
173
176
|
);
|
|
174
177
|
});
|
|
175
178
|
break;
|
|
176
179
|
}
|
|
177
|
-
case
|
|
178
|
-
const { clientId:
|
|
179
|
-
let
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
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(
|
|
182
185
|
{
|
|
183
|
-
type:
|
|
184
|
-
payload: { queryId: l, results:
|
|
186
|
+
type: s.ResourceDataClientRenderResult,
|
|
187
|
+
payload: { queryId: l, results: u }
|
|
185
188
|
},
|
|
186
189
|
"*"
|
|
187
190
|
);
|
|
188
191
|
});
|
|
189
192
|
break;
|
|
190
193
|
}
|
|
191
|
-
case
|
|
192
|
-
const { clientId:
|
|
193
|
-
let
|
|
194
|
-
|
|
195
|
-
|
|
194
|
+
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(
|
|
196
199
|
{
|
|
197
|
-
type:
|
|
200
|
+
type: s.ResourceDataClientUpdated,
|
|
198
201
|
payload: { updateId: l }
|
|
199
202
|
},
|
|
200
203
|
"*"
|
|
@@ -202,62 +205,81 @@ function $t({ iframe: t, context: e }) {
|
|
|
202
205
|
});
|
|
203
206
|
break;
|
|
204
207
|
}
|
|
205
|
-
case
|
|
206
|
-
e.openActionBottomSheet(o.data.payload.options).then((
|
|
207
|
-
t.contentWindow.postMessage({ type:
|
|
208
|
+
case s.OpenActionBottomSheet:
|
|
209
|
+
e.openActionBottomSheet(o.data.payload.options).then((r) => {
|
|
210
|
+
t.contentWindow.postMessage({ type: s.OpenActionBottomSheetResult, payload: { result: r } }, "*");
|
|
208
211
|
});
|
|
209
212
|
break;
|
|
210
|
-
case
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
213
|
+
case s.OpenActionMenu:
|
|
214
|
+
{
|
|
215
|
+
const r = t.contentDocument.querySelector(o.data.payload.selector), l = {
|
|
216
|
+
getBoundingClientRect: () => {
|
|
217
|
+
const c = t.getBoundingClientRect(), i = r.getBoundingClientRect();
|
|
218
|
+
return {
|
|
219
|
+
...JSON.parse(JSON.stringify(i)),
|
|
220
|
+
top: c.top + i.top,
|
|
221
|
+
x: c.x + i.x
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
e.openActionMenu(l, o.data.payload.options).then((c) => {
|
|
226
|
+
t.contentWindow.postMessage({ type: s.OpenActionMenuResult, payload: { result: c } }, "*");
|
|
227
|
+
});
|
|
228
|
+
}
|
|
224
229
|
break;
|
|
225
|
-
case
|
|
226
|
-
e.openAlertDialog(o.data.payload.options).then((
|
|
227
|
-
t.contentWindow.postMessage({ type:
|
|
230
|
+
case s.OpenAlertDialog:
|
|
231
|
+
e.openAlertDialog(o.data.payload.options).then((r) => {
|
|
232
|
+
t.contentWindow.postMessage({ type: s.OpenAlertDialogResult, payload: { result: r } }, "*");
|
|
228
233
|
});
|
|
229
234
|
break;
|
|
230
|
-
case
|
|
231
|
-
e.openConfirmDialog(o.data.payload.options).then((
|
|
232
|
-
t.contentWindow.postMessage({ type:
|
|
235
|
+
case s.OpenConfirmDialog:
|
|
236
|
+
e.openConfirmDialog(o.data.payload.options).then((r) => {
|
|
237
|
+
t.contentWindow.postMessage({ type: s.OpenConfirmDialogResult, payload: { result: r } }, "*");
|
|
233
238
|
});
|
|
234
239
|
break;
|
|
235
|
-
case
|
|
236
|
-
e.openContentDialog(o.data.payload.options).then((
|
|
237
|
-
t.contentWindow.postMessage({ type:
|
|
240
|
+
case s.OpenContentDialog:
|
|
241
|
+
e.openContentDialog(o.data.payload.options).then((r) => {
|
|
242
|
+
t.contentWindow.postMessage({ type: s.OpenContentDialogResult, payload: { result: r } }, "*");
|
|
238
243
|
});
|
|
239
244
|
break;
|
|
240
|
-
case
|
|
241
|
-
e.openFormDialog(o.data.payload.options).then((
|
|
242
|
-
t.contentWindow.postMessage({ type:
|
|
245
|
+
case s.OpenFormDialog:
|
|
246
|
+
e.openFormDialog(o.data.payload.options).then((r) => {
|
|
247
|
+
t.contentWindow.postMessage({ type: s.OpenFormDialogResult, payload: { result: r } }, "*");
|
|
243
248
|
});
|
|
244
249
|
break;
|
|
245
|
-
case
|
|
246
|
-
|
|
250
|
+
case s.OpenSelectPanel:
|
|
251
|
+
{
|
|
252
|
+
const r = t.contentDocument.querySelector(o.data.payload.selector), l = {
|
|
253
|
+
getBoundingClientRect: () => {
|
|
254
|
+
const c = t.getBoundingClientRect(), i = r.getBoundingClientRect();
|
|
255
|
+
return {
|
|
256
|
+
...JSON.parse(JSON.stringify(i)),
|
|
257
|
+
top: c.top + i.top,
|
|
258
|
+
x: c.x + i.x
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
e.openSelectPanel(l, o.data.payload.options).then((c) => {
|
|
263
|
+
t.contentWindow.postMessage({ type: s.OpenSelectPanelResult, payload: { result: c } }, "*");
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
break;
|
|
267
|
+
case s.OpenToast:
|
|
268
|
+
e.openToast(o.data.payload.options).then((r) => {
|
|
247
269
|
const { id: l } = o.data.payload;
|
|
248
|
-
t.contentWindow && t.contentWindow.postMessage({ type:
|
|
270
|
+
t.contentWindow && t.contentWindow.postMessage({ type: s.OpenToastResult, payload: { id: l, result: r } }, "*");
|
|
249
271
|
});
|
|
250
272
|
break;
|
|
251
|
-
case
|
|
273
|
+
case s.ShowVpnStatusDetails:
|
|
252
274
|
e.showVpnStatusDetails(o.data.payload.agentId);
|
|
253
275
|
break;
|
|
254
|
-
case
|
|
276
|
+
case s.ToggleVpn:
|
|
255
277
|
e.toggleVpn(o.data.payload.agentId);
|
|
256
278
|
break;
|
|
257
|
-
case
|
|
279
|
+
case s.NavigateByUrl:
|
|
258
280
|
e.navigateByUrl(o.data.payload.url);
|
|
259
281
|
break;
|
|
260
|
-
case
|
|
282
|
+
case s.SetTimeRange:
|
|
261
283
|
e.setTimeRange(o.data.payload.timeRange);
|
|
262
284
|
break;
|
|
263
285
|
}
|
|
@@ -274,50 +296,50 @@ class te {
|
|
|
274
296
|
var ne = typeof global == "object" && global && global.Object === Object && global;
|
|
275
297
|
const ae = ne;
|
|
276
298
|
var oe = typeof self == "object" && self && self.Object === Object && self, re = ae || oe || Function("return this")();
|
|
277
|
-
const
|
|
278
|
-
var se =
|
|
279
|
-
const
|
|
280
|
-
var
|
|
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;
|
|
281
303
|
function de(t) {
|
|
282
|
-
var e = ie.call(t,
|
|
304
|
+
var e = ie.call(t, C), n = t[C];
|
|
283
305
|
try {
|
|
284
|
-
t[
|
|
306
|
+
t[C] = void 0;
|
|
285
307
|
var a = !0;
|
|
286
308
|
} catch {
|
|
287
309
|
}
|
|
288
310
|
var o = le.call(t);
|
|
289
|
-
return a && (e ? t[
|
|
311
|
+
return a && (e ? t[C] = n : delete t[C]), o;
|
|
290
312
|
}
|
|
291
313
|
var ce = Object.prototype, ue = ce.toString;
|
|
292
314
|
function pe(t) {
|
|
293
315
|
return ue.call(t);
|
|
294
316
|
}
|
|
295
|
-
var ge = "[object Null]", ye = "[object Undefined]",
|
|
317
|
+
var ge = "[object Null]", ye = "[object Undefined]", U = O ? O.toStringTag : void 0;
|
|
296
318
|
function fe(t) {
|
|
297
|
-
return t == null ? t === void 0 ? ye : ge :
|
|
319
|
+
return t == null ? t === void 0 ? ye : ge : U && U in Object(t) ? de(t) : pe(t);
|
|
298
320
|
}
|
|
299
|
-
function
|
|
321
|
+
function V(t) {
|
|
300
322
|
var e = typeof t;
|
|
301
323
|
return t != null && (e == "object" || e == "function");
|
|
302
324
|
}
|
|
303
325
|
var he = "[object AsyncFunction]", me = "[object Function]", we = "[object GeneratorFunction]", Ce = "[object Proxy]";
|
|
304
326
|
function _e(t) {
|
|
305
|
-
if (!
|
|
327
|
+
if (!V(t))
|
|
306
328
|
return !1;
|
|
307
329
|
var e = fe(t);
|
|
308
330
|
return e == me || e == we || e == he || e == Ce;
|
|
309
331
|
}
|
|
310
|
-
var De =
|
|
332
|
+
var De = T["__core-js_shared__"];
|
|
311
333
|
const E = De;
|
|
312
|
-
var
|
|
334
|
+
var N = function() {
|
|
313
335
|
var t = /[^.]+$/.exec(E && E.keys && E.keys.IE_PROTO || "");
|
|
314
336
|
return t ? "Symbol(src)_1." + t : "";
|
|
315
337
|
}();
|
|
316
338
|
function Re(t) {
|
|
317
|
-
return !!
|
|
339
|
+
return !!N && N in t;
|
|
318
340
|
}
|
|
319
341
|
var be = Function.prototype, Oe = be.toString;
|
|
320
|
-
function
|
|
342
|
+
function Se(t) {
|
|
321
343
|
if (t != null) {
|
|
322
344
|
try {
|
|
323
345
|
return Oe.call(t);
|
|
@@ -330,164 +352,164 @@ function ve(t) {
|
|
|
330
352
|
}
|
|
331
353
|
return "";
|
|
332
354
|
}
|
|
333
|
-
var $e = /[\\^$.*+?()[\]{}|]/g, Me = /^\[object .+?Constructor\]$/,
|
|
334
|
-
"^" +
|
|
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.*?") + "$"
|
|
335
357
|
);
|
|
336
358
|
function qe(t) {
|
|
337
|
-
if (!
|
|
359
|
+
if (!V(t) || Re(t))
|
|
338
360
|
return !1;
|
|
339
361
|
var e = _e(t) ? Te : Me;
|
|
340
|
-
return e.test(
|
|
362
|
+
return e.test(Se(t));
|
|
341
363
|
}
|
|
342
364
|
function Ae(t, e) {
|
|
343
365
|
return t == null ? void 0 : t[e];
|
|
344
366
|
}
|
|
345
|
-
function
|
|
367
|
+
function W(t, e) {
|
|
346
368
|
var n = Ae(t, e);
|
|
347
369
|
return qe(n) ? n : void 0;
|
|
348
370
|
}
|
|
349
371
|
function Ue(t, e) {
|
|
350
372
|
return t === e || t !== t && e !== e;
|
|
351
373
|
}
|
|
352
|
-
var Ne =
|
|
353
|
-
const
|
|
354
|
-
function
|
|
355
|
-
this.__data__ =
|
|
374
|
+
var Ne = W(Object, "create");
|
|
375
|
+
const _ = Ne;
|
|
376
|
+
function Pe() {
|
|
377
|
+
this.__data__ = _ ? _(null) : {}, this.size = 0;
|
|
356
378
|
}
|
|
357
|
-
function
|
|
379
|
+
function Be(t) {
|
|
358
380
|
var e = this.has(t) && delete this.__data__[t];
|
|
359
381
|
return this.size -= e ? 1 : 0, e;
|
|
360
382
|
}
|
|
361
|
-
var
|
|
383
|
+
var je = "__lodash_hash_undefined__", ke = Object.prototype, Fe = ke.hasOwnProperty;
|
|
362
384
|
function He(t) {
|
|
363
385
|
var e = this.__data__;
|
|
364
|
-
if (
|
|
386
|
+
if (_) {
|
|
365
387
|
var n = e[t];
|
|
366
|
-
return n ===
|
|
388
|
+
return n === je ? void 0 : n;
|
|
367
389
|
}
|
|
368
|
-
return
|
|
390
|
+
return Fe.call(e, t) ? e[t] : void 0;
|
|
369
391
|
}
|
|
370
392
|
var Ve = Object.prototype, We = Ve.hasOwnProperty;
|
|
371
393
|
function ze(t) {
|
|
372
394
|
var e = this.__data__;
|
|
373
|
-
return
|
|
395
|
+
return _ ? e[t] !== void 0 : We.call(e, t);
|
|
374
396
|
}
|
|
375
397
|
var Qe = "__lodash_hash_undefined__";
|
|
376
398
|
function Ge(t, e) {
|
|
377
399
|
var n = this.__data__;
|
|
378
|
-
return this.size += this.has(t) ? 0 : 1, n[t] =
|
|
400
|
+
return this.size += this.has(t) ? 0 : 1, n[t] = _ && e === void 0 ? Qe : e, this;
|
|
379
401
|
}
|
|
380
|
-
function
|
|
402
|
+
function h(t) {
|
|
381
403
|
var e = -1, n = t == null ? 0 : t.length;
|
|
382
404
|
for (this.clear(); ++e < n; ) {
|
|
383
405
|
var a = t[e];
|
|
384
406
|
this.set(a[0], a[1]);
|
|
385
407
|
}
|
|
386
408
|
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
409
|
+
h.prototype.clear = Pe;
|
|
410
|
+
h.prototype.delete = Be;
|
|
411
|
+
h.prototype.get = He;
|
|
412
|
+
h.prototype.has = ze;
|
|
413
|
+
h.prototype.set = Ge;
|
|
392
414
|
function Je() {
|
|
393
415
|
this.__data__ = [], this.size = 0;
|
|
394
416
|
}
|
|
395
|
-
function
|
|
417
|
+
function S(t, e) {
|
|
396
418
|
for (var n = t.length; n--; )
|
|
397
419
|
if (Ue(t[n][0], e))
|
|
398
420
|
return n;
|
|
399
421
|
return -1;
|
|
400
422
|
}
|
|
401
|
-
var Ke = Array.prototype,
|
|
402
|
-
function
|
|
403
|
-
var e = this.__data__, n =
|
|
423
|
+
var Ke = Array.prototype, xe = Ke.splice;
|
|
424
|
+
function Xe(t) {
|
|
425
|
+
var e = this.__data__, n = S(e, t);
|
|
404
426
|
if (n < 0)
|
|
405
427
|
return !1;
|
|
406
428
|
var a = e.length - 1;
|
|
407
|
-
return n == a ? e.pop() :
|
|
429
|
+
return n == a ? e.pop() : xe.call(e, n, 1), --this.size, !0;
|
|
408
430
|
}
|
|
409
|
-
function
|
|
410
|
-
var e = this.__data__, n =
|
|
431
|
+
function Ye(t) {
|
|
432
|
+
var e = this.__data__, n = S(e, t);
|
|
411
433
|
return n < 0 ? void 0 : e[n][1];
|
|
412
434
|
}
|
|
413
|
-
function
|
|
414
|
-
return
|
|
435
|
+
function Ze(t) {
|
|
436
|
+
return S(this.__data__, t) > -1;
|
|
415
437
|
}
|
|
416
438
|
function et(t, e) {
|
|
417
|
-
var n = this.__data__, a =
|
|
439
|
+
var n = this.__data__, a = S(n, t);
|
|
418
440
|
return a < 0 ? (++this.size, n.push([t, e])) : n[a][1] = e, this;
|
|
419
441
|
}
|
|
420
|
-
function
|
|
442
|
+
function w(t) {
|
|
421
443
|
var e = -1, n = t == null ? 0 : t.length;
|
|
422
444
|
for (this.clear(); ++e < n; ) {
|
|
423
445
|
var a = t[e];
|
|
424
446
|
this.set(a[0], a[1]);
|
|
425
447
|
}
|
|
426
448
|
}
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
var tt =
|
|
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");
|
|
433
455
|
const nt = tt;
|
|
434
456
|
function at() {
|
|
435
457
|
this.size = 0, this.__data__ = {
|
|
436
|
-
hash: new
|
|
437
|
-
map: new (nt ||
|
|
438
|
-
string: new
|
|
458
|
+
hash: new h(),
|
|
459
|
+
map: new (nt || w)(),
|
|
460
|
+
string: new h()
|
|
439
461
|
};
|
|
440
462
|
}
|
|
441
463
|
function ot(t) {
|
|
442
464
|
var e = typeof t;
|
|
443
465
|
return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
|
|
444
466
|
}
|
|
445
|
-
function
|
|
467
|
+
function $(t, e) {
|
|
446
468
|
var n = t.__data__;
|
|
447
469
|
return ot(e) ? n[typeof e == "string" ? "string" : "hash"] : n.map;
|
|
448
470
|
}
|
|
449
471
|
function rt(t) {
|
|
450
|
-
var e =
|
|
472
|
+
var e = $(this, t).delete(t);
|
|
451
473
|
return this.size -= e ? 1 : 0, e;
|
|
452
474
|
}
|
|
453
475
|
function st(t) {
|
|
454
|
-
return
|
|
476
|
+
return $(this, t).get(t);
|
|
455
477
|
}
|
|
456
478
|
function it(t) {
|
|
457
|
-
return
|
|
479
|
+
return $(this, t).has(t);
|
|
458
480
|
}
|
|
459
481
|
function lt(t, e) {
|
|
460
|
-
var n =
|
|
482
|
+
var n = $(this, t), a = n.size;
|
|
461
483
|
return n.set(t, e), this.size += n.size == a ? 0 : 1, this;
|
|
462
484
|
}
|
|
463
|
-
function
|
|
485
|
+
function m(t) {
|
|
464
486
|
var e = -1, n = t == null ? 0 : t.length;
|
|
465
487
|
for (this.clear(); ++e < n; ) {
|
|
466
488
|
var a = t[e];
|
|
467
489
|
this.set(a[0], a[1]);
|
|
468
490
|
}
|
|
469
491
|
}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
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;
|
|
475
497
|
var dt = "Expected a function";
|
|
476
|
-
function
|
|
498
|
+
function q(t, e) {
|
|
477
499
|
if (typeof t != "function" || e != null && typeof e != "function")
|
|
478
500
|
throw new TypeError(dt);
|
|
479
501
|
var n = function() {
|
|
480
|
-
var a = arguments, o = e ? e.apply(this, a) : a[0],
|
|
481
|
-
if (
|
|
482
|
-
return
|
|
483
|
-
var
|
|
484
|
-
return n.cache =
|
|
502
|
+
var a = arguments, o = e ? e.apply(this, a) : a[0], r = n.cache;
|
|
503
|
+
if (r.has(o))
|
|
504
|
+
return r.get(o);
|
|
505
|
+
var l = t.apply(this, a);
|
|
506
|
+
return n.cache = r.set(o, l) || r, l;
|
|
485
507
|
};
|
|
486
|
-
return n.cache = new (
|
|
508
|
+
return n.cache = new (q.Cache || m)(), n;
|
|
487
509
|
}
|
|
488
|
-
|
|
489
|
-
const ct = 2,
|
|
490
|
-
class
|
|
510
|
+
q.Cache = m;
|
|
511
|
+
const ct = 2, z = 1, Q = "";
|
|
512
|
+
class M {
|
|
491
513
|
constructor(e, n, a) {
|
|
492
514
|
this.locale = e, this.queryRef = n, this.rawValue = a;
|
|
493
515
|
}
|
|
@@ -499,18 +521,18 @@ class S {
|
|
|
499
521
|
* @param rawValue the raw value
|
|
500
522
|
*/
|
|
501
523
|
static create(e, n, a) {
|
|
502
|
-
return n.query.postAggr === "count" ? new ut(e, n, a) : new
|
|
524
|
+
return n.query.postAggr === "count" ? new ut(e, n, a) : new M(e, n, a);
|
|
503
525
|
}
|
|
504
526
|
getDecimals(e = ct) {
|
|
505
527
|
return this.decimals ?? this.queryRef.query.decimals ?? e;
|
|
506
528
|
}
|
|
507
529
|
getFactor() {
|
|
508
530
|
var e, n, a;
|
|
509
|
-
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) ??
|
|
531
|
+
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) ?? z;
|
|
510
532
|
}
|
|
511
533
|
getUnit() {
|
|
512
534
|
var e, n, a;
|
|
513
|
-
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) ??
|
|
535
|
+
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) ?? Q;
|
|
514
536
|
}
|
|
515
537
|
setDecimals(e) {
|
|
516
538
|
this.decimals = e;
|
|
@@ -526,44 +548,44 @@ class S {
|
|
|
526
548
|
return this.rawValue;
|
|
527
549
|
}
|
|
528
550
|
toString() {
|
|
529
|
-
var a, o,
|
|
530
|
-
const e = this.locale ?? void 0, n =
|
|
531
|
-
const
|
|
551
|
+
var a, o, r, l;
|
|
552
|
+
const e = this.locale ?? void 0, n = q((c, i, u, g) => {
|
|
553
|
+
const Y = {
|
|
532
554
|
style: "decimal",
|
|
533
|
-
minimumFractionDigits: Math.floor(
|
|
534
|
-
maximumFractionDigits: Math.floor(
|
|
555
|
+
minimumFractionDigits: Math.floor(i),
|
|
556
|
+
maximumFractionDigits: Math.floor(i)
|
|
535
557
|
};
|
|
536
|
-
return `${new Intl.NumberFormat(
|
|
558
|
+
return `${new Intl.NumberFormat(g, Y).format(c)}${u ? " " + u : ""}`;
|
|
537
559
|
});
|
|
538
|
-
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" : ((
|
|
560
|
+
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(
|
|
539
561
|
this.rawValue,
|
|
540
562
|
Number.isInteger(this.getFactor()) ? this.getDecimals(0) : this.getDecimals(),
|
|
541
563
|
this.getUnit(),
|
|
542
564
|
e
|
|
543
|
-
) : ((
|
|
565
|
+
) : ((l = this.queryRef.variable) == null ? void 0 : l.type) === "float" ? n(this.rawValue, this.getDecimals(), this.getUnit(), e) : String(this.getValue());
|
|
544
566
|
}
|
|
545
567
|
}
|
|
546
|
-
class ut extends
|
|
568
|
+
class ut extends M {
|
|
547
569
|
getFactor() {
|
|
548
|
-
return this.factor ?? this.queryRef.query.factor ??
|
|
570
|
+
return this.factor ?? this.queryRef.query.factor ?? z;
|
|
549
571
|
}
|
|
550
572
|
getUnit() {
|
|
551
|
-
return this.unit ?? this.queryRef.query.unit ??
|
|
573
|
+
return this.unit ?? this.queryRef.query.unit ?? Q;
|
|
552
574
|
}
|
|
553
575
|
}
|
|
554
|
-
function
|
|
576
|
+
function P(t) {
|
|
555
577
|
return t.map(({ queryRef: n, time: a, value: o }) => {
|
|
556
|
-
const
|
|
578
|
+
const r = new te(n.query, n.variable, n.tag), l = M.create(o.locale, r, o.rawValue);
|
|
557
579
|
return {
|
|
558
|
-
queryRef:
|
|
580
|
+
queryRef: r,
|
|
559
581
|
time: a,
|
|
560
|
-
value:
|
|
582
|
+
value: l
|
|
561
583
|
};
|
|
562
584
|
});
|
|
563
585
|
}
|
|
564
|
-
let
|
|
565
|
-
function
|
|
566
|
-
if (
|
|
586
|
+
let y, A, G;
|
|
587
|
+
function B(t, e) {
|
|
588
|
+
if (G = /* @__PURE__ */ new Date(), t.nodeType !== Node.ELEMENT_NODE)
|
|
567
589
|
throw new Error("Can't generate CSS selector for non-element node type.");
|
|
568
590
|
if (t.tagName.toLowerCase() === "html")
|
|
569
591
|
return "html";
|
|
@@ -572,59 +594,59 @@ function pt(t, e) {
|
|
|
572
594
|
idName: (o) => !0,
|
|
573
595
|
className: (o) => !0,
|
|
574
596
|
tagName: (o) => !0,
|
|
575
|
-
attr: (o,
|
|
597
|
+
attr: (o, r) => !1,
|
|
576
598
|
seedMinLength: 1,
|
|
577
599
|
optimizedMinLength: 2,
|
|
578
600
|
threshold: 1e3,
|
|
579
601
|
maxNumberOfTries: 1e4,
|
|
580
602
|
timeoutMs: void 0
|
|
581
603
|
};
|
|
582
|
-
|
|
583
|
-
let a =
|
|
604
|
+
y = { ...n, ...e }, A = pt(y.root, n);
|
|
605
|
+
let a = D(t, "all", () => D(t, "two", () => D(t, "one", () => D(t, "none"))));
|
|
584
606
|
if (a) {
|
|
585
|
-
const o =
|
|
586
|
-
return o.length > 0 && (a = o[0]),
|
|
607
|
+
const o = x(X(a, t));
|
|
608
|
+
return o.length > 0 && (a = o[0]), v(a);
|
|
587
609
|
} else
|
|
588
610
|
throw new Error("Selector was not found.");
|
|
589
611
|
}
|
|
590
|
-
function
|
|
612
|
+
function pt(t, e) {
|
|
591
613
|
return t.nodeType === Node.DOCUMENT_NODE ? t : t === e.root ? t.ownerDocument : t;
|
|
592
614
|
}
|
|
593
|
-
function
|
|
594
|
-
let a = null, o = [],
|
|
595
|
-
for (;
|
|
596
|
-
const
|
|
597
|
-
if (
|
|
598
|
-
throw new Error(`Timeout: Can't find a unique selector after ${
|
|
599
|
-
let
|
|
600
|
-
const
|
|
615
|
+
function D(t, e, n) {
|
|
616
|
+
let a = null, o = [], r = t, l = 0;
|
|
617
|
+
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);
|
|
601
623
|
if (e == "all")
|
|
602
|
-
|
|
624
|
+
u && (i = i.concat(i.filter(I).map((g) => R(g, u))));
|
|
603
625
|
else if (e == "two")
|
|
604
|
-
|
|
626
|
+
i = i.slice(0, 1), u && (i = i.concat(i.filter(I).map((g) => R(g, u))));
|
|
605
627
|
else if (e == "one") {
|
|
606
|
-
const [
|
|
607
|
-
|
|
628
|
+
const [g] = i = i.slice(0, 1);
|
|
629
|
+
u && I(g) && (i = [R(g, u)]);
|
|
608
630
|
} else
|
|
609
|
-
e == "none" && (
|
|
610
|
-
for (let
|
|
611
|
-
|
|
612
|
-
if (o.push(
|
|
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))
|
|
613
635
|
break;
|
|
614
|
-
|
|
636
|
+
r = r.parentElement, l++;
|
|
615
637
|
}
|
|
616
|
-
return a || (a =
|
|
638
|
+
return a || (a = j(o, n)), !a && n ? n() : a;
|
|
617
639
|
}
|
|
618
|
-
function
|
|
619
|
-
const n =
|
|
620
|
-
if (n.length >
|
|
640
|
+
function j(t, e) {
|
|
641
|
+
const n = x(K(t));
|
|
642
|
+
if (n.length > y.threshold)
|
|
621
643
|
return e ? e() : null;
|
|
622
644
|
for (let a of n)
|
|
623
|
-
if (
|
|
645
|
+
if (J(a))
|
|
624
646
|
return a;
|
|
625
647
|
return null;
|
|
626
648
|
}
|
|
627
|
-
function
|
|
649
|
+
function v(t) {
|
|
628
650
|
let e = t[0], n = e.name;
|
|
629
651
|
for (let a = 1; a < t.length; a++) {
|
|
630
652
|
const o = t[a].level || 0;
|
|
@@ -632,12 +654,12 @@ function I(t) {
|
|
|
632
654
|
}
|
|
633
655
|
return n;
|
|
634
656
|
}
|
|
635
|
-
function
|
|
657
|
+
function k(t) {
|
|
636
658
|
return t.map((e) => e.penalty).reduce((e, n) => e + n, 0);
|
|
637
659
|
}
|
|
638
|
-
function
|
|
639
|
-
const e =
|
|
640
|
-
switch (
|
|
660
|
+
function J(t) {
|
|
661
|
+
const e = v(t);
|
|
662
|
+
switch (A.querySelectorAll(e).length) {
|
|
641
663
|
case 0:
|
|
642
664
|
throw new Error(`Can't select any node with this selector: ${e}`);
|
|
643
665
|
case 1:
|
|
@@ -646,39 +668,39 @@ function K(t) {
|
|
|
646
668
|
return !1;
|
|
647
669
|
}
|
|
648
670
|
}
|
|
649
|
-
function
|
|
671
|
+
function gt(t) {
|
|
650
672
|
const e = t.getAttribute("id");
|
|
651
|
-
return e &&
|
|
673
|
+
return e && y.idName(e) ? {
|
|
652
674
|
name: "#" + CSS.escape(e),
|
|
653
675
|
penalty: 0
|
|
654
676
|
} : null;
|
|
655
677
|
}
|
|
656
|
-
function
|
|
657
|
-
return Array.from(t.attributes).filter((n) =>
|
|
678
|
+
function yt(t) {
|
|
679
|
+
return Array.from(t.attributes).filter((n) => y.attr(n.name, n.value)).map((n) => ({
|
|
658
680
|
name: `[${CSS.escape(n.name)}="${CSS.escape(n.value)}"]`,
|
|
659
681
|
penalty: 0.5
|
|
660
682
|
}));
|
|
661
683
|
}
|
|
662
|
-
function
|
|
663
|
-
return Array.from(t.classList).filter(
|
|
684
|
+
function ft(t) {
|
|
685
|
+
return Array.from(t.classList).filter(y.className).map((n) => ({
|
|
664
686
|
name: "." + CSS.escape(n),
|
|
665
687
|
penalty: 1
|
|
666
688
|
}));
|
|
667
689
|
}
|
|
668
|
-
function
|
|
690
|
+
function ht(t) {
|
|
669
691
|
const e = t.tagName.toLowerCase();
|
|
670
|
-
return
|
|
692
|
+
return y.tagName(e) ? {
|
|
671
693
|
name: e,
|
|
672
694
|
penalty: 2
|
|
673
695
|
} : null;
|
|
674
696
|
}
|
|
675
|
-
function
|
|
697
|
+
function F() {
|
|
676
698
|
return {
|
|
677
699
|
name: "*",
|
|
678
700
|
penalty: 3
|
|
679
701
|
};
|
|
680
702
|
}
|
|
681
|
-
function
|
|
703
|
+
function mt(t) {
|
|
682
704
|
const e = t.parentNode;
|
|
683
705
|
if (!e)
|
|
684
706
|
return null;
|
|
@@ -690,80 +712,80 @@ function wt(t) {
|
|
|
690
712
|
n = n.nextSibling;
|
|
691
713
|
return a;
|
|
692
714
|
}
|
|
693
|
-
function
|
|
715
|
+
function R(t, e) {
|
|
694
716
|
return {
|
|
695
717
|
name: t.name + `:nth-child(${e})`,
|
|
696
718
|
penalty: t.penalty + 1
|
|
697
719
|
};
|
|
698
720
|
}
|
|
699
|
-
function
|
|
721
|
+
function I(t) {
|
|
700
722
|
return t.name !== "html" && !t.name.startsWith("#");
|
|
701
723
|
}
|
|
702
|
-
function
|
|
703
|
-
const e = t.filter(
|
|
724
|
+
function b(...t) {
|
|
725
|
+
const e = t.filter(wt);
|
|
704
726
|
return e.length > 0 ? e : null;
|
|
705
727
|
}
|
|
706
|
-
function
|
|
728
|
+
function wt(t) {
|
|
707
729
|
return t != null;
|
|
708
730
|
}
|
|
709
|
-
function*
|
|
731
|
+
function* K(t, e = []) {
|
|
710
732
|
if (t.length > 0)
|
|
711
733
|
for (let n of t[0])
|
|
712
|
-
yield*
|
|
734
|
+
yield* K(t.slice(1, t.length), e.concat(n));
|
|
713
735
|
else
|
|
714
736
|
yield e;
|
|
715
737
|
}
|
|
716
|
-
function
|
|
717
|
-
return [...t].sort((e, n) =>
|
|
738
|
+
function x(t) {
|
|
739
|
+
return [...t].sort((e, n) => k(e) - k(n));
|
|
718
740
|
}
|
|
719
|
-
function*
|
|
741
|
+
function* X(t, e, n = {
|
|
720
742
|
counter: 0,
|
|
721
743
|
visited: /* @__PURE__ */ new Map()
|
|
722
744
|
}) {
|
|
723
|
-
if (t.length > 2 && t.length >
|
|
745
|
+
if (t.length > 2 && t.length > y.optimizedMinLength)
|
|
724
746
|
for (let a = 1; a < t.length - 1; a++) {
|
|
725
|
-
if (n.counter >
|
|
747
|
+
if (n.counter > y.maxNumberOfTries)
|
|
726
748
|
return;
|
|
727
749
|
n.counter += 1;
|
|
728
750
|
const o = [...t];
|
|
729
751
|
o.splice(a, 1);
|
|
730
|
-
const
|
|
731
|
-
if (n.visited.has(
|
|
752
|
+
const r = v(o);
|
|
753
|
+
if (n.visited.has(r))
|
|
732
754
|
return;
|
|
733
|
-
|
|
755
|
+
J(o) && Ct(o, e) && (yield o, n.visited.set(r, !0), yield* X(o, e, n));
|
|
734
756
|
}
|
|
735
757
|
}
|
|
736
|
-
function
|
|
737
|
-
return
|
|
758
|
+
function Ct(t, e) {
|
|
759
|
+
return A.querySelector(v(t)) === e;
|
|
738
760
|
}
|
|
739
|
-
class
|
|
761
|
+
class f extends Error {
|
|
740
762
|
constructor(e = "Method is not implemented") {
|
|
741
763
|
super(e), this.name = "NotImplementedError", this.message = e, this.stack = `NotImplementedError: ${e}`;
|
|
742
764
|
}
|
|
743
765
|
}
|
|
744
|
-
class
|
|
766
|
+
class _t {
|
|
745
767
|
constructor(e) {
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
768
|
+
p(this, "ontimerangechange", null);
|
|
769
|
+
p(this, "onvpnclientstatuschange", null);
|
|
770
|
+
p(this, "_getApiLinks");
|
|
771
|
+
p(this, "appData");
|
|
772
|
+
p(this, "componentBaseUrl");
|
|
773
|
+
p(this, "destroyed");
|
|
774
|
+
p(this, "mode");
|
|
775
|
+
p(this, "inputs");
|
|
776
|
+
p(this, "inputMap");
|
|
777
|
+
p(this, "timeRange");
|
|
778
|
+
p(this, "timeRangeIsAdjustable");
|
|
779
|
+
p(this, "vpnClientStatus");
|
|
758
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);
|
|
759
781
|
}
|
|
760
782
|
_messageHandler(e) {
|
|
761
783
|
if (e.source === window.parent)
|
|
762
784
|
switch (e.data.type) {
|
|
763
|
-
case
|
|
785
|
+
case s.TimeRangeChange:
|
|
764
786
|
this.ontimerangechange && this.ontimerangechange(...e.data.payload);
|
|
765
787
|
break;
|
|
766
|
-
case
|
|
788
|
+
case s.VpnClientStatusChange:
|
|
767
789
|
this.onvpnclientstatuschange && this.onvpnclientstatuschange(...e.data.payload);
|
|
768
790
|
break;
|
|
769
791
|
}
|
|
@@ -772,98 +794,98 @@ class Dt {
|
|
|
772
794
|
const e = crypto.randomUUID();
|
|
773
795
|
return window.parent.postMessage(
|
|
774
796
|
{
|
|
775
|
-
type:
|
|
797
|
+
type: s.BackendComponentClientCreate,
|
|
776
798
|
payload: { clientId: e }
|
|
777
799
|
},
|
|
778
800
|
"*"
|
|
779
|
-
), new
|
|
801
|
+
), new Dt(e);
|
|
780
802
|
}
|
|
781
803
|
createLoggingDataClient() {
|
|
782
804
|
const e = crypto.randomUUID();
|
|
783
805
|
return window.parent.postMessage(
|
|
784
806
|
{
|
|
785
|
-
type:
|
|
807
|
+
type: s.LoggingDataClientCreate,
|
|
786
808
|
payload: { clientId: e }
|
|
787
809
|
},
|
|
788
810
|
"*"
|
|
789
|
-
), new
|
|
811
|
+
), new Rt(e);
|
|
790
812
|
}
|
|
791
813
|
createObjectStorageClient() {
|
|
792
|
-
throw new
|
|
814
|
+
throw new f();
|
|
793
815
|
}
|
|
794
816
|
createResourceDataClient() {
|
|
795
817
|
const e = crypto.randomUUID();
|
|
796
818
|
return window.parent.postMessage(
|
|
797
819
|
{
|
|
798
|
-
type:
|
|
820
|
+
type: s.ResourceDataClientCreate,
|
|
799
821
|
payload: { clientId: e }
|
|
800
822
|
},
|
|
801
823
|
"*"
|
|
802
|
-
), new
|
|
824
|
+
), new bt(e);
|
|
803
825
|
}
|
|
804
826
|
createTooltip() {
|
|
805
|
-
throw new
|
|
827
|
+
throw new f();
|
|
806
828
|
}
|
|
807
829
|
destroy() {
|
|
808
|
-
window.parent.postMessage({ type:
|
|
830
|
+
window.parent.postMessage({ type: s.Destroy }, "*"), window.removeEventListener("message", this._messageHandler, !1), this.destroyed = !0;
|
|
809
831
|
}
|
|
810
832
|
getApiUrl(e, n) {
|
|
811
833
|
const a = this._getApiLinks().get(e);
|
|
812
834
|
if (!a)
|
|
813
835
|
throw new Error("IxApiError: entry not found");
|
|
814
|
-
return n ? Object.keys(n).sort().reduce((o,
|
|
815
|
-
if (o.includes(`{${
|
|
816
|
-
return o.replace(`{${
|
|
817
|
-
const
|
|
818
|
-
return
|
|
836
|
+
return n ? Object.keys(n).sort().reduce((o, r) => {
|
|
837
|
+
if (o.includes(`{${r}}`))
|
|
838
|
+
return o.replace(`{${r}}`, n[r]);
|
|
839
|
+
const l = new URL(o);
|
|
840
|
+
return l.searchParams.set(r, n[r]), decodeURIComponent(l.href);
|
|
819
841
|
}, a.href) : a.href;
|
|
820
842
|
}
|
|
821
843
|
navigateByUrl(e) {
|
|
822
|
-
window.parent.postMessage({ type:
|
|
844
|
+
window.parent.postMessage({ type: s.NavigateByUrl, payload: { url: e } }, "*");
|
|
823
845
|
}
|
|
824
846
|
openActionBottomSheet(e) {
|
|
825
847
|
return new Promise((n) => {
|
|
826
|
-
window.addEventListener("message", a, !1), window.parent.postMessage({ type:
|
|
848
|
+
window.addEventListener("message", a, !1), window.parent.postMessage({ type: s.OpenActionBottomSheet, payload: { options: e } }, "*");
|
|
827
849
|
function a(o) {
|
|
828
|
-
o.source === window.parent && o.data.type ===
|
|
850
|
+
o.source === window.parent && o.data.type === s.OpenActionBottomSheetResult && (window.removeEventListener("message", a, !1), n(o.data.payload.result));
|
|
829
851
|
}
|
|
830
852
|
});
|
|
831
853
|
}
|
|
832
854
|
openActionMenu(e, n) {
|
|
833
855
|
return new Promise((a) => {
|
|
834
|
-
window.addEventListener("message", o, !1), window.parent.postMessage({ type:
|
|
835
|
-
function o(
|
|
836
|
-
|
|
856
|
+
window.addEventListener("message", o, !1), window.parent.postMessage({ type: s.OpenActionMenu, payload: { selector: B(e), options: n } }, "*");
|
|
857
|
+
function o(r) {
|
|
858
|
+
r.source === window.parent && r.data.type === s.OpenActionMenuResult && (window.removeEventListener("message", o, !1), a(r.data.payload.result));
|
|
837
859
|
}
|
|
838
860
|
});
|
|
839
861
|
}
|
|
840
862
|
openAlertDialog(e) {
|
|
841
863
|
return new Promise((n) => {
|
|
842
|
-
window.addEventListener("message", a, !1), window.parent.postMessage({ type:
|
|
864
|
+
window.addEventListener("message", a, !1), window.parent.postMessage({ type: s.OpenAlertDialog, payload: { options: e } }, "*");
|
|
843
865
|
function a(o) {
|
|
844
|
-
o.source === window.parent && o.data.type ===
|
|
866
|
+
o.source === window.parent && o.data.type === s.OpenAlertDialogResult && (window.removeEventListener("message", a, !1), n(o.data.payload.result));
|
|
845
867
|
}
|
|
846
868
|
});
|
|
847
869
|
}
|
|
848
870
|
openConfirmDialog(e) {
|
|
849
871
|
return new Promise((n) => {
|
|
850
|
-
window.addEventListener("message", a, !1), window.parent.postMessage({ type:
|
|
872
|
+
window.addEventListener("message", a, !1), window.parent.postMessage({ type: s.OpenConfirmDialog, payload: { options: e } }, "*");
|
|
851
873
|
function a(o) {
|
|
852
|
-
o.source === window.parent && o.data.type ===
|
|
874
|
+
o.source === window.parent && o.data.type === s.OpenConfirmDialogResult && (window.removeEventListener("message", a, !1), n(o.data.payload.result));
|
|
853
875
|
}
|
|
854
876
|
});
|
|
855
877
|
}
|
|
856
878
|
openContentDialog(e) {
|
|
857
879
|
if (typeof e.onopened == "function")
|
|
858
|
-
throw new
|
|
880
|
+
throw new f('The "onopened" option is not implemented');
|
|
859
881
|
if (typeof e.onclose == "function")
|
|
860
|
-
throw new
|
|
882
|
+
throw new f('The "onclose" option is not implemented');
|
|
861
883
|
if (e.pagination)
|
|
862
|
-
throw new
|
|
884
|
+
throw new f('The "pagination" option is not implemented');
|
|
863
885
|
return new Promise((n) => {
|
|
864
886
|
window.addEventListener("message", a, !1), window.parent.postMessage(
|
|
865
887
|
{
|
|
866
|
-
type:
|
|
888
|
+
type: s.OpenContentDialog,
|
|
867
889
|
payload: {
|
|
868
890
|
options: e.htmlContent && typeof e.htmlContent != "string" ? { ...e, htmlContent: e.htmlContent.cloneNode(!0).outerHTML } : e
|
|
869
891
|
}
|
|
@@ -871,38 +893,46 @@ class Dt {
|
|
|
871
893
|
"*"
|
|
872
894
|
);
|
|
873
895
|
function a(o) {
|
|
874
|
-
o.source === window.parent && o.data.type ===
|
|
896
|
+
o.source === window.parent && o.data.type === s.OpenContentDialogResult && (window.removeEventListener("message", a, !1), n(o.data.payload.result));
|
|
875
897
|
}
|
|
876
898
|
});
|
|
877
899
|
}
|
|
878
900
|
openFormDialog(e) {
|
|
879
901
|
return new Promise((n) => {
|
|
880
|
-
window.addEventListener("message", a, !1), window.parent.postMessage({ type:
|
|
902
|
+
window.addEventListener("message", a, !1), window.parent.postMessage({ type: s.OpenFormDialog, payload: { options: e } }, "*");
|
|
881
903
|
function a(o) {
|
|
882
|
-
o.source === window.parent && o.data.type ===
|
|
904
|
+
o.source === window.parent && o.data.type === s.OpenFormDialogResult && (window.removeEventListener("message", a, !1), n(o.data.payload.result));
|
|
905
|
+
}
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
openSelectPanel(e, n) {
|
|
909
|
+
return new Promise((a) => {
|
|
910
|
+
window.addEventListener("message", o, !1), window.parent.postMessage({ type: s.OpenSelectPanel, payload: { selector: B(e), options: n } }, "*");
|
|
911
|
+
function o(r) {
|
|
912
|
+
r.source === window.parent && r.data.type === s.OpenSelectPanelResult && (window.removeEventListener("message", o, !1), a(r.data.payload.result));
|
|
883
913
|
}
|
|
884
914
|
});
|
|
885
915
|
}
|
|
886
916
|
openToast(...e) {
|
|
887
917
|
return new Promise((n) => {
|
|
888
|
-
window.addEventListener("message",
|
|
918
|
+
window.addEventListener("message", r, !1);
|
|
889
919
|
const a = crypto.randomUUID(), o = typeof e[0] == "string" ? { ...e[1], message: e[0] } : e[0];
|
|
890
|
-
window.parent.postMessage({ type:
|
|
891
|
-
function
|
|
892
|
-
|
|
920
|
+
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));
|
|
893
923
|
}
|
|
894
924
|
});
|
|
895
925
|
}
|
|
896
926
|
sanitizeHtml() {
|
|
897
|
-
throw new
|
|
927
|
+
throw new f();
|
|
898
928
|
}
|
|
899
929
|
saveAsFile() {
|
|
900
|
-
throw new
|
|
930
|
+
throw new f();
|
|
901
931
|
}
|
|
902
932
|
setTimeRange(e) {
|
|
903
933
|
window.parent.postMessage(
|
|
904
934
|
{
|
|
905
|
-
type:
|
|
935
|
+
type: s.SetTimeRange,
|
|
906
936
|
payload: { timeRange: e }
|
|
907
937
|
},
|
|
908
938
|
"*"
|
|
@@ -911,31 +941,31 @@ class Dt {
|
|
|
911
941
|
showVpnStatusDetails(e) {
|
|
912
942
|
window.parent.postMessage(
|
|
913
943
|
{
|
|
914
|
-
type:
|
|
944
|
+
type: s.ShowVpnStatusDetails,
|
|
915
945
|
payload: { agentId: e }
|
|
916
946
|
},
|
|
917
947
|
"*"
|
|
918
948
|
);
|
|
919
949
|
}
|
|
920
950
|
testVpnAccess() {
|
|
921
|
-
throw new
|
|
951
|
+
throw new f();
|
|
922
952
|
}
|
|
923
953
|
toggleVpn(e) {
|
|
924
|
-
window.parent.postMessage({ type:
|
|
954
|
+
window.parent.postMessage({ type: s.ToggleVpn, payload: { agentId: e } }, "*");
|
|
925
955
|
}
|
|
926
956
|
translate() {
|
|
927
|
-
throw new
|
|
957
|
+
throw new f();
|
|
928
958
|
}
|
|
929
959
|
}
|
|
930
|
-
class
|
|
960
|
+
class Dt {
|
|
931
961
|
constructor(e) {
|
|
932
962
|
this.id = e;
|
|
933
963
|
}
|
|
934
964
|
call(e, n) {
|
|
935
965
|
return new Promise((a) => {
|
|
936
966
|
const o = crypto.randomUUID();
|
|
937
|
-
window.addEventListener("message",
|
|
938
|
-
type:
|
|
967
|
+
window.addEventListener("message", r, !1), window.parent.postMessage({
|
|
968
|
+
type: s.BackendComponentClientCall,
|
|
939
969
|
payload: {
|
|
940
970
|
clientId: this.id,
|
|
941
971
|
callId: o,
|
|
@@ -943,22 +973,22 @@ class Rt {
|
|
|
943
973
|
functionArguments: n
|
|
944
974
|
}
|
|
945
975
|
});
|
|
946
|
-
function
|
|
947
|
-
|
|
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));
|
|
948
978
|
}
|
|
949
979
|
});
|
|
950
980
|
}
|
|
951
981
|
destroy() {
|
|
952
982
|
window.parent.postMessage(
|
|
953
983
|
{
|
|
954
|
-
type:
|
|
984
|
+
type: s.BackendComponentClientDestroy,
|
|
955
985
|
payload: { clientId: this.id }
|
|
956
986
|
},
|
|
957
987
|
"*"
|
|
958
988
|
);
|
|
959
989
|
}
|
|
960
990
|
}
|
|
961
|
-
class
|
|
991
|
+
class Rt {
|
|
962
992
|
constructor(e) {
|
|
963
993
|
this.id = e;
|
|
964
994
|
}
|
|
@@ -966,25 +996,25 @@ class bt {
|
|
|
966
996
|
const a = crypto.randomUUID();
|
|
967
997
|
return window.addEventListener("message", o, !1), window.parent.postMessage(
|
|
968
998
|
{
|
|
969
|
-
type:
|
|
999
|
+
type: s.LoggingDataClientQuery,
|
|
970
1000
|
payload: { clientId: this.id, queryId: a, query: e }
|
|
971
1001
|
},
|
|
972
1002
|
"*"
|
|
973
1003
|
), () => {
|
|
974
1004
|
window.removeEventListener("message", o, !1);
|
|
975
1005
|
};
|
|
976
|
-
function o(
|
|
977
|
-
if (
|
|
978
|
-
const { results:
|
|
1006
|
+
function o(r) {
|
|
1007
|
+
if (r.source === window.parent && r.data.type === s.LoggingDataClientQueryResult && r.data.payload.queryId === a) {
|
|
1008
|
+
const { results: l } = r.data.payload;
|
|
979
1009
|
if (e.length)
|
|
980
1010
|
if (!e.queries || e.format !== "csv") {
|
|
981
|
-
const
|
|
982
|
-
n(
|
|
1011
|
+
const c = l.map((i) => P(i));
|
|
1012
|
+
n(c);
|
|
983
1013
|
} else
|
|
984
|
-
throw new
|
|
1014
|
+
throw new f();
|
|
985
1015
|
else {
|
|
986
|
-
const
|
|
987
|
-
n(
|
|
1016
|
+
const c = P(l);
|
|
1017
|
+
n(c);
|
|
988
1018
|
}
|
|
989
1019
|
}
|
|
990
1020
|
}
|
|
@@ -992,14 +1022,14 @@ class bt {
|
|
|
992
1022
|
destroy() {
|
|
993
1023
|
window.parent.postMessage(
|
|
994
1024
|
{
|
|
995
|
-
type:
|
|
1025
|
+
type: s.LoggingDataClientDestroy,
|
|
996
1026
|
payload: { clientId: this.id }
|
|
997
1027
|
},
|
|
998
1028
|
"*"
|
|
999
1029
|
);
|
|
1000
1030
|
}
|
|
1001
1031
|
}
|
|
1002
|
-
class
|
|
1032
|
+
class bt {
|
|
1003
1033
|
constructor(e) {
|
|
1004
1034
|
this.id = e;
|
|
1005
1035
|
}
|
|
@@ -1007,15 +1037,15 @@ class Ot {
|
|
|
1007
1037
|
const a = crypto.randomUUID();
|
|
1008
1038
|
return window.addEventListener("message", o, !1), window.parent.postMessage(
|
|
1009
1039
|
{
|
|
1010
|
-
type:
|
|
1040
|
+
type: s.ResourceDataClientQuery,
|
|
1011
1041
|
payload: { clientId: this.id, queryId: a, query: e }
|
|
1012
1042
|
},
|
|
1013
1043
|
"*"
|
|
1014
1044
|
), () => {
|
|
1015
1045
|
window.removeEventListener("message", o, !1);
|
|
1016
1046
|
};
|
|
1017
|
-
function o(
|
|
1018
|
-
|
|
1047
|
+
function o(r) {
|
|
1048
|
+
r.source === window.parent && r.data.type === s.ResourceDataClientQueryResult && r.data.payload.queryId === a && n(r.data.payload.results);
|
|
1019
1049
|
}
|
|
1020
1050
|
}
|
|
1021
1051
|
update(e) {
|
|
@@ -1023,13 +1053,13 @@ class Ot {
|
|
|
1023
1053
|
const a = crypto.randomUUID();
|
|
1024
1054
|
window.addEventListener("message", o, !1), window.parent.postMessage(
|
|
1025
1055
|
{
|
|
1026
|
-
type:
|
|
1056
|
+
type: s.ResourceDataClientUpdate,
|
|
1027
1057
|
payload: { clientId: this.id, updateId: a, update: e }
|
|
1028
1058
|
},
|
|
1029
1059
|
"*"
|
|
1030
1060
|
);
|
|
1031
|
-
function o(
|
|
1032
|
-
|
|
1061
|
+
function o(r) {
|
|
1062
|
+
r.source === window.parent && r.data.type === s.ResourceDataClientUpdated && r.data.payload.updateId === a && (window.removeEventListener("message", o, !1), n());
|
|
1033
1063
|
}
|
|
1034
1064
|
});
|
|
1035
1065
|
}
|
|
@@ -1037,45 +1067,45 @@ class Ot {
|
|
|
1037
1067
|
const a = crypto.randomUUID();
|
|
1038
1068
|
return window.addEventListener("message", o, !1), window.parent.postMessage(
|
|
1039
1069
|
{
|
|
1040
|
-
type:
|
|
1070
|
+
type: s.ResourceDataClientRender,
|
|
1041
1071
|
payload: { clientId: this.id, queryId: a, query: e }
|
|
1042
1072
|
},
|
|
1043
1073
|
"*"
|
|
1044
1074
|
), () => {
|
|
1045
1075
|
window.removeEventListener("message", o, !1);
|
|
1046
1076
|
};
|
|
1047
|
-
function o(
|
|
1048
|
-
|
|
1077
|
+
function o(r) {
|
|
1078
|
+
r.source === window.parent && r.data.type === s.ResourceDataClientRenderResult && r.data.payload.queryId === a && n(r.data.payload.results);
|
|
1049
1079
|
}
|
|
1050
1080
|
}
|
|
1051
1081
|
destroy() {
|
|
1052
1082
|
window.parent.postMessage(
|
|
1053
1083
|
{
|
|
1054
|
-
type:
|
|
1084
|
+
type: s.ResourceDataClientDestroy,
|
|
1055
1085
|
payload: { clientId: this.id }
|
|
1056
1086
|
},
|
|
1057
1087
|
"*"
|
|
1058
1088
|
);
|
|
1059
1089
|
}
|
|
1060
1090
|
}
|
|
1061
|
-
function
|
|
1091
|
+
function L(t) {
|
|
1062
1092
|
const e = !!(t && t.migrateInputs);
|
|
1063
|
-
return !e &&
|
|
1093
|
+
return !e && L.__cache__ ? Promise.resolve(L.__cache__) : new Promise((n) => {
|
|
1064
1094
|
window.addEventListener(
|
|
1065
1095
|
"message",
|
|
1066
1096
|
function a(o) {
|
|
1067
|
-
if (o.source === window.parent && o.data && o.data.type ===
|
|
1068
|
-
let
|
|
1069
|
-
e && (
|
|
1070
|
-
const
|
|
1071
|
-
n(
|
|
1097
|
+
if (o.source === window.parent && o.data && o.data.type === s.Created) {
|
|
1098
|
+
let r = o.data.payload;
|
|
1099
|
+
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);
|
|
1072
1102
|
}
|
|
1073
1103
|
},
|
|
1074
1104
|
!1
|
|
1075
|
-
), window.parent.postMessage({ type:
|
|
1105
|
+
), window.parent.postMessage({ type: s.Create }, "*");
|
|
1076
1106
|
});
|
|
1077
1107
|
}
|
|
1078
1108
|
export {
|
|
1079
1109
|
$t as connect,
|
|
1080
|
-
|
|
1110
|
+
L as getComponentContext
|
|
1081
1111
|
};
|