phirepass-widgets 0.0.115 → 0.0.117
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/README.md +13 -12
- package/dist/cjs/{index-BCgmMoIq.js → index-DehquNXP.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/phirepass-downloader_3.cjs.entry.js +20 -9
- package/dist/cjs/phirepass-rdp.cjs.entry.js +2 -2
- package/dist/cjs/phirepass-terminal.cjs.entry.js +2 -2
- package/dist/cjs/phirepass-widgets.cjs.js +2 -2
- package/dist/cjs/{protocol-CYh109n2.js → protocol-BjOgJZ9-.js} +34 -9
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/phirepass-downloader/phirepass-downloader.js +18 -7
- package/dist/collection/phirepass-channel_bg.wasm +0 -0
- package/dist/components/{p-DqT-qhTU.js → p-B4kFfbHE.js} +1 -1
- package/dist/components/p-BekUePpu.js +1 -0
- package/dist/components/phirepass-downloader.js +1 -1
- package/dist/components/phirepass-rdp.js +1 -1
- package/dist/components/phirepass-sftp-client.js +1 -1
- package/dist/components/phirepass-terminal.js +4 -4
- package/dist/esm/{index-Dd9o0CbU.js → index-BinptKL7.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/phirepass-downloader_3.entry.js +20 -9
- package/dist/esm/phirepass-rdp.entry.js +2 -2
- package/dist/esm/phirepass-terminal.entry.js +2 -2
- package/dist/esm/phirepass-widgets.js +3 -3
- package/dist/esm/{protocol-BtMWUitf.js → protocol-BekUePpu.js} +33 -8
- package/dist/phirepass-widgets/p-6a192c8d.entry.js +1 -0
- package/dist/phirepass-widgets/{p-705501d4.entry.js → p-9e6f9220.entry.js} +4 -4
- package/dist/phirepass-widgets/p-BekUePpu.js +1 -0
- package/dist/phirepass-widgets/{p-2fd32ec5.entry.js → p-fe1ce8da.entry.js} +1 -1
- 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-downloader/phirepass-downloader.d.ts +7 -0
- package/package.json +9 -9
- package/dist/components/p-BtMWUitf.js +0 -1
- package/dist/phirepass-widgets/p-BtMWUitf.js +0 -1
- package/dist/phirepass-widgets/p-b8caf9e1.entry.js +0 -1
- /package/dist/phirepass-widgets/{p-Dd9o0CbU.js → p-BinptKL7.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class n{__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,i.unregister(this),n}free(){const n=this.__destroy_into_raw();j.__wbg_channel_free(n,0)}authenticate(n,t,e){const r=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0);let _,o,c,i;try{_=v(n,j.__wbindgen_export,j.__wbindgen_export2),o=T,c=v(t,j.__wbindgen_export,j.__wbindgen_export2),i=T}catch(n){throw c&&j.__wbindgen_export3(c,1*i,1),_&&j.__wbindgen_export3(_,1*o,1),n}j.channel_authenticate(this.__wbg_ptr,_,o,c,i,r)}connect(){j.channel_connect(this.__wbg_ptr)}create_service(n,t,e,r,_,o,c,i,s){const u=+_,a=+(y(s)?Number.MAX_SAFE_INTEGER:s>>>0);let f,b,d,w,l,g,h,m,p,N,A,R,S,O;try{f=v(n,j.__wbindgen_export,j.__wbindgen_export2),b=T,d=v(t,j.__wbindgen_export,j.__wbindgen_export2),w=T,l=y(e)?0:v(e,j.__wbindgen_export,j.__wbindgen_export2),g=T,h=v(r,j.__wbindgen_export,j.__wbindgen_export2),m=T,p=y(o)?0:v(o,j.__wbindgen_export,j.__wbindgen_export2),N=T,A=y(c)?0:v(c,j.__wbindgen_export,j.__wbindgen_export2),R=T,S=y(i)?0:v(i,j.__wbindgen_export,j.__wbindgen_export2),O=T}catch(n){throw S&&j.__wbindgen_export3(S,1*O,1),A&&j.__wbindgen_export3(A,1*R,1),p&&j.__wbindgen_export3(p,1*N,1),h&&j.__wbindgen_export3(h,1*m,1),l&&j.__wbindgen_export3(l,1*g,1),d&&j.__wbindgen_export3(d,1*w,1),f&&j.__wbindgen_export3(f,1*b,1),n}j.channel_create_service(this.__wbg_ptr,f,b,d,w,l,g,h,m,u,p,N,A,R,S,O,a)}delete_service(n,t,e){const r=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0);let _,o,c,i;try{_=v(n,j.__wbindgen_export,j.__wbindgen_export2),o=T,c=v(t,j.__wbindgen_export,j.__wbindgen_export2),i=T}catch(n){throw c&&j.__wbindgen_export3(c,1*i,1),_&&j.__wbindgen_export3(_,1*o,1),n}j.channel_delete_service(this.__wbg_ptr,_,o,c,i,r)}disconnect(){j.channel_disconnect(this.__wbg_ptr)}is_connected(){return 0!==j.channel_is_connected(this.__wbg_ptr)}is_disconnected(){return 0!==j.channel_is_disconnected(this.__wbg_ptr)}constructor(n,t,e){let r,_,o,c,s,u;try{r=v(n,j.__wbindgen_export,j.__wbindgen_export2),_=T,o=v(t,j.__wbindgen_export,j.__wbindgen_export2),c=T,s=y(e)?0:v(e,j.__wbindgen_export,j.__wbindgen_export2),u=T}catch(n){throw s&&j.__wbindgen_export3(s,1*u,1),o&&j.__wbindgen_export3(o,1*c,1),r&&j.__wbindgen_export3(r,1*_,1),n}const a=j.channel_new(r,_,o,c,s,u);return this.__wbg_ptr=a,i.register(this,this.__wbg_ptr,this),this}on_connection_close(n){j.channel_on_connection_close(this.__wbg_ptr,y(n)?0:s(n))}on_connection_error(n){j.channel_on_connection_error(this.__wbg_ptr,y(n)?0:s(n))}on_connection_message(n){j.channel_on_connection_message(this.__wbg_ptr,y(n)?0:s(n))}on_connection_open(n){j.channel_on_connection_open(this.__wbg_ptr,y(n)?0:s(n))}on_protocol_message(n){j.channel_on_protocol_message(this.__wbg_ptr,y(n)?0:s(n))}on_protocol_message_type(n,t){const e=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_on_protocol_message_type(this.__wbg_ptr,e,T,y(t)?0:s(t))}open_rdp_tunnel(n,t,e,r,_){const o=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let c,i,s,u,a,f,b,d;try{c=v(n,j.__wbindgen_export,j.__wbindgen_export2),i=T,s=v(t,j.__wbindgen_export,j.__wbindgen_export2),u=T,a=y(e)?0:v(e,j.__wbindgen_export,j.__wbindgen_export2),f=T,b=y(r)?0:v(r,j.__wbindgen_export,j.__wbindgen_export2),d=T}catch(n){throw b&&j.__wbindgen_export3(b,1*d,1),a&&j.__wbindgen_export3(a,1*f,1),s&&j.__wbindgen_export3(s,1*u,1),c&&j.__wbindgen_export3(c,1*i,1),n}j.channel_open_rdp_tunnel(this.__wbg_ptr,c,i,s,u,a,f,b,d,o)}open_sftp_tunnel(n,t,e,r,_){const o=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let c,i,s,u,a,f,b,d;try{c=v(n,j.__wbindgen_export,j.__wbindgen_export2),i=T,s=v(t,j.__wbindgen_export,j.__wbindgen_export2),u=T,a=y(e)?0:v(e,j.__wbindgen_export,j.__wbindgen_export2),f=T,b=y(r)?0:v(r,j.__wbindgen_export,j.__wbindgen_export2),d=T}catch(n){throw b&&j.__wbindgen_export3(b,1*d,1),a&&j.__wbindgen_export3(a,1*f,1),s&&j.__wbindgen_export3(s,1*u,1),c&&j.__wbindgen_export3(c,1*i,1),n}j.channel_open_sftp_tunnel(this.__wbg_ptr,c,i,s,u,a,f,b,d,o)}open_ssh_tunnel(n,t,e,r,_){const o=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let c,i,s,u,a,f,b,d;try{c=v(n,j.__wbindgen_export,j.__wbindgen_export2),i=T,s=v(t,j.__wbindgen_export,j.__wbindgen_export2),u=T,a=y(e)?0:v(e,j.__wbindgen_export,j.__wbindgen_export2),f=T,b=y(r)?0:v(r,j.__wbindgen_export,j.__wbindgen_export2),d=T}catch(n){throw b&&j.__wbindgen_export3(b,1*d,1),a&&j.__wbindgen_export3(a,1*f,1),s&&j.__wbindgen_export3(s,1*u,1),c&&j.__wbindgen_export3(c,1*i,1),n}j.channel_open_ssh_tunnel(this.__wbg_ptr,c,i,s,u,a,f,b,d,o)}send_download_delete(n,t,e){const r=+t,_=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0),o=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_download_delete(this.__wbg_ptr,o,T,r,_)}send_download_resume(n,t,e){const r=+t,_=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0),o=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_download_resume(this.__wbg_ptr,o,T,r,_)}send_download_set_order(n,t,e){const r=+t,_=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0),o=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_download_set_order(this.__wbg_ptr,o,T,r,_)}send_download_settings_get(n,t){const e=+(y(t)?Number.MAX_SAFE_INTEGER:t>>>0),r=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_download_settings_get(this.__wbg_ptr,r,T,e)}send_download_settings_save(n,t,e){const r=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0),_=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_download_settings_save(this.__wbg_ptr,_,T,t,r)}send_download_start(n,t,e,r,_,o,c){const i=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let s,u,a,f;try{s=v(n,j.__wbindgen_export,j.__wbindgen_export2),u=T,a=y(e)?0:v(e,j.__wbindgen_export,j.__wbindgen_export2),f=T}catch(n){throw a&&j.__wbindgen_export3(a,1*f,1),s&&j.__wbindgen_export3(s,1*u,1),n}j.channel_send_download_start(this.__wbg_ptr,s,u,t,a,f,r,y(_)?16777215:_?1:0,o,i)}send_download_stop(n,t,e){const r=+t,_=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0),o=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_download_stop(this.__wbg_ptr,o,T,r,_)}send_download_subscribe(n){j.channel_send_download_subscribe(this.__wbg_ptr,n)}send_download_where(n,t,e){const r=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0),_=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_download_where(this.__wbg_ptr,_,T,t,r)}send_sftp_chmod(n,t,e,r,_){const o=+t,c=+r,i=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let s,u,a,f;try{s=v(n,j.__wbindgen_export,j.__wbindgen_export2),u=T,a=v(e,j.__wbindgen_export,j.__wbindgen_export2),f=T}catch(n){throw a&&j.__wbindgen_export3(a,1*f,1),s&&j.__wbindgen_export3(s,1*u,1),n}j.channel_send_sftp_chmod(this.__wbg_ptr,s,u,o,a,f,c,i)}send_sftp_delete(n,t,e,r,_){const o=+t,c=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let i,s,u,a,f,b;try{i=v(n,j.__wbindgen_export,j.__wbindgen_export2),s=T,u=v(e,j.__wbindgen_export,j.__wbindgen_export2),a=T,f=v(r,j.__wbindgen_export,j.__wbindgen_export2),b=T}catch(n){throw f&&j.__wbindgen_export3(f,1*b,1),u&&j.__wbindgen_export3(u,1*a,1),i&&j.__wbindgen_export3(i,1*s,1),n}j.channel_send_sftp_delete(this.__wbg_ptr,i,s,o,u,a,f,b,c)}send_sftp_download_ack(n,t,e,r){const _=+t,o=+e,c=+r,i=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_download_ack(this.__wbg_ptr,i,T,_,o,c)}send_sftp_download_chunk(n,t,e,r,_){const o=+t,c=+e,i=+r,s=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0),u=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_download_chunk(this.__wbg_ptr,u,T,o,c,i,s)}send_sftp_download_start(n,t,e,r,_){const o=+t,c=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let i,s,u,a,f,b;try{i=v(n,j.__wbindgen_export,j.__wbindgen_export2),s=T,u=v(e,j.__wbindgen_export,j.__wbindgen_export2),a=T,f=v(r,j.__wbindgen_export,j.__wbindgen_export2),b=T}catch(n){throw f&&j.__wbindgen_export3(f,1*b,1),u&&j.__wbindgen_export3(u,1*a,1),i&&j.__wbindgen_export3(i,1*s,1),n}j.channel_send_sftp_download_start(this.__wbg_ptr,i,s,o,u,a,f,b,c)}send_sftp_list_data(n,t,e,r){const _=+t,o=+(y(r)?Number.MAX_SAFE_INTEGER:r>>>0);let c,i,s,u;try{c=v(n,j.__wbindgen_export,j.__wbindgen_export2),i=T,s=v(e,j.__wbindgen_export,j.__wbindgen_export2),u=T}catch(n){throw s&&j.__wbindgen_export3(s,1*u,1),c&&j.__wbindgen_export3(c,1*i,1),n}j.channel_send_sftp_list_data(this.__wbg_ptr,c,i,_,s,u,o)}send_sftp_mkdir(n,t,e,r){const _=+t,o=+(y(r)?Number.MAX_SAFE_INTEGER:r>>>0);let c,i,s,u;try{c=v(n,j.__wbindgen_export,j.__wbindgen_export2),i=T,s=v(e,j.__wbindgen_export,j.__wbindgen_export2),u=T}catch(n){throw s&&j.__wbindgen_export3(s,1*u,1),c&&j.__wbindgen_export3(c,1*i,1),n}j.channel_send_sftp_mkdir(this.__wbg_ptr,c,i,_,s,u,o)}send_sftp_open_stream(n,t,e,r){const _=+t,o=+(y(r)?Number.MAX_SAFE_INTEGER:r>>>0);let c,i,s,u;try{c=v(n,j.__wbindgen_export,j.__wbindgen_export2),i=T,s=v(e,j.__wbindgen_export,j.__wbindgen_export2),u=T}catch(n){throw s&&j.__wbindgen_export3(s,1*u,1),c&&j.__wbindgen_export3(c,1*i,1),n}j.channel_send_sftp_open_stream(this.__wbg_ptr,c,i,_,s,u,o)}send_sftp_read_file(n,t,e,r){const _=+t,o=+(y(r)?Number.MAX_SAFE_INTEGER:r>>>0);let c,i,s,u;try{c=v(n,j.__wbindgen_export,j.__wbindgen_export2),i=T,s=v(e,j.__wbindgen_export,j.__wbindgen_export2),u=T}catch(n){throw s&&j.__wbindgen_export3(s,1*u,1),c&&j.__wbindgen_export3(c,1*i,1),n}j.channel_send_sftp_read_file(this.__wbg_ptr,c,i,_,s,u,o)}send_sftp_remove(n,t,e,r,_){const o=+t,c=+r,i=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let s,u,a,f;try{s=v(n,j.__wbindgen_export,j.__wbindgen_export2),u=T,a=v(e,j.__wbindgen_export,j.__wbindgen_export2),f=T}catch(n){throw a&&j.__wbindgen_export3(a,1*f,1),s&&j.__wbindgen_export3(s,1*u,1),n}j.channel_send_sftp_remove(this.__wbg_ptr,s,u,o,a,f,c,i)}send_sftp_rename(n,t,e,r,_){const o=+t,c=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let i,s,u,a,f,b;try{i=v(n,j.__wbindgen_export,j.__wbindgen_export2),s=T,u=v(e,j.__wbindgen_export,j.__wbindgen_export2),a=T,f=v(r,j.__wbindgen_export,j.__wbindgen_export2),b=T}catch(n){throw f&&j.__wbindgen_export3(f,1*b,1),u&&j.__wbindgen_export3(u,1*a,1),i&&j.__wbindgen_export3(i,1*s,1),n}j.channel_send_sftp_rename(this.__wbg_ptr,i,s,o,u,a,f,b,c)}send_sftp_upload_chunk(n,t,e,r,_,o,c){const i=+t,s=+e,u=+r,a=+_,f=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let b,d,w,l;try{b=v(n,j.__wbindgen_export,j.__wbindgen_export2),d=T,w=p(o,j.__wbindgen_export),l=T}catch(n){throw w&&j.__wbindgen_export3(w,1*l,1),b&&j.__wbindgen_export3(b,1*d,1),n}j.channel_send_sftp_upload_chunk(this.__wbg_ptr,b,d,i,s,u,a,w,l,f)}send_sftp_upload_start(n,t,e,r,_,o,c){const i=+t,s=+_,u=BigInt.asIntN(64,o),a=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let f,b,d,w,l,g;try{f=v(n,j.__wbindgen_export,j.__wbindgen_export2),b=T,d=v(e,j.__wbindgen_export,j.__wbindgen_export2),w=T,l=v(r,j.__wbindgen_export,j.__wbindgen_export2),g=T}catch(n){throw l&&j.__wbindgen_export3(l,1*g,1),d&&j.__wbindgen_export3(d,1*w,1),f&&j.__wbindgen_export3(f,1*b,1),n}j.channel_send_sftp_upload_start(this.__wbg_ptr,f,b,i,d,w,l,g,s,u,a)}send_sftp_write_file(n,t,e,r,_){const o=+t,c=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let i,s,u,a,f,b;try{i=v(n,j.__wbindgen_export,j.__wbindgen_export2),s=T,u=v(e,j.__wbindgen_export,j.__wbindgen_export2),a=T,f=p(r,j.__wbindgen_export),b=T}catch(n){throw f&&j.__wbindgen_export3(f,1*b,1),u&&j.__wbindgen_export3(u,1*a,1),i&&j.__wbindgen_export3(i,1*s,1),n}j.channel_send_sftp_write_file(this.__wbg_ptr,i,s,o,u,a,f,b,c)}send_ssh_terminal_resize(n,t,e,r,_,o){const c=+t,i=+e,s=+r,u=+_,a=+o,f=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_ssh_terminal_resize(this.__wbg_ptr,f,T,c,i,s,u,a)}send_ssh_tunnel_data(n,t,e){const r=+t;let _,o,c,i;try{_=v(n,j.__wbindgen_export,j.__wbindgen_export2),o=T,c=v(e,j.__wbindgen_export,j.__wbindgen_export2),i=T}catch(n){throw c&&j.__wbindgen_export3(c,1*i,1),_&&j.__wbindgen_export3(_,1*o,1),n}j.channel_send_ssh_tunnel_data(this.__wbg_ptr,_,o,r,c,i)}start_heartbeat(n){j.channel_start_heartbeat(this.__wbg_ptr,n)}stop_heartbeat(){j.channel_stop_heartbeat(this.__wbg_ptr)}update_service(n,t,e,r,_,o,c,i,s,u){const a=+o,f=+(y(u)?Number.MAX_SAFE_INTEGER:u>>>0);let b,d,w,l,g,h,m,p,N,A,R,S,O,U,F,P;try{b=v(n,j.__wbindgen_export,j.__wbindgen_export2),d=T,w=v(t,j.__wbindgen_export,j.__wbindgen_export2),l=T,g=v(e,j.__wbindgen_export,j.__wbindgen_export2),h=T,m=y(r)?0:v(r,j.__wbindgen_export,j.__wbindgen_export2),p=T,N=v(_,j.__wbindgen_export,j.__wbindgen_export2),A=T,R=y(c)?0:v(c,j.__wbindgen_export,j.__wbindgen_export2),S=T,O=y(i)?0:v(i,j.__wbindgen_export,j.__wbindgen_export2),U=T,F=y(s)?0:v(s,j.__wbindgen_export,j.__wbindgen_export2),P=T}catch(n){throw F&&j.__wbindgen_export3(F,1*P,1),O&&j.__wbindgen_export3(O,1*U,1),R&&j.__wbindgen_export3(R,1*S,1),N&&j.__wbindgen_export3(N,1*A,1),m&&j.__wbindgen_export3(m,1*p,1),g&&j.__wbindgen_export3(g,1*h,1),w&&j.__wbindgen_export3(w,1*l,1),b&&j.__wbindgen_export3(b,1*d,1),n}j.channel_update_service(this.__wbg_ptr,b,d,w,l,g,h,m,p,N,A,a,R,S,O,U,F,P,f)}}Symbol.dispose&&(n.prototype[Symbol.dispose]=n.prototype.free);const t=Object.freeze({Generic:0,0:"Generic",Authentication:10,10:"Authentication",RequiresUsername:100,100:"RequiresUsername",RequiresPassword:110,110:"RequiresPassword",RequiresUsernamePassword:120,120:"RequiresUsernamePassword"});function e(n,t){j.__wasm_bindgen_func_elem_100(n,t)}function r(n,t,e){j.__wasm_bindgen_func_elem_96(n,t,e)}function _(n,t,e){j.__wasm_bindgen_func_elem_96_47(n,t,e)}function o(n,t,e){j.__wasm_bindgen_func_elem_96_48(n,t,e)}const c=["blob","arraybuffer"],i="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((n=>j.__wbg_channel_free(n,1)));function s(n){const t=j.__wbindgen_export5();return j.__wbindgen_externrefs.set(t,n),t}const u="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((n=>j.__wbindgen_export6(n.a,n.b)));function a(n){switch(typeof n){case"number":case"boolean":case"undefined":return`${n}`;case"string":return JSON.stringify(n);case"bigint":return`${n}n`;case"symbol":return void 0!==n.description?`Symbol(${n.description})`:"Symbol";case"function":return"string"==typeof n.name&&""!==n.name?`Function(${n.name})`:"Function";case"object":{if(null===n)return"null";if(Array.isArray(n))return"["+Array.from(n,a).join(", ")+"]";if(n instanceof Error)return`${n.name}: ${n.message}\n${n.stack}`;const t=toString.call(n),e=/\[object ([^\]]+)\]/.exec(t)?.[1];if(void 0===e)return t;if("Object"===e)try{return"Object("+JSON.stringify(n)+")"}catch(n){return"Object"}return e}}}function f(n,t){return n>>>=0,g().subarray(n/1,n/1+t)}let b=null;function d(){return(null===b||!0===b.buffer.detached||void 0===b.buffer.detached&&b.buffer!==j.memory.buffer)&&(b=new DataView(j.memory.buffer)),b}function w(n,t){return n>>>=0,e=g().subarray(n,n+t),R+=e.length,R>=A&&(N=new TextDecoder("utf-8",{ignoreBOM:!0}),N.decode(),R=e.length),N.decode(e);var e}let l=null;function g(){return null!==l&&0!==l.byteLength||(l=new Uint8Array(j.memory.buffer)),l}function h(n,t){try{return n.apply(this,t)}catch(n){const t=s(n);j.__wbindgen_export4(t)}}function y(n){return null==n}function m(n,t,e){const r={a:n,b:t,cnt:1},_=(...n)=>{r.cnt++;const t=r.a;r.a=0;try{return e(t,r.b,...n)}finally{r.a=t,_._wbg_cb_unref()}};return _._wbg_cb_unref=()=>{0==--r.cnt&&(j.__wbindgen_export6(r.a,r.b),r.a=0,u.unregister(r))},u.register(_,r,r),_}function p(n,t){const e=t(1*n.length,1)>>>0;return g().set(n,e/1),T=n.length,e}function v(n,t,e){if(void 0===e){const e=S.encode(n),r=t(e.length,1)>>>0;return g().subarray(r,r+e.length).set(e),T=e.length,r}let r=n.length,_=t(r,1)>>>0;const o=g();let c=0;for(;c<r;c++){const t=n.charCodeAt(c);if(t>127)break;o[_+c]=t}if(c!==r){0!==c&&(n=n.slice(c)),_=e(_,r,r=c+3*n.length,1)>>>0;const t=g().subarray(_+c,_+r);c+=S.encodeInto(n,t).written,_=e(_,r,c,1)>>>0}return T=c,_}let N=new TextDecoder("utf-8",{ignoreBOM:!0});N.decode();const A=2146435072;let R=0;const S=new TextEncoder;"encodeInto"in S||(S.encodeInto=function(n,t){const e=S.encode(n);return t.set(e),{read:n.length,written:e.length}});let j,O,T=0;async function U(n){return void 0!==j?j:(void 0===O&&(O=async function(n){void 0!==n&&(Object.getPrototypeOf(n)===Object.prototype?({module_or_path:n}=n):console.warn("using deprecated parameters for the initialization function; pass a single object instead")),void 0===n&&(n=new URL("phirepass-channel_bg.wasm",import.meta.url));const t=function(){const n={__proto__:null,__wbg_Error_208446807d0d1e30:function(n,t){return Error(w(n,t))},__wbg_Number_ff192a72a0dcdf6d:function(n){return Number(n)},__wbg_String_8564e559799eccda:function(n,t){const e=v(String(t),j.__wbindgen_export,j.__wbindgen_export2),r=T;d().setInt32(4+(n>>>0),r,!0),d().setInt32(0+(n>>>0),e,!0)},__wbg___wbindgen_bigint_get_as_i64_11da4b52cd0aedef:function(n,t){const e="bigint"==typeof t?t:void 0;d().setBigInt64(8+(n>>>0),y(e)?BigInt(0):e,!0),d().setInt32(0+(n>>>0),!y(e),!0)},__wbg___wbindgen_boolean_get_4f1baf9a00be3c74:function(n){const t="boolean"==typeof n?n:void 0;return y(t)?16777215:t?1:0},__wbg___wbindgen_debug_string_f249a2a76caa9a55:function(n,t){const e=v(a(t),j.__wbindgen_export,j.__wbindgen_export2),r=T;d().setInt32(4+(n>>>0),r,!0),d().setInt32(0+(n>>>0),e,!0)},__wbg___wbindgen_in_3f58a9d3b3a7eed2:function(n,t){return n in t},__wbg___wbindgen_is_bigint_5fa10641e039d3ef:function(n){return"bigint"==typeof n},__wbg___wbindgen_is_function_741ff2bb612836f5:function(n){return"function"==typeof n},__wbg___wbindgen_is_null_c22311b1cc228e3a:function(n){return null===n},__wbg___wbindgen_is_object_8b968c3ab8e96595:function(n){return"object"==typeof n&&null!==n},__wbg___wbindgen_is_string_fc456fee5d3317de:function(n){return"string"==typeof n},__wbg___wbindgen_is_undefined_be5b34249ff1fc15:function(n){return void 0===n},__wbg___wbindgen_jsval_eq_38d7bfbe4cc84039:function(n,t){return n===t},__wbg___wbindgen_jsval_loose_eq_b2f214e2e4b30e36:function(n,t){return n==t},__wbg___wbindgen_number_get_934b640d0889af78:function(n,t){const e="number"==typeof t?t:void 0;d().setFloat64(8+(n>>>0),y(e)?0:e,!0),d().setInt32(0+(n>>>0),!y(e),!0)},__wbg___wbindgen_string_get_7ce8eee7fd327545:function(n,t){const e="string"==typeof t?t:void 0;var r=y(e)?0:v(e,j.__wbindgen_export,j.__wbindgen_export2),_=T;d().setInt32(4+(n>>>0),_,!0),d().setInt32(0+(n>>>0),r,!0)},__wbg___wbindgen_throw_4c88d8bf264fd984:function(n,t){throw new Error(w(n,t))},__wbg__wbg_cb_unref_09736879a3f67559:function(n){n._wbg_cb_unref()},__wbg_call_40b008ba32f73991:function(){return h((function(n,t){return n.call(t)}),arguments)},__wbg_call_a410eb4b59ed5965:function(){return h((function(n,t,e){return n.call(t,e)}),arguments)},__wbg_call_fc92fee6137d452d:function(){return h((function(n,t,e,r){return n.call(t,e,r)}),arguments)},__wbg_clearInterval_2ed00e80b9bdc143:function(n){return clearInterval(n)},__wbg_close_5ee9c5fe4e8754a4:function(){return h((function(n){n.close()}),arguments)},__wbg_data_c7e5e8500f1bca2f:function(n){return n.data},__wbg_done_57e08d0be6e30c02:function(n){return n.done},__wbg_entries_7bb1459bd9b5c2b9:function(n){return Object.entries(n)},__wbg_from_eac91875c8a5ffa4:function(n){return Array.from(n)},__wbg_getRandomValues_5d8c030b527203a6:function(){return h((function(n,t){globalThis.crypto.getRandomValues(f(n,t))}),arguments)},__wbg_get_2080c49015e35254:function(){return h((function(n,t){return Reflect.get(n,t)}),arguments)},__wbg_get_635eea311fa1a291:function(){return h((function(n,t){return Reflect.get(n,t)}),arguments)},__wbg_get_d7176cfb76d71114:function(n,t){return n[t>>>0]},__wbg_get_unchecked_e6325ad374eff861:function(n,t){return n[t>>>0]},__wbg_get_with_ref_key_fc601247060b7204:function(n,t){return n[t]},__wbg_info_386f00b314475db5:function(n,t){console.info(w(n,t))},__wbg_instanceof_ArrayBuffer_12cdaa4161423e6b:function(n){let t;try{t=n instanceof ArrayBuffer}catch(n){t=!1}return t},__wbg_instanceof_Uint8Array_d7aeb0dcb3108fea:function(n){let t;try{t=n instanceof Uint8Array}catch(n){t=!1}return t},__wbg_isArray_bcf1376d0d732d08:function(n){return Array.isArray(n)},__wbg_isSafeInteger_1a35ba4d31e71d38:function(n){return Number.isSafeInteger(n)},__wbg_iterator_e4c5e8f68ada7b58:function(){return Symbol.iterator},__wbg_length_186163212ffe79c3:function(n){return n.length},__wbg_length_b03a0fabb109b1e9:function(n){return n.length},__wbg_new_13de428334042d26:function(n){return new Uint8Array(n)},__wbg_new_37eb45aaf5eeb820:function(){return new Array},__wbg_new_cd4348290afae586:function(){return new Object},__wbg_new_with_str_sequence_75b26d88172889d0:function(){return h((function(n,t,e){return new WebSocket(w(n,t),e)}),arguments)},__wbg_next_178c1651c11432b3:function(n){return n.next},__wbg_next_af5ac6a08bb0a717:function(){return h((function(n){return n.next()}),arguments)},__wbg_prototypesetcall_13162965d1fe7aa3:function(n,t,e){Uint8Array.prototype.set.call(f(n,t),e)},__wbg_push_c9f4893fc209f768:function(n,t){return n.push(t)},__wbg_readyState_039bc047141a5f6d:function(n){return n.readyState},__wbg_send_d83d0891cf698779:function(){return h((function(n,t,e){n.send(f(t,e))}),arguments)},__wbg_setInterval_ef738bbfe8cc0974:function(){return h((function(n,t){return setInterval(n,t)}),arguments)},__wbg_set_binaryType_d5b4dafd0f127fb2:function(n,t){n.binaryType=c[t]},__wbg_set_d2d33b52458e984a:function(n,t,e){n[t>>>0]=e},__wbg_set_e4b9a833d288759a:function(n,t,e){n[t]=e},__wbg_set_onclose_078935cf8d0fb024:function(n,t){n.onclose=t},__wbg_set_onerror_f7f089f7f059501c:function(n,t){n.onerror=t},__wbg_set_onmessage_26abc49cfa5f9ffc:function(n,t){n.onmessage=t},__wbg_set_onopen_757be120cc7b1ea6:function(n,t){n.onopen=t},__wbg_value_e0f328965e184931:function(n){return n.value},__wbg_warn_4f0851b2fd19b28b:function(n,t){console.warn(w(n,t))},__wbindgen_generic_0000000000000001:function(n,t){return m(n,t,r)},__wbindgen_generic_0000000000000002:function(n,t){return m(n,t,_)},__wbindgen_generic_0000000000000003:function(n,t){return m(n,t,o)},__wbindgen_generic_0000000000000004:function(n,t){return m(n,t,e)},__wbindgen_generic_0000000000000005:function(n){return n},__wbindgen_generic_0000000000000006:function(n,t){return f(n,t)},__wbindgen_generic_0000000000000007:function(n,t){return w(n,t)},__wbindgen_generic_0000000000000008:function(n){return BigInt.asUintN(64,n)},__wbindgen_init_externref_table:function(){const n=j.__wbindgen_externrefs;n.set(0,void 0),n.set(1024,void 0),n.set(1025,null),n.set(1026,!0),n.set(1027,!1)}};return{__proto__:null,"./phirepass-channel_bg.js":n}}();("string"==typeof n||"function"==typeof Request&&n instanceof Request||"function"==typeof URL&&n instanceof URL)&&(n=fetch(n));const{instance:i}=await async function(n,t){if("function"==typeof Response&&n instanceof Response){if(!n.ok)throw new Error(`failed to fetch Wasm: ${n.status} ${n.statusText} fetching '${n.url}'`);if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(n,t)}catch(t){if(!function(n){switch(n){case"basic":case"cors":case"default":return!0}return!1}(n.type)||"application/wasm"===n.headers.get("Content-Type"))throw t;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t)}const e=await n.arrayBuffer();return await WebAssembly.instantiate(e,t)}{const e=await WebAssembly.instantiate(n,t);return e instanceof WebAssembly.Instance?{instance:e,module:n}:e}}(await n,t);return function(n){return j=n.exports,b=null,l=null,j.__wbindgen_start(),j}(i)}(n),O.catch((()=>{O=void 0}))),O)}var F,P,k;!function(n){n.Error="Error",n.AuthSuccess="AuthSuccess",n.TunnelOpened="TunnelOpened",n.TunnelClosed="TunnelClosed",n.TunnelData="TunnelData",n.RDPAuthorized="RDPAuthorized",n.SFTPListItems="SFTPListItems",n.SFTPDownloadStartResponse="SFTPDownloadStartResponse",n.SFTPDownloadChunk="SFTPDownloadChunk",n.SFTPUploadStartResponse="SFTPUploadStartResponse",n.SFTPUploadChunkAck="SFTPUploadChunkAck",n.SFTPOpResult="SFTPOpResult"}(F||(F={})),function(n){n[n.Username=0]="Username",n[n.Password=1]="Password",n[n.Default=2]="Default"}(P||(P={})),function(n){n.Disconnected="disconnected",n.Connected="connected",n.Error="error"}(k||(k={}));export{n as C,t as E,P as I,F as P,U as _,k as a}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,g as s,h as i,H as o}from"./p-Dd9o0CbU.js";import{_ as n,C as h,a as r,P as a}from"./p-BtMWUitf.js";const c=200;function d(t){return!Number.isFinite(t)||t<=0?c:Math.min(8192,Math.max(c,Math.floor(t)))}function l(t){return t-t%2}function u(t){const e=t.getBoundingClientRect();return s=e.height,{width:l(d(e.width)),height:l(d(s))};var s}class p{onResize;debounceMs;observer;handle;reported;constructor(t,e=250){this.onResize=t,this.debounceMs=e}observe(t,e){this.disconnect(),this.reported=e,this.report(u(t)),"undefined"!=typeof ResizeObserver&&(this.observer=new ResizeObserver((()=>{clearTimeout(this.handle),this.handle=setTimeout((()=>this.report(u(t))),this.debounceMs)})),this.observer.observe(t))}disconnect(){clearTimeout(this.handle),this.handle=void 0,this.observer?.disconnect(),this.observer=void 0,this.reported=void 0}report(t){var e,s;s=this.reported,(e=t)&&s&&e.width===s.width&&e.height===s.height||(this.reported=t,this.onResize(t))}}function f(){return navigator.keyboard}function m(){return"function"==typeof f()?.lock}function b(t){return document.fullscreenElement===t}function w(t){return document.fullscreenElement?.contains(t)??!1}function y(){if(m())try{f().unlock()}catch(t){console.warn("Failed to release the keyboard lock:",t)}}const g=class{constructor(s){new.target===g&&t(this,s),this.connectionStateChanged=e(this,"connectionStateChanged")}channel;containerEl;ironEl;userInteraction;viewport;domReady=!1;runtimeReady=!1;connected=!1;disposed=!1;session_id;onFullscreenChange=()=>this.sync_keyboard_lock();credentials;credentialsPrompt=!1;statusMessage;usernameBuffer="";passwordBuffer="";get el(){return s(this)}serverHost="phirepass.com";serverPort=443;allowInsecure=!1;heartbeatInterval=3e4;nodeId;serviceId;token;username;password;destination;scale="fit";dynamicResize=!0;captureKeyboard=!0;clipboard=!0;onNodeIdChange(t,e){this.reset_session_state(),this.channel&&this.channel.is_connected()&&this.close_comms(),t&&(this.open_comms(),this.channel.connect())}serverId;channelFactory;onServerIdChange(t,e){this.onNodeIdChange(this.nodeId,this.nodeId)}connectionStateChanged;create_web_socket_endpoint(){const t=this.allowInsecure?"ws":"wss";return this.allowInsecure||443!==this.serverPort?this.allowInsecure&&80===this.serverPort?`${t}://${this.serverHost}`:`${t}://${this.serverHost}:${this.serverPort}`:`${t}://${this.serverHost}`}async connectedCallback(){document.addEventListener("fullscreenchange",this.onFullscreenChange),this.disposed=!1,this.channelFactory||await n(),this.open_comms(),this.runtimeReady=!0,this.nodeId?this.try_connect():console.warn("Prop node_id is not set. Cannot connect to RDP.")}componentDidLoad(){this.domReady=!0,this.try_connect()}async disconnectedCallback(){document.removeEventListener("fullscreenchange",this.onFullscreenChange),this.disposed=!0,this.session_id=void 0,this.connected=!1,this.domReady=!1,this.runtimeReady=!1,this.close_comms()}async toggleFullscreen(){const t=await async function(t){try{return b(t)?(await document.exitFullscreen(),!1):(await t.requestFullscreen({navigationUI:"hide"}),!0)}catch(e){return console.warn("Failed to change the fullscreen state of the RDP session:",e),b(t)}}(this.el);return this.focus_desktop(),t}async keyboardLockSupported(){return m()}async focusDesktop(){this.focus_desktop()}async sendCtrlAltDel(){return!!this.userInteraction&&(this.userInteraction.ctrlAltDel(),this.focus_desktop(),!0)}async sendMetaKey(){return!!this.userInteraction&&(this.userInteraction.metaKey(),this.focus_desktop(),!0)}try_connect(){!this.connected&&this.domReady&&this.runtimeReady&&this.containerEl&&this.channel&&this.connect()}connect(){this.connected=!0,this.channel.connect()}open_comms(){this.channel=this.channelFactory?this.channelFactory(`${this.create_web_socket_endpoint()}/api/web/ws`,this.nodeId,this.serverId||void 0):this.serverId?new h(`${this.create_web_socket_endpoint()}/api/web/ws`,this.nodeId,this.serverId):new h(`${this.create_web_socket_endpoint()}/api/web/ws`,this.nodeId),this.channel.on_connection_open((()=>{this.connectionStateChanged.emit([r.Connected]),this.channel.authenticate(this.token,this.nodeId)})),this.channel.on_connection_close((()=>{this.connectionStateChanged.emit([r.Disconnected]),this.teardown_client()})),this.channel.on_connection_error((t=>{this.connectionStateChanged.emit([r.Error,t])})),this.channel.on_connection_message((()=>{})),this.channel.on_protocol_message((t=>{const{web:e}=t.data;switch(e.type){case a.Error:this.handle_error(e);break;case a.AuthSuccess:this.handle_auth_success(e);break;case a.RDPAuthorized:this.handle_rdp_authorized(e);break;case a.TunnelClosed:this.handle_tunnel_closed(e);break;default:console.warn("Unknown protocol message type:",e)}}))}close_comms(){this.teardown_client(),this.channel&&(this.channel.stop_heartbeat(),this.channel.disconnect())}reset_session_state(){this.session_id=void 0,this.credentials=void 0,this.credentialsPrompt=!1,this.usernameBuffer="",this.passwordBuffer="",this.statusMessage=void 0}handle_auth_success(t){if(this.channel.start_heartbeat(this.heartbeatInterval<=15e3?3e4:this.heartbeatInterval),this.username&&this.password)return this.credentials={username:this.username,password:this.password},void this.request_tunnel();this.credentialsPrompt=!0}request_tunnel(){this.credentials&&(this.statusMessage=void 0,this.channel.open_rdp_tunnel(this.nodeId,this.serviceId,this.credentials.username,this.credentials.password))}async handle_rdp_authorized(t){this.session_id=t.sid,this.statusMessage="Connecting…";const[e]=await Promise.all([import("@devolutions/iron-remote-desktop-rdp"),import("@devolutions/iron-remote-desktop")]);if(this.disposed||!this.containerEl||this.session_id!==t.sid)return;if(await e.init("info"),this.disposed||!this.containerEl||this.session_id!==t.sid)return;const s=document.createElement("iron-remote-desktop");s.module=e.Backend,s.scale=this.scale,s.flexcenter=!0,s.verbose=!1;const i=[e.enableCredssp(!0)];this.dynamicResize&&i.push(e.displayControl(!0)),s.addEventListener("ready",(e=>{this.start_session(e.detail.irgUserInteraction,t.ticket,i)})),this.ironEl=s,this.mount_client(s)}mount_client(t){this.el.appendChild(t)}async start_session(t,e,s){this.userInteraction=t,this.clipboard||t.setEnableClipboard(!1),t.onWarningCallback((t=>{console.warn("The remote desktop client reported a problem:",t)}));const i=t.configBuilder().withUsername(this.credentials?.username??"").withPassword(this.credentials?.password??"").withDestination(this.destination??this.nodeId).withProxyAddress(`${this.create_web_socket_endpoint()}/api/web/rdp/${this.nodeId}`).withAuthToken(e);for(const t of s)i.withExtension(t);let o;this.dynamicResize&&(o=function(t){const e=t.getBoundingClientRect();if(Number.isFinite(e.width)&&Number.isFinite(e.height)&&!(e.width<c||e.height<c))return{width:l(Math.min(Math.floor(e.width),4096)),height:l(Math.min(Math.floor(e.height),4096))}}(this.el),o&&i.withDesktopSize(o));try{const e=await t.connect(i.build());if(this.disposed)return this.shutdown_session(t),void await e.run();t.setVisibility(!0),this.statusMessage=void 0,this.focus_desktop(),this.sync_keyboard_lock();const s=e.run();this.start_viewport_sync(o);const n=await s;this.statusMessage=n.reason()}catch(t){const e=this.describe_error(t);this.statusMessage=e,this.connectionStateChanged.emit([r.Error,t])}}start_viewport_sync(t){this.dynamicResize&&(this.viewport=new p((t=>this.resize_desktop(t))),this.viewport.observe(this.el,t))}stop_viewport_sync(){this.viewport?.disconnect(),this.viewport=void 0}resize_desktop(t){try{this.userInteraction?.resize(t.width,t.height)}catch(t){console.warn("The remote host would not resize its desktop:",t)}}focus_desktop(){var t;t=this.ironEl,t?.focus({preventScroll:!0})}async sync_keyboard_lock(){this.captureKeyboard&&w(this.el)?(await async function(t){if(m()&&w(t))try{await f().lock()}catch(t){console.warn("Failed to lock the keyboard for the RDP session:",t)}}(this.el),this.focus_desktop()):y()}describe_error(t){return t&&"function"==typeof t.backtrace?t.backtrace():t instanceof Error?t.message:"Connection failed."}handle_tunnel_closed(t){this.session_id=void 0,this.statusMessage=this.statusMessage??"Connection closed.",this.teardown_client(),this.close_comms()}handle_error(t){this.statusMessage=t.message,this.connectionStateChanged.emit([r.Error,t])}shutdown_session(t){try{t.shutdown()}catch(t){console.warn("Failed to shut the RDP session down cleanly:",t)}}teardown_client(){this.stop_viewport_sync(),y(),this.userInteraction&&(this.shutdown_session(this.userInteraction),this.userInteraction=void 0),this.ironEl?.remove(),this.ironEl=void 0,this.credentialsPrompt=!1,this.usernameBuffer="",this.passwordBuffer=""}submit_credentials(t){t.preventDefault(),this.credentialsPrompt=!1,this.credentials={username:this.usernameBuffer,password:this.passwordBuffer},this.usernameBuffer="",this.passwordBuffer="",this.request_tunnel()}render(){return i(o,{key:"9db127da5dbe168ef5f7a021767e5cedeb8305e6"},i("div",{key:"06d2de6763ec479198389032ab65033eefab21d6",class:"screen",ref:t=>this.containerEl=t},i("slot",{key:"7842ca9fd64795794e1b90e15319ddaa599f85b8"})),this.credentialsPrompt&&i("form",{key:"ce53830ced182740f139a318f099918c31013d9f",class:"prompt",onSubmit:t=>this.submit_credentials(t)},i("label",{key:"2b55341b9cfc2e08a847e26985000f5e1bc86eca",htmlFor:"rdp-username"},"Username"),i("input",{key:"243500ff59de6f16cc67acc5ddf9e15e3c0de0f6",id:"rdp-username",type:"text",autocomplete:"off",autofocus:!0,onInput:t=>this.usernameBuffer=t.target.value}),i("label",{key:"5a346aa6a730c4cb0dd550eab9a65db9f2e74bc6",htmlFor:"rdp-password"},"Password"),i("input",{key:"0f1081b05f94e15a7f04df4de390a33a021ffe53",id:"rdp-password",type:"password",autocomplete:"off",onInput:t=>this.passwordBuffer=t.target.value}),i("button",{key:"e9657c9df124176210508f5125fc526e3c78c5f1",type:"submit"},"Connect")),this.statusMessage&&!this.credentialsPrompt&&i("div",{key:"3c59dbae63b7c5c5ef80344abad4b1a2b4c0b79d",class:"status"},this.statusMessage))}static get watchers(){return{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}}};g.style=':host{display:block;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;position:relative;background:#0b1021;container-type:inline-size}.screen{width:100%;height:100%;display:flex}::slotted(iron-remote-desktop){display:block;flex:1 1 auto;min-width:0;min-height:0;width:100%;height:100%}:host(:fullscreen){width:100vw;height:100vh;background:#000}.prompt{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0.5rem;background:rgba(11, 16, 33, 0.92);color:#e2e8f0;font-family:"Berkeley Mono", "Fira Code", "SFMono-Regular", Menlo, monospace;font-size:0.875rem}.prompt input{padding:0.5rem 0.75rem;border:1px solid #334155;border-radius:0.375rem;background:#0f172a;color:inherit;font:inherit;min-width:16rem}.prompt input:focus{outline:2px solid #67e8f9;outline-offset:1px}.prompt button{margin-top:0.5rem;padding:0.5rem 1.25rem;border:0;border-radius:0.375rem;background:#67e8f9;color:#0b1021;font:inherit;font-weight:600;cursor:pointer}.status{position:absolute;inset-inline:0;bottom:0;padding:0.5rem 0.75rem;background:rgba(11, 16, 33, 0.92);color:#e2e8f0;font-family:"Berkeley Mono", "Fira Code", "SFMono-Regular", Menlo, monospace;font-size:0.8125rem;text-align:center}@container (max-width: 640px){.prompt{padding:1rem;gap:0.4rem}.prompt input{min-width:0;width:100%;max-width:22rem;font-size:16px;padding:0.625rem 0.75rem}.prompt button{width:100%;max-width:22rem;padding:0.75rem 1.25rem}.status{font-size:0.75rem;padding:0.5rem;padding-bottom:calc(0.5rem + env(safe-area-inset-bottom))}}';export{g as phirepass_rdp}
|
|
1
|
+
import{r as t,c as e,g as s,h as i,H as o}from"./p-BinptKL7.js";import{_ as n,C as h,a as r,P as a}from"./p-BekUePpu.js";const c=200;function d(t){return!Number.isFinite(t)||t<=0?c:Math.min(8192,Math.max(c,Math.floor(t)))}function l(t){return t-t%2}function u(t){const e=t.getBoundingClientRect();return s=e.height,{width:l(d(e.width)),height:l(d(s))};var s}class p{onResize;debounceMs;observer;handle;reported;constructor(t,e=250){this.onResize=t,this.debounceMs=e}observe(t,e){this.disconnect(),this.reported=e,this.report(u(t)),"undefined"!=typeof ResizeObserver&&(this.observer=new ResizeObserver((()=>{clearTimeout(this.handle),this.handle=setTimeout((()=>this.report(u(t))),this.debounceMs)})),this.observer.observe(t))}disconnect(){clearTimeout(this.handle),this.handle=void 0,this.observer?.disconnect(),this.observer=void 0,this.reported=void 0}report(t){var e,s;s=this.reported,(e=t)&&s&&e.width===s.width&&e.height===s.height||(this.reported=t,this.onResize(t))}}function f(){return navigator.keyboard}function m(){return"function"==typeof f()?.lock}function b(t){return document.fullscreenElement===t}function w(t){return document.fullscreenElement?.contains(t)??!1}function y(){if(m())try{f().unlock()}catch(t){console.warn("Failed to release the keyboard lock:",t)}}const g=class{constructor(s){new.target===g&&t(this,s),this.connectionStateChanged=e(this,"connectionStateChanged")}channel;containerEl;ironEl;userInteraction;viewport;domReady=!1;runtimeReady=!1;connected=!1;disposed=!1;session_id;onFullscreenChange=()=>this.sync_keyboard_lock();credentials;credentialsPrompt=!1;statusMessage;usernameBuffer="";passwordBuffer="";get el(){return s(this)}serverHost="phirepass.com";serverPort=443;allowInsecure=!1;heartbeatInterval=3e4;nodeId;serviceId;token;username;password;destination;scale="fit";dynamicResize=!0;captureKeyboard=!0;clipboard=!0;onNodeIdChange(t,e){this.reset_session_state(),this.channel&&this.channel.is_connected()&&this.close_comms(),t&&(this.open_comms(),this.channel.connect())}serverId;channelFactory;onServerIdChange(t,e){this.onNodeIdChange(this.nodeId,this.nodeId)}connectionStateChanged;create_web_socket_endpoint(){const t=this.allowInsecure?"ws":"wss";return this.allowInsecure||443!==this.serverPort?this.allowInsecure&&80===this.serverPort?`${t}://${this.serverHost}`:`${t}://${this.serverHost}:${this.serverPort}`:`${t}://${this.serverHost}`}async connectedCallback(){document.addEventListener("fullscreenchange",this.onFullscreenChange),this.disposed=!1,this.channelFactory||await n(),this.open_comms(),this.runtimeReady=!0,this.nodeId?this.try_connect():console.warn("Prop node_id is not set. Cannot connect to RDP.")}componentDidLoad(){this.domReady=!0,this.try_connect()}async disconnectedCallback(){document.removeEventListener("fullscreenchange",this.onFullscreenChange),this.disposed=!0,this.session_id=void 0,this.connected=!1,this.domReady=!1,this.runtimeReady=!1,this.close_comms()}async toggleFullscreen(){const t=await async function(t){try{return b(t)?(await document.exitFullscreen(),!1):(await t.requestFullscreen({navigationUI:"hide"}),!0)}catch(e){return console.warn("Failed to change the fullscreen state of the RDP session:",e),b(t)}}(this.el);return this.focus_desktop(),t}async keyboardLockSupported(){return m()}async focusDesktop(){this.focus_desktop()}async sendCtrlAltDel(){return!!this.userInteraction&&(this.userInteraction.ctrlAltDel(),this.focus_desktop(),!0)}async sendMetaKey(){return!!this.userInteraction&&(this.userInteraction.metaKey(),this.focus_desktop(),!0)}try_connect(){!this.connected&&this.domReady&&this.runtimeReady&&this.containerEl&&this.channel&&this.connect()}connect(){this.connected=!0,this.channel.connect()}open_comms(){this.channel=this.channelFactory?this.channelFactory(`${this.create_web_socket_endpoint()}/api/web/ws`,this.nodeId,this.serverId||void 0):this.serverId?new h(`${this.create_web_socket_endpoint()}/api/web/ws`,this.nodeId,this.serverId):new h(`${this.create_web_socket_endpoint()}/api/web/ws`,this.nodeId),this.channel.on_connection_open((()=>{this.connectionStateChanged.emit([r.Connected]),this.channel.authenticate(this.token,this.nodeId)})),this.channel.on_connection_close((()=>{this.connectionStateChanged.emit([r.Disconnected]),this.teardown_client()})),this.channel.on_connection_error((t=>{this.connectionStateChanged.emit([r.Error,t])})),this.channel.on_connection_message((()=>{})),this.channel.on_protocol_message((t=>{const{web:e}=t.data;switch(e.type){case a.Error:this.handle_error(e);break;case a.AuthSuccess:this.handle_auth_success(e);break;case a.RDPAuthorized:this.handle_rdp_authorized(e);break;case a.TunnelClosed:this.handle_tunnel_closed(e);break;default:console.warn("Unknown protocol message type:",e)}}))}close_comms(){this.teardown_client(),this.channel&&(this.channel.stop_heartbeat(),this.channel.disconnect())}reset_session_state(){this.session_id=void 0,this.credentials=void 0,this.credentialsPrompt=!1,this.usernameBuffer="",this.passwordBuffer="",this.statusMessage=void 0}handle_auth_success(t){if(this.channel.start_heartbeat(this.heartbeatInterval<=15e3?3e4:this.heartbeatInterval),this.username&&this.password)return this.credentials={username:this.username,password:this.password},void this.request_tunnel();this.credentialsPrompt=!0}request_tunnel(){this.credentials&&(this.statusMessage=void 0,this.channel.open_rdp_tunnel(this.nodeId,this.serviceId,this.credentials.username,this.credentials.password))}async handle_rdp_authorized(t){this.session_id=t.sid,this.statusMessage="Connecting…";const[e]=await Promise.all([import("@devolutions/iron-remote-desktop-rdp"),import("@devolutions/iron-remote-desktop")]);if(this.disposed||!this.containerEl||this.session_id!==t.sid)return;if(await e.init("info"),this.disposed||!this.containerEl||this.session_id!==t.sid)return;const s=document.createElement("iron-remote-desktop");s.module=e.Backend,s.scale=this.scale,s.flexcenter=!0,s.verbose=!1;const i=[e.enableCredssp(!0)];this.dynamicResize&&i.push(e.displayControl(!0)),s.addEventListener("ready",(e=>{this.start_session(e.detail.irgUserInteraction,t.ticket,i)})),this.ironEl=s,this.mount_client(s)}mount_client(t){this.el.appendChild(t)}async start_session(t,e,s){this.userInteraction=t,this.clipboard||t.setEnableClipboard(!1),t.onWarningCallback((t=>{console.warn("The remote desktop client reported a problem:",t)}));const i=t.configBuilder().withUsername(this.credentials?.username??"").withPassword(this.credentials?.password??"").withDestination(this.destination??this.nodeId).withProxyAddress(`${this.create_web_socket_endpoint()}/api/web/rdp/${this.nodeId}`).withAuthToken(e);for(const t of s)i.withExtension(t);let o;this.dynamicResize&&(o=function(t){const e=t.getBoundingClientRect();if(Number.isFinite(e.width)&&Number.isFinite(e.height)&&!(e.width<c||e.height<c))return{width:l(Math.min(Math.floor(e.width),4096)),height:l(Math.min(Math.floor(e.height),4096))}}(this.el),o&&i.withDesktopSize(o));try{const e=await t.connect(i.build());if(this.disposed)return this.shutdown_session(t),void await e.run();t.setVisibility(!0),this.statusMessage=void 0,this.focus_desktop(),this.sync_keyboard_lock();const s=e.run();this.start_viewport_sync(o);const n=await s;this.statusMessage=n.reason()}catch(t){const e=this.describe_error(t);this.statusMessage=e,this.connectionStateChanged.emit([r.Error,t])}}start_viewport_sync(t){this.dynamicResize&&(this.viewport=new p((t=>this.resize_desktop(t))),this.viewport.observe(this.el,t))}stop_viewport_sync(){this.viewport?.disconnect(),this.viewport=void 0}resize_desktop(t){try{this.userInteraction?.resize(t.width,t.height)}catch(t){console.warn("The remote host would not resize its desktop:",t)}}focus_desktop(){var t;t=this.ironEl,t?.focus({preventScroll:!0})}async sync_keyboard_lock(){this.captureKeyboard&&w(this.el)?(await async function(t){if(m()&&w(t))try{await f().lock()}catch(t){console.warn("Failed to lock the keyboard for the RDP session:",t)}}(this.el),this.focus_desktop()):y()}describe_error(t){return t&&"function"==typeof t.backtrace?t.backtrace():t instanceof Error?t.message:"Connection failed."}handle_tunnel_closed(t){this.session_id=void 0,this.statusMessage=this.statusMessage??"Connection closed.",this.teardown_client(),this.close_comms()}handle_error(t){this.statusMessage=t.message,this.connectionStateChanged.emit([r.Error,t])}shutdown_session(t){try{t.shutdown()}catch(t){console.warn("Failed to shut the RDP session down cleanly:",t)}}teardown_client(){this.stop_viewport_sync(),y(),this.userInteraction&&(this.shutdown_session(this.userInteraction),this.userInteraction=void 0),this.ironEl?.remove(),this.ironEl=void 0,this.credentialsPrompt=!1,this.usernameBuffer="",this.passwordBuffer=""}submit_credentials(t){t.preventDefault(),this.credentialsPrompt=!1,this.credentials={username:this.usernameBuffer,password:this.passwordBuffer},this.usernameBuffer="",this.passwordBuffer="",this.request_tunnel()}render(){return i(o,{key:"9db127da5dbe168ef5f7a021767e5cedeb8305e6"},i("div",{key:"06d2de6763ec479198389032ab65033eefab21d6",class:"screen",ref:t=>this.containerEl=t},i("slot",{key:"7842ca9fd64795794e1b90e15319ddaa599f85b8"})),this.credentialsPrompt&&i("form",{key:"ce53830ced182740f139a318f099918c31013d9f",class:"prompt",onSubmit:t=>this.submit_credentials(t)},i("label",{key:"2b55341b9cfc2e08a847e26985000f5e1bc86eca",htmlFor:"rdp-username"},"Username"),i("input",{key:"243500ff59de6f16cc67acc5ddf9e15e3c0de0f6",id:"rdp-username",type:"text",autocomplete:"off",autofocus:!0,onInput:t=>this.usernameBuffer=t.target.value}),i("label",{key:"5a346aa6a730c4cb0dd550eab9a65db9f2e74bc6",htmlFor:"rdp-password"},"Password"),i("input",{key:"0f1081b05f94e15a7f04df4de390a33a021ffe53",id:"rdp-password",type:"password",autocomplete:"off",onInput:t=>this.passwordBuffer=t.target.value}),i("button",{key:"e9657c9df124176210508f5125fc526e3c78c5f1",type:"submit"},"Connect")),this.statusMessage&&!this.credentialsPrompt&&i("div",{key:"3c59dbae63b7c5c5ef80344abad4b1a2b4c0b79d",class:"status"},this.statusMessage))}static get watchers(){return{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}}};g.style=':host{display:block;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;position:relative;background:#0b1021;container-type:inline-size}.screen{width:100%;height:100%;display:flex}::slotted(iron-remote-desktop){display:block;flex:1 1 auto;min-width:0;min-height:0;width:100%;height:100%}:host(:fullscreen){width:100vw;height:100vh;background:#000}.prompt{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0.5rem;background:rgba(11, 16, 33, 0.92);color:#e2e8f0;font-family:"Berkeley Mono", "Fira Code", "SFMono-Regular", Menlo, monospace;font-size:0.875rem}.prompt input{padding:0.5rem 0.75rem;border:1px solid #334155;border-radius:0.375rem;background:#0f172a;color:inherit;font:inherit;min-width:16rem}.prompt input:focus{outline:2px solid #67e8f9;outline-offset:1px}.prompt button{margin-top:0.5rem;padding:0.5rem 1.25rem;border:0;border-radius:0.375rem;background:#67e8f9;color:#0b1021;font:inherit;font-weight:600;cursor:pointer}.status{position:absolute;inset-inline:0;bottom:0;padding:0.5rem 0.75rem;background:rgba(11, 16, 33, 0.92);color:#e2e8f0;font-family:"Berkeley Mono", "Fira Code", "SFMono-Regular", Menlo, monospace;font-size:0.8125rem;text-align:center}@container (max-width: 640px){.prompt{padding:1rem;gap:0.4rem}.prompt input{min-width:0;width:100%;max-width:22rem;font-size:16px;padding:0.625rem 0.75rem}.prompt button{width:100%;max-width:22rem;padding:0.75rem 1.25rem}.status{font-size:0.75rem;padding:0.5rem;padding-bottom:calc(0.5rem + env(safe-area-inset-bottom))}}';export{g as phirepass_rdp}
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as r}from"./p-
|
|
1
|
+
import{p as e,b as r}from"./p-BinptKL7.js";export{s as setNonce}from"./p-BinptKL7.js";import{g as o}from"./p-DQuL1Twl.js";(()=>{const r=import.meta.url,o={};return""!==r&&(o.resourcesUrl=new URL(".",r).href),e(o)})().then((async e=>(await o(),r([["p-fe1ce8da",[[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"],channelFactory:[16],credentialsPrompt:[32],statusMessage:[32],toggleFullscreen:[64],keyboardLockSupported:[64],focusDesktop:[64],sendCtrlAltDel:[64],sendMetaKey:[64]},null,{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}]]],["p-9e6f9220",[[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],keyBar:[1,"key-bar"],serverId:[1,"server-id"],channelFactory:[16],ctrlArmed:[32],altArmed:[32]},null,{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}]]],["p-6a192c8d",[[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"],channelFactory:[16],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],delete_is_dir:[32],delete_recursive:[32],delete_error:[32],prompt_kind:[32],prompt_value:[32],prompt_error:[32],prompt_busy:[32],chmod_target:[32],chmod_mode:[32],chmod_error:[32],chmod_busy:[32],show_editor:[32],editor_name:[32],editor_text:[32],editor_saved_text:[32],editor_busy:[32],editor_error:[32],editor_confirm_discard:[32],editor_loaded:[32],filter:[32],sort_key:[32],sort_asc:[32],channel_ready:[32],fetch_count:[32],fresh_names:[32],part_delete:[32],torrent_menu:[32],listing_player:[32],maximize:[64],minimize:[64]},null,{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}],[513,"phirepass-downloader",{nodeId:[1,"node-id"],nodeLabel:[1,"node-label"],token:[1],channel:[16],connected:[4],channelFactory:[16],browsingService:[1,"browsing-service"],browsingPath:[1025,"browsing-path"],compact:[516],streamBase:[1,"stream-base"],canConfigure:[4,"can-configure"],inlinePlayer:[4,"inline-player"],serverHost:[1,"server-host"],serverPort:[2,"server-port"],serverId:[1,"server-id"],allowInsecure:[4,"allow-insecure"],heartbeatInterval:[2,"heartbeat-interval"],connection:[32],caps:[32],jobs:[32],tab:[32],drawerOpen:[32],dialogOpen:[32],unread:[32],form:[32],where:[32],starting:[32],refusal:[32],confirm:[32],notices:[32],subDir:[32],picker:[32],player:[32],receive:[64],openFetch:[64],toggleDrawer:[64],jobForPath:[64],deleteDownload:[64],torrentPathFor:[64],startTorrentPath:[64]},null,{channel:[{onChannel:0}],connected:[{onConnected:0}],browsingPath:[{onBrowsing:0}],browsingService:[{onBrowsing:0}],nodeId:[{onNode:0}]}],[513,"phirepass-media-player",{src:[1],name:[1],mime:[1],status:[1],ready:[2],positionStore:[16],positionKey:[1,"position-key"],remotePlayback:[16],linkMinter:[16],castDevice:[1,"cast-device"],phase:[32],stored:[32],castAvailable:[32],castSrc:[32],linkNote:[32],currentTime:[32],duration:[32],close:[64]},null,{src:[{onSrc:0}]}]]]],e))));
|
|
@@ -217,6 +217,13 @@ export declare class PhirepassDownloader {
|
|
|
217
217
|
private canPickFolder;
|
|
218
218
|
private listFolders;
|
|
219
219
|
private savePicker;
|
|
220
|
+
/**
|
|
221
|
+
* The dialog's state as it is now, not as it was when the dialog last rendered.
|
|
222
|
+
* Handlers run between a state change and the re-render it schedules (tick a box,
|
|
223
|
+
* then click confirm before the frame), so reading `c` from the render closure
|
|
224
|
+
* would act on the stale value.
|
|
225
|
+
*/
|
|
226
|
+
private latest;
|
|
220
227
|
private renderConfirm;
|
|
221
228
|
private renderForm;
|
|
222
229
|
private renderRows;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "phirepass-widgets",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.117",
|
|
4
4
|
"description": "Phirepass widgets for the web application",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -40,24 +40,24 @@
|
|
|
40
40
|
"test": "vitest run --config vitest.config.mts --project spec",
|
|
41
41
|
"test.watch": "vitest --config vitest.config.mts --project spec",
|
|
42
42
|
"test:storybook": "stencil build && vitest run --config vitest.config.mts --project storybook",
|
|
43
|
-
"test:all": "
|
|
43
|
+
"test:all": "bun run test && bun run test:storybook",
|
|
44
44
|
"storybook": "stencil build && storybook dev -p 6006",
|
|
45
45
|
"build-storybook": "stencil build && storybook build",
|
|
46
46
|
"generate": "stencil generate"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@stencil/core": "^4.45.
|
|
49
|
+
"@stencil/core": "^4.45.5",
|
|
50
50
|
"@stencil/vitest": "^1.16.2",
|
|
51
|
-
"@storybook/addon-a11y": "^10.6.
|
|
52
|
-
"@storybook/addon-docs": "^10.6.
|
|
53
|
-
"@storybook/addon-vitest": "^10.6.
|
|
54
|
-
"@storybook/web-components-vite": "^10.6.
|
|
51
|
+
"@storybook/addon-a11y": "^10.6.8",
|
|
52
|
+
"@storybook/addon-docs": "^10.6.8",
|
|
53
|
+
"@storybook/addon-vitest": "^10.6.8",
|
|
54
|
+
"@storybook/web-components-vite": "^10.6.8",
|
|
55
55
|
"@types/node": "^26.6.6",
|
|
56
56
|
"@vitest/browser": "^5.1.1",
|
|
57
57
|
"@vitest/browser-playwright": "^5.1.1",
|
|
58
58
|
"lit": "^3.3.3",
|
|
59
59
|
"playwright": "^1.65.1",
|
|
60
|
-
"storybook": "^10.6.
|
|
60
|
+
"storybook": "^10.6.8",
|
|
61
61
|
"vite": "^8.3.8",
|
|
62
62
|
"vitest": "^5.1.1"
|
|
63
63
|
},
|
|
@@ -72,6 +72,6 @@
|
|
|
72
72
|
"@xterm/addon-web-links": "^0.12.0",
|
|
73
73
|
"@xterm/addon-webgl": "^0.19.0",
|
|
74
74
|
"@xterm/xterm": "^6.0.0",
|
|
75
|
-
"phirepass-channel": "^0.1.
|
|
75
|
+
"phirepass-channel": "^0.1.358"
|
|
76
76
|
}
|
|
77
77
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
class n{__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,i.unregister(this),n}free(){const n=this.__destroy_into_raw();j.__wbg_channel_free(n,0)}authenticate(n,t,e){const r=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0);let _,o,c,i;try{_=v(n,j.__wbindgen_export,j.__wbindgen_export2),o=T,c=v(t,j.__wbindgen_export,j.__wbindgen_export2),i=T}catch(n){throw c&&j.__wbindgen_export3(c,1*i,1),_&&j.__wbindgen_export3(_,1*o,1),n}j.channel_authenticate(this.__wbg_ptr,_,o,c,i,r)}connect(){j.channel_connect(this.__wbg_ptr)}create_service(n,t,e,r,_,o,c,i,s){const u=+_,a=+(y(s)?Number.MAX_SAFE_INTEGER:s>>>0);let f,b,d,w,l,g,h,m,p,N,A,R,S,O;try{f=v(n,j.__wbindgen_export,j.__wbindgen_export2),b=T,d=v(t,j.__wbindgen_export,j.__wbindgen_export2),w=T,l=y(e)?0:v(e,j.__wbindgen_export,j.__wbindgen_export2),g=T,h=v(r,j.__wbindgen_export,j.__wbindgen_export2),m=T,p=y(o)?0:v(o,j.__wbindgen_export,j.__wbindgen_export2),N=T,A=y(c)?0:v(c,j.__wbindgen_export,j.__wbindgen_export2),R=T,S=y(i)?0:v(i,j.__wbindgen_export,j.__wbindgen_export2),O=T}catch(n){throw S&&j.__wbindgen_export3(S,1*O,1),A&&j.__wbindgen_export3(A,1*R,1),p&&j.__wbindgen_export3(p,1*N,1),h&&j.__wbindgen_export3(h,1*m,1),l&&j.__wbindgen_export3(l,1*g,1),d&&j.__wbindgen_export3(d,1*w,1),f&&j.__wbindgen_export3(f,1*b,1),n}j.channel_create_service(this.__wbg_ptr,f,b,d,w,l,g,h,m,u,p,N,A,R,S,O,a)}delete_service(n,t,e){const r=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0);let _,o,c,i;try{_=v(n,j.__wbindgen_export,j.__wbindgen_export2),o=T,c=v(t,j.__wbindgen_export,j.__wbindgen_export2),i=T}catch(n){throw c&&j.__wbindgen_export3(c,1*i,1),_&&j.__wbindgen_export3(_,1*o,1),n}j.channel_delete_service(this.__wbg_ptr,_,o,c,i,r)}disconnect(){j.channel_disconnect(this.__wbg_ptr)}is_connected(){return 0!==j.channel_is_connected(this.__wbg_ptr)}is_disconnected(){return 0!==j.channel_is_disconnected(this.__wbg_ptr)}constructor(n,t,e){let r,_,o,c,s,u;try{r=v(n,j.__wbindgen_export,j.__wbindgen_export2),_=T,o=v(t,j.__wbindgen_export,j.__wbindgen_export2),c=T,s=y(e)?0:v(e,j.__wbindgen_export,j.__wbindgen_export2),u=T}catch(n){throw s&&j.__wbindgen_export3(s,1*u,1),o&&j.__wbindgen_export3(o,1*c,1),r&&j.__wbindgen_export3(r,1*_,1),n}const a=j.channel_new(r,_,o,c,s,u);return this.__wbg_ptr=a,i.register(this,this.__wbg_ptr,this),this}on_connection_close(n){j.channel_on_connection_close(this.__wbg_ptr,y(n)?0:s(n))}on_connection_error(n){j.channel_on_connection_error(this.__wbg_ptr,y(n)?0:s(n))}on_connection_message(n){j.channel_on_connection_message(this.__wbg_ptr,y(n)?0:s(n))}on_connection_open(n){j.channel_on_connection_open(this.__wbg_ptr,y(n)?0:s(n))}on_protocol_message(n){j.channel_on_protocol_message(this.__wbg_ptr,y(n)?0:s(n))}on_protocol_message_type(n,t){const e=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_on_protocol_message_type(this.__wbg_ptr,e,T,y(t)?0:s(t))}open_rdp_tunnel(n,t,e,r,_){const o=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let c,i,s,u,a,f,b,d;try{c=v(n,j.__wbindgen_export,j.__wbindgen_export2),i=T,s=v(t,j.__wbindgen_export,j.__wbindgen_export2),u=T,a=y(e)?0:v(e,j.__wbindgen_export,j.__wbindgen_export2),f=T,b=y(r)?0:v(r,j.__wbindgen_export,j.__wbindgen_export2),d=T}catch(n){throw b&&j.__wbindgen_export3(b,1*d,1),a&&j.__wbindgen_export3(a,1*f,1),s&&j.__wbindgen_export3(s,1*u,1),c&&j.__wbindgen_export3(c,1*i,1),n}j.channel_open_rdp_tunnel(this.__wbg_ptr,c,i,s,u,a,f,b,d,o)}open_sftp_tunnel(n,t,e,r,_){const o=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let c,i,s,u,a,f,b,d;try{c=v(n,j.__wbindgen_export,j.__wbindgen_export2),i=T,s=v(t,j.__wbindgen_export,j.__wbindgen_export2),u=T,a=y(e)?0:v(e,j.__wbindgen_export,j.__wbindgen_export2),f=T,b=y(r)?0:v(r,j.__wbindgen_export,j.__wbindgen_export2),d=T}catch(n){throw b&&j.__wbindgen_export3(b,1*d,1),a&&j.__wbindgen_export3(a,1*f,1),s&&j.__wbindgen_export3(s,1*u,1),c&&j.__wbindgen_export3(c,1*i,1),n}j.channel_open_sftp_tunnel(this.__wbg_ptr,c,i,s,u,a,f,b,d,o)}open_ssh_tunnel(n,t,e,r,_){const o=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let c,i,s,u,a,f,b,d;try{c=v(n,j.__wbindgen_export,j.__wbindgen_export2),i=T,s=v(t,j.__wbindgen_export,j.__wbindgen_export2),u=T,a=y(e)?0:v(e,j.__wbindgen_export,j.__wbindgen_export2),f=T,b=y(r)?0:v(r,j.__wbindgen_export,j.__wbindgen_export2),d=T}catch(n){throw b&&j.__wbindgen_export3(b,1*d,1),a&&j.__wbindgen_export3(a,1*f,1),s&&j.__wbindgen_export3(s,1*u,1),c&&j.__wbindgen_export3(c,1*i,1),n}j.channel_open_ssh_tunnel(this.__wbg_ptr,c,i,s,u,a,f,b,d,o)}send_download_delete(n,t,e){const r=+t,_=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0),o=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_download_delete(this.__wbg_ptr,o,T,r,_)}send_download_resume(n,t,e){const r=+t,_=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0),o=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_download_resume(this.__wbg_ptr,o,T,r,_)}send_download_set_order(n,t,e){const r=+t,_=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0),o=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_download_set_order(this.__wbg_ptr,o,T,r,_)}send_download_settings_get(n,t){const e=+(y(t)?Number.MAX_SAFE_INTEGER:t>>>0),r=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_download_settings_get(this.__wbg_ptr,r,T,e)}send_download_settings_save(n,t,e){const r=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0),_=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_download_settings_save(this.__wbg_ptr,_,T,t,r)}send_download_start(n,t,e,r,_,o,c){const i=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let s,u,a,f;try{s=v(n,j.__wbindgen_export,j.__wbindgen_export2),u=T,a=y(e)?0:v(e,j.__wbindgen_export,j.__wbindgen_export2),f=T}catch(n){throw a&&j.__wbindgen_export3(a,1*f,1),s&&j.__wbindgen_export3(s,1*u,1),n}j.channel_send_download_start(this.__wbg_ptr,s,u,t,a,f,r,y(_)?16777215:_?1:0,o,i)}send_download_stop(n,t,e){const r=+t,_=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0),o=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_download_stop(this.__wbg_ptr,o,T,r,_)}send_download_subscribe(n){j.channel_send_download_subscribe(this.__wbg_ptr,n)}send_download_where(n,t,e){const r=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0),_=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_download_where(this.__wbg_ptr,_,T,t,r)}send_sftp_chmod(n,t,e,r,_){const o=+t,c=+r,i=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let s,u,a,f;try{s=v(n,j.__wbindgen_export,j.__wbindgen_export2),u=T,a=v(e,j.__wbindgen_export,j.__wbindgen_export2),f=T}catch(n){throw a&&j.__wbindgen_export3(a,1*f,1),s&&j.__wbindgen_export3(s,1*u,1),n}j.channel_send_sftp_chmod(this.__wbg_ptr,s,u,o,a,f,c,i)}send_sftp_delete(n,t,e,r,_){const o=+t,c=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let i,s,u,a,f,b;try{i=v(n,j.__wbindgen_export,j.__wbindgen_export2),s=T,u=v(e,j.__wbindgen_export,j.__wbindgen_export2),a=T,f=v(r,j.__wbindgen_export,j.__wbindgen_export2),b=T}catch(n){throw f&&j.__wbindgen_export3(f,1*b,1),u&&j.__wbindgen_export3(u,1*a,1),i&&j.__wbindgen_export3(i,1*s,1),n}j.channel_send_sftp_delete(this.__wbg_ptr,i,s,o,u,a,f,b,c)}send_sftp_download_ack(n,t,e,r){const _=+t,o=+e,c=+r,i=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_download_ack(this.__wbg_ptr,i,T,_,o,c)}send_sftp_download_chunk(n,t,e,r,_){const o=+t,c=+e,i=+r,s=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0),u=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_download_chunk(this.__wbg_ptr,u,T,o,c,i,s)}send_sftp_download_start(n,t,e,r,_){const o=+t,c=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let i,s,u,a,f,b;try{i=v(n,j.__wbindgen_export,j.__wbindgen_export2),s=T,u=v(e,j.__wbindgen_export,j.__wbindgen_export2),a=T,f=v(r,j.__wbindgen_export,j.__wbindgen_export2),b=T}catch(n){throw f&&j.__wbindgen_export3(f,1*b,1),u&&j.__wbindgen_export3(u,1*a,1),i&&j.__wbindgen_export3(i,1*s,1),n}j.channel_send_sftp_download_start(this.__wbg_ptr,i,s,o,u,a,f,b,c)}send_sftp_list_data(n,t,e,r){const _=+t,o=+(y(r)?Number.MAX_SAFE_INTEGER:r>>>0);let c,i,s,u;try{c=v(n,j.__wbindgen_export,j.__wbindgen_export2),i=T,s=v(e,j.__wbindgen_export,j.__wbindgen_export2),u=T}catch(n){throw s&&j.__wbindgen_export3(s,1*u,1),c&&j.__wbindgen_export3(c,1*i,1),n}j.channel_send_sftp_list_data(this.__wbg_ptr,c,i,_,s,u,o)}send_sftp_mkdir(n,t,e,r){const _=+t,o=+(y(r)?Number.MAX_SAFE_INTEGER:r>>>0);let c,i,s,u;try{c=v(n,j.__wbindgen_export,j.__wbindgen_export2),i=T,s=v(e,j.__wbindgen_export,j.__wbindgen_export2),u=T}catch(n){throw s&&j.__wbindgen_export3(s,1*u,1),c&&j.__wbindgen_export3(c,1*i,1),n}j.channel_send_sftp_mkdir(this.__wbg_ptr,c,i,_,s,u,o)}send_sftp_read_file(n,t,e,r){const _=+t,o=+(y(r)?Number.MAX_SAFE_INTEGER:r>>>0);let c,i,s,u;try{c=v(n,j.__wbindgen_export,j.__wbindgen_export2),i=T,s=v(e,j.__wbindgen_export,j.__wbindgen_export2),u=T}catch(n){throw s&&j.__wbindgen_export3(s,1*u,1),c&&j.__wbindgen_export3(c,1*i,1),n}j.channel_send_sftp_read_file(this.__wbg_ptr,c,i,_,s,u,o)}send_sftp_remove(n,t,e,r,_){const o=+t,c=+r,i=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let s,u,a,f;try{s=v(n,j.__wbindgen_export,j.__wbindgen_export2),u=T,a=v(e,j.__wbindgen_export,j.__wbindgen_export2),f=T}catch(n){throw a&&j.__wbindgen_export3(a,1*f,1),s&&j.__wbindgen_export3(s,1*u,1),n}j.channel_send_sftp_remove(this.__wbg_ptr,s,u,o,a,f,c,i)}send_sftp_rename(n,t,e,r,_){const o=+t,c=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let i,s,u,a,f,b;try{i=v(n,j.__wbindgen_export,j.__wbindgen_export2),s=T,u=v(e,j.__wbindgen_export,j.__wbindgen_export2),a=T,f=v(r,j.__wbindgen_export,j.__wbindgen_export2),b=T}catch(n){throw f&&j.__wbindgen_export3(f,1*b,1),u&&j.__wbindgen_export3(u,1*a,1),i&&j.__wbindgen_export3(i,1*s,1),n}j.channel_send_sftp_rename(this.__wbg_ptr,i,s,o,u,a,f,b,c)}send_sftp_upload_chunk(n,t,e,r,_,o,c){const i=+t,s=+e,u=+r,a=+_,f=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let b,d,w,l;try{b=v(n,j.__wbindgen_export,j.__wbindgen_export2),d=T,w=p(o,j.__wbindgen_export),l=T}catch(n){throw w&&j.__wbindgen_export3(w,1*l,1),b&&j.__wbindgen_export3(b,1*d,1),n}j.channel_send_sftp_upload_chunk(this.__wbg_ptr,b,d,i,s,u,a,w,l,f)}send_sftp_upload_start(n,t,e,r,_,o,c){const i=+t,s=+_,u=BigInt.asIntN(64,o),a=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let f,b,d,w,l,g;try{f=v(n,j.__wbindgen_export,j.__wbindgen_export2),b=T,d=v(e,j.__wbindgen_export,j.__wbindgen_export2),w=T,l=v(r,j.__wbindgen_export,j.__wbindgen_export2),g=T}catch(n){throw l&&j.__wbindgen_export3(l,1*g,1),d&&j.__wbindgen_export3(d,1*w,1),f&&j.__wbindgen_export3(f,1*b,1),n}j.channel_send_sftp_upload_start(this.__wbg_ptr,f,b,i,d,w,l,g,s,u,a)}send_sftp_write_file(n,t,e,r,_){const o=+t,c=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let i,s,u,a,f,b;try{i=v(n,j.__wbindgen_export,j.__wbindgen_export2),s=T,u=v(e,j.__wbindgen_export,j.__wbindgen_export2),a=T,f=p(r,j.__wbindgen_export),b=T}catch(n){throw f&&j.__wbindgen_export3(f,1*b,1),u&&j.__wbindgen_export3(u,1*a,1),i&&j.__wbindgen_export3(i,1*s,1),n}j.channel_send_sftp_write_file(this.__wbg_ptr,i,s,o,u,a,f,b,c)}send_ssh_terminal_resize(n,t,e,r,_,o){const c=+t,i=+e,s=+r,u=+_,a=+o,f=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_ssh_terminal_resize(this.__wbg_ptr,f,T,c,i,s,u,a)}send_ssh_tunnel_data(n,t,e){const r=+t;let _,o,c,i;try{_=v(n,j.__wbindgen_export,j.__wbindgen_export2),o=T,c=v(e,j.__wbindgen_export,j.__wbindgen_export2),i=T}catch(n){throw c&&j.__wbindgen_export3(c,1*i,1),_&&j.__wbindgen_export3(_,1*o,1),n}j.channel_send_ssh_tunnel_data(this.__wbg_ptr,_,o,r,c,i)}start_heartbeat(n){j.channel_start_heartbeat(this.__wbg_ptr,n)}stop_heartbeat(){j.channel_stop_heartbeat(this.__wbg_ptr)}update_service(n,t,e,r,_,o,c,i,s,u){const a=+o,f=+(y(u)?Number.MAX_SAFE_INTEGER:u>>>0);let b,d,w,l,g,h,m,p,N,A,R,S,O,U,F,P;try{b=v(n,j.__wbindgen_export,j.__wbindgen_export2),d=T,w=v(t,j.__wbindgen_export,j.__wbindgen_export2),l=T,g=v(e,j.__wbindgen_export,j.__wbindgen_export2),h=T,m=y(r)?0:v(r,j.__wbindgen_export,j.__wbindgen_export2),p=T,N=v(_,j.__wbindgen_export,j.__wbindgen_export2),A=T,R=y(c)?0:v(c,j.__wbindgen_export,j.__wbindgen_export2),S=T,O=y(i)?0:v(i,j.__wbindgen_export,j.__wbindgen_export2),U=T,F=y(s)?0:v(s,j.__wbindgen_export,j.__wbindgen_export2),P=T}catch(n){throw F&&j.__wbindgen_export3(F,1*P,1),O&&j.__wbindgen_export3(O,1*U,1),R&&j.__wbindgen_export3(R,1*S,1),N&&j.__wbindgen_export3(N,1*A,1),m&&j.__wbindgen_export3(m,1*p,1),g&&j.__wbindgen_export3(g,1*h,1),w&&j.__wbindgen_export3(w,1*l,1),b&&j.__wbindgen_export3(b,1*d,1),n}j.channel_update_service(this.__wbg_ptr,b,d,w,l,g,h,m,p,N,A,a,R,S,O,U,F,P,f)}}Symbol.dispose&&(n.prototype[Symbol.dispose]=n.prototype.free);const t=Object.freeze({Generic:0,0:"Generic",Authentication:10,10:"Authentication",RequiresUsername:100,100:"RequiresUsername",RequiresPassword:110,110:"RequiresPassword",RequiresUsernamePassword:120,120:"RequiresUsernamePassword"});function e(n,t){j.__wasm_bindgen_func_elem_100(n,t)}function r(n,t,e){j.__wasm_bindgen_func_elem_96(n,t,e)}function _(n,t,e){j.__wasm_bindgen_func_elem_96_46(n,t,e)}function o(n,t,e){j.__wasm_bindgen_func_elem_96_47(n,t,e)}const c=["blob","arraybuffer"],i="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((n=>j.__wbg_channel_free(n,1)));function s(n){const t=j.__wbindgen_export5();return j.__wbindgen_externrefs.set(t,n),t}const u="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((n=>j.__wbindgen_export6(n.a,n.b)));function a(n){switch(typeof n){case"number":case"boolean":case"undefined":return`${n}`;case"string":return JSON.stringify(n);case"bigint":return`${n}n`;case"symbol":return void 0!==n.description?`Symbol(${n.description})`:"Symbol";case"function":return"string"==typeof n.name&&""!==n.name?`Function(${n.name})`:"Function";case"object":{if(null===n)return"null";if(Array.isArray(n))return"["+Array.from(n,a).join(", ")+"]";if(n instanceof Error)return`${n.name}: ${n.message}\n${n.stack}`;const t=toString.call(n),e=/\[object ([^\]]+)\]/.exec(t)?.[1];if(void 0===e)return t;if("Object"===e)try{return"Object("+JSON.stringify(n)+")"}catch(n){return"Object"}return e}}}function f(n,t){return n>>>=0,g().subarray(n/1,n/1+t)}let b=null;function d(){return(null===b||!0===b.buffer.detached||void 0===b.buffer.detached&&b.buffer!==j.memory.buffer)&&(b=new DataView(j.memory.buffer)),b}function w(n,t){return n>>>=0,e=g().subarray(n,n+t),R+=e.length,R>=A&&(N=new TextDecoder("utf-8",{ignoreBOM:!0}),N.decode(),R=e.length),N.decode(e);var e}let l=null;function g(){return null!==l&&0!==l.byteLength||(l=new Uint8Array(j.memory.buffer)),l}function h(n,t){try{return n.apply(this,t)}catch(n){const t=s(n);j.__wbindgen_export4(t)}}function y(n){return null==n}function m(n,t,e){const r={a:n,b:t,cnt:1},_=(...n)=>{r.cnt++;const t=r.a;r.a=0;try{return e(t,r.b,...n)}finally{r.a=t,_._wbg_cb_unref()}};return _._wbg_cb_unref=()=>{0==--r.cnt&&(j.__wbindgen_export6(r.a,r.b),r.a=0,u.unregister(r))},u.register(_,r,r),_}function p(n,t){const e=t(1*n.length,1)>>>0;return g().set(n,e/1),T=n.length,e}function v(n,t,e){if(void 0===e){const e=S.encode(n),r=t(e.length,1)>>>0;return g().subarray(r,r+e.length).set(e),T=e.length,r}let r=n.length,_=t(r,1)>>>0;const o=g();let c=0;for(;c<r;c++){const t=n.charCodeAt(c);if(t>127)break;o[_+c]=t}if(c!==r){0!==c&&(n=n.slice(c)),_=e(_,r,r=c+3*n.length,1)>>>0;const t=g().subarray(_+c,_+r);c+=S.encodeInto(n,t).written,_=e(_,r,c,1)>>>0}return T=c,_}let N=new TextDecoder("utf-8",{ignoreBOM:!0});N.decode();const A=2146435072;let R=0;const S=new TextEncoder;"encodeInto"in S||(S.encodeInto=function(n,t){const e=S.encode(n);return t.set(e),{read:n.length,written:e.length}});let j,O,T=0;async function U(n){return void 0!==j?j:(void 0===O&&(O=async function(n){void 0!==n&&(Object.getPrototypeOf(n)===Object.prototype?({module_or_path:n}=n):console.warn("using deprecated parameters for the initialization function; pass a single object instead")),void 0===n&&(n=new URL("phirepass-channel_bg.wasm",import.meta.url));const t=function(){const n={__proto__:null,__wbg_Error_208446807d0d1e30:function(n,t){return Error(w(n,t))},__wbg_Number_ff192a72a0dcdf6d:function(n){return Number(n)},__wbg_String_8564e559799eccda:function(n,t){const e=v(String(t),j.__wbindgen_export,j.__wbindgen_export2),r=T;d().setInt32(4+(n>>>0),r,!0),d().setInt32(0+(n>>>0),e,!0)},__wbg___wbindgen_bigint_get_as_i64_11da4b52cd0aedef:function(n,t){const e="bigint"==typeof t?t:void 0;d().setBigInt64(8+(n>>>0),y(e)?BigInt(0):e,!0),d().setInt32(0+(n>>>0),!y(e),!0)},__wbg___wbindgen_boolean_get_4f1baf9a00be3c74:function(n){const t="boolean"==typeof n?n:void 0;return y(t)?16777215:t?1:0},__wbg___wbindgen_debug_string_f249a2a76caa9a55:function(n,t){const e=v(a(t),j.__wbindgen_export,j.__wbindgen_export2),r=T;d().setInt32(4+(n>>>0),r,!0),d().setInt32(0+(n>>>0),e,!0)},__wbg___wbindgen_in_3f58a9d3b3a7eed2:function(n,t){return n in t},__wbg___wbindgen_is_bigint_5fa10641e039d3ef:function(n){return"bigint"==typeof n},__wbg___wbindgen_is_function_741ff2bb612836f5:function(n){return"function"==typeof n},__wbg___wbindgen_is_null_c22311b1cc228e3a:function(n){return null===n},__wbg___wbindgen_is_object_8b968c3ab8e96595:function(n){return"object"==typeof n&&null!==n},__wbg___wbindgen_is_string_fc456fee5d3317de:function(n){return"string"==typeof n},__wbg___wbindgen_is_undefined_be5b34249ff1fc15:function(n){return void 0===n},__wbg___wbindgen_jsval_eq_38d7bfbe4cc84039:function(n,t){return n===t},__wbg___wbindgen_jsval_loose_eq_b2f214e2e4b30e36:function(n,t){return n==t},__wbg___wbindgen_number_get_934b640d0889af78:function(n,t){const e="number"==typeof t?t:void 0;d().setFloat64(8+(n>>>0),y(e)?0:e,!0),d().setInt32(0+(n>>>0),!y(e),!0)},__wbg___wbindgen_string_get_7ce8eee7fd327545:function(n,t){const e="string"==typeof t?t:void 0;var r=y(e)?0:v(e,j.__wbindgen_export,j.__wbindgen_export2),_=T;d().setInt32(4+(n>>>0),_,!0),d().setInt32(0+(n>>>0),r,!0)},__wbg___wbindgen_throw_4c88d8bf264fd984:function(n,t){throw new Error(w(n,t))},__wbg__wbg_cb_unref_09736879a3f67559:function(n){n._wbg_cb_unref()},__wbg_call_40b008ba32f73991:function(){return h((function(n,t){return n.call(t)}),arguments)},__wbg_call_a410eb4b59ed5965:function(){return h((function(n,t,e){return n.call(t,e)}),arguments)},__wbg_call_fc92fee6137d452d:function(){return h((function(n,t,e,r){return n.call(t,e,r)}),arguments)},__wbg_clearInterval_2ed00e80b9bdc143:function(n){return clearInterval(n)},__wbg_close_5ee9c5fe4e8754a4:function(){return h((function(n){n.close()}),arguments)},__wbg_data_c7e5e8500f1bca2f:function(n){return n.data},__wbg_done_57e08d0be6e30c02:function(n){return n.done},__wbg_entries_7bb1459bd9b5c2b9:function(n){return Object.entries(n)},__wbg_from_eac91875c8a5ffa4:function(n){return Array.from(n)},__wbg_getRandomValues_5d8c030b527203a6:function(){return h((function(n,t){globalThis.crypto.getRandomValues(f(n,t))}),arguments)},__wbg_get_2080c49015e35254:function(){return h((function(n,t){return Reflect.get(n,t)}),arguments)},__wbg_get_635eea311fa1a291:function(){return h((function(n,t){return Reflect.get(n,t)}),arguments)},__wbg_get_d7176cfb76d71114:function(n,t){return n[t>>>0]},__wbg_get_unchecked_e6325ad374eff861:function(n,t){return n[t>>>0]},__wbg_get_with_ref_key_fc601247060b7204:function(n,t){return n[t]},__wbg_info_b0bac022aae81d46:function(n,t){console.info(w(n,t))},__wbg_instanceof_ArrayBuffer_12cdaa4161423e6b:function(n){let t;try{t=n instanceof ArrayBuffer}catch(n){t=!1}return t},__wbg_instanceof_Uint8Array_d7aeb0dcb3108fea:function(n){let t;try{t=n instanceof Uint8Array}catch(n){t=!1}return t},__wbg_isArray_bcf1376d0d732d08:function(n){return Array.isArray(n)},__wbg_isSafeInteger_1a35ba4d31e71d38:function(n){return Number.isSafeInteger(n)},__wbg_iterator_e4c5e8f68ada7b58:function(){return Symbol.iterator},__wbg_length_186163212ffe79c3:function(n){return n.length},__wbg_length_b03a0fabb109b1e9:function(n){return n.length},__wbg_new_13de428334042d26:function(n){return new Uint8Array(n)},__wbg_new_37eb45aaf5eeb820:function(){return new Array},__wbg_new_cd4348290afae586:function(){return new Object},__wbg_new_with_str_sequence_75b26d88172889d0:function(){return h((function(n,t,e){return new WebSocket(w(n,t),e)}),arguments)},__wbg_next_178c1651c11432b3:function(n){return n.next},__wbg_next_af5ac6a08bb0a717:function(){return h((function(n){return n.next()}),arguments)},__wbg_prototypesetcall_13162965d1fe7aa3:function(n,t,e){Uint8Array.prototype.set.call(f(n,t),e)},__wbg_push_c9f4893fc209f768:function(n,t){return n.push(t)},__wbg_readyState_039bc047141a5f6d:function(n){return n.readyState},__wbg_send_d83d0891cf698779:function(){return h((function(n,t,e){n.send(f(t,e))}),arguments)},__wbg_setInterval_ef738bbfe8cc0974:function(){return h((function(n,t){return setInterval(n,t)}),arguments)},__wbg_set_binaryType_d5b4dafd0f127fb2:function(n,t){n.binaryType=c[t]},__wbg_set_d2d33b52458e984a:function(n,t,e){n[t>>>0]=e},__wbg_set_e4b9a833d288759a:function(n,t,e){n[t]=e},__wbg_set_onclose_078935cf8d0fb024:function(n,t){n.onclose=t},__wbg_set_onerror_f7f089f7f059501c:function(n,t){n.onerror=t},__wbg_set_onmessage_26abc49cfa5f9ffc:function(n,t){n.onmessage=t},__wbg_set_onopen_757be120cc7b1ea6:function(n,t){n.onopen=t},__wbg_value_e0f328965e184931:function(n){return n.value},__wbg_warn_95c497419b251cd5:function(n,t){console.warn(w(n,t))},__wbindgen_generic_0000000000000001:function(n,t){return m(n,t,r)},__wbindgen_generic_0000000000000002:function(n,t){return m(n,t,_)},__wbindgen_generic_0000000000000003:function(n,t){return m(n,t,o)},__wbindgen_generic_0000000000000004:function(n,t){return m(n,t,e)},__wbindgen_generic_0000000000000005:function(n){return n},__wbindgen_generic_0000000000000006:function(n,t){return f(n,t)},__wbindgen_generic_0000000000000007:function(n,t){return w(n,t)},__wbindgen_generic_0000000000000008:function(n){return BigInt.asUintN(64,n)},__wbindgen_init_externref_table:function(){const n=j.__wbindgen_externrefs;n.set(0,void 0),n.set(1024,void 0),n.set(1025,null),n.set(1026,!0),n.set(1027,!1)}};return{__proto__:null,"./phirepass-channel_bg.js":n}}();("string"==typeof n||"function"==typeof Request&&n instanceof Request||"function"==typeof URL&&n instanceof URL)&&(n=fetch(n));const{instance:i}=await async function(n,t){if("function"==typeof Response&&n instanceof Response){if(!n.ok)throw new Error(`failed to fetch Wasm: ${n.status} ${n.statusText} fetching '${n.url}'`);if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(n,t)}catch(t){if(!function(n){switch(n){case"basic":case"cors":case"default":return!0}return!1}(n.type)||"application/wasm"===n.headers.get("Content-Type"))throw t;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t)}const e=await n.arrayBuffer();return await WebAssembly.instantiate(e,t)}{const e=await WebAssembly.instantiate(n,t);return e instanceof WebAssembly.Instance?{instance:e,module:n}:e}}(await n,t);return function(n){return j=n.exports,b=null,l=null,j.__wbindgen_start(),j}(i)}(n),O.catch((()=>{O=void 0}))),O)}var F,P,k;!function(n){n.Error="Error",n.AuthSuccess="AuthSuccess",n.TunnelOpened="TunnelOpened",n.TunnelClosed="TunnelClosed",n.TunnelData="TunnelData",n.RDPAuthorized="RDPAuthorized",n.SFTPListItems="SFTPListItems",n.SFTPDownloadStartResponse="SFTPDownloadStartResponse",n.SFTPDownloadChunk="SFTPDownloadChunk",n.SFTPUploadStartResponse="SFTPUploadStartResponse",n.SFTPUploadChunkAck="SFTPUploadChunkAck",n.SFTPOpResult="SFTPOpResult"}(F||(F={})),function(n){n[n.Username=0]="Username",n[n.Password=1]="Password",n[n.Default=2]="Default"}(P||(P={})),function(n){n.Disconnected="disconnected",n.Connected="connected",n.Error="error"}(k||(k={}));export{n as C,t as E,P as I,F as P,U as _,k as a}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
class n{__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,i.unregister(this),n}free(){const n=this.__destroy_into_raw();j.__wbg_channel_free(n,0)}authenticate(n,t,e){const r=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0);let _,o,c,i;try{_=v(n,j.__wbindgen_export,j.__wbindgen_export2),o=T,c=v(t,j.__wbindgen_export,j.__wbindgen_export2),i=T}catch(n){throw c&&j.__wbindgen_export3(c,1*i,1),_&&j.__wbindgen_export3(_,1*o,1),n}j.channel_authenticate(this.__wbg_ptr,_,o,c,i,r)}connect(){j.channel_connect(this.__wbg_ptr)}create_service(n,t,e,r,_,o,c,i,s){const u=+_,a=+(y(s)?Number.MAX_SAFE_INTEGER:s>>>0);let f,b,d,w,l,g,h,m,p,N,A,R,S,O;try{f=v(n,j.__wbindgen_export,j.__wbindgen_export2),b=T,d=v(t,j.__wbindgen_export,j.__wbindgen_export2),w=T,l=y(e)?0:v(e,j.__wbindgen_export,j.__wbindgen_export2),g=T,h=v(r,j.__wbindgen_export,j.__wbindgen_export2),m=T,p=y(o)?0:v(o,j.__wbindgen_export,j.__wbindgen_export2),N=T,A=y(c)?0:v(c,j.__wbindgen_export,j.__wbindgen_export2),R=T,S=y(i)?0:v(i,j.__wbindgen_export,j.__wbindgen_export2),O=T}catch(n){throw S&&j.__wbindgen_export3(S,1*O,1),A&&j.__wbindgen_export3(A,1*R,1),p&&j.__wbindgen_export3(p,1*N,1),h&&j.__wbindgen_export3(h,1*m,1),l&&j.__wbindgen_export3(l,1*g,1),d&&j.__wbindgen_export3(d,1*w,1),f&&j.__wbindgen_export3(f,1*b,1),n}j.channel_create_service(this.__wbg_ptr,f,b,d,w,l,g,h,m,u,p,N,A,R,S,O,a)}delete_service(n,t,e){const r=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0);let _,o,c,i;try{_=v(n,j.__wbindgen_export,j.__wbindgen_export2),o=T,c=v(t,j.__wbindgen_export,j.__wbindgen_export2),i=T}catch(n){throw c&&j.__wbindgen_export3(c,1*i,1),_&&j.__wbindgen_export3(_,1*o,1),n}j.channel_delete_service(this.__wbg_ptr,_,o,c,i,r)}disconnect(){j.channel_disconnect(this.__wbg_ptr)}is_connected(){return 0!==j.channel_is_connected(this.__wbg_ptr)}is_disconnected(){return 0!==j.channel_is_disconnected(this.__wbg_ptr)}constructor(n,t,e){let r,_,o,c,s,u;try{r=v(n,j.__wbindgen_export,j.__wbindgen_export2),_=T,o=v(t,j.__wbindgen_export,j.__wbindgen_export2),c=T,s=y(e)?0:v(e,j.__wbindgen_export,j.__wbindgen_export2),u=T}catch(n){throw s&&j.__wbindgen_export3(s,1*u,1),o&&j.__wbindgen_export3(o,1*c,1),r&&j.__wbindgen_export3(r,1*_,1),n}const a=j.channel_new(r,_,o,c,s,u);return this.__wbg_ptr=a,i.register(this,this.__wbg_ptr,this),this}on_connection_close(n){j.channel_on_connection_close(this.__wbg_ptr,y(n)?0:s(n))}on_connection_error(n){j.channel_on_connection_error(this.__wbg_ptr,y(n)?0:s(n))}on_connection_message(n){j.channel_on_connection_message(this.__wbg_ptr,y(n)?0:s(n))}on_connection_open(n){j.channel_on_connection_open(this.__wbg_ptr,y(n)?0:s(n))}on_protocol_message(n){j.channel_on_protocol_message(this.__wbg_ptr,y(n)?0:s(n))}on_protocol_message_type(n,t){const e=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_on_protocol_message_type(this.__wbg_ptr,e,T,y(t)?0:s(t))}open_rdp_tunnel(n,t,e,r,_){const o=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let c,i,s,u,a,f,b,d;try{c=v(n,j.__wbindgen_export,j.__wbindgen_export2),i=T,s=v(t,j.__wbindgen_export,j.__wbindgen_export2),u=T,a=y(e)?0:v(e,j.__wbindgen_export,j.__wbindgen_export2),f=T,b=y(r)?0:v(r,j.__wbindgen_export,j.__wbindgen_export2),d=T}catch(n){throw b&&j.__wbindgen_export3(b,1*d,1),a&&j.__wbindgen_export3(a,1*f,1),s&&j.__wbindgen_export3(s,1*u,1),c&&j.__wbindgen_export3(c,1*i,1),n}j.channel_open_rdp_tunnel(this.__wbg_ptr,c,i,s,u,a,f,b,d,o)}open_sftp_tunnel(n,t,e,r,_){const o=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let c,i,s,u,a,f,b,d;try{c=v(n,j.__wbindgen_export,j.__wbindgen_export2),i=T,s=v(t,j.__wbindgen_export,j.__wbindgen_export2),u=T,a=y(e)?0:v(e,j.__wbindgen_export,j.__wbindgen_export2),f=T,b=y(r)?0:v(r,j.__wbindgen_export,j.__wbindgen_export2),d=T}catch(n){throw b&&j.__wbindgen_export3(b,1*d,1),a&&j.__wbindgen_export3(a,1*f,1),s&&j.__wbindgen_export3(s,1*u,1),c&&j.__wbindgen_export3(c,1*i,1),n}j.channel_open_sftp_tunnel(this.__wbg_ptr,c,i,s,u,a,f,b,d,o)}open_ssh_tunnel(n,t,e,r,_){const o=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let c,i,s,u,a,f,b,d;try{c=v(n,j.__wbindgen_export,j.__wbindgen_export2),i=T,s=v(t,j.__wbindgen_export,j.__wbindgen_export2),u=T,a=y(e)?0:v(e,j.__wbindgen_export,j.__wbindgen_export2),f=T,b=y(r)?0:v(r,j.__wbindgen_export,j.__wbindgen_export2),d=T}catch(n){throw b&&j.__wbindgen_export3(b,1*d,1),a&&j.__wbindgen_export3(a,1*f,1),s&&j.__wbindgen_export3(s,1*u,1),c&&j.__wbindgen_export3(c,1*i,1),n}j.channel_open_ssh_tunnel(this.__wbg_ptr,c,i,s,u,a,f,b,d,o)}send_download_delete(n,t,e){const r=+t,_=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0),o=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_download_delete(this.__wbg_ptr,o,T,r,_)}send_download_resume(n,t,e){const r=+t,_=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0),o=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_download_resume(this.__wbg_ptr,o,T,r,_)}send_download_set_order(n,t,e){const r=+t,_=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0),o=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_download_set_order(this.__wbg_ptr,o,T,r,_)}send_download_settings_get(n,t){const e=+(y(t)?Number.MAX_SAFE_INTEGER:t>>>0),r=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_download_settings_get(this.__wbg_ptr,r,T,e)}send_download_settings_save(n,t,e){const r=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0),_=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_download_settings_save(this.__wbg_ptr,_,T,t,r)}send_download_start(n,t,e,r,_,o,c){const i=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let s,u,a,f;try{s=v(n,j.__wbindgen_export,j.__wbindgen_export2),u=T,a=y(e)?0:v(e,j.__wbindgen_export,j.__wbindgen_export2),f=T}catch(n){throw a&&j.__wbindgen_export3(a,1*f,1),s&&j.__wbindgen_export3(s,1*u,1),n}j.channel_send_download_start(this.__wbg_ptr,s,u,t,a,f,r,y(_)?16777215:_?1:0,o,i)}send_download_stop(n,t,e){const r=+t,_=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0),o=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_download_stop(this.__wbg_ptr,o,T,r,_)}send_download_subscribe(n){j.channel_send_download_subscribe(this.__wbg_ptr,n)}send_download_where(n,t,e){const r=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0),_=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_download_where(this.__wbg_ptr,_,T,t,r)}send_sftp_chmod(n,t,e,r,_){const o=+t,c=+r,i=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let s,u,a,f;try{s=v(n,j.__wbindgen_export,j.__wbindgen_export2),u=T,a=v(e,j.__wbindgen_export,j.__wbindgen_export2),f=T}catch(n){throw a&&j.__wbindgen_export3(a,1*f,1),s&&j.__wbindgen_export3(s,1*u,1),n}j.channel_send_sftp_chmod(this.__wbg_ptr,s,u,o,a,f,c,i)}send_sftp_delete(n,t,e,r,_){const o=+t,c=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let i,s,u,a,f,b;try{i=v(n,j.__wbindgen_export,j.__wbindgen_export2),s=T,u=v(e,j.__wbindgen_export,j.__wbindgen_export2),a=T,f=v(r,j.__wbindgen_export,j.__wbindgen_export2),b=T}catch(n){throw f&&j.__wbindgen_export3(f,1*b,1),u&&j.__wbindgen_export3(u,1*a,1),i&&j.__wbindgen_export3(i,1*s,1),n}j.channel_send_sftp_delete(this.__wbg_ptr,i,s,o,u,a,f,b,c)}send_sftp_download_ack(n,t,e,r){const _=+t,o=+e,c=+r,i=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_download_ack(this.__wbg_ptr,i,T,_,o,c)}send_sftp_download_chunk(n,t,e,r,_){const o=+t,c=+e,i=+r,s=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0),u=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_download_chunk(this.__wbg_ptr,u,T,o,c,i,s)}send_sftp_download_start(n,t,e,r,_){const o=+t,c=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let i,s,u,a,f,b;try{i=v(n,j.__wbindgen_export,j.__wbindgen_export2),s=T,u=v(e,j.__wbindgen_export,j.__wbindgen_export2),a=T,f=v(r,j.__wbindgen_export,j.__wbindgen_export2),b=T}catch(n){throw f&&j.__wbindgen_export3(f,1*b,1),u&&j.__wbindgen_export3(u,1*a,1),i&&j.__wbindgen_export3(i,1*s,1),n}j.channel_send_sftp_download_start(this.__wbg_ptr,i,s,o,u,a,f,b,c)}send_sftp_list_data(n,t,e,r){const _=+t,o=+(y(r)?Number.MAX_SAFE_INTEGER:r>>>0);let c,i,s,u;try{c=v(n,j.__wbindgen_export,j.__wbindgen_export2),i=T,s=v(e,j.__wbindgen_export,j.__wbindgen_export2),u=T}catch(n){throw s&&j.__wbindgen_export3(s,1*u,1),c&&j.__wbindgen_export3(c,1*i,1),n}j.channel_send_sftp_list_data(this.__wbg_ptr,c,i,_,s,u,o)}send_sftp_mkdir(n,t,e,r){const _=+t,o=+(y(r)?Number.MAX_SAFE_INTEGER:r>>>0);let c,i,s,u;try{c=v(n,j.__wbindgen_export,j.__wbindgen_export2),i=T,s=v(e,j.__wbindgen_export,j.__wbindgen_export2),u=T}catch(n){throw s&&j.__wbindgen_export3(s,1*u,1),c&&j.__wbindgen_export3(c,1*i,1),n}j.channel_send_sftp_mkdir(this.__wbg_ptr,c,i,_,s,u,o)}send_sftp_read_file(n,t,e,r){const _=+t,o=+(y(r)?Number.MAX_SAFE_INTEGER:r>>>0);let c,i,s,u;try{c=v(n,j.__wbindgen_export,j.__wbindgen_export2),i=T,s=v(e,j.__wbindgen_export,j.__wbindgen_export2),u=T}catch(n){throw s&&j.__wbindgen_export3(s,1*u,1),c&&j.__wbindgen_export3(c,1*i,1),n}j.channel_send_sftp_read_file(this.__wbg_ptr,c,i,_,s,u,o)}send_sftp_remove(n,t,e,r,_){const o=+t,c=+r,i=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let s,u,a,f;try{s=v(n,j.__wbindgen_export,j.__wbindgen_export2),u=T,a=v(e,j.__wbindgen_export,j.__wbindgen_export2),f=T}catch(n){throw a&&j.__wbindgen_export3(a,1*f,1),s&&j.__wbindgen_export3(s,1*u,1),n}j.channel_send_sftp_remove(this.__wbg_ptr,s,u,o,a,f,c,i)}send_sftp_rename(n,t,e,r,_){const o=+t,c=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let i,s,u,a,f,b;try{i=v(n,j.__wbindgen_export,j.__wbindgen_export2),s=T,u=v(e,j.__wbindgen_export,j.__wbindgen_export2),a=T,f=v(r,j.__wbindgen_export,j.__wbindgen_export2),b=T}catch(n){throw f&&j.__wbindgen_export3(f,1*b,1),u&&j.__wbindgen_export3(u,1*a,1),i&&j.__wbindgen_export3(i,1*s,1),n}j.channel_send_sftp_rename(this.__wbg_ptr,i,s,o,u,a,f,b,c)}send_sftp_upload_chunk(n,t,e,r,_,o,c){const i=+t,s=+e,u=+r,a=+_,f=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let b,d,w,l;try{b=v(n,j.__wbindgen_export,j.__wbindgen_export2),d=T,w=p(o,j.__wbindgen_export),l=T}catch(n){throw w&&j.__wbindgen_export3(w,1*l,1),b&&j.__wbindgen_export3(b,1*d,1),n}j.channel_send_sftp_upload_chunk(this.__wbg_ptr,b,d,i,s,u,a,w,l,f)}send_sftp_upload_start(n,t,e,r,_,o,c){const i=+t,s=+_,u=BigInt.asIntN(64,o),a=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let f,b,d,w,l,g;try{f=v(n,j.__wbindgen_export,j.__wbindgen_export2),b=T,d=v(e,j.__wbindgen_export,j.__wbindgen_export2),w=T,l=v(r,j.__wbindgen_export,j.__wbindgen_export2),g=T}catch(n){throw l&&j.__wbindgen_export3(l,1*g,1),d&&j.__wbindgen_export3(d,1*w,1),f&&j.__wbindgen_export3(f,1*b,1),n}j.channel_send_sftp_upload_start(this.__wbg_ptr,f,b,i,d,w,l,g,s,u,a)}send_sftp_write_file(n,t,e,r,_){const o=+t,c=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let i,s,u,a,f,b;try{i=v(n,j.__wbindgen_export,j.__wbindgen_export2),s=T,u=v(e,j.__wbindgen_export,j.__wbindgen_export2),a=T,f=p(r,j.__wbindgen_export),b=T}catch(n){throw f&&j.__wbindgen_export3(f,1*b,1),u&&j.__wbindgen_export3(u,1*a,1),i&&j.__wbindgen_export3(i,1*s,1),n}j.channel_send_sftp_write_file(this.__wbg_ptr,i,s,o,u,a,f,b,c)}send_ssh_terminal_resize(n,t,e,r,_,o){const c=+t,i=+e,s=+r,u=+_,a=+o,f=v(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_ssh_terminal_resize(this.__wbg_ptr,f,T,c,i,s,u,a)}send_ssh_tunnel_data(n,t,e){const r=+t;let _,o,c,i;try{_=v(n,j.__wbindgen_export,j.__wbindgen_export2),o=T,c=v(e,j.__wbindgen_export,j.__wbindgen_export2),i=T}catch(n){throw c&&j.__wbindgen_export3(c,1*i,1),_&&j.__wbindgen_export3(_,1*o,1),n}j.channel_send_ssh_tunnel_data(this.__wbg_ptr,_,o,r,c,i)}start_heartbeat(n){j.channel_start_heartbeat(this.__wbg_ptr,n)}stop_heartbeat(){j.channel_stop_heartbeat(this.__wbg_ptr)}update_service(n,t,e,r,_,o,c,i,s,u){const a=+o,f=+(y(u)?Number.MAX_SAFE_INTEGER:u>>>0);let b,d,w,l,g,h,m,p,N,A,R,S,O,U,F,P;try{b=v(n,j.__wbindgen_export,j.__wbindgen_export2),d=T,w=v(t,j.__wbindgen_export,j.__wbindgen_export2),l=T,g=v(e,j.__wbindgen_export,j.__wbindgen_export2),h=T,m=y(r)?0:v(r,j.__wbindgen_export,j.__wbindgen_export2),p=T,N=v(_,j.__wbindgen_export,j.__wbindgen_export2),A=T,R=y(c)?0:v(c,j.__wbindgen_export,j.__wbindgen_export2),S=T,O=y(i)?0:v(i,j.__wbindgen_export,j.__wbindgen_export2),U=T,F=y(s)?0:v(s,j.__wbindgen_export,j.__wbindgen_export2),P=T}catch(n){throw F&&j.__wbindgen_export3(F,1*P,1),O&&j.__wbindgen_export3(O,1*U,1),R&&j.__wbindgen_export3(R,1*S,1),N&&j.__wbindgen_export3(N,1*A,1),m&&j.__wbindgen_export3(m,1*p,1),g&&j.__wbindgen_export3(g,1*h,1),w&&j.__wbindgen_export3(w,1*l,1),b&&j.__wbindgen_export3(b,1*d,1),n}j.channel_update_service(this.__wbg_ptr,b,d,w,l,g,h,m,p,N,A,a,R,S,O,U,F,P,f)}}Symbol.dispose&&(n.prototype[Symbol.dispose]=n.prototype.free);const t=Object.freeze({Generic:0,0:"Generic",Authentication:10,10:"Authentication",RequiresUsername:100,100:"RequiresUsername",RequiresPassword:110,110:"RequiresPassword",RequiresUsernamePassword:120,120:"RequiresUsernamePassword"});function e(n,t){j.__wasm_bindgen_func_elem_100(n,t)}function r(n,t,e){j.__wasm_bindgen_func_elem_96(n,t,e)}function _(n,t,e){j.__wasm_bindgen_func_elem_96_46(n,t,e)}function o(n,t,e){j.__wasm_bindgen_func_elem_96_47(n,t,e)}const c=["blob","arraybuffer"],i="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((n=>j.__wbg_channel_free(n,1)));function s(n){const t=j.__wbindgen_export5();return j.__wbindgen_externrefs.set(t,n),t}const u="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((n=>j.__wbindgen_export6(n.a,n.b)));function a(n){switch(typeof n){case"number":case"boolean":case"undefined":return`${n}`;case"string":return JSON.stringify(n);case"bigint":return`${n}n`;case"symbol":return void 0!==n.description?`Symbol(${n.description})`:"Symbol";case"function":return"string"==typeof n.name&&""!==n.name?`Function(${n.name})`:"Function";case"object":{if(null===n)return"null";if(Array.isArray(n))return"["+Array.from(n,a).join(", ")+"]";if(n instanceof Error)return`${n.name}: ${n.message}\n${n.stack}`;const t=toString.call(n),e=/\[object ([^\]]+)\]/.exec(t)?.[1];if(void 0===e)return t;if("Object"===e)try{return"Object("+JSON.stringify(n)+")"}catch(n){return"Object"}return e}}}function f(n,t){return n>>>=0,g().subarray(n/1,n/1+t)}let b=null;function d(){return(null===b||!0===b.buffer.detached||void 0===b.buffer.detached&&b.buffer!==j.memory.buffer)&&(b=new DataView(j.memory.buffer)),b}function w(n,t){return n>>>=0,e=g().subarray(n,n+t),R+=e.length,R>=A&&(N=new TextDecoder("utf-8",{ignoreBOM:!0}),N.decode(),R=e.length),N.decode(e);var e}let l=null;function g(){return null!==l&&0!==l.byteLength||(l=new Uint8Array(j.memory.buffer)),l}function h(n,t){try{return n.apply(this,t)}catch(n){const t=s(n);j.__wbindgen_export4(t)}}function y(n){return null==n}function m(n,t,e){const r={a:n,b:t,cnt:1},_=(...n)=>{r.cnt++;const t=r.a;r.a=0;try{return e(t,r.b,...n)}finally{r.a=t,_._wbg_cb_unref()}};return _._wbg_cb_unref=()=>{0==--r.cnt&&(j.__wbindgen_export6(r.a,r.b),r.a=0,u.unregister(r))},u.register(_,r,r),_}function p(n,t){const e=t(1*n.length,1)>>>0;return g().set(n,e/1),T=n.length,e}function v(n,t,e){if(void 0===e){const e=S.encode(n),r=t(e.length,1)>>>0;return g().subarray(r,r+e.length).set(e),T=e.length,r}let r=n.length,_=t(r,1)>>>0;const o=g();let c=0;for(;c<r;c++){const t=n.charCodeAt(c);if(t>127)break;o[_+c]=t}if(c!==r){0!==c&&(n=n.slice(c)),_=e(_,r,r=c+3*n.length,1)>>>0;const t=g().subarray(_+c,_+r);c+=S.encodeInto(n,t).written,_=e(_,r,c,1)>>>0}return T=c,_}let N=new TextDecoder("utf-8",{ignoreBOM:!0});N.decode();const A=2146435072;let R=0;const S=new TextEncoder;"encodeInto"in S||(S.encodeInto=function(n,t){const e=S.encode(n);return t.set(e),{read:n.length,written:e.length}});let j,O,T=0;async function U(n){return void 0!==j?j:(void 0===O&&(O=async function(n){void 0!==n&&(Object.getPrototypeOf(n)===Object.prototype?({module_or_path:n}=n):console.warn("using deprecated parameters for the initialization function; pass a single object instead")),void 0===n&&(n=new URL("phirepass-channel_bg.wasm",import.meta.url));const t=function(){const n={__proto__:null,__wbg_Error_208446807d0d1e30:function(n,t){return Error(w(n,t))},__wbg_Number_ff192a72a0dcdf6d:function(n){return Number(n)},__wbg_String_8564e559799eccda:function(n,t){const e=v(String(t),j.__wbindgen_export,j.__wbindgen_export2),r=T;d().setInt32(4+(n>>>0),r,!0),d().setInt32(0+(n>>>0),e,!0)},__wbg___wbindgen_bigint_get_as_i64_11da4b52cd0aedef:function(n,t){const e="bigint"==typeof t?t:void 0;d().setBigInt64(8+(n>>>0),y(e)?BigInt(0):e,!0),d().setInt32(0+(n>>>0),!y(e),!0)},__wbg___wbindgen_boolean_get_4f1baf9a00be3c74:function(n){const t="boolean"==typeof n?n:void 0;return y(t)?16777215:t?1:0},__wbg___wbindgen_debug_string_f249a2a76caa9a55:function(n,t){const e=v(a(t),j.__wbindgen_export,j.__wbindgen_export2),r=T;d().setInt32(4+(n>>>0),r,!0),d().setInt32(0+(n>>>0),e,!0)},__wbg___wbindgen_in_3f58a9d3b3a7eed2:function(n,t){return n in t},__wbg___wbindgen_is_bigint_5fa10641e039d3ef:function(n){return"bigint"==typeof n},__wbg___wbindgen_is_function_741ff2bb612836f5:function(n){return"function"==typeof n},__wbg___wbindgen_is_null_c22311b1cc228e3a:function(n){return null===n},__wbg___wbindgen_is_object_8b968c3ab8e96595:function(n){return"object"==typeof n&&null!==n},__wbg___wbindgen_is_string_fc456fee5d3317de:function(n){return"string"==typeof n},__wbg___wbindgen_is_undefined_be5b34249ff1fc15:function(n){return void 0===n},__wbg___wbindgen_jsval_eq_38d7bfbe4cc84039:function(n,t){return n===t},__wbg___wbindgen_jsval_loose_eq_b2f214e2e4b30e36:function(n,t){return n==t},__wbg___wbindgen_number_get_934b640d0889af78:function(n,t){const e="number"==typeof t?t:void 0;d().setFloat64(8+(n>>>0),y(e)?0:e,!0),d().setInt32(0+(n>>>0),!y(e),!0)},__wbg___wbindgen_string_get_7ce8eee7fd327545:function(n,t){const e="string"==typeof t?t:void 0;var r=y(e)?0:v(e,j.__wbindgen_export,j.__wbindgen_export2),_=T;d().setInt32(4+(n>>>0),_,!0),d().setInt32(0+(n>>>0),r,!0)},__wbg___wbindgen_throw_4c88d8bf264fd984:function(n,t){throw new Error(w(n,t))},__wbg__wbg_cb_unref_09736879a3f67559:function(n){n._wbg_cb_unref()},__wbg_call_40b008ba32f73991:function(){return h((function(n,t){return n.call(t)}),arguments)},__wbg_call_a410eb4b59ed5965:function(){return h((function(n,t,e){return n.call(t,e)}),arguments)},__wbg_call_fc92fee6137d452d:function(){return h((function(n,t,e,r){return n.call(t,e,r)}),arguments)},__wbg_clearInterval_2ed00e80b9bdc143:function(n){return clearInterval(n)},__wbg_close_5ee9c5fe4e8754a4:function(){return h((function(n){n.close()}),arguments)},__wbg_data_c7e5e8500f1bca2f:function(n){return n.data},__wbg_done_57e08d0be6e30c02:function(n){return n.done},__wbg_entries_7bb1459bd9b5c2b9:function(n){return Object.entries(n)},__wbg_from_eac91875c8a5ffa4:function(n){return Array.from(n)},__wbg_getRandomValues_5d8c030b527203a6:function(){return h((function(n,t){globalThis.crypto.getRandomValues(f(n,t))}),arguments)},__wbg_get_2080c49015e35254:function(){return h((function(n,t){return Reflect.get(n,t)}),arguments)},__wbg_get_635eea311fa1a291:function(){return h((function(n,t){return Reflect.get(n,t)}),arguments)},__wbg_get_d7176cfb76d71114:function(n,t){return n[t>>>0]},__wbg_get_unchecked_e6325ad374eff861:function(n,t){return n[t>>>0]},__wbg_get_with_ref_key_fc601247060b7204:function(n,t){return n[t]},__wbg_info_b0bac022aae81d46:function(n,t){console.info(w(n,t))},__wbg_instanceof_ArrayBuffer_12cdaa4161423e6b:function(n){let t;try{t=n instanceof ArrayBuffer}catch(n){t=!1}return t},__wbg_instanceof_Uint8Array_d7aeb0dcb3108fea:function(n){let t;try{t=n instanceof Uint8Array}catch(n){t=!1}return t},__wbg_isArray_bcf1376d0d732d08:function(n){return Array.isArray(n)},__wbg_isSafeInteger_1a35ba4d31e71d38:function(n){return Number.isSafeInteger(n)},__wbg_iterator_e4c5e8f68ada7b58:function(){return Symbol.iterator},__wbg_length_186163212ffe79c3:function(n){return n.length},__wbg_length_b03a0fabb109b1e9:function(n){return n.length},__wbg_new_13de428334042d26:function(n){return new Uint8Array(n)},__wbg_new_37eb45aaf5eeb820:function(){return new Array},__wbg_new_cd4348290afae586:function(){return new Object},__wbg_new_with_str_sequence_75b26d88172889d0:function(){return h((function(n,t,e){return new WebSocket(w(n,t),e)}),arguments)},__wbg_next_178c1651c11432b3:function(n){return n.next},__wbg_next_af5ac6a08bb0a717:function(){return h((function(n){return n.next()}),arguments)},__wbg_prototypesetcall_13162965d1fe7aa3:function(n,t,e){Uint8Array.prototype.set.call(f(n,t),e)},__wbg_push_c9f4893fc209f768:function(n,t){return n.push(t)},__wbg_readyState_039bc047141a5f6d:function(n){return n.readyState},__wbg_send_d83d0891cf698779:function(){return h((function(n,t,e){n.send(f(t,e))}),arguments)},__wbg_setInterval_ef738bbfe8cc0974:function(){return h((function(n,t){return setInterval(n,t)}),arguments)},__wbg_set_binaryType_d5b4dafd0f127fb2:function(n,t){n.binaryType=c[t]},__wbg_set_d2d33b52458e984a:function(n,t,e){n[t>>>0]=e},__wbg_set_e4b9a833d288759a:function(n,t,e){n[t]=e},__wbg_set_onclose_078935cf8d0fb024:function(n,t){n.onclose=t},__wbg_set_onerror_f7f089f7f059501c:function(n,t){n.onerror=t},__wbg_set_onmessage_26abc49cfa5f9ffc:function(n,t){n.onmessage=t},__wbg_set_onopen_757be120cc7b1ea6:function(n,t){n.onopen=t},__wbg_value_e0f328965e184931:function(n){return n.value},__wbg_warn_95c497419b251cd5:function(n,t){console.warn(w(n,t))},__wbindgen_generic_0000000000000001:function(n,t){return m(n,t,r)},__wbindgen_generic_0000000000000002:function(n,t){return m(n,t,_)},__wbindgen_generic_0000000000000003:function(n,t){return m(n,t,o)},__wbindgen_generic_0000000000000004:function(n,t){return m(n,t,e)},__wbindgen_generic_0000000000000005:function(n){return n},__wbindgen_generic_0000000000000006:function(n,t){return f(n,t)},__wbindgen_generic_0000000000000007:function(n,t){return w(n,t)},__wbindgen_generic_0000000000000008:function(n){return BigInt.asUintN(64,n)},__wbindgen_init_externref_table:function(){const n=j.__wbindgen_externrefs;n.set(0,void 0),n.set(1024,void 0),n.set(1025,null),n.set(1026,!0),n.set(1027,!1)}};return{__proto__:null,"./phirepass-channel_bg.js":n}}();("string"==typeof n||"function"==typeof Request&&n instanceof Request||"function"==typeof URL&&n instanceof URL)&&(n=fetch(n));const{instance:i}=await async function(n,t){if("function"==typeof Response&&n instanceof Response){if(!n.ok)throw new Error(`failed to fetch Wasm: ${n.status} ${n.statusText} fetching '${n.url}'`);if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(n,t)}catch(t){if(!function(n){switch(n){case"basic":case"cors":case"default":return!0}return!1}(n.type)||"application/wasm"===n.headers.get("Content-Type"))throw t;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t)}const e=await n.arrayBuffer();return await WebAssembly.instantiate(e,t)}{const e=await WebAssembly.instantiate(n,t);return e instanceof WebAssembly.Instance?{instance:e,module:n}:e}}(await n,t);return function(n){return j=n.exports,b=null,l=null,j.__wbindgen_start(),j}(i)}(n),O.catch((()=>{O=void 0}))),O)}var F,P,k;!function(n){n.Error="Error",n.AuthSuccess="AuthSuccess",n.TunnelOpened="TunnelOpened",n.TunnelClosed="TunnelClosed",n.TunnelData="TunnelData",n.RDPAuthorized="RDPAuthorized",n.SFTPListItems="SFTPListItems",n.SFTPDownloadStartResponse="SFTPDownloadStartResponse",n.SFTPDownloadChunk="SFTPDownloadChunk",n.SFTPUploadStartResponse="SFTPUploadStartResponse",n.SFTPUploadChunkAck="SFTPUploadChunkAck",n.SFTPOpResult="SFTPOpResult"}(F||(F={})),function(n){n[n.Username=0]="Username",n[n.Password=1]="Password",n[n.Default=2]="Default"}(P||(P={})),function(n){n.Disconnected="disconnected",n.Connected="connected",n.Error="error"}(k||(k={}));export{n as C,t as E,P as I,F as P,U as _,k as a}
|