phirepass-widgets 0.0.23 → 0.0.25
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/cjs/{index-L0_45iFE.js → index-Rxdu9QG2.js} +16 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/phirepass-sftp-client.cjs.entry.js +1 -1
- package/dist/cjs/phirepass-terminal.cjs.entry.js +33 -26
- package/dist/cjs/phirepass-widgets.cjs.js +1 -1
- package/dist/collection/components/phirepass-terminal/phirepass-terminal.js +54 -25
- package/dist/components/index.js +1 -1
- package/dist/components/phirepass-terminal.js +5 -5
- package/dist/esm/{index-BZOTLEeX.js → index-C8ZFkLEv.js} +16 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/phirepass-sftp-client.entry.js +1 -1
- package/dist/esm/phirepass-terminal.entry.js +33 -26
- package/dist/esm/phirepass-widgets.js +2 -2
- package/dist/phirepass-widgets/p-0d711924.entry.js +49 -0
- package/dist/phirepass-widgets/p-376ef3af.entry.js +1 -0
- package/dist/phirepass-widgets/p-C8ZFkLEv.js +2 -0
- package/dist/phirepass-widgets/phirepass-widgets.esm.js +1 -1
- package/dist/types/components/phirepass-terminal/phirepass-terminal.d.ts +26 -19
- package/dist/types/components.d.ts +16 -0
- package/package.json +1 -1
- package/dist/phirepass-widgets/p-0bd7f5f1.entry.js +0 -1
- package/dist/phirepass-widgets/p-BZOTLEeX.js +0 -2
- package/dist/phirepass-widgets/p-bbb96b8f.entry.js +0 -49
|
@@ -435,6 +435,21 @@ var getElement = (ref) => {
|
|
|
435
435
|
var _a;
|
|
436
436
|
return (_a = getHostRef(ref)) == null ? void 0 : _a.$hostElement$ ;
|
|
437
437
|
};
|
|
438
|
+
|
|
439
|
+
// src/runtime/event-emitter.ts
|
|
440
|
+
var createEvent = (ref, name, flags) => {
|
|
441
|
+
const elm = getElement(ref);
|
|
442
|
+
return {
|
|
443
|
+
emit: (detail) => {
|
|
444
|
+
return emitEvent(elm, name, {
|
|
445
|
+
bubbles: true,
|
|
446
|
+
composed: true,
|
|
447
|
+
cancelable: true,
|
|
448
|
+
detail
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
};
|
|
438
453
|
var emitEvent = (elm, name, opts) => {
|
|
439
454
|
const ev = plt.ce(name, opts);
|
|
440
455
|
elm.dispatchEvent(ev);
|
|
@@ -1474,6 +1489,7 @@ function transformTag(tag) {
|
|
|
1474
1489
|
|
|
1475
1490
|
exports.Host = Host;
|
|
1476
1491
|
exports.bootstrapLazy = bootstrapLazy;
|
|
1492
|
+
exports.createEvent = createEvent;
|
|
1477
1493
|
exports.getElement = getElement;
|
|
1478
1494
|
exports.h = h;
|
|
1479
1495
|
exports.promiseResolve = promiseResolve;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-Rxdu9QG2.js');
|
|
4
4
|
|
|
5
5
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
6
6
|
/**
|
|
@@ -986,9 +986,16 @@ var InputMode;
|
|
|
986
986
|
InputMode[InputMode["Password"] = 1] = "Password";
|
|
987
987
|
InputMode[InputMode["Default"] = 2] = "Default";
|
|
988
988
|
})(InputMode || (InputMode = {}));
|
|
989
|
+
var ConnectionState;
|
|
990
|
+
(function (ConnectionState) {
|
|
991
|
+
ConnectionState["Disconnected"] = "disconnected";
|
|
992
|
+
ConnectionState["Connected"] = "connected";
|
|
993
|
+
ConnectionState["Error"] = "error";
|
|
994
|
+
})(ConnectionState || (ConnectionState = {}));
|
|
989
995
|
const PhirepassTerminal = class {
|
|
990
996
|
constructor(hostRef) {
|
|
991
997
|
index.registerInstance(this, hostRef);
|
|
998
|
+
this.connectionStateChanged = index.createEvent(this, "connectionStateChanged");
|
|
992
999
|
}
|
|
993
1000
|
terminal;
|
|
994
1001
|
fitAddon;
|
|
@@ -1088,7 +1095,8 @@ const PhirepassTerminal = class {
|
|
|
1088
1095
|
onServerIdChange(_newValue, _oldValue) {
|
|
1089
1096
|
this.onNodeIdChange(this.nodeId, this.nodeId);
|
|
1090
1097
|
}
|
|
1091
|
-
|
|
1098
|
+
connectionStateChanged;
|
|
1099
|
+
create_web_socket_endpoint() {
|
|
1092
1100
|
const protocol = this.allowInsecure ? 'ws' : 'wss';
|
|
1093
1101
|
if (!this.allowInsecure && this.serverPort === 443) {
|
|
1094
1102
|
return `${protocol}://${this.serverHost}`;
|
|
@@ -1099,13 +1107,9 @@ const PhirepassTerminal = class {
|
|
|
1099
1107
|
return `${protocol}://${this.serverHost}:${this.serverPort}`;
|
|
1100
1108
|
}
|
|
1101
1109
|
async connectedCallback() {
|
|
1102
|
-
console.log('PhirepassTerminal connected to DOM');
|
|
1103
1110
|
await __wbg_init();
|
|
1104
|
-
console.log('PhirepassChannel module initialized');
|
|
1105
1111
|
this.setup_terminal();
|
|
1106
|
-
console.log('Terminal setup complete');
|
|
1107
1112
|
this.open_comms();
|
|
1108
|
-
console.log('Comms opened');
|
|
1109
1113
|
this.runtimeReady = true;
|
|
1110
1114
|
if (!this.nodeId) {
|
|
1111
1115
|
console.warn('Prop node_id is not set. Cannot connect to terminal.');
|
|
@@ -1167,19 +1171,21 @@ const PhirepassTerminal = class {
|
|
|
1167
1171
|
}
|
|
1168
1172
|
open_comms() {
|
|
1169
1173
|
if (this.serverId) {
|
|
1170
|
-
this.channel = new Channel(`${this.
|
|
1174
|
+
this.channel = new Channel(`${this.create_web_socket_endpoint()}/api/web/ws`, this.nodeId, this.serverId);
|
|
1171
1175
|
}
|
|
1172
1176
|
else {
|
|
1173
|
-
this.channel = new Channel(`${this.
|
|
1177
|
+
this.channel = new Channel(`${this.create_web_socket_endpoint()}/api/web/ws`, this.nodeId);
|
|
1174
1178
|
}
|
|
1175
1179
|
this.channel.on_connection_open(() => {
|
|
1180
|
+
this.connectionStateChanged.emit([ConnectionState.Connected]);
|
|
1176
1181
|
this.channel.authenticate(this.token, this.nodeId);
|
|
1177
1182
|
});
|
|
1178
1183
|
this.channel.on_connection_close(() => {
|
|
1184
|
+
this.connectionStateChanged.emit([ConnectionState.Disconnected]);
|
|
1179
1185
|
this.terminal.reset();
|
|
1180
1186
|
});
|
|
1181
1187
|
this.channel.on_connection_error((err) => {
|
|
1182
|
-
|
|
1188
|
+
this.connectionStateChanged.emit([ConnectionState.Error, err]);
|
|
1183
1189
|
});
|
|
1184
1190
|
this.channel.on_connection_message((_raw) => {
|
|
1185
1191
|
// console.log('>> raw message received', raw);
|
|
@@ -1191,7 +1197,7 @@ const PhirepassTerminal = class {
|
|
|
1191
1197
|
this.handle_error(web);
|
|
1192
1198
|
break;
|
|
1193
1199
|
case "AuthSuccess":
|
|
1194
|
-
this.
|
|
1200
|
+
this.handle_auth_success(web);
|
|
1195
1201
|
break;
|
|
1196
1202
|
case "TunnelOpened":
|
|
1197
1203
|
this.session_id = web.sid;
|
|
@@ -1199,7 +1205,7 @@ const PhirepassTerminal = class {
|
|
|
1199
1205
|
this.send_ssh_terminal_resize();
|
|
1200
1206
|
break;
|
|
1201
1207
|
case "TunnelClosed":
|
|
1202
|
-
this.
|
|
1208
|
+
this.handle_tunnel_closed();
|
|
1203
1209
|
break;
|
|
1204
1210
|
case "TunnelData":
|
|
1205
1211
|
this.terminal.write(new Uint8Array(web.data));
|
|
@@ -1277,12 +1283,12 @@ const PhirepassTerminal = class {
|
|
|
1277
1283
|
this.inputMode = InputMode.Default;
|
|
1278
1284
|
this.clear_creds_buffer();
|
|
1279
1285
|
}
|
|
1280
|
-
|
|
1286
|
+
handle_auth_success(_auth_) {
|
|
1281
1287
|
this.clear_creds_buffer();
|
|
1282
1288
|
this.channel.start_heartbeat(this.heartbeatInterval <= 15_000 ? 30_000 : this.heartbeatInterval);
|
|
1283
1289
|
this.channel.open_ssh_tunnel(this.nodeId);
|
|
1284
1290
|
}
|
|
1285
|
-
|
|
1291
|
+
handle_tunnel_closed() {
|
|
1286
1292
|
this.session_id = undefined;
|
|
1287
1293
|
this.inputMode = InputMode.Default;
|
|
1288
1294
|
this.clear_creds_buffer();
|
|
@@ -1297,15 +1303,16 @@ const PhirepassTerminal = class {
|
|
|
1297
1303
|
console.log('Terminal opened in container');
|
|
1298
1304
|
this.fitAddon.fit();
|
|
1299
1305
|
this.terminal.focus();
|
|
1300
|
-
this.terminal.onData(this.
|
|
1306
|
+
this.terminal.onData(this.handle_terminal_data.bind(this));
|
|
1301
1307
|
this.channel.connect();
|
|
1302
|
-
this.
|
|
1308
|
+
this.setup_resize_observer();
|
|
1303
1309
|
this.connected = true;
|
|
1304
1310
|
console.log('Terminal connected and ready');
|
|
1305
1311
|
}
|
|
1306
1312
|
}
|
|
1307
|
-
|
|
1313
|
+
setup_resize_observer() {
|
|
1308
1314
|
this.resizeObserver = new ResizeObserver(() => {
|
|
1315
|
+
console.log('Container resized, fitting terminal');
|
|
1309
1316
|
if (this.resizeDebounceHandle) {
|
|
1310
1317
|
clearTimeout(this.resizeDebounceHandle);
|
|
1311
1318
|
}
|
|
@@ -1316,23 +1323,23 @@ const PhirepassTerminal = class {
|
|
|
1316
1323
|
});
|
|
1317
1324
|
this.resizeObserver.observe(this.el);
|
|
1318
1325
|
}
|
|
1319
|
-
|
|
1326
|
+
handle_terminal_data(data) {
|
|
1320
1327
|
switch (this.inputMode) {
|
|
1321
1328
|
case InputMode.Username:
|
|
1322
|
-
this.
|
|
1329
|
+
this.handle_username_input(data);
|
|
1323
1330
|
break;
|
|
1324
1331
|
case InputMode.Password:
|
|
1325
|
-
this.
|
|
1332
|
+
this.handle_password_input(data);
|
|
1326
1333
|
break;
|
|
1327
1334
|
case InputMode.Default:
|
|
1328
1335
|
this.send_ssh_data(data);
|
|
1329
1336
|
break;
|
|
1330
1337
|
}
|
|
1331
1338
|
}
|
|
1332
|
-
|
|
1339
|
+
handle_username_input(data) {
|
|
1333
1340
|
if (data === "\r" || data === "\n") {
|
|
1334
1341
|
this.terminal.write("\r\n");
|
|
1335
|
-
this.
|
|
1342
|
+
this.submit_username();
|
|
1336
1343
|
return;
|
|
1337
1344
|
}
|
|
1338
1345
|
if (data === "\u0003") {
|
|
@@ -1352,7 +1359,7 @@ const PhirepassTerminal = class {
|
|
|
1352
1359
|
this.terminal.write(data);
|
|
1353
1360
|
}
|
|
1354
1361
|
}
|
|
1355
|
-
|
|
1362
|
+
submit_username() {
|
|
1356
1363
|
if (!this.channel.is_connected()) {
|
|
1357
1364
|
return;
|
|
1358
1365
|
}
|
|
@@ -1366,10 +1373,10 @@ const PhirepassTerminal = class {
|
|
|
1366
1373
|
this.inputMode = InputMode.Default;
|
|
1367
1374
|
this.channel.open_ssh_tunnel(this.nodeId, username);
|
|
1368
1375
|
}
|
|
1369
|
-
|
|
1376
|
+
handle_password_input(data) {
|
|
1370
1377
|
if (data === "\r" || data === "\n") {
|
|
1371
1378
|
this.terminal.write("\r\n");
|
|
1372
|
-
this.
|
|
1379
|
+
this.submit_password();
|
|
1373
1380
|
return;
|
|
1374
1381
|
}
|
|
1375
1382
|
if (data === "\u0003") {
|
|
@@ -1389,7 +1396,7 @@ const PhirepassTerminal = class {
|
|
|
1389
1396
|
this.terminal.write("*");
|
|
1390
1397
|
}
|
|
1391
1398
|
}
|
|
1392
|
-
|
|
1399
|
+
submit_password() {
|
|
1393
1400
|
if (!this.channel.is_connected()) {
|
|
1394
1401
|
return;
|
|
1395
1402
|
}
|
|
@@ -1409,7 +1416,7 @@ const PhirepassTerminal = class {
|
|
|
1409
1416
|
this.usernameBuffer = "";
|
|
1410
1417
|
}
|
|
1411
1418
|
render() {
|
|
1412
|
-
return (index.h(index.Host, { key: '
|
|
1419
|
+
return (index.h(index.Host, { key: '69829da082f49d271442e4cc55d06498b57a36a4' }, index.h("div", { key: '20f52c1b6782607c6e28a540907ab00eb4ccb437', id: "ccc", ref: el => (this.containerEl = el) })));
|
|
1413
1420
|
}
|
|
1414
1421
|
static get watchers() { return {
|
|
1415
1422
|
"nodeId": [{
|
|
@@ -14,6 +14,12 @@ var InputMode;
|
|
|
14
14
|
InputMode[InputMode["Password"] = 1] = "Password";
|
|
15
15
|
InputMode[InputMode["Default"] = 2] = "Default";
|
|
16
16
|
})(InputMode || (InputMode = {}));
|
|
17
|
+
var ConnectionState;
|
|
18
|
+
(function (ConnectionState) {
|
|
19
|
+
ConnectionState["Disconnected"] = "disconnected";
|
|
20
|
+
ConnectionState["Connected"] = "connected";
|
|
21
|
+
ConnectionState["Error"] = "error";
|
|
22
|
+
})(ConnectionState || (ConnectionState = {}));
|
|
17
23
|
export class PhirepassTerminal {
|
|
18
24
|
terminal;
|
|
19
25
|
fitAddon;
|
|
@@ -113,7 +119,8 @@ export class PhirepassTerminal {
|
|
|
113
119
|
onServerIdChange(_newValue, _oldValue) {
|
|
114
120
|
this.onNodeIdChange(this.nodeId, this.nodeId);
|
|
115
121
|
}
|
|
116
|
-
|
|
122
|
+
connectionStateChanged;
|
|
123
|
+
create_web_socket_endpoint() {
|
|
117
124
|
const protocol = this.allowInsecure ? 'ws' : 'wss';
|
|
118
125
|
if (!this.allowInsecure && this.serverPort === 443) {
|
|
119
126
|
return `${protocol}://${this.serverHost}`;
|
|
@@ -124,13 +131,9 @@ export class PhirepassTerminal {
|
|
|
124
131
|
return `${protocol}://${this.serverHost}:${this.serverPort}`;
|
|
125
132
|
}
|
|
126
133
|
async connectedCallback() {
|
|
127
|
-
console.log('PhirepassTerminal connected to DOM');
|
|
128
134
|
await init();
|
|
129
|
-
console.log('PhirepassChannel module initialized');
|
|
130
135
|
this.setup_terminal();
|
|
131
|
-
console.log('Terminal setup complete');
|
|
132
136
|
this.open_comms();
|
|
133
|
-
console.log('Comms opened');
|
|
134
137
|
this.runtimeReady = true;
|
|
135
138
|
if (!this.nodeId) {
|
|
136
139
|
console.warn('Prop node_id is not set. Cannot connect to terminal.');
|
|
@@ -192,19 +195,21 @@ export class PhirepassTerminal {
|
|
|
192
195
|
}
|
|
193
196
|
open_comms() {
|
|
194
197
|
if (this.serverId) {
|
|
195
|
-
this.channel = new PhirepassChannel(`${this.
|
|
198
|
+
this.channel = new PhirepassChannel(`${this.create_web_socket_endpoint()}/api/web/ws`, this.nodeId, this.serverId);
|
|
196
199
|
}
|
|
197
200
|
else {
|
|
198
|
-
this.channel = new PhirepassChannel(`${this.
|
|
201
|
+
this.channel = new PhirepassChannel(`${this.create_web_socket_endpoint()}/api/web/ws`, this.nodeId);
|
|
199
202
|
}
|
|
200
203
|
this.channel.on_connection_open(() => {
|
|
204
|
+
this.connectionStateChanged.emit([ConnectionState.Connected]);
|
|
201
205
|
this.channel.authenticate(this.token, this.nodeId);
|
|
202
206
|
});
|
|
203
207
|
this.channel.on_connection_close(() => {
|
|
208
|
+
this.connectionStateChanged.emit([ConnectionState.Disconnected]);
|
|
204
209
|
this.terminal.reset();
|
|
205
210
|
});
|
|
206
211
|
this.channel.on_connection_error((err) => {
|
|
207
|
-
|
|
212
|
+
this.connectionStateChanged.emit([ConnectionState.Error, err]);
|
|
208
213
|
});
|
|
209
214
|
this.channel.on_connection_message((_raw) => {
|
|
210
215
|
// console.log('>> raw message received', raw);
|
|
@@ -216,7 +221,7 @@ export class PhirepassTerminal {
|
|
|
216
221
|
this.handle_error(web);
|
|
217
222
|
break;
|
|
218
223
|
case "AuthSuccess":
|
|
219
|
-
this.
|
|
224
|
+
this.handle_auth_success(web);
|
|
220
225
|
break;
|
|
221
226
|
case "TunnelOpened":
|
|
222
227
|
this.session_id = web.sid;
|
|
@@ -224,7 +229,7 @@ export class PhirepassTerminal {
|
|
|
224
229
|
this.send_ssh_terminal_resize();
|
|
225
230
|
break;
|
|
226
231
|
case "TunnelClosed":
|
|
227
|
-
this.
|
|
232
|
+
this.handle_tunnel_closed();
|
|
228
233
|
break;
|
|
229
234
|
case "TunnelData":
|
|
230
235
|
this.terminal.write(new Uint8Array(web.data));
|
|
@@ -302,12 +307,12 @@ export class PhirepassTerminal {
|
|
|
302
307
|
this.inputMode = InputMode.Default;
|
|
303
308
|
this.clear_creds_buffer();
|
|
304
309
|
}
|
|
305
|
-
|
|
310
|
+
handle_auth_success(_auth_) {
|
|
306
311
|
this.clear_creds_buffer();
|
|
307
312
|
this.channel.start_heartbeat(this.heartbeatInterval <= 15_000 ? 30_000 : this.heartbeatInterval);
|
|
308
313
|
this.channel.open_ssh_tunnel(this.nodeId);
|
|
309
314
|
}
|
|
310
|
-
|
|
315
|
+
handle_tunnel_closed() {
|
|
311
316
|
this.session_id = undefined;
|
|
312
317
|
this.inputMode = InputMode.Default;
|
|
313
318
|
this.clear_creds_buffer();
|
|
@@ -322,15 +327,16 @@ export class PhirepassTerminal {
|
|
|
322
327
|
console.log('Terminal opened in container');
|
|
323
328
|
this.fitAddon.fit();
|
|
324
329
|
this.terminal.focus();
|
|
325
|
-
this.terminal.onData(this.
|
|
330
|
+
this.terminal.onData(this.handle_terminal_data.bind(this));
|
|
326
331
|
this.channel.connect();
|
|
327
|
-
this.
|
|
332
|
+
this.setup_resize_observer();
|
|
328
333
|
this.connected = true;
|
|
329
334
|
console.log('Terminal connected and ready');
|
|
330
335
|
}
|
|
331
336
|
}
|
|
332
|
-
|
|
337
|
+
setup_resize_observer() {
|
|
333
338
|
this.resizeObserver = new ResizeObserver(() => {
|
|
339
|
+
console.log('Container resized, fitting terminal');
|
|
334
340
|
if (this.resizeDebounceHandle) {
|
|
335
341
|
clearTimeout(this.resizeDebounceHandle);
|
|
336
342
|
}
|
|
@@ -341,23 +347,23 @@ export class PhirepassTerminal {
|
|
|
341
347
|
});
|
|
342
348
|
this.resizeObserver.observe(this.el);
|
|
343
349
|
}
|
|
344
|
-
|
|
350
|
+
handle_terminal_data(data) {
|
|
345
351
|
switch (this.inputMode) {
|
|
346
352
|
case InputMode.Username:
|
|
347
|
-
this.
|
|
353
|
+
this.handle_username_input(data);
|
|
348
354
|
break;
|
|
349
355
|
case InputMode.Password:
|
|
350
|
-
this.
|
|
356
|
+
this.handle_password_input(data);
|
|
351
357
|
break;
|
|
352
358
|
case InputMode.Default:
|
|
353
359
|
this.send_ssh_data(data);
|
|
354
360
|
break;
|
|
355
361
|
}
|
|
356
362
|
}
|
|
357
|
-
|
|
363
|
+
handle_username_input(data) {
|
|
358
364
|
if (data === "\r" || data === "\n") {
|
|
359
365
|
this.terminal.write("\r\n");
|
|
360
|
-
this.
|
|
366
|
+
this.submit_username();
|
|
361
367
|
return;
|
|
362
368
|
}
|
|
363
369
|
if (data === "\u0003") {
|
|
@@ -377,7 +383,7 @@ export class PhirepassTerminal {
|
|
|
377
383
|
this.terminal.write(data);
|
|
378
384
|
}
|
|
379
385
|
}
|
|
380
|
-
|
|
386
|
+
submit_username() {
|
|
381
387
|
if (!this.channel.is_connected()) {
|
|
382
388
|
return;
|
|
383
389
|
}
|
|
@@ -391,10 +397,10 @@ export class PhirepassTerminal {
|
|
|
391
397
|
this.inputMode = InputMode.Default;
|
|
392
398
|
this.channel.open_ssh_tunnel(this.nodeId, username);
|
|
393
399
|
}
|
|
394
|
-
|
|
400
|
+
handle_password_input(data) {
|
|
395
401
|
if (data === "\r" || data === "\n") {
|
|
396
402
|
this.terminal.write("\r\n");
|
|
397
|
-
this.
|
|
403
|
+
this.submit_password();
|
|
398
404
|
return;
|
|
399
405
|
}
|
|
400
406
|
if (data === "\u0003") {
|
|
@@ -414,7 +420,7 @@ export class PhirepassTerminal {
|
|
|
414
420
|
this.terminal.write("*");
|
|
415
421
|
}
|
|
416
422
|
}
|
|
417
|
-
|
|
423
|
+
submit_password() {
|
|
418
424
|
if (!this.channel.is_connected()) {
|
|
419
425
|
return;
|
|
420
426
|
}
|
|
@@ -434,7 +440,7 @@ export class PhirepassTerminal {
|
|
|
434
440
|
this.usernameBuffer = "";
|
|
435
441
|
}
|
|
436
442
|
render() {
|
|
437
|
-
return (h(Host, { key: '
|
|
443
|
+
return (h(Host, { key: '69829da082f49d271442e4cc55d06498b57a36a4' }, h("div", { key: '20f52c1b6782607c6e28a540907ab00eb4ccb437', id: "ccc", ref: el => (this.containerEl = el) })));
|
|
438
444
|
}
|
|
439
445
|
static get is() { return "phirepass-terminal"; }
|
|
440
446
|
static get encapsulation() { return "shadow"; }
|
|
@@ -607,6 +613,29 @@ export class PhirepassTerminal {
|
|
|
607
613
|
}
|
|
608
614
|
};
|
|
609
615
|
}
|
|
616
|
+
static get events() {
|
|
617
|
+
return [{
|
|
618
|
+
"method": "connectionStateChanged",
|
|
619
|
+
"name": "connectionStateChanged",
|
|
620
|
+
"bubbles": true,
|
|
621
|
+
"cancelable": true,
|
|
622
|
+
"composed": true,
|
|
623
|
+
"docs": {
|
|
624
|
+
"tags": [],
|
|
625
|
+
"text": ""
|
|
626
|
+
},
|
|
627
|
+
"complexType": {
|
|
628
|
+
"original": "[ConnectionState, unknown?]",
|
|
629
|
+
"resolved": "[ConnectionState, unknown?]",
|
|
630
|
+
"references": {
|
|
631
|
+
"ConnectionState": {
|
|
632
|
+
"location": "global",
|
|
633
|
+
"id": "global::ConnectionState"
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
}];
|
|
638
|
+
}
|
|
610
639
|
static get elementRef() { return "el"; }
|
|
611
640
|
static get watchers() {
|
|
612
641
|
return [{
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t,e,n){const l="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==l;){const l=Object.getOwnPropertyDescriptor(t,e);if(l&&(!n||l.get))return l;t=Object.getPrototypeOf(t)}}var e,n=(e,n)=>{var l;Object.entries(null!=(l=n.l.t)?l:{}).map((([l,[o]])=>{if(31&o||32&o){const o=e[l],s=t(Object.getPrototypeOf(e),l,!0)||Object.getOwnPropertyDescriptor(e,l);s&&Object.defineProperty(e,l,{get(){return s.get.call(this)},set(t){s.set.call(this,t)},configurable:!0,enumerable:!0}),n.o.has(l)?e[l]=n.o.get(l):void 0!==o&&(e[l]=o)}}))},l=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},o=(t,e)=>(0,console.error)(t,e),s=new Map,i="undefined"!=typeof window?window:{},r=i.HTMLElement||class{},c={i:0,u:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,l)=>t.addEventListener(e,n,l),rel:(t,e,n,l)=>t.removeEventListener(e,n,l),ce:(t,e)=>new CustomEvent(t,e)},u=(()=>{try{return!!i.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),f=!!u&&(()=>!!i.document&&Object.getOwnPropertyDescriptor(i.document.adoptedStyleSheets,"length").writable)(),a=!1,d=[],h=[],p=(t,e)=>n=>{t.push(n),a||(a=!0,e&&4&c.i?$(y):c.raf(y))},m=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){o(t)}t.length=0},y=()=>{m(d),m(h),(a=d.length>0)&&c.raf(y)},$=t=>Promise.resolve(void 0).then(t),b=p(h,!0),v=t=>{const e=new URL(t,c.u);return e.origin!==i.location.origin?e.href:e.pathname},w=t=>c.u=t;function g(){const t=this.attachShadow({mode:"open"});void 0===e&&(e=null),e&&(f?t.adoptedStyleSheets.push(e):t.adoptedStyleSheets=[...t.adoptedStyleSheets,e])}var j,O=new WeakMap,S=t=>"sc-"+t.h,M=t=>"object"==(t=typeof t)||"function"===t,k=(t,e,...n)=>{let l=null,o=null,s=!1,i=!1;const r=[],c=e=>{for(let n=0;n<e.length;n++)l=e[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof t&&!M(l))&&(l+=""),s&&i?r[r.length-1].p+=l:r.push(s?E(null,l):l),i=s)};c(n),e&&e.key&&(o=e.key);const u=E(t,null);return u.m=e,r.length>0&&(u.$=r),u.v=o,u},E=(t,e)=>({i:0,j:t,p:null!=e?e:null,O:null,$:null,m:null,v:null}),A={},C=(t,e)=>null==t||M(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?"string"==typeof t?parseFloat(t):"number"==typeof t?t:NaN:1&e?t+"":t,L=(t,e,n,o,s,i)=>{if(n===o)return;let r=((t,e)=>e in t)(t,e);if(e.toLowerCase(),"key"===e);else if("ref"===e)o&&T(o,t);else{if("a"===e[0]&&e.startsWith("attr:")){const n=e.slice(5);let s;{const e=l(t);if(e&&e.l&&e.l.t){const t=e.l.t[n];t&&t[1]&&(s=t[1])}}return s||(s=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==o||!1===o?!1===o&&""!==t.getAttribute(s)||t.removeAttribute(s):t.setAttribute(s,!0===o?"":o))}if("p"===e[0]&&e.startsWith("prop:")){const n=e.slice(5);try{t[n]=o}catch(t){}return}{const l=M(o);if((r||l&&null!==o)&&!s)try{if(t.tagName.includes("-"))t[e]!==o&&(t[e]=o);else{const l=null==o?"":o;"list"===e?r=!1:null!=n&&t[e]===l||("function"==typeof t.__lookupSetter__(e)?t[e]=l:t.setAttribute(e,l))}}catch(t){}null==o||!1===o?!1===o&&""!==t.getAttribute(e)||t.removeAttribute(e):(!r||4&i||s)&&!l&&1===t.nodeType&&t.setAttribute(e,o=!0===o?"":o)}}},N=(t,e,n)=>{const l=11===e.O.nodeType&&e.O.host?e.O.host:e.O,o=t&&t.m||{},s=e.m||{};for(const t of _(Object.keys(o)))t in s||L(l,t,o[t],void 0,n,e.i);for(const t of _(Object.keys(s)))L(l,t,o[t],s[t],n,e.i)};function _(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var x=!1,D=!1,H=[],P=[],U=(t,e,n)=>{const l=e.$[n];let o,s,r=0;if(!i.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(o=l.O=i.document.createElement(l.j),N(null,l,D),l.$){const e="template"===l.j?o.content:o;for(r=0;r<l.$.length;++r)s=U(t,l,r),s&&e.appendChild(s)}return o["s-hn"]=j,o},R=(t,e,n,l,o,s)=>{let i,r=t;for(r.shadowRoot&&r.tagName===j&&(r=r.shadowRoot),"template"===n.j&&(r=r.content);o<=s;++o)l[o]&&(i=U(null,n,o),i&&(l[o].O=i,V(r,i,e)))},W=(t,e,n)=>{for(let l=e;l<=n;++l){const e=t[l];if(e){const t=e.O;z(e),t&&t.remove()}}},F=(t,e,n=!1)=>t.j===e.j&&(n?(n&&!t.v&&e.v&&(t.v=e.v),!0):t.v===e.v),q=(t,e,n=!1)=>{const l=e.O=t.O,o=t.$,s=e.$;"slot"!==e.j||x||t.S!==e.S&&(e.O["s-sn"]=e.S||"",(t=>{c.i|=1;const e=t.closest(j.toLowerCase());if(null!=e){const n=Array.from(e.__childNodes||e.childNodes).find((t=>t["s-cr"])),l=Array.from(t.__childNodes||t.childNodes);for(const t of n?l.reverse():l)null!=t["s-sh"]&&(V(e,t,null!=n?n:null),t["s-sh"]=void 0)}c.i&=-2})(e.O.parentElement)),N(t,e,D),null!==o&&null!==s?((t,e,n,l,o=!1)=>{let s,i,r=0,c=0,u=0,f=0,a=e.length-1,d=e[0],h=e[a],p=l.length-1,m=l[0],y=l[p];const $="template"===n.j?t.content:t;for(;r<=a&&c<=p;)if(null==d)d=e[++r];else if(null==h)h=e[--a];else if(null==m)m=l[++c];else if(null==y)y=l[--p];else if(F(d,m,o))q(d,m,o),d=e[++r],m=l[++c];else if(F(h,y,o))q(h,y,o),h=e[--a],y=l[--p];else if(F(d,y,o))q(d,y,o),V($,d.O,h.O.nextSibling),d=e[++r],y=l[--p];else if(F(h,m,o))q(h,m,o),V($,h.O,d.O),h=e[--a],m=l[++c];else{for(u=-1,f=r;f<=a;++f)if(e[f]&&null!==e[f].v&&e[f].v===m.v){u=f;break}u>=0?(i=e[u],i.j!==m.j?s=U(e&&e[c],n,u):(q(i,m,o),e[u]=void 0,s=i.O),m=l[++c]):(s=U(e&&e[c],n,c),m=l[++c]),s&&V(d.O.parentNode,s,d.O)}r>a?R(t,null==l[p+1]?null:l[p+1].O,n,l,c,p):c>p&&W(e,r,a)})(l,o,e,s,n):null!==s?R(l,null,e,s,0,s.length-1):!n&&null!==o&&W(o,0,o.length-1)},z=t=>{t.m&&t.m.ref&&H.push((()=>t.m.ref(null))),t.$&&t.$.map(z)},T=(t,e)=>{P.push((()=>t(e)))},V=(t,e,n)=>t.__insertBefore?t.__insertBefore(e,n):null==t?void 0:t.insertBefore(e,n),Y=(t,e,n=!1)=>{const l=t.$hostElement$,o=t.l,s=t.M||E(null,null),i=(t=>t&&t.j===A)(e)?e:k(null,null,e);if(j=l.tagName,n&&i.m)for(const t of Object.keys(i.m))l.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(i.m[t]=l[t]);i.j=null,i.i|=4,t.M=i,i.O=s.O=l.shadowRoot||l,x=!(!(1&o.i)||128&o.i),q(s,i,n),H.forEach((t=>t())),H.length=0,P.forEach((t=>t())),P.length=0},Z=(t,e)=>{if(e&&!t.k&&e["s-p"]){const n=e["s-p"].push(new Promise((l=>t.k=()=>{e["s-p"].splice(n-1,1),l()})))}},B=(t,e)=>{if(t.i|=16,4&t.i)return void(t.i|=512);Z(t,t.A);const n=()=>G(t,e);if(!e)return b(n);queueMicrotask((()=>{n()}))},G=(t,e)=>{const n=t.$hostElement$,l=n;if(!l)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let o;return o=et(l,e?"componentWillLoad":"componentWillUpdate",void 0,n),o=I(o,(()=>et(l,"componentWillRender",void 0,n))),I(o,(()=>K(t,l,e)))},I=(t,e)=>J(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),J=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,K=async(t,e,n)=>{var l;const o=t.$hostElement$,r=o["s-rc"];n&&(t=>{const e=t.l,n=t.$hostElement$,l=e.i,o=((t,e)=>{var n,l,o;const r=S(e),a=s.get(r);if(!i.document)return r;if(t=11===t.nodeType?t:i.document,a)if("string"==typeof a){let o,s=O.get(t=t.head||t);if(s||O.set(t,s=new Set),!s.has(r)){o=i.document.createElement("style"),o.textContent=a;const d=null!=(n=c.C)?n:function(){var t,e,n;return null!=(n=null==(e=null==(t=i.document.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:e.getAttribute("content"))?n:void 0}();if(null!=d&&o.setAttribute("nonce",d),!(1&e.i))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(o,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(u){const e=new(null!=(l=t.defaultView)?l:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(a),f?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.textContent=a+e.textContent:t.prepend(o)}else t.append(o);1&e.i&&t.insertBefore(o,null),4&e.i&&(o.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),s&&s.add(r)}}else{let e=O.get(t);if(e||O.set(t,e=new Set),!e.has(r)){const n=null!=(o=t.defaultView)?o:t.ownerDocument.defaultView;let l;if(a.constructor===n.CSSStyleSheet)l=a;else{l=new n.CSSStyleSheet;for(let t=0;t<a.cssRules.length;t++)l.insertRule(a.cssRules[t].cssText,t)}f?t.adoptedStyleSheets.push(l):t.adoptedStyleSheets=[...t.adoptedStyleSheets,l],e.add(r)}}return r})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(t);Q(t,e,o,n),r&&(r.map((t=>t())),o["s-rc"]=void 0);{const e=null!=(l=o["s-p"])?l:[],n=()=>X(t);0===e.length?n():(Promise.all(e).then(n).catch(n),t.i|=4,e.length=0)}},Q=(t,e,n,l)=>{try{e=e.render(),t.i&=-17,t.i|=2,Y(t,e,l)}catch(e){o(e,t.$hostElement$)}return null},X=t=>{const e=t.$hostElement$,n=e,l=t.A;et(n,"componentDidRender",void 0,e),64&t.i?et(n,"componentDidUpdate",void 0,e):(t.i|=64,nt(e),et(n,"componentDidLoad",void 0,e),t.L(e),l||tt()),t.k&&(t.k(),t.k=void 0),512&t.i&&$((()=>B(t,!1))),t.i&=-517},tt=()=>{$((()=>(t=>{const e=c.ce("appload",{detail:{namespace:"phirepass-widgets"}});return t.dispatchEvent(e),e})(i)))},et=(t,e,n,l)=>{if(t&&t[e])try{return t[e](n)}catch(t){o(t,l)}},nt=t=>t.classList.add("hydrated"),lt=(t,e,n,s)=>{const i=l(t);if(!i)return;const r=t,c=i.o.get(e),u=i.i,f=r;if(!((n=C(n,s.t[e][0]))===c||Number.isNaN(c)&&Number.isNaN(n))){if(i.o.set(e,n),s.N){const t=s.N[e];t&&t.map((t=>{try{const[[l,o]]=Object.entries(t);(128&u||1&o)&&(f?f[l](n,c,e):i._.push((()=>{i.D[l](n,c,e)})))}catch(t){o(t,r)}}))}if(2&u){if(f.componentShouldUpdate&&!1===f.componentShouldUpdate(n,c,e)&&!(16&u))return;16&u||B(i,!1)}}},ot=(e,n)=>{var o,s;const i=e.prototype;{e.watchers&&!n.N&&(n.N=e.watchers),e.deserializers&&!n.H&&(n.H=e.deserializers),e.serializers&&!n.P&&(n.P=e.serializers);const r=Object.entries(null!=(o=n.t)?o:{});r.map((([e,[o]])=>{if(31&o||32&o){const{get:s,set:r}=t(i,e)||{};s&&(n.t[e][0]|=2048),r&&(n.t[e][0]|=4096),Object.defineProperty(i,e,{get(){return s?s.apply(this):((t,e)=>l(this).o.get(e))(0,e)},configurable:!0,enumerable:!0}),Object.defineProperty(i,e,{set(t){const s=l(this);if(s){if(r)return void 0===(32&o?this[e]:s.$hostElement$[e])&&s.o.get(e)&&(t=s.o.get(e)),r.call(this,C(t,o)),void lt(this,e,t=32&o?this[e]:s.$hostElement$[e],n);lt(this,e,t,n)}}})}}));{const t=new Map;i.attributeChangedCallback=function(e,o,s){c.jmp((()=>{var c;const u=t.get(e),f=l(this);if(this.hasOwnProperty(u),i.hasOwnProperty(u)&&"number"==typeof this[u]&&this[u]==s)return;if(null==u){const t=null==f?void 0:f.i;if(f&&t&&!(8&t)&&s!==o){const l=this,i=null==(c=n.N)?void 0:c[e];null==i||i.forEach((n=>{const[[i,r]]=Object.entries(n);null!=l[i]&&(128&t||1&r)&&l[i].call(l,s,o,e)}))}return}const a=r.find((([t])=>t===u));a&&4&a[1][0]&&(s=null!==s&&"false"!==s);const d=Object.getOwnPropertyDescriptor(i,u);s==this[u]||d.get&&!d.set||(this[u]=s)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=n.N)?s:{}),...r.filter((([t,e])=>31&e[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))]))}}return e},st=(t,e)=>{const i={i:e[0],h:e[1]};try{i.t=e[2],i.N=t.N,i.H=t.H,i.P=t.P;const r=t.prototype.connectedCallback,f=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__hasHostListenerAttached:!1,__registerHost(){((t,e)=>{const l={i:0,$hostElement$:t,l:e,o:new Map,U:new Map};l.R=new Promise((t=>l.L=t)),t["s-p"]=[],t["s-rc"]=[];const o=l;t.__stencil__getHostRef=()=>o,512&e.i&&n(t,l)})(this,i)},connectedCallback(){if(!this.__hasHostListenerAttached){if(!l(this))return;this.__hasHostListenerAttached=!0}(t=>{if(!(1&c.i)){const e=l(t);if(!e)return;const n=e.l,i=()=>{};if(1&e.i)(null==e?void 0:e.D)||(null==e?void 0:e.R)&&e.R.then((()=>{}));else{e.i|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){Z(e,e.A=n);break}}n.t&&Object.entries(n.t).map((([e,[n]])=>{if(31&n&&Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let l;try{if(!(32&e.i)&&(e.i|=32,l=t.constructor,customElements.whenDefined(t.localName).then((()=>e.i|=128)),l&&l.style)){let t;"string"==typeof l.style&&(t=l.style);const e=S(n);if(!s.has(e)){const l=()=>{};((t,e,n)=>{let l=s.get(t);u&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=e:l.replaceSync(e)):l=e,s.set(t,l)})(e,t,!!(1&n.i)),l()}}const o=e.A,i=()=>B(e,!0);o&&o["s-rc"]?o["s-rc"].push(i):i()}catch(n){o(n,t),e.k&&(e.k(),e.k=void 0),e.L&&e.L(t)}})(t,e,n)}i()}})(this),r&&r.call(this)},disconnectedCallback(){(async t=>{O.has(t)&&O.delete(t),t.shadowRoot&&O.has(t.shadowRoot)&&O.delete(t.shadowRoot)})(this),f&&f.call(this)},__attachShadow(){if(this.shadowRoot){if("open"!==this.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${i.h}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else g.call(this,i)}}),Object.defineProperty(t,"is",{value:i.h,configurable:!0}),ot(t,i)}catch(e){return o(e),t}},it=t=>c.C=t,rt=t=>Object.assign(c,t);function ct(t,e){Y({l:{i:0,h:e.tagName},$hostElement$:e},t)}function ut(t){return t}export{r as H,A as a,v as getAssetPath,k as h,st as p,ct as render,w as setAssetPath,it as setNonce,rt as setPlatformOptions,ut as t}
|
|
1
|
+
function t(t,e,n){const l="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==l;){const l=Object.getOwnPropertyDescriptor(t,e);if(l&&(!n||l.get))return l;t=Object.getPrototypeOf(t)}}var e,n=(e,n)=>{var l;Object.entries(null!=(l=n.l.t)?l:{}).map((([l,[o]])=>{if(31&o||32&o){const o=e[l],s=t(Object.getPrototypeOf(e),l,!0)||Object.getOwnPropertyDescriptor(e,l);s&&Object.defineProperty(e,l,{get(){return s.get.call(this)},set(t){s.set.call(this,t)},configurable:!0,enumerable:!0}),n.o.has(l)?e[l]=n.o.get(l):void 0!==o&&(e[l]=o)}}))},l=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},o=(t,e)=>(0,console.error)(t,e),s=new Map,i="undefined"!=typeof window?window:{},r=i.HTMLElement||class{},c={i:0,u:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,l)=>t.addEventListener(e,n,l),rel:(t,e,n,l)=>t.removeEventListener(e,n,l),ce:(t,e)=>new CustomEvent(t,e)},u=(()=>{try{return!!i.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),f=!!u&&(()=>!!i.document&&Object.getOwnPropertyDescriptor(i.document.adoptedStyleSheets,"length").writable)(),a=!1,d=[],h=[],p=(t,e)=>n=>{t.push(n),a||(a=!0,e&&4&c.i?y(b):c.raf(b))},m=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){o(t)}t.length=0},b=()=>{m(d),m(h),(a=d.length>0)&&c.raf(b)},y=t=>Promise.resolve(void 0).then(t),$=p(h,!0),v=t=>{const e=new URL(t,c.u);return e.origin!==i.location.origin?e.href:e.pathname},w=t=>c.u=t;function g(){const t=this.attachShadow({mode:"open"});void 0===e&&(e=null),e&&(f?t.adoptedStyleSheets.push(e):t.adoptedStyleSheets=[...t.adoptedStyleSheets,e])}var j,O=new WeakMap,S=t=>"sc-"+t.h,M=t=>"object"==(t=typeof t)||"function"===t,k=(t,e,...n)=>{let l=null,o=null,s=!1,i=!1;const r=[],c=e=>{for(let n=0;n<e.length;n++)l=e[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof t&&!M(l))&&(l+=""),s&&i?r[r.length-1].p+=l:r.push(s?E(null,l):l),i=s)};c(n),e&&e.key&&(o=e.key);const u=E(t,null);return u.m=e,r.length>0&&(u.$=r),u.v=o,u},E=(t,e)=>({i:0,j:t,p:null!=e?e:null,O:null,$:null,m:null,v:null}),A={},C=(t,e)=>null==t||M(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?"string"==typeof t?parseFloat(t):"number"==typeof t?t:NaN:1&e?t+"":t,L=(t,e)=>{const n=t;return{emit:t=>N(n,e,{bubbles:!0,composed:!0,cancelable:!0,detail:t})}},N=(t,e,n)=>{const l=c.ce(e,n);return t.dispatchEvent(l),l},_=(t,e,n,o,s,i)=>{if(n===o)return;let r=((t,e)=>e in t)(t,e);if(e.toLowerCase(),"key"===e);else if("ref"===e)o&&Y(o,t);else{if("a"===e[0]&&e.startsWith("attr:")){const n=e.slice(5);let s;{const e=l(t);if(e&&e.l&&e.l.t){const t=e.l.t[n];t&&t[1]&&(s=t[1])}}return s||(s=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==o||!1===o?!1===o&&""!==t.getAttribute(s)||t.removeAttribute(s):t.setAttribute(s,!0===o?"":o))}if("p"===e[0]&&e.startsWith("prop:")){const n=e.slice(5);try{t[n]=o}catch(t){}return}{const l=M(o);if((r||l&&null!==o)&&!s)try{if(t.tagName.includes("-"))t[e]!==o&&(t[e]=o);else{const l=null==o?"":o;"list"===e?r=!1:null!=n&&t[e]===l||("function"==typeof t.__lookupSetter__(e)?t[e]=l:t.setAttribute(e,l))}}catch(t){}null==o||!1===o?!1===o&&""!==t.getAttribute(e)||t.removeAttribute(e):(!r||4&i||s)&&!l&&1===t.nodeType&&t.setAttribute(e,o=!0===o?"":o)}}},x=(t,e,n)=>{const l=11===e.O.nodeType&&e.O.host?e.O.host:e.O,o=t&&t.m||{},s=e.m||{};for(const t of D(Object.keys(o)))t in s||_(l,t,o[t],void 0,n,e.i);for(const t of D(Object.keys(s)))_(l,t,o[t],s[t],n,e.i)};function D(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var H=!1,P=!1,U=[],R=[],W=(t,e,n)=>{const l=e.$[n];let o,s,r=0;if(!i.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(o=l.O=i.document.createElement(l.j),x(null,l,P),l.$){const e="template"===l.j?o.content:o;for(r=0;r<l.$.length;++r)s=W(t,l,r),s&&e.appendChild(s)}return o["s-hn"]=j,o},F=(t,e,n,l,o,s)=>{let i,r=t;for(r.shadowRoot&&r.tagName===j&&(r=r.shadowRoot),"template"===n.j&&(r=r.content);o<=s;++o)l[o]&&(i=W(null,n,o),i&&(l[o].O=i,Z(r,i,e)))},q=(t,e,n)=>{for(let l=e;l<=n;++l){const e=t[l];if(e){const t=e.O;V(e),t&&t.remove()}}},z=(t,e,n=!1)=>t.j===e.j&&(n?(n&&!t.v&&e.v&&(t.v=e.v),!0):t.v===e.v),T=(t,e,n=!1)=>{const l=e.O=t.O,o=t.$,s=e.$;"slot"!==e.j||H||t.S!==e.S&&(e.O["s-sn"]=e.S||"",(t=>{c.i|=1;const e=t.closest(j.toLowerCase());if(null!=e){const n=Array.from(e.__childNodes||e.childNodes).find((t=>t["s-cr"])),l=Array.from(t.__childNodes||t.childNodes);for(const t of n?l.reverse():l)null!=t["s-sh"]&&(Z(e,t,null!=n?n:null),t["s-sh"]=void 0)}c.i&=-2})(e.O.parentElement)),x(t,e,P),null!==o&&null!==s?((t,e,n,l,o=!1)=>{let s,i,r=0,c=0,u=0,f=0,a=e.length-1,d=e[0],h=e[a],p=l.length-1,m=l[0],b=l[p];const y="template"===n.j?t.content:t;for(;r<=a&&c<=p;)if(null==d)d=e[++r];else if(null==h)h=e[--a];else if(null==m)m=l[++c];else if(null==b)b=l[--p];else if(z(d,m,o))T(d,m,o),d=e[++r],m=l[++c];else if(z(h,b,o))T(h,b,o),h=e[--a],b=l[--p];else if(z(d,b,o))T(d,b,o),Z(y,d.O,h.O.nextSibling),d=e[++r],b=l[--p];else if(z(h,m,o))T(h,m,o),Z(y,h.O,d.O),h=e[--a],m=l[++c];else{for(u=-1,f=r;f<=a;++f)if(e[f]&&null!==e[f].v&&e[f].v===m.v){u=f;break}u>=0?(i=e[u],i.j!==m.j?s=W(e&&e[c],n,u):(T(i,m,o),e[u]=void 0,s=i.O),m=l[++c]):(s=W(e&&e[c],n,c),m=l[++c]),s&&Z(d.O.parentNode,s,d.O)}r>a?F(t,null==l[p+1]?null:l[p+1].O,n,l,c,p):c>p&&q(e,r,a)})(l,o,e,s,n):null!==s?F(l,null,e,s,0,s.length-1):!n&&null!==o&&q(o,0,o.length-1)},V=t=>{t.m&&t.m.ref&&U.push((()=>t.m.ref(null))),t.$&&t.$.map(V)},Y=(t,e)=>{R.push((()=>t(e)))},Z=(t,e,n)=>t.__insertBefore?t.__insertBefore(e,n):null==t?void 0:t.insertBefore(e,n),B=(t,e,n=!1)=>{const l=t.$hostElement$,o=t.l,s=t.M||E(null,null),i=(t=>t&&t.j===A)(e)?e:k(null,null,e);if(j=l.tagName,n&&i.m)for(const t of Object.keys(i.m))l.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(i.m[t]=l[t]);i.j=null,i.i|=4,t.M=i,i.O=s.O=l.shadowRoot||l,H=!(!(1&o.i)||128&o.i),T(s,i,n),U.forEach((t=>t())),U.length=0,R.forEach((t=>t())),R.length=0},G=(t,e)=>{if(e&&!t.k&&e["s-p"]){const n=e["s-p"].push(new Promise((l=>t.k=()=>{e["s-p"].splice(n-1,1),l()})))}},I=(t,e)=>{if(t.i|=16,4&t.i)return void(t.i|=512);G(t,t.A);const n=()=>J(t,e);if(!e)return $(n);queueMicrotask((()=>{n()}))},J=(t,e)=>{const n=t.$hostElement$,l=n;if(!l)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let o;return o=lt(l,e?"componentWillLoad":"componentWillUpdate",void 0,n),o=K(o,(()=>lt(l,"componentWillRender",void 0,n))),K(o,(()=>X(t,l,e)))},K=(t,e)=>Q(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),Q=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,X=async(t,e,n)=>{var l;const o=t.$hostElement$,r=o["s-rc"];n&&(t=>{const e=t.l,n=t.$hostElement$,l=e.i,o=((t,e)=>{var n,l,o;const r=S(e),a=s.get(r);if(!i.document)return r;if(t=11===t.nodeType?t:i.document,a)if("string"==typeof a){let o,s=O.get(t=t.head||t);if(s||O.set(t,s=new Set),!s.has(r)){o=i.document.createElement("style"),o.textContent=a;const d=null!=(n=c.C)?n:function(){var t,e,n;return null!=(n=null==(e=null==(t=i.document.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:e.getAttribute("content"))?n:void 0}();if(null!=d&&o.setAttribute("nonce",d),!(1&e.i))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(o,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(u){const e=new(null!=(l=t.defaultView)?l:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(a),f?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.textContent=a+e.textContent:t.prepend(o)}else t.append(o);1&e.i&&t.insertBefore(o,null),4&e.i&&(o.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),s&&s.add(r)}}else{let e=O.get(t);if(e||O.set(t,e=new Set),!e.has(r)){const n=null!=(o=t.defaultView)?o:t.ownerDocument.defaultView;let l;if(a.constructor===n.CSSStyleSheet)l=a;else{l=new n.CSSStyleSheet;for(let t=0;t<a.cssRules.length;t++)l.insertRule(a.cssRules[t].cssText,t)}f?t.adoptedStyleSheets.push(l):t.adoptedStyleSheets=[...t.adoptedStyleSheets,l],e.add(r)}}return r})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(t);tt(t,e,o,n),r&&(r.map((t=>t())),o["s-rc"]=void 0);{const e=null!=(l=o["s-p"])?l:[],n=()=>et(t);0===e.length?n():(Promise.all(e).then(n).catch(n),t.i|=4,e.length=0)}},tt=(t,e,n,l)=>{try{e=e.render(),t.i&=-17,t.i|=2,B(t,e,l)}catch(e){o(e,t.$hostElement$)}return null},et=t=>{const e=t.$hostElement$,n=e,l=t.A;lt(n,"componentDidRender",void 0,e),64&t.i?lt(n,"componentDidUpdate",void 0,e):(t.i|=64,ot(e),lt(n,"componentDidLoad",void 0,e),t.L(e),l||nt()),t.k&&(t.k(),t.k=void 0),512&t.i&&y((()=>I(t,!1))),t.i&=-517},nt=()=>{y((()=>N(i,"appload",{detail:{namespace:"phirepass-widgets"}})))},lt=(t,e,n,l)=>{if(t&&t[e])try{return t[e](n)}catch(t){o(t,l)}},ot=t=>t.classList.add("hydrated"),st=(t,e,n,s)=>{const i=l(t);if(!i)return;const r=t,c=i.o.get(e),u=i.i,f=r;if(!((n=C(n,s.t[e][0]))===c||Number.isNaN(c)&&Number.isNaN(n))){if(i.o.set(e,n),s.N){const t=s.N[e];t&&t.map((t=>{try{const[[l,o]]=Object.entries(t);(128&u||1&o)&&(f?f[l](n,c,e):i._.push((()=>{i.D[l](n,c,e)})))}catch(t){o(t,r)}}))}if(2&u){if(f.componentShouldUpdate&&!1===f.componentShouldUpdate(n,c,e)&&!(16&u))return;16&u||I(i,!1)}}},it=(e,n)=>{var o,s;const i=e.prototype;{e.watchers&&!n.N&&(n.N=e.watchers),e.deserializers&&!n.H&&(n.H=e.deserializers),e.serializers&&!n.P&&(n.P=e.serializers);const r=Object.entries(null!=(o=n.t)?o:{});r.map((([e,[o]])=>{if(31&o||32&o){const{get:s,set:r}=t(i,e)||{};s&&(n.t[e][0]|=2048),r&&(n.t[e][0]|=4096),Object.defineProperty(i,e,{get(){return s?s.apply(this):((t,e)=>l(this).o.get(e))(0,e)},configurable:!0,enumerable:!0}),Object.defineProperty(i,e,{set(t){const s=l(this);if(s){if(r)return void 0===(32&o?this[e]:s.$hostElement$[e])&&s.o.get(e)&&(t=s.o.get(e)),r.call(this,C(t,o)),void st(this,e,t=32&o?this[e]:s.$hostElement$[e],n);st(this,e,t,n)}}})}}));{const t=new Map;i.attributeChangedCallback=function(e,o,s){c.jmp((()=>{var c;const u=t.get(e),f=l(this);if(this.hasOwnProperty(u),i.hasOwnProperty(u)&&"number"==typeof this[u]&&this[u]==s)return;if(null==u){const t=null==f?void 0:f.i;if(f&&t&&!(8&t)&&s!==o){const l=this,i=null==(c=n.N)?void 0:c[e];null==i||i.forEach((n=>{const[[i,r]]=Object.entries(n);null!=l[i]&&(128&t||1&r)&&l[i].call(l,s,o,e)}))}return}const a=r.find((([t])=>t===u));a&&4&a[1][0]&&(s=null!==s&&"false"!==s);const d=Object.getOwnPropertyDescriptor(i,u);s==this[u]||d.get&&!d.set||(this[u]=s)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=n.N)?s:{}),...r.filter((([t,e])=>31&e[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))]))}}return e},rt=(t,e)=>{const i={i:e[0],h:e[1]};try{i.t=e[2],i.N=t.N,i.H=t.H,i.P=t.P;const r=t.prototype.connectedCallback,f=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__hasHostListenerAttached:!1,__registerHost(){((t,e)=>{const l={i:0,$hostElement$:t,l:e,o:new Map,U:new Map};l.R=new Promise((t=>l.L=t)),t["s-p"]=[],t["s-rc"]=[];const o=l;t.__stencil__getHostRef=()=>o,512&e.i&&n(t,l)})(this,i)},connectedCallback(){if(!this.__hasHostListenerAttached){if(!l(this))return;this.__hasHostListenerAttached=!0}(t=>{if(!(1&c.i)){const e=l(t);if(!e)return;const n=e.l,i=()=>{};if(1&e.i)(null==e?void 0:e.D)||(null==e?void 0:e.R)&&e.R.then((()=>{}));else{e.i|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){G(e,e.A=n);break}}n.t&&Object.entries(n.t).map((([e,[n]])=>{if(31&n&&Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let l;try{if(!(32&e.i)&&(e.i|=32,l=t.constructor,customElements.whenDefined(t.localName).then((()=>e.i|=128)),l&&l.style)){let t;"string"==typeof l.style&&(t=l.style);const e=S(n);if(!s.has(e)){const l=()=>{};((t,e,n)=>{let l=s.get(t);u&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=e:l.replaceSync(e)):l=e,s.set(t,l)})(e,t,!!(1&n.i)),l()}}const o=e.A,i=()=>I(e,!0);o&&o["s-rc"]?o["s-rc"].push(i):i()}catch(n){o(n,t),e.k&&(e.k(),e.k=void 0),e.L&&e.L(t)}})(t,e,n)}i()}})(this),r&&r.call(this)},disconnectedCallback(){(async t=>{O.has(t)&&O.delete(t),t.shadowRoot&&O.has(t.shadowRoot)&&O.delete(t.shadowRoot)})(this),f&&f.call(this)},__attachShadow(){if(this.shadowRoot){if("open"!==this.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${i.h}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else g.call(this,i)}}),Object.defineProperty(t,"is",{value:i.h,configurable:!0}),it(t,i)}catch(e){return o(e),t}},ct=t=>c.C=t,ut=t=>Object.assign(c,t);function ft(t,e){B({l:{i:0,h:e.tagName},$hostElement$:e},t)}function at(t){return t}export{r as H,A as a,L as c,v as getAssetPath,k as h,rt as p,ft as render,w as setAssetPath,ct as setNonce,ut as setPlatformOptions,at as t}
|