phirepass-widgets 0.0.99 → 0.0.100
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-W8Ah6QS2.js → index-CbZdPuPQ.js} +3 -4
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/phirepass-rdp.cjs.entry.js +89 -10
- package/dist/cjs/phirepass-sftp-client.cjs.entry.js +2 -2
- package/dist/cjs/phirepass-terminal.cjs.entry.js +2 -2
- package/dist/cjs/phirepass-widgets.cjs.js +3 -3
- package/dist/cjs/{protocol-Da4CPy8u.js → protocol-B45sQiET.js} +9 -15
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/phirepass-rdp/phirepass-rdp.js +142 -9
- package/dist/collection/phirepass-channel_bg.wasm +0 -0
- package/dist/components/index.js +1 -1
- package/dist/components/p-DFhjP92A.js +1 -0
- package/dist/components/phirepass-rdp.js +1 -1
- package/dist/components/phirepass-sftp-client.js +1 -1
- package/dist/components/phirepass-terminal.js +1 -1
- package/dist/esm/{index-DRwCfim8.js → index-AP5XjS35.js} +3 -4
- package/dist/esm/loader.js +3 -3
- package/dist/esm/phirepass-rdp.entry.js +89 -10
- package/dist/esm/phirepass-sftp-client.entry.js +2 -2
- package/dist/esm/phirepass-terminal.entry.js +2 -2
- package/dist/esm/phirepass-widgets.js +4 -4
- package/dist/esm/{protocol-D0bkJ9BS.js → protocol-DFhjP92A.js} +8 -14
- package/dist/phirepass-widgets/{p-9d393c3d.entry.js → p-0e9afedb.entry.js} +1 -1
- package/dist/phirepass-widgets/{p-DRwCfim8.js → p-AP5XjS35.js} +1 -1
- package/dist/phirepass-widgets/p-DFhjP92A.js +1 -0
- package/dist/phirepass-widgets/{p-def42e4b.entry.js → p-c4a31b26.entry.js} +1 -1
- package/dist/phirepass-widgets/p-ee09d805.entry.js +1 -0
- package/dist/phirepass-widgets/phirepass-channel_bg.wasm +0 -0
- package/dist/phirepass-widgets/phirepass-widgets.esm.js +1 -1
- package/dist/types/components/phirepass-rdp/phirepass-rdp.d.ts +34 -3
- package/dist/types/components.d.ts +21 -2
- package/package.json +3 -3
- package/dist/components/p-D0bkJ9BS.js +0 -1
- package/dist/phirepass-widgets/p-D0bkJ9BS.js +0 -1
- package/dist/phirepass-widgets/p-c165bb58.entry.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, g as getElement, h, H as Host } from './index-
|
|
2
|
-
import { _ as __wbg_init, C as Channel, a as ConnectionState, P as ProtocolMessageType } from './protocol-
|
|
1
|
+
import { r as registerInstance, c as createEvent, g as getElement, h, H as Host } from './index-AP5XjS35.js';
|
|
2
|
+
import { _ as __wbg_init, C as Channel, a as ConnectionState, P as ProtocolMessageType } from './protocol-DFhjP92A.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* RDP's display-control PDU describes a monitor in whole, even pixels within
|
|
@@ -267,9 +267,11 @@ const PhirepassRdp = class {
|
|
|
267
267
|
* the widget is resized, so the desktop is rendered at native size rather
|
|
268
268
|
* than scaled.
|
|
269
269
|
*
|
|
270
|
-
*
|
|
271
|
-
*
|
|
272
|
-
*
|
|
270
|
+
* Turning this on is what registers the display-control extension, since
|
|
271
|
+
* the channel it opens is negotiated at connect time and never afterwards.
|
|
272
|
+
* The host still has the last word: one that does not offer the channel
|
|
273
|
+
* keeps the resolution it started with, which `scale` then fits into the
|
|
274
|
+
* widget, as before.
|
|
273
275
|
*/
|
|
274
276
|
dynamicResize = true;
|
|
275
277
|
/**
|
|
@@ -282,6 +284,16 @@ const PhirepassRdp = class {
|
|
|
282
284
|
* desktop has focus.
|
|
283
285
|
*/
|
|
284
286
|
captureKeyboard = true;
|
|
287
|
+
/**
|
|
288
|
+
* Share the clipboard with the remote host in both directions.
|
|
289
|
+
*
|
|
290
|
+
* On is the client's own default and needs nothing from us, so this exists
|
|
291
|
+
* to turn it **off**: a deployment that treats copy-out as exfiltration can
|
|
292
|
+
* take the clipboard away without giving up the session. Clipboard access
|
|
293
|
+
* additionally needs a secure context — over plain HTTP the browser refuses
|
|
294
|
+
* it whatever this says, and the client's warning is logged.
|
|
295
|
+
*/
|
|
296
|
+
clipboard = true;
|
|
285
297
|
onNodeIdChange(newValue, _oldValue) {
|
|
286
298
|
this.reset_session_state();
|
|
287
299
|
if (this.channel && this.channel.is_connected()) {
|
|
@@ -361,6 +373,39 @@ const PhirepassRdp = class {
|
|
|
361
373
|
async focusDesktop() {
|
|
362
374
|
this.focus_desktop();
|
|
363
375
|
}
|
|
376
|
+
/**
|
|
377
|
+
* Sends Ctrl+Alt+Del to the remote host.
|
|
378
|
+
*
|
|
379
|
+
* The host has to be told, because pressing it never reaches us: Ctrl+Alt+Del
|
|
380
|
+
* is a secure attention sequence the operating system takes before any
|
|
381
|
+
* browser sees it, and `captureKeyboard` cannot claim it either. Yet it is
|
|
382
|
+
* how a Windows session is unlocked and how the login screen is reached, so
|
|
383
|
+
* without this a locked desktop is a dead end.
|
|
384
|
+
*
|
|
385
|
+
* Answers whether it was sent — there is no session to send it to until the
|
|
386
|
+
* client has connected.
|
|
387
|
+
*/
|
|
388
|
+
async sendCtrlAltDel() {
|
|
389
|
+
if (!this.userInteraction) {
|
|
390
|
+
return false;
|
|
391
|
+
}
|
|
392
|
+
this.userInteraction.ctrlAltDel();
|
|
393
|
+
this.focus_desktop();
|
|
394
|
+
return true;
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Sends the Meta (Windows/Command) key to the remote host, which opens the
|
|
398
|
+
* Start menu. Outside fullscreen the browser and the desktop environment
|
|
399
|
+
* take this key first, so like Ctrl+Alt+Del it has to be sendable directly.
|
|
400
|
+
*/
|
|
401
|
+
async sendMetaKey() {
|
|
402
|
+
if (!this.userInteraction) {
|
|
403
|
+
return false;
|
|
404
|
+
}
|
|
405
|
+
this.userInteraction.metaKey();
|
|
406
|
+
this.focus_desktop();
|
|
407
|
+
return true;
|
|
408
|
+
}
|
|
364
409
|
try_connect() {
|
|
365
410
|
if (this.connected || !this.domReady || !this.runtimeReady) {
|
|
366
411
|
return;
|
|
@@ -482,9 +527,25 @@ const PhirepassRdp = class {
|
|
|
482
527
|
element.scale = this.scale;
|
|
483
528
|
element.flexcenter = true;
|
|
484
529
|
element.verbose = false;
|
|
530
|
+
// Extensions are how the client is configured, and neither
|
|
531
|
+
// `iron-remote-desktop` nor its RDP backend registers one on the app's
|
|
532
|
+
// behalf — both packages only expose the factories.
|
|
533
|
+
const extensions = [backend.enableCredssp(true)];
|
|
534
|
+
// The DisplayControl virtual channel is negotiated at connect time and
|
|
535
|
+
// never afterwards: it is how the client tells the host it can accept a
|
|
536
|
+
// resolution change at all. A client that did not ask for it fails
|
|
537
|
+
// every `resize()` with "Display Control Virtual Channel is not
|
|
538
|
+
// available", which reaches the widget as a host that silently refuses
|
|
539
|
+
// to resize — making the viewport sync, the initial desktop
|
|
540
|
+
// measurement and the `dynamicResize` prop all look like a host
|
|
541
|
+
// limitation. Asked for only when `dynamicResize` is on, so a caller
|
|
542
|
+
// that turned it off does not advertise a channel it will never use.
|
|
543
|
+
if (this.dynamicResize) {
|
|
544
|
+
extensions.push(backend.displayControl(true));
|
|
545
|
+
}
|
|
485
546
|
element.addEventListener('ready', (event) => {
|
|
486
547
|
const detail = event.detail;
|
|
487
|
-
void this.start_session(detail.irgUserInteraction, web.ticket,
|
|
548
|
+
void this.start_session(detail.irgUserInteraction, web.ticket, extensions);
|
|
488
549
|
});
|
|
489
550
|
this.ironEl = element;
|
|
490
551
|
this.mount_client(element);
|
|
@@ -505,16 +566,34 @@ const PhirepassRdp = class {
|
|
|
505
566
|
mount_client(element) {
|
|
506
567
|
this.el.appendChild(element);
|
|
507
568
|
}
|
|
508
|
-
async start_session(userInteraction, ticket,
|
|
569
|
+
async start_session(userInteraction, ticket, extensions) {
|
|
509
570
|
this.userInteraction = userInteraction;
|
|
571
|
+
// Both clipboard switches are on by default inside the client, and its
|
|
572
|
+
// element wires the browser side up on its own — so this only ever
|
|
573
|
+
// turns the clipboard off. It has to happen before `connect`, because
|
|
574
|
+
// that is when the client decides whether to register the clipboard
|
|
575
|
+
// callbacks with its backend at all.
|
|
576
|
+
if (!this.clipboard) {
|
|
577
|
+
userInteraction.setEnableClipboard(false);
|
|
578
|
+
}
|
|
579
|
+
// Clipboard problems are reported this way and no other: an insecure
|
|
580
|
+
// context, a browser too old for the async clipboard API, a read the
|
|
581
|
+
// user never granted. Without a callback the client's own warning is
|
|
582
|
+
// dropped, and a clipboard that does nothing looks identical to one
|
|
583
|
+
// that was never asked for.
|
|
584
|
+
userInteraction.onWarningCallback((warning) => {
|
|
585
|
+
console.warn('The remote desktop client reported a problem:', warning);
|
|
586
|
+
});
|
|
510
587
|
const builder = userInteraction
|
|
511
588
|
.configBuilder()
|
|
512
589
|
.withUsername(this.credentials?.username ?? '')
|
|
513
590
|
.withPassword(this.credentials?.password ?? '')
|
|
514
591
|
.withDestination(this.destination ?? this.nodeId)
|
|
515
592
|
.withProxyAddress(`${this.create_web_socket_endpoint()}/api/web/rdp/${this.nodeId}`)
|
|
516
|
-
.withAuthToken(ticket)
|
|
517
|
-
|
|
593
|
+
.withAuthToken(ticket);
|
|
594
|
+
for (const extension of extensions) {
|
|
595
|
+
builder.withExtension(extension);
|
|
596
|
+
}
|
|
518
597
|
// Asking for the widget's size up front saves the remote host a
|
|
519
598
|
// resolution change immediately after logon — but only when the widget
|
|
520
599
|
// has been laid out. An unmeasurable widget asks for nothing and lets
|
|
@@ -651,7 +730,7 @@ const PhirepassRdp = class {
|
|
|
651
730
|
this.request_tunnel();
|
|
652
731
|
}
|
|
653
732
|
render() {
|
|
654
|
-
return (h(Host, { key: '
|
|
733
|
+
return (h(Host, { key: '9eb8ba7d53d4c9489df71a9da5bae59f348b3d8a' }, h("div", { key: '2172cf49625768c585cb5a976f5164d0348e8426', class: "screen", ref: (el) => (this.containerEl = el) }, h("slot", { key: '46f7cffae68155552bb5262c94d8fa308dbcb5df' })), this.credentialsPrompt && (h("form", { key: '02da607149cf5d444389888bc4dc1422f7ed44bd', class: "prompt", onSubmit: (event) => this.submit_credentials(event) }, h("label", { key: '5e560dd128da72280e0711c545335ec3624a7934', htmlFor: "rdp-username" }, "Username"), h("input", { key: '3969f84697c0112cb3a7eeab0a2f8238cff7cff5', id: "rdp-username", type: "text", autocomplete: "off", autofocus: true, onInput: (event) => (this.usernameBuffer = event.target.value) }), h("label", { key: 'fec51856a4523c8713938cee20b0e0025ff32795', htmlFor: "rdp-password" }, "Password"), h("input", { key: 'e4dff2271b1eb7576bff701540f2566d0bbb897d', id: "rdp-password", type: "password", autocomplete: "off", onInput: (event) => (this.passwordBuffer = event.target.value) }), h("button", { key: 'b59d8a69c27e065831d815c9f5a7c8a3432594f6', type: "submit" }, "Connect"))), this.statusMessage && !this.credentialsPrompt && (h("div", { key: '7439841369456b3d057a3c389cabeca6affa6f98', class: "status" }, this.statusMessage))));
|
|
655
734
|
}
|
|
656
735
|
static get watchers() { return {
|
|
657
736
|
"nodeId": [{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-
|
|
2
|
-
import { _ as __wbg_init, E as ErrorType, C as Channel, a as ConnectionState, P as ProtocolMessageType } from './protocol-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-AP5XjS35.js';
|
|
2
|
+
import { _ as __wbg_init, E as ErrorType, C as Channel, a as ConnectionState, P as ProtocolMessageType } from './protocol-DFhjP92A.js';
|
|
3
3
|
|
|
4
4
|
const phirepassSftpClientLogoSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoNDYsIDE4NCwgMTM4KSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgICBjbGFzcz0ibHVjaWRlIGx1Y2lkZS10ZXJtaW5hbCB3LTMuNSBoLTMuNSB0ZXh0LXByaW1hcnkiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iNCAxNyAxMCAxMSA0IDUiPjwvcG9seWxpbmU+CiAgICA8bGluZSB4MT0iMTIiIHgyPSIyMCIgeTE9IjE5IiB5Mj0iMTkiPjwvbGluZT4KPC9zdmc+Cg==';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, g as getElement, h as h$1, H as Host } from './index-
|
|
2
|
-
import { I as InputMode, _ as __wbg_init, C as Channel, a as ConnectionState, P as ProtocolMessageType, E as ErrorType } from './protocol-
|
|
1
|
+
import { r as registerInstance, c as createEvent, g as getElement, h as h$1, H as Host } from './index-AP5XjS35.js';
|
|
2
|
+
import { I as InputMode, _ as __wbg_init, C as Channel, a as ConnectionState, P as ProtocolMessageType, E as ErrorType } from './protocol-DFhjP92A.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-AP5XjS35.js';
|
|
2
|
+
export { s as setNonce } from './index-AP5XjS35.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-DQuL1Twl.js';
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
|
-
Stencil Client Patch Browser v4.44.
|
|
6
|
+
Stencil Client Patch Browser v4.44.2 | MIT Licensed | https://stenciljs.com
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
var patchBrowser = () => {
|
|
@@ -17,5 +17,5 @@ var patchBrowser = () => {
|
|
|
17
17
|
|
|
18
18
|
patchBrowser().then(async (options) => {
|
|
19
19
|
await globalScripts();
|
|
20
|
-
return bootstrapLazy([["phirepass-rdp",[[769,"phirepass-rdp",{"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"username":[1],"password":[1],"destination":[1],"scale":[1],"dynamicResize":[4,"dynamic-resize"],"captureKeyboard":[4,"capture-keyboard"],"serverId":[1,"server-id"],"credentialsPrompt":[32],"statusMessage":[32],"toggleFullscreen":[64],"keyboardLockSupported":[64],"focusDesktop":[64]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-sftp-client",[[513,"phirepass-sftp-client",{"name":[1],"description":[1],"hideHeader":[4,"hide-header"],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"serverId":[1,"server-id"],"max":[32],"show_login_screen":[32],"show_login_screen_username":[32],"show_error":[32],"error_message":[32],"show_login_screen_password":[32],"show_navigation":[32],"breadcrumbs":[32],"current_dir":[32],"listing":[32],"show_content":[32],"show_loader":[32],"version":[32],"status":[32],"selected_item":[32],"show_upload_modal":[32],"upload_progress":[32],"upload_file_name":[32],"upload_speed":[32],"upload_finished":[32],"show_download_modal":[32],"download_progress":[32],"download_file_name":[32],"download_speed":[32],"download_finished":[32],"show_delete_modal":[32],"delete_file_name":[32],"delete_loading":[32],"maximize":[64],"minimize":[64]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-terminal",[[513,"phirepass-terminal",{"terminalOptions":[16],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"serverId":[1,"server-id"]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]]], options);
|
|
20
|
+
return bootstrapLazy([["phirepass-rdp",[[769,"phirepass-rdp",{"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"username":[1],"password":[1],"destination":[1],"scale":[1],"dynamicResize":[4,"dynamic-resize"],"captureKeyboard":[4,"capture-keyboard"],"clipboard":[4],"serverId":[1,"server-id"],"credentialsPrompt":[32],"statusMessage":[32],"toggleFullscreen":[64],"keyboardLockSupported":[64],"focusDesktop":[64],"sendCtrlAltDel":[64],"sendMetaKey":[64]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-sftp-client",[[513,"phirepass-sftp-client",{"name":[1],"description":[1],"hideHeader":[4,"hide-header"],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"serverId":[1,"server-id"],"max":[32],"show_login_screen":[32],"show_login_screen_username":[32],"show_error":[32],"error_message":[32],"show_login_screen_password":[32],"show_navigation":[32],"breadcrumbs":[32],"current_dir":[32],"listing":[32],"show_content":[32],"show_loader":[32],"version":[32],"status":[32],"selected_item":[32],"show_upload_modal":[32],"upload_progress":[32],"upload_file_name":[32],"upload_speed":[32],"upload_finished":[32],"show_download_modal":[32],"download_progress":[32],"download_file_name":[32],"download_speed":[32],"download_finished":[32],"show_delete_modal":[32],"delete_file_name":[32],"delete_loading":[32],"maximize":[64],"minimize":[64]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-terminal",[[513,"phirepass-terminal",{"terminalOptions":[16],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"serverId":[1,"server-id"]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]]], options);
|
|
21
21
|
});
|
|
@@ -34,11 +34,10 @@ class Channel {
|
|
|
34
34
|
* @param {number} port
|
|
35
35
|
* @param {string | null} [username]
|
|
36
36
|
* @param {string | null} [password]
|
|
37
|
-
* @param {string | null} [visibility]
|
|
38
37
|
* @param {string | null} [scheme]
|
|
39
38
|
* @param {number | null} [msg_id]
|
|
40
39
|
*/
|
|
41
|
-
create_service(node_id, kind, name, host, port, username, password,
|
|
40
|
+
create_service(node_id, kind, name, host, port, username, password, scheme, msg_id) {
|
|
42
41
|
const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
43
42
|
const len0 = WASM_VECTOR_LEN;
|
|
44
43
|
const ptr1 = passStringToWasm0(kind, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -51,11 +50,9 @@ class Channel {
|
|
|
51
50
|
var len4 = WASM_VECTOR_LEN;
|
|
52
51
|
var ptr5 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
53
52
|
var len5 = WASM_VECTOR_LEN;
|
|
54
|
-
var ptr6 = isLikeNone(
|
|
53
|
+
var ptr6 = isLikeNone(scheme) ? 0 : passStringToWasm0(scheme, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
55
54
|
var len6 = WASM_VECTOR_LEN;
|
|
56
|
-
|
|
57
|
-
var len7 = WASM_VECTOR_LEN;
|
|
58
|
-
wasm.channel_create_service(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, port, ptr4, len4, ptr5, len5, ptr6, len6, ptr7, len7, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
55
|
+
wasm.channel_create_service(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, port, ptr4, len4, ptr5, len5, ptr6, len6, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
59
56
|
}
|
|
60
57
|
/**
|
|
61
58
|
* @param {string} node_id
|
|
@@ -353,11 +350,10 @@ class Channel {
|
|
|
353
350
|
* @param {number} port
|
|
354
351
|
* @param {string | null} [username]
|
|
355
352
|
* @param {string | null} [password]
|
|
356
|
-
* @param {string | null} [visibility]
|
|
357
353
|
* @param {string | null} [scheme]
|
|
358
354
|
* @param {number | null} [msg_id]
|
|
359
355
|
*/
|
|
360
|
-
update_service(node_id, service_id, kind, name, host, port, username, password,
|
|
356
|
+
update_service(node_id, service_id, kind, name, host, port, username, password, scheme, msg_id) {
|
|
361
357
|
const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
362
358
|
const len0 = WASM_VECTOR_LEN;
|
|
363
359
|
const ptr1 = passStringToWasm0(service_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -372,11 +368,9 @@ class Channel {
|
|
|
372
368
|
var len5 = WASM_VECTOR_LEN;
|
|
373
369
|
var ptr6 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
374
370
|
var len6 = WASM_VECTOR_LEN;
|
|
375
|
-
var ptr7 = isLikeNone(
|
|
371
|
+
var ptr7 = isLikeNone(scheme) ? 0 : passStringToWasm0(scheme, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
376
372
|
var len7 = WASM_VECTOR_LEN;
|
|
377
|
-
|
|
378
|
-
var len8 = WASM_VECTOR_LEN;
|
|
379
|
-
wasm.channel_update_service(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, port, ptr5, len5, ptr6, len6, ptr7, len7, ptr8, len8, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
373
|
+
wasm.channel_update_service(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, port, ptr5, len5, ptr6, len6, ptr7, len7, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
380
374
|
}
|
|
381
375
|
}
|
|
382
376
|
if (Symbol.dispose) Channel.prototype[Symbol.dispose] = Channel.prototype.free;
|
|
@@ -460,7 +454,7 @@ function __wbg_get_imports() {
|
|
|
460
454
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
461
455
|
return addHeapObject(ret);
|
|
462
456
|
}, arguments); },
|
|
463
|
-
|
|
457
|
+
__wbg_info_c401af4c728dfc5d: function(arg0, arg1) {
|
|
464
458
|
console.info(getStringFromWasm0(arg0, arg1));
|
|
465
459
|
},
|
|
466
460
|
__wbg_instanceof_ArrayBuffer_993d02d2d254cad1: function(arg0) {
|
|
@@ -532,7 +526,7 @@ function __wbg_get_imports() {
|
|
|
532
526
|
__wbg_set_onopen_b28699f3431204cf: function(arg0, arg1) {
|
|
533
527
|
getObject(arg0).onopen = getObject(arg1);
|
|
534
528
|
},
|
|
535
|
-
|
|
529
|
+
__wbg_warn_68977fa8f7b50381: function(arg0, arg1) {
|
|
536
530
|
console.warn(getStringFromWasm0(arg0, arg1));
|
|
537
531
|
},
|
|
538
532
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as i,H as s}from"./p-DRwCfim8.js";import{_ as a,E as o,C as r,a as d,P as n}from"./p-D0bkJ9BS.js";const c=class{constructor(i){e(this,i),this.maximizeEvent=t(this,"maximize"),this.connectionStateChanged=t(this,"connectionStateChanged")}channel;domReady=!1;runtimeReady=!1;connected=!1;uploadInputEl;deleteLoadingTimeout;msgId=1;activeUploadToken=0;pendingUploadStarts=new Map;pendingUploadAcks=new Map;pendingDownloadStarts=new Map;activeDownloads=new Map;activeDownloadMsgId;pendingDelete;session_id;name="SFTP";description="Client";hideHeader=!1;serverHost="phirepass.com";serverPort=443;allowInsecure=!1;heartbeatInterval=3e4;nodeId;serviceId;token;onNodeIdChange(e,t){this.reset_session_state(),this.channel&&this.channel.is_connected()&&this.close_comms(),e&&(this.open_comms(),this.channel.connect(),this.status="Connecting...")}serverId;onServerIdChange(e,t){this.onNodeIdChange(this.nodeId,this.nodeId)}maximizeEvent;async maximize(){this.max=!this.max}async minimize(){this.max=!1}connectionStateChanged;max=!1;show_login_screen=!1;show_login_screen_username=!1;show_error=!1;error_message="";show_login_screen_password=!1;show_navigation=!1;breadcrumbs=[];current_dir=".";listing=[];show_content=!1;show_loader=!1;version="";status="Disconnected";selected_item=null;show_upload_modal=!1;upload_progress=0;upload_file_name="";upload_speed="--";upload_finished=!1;show_download_modal=!1;download_progress=0;download_file_name="";download_speed="--";download_finished=!1;show_delete_modal=!1;delete_file_name="";delete_loading=!1;toggle_max(){this.maximizeEvent?.emit(!this.max)}async connectedCallback(){await a(),this.open_comms(),this.runtimeReady=!0,this.nodeId?this.try_connect():console.warn("Prop node_id is not set. Cannot connect to terminal.")}componentDidLoad(){this.domReady=!0,this.try_connect()}async disconnectedCallback(){this.connected=!1,this.domReady=!1,this.runtimeReady=!1,this.cancel_active_upload(),this.cancel_active_download(),this.clear_pending_operations(),this.clear_delete_loading_timeout(),this.close_comms()}clear_delete_loading_timeout(){void 0!==this.deleteLoadingTimeout&&(window.clearTimeout(this.deleteLoadingTimeout),this.deleteLoadingTimeout=void 0)}next_msg_id(){const e=this.msgId;return this.msgId+=1,e}clear_pending_operations(){this.pendingUploadStarts.forEach((e=>{window.clearTimeout(e.timeout),e.reject(new Error("Upload start aborted"))})),this.pendingUploadStarts.clear(),this.pendingUploadAcks.forEach((e=>{window.clearTimeout(e.timeout),e.reject(new Error("Upload chunk aborted"))})),this.pendingUploadAcks.clear(),this.pendingDownloadStarts.forEach((e=>{window.clearTimeout(e.timeout),e.reject(new Error("Download start aborted"))})),this.pendingDownloadStarts.clear(),this.stop_delete_polling(),this.activeDownloads.clear()}stop_delete_polling(){void 0!==this.pendingDelete?.interval&&window.clearInterval(this.pendingDelete.interval),this.pendingDelete=void 0}cancel_active_upload(){this.activeUploadToken+=1,this.upload_progress=0,this.upload_finished=!1,this.upload_speed="--"}cancel_active_download(){void 0!==this.activeDownloadMsgId&&this.activeDownloads.delete(this.activeDownloadMsgId),this.activeDownloadMsgId=void 0,this.download_progress=0,this.download_finished=!1,this.download_speed="--"}format_duration(e){if(!Number.isFinite(e)||e<0)return"--";if(e<60)return`${e.toFixed(0)}s`;const t=Math.floor(e/60),i=Math.floor(e%60);return t<60?`${t}m ${i}s`:`${Math.floor(t/60)}h ${t%60}m`}format_percent(e){return`${(Number.isFinite(e)?e:0).toFixed(2)}%`}format_transfer_rate(e){return!Number.isFinite(e)||e<=0?"--":`${this.format_size(e)}/s`}update_upload_progress(e,t,i){if(this.upload_progress=Math.max(0,Math.min(100,t>0?e/t*100:0)),e>=t)return this.upload_finished=!0,void(this.upload_speed="--");const s=(performance.now()-i)/1e3,a=s>0?e/s:0;this.upload_speed=this.format_transfer_rate(a);const o=a>0?(t-e)/a:NaN;this.status=`Uploading ${this.format_size(e)} / ${this.format_size(t)} (ETA ${this.format_duration(o)})`}update_download_progress(e,t,i){if(this.download_progress=Math.max(0,Math.min(100,t>0?e/t*100:0)),e>=t)return this.download_finished=!0,void(this.download_speed="--");const s=(Date.now()-i)/1e3,a=s>0?e/s:0;this.download_speed=this.format_transfer_rate(a);const o=a>0?(t-e)/a:NaN;this.status=`Downloading ${this.format_size(e)} / ${this.format_size(t)} (ETA ${this.format_duration(o)})`}connect(){this.connected=!0,this.channel.connect(),this.status="Connecting..."}try_connect(){!this.connected&&this.domReady&&this.runtimeReady&&this.channel&&this.connect()}create_web_socket_endpoint(){const e=this.allowInsecure?"ws":"wss";return this.allowInsecure||443!==this.serverPort?this.allowInsecure&&80===this.serverPort?`${e}://${this.serverHost}`:`${e}://${this.serverHost}:${this.serverPort}`:`${e}://${this.serverHost}`}handle_error(e){if(void 0!==e.msg_id){const t=this.pendingUploadStarts.get(e.msg_id);t&&(window.clearTimeout(t.timeout),t.reject(new Error(e.message||"Upload start failed")),this.pendingUploadStarts.delete(e.msg_id));const i=this.pendingDownloadStarts.get(e.msg_id);i&&(window.clearTimeout(i.timeout),i.reject(new Error(e.message||"Download start failed")),this.pendingDownloadStarts.delete(e.msg_id)),this.activeDownloads.has(e.msg_id)&&(this.activeDownloads.delete(e.msg_id),this.activeDownloadMsgId===e.msg_id&&(this.activeDownloadMsgId=void 0),this.download_finished=!1),this.pendingDelete?.msgId===e.msg_id&&(this.stop_delete_polling(),this.delete_loading=!1,this.show_delete_modal=!1,this.status="Connected")}switch(e.kind){case o.Generic:case o.Authentication:this.error_message=e.message||"An unknown error occurred.",this.show_error=!0;break;case o.RequiresUsername:this.show_login_screen_username=!0,this.show_login_screen_password=!1,this.show_login_screen=!0;break;case o.RequiresPassword:this.show_login_screen_username=!1,this.show_login_screen_password=!0,this.show_login_screen=!0;break;case o.RequiresUsernamePassword:this.show_login_screen_username=!0,this.show_login_screen_password=!0,this.show_login_screen=!0}setTimeout((()=>{this.show_loader=!1}),1e3)}handle_auth_success(e){this.clear_creds_buffer(),this.version=e.version,this.channel.start_heartbeat(this.heartbeatInterval<=15e3?3e4:this.heartbeatInterval),this.channel.open_sftp_tunnel(this.nodeId,this.serviceId),this.status="Connected"}handle_tunnel_opened(e){this.session_id=e.sid,this.channel.send_sftp_list_data(this.nodeId,this.session_id,this.current_dir)}handle_sftp_list_items(e){setTimeout((()=>{this.show_loader=!1}),500),this.listing=e.dir.items,this.current_dir=e.path,this.breadcrumbs=e.path.split("/").map(((e,t,i)=>""===e&&0===t?{label:"/",path:"/"}:{label:e,path:i.slice(0,t+1).join("/")})),this.show_content=!0,this.show_navigation=!0,this.pendingDelete&&e.path===this.current_dir&&(e.dir.items.some((e=>"File"===e.kind&&e.name===this.pendingDelete?.filename))||(this.stop_delete_polling(),this.delete_loading=!1,this.show_delete_modal=!1,this.delete_file_name="",this.status="Connected")),console.log("Received SFTP list items:",e)}handle_upload_start_response(e){if(void 0===e.msg_id)return;const t=this.pendingUploadStarts.get(e.msg_id);t&&(window.clearTimeout(t.timeout),t.resolve(e.response.upload_id),this.pendingUploadStarts.delete(e.msg_id))}handle_upload_chunk_ack(e){const t=`${e.upload_id}_${e.chunk_index}`,i=this.pendingUploadAcks.get(t);i&&(window.clearTimeout(i.timeout),i.resolve(),this.pendingUploadAcks.delete(t))}handle_download_start_response(e){if(void 0===e.msg_id)return;const t=this.pendingDownloadStarts.get(e.msg_id);t&&(window.clearTimeout(t.timeout),t.resolve({download_id:e.response.download_id,total_size:e.response.total_size,total_chunks:e.response.total_chunks}),this.pendingDownloadStarts.delete(e.msg_id))}finalize_download(e){const t=this.activeDownloads.get(e);if(!t)return;const i=Array.from(t.chunks.entries()).sort(((e,t)=>e[0]-t[0])).map((([,e])=>e)).map((e=>new Uint8Array(e))),s=new Blob(i,{type:"application/octet-stream"}),a=URL.createObjectURL(s),o=document.createElement("a");o.href=a,o.download=t.filename,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a),this.activeDownloads.delete(e),this.activeDownloadMsgId===e&&(this.activeDownloadMsgId=void 0),this.download_finished=!0,this.status="Connected"}handle_download_chunk(e){if(void 0===e.msg_id)return;const t=this.activeDownloads.get(e.msg_id);if(!t||!this.session_id)return;const i=new Uint8Array(e.chunk.data);t.chunks.set(e.chunk.chunk_index,i);const s=Array.from(t.chunks.values()).reduce(((e,t)=>e+t.length),0);this.update_download_progress(s,t.total_size,t.startTime),this.channel.send_sftp_download_ack(this.nodeId,this.session_id,t.download_id,e.chunk.chunk_index),t.chunks.size>=t.total_chunks&&this.finalize_download(e.msg_id)}async start_download(e){if(!this.session_id)return;this.selected_item=e,this.download_file_name=e.name,this.download_progress=0,this.download_finished=!1,this.download_speed="--",this.show_download_modal=!0,this.show_error=!1;const t=this.next_msg_id();this.activeDownloadMsgId=t,this.activeDownloads.set(t,{filename:e.name,chunks:new Map,total_chunks:0,total_size:0,download_id:0,startTime:Date.now()});const i=new Promise(((e,i)=>{const s=window.setTimeout((()=>{this.pendingDownloadStarts.delete(t),i(new Error("Download start timeout"))}),1e4);this.pendingDownloadStarts.set(t,{timeout:s,resolve:e,reject:i})}));try{this.channel.send_sftp_download_start(this.nodeId,this.session_id,e.path,e.name,t);const{download_id:s,total_chunks:a,total_size:o}=await i,r=this.activeDownloads.get(t);if(!r)return;r.download_id=s,r.total_chunks=a,r.total_size=o}catch(e){this.activeDownloads.delete(t),this.activeDownloadMsgId===t&&(this.activeDownloadMsgId=void 0),this.show_error=!0,this.error_message=e instanceof Error?e.message:"Failed to start download",this.cancel_download()}}async upload_file(e){if(!this.session_id)return;const t=this.activeUploadToken+1;this.activeUploadToken=t,this.upload_file_name=e.name,this.upload_progress=0,this.upload_finished=!1,this.upload_speed="--",this.show_upload_modal=!0,this.show_error=!1,this.status="Uploading...";const i=65536,s=Math.max(1,Math.ceil(e.size/i)),a=this.next_msg_id(),o=new Promise(((e,t)=>{const i=window.setTimeout((()=>{this.pendingUploadStarts.delete(a),t(new Error("Upload start timeout"))}),1e4);this.pendingUploadStarts.set(a,{timeout:i,resolve:e,reject:t})}));try{this.channel.send_sftp_upload_start(this.nodeId,this.session_id,e.name,this.current_dir,s,BigInt(e.size),a);const r=await o;let d=0;const n=performance.now();for(let a=0;a<s;a+=1){if(t!==this.activeUploadToken)throw new Error("Upload cancelled");const s=a*i,o=Math.min(s+i,e.size),c=new Uint8Array(await e.slice(s,o).arrayBuffer());await new Promise(((e,t)=>{const i=`${r}_${a}`,s=window.setTimeout((()=>{this.pendingUploadAcks.delete(i),t(new Error(`Upload chunk ${a+1} timed out`))}),3e4);this.pendingUploadAcks.set(i,{timeout:s,resolve:e,reject:t}),this.channel.send_sftp_upload_chunk(this.nodeId,this.session_id,r,a,c.length,c,null)})),d+=c.length,this.update_upload_progress(d,e.size,n)}this.upload_progress=100,this.upload_finished=!0,this.status="Connected",this.refresh_directory()}catch(e){"Upload cancelled"!==e.message&&(this.show_error=!0,this.error_message=e instanceof Error?e.message:"Upload failed"),this.upload_finished=!1,this.status="Connected"}}handle_tunnel_data(e){console.log("received tunnel data:",e)}handle_tunnel_closed(e){this.clear_creds_buffer(),this.close_comms()}open_comms(){this.channel=this.serverId?new r(`${this.create_web_socket_endpoint()}/api/web/ws`,this.nodeId,this.serverId):new r(`${this.create_web_socket_endpoint()}/api/web/ws`,this.nodeId),this.channel.on_connection_open((()=>{this.connectionStateChanged.emit([d.Connected]),this.channel.authenticate(this.token,this.nodeId),this.status="Authenticating..."})),this.channel.on_connection_close((()=>{this.connectionStateChanged.emit([d.Disconnected]),this.status="Disconnected"})),this.channel.on_connection_error((e=>{this.connectionStateChanged.emit([d.Error,e]),this.status="Error "+e.message})),this.channel.on_connection_message((()=>{})),this.channel.on_protocol_message((e=>{const{web:t}=e.data;switch(t.type){case n.Error:this.handle_error(t);break;case n.AuthSuccess:this.handle_auth_success(t);break;case n.TunnelOpened:this.handle_tunnel_opened(t);break;case n.TunnelClosed:this.handle_tunnel_closed(t);break;case n.TunnelData:this.handle_tunnel_data(t);break;case n.SFTPListItems:this.handle_sftp_list_items(t);break;case n.SFTPUploadStartResponse:this.handle_upload_start_response(t);break;case n.SFTPUploadChunkAck:this.handle_upload_chunk_ack(t);break;case n.SFTPDownloadStartResponse:this.handle_download_start_response(t);break;case n.SFTPDownloadChunk:this.handle_download_chunk(t);break;default:console.warn("Unhandled protocol message type:",t)}}))}close_comms(){this.cancel_active_upload(),this.cancel_active_download(),this.clear_pending_operations(),this.channel&&(this.channel.stop_heartbeat(),this.channel.disconnect())}clear_creds_buffer(){}reset_session_state(){this.clear_creds_buffer()}list_breadcrumb(e){this.show_loader=!0,this.selected_item=null,this.channel.send_sftp_list_data(this.nodeId,this.session_id,e)}go_to_parent_directory(){this.session_id&&"/"!==this.current_dir&&this.list_breadcrumb(this.breadcrumbs[this.breadcrumbs.length-2]?.path||"/")}refresh_directory(){this.session_id&&this.list_breadcrumb(this.current_dir)}disconnect_session(){this.close_comms(),this.session_id=void 0,this.show_loader=!1,this.show_content=!1,this.breadcrumbs=[],this.current_dir=".",this.listing=[],this.show_navigation=!1,this.show_login_screen_username=!1,this.show_login_screen_password=!1,this.show_login_screen=!1,this.show_upload_modal=!1,this.show_download_modal=!1,this.show_delete_modal=!1,this.upload_progress=0,this.download_progress=0,this.upload_finished=!1,this.download_finished=!1,this.delete_loading=!1,this.delete_file_name="",this.version="",this.status="Disconnected"}on_file_row_action(e,t){t.preventDefault(),t.stopPropagation(),"File"===e.kind&&this.start_download(e)}on_file_delete_action(e,t){t.preventDefault(),t.stopPropagation(),this.selected_item=e,this.delete_file_name=e.name,this.delete_loading=!1,this.show_delete_modal=!0}cancel_delete(){this.delete_loading||(this.show_delete_modal=!1,this.delete_file_name="",this.delete_loading=!1,this.refresh_directory())}confirm_delete(){if(this.delete_loading)return;if(!this.session_id||!this.selected_item)return void(this.show_delete_modal=!1);const e=this.selected_item.name;this.delete_loading=!0,this.status="Deleting...",this.show_error=!1,this.stop_delete_polling();const t=this.next_msg_id();this.pendingDelete={filename:e,msgId:t,startedAt:Date.now()};const i=()=>{if(this.pendingDelete)return Date.now()-this.pendingDelete.startedAt>=3e4?(this.stop_delete_polling(),this.delete_loading=!1,this.show_delete_modal=!1,this.show_error=!0,this.error_message=`Delete timed out for "${e}".`,void(this.status="Connected")):void(this.session_id&&this.channel.send_sftp_list_data(this.nodeId,this.session_id,this.current_dir))};i(),this.pendingDelete.interval=window.setInterval(i,2500),this.channel.send_sftp_delete(this.nodeId,this.session_id,this.current_dir,e,t)}open_upload_picker(){this.uploadInputEl?.click()}on_upload_selected(e){const t=e.target,i=t.files?.[0];i&&(this.upload_file(i),t.value="")}cancel_upload(){this.cancel_active_upload(),this.show_upload_modal=!1,this.upload_file_name="",this.upload_speed="--",this.status="Connected",this.refresh_directory()}cancel_download(){this.cancel_active_download(),this.show_download_modal=!1,this.download_file_name="",this.download_speed="--",this.status="Connected",this.refresh_directory()}is_selected(e){return!!this.selected_item&&this.selected_item.path===e.path&&this.selected_item.name===e.name}list_directory(e){if(!this.session_id)return void console.warn("No active session. Cannot list directory.");if("File"===e.kind)return console.warn("Cannot list directory of a file. Ignoring click."),void(this.selected_item=e);const t=[e.path,e.name].join("/");t!==this.current_dir?(this.show_loader=!0,this.selected_item=null,this.channel.send_sftp_list_data(this.nodeId,this.session_id,t)):console.warn("Already in this directory. Ignoring click.")}format_size(e){if(void 0===e||Number.isNaN(e))return"-";if(e<1024)return`${e} B`;const t=["KB","MB","GB","TB","PB"];let i=e,s=-1;for(;i>=1024&&s<t.length-1;)i/=1024,s+=1;return`${i.toFixed(i>=10?1:2)} ${t[s]}`}mode_type_to_char(e,t){switch(61440&e){case 49152:return"s";case 40960:return"l";case 32768:return"-";case 24576:return"b";case 16384:return"d";case 8192:return"c";case 4096:return"p";default:return"Folder"===t?"d":"-"}}format_permissions(e,t){if(null==e)return"-";if("string"==typeof e){const i=e.trim();if(/^[bcdlps-][rwxStTs-]{9}$/.test(i))return i;if(/^[0-7]{3,4}$/.test(i)){const e=parseInt(i,8);return this.format_permissions(e,t)}if(/^\d+$/.test(i)){const e=parseInt(i,10);return this.format_permissions(e,t)}return i||"-"}const i=e,s=this.mode_type_to_char(i,t),a=[256&i?"r":"-",128&i?"w":"-",64&i?"x":"-",32&i?"r":"-",16&i?"w":"-",8&i?"x":"-",4&i?"r":"-",2&i?"w":"-",1&i?"x":"-"];return 2048&i&&(a[2]="x"===a[2]?"s":"S"),1024&i&&(a[5]="x"===a[5]?"s":"S"),512&i&&(a[8]="x"===a[8]?"t":"T"),`${s}${a.join("")}`}render(){return i(s,{key:"6f830eb2cea173cb081eabdd7d3d418e8c831b4a",class:{default:!this.max,max:this.max}},i("section",{key:"0c028222f80a6783f4f457dd9dbb4f276c7e75cc",class:"listing"},!this.hideHeader&&i("header",{key:"bf4260a4f13173ff003885c39167177c17fb138f"},i("section",{key:"6025f57ee11cda79928158fc86be88588aeda5c1",class:"title"},i("img",{key:"1a1fc770118c2d1c027248b65c110ad948ce5860",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoNDYsIDE4NCwgMTM4KSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgICBjbGFzcz0ibHVjaWRlIGx1Y2lkZS10ZXJtaW5hbCB3LTMuNSBoLTMuNSB0ZXh0LXByaW1hcnkiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iNCAxNyAxMCAxMSA0IDUiPjwvcG9seWxpbmU+CiAgICA8bGluZSB4MT0iMTIiIHgyPSIyMCIgeTE9IjE5IiB5Mj0iMTkiPjwvbGluZT4KPC9zdmc+Cg==",alt:"SFTP Client"}),i("div",{key:"5c71b597edfd27b5d79966281cada602604ed849",class:"text"},i("div",{key:"600e8073d2d240cb599a76426a296a396201f70e",class:"name"},this.name),i("div",{key:"6d40ba59e26818071ab0f110651c8da1cbe8794c",class:"description"},this.description))),i("section",{key:"a90afbb3729ac3dc40cc16eda959a5b9028a14f3",class:"actions"},i("div",{key:"97b8b948b8bbe521cfbc91279e84ccc9e9c5b151",class:"action",onClick:()=>this.toggle_max()},i("img",{key:"6f7881d837d5b5e4f79d1dead0d53df733205899",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTE1LCAxMjMsIDE0MCkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtbWF4aW1pemUyIHctMyBoLTMiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iMTUgMyAyMSAzIDIxIDkiPjwvcG9seWxpbmU+CiAgICA8cG9seWxpbmUgcG9pbnRzPSI5IDIxIDMgMjEgMyAxNSI+PC9wb2x5bGluZT4KICAgIDxsaW5lIHgxPSIyMSIgeDI9IjE0IiB5MT0iMyIgeTI9IjEwIj48L2xpbmU+CiAgICA8bGluZSB4MT0iMyIgeDI9IjEwIiB5MT0iMjEiIHkyPSIxNCI+PC9saW5lPgo8L3N2Zz4K",alt:"Maximize"})))),i("main",{key:"58db45bcafab4c55e257831e9693591724fc9848"},this.show_navigation&&i("nav",{key:"9b0c06d3afd36a32845334375c0ec0f0f4e363ea",class:"navigation"},i("div",{key:"5b84ca2d3a55afb383fe27ed9b955d24560b0283",class:"breadcrumbs"},this.breadcrumbs.map(((e,t,s)=>i("span",{key:t,class:"breadcrumb-container"},i("span",{key:t,onClick:()=>this.list_breadcrumb(e.path),class:"breadcrumb"},e.label),t<s.length-1&&i("img",{class:"arrow",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogICAgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIKICAgIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tcmlnaHQgdy0zIGgtMyB0ZXh0LW11dGVkLWZvcmVncm91bmQvNTAgc2hyaW5rLTAiPgogICAgPHBhdGggZD0ibTkgMTggNi02LTYtNiI+PC9wYXRoPgo8L3N2Zz4K"}))))),i("section",{key:"66dd6ce5d4d85c089a869a371208c98582a33e87",class:"actions","aria-label":"SFTP actions"},i("button",{key:"105c5d93be38f4ceb1da058f5f57855decf3aa8f",type:"button",class:"action",onClick:()=>this.go_to_parent_directory(),title:"Go to parent directory","aria-label":"Go to parent directory"},i("img",{key:"8b425e80e9aa707607822b9e4ae3828ae01e4202",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtYXJyb3ctdXAgdy0zLjUgaC0zLjUiPgogICAgPHBhdGggZD0ibTUgMTIgNy03IDcgNyI+PC9wYXRoPgogICAgPHBhdGggZD0iTTEyIDE5VjUiPjwvcGF0aD4KPC9zdmc+Cg==",alt:"Go up"})),i("button",{key:"d0f01c462c3e6f52155e1307f048c5027202819b",type:"button",class:"action",onClick:()=>this.refresh_directory(),title:"Refresh","aria-label":"Refresh"},i("img",{key:"11e66f738f80032018bbe796eb8f7f42001f4b5f",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtcmVmcmVzaC1jdyB3LTMuNSBoLTMuNSI+CiAgICA8cGF0aCBkPSJNMyAxMmE5IDkgMCAwIDEgOS05IDkuNzUgOS43NSAwIDAgMSA2Ljc0IDIuNzRMMjEgOCI+PC9wYXRoPgogICAgPHBhdGggZD0iTTIxIDN2NWgtNSI+PC9wYXRoPgogICAgPHBhdGggZD0iTTIxIDEyYTkgOSAwIDAgMS05IDkgOS43NSA5Ljc1IDAgMCAxLTYuNzQtMi43NEwzIDE2Ij48L3BhdGg+CiAgICA8cGF0aCBkPSJNOCAxNkgzdjUiPjwvcGF0aD4KPC9zdmc+Cg==",alt:"Refresh"})),i("button",{key:"a39aed27376480e5e2dc68fc4b1ef57b8c4b0b40",type:"button",class:"action",onClick:()=>this.open_upload_picker(),title:"Upload","aria-label":"Upload"},i("img",{key:"fac80ba8c1283eed058e017efc45904658f91f43",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtdXBsb2FkIHctMy41IGgtMy41Ij4KICAgIDxwYXRoIGQ9Ik0yMSAxNXY0YTIgMiAwIDAgMS0yIDJINWEyIDIgMCAwIDEtMi0ydi00Ij48L3BhdGg+CiAgICA8cG9seWxpbmUgcG9pbnRzPSIxNyA4IDEyIDMgNyA4Ij48L3BvbHlsaW5lPgogICAgPGxpbmUgeDE9IjEyIiB4Mj0iMTIiIHkxPSIzIiB5Mj0iMTUiPjwvbGluZT4KPC9zdmc+Cg==",alt:"Upload"})),i("button",{key:"281854c1ac21ac8be51a22da7a5e6ac7f902f74b",type:"button",class:"action disconnect",onClick:()=>this.disconnect_session(),title:"Disconnect","aria-label":"Disconnect"},"DISCONNECT"))),i("input",{key:"9daf263acc61a2241c10817056cdb3cd8da81c9e",type:"file",ref:e=>this.uploadInputEl=e,onChange:e=>this.on_upload_selected(e),style:{display:"none"}}),this.show_content&&i("div",{key:"6611808a8f69b06bb66e2b7e82bb06e0c6469d18",class:"content"},i("table",{key:"46d758f6b01f1e48acf99d0b797c5ec538717ea0"},i("thead",{key:"7f3b4f05a2538d20efd43d21ec2d425a286d1b35"},i("tr",{key:"b9c8584bc98a5e9d24fd17346e325ccf511a109c"},i("th",{key:"93220b4f6a1f7a7ca79978f8a98fb7218eb4a353"},"Name"),i("th",{key:"a25c5948ab02ed467ba4f71314f5ebb0756e7678"},"Size"),i("th",{key:"27f32a431f5e20b4331b79ae358d7a077681a548"},"Permissions"),i("th",{key:"a3ae189c7161a3237dd2f07c50a965a0b5a51058"},"Owner"),i("th",{key:"ddc31efb5d7d3746875590ef4e52dd61375f963c"},"Modified"),i("th",{key:"590b952ac4c16a9abdb4bcce432818ef9ddb1687",class:"action-col","aria-label":"Actions"}))),i("tbody",{key:"5a35c2357ad4ff9e99dcd499ec894bc89466b4ba"},this.listing.map(((e,t)=>i("tr",{key:t,class:{selected:this.is_selected(e)},onClick:()=>this.list_directory(e)},i("td",null,i("img","Folder"===e.kind?{class:"kind",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoNDYsIDE4NCwgMTM4KSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgICBjbGFzcz0ibHVjaWRlIGx1Y2lkZS1mb2xkZXIgdy0zLjUgaC0zLjUgdGV4dC1wcmltYXJ5IHNocmluay0wIj4KICAgIDxwYXRoCiAgICAgICAgZD0iTTIwIDIwYTIgMiAwIDAgMCAyLTJWOGEyIDIgMCAwIDAtMi0yaC03LjlhMiAyIDAgMCAxLTEuNjktLjlMOS42IDMuOUEyIDIgMCAwIDAgNy45MyAzSDRhMiAyIDAgMCAwLTIgMnYxM2EyIDIgMCAwIDAgMiAyWiI+PC9wYXRoPgo8L3N2Zz4K",alt:"Folder"}:{class:"kind",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTE1LCAxMjMsIDE0MCkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtZmlsZSB3LTMuNSBoLTMuNSB0ZXh0LW11dGVkLWZvcmVncm91bmQgc2hyaW5rLTAiPgogICAgPHBhdGggZD0iTTE1IDJINmEyIDIgMCAwIDAtMiAydjE2YTIgMiAwIDAgMCAyIDJoMTJhMiAyIDAgMCAwIDItMlY3WiI+PC9wYXRoPgogICAgPHBhdGggZD0iTTE0IDJ2NGEyIDIgMCAwIDAgMiAyaDQiPjwvcGF0aD4KPC9zdmc+Cg==",alt:"File"}),i("span",{class:`name ${e.kind.toLowerCase()}`},e.name)),i("td",null,this.format_size(e.attributes.size)),i("td",null,this.format_permissions(e.attributes.permissions,e.kind)),i("td",null,e.attributes.user??"-"),i("td",null,new Date(1e3*e.attributes.modified).toLocaleString()),i("td",{class:"action-col"},"File"===e.kind&&i("div",{class:"file-actions"},i("button",{type:"button",class:"file-action",onClick:t=>this.on_file_row_action(e,t),title:"Download","aria-label":"Download"},i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},i("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),i("polyline",{points:"7 10 12 15 17 10"}),i("line",{x1:"12",x2:"12",y1:"15",y2:"3"}))),i("button",{type:"button",class:"file-action delete",onClick:t=>this.on_file_delete_action(e,t),title:"Delete","aria-label":"Delete"},i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},i("polyline",{points:"3 6 5 6 21 6"}),i("path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),i("path",{d:"M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"}),i("line",{x1:"10",x2:"10",y1:"11",y2:"17"}),i("line",{x1:"14",x2:"14",y1:"11",y2:"17"}))))))))))),this.show_loader&&i("div",{key:"137cf80c05c6fa389cf9bd3bd9003d8f4796419b",class:"loader"},"Loading..."),this.show_error&&i("div",{key:"1ba1fad888b61e18f6dfb2bcbd7bd22e0f911c6c",class:"error"},this.error_message)),i("footer",{key:"247a9ed330ff6f465cca3cae91dd045f1183d6d4"},i("section",{key:"16691e17293b7f2181d080ecb68f283110b5a887",class:"version"},this.version?`Version: ${this.version}`:""))),this.show_login_screen&&i("section",{key:"8df665b59da590cd5a4c684a9eb3a772f9265cbb",class:{creds:!0,blurred:this.show_login_screen}},i("form",{key:"efffd5be69a1ac3f2df26c174be2ebb6aa989850",class:"auth",onSubmit:e=>{const t=new FormData(e.target);let i,s;this.show_login_screen_username&&(i=t.get("username")),this.show_login_screen_password&&(s=t.get("password")),this.channel.open_sftp_tunnel(this.nodeId,this.serviceId,i,s),this.show_login_screen_username=!1,this.show_login_screen_password=!1,this.show_login_screen=!1,this.show_loader=!0,e.stopPropagation(),e.preventDefault()}},i("div",{key:"6ece35409f1cb33e953857e908b5c251265f9b7a",class:"title"},"SFTP Connection"),this.show_login_screen_username&&i("div",{key:"d2e6a109f1d68ffb21fd709f9f761b7a097973ce"},i("label",{key:"df54f92649e1e3535b368bcbdb53e2061e008d9d",htmlFor:"username"},"Username"),i("input",{key:"09724a6b262408825babdf1855daf97dd6e48274",autocorrect:"off",autocapitalize:"none",autoComplete:"off",id:"username",name:"username",type:"text",placeholder:""})),this.show_login_screen_password&&i("div",{key:"b67d7fdf364616217cf0fe7493db87f368a0e00b"},i("label",{key:"1a4f81e403e8048980848a22753dff7922a25eb8",htmlFor:"password"},"Password"),i("input",{key:"d7a806e065f81c07a682d0ace085dd80f96bb2e2",autocorrect:"off",autocapitalize:"none",autoComplete:"off",id:"password",name:"password",type:"password",placeholder:""})),i("div",{key:"eb184e90d5a99411c0c68c63c0f58b74e2b3a454"},i("button",{key:"92014931e757553af1fc785fa89dc859fed6421d",type:"submit"},"Connect")))),this.show_upload_modal&&i("section",{key:"b730e0680f0e5325f506104438e30e9f3dc6ec18",class:{"upload-modal":!0,visible:this.show_upload_modal}},i("div",{key:"80205240d2af805bede0d6d42ffefad176d0b6f6",class:"upload-dialog",role:"dialog","aria-modal":"true","aria-label":"Upload progress"},i("div",{key:"ee11974c49a3597eaee6b588c328c5d77659c2b4",class:"title"},"Uploading File"),i("div",{key:"cf24d8f350325bf9cd6f128dc5ad2b2467ff4adb",class:"file-name",title:this.upload_file_name},this.upload_file_name),i("div",{key:"e36c4cf5785166c1d9b5121066210d87cc09d4e5",class:"progress-track",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":this.upload_progress},i("div",{key:"f1db022f2d3fb92fb9686d50e4aa0366e80da8ca",class:"progress-fill",style:{width:`${this.upload_progress}%`}})),i("div",{key:"515bdf6caf6a3d0c04badc923bc8a1f24d388cfe",class:"progress-meta"},i("div",{key:"00935d340635aaa36004444b627e25732f7c17ab",class:"progress-speed"},this.upload_speed),i("div",{key:"369e5c294ac99e1f25fceb3575838e50ce5c0cb4",class:"progress-value"},this.format_percent(this.upload_progress))),i("button",{key:"c9694acf8f7cb316a9e60bf33c80279fba7f3676",type:"button",class:{cancel:!0,finished:this.upload_finished},onClick:()=>this.cancel_upload()},this.upload_finished?"Close":"Cancel"))),this.show_download_modal&&i("section",{key:"c54157cf02112940304bd5d107e442626cbc3a3a",class:{"download-modal":!0,visible:this.show_download_modal}},i("div",{key:"51cc07975f3cb4d8d5dd29a457a2cb56d58c2bc3",class:"download-dialog",role:"dialog","aria-modal":"true","aria-label":"Download progress"},i("div",{key:"fa15597119c5656530b136a0796ba498d05f7ba3",class:"title"},"Downloading File"),i("div",{key:"a12e3b257a91a30323c018dcd0117ddcfde7ec9d",class:"file-name",title:this.download_file_name},this.download_file_name),i("div",{key:"788db1afcf3506ee26dc7965060b5213b1285379",class:"progress-track",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":this.download_progress},i("div",{key:"9842d1e20a24bcbb5185918b2373818414a86bb6",class:"progress-fill",style:{width:`${this.download_progress}%`}})),i("div",{key:"26347a189b2fc3b0594a548cb15aeaa6e1ca2901",class:"progress-meta"},i("div",{key:"c2acfab8ec6d6c74df299f7b7b1f8bdcb88702db",class:"progress-speed"},this.download_speed),i("div",{key:"853c8b4b8fb5d9d13cd5c654bfdeda02b4f4e097",class:"progress-value"},this.format_percent(this.download_progress))),i("button",{key:"40a339398d29082b1532cd1d13fec2027a5c0c84",type:"button",class:{cancel:!0,finished:this.download_finished},onClick:()=>this.cancel_download()},this.download_finished?"Close":"Cancel"))),this.show_delete_modal&&i("section",{key:"07ca147451fe3063aa418ee46af09d5d037752cc",class:{"delete-modal":!0,visible:this.show_delete_modal}},i("div",{key:"5c11193b4808d43d33151cb5eebf8efa54ec75bd",class:"delete-dialog",role:"dialog","aria-modal":"true","aria-label":"Delete confirmation"},i("div",{key:"858d54eddbb5ed0b72176494ac515fc4c7b16dfc",class:"title"},"Delete File"),i("div",{key:"df347ceded9b6e8b44285e0b4122cd363c2504a2",class:"message"},this.delete_loading?"Deleting file...":"Are you sure you want to delete this file?"),i("div",{key:"c547c48ba66daabb9bed82d220d87b8b0eef25b3",class:"file-name",title:this.delete_file_name},this.delete_file_name),this.delete_loading&&i("div",{key:"a3fd5cf9a93a5d2937a10d8333bb2dd6abe73254",class:"delete-loader","aria-hidden":"true"},i("span",{key:"ca4414ae7183139b1ff8b36630e330f05896c0fd",class:"spinner"})),i("div",{key:"e229b2804e7cbed6edbbd1b6542b7a33ac1c0575",class:"modal-actions"},i("button",{key:"eedf2e90f7896fcce7db6bad995c890d79ec9361",type:"button",class:"btn secondary",onClick:()=>this.cancel_delete(),disabled:this.delete_loading},"Cancel"),i("button",{key:"010e0b6468eb7522f7131e2a37d4b25fad828837",type:"button",class:"btn destructive",onClick:()=>this.confirm_delete(),disabled:this.delete_loading},this.delete_loading?"Deleting...":"Delete")))))}static get watchers(){return{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}}};c.style=":host{--radius:0.375rem;--card:220 18% 10%;--border:220 15% 18%;--primary:160 60% 45%;--radius:0.375rem;--destructive:0 70% 50%;--muted:220 15% 13%;--muted-foreground:220 10% 50%;--primary-foreground:220 20% 7%;--scroll-track:220 16% 12%;--scroll-thumb:220 12% 34%;--scroll-thumb-hover:160 45% 44%;font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;height:100%;width:100%;border:1px solid hsl(var(--border));background-color:hsl(var(--card));border-radius:var(--radius);overflow:hidden;display:flex;flex-direction:column;position:relative;container-type:inline-size;.listing{height:100%;display:flex;flex-direction:column;justify-content:space-between;min-height:0;header{height:30px;background:rgba(28, 31, 38, 0.6);border-bottom:1px solid hsl(var(--border));display:flex;align-items:center;justify-content:space-between;.actions{display:flex;align-items:center;.action{cursor:pointer;padding:4px;display:flex;align-items:center;z-index:1;img{height:14px;padding:4px;border-radius:4px}&:hover{background-color:hsl(var(--border) / 0.6)}}}.title{color:hsl(var(--primary));height:14px;padding:0 12px;display:flex;align-items:center;font-size:0.75rem;line-height:1rem;img{height:14px;margin-right:5px}.text{display:flex;flex-direction:row;justify-content:center;margin-top:2px;.name{margin-right:10px}.description{color:hsl(var(--muted-foreground))}}}}main{flex:1;display:flex;flex-direction:column;position:relative;min-height:0;overflow:hidden;.loader{color:hsl(var(--muted-foreground));font-size:13px;animation:pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;text-align:center;display:flex;align-items:center;justify-content:center;position:absolute;height:100%;width:100%;background:rgba(28, 31, 38, 0);backdrop-filter:blur(4px)}.error{font-size:13px;text-align:center;color:hsl(var(--destructive));height:100%;display:flex;align-items:center;justify-content:center}.navigation{height:25px;padding:10px;font-size:0.75rem;line-height:1rem;background-color:hsl(var(--card));display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid hsl(var(--border));position:sticky;top:0;z-index:3;.breadcrumbs{display:flex;align-items:center;margin-right:10px;.breadcrumb-container{white-space:nowrap;.breadcrumb{color:hsl(var(--primary));margin-right:4px;cursor:pointer;&:after{margin-left:4px}&:hover{color:rgb(189, 219, 209)}&:last-child{margin-right:0;color:rgb(189, 219, 209);cursor:default}}}.arrow{height:12px;width:12px;opacity:0.6;top:2px;margin-right:4px;position:relative}}.actions{display:flex;align-items:center;gap:8px}.action{border:none;background:transparent;color:rgb(189, 219, 209);font-size:1.1rem;line-height:1;padding:2px 4px;border-radius:4px;cursor:pointer;&:hover{background-color:hsl(var(--border) / 0.6)}img{height:14px;width:14px;display:block}}.action.disconnect{color:#ff4d5f;font-size:0.65rem;letter-spacing:0.08em;padding:4px 8px;&:hover{color:#ff6b7a;background-color:hsl(var(--destructive) / 0.12)}}}.content{flex:1;min-height:0;overflow:auto;font-size:0.75rem;line-height:1rem;scrollbar-width:thin;scrollbar-color:hsl(var(--scroll-thumb)) hsl(var(--scroll-track));&::-webkit-scrollbar{width:10px;height:10px}&::-webkit-scrollbar-track{background:hsl(var(--scroll-track))}&::-webkit-scrollbar-thumb{background:hsl(var(--scroll-thumb));border-radius:999px;border:2px solid hsl(var(--scroll-track))}&::-webkit-scrollbar-thumb:hover{background:hsl(var(--scroll-thumb-hover))}table{width:100%;border-collapse:separate;border-spacing:0;table-layout:auto;thead{background-color:hsl(var(--muted));border-bottom:1px solid hsl(var(--border));th{padding:8px 10px;text-align:left;color:hsl(var(--muted-foreground));position:sticky;top:0;z-index:2;background-color:hsl(var(--muted));border-bottom:1px solid hsl(var(--border));line-height:0.95rem;&.action-col{width:58px;min-width:58px;padding:0 10px}&:first-child{width:30%;min-width:180px;max-width:195px}&:nth-child(2),&:nth-child(3),&:nth-child(4),&:nth-child(5){white-space:nowrap;width:1%}}}tbody{padding:10px 10px;tr{border-bottom:1px solid hsl(var(--border) / 0.4);td{padding:10px 10px 9px;color:hsl(var(--muted-foreground));&:first-child{min-width:180px;max-width:195px;white-space:nowrap;.name{display:inline-block;max-width:calc(100% - 26px);overflow:hidden;text-overflow:ellipsis;vertical-align:middle}}&:nth-child(2),&:nth-child(3),&:nth-child(4),&:nth-child(5){white-space:nowrap}&.action-col{width:58px;min-width:58px;text-align:center;padding-left:1px;padding-right:1px;.file-actions{display:flex;align-items:center;justify-content:center;gap:8px}.file-action{border:none;background:transparent;color:hsl(var(--muted-foreground));width:16px;height:16px;border-radius:3px;cursor:pointer;opacity:0;visibility:hidden;pointer-events:none;transition:opacity 120ms ease;padding:0;svg{width:12px;height:12px;display:block;margin:0 auto}&:hover{color:hsl(var(--primary))}&.delete:hover{color:hsl(var(--destructive))}}}.name{&.file{color:rgb(189, 219, 209)}&.folder{color:hsl(var(--primary))}}.kind{height:14px;width:14px;margin-right:5px;top:3px;position:relative}}&:hover{cursor:pointer;background-color:hsl(var(--muted) / 0.4);td.action-col .file-action{opacity:1;visibility:visible;pointer-events:auto;color:hsl(var(--primary))}}&.selected{background-color:hsl(var(--primary) / 0.3);td.action-col .file-action{opacity:1;visibility:visible;pointer-events:auto}&:hover{background-color:hsl(var(--primary) / 0.4)}}}}}}}footer{height:25px;background:rgba(28, 31, 38, 0.6);border-top:1px solid hsl(var(--border));font-size:0.75rem;line-height:1rem;display:flex;align-items:center;justify-content:space-between;padding:0 10px;.status{font-size:0.65rem;color:hsl(var(--muted-foreground));.selected-item{margin-left:10px;color:hsl(var(--primary))}}.version{font-size:0.65rem;color:hsl(var(--muted-foreground))}}}.creds{position:absolute;top:0;left:0;height:100%;width:100%;display:flex;justify-content:center;align-items:center;;&.blurred{background:rgba(28, 31, 38, 0);backdrop-filter:blur(4px)}.auth{display:flex;flex-direction:column;background:hsl(var(--card));position:relative;background-color:rgba(21, 24, 30, 0.95);border:1px solid hsl(var(--border));padding:30px;box-shadow:rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.5) 0px 25px 50px -12px;border-radius:var(--radius);.title{margin-bottom:12px;color:hsl(var(--primary))}label{font-size:0.75rem;line-height:1rem;margin-bottom:1rem;color:hsl(var(--muted-foreground))}input{font-size:0.875rem;line-height:1.25rem;padding-top:0.5rem;padding-bottom:0.5rem;padding-left:0.75rem;padding-right:0.75rem;background-color:rgb(28, 31, 38);border-color:rgb(39, 44, 53);border-width:1px;border-radius:calc(var(--radius) - 2px);width:100%;margin-bottom:12px;color:rgb(189, 219, 209);box-sizing:border-box;&:focus{outline:none;border-color:hsl(var(--primary));box-shadow:0 0 0 1px hsl(var(--primary))}}button[type='submit']{margin-top:12px;width:100%;background-color:hsl(var(--primary));color:hsl(var(--primary-foreground));letter-spacing:0.05em;font-size:13px;font-weight:500;padding:0.5rem 1rem;border-radius:calc(var(--radius) - 2px);height:2rem;cursor:pointer;border:none;&:hover{background-color:hsl(var(--primary) / 0.9)}}}}.upload-modal,.download-modal,.delete-modal{position:absolute;inset:0;display:none;align-items:center;justify-content:center;background:rgba(28, 31, 38, 0);backdrop-filter:blur(4px);z-index:6;&.visible{display:flex}.upload-dialog,.download-dialog,.delete-dialog{width:min(360px, calc(100% - 24px));background-color:rgba(21, 24, 30, 0.96);border:1px solid hsl(var(--border));border-radius:var(--radius);padding:16px;box-shadow:rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.5) 0px 25px 50px -12px;.title{color:hsl(var(--primary));font-size:0.8rem;margin-bottom:8px}.file-name{color:rgb(189, 219, 209);font-size:0.72rem;line-height:1rem;margin-bottom:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.progress-track{width:100%;height:10px;border-radius:999px;background-color:hsl(var(--muted));overflow:hidden;border:1px solid hsl(var(--border));.progress-fill{height:100%;width:0;background:linear-gradient(90deg, hsl(var(--primary) / 0.7), hsl(var(--primary)));transition:width 140ms ease}}.progress-meta{margin-top:8px;margin-bottom:12px;display:flex;align-items:center;justify-content:space-between;gap:10px}.progress-speed{color:hsl(var(--muted-foreground));font-size:0.75rem;font-variant-numeric:tabular-nums;line-height:1.4;text-align:left}.progress-value{color:hsl(var(--muted-foreground));font-size:0.75rem;font-variant-numeric:tabular-nums;line-height:1.4;text-align:right}.cancel{margin-top:14px;width:100%;height:2rem;border:1px solid hsl(var(--border));border-radius:calc(var(--radius) - 2px);background:hsl(var(--muted));color:rgb(189, 219, 209);font-size:0.75rem;letter-spacing:0.03em;cursor:pointer;&:hover{border-color:hsl(var(--primary));color:hsl(var(--primary))}&.finished{background-color:hsl(var(--primary));border-color:hsl(var(--primary));color:hsl(var(--primary-foreground));&:hover{background-color:hsl(var(--primary) / 0.9);border-color:hsl(var(--primary) / 0.9);color:hsl(var(--primary-foreground))}}}.message{color:rgb(189, 219, 209);font-size:0.74rem;line-height:1rem;margin-bottom:8px}.modal-actions{margin-top:14px;display:grid;grid-template-columns:1fr 1fr;gap:8px;.btn{height:2rem;border:1px solid hsl(var(--border));border-radius:calc(var(--radius) - 2px);font-size:0.75rem;letter-spacing:0.03em;cursor:pointer;&:disabled{opacity:0.65;cursor:not-allowed}}.btn.secondary{background:hsl(var(--muted));color:rgb(189, 219, 209);&:hover{border-color:hsl(var(--primary));color:hsl(var(--primary))}}.btn.destructive{background:hsl(var(--destructive));border-color:hsl(var(--destructive));color:white;&:hover{background:hsl(var(--destructive) / 0.9);border-color:hsl(var(--destructive) / 0.9)}}}.delete-loader{margin-top:4px;display:flex;justify-content:center;.spinner{width:16px;height:16px;border:2px solid hsl(var(--muted-foreground) / 0.35);border-top-color:hsl(var(--primary));border-radius:50%;animation:spin 0.7s linear infinite}}}}}@keyframes spin{to{transform:rotate(360deg)}}:host(.max){height:100vh;width:100vw;position:fixed;top:0;left:0;z-index:9999}@container (max-width: 699px){:host .listing main .content table thead th:nth-child(4),:host .listing main .content table tbody td:nth-child(4){display:none}}@container (max-width: 635px){:host .listing main .content table thead th:nth-child(3),:host .listing main .content table tbody td:nth-child(3){display:none}}@container (max-width: 530px){:host .listing main .content table thead th:nth-child(5),:host .listing main .content table tbody td:nth-child(5){display:none}:host .listing footer .status{display:none}}@container (max-width: 370px){:host .listing main .content table thead th:nth-child(2),:host .listing main .content table tbody td:nth-child(2){display:none}:host .listing main .content table thead th:first-child,:host .listing main .content table tbody td:first-child{width:100%;min-width:0;max-width:none}:host .listing main .content table tbody td:first-child .name{max-width:100%}}@container (max-width: 295px){:host .listing main .content table tbody td:first-child .name{max-width:120px}}";export{c as phirepass_sftp_client}
|
|
1
|
+
import{r as e,c as t,h as i,H as s}from"./p-AP5XjS35.js";import{_ as a,E as o,C as r,a as d,P as n}from"./p-DFhjP92A.js";const c=class{constructor(i){e(this,i),this.maximizeEvent=t(this,"maximize"),this.connectionStateChanged=t(this,"connectionStateChanged")}channel;domReady=!1;runtimeReady=!1;connected=!1;uploadInputEl;deleteLoadingTimeout;msgId=1;activeUploadToken=0;pendingUploadStarts=new Map;pendingUploadAcks=new Map;pendingDownloadStarts=new Map;activeDownloads=new Map;activeDownloadMsgId;pendingDelete;session_id;name="SFTP";description="Client";hideHeader=!1;serverHost="phirepass.com";serverPort=443;allowInsecure=!1;heartbeatInterval=3e4;nodeId;serviceId;token;onNodeIdChange(e,t){this.reset_session_state(),this.channel&&this.channel.is_connected()&&this.close_comms(),e&&(this.open_comms(),this.channel.connect(),this.status="Connecting...")}serverId;onServerIdChange(e,t){this.onNodeIdChange(this.nodeId,this.nodeId)}maximizeEvent;async maximize(){this.max=!this.max}async minimize(){this.max=!1}connectionStateChanged;max=!1;show_login_screen=!1;show_login_screen_username=!1;show_error=!1;error_message="";show_login_screen_password=!1;show_navigation=!1;breadcrumbs=[];current_dir=".";listing=[];show_content=!1;show_loader=!1;version="";status="Disconnected";selected_item=null;show_upload_modal=!1;upload_progress=0;upload_file_name="";upload_speed="--";upload_finished=!1;show_download_modal=!1;download_progress=0;download_file_name="";download_speed="--";download_finished=!1;show_delete_modal=!1;delete_file_name="";delete_loading=!1;toggle_max(){this.maximizeEvent?.emit(!this.max)}async connectedCallback(){await a(),this.open_comms(),this.runtimeReady=!0,this.nodeId?this.try_connect():console.warn("Prop node_id is not set. Cannot connect to terminal.")}componentDidLoad(){this.domReady=!0,this.try_connect()}async disconnectedCallback(){this.connected=!1,this.domReady=!1,this.runtimeReady=!1,this.cancel_active_upload(),this.cancel_active_download(),this.clear_pending_operations(),this.clear_delete_loading_timeout(),this.close_comms()}clear_delete_loading_timeout(){void 0!==this.deleteLoadingTimeout&&(window.clearTimeout(this.deleteLoadingTimeout),this.deleteLoadingTimeout=void 0)}next_msg_id(){const e=this.msgId;return this.msgId+=1,e}clear_pending_operations(){this.pendingUploadStarts.forEach((e=>{window.clearTimeout(e.timeout),e.reject(new Error("Upload start aborted"))})),this.pendingUploadStarts.clear(),this.pendingUploadAcks.forEach((e=>{window.clearTimeout(e.timeout),e.reject(new Error("Upload chunk aborted"))})),this.pendingUploadAcks.clear(),this.pendingDownloadStarts.forEach((e=>{window.clearTimeout(e.timeout),e.reject(new Error("Download start aborted"))})),this.pendingDownloadStarts.clear(),this.stop_delete_polling(),this.activeDownloads.clear()}stop_delete_polling(){void 0!==this.pendingDelete?.interval&&window.clearInterval(this.pendingDelete.interval),this.pendingDelete=void 0}cancel_active_upload(){this.activeUploadToken+=1,this.upload_progress=0,this.upload_finished=!1,this.upload_speed="--"}cancel_active_download(){void 0!==this.activeDownloadMsgId&&this.activeDownloads.delete(this.activeDownloadMsgId),this.activeDownloadMsgId=void 0,this.download_progress=0,this.download_finished=!1,this.download_speed="--"}format_duration(e){if(!Number.isFinite(e)||e<0)return"--";if(e<60)return`${e.toFixed(0)}s`;const t=Math.floor(e/60),i=Math.floor(e%60);return t<60?`${t}m ${i}s`:`${Math.floor(t/60)}h ${t%60}m`}format_percent(e){return`${(Number.isFinite(e)?e:0).toFixed(2)}%`}format_transfer_rate(e){return!Number.isFinite(e)||e<=0?"--":`${this.format_size(e)}/s`}update_upload_progress(e,t,i){if(this.upload_progress=Math.max(0,Math.min(100,t>0?e/t*100:0)),e>=t)return this.upload_finished=!0,void(this.upload_speed="--");const s=(performance.now()-i)/1e3,a=s>0?e/s:0;this.upload_speed=this.format_transfer_rate(a);const o=a>0?(t-e)/a:NaN;this.status=`Uploading ${this.format_size(e)} / ${this.format_size(t)} (ETA ${this.format_duration(o)})`}update_download_progress(e,t,i){if(this.download_progress=Math.max(0,Math.min(100,t>0?e/t*100:0)),e>=t)return this.download_finished=!0,void(this.download_speed="--");const s=(Date.now()-i)/1e3,a=s>0?e/s:0;this.download_speed=this.format_transfer_rate(a);const o=a>0?(t-e)/a:NaN;this.status=`Downloading ${this.format_size(e)} / ${this.format_size(t)} (ETA ${this.format_duration(o)})`}connect(){this.connected=!0,this.channel.connect(),this.status="Connecting..."}try_connect(){!this.connected&&this.domReady&&this.runtimeReady&&this.channel&&this.connect()}create_web_socket_endpoint(){const e=this.allowInsecure?"ws":"wss";return this.allowInsecure||443!==this.serverPort?this.allowInsecure&&80===this.serverPort?`${e}://${this.serverHost}`:`${e}://${this.serverHost}:${this.serverPort}`:`${e}://${this.serverHost}`}handle_error(e){if(void 0!==e.msg_id){const t=this.pendingUploadStarts.get(e.msg_id);t&&(window.clearTimeout(t.timeout),t.reject(new Error(e.message||"Upload start failed")),this.pendingUploadStarts.delete(e.msg_id));const i=this.pendingDownloadStarts.get(e.msg_id);i&&(window.clearTimeout(i.timeout),i.reject(new Error(e.message||"Download start failed")),this.pendingDownloadStarts.delete(e.msg_id)),this.activeDownloads.has(e.msg_id)&&(this.activeDownloads.delete(e.msg_id),this.activeDownloadMsgId===e.msg_id&&(this.activeDownloadMsgId=void 0),this.download_finished=!1),this.pendingDelete?.msgId===e.msg_id&&(this.stop_delete_polling(),this.delete_loading=!1,this.show_delete_modal=!1,this.status="Connected")}switch(e.kind){case o.Generic:case o.Authentication:this.error_message=e.message||"An unknown error occurred.",this.show_error=!0;break;case o.RequiresUsername:this.show_login_screen_username=!0,this.show_login_screen_password=!1,this.show_login_screen=!0;break;case o.RequiresPassword:this.show_login_screen_username=!1,this.show_login_screen_password=!0,this.show_login_screen=!0;break;case o.RequiresUsernamePassword:this.show_login_screen_username=!0,this.show_login_screen_password=!0,this.show_login_screen=!0}setTimeout((()=>{this.show_loader=!1}),1e3)}handle_auth_success(e){this.clear_creds_buffer(),this.version=e.version,this.channel.start_heartbeat(this.heartbeatInterval<=15e3?3e4:this.heartbeatInterval),this.channel.open_sftp_tunnel(this.nodeId,this.serviceId),this.status="Connected"}handle_tunnel_opened(e){this.session_id=e.sid,this.channel.send_sftp_list_data(this.nodeId,this.session_id,this.current_dir)}handle_sftp_list_items(e){setTimeout((()=>{this.show_loader=!1}),500),this.listing=e.dir.items,this.current_dir=e.path,this.breadcrumbs=e.path.split("/").map(((e,t,i)=>""===e&&0===t?{label:"/",path:"/"}:{label:e,path:i.slice(0,t+1).join("/")})),this.show_content=!0,this.show_navigation=!0,this.pendingDelete&&e.path===this.current_dir&&(e.dir.items.some((e=>"File"===e.kind&&e.name===this.pendingDelete?.filename))||(this.stop_delete_polling(),this.delete_loading=!1,this.show_delete_modal=!1,this.delete_file_name="",this.status="Connected")),console.log("Received SFTP list items:",e)}handle_upload_start_response(e){if(void 0===e.msg_id)return;const t=this.pendingUploadStarts.get(e.msg_id);t&&(window.clearTimeout(t.timeout),t.resolve(e.response.upload_id),this.pendingUploadStarts.delete(e.msg_id))}handle_upload_chunk_ack(e){const t=`${e.upload_id}_${e.chunk_index}`,i=this.pendingUploadAcks.get(t);i&&(window.clearTimeout(i.timeout),i.resolve(),this.pendingUploadAcks.delete(t))}handle_download_start_response(e){if(void 0===e.msg_id)return;const t=this.pendingDownloadStarts.get(e.msg_id);t&&(window.clearTimeout(t.timeout),t.resolve({download_id:e.response.download_id,total_size:e.response.total_size,total_chunks:e.response.total_chunks}),this.pendingDownloadStarts.delete(e.msg_id))}finalize_download(e){const t=this.activeDownloads.get(e);if(!t)return;const i=Array.from(t.chunks.entries()).sort(((e,t)=>e[0]-t[0])).map((([,e])=>e)).map((e=>new Uint8Array(e))),s=new Blob(i,{type:"application/octet-stream"}),a=URL.createObjectURL(s),o=document.createElement("a");o.href=a,o.download=t.filename,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a),this.activeDownloads.delete(e),this.activeDownloadMsgId===e&&(this.activeDownloadMsgId=void 0),this.download_finished=!0,this.status="Connected"}handle_download_chunk(e){if(void 0===e.msg_id)return;const t=this.activeDownloads.get(e.msg_id);if(!t||!this.session_id)return;const i=new Uint8Array(e.chunk.data);t.chunks.set(e.chunk.chunk_index,i);const s=Array.from(t.chunks.values()).reduce(((e,t)=>e+t.length),0);this.update_download_progress(s,t.total_size,t.startTime),this.channel.send_sftp_download_ack(this.nodeId,this.session_id,t.download_id,e.chunk.chunk_index),t.chunks.size>=t.total_chunks&&this.finalize_download(e.msg_id)}async start_download(e){if(!this.session_id)return;this.selected_item=e,this.download_file_name=e.name,this.download_progress=0,this.download_finished=!1,this.download_speed="--",this.show_download_modal=!0,this.show_error=!1;const t=this.next_msg_id();this.activeDownloadMsgId=t,this.activeDownloads.set(t,{filename:e.name,chunks:new Map,total_chunks:0,total_size:0,download_id:0,startTime:Date.now()});const i=new Promise(((e,i)=>{const s=window.setTimeout((()=>{this.pendingDownloadStarts.delete(t),i(new Error("Download start timeout"))}),1e4);this.pendingDownloadStarts.set(t,{timeout:s,resolve:e,reject:i})}));try{this.channel.send_sftp_download_start(this.nodeId,this.session_id,e.path,e.name,t);const{download_id:s,total_chunks:a,total_size:o}=await i,r=this.activeDownloads.get(t);if(!r)return;r.download_id=s,r.total_chunks=a,r.total_size=o}catch(e){this.activeDownloads.delete(t),this.activeDownloadMsgId===t&&(this.activeDownloadMsgId=void 0),this.show_error=!0,this.error_message=e instanceof Error?e.message:"Failed to start download",this.cancel_download()}}async upload_file(e){if(!this.session_id)return;const t=this.activeUploadToken+1;this.activeUploadToken=t,this.upload_file_name=e.name,this.upload_progress=0,this.upload_finished=!1,this.upload_speed="--",this.show_upload_modal=!0,this.show_error=!1,this.status="Uploading...";const i=65536,s=Math.max(1,Math.ceil(e.size/i)),a=this.next_msg_id(),o=new Promise(((e,t)=>{const i=window.setTimeout((()=>{this.pendingUploadStarts.delete(a),t(new Error("Upload start timeout"))}),1e4);this.pendingUploadStarts.set(a,{timeout:i,resolve:e,reject:t})}));try{this.channel.send_sftp_upload_start(this.nodeId,this.session_id,e.name,this.current_dir,s,BigInt(e.size),a);const r=await o;let d=0;const n=performance.now();for(let a=0;a<s;a+=1){if(t!==this.activeUploadToken)throw new Error("Upload cancelled");const s=a*i,o=Math.min(s+i,e.size),c=new Uint8Array(await e.slice(s,o).arrayBuffer());await new Promise(((e,t)=>{const i=`${r}_${a}`,s=window.setTimeout((()=>{this.pendingUploadAcks.delete(i),t(new Error(`Upload chunk ${a+1} timed out`))}),3e4);this.pendingUploadAcks.set(i,{timeout:s,resolve:e,reject:t}),this.channel.send_sftp_upload_chunk(this.nodeId,this.session_id,r,a,c.length,c,null)})),d+=c.length,this.update_upload_progress(d,e.size,n)}this.upload_progress=100,this.upload_finished=!0,this.status="Connected",this.refresh_directory()}catch(e){"Upload cancelled"!==e.message&&(this.show_error=!0,this.error_message=e instanceof Error?e.message:"Upload failed"),this.upload_finished=!1,this.status="Connected"}}handle_tunnel_data(e){console.log("received tunnel data:",e)}handle_tunnel_closed(e){this.clear_creds_buffer(),this.close_comms()}open_comms(){this.channel=this.serverId?new r(`${this.create_web_socket_endpoint()}/api/web/ws`,this.nodeId,this.serverId):new r(`${this.create_web_socket_endpoint()}/api/web/ws`,this.nodeId),this.channel.on_connection_open((()=>{this.connectionStateChanged.emit([d.Connected]),this.channel.authenticate(this.token,this.nodeId),this.status="Authenticating..."})),this.channel.on_connection_close((()=>{this.connectionStateChanged.emit([d.Disconnected]),this.status="Disconnected"})),this.channel.on_connection_error((e=>{this.connectionStateChanged.emit([d.Error,e]),this.status="Error "+e.message})),this.channel.on_connection_message((()=>{})),this.channel.on_protocol_message((e=>{const{web:t}=e.data;switch(t.type){case n.Error:this.handle_error(t);break;case n.AuthSuccess:this.handle_auth_success(t);break;case n.TunnelOpened:this.handle_tunnel_opened(t);break;case n.TunnelClosed:this.handle_tunnel_closed(t);break;case n.TunnelData:this.handle_tunnel_data(t);break;case n.SFTPListItems:this.handle_sftp_list_items(t);break;case n.SFTPUploadStartResponse:this.handle_upload_start_response(t);break;case n.SFTPUploadChunkAck:this.handle_upload_chunk_ack(t);break;case n.SFTPDownloadStartResponse:this.handle_download_start_response(t);break;case n.SFTPDownloadChunk:this.handle_download_chunk(t);break;default:console.warn("Unhandled protocol message type:",t)}}))}close_comms(){this.cancel_active_upload(),this.cancel_active_download(),this.clear_pending_operations(),this.channel&&(this.channel.stop_heartbeat(),this.channel.disconnect())}clear_creds_buffer(){}reset_session_state(){this.clear_creds_buffer()}list_breadcrumb(e){this.show_loader=!0,this.selected_item=null,this.channel.send_sftp_list_data(this.nodeId,this.session_id,e)}go_to_parent_directory(){this.session_id&&"/"!==this.current_dir&&this.list_breadcrumb(this.breadcrumbs[this.breadcrumbs.length-2]?.path||"/")}refresh_directory(){this.session_id&&this.list_breadcrumb(this.current_dir)}disconnect_session(){this.close_comms(),this.session_id=void 0,this.show_loader=!1,this.show_content=!1,this.breadcrumbs=[],this.current_dir=".",this.listing=[],this.show_navigation=!1,this.show_login_screen_username=!1,this.show_login_screen_password=!1,this.show_login_screen=!1,this.show_upload_modal=!1,this.show_download_modal=!1,this.show_delete_modal=!1,this.upload_progress=0,this.download_progress=0,this.upload_finished=!1,this.download_finished=!1,this.delete_loading=!1,this.delete_file_name="",this.version="",this.status="Disconnected"}on_file_row_action(e,t){t.preventDefault(),t.stopPropagation(),"File"===e.kind&&this.start_download(e)}on_file_delete_action(e,t){t.preventDefault(),t.stopPropagation(),this.selected_item=e,this.delete_file_name=e.name,this.delete_loading=!1,this.show_delete_modal=!0}cancel_delete(){this.delete_loading||(this.show_delete_modal=!1,this.delete_file_name="",this.delete_loading=!1,this.refresh_directory())}confirm_delete(){if(this.delete_loading)return;if(!this.session_id||!this.selected_item)return void(this.show_delete_modal=!1);const e=this.selected_item.name;this.delete_loading=!0,this.status="Deleting...",this.show_error=!1,this.stop_delete_polling();const t=this.next_msg_id();this.pendingDelete={filename:e,msgId:t,startedAt:Date.now()};const i=()=>{if(this.pendingDelete)return Date.now()-this.pendingDelete.startedAt>=3e4?(this.stop_delete_polling(),this.delete_loading=!1,this.show_delete_modal=!1,this.show_error=!0,this.error_message=`Delete timed out for "${e}".`,void(this.status="Connected")):void(this.session_id&&this.channel.send_sftp_list_data(this.nodeId,this.session_id,this.current_dir))};i(),this.pendingDelete.interval=window.setInterval(i,2500),this.channel.send_sftp_delete(this.nodeId,this.session_id,this.current_dir,e,t)}open_upload_picker(){this.uploadInputEl?.click()}on_upload_selected(e){const t=e.target,i=t.files?.[0];i&&(this.upload_file(i),t.value="")}cancel_upload(){this.cancel_active_upload(),this.show_upload_modal=!1,this.upload_file_name="",this.upload_speed="--",this.status="Connected",this.refresh_directory()}cancel_download(){this.cancel_active_download(),this.show_download_modal=!1,this.download_file_name="",this.download_speed="--",this.status="Connected",this.refresh_directory()}is_selected(e){return!!this.selected_item&&this.selected_item.path===e.path&&this.selected_item.name===e.name}list_directory(e){if(!this.session_id)return void console.warn("No active session. Cannot list directory.");if("File"===e.kind)return console.warn("Cannot list directory of a file. Ignoring click."),void(this.selected_item=e);const t=[e.path,e.name].join("/");t!==this.current_dir?(this.show_loader=!0,this.selected_item=null,this.channel.send_sftp_list_data(this.nodeId,this.session_id,t)):console.warn("Already in this directory. Ignoring click.")}format_size(e){if(void 0===e||Number.isNaN(e))return"-";if(e<1024)return`${e} B`;const t=["KB","MB","GB","TB","PB"];let i=e,s=-1;for(;i>=1024&&s<t.length-1;)i/=1024,s+=1;return`${i.toFixed(i>=10?1:2)} ${t[s]}`}mode_type_to_char(e,t){switch(61440&e){case 49152:return"s";case 40960:return"l";case 32768:return"-";case 24576:return"b";case 16384:return"d";case 8192:return"c";case 4096:return"p";default:return"Folder"===t?"d":"-"}}format_permissions(e,t){if(null==e)return"-";if("string"==typeof e){const i=e.trim();if(/^[bcdlps-][rwxStTs-]{9}$/.test(i))return i;if(/^[0-7]{3,4}$/.test(i)){const e=parseInt(i,8);return this.format_permissions(e,t)}if(/^\d+$/.test(i)){const e=parseInt(i,10);return this.format_permissions(e,t)}return i||"-"}const i=e,s=this.mode_type_to_char(i,t),a=[256&i?"r":"-",128&i?"w":"-",64&i?"x":"-",32&i?"r":"-",16&i?"w":"-",8&i?"x":"-",4&i?"r":"-",2&i?"w":"-",1&i?"x":"-"];return 2048&i&&(a[2]="x"===a[2]?"s":"S"),1024&i&&(a[5]="x"===a[5]?"s":"S"),512&i&&(a[8]="x"===a[8]?"t":"T"),`${s}${a.join("")}`}render(){return i(s,{key:"6f830eb2cea173cb081eabdd7d3d418e8c831b4a",class:{default:!this.max,max:this.max}},i("section",{key:"0c028222f80a6783f4f457dd9dbb4f276c7e75cc",class:"listing"},!this.hideHeader&&i("header",{key:"bf4260a4f13173ff003885c39167177c17fb138f"},i("section",{key:"6025f57ee11cda79928158fc86be88588aeda5c1",class:"title"},i("img",{key:"1a1fc770118c2d1c027248b65c110ad948ce5860",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoNDYsIDE4NCwgMTM4KSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgICBjbGFzcz0ibHVjaWRlIGx1Y2lkZS10ZXJtaW5hbCB3LTMuNSBoLTMuNSB0ZXh0LXByaW1hcnkiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iNCAxNyAxMCAxMSA0IDUiPjwvcG9seWxpbmU+CiAgICA8bGluZSB4MT0iMTIiIHgyPSIyMCIgeTE9IjE5IiB5Mj0iMTkiPjwvbGluZT4KPC9zdmc+Cg==",alt:"SFTP Client"}),i("div",{key:"5c71b597edfd27b5d79966281cada602604ed849",class:"text"},i("div",{key:"600e8073d2d240cb599a76426a296a396201f70e",class:"name"},this.name),i("div",{key:"6d40ba59e26818071ab0f110651c8da1cbe8794c",class:"description"},this.description))),i("section",{key:"a90afbb3729ac3dc40cc16eda959a5b9028a14f3",class:"actions"},i("div",{key:"97b8b948b8bbe521cfbc91279e84ccc9e9c5b151",class:"action",onClick:()=>this.toggle_max()},i("img",{key:"6f7881d837d5b5e4f79d1dead0d53df733205899",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTE1LCAxMjMsIDE0MCkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtbWF4aW1pemUyIHctMyBoLTMiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iMTUgMyAyMSAzIDIxIDkiPjwvcG9seWxpbmU+CiAgICA8cG9seWxpbmUgcG9pbnRzPSI5IDIxIDMgMjEgMyAxNSI+PC9wb2x5bGluZT4KICAgIDxsaW5lIHgxPSIyMSIgeDI9IjE0IiB5MT0iMyIgeTI9IjEwIj48L2xpbmU+CiAgICA8bGluZSB4MT0iMyIgeDI9IjEwIiB5MT0iMjEiIHkyPSIxNCI+PC9saW5lPgo8L3N2Zz4K",alt:"Maximize"})))),i("main",{key:"58db45bcafab4c55e257831e9693591724fc9848"},this.show_navigation&&i("nav",{key:"9b0c06d3afd36a32845334375c0ec0f0f4e363ea",class:"navigation"},i("div",{key:"5b84ca2d3a55afb383fe27ed9b955d24560b0283",class:"breadcrumbs"},this.breadcrumbs.map(((e,t,s)=>i("span",{key:t,class:"breadcrumb-container"},i("span",{key:t,onClick:()=>this.list_breadcrumb(e.path),class:"breadcrumb"},e.label),t<s.length-1&&i("img",{class:"arrow",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogICAgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIKICAgIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tcmlnaHQgdy0zIGgtMyB0ZXh0LW11dGVkLWZvcmVncm91bmQvNTAgc2hyaW5rLTAiPgogICAgPHBhdGggZD0ibTkgMTggNi02LTYtNiI+PC9wYXRoPgo8L3N2Zz4K"}))))),i("section",{key:"66dd6ce5d4d85c089a869a371208c98582a33e87",class:"actions","aria-label":"SFTP actions"},i("button",{key:"105c5d93be38f4ceb1da058f5f57855decf3aa8f",type:"button",class:"action",onClick:()=>this.go_to_parent_directory(),title:"Go to parent directory","aria-label":"Go to parent directory"},i("img",{key:"8b425e80e9aa707607822b9e4ae3828ae01e4202",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtYXJyb3ctdXAgdy0zLjUgaC0zLjUiPgogICAgPHBhdGggZD0ibTUgMTIgNy03IDcgNyI+PC9wYXRoPgogICAgPHBhdGggZD0iTTEyIDE5VjUiPjwvcGF0aD4KPC9zdmc+Cg==",alt:"Go up"})),i("button",{key:"d0f01c462c3e6f52155e1307f048c5027202819b",type:"button",class:"action",onClick:()=>this.refresh_directory(),title:"Refresh","aria-label":"Refresh"},i("img",{key:"11e66f738f80032018bbe796eb8f7f42001f4b5f",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtcmVmcmVzaC1jdyB3LTMuNSBoLTMuNSI+CiAgICA8cGF0aCBkPSJNMyAxMmE5IDkgMCAwIDEgOS05IDkuNzUgOS43NSAwIDAgMSA2Ljc0IDIuNzRMMjEgOCI+PC9wYXRoPgogICAgPHBhdGggZD0iTTIxIDN2NWgtNSI+PC9wYXRoPgogICAgPHBhdGggZD0iTTIxIDEyYTkgOSAwIDAgMS05IDkgOS43NSA5Ljc1IDAgMCAxLTYuNzQtMi43NEwzIDE2Ij48L3BhdGg+CiAgICA8cGF0aCBkPSJNOCAxNkgzdjUiPjwvcGF0aD4KPC9zdmc+Cg==",alt:"Refresh"})),i("button",{key:"a39aed27376480e5e2dc68fc4b1ef57b8c4b0b40",type:"button",class:"action",onClick:()=>this.open_upload_picker(),title:"Upload","aria-label":"Upload"},i("img",{key:"fac80ba8c1283eed058e017efc45904658f91f43",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtdXBsb2FkIHctMy41IGgtMy41Ij4KICAgIDxwYXRoIGQ9Ik0yMSAxNXY0YTIgMiAwIDAgMS0yIDJINWEyIDIgMCAwIDEtMi0ydi00Ij48L3BhdGg+CiAgICA8cG9seWxpbmUgcG9pbnRzPSIxNyA4IDEyIDMgNyA4Ij48L3BvbHlsaW5lPgogICAgPGxpbmUgeDE9IjEyIiB4Mj0iMTIiIHkxPSIzIiB5Mj0iMTUiPjwvbGluZT4KPC9zdmc+Cg==",alt:"Upload"})),i("button",{key:"281854c1ac21ac8be51a22da7a5e6ac7f902f74b",type:"button",class:"action disconnect",onClick:()=>this.disconnect_session(),title:"Disconnect","aria-label":"Disconnect"},"DISCONNECT"))),i("input",{key:"9daf263acc61a2241c10817056cdb3cd8da81c9e",type:"file",ref:e=>this.uploadInputEl=e,onChange:e=>this.on_upload_selected(e),style:{display:"none"}}),this.show_content&&i("div",{key:"6611808a8f69b06bb66e2b7e82bb06e0c6469d18",class:"content"},i("table",{key:"46d758f6b01f1e48acf99d0b797c5ec538717ea0"},i("thead",{key:"7f3b4f05a2538d20efd43d21ec2d425a286d1b35"},i("tr",{key:"b9c8584bc98a5e9d24fd17346e325ccf511a109c"},i("th",{key:"93220b4f6a1f7a7ca79978f8a98fb7218eb4a353"},"Name"),i("th",{key:"a25c5948ab02ed467ba4f71314f5ebb0756e7678"},"Size"),i("th",{key:"27f32a431f5e20b4331b79ae358d7a077681a548"},"Permissions"),i("th",{key:"a3ae189c7161a3237dd2f07c50a965a0b5a51058"},"Owner"),i("th",{key:"ddc31efb5d7d3746875590ef4e52dd61375f963c"},"Modified"),i("th",{key:"590b952ac4c16a9abdb4bcce432818ef9ddb1687",class:"action-col","aria-label":"Actions"}))),i("tbody",{key:"5a35c2357ad4ff9e99dcd499ec894bc89466b4ba"},this.listing.map(((e,t)=>i("tr",{key:t,class:{selected:this.is_selected(e)},onClick:()=>this.list_directory(e)},i("td",null,i("img","Folder"===e.kind?{class:"kind",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoNDYsIDE4NCwgMTM4KSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgICBjbGFzcz0ibHVjaWRlIGx1Y2lkZS1mb2xkZXIgdy0zLjUgaC0zLjUgdGV4dC1wcmltYXJ5IHNocmluay0wIj4KICAgIDxwYXRoCiAgICAgICAgZD0iTTIwIDIwYTIgMiAwIDAgMCAyLTJWOGEyIDIgMCAwIDAtMi0yaC03LjlhMiAyIDAgMCAxLTEuNjktLjlMOS42IDMuOUEyIDIgMCAwIDAgNy45MyAzSDRhMiAyIDAgMCAwLTIgMnYxM2EyIDIgMCAwIDAgMiAyWiI+PC9wYXRoPgo8L3N2Zz4K",alt:"Folder"}:{class:"kind",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTE1LCAxMjMsIDE0MCkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtZmlsZSB3LTMuNSBoLTMuNSB0ZXh0LW11dGVkLWZvcmVncm91bmQgc2hyaW5rLTAiPgogICAgPHBhdGggZD0iTTE1IDJINmEyIDIgMCAwIDAtMiAydjE2YTIgMiAwIDAgMCAyIDJoMTJhMiAyIDAgMCAwIDItMlY3WiI+PC9wYXRoPgogICAgPHBhdGggZD0iTTE0IDJ2NGEyIDIgMCAwIDAgMiAyaDQiPjwvcGF0aD4KPC9zdmc+Cg==",alt:"File"}),i("span",{class:`name ${e.kind.toLowerCase()}`},e.name)),i("td",null,this.format_size(e.attributes.size)),i("td",null,this.format_permissions(e.attributes.permissions,e.kind)),i("td",null,e.attributes.user??"-"),i("td",null,new Date(1e3*e.attributes.modified).toLocaleString()),i("td",{class:"action-col"},"File"===e.kind&&i("div",{class:"file-actions"},i("button",{type:"button",class:"file-action",onClick:t=>this.on_file_row_action(e,t),title:"Download","aria-label":"Download"},i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},i("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),i("polyline",{points:"7 10 12 15 17 10"}),i("line",{x1:"12",x2:"12",y1:"15",y2:"3"}))),i("button",{type:"button",class:"file-action delete",onClick:t=>this.on_file_delete_action(e,t),title:"Delete","aria-label":"Delete"},i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},i("polyline",{points:"3 6 5 6 21 6"}),i("path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),i("path",{d:"M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"}),i("line",{x1:"10",x2:"10",y1:"11",y2:"17"}),i("line",{x1:"14",x2:"14",y1:"11",y2:"17"}))))))))))),this.show_loader&&i("div",{key:"137cf80c05c6fa389cf9bd3bd9003d8f4796419b",class:"loader"},"Loading..."),this.show_error&&i("div",{key:"1ba1fad888b61e18f6dfb2bcbd7bd22e0f911c6c",class:"error"},this.error_message)),i("footer",{key:"247a9ed330ff6f465cca3cae91dd045f1183d6d4"},i("section",{key:"16691e17293b7f2181d080ecb68f283110b5a887",class:"version"},this.version?`Version: ${this.version}`:""))),this.show_login_screen&&i("section",{key:"8df665b59da590cd5a4c684a9eb3a772f9265cbb",class:{creds:!0,blurred:this.show_login_screen}},i("form",{key:"efffd5be69a1ac3f2df26c174be2ebb6aa989850",class:"auth",onSubmit:e=>{const t=new FormData(e.target);let i,s;this.show_login_screen_username&&(i=t.get("username")),this.show_login_screen_password&&(s=t.get("password")),this.channel.open_sftp_tunnel(this.nodeId,this.serviceId,i,s),this.show_login_screen_username=!1,this.show_login_screen_password=!1,this.show_login_screen=!1,this.show_loader=!0,e.stopPropagation(),e.preventDefault()}},i("div",{key:"6ece35409f1cb33e953857e908b5c251265f9b7a",class:"title"},"SFTP Connection"),this.show_login_screen_username&&i("div",{key:"d2e6a109f1d68ffb21fd709f9f761b7a097973ce"},i("label",{key:"df54f92649e1e3535b368bcbdb53e2061e008d9d",htmlFor:"username"},"Username"),i("input",{key:"09724a6b262408825babdf1855daf97dd6e48274",autocorrect:"off",autocapitalize:"none",autoComplete:"off",id:"username",name:"username",type:"text",placeholder:""})),this.show_login_screen_password&&i("div",{key:"b67d7fdf364616217cf0fe7493db87f368a0e00b"},i("label",{key:"1a4f81e403e8048980848a22753dff7922a25eb8",htmlFor:"password"},"Password"),i("input",{key:"d7a806e065f81c07a682d0ace085dd80f96bb2e2",autocorrect:"off",autocapitalize:"none",autoComplete:"off",id:"password",name:"password",type:"password",placeholder:""})),i("div",{key:"eb184e90d5a99411c0c68c63c0f58b74e2b3a454"},i("button",{key:"92014931e757553af1fc785fa89dc859fed6421d",type:"submit"},"Connect")))),this.show_upload_modal&&i("section",{key:"b730e0680f0e5325f506104438e30e9f3dc6ec18",class:{"upload-modal":!0,visible:this.show_upload_modal}},i("div",{key:"80205240d2af805bede0d6d42ffefad176d0b6f6",class:"upload-dialog",role:"dialog","aria-modal":"true","aria-label":"Upload progress"},i("div",{key:"ee11974c49a3597eaee6b588c328c5d77659c2b4",class:"title"},"Uploading File"),i("div",{key:"cf24d8f350325bf9cd6f128dc5ad2b2467ff4adb",class:"file-name",title:this.upload_file_name},this.upload_file_name),i("div",{key:"e36c4cf5785166c1d9b5121066210d87cc09d4e5",class:"progress-track",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":this.upload_progress},i("div",{key:"f1db022f2d3fb92fb9686d50e4aa0366e80da8ca",class:"progress-fill",style:{width:`${this.upload_progress}%`}})),i("div",{key:"515bdf6caf6a3d0c04badc923bc8a1f24d388cfe",class:"progress-meta"},i("div",{key:"00935d340635aaa36004444b627e25732f7c17ab",class:"progress-speed"},this.upload_speed),i("div",{key:"369e5c294ac99e1f25fceb3575838e50ce5c0cb4",class:"progress-value"},this.format_percent(this.upload_progress))),i("button",{key:"c9694acf8f7cb316a9e60bf33c80279fba7f3676",type:"button",class:{cancel:!0,finished:this.upload_finished},onClick:()=>this.cancel_upload()},this.upload_finished?"Close":"Cancel"))),this.show_download_modal&&i("section",{key:"c54157cf02112940304bd5d107e442626cbc3a3a",class:{"download-modal":!0,visible:this.show_download_modal}},i("div",{key:"51cc07975f3cb4d8d5dd29a457a2cb56d58c2bc3",class:"download-dialog",role:"dialog","aria-modal":"true","aria-label":"Download progress"},i("div",{key:"fa15597119c5656530b136a0796ba498d05f7ba3",class:"title"},"Downloading File"),i("div",{key:"a12e3b257a91a30323c018dcd0117ddcfde7ec9d",class:"file-name",title:this.download_file_name},this.download_file_name),i("div",{key:"788db1afcf3506ee26dc7965060b5213b1285379",class:"progress-track",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":this.download_progress},i("div",{key:"9842d1e20a24bcbb5185918b2373818414a86bb6",class:"progress-fill",style:{width:`${this.download_progress}%`}})),i("div",{key:"26347a189b2fc3b0594a548cb15aeaa6e1ca2901",class:"progress-meta"},i("div",{key:"c2acfab8ec6d6c74df299f7b7b1f8bdcb88702db",class:"progress-speed"},this.download_speed),i("div",{key:"853c8b4b8fb5d9d13cd5c654bfdeda02b4f4e097",class:"progress-value"},this.format_percent(this.download_progress))),i("button",{key:"40a339398d29082b1532cd1d13fec2027a5c0c84",type:"button",class:{cancel:!0,finished:this.download_finished},onClick:()=>this.cancel_download()},this.download_finished?"Close":"Cancel"))),this.show_delete_modal&&i("section",{key:"07ca147451fe3063aa418ee46af09d5d037752cc",class:{"delete-modal":!0,visible:this.show_delete_modal}},i("div",{key:"5c11193b4808d43d33151cb5eebf8efa54ec75bd",class:"delete-dialog",role:"dialog","aria-modal":"true","aria-label":"Delete confirmation"},i("div",{key:"858d54eddbb5ed0b72176494ac515fc4c7b16dfc",class:"title"},"Delete File"),i("div",{key:"df347ceded9b6e8b44285e0b4122cd363c2504a2",class:"message"},this.delete_loading?"Deleting file...":"Are you sure you want to delete this file?"),i("div",{key:"c547c48ba66daabb9bed82d220d87b8b0eef25b3",class:"file-name",title:this.delete_file_name},this.delete_file_name),this.delete_loading&&i("div",{key:"a3fd5cf9a93a5d2937a10d8333bb2dd6abe73254",class:"delete-loader","aria-hidden":"true"},i("span",{key:"ca4414ae7183139b1ff8b36630e330f05896c0fd",class:"spinner"})),i("div",{key:"e229b2804e7cbed6edbbd1b6542b7a33ac1c0575",class:"modal-actions"},i("button",{key:"eedf2e90f7896fcce7db6bad995c890d79ec9361",type:"button",class:"btn secondary",onClick:()=>this.cancel_delete(),disabled:this.delete_loading},"Cancel"),i("button",{key:"010e0b6468eb7522f7131e2a37d4b25fad828837",type:"button",class:"btn destructive",onClick:()=>this.confirm_delete(),disabled:this.delete_loading},this.delete_loading?"Deleting...":"Delete")))))}static get watchers(){return{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}}};c.style=":host{--radius:0.375rem;--card:220 18% 10%;--border:220 15% 18%;--primary:160 60% 45%;--radius:0.375rem;--destructive:0 70% 50%;--muted:220 15% 13%;--muted-foreground:220 10% 50%;--primary-foreground:220 20% 7%;--scroll-track:220 16% 12%;--scroll-thumb:220 12% 34%;--scroll-thumb-hover:160 45% 44%;font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;height:100%;width:100%;border:1px solid hsl(var(--border));background-color:hsl(var(--card));border-radius:var(--radius);overflow:hidden;display:flex;flex-direction:column;position:relative;container-type:inline-size;.listing{height:100%;display:flex;flex-direction:column;justify-content:space-between;min-height:0;header{height:30px;background:rgba(28, 31, 38, 0.6);border-bottom:1px solid hsl(var(--border));display:flex;align-items:center;justify-content:space-between;.actions{display:flex;align-items:center;.action{cursor:pointer;padding:4px;display:flex;align-items:center;z-index:1;img{height:14px;padding:4px;border-radius:4px}&:hover{background-color:hsl(var(--border) / 0.6)}}}.title{color:hsl(var(--primary));height:14px;padding:0 12px;display:flex;align-items:center;font-size:0.75rem;line-height:1rem;img{height:14px;margin-right:5px}.text{display:flex;flex-direction:row;justify-content:center;margin-top:2px;.name{margin-right:10px}.description{color:hsl(var(--muted-foreground))}}}}main{flex:1;display:flex;flex-direction:column;position:relative;min-height:0;overflow:hidden;.loader{color:hsl(var(--muted-foreground));font-size:13px;animation:pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;text-align:center;display:flex;align-items:center;justify-content:center;position:absolute;height:100%;width:100%;background:rgba(28, 31, 38, 0);backdrop-filter:blur(4px)}.error{font-size:13px;text-align:center;color:hsl(var(--destructive));height:100%;display:flex;align-items:center;justify-content:center}.navigation{height:25px;padding:10px;font-size:0.75rem;line-height:1rem;background-color:hsl(var(--card));display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid hsl(var(--border));position:sticky;top:0;z-index:3;.breadcrumbs{display:flex;align-items:center;margin-right:10px;.breadcrumb-container{white-space:nowrap;.breadcrumb{color:hsl(var(--primary));margin-right:4px;cursor:pointer;&:after{margin-left:4px}&:hover{color:rgb(189, 219, 209)}&:last-child{margin-right:0;color:rgb(189, 219, 209);cursor:default}}}.arrow{height:12px;width:12px;opacity:0.6;top:2px;margin-right:4px;position:relative}}.actions{display:flex;align-items:center;gap:8px}.action{border:none;background:transparent;color:rgb(189, 219, 209);font-size:1.1rem;line-height:1;padding:2px 4px;border-radius:4px;cursor:pointer;&:hover{background-color:hsl(var(--border) / 0.6)}img{height:14px;width:14px;display:block}}.action.disconnect{color:#ff4d5f;font-size:0.65rem;letter-spacing:0.08em;padding:4px 8px;&:hover{color:#ff6b7a;background-color:hsl(var(--destructive) / 0.12)}}}.content{flex:1;min-height:0;overflow:auto;font-size:0.75rem;line-height:1rem;scrollbar-width:thin;scrollbar-color:hsl(var(--scroll-thumb)) hsl(var(--scroll-track));&::-webkit-scrollbar{width:10px;height:10px}&::-webkit-scrollbar-track{background:hsl(var(--scroll-track))}&::-webkit-scrollbar-thumb{background:hsl(var(--scroll-thumb));border-radius:999px;border:2px solid hsl(var(--scroll-track))}&::-webkit-scrollbar-thumb:hover{background:hsl(var(--scroll-thumb-hover))}table{width:100%;border-collapse:separate;border-spacing:0;table-layout:auto;thead{background-color:hsl(var(--muted));border-bottom:1px solid hsl(var(--border));th{padding:8px 10px;text-align:left;color:hsl(var(--muted-foreground));position:sticky;top:0;z-index:2;background-color:hsl(var(--muted));border-bottom:1px solid hsl(var(--border));line-height:0.95rem;&.action-col{width:58px;min-width:58px;padding:0 10px}&:first-child{width:30%;min-width:180px;max-width:195px}&:nth-child(2),&:nth-child(3),&:nth-child(4),&:nth-child(5){white-space:nowrap;width:1%}}}tbody{padding:10px 10px;tr{border-bottom:1px solid hsl(var(--border) / 0.4);td{padding:10px 10px 9px;color:hsl(var(--muted-foreground));&:first-child{min-width:180px;max-width:195px;white-space:nowrap;.name{display:inline-block;max-width:calc(100% - 26px);overflow:hidden;text-overflow:ellipsis;vertical-align:middle}}&:nth-child(2),&:nth-child(3),&:nth-child(4),&:nth-child(5){white-space:nowrap}&.action-col{width:58px;min-width:58px;text-align:center;padding-left:1px;padding-right:1px;.file-actions{display:flex;align-items:center;justify-content:center;gap:8px}.file-action{border:none;background:transparent;color:hsl(var(--muted-foreground));width:16px;height:16px;border-radius:3px;cursor:pointer;opacity:0;visibility:hidden;pointer-events:none;transition:opacity 120ms ease;padding:0;svg{width:12px;height:12px;display:block;margin:0 auto}&:hover{color:hsl(var(--primary))}&.delete:hover{color:hsl(var(--destructive))}}}.name{&.file{color:rgb(189, 219, 209)}&.folder{color:hsl(var(--primary))}}.kind{height:14px;width:14px;margin-right:5px;top:3px;position:relative}}&:hover{cursor:pointer;background-color:hsl(var(--muted) / 0.4);td.action-col .file-action{opacity:1;visibility:visible;pointer-events:auto;color:hsl(var(--primary))}}&.selected{background-color:hsl(var(--primary) / 0.3);td.action-col .file-action{opacity:1;visibility:visible;pointer-events:auto}&:hover{background-color:hsl(var(--primary) / 0.4)}}}}}}}footer{height:25px;background:rgba(28, 31, 38, 0.6);border-top:1px solid hsl(var(--border));font-size:0.75rem;line-height:1rem;display:flex;align-items:center;justify-content:space-between;padding:0 10px;.status{font-size:0.65rem;color:hsl(var(--muted-foreground));.selected-item{margin-left:10px;color:hsl(var(--primary))}}.version{font-size:0.65rem;color:hsl(var(--muted-foreground))}}}.creds{position:absolute;top:0;left:0;height:100%;width:100%;display:flex;justify-content:center;align-items:center;;&.blurred{background:rgba(28, 31, 38, 0);backdrop-filter:blur(4px)}.auth{display:flex;flex-direction:column;background:hsl(var(--card));position:relative;background-color:rgba(21, 24, 30, 0.95);border:1px solid hsl(var(--border));padding:30px;box-shadow:rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.5) 0px 25px 50px -12px;border-radius:var(--radius);.title{margin-bottom:12px;color:hsl(var(--primary))}label{font-size:0.75rem;line-height:1rem;margin-bottom:1rem;color:hsl(var(--muted-foreground))}input{font-size:0.875rem;line-height:1.25rem;padding-top:0.5rem;padding-bottom:0.5rem;padding-left:0.75rem;padding-right:0.75rem;background-color:rgb(28, 31, 38);border-color:rgb(39, 44, 53);border-width:1px;border-radius:calc(var(--radius) - 2px);width:100%;margin-bottom:12px;color:rgb(189, 219, 209);box-sizing:border-box;&:focus{outline:none;border-color:hsl(var(--primary));box-shadow:0 0 0 1px hsl(var(--primary))}}button[type='submit']{margin-top:12px;width:100%;background-color:hsl(var(--primary));color:hsl(var(--primary-foreground));letter-spacing:0.05em;font-size:13px;font-weight:500;padding:0.5rem 1rem;border-radius:calc(var(--radius) - 2px);height:2rem;cursor:pointer;border:none;&:hover{background-color:hsl(var(--primary) / 0.9)}}}}.upload-modal,.download-modal,.delete-modal{position:absolute;inset:0;display:none;align-items:center;justify-content:center;background:rgba(28, 31, 38, 0);backdrop-filter:blur(4px);z-index:6;&.visible{display:flex}.upload-dialog,.download-dialog,.delete-dialog{width:min(360px, calc(100% - 24px));background-color:rgba(21, 24, 30, 0.96);border:1px solid hsl(var(--border));border-radius:var(--radius);padding:16px;box-shadow:rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.5) 0px 25px 50px -12px;.title{color:hsl(var(--primary));font-size:0.8rem;margin-bottom:8px}.file-name{color:rgb(189, 219, 209);font-size:0.72rem;line-height:1rem;margin-bottom:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.progress-track{width:100%;height:10px;border-radius:999px;background-color:hsl(var(--muted));overflow:hidden;border:1px solid hsl(var(--border));.progress-fill{height:100%;width:0;background:linear-gradient(90deg, hsl(var(--primary) / 0.7), hsl(var(--primary)));transition:width 140ms ease}}.progress-meta{margin-top:8px;margin-bottom:12px;display:flex;align-items:center;justify-content:space-between;gap:10px}.progress-speed{color:hsl(var(--muted-foreground));font-size:0.75rem;font-variant-numeric:tabular-nums;line-height:1.4;text-align:left}.progress-value{color:hsl(var(--muted-foreground));font-size:0.75rem;font-variant-numeric:tabular-nums;line-height:1.4;text-align:right}.cancel{margin-top:14px;width:100%;height:2rem;border:1px solid hsl(var(--border));border-radius:calc(var(--radius) - 2px);background:hsl(var(--muted));color:rgb(189, 219, 209);font-size:0.75rem;letter-spacing:0.03em;cursor:pointer;&:hover{border-color:hsl(var(--primary));color:hsl(var(--primary))}&.finished{background-color:hsl(var(--primary));border-color:hsl(var(--primary));color:hsl(var(--primary-foreground));&:hover{background-color:hsl(var(--primary) / 0.9);border-color:hsl(var(--primary) / 0.9);color:hsl(var(--primary-foreground))}}}.message{color:rgb(189, 219, 209);font-size:0.74rem;line-height:1rem;margin-bottom:8px}.modal-actions{margin-top:14px;display:grid;grid-template-columns:1fr 1fr;gap:8px;.btn{height:2rem;border:1px solid hsl(var(--border));border-radius:calc(var(--radius) - 2px);font-size:0.75rem;letter-spacing:0.03em;cursor:pointer;&:disabled{opacity:0.65;cursor:not-allowed}}.btn.secondary{background:hsl(var(--muted));color:rgb(189, 219, 209);&:hover{border-color:hsl(var(--primary));color:hsl(var(--primary))}}.btn.destructive{background:hsl(var(--destructive));border-color:hsl(var(--destructive));color:white;&:hover{background:hsl(var(--destructive) / 0.9);border-color:hsl(var(--destructive) / 0.9)}}}.delete-loader{margin-top:4px;display:flex;justify-content:center;.spinner{width:16px;height:16px;border:2px solid hsl(var(--muted-foreground) / 0.35);border-top-color:hsl(var(--primary));border-radius:50%;animation:spin 0.7s linear infinite}}}}}@keyframes spin{to{transform:rotate(360deg)}}:host(.max){height:100vh;width:100vw;position:fixed;top:0;left:0;z-index:9999}@container (max-width: 699px){:host .listing main .content table thead th:nth-child(4),:host .listing main .content table tbody td:nth-child(4){display:none}}@container (max-width: 635px){:host .listing main .content table thead th:nth-child(3),:host .listing main .content table tbody td:nth-child(3){display:none}}@container (max-width: 530px){:host .listing main .content table thead th:nth-child(5),:host .listing main .content table tbody td:nth-child(5){display:none}:host .listing footer .status{display:none}}@container (max-width: 370px){:host .listing main .content table thead th:nth-child(2),:host .listing main .content table tbody td:nth-child(2){display:none}:host .listing main .content table thead th:first-child,:host .listing main .content table tbody td:first-child{width:100%;min-width:0;max-width:none}:host .listing main .content table tbody td:first-child .name{max-width:100%}}@container (max-width: 295px){:host .listing main .content table tbody td:first-child .name{max-width:120px}}";export{c as phirepass_sftp_client}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
function t(t,e,n){const o="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==o;){const o=Object.getOwnPropertyDescriptor(t,e);if(o&&(!n||o.get))return o;t=Object.getPrototypeOf(t)}}var e,n=(e,n)=>{var o;Object.entries(null!=(o=n.o.t)?o:{}).map((([o,[l]])=>{if(31&l||32&l){const l=e[o],i=t(Object.getPrototypeOf(e),o,!0)||Object.getOwnPropertyDescriptor(e,o);i&&Object.defineProperty(e,o,{get(){return i.get.call(this)},set(t){i.set.call(this,t)},configurable:!0,enumerable:!0}),n.l.has(o)?e[o]=n.l.get(o):void 0!==l&&(e[o]=l)}}))},o=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},l=(t,e)=>{e&&(t.__stencil__getHostRef=()=>e,e.i=t,512&e.o.u&&n(t,e))},i=(t,e)=>e in t,s=(t,e)=>(0,console.error)(t,e),r=new Map,c=new Map,u=new Map,f="undefined"!=typeof window?window:{},a={u:0,p:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o),ce:(t,e)=>new CustomEvent(t,e)},d=t=>Promise.resolve(t),p=(()=>{try{return!!f.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),h=!!p&&(()=>!!f.document&&Object.getOwnPropertyDescriptor(f.document.adoptedStyleSheets,"length").writable)(),v=!1,m=[],b=[],y=()=>{var t;return(null==(t=f.document)?void 0:t.hidden)?j(g):a.raf(g)},w=(t,e)=>n=>{t.push(n),v||(v=!0,e&&4&a.u?j(g):y())},$=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){s(t)}t.length=0},g=()=>{$(m),$(b),(v=m.length>0)&&y()},j=t=>d().then(t),O=w(b,!0);function S(){const t=this.attachShadow({mode:"open"});void 0===e&&(e=null),e&&(h?t.adoptedStyleSheets.push(e):t.adoptedStyleSheets=[...t.adoptedStyleSheets,e])}function k(t){var e,n,o;return null!=(o=null==(n=null==(e=t.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}var M,E=new WeakMap,C=t=>"sc-"+t.h,x=t=>"object"==(t=typeof t)||"function"===t,N=(t,e,...n)=>{let o=null,l=null,i=!1,r=!1;const c=[],u=e=>{for(let n=0;n<e.length;n++)if(o=e[n],Array.isArray(o))u(o);else if(null!=o&&"boolean"!=typeof o){if(i="function"!=typeof t&&!x(o))o+="";else if("function"!=typeof t&&void 0===o.u){s("Invalid vNode child");continue}i&&r?c[c.length-1].v+=o:c.push(i?A(null,o):o),r=i}};if(u(n),e){e.key&&(l=e.key);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}const f=A(t,null);return f.m=e,c.length>0&&(f.$=c),f.j=l,f},A=(t,e)=>({u:0,O:t,v:null!=e?e:null,S:null,$:null,m:null,j:null}),L={},P=t=>{if(!t)return;const e=Object.keys(t);if(0===e.length)return;let n=!1;for(const o of e){if(n)break;for(const e of t[o])if("string"==typeof e){n=!0;break}}if(!n)return t;const o={};for(const n of e)o[n]=t[n].map((t=>"string"==typeof t?{[t]:0}:t));return o},R=(t,e)=>null==t||x(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?"string"==typeof t?parseFloat(t):"number"==typeof t?t:NaN:1&e?t+"":t,T=t=>{var e;return null==(e=o(t))?void 0:e.$hostElement$},D=(t,e)=>{const n=T(t);return{emit:t=>H(n,e,{bubbles:!0,composed:!0,cancelable:!0,detail:t})}},H=(t,e,n)=>{const o=a.ce(e,n);return t.dispatchEvent(o),o},U=(t,e,n,l,s,r)=>{if(n===l)return;let c=i(t,e),u=e.toLowerCase();if("class"===e){const e=t.classList,o=V(n);let i=V(l);e.remove(...o.filter((t=>t&&!i.includes(t)))),e.add(...i.filter((t=>t&&!o.includes(t))))}else if("style"===e){for(const e in n)l&&null!=l[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in l)n&&l[e]===n[e]||(e.includes("-")?t.style.setProperty(e,l[e]):t.style[e]=l[e])}else if("key"===e);else if("ref"===e)l&&ot(l,t);else if(c||"o"!==e[0]||"n"!==e[1]){if("a"===e[0]&&e.startsWith("attr:")){const n=e.slice(5);let i;{const e=o(t);if(e&&e.o&&e.o.t){const t=e.o.t[n];t&&t[1]&&(i=t[1])}}return i||(i=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==l||!1===l?!1===l&&""!==t.getAttribute(i)||t.removeAttribute(i):t.setAttribute(i,!0===l?"":l))}if("p"===e[0]&&e.startsWith("prop:")){const n=e.slice(5);try{t[n]=l}catch(t){}return}{const o=x(l);if((c||o&&null!==l)&&!s)try{if(t.tagName.includes("-"))t[e]!==l&&(t[e]=l);else{const o=null==l?"":l;"list"===e?c=!1:null!=n&&t[e]===o||("function"==typeof t.__lookupSetter__(e)?t[e]=o:t.setAttribute(e,o))}}catch(t){}null==l||!1===l?(!1!==l||""===t.getAttribute(e)||4&r&&!z(e))&&t.removeAttribute(e):(!c||4&r||s)&&!o&&1===t.nodeType&&t.setAttribute(e,l=!0===l?"":l)}}else if(e="-"===e[2]?e.slice(3):i(f,u)?u.slice(2):u[2]+e.slice(3),n||l){const o=e.endsWith(q);e=e.replace(B,""),n&&a.rel(t,e,n,o),l&&a.ael(t,e,l,o)}},W=new Set(["draggable","contenteditable","spellcheck"]),z=t=>W.has(t)||t.startsWith("aria-"),F=/\s/,V=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(F):[]),q="Capture",B=RegExp(q+"$"),G=(t,e,n)=>{const o=11===e.S.nodeType&&e.S.host?e.S.host:e.S,l=t&&t.m||{},i=e.m||{};for(const t of I(Object.keys(l)))t in i||U(o,t,l[t],void 0,n,e.u);for(const t of I(Object.keys(i)))U(o,t,l[t],i[t],n,e.u)};function I(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var Y=!1,Z=!1,_=[],J=[],K=(t,e,n)=>{const o=e.$[n];let l,i,s=0;if(null!=o.v)l=o.S=f.document.createTextNode(o.v);else{if(Z||(Z="svg"===o.O),!f.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(l=o.S=f.document.createElementNS(Z?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o.O),Z&&"foreignObject"===o.O&&(Z=!1),G(null,o,Z),o.$){const e="template"===o.O?l.content:l;for(s=0;s<o.$.length;++s)i=K(t,o,s),i&&e.appendChild(i)}"svg"===o.O?Z=!1:"foreignObject"===l.tagName&&(Z=!0)}return l["s-hn"]=M,l},Q=(t,e,n,o,l,i)=>{let s,r=t;for(r.shadowRoot&&r.tagName===M&&(r=r.shadowRoot),"template"===n.O&&(r=r.content);l<=i;++l)o[l]&&(s=K(null,n,l),s&&(o[l].S=s,lt(r,s,e)))},X=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.S;nt(e),t&&t.remove()}}},tt=(t,e,n=!1)=>t.O===e.O&&(n?(n&&!t.j&&e.j&&(t.j=e.j),!0):t.j===e.j),et=(t,e,n=!1)=>{const o=e.S=t.S,l=t.$,i=e.$,s=e.O,r=e.v;null==r?(Z="svg"===s||"foreignObject"!==s&&Z,"slot"!==s||Y||t.k!==e.k&&(e.S["s-sn"]=e.k||"",(t=>{a.u|=1;const e=t.closest(M.toLowerCase());if(null!=e){const n=Array.from(e.__childNodes||e.childNodes).find((t=>t["s-cr"])),o=Array.from(t.__childNodes||t.childNodes);for(const t of n?o.reverse():o)null!=t["s-sh"]&&(lt(e,t,null!=n?n:null),t["s-sh"]=void 0)}a.u&=-2})(e.S.parentElement)),G(t,e,Z),null!==l&&null!==i?((t,e,n,o,l=!1)=>{let i,s,r=0,c=0,u=0,f=0,a=e.length-1,d=e[0],p=e[a],h=o.length-1,v=o[0],m=o[h];const b="template"===n.O?t.content:t;for(;r<=a&&c<=h;)if(null==d)d=e[++r];else if(null==p)p=e[--a];else if(null==v)v=o[++c];else if(null==m)m=o[--h];else if(tt(d,v,l))et(d,v,l),d=e[++r],v=o[++c];else if(tt(p,m,l))et(p,m,l),p=e[--a],m=o[--h];else if(tt(d,m,l))et(d,m,l),lt(b,d.S,p.S.nextSibling),d=e[++r],m=o[--h];else if(tt(p,v,l))et(p,v,l),lt(b,p.S,d.S),p=e[--a],v=o[++c];else{for(u=-1,f=r;f<=a;++f)if(e[f]&&null!==e[f].j&&e[f].j===v.j){u=f;break}u>=0?(s=e[u],s.O!==v.O?i=K(e&&e[c],n,u):(et(s,v,l),e[u]=void 0,i=s.S),v=o[++c]):(i=K(e&&e[c],n,c),v=o[++c]),i&<(d.S.parentNode,i,d.S)}r>a?Q(t,null==o[h+1]?null:o[h+1].S,n,o,c,h):c>h&&X(e,r,a)})(o,l,e,i,n):null!==i?(null!==t.v&&(o.textContent=""),Q(o,null,e,i,0,i.length-1)):!n&&null!==l&&X(l,0,l.length-1),Z&&"svg"===s&&(Z=!1)):t.v!==r&&(o.data=r)},nt=t=>{t.m&&t.m.ref&&_.push((()=>t.m.ref(null))),t.$&&t.$.map(nt)},ot=(t,e)=>{J.push((()=>t(e)))},lt=(t,e,n)=>null==t?void 0:t.insertBefore(e,n),it=(t,e)=>{if(e&&!t.M&&e["s-p"]){const n=e["s-p"].push(new Promise((o=>t.M=()=>{e["s-p"].splice(n-1,1),o()})))}},st=(t,e)=>{if(t.u|=16,4&t.u)return void(t.u|=512);it(t,t.C);const n=()=>rt(t,e);if(!e)return O(n);queueMicrotask((()=>{n()}))},rt=(t,e)=>{const n=t.$hostElement$,o=t.i;if(!o)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 l;return e?(t.N.length&&t.N.forEach((t=>t(n))),l=ht(o,"componentWillLoad",void 0,n)):l=ht(o,"componentWillUpdate",void 0,n),l=ct(l,(()=>ht(o,"componentWillRender",void 0,n))),ct(l,(()=>ft(t,o,e)))},ct=(t,e)=>ut(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),ut=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,ft=async(t,e,n)=>{var o;const l=t.$hostElement$,i=l["s-rc"];n&&(t=>{const e=t.o,n=t.$hostElement$,o=e.u,l=((t,e)=>{var n,o,l;const i=C(e),s=u.get(i);if(!f.document)return i;if(t=11===t.nodeType?t:f.document,s)if("string"==typeof s){let l,r=E.get(t=t.head||t);if(r||E.set(t,r=new Set),!r.has(i)){l=f.document.createElement("style"),l.textContent=s;const c=null!=(n=a.A)?n:k(f.document);if(null!=c&&l.setAttribute("nonce",c),!(1&e.u))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(l,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(p){const e=new(null!=(o=t.defaultView)?o:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(s),h?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.textContent=s+e.textContent:t.prepend(l)}else t.append(l);1&e.u&&t.insertBefore(l,null),4&e.u&&(l.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),r&&r.add(i)}}else{let e=E.get(t);if(e||E.set(t,e=new Set),!e.has(i)){const n=null!=(l=t.defaultView)?l:t.ownerDocument.defaultView;let o;if(s.constructor===n.CSSStyleSheet)o=s;else{o=new n.CSSStyleSheet;for(let t=0;t<s.cssRules.length;t++)o.insertRule(s.cssRules[t].cssText,t)}h?t.adoptedStyleSheets.push(o):t.adoptedStyleSheets=[...t.adoptedStyleSheets,o],e.add(i)}}return i})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&o&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(t);at(t,e,l,n),i&&(i.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>dt(t);0===e.length?n():(Promise.all(e).then(n).catch(n),t.u|=4,e.length=0)}},at=(t,e,n,o)=>{try{e=e.render(),t.u&=-17,t.u|=2,((t,e,n=!1)=>{const o=t.$hostElement$,l=t.o,i=t.L||A(null,null),s=(t=>t&&t.O===L)(e)?e:N(null,null,e);if(M=o.tagName,n&&s.m)for(const t of Object.keys(s.m))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(s.m[t]=o[t]);s.O=null,s.u|=4,t.L=s,s.S=i.S=o.shadowRoot||o,Y=!(!(1&l.u)||128&l.u),et(i,s,n),_.forEach((t=>t())),_.length=0,J.forEach((t=>t())),J.length=0})(t,e,o)}catch(e){s(e,t.$hostElement$)}return null},dt=t=>{const e=t.$hostElement$,n=t.i,o=t.C;ht(n,"componentDidRender",void 0,e),64&t.u?ht(n,"componentDidUpdate",void 0,e):(t.u|=64,vt(e),ht(n,"componentDidLoad",void 0,e),t.P(e),o||pt()),t.R(e),t.M&&(t.M(),t.M=void 0),512&t.u&&j((()=>st(t,!1))),t.u&=-517},pt=()=>{j((()=>H(f,"appload",{detail:{namespace:"phirepass-widgets"}})))},ht=(t,e,n,o)=>{if(t&&t[e])try{return t[e](n)}catch(t){s(t,o)}},vt=t=>t.classList.add("hydrated"),mt=(t,e,n,l)=>{const i=o(t);if(!i)return;if(!i)throw Error(`Couldn't find host element for "${l.h}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`);const r=i.$hostElement$,c=i.l.get(e),u=i.u,f=i.i;if(n=R(n,l.t[e][0]),!(8&u&&void 0!==c||n===c||Number.isNaN(c)&&Number.isNaN(n))){if(i.l.set(e,n),l.T){const t=l.T[e];t&&t.map((t=>{try{const[[o,l]]=Object.entries(t);(128&u||1&l)&&(f?f[o](n,c,e):i.N.push((()=>{i.i[o](n,c,e)})))}catch(t){s(t,r)}}))}if(2&u){if(f.componentShouldUpdate&&!1===f.componentShouldUpdate(n,c,e)&&!(16&u))return;16&u||st(i,!1)}}},bt=(e,n,l)=>{var i,s;const r=e.prototype;{e.watchers&&!n.T&&(n.T=P(e.watchers)),e.deserializers&&!n.D&&(n.D=e.deserializers),e.serializers&&!n.H&&(n.H=e.serializers);const c=Object.entries(null!=(i=n.t)?i:{});if(c.map((([e,[i]])=>{if(31&i||2&l&&32&i){const{get:s,set:c}=t(r,e)||{};s&&(n.t[e][0]|=2048),c&&(n.t[e][0]|=4096),(1&l||!s)&&Object.defineProperty(r,e,{get(){{if(!(2048&n.t[e][0]))return((t,e)=>o(this).l.get(e))(0,e);const t=o(this),l=t?t.i:r;if(!l)return;return l[e]}},configurable:!0,enumerable:!0}),Object.defineProperty(r,e,{set(t){const s=o(this);if(s){if(c)return void 0===(32&i?this[e]:s.$hostElement$[e])&&s.l.get(e)&&(t=s.l.get(e)),c.call(this,R(t,i)),void mt(this,e,t=32&i?this[e]:s.$hostElement$[e],n);{if(!(1&l&&4096&n.t[e][0]))return mt(this,e,t,n),void(1&l&&!s.i&&s.N.push((()=>{4096&n.t[e][0]&&s.i[e]!==s.l.get(e)&&(s.i[e]=t)})));const o=()=>{const o=s.i[e];!s.l.get(e)&&o&&s.l.set(e,o),s.i[e]=R(t,i),mt(this,e,s.i[e],n)};s.i?o():s.N.push((()=>{o()}))}}}})}else 1&l&&64&i&&Object.defineProperty(r,e,{value(...t){var n;const l=o(this);return null==(n=null==l?void 0:l.U)?void 0:n.then((()=>{var n;return null==(n=l.i)?void 0:n[e](...t)}))}})})),1&l){const t=new Map;r.attributeChangedCallback=function(e,l,i){a.jmp((()=>{var s;const u=t.get(e),f=o(this);if(this.hasOwnProperty(u)&&(i=this[u],delete this[u]),r.hasOwnProperty(u)&&"number"==typeof this[u]&&this[u]==i)return;if(null==u){const t=null==f?void 0:f.u;if(f&&t&&!(8&t)&&i!==l){const o=f.i,r=null==(s=n.T)?void 0:s[e];null==r||r.forEach((n=>{const[[s,r]]=Object.entries(n);null!=o[s]&&(128&t||1&r)&&o[s].call(o,i,l,e)}))}return}const a=c.find((([t])=>t===u)),d=a&&4&a[1][0],p=d&&null===i&&void 0===this[u];d&&(i=null!==i&&"false"!==i);const h=Object.getOwnPropertyDescriptor(r,u);p||i==this[u]||h.get&&!h.set||(this[u]=i)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=n.T)?s:{}),...c.filter((([t,e])=>31&e[0])).map((([e,n])=>{const o=n[1]||e;return t.set(o,e),o}))]))}}return e},yt=async(t,e,n)=>{var o;let l;try{if(!(32&e.u)){if(e.u|=32,e.u&=-1025,n.W){const i=((t,e)=>{var n;const o=t.h.replace(/-/g,"_"),l=t.W;if(!l)return;const i=r.get(l);if(i)return i[o];const u=null!=(n=c.get(l))?n:0,f=[u>0?"s-retry="+u:"",""].filter(Boolean).join("&");
|
|
1
|
+
function t(t,e,n){const o="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==o;){const o=Object.getOwnPropertyDescriptor(t,e);if(o&&(!n||o.get))return o;t=Object.getPrototypeOf(t)}}var e,n=(e,n)=>{var o;Object.entries(null!=(o=n.o.t)?o:{}).map((([o,[l]])=>{if(31&l||32&l){const l=e[o],i=t(Object.getPrototypeOf(e),o,!0)||Object.getOwnPropertyDescriptor(e,o);i&&Object.defineProperty(e,o,{get(){return i.get.call(this)},set(t){i.set.call(this,t)},configurable:!0,enumerable:!0}),n.l.has(o)?e[o]=n.l.get(o):void 0!==l&&(e[o]=l)}}))},o=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},l=(t,e)=>{e&&(t.__stencil__getHostRef=()=>e,e.i=t,512&e.o.u&&n(t,e))},i=(t,e)=>e in t,s=(t,e)=>(0,console.error)(t,e),r=new Map,c=new Map,u=new Map,f="undefined"!=typeof window?window:{},a={u:0,p:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o),ce:(t,e)=>new CustomEvent(t,e)},d=t=>Promise.resolve(t),p=(()=>{try{return!!f.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),h=!!p&&(()=>!!f.document&&Object.getOwnPropertyDescriptor(f.document.adoptedStyleSheets,"length").writable)(),v=!1,m=[],b=[],y=()=>{var t;return(null==(t=f.document)?void 0:t.hidden)?j(g):a.raf(g)},w=(t,e)=>n=>{t.push(n),v||(v=!0,e&&4&a.u?j(g):y())},$=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){s(t)}t.length=0},g=()=>{$(m),$(b),(v=m.length>0)&&y()},j=t=>d().then(t),O=w(b,!0);function S(){const t=this.attachShadow({mode:"open"});void 0===e&&(e=null),e&&(h?t.adoptedStyleSheets.push(e):t.adoptedStyleSheets=[...t.adoptedStyleSheets,e])}function k(t){var e,n,o;return null!=(o=null==(n=null==(e=t.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}var M,E=new WeakMap,C=t=>"sc-"+t.h,x=t=>"object"==(t=typeof t)||"function"===t,N=(t,e,...n)=>{let o=null,l=null,i=!1,r=!1;const c=[],u=e=>{for(let n=0;n<e.length;n++)if(o=e[n],Array.isArray(o))u(o);else if(null!=o&&"boolean"!=typeof o){if(i="function"!=typeof t&&!x(o))o+="";else if("function"!=typeof t&&void 0===o.u){s("Invalid vNode child");continue}i&&r?c[c.length-1].v+=o:c.push(i?A(null,o):o),r=i}};if(u(n),e){e.key&&(l=e.key);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}const f=A(t,null);return f.m=e,c.length>0&&(f.$=c),f.j=l,f},A=(t,e)=>({u:0,O:t,v:null!=e?e:null,S:null,$:null,m:null,j:null}),L={},P=t=>{if(!t)return;const e=Object.keys(t);if(0===e.length)return;let n=!1;for(const o of e){if(n)break;for(const e of t[o])if("string"==typeof e){n=!0;break}}if(!n)return t;const o={};for(const n of e)o[n]=t[n].map((t=>"string"==typeof t?{[t]:0}:t));return o},R=(t,e)=>null==t||x(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?"string"==typeof t?parseFloat(t):"number"==typeof t?t:NaN:1&e?t+"":t,T=t=>{var e;return null==(e=o(t))?void 0:e.$hostElement$},D=(t,e)=>{const n=T(t);return{emit:t=>H(n,e,{bubbles:!0,composed:!0,cancelable:!0,detail:t})}},H=(t,e,n)=>{const o=a.ce(e,n);return t.dispatchEvent(o),o},U=(t,e,n,l,s,r)=>{if(n===l)return;let c=i(t,e),u=e.toLowerCase();if("class"===e){const e=t.classList,o=V(n);let i=V(l);e.remove(...o.filter((t=>t&&!i.includes(t)))),e.add(...i.filter((t=>t&&!o.includes(t))))}else if("style"===e){for(const e in n)l&&null!=l[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in l)n&&l[e]===n[e]||(e.includes("-")?t.style.setProperty(e,l[e]):t.style[e]=l[e])}else if("key"===e);else if("ref"===e)l&&ot(l,t);else if(c||"o"!==e[0]||"n"!==e[1]){if("a"===e[0]&&e.startsWith("attr:")){const n=e.slice(5);let i;{const e=o(t);if(e&&e.o&&e.o.t){const t=e.o.t[n];t&&t[1]&&(i=t[1])}}return i||(i=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==l||!1===l?!1===l&&""!==t.getAttribute(i)||t.removeAttribute(i):t.setAttribute(i,!0===l?"":l))}if("p"===e[0]&&e.startsWith("prop:")){const n=e.slice(5);try{t[n]=l}catch(t){}return}{const o=x(l);if((c||o&&null!==l)&&!s)try{if(t.tagName.includes("-"))t[e]!==l&&(t[e]=l);else{const o=null==l?"":l;"list"===e?c=!1:null!=n&&t[e]===o||("function"==typeof t.__lookupSetter__(e)?t[e]=o:t.setAttribute(e,o))}}catch(t){}null==l||!1===l?(!1!==l||""===t.getAttribute(e)||4&r&&!z(e))&&t.removeAttribute(e):(!c||4&r||s)&&!o&&1===t.nodeType&&t.setAttribute(e,l=!0===l?"":l)}}else if(e="-"===e[2]?e.slice(3):i(f,u)?u.slice(2):u[2]+e.slice(3),n||l){const o=e.endsWith(q);e=e.replace(B,""),n&&a.rel(t,e,n,o),l&&a.ael(t,e,l,o)}},W=new Set(["draggable","contenteditable","spellcheck"]),z=t=>W.has(t)||t.startsWith("aria-"),F=/\s/,V=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(F):[]),q="Capture",B=RegExp(q+"$"),G=(t,e,n)=>{const o=11===e.S.nodeType&&e.S.host?e.S.host:e.S,l=t&&t.m||{},i=e.m||{};for(const t of I(Object.keys(l)))t in i||U(o,t,l[t],void 0,n,e.u);for(const t of I(Object.keys(i)))U(o,t,l[t],i[t],n,e.u)};function I(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var Y=!1,Z=!1,_=[],J=[],K=(t,e,n)=>{const o=e.$[n];let l,i,s=0;if(null!=o.v)l=o.S=f.document.createTextNode(o.v);else{if(Z||(Z="svg"===o.O),!f.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(l=o.S=f.document.createElementNS(Z?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o.O),Z&&"foreignObject"===o.O&&(Z=!1),G(null,o,Z),o.$){const e="template"===o.O?l.content:l;for(s=0;s<o.$.length;++s)i=K(t,o,s),i&&e.appendChild(i)}"svg"===o.O?Z=!1:"foreignObject"===l.tagName&&(Z=!0)}return l["s-hn"]=M,l},Q=(t,e,n,o,l,i)=>{let s,r=t;for(r.shadowRoot&&r.tagName===M&&(r=r.shadowRoot),"template"===n.O&&(r=r.content);l<=i;++l)o[l]&&(s=K(null,n,l),s&&(o[l].S=s,lt(r,s,e)))},X=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.S;nt(e),t&&t.remove()}}},tt=(t,e,n=!1)=>t.O===e.O&&(n?(n&&!t.j&&e.j&&(t.j=e.j),!0):t.j===e.j),et=(t,e,n=!1)=>{const o=e.S=t.S,l=t.$,i=e.$,s=e.O,r=e.v;null==r?(Z="svg"===s||"foreignObject"!==s&&Z,"slot"!==s||Y||t.k!==e.k&&(e.S["s-sn"]=e.k||"",(t=>{a.u|=1;const e=t.closest(M.toLowerCase());if(null!=e){const n=Array.from(e.__childNodes||e.childNodes).find((t=>t["s-cr"])),o=Array.from(t.__childNodes||t.childNodes);for(const t of n?o.reverse():o)null!=t["s-sh"]&&(lt(e,t,null!=n?n:null),t["s-sh"]=void 0)}a.u&=-2})(e.S.parentElement)),G(t,e,Z),null!==l&&null!==i?((t,e,n,o,l=!1)=>{let i,s,r=0,c=0,u=0,f=0,a=e.length-1,d=e[0],p=e[a],h=o.length-1,v=o[0],m=o[h];const b="template"===n.O?t.content:t;for(;r<=a&&c<=h;)if(null==d)d=e[++r];else if(null==p)p=e[--a];else if(null==v)v=o[++c];else if(null==m)m=o[--h];else if(tt(d,v,l))et(d,v,l),d=e[++r],v=o[++c];else if(tt(p,m,l))et(p,m,l),p=e[--a],m=o[--h];else if(tt(d,m,l))et(d,m,l),lt(b,d.S,p.S.nextSibling),d=e[++r],m=o[--h];else if(tt(p,v,l))et(p,v,l),lt(b,p.S,d.S),p=e[--a],v=o[++c];else{for(u=-1,f=r;f<=a;++f)if(e[f]&&null!==e[f].j&&e[f].j===v.j){u=f;break}u>=0?(s=e[u],s.O!==v.O?i=K(e&&e[c],n,u):(et(s,v,l),e[u]=void 0,i=s.S),v=o[++c]):(i=K(e&&e[c],n,c),v=o[++c]),i&<(d.S.parentNode,i,d.S)}r>a?Q(t,null==o[h+1]?null:o[h+1].S,n,o,c,h):c>h&&X(e,r,a)})(o,l,e,i,n):null!==i?(null!==t.v&&(o.textContent=""),Q(o,null,e,i,0,i.length-1)):!n&&null!==l&&X(l,0,l.length-1),Z&&"svg"===s&&(Z=!1)):t.v!==r&&(o.data=r)},nt=t=>{t.m&&t.m.ref&&_.push((()=>t.m.ref(null))),t.$&&t.$.map(nt)},ot=(t,e)=>{J.push((()=>t(e)))},lt=(t,e,n)=>null==t?void 0:t.insertBefore(e,n),it=(t,e)=>{if(e&&!t.M&&e["s-p"]){const n=e["s-p"].push(new Promise((o=>t.M=()=>{e["s-p"].splice(n-1,1),o()})))}},st=(t,e)=>{if(t.u|=16,4&t.u)return void(t.u|=512);it(t,t.C);const n=()=>rt(t,e);if(!e)return O(n);queueMicrotask((()=>{n()}))},rt=(t,e)=>{const n=t.$hostElement$,o=t.i;if(!o)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 l;return e?(t.N.length&&t.N.forEach((t=>t(n))),l=ht(o,"componentWillLoad",void 0,n)):l=ht(o,"componentWillUpdate",void 0,n),l=ct(l,(()=>ht(o,"componentWillRender",void 0,n))),ct(l,(()=>ft(t,o,e)))},ct=(t,e)=>ut(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),ut=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,ft=async(t,e,n)=>{var o;const l=t.$hostElement$,i=l["s-rc"];n&&(t=>{const e=t.o,n=t.$hostElement$,o=e.u,l=((t,e)=>{var n,o,l;const i=C(e),s=u.get(i);if(!f.document)return i;if(t=11===t.nodeType?t:f.document,s)if("string"==typeof s){let l,r=E.get(t=t.head||t);if(r||E.set(t,r=new Set),!r.has(i)){l=f.document.createElement("style"),l.textContent=s;const c=null!=(n=a.A)?n:k(f.document);if(null!=c&&l.setAttribute("nonce",c),!(1&e.u))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(l,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(p){const e=new(null!=(o=t.defaultView)?o:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(s),h?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.textContent=s+e.textContent:t.prepend(l)}else t.append(l);1&e.u&&t.insertBefore(l,null),4&e.u&&(l.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),r&&r.add(i)}}else{let e=E.get(t);if(e||E.set(t,e=new Set),!e.has(i)){const n=null!=(l=t.defaultView)?l:t.ownerDocument.defaultView;let o;if(s.constructor===n.CSSStyleSheet)o=s;else{o=new n.CSSStyleSheet;for(let t=0;t<s.cssRules.length;t++)o.insertRule(s.cssRules[t].cssText,t)}h?t.adoptedStyleSheets.push(o):t.adoptedStyleSheets=[...t.adoptedStyleSheets,o],e.add(i)}}return i})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&o&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(t);at(t,e,l,n),i&&(i.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>dt(t);0===e.length?n():(Promise.all(e).then(n).catch(n),t.u|=4,e.length=0)}},at=(t,e,n,o)=>{try{e=e.render(),t.u&=-17,t.u|=2,((t,e,n=!1)=>{const o=t.$hostElement$,l=t.o,i=t.L||A(null,null),s=(t=>t&&t.O===L)(e)?e:N(null,null,e);if(M=o.tagName,n&&s.m)for(const t of Object.keys(s.m))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(s.m[t]=o[t]);s.O=null,s.u|=4,t.L=s,s.S=i.S=o.shadowRoot||o,Y=!(!(1&l.u)||128&l.u),et(i,s,n),_.forEach((t=>t())),_.length=0,J.forEach((t=>t())),J.length=0})(t,e,o)}catch(e){s(e,t.$hostElement$)}return null},dt=t=>{const e=t.$hostElement$,n=t.i,o=t.C;ht(n,"componentDidRender",void 0,e),64&t.u?ht(n,"componentDidUpdate",void 0,e):(t.u|=64,vt(e),ht(n,"componentDidLoad",void 0,e),t.P(e),o||pt()),t.R(e),t.M&&(t.M(),t.M=void 0),512&t.u&&j((()=>st(t,!1))),t.u&=-517},pt=()=>{j((()=>H(f,"appload",{detail:{namespace:"phirepass-widgets"}})))},ht=(t,e,n,o)=>{if(t&&t[e])try{return t[e](n)}catch(t){s(t,o)}},vt=t=>t.classList.add("hydrated"),mt=(t,e,n,l)=>{const i=o(t);if(!i)return;if(!i)throw Error(`Couldn't find host element for "${l.h}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`);const r=i.$hostElement$,c=i.l.get(e),u=i.u,f=i.i;if(n=R(n,l.t[e][0]),!(8&u&&void 0!==c||n===c||Number.isNaN(c)&&Number.isNaN(n))){if(i.l.set(e,n),l.T){const t=l.T[e];t&&t.map((t=>{try{const[[o,l]]=Object.entries(t);(128&u||1&l)&&(f?f[o](n,c,e):i.N.push((()=>{i.i[o](n,c,e)})))}catch(t){s(t,r)}}))}if(2&u){if(f.componentShouldUpdate&&!1===f.componentShouldUpdate(n,c,e)&&!(16&u))return;16&u||st(i,!1)}}},bt=(e,n,l)=>{var i,s;const r=e.prototype;{e.watchers&&!n.T&&(n.T=P(e.watchers)),e.deserializers&&!n.D&&(n.D=e.deserializers),e.serializers&&!n.H&&(n.H=e.serializers);const c=Object.entries(null!=(i=n.t)?i:{});if(c.map((([e,[i]])=>{if(31&i||2&l&&32&i){const{get:s,set:c}=t(r,e)||{};s&&(n.t[e][0]|=2048),c&&(n.t[e][0]|=4096),(1&l||!s)&&Object.defineProperty(r,e,{get(){{if(!(2048&n.t[e][0]))return((t,e)=>o(this).l.get(e))(0,e);const t=o(this),l=t?t.i:r;if(!l)return;return l[e]}},configurable:!0,enumerable:!0}),Object.defineProperty(r,e,{set(t){const s=o(this);if(s){if(c)return void 0===(32&i?this[e]:s.$hostElement$[e])&&s.l.get(e)&&(t=s.l.get(e)),c.call(this,R(t,i)),void mt(this,e,t=32&i?this[e]:s.$hostElement$[e],n);{if(!(1&l&&4096&n.t[e][0]))return mt(this,e,t,n),void(1&l&&!s.i&&s.N.push((()=>{4096&n.t[e][0]&&s.i[e]!==s.l.get(e)&&(s.i[e]=t)})));const o=()=>{const o=s.i[e];!s.l.get(e)&&o&&s.l.set(e,o),s.i[e]=R(t,i),mt(this,e,s.i[e],n)};s.i?o():s.N.push((()=>{o()}))}}}})}else 1&l&&64&i&&Object.defineProperty(r,e,{value(...t){var n;const l=o(this);return null==(n=null==l?void 0:l.U)?void 0:n.then((()=>{var n;return null==(n=l.i)?void 0:n[e](...t)}))}})})),1&l){const t=new Map;r.attributeChangedCallback=function(e,l,i){a.jmp((()=>{var s;const u=t.get(e),f=o(this);if(this.hasOwnProperty(u)&&(i=this[u],delete this[u]),r.hasOwnProperty(u)&&"number"==typeof this[u]&&this[u]==i)return;if(null==u){const t=null==f?void 0:f.u;if(f&&t&&!(8&t)&&i!==l){const o=f.i,r=null==(s=n.T)?void 0:s[e];null==r||r.forEach((n=>{const[[s,r]]=Object.entries(n);null!=o[s]&&(128&t||1&r)&&o[s].call(o,i,l,e)}))}return}const a=c.find((([t])=>t===u)),d=4&(a?a[1][0]:0),p=d&&null===i&&void 0===this[u];d&&(i=null!==i&&"false"!==i);const h=Object.getOwnPropertyDescriptor(r,u);p||i==this[u]||h.get&&!h.set||(this[u]=i)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=n.T)?s:{}),...c.filter((([t,e])=>31&e[0])).map((([e,n])=>{const o=n[1]||e;return t.set(o,e),o}))]))}}return e},yt=async(t,e,n)=>{var o;let l;try{if(!(32&e.u)){if(e.u|=32,e.u&=-1025,n.W){const i=((t,e)=>{var n;const o=t.h.replace(/-/g,"_"),l=t.W;if(!l)return;const i=r.get(l);if(i)return i[o];const u=null!=(n=c.get(l))?n:0,f=[u>0?"s-retry="+u:"",""].filter(Boolean).join("&");
|
|
2
2
|
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
3
3
|
return import(`./${l}.entry.js${f?"?"+f:""}`).then((t=>(c.delete(l),r.set(l,t),t[o])),(t=>{c.set(l,u+1),s(t,e.$hostElement$)}))})(n,e);if(i&&"then"in i){const t=()=>{};l=await i,t()}else l=i;if(!l)throw e.u&=-33,e.F=(null!=(o=e.F)?o:0)+1,e.F<3&&(e.u|=1024),Error(`Constructor for "${n.h}#${e.V}" was not found`);l.isProxied||(n.T=P(l.watchers),n.H=l.serializers,n.D=l.deserializers,bt(l,n,2),l.isProxied=!0);const u=()=>{};e.u|=8;try{new l(e)}catch(e){s(e,t)}e.u&=-9,e.u|=128,u(),wt(e.i,t)}else l=t.constructor,customElements.whenDefined(t.localName).then((()=>e.u|=128));if(l&&l.style){let t;"string"==typeof l.style&&(t=l.style);const e=C(n);if(!u.has(e)){const o=()=>{};((t,e,n)=>{let o=u.get(t);p&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=e:o.replaceSync(e)):o=e,u.set(t,o)})(e,t,!!(1&n.u)),o()}}}const i=e.C,f=()=>st(e,!0);i&&i["s-rc"]?i["s-rc"].push(f):f()}catch(n){s(n,t),e.M&&(e.M(),e.M=void 0),!e.P||1024&e.u||e.P(t)}},wt=(t,e)=>{ht(t,"connectedCallback",void 0,e)},$t=(t,e)=>{ht(t,"disconnectedCallback",void 0,e||t)},gt=(t,e={})=>{var n;if(!f.document)return void console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");const l=[],i=e.exclude||[],s=f.customElements,r=f.document.head,c=r.querySelector("meta[charset]"),u=f.document.createElement("style"),d=[];let p,h=!0;if(Object.assign(a,e),a.p=new URL(e.resourcesUrl||"./",f.document.baseURI).href,t.map((t=>{t[1].map((e=>{var n,r;const c={u:e[0],h:e[1],t:e[2],q:e[3]};c.t=e[2],c.T=P(e[4]),c.H=null!=(n=e[5])?n:{},c.D=null!=(r=e[6])?r:{};const u=c.h,f=class extends HTMLElement{"s-p";"s-rc";hasRegisteredEventListeners=!1;constructor(t){if(super(t),((t,e)=>{const n={u:0,$hostElement$:t,o:e,l:new Map,B:new Map};n.U=new Promise((t=>n.R=t)),n.G=new Promise((t=>n.P=t)),t["s-p"]=[],t["s-rc"]=[],n.N=[];const o=n;t.__stencil__getHostRef=()=>o})(t=this,c),1&c.u)if(t.shadowRoot){if("open"!==t.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${c.h}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else S.call(t,c)}connectedCallback(){o(this)&&(this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),p&&(clearTimeout(p),p=null),h?d.push(this):a.jmp((()=>(t=>{if(!(1&a.u)){const e=o(t);if(!e)return;const n=e.o,l=()=>{};if(1&e.u)(null==e?void 0:e.i)?wt(e.i,t):1024&e.u?setTimeout((()=>yt(t,e,n)),1e3):(null==e?void 0:e.G)&&e.G.then((()=>wt(e.i,t)));else{e.u|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){it(e,e.C=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}})),yt(t,e,n)}l()}})(this))))}disconnectedCallback(){a.jmp((()=>(async t=>{if(!(1&a.u)){const e=o(t);(null==e?void 0:e.i)?$t(e.i,t):(null==e?void 0:e.G)&&e.G.then((()=>$t(e.i,t)))}E.has(t)&&E.delete(t),t.shadowRoot&&E.has(t.shadowRoot)&&E.delete(t.shadowRoot)})(this))),j((()=>{var t;const e=o(this);if(!e)return;const n=d.findIndex((t=>t===this));n>-1&&d.splice(n,1),(null==(t=null==e?void 0:e.L)?void 0:t.S)instanceof Node&&!e.L.S.isConnected&&delete e.L.S}))}componentOnReady(){var t;return null==(t=o(this))?void 0:t.G}};c.W=t[0],i.includes(u)||s.get(u)||(l.push(u),s.define(u,bt(f,c,1)))}))})),l.length>0&&(u.textContent+=l.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",u.innerHTML.length)){u.setAttribute("data-styles","");const t=null!=(n=a.A)?n:k(f.document);null!=t&&u.setAttribute("nonce",t),r.insertBefore(u,c?c.nextSibling:r.firstChild)}h=!1,d.length?d.map((t=>t.connectedCallback())):a.jmp((()=>p=setTimeout(pt,30)))},jt=t=>a.A=t;export{L as H,gt as b,D as c,T as g,N as h,d as p,l as r,jt as s}
|