@duplicati/ngclient 0.0.169 → 0.0.171

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.
@@ -1 +1 @@
1
- import{a as $e,b as He}from"./chunk-LFVCKT5O.js";import{a as we}from"./chunk-MZMEFIHU.js";import{a as J}from"./chunk-66KMXCBD.js";import"./chunk-DU5QSRYH.js";import{a as ve}from"./chunk-I5AKUAZF.js";import"./chunk-PJAWWLYW.js";import"./chunk-6Q6SSTBK.js";import"./chunk-RECKKS2S.js";import"./chunk-L4GZJLYK.js";import{a as be}from"./chunk-LJQN4G2O.js";import"./chunk-I2RHQQ3J.js";import"./chunk-F2QQDU4N.js";import{a as Re}from"./chunk-XE5OMGTJ.js";import{a as ye}from"./chunk-ZV7VPSMZ.js";import"./chunk-T6C2OUI5.js";import{b as Ce,d as Ge}from"./chunk-TJ3WIU6Q.js";import{b as V}from"./chunk-KBGIIJMM.js";import{B as R,G as Pe,H as Ie,J as Le,Q as De,Y as Me,c as Te,d as me,e as he,i as Fe,r as Ee,s as Ae,t as Oe,u as M,w as Y,x as Ne,z as fe}from"./chunk-LFRGO2IP.js";import{c as pe,e as Se,f as ge}from"./chunk-LEZL7BSL.js";import"./chunk-4MEL5WTX.js";import"./chunk-5K64UNNB.js";import"./chunk-6DB3NZXR.js";import"./chunk-FPPZ4BUR.js";import{$b as c,Ab as te,Bb as ne,Bc as ce,Cb as O,Db as a,Eb as o,Fb as _,H as j,Jb as ie,Kb as oe,Mb as E,Ra as r,Rc as B,Sc as Q,Tb as g,Ub as C,Vb as f,Wc as ue,Yb as b,Yc as de,Zb as T,_ as S,_c as K,bb as D,da as m,ea as h,gc as ae,hc as se,kc as U,mc as L,nc as u,oa as A,oc as q,pc as y,sc as $,tc as H,uc as w,vc as re,wb as d,wc as le,xb as p,xc as x,yb as ee,yc as _e}from"./chunk-FAM42SZT.js";import{a as z,b as W}from"./chunk-EUDKD2JW.js";var Be=["scroller"];function Ye(i,n){i&1&&(a(0,"sh-icon"),u(1,"bell-ringing"),o())}function Ve(i,n){i&1&&(a(0,"sh-icon"),u(1,"bell"),o())}function Je(i,n){if(i&1&&_(0,"app-notification",8),i&2){c(2);let e=x(6);O("index",0)("notification",e.content)}}function Xe(i,n){if(i&1&&(a(0,"div",11),u(1),o()),i&2){c(3);let e=x(6);r(),y(" ",e.content.content," ")}}function ze(i,n){if(i&1&&(a(0,"sh-alert")(1,"div",10),u(2),o(),d(3,Xe,2,1,"div",11),o()),i&2){c(2);let e=x(6);L(e.content.type||"error"),r(2),q(e.content.title),r(),p(e.content.content?3:-1)}}function We(i,n){if(i&1&&(a(0,"div",6),d(1,Je,1,2,"app-notification",8)(2,ze,4,4,"sh-alert",9),o()),i&2){c();let e=x(6);r(),p(e.type==="notification"?1:2)}}function je(i,n){if(i&1){let e=E();a(0,"div",7)(1,"div",12)(2,"h6",13),g(3,2),a(4,"button",5),T("click",function(){m(e);let s=c();return h(s.toggleNotifications())}),_(5,"sh-icon"),o(),C(),o(),a(6,"div",14,0)(8,"div",15),_(9,"app-notifications"),o()()()()}}function qe(i,n){if(i&1&&(a(0,"div",20),u(1),o()),i&2){let e=c().$implicit;r(),y(" ",e.content," ")}}function Qe(i,n){if(i&1){let e=E();a(0,"sh-alert",18,1),T("click",function(){let s=m(e).$implicit,l=c(2);return h(l.deleteAlertByIndex(s.id))}),a(2,"div",19),u(3),o(),d(4,qe,2,1,"div",20),o()}if(i&2){let e=n.$implicit;L(e.type),O("id",e.id),r(3),q(e.title),r(),p(e.content?4:-1)}}function Ke(i,n){i&1&&(a(0,"p",17),f(1,4),o())}function Ze(i,n){if(i&1){let e=E();a(0,"div",7)(1,"div",12)(2,"h6",13),g(3,3),a(4,"button",5),T("click",function(){m(e);let s=c();return h(s.toggleAlerts())}),_(5,"sh-icon"),o(),C(),o(),a(6,"div",14,0)(8,"div",15),te(9,Qe,5,5,"sh-alert",16,ee,!1,Ke,2,0,"p",17),o()()()()}if(i&2){let e=c();r(9),ne(e.alertHistory())}}var xe=new Ee,k=class i{#e=S(Ne);#t=S(J);isSubmitting=A(!1);messageSent=A(!1);form=xe.group({message:xe.control("",[me.required])});notifications=this.#t.notifications;shownMessage=A(null);shownMessageInterval=null;alertHistory=this.#e.alertHistory;alertHistoryIsOpen=this.#e.alertHistoryIsOpen;alertHistoryIsHidden=this.#e.alertHistoryIsHidden;numberOfOpenAlerts=B(()=>this.alertHistory().filter(n=>n.isOpen).length);scroller=de("scroller");isAlertsOpen=K(!1);isNotificationsOpen=K(!1);previousHistoryCount=A(null);previousNotificationsCount=A(null);constructor(){Q(()=>{let n=this.alertHistory(),e=this.notifications();if(e.length===0){this.shownMessage.set(null);return}e.length&&this.previousHistoryCount()!==n.length&&!this.isNotificationsOpen()?(this.shownMessage.set({content:e[0],countDown:3,type:"notification"}),this.previousHistoryCount.set(n.length),this.shownMessageInterval=setInterval(()=>{let t=this.shownMessage();if(t?.countDown===0){this.shownMessage.set(null),this.shownMessageInterval=null;return}t!==null&&this.shownMessage.update(s=>W(z({},s),{countDown:s.countDown-1}))},1e3)):n.length&&this.previousHistoryCount()!==n.length&&!this.isAlertsOpen()&&(this.shownMessage.set({content:n[0],countDown:3,type:"alert"}),this.previousHistoryCount.set(n.length),this.shownMessageInterval=setInterval(()=>{let t=this.shownMessage();if(t?.countDown===0){this.shownMessage.set(null),this.shownMessageInterval=null;return}t!==null&&this.shownMessage.update(s=>W(z({},s),{countDown:s.countDown-1}))},1e3))}),Q(()=>{this.alertHistoryIsOpen(),this.scrollToBottom()})}resetPreviewMessage(){this.shownMessage.set(null),this.shownMessageInterval=null}toggleAlerts(){this.isAlertsOpen()?this.isAlertsOpen.set(!1):(this.isAlertsOpen.set(!0),this.isNotificationsOpen.set(!1),this.resetPreviewMessage())}toggleNotifications(){this.isNotificationsOpen.set(!this.isNotificationsOpen()),this.isAlertsOpen()&&this.isAlertsOpen.set(!1)}deleteAlertByIndex(n){this.#e.removeAlert(n)}scrollToBottom(){this.scroller()&&this.scroller()?.nativeElement&&this.scroller().nativeElement.scrollTo(0,this.scroller().nativeElement.scrollHeight)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=D({type:i,selectors:[["app-service-hub"]],viewQuery:function(e,t){e&1&&ae(t.scroller,Be,5),e&2&&se()},inputs:{isAlertsOpen:[1,"isAlertsOpen"],isNotificationsOpen:[1,"isNotificationsOpen"]},outputs:{isAlertsOpen:"isAlertsOpenChange",isNotificationsOpen:"isNotificationsOpenChange"},decls:10,vars:9,consts:()=>{let n;n=$localize` Notifications ${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_BUTTON:`;let e;e=$localize` Alerts ${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_BUTTON:`;let t;return t=$localize`No alerts yet`,[["scroller",""],["alerts",""],n,e,t,["shButton","",3,"click"],[1,"preview-alert-wrap"],[1,"alert-stream-modal"],[3,"index","notification"],[3,"class"],["ship-alert-title",""],["ship-alert-content",""],[1,"alert-stream-modal-content"],[1,"paragraph-20"],[1,"alert-stream-modal-list-scroller"],[1,"alert-stream-modal-list"],[3,"class","id"],[1,"no-alerts"],[3,"click","id"],["title",""],["content",""]]},template:function(e,t){if(e&1){let s=E();a(0,"button",5),T("click",function(){return m(s),h(t.toggleAlerts())}),a(1,"sh-icon"),u(2,"info"),o()(),a(3,"button",5),T("click",function(){return m(s),h(t.toggleNotifications())}),d(4,Ye,2,0,"sh-icon")(5,Ve,2,0,"sh-icon"),o(),re(6),d(7,We,3,1,"div",6),d(8,je,10,0,"div",7),d(9,Ze,12,1,"div",7)}if(e&2){L(t.alertHistory().length?"error":""),r(3),L(t.notifications().length?"error":""),r(),p(t.notifications().length?4:5),r(2);let s=le(t.shownMessage());r(),p(s?7:-1),r(),p(t.isNotificationsOpen()?8:-1),r(),p(t.isAlertsOpen()?9:-1)}},dependencies:[Oe,Y,M,R,He,$e],styles:["[_nghost-%COMP%]{display:flex;position:fixed;gap:.5rem;bottom:1.5rem;right:1.5rem;z-index:5000}@media only screen and (max-width: 768px){[_nghost-%COMP%]{bottom:1rem;right:1rem}}[_nghost-%COMP%] h6[_ngcontent-%COMP%]{margin:0}.preview-alert-wrap[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column;min-width:15.625rem}.helpdesk-modal[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column}@media only screen and (max-width: 768px){.helpdesk-modal[_ngcontent-%COMP%]{bottom:2.6875rem}}.helpdesk-modal-content[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;gap:1rem;min-width:20rem;border:1px solid var(--base-4);background-color:var(--base-1);border-radius:var(--shape-2)}.helpdesk-modal-content[_ngcontent-%COMP%] .message-sent[_ngcontent-%COMP%]{padding:0 1rem 1rem;text-wrap:pretty}.helpdesk-modal-content[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid var(--base-4);display:flex;align-items:center;justify-content:space-between}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{padding:0 1rem 1rem;display:flex;flex-direction:column;align-items:flex-end;gap:1rem}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{width:100%;text-wrap:pretty}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{width:100%}.alert-stream-modal[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column}@media only screen and (max-width: 768px){.alert-stream-modal[_ngcontent-%COMP%]{bottom:2.6875rem}}.alert-stream-modal-list-scroller[_ngcontent-%COMP%]{overflow-y:auto;max-height:18.75rem}.alert-stream-modal-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:1rem;border-radius:var(--shape-2)}.alert-stream-modal-content[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;min-width:20rem;border:1px solid var(--base-4);background-color:var(--base-1);border-radius:var(--shape-2)}.alert-stream-modal-content[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid var(--base-4);display:flex;align-items:center;justify-content:space-between}.no-alerts[_ngcontent-%COMP%]{padding:1rem;display:flex;flex-direction:column;gap:1rem;text-align:center}"],changeDetection:0})};function et(i,n){i&1&&(a(0,"sh-icon",14),u(1,"check"),o())}function tt(i,n){i&1&&(a(0,"sh-icon",15),u(1,"prohibit"),o())}function nt(i,n){if(i&1){let e=E();a(0,"button",20),T("click",function(){m(e);let s=c();return h(s.updatePassphrase())}),f(1,5),o()}if(i&2){let e=c();U("loader",e.isUpdating())}}function it(i,n){if(i&1){let e=E();a(0,"button",21),T("click",function(){m(e);let s=c();return h(s.updatePassphrase())}),f(1,6),o()}if(i&2){let e=c();U("loader",e.isUpdating()),O("disabled",!0)}}var X=class i{#e=S(V);closed=ue();isUpdating=A(!1);passphrase=A("");repeatPassphrase=A("");updatePassphrase(){this.passphrase()===this.repeatPassphrase()&&(this.isUpdating.set(!0),this.#e.patchApiV1Serversettings({requestBody:{"server-passphrase":this.passphrase()}}).pipe(j(()=>this.isUpdating.set(!1))).subscribe({next:()=>this.closed.emit()}))}cancel(){this.isUpdating.set(!0),this.#e.patchApiV1Serversettings({requestBody:{"has-asked-for-password-change":"True"}}).pipe(j(()=>this.isUpdating.set(!1))).subscribe({next:()=>this.closed.emit()})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=D({type:i,selectors:[["app-change-passphrase-alert-dialog"]],outputs:{closed:"closed"},decls:23,vars:7,consts:()=>{let n;n=$localize`Enter new password`;let e;e=$localize`Repeat password`;let t;t=$localize`Password have to be filled and have to match`;let s;s=$localize`Change passphrase`;let l;l=$localize` Duplicati needs to be secured with a passphrase and a random passphrase has been generated for you. ${"[\uFFFD#6\uFFFD\uFFFD/#6\uFFFD|\uFFFD#7\uFFFD\uFFFD/#7\uFFFD]"}:LINE_BREAK:${"[\uFFFD#6\uFFFD\uFFFD/#6\uFFFD|\uFFFD#7\uFFFD\uFFFD/#7\uFFFD]"}:LINE_BREAK: If you open Duplicati from the tray icon, you do not need a passphrase, but if you plan to open it from another location you need to set a passphrase you know. Do you want to set a passphrase now? `,l=b(l);let P;P=$localize`Passphrase`;let I;I=$localize`Repeat passphrase`;let G;G=$localize`Not now thanks`;let v;v=$localize` Yes, update passphrase now `;let F;return F=$localize` Yes, update passphrase now `,[s,l,P,I,G,v,F,["header",""],["content",""],["type","warning"],["for","password"],["type","password","name","password","autocomplete","disabled","placeholder",n,"tabindex","1",3,"ngModelChange","ngModel"],["for","repeatPassword"],["type","password","name","repeatPassword","autocomplete","disabled","placeholder",e,"tabindex","2",3,"ngModelChange","disabled","ngModel"],["suffix","",1,"sh-success"],["suffix",""],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"loader"],["shButton","","shTooltip",t,1,"raised","primary",3,"loader","disabled"],["shButton","",1,"raised","primary",3,"click"],["shButton","","shTooltip",t,1,"raised","primary",3,"click","disabled"]]},template:function(e,t){e&1&&(a(0,"header",7)(1,"h3"),f(2,0),o()(),a(3,"div",8)(4,"sh-alert",9),g(5,1),_(6,"br")(7,"br"),C(),o(),a(8,"sh-form-field")(9,"label",10),f(10,2),o(),a(11,"input",11),w("ngModelChange",function(l){return H(t.passphrase,l)||(t.passphrase=l),l}),o()(),a(12,"sh-form-field")(13,"label",12),f(14,3),o(),a(15,"input",13),w("ngModelChange",function(l){return H(t.repeatPassphrase,l)||(t.repeatPassphrase=l),l}),o(),d(16,et,2,0,"sh-icon",14)(17,tt,2,0,"sh-icon",15),o()(),a(18,"footer",16)(19,"button",17),T("click",function(){return t.cancel()}),f(20,4),o(),d(21,nt,2,2,"button",18)(22,it,2,3,"button",19),o()),e&2&&(r(11),$("ngModel",t.passphrase),r(4),O("disabled",t.passphrase().length===0),$("ngModel",t.repeatPassphrase),r(),p(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?16:17),r(3),U("loader",t.isUpdating()),r(2),p(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?21:22))},dependencies:[Ae,Te,he,Fe,Y,Ie,M,Me,R],styles:["[_nghost-%COMP%]{display:block;--dialog-p: 1.5rem}[content][_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}"],changeDetection:0})};var ot=()=>({exact:!0});function at(i,n){i&1&&(a(0,"sh-icon",26),u(1,"x-bold"),o())}function st(i,n){i&1&&(a(0,"sh-icon",27),u(1,"list-bold"),o())}function rt(i,n){if(i&1){let e=E();ie(0,10),a(1,"button",25),T("click",function(){m(e);let s=c();return h(s.toggleNav())}),d(2,at,2,0,"sh-icon",26)(3,st,2,0,"sh-icon",27),o(),oe()}if(i&2){let e=c();r(2),p(e.isNavOpen()?2:3)}}function lt(i,n){i&1&&(a(0,"sh-icon"),u(1,"sun"),o())}function _t(i,n){i&1&&(a(0,"sh-icon"),u(1,"moon"),o())}function ct(i,n){if(i&1){let e=E();a(0,"button",28),T("click",function(){m(e);let s=c();return h(s.changeDefaultClientTo("ngax"))}),g(1,7),_(2,"sh-icon"),C(),o(),a(3,"button",28),T("click",function(){m(e);let s=c();return h(s.logout())}),g(4,8),_(5,"sh-icon"),C(),o()}}var Z=class i{#e=S(we);#t=S(V);#i=S(ve);#o=S(Ce);#a=S(fe);#s=S(J);#r=S(Ge);#l=S(be);#n=S(Re);relayIsEnabled=this.#o.relayIsEnabled;isDarkMode=this.#e.isDarkMode;isNavOpen=this.#e.isNavOpen;isMobile=this.#e.isMobile;sidenavType=this.#e.sidenavType;machineName=B(()=>{let n=this.#l.serverSettings();if(n&&n["--machine-name"])return n["--machine-name"];if(n&&n["machine-name"])return n["machine-name"];let e=this.#n.allOptions().find(t=>t.name==="machine-name");return e&&e.defaultValue?e.defaultValue:this.#n.systemInfo()?.MachineName??"Unknown"});ngOnInit(){return this.#s.init(),this.#i.getBackups(!0),this.#t.getApiV1Serversettings().subscribe({next:n=>{let e=n["autogenerated-passphrase"]==="True",t=n["has-asked-for-password-change"]==="True";e&&!t&&this.#a.open(X,{maxWidth:"500px"})}})}toggleNav(){this.#e.toggleNav()}toggleBodyClass(){this.#e.toggleBodyClass()}changeDefaultClientTo(n){this.#_(n),window.location.replace(`/${n}`)}logout(){this.#r.logout()}#_(n){var e=new Date;e.setTime(e.getTime()+2160*60*60*1e3),document.cookie="default-client="+n+"; expires="+e.toUTCString()+"; path=/"}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=D({type:i,selectors:[["app-layout"]],decls:43,vars:12,consts:()=>{let n;n=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_ICON:house${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_ICON: Home `;let e;e=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:database${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON: Add backup `;let t;t=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:clock-counter-clockwise${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Restore `;let s;s=$localize`${"\uFFFD#20\uFFFD"}:START_TAG_SH_ICON:gear${"\uFFFD/#20\uFFFD"}:CLOSE_TAG_SH_ICON: Settings `;let l;l=$localize`${"\uFFFD#32\uFFFD"}:START_TAG_SH_ICON:info${"\uFFFD/#32\uFFFD"}:CLOSE_TAG_SH_ICON: About Duplicati `;let P;P=$localize`${"\uFFFD#35\uFFFD"}:START_TAG_SH_ICON:files${"[\uFFFD/#35\uFFFD|\uFFFD/#36\uFFFD]"}:CLOSE_TAG_SH_ICON: Documentation ${"\uFFFD#36\uFFFD"}:START_TAG_SH_ICON_1:arrow-square-out${"[\uFFFD/#35\uFFFD|\uFFFD/#36\uFFFD]"}:CLOSE_TAG_SH_ICON:`,P=b(P);let I;I=$localize`${"\uFFFD#39\uFFFD"}:START_TAG_SH_ICON:chats-circle${"[\uFFFD/#39\uFFFD|\uFFFD/#40\uFFFD]"}:CLOSE_TAG_SH_ICON: Visit forum ${"\uFFFD#40\uFFFD"}:START_TAG_SH_ICON_1:arrow-square-out${"[\uFFFD/#39\uFFFD|\uFFFD/#40\uFFFD]"}:CLOSE_TAG_SH_ICON:`,I=b(I);let G;G=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:skip-back${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Use old UI `;let v;return v=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:sign-out${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON: Log out `,[n,e,t,s,l,P,I,G,v,[3,"isOpenChange","isOpen","disableDrag"],["sidenav-closed-topbar",""],["sidenav",""],["shButton","",1,"icon","small",3,"click"],[1,"base-1","primary"],["action","","routerLink","/","routerLinkActive","active",3,"routerLinkActiveOptions"],["action","","routerLink","/add-backup","routerLinkActive","active"],["action","","routerLink","/restore","routerLinkActive","active"],["action","","routerLink","/settings","routerLinkActive","active"],["action","",1,"machine-name",3,"title"],[1,"spacer"],[1,"base-1l","primary"],["action","","routerLink","/about","routerLinkActive","active"],["href","https://docs.duplicati.com","target","_blank","action",""],["suffix",""],["href","https://forum.duplicati.com","target","_blank","action",""],["shButton","",1,"small","toggle-sidebar",3,"click"],[1,"cross"],[1,"burger"],["action","",3,"click"]]},template:function(e,t){e&1&&(a(0,"sh-sidenav",9),w("isOpenChange",function(l){return H(t.isNavOpen,l)||(t.isNavOpen=l),l}),d(1,rt,4,1,"ng-container",10),a(2,"div",11)(3,"header"),_(4,"app-logo"),a(5,"button",12),T("click",function(){return t.toggleBodyClass()}),d(6,lt,2,0,"sh-icon")(7,_t,2,0,"sh-icon"),o()(),a(8,"sh-list",13)(9,"button",14),g(10,0),_(11,"sh-icon"),C(),o(),a(12,"button",15),g(13,1),_(14,"sh-icon"),C(),o(),a(15,"button",16),g(16,2),_(17,"sh-icon"),C(),o(),a(18,"button",17),g(19,3),_(20,"sh-icon"),C(),o(),_(21,"sh-divider"),a(22,"div",18)(23,"sh-icon"),u(24,"desktop"),o(),u(25),o()(),_(26,"div",19),a(27,"sh-list",20),d(28,ct,6,0),_(29,"sh-divider"),a(30,"button",21),g(31,4),_(32,"sh-icon"),C(),o(),a(33,"a",22),g(34,5),_(35,"sh-icon")(36,"sh-icon",23),C(),o(),a(37,"a",24),g(38,6),_(39,"sh-icon")(40,"sh-icon",23),C(),o()()(),_(41,"router-outlet")(42,"app-service-hub"),o()),e&2&&(L(t.sidenavType()),$("isOpen",t.isNavOpen),O("disableDrag",!0),r(),p(t.isMobile()?1:-1),r(5),p(t.isDarkMode()?6:7),r(3),O("routerLinkActiveOptions",ce(11,ot)),r(13),O("title",_e(t.machineName())),r(3),y(" ",t.machineName()," "),r(3),p(t.relayIsEnabled()?-1:28))},dependencies:[pe,Se,ge,De,M,Le,R,Pe,k,ye],styles:["[_nghost-%COMP%]{height:100vh;width:100%;overflow:hidden}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1.25rem;gap:.75rem}.toggle-sidebar[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;justify-content:center}.toggle-sidebar[_ngcontent-%COMP%] .cross[_ngcontent-%COMP%], .toggle-sidebar[_ngcontent-%COMP%] .burger[_ngcontent-%COMP%]{opacity:1;transition:opacity 124ms linear;margin:0}.toggle-sidebar[_ngcontent-%COMP%] .cross.hidden[_ngcontent-%COMP%], .toggle-sidebar[_ngcontent-%COMP%] .burger.hidden[_ngcontent-%COMP%]{opacity:0}.toggle-sidebar[_ngcontent-%COMP%] .burger[_ngcontent-%COMP%]{position:absolute;inset:auto}h3[title][_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}div[sidenav][_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100vh}.machine-name[_ngcontent-%COMP%]{margin:0;cursor:default}"],changeDetection:0})};export{Z as default};
1
+ import{a as $e,b as He}from"./chunk-LFVCKT5O.js";import{a as we}from"./chunk-MZMEFIHU.js";import{a as V}from"./chunk-66KMXCBD.js";import"./chunk-DU5QSRYH.js";import{a as Ge}from"./chunk-I5AKUAZF.js";import"./chunk-PJAWWLYW.js";import"./chunk-6Q6SSTBK.js";import"./chunk-RECKKS2S.js";import"./chunk-L4GZJLYK.js";import{a as be}from"./chunk-LJQN4G2O.js";import"./chunk-I2RHQQ3J.js";import"./chunk-F2QQDU4N.js";import{a as Re}from"./chunk-XE5OMGTJ.js";import{a as ye}from"./chunk-ZV7VPSMZ.js";import"./chunk-T6C2OUI5.js";import{b as Ce,d as ve}from"./chunk-TJ3WIU6Q.js";import{b as Y}from"./chunk-KBGIIJMM.js";import{B as R,G as Pe,H as Ie,J as Le,Q as Me,Y as De,c as Te,d as me,e as he,i as Ee,r as Ae,s as Fe,t as Oe,u as D,w as B,x as Ne,z as fe}from"./chunk-LFRGO2IP.js";import{c as pe,e as Se,f as ge}from"./chunk-LEZL7BSL.js";import"./chunk-4MEL5WTX.js";import"./chunk-5K64UNNB.js";import"./chunk-6DB3NZXR.js";import"./chunk-FPPZ4BUR.js";import{$b as c,Ab as te,Bb as ne,Bc as ce,Cb as O,Db as a,Eb as o,Fb as _,H as W,Jb as ie,Kb as oe,Mb as E,Ra as r,Rc as U,Sc as q,Tb as g,Ub as C,Vb as f,Wc as ue,Yb as G,Yc as de,Zb as T,_ as S,_c as Q,bb as M,da as m,ea as h,gc as ae,hc as se,kc as k,mc as L,nc as u,oa as F,oc as j,pc as b,sc as y,tc as $,uc as H,vc as re,wb as d,wc as le,xb as p,xc as w,yb as ee,yc as _e}from"./chunk-FAM42SZT.js";import{a as X,b as z}from"./chunk-EUDKD2JW.js";var Be=["scroller"];function Ye(i,n){i&1&&(a(0,"sh-icon"),u(1,"bell-ringing"),o())}function Ve(i,n){i&1&&(a(0,"sh-icon"),u(1,"bell"),o())}function Je(i,n){if(i&1&&_(0,"app-notification",8),i&2){c(2);let e=w(6);O("index",0)("notification",e.content)}}function Xe(i,n){if(i&1&&(a(0,"div",11),u(1),o()),i&2){c(3);let e=w(6);r(),b(" ",e.content.content," ")}}function ze(i,n){if(i&1&&(a(0,"sh-alert")(1,"div",10),u(2),o(),d(3,Xe,2,1,"div",11),o()),i&2){c(2);let e=w(6);L(e.content.type||"error"),r(2),j(e.content.title),r(),p(e.content.content?3:-1)}}function We(i,n){if(i&1&&(a(0,"div",6),d(1,Je,1,2,"app-notification",8)(2,ze,4,4,"sh-alert",9),o()),i&2){c();let e=w(6);r(),p(e.type==="notification"?1:2)}}function je(i,n){if(i&1){let e=E();a(0,"div",7)(1,"div",12)(2,"h6",13),g(3,2),a(4,"button",5),T("click",function(){m(e);let s=c();return h(s.toggleNotifications())}),_(5,"sh-icon"),o(),C(),o(),a(6,"div",14,0)(8,"div",15),_(9,"app-notifications"),o()()()()}}function qe(i,n){if(i&1&&(a(0,"div",20),u(1),o()),i&2){let e=c().$implicit;r(),b(" ",e.content," ")}}function Qe(i,n){if(i&1){let e=E();a(0,"sh-alert",18,1),T("click",function(){let s=m(e).$implicit,l=c(2);return h(l.deleteAlertByIndex(s.id))}),a(2,"div",19),u(3),o(),d(4,qe,2,1,"div",20),o()}if(i&2){let e=n.$implicit;L(e.type),O("id",e.id),r(3),j(e.title),r(),p(e.content?4:-1)}}function Ke(i,n){i&1&&(a(0,"p",17),f(1,4),o())}function Ze(i,n){if(i&1){let e=E();a(0,"div",7)(1,"div",12)(2,"h6",13),g(3,3),a(4,"button",5),T("click",function(){m(e);let s=c();return h(s.toggleAlerts())}),_(5,"sh-icon"),o(),C(),o(),a(6,"div",14,0)(8,"div",15),te(9,Qe,5,5,"sh-alert",16,ee,!1,Ke,2,0,"p",17),o()()()()}if(i&2){let e=c();r(9),ne(e.alertHistory())}}var xe=new Ae,x=class i{#e=S(Ne);#t=S(V);isSubmitting=F(!1);messageSent=F(!1);form=xe.group({message:xe.control("",[me.required])});notifications=this.#t.notifications;shownMessage=F(null);shownMessageInterval=null;alertHistory=this.#e.alertHistory;alertHistoryIsOpen=this.#e.alertHistoryIsOpen;alertHistoryIsHidden=this.#e.alertHistoryIsHidden;numberOfOpenAlerts=U(()=>this.alertHistory().filter(n=>n.isOpen).length);scroller=de("scroller");isAlertsOpen=Q(!1);isNotificationsOpen=Q(!1);previousHistoryCount=F(null);previousNotificationsCount=F(null);constructor(){q(()=>{let n=this.alertHistory(),e=this.notifications();if(e.length===0){this.shownMessage.set(null);return}e.length&&this.previousHistoryCount()!==n.length&&!this.isNotificationsOpen()?(this.shownMessage.set({content:e[0],countDown:3,type:"notification"}),this.previousHistoryCount.set(n.length),this.shownMessageInterval=setInterval(()=>{let t=this.shownMessage();if(t?.countDown===0){this.shownMessage.set(null),this.shownMessageInterval=null;return}t!==null&&this.shownMessage.update(s=>z(X({},s),{countDown:s.countDown-1}))},1e3)):n.length&&this.previousHistoryCount()!==n.length&&!this.isAlertsOpen()&&(this.shownMessage.set({content:n[0],countDown:3,type:"alert"}),this.previousHistoryCount.set(n.length),this.shownMessageInterval=setInterval(()=>{let t=this.shownMessage();if(t?.countDown===0){this.shownMessage.set(null),this.shownMessageInterval=null;return}t!==null&&this.shownMessage.update(s=>z(X({},s),{countDown:s.countDown-1}))},1e3))}),q(()=>{this.alertHistoryIsOpen(),this.scrollToBottom()})}resetPreviewMessage(){this.shownMessage.set(null),this.shownMessageInterval=null}toggleAlerts(){this.isAlertsOpen()?this.isAlertsOpen.set(!1):(this.isAlertsOpen.set(!0),this.isNotificationsOpen.set(!1),this.resetPreviewMessage())}toggleNotifications(){this.isNotificationsOpen.set(!this.isNotificationsOpen()),this.isAlertsOpen()&&this.isAlertsOpen.set(!1)}deleteAlertByIndex(n){this.#e.removeAlert(n)}scrollToBottom(){this.scroller()&&this.scroller()?.nativeElement&&this.scroller().nativeElement.scrollTo(0,this.scroller().nativeElement.scrollHeight)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["app-service-hub"]],viewQuery:function(e,t){e&1&&ae(t.scroller,Be,5),e&2&&se()},inputs:{isAlertsOpen:[1,"isAlertsOpen"],isNotificationsOpen:[1,"isNotificationsOpen"]},outputs:{isAlertsOpen:"isAlertsOpenChange",isNotificationsOpen:"isNotificationsOpenChange"},decls:10,vars:9,consts:()=>{let n;n=$localize` Notifications ${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_BUTTON:`;let e;e=$localize` Alerts ${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_BUTTON:`;let t;return t=$localize`No alerts yet`,[["scroller",""],["alerts",""],n,e,t,["shButton","",3,"click"],[1,"preview-alert-wrap"],[1,"alert-stream-modal"],[3,"index","notification"],[3,"class"],["ship-alert-title",""],["ship-alert-content",""],[1,"alert-stream-modal-content"],[1,"paragraph-20"],[1,"alert-stream-modal-list-scroller"],[1,"alert-stream-modal-list"],[3,"class","id"],[1,"no-alerts"],[3,"click","id"],["title",""],["content",""]]},template:function(e,t){if(e&1){let s=E();a(0,"button",5),T("click",function(){return m(s),h(t.toggleAlerts())}),a(1,"sh-icon"),u(2,"info"),o()(),a(3,"button",5),T("click",function(){return m(s),h(t.toggleNotifications())}),d(4,Ye,2,0,"sh-icon")(5,Ve,2,0,"sh-icon"),o(),re(6),d(7,We,3,1,"div",6),d(8,je,10,0,"div",7),d(9,Ze,12,1,"div",7)}if(e&2){L(t.alertHistory().length?"error":""),r(3),L(t.notifications().length?"error":""),r(),p(t.notifications().length?4:5),r(2);let s=le(t.shownMessage());r(),p(s?7:-1),r(),p(t.isNotificationsOpen()?8:-1),r(),p(t.isAlertsOpen()?9:-1)}},dependencies:[Oe,B,D,R,He,$e],styles:["[_nghost-%COMP%]{display:flex;position:fixed;gap:.5rem;bottom:1.5rem;right:1.5rem;z-index:5000}@media only screen and (max-width: 768px){[_nghost-%COMP%]{bottom:1rem;right:1rem}}[_nghost-%COMP%] h6[_ngcontent-%COMP%]{margin:0}.preview-alert-wrap[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column;min-width:15.625rem}.helpdesk-modal[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column}@media only screen and (max-width: 768px){.helpdesk-modal[_ngcontent-%COMP%]{bottom:2.6875rem}}.helpdesk-modal-content[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;gap:1rem;min-width:20rem;border:1px solid var(--base-4);background-color:var(--base-1);border-radius:var(--shape-2)}.helpdesk-modal-content[_ngcontent-%COMP%] .message-sent[_ngcontent-%COMP%]{padding:0 1rem 1rem;text-wrap:pretty}.helpdesk-modal-content[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid var(--base-4);display:flex;align-items:center;justify-content:space-between}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{padding:0 1rem 1rem;display:flex;flex-direction:column;align-items:flex-end;gap:1rem}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{width:100%;text-wrap:pretty}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{width:100%}.alert-stream-modal[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column}@media only screen and (max-width: 768px){.alert-stream-modal[_ngcontent-%COMP%]{bottom:2.6875rem}}.alert-stream-modal-list-scroller[_ngcontent-%COMP%]{overflow-y:auto;max-height:18.75rem}.alert-stream-modal-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:1rem;border-radius:var(--shape-2)}.alert-stream-modal-content[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;min-width:20rem;border:1px solid var(--base-4);background-color:var(--base-1);border-radius:var(--shape-2)}.alert-stream-modal-content[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid var(--base-4);display:flex;align-items:center;justify-content:space-between}.no-alerts[_ngcontent-%COMP%]{padding:1rem;display:flex;flex-direction:column;gap:1rem;text-align:center}"],changeDetection:0})};function et(i,n){i&1&&(a(0,"sh-icon",14),u(1,"check"),o())}function tt(i,n){i&1&&(a(0,"sh-icon",15),u(1,"prohibit"),o())}function nt(i,n){if(i&1){let e=E();a(0,"button",20),T("click",function(){m(e);let s=c();return h(s.updatePassphrase())}),f(1,5),o()}if(i&2){let e=c();k("loader",e.isUpdating())}}function it(i,n){if(i&1){let e=E();a(0,"button",21),T("click",function(){m(e);let s=c();return h(s.updatePassphrase())}),f(1,6),o()}if(i&2){let e=c();k("loader",e.isUpdating()),O("disabled",!0)}}var J=class i{#e=S(Y);closed=ue();isUpdating=F(!1);passphrase=F("");repeatPassphrase=F("");updatePassphrase(){this.passphrase()===this.repeatPassphrase()&&(this.isUpdating.set(!0),this.#e.patchApiV1Serversettings({requestBody:{"server-passphrase":this.passphrase()}}).pipe(W(()=>this.isUpdating.set(!1))).subscribe({next:()=>this.closed.emit()}))}cancel(){this.isUpdating.set(!0),this.#e.patchApiV1Serversettings({requestBody:{"has-asked-for-password-change":"True"}}).pipe(W(()=>this.isUpdating.set(!1))).subscribe({next:()=>this.closed.emit()})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["app-change-passphrase-alert-dialog"]],outputs:{closed:"closed"},decls:23,vars:7,consts:()=>{let n;n=$localize`Enter new password`;let e;e=$localize`Repeat password`;let t;t=$localize`Password have to be filled and have to match`;let s;s=$localize`Change passphrase`;let l;l=$localize` Duplicati needs to be secured with a passphrase and a random passphrase has been generated for you. ${"[\uFFFD#6\uFFFD\uFFFD/#6\uFFFD|\uFFFD#7\uFFFD\uFFFD/#7\uFFFD]"}:LINE_BREAK:${"[\uFFFD#6\uFFFD\uFFFD/#6\uFFFD|\uFFFD#7\uFFFD\uFFFD/#7\uFFFD]"}:LINE_BREAK: If you open Duplicati from the tray icon, you do not need a passphrase, but if you plan to open it from another location you need to set a passphrase you know. Do you want to set a passphrase now? `,l=G(l);let P;P=$localize`Passphrase`;let I;I=$localize`Repeat passphrase`;let v;v=$localize`Not now thanks`;let A;A=$localize` Yes, update passphrase now `;let Z;return Z=$localize` Yes, update passphrase now `,[s,l,P,I,v,A,Z,["header",""],["content",""],["type","warning"],["for","password"],["type","password","name","password","autocomplete","disabled","placeholder",n,"tabindex","1",3,"ngModelChange","ngModel"],["for","repeatPassword"],["type","password","name","repeatPassword","autocomplete","disabled","placeholder",e,"tabindex","2",3,"ngModelChange","disabled","ngModel"],["suffix","",1,"sh-success"],["suffix",""],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"loader"],["shButton","","shTooltip",t,1,"raised","primary",3,"loader","disabled"],["shButton","",1,"raised","primary",3,"click"],["shButton","","shTooltip",t,1,"raised","primary",3,"click","disabled"]]},template:function(e,t){e&1&&(a(0,"header",7)(1,"h3"),f(2,0),o()(),a(3,"div",8)(4,"sh-alert",9),g(5,1),_(6,"br")(7,"br"),C(),o(),a(8,"sh-form-field")(9,"label",10),f(10,2),o(),a(11,"input",11),H("ngModelChange",function(l){return $(t.passphrase,l)||(t.passphrase=l),l}),o()(),a(12,"sh-form-field")(13,"label",12),f(14,3),o(),a(15,"input",13),H("ngModelChange",function(l){return $(t.repeatPassphrase,l)||(t.repeatPassphrase=l),l}),o(),d(16,et,2,0,"sh-icon",14)(17,tt,2,0,"sh-icon",15),o()(),a(18,"footer",16)(19,"button",17),T("click",function(){return t.cancel()}),f(20,4),o(),d(21,nt,2,2,"button",18)(22,it,2,3,"button",19),o()),e&2&&(r(11),y("ngModel",t.passphrase),r(4),O("disabled",t.passphrase().length===0),y("ngModel",t.repeatPassphrase),r(),p(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?16:17),r(3),k("loader",t.isUpdating()),r(2),p(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?21:22))},dependencies:[Fe,Te,he,Ee,B,Ie,D,De,R],styles:["[_nghost-%COMP%]{display:block;--dialog-p: 1.5rem}[content][_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}"],changeDetection:0})};var ot=()=>({exact:!0});function at(i,n){i&1&&(a(0,"sh-icon",26),u(1,"x-bold"),o())}function st(i,n){i&1&&(a(0,"sh-icon",27),u(1,"list-bold"),o())}function rt(i,n){if(i&1){let e=E();ie(0,9),a(1,"button",25),T("click",function(){m(e);let s=c();return h(s.toggleNav())}),d(2,at,2,0,"sh-icon",26)(3,st,2,0,"sh-icon",27),o(),oe()}if(i&2){let e=c();r(2),p(e.isNavOpen()?2:3)}}function lt(i,n){i&1&&(a(0,"sh-icon"),u(1,"sun"),o())}function _t(i,n){i&1&&(a(0,"sh-icon"),u(1,"moon"),o())}function ct(i,n){if(i&1){let e=E();a(0,"button",28),T("click",function(){m(e);let s=c();return h(s.logout())}),g(1,7),_(2,"sh-icon"),C(),o()}}var K=class i{#e=S(we);#t=S(Y);#i=S(Ge);#o=S(Ce);#a=S(fe);#s=S(V);#r=S(ve);#l=S(be);#n=S(Re);relayIsEnabled=this.#o.relayIsEnabled;isDarkMode=this.#e.isDarkMode;isNavOpen=this.#e.isNavOpen;isMobile=this.#e.isMobile;sidenavType=this.#e.sidenavType;machineName=U(()=>{let n=this.#l.serverSettings();if(n&&n["--machine-name"])return n["--machine-name"];if(n&&n["machine-name"])return n["machine-name"];let e=this.#n.allOptions().find(t=>t.name==="machine-name");return e&&e.defaultValue?e.defaultValue:this.#n.systemInfo()?.MachineName??"Unknown"});ngOnInit(){return this.#s.init(),this.#i.getBackups(!0),this.#t.getApiV1Serversettings().subscribe({next:n=>{let e=n["autogenerated-passphrase"]==="True",t=n["has-asked-for-password-change"]==="True";e&&!t&&this.#a.open(J,{maxWidth:"500px"})}})}toggleNav(){this.#e.toggleNav()}toggleBodyClass(){this.#e.toggleBodyClass()}changeDefaultClientTo(n){this.#_(n),window.location.replace(`/${n}`)}logout(){this.#r.logout()}#_(n){var e=new Date;e.setTime(e.getTime()+2160*60*60*1e3),document.cookie="default-client="+n+"; expires="+e.toUTCString()+"; path=/"}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["app-layout"]],decls:42,vars:12,consts:()=>{let n;n=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_ICON:house${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_ICON: Home `;let e;e=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:database${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON: Add backup `;let t;t=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:clock-counter-clockwise${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Restore `;let s;s=$localize`${"\uFFFD#20\uFFFD"}:START_TAG_SH_ICON:gear${"\uFFFD/#20\uFFFD"}:CLOSE_TAG_SH_ICON: Settings `;let l;l=$localize`${"\uFFFD#30\uFFFD"}:START_TAG_SH_ICON:info${"\uFFFD/#30\uFFFD"}:CLOSE_TAG_SH_ICON: About Duplicati `;let P;P=$localize`${"\uFFFD#33\uFFFD"}:START_TAG_SH_ICON:files${"[\uFFFD/#33\uFFFD|\uFFFD/#34\uFFFD]"}:CLOSE_TAG_SH_ICON: Documentation ${"\uFFFD#34\uFFFD"}:START_TAG_SH_ICON_1:arrow-square-out${"[\uFFFD/#33\uFFFD|\uFFFD/#34\uFFFD]"}:CLOSE_TAG_SH_ICON:`,P=G(P);let I;I=$localize`${"\uFFFD#37\uFFFD"}:START_TAG_SH_ICON:chats-circle${"[\uFFFD/#37\uFFFD|\uFFFD/#38\uFFFD]"}:CLOSE_TAG_SH_ICON: Visit forum ${"\uFFFD#38\uFFFD"}:START_TAG_SH_ICON_1:arrow-square-out${"[\uFFFD/#37\uFFFD|\uFFFD/#38\uFFFD]"}:CLOSE_TAG_SH_ICON:`,I=G(I);let v;return v=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:sign-out${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Log out `,[n,e,t,s,l,P,I,v,[3,"isOpenChange","isOpen","disableDrag"],["sidenav-closed-topbar",""],["sidenav",""],["shButton","",1,"icon","small",3,"click"],[1,"base-1","primary"],["action","","routerLink","/","routerLinkActive","active",3,"routerLinkActiveOptions"],["action","","routerLink","/add-backup","routerLinkActive","active"],["action","","routerLink","/restore","routerLinkActive","active"],["action","","routerLink","/settings","routerLinkActive","active"],[1,"spacer"],[1,"base-1l","primary"],["action","",1,"machine-name",3,"title"],["action","","routerLink","/about","routerLinkActive","active"],["href","https://docs.duplicati.com","target","_blank","action",""],["suffix",""],["href","https://forum.duplicati.com","target","_blank","action",""],["action",""],["shButton","",1,"small","toggle-sidebar",3,"click"],[1,"cross"],[1,"burger"],["action","",3,"click"]]},template:function(e,t){e&1&&(a(0,"sh-sidenav",8),H("isOpenChange",function(l){return $(t.isNavOpen,l)||(t.isNavOpen=l),l}),d(1,rt,4,1,"ng-container",9),a(2,"div",10)(3,"header"),_(4,"app-logo"),a(5,"button",11),T("click",function(){return t.toggleBodyClass()}),d(6,lt,2,0,"sh-icon")(7,_t,2,0,"sh-icon"),o()(),a(8,"sh-list",12)(9,"button",13),g(10,0),_(11,"sh-icon"),C(),o(),a(12,"button",14),g(13,1),_(14,"sh-icon"),C(),o(),a(15,"button",15),g(16,2),_(17,"sh-icon"),C(),o(),a(18,"button",16),g(19,3),_(20,"sh-icon"),C(),o()(),_(21,"div",17),a(22,"sh-list",18)(23,"div",19)(24,"sh-icon"),u(25,"desktop"),o(),u(26),o(),_(27,"sh-divider"),a(28,"button",20),g(29,4),_(30,"sh-icon"),C(),o(),a(31,"a",21),g(32,5),_(33,"sh-icon")(34,"sh-icon",22),C(),o(),a(35,"a",23),g(36,6),_(37,"sh-icon")(38,"sh-icon",22),C(),o(),d(39,ct,3,0,"button",24),o()(),_(40,"router-outlet")(41,"app-service-hub"),o()),e&2&&(L(t.sidenavType()),y("isOpen",t.isNavOpen),O("disableDrag",!0),r(),p(t.isMobile()?1:-1),r(5),p(t.isDarkMode()?6:7),r(3),O("routerLinkActiveOptions",ce(11,ot)),r(14),O("title",_e(t.machineName())),r(3),b(" ",t.machineName()," "),r(13),p(t.relayIsEnabled()?-1:39))},dependencies:[pe,Se,ge,Me,D,Le,R,Pe,x,ye],styles:["[_nghost-%COMP%]{height:100vh;width:100%;overflow:hidden}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1.25rem;gap:.75rem}.toggle-sidebar[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;justify-content:center}.toggle-sidebar[_ngcontent-%COMP%] .cross[_ngcontent-%COMP%], .toggle-sidebar[_ngcontent-%COMP%] .burger[_ngcontent-%COMP%]{opacity:1;transition:opacity 124ms linear;margin:0}.toggle-sidebar[_ngcontent-%COMP%] .cross.hidden[_ngcontent-%COMP%], .toggle-sidebar[_ngcontent-%COMP%] .burger.hidden[_ngcontent-%COMP%]{opacity:0}.toggle-sidebar[_ngcontent-%COMP%] .burger[_ngcontent-%COMP%]{position:absolute;inset:auto}h3[title][_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}div[sidenav][_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100vh}.machine-name[_ngcontent-%COMP%]{margin:0;cursor:default}"],changeDetection:0})};export{K as default};
@@ -0,0 +1 @@
1
+ import{a as Pt}from"./chunk-MZMEFIHU.js";import{a as Ot}from"./chunk-XDECUOQ5.js";import{a as ht}from"./chunk-NOHHRZSK.js";import"./chunk-DU5QSRYH.js";import"./chunk-D2DI6ZER.js";import"./chunk-M77IE672.js";import"./chunk-I5AKUAZF.js";import"./chunk-PJAWWLYW.js";import"./chunk-6Q6SSTBK.js";import"./chunk-RECKKS2S.js";import{a as ie}from"./chunk-W4QCGFNO.js";import"./chunk-L4GZJLYK.js";import{a as X}from"./chunk-LJQN4G2O.js";import"./chunk-I2RHQQ3J.js";import{a as Mt}from"./chunk-F2QQDU4N.js";import{a as ft}from"./chunk-XE5OMGTJ.js";import"./chunk-T6C2OUI5.js";import{a as rt,b as Tt}from"./chunk-TJ3WIU6Q.js";import{b as ne}from"./chunk-KBGIIJMM.js";import{B as J,E as ct,G as gt,H as te,L as Ct,M as pt,N as Et,P as ut,W as Nt,Y as mt,c as j,e as K,i as Q,m as dt,s as Y,t as Z,u as k,w as ee,z as St}from"./chunk-LFRGO2IP.js";import"./chunk-LEZL7BSL.js";import"./chunk-4MEL5WTX.js";import"./chunk-5K64UNNB.js";import"./chunk-6DB3NZXR.js";import"./chunk-FPPZ4BUR.js";import{$b as d,B as b,Bc as V,Cb as m,Db as o,Eb as i,Fb as h,H as R,Mb as f,Oa as tt,Ra as _,Rc as w,Sc as x,Tb as G,Ub as y,Vb as l,Wb as B,Xb as H,Yb as W,Yc as _t,Zb as c,_ as P,a as Ye,b as Ze,bb as D,c as et,da as p,ea as E,gb as le,gc as st,hb as nt,hc as at,kc as M,n as F,nc as $,oa as S,oc as q,pc as _e,rb as it,sb as ot,sc as A,tc as v,uc as L,wb as g,xb as C,yc as lt}from"./chunk-FAM42SZT.js";import"./chunk-EUDKD2JW.js";var $t=["formRef"],At=()=>[import("./chunk-7KUVROHU.js").then(s=>s.OptionsListComponent)];function vt(s,t){s&1&&(o(0,"sh-alert",3),l(1,1),i())}function Lt(s,t){if(s&1){let e=f();o(0,"app-options-list",5),L("optionsChange",function(a){p(e);let T=d();return v(T.settings,a)||(T.settings=a),E(a)}),i()}if(s&2){let e=d();A("options",e.settings),m("hasFreeTextSettings",!0)}}var z=class s{#e=P(X);#n=P(ne);formRef=_t.required("formRef");settings=S([]);isSubmitting=S(!1);isLoadingOptions=S(!0);saved=S(!1);lastRecievedServerSettings=S({});serverSettingsEffect=x(()=>{let t=this.#e.serverSettings();if(t===void 0)return;this.lastRecievedServerSettings.set(t),this.isLoadingOptions.set(!0);let e=Object.entries(t);e.forEach(([n,a],T)=>{if(n.startsWith("--")){let N=n.substring(2);this.settings.update(u=>(u.some(O=>O.Name===N)||u.push({Name:N,Value:a}),u))}T===e.length-1&&this.isLoadingOptions.set(!1)})});submit(){this.isSubmitting.set(!0);let t=this.settings(),e=this.lastRecievedServerSettings(),n=t.map(u=>u.Name),T=Object.keys(e).filter(u=>u.startsWith("--")).filter(u=>!n.includes(u.replace("--",""))),N=t.reduce((u,O)=>{let I=O.Name?.startsWith("--")?O.Name:`--${O.Name}`;return u[I]=O.Value,u},{});T.forEach(u=>{N[u]=null}),this.#n.patchApiV1Serversettings({requestBody:N}).pipe(R(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.#e.refreshServerSettings(),this.saved.set(!0),setTimeout(()=>{this.saved.set(!1)},3e3)}})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=D({type:s,selectors:[["app-advanced-options-settings"]],viewQuery:function(e,n){e&1&&st(n.formRef,$t,5),e&2&&at()},decls:8,vars:4,consts:()=>{let t;t=$localize`${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:floppy-disk${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON: Save settings `;let e;return e=$localize`Settings saved`,[t,e,[1,"actions"],[1,"success"],["shButton","","type","button",1,"raised","primary",3,"click"],[3,"optionsChange","options","hasFreeTextSettings"]]},template:function(e,n){e&1&&(o(0,"div",2),g(1,vt,2,0,"sh-alert",3),o(2,"button",4),c("click",function(){return n.submit()}),G(3,0),h(4,"sh-icon"),y(),i()(),nt(5,Lt,1,2),it(6,5,At)),e&2&&(_(),C(n.saved()?1:-1),_(),M("loader",n.isSubmitting()),_(4),ot(!n.isLoadingOptions()))},dependencies:[Z,J,k,ee],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40.625rem;justify-self:flex-end}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:flex-end;margin-bottom:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.remote-volume-wrap[_ngcontent-%COMP%] p.warning[_ngcontent-%COMP%]{color:#7d7d00}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 2.5rem;align-items:flex-end}"],changeDetection:0})};function bt(s,t){if(s&1){let e=f();o(0,"sh-form-field",12)(1,"input",13),L("ngModelChange",function(a){p(e);let T=d(2);return v(T.registerUrl,a)||(T.registerUrl=a),E(a)}),i()(),o(2,"button",14),c("click",function(){p(e);let a=d(2);return E(a.register())}),l(3,0),i()}if(s&2){let e=d(2);_(),A("ngModel",e.registerUrl)}}function wt(s,t){if(s&1&&(o(0,"div",9)(1,"label"),l(2,1),i(),o(3,"a",15),$(4),i()()),s&2){let e=d(2);_(3),m("href",lt(e.claimUrl()),tt),_(),q(e.claimUrl())}}function Dt(s,t){s&1&&(o(0,"div",9)(1,"label"),l(2,2),i()())}function xt(s,t){if(s&1){let e=f();o(0,"button",14),c("click",function(){p(e);let a=d(2);return E(a.cancel())}),l(1,3),i()}}function kt(s,t){if(s&1){let e=f();o(0,"button",14),c("click",function(){p(e);let a=d(2);return E(a.disable())}),l(1,4),i()}}function Jt(s,t){if(s&1){let e=f();o(0,"button",14),c("click",function(){p(e);let a=d(2);return E(a.enable())}),l(1,5),i(),o(2,"button",16),c("click",function(){p(e);let a=d(2);return E(a.delete())}),l(3,6),i()}}function Xt(s,t){s&1&&(G(0,7,1),h(1,"sh-icon"),y())}function Vt(s,t){s&1&&(G(0,7,2),h(1,"sh-icon"),y())}function zt(s,t){if(s&1){let e=f();o(0,"sh-chip",17),c("click",function(){p(e);let a=d(2);return E(a.copyReportingUrl())}),G(1,7),g(2,Xt,2,0,"sh-icon")(3,Vt,2,0,"sh-icon"),y(),i()}if(s&2){let e=d(2);_(2),C(e.copiedReportingUrl()===!0?2:3)}}function Ut(s,t){if(s&1&&(o(0,"div",8),g(1,bt,4,1),g(2,wt,5,3,"div",9),g(3,Dt,3,0,"div",9),g(4,xt,2,0,"button",10),g(5,kt,2,0,"button",10),g(6,Jt,4,0),g(7,zt,4,1,"sh-chip",11),i()),s&2){let e=d();_(),C(e.state()==="inactive"?1:-1),_(),C(e.state()==="registered"?2:-1),_(),C(e.state()==="registering"?3:-1),_(),C(e.state()==="registering"||e.state()==="registeringfaulted"||e.state()==="registered"?4:-1),_(),C(e.state()==="connected"||e.state()==="connecting"?5:-1),_(),C(e.state()==="disabled"?6:-1),_(),C(e.additionalReportingUrl()!==""?7:-1)}}var oe=class s{#e=P(ie);#n=P(X);state=this.#e.state;claimUrl=this.#e.claimUrl;registerUrl=this.#e.registerUrl;additionalReportingUrl=w(()=>{let t=this.#n.serverSettings();return this.#e.state()==="inactive"?"":t&&t["additional-report-url"]||""});copiedReportingUrl=S(!1);ngOnInit(){this.#e.refreshRemoteControlStatus()}cancel(){this.#e.cancelRemoteRegistration()}register(){this.#e.beginRemoteRegistration()}disable(){this.#e.disableRemoteControl()}enable(){this.#e.enableRemoteControl()}delete(){this.#e.deleteRemoteControl()}copyReportingUrl(){let t=this.additionalReportingUrl();t&&(this.copiedReportingUrl.set(!0),setTimeout(()=>this.copiedReportingUrl.set(!1),2e3),navigator.clipboard.writeText(t))}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=D({type:s,selectors:[["app-remote-control"]],decls:1,vars:1,consts:()=>{let t;t=$localize`Register on console`;let e;e=$localize`Machine is now registered, open this link to add it to your account:`;let n;n=$localize`Registering, please wait...`;let a;a=$localize`Cancel registration`;let T;T=$localize`Disable console connection`;let N;N=$localize`Enable console connection`;let u;u=$localize` Delete console connection setup `;let O;return O=$localize` Reporting configured by server ${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,O=W(O),[t,e,n,a,T,N,u,O,[1,"field-row"],[1,"field-col"],["type","button","shButton","",1,"raised"],[1,"reporting-url","primary","simple"],["label","Registration URL","for","remoteControlRegisterUrl"],["type","text","sh-input","","id","remoteControlRegisterUrl","name","remoteControlRegisterUrl",3,"ngModelChange","ngModel"],["type","button","shButton","",1,"raised",3,"click"],["target","_blank",3,"href"],["type","button","shButton","",1,"raised","error",3,"click"],[1,"reporting-url","primary","simple",3,"click"]]},template:function(e,n){e&1&&g(0,Ut,8,7,"div",8),e&2&&C(n.state()!=="unknown"?0:-1)},dependencies:[Y,j,K,Q,te,J,ct,k],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{flex:1 0}.reporting-url[_ngcontent-%COMP%]{cursor:pointer;-webkit-user-select:none;user-select:none;margin-top:.25rem}"],changeDetection:0})};function Gt(...s){let t=S(...s);return Object.defineProperty(t,"value",{get:t.asReadonly(),set:t.set.bind(t)})}var se=()=>({standalone:!0});function Bt(s,t){s&1&&(o(0,"label"),l(1,34),i())}function Ht(s,t){s&1&&(o(0,"label"),l(1,35),i())}function Wt(s,t){if(s&1){let e=f();o(0,"section")(1,"div",52)(2,"h3"),l(3,32),i(),o(4,"p"),l(5,33),i()(),o(6,"div",53)(7,"sh-toggle",63),c("click",function(){p(e);let a=d(2);return E(a.toggleConsoleControl())}),g(8,Bt,2,0,"label")(9,Ht,2,0,"label"),i()()()}if(s&2){let e=d(2);_(7),M("active",!e.consoleControlDisabled()),_(),C(e.consoleControlDisabled()?8:9)}}function qt(s,t){if(s&1&&(o(0,"section")(1,"div",52)(2,"h3"),l(3,31),i(),o(4,"p"),$(5),i()(),o(6,"div",53),h(7,"app-remote-control"),i()(),g(8,Wt,10,3,"section")),s&2){let e=d();_(5),q(e.remoteControlStatus()),_(3),C(e.remoteControlState()!="inactive"?8:-1)}}function jt(s,t){s&1&&(o(0,"sh-icon",78),$(1,"check"),i())}function Kt(s,t){s&1&&(o(0,"sh-icon",79),$(1,"prohibit"),i())}function Qt(s,t){if(s&1){let e=f();o(0,"button",83),c("click",function(){p(e);let a=d(2);return E(a.updatePassphrase())}),l(1,39),i()}if(s&2){let e=d(2);M("loader",e.isUpdating())}}function Yt(s,t){if(s&1){let e=f();o(0,"button",84),c("click",function(){p(e);let a=d(2);return E(a.updatePassphrase())}),l(1,40),i()}if(s&2){let e=d(2);M("loader",e.isUpdating()),m("disabled",!0)}}function Zt(s,t){if(s&1){let e=f();o(0,"sh-form-field")(1,"label",74),l(2,36),i(),o(3,"input",75),L("ngModelChange",function(a){p(e);let T=d();return v(T.passphrase,a)||(T.passphrase=a),E(a)}),i()(),o(4,"sh-form-field")(5,"label",76),l(6,37),i(),o(7,"input",77),L("ngModelChange",function(a){p(e);let T=d();return v(T.repeatPassphrase,a)||(T.repeatPassphrase=a),E(a)}),i(),g(8,jt,2,0,"sh-icon",78)(9,Kt,2,0,"sh-icon",79),i(),o(10,"div",58)(11,"button",80),c("click",function(){p(e);let a=d();return E(a.cancelPasswordChange())}),l(12,38),i(),g(13,Qt,2,2,"button",81)(14,Yt,2,3,"button",82),i()}if(s&2){let e=d();_(3),A("ngModel",e.passphrase),_(4),m("disabled",e.passphrase().length===0),A("ngModel",e.repeatPassphrase),_(),C(e.passphrase().length!==0&&e.passphrase()===e.repeatPassphrase()?8:9),_(3),M("loader",e.isUpdating()),_(2),C(e.passphrase().length!==0&&e.passphrase()===e.repeatPassphrase()?13:14)}}function en(s,t){s&1&&(o(0,"sh-icon",85),$(1,"check"),i())}function tn(s,t){if(s&1){let e=f();o(0,"div",58)(1,"button",80),c("click",function(){p(e);let a=d();return E(a.openPassphraseForm())}),l(2,41),i(),g(3,en,2,0,"sh-icon",85),i()}if(s&2){let e=d();_(3),C(e.passwordUpdated()?3:-1)}}function nn(s,t){if(s&1){let e=f();o(0,"sh-form-field")(1,"label",86),l(2,42),i(),o(3,"textarea",87),L("ngModelChange",function(a){p(e);let T=d();return v(T.allowedHostnames,a)||(T.allowedHostnames=a),E(a)}),i()(),o(4,"sh-alert",88),l(5,43),i(),o(6,"button",83),c("click",function(){p(e);let a=d();return E(a.updateAllowedHostnames())}),l(7,44),i()}if(s&2){let e=d();_(3),A("ngModel",e.allowedHostnames),_(3),M("loader",e.updatingAllowedHosts())}}function on(s,t){if(s&1){let e=f();o(0,"section")(1,"div",52)(2,"h3"),l(3,45),i(),o(4,"p"),l(5,46),i()(),o(6,"div",53)(7,"sh-select",89)(8,"input",60),c("ngModelChange",function(a){p(e);let T=d();return E(T.updatePowerMode(a))}),i()()()()}if(s&2){let e=d();_(7),m("options",e.powerModeOptions())("isClearable",!1),_(),m("ngModel",e.powerModeCtrl())("ngModelOptions",V(4,se))}}function sn(s,t){if(s&1&&(o(0,"p"),l(1,47),i()),s&2){let e,n=d();_(),B((e=n.sysinfo())==null?null:e.ServerVersionName),H(1)}}function an(s,t){s&1&&h(0,"sh-progress-bar",64)}function ln(s,t){if(s&1&&$(0),s&2){let e=t.$implicit;_e(" ",e.label," ")}}function _n(s,t){if(s&1&&$(0),s&2){let e=t.$implicit;_e(" ",e.label," ")}}function rn(s,t){if(s&1){let e=f();o(0,"section")(1,"div",52)(2,"h3"),l(3,48),i(),o(4,"p"),G(5,49),h(6,"a",90)(7,"br")(8,"br"),y(),i()(),o(9,"div",53)(10,"sh-select",91)(11,"input",60),c("ngModelChange",function(a){p(e);let T=d();return E(T.updateUsageStatistics(a))}),i(),le(12,_n,1,1,"ng-template"),i()()()}if(s&2){let e=d();_(10),m("options",e.usageStatisticsOptions())("isLoading",e.updatingUsageStatistics()),_(),m("ngModel",e.usageStatistics())("ngModelOptions",V(4,se))}}function Tn(s,t,e){let n=Gt(s),a=n[Ye];e?.equal&&(a.equal=e.equal);let T;return n.set=N=>{clearTimeout(T),T=setTimeout(()=>Ze(a,N),t)},n.update=N=>{clearTimeout(T),T=setTimeout(()=>et(a,N),t)},n}var dn=[{value:"none",label:$localize`None`},{value:"s",label:$localize`Seconds`},{value:"m",label:$localize`Minutes`},{value:"h",label:$localize`Hours`}],yt=[{value:"none",label:$localize`System default ($value)`},{value:"information",label:$localize`Usage statistics, warnings, errors, and crashes`},{value:"warning",label:$localize`Warnings, errors and crashes`},{value:"error",label:$localize`Errors and crashes`},{value:"crash",label:$localize`Crashes only`},{value:"disabled",label:$localize`None / disabled`}],re=class s{#e=P(St);#n=P(Pt);#i=P(ft);#t=P(ne);#o=P(X);#s=P(ie);#_=P(Tt);#a=P(rt);#l=this.#a.getItem("locale")??"en-US";sysinfo=this.#i.systemInfo;isDarkMode=this.#n.isDarkMode;editAs=S("list");previousLang=this.#l;langCtrl=S(this.#l);powerModeCtrl=S("");usageStatistics=S("");updatingUsageStatistics=S(!1);remoteControlStatus=this.#s.status;remoteControlState=this.#s.state;updatingChannel=S(!1);updateChannel=S("");isUsingRelay=this.#_.relayIsEnabled;usageStatisticsDisabled=w(()=>(this.#i.systemInfo()?.DefaultUsageReportLevel??"").toLowerCase()==="disabled");#T=x(()=>{let t=this.#i.systemInfo()?.DefaultUsageReportLevel??"",e=yt;e[0].label=$localize`System default (${t})`,this.usageStatisticsOptions.set(e)});setNewChannel(t){let e=this.updateChannel();this.updateChannel.set(t),this.#t.patchApiV1Serversettings({requestBody:{"update-channel":t}}).pipe(R(()=>this.updatingChannel.set(!1)),b(()=>(this.updateChannel.set(e),F(null)))).subscribe()}allowRemoteAccess=S(!1);allowedHostnames=S("");loadedAllowedHostnames=S("");updatingRemoteAccess=S(!1);updatingAllowedHosts=S(!1);updatingConsoleControl=S(!1);consoleControlDisabled=S(!1);updateRemoteAccess(){let t=this.allowRemoteAccess(),e=!t;this.allowRemoteAccess.set(e),this.#t.patchApiV1Serversettings({requestBody:{"server-listen-interface":e?"any":"loopback"}}).pipe(R(()=>this.updatingRemoteAccess.set(!1)),b(()=>(this.allowRemoteAccess.set(t),F(null)))).subscribe()}updateAllowedHostnames(){let t=this.loadedAllowedHostnames(),e=this.allowedHostnames();this.updatingAllowedHosts.set(!0),this.#t.patchApiV1Serversettings({requestBody:{"server-listen-interface":"any","allowed-hostnames":e}}).pipe(R(()=>this.updatingAllowedHosts.set(!1)),b(()=>(this.allowedHostnames.set(t),F(null)))).subscribe()}toggleConsoleControl(){let t=this.consoleControlDisabled(),e=!t;this.updatingConsoleControl.set(!0),this.consoleControlDisabled.set(e),this.#t.patchApiV1Serversettings({requestBody:{"disable-console-control":e?"True":"False"}}).pipe(R(()=>this.updatingConsoleControl.set(!1)),b(()=>(this.consoleControlDisabled.set(t),F(null)))).subscribe()}updatingDisableTrayIconLogin=S(!1);disableTrayIconLogin=S(!1);saveDisableTrayIconLogin(){let t=this.disableTrayIconLogin(),e=!t;this.updatingDisableTrayIconLogin.set(!0),this.disableTrayIconLogin.set(e),this.#t.patchApiV1Serversettings({requestBody:{"disable-tray-icon-login":e?"True":"False"}}).pipe(R(()=>this.updatingDisableTrayIconLogin.set(!1)),b(()=>(this.disableTrayIconLogin.set(t),F(null)))).subscribe()}showPassphraseForm=S(!1);isUpdating=S(!1);passphrase=S("");repeatPassphrase=S("");passwordUpdated=S(!1);updatePassphrase(){this.passphrase()===this.repeatPassphrase()&&(this.isUpdating.set(!0),this.#t.patchApiV1Serversettings({requestBody:{"server-passphrase":this.passphrase()}}).pipe(R(()=>this.isUpdating.set(!1))).subscribe({next:()=>{this.showPassphraseForm.set(!1),this.passwordUpdated.set(!0),setTimeout(()=>{this.passwordUpdated.set(!1)},3e3)}}))}openPassphraseForm(){this.showPassphraseForm.set(!0)}cancelPasswordChange(){this.showPassphraseForm.set(!1)}languageOptions=S(ht);powerModeOptions=w(()=>{let t=this.#i.systemInfo();return!t?.PowerModeProviders||t.PowerModeProviders.filter(e=>e!==""&&e!=="None").length==0?[]:t.PowerModeProviders.map(e=>({value:e==""?"default":e,label:e===""?$localize`Default`:e}))});usageStatisticsOptions=S(yt);timeTypeOptions=S(dn);timeType=S("none");timeValue=Tn(0,300);timeRange=w(()=>this.timeType()==="h"?[0,24]:[0,60]);timeValueEffect=x(()=>{let t=this.timeValue(),e=this.#o.serverSettings();!e||e["startup-delay"]===""&&this.timeType()==="none"||this.updateStartupDelay()});updateLocale(t){!t||t===""||t===this.previousLang||(this.#a.setItem("locale",t),window.location.reload())}updateStartupDelay(){let t=this.timeValue(),e=this.timeType(),n="";e!=="none"&&t!==0&&(n=`${t}${e}`),this.#t.patchApiV1Serversettings({requestBody:{"startup-delay":n}}).subscribe()}updateTimeType(t){this.timeType()==="none"&&this.timeValue.set(0),this.timeType.set(t)}updateUsageStatistics(t){let e=this.usageStatistics();!t||t===""||t===e||(this.usageStatistics.set(t),this.updatingUsageStatistics.set(!0),this.#t.patchApiV1Serversettings({requestBody:{"usage-reporter-level":this.usageStatistics()==="none"?"":this.usageStatistics()}}).pipe(R(()=>this.updatingUsageStatistics.set(!1)),b(()=>(this.usageStatistics.set(e),F(null)))).subscribe())}updatePowerMode(t){let e=this.powerModeCtrl();e!==t&&(t==="default"&&(t=""),this.#t.patchApiV1Serversettings({requestBody:{"power-mode-provider":t||""}}).pipe(b(()=>(this.powerModeCtrl.set(e),F(null)))).subscribe())}serverSettingsEffect=x(()=>{let t=this.#o.serverSettings();if(t===void 0)return;let e=t["startup-delay"],n=e.slice(-1),a=e.slice(0,-1),T=["s","m","h"];this.disableTrayIconLogin.set(t["disable-tray-icon-login"]!=="False"),this.updateChannel.set(t["update-channel"]),this.allowRemoteAccess.set(t["server-listen-interface"]==="any"),this.allowedHostnames.set(t["allowed-hostnames"]),this.loadedAllowedHostnames.set(t["allowed-hostnames"]),this.consoleControlDisabled.set(t["disable-console-control"]==="True"),this.usageStatistics.set(t["usage-reporter-level"]===""?"none":t["usage-reporter-level"]),this.timeType.set(e==""?"none":T.includes(n)?n:"none"),this.timeValue.set(e==""?0:parseInt(a));let N=t["power-mode-provider"]===""||t["power-mode-provider"]==null?"default":t["power-mode-provider"];this.powerModeCtrl.set(N)});setDarkMode(){this.#n.setDarkMode()}setLightMode(){this.#n.setLightMode()}changeDefaultClientTo(t){this.#e.open(Mt,{data:{title:$localize`Use legacy UI`,message:$localize`Are you sure you want to use the legacy user interface, not recommended unless you have a specific reason?`,confirmText:$localize`Use legacy`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#r(t),window.location.replace(`/${t}`))}})}#r(t){var e=new Date;e.setTime(e.getTime()+2160*60*60*1e3),document.cookie="default-client="+t+"; expires="+e.toUTCString()+"; path=/"}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=D({type:s,selectors:[["app-settings"]],decls:123,vars:43,consts:()=>{let t;t=$localize`Settings`;let e;e=$localize`Configure your backup settings.`;let n;n=$localize`Color theme`;let a;a=$localize`Customize your application theme`;let T;T=$localize`Passwords`;let N;N=$localize`Change server passphrase`;let u;u=$localize`Language`;let O;O=$localize`Select a language for the platform`;let I;I=$localize`Use legacy interface`;let Te;Te=$localize`Use the old user interface, not recommended unless you have a specific reason.`;let de;de=$localize`${"\uFFFD#46\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#46\uFFFD"}:CLOSE_TAG_SH_ICON: Use legacy UI `;let Se;Se=$localize`Allow remote access (requires restart)`;let ce;ce=$localize` By allowing remote access, the server listens to requests from any machine on your network. If you enable this option, make sure you are always using the computer on a secure firewall protected network. `;let ge;ge=$localize`Allow remote access`;let Ce;Ce=$localize`Prevent tray icon automatic log-in`;let pe;pe=$localize` By default, the tray icon will open the user interface with a token that unlocks the user interface. This ensures that you can access the user interface from the tray icon, while requiring others to enter a password. If you prefer having to type in the password, even when accessing the user interface from the tray icon, enable this option. `;let Ee;Ee=$localize`Prevent tray icon automatic log-in`;let ue;ue=$localize`Update channel`;let Ne;Ne=$localize` Default (${"\uFFFD0\uFFFD"}:INTERPOLATION:) `;let me;me=$localize`Same as the base install version: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let fe;fe=$localize`Stable`;let Me;Me=$localize`Official stable release.`;let Pe;Pe=$localize`Beta`;let Oe;Oe=$localize` Try out the new features that we are working on. Test a backup and restore before using this in production environments. `;let he;he=$localize` Experimental `;let Ie;Ie=$localize`Early previews of new features. Not for use with important data.`;let Re;Re=$localize`Canary`;let Ge;Ge=$localize`Builds for developers and testers only. Not for use with important data.`;let ye;ye=$localize`Pause after startup or hibernation`;let $e;$e=$localize` Duplicati will run when started, but will remain in paused state for the duration. Duplicati will occupy minimal system resources and no backups will be run. `;let Ae;Ae=$localize`Advanced options`;let ve;ve=$localize`Connect to console`;let Le;Le=$localize`Disable console control`;let Fe;Fe=$localize` Disabling console control will disable remote access to this machine from the console, but will keep the registration intact and allow pushing settings from the console. `;let be;be=$localize`Remote control disabled`;let we;we=$localize`Remote control enabled`;let De;De=$localize`Enter new password`;let xe;xe=$localize`Repeat password`;let ae;ae=$localize`Password have to be filled and have to match`;let ke;ke=$localize`Passphrase`;let Je;Je=$localize`Repeat passphrase`;let Xe;Xe=$localize`Cancel`;let Ve;Ve=$localize` Update passphrase `;let ze;ze=$localize` Update passphrase `;let Ue;Ue=$localize`Change password`;let Be;Be=$localize`Allowed hostnames`;let He;He=$localize` To prevent various DNS based attacks, Duplicati limits the allowed hostnames to the ones listed here. Direct IP access and localhost is always allowed. Multiple hostnames can be supplied with a semicolon separator. If any of the allowed hostnames is an asterisk (*), all hostnames are allowed and this feature is disabled. If the field is empty, only IP address and localhost access is allowed. `;let We;We=$localize` Update allowed hostnames `;let qe;qe=$localize`Power mode provider`;let je;je=$localize` The power mode provider monitors the system for when it enters a low power state and pauses Duplicati. When the system resumes, Duplicati will resume as well. Choosing the None option disables detection of low power states and Duplicati will run all the time. `;let Ke;Ke=$localize`Installed version: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let Qe;Qe=$localize`Usage statistics`;let U;return U=$localize` Usage reports help us improve the user experience and evaluate impact of new features. We use them to generate ${"\uFFFD#6\uFFFD"}:START_LINK:public usage statistics.${"\uFFFD/#6\uFFFD"}:CLOSE_LINK:${"[\uFFFD#7\uFFFD\uFFFD/#7\uFFFD|\uFFFD#8\uFFFD\uFFFD/#8\uFFFD]"}:LINE_BREAK:${"[\uFFFD#7\uFFFD\uFFFD/#7\uFFFD|\uFFFD#8\uFFFD\uFFFD/#8\uFFFD]"}:LINE_BREAK: All usage reports are sent anonymously and do not contain any personal information. They contain information about hardware and operating system, the type of backend, backup duration, overall size of source data and similar data. They do not contain paths, filenames, usernames, passwords or similar sensitive information. `,U=W(U),[t,e,n,a,T,N,u,O,I,Te,de,Se,ce,ge,Ce,pe,Ee,ue,Ne,me,fe,Me,Pe,Oe,he,Ie,Re,Ge,ye,$e,Ae,ve,Le,Fe,be,we,ke,Je,Xe,Ve,ze,Ue,Be,He,We,qe,je,Ke,Qe,U,[1,"content"],[1,"title"],[1,"left"],[1,"right"],[1,"themes"],["src","assets/images/light-theme.png","alt","light theme",3,"click"],["src","assets/images/dark-theme.png","alt","dark theme",3,"click"],[1,"right","passphrase-form"],[1,"actions"],["value","value","label","label",3,"options","isClearable","inlineSearch"],["type","text",3,"ngModelChange","ngModel","ngModelOptions"],["shButton","",1,"primary",3,"click"],[1,"right","remote-access-form"],[1,"primary","raised",3,"click"],[1,"indeterminate","primary"],[1,"right","radios"],[1,"radio-option",3,"click"],[1,"primary","raised"],[1,"field-row"],[1,"raised","primary",3,"unit"],["type","range",3,"ngModelChange","min","max","disabled","ngModel","ngModelOptions"],["label","label","value","value",3,"options","isClearable"],["type","text",3,"ngModelChange","ngModel"],[1,"advanced-settings"],["for","password"],["type","password","name","password","autocomplete","disabled","placeholder",De,"tabindex","1",3,"ngModelChange","ngModel"],["for","repeatPassword"],["type","password","name","repeatPassword","autocomplete","disabled","placeholder",xe,"tabindex","2",3,"ngModelChange","disabled","ngModel"],["suffix","",1,"sh-success"],["suffix",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"loader"],["shButton","","shTooltip",ae,1,"raised","primary",3,"loader","disabled"],["shButton","",1,"raised","primary",3,"click"],["shButton","","shTooltip",ae,1,"raised","primary",3,"click","disabled"],[1,"sh-success"],["for","allowedHostnames"],["type","text","id","allowedHostnames",3,"ngModelChange","ngModel"],["type","primary"],["value","value","label","label",3,"options","isClearable"],["href","#"],["label","label","value","value",3,"options","isLoading"]]},template:function(e,n){if(e&1&&(h(0,"app-status-bar"),o(1,"div",50)(2,"header")(3,"div",51)(4,"h2"),l(5,0),i(),o(6,"p"),l(7,1),i()()(),g(8,qt,9,2),o(9,"section")(10,"div",52)(11,"h3"),l(12,2),i(),o(13,"p"),l(14,3),i()(),o(15,"div",53)(16,"div",54)(17,"img",55),c("click",function(){return n.setLightMode()}),i(),o(18,"img",56),c("click",function(){return n.setDarkMode()}),i()()()(),o(19,"section")(20,"div",52)(21,"h3"),l(22,4),i(),o(23,"p"),l(24,5),i()(),o(25,"div",57),g(26,Zt,15,7)(27,tn,4,1,"div",58),i()(),o(28,"section")(29,"div",52)(30,"h3"),l(31,6),i(),o(32,"p"),l(33,7),i()(),o(34,"div",53)(35,"sh-select",59)(36,"input",60),c("ngModelChange",function(T){return n.updateLocale(T)}),i()()()(),o(37,"section")(38,"div",52)(39,"h3"),l(40,8),i(),o(41,"p"),l(42,9),i()(),o(43,"div",53)(44,"button",61),c("click",function(){return n.changeDefaultClientTo("ngclient")}),G(45,10),h(46,"sh-icon"),y(),i()()(),o(47,"section")(48,"div",52)(49,"h3"),l(50,11),i(),o(51,"p"),l(52,12),i()(),o(53,"div",62)(54,"sh-toggle",63),c("click",function(){return n.updateRemoteAccess()}),o(55,"label"),l(56,13),i()(),g(57,nn,8,3),i()(),o(58,"section")(59,"div",52)(60,"h3"),l(61,14),i(),o(62,"p"),l(63,15),i()(),o(64,"div",53)(65,"sh-toggle",63),c("click",function(){return n.saveDisableTrayIconLogin()}),o(66,"label"),l(67,16),i()()()(),g(68,on,9,5,"section"),o(69,"section")(70,"div",52)(71,"h3"),l(72,17),i(),g(73,sn,2,1,"p"),g(74,an,1,0,"sh-progress-bar",64),i(),o(75,"div",65)(76,"div",66),c("click",function(){return n.setNewChannel("")}),o(77,"sh-radio",67),l(78,18),i(),o(79,"p"),l(80,19),i()(),o(81,"div",66),c("click",function(){return n.setNewChannel("stable")}),o(82,"sh-radio",67),l(83,20),i(),o(84,"p"),l(85,21),i()(),o(86,"div",66),c("click",function(){return n.setNewChannel("beta")}),o(87,"sh-radio",67),l(88,22),i(),o(89,"p"),l(90,23),i()(),o(91,"div",66),c("click",function(){return n.setNewChannel("experimental")}),o(92,"sh-radio",67),l(93,24),i(),o(94,"p"),l(95,25),i()(),o(96,"div",66),c("click",function(){return n.setNewChannel("canary")}),o(97,"sh-radio",67),l(98,26),i(),o(99,"p"),l(100,27),i()()()()(),h(101,"sh-divider"),o(102,"div",50)(103,"section")(104,"div",52)(105,"h3"),l(106,28),i(),o(107,"p"),l(108,29),i()(),o(109,"div",53)(110,"div",68)(111,"sh-range-slider",69)(112,"input",70),L("ngModelChange",function(T){return v(n.timeValue,T)||(n.timeValue=T),T}),i()(),o(113,"sh-select",71)(114,"input",72),c("ngModelChange",function(T){return n.updateTimeType(T)}),i(),le(115,ln,1,1,"ng-template"),i()()()(),g(116,rn,13,5,"section"),i(),o(117,"div",50)(118,"section")(119,"div",73)(120,"h3"),l(121,30),i(),h(122,"app-advanced-options-settings"),i()()()),e&2){let a,T,N;_(8),C(n.isUsingRelay()?-1:8),_(9),M("active",!n.isDarkMode()),_(),M("active",n.isDarkMode()),_(8),C(n.showPassphraseForm()?26:27),_(9),m("options",n.languageOptions())("isClearable",!1)("inlineSearch",!0),_(),m("ngModel",n.langCtrl())("ngModelOptions",V(41,se)),_(18),M("active",n.allowRemoteAccess()),_(3),C(n.allowRemoteAccess()?57:-1),_(8),M("active",n.disableTrayIconLogin()),_(3),C(n.powerModeOptions().length>0?68:-1),_(5),C((a=n.sysinfo())!=null&&a.ServerVersion?73:-1),_(),C(n.updatingChannel()?74:-1),_(3),M("active",n.updateChannel()===""),_(),B((T=n.sysinfo())==null?null:T.DefaultUpdateChannel),H(78),_(2),B((N=n.sysinfo())==null?null:N.ServerVersionType),H(80),_(2),M("active",n.updateChannel()==="stable"),_(5),M("active",n.updateChannel()==="beta"),_(5),M("active",n.updateChannel()==="experimental"),_(5),M("active",n.updateChannel()==="canary"),_(14),m("unit",n.timeType()==="none"?"s":n.timeType()),_(),m("min",n.timeRange()[0])("max",n.timeRange()[1])("disabled",n.timeType()==="none"),A("ngModel",n.timeValue),m("ngModelOptions",V(42,se)),_(),m("options",n.timeTypeOptions())("isClearable",!1),_(),m("ngModel",n.timeType()),_(2),C(n.usageStatisticsDisabled()?-1:116)}},dependencies:[Y,j,dt,K,Q,Z,Ot,oe,z,J,pt,Et,Ct,Nt,mt,te,k,gt,ee,ut],styles:["[_nghost-%COMP%]{display:block}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem 2rem}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem 0;background:var(--base-1);border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}section[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;padding:2rem 0;border-top:1px solid var(--base-4)}section[_ngcontent-%COMP%]:first-of-type{border-top:0}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;align-items:flex-start}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] sh-button-group[_ngcontent-%COMP%]{margin-top:.25rem}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;width:50%}.passphrase-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:1rem}.passphrase-form[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.remote-access-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.themes[_ngcontent-%COMP%]{display:flex;gap:.5rem}.themes[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:15rem;border-radius:var(--shape-3);cursor:pointer}.themes[_ngcontent-%COMP%] img.active[_ngcontent-%COMP%]{border:2px solid var(--primary-8)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.radio-option[_ngcontent-%COMP%]{cursor:pointer}.radio-option[_ngcontent-%COMP%] sh-radio[_ngcontent-%COMP%]{color:var(--base-8);margin-bottom:.25rem}.radio-option[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;color:var(--base-9)}.field-col[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{flex:1 0}.advanced-settings[_ngcontent-%COMP%]{grid-column:1/-1;display:grid;grid-template-columns:auto 1fr;gap:1rem}"],changeDetection:0})};export{Tn as debounceSignal,re as default};
package/index.html CHANGED
@@ -83,5 +83,5 @@
83
83
  <body>
84
84
  <app-root></app-root>
85
85
  <div class="loading">Connecting ...</div>
86
- <link rel="modulepreload" href="chunk-NOHHRZSK.js"><link rel="modulepreload" href="chunk-66KMXCBD.js"><link rel="modulepreload" href="chunk-PDBKO5D5.js"><link rel="modulepreload" href="chunk-DU5QSRYH.js"><link rel="modulepreload" href="chunk-D2DI6ZER.js"><link rel="modulepreload" href="chunk-M77IE672.js"><link rel="modulepreload" href="chunk-I5AKUAZF.js"><link rel="modulepreload" href="chunk-PJAWWLYW.js"><link rel="modulepreload" href="chunk-6Q6SSTBK.js"><link rel="modulepreload" href="chunk-RECKKS2S.js"><script src="polyfills-S663R3NQ.js" type="module"></script><script src="main-NUSQL6LE.js" type="module"></script></body>
86
+ <link rel="modulepreload" href="chunk-NOHHRZSK.js"><link rel="modulepreload" href="chunk-66KMXCBD.js"><link rel="modulepreload" href="chunk-PDBKO5D5.js"><link rel="modulepreload" href="chunk-DU5QSRYH.js"><link rel="modulepreload" href="chunk-D2DI6ZER.js"><link rel="modulepreload" href="chunk-M77IE672.js"><link rel="modulepreload" href="chunk-I5AKUAZF.js"><link rel="modulepreload" href="chunk-PJAWWLYW.js"><link rel="modulepreload" href="chunk-6Q6SSTBK.js"><link rel="modulepreload" href="chunk-RECKKS2S.js"><script src="polyfills-S663R3NQ.js" type="module"></script><script src="main-73PQI6UX.js" type="module"></script></body>
87
87
  </html>
@@ -1 +1 @@
1
- import{b as Re,c as Te}from"./chunk-NOHHRZSK.js";import{a as be}from"./chunk-66KMXCBD.js";import{a as Se}from"./chunk-PDBKO5D5.js";import{a as k}from"./chunk-DU5QSRYH.js";import{a as Ce}from"./chunk-D2DI6ZER.js";import{b as ve}from"./chunk-M77IE672.js";import"./chunk-I5AKUAZF.js";import"./chunk-PJAWWLYW.js";import{a as P}from"./chunk-6Q6SSTBK.js";import{a as ge}from"./chunk-RECKKS2S.js";import"./chunk-F2QQDU4N.js";import{a as L}from"./chunk-XE5OMGTJ.js";import"./chunk-T6C2OUI5.js";import{a as h,b as v,c as ye,d as I}from"./chunk-TJ3WIU6Q.js";import{c as fe}from"./chunk-KBGIIJMM.js";import{v as ue,x as he}from"./chunk-LFRGO2IP.js";import{c as ae,d as pe,g as ce,h as le,i as me,j as de}from"./chunk-LEZL7BSL.js";import{a as ee}from"./chunk-4MEL5WTX.js";import{a as te,b as oe,c as ne,e as re,f as se,g as ie}from"./chunk-5K64UNNB.js";import{la as Y,qa as Z}from"./chunk-6DB3NZXR.js";import"./chunk-FPPZ4BUR.js";import{A as x,B as G,Fb as z,H as w,Mc as q,N as B,Nc as X,P as R,R as J,Sc as Q,V as M,Y as _,_ as r,bb as K,f as W,i as j,ia as $,n as U,o as F,oa as d,r as S}from"./chunk-FAM42SZT.js";import"./chunk-EUDKD2JW.js";var E=class e{#o=r(h);#s=r(v);ngOnInit(){this.#s.fetchConfig(),this.#o.clearAllNotCurrentVersion()}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=K({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&z(0,"router-outlet")},dependencies:[ae],encapsulation:2})};var Me={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var f=new _("ENVIRONMENT");var A=class e{#o=r(fe);isLoaded=d(!1);webmodules=d(null);preload(t=!1){let o=this.#o.getApiV1Webmodules().pipe(J(n=>this.webmodules.set(n)),w(()=>this.isLoaded.set(!0)));if(t)return o;o.subscribe()}static \u0275fac=function(o){return new(o||e)};static \u0275prov=M({token:e,factory:e.\u0275fac,providedIn:"root"})};var Le=()=>{let e=r(I);return e.token()?!0:e.checkProxyAuthed().pipe(R(t=>t?U(!0):e.refreshToken().pipe(S(()=>!0))))},Pe=()=>{let e=r(v),t=r(k),o=r($),n=e.relayIsEnabled()?"longpoll":"websocket",i=[o.get(L).preload(!0),o.get(L).preloadFilterGroups(!0),o.get(A).preload(!0)];return e.configLoaded===null?x(i).pipe(S(()=>n)):e.configLoaded?.pipe(R(()=>x(i)))},Ve=()=>!0,Ie={path:"connect/:typeParam",loadComponent:()=>import("./chunk-HJ5IWG4Y.js")},De=()=>{let e=r(h);return!e.getItem("locale")&&navigator.language&&e.setItem("locale",navigator.language),!0},ke=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-NHRDYV7W.js")},{path:"logout",loadComponent:()=>import("./chunk-XTYBRFP6.js")},{path:"",canActivate:[Le],children:[{path:"",canActivate:[Pe,Ve,De],children:[{path:"welcome",loadComponent:()=>import("./chunk-XY6KVQXK.js"),children:[{path:"",redirectTo:"select",pathMatch:"full"},{path:"select",loadComponent:()=>import("./chunk-ABJWT6DQ.js")},Ie]},{path:"",loadComponent:()=>import("./chunk-33SCK3HX.js"),children:[{path:"",loadComponent:()=>import("./chunk-ZTCP7QD2.js")},Ie,{path:"add-backup",loadComponent:()=>import("./chunk-47AUYCMN.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-RNNVKT2R.js")},{path:"backup/import",loadComponent:()=>import("./chunk-X5FW56GT.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-AFUSUOJX.js"),loadChildren:()=>import("./chunk-AGFUNVOJ.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-AFUSUOJX.js"),loadChildren:()=>import("./chunk-AGFUNVOJ.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-4FD362Y4.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-4L4YRYBK.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-ES5NR2JV.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-PG2PHQWA.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-IZQG3EV6.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-FVVMRBPU.js")},{path:"from-config",loadComponent:()=>import("./chunk-CSY4BFC4.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-RKMVTPJD.js"),loadChildren:()=>import("./chunk-LEYS7OLH.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-RKMVTPJD.js"),loadChildren:()=>import("./chunk-LEYS7OLH.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-RKMVTPJD.js"),loadChildren:()=>import("./chunk-LEYS7OLH.js")},{path:"settings",loadComponent:()=>import("./chunk-3CHE2VBA.js")},{path:"about",loadComponent:()=>import("./chunk-646U6U3M.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-MP7JKTLP.js")},{path:"changelog",loadComponent:()=>import("./chunk-FCZXIW2B.js")},{path:"libraries",loadComponent:()=>import("./chunk-S5O366BO.js")},{path:"system-info",loadComponent:()=>import("./chunk-WEFZF25L.js")},{path:"server-settings",loadComponent:()=>import("./chunk-4PMLRVX5.js")},{path:"logs",loadChildren:()=>import("./chunk-TZP7VKPA.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-CCM2D4BF.js")}]}]}]}]}]}];var V=null,Ee=(e,t)=>{let o=r(I),n=r(pe),i=r(h),l=r(f),s=i.getItem("locale"),u=r(he),p=Re(s),a=e.url==="/api/v1/auth/login",m=e.url==="/api/v1/auth/refresh",C=e.url==="/api/v1/progressstate",y=e.url==="/api/v1/remoteoperation/test",b=e.url==="/api/v1/filesystem/validate",T=e.url.startsWith("/api/v2/"),O=o.token(),D=e,H=e.headers.has("custom-proxy-check")||O===ye;if(O&&e.url.startsWith(l.baseUrl)&&!H){let c=e.headers.set("Authorization",`Bearer ${O}`);s&&s!=="en-US"&&(c=c.set("X-Ui-Language",p)),D=e.clone({headers:c})}return t(D).pipe(S(c=>{if(c.type===4&&c.status===200&&T){let g=c.body;if(g?.Success===!1)throw{status:200,message:g?.Error??"Unknown error",error:{Error:g?.Error??"Unknown error"},requestBody:g}}return c}),G(c=>{let g=c.error?.Error||`Error Code: ${c.status}, Message: ${c.message}`;return!H&&(C&&c.status===404||y||b||u.error(g),m&&c.status===401&&(o.logout(),n.navigate(["/logout"])),!a&&!m&&c.status===401)?(V??=o.refreshToken().pipe(B()),V.pipe(R(()=>t(e.clone({headers:e.headers.set("Authorization",`Bearer ${o.token()}`)}))),w(()=>V=null))):F(()=>({error:c,message:g}))}))};var He="1.0.0",Ae=`portal-proxy-client-${P()}`,We=1,N=class e{#o=1e3;#s=r(f);#t=d("disconnected");#l=d(this.#o);#i=d(!1);#n=d(!1);#a=d(null);isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#t.asReadonly();#p=[];#r={};#e=null;#m=new TextDecoder("utf-8");#c=null;#d=Q(()=>{let t=this.#i(),o=this.#l(),n=this.#a();if(!n||!t||!o||o<this.#o){this.#c&&window.clearInterval(this.#c);return}this.#c=window.setInterval(()=>{this.connectToMachineServer(n)},o)});utf8Atob(t){let o=Uint8Array.from(atob(t),i=>i.charCodeAt(0)),n=this.#m.decode(o);return n?JSON.parse(n):null}connectToMachineServer(t,o){let n=o?.reconnect??!1,i=this.wsState();(i==="disconnected"||i==="error"||n)&&(this.#e?.close(),this.#e=null),!this.#e&&(this.#e=new WebSocket(this.#s.machineServerUrl),this.#t.set("connecting"),this.#e.onopen=()=>{this.#t.set("connect"),this.#n.set(!0),this.#i.set(!1),this.#a.set(null)},this.#e.onclose=()=>{this.#t.set("disconnected"),this.#n.set(!1),this.#a.set(t),this.#i.set(!0)},this.#e.onerror=()=>{this.#t.set("error")},this.#e.onmessage=l=>{let s=JSON.parse(l.data);if(this.wsState()==="connect"){if(s.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${s.type}'`);return}let p={token:t,publicKey:"",clientVersion:He,protocolVersion:We},a=this.createResponse(s,"authportal",p);this.#t.set("welcome"),this.#e?.send(a)}else if(this.wsState()==="welcome"){if(s.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${s.type}'`);return}var u=JSON.parse(s.payload??"");if(u.accepted===!1){this.disconnectFromMachineServer("Authentication failed");return}for(this.#t.set("authenticated"),this.#n.set(!0);this.#p.length>0;){let p=this.#p.pop();p&&this.#r[p.messageId]&&this.activateCommand(p)}}else if(this.wsState()==="authenticated"){if(s.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${s.type}'`);return}let p=this.#r[s.messageId];if(p){if(s.errorMessage){p.reject(s.errorMessage);return}else{let a=JSON.parse(s.payload??"");a.body=a?.body==null?null:this.utf8Atob(a.body),p.resolve(a)}delete this.#r[s.messageId],window.clearTimeout(p.timer)}}})}disconnectFromMachineServer(t=null){t&&console.error(t),this.#e?.close(),this.#e=null,this.#t.set("disconnected"),this.#n.set(!1)}createResponse(t,o,n){let i={from:Ae,to:t.from,type:o,messageId:t.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(t,o,n,i,l,s,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(t),new Promise((p,a)=>{let m=P(),y={from:Ae,to:o,type:"command",messageId:m,payload:JSON.stringify({method:n,path:i,body:l,headers:s})},b={resolve:p,reject:a,timer:window.setTimeout(()=>{let T=this.#r[m];T&&(delete this.#r[m],T.reject("Timeout"))},u)};this.#r[m]=b,this.#n()?this.activateCommand(y):this.#p.push(y)})}activateCommand(t){this.#e?.send(JSON.stringify(t))}static \u0275fac=function(o){return new(o||e)};static \u0275prov=M({token:e,factory:e.\u0275fac,providedIn:"root"})};function je(e){if(typeof e!="string")return null;let o=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...o))}function Ne(e,t,o){let n=e.relayconfigState.config();if(n===null)return o(t);let i=je(t.body),l={};t.headers.keys().forEach(a=>{l[a]=t.headers.get(a)??""});let s=t.headers.get("timeout"),u=s!==null?parseInt(s):e.defaultTimeout;t.url.startsWith("/api/v1/serverstate")&&t.url.includes("longpoll=true")&&(u=1e3*99);let p=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,t.method,t.url,i,l,u);return new W(a=>{p.then(m=>{let C=new te;l!=null&&Object.keys(l).forEach(b=>{C.set(b,l[b])});let y=new oe({body:m.body,status:m.code,statusText:"OK",headers:C});a.next(y),a.complete()}).catch(m=>{a.error(new ne({error:m??"Unknown error",status:0,statusText:m??"Unknown error"}))})})}var Oe=(e,t)=>{let o={relayconfigState:r(v),defaultTimeout:r(f).defaultTimeout,relayWebsocket:r(N)},n=o.relayconfigState.config();if(o.relayconfigState.configLoaded!==null&&n===null){let i=new j;return o.relayconfigState.configLoaded.subscribe(l=>{l&&Ne(o,e,t).subscribe(i)}),i}return Ne(o,e,t)};var xe={providers:[q(),le(ke,de(),me(ce)),re(ie(),se([Oe,Ee])),h,{provide:f,useValue:Me},{provide:X,useValue:Te()},{provide:ue,useValue:{alertVariant:"simple"}},be,k,ve,Z,ge,Y,Ce,Se]};ee(E,xe);
1
+ import{b as Re,c as Te}from"./chunk-NOHHRZSK.js";import{a as be}from"./chunk-66KMXCBD.js";import{a as Se}from"./chunk-PDBKO5D5.js";import{a as k}from"./chunk-DU5QSRYH.js";import{a as Ce}from"./chunk-D2DI6ZER.js";import{b as ve}from"./chunk-M77IE672.js";import"./chunk-I5AKUAZF.js";import"./chunk-PJAWWLYW.js";import{a as P}from"./chunk-6Q6SSTBK.js";import{a as ge}from"./chunk-RECKKS2S.js";import"./chunk-F2QQDU4N.js";import{a as L}from"./chunk-XE5OMGTJ.js";import"./chunk-T6C2OUI5.js";import{a as h,b as v,c as ye,d as I}from"./chunk-TJ3WIU6Q.js";import{c as fe}from"./chunk-KBGIIJMM.js";import{v as ue,x as he}from"./chunk-LFRGO2IP.js";import{c as ae,d as pe,g as ce,h as le,i as me,j as de}from"./chunk-LEZL7BSL.js";import{a as ee}from"./chunk-4MEL5WTX.js";import{a as te,b as oe,c as ne,e as re,f as se,g as ie}from"./chunk-5K64UNNB.js";import{la as Y,qa as Z}from"./chunk-6DB3NZXR.js";import"./chunk-FPPZ4BUR.js";import{A as x,B as G,Fb as z,H as w,Mc as q,N as B,Nc as X,P as R,R as J,Sc as Q,V as M,Y as _,_ as r,bb as K,f as W,i as j,ia as $,n as U,o as F,oa as d,r as S}from"./chunk-FAM42SZT.js";import"./chunk-EUDKD2JW.js";var E=class e{#o=r(h);#s=r(v);ngOnInit(){this.#s.fetchConfig(),this.#o.clearAllNotCurrentVersion()}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=K({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&z(0,"router-outlet")},dependencies:[ae],encapsulation:2})};var Me={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var f=new _("ENVIRONMENT");var A=class e{#o=r(fe);isLoaded=d(!1);webmodules=d(null);preload(t=!1){let o=this.#o.getApiV1Webmodules().pipe(J(n=>this.webmodules.set(n)),w(()=>this.isLoaded.set(!0)));if(t)return o;o.subscribe()}static \u0275fac=function(o){return new(o||e)};static \u0275prov=M({token:e,factory:e.\u0275fac,providedIn:"root"})};var Le=()=>{let e=r(I);return e.token()?!0:e.checkProxyAuthed().pipe(R(t=>t?U(!0):e.refreshToken().pipe(S(()=>!0))))},Pe=()=>{let e=r(v),t=r(k),o=r($),n=e.relayIsEnabled()?"longpoll":"websocket",i=[o.get(L).preload(!0),o.get(L).preloadFilterGroups(!0),o.get(A).preload(!0)];return e.configLoaded===null?x(i).pipe(S(()=>n)):e.configLoaded?.pipe(R(()=>x(i)))},Ve=()=>!0,Ie={path:"connect/:typeParam",loadComponent:()=>import("./chunk-HJ5IWG4Y.js")},De=()=>{let e=r(h);return!e.getItem("locale")&&navigator.language&&e.setItem("locale",navigator.language),!0},ke=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-NHRDYV7W.js")},{path:"logout",loadComponent:()=>import("./chunk-XTYBRFP6.js")},{path:"",canActivate:[Le],children:[{path:"",canActivate:[Pe,Ve,De],children:[{path:"welcome",loadComponent:()=>import("./chunk-XY6KVQXK.js"),children:[{path:"",redirectTo:"select",pathMatch:"full"},{path:"select",loadComponent:()=>import("./chunk-ABJWT6DQ.js")},Ie]},{path:"",loadComponent:()=>import("./chunk-5SNEZYDF.js"),children:[{path:"",loadComponent:()=>import("./chunk-ZTCP7QD2.js")},Ie,{path:"add-backup",loadComponent:()=>import("./chunk-47AUYCMN.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-RNNVKT2R.js")},{path:"backup/import",loadComponent:()=>import("./chunk-X5FW56GT.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-AFUSUOJX.js"),loadChildren:()=>import("./chunk-AGFUNVOJ.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-AFUSUOJX.js"),loadChildren:()=>import("./chunk-AGFUNVOJ.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-4FD362Y4.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-4L4YRYBK.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-ES5NR2JV.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-PG2PHQWA.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-IZQG3EV6.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-FVVMRBPU.js")},{path:"from-config",loadComponent:()=>import("./chunk-CSY4BFC4.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-RKMVTPJD.js"),loadChildren:()=>import("./chunk-LEYS7OLH.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-RKMVTPJD.js"),loadChildren:()=>import("./chunk-LEYS7OLH.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-RKMVTPJD.js"),loadChildren:()=>import("./chunk-LEYS7OLH.js")},{path:"settings",loadComponent:()=>import("./chunk-K2PFS33O.js")},{path:"about",loadComponent:()=>import("./chunk-646U6U3M.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-MP7JKTLP.js")},{path:"changelog",loadComponent:()=>import("./chunk-FCZXIW2B.js")},{path:"libraries",loadComponent:()=>import("./chunk-S5O366BO.js")},{path:"system-info",loadComponent:()=>import("./chunk-WEFZF25L.js")},{path:"server-settings",loadComponent:()=>import("./chunk-4PMLRVX5.js")},{path:"logs",loadChildren:()=>import("./chunk-TZP7VKPA.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-CCM2D4BF.js")}]}]}]}]}]}];var V=null,Ee=(e,t)=>{let o=r(I),n=r(pe),i=r(h),l=r(f),s=i.getItem("locale"),u=r(he),p=Re(s),a=e.url==="/api/v1/auth/login",m=e.url==="/api/v1/auth/refresh",C=e.url==="/api/v1/progressstate",y=e.url==="/api/v1/remoteoperation/test",b=e.url==="/api/v1/filesystem/validate",T=e.url.startsWith("/api/v2/"),O=o.token(),D=e,H=e.headers.has("custom-proxy-check")||O===ye;if(O&&e.url.startsWith(l.baseUrl)&&!H){let c=e.headers.set("Authorization",`Bearer ${O}`);s&&s!=="en-US"&&(c=c.set("X-Ui-Language",p)),D=e.clone({headers:c})}return t(D).pipe(S(c=>{if(c.type===4&&c.status===200&&T){let g=c.body;if(g?.Success===!1)throw{status:200,message:g?.Error??"Unknown error",error:{Error:g?.Error??"Unknown error"},requestBody:g}}return c}),G(c=>{let g=c.error?.Error||`Error Code: ${c.status}, Message: ${c.message}`;return!H&&(C&&c.status===404||y||b||u.error(g),m&&c.status===401&&(o.logout(),n.navigate(["/logout"])),!a&&!m&&c.status===401)?(V??=o.refreshToken().pipe(B()),V.pipe(R(()=>t(e.clone({headers:e.headers.set("Authorization",`Bearer ${o.token()}`)}))),w(()=>V=null))):F(()=>({error:c,message:g}))}))};var He="1.0.0",Ae=`portal-proxy-client-${P()}`,We=1,N=class e{#o=1e3;#s=r(f);#t=d("disconnected");#l=d(this.#o);#i=d(!1);#n=d(!1);#a=d(null);isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#t.asReadonly();#p=[];#r={};#e=null;#m=new TextDecoder("utf-8");#c=null;#d=Q(()=>{let t=this.#i(),o=this.#l(),n=this.#a();if(!n||!t||!o||o<this.#o){this.#c&&window.clearInterval(this.#c);return}this.#c=window.setInterval(()=>{this.connectToMachineServer(n)},o)});utf8Atob(t){let o=Uint8Array.from(atob(t),i=>i.charCodeAt(0)),n=this.#m.decode(o);return n?JSON.parse(n):null}connectToMachineServer(t,o){let n=o?.reconnect??!1,i=this.wsState();(i==="disconnected"||i==="error"||n)&&(this.#e?.close(),this.#e=null),!this.#e&&(this.#e=new WebSocket(this.#s.machineServerUrl),this.#t.set("connecting"),this.#e.onopen=()=>{this.#t.set("connect"),this.#n.set(!0),this.#i.set(!1),this.#a.set(null)},this.#e.onclose=()=>{this.#t.set("disconnected"),this.#n.set(!1),this.#a.set(t),this.#i.set(!0)},this.#e.onerror=()=>{this.#t.set("error")},this.#e.onmessage=l=>{let s=JSON.parse(l.data);if(this.wsState()==="connect"){if(s.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${s.type}'`);return}let p={token:t,publicKey:"",clientVersion:He,protocolVersion:We},a=this.createResponse(s,"authportal",p);this.#t.set("welcome"),this.#e?.send(a)}else if(this.wsState()==="welcome"){if(s.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${s.type}'`);return}var u=JSON.parse(s.payload??"");if(u.accepted===!1){this.disconnectFromMachineServer("Authentication failed");return}for(this.#t.set("authenticated"),this.#n.set(!0);this.#p.length>0;){let p=this.#p.pop();p&&this.#r[p.messageId]&&this.activateCommand(p)}}else if(this.wsState()==="authenticated"){if(s.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${s.type}'`);return}let p=this.#r[s.messageId];if(p){if(s.errorMessage){p.reject(s.errorMessage);return}else{let a=JSON.parse(s.payload??"");a.body=a?.body==null?null:this.utf8Atob(a.body),p.resolve(a)}delete this.#r[s.messageId],window.clearTimeout(p.timer)}}})}disconnectFromMachineServer(t=null){t&&console.error(t),this.#e?.close(),this.#e=null,this.#t.set("disconnected"),this.#n.set(!1)}createResponse(t,o,n){let i={from:Ae,to:t.from,type:o,messageId:t.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(t,o,n,i,l,s,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(t),new Promise((p,a)=>{let m=P(),y={from:Ae,to:o,type:"command",messageId:m,payload:JSON.stringify({method:n,path:i,body:l,headers:s})},b={resolve:p,reject:a,timer:window.setTimeout(()=>{let T=this.#r[m];T&&(delete this.#r[m],T.reject("Timeout"))},u)};this.#r[m]=b,this.#n()?this.activateCommand(y):this.#p.push(y)})}activateCommand(t){this.#e?.send(JSON.stringify(t))}static \u0275fac=function(o){return new(o||e)};static \u0275prov=M({token:e,factory:e.\u0275fac,providedIn:"root"})};function je(e){if(typeof e!="string")return null;let o=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...o))}function Ne(e,t,o){let n=e.relayconfigState.config();if(n===null)return o(t);let i=je(t.body),l={};t.headers.keys().forEach(a=>{l[a]=t.headers.get(a)??""});let s=t.headers.get("timeout"),u=s!==null?parseInt(s):e.defaultTimeout;t.url.startsWith("/api/v1/serverstate")&&t.url.includes("longpoll=true")&&(u=1e3*99);let p=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,t.method,t.url,i,l,u);return new W(a=>{p.then(m=>{let C=new te;l!=null&&Object.keys(l).forEach(b=>{C.set(b,l[b])});let y=new oe({body:m.body,status:m.code,statusText:"OK",headers:C});a.next(y),a.complete()}).catch(m=>{a.error(new ne({error:m??"Unknown error",status:0,statusText:m??"Unknown error"}))})})}var Oe=(e,t)=>{let o={relayconfigState:r(v),defaultTimeout:r(f).defaultTimeout,relayWebsocket:r(N)},n=o.relayconfigState.config();if(o.relayconfigState.configLoaded!==null&&n===null){let i=new j;return o.relayconfigState.configLoaded.subscribe(l=>{l&&Ne(o,e,t).subscribe(i)}),i}return Ne(o,e,t)};var xe={providers:[q(),le(ke,de(),me(ce)),re(ie(),se([Oe,Ee])),h,{provide:f,useValue:Me},{provide:X,useValue:Te()},{provide:ue,useValue:{alertVariant:"simple"}},be,k,ve,Z,ge,Y,Ce,Se]};ee(E,xe);
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.169",
2
+ "version": "0.0.171",
3
3
  "name": "@duplicati/ngclient",
4
4
  "license": "MIT",
5
5
  "contributors": [
package/chunk-3CHE2VBA.js DELETED
@@ -1 +0,0 @@
1
- import{a as ut}from"./chunk-MZMEFIHU.js";import{a as Nt}from"./chunk-XDECUOQ5.js";import{a as mt}from"./chunk-NOHHRZSK.js";import"./chunk-DU5QSRYH.js";import"./chunk-D2DI6ZER.js";import"./chunk-M77IE672.js";import"./chunk-I5AKUAZF.js";import"./chunk-PJAWWLYW.js";import"./chunk-6Q6SSTBK.js";import"./chunk-RECKKS2S.js";import{a as ie}from"./chunk-W4QCGFNO.js";import"./chunk-L4GZJLYK.js";import{a as X}from"./chunk-LJQN4G2O.js";import"./chunk-I2RHQQ3J.js";import"./chunk-F2QQDU4N.js";import{a as Et}from"./chunk-XE5OMGTJ.js";import"./chunk-T6C2OUI5.js";import{a as at,b as lt}from"./chunk-TJ3WIU6Q.js";import{b as ne}from"./chunk-KBGIIJMM.js";import{B as J,E as rt,G as dt,H as te,L as Tt,M as St,N as ct,P as gt,W as Ct,Y as pt,c as j,e as K,i as Q,m as _t,s as Y,t as Z,u as k,w as ee}from"./chunk-LFRGO2IP.js";import"./chunk-LEZL7BSL.js";import"./chunk-4MEL5WTX.js";import"./chunk-5K64UNNB.js";import"./chunk-6DB3NZXR.js";import"./chunk-FPPZ4BUR.js";import{$b as T,B as $,Bc as V,Cb as m,Db as s,Eb as o,Fb as I,H as R,Mb as f,Oa as Ye,Ra as l,Rc as w,Sc as x,Tb as F,Ub as b,Vb as _,Wb as B,Xb as H,Yb as W,Yc as st,Zb as c,_ as O,a as je,b as Ke,bb as D,c as Qe,da as p,ea as E,gb as le,gc as nt,hb as Ze,hc as it,kc as M,n as L,nc as G,oa as S,oc as q,pc as _e,rb as et,sb as tt,sc as y,tc as v,uc as A,wb as g,xb as C,yc as ot}from"./chunk-FAM42SZT.js";import"./chunk-EUDKD2JW.js";var ht=["formRef"],It=()=>[import("./chunk-7KUVROHU.js").then(i=>i.OptionsListComponent)];function Rt(i,t){i&1&&(s(0,"sh-alert",3),_(1,1),o())}function Gt(i,t){if(i&1){let e=f();s(0,"app-options-list",5),A("optionsChange",function(a){p(e);let d=T();return v(d.settings,a)||(d.settings=a),E(a)}),o()}if(i&2){let e=T();y("options",e.settings),m("hasFreeTextSettings",!0)}}var z=class i{#e=O(X);#n=O(ne);formRef=st.required("formRef");settings=S([]);isSubmitting=S(!1);isLoadingOptions=S(!0);saved=S(!1);lastRecievedServerSettings=S({});serverSettingsEffect=x(()=>{let t=this.#e.serverSettings();if(t===void 0)return;this.lastRecievedServerSettings.set(t),this.isLoadingOptions.set(!0);let e=Object.entries(t);e.forEach(([n,a],d)=>{if(n.startsWith("--")){let N=n.substring(2);this.settings.update(u=>(u.some(P=>P.Name===N)||u.push({Name:N,Value:a}),u))}d===e.length-1&&this.isLoadingOptions.set(!1)})});submit(){this.isSubmitting.set(!0);let t=this.settings(),e=this.lastRecievedServerSettings(),n=t.map(u=>u.Name),d=Object.keys(e).filter(u=>u.startsWith("--")).filter(u=>!n.includes(u.replace("--",""))),N=t.reduce((u,P)=>{let h=P.Name?.startsWith("--")?P.Name:`--${P.Name}`;return u[h]=P.Value,u},{});d.forEach(u=>{N[u]=null}),this.#n.patchApiV1Serversettings({requestBody:N}).pipe(R(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.#e.refreshServerSettings(),this.saved.set(!0),setTimeout(()=>{this.saved.set(!1)},3e3)}})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=D({type:i,selectors:[["app-advanced-options-settings"]],viewQuery:function(e,n){e&1&&nt(n.formRef,ht,5),e&2&&it()},decls:8,vars:4,consts:()=>{let t;t=$localize`${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:floppy-disk${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON: Save settings `;let e;return e=$localize`Settings saved`,[t,e,[1,"actions"],[1,"success"],["shButton","","type","button",1,"raised","primary",3,"click"],[3,"optionsChange","options","hasFreeTextSettings"]]},template:function(e,n){e&1&&(s(0,"div",2),g(1,Rt,2,0,"sh-alert",3),s(2,"button",4),c("click",function(){return n.submit()}),F(3,0),I(4,"sh-icon"),b(),o()(),Ze(5,Gt,1,2),et(6,5,It)),e&2&&(l(),C(n.saved()?1:-1),l(),M("loader",n.isSubmitting()),l(4),tt(!n.isLoadingOptions()))},dependencies:[Z,J,k,ee],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40.625rem;justify-self:flex-end}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:flex-end;margin-bottom:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.remote-volume-wrap[_ngcontent-%COMP%] p.warning[_ngcontent-%COMP%]{color:#7d7d00}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 2.5rem;align-items:flex-end}"],changeDetection:0})};function vt(i,t){if(i&1){let e=f();s(0,"sh-form-field",12)(1,"input",13),A("ngModelChange",function(a){p(e);let d=T(2);return v(d.registerUrl,a)||(d.registerUrl=a),E(a)}),o()(),s(2,"button",14),c("click",function(){p(e);let a=T(2);return E(a.register())}),_(3,0),o()}if(i&2){let e=T(2);l(),y("ngModel",e.registerUrl)}}function At(i,t){if(i&1&&(s(0,"div",9)(1,"label"),_(2,1),o(),s(3,"a",15),G(4),o()()),i&2){let e=T(2);l(3),m("href",ot(e.claimUrl()),Ye),l(),q(e.claimUrl())}}function Lt(i,t){i&1&&(s(0,"div",9)(1,"label"),_(2,2),o()())}function $t(i,t){if(i&1){let e=f();s(0,"button",14),c("click",function(){p(e);let a=T(2);return E(a.cancel())}),_(1,3),o()}}function Ft(i,t){if(i&1){let e=f();s(0,"button",14),c("click",function(){p(e);let a=T(2);return E(a.disable())}),_(1,4),o()}}function bt(i,t){if(i&1){let e=f();s(0,"button",14),c("click",function(){p(e);let a=T(2);return E(a.enable())}),_(1,5),o(),s(2,"button",16),c("click",function(){p(e);let a=T(2);return E(a.delete())}),_(3,6),o()}}function wt(i,t){i&1&&(F(0,7,1),I(1,"sh-icon"),b())}function Dt(i,t){i&1&&(F(0,7,2),I(1,"sh-icon"),b())}function xt(i,t){if(i&1){let e=f();s(0,"sh-chip",17),c("click",function(){p(e);let a=T(2);return E(a.copyReportingUrl())}),F(1,7),g(2,wt,2,0,"sh-icon")(3,Dt,2,0,"sh-icon"),b(),o()}if(i&2){let e=T(2);l(2),C(e.copiedReportingUrl()===!0?2:3)}}function kt(i,t){if(i&1&&(s(0,"div",8),g(1,vt,4,1),g(2,At,5,3,"div",9),g(3,Lt,3,0,"div",9),g(4,$t,2,0,"button",10),g(5,Ft,2,0,"button",10),g(6,bt,4,0),g(7,xt,4,1,"sh-chip",11),o()),i&2){let e=T();l(),C(e.state()==="inactive"?1:-1),l(),C(e.state()==="registered"?2:-1),l(),C(e.state()==="registering"?3:-1),l(),C(e.state()==="registering"||e.state()==="registeringfaulted"||e.state()==="registered"?4:-1),l(),C(e.state()==="connected"||e.state()==="connecting"?5:-1),l(),C(e.state()==="disabled"?6:-1),l(),C(e.additionalReportingUrl()!==""?7:-1)}}var oe=class i{#e=O(ie);#n=O(X);state=this.#e.state;claimUrl=this.#e.claimUrl;registerUrl=this.#e.registerUrl;additionalReportingUrl=w(()=>{let t=this.#n.serverSettings();return this.#e.state()==="inactive"?"":t&&t["additional-report-url"]||""});copiedReportingUrl=S(!1);ngOnInit(){this.#e.refreshRemoteControlStatus()}cancel(){this.#e.cancelRemoteRegistration()}register(){this.#e.beginRemoteRegistration()}disable(){this.#e.disableRemoteControl()}enable(){this.#e.enableRemoteControl()}delete(){this.#e.deleteRemoteControl()}copyReportingUrl(){let t=this.additionalReportingUrl();t&&(this.copiedReportingUrl.set(!0),setTimeout(()=>this.copiedReportingUrl.set(!1),2e3),navigator.clipboard.writeText(t))}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=D({type:i,selectors:[["app-remote-control"]],decls:1,vars:1,consts:()=>{let t;t=$localize`Register on console`;let e;e=$localize`Machine is now registered, open this link to add it to your account:`;let n;n=$localize`Registering, please wait...`;let a;a=$localize`Cancel registration`;let d;d=$localize`Disable console connection`;let N;N=$localize`Enable console connection`;let u;u=$localize` Delete console connection setup `;let P;return P=$localize` Reporting configured by server ${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,P=W(P),[t,e,n,a,d,N,u,P,[1,"field-row"],[1,"field-col"],["type","button","shButton","",1,"raised"],[1,"reporting-url","primary","simple"],["label","Registration URL","for","remoteControlRegisterUrl"],["type","text","sh-input","","id","remoteControlRegisterUrl","name","remoteControlRegisterUrl",3,"ngModelChange","ngModel"],["type","button","shButton","",1,"raised",3,"click"],["target","_blank",3,"href"],["type","button","shButton","",1,"raised","error",3,"click"],[1,"reporting-url","primary","simple",3,"click"]]},template:function(e,n){e&1&&g(0,kt,8,7,"div",8),e&2&&C(n.state()!=="unknown"?0:-1)},dependencies:[Y,j,K,Q,te,J,rt,k],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{flex:1 0}.reporting-url[_ngcontent-%COMP%]{cursor:pointer;-webkit-user-select:none;user-select:none;margin-top:.25rem}"],changeDetection:0})};function Pt(...i){let t=S(...i);return Object.defineProperty(t,"value",{get:t.asReadonly(),set:t.set.bind(t)})}var se=()=>({standalone:!0});function Jt(i,t){i&1&&(s(0,"label"),_(1,31),o())}function Xt(i,t){i&1&&(s(0,"label"),_(1,32),o())}function Vt(i,t){if(i&1){let e=f();s(0,"section")(1,"div",49)(2,"h3"),_(3,29),o(),s(4,"p"),_(5,30),o()(),s(6,"div",50)(7,"sh-toggle",59),c("click",function(){p(e);let a=T(2);return E(a.toggleConsoleControl())}),g(8,Jt,2,0,"label")(9,Xt,2,0,"label"),o()()()}if(i&2){let e=T(2);l(7),M("active",!e.consoleControlDisabled()),l(),C(e.consoleControlDisabled()?8:9)}}function zt(i,t){if(i&1&&(s(0,"section")(1,"div",49)(2,"h3"),_(3,28),o(),s(4,"p"),G(5),o()(),s(6,"div",50),I(7,"app-remote-control"),o()(),g(8,Vt,10,3,"section")),i&2){let e=T();l(5),q(e.remoteControlStatus()),l(3),C(e.remoteControlState()!="inactive"?8:-1)}}function Ut(i,t){i&1&&(s(0,"sh-icon",74),G(1,"check"),o())}function Bt(i,t){i&1&&(s(0,"sh-icon",75),G(1,"prohibit"),o())}function Ht(i,t){if(i&1){let e=f();s(0,"button",79),c("click",function(){p(e);let a=T(2);return E(a.updatePassphrase())}),_(1,36),o()}if(i&2){let e=T(2);M("loader",e.isUpdating())}}function Wt(i,t){if(i&1){let e=f();s(0,"button",80),c("click",function(){p(e);let a=T(2);return E(a.updatePassphrase())}),_(1,37),o()}if(i&2){let e=T(2);M("loader",e.isUpdating()),m("disabled",!0)}}function qt(i,t){if(i&1){let e=f();s(0,"sh-form-field")(1,"label",70),_(2,33),o(),s(3,"input",71),A("ngModelChange",function(a){p(e);let d=T();return v(d.passphrase,a)||(d.passphrase=a),E(a)}),o()(),s(4,"sh-form-field")(5,"label",72),_(6,34),o(),s(7,"input",73),A("ngModelChange",function(a){p(e);let d=T();return v(d.repeatPassphrase,a)||(d.repeatPassphrase=a),E(a)}),o(),g(8,Ut,2,0,"sh-icon",74)(9,Bt,2,0,"sh-icon",75),o(),s(10,"div",55)(11,"button",76),c("click",function(){p(e);let a=T();return E(a.cancelPasswordChange())}),_(12,35),o(),g(13,Ht,2,2,"button",77)(14,Wt,2,3,"button",78),o()}if(i&2){let e=T();l(3),y("ngModel",e.passphrase),l(4),m("disabled",e.passphrase().length===0),y("ngModel",e.repeatPassphrase),l(),C(e.passphrase().length!==0&&e.passphrase()===e.repeatPassphrase()?8:9),l(3),M("loader",e.isUpdating()),l(2),C(e.passphrase().length!==0&&e.passphrase()===e.repeatPassphrase()?13:14)}}function jt(i,t){i&1&&(s(0,"sh-icon",81),G(1,"check"),o())}function Kt(i,t){if(i&1){let e=f();s(0,"div",55)(1,"button",76),c("click",function(){p(e);let a=T();return E(a.openPassphraseForm())}),_(2,38),o(),g(3,jt,2,0,"sh-icon",81),o()}if(i&2){let e=T();l(3),C(e.passwordUpdated()?3:-1)}}function Qt(i,t){if(i&1){let e=f();s(0,"sh-form-field")(1,"label",82),_(2,39),o(),s(3,"textarea",83),A("ngModelChange",function(a){p(e);let d=T();return v(d.allowedHostnames,a)||(d.allowedHostnames=a),E(a)}),o()(),s(4,"sh-alert",84),_(5,40),o(),s(6,"button",79),c("click",function(){p(e);let a=T();return E(a.updateAllowedHostnames())}),_(7,41),o()}if(i&2){let e=T();l(3),y("ngModel",e.allowedHostnames),l(3),M("loader",e.updatingAllowedHosts())}}function Yt(i,t){if(i&1){let e=f();s(0,"section")(1,"div",49)(2,"h3"),_(3,42),o(),s(4,"p"),_(5,43),o()(),s(6,"div",50)(7,"sh-select",85)(8,"input",57),c("ngModelChange",function(a){p(e);let d=T();return E(d.updatePowerMode(a))}),o()()()()}if(i&2){let e=T();l(7),m("options",e.powerModeOptions())("isClearable",!1),l(),m("ngModel",e.powerModeCtrl())("ngModelOptions",V(4,se))}}function Zt(i,t){if(i&1&&(s(0,"p"),_(1,44),o()),i&2){let e,n=T();l(),B((e=n.sysinfo())==null?null:e.ServerVersionName),H(1)}}function en(i,t){i&1&&I(0,"sh-progress-bar",60)}function tn(i,t){if(i&1&&G(0),i&2){let e=t.$implicit;_e(" ",e.label," ")}}function nn(i,t){if(i&1&&G(0),i&2){let e=t.$implicit;_e(" ",e.label," ")}}function on(i,t){if(i&1){let e=f();s(0,"section")(1,"div",49)(2,"h3"),_(3,45),o(),s(4,"p"),F(5,46),I(6,"a",86)(7,"br")(8,"br"),b(),o()(),s(9,"div",50)(10,"sh-select",87)(11,"input",57),c("ngModelChange",function(a){p(e);let d=T();return E(d.updateUsageStatistics(a))}),o(),le(12,nn,1,1,"ng-template"),o()()()}if(i&2){let e=T();l(10),m("options",e.usageStatisticsOptions())("isLoading",e.updatingUsageStatistics()),l(),m("ngModel",e.usageStatistics())("ngModelOptions",V(4,se))}}function sn(i,t,e){let n=Pt(i),a=n[je];e?.equal&&(a.equal=e.equal);let d;return n.set=N=>{clearTimeout(d),d=setTimeout(()=>Ke(a,N),t)},n.update=N=>{clearTimeout(d),d=setTimeout(()=>Qe(a,N),t)},n}var an=[{value:"none",label:$localize`None`},{value:"s",label:$localize`Seconds`},{value:"m",label:$localize`Minutes`},{value:"h",label:$localize`Hours`}],Ot=[{value:"none",label:$localize`System default ($value)`},{value:"information",label:$localize`Usage statistics, warnings, errors, and crashes`},{value:"warning",label:$localize`Warnings, errors and crashes`},{value:"error",label:$localize`Errors and crashes`},{value:"crash",label:$localize`Crashes only`},{value:"disabled",label:$localize`None / disabled`}],re=class i{#e=O(ut);#n=O(Et);#t=O(ne);#i=O(X);#o=O(ie);#l=O(lt);#s=O(at);#a=this.#s.getItem("locale")??"en-US";sysinfo=this.#n.systemInfo;isDarkMode=this.#e.isDarkMode;editAs=S("list");previousLang=this.#a;langCtrl=S(this.#a);powerModeCtrl=S("");usageStatistics=S("");updatingUsageStatistics=S(!1);remoteControlStatus=this.#o.status;remoteControlState=this.#o.state;updatingChannel=S(!1);updateChannel=S("");isUsingRelay=this.#l.relayIsEnabled;usageStatisticsDisabled=w(()=>(this.#n.systemInfo()?.DefaultUsageReportLevel??"").toLowerCase()==="disabled");#_=x(()=>{let t=this.#n.systemInfo()?.DefaultUsageReportLevel??"",e=Ot;e[0].label=$localize`System default (${t})`,this.usageStatisticsOptions.set(e)});setNewChannel(t){let e=this.updateChannel();this.updateChannel.set(t),this.#t.patchApiV1Serversettings({requestBody:{"update-channel":t}}).pipe(R(()=>this.updatingChannel.set(!1)),$(()=>(this.updateChannel.set(e),L(null)))).subscribe()}allowRemoteAccess=S(!1);allowedHostnames=S("");loadedAllowedHostnames=S("");updatingRemoteAccess=S(!1);updatingAllowedHosts=S(!1);updatingConsoleControl=S(!1);consoleControlDisabled=S(!1);updateRemoteAccess(){let t=this.allowRemoteAccess(),e=!t;this.allowRemoteAccess.set(e),this.#t.patchApiV1Serversettings({requestBody:{"server-listen-interface":e?"any":"loopback"}}).pipe(R(()=>this.updatingRemoteAccess.set(!1)),$(()=>(this.allowRemoteAccess.set(t),L(null)))).subscribe()}updateAllowedHostnames(){let t=this.loadedAllowedHostnames(),e=this.allowedHostnames();this.updatingAllowedHosts.set(!0),this.#t.patchApiV1Serversettings({requestBody:{"server-listen-interface":"any","allowed-hostnames":e}}).pipe(R(()=>this.updatingAllowedHosts.set(!1)),$(()=>(this.allowedHostnames.set(t),L(null)))).subscribe()}toggleConsoleControl(){let t=this.consoleControlDisabled(),e=!t;this.updatingConsoleControl.set(!0),this.consoleControlDisabled.set(e),this.#t.patchApiV1Serversettings({requestBody:{"disable-console-control":e?"True":"False"}}).pipe(R(()=>this.updatingConsoleControl.set(!1)),$(()=>(this.consoleControlDisabled.set(t),L(null)))).subscribe()}updatingDisableTrayIconLogin=S(!1);disableTrayIconLogin=S(!1);saveDisableTrayIconLogin(){let t=this.disableTrayIconLogin(),e=!t;this.updatingDisableTrayIconLogin.set(!0),this.disableTrayIconLogin.set(e),this.#t.patchApiV1Serversettings({requestBody:{"disable-tray-icon-login":e?"True":"False"}}).pipe(R(()=>this.updatingDisableTrayIconLogin.set(!1)),$(()=>(this.disableTrayIconLogin.set(t),L(null)))).subscribe()}showPassphraseForm=S(!1);isUpdating=S(!1);passphrase=S("");repeatPassphrase=S("");passwordUpdated=S(!1);updatePassphrase(){this.passphrase()===this.repeatPassphrase()&&(this.isUpdating.set(!0),this.#t.patchApiV1Serversettings({requestBody:{"server-passphrase":this.passphrase()}}).pipe(R(()=>this.isUpdating.set(!1))).subscribe({next:()=>{this.showPassphraseForm.set(!1),this.passwordUpdated.set(!0),setTimeout(()=>{this.passwordUpdated.set(!1)},3e3)}}))}openPassphraseForm(){this.showPassphraseForm.set(!0)}cancelPasswordChange(){this.showPassphraseForm.set(!1)}languageOptions=S(mt);powerModeOptions=w(()=>{let t=this.#n.systemInfo();return!t?.PowerModeProviders||t.PowerModeProviders.filter(e=>e!==""&&e!=="None").length==0?[]:t.PowerModeProviders.map(e=>({value:e==""?"default":e,label:e===""?$localize`Default`:e}))});usageStatisticsOptions=S(Ot);timeTypeOptions=S(an);timeType=S("none");timeValue=sn(0,300);timeRange=w(()=>this.timeType()==="h"?[0,24]:[0,60]);timeValueEffect=x(()=>{let t=this.timeValue(),e=this.#i.serverSettings();!e||e["startup-delay"]===""&&this.timeType()==="none"||this.updateStartupDelay()});updateLocale(t){!t||t===""||t===this.previousLang||(this.#s.setItem("locale",t),window.location.reload())}updateStartupDelay(){let t=this.timeValue(),e=this.timeType(),n="";e!=="none"&&t!==0&&(n=`${t}${e}`),this.#t.patchApiV1Serversettings({requestBody:{"startup-delay":n}}).subscribe()}updateTimeType(t){this.timeType()==="none"&&this.timeValue.set(0),this.timeType.set(t)}updateUsageStatistics(t){let e=this.usageStatistics();!t||t===""||t===e||(this.usageStatistics.set(t),this.updatingUsageStatistics.set(!0),this.#t.patchApiV1Serversettings({requestBody:{"usage-reporter-level":this.usageStatistics()==="none"?"":this.usageStatistics()}}).pipe(R(()=>this.updatingUsageStatistics.set(!1)),$(()=>(this.usageStatistics.set(e),L(null)))).subscribe())}updatePowerMode(t){let e=this.powerModeCtrl();e!==t&&(t==="default"&&(t=""),this.#t.patchApiV1Serversettings({requestBody:{"power-mode-provider":t||""}}).pipe($(()=>(this.powerModeCtrl.set(e),L(null)))).subscribe())}serverSettingsEffect=x(()=>{let t=this.#i.serverSettings();if(t===void 0)return;let e=t["startup-delay"],n=e.slice(-1),a=e.slice(0,-1),d=["s","m","h"];this.disableTrayIconLogin.set(t["disable-tray-icon-login"]!=="False"),this.updateChannel.set(t["update-channel"]),this.allowRemoteAccess.set(t["server-listen-interface"]==="any"),this.allowedHostnames.set(t["allowed-hostnames"]),this.loadedAllowedHostnames.set(t["allowed-hostnames"]),this.consoleControlDisabled.set(t["disable-console-control"]==="True"),this.usageStatistics.set(t["usage-reporter-level"]===""?"none":t["usage-reporter-level"]),this.timeType.set(e==""?"none":d.includes(n)?n:"none"),this.timeValue.set(e==""?0:parseInt(a));let N=t["power-mode-provider"]===""||t["power-mode-provider"]==null?"default":t["power-mode-provider"];this.powerModeCtrl.set(N)});setDarkMode(){this.#e.setDarkMode()}setLightMode(){this.#e.setLightMode()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=D({type:i,selectors:[["app-settings"]],decls:113,vars:43,consts:()=>{let t;t=$localize`Settings`;let e;e=$localize`Configure your backup settings.`;let n;n=$localize`Color theme`;let a;a=$localize`Customize your application theme`;let d;d=$localize`Passwords`;let N;N=$localize`Change server passphrase`;let u;u=$localize`Language`;let P;P=$localize`Select a language for the platform`;let h;h=$localize`Allow remote access (requires restart)`;let de;de=$localize` By allowing remote access, the server listens to requests from any machine on your network. If you enable this option, make sure you are always using the computer on a secure firewall protected network. `;let Te;Te=$localize`Allow remote access`;let Se;Se=$localize`Prevent tray icon automatic log-in`;let ce;ce=$localize` By default, the tray icon will open the user interface with a token that unlocks the user interface. This ensures that you can access the user interface from the tray icon, while requiring others to enter a password. If you prefer having to type in the password, even when accessing the user interface from the tray icon, enable this option. `;let ge;ge=$localize`Prevent tray icon automatic log-in`;let Ce;Ce=$localize`Update channel`;let pe;pe=$localize` Default (${"\uFFFD0\uFFFD"}:INTERPOLATION:) `;let Ee;Ee=$localize`Same as the base install version: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let ue;ue=$localize`Stable`;let Ne;Ne=$localize`Official stable release.`;let me;me=$localize`Beta`;let fe;fe=$localize` Try out the new features that we are working on. Test a backup and restore before using this in production environments. `;let Me;Me=$localize` Experimental `;let Pe;Pe=$localize`Early previews of new features. Not for use with important data.`;let Oe;Oe=$localize`Canary`;let he;he=$localize`Builds for developers and testers only. Not for use with important data.`;let Ie;Ie=$localize`Pause after startup or hibernation`;let Re;Re=$localize` Duplicati will run when started, but will remain in paused state for the duration. Duplicati will occupy minimal system resources and no backups will be run. `;let Ge;Ge=$localize`Advanced options`;let ye;ye=$localize`Connect to console`;let ve;ve=$localize`Disable console control`;let Ae;Ae=$localize` Disabling console control will disable remote access to this machine from the console, but will keep the registration intact and allow pushing settings from the console. `;let Le;Le=$localize`Remote control disabled`;let $e;$e=$localize`Remote control enabled`;let Fe;Fe=$localize`Enter new password`;let be;be=$localize`Repeat password`;let ae;ae=$localize`Password have to be filled and have to match`;let we;we=$localize`Passphrase`;let De;De=$localize`Repeat passphrase`;let xe;xe=$localize`Cancel`;let ke;ke=$localize` Update passphrase `;let Je;Je=$localize` Update passphrase `;let Xe;Xe=$localize`Change password`;let Ve;Ve=$localize`Allowed hostnames`;let ze;ze=$localize` To prevent various DNS based attacks, Duplicati limits the allowed hostnames to the ones listed here. Direct IP access and localhost is always allowed. Multiple hostnames can be supplied with a semicolon separator. If any of the allowed hostnames is an asterisk (*), all hostnames are allowed and this feature is disabled. If the field is empty, only IP address and localhost access is allowed. `;let Ue;Ue=$localize` Update allowed hostnames `;let Be;Be=$localize`Power mode provider`;let He;He=$localize` The power mode provider monitors the system for when it enters a low power state and pauses Duplicati. When the system resumes, Duplicati will resume as well. Choosing the None option disables detection of low power states and Duplicati will run all the time. `;let We;We=$localize`Installed version: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let qe;qe=$localize`Usage statistics`;let U;return U=$localize` Usage reports help us improve the user experience and evaluate impact of new features. We use them to generate ${"\uFFFD#6\uFFFD"}:START_LINK:public usage statistics.${"\uFFFD/#6\uFFFD"}:CLOSE_LINK:${"[\uFFFD#7\uFFFD\uFFFD/#7\uFFFD|\uFFFD#8\uFFFD\uFFFD/#8\uFFFD]"}:LINE_BREAK:${"[\uFFFD#7\uFFFD\uFFFD/#7\uFFFD|\uFFFD#8\uFFFD\uFFFD/#8\uFFFD]"}:LINE_BREAK: All usage reports are sent anonymously and do not contain any personal information. They contain information about hardware and operating system, the type of backend, backup duration, overall size of source data and similar data. They do not contain paths, filenames, usernames, passwords or similar sensitive information. `,U=W(U),[t,e,n,a,d,N,u,P,h,de,Te,Se,ce,ge,Ce,pe,Ee,ue,Ne,me,fe,Me,Pe,Oe,he,Ie,Re,Ge,ye,ve,Ae,Le,$e,we,De,xe,ke,Je,Xe,Ve,ze,Ue,Be,He,We,qe,U,[1,"content"],[1,"title"],[1,"left"],[1,"right"],[1,"themes"],["src","assets/images/light-theme.png","alt","light theme",3,"click"],["src","assets/images/dark-theme.png","alt","dark theme",3,"click"],[1,"right","passphrase-form"],[1,"actions"],["value","value","label","label",3,"options","isClearable","inlineSearch"],["type","text",3,"ngModelChange","ngModel","ngModelOptions"],[1,"right","remote-access-form"],[1,"primary","raised",3,"click"],[1,"indeterminate","primary"],[1,"right","radios"],[1,"radio-option",3,"click"],[1,"primary","raised"],[1,"field-row"],[1,"raised","primary",3,"unit"],["type","range",3,"ngModelChange","min","max","disabled","ngModel","ngModelOptions"],["label","label","value","value",3,"options","isClearable"],["type","text",3,"ngModelChange","ngModel"],[1,"advanced-settings"],["for","password"],["type","password","name","password","autocomplete","disabled","placeholder",Fe,"tabindex","1",3,"ngModelChange","ngModel"],["for","repeatPassword"],["type","password","name","repeatPassword","autocomplete","disabled","placeholder",be,"tabindex","2",3,"ngModelChange","disabled","ngModel"],["suffix","",1,"sh-success"],["suffix",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"loader"],["shButton","","shTooltip",ae,1,"raised","primary",3,"loader","disabled"],["shButton","",1,"raised","primary",3,"click"],["shButton","","shTooltip",ae,1,"raised","primary",3,"click","disabled"],[1,"sh-success"],["for","allowedHostnames"],["type","text","id","allowedHostnames",3,"ngModelChange","ngModel"],["type","primary"],["value","value","label","label",3,"options","isClearable"],["href","#"],["label","label","value","value",3,"options","isLoading"]]},template:function(e,n){if(e&1&&(I(0,"app-status-bar"),s(1,"div",47)(2,"header")(3,"div",48)(4,"h2"),_(5,0),o(),s(6,"p"),_(7,1),o()()(),g(8,zt,9,2),s(9,"section")(10,"div",49)(11,"h3"),_(12,2),o(),s(13,"p"),_(14,3),o()(),s(15,"div",50)(16,"div",51)(17,"img",52),c("click",function(){return n.setLightMode()}),o(),s(18,"img",53),c("click",function(){return n.setDarkMode()}),o()()()(),s(19,"section")(20,"div",49)(21,"h3"),_(22,4),o(),s(23,"p"),_(24,5),o()(),s(25,"div",54),g(26,qt,15,7)(27,Kt,4,1,"div",55),o()(),s(28,"section")(29,"div",49)(30,"h3"),_(31,6),o(),s(32,"p"),_(33,7),o()(),s(34,"div",50)(35,"sh-select",56)(36,"input",57),c("ngModelChange",function(d){return n.updateLocale(d)}),o()()()(),s(37,"section")(38,"div",49)(39,"h3"),_(40,8),o(),s(41,"p"),_(42,9),o()(),s(43,"div",58)(44,"sh-toggle",59),c("click",function(){return n.updateRemoteAccess()}),s(45,"label"),_(46,10),o()(),g(47,Qt,8,3),o()(),s(48,"section")(49,"div",49)(50,"h3"),_(51,11),o(),s(52,"p"),_(53,12),o()(),s(54,"div",50)(55,"sh-toggle",59),c("click",function(){return n.saveDisableTrayIconLogin()}),s(56,"label"),_(57,13),o()()()(),g(58,Yt,9,5,"section"),s(59,"section")(60,"div",49)(61,"h3"),_(62,14),o(),g(63,Zt,2,1,"p"),g(64,en,1,0,"sh-progress-bar",60),o(),s(65,"div",61)(66,"div",62),c("click",function(){return n.setNewChannel("")}),s(67,"sh-radio",63),_(68,15),o(),s(69,"p"),_(70,16),o()(),s(71,"div",62),c("click",function(){return n.setNewChannel("stable")}),s(72,"sh-radio",63),_(73,17),o(),s(74,"p"),_(75,18),o()(),s(76,"div",62),c("click",function(){return n.setNewChannel("beta")}),s(77,"sh-radio",63),_(78,19),o(),s(79,"p"),_(80,20),o()(),s(81,"div",62),c("click",function(){return n.setNewChannel("experimental")}),s(82,"sh-radio",63),_(83,21),o(),s(84,"p"),_(85,22),o()(),s(86,"div",62),c("click",function(){return n.setNewChannel("canary")}),s(87,"sh-radio",63),_(88,23),o(),s(89,"p"),_(90,24),o()()()()(),I(91,"sh-divider"),s(92,"div",47)(93,"section")(94,"div",49)(95,"h3"),_(96,25),o(),s(97,"p"),_(98,26),o()(),s(99,"div",50)(100,"div",64)(101,"sh-range-slider",65)(102,"input",66),A("ngModelChange",function(d){return v(n.timeValue,d)||(n.timeValue=d),d}),o()(),s(103,"sh-select",67)(104,"input",68),c("ngModelChange",function(d){return n.updateTimeType(d)}),o(),le(105,tn,1,1,"ng-template"),o()()()(),g(106,on,13,5,"section"),o(),s(107,"div",47)(108,"section")(109,"div",69)(110,"h3"),_(111,27),o(),I(112,"app-advanced-options-settings"),o()()()),e&2){let a,d,N;l(8),C(n.isUsingRelay()?-1:8),l(9),M("active",!n.isDarkMode()),l(),M("active",n.isDarkMode()),l(8),C(n.showPassphraseForm()?26:27),l(9),m("options",n.languageOptions())("isClearable",!1)("inlineSearch",!0),l(),m("ngModel",n.langCtrl())("ngModelOptions",V(41,se)),l(8),M("active",n.allowRemoteAccess()),l(3),C(n.allowRemoteAccess()?47:-1),l(8),M("active",n.disableTrayIconLogin()),l(3),C(n.powerModeOptions().length>0?58:-1),l(5),C((a=n.sysinfo())!=null&&a.ServerVersion?63:-1),l(),C(n.updatingChannel()?64:-1),l(3),M("active",n.updateChannel()===""),l(),B((d=n.sysinfo())==null?null:d.DefaultUpdateChannel),H(68),l(2),B((N=n.sysinfo())==null?null:N.ServerVersionType),H(70),l(2),M("active",n.updateChannel()==="stable"),l(5),M("active",n.updateChannel()==="beta"),l(5),M("active",n.updateChannel()==="experimental"),l(5),M("active",n.updateChannel()==="canary"),l(14),m("unit",n.timeType()==="none"?"s":n.timeType()),l(),m("min",n.timeRange()[0])("max",n.timeRange()[1])("disabled",n.timeType()==="none"),y("ngModel",n.timeValue),m("ngModelOptions",V(42,se)),l(),m("options",n.timeTypeOptions())("isClearable",!1),l(),m("ngModel",n.timeType()),l(2),C(n.usageStatisticsDisabled()?-1:106)}},dependencies:[Y,j,_t,K,Q,Z,Nt,oe,z,J,St,ct,Tt,Ct,pt,te,k,dt,ee,gt],styles:["[_nghost-%COMP%]{display:block}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem 2rem}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem 0;background:var(--base-1);border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}section[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;padding:2rem 0;border-top:1px solid var(--base-4)}section[_ngcontent-%COMP%]:first-of-type{border-top:0}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;align-items:flex-start}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] sh-button-group[_ngcontent-%COMP%]{margin-top:.25rem}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;width:50%}.passphrase-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:1rem}.passphrase-form[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.remote-access-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.themes[_ngcontent-%COMP%]{display:flex;gap:.5rem}.themes[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:15rem;border-radius:var(--shape-3);cursor:pointer}.themes[_ngcontent-%COMP%] img.active[_ngcontent-%COMP%]{border:2px solid var(--primary-8)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.radio-option[_ngcontent-%COMP%]{cursor:pointer}.radio-option[_ngcontent-%COMP%] sh-radio[_ngcontent-%COMP%]{color:var(--base-8);margin-bottom:.25rem}.radio-option[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;color:var(--base-9)}.field-col[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{flex:1 0}.advanced-settings[_ngcontent-%COMP%]{grid-column:1/-1;display:grid;grid-template-columns:auto 1fr;gap:1rem}"],changeDetection:0})};export{sn as debounceSignal,re as default};