@duplicati/ngclient 0.0.119 → 0.0.120

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.
@@ -0,0 +1 @@
1
+ import{a as Le,b as Re}from"./chunk-YYC22I2K.js";import{a as $e}from"./chunk-TJJORMQV.js";import{a as x}from"./chunk-HTX2RSBS.js";import"./chunk-OHZGASM5.js";import"./chunk-65UN5LE6.js";import{a as fe}from"./chunk-WFM6YWRN.js";import"./chunk-3AIKVVWP.js";import"./chunk-RHW5QVAY.js";import"./chunk-RSZISHXB.js";import{a as Ie}from"./chunk-X6PSFVBL.js";import{c as Pe,d as Oe,e as he,h as De,r as ke,s as Ne,t as Me}from"./chunk-5ENRUF35.js";import{a as de,c as Ee}from"./chunk-ZQSBINUM.js";import"./chunk-3XVU2YA6.js";import{c as ce,e as pe,f as ue}from"./chunk-5LKXKKAK.js";import"./chunk-HFNFJ7G2.js";import{C as Te,a as M,b as G,c as Se,e as ge,g as w,k as Fe,l as Ae,n as me,u as Ce}from"./chunk-AL5KGNEF.js";import{h as H}from"./chunk-FRSQ5NDX.js";import"./chunk-M3WT5B3C.js";import{$a as ee,Ab as te,Bb as ne,Cb as oe,Db as s,Eb as i,F as X,Fb as l,Jb as f,Pb as p,Pc as _e,Qb as u,Qc as Q,Rb as O,Ua as r,Ub as $,Vb as S,Wb as c,Z as F,bb as V,ea as A,fa as m,gb as N,gc as ie,hc as se,jc as g,kc as K,lb as C,lc as z,oc as W,pc as q,qc as j,ra as Z,rc as ae,sc as re,tc as b,ub as h,va as E,vc as le,wb as v,yb as R,zb as d}from"./chunk-AHUC7M75.js";import{a as Y,b as B}from"./chunk-7CGTOI24.js";var Ge=["scroller"];function we(n,o){n&1&&(s(0,"spk-icon"),g(1,"bell-ringing"),i())}function He(n,o){n&1&&(s(0,"spk-icon"),g(1,"bell"),i())}function xe(n,o){if(n&1&&l(0,"app-notification",8),n&2){c(2);let e=b(6);h("index",0)("notification",e.content)}}function Ue(n,o){if(n&1&&(s(0,"div",11),g(1),i()),n&2){c(3);let e=b(6);r(),z(" ",e.content.content," ")}}function Ye(n,o){if(n&1&&(s(0,"spk-alert")(1,"div",10),g(2),i(),C(3,Ue,2,1,"div",11),i()),n&2){c(2);let e=b(6);R(e.content.type||"error"),r(2),K(e.content.title),r(),d(e.content.content?3:-1)}}function Be(n,o){if(n&1&&(s(0,"div",6),C(1,xe,1,2,"app-notification",8)(2,Ye,4,4,"spk-alert",9),i()),n&2){c();let e=b(6);r(),d(e.type==="notification"?1:2)}}function Xe(n,o){if(n&1){let e=f();s(0,"div",7)(1,"div",12)(2,"h6",13),p(3,2),s(4,"button",5),S("click",function(){A(e);let a=c();return m(a.toggleNotifications())}),l(5,"spk-icon"),i(),u(),i(),s(6,"div",14,0)(8,"div",15),l(9,"app-notifications"),i()()()()}}function Ve(n,o){if(n&1&&(s(0,"div",19),g(1),i()),n&2){let e=c().$implicit;r(),z(" ",e.content," ")}}function Ke(n,o){if(n&1){let e=f();s(0,"spk-alert",17,1),S("click",function(){let a=A(e).$implicit,_=c(2);return m(_.deleteAlertByIndex(a.id))}),s(2,"div",18),g(3),i(),C(4,Ve,2,1,"div",19),i()}if(n&2){let e=o.$implicit;R(e.type),h("id",e.id),r(3),K(e.title),r(),d(e.content?4:-1)}}function ze(n,o){n&1&&(s(0,"p"),O(1,4),i())}function We(n,o){if(n&1){let e=f();s(0,"div",7)(1,"div",12)(2,"h6",13),p(3,3),s(4,"button",5),S("click",function(){A(e);let a=c();return m(a.toggleAlerts())}),l(5,"spk-icon"),i(),u(),i(),s(6,"div",14,0)(8,"div",15),ne(9,Ke,5,5,"spk-alert",16,te,!1,ze,2,0,"p"),i()()()()}if(n&2){let e=c();r(9),oe(e.alertHistory())}}var be=new ke,y=class n{#e=F(Se);#t=F(x);isSubmitting=E(!1);messageSent=E(!1);form=be.group({message:be.control("",[Oe.required])});notifications=this.#t.notifications;shownMessage=E(null);shownMessageInterval=null;alertHistory=this.#e.alertHistory;alertHistoryIsOpen=this.#e.alertHistoryIsOpen;alertHistoryIsHidden=this.#e.alertHistoryIsHidden;numberOfOpenAlerts=_e(()=>this.alertHistory().filter(o=>o.isOpen).length);scroller=ee("scroller");isAlertsOpen=V(!1);isNotificationsOpen=V(!1);previousHistoryCount=E(null);previousNotificationsCount=E(null);constructor(){Q(()=>{let o=this.alertHistory(),e=this.notifications();e.length&&this.previousHistoryCount()!==o.length&&!this.isNotificationsOpen()?(this.shownMessage.set({content:e[0],countDown:3,type:"notification"}),this.previousHistoryCount.set(o.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(a=>B(Y({},a),{countDown:a.countDown-1}))},1e3)):o.length&&this.previousHistoryCount()!==o.length&&!this.isAlertsOpen()&&(this.shownMessage.set({content:o[0],countDown:3,type:"alert"}),this.previousHistoryCount.set(o.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(a=>B(Y({},a),{countDown:a.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(o){this.#e.removeAlert(o)}scrollToBottom(){this.scroller()&&this.scroller()?.nativeElement&&this.scroller().nativeElement.scrollTo(0,this.scroller().nativeElement.scrollHeight)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=N({type:n,selectors:[["app-service-hub"]],viewQuery:function(e,t){e&1&&ie(t.scroller,Ge,5),e&2&&se()},inputs:{isAlertsOpen:[1,"isAlertsOpen"],isNotificationsOpen:[1,"isNotificationsOpen"]},outputs:{isAlertsOpen:"isAlertsOpenChange",isNotificationsOpen:"isNotificationsOpenChange"},decls:10,vars:9,consts:()=>{let o;o=$localize` Notifications ${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"\uFFFD#5\uFFFD"}:START_TAG_SPK_ICON:x-circle${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_BUTTON:`;let e;e=$localize` Alerts ${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"\uFFFD#5\uFFFD"}:START_TAG_SPK_ICON:x-circle${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_BUTTON:`;let t;return t=$localize`No alerts yet`,[["scroller",""],["alerts",""],o,e,t,["spk-button","",3,"click"],[1,"preview-alert-wrap"],[1,"alert-stream-modal"],[3,"index","notification"],[3,"class"],["sparkle-alert-title",""],["sparkle-alert-content",""],[1,"alert-stream-modal-content"],[1,"paragraph-20"],[1,"alert-stream-modal-list-scroller"],[1,"alert-stream-modal-list"],[3,"class","id"],[3,"click","id"],["title",""],["content",""]]},template:function(e,t){if(e&1){let a=f();s(0,"button",5),S("click",function(){return A(a),m(t.toggleAlerts())}),s(1,"spk-icon"),g(2,"info"),i()(),s(3,"button",5),S("click",function(){return A(a),m(t.toggleNotifications())}),C(4,we,2,0,"spk-icon")(5,He,2,0,"spk-icon"),i(),ae(6),C(7,Be,3,1,"div",6)(8,Xe,10,0,"div",7)(9,We,12,1,"div",7)}if(e&2){R(t.alertHistory().length?"error":""),r(3),R(t.notifications().length?"error":""),r(),d(t.notifications().length?4:5),r(2);let a=re(t.shownMessage());r(),d(a?7:-1),r(),d(t.isNotificationsOpen()?8:-1),r(),d(t.isAlertsOpen()?9:-1)}},dependencies:[Me,G,M,w,Re,Le],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:250px}.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}"],changeDetection:0})};function qe(n,o){n&1&&(s(0,"spk-icon",14),g(1,"check"),i())}function je(n,o){n&1&&(s(0,"spk-icon",15),g(1,"prohibit"),i())}function Qe(n,o){if(n&1){let e=f();s(0,"button",20),S("click",function(){A(e);let a=c();return m(a.updatePassphrase())}),O(1,5),i()}if(n&2){let e=c();v("loader",e.isUpdating())}}function Je(n,o){if(n&1){let e=f();s(0,"button",21),S("click",function(){A(e);let a=c();return m(a.updatePassphrase())}),O(1,6),i()}if(n&2){let e=c();v("loader",e.isUpdating()),h("disabled",!0)}}var U=class n{#e=F(H);closed=Z();isUpdating=E(!1);passphrase=E("");repeatPassphrase=E("");updatePassphrase(){this.passphrase()===this.repeatPassphrase()&&(this.isUpdating.set(!0),this.#e.patchApiV1Serversettings({requestBody:{"server-passphrase":this.passphrase()}}).pipe(X(()=>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(X(()=>this.isUpdating.set(!1))).subscribe({next:()=>this.closed.emit()})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=N({type:n,selectors:[["app-change-passphrase-alert-dialog"]],outputs:{closed:"closed"},decls:23,vars:7,consts:()=>{let o;o=$localize`Enter new password`;let e;e=$localize`Repeat password`;let t;t=$localize`Password have to be filled and have to match`;let a;a=$localize`Change passphrase`;let _;_=$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? `,_=$(_);let D;D=$localize`Passphrase`;let k;k=$localize`Repeat passphrase`;let I;I=$localize`Not now thanks`;let L;L=$localize` Yes, update passphrase now `;let T;return T=$localize` Yes, update passphrase now `,[a,_,D,k,I,L,T,["header",""],["content",""],["type","warning"],["for","password"],["type","password","name","password","autocomplete","disabled","placeholder",o,"tabindex","1",3,"ngModelChange","ngModel"],["for","repeatPassword"],["type","password","name","repeatPassword","autocomplete","disabled","placeholder",e,"tabindex","2",3,"ngModelChange","disabled","ngModel"],["suffix","",1,"spk-success"],["suffix",""],["footer",""],["spk-button","",3,"click"],["spk-button","",1,"raised","primary",3,"loader"],["spk-button","","spkTooltip",t,1,"raised","primary",3,"loader","disabled"],["spk-button","",1,"raised","primary",3,"click"],["spk-button","","spkTooltip",t,1,"raised","primary",3,"click","disabled"]]},template:function(e,t){e&1&&(s(0,"header",7)(1,"h3"),O(2,0),i()(),s(3,"div",8)(4,"spk-alert",9),p(5,1),l(6,"br")(7,"br"),u(),i(),s(8,"spk-form-field")(9,"label",10),O(10,2),i(),s(11,"input",11),j("ngModelChange",function(_){return q(t.passphrase,_)||(t.passphrase=_),_}),i()(),s(12,"spk-form-field")(13,"label",12),O(14,3),i(),s(15,"input",13),j("ngModelChange",function(_){return q(t.repeatPassphrase,_)||(t.repeatPassphrase=_),_}),i(),C(16,qe,2,0,"spk-icon",14)(17,je,2,0,"spk-icon",15),i()(),s(18,"footer",16)(19,"button",17),S("click",function(){return t.cancel()}),O(20,4),i(),C(21,Qe,2,2,"button",18)(22,Je,2,3,"button",19),i()),e&2&&(r(11),W("ngModel",t.passphrase),r(4),h("disabled",t.passphrase().length===0),W("ngModel",t.repeatPassphrase),r(),d(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?16:17),r(3),v("loader",t.isUpdating()),r(2),d(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?21:22))},dependencies:[Ne,Pe,he,De,G,Ae,M,Te],styles:["[_nghost-%COMP%]{display:block;--dialog-p: 1.5rem}[content][_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}"],changeDetection:0})};var Ze=()=>({exact:!0});function et(n,o){n&1&&(s(0,"spk-icon"),g(1,"sun"),i())}function tt(n,o){n&1&&(s(0,"spk-icon"),g(1,"moon"),i())}function nt(n,o){if(n&1){let e=f();s(0,"button",22),S("click",function(){A(e);let a=c();return m(a.changeDefaultClientTo("ngax"))}),p(1,7),l(2,"spk-icon"),u(),i(),s(3,"button",22),S("click",function(){A(e);let a=c();return m(a.logout())}),p(4,8),l(5,"spk-icon"),u(),i()}}var J=class n{#e=F($e);#t=F(H);#n=F(fe);#o=F(de);#i=F(ge);#s=F(x);#a=F(Ee);relayIsEnabled=this.#o.relayIsEnabled;isDarkMode=this.#e.isDarkMode;ngOnInit(){return this.#s.init(),this.#n.getBackups(!0),this.#t.getApiV1Serversettings().subscribe({next:o=>{let e=o["autogenerated-passphrase"]==="True",t=o["has-asked-for-password-change"]==="True";e&&!t&&this.#i.open(U,{maxWidth:"500px"})}})}toggleBodyClass(){this.#e.toggleBodyClass()}changeDefaultClientTo(o){this.#r(o),window.location.replace(`/${o}`)}logout(){this.#a.logout()}#r(o){var e=new Date;e.setTime(e.getTime()+90*24*60*60*1e3),document.cookie="default-client="+o+"; expires="+e.toUTCString()+"; path=/"}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=N({type:n,selectors:[["app-layout"]],decls:37,vars:4,consts:()=>{let o;o=$localize`${"\uFFFD#10\uFFFD"}:START_TAG_SPK_ICON:house${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_SPK_ICON: Home `;let e;e=$localize`${"\uFFFD#13\uFFFD"}:START_TAG_SPK_ICON:database${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SPK_ICON: Add backup `;let t;t=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SPK_ICON:clock-counter-clockwise${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SPK_ICON: Restore `;let a;a=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SPK_ICON:gear${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SPK_ICON: Settings `;let _;_=$localize`${"\uFFFD#26\uFFFD"}:START_TAG_SPK_ICON:info${"\uFFFD/#26\uFFFD"}:CLOSE_TAG_SPK_ICON: About Duplicati `;let D;D=$localize`${"\uFFFD#29\uFFFD"}:START_TAG_SPK_ICON:files${"[\uFFFD/#29\uFFFD|\uFFFD/#30\uFFFD]"}:CLOSE_TAG_SPK_ICON: Documentation ${"\uFFFD#30\uFFFD"}:START_TAG_SPK_ICON_1:arrow-square-out${"[\uFFFD/#29\uFFFD|\uFFFD/#30\uFFFD]"}:CLOSE_TAG_SPK_ICON:`,D=$(D);let k;k=$localize`${"\uFFFD#33\uFFFD"}:START_TAG_SPK_ICON:chats-circle${"[\uFFFD/#33\uFFFD|\uFFFD/#34\uFFFD]"}:CLOSE_TAG_SPK_ICON: Visit forum ${"\uFFFD#34\uFFFD"}:START_TAG_SPK_ICON_1:arrow-square-out${"[\uFFFD/#33\uFFFD|\uFFFD/#34\uFFFD]"}:CLOSE_TAG_SPK_ICON:`,k=$(k);let I;I=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:skip-back${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: Revert to NGAX client `;let L;return L=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_ICON:sign-out${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_ICON: Log out `,[o,e,t,a,_,D,k,I,L,["sidenav",""],["spk-button","",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","","routerLink","/about","routerLinkActive","active"],["href","https://docs.duplicati.com","target","_blank","action",""],["suffix",""],["href","https://forum.duplicati.com","target","_blank","action",""],["action","",3,"click"]]},template:function(e,t){e&1&&(s(0,"spk-sidenav")(1,"div",9)(2,"header"),l(3,"app-logo"),s(4,"button",10),S("click",function(){return t.toggleBodyClass()}),C(5,et,2,0,"spk-icon")(6,tt,2,0,"spk-icon"),i()(),s(7,"spk-list",11)(8,"button",12),p(9,0),l(10,"spk-icon"),u(),i(),s(11,"button",13),p(12,1),l(13,"spk-icon"),u(),i(),s(14,"button",14),p(15,2),l(16,"spk-icon"),u(),i(),s(17,"button",15),p(18,3),l(19,"spk-icon"),u(),i()(),l(20,"div",16),s(21,"spk-list",17),C(22,nt,6,0),l(23,"spk-divider"),s(24,"button",18),p(25,4),l(26,"spk-icon"),u(),i(),s(27,"a",19),p(28,5),l(29,"spk-icon")(30,"spk-icon",20),u(),i(),s(31,"a",21),p(32,6),l(33,"spk-icon")(34,"spk-icon",20),u(),i()()(),l(35,"router-outlet")(36,"app-service-hub"),i()),e&2&&(r(5),d(t.isDarkMode()?5:6),r(3),h("routerLinkActiveOptions",le(3,Ze)),r(14),d(t.relayIsEnabled()?-1:22))},dependencies:[ce,pe,ue,Ce,M,me,w,Fe,y,Ie],styles:["[_nghost-%COMP%]{height:100vh;width:100%;overflow:hidden}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:20px;gap:12px}h3[title][_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}div[sidenav][_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100vh}"],changeDetection:0})};export{J as default};
@@ -1,3 +1,3 @@
1
- import{a as Ee}from"./chunk-4LLC3Q7O.js";import{a as fe}from"./chunk-B3WLZK7W.js";import{l as P}from"./chunk-RXHYUPYG.js";import"./chunk-KHGD372Q.js";import"./chunk-LDJVMU7P.js";import{a as Se}from"./chunk-LJDOQTEF.js";import"./chunk-B64M2BXZ.js";import"./chunk-NF3MS2YP.js";import{a as T}from"./chunk-XR4SRVOQ.js";import"./chunk-WZRSQ7XL.js";import{a as le}from"./chunk-OHZGASM5.js";import"./chunk-65UN5LE6.js";import"./chunk-WFM6YWRN.js";import"./chunk-3AIKVVWP.js";import"./chunk-RHW5QVAY.js";import"./chunk-RSZISHXB.js";import{c as se,e as me,f as de,i as pe,m as _e,n as ce,o as ue,q as Ce,r as ge,s as Me,t as Ne}from"./chunk-5ENRUF35.js";import"./chunk-ZQSBINUM.js";import"./chunk-3XVU2YA6.js";import{b as q,d as Z,e as J}from"./chunk-5LKXKKAK.js";import"./chunk-HFNFJ7G2.js";import{a as Q,e as Y,g as ee,k as te,l as ne,p as oe,t as ie}from"./chunk-AL5KGNEF.js";import{g as ae,h as re}from"./chunk-FRSQ5NDX.js";import"./chunk-RHII5WE3.js";import"./chunk-M3WT5B3C.js";import"./chunk-TCDECRYI.js";import{Ab as R,Bb as y,Cb as v,Db as r,Eb as o,Fb as l,Gb as A,Hb as O,Jb as G,Pb as M,Qb as N,Qc as H,Rb as c,Sb as x,Tb as U,Ua as m,Vb as K,Wb as f,Z as _,_b as w,ea as S,fa as E,gb as $,lb as h,oc as X,pc as z,qc as V,ub as C,uc as W,va as F,vc as j,wb as b,zb as B}from"./chunk-AHUC7M75.js";import"./chunk-7CGTOI24.js";var Fe=()=>[];function Ae(s,t){s&1&&l(0,"spk-progress-bar",12)}function Oe(s,t){if(s&1&&(r(0,"spk-form-field"),l(1,"input",32),o()),s&2){let e=t.$implicit,i=t.$index;m(),w("id","filter-",i,""),C("formControl",e)}}function Te(s,t){if(s&1){let e=G();r(0,"form",13)(1,"spk-select",14)(2,"label",15),c(3,1),o(),l(4,"input",16),o(),r(5,"spk-form-field")(6,"label",17),c(7,2),o(),l(8,"textarea",18),o(),r(9,"spk-form-field")(10,"label",19),c(11,3),o(),l(12,"textarea",20),o()(),r(13,"spk-divider"),c(14,4),o(),r(15,"form",13)(16,"spk-form-field")(17,"label",21),c(18,5),o(),l(19,"input",22),o(),r(20,"spk-form-field")(21,"label",23),c(22,6),o(),l(23,"input",24),o(),r(24,"app-toggle-card",25),A(25,26),c(26,7),O(),A(27,27),y(28,Oe,2,3,"spk-form-field",null,R),O(),o()(),r(30,"p"),M(31,8),l(32,"a",28),N(),o(),r(33,"app-options-list",29),V("optionsChange",function(a){S(e);let u=f();return z(u.settings,a)||(u.settings=a),E(a)}),o(),r(34,"div",30)(35,"button",31),K("click",function(){S(e);let a=f();return E(a.submit())}),M(36,9),l(37,"spk-icon"),N(),o()()}if(s&2){let e,i=f();C("formGroup",i.baseCmdForm),m(),C("options",(e=i.commandOptions())!==null&&e!==void 0?e:j(10,Fe))("inlineSearch",!0),m(14),C("formGroup",i.standardFields),m(9),C("disallowToggle",!0),m(4),v(i.standardFields.controls.filters.controls),m(5),X("options",i.settings),C("hasFreeTextSettings",!0),m(2),b("loader",i.isSubmitting()),m(2),x(i.baseCmdForm.value.command),U(36)}}var d=new ge,Pe=["Bytes","KB","MB","GB","TB","PB"],I=class s{#e=_(P);#t=_(re);#n=_(Z);#o=_(q);#i=_(ae);#a=_(le);#s=_(Y);#r=T(this.#o.params);commandOptions=T(this.#i.getApiV1Commandline());sizeOptions=F(Pe);isSubmitting=F(!1);optionsFields=this.#e.optionsFields;standardFields=d.group({"backup-id":d.control(""),"backup-name":d.control(""),dbpath:d.control(""),filters:d.array([])});baseCmdForm=d.group({command:d.control("backup"),targetUrl:d.control(""),arguments:d.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;settings=this.#e.settings;#m=H(()=>{let t=this.#r()?.id;this.#e.backupId.set(t),this.getBackup(t)});getBackup(t){this.#t.getApiV1BackupById({id:t}).subscribe({next:e=>{this.#e.mapScheduleToForm(e.Schedule??null),e.Backup&&(this.mapStandardFieldsToForm(e.Backup),this.mapBaseCmdToForm(e.Backup),this.#e.mapOptionsToForms(e.Backup)),this.#e.finishedLoading.set(!0)}})}mapStandardFieldsToForm(t){this.standardFields.patchValue({dbpath:t.DBPath,"backup-id":t.ID,"backup-name":t.Name}),t.Filters&&t.Filters.length&&t.Filters.map(e=>{this.standardFields.controls.filters.push(d.control(`${e.Include?"":"-"}${e.Expression}`))})}submit(){this.#a.resumeDialogCheck(()=>this.#l())}#l(){this.isSubmitting.set(!0);let t=this.baseCmdForm.value,e=t.targetUrl??"",i=t.arguments?.split(`
1
+ import{a as Ee}from"./chunk-4LLC3Q7O.js";import{a as fe}from"./chunk-B3WLZK7W.js";import{l as P}from"./chunk-IQFSWP4W.js";import"./chunk-KHGD372Q.js";import"./chunk-LDJVMU7P.js";import{a as Se}from"./chunk-LJDOQTEF.js";import"./chunk-YKOEKIFQ.js";import"./chunk-NF3MS2YP.js";import{a as T}from"./chunk-XR4SRVOQ.js";import"./chunk-WZRSQ7XL.js";import{a as le}from"./chunk-OHZGASM5.js";import"./chunk-65UN5LE6.js";import"./chunk-WFM6YWRN.js";import"./chunk-3AIKVVWP.js";import"./chunk-RHW5QVAY.js";import"./chunk-RSZISHXB.js";import{c as se,e as me,f as de,i as pe,m as _e,n as ce,o as ue,q as Ce,r as ge,s as Me,t as Ne}from"./chunk-5ENRUF35.js";import"./chunk-ZQSBINUM.js";import"./chunk-3XVU2YA6.js";import{b as q,d as Z,e as J}from"./chunk-5LKXKKAK.js";import"./chunk-HFNFJ7G2.js";import{a as Q,e as Y,g as ee,k as te,l as ne,p as oe,t as ie}from"./chunk-AL5KGNEF.js";import{g as ae,h as re}from"./chunk-FRSQ5NDX.js";import"./chunk-RHII5WE3.js";import"./chunk-M3WT5B3C.js";import"./chunk-TCDECRYI.js";import{Ab as R,Bb as y,Cb as v,Db as r,Eb as o,Fb as l,Gb as A,Hb as O,Jb as G,Pb as M,Qb as N,Qc as H,Rb as c,Sb as x,Tb as U,Ua as m,Vb as K,Wb as f,Z as _,_b as w,ea as S,fa as E,gb as $,lb as h,oc as X,pc as z,qc as V,ub as C,uc as W,va as F,vc as j,wb as b,zb as B}from"./chunk-AHUC7M75.js";import"./chunk-7CGTOI24.js";var Fe=()=>[];function Ae(s,t){s&1&&l(0,"spk-progress-bar",12)}function Oe(s,t){if(s&1&&(r(0,"spk-form-field"),l(1,"input",32),o()),s&2){let e=t.$implicit,i=t.$index;m(),w("id","filter-",i,""),C("formControl",e)}}function Te(s,t){if(s&1){let e=G();r(0,"form",13)(1,"spk-select",14)(2,"label",15),c(3,1),o(),l(4,"input",16),o(),r(5,"spk-form-field")(6,"label",17),c(7,2),o(),l(8,"textarea",18),o(),r(9,"spk-form-field")(10,"label",19),c(11,3),o(),l(12,"textarea",20),o()(),r(13,"spk-divider"),c(14,4),o(),r(15,"form",13)(16,"spk-form-field")(17,"label",21),c(18,5),o(),l(19,"input",22),o(),r(20,"spk-form-field")(21,"label",23),c(22,6),o(),l(23,"input",24),o(),r(24,"app-toggle-card",25),A(25,26),c(26,7),O(),A(27,27),y(28,Oe,2,3,"spk-form-field",null,R),O(),o()(),r(30,"p"),M(31,8),l(32,"a",28),N(),o(),r(33,"app-options-list",29),V("optionsChange",function(a){S(e);let u=f();return z(u.settings,a)||(u.settings=a),E(a)}),o(),r(34,"div",30)(35,"button",31),K("click",function(){S(e);let a=f();return E(a.submit())}),M(36,9),l(37,"spk-icon"),N(),o()()}if(s&2){let e,i=f();C("formGroup",i.baseCmdForm),m(),C("options",(e=i.commandOptions())!==null&&e!==void 0?e:j(10,Fe))("inlineSearch",!0),m(14),C("formGroup",i.standardFields),m(9),C("disallowToggle",!0),m(4),v(i.standardFields.controls.filters.controls),m(5),X("options",i.settings),C("hasFreeTextSettings",!0),m(2),b("loader",i.isSubmitting()),m(2),x(i.baseCmdForm.value.command),U(36)}}var d=new ge,Pe=["Bytes","KB","MB","GB","TB","PB"],I=class s{#e=_(P);#t=_(re);#n=_(Z);#o=_(q);#i=_(ae);#a=_(le);#s=_(Y);#r=T(this.#o.params);commandOptions=T(this.#i.getApiV1Commandline());sizeOptions=F(Pe);isSubmitting=F(!1);optionsFields=this.#e.optionsFields;standardFields=d.group({"backup-id":d.control(""),"backup-name":d.control(""),dbpath:d.control(""),filters:d.array([])});baseCmdForm=d.group({command:d.control("backup"),targetUrl:d.control(""),arguments:d.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;settings=this.#e.settings;#m=H(()=>{let t=this.#r()?.id;this.#e.backupId.set(t),this.getBackup(t)});getBackup(t){this.#t.getApiV1BackupById({id:t}).subscribe({next:e=>{this.#e.mapScheduleToForm(e.Schedule??null),e.Backup&&(this.mapStandardFieldsToForm(e.Backup),this.mapBaseCmdToForm(e.Backup),this.#e.mapOptionsToForms(e.Backup)),this.#e.finishedLoading.set(!0)}})}mapStandardFieldsToForm(t){this.standardFields.patchValue({dbpath:t.DBPath,"backup-id":t.ID,"backup-name":t.Name}),t.Filters&&t.Filters.length&&t.Filters.map(e=>{this.standardFields.controls.filters.push(d.control(`${e.Include?"":"-"}${e.Expression}`))})}submit(){this.#a.resumeDialogCheck(()=>this.#l())}#l(){this.isSubmitting.set(!0);let t=this.baseCmdForm.value,e=t.targetUrl??"",i=t.arguments?.split(`
2
2
  `).filter(n=>n.length>0)??[],a=this.standardFields.value,u=a.filters??[],g=[t.command,e,...i,`--backup-name=${a["backup-name"]}`,`--dbpath=${a.dbpath}`,`--backup-id=${a["backup-id"]}`,...u.filter(n=>n).map(n=>n.startsWith("-")?`--exclude=${n?.slice(1)}`:`--include=${n}`),...this.#e.mapFormsToSettings(["backup-id","backup-name","dbpath"]).map(n=>n.Name.startsWith("--")?`${n.Name}=${n.Value}`:`--${n.Name}=${n.Value}`),"--disable-module=console-password-input"];this.#t.postApiV1Commandline({requestBody:g}).subscribe(n=>{n.Status==="OK"&&this.#n.navigate(["backup",this.backupId(),"commandline",n.ID])})}mapBaseCmdToForm(t){let e=t.TargetURL??null;e&&this.baseCmdForm.patchValue({targetUrl:e??"",arguments:t.Sources?.join(`
3
3
  `)??""})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=$({type:s,selectors:[["app-commandline"]],features:[W([P])],decls:8,vars:1,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_ICON: Back `;let e;e=$localize`Command`;let i;i=$localize`TargetUrl`;let a;a=$localize`Commandline Arguments`;let u;u=$localize`Advanced options`;let g;g=$localize`Backup ID`;let n;n=$localize`Backup Name`;let k;k=$localize`Filters`;let D;D=$localize` The backups will be split up into multiple files called volumes. Here you can set the maximum size of the individual volume files. ${"\uFFFD#32\uFFFD"}:START_LINK:Read more${"\uFFFD/#32\uFFFD"}:CLOSE_LINK:`;let L;return L=$localize`${"\uFFFD#37\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#37\uFFFD"}:CLOSE_TAG_SPK_ICON: Run "${"\uFFFD0\uFFFD"}:INTERPOLATION:" command now `,[t,e,i,a,u,g,n,k,D,L,[1,"back"],["type","button","spk-button","","routerLink","/",1,"small"],[1,"indeterminate","primary"],[3,"formGroup"],["placeholder","Select a command...",3,"options","inlineSearch"],["for","command"],["type","text","id","command","formControlName","command"],["for","targetUrl"],["id","targetUrl","autocomplete","off","formControlName","targetUrl"],["for","arguments"],["id","arguments","autocomplete","off","formControlName","arguments"],["for","backup-id"],["id","backup-id","formControlName","backup-id"],["for","backup-name"],["id","backup-name","formControlName","backup-name"],[3,"disallowToggle"],["title",""],["content","","formGroupName","filters"],["href","#",1,"spk-primary"],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["spk-button","",1,"raised","primary",3,"click"],[3,"id","formControl"]]},template:function(e,i){e&1&&(l(0,"app-status-bar"),r(1,"section")(2,"div",10)(3,"button",11),M(4,0),l(5,"spk-icon"),N(),o()(),h(6,Ae,1,0,"spk-progress-bar",12)(7,Te,38,11),o()),e&2&&(m(6),B(i.finishedLoading()?7:6))},dependencies:[Me,pe,se,me,de,fe,Ee,Se,Ne,_e,ce,Ce,ue,J,ne,ee,te,ie,oe,Q],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;max-width:40rem;padding:2.5rem;gap:1.25rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.form-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.form-column[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.form-column[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}"],changeDetection:0})};export{I as default};
@@ -1 +1 @@
1
- import{a as v}from"./chunk-B3WLZK7W.js";import{l as T}from"./chunk-RXHYUPYG.js";import"./chunk-KHGD372Q.js";import"./chunk-LDJVMU7P.js";import"./chunk-LJDOQTEF.js";import"./chunk-B64M2BXZ.js";import"./chunk-NF3MS2YP.js";import{a as m}from"./chunk-XR4SRVOQ.js";import"./chunk-WZRSQ7XL.js";import"./chunk-OHZGASM5.js";import"./chunk-65UN5LE6.js";import{a as L}from"./chunk-WFM6YWRN.js";import"./chunk-3AIKVVWP.js";import"./chunk-RHW5QVAY.js";import"./chunk-RSZISHXB.js";import"./chunk-5ENRUF35.js";import"./chunk-ZQSBINUM.js";import"./chunk-3XVU2YA6.js";import{b as E,c as B,e as b,f as $}from"./chunk-5LKXKKAK.js";import"./chunk-HFNFJ7G2.js";import{p as M,q as N,v as I}from"./chunk-AL5KGNEF.js";import{h as K}from"./chunk-FRSQ5NDX.js";import"./chunk-RHII5WE3.js";import"./chunk-M3WT5B3C.js";import"./chunk-TCDECRYI.js";import{Db as p,E as C,Eb as r,Fb as s,Pb as d,Qb as c,Qc as O,Ua as n,Wb as R,Z as l,gb as D,jc as A,lb as k,lc as P,ub as u,uc as h,xc as _,zb as g}from"./chunk-AHUC7M75.js";import"./chunk-7CGTOI24.js";var G=(i,e)=>[i,e,"general"],y=(i,e)=>[i,e,"destination"],U=(i,e)=>[i,e,"source-data"],w=(i,e)=>[i,e,"schedule"],X=(i,e)=>[i,e,"options"];function x(i,e){if(i&1&&(p(0,"p"),A(1),r()),i&2){let a=R();n(),P("Editing: ",a.backupName(),"")}}function z(i,e){i&1&&s(0,"spk-progress-bar",6)}function j(i,e){i&1&&(p(0,"section"),s(1,"router-outlet"),r())}var f=class i{#t=l(E);#e=l(T);#a=l(L);#i=l(K);isDraft=this.#e.isDraft;isNew=this.#e.isNew;backupId=this.#e.backupId;backupName=this.#e.backupName;finishedLoading=this.#e.finishedLoading;#o=m(this.#t.params);#n=m(this.#t.url);paramsChanged=O(()=>{let e=this.#o()?.id,a=!!this.#n()?.find(t=>t.path==="backup-draft");this.#e.backupId.set(e),e!=="new"?this.getBackup(e,a):this.getDefaults()});getDefaults(){this.#i.getApiV1Backupdefaults().pipe(C(1)).subscribe({next:e=>{let a=e.Backup;a.Settings=[...a.Settings],this.#e.mapScheduleToForm(e.Schedule),this.#e.mapOptionsToForms(a),this.#e.applicationOptions.set(e.ApplicationOptions),this.#e.backupDefaults.set(e),this.#e.finishedLoading.set(!0)}})}getBackup(e,a=!1){let t=o=>{this.#e.mapScheduleToForm(o.Schedule??null),o.Backup&&(this.#e.mapGeneralToForm(o.Backup),this.#e.mapDestinationToForm(o.Backup),this.#e.mapSourceDataToForm(o.Backup),this.#e.mapOptionsToForms(o.Backup)),this.#e.finishedLoading.set(!0)};if(a){this.isDraft.set(a);let o=this.#a.draftBackups().find(F=>F.id===e);if(!o){alert("Backup not found");return}t(o.data)}else this.#i.getApiV1BackupById({id:e}).subscribe({next:t})}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=D({type:i,selectors:[["app-backup"]],features:[h([T])],decls:21,vars:22,consts:()=>{let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SPK_RADIO: General `;let a;a=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_RADIO: Destination `;let t;t=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_RADIO: Source Data `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_RADIO: Schedule `;let F;return F=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SPK_RADIO: Options `,[e,a,t,o,F,["step","","routerLinkActive","active",3,"routerLink"],[1,"indeterminate","primary"]]},template:function(a,t){a&1&&(s(0,"app-status-bar"),p(1,"header"),k(2,x,2,1,"p"),p(3,"spk-stepper")(4,"div",5),d(5,0),s(6,"spk-radio"),c(),r(),p(7,"div",5),d(8,1),s(9,"spk-radio"),c(),r(),p(10,"div",5),d(11,2),s(12,"spk-radio"),c(),r(),p(13,"div",5),d(14,3),s(15,"spk-radio"),c(),r(),p(16,"div",5),d(17,4),s(18,"spk-radio"),c(),r()()(),k(19,z,1,0,"spk-progress-bar",6)(20,j,2,0,"section")),a&2&&(n(2),g(t.isNew()?-1:2),n(2),u("routerLink",_(7,G,t.isDraft()?"/backup-draft":"/backup",t.backupId())),n(3),u("routerLink",_(10,y,t.isDraft()?"/backup-draft":"/backup",t.backupId())),n(3),u("routerLink",_(13,U,t.isDraft()?"/backup-draft":"/backup",t.backupId())),n(3),u("routerLink",_(16,w,t.isDraft()?"/backup-draft":"/backup",t.backupId())),n(3),u("routerLink",_(19,X,t.isDraft()?"/backup-draft":"/backup",t.backupId())),n(3),g(t.finishedLoading()?20:19))},dependencies:[B,b,$,v,N,I,M],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}header[_ngcontent-%COMP%]{padding:1rem 1.5rem;border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:.5rem}header[_ngcontent-%COMP%] spk-stepper[_ngcontent-%COMP%]{width:100%}section[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;flex:1 0;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:auto}"],changeDetection:0})};export{f as default};
1
+ import{a as v}from"./chunk-B3WLZK7W.js";import{l as T}from"./chunk-IQFSWP4W.js";import"./chunk-KHGD372Q.js";import"./chunk-LDJVMU7P.js";import"./chunk-LJDOQTEF.js";import"./chunk-YKOEKIFQ.js";import"./chunk-NF3MS2YP.js";import{a as m}from"./chunk-XR4SRVOQ.js";import"./chunk-WZRSQ7XL.js";import"./chunk-OHZGASM5.js";import"./chunk-65UN5LE6.js";import{a as L}from"./chunk-WFM6YWRN.js";import"./chunk-3AIKVVWP.js";import"./chunk-RHW5QVAY.js";import"./chunk-RSZISHXB.js";import"./chunk-5ENRUF35.js";import"./chunk-ZQSBINUM.js";import"./chunk-3XVU2YA6.js";import{b as E,c as B,e as b,f as $}from"./chunk-5LKXKKAK.js";import"./chunk-HFNFJ7G2.js";import{p as M,q as N,v as I}from"./chunk-AL5KGNEF.js";import{h as K}from"./chunk-FRSQ5NDX.js";import"./chunk-RHII5WE3.js";import"./chunk-M3WT5B3C.js";import"./chunk-TCDECRYI.js";import{Db as p,E as C,Eb as r,Fb as s,Pb as d,Qb as c,Qc as O,Ua as n,Wb as R,Z as l,gb as D,jc as A,lb as k,lc as P,ub as u,uc as h,xc as _,zb as g}from"./chunk-AHUC7M75.js";import"./chunk-7CGTOI24.js";var G=(i,e)=>[i,e,"general"],y=(i,e)=>[i,e,"destination"],U=(i,e)=>[i,e,"source-data"],w=(i,e)=>[i,e,"schedule"],X=(i,e)=>[i,e,"options"];function x(i,e){if(i&1&&(p(0,"p"),A(1),r()),i&2){let a=R();n(),P("Editing: ",a.backupName(),"")}}function z(i,e){i&1&&s(0,"spk-progress-bar",6)}function j(i,e){i&1&&(p(0,"section"),s(1,"router-outlet"),r())}var f=class i{#t=l(E);#e=l(T);#a=l(L);#i=l(K);isDraft=this.#e.isDraft;isNew=this.#e.isNew;backupId=this.#e.backupId;backupName=this.#e.backupName;finishedLoading=this.#e.finishedLoading;#o=m(this.#t.params);#n=m(this.#t.url);paramsChanged=O(()=>{let e=this.#o()?.id,a=!!this.#n()?.find(t=>t.path==="backup-draft");this.#e.backupId.set(e),e!=="new"?this.getBackup(e,a):this.getDefaults()});getDefaults(){this.#i.getApiV1Backupdefaults().pipe(C(1)).subscribe({next:e=>{let a=e.Backup;a.Settings=[...a.Settings],this.#e.mapScheduleToForm(e.Schedule),this.#e.mapOptionsToForms(a),this.#e.applicationOptions.set(e.ApplicationOptions),this.#e.backupDefaults.set(e),this.#e.finishedLoading.set(!0)}})}getBackup(e,a=!1){let t=o=>{this.#e.mapScheduleToForm(o.Schedule??null),o.Backup&&(this.#e.mapGeneralToForm(o.Backup),this.#e.mapDestinationToForm(o.Backup),this.#e.mapSourceDataToForm(o.Backup),this.#e.mapOptionsToForms(o.Backup)),this.#e.finishedLoading.set(!0)};if(a){this.isDraft.set(a);let o=this.#a.draftBackups().find(F=>F.id===e);if(!o){alert("Backup not found");return}t(o.data)}else this.#i.getApiV1BackupById({id:e}).subscribe({next:t})}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=D({type:i,selectors:[["app-backup"]],features:[h([T])],decls:21,vars:22,consts:()=>{let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SPK_RADIO: General `;let a;a=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_RADIO: Destination `;let t;t=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_RADIO: Source Data `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_RADIO: Schedule `;let F;return F=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SPK_RADIO: Options `,[e,a,t,o,F,["step","","routerLinkActive","active",3,"routerLink"],[1,"indeterminate","primary"]]},template:function(a,t){a&1&&(s(0,"app-status-bar"),p(1,"header"),k(2,x,2,1,"p"),p(3,"spk-stepper")(4,"div",5),d(5,0),s(6,"spk-radio"),c(),r(),p(7,"div",5),d(8,1),s(9,"spk-radio"),c(),r(),p(10,"div",5),d(11,2),s(12,"spk-radio"),c(),r(),p(13,"div",5),d(14,3),s(15,"spk-radio"),c(),r(),p(16,"div",5),d(17,4),s(18,"spk-radio"),c(),r()()(),k(19,z,1,0,"spk-progress-bar",6)(20,j,2,0,"section")),a&2&&(n(2),g(t.isNew()?-1:2),n(2),u("routerLink",_(7,G,t.isDraft()?"/backup-draft":"/backup",t.backupId())),n(3),u("routerLink",_(10,y,t.isDraft()?"/backup-draft":"/backup",t.backupId())),n(3),u("routerLink",_(13,U,t.isDraft()?"/backup-draft":"/backup",t.backupId())),n(3),u("routerLink",_(16,w,t.isDraft()?"/backup-draft":"/backup",t.backupId())),n(3),u("routerLink",_(19,X,t.isDraft()?"/backup-draft":"/backup",t.backupId())),n(3),g(t.finishedLoading()?20:19))},dependencies:[B,b,$,v,N,I,M],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}header[_ngcontent-%COMP%]{padding:1rem 1.5rem;border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:.5rem}header[_ngcontent-%COMP%] spk-stepper[_ngcontent-%COMP%]{width:100%}section[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;flex:1 0;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:auto}"],changeDetection:0})};export{f as default};
@@ -1 +1 @@
1
- import{h as a,i as b}from"./chunk-RXHYUPYG.js";import"./chunk-KHGD372Q.js";import"./chunk-LDJVMU7P.js";import"./chunk-LJDOQTEF.js";import"./chunk-B64M2BXZ.js";import"./chunk-NF3MS2YP.js";import"./chunk-XR4SRVOQ.js";import"./chunk-WZRSQ7XL.js";import"./chunk-3AIKVVWP.js";import"./chunk-RHW5QVAY.js";import"./chunk-5ENRUF35.js";import"./chunk-5LKXKKAK.js";import"./chunk-HFNFJ7G2.js";import"./chunk-AL5KGNEF.js";import"./chunk-FRSQ5NDX.js";import"./chunk-M3WT5B3C.js";import"./chunk-AHUC7M75.js";import"./chunk-7CGTOI24.js";export{a as SCHEDULE_FIELD_DEFAULTS,b as default};
1
+ import{h as a,i as b}from"./chunk-IQFSWP4W.js";import"./chunk-KHGD372Q.js";import"./chunk-LDJVMU7P.js";import"./chunk-LJDOQTEF.js";import"./chunk-YKOEKIFQ.js";import"./chunk-NF3MS2YP.js";import"./chunk-XR4SRVOQ.js";import"./chunk-WZRSQ7XL.js";import"./chunk-3AIKVVWP.js";import"./chunk-RHW5QVAY.js";import"./chunk-5ENRUF35.js";import"./chunk-5LKXKKAK.js";import"./chunk-HFNFJ7G2.js";import"./chunk-AL5KGNEF.js";import"./chunk-FRSQ5NDX.js";import"./chunk-M3WT5B3C.js";import"./chunk-AHUC7M75.js";import"./chunk-7CGTOI24.js";export{a as SCHEDULE_FIELD_DEFAULTS,b as default};
@@ -1 +1 @@
1
- import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-YW5R7NEG.js")},{path:"encryption",loadComponent:()=>import("./chunk-ZHMYBX5F.js")},{path:"select-files",loadComponent:()=>import("./chunk-KBJGYXKV.js")},{path:"options",loadComponent:()=>import("./chunk-Z45ZPMZS.js")},{path:"progress",loadComponent:()=>import("./chunk-A6XWHATE.js")}],t=o;export{t as default};
1
+ import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-HYHEAOIF.js")},{path:"encryption",loadComponent:()=>import("./chunk-ZHMYBX5F.js")},{path:"select-files",loadComponent:()=>import("./chunk-KBJGYXKV.js")},{path:"options",loadComponent:()=>import("./chunk-Z45ZPMZS.js")},{path:"progress",loadComponent:()=>import("./chunk-KKIWOA46.js")}],t=o;export{t as default};
@@ -1 +1 @@
1
- import{a as un}from"./chunk-B3WLZK7W.js";import{c as Z,d as sn}from"./chunk-B64M2BXZ.js";import"./chunk-XR4SRVOQ.js";import{a as cn}from"./chunk-OHZGASM5.js";import"./chunk-65UN5LE6.js";import{a as ln}from"./chunk-WFM6YWRN.js";import{a as rn}from"./chunk-3AIKVVWP.js";import"./chunk-RHW5QVAY.js";import"./chunk-RSZISHXB.js";import"./chunk-5ENRUF35.js";import"./chunk-ZQSBINUM.js";import"./chunk-3XVU2YA6.js";import{e as je}from"./chunk-5LKXKKAK.js";import"./chunk-HFNFJ7G2.js";import{a as Y,e as qe,f as Je,g as Qe,h as Ye,j as Ze,k as en,o as nn,p as tn,w as on,x as an}from"./chunk-AL5KGNEF.js";import{h as _n}from"./chunk-FRSQ5NDX.js";import"./chunk-RHII5WE3.js";import"./chunk-M3WT5B3C.js";import"./chunk-TCDECRYI.js";import{Ab as z,Ac as b,Bb as V,Bc as G,Cb as K,Cc as Q,Db as a,Eb as o,F as w,Fb as d,Gb as M,Hb as m,Ib as $,Jb as B,Pb as s,Qb as u,Qc as We,Rb as p,Sb as y,Tb as x,Ua as r,Ub as j,Vb as f,Wb as F,Z as L,a as ve,b as W,ea as k,fa as P,gb as he,ic as U,jc as T,kc as ze,lb as g,lc as O,oc as Ve,pc as Ke,qc as Ue,rb as Xe,rc as q,sb as we,ub as S,va as H,vc as J,wb as R,wc as D,zb as E,zc as I}from"./chunk-AHUC7M75.js";import"./chunk-7CGTOI24.js";function pn(...e){let i=H(...e);return Object.defineProperty(i,"value",{get:i.asReadonly(),set:i.set.bind(i)})}function Fn(e,i,n){let t=localStorage.getItem(i);t!=null&&(e=JSON.parse(t));let _=pn(e),c=_[ve];n?.equal&&(c.equal=n.equal);function N(C){C==null?localStorage.removeItem(i):localStorage.setItem(i,JSON.stringify(C))}return _.set=C=>{N(C),W(c,C)},_.update=C=>{let A=C(_());N(A),W(c,A)},_}var Tn=()=>[import("./chunk-RLUT4FSI.js").then(e=>e.NgTemplateOutlet),Y,Ze,an,on,import("./chunk-RKAIZDDW.js").then(e=>e.DurationFormatPipe),import("./chunk-CRJHIWSF.js").then(e=>e.BytesPipe),import("./chunk-G5CT45UH.js").then(e=>e.RelativeTimePipe)],Sn=()=>["/add-backup"],Cn=()=>["/restore"],dn=e=>({$implicit:e}),En=e=>["/backup",e],Mn=e=>["/restore",e],mn=e=>["/backup",e,"export"],On=e=>["/backup",e,"database"],Nn=e=>["/backup",e,"commandline"],kn=e=>["/backup",e,"log"];function Pn(e,i){if(e&1){let n=B();a(0,"button",57),f("click",function(){let _=k(n).$implicit,c=F(2);return P(c.sortByColumn.set(_.value))}),p(1,15),o()}if(e&2){let n=i.$implicit,t=F(2);R("active",t.orderBy()===n.value),r(),y(n.label),x(1)}}function fn(e,i){if(e&1&&(a(0,"spk-menu",58)(1,"button",59),s(2,14),d(3,"strong")(4,"spk-icon"),u(),o(),M(5,60),V(6,Pn,2,3,"button",61,z),m(),o()),e&2){let n=F();r(4),y(n.orderBy()),x(2),r(2),K(n.sortOrderOptions())}}function $n(e,i){if(e&1&&(T(0),I(1,"durationFormat")),e&2){let n=F().$implicit,t=F(4);O(" ",G(1,1,n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDuration,t.timeType()==="actual")," ")}}function Dn(e,i){e&1&&(M(0),p(1,21),m())}function In(e,i){if(e&1&&(T(0),I(1,"bytes")),e&2){let n=F().$implicit;O(" ",b(1,1,n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.SourceFilesSize)," ")}}function An(e,i){e&1&&(M(0),p(1,22),m())}function Rn(e,i){if(e&1&&(T(0),I(1,"bytes")),e&2){let n=F().$implicit;O(" ",b(1,1,n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.TargetFilesSize)," ")}}function Hn(e,i){e&1&&(M(0),p(1,23),m())}function yn(e,i){e&1&&$(0)}function xn(e,i){if(e&1&&(a(0,"div",64)(1,"div",51)(2,"h3"),T(3),a(4,"spk-chip")(5,"spk-icon"),T(6),o(),T(7),o()(),a(8,"p")(9,"span"),p(10,16),o(),T(11),I(12,"relativeTime"),o(),a(13,"p")(14,"span"),p(15,17),o(),g(16,$n,2,4)(17,Dn,2,0,"ng-container"),o(),a(18,"p")(19,"span"),p(20,18),o(),g(21,In,2,3)(22,An,2,0,"ng-container"),o(),a(23,"p")(24,"span"),p(25,19),o(),g(26,Rn,2,3)(27,Hn,2,0,"ng-container"),o()(),q(28),a(29,"spk-chip",65),p(30,20),o(),a(31,"div",55),g(32,yn,1,0,"ng-container",66),o()()),e&2){let n,t=i.$implicit,_=F(4),c=U(51);r(3),O(" ",(n=t.Backup==null?null:t.Backup.Name)!==null&&n!==void 0?n:_.MISSING_BACKUP_NAME," "),r(3),ze(_.getBackendIcon(t.Backup==null?null:t.Backup.TargetURL)),r(),O(" ",_.getBackendType(t.Backup==null?null:t.Backup.TargetURL)," "),r(4),O(" ",G(12,11,t.Backup==null||t.Backup.Metadata==null?null:t.Backup.Metadata.LastBackupDate,_.timeType()==="actual")," "),r(5),E(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.LastBackupDuration?16:17),r(5),E(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.SourceFilesSize?21:22),r(5),E(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.TargetFilesSize?26:27);let N=_.getBackupVersionCount(t);r(4),y(N)(N),x(30),r(2),S("ngTemplateOutlet",c)("ngTemplateOutletContext",D(14,dn,t))}}function Ln(e,i){if(e&1&&V(0,xn,33,16,"div",64,z),e&2){let n=F(3);K(n.backups())}}function Bn(e,i){e&1&&(M(0),p(1,24),m())}function bn(e,i){if(e&1&&(a(0,"div",62),g(1,Ln,2,0)(2,Bn,2,0,"ng-container"),o()),e&2){let n=F(2);r(),E(n.backups().length?1:2)}}function Gn(e,i){e&1&&(s(0,25,1),$(1),u())}function vn(e,i){e&1&&(s(0,26,1),$(1),u())}function hn(e,i){e&1&&(s(0,27,1),$(1),u())}function Xn(e,i){e&1&&(s(0,28,1),$(1),u())}function wn(e,i){e&1&&(s(0,29,1),$(1),u())}function zn(e,i){e&1&&(s(0,30,1),$(1),u())}function Vn(e,i){if(e&1&&(T(0),I(1,"relativeTime")),e&2){let n=F().$implicit,t=F(3);O(" ",G(1,1,n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDate,t.timeType()==="actual")," ")}}function Kn(e,i){e&1&&(M(0),p(1,34),m())}function Un(e,i){if(e&1&&(T(0),I(1,"durationFormat")),e&2){let n=F().$implicit,t=F(3);O(" ",G(1,1,n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDuration,t.timeType()==="actual")," ")}}function Wn(e,i){e&1&&(M(0),p(1,35),m())}function jn(e,i){if(e&1&&(T(0),I(1,"bytes")),e&2){let n=F().$implicit;O(" ",b(1,1,n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.SourceFilesSize)," ")}}function qn(e,i){e&1&&(M(0),p(1,36),m())}function Jn(e,i){if(e&1&&(T(0),I(1,"bytes")),e&2){let n=F().$implicit;O(" ",b(1,1,n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.TargetFilesSize)," ")}}function Qn(e,i){e&1&&(M(0),p(1,37),m())}function Yn(e,i){e&1&&$(0)}function Zn(e,i){if(e&1&&(a(0,"tr")(1,"td"),T(2),o(),a(3,"td"),T(4),o(),a(5,"td"),g(6,Vn,2,4)(7,Kn,2,0,"ng-container"),o(),a(8,"td"),g(9,Un,2,4)(10,Wn,2,0,"ng-container"),o(),a(11,"td"),g(12,jn,2,3)(13,qn,2,0,"ng-container"),o(),a(14,"td"),g(15,Jn,2,3)(16,Qn,2,0,"ng-container"),o(),a(17,"td"),q(18),a(19,"span"),p(20,33),o()(),a(21,"td"),g(22,Yn,1,0,"ng-container",66),o()()),e&2){let n,t=i.$implicit,_=F(3),c=U(51);r(2),O(" ",(n=t.Backup==null?null:t.Backup.Name)!==null&&n!==void 0?n:_.MISSING_BACKUP_NAME," "),r(2),O(" ",_.getBackendType(t.Backup==null?null:t.Backup.TargetURL)," "),r(2),E(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.LastBackupDate?6:7),r(3),E(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.LastBackupDuration?9:10),r(3),E(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.SourceFilesSize?12:13),r(3),E(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.TargetFilesSize?15:16);let N=_.getBackupVersionCount(t);r(5),y(N)(N),x(20),r(2),S("ngTemplateOutlet",c)("ngTemplateOutletContext",D(10,dn,t))}}function et(e,i){if(e&1){let n=B();a(0,"spk-table",67),Ue("sortByColumnChange",function(_){k(n);let c=F(2);return Ke(c.sortByColumn,_)||(c.sortByColumn=_),P(_)}),a(1,"tr",68)(2,"th",69),s(3,25),g(4,Gn,2,0,"ng-container",70),u(),o(),a(5,"th",71),s(6,26),g(7,vn,2,0,"ng-container",70),u(),o(),a(8,"th",72),s(9,27),g(10,hn,2,0,"ng-container",70),u(),o(),a(11,"th",73),s(12,28),g(13,Xn,2,0,"ng-container",70),u(),o(),a(14,"th",74),s(15,29),g(16,wn,2,0,"ng-container",70),u(),o(),a(17,"th",75),s(18,30),g(19,zn,2,0,"ng-container",70),u(),o(),a(20,"th"),p(21,31),o(),a(22,"th"),p(23,32),o()(),V(24,Zn,23,12,"tr",null,z),o()}if(e&2){let n=F(2),t=U(53);S("data",n.backups())("loading",n.backupsLoading()),Ve("sortByColumn",n.sortByColumn),r(4),S("ngTemplateOutlet",t),r(3),S("ngTemplateOutlet",t),r(3),S("ngTemplateOutlet",t),r(3),S("ngTemplateOutlet",t),r(3),S("ngTemplateOutlet",t),r(3),S("ngTemplateOutlet",t),r(5),K(n.backups())}}function nt(e,i){if(e&1&&g(0,bn,3,1,"div",62)(1,et,26,9,"spk-table",63),e&2){let n=F();E(n.viewMode()==="list"?0:n.viewMode()==="details"?1:-1)}}function tt(e,i){e&1&&(a(0,"div",76),d(1,"spk-progress-bar",77),a(2,"div",51)(3,"h3"),p(4,38),o()()())}function it(e,i){e&1&&p(0,39,1)}function ot(e,i){e&1&&(a(0,"spk-icon"),T(1,"check"),o())}function at(e,i){e&1&&(a(0,"spk-icon"),T(1,"dots-three-vertical"),o())}function _t(e,i){if(e&1){let n=B();a(0,"button",78),f("click",function(){let _=k(n).$implicit,c=F();return P(c.startBackup(_.Backup==null?null:_.Backup.ID))}),s(1,39),d(2,"spk-icon"),g(3,it,1,0),u(),o(),a(4,"button",79)(5,"spk-icon"),T(6,"pencil-simple"),o()(),a(7,"spk-menu",80)(8,"button",52),g(9,ot,2,0,"spk-icon")(10,at,2,0,"spk-icon"),o(),M(11,60),a(12,"h3",81),T(13,"Operations"),o(),a(14,"button",82),s(15,40),d(16,"spk-icon"),u(),o(),a(17,"button",82),s(18,41),d(19,"spk-icon"),u(),o(),a(20,"button",83),f("click",function(){let _=k(n).$implicit,c=F();return P(c.deleteBackup(_.Backup==null?null:_.Backup.ID))}),s(21,42),d(22,"spk-icon"),u(),o(),d(23,"spk-divider"),a(24,"h3",81),T(25,"Advanced"),o(),a(26,"button",82),s(27,43),d(28,"spk-icon"),u(),o(),a(29,"button",57),f("click",function(){let _=k(n).$implicit,c=F();return P(c.verifyFiles(_.Backup==null?null:_.Backup.ID))}),s(30,44),d(31,"spk-icon"),u(),o(),a(32,"button",57),f("click",function(){let _=k(n).$implicit,c=F();return P(c.compressBackup(_.Backup==null?null:_.Backup.ID))}),s(33,45),d(34,"spk-icon"),u(),o(),a(35,"button",82),s(36,46),d(37,"spk-icon"),u(),o(),d(38,"spk-divider"),a(39,"h3",81),T(40,"Reporting"),o(),a(41,"button",82),s(42,47),d(43,"spk-icon"),u(),o(),a(44,"button",57),f("click",function(){let _=k(n).$implicit,c=F();return P(c.createErrorReport(_.Backup==null?null:_.Backup.ID))}),s(45,48),d(46,"spk-icon"),u(),o(),m(),o()}if(e&2){let n=i.$implicit,t=F();R("loader",t.startingBackup()===(n.Backup==null?null:n.Backup.ID)),r(3),E(t.viewMode()==="list"?3:-1),r(),S("routerLink",D(17,En,n.Backup==null?null:n.Backup.ID)),r(3),S("right",!0),r(),R("loader",t.loadingId()===(n.Backup==null?null:n.Backup.ID))("success",t.successId()===(n.Backup==null?null:n.Backup.ID)),r(),E(t.successId()===(n.Backup==null?null:n.Backup.ID)?9:10),r(5),S("routerLink",D(19,Mn,n.Backup==null?null:n.Backup.ID)),r(3),S("routerLink",D(21,mn,n.Backup==null?null:n.Backup.ID)),r(3),R("loader",t.deletingBackup()===(n.Backup==null?null:n.Backup.ID)),r(6),S("routerLink",D(23,On,n.Backup==null?null:n.Backup.ID)),r(9),S("routerLink",D(25,Nn,n.Backup==null?null:n.Backup.ID)),r(6),S("routerLink",D(27,kn,n.Backup==null?null:n.Backup.ID))}}function lt(e,i){e&1&&(a(0,"spk-icon",84),T(1,"funnel-simple"),o(),a(2,"spk-icon",85),T(3,"sort-ascending"),o(),a(4,"spk-icon",86),T(5,"sort-descending"),o())}var gn={file:{Display:$localize`Local`,Icon:null}},ee=class e{#e=L(ln);#t=L(qe);#n=L(_n);#i=L(cn);MISSING_BACKUP_NAME=$localize`Backup name missing`;sortOrderOptions=this.#e.orderByOptions;orderBy=this.#e.orderBy;backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;startingBackup=this.#e.startingBackup;deletingBackup=this.#e.deletingBackup;timeType=this.#e.timeType;viewMode=Fn("list","viewMode");sortByColumn=H("name");loadingId=H(null);successId=H(null);sortEffect=We(()=>this.#e.setOrderBy(this.sortByColumn()));ngOnInit(){this.#e.getBackups(!0)}setOrderBy(i){this.#e.setOrderBy(i)}setTimeType(i){this.#e.setTimeType(i)}startBackup(i){this.#i.resumeDialogCheck(()=>this.#e.startBackup(i))}getBackendIcon(i){if(!i)return"";let n=i.split("://")[0],t=Z.find(c=>c.key===n);if(!t)return"database";let _=gn[t.key];return _?.Icon?_.Icon:"database"}getBackendType(i){if(!i)return"";let n=i.split("://")[0],t=Z.find(c=>c.key===n);if(!t)return"";let _=gn[t.key];if(_?.Display)return _.Display;if(t.key==="s3"){let c="http://null?"+i.split("?")[1],C=new URL(c).searchParams.get("s3-server-name")?.toLowerCase()??"";for(let[A,v]of Object.entries(sn))if(C.endsWith(A))return v}return t.displayName}getBackupVersionCount(i){return parseInt(i?.Backup?.Metadata?.BackupListCount??"",10)||0}deleteBackup(i){this.loadingId.set(i),this.#t.open(rn,{data:{title:$localize`Confirm delete`,message:$localize`Are you sure you want to delete this backup?`,confirmText:$localize`Delete backup`,cancelText:$localize`Cancel`},closed:n=>{n&&this.#e.deleteBackup(i)}})}verifyFiles(i){this.loadingId.set(i),this.#n.postApiV1BackupByIdVerify({id:i}).pipe(w(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(i),setTimeout(()=>this.successId.set(null),2e3)}})}compressBackup(i){this.loadingId.set(i),this.#n.postApiV1BackupByIdCompact({id:i}).pipe(w(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(i),setTimeout(()=>this.successId.set(null),2e3)}})}createErrorReport(i){this.loadingId.set(i),this.#n.postApiV1BackupByIdCreatereport({id:i}).pipe(w(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(i),setTimeout(()=>this.successId.set(null),2e3)}})}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=he({type:e,selectors:[["app-home"]],decls:54,vars:11,consts:()=>{let i;i=$localize`Backups`;let n;n=$localize`Backups are stored in the cloud and can be restored at any time.`;let t;t=$localize` Add ${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let _;_=$localize`Restores`;let c;c=$localize`Restores allow you to restore your data from the cloud.`;let N;N=$localize` Start ${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let C;C=$localize`My backups`;let A;A=$localize`${"\uFFFD#31\uFFFD"}:START_TAG_SPK_ICON:rows${"\uFFFD/#31\uFFFD"}:CLOSE_TAG_SPK_ICON: List `;let v;v=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SPK_ICON:list${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SPK_ICON: Details `;let ne;ne=$localize` Time: ${"\uFFFD#38\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#39\uFFFD"}:START_TAG_SPK_ICON:clock${"\uFFFD/#39\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let te;te=$localize`Relative time`;let ie;ie=$localize`Actual time`;let oe;oe=$localize` Order by: ${"\uFFFD#3\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#4\uFFFD"}:START_TAG_SPK_ICON:arrows-down-up${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let ae;ae=$localize` ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let _e;_e=$localize`Last successful backup:`;let le;le=$localize`Duration:`;let re;re=$localize`Source:`;let ce;ce=$localize`Destination:`;let h;h=$localize`{VAR_PLURAL, plural, =0 {No version yet} =1 {1 Version} other {{INTERPOLATION} Versions}}`,h=j(h,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let se;se=$localize` ${h}:ICU@@6502601490918455200: `;let ue;ue=$localize`N/A`;let pe;pe=$localize`N/A`;let Fe;Fe=$localize`N/A`;let ge;ge=$localize`No backups founds`;let de;de=$localize` Backup ${"\uFFFD*4:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*4:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Te;Te=$localize` Type ${"\uFFFD*7:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*7:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Se;Se=$localize` Last successful backup ${"\uFFFD*10:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*10:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Ce;Ce=$localize` Duration ${"\uFFFD*13:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*13:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Ee;Ee=$localize` Source ${"\uFFFD*16:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*16:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Me;Me=$localize` Destination ${"\uFFFD*19:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*19:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let me;me=$localize`Version`;let Oe;Oe=$localize`Actions`;let X;X=$localize`{VAR_PLURAL, plural, =0 {No version yet} =1 {1 Version} other {{INTERPOLATION} Versions}}`,X=j(X,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let Ne;Ne=$localize` ${X}:ICU@@6502601490918455200: `;let ke;ke=$localize`N/A`;let Pe;Pe=$localize`N/A`;let fe;fe=$localize`N/A`;let $e;$e=$localize`N/A`;let De;De=$localize`Loading backups...`;let Ie;Ie=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:play-circle${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:${"\uFFFD*3:1\uFFFD"}:START_BLOCK_IF: Start ${"\uFFFD/*3:1\uFFFD"}:CLOSE_BLOCK_IF:`;let Ae;Ae=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SPK_ICON:clock-counter-clockwise${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SPK_ICON: Restore `;let Re;Re=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SPK_ICON:export${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SPK_ICON: Export `;let He;He=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:x-circle${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON: Delete `;let ye;ye=$localize`${"\uFFFD#28\uFFFD"}:START_TAG_SPK_ICON:database${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SPK_ICON: Database `;let xe;xe=$localize`${"\uFFFD#31\uFFFD"}:START_TAG_SPK_ICON:check-square-offset${"\uFFFD/#31\uFFFD"}:CLOSE_TAG_SPK_ICON: Verify files `;let Le;Le=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SPK_ICON:file-archive${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SPK_ICON: Compress now `;let Be;Be=$localize`${"\uFFFD#37\uFFFD"}:START_TAG_SPK_ICON:terminal-window${"\uFFFD/#37\uFFFD"}:CLOSE_TAG_SPK_ICON: Commandline `;let be;be=$localize`${"\uFFFD#43\uFFFD"}:START_TAG_SPK_ICON:notepad${"\uFFFD/#43\uFFFD"}:CLOSE_TAG_SPK_ICON: Log `;let Ge;return Ge=$localize`${"\uFFFD#46\uFFFD"}:START_TAG_SPK_ICON:file-plus${"\uFFFD/#46\uFFFD"}:CLOSE_TAG_SPK_ICON: Create error report `,[["actions",""],["sortIcons",""],i,n,t,_,c,N,C,A,v,ne,te,ie,oe,ae,_e,le,re,ce,se,ue,pe,Fe,ge,de,Te,Se,Ce,Ee,Me,me,Oe,Ne,ke,Pe,fe,$e,De,Ie,Ae,Re,He,ye,xe,Le,Be,be,Ge,[1,"type-a",3,"routerLink"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["type","button","spk-button",""],["src","assets/images/restore.png","alt","","width","48px"],[1,"content"],[1,"actions"],[1,"small"],["type","button",3,"click"],[1,"table-overview"],["type","button","spk-button","",1,"small","table-buttons"],["menu",""],["type","button",3,"active"],[1,"backups"],[1,"type-b",3,"data","loading","sortByColumn"],[1,"backup"],[1,"simple","success"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"type-b",3,"sortByColumnChange","data","loading","sortByColumn"],["table-header",""],["spkSort","name"],[4,"ngTemplateOutlet"],["spkSort","type"],["spkSort","lastrun"],["spkSort","duration"],["spkSort","sourcesize"],["spkSort","destinationsize"],[1,"loading-list"],[1,"indeterminate","primary"],["spk-button","",3,"click"],["type","button","spk-button","",3,"routerLink"],[3,"right"],["title",""],["type","button",3,"routerLink"],[3,"click"],[1,"filter"],[1,"asc"],[1,"desc"]]},template:function(n,t){if(n&1){let _=B();d(0,"app-status-bar"),a(1,"section")(2,"header")(3,"spk-card",49),d(4,"img",50),a(5,"div",51)(6,"h3"),p(7,2),o(),a(8,"p"),p(9,3),o()(),a(10,"button",52),s(11,4),d(12,"spk-icon"),u(),o()(),a(13,"spk-card",49),d(14,"img",53),a(15,"div",51)(16,"h3"),p(17,5),o(),a(18,"p"),p(19,6),o()(),a(20,"button",52),s(21,7),d(22,"spk-icon"),u(),o()()(),a(23,"div",54)(24,"h2"),M(25),p(26,8),m(),a(27,"div",55)(28,"spk-button-group",56)(29,"button",57),f("click",function(){return k(_),P(t.viewMode.set("list"))}),s(30,9),d(31,"spk-icon"),u(),o(),a(32,"button",57),f("click",function(){return k(_),P(t.viewMode.set("details"))}),s(33,10),d(34,"spk-icon"),u(),o()(),a(35,"spk-menu",58)(36,"button",59),s(37,11),d(38,"strong")(39,"spk-icon"),u(),o(),M(40,60),a(41,"button",57),f("click",function(){return k(_),P(t.setTimeType("relative"))}),p(42,12),o(),a(43,"button",57),f("click",function(){return k(_),P(t.setTimeType("actual"))}),p(44,13),o(),m(),o(),g(45,fn,8,1,"spk-menu",58),o()(),g(46,nt,2,1)(47,tt,5,0),Xe(48,46,Tn,null,47),o()(),g(50,_t,47,29,"ng-template",null,0,Q)(52,lt,6,0,"ng-template",null,1,Q)}n&2&&(r(3),S("routerLink",J(9,Sn)),r(10),S("routerLink",J(10,Cn)),r(16),R("active",t.viewMode()==="list"),r(3),R("active",t.viewMode()==="details"),r(7),y(t.timeType()),x(37),r(6),E(t.viewMode()==="list"?45:-1),r(3),we(!t.backupsLoading()))},dependencies:[je,un,Ye,Qe,Y,en,nn,tn,Je],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem 0}header[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;padding:0 2rem;gap:1rem}spk-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}spk-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.content[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{padding:0 2rem}.content[_ngcontent-%COMP%] .table-buttons[_ngcontent-%COMP%]{min-height:40px}.backups[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem;gap:.5rem}.backup[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem;gap:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;max-width:40%}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font:var(--paragraph-30);color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--base-12)}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.sortable[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none}.sortable[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{margin-left:.5rem;font-size:1rem;justify-self:flex-end;display:none}.sortable[_ngcontent-%COMP%]:not(.sort-asc):not(.sort-desc) spk-icon.filter[_ngcontent-%COMP%]{display:block}.sortable.sort-asc[_ngcontent-%COMP%] spk-icon.asc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}.sortable.sort-desc[_ngcontent-%COMP%] spk-icon.desc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}"],changeDetection:0})};export{ee as default};
1
+ import{a as un}from"./chunk-B3WLZK7W.js";import{c as Z,d as sn}from"./chunk-YKOEKIFQ.js";import"./chunk-XR4SRVOQ.js";import{a as cn}from"./chunk-OHZGASM5.js";import"./chunk-65UN5LE6.js";import{a as ln}from"./chunk-WFM6YWRN.js";import{a as rn}from"./chunk-3AIKVVWP.js";import"./chunk-RHW5QVAY.js";import"./chunk-RSZISHXB.js";import"./chunk-5ENRUF35.js";import"./chunk-ZQSBINUM.js";import"./chunk-3XVU2YA6.js";import{e as je}from"./chunk-5LKXKKAK.js";import"./chunk-HFNFJ7G2.js";import{a as Y,e as qe,f as Je,g as Qe,h as Ye,j as Ze,k as en,o as nn,p as tn,w as on,x as an}from"./chunk-AL5KGNEF.js";import{h as _n}from"./chunk-FRSQ5NDX.js";import"./chunk-RHII5WE3.js";import"./chunk-M3WT5B3C.js";import"./chunk-TCDECRYI.js";import{Ab as z,Ac as b,Bb as V,Bc as G,Cb as K,Cc as Q,Db as a,Eb as o,F as w,Fb as d,Gb as M,Hb as m,Ib as $,Jb as B,Pb as s,Qb as u,Qc as We,Rb as p,Sb as y,Tb as x,Ua as r,Ub as j,Vb as f,Wb as F,Z as L,a as ve,b as W,ea as k,fa as P,gb as he,ic as U,jc as T,kc as ze,lb as g,lc as O,oc as Ve,pc as Ke,qc as Ue,rb as Xe,rc as q,sb as we,ub as S,va as H,vc as J,wb as R,wc as D,zb as E,zc as I}from"./chunk-AHUC7M75.js";import"./chunk-7CGTOI24.js";function pn(...e){let i=H(...e);return Object.defineProperty(i,"value",{get:i.asReadonly(),set:i.set.bind(i)})}function Fn(e,i,n){let t=localStorage.getItem(i);t!=null&&(e=JSON.parse(t));let _=pn(e),c=_[ve];n?.equal&&(c.equal=n.equal);function N(C){C==null?localStorage.removeItem(i):localStorage.setItem(i,JSON.stringify(C))}return _.set=C=>{N(C),W(c,C)},_.update=C=>{let A=C(_());N(A),W(c,A)},_}var Tn=()=>[import("./chunk-RLUT4FSI.js").then(e=>e.NgTemplateOutlet),Y,Ze,an,on,import("./chunk-RKAIZDDW.js").then(e=>e.DurationFormatPipe),import("./chunk-CRJHIWSF.js").then(e=>e.BytesPipe),import("./chunk-G5CT45UH.js").then(e=>e.RelativeTimePipe)],Sn=()=>["/add-backup"],Cn=()=>["/restore"],dn=e=>({$implicit:e}),En=e=>["/backup",e],Mn=e=>["/restore",e],mn=e=>["/backup",e,"export"],On=e=>["/backup",e,"database"],Nn=e=>["/backup",e,"commandline"],kn=e=>["/backup",e,"log"];function Pn(e,i){if(e&1){let n=B();a(0,"button",57),f("click",function(){let _=k(n).$implicit,c=F(2);return P(c.sortByColumn.set(_.value))}),p(1,15),o()}if(e&2){let n=i.$implicit,t=F(2);R("active",t.orderBy()===n.value),r(),y(n.label),x(1)}}function fn(e,i){if(e&1&&(a(0,"spk-menu",58)(1,"button",59),s(2,14),d(3,"strong")(4,"spk-icon"),u(),o(),M(5,60),V(6,Pn,2,3,"button",61,z),m(),o()),e&2){let n=F();r(4),y(n.orderBy()),x(2),r(2),K(n.sortOrderOptions())}}function $n(e,i){if(e&1&&(T(0),I(1,"durationFormat")),e&2){let n=F().$implicit,t=F(4);O(" ",G(1,1,n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDuration,t.timeType()==="actual")," ")}}function Dn(e,i){e&1&&(M(0),p(1,21),m())}function In(e,i){if(e&1&&(T(0),I(1,"bytes")),e&2){let n=F().$implicit;O(" ",b(1,1,n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.SourceFilesSize)," ")}}function An(e,i){e&1&&(M(0),p(1,22),m())}function Rn(e,i){if(e&1&&(T(0),I(1,"bytes")),e&2){let n=F().$implicit;O(" ",b(1,1,n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.TargetFilesSize)," ")}}function Hn(e,i){e&1&&(M(0),p(1,23),m())}function yn(e,i){e&1&&$(0)}function xn(e,i){if(e&1&&(a(0,"div",64)(1,"div",51)(2,"h3"),T(3),a(4,"spk-chip")(5,"spk-icon"),T(6),o(),T(7),o()(),a(8,"p")(9,"span"),p(10,16),o(),T(11),I(12,"relativeTime"),o(),a(13,"p")(14,"span"),p(15,17),o(),g(16,$n,2,4)(17,Dn,2,0,"ng-container"),o(),a(18,"p")(19,"span"),p(20,18),o(),g(21,In,2,3)(22,An,2,0,"ng-container"),o(),a(23,"p")(24,"span"),p(25,19),o(),g(26,Rn,2,3)(27,Hn,2,0,"ng-container"),o()(),q(28),a(29,"spk-chip",65),p(30,20),o(),a(31,"div",55),g(32,yn,1,0,"ng-container",66),o()()),e&2){let n,t=i.$implicit,_=F(4),c=U(51);r(3),O(" ",(n=t.Backup==null?null:t.Backup.Name)!==null&&n!==void 0?n:_.MISSING_BACKUP_NAME," "),r(3),ze(_.getBackendIcon(t.Backup==null?null:t.Backup.TargetURL)),r(),O(" ",_.getBackendType(t.Backup==null?null:t.Backup.TargetURL)," "),r(4),O(" ",G(12,11,t.Backup==null||t.Backup.Metadata==null?null:t.Backup.Metadata.LastBackupDate,_.timeType()==="actual")," "),r(5),E(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.LastBackupDuration?16:17),r(5),E(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.SourceFilesSize?21:22),r(5),E(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.TargetFilesSize?26:27);let N=_.getBackupVersionCount(t);r(4),y(N)(N),x(30),r(2),S("ngTemplateOutlet",c)("ngTemplateOutletContext",D(14,dn,t))}}function Ln(e,i){if(e&1&&V(0,xn,33,16,"div",64,z),e&2){let n=F(3);K(n.backups())}}function Bn(e,i){e&1&&(M(0),p(1,24),m())}function bn(e,i){if(e&1&&(a(0,"div",62),g(1,Ln,2,0)(2,Bn,2,0,"ng-container"),o()),e&2){let n=F(2);r(),E(n.backups().length?1:2)}}function Gn(e,i){e&1&&(s(0,25,1),$(1),u())}function vn(e,i){e&1&&(s(0,26,1),$(1),u())}function hn(e,i){e&1&&(s(0,27,1),$(1),u())}function Xn(e,i){e&1&&(s(0,28,1),$(1),u())}function wn(e,i){e&1&&(s(0,29,1),$(1),u())}function zn(e,i){e&1&&(s(0,30,1),$(1),u())}function Vn(e,i){if(e&1&&(T(0),I(1,"relativeTime")),e&2){let n=F().$implicit,t=F(3);O(" ",G(1,1,n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDate,t.timeType()==="actual")," ")}}function Kn(e,i){e&1&&(M(0),p(1,34),m())}function Un(e,i){if(e&1&&(T(0),I(1,"durationFormat")),e&2){let n=F().$implicit,t=F(3);O(" ",G(1,1,n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDuration,t.timeType()==="actual")," ")}}function Wn(e,i){e&1&&(M(0),p(1,35),m())}function jn(e,i){if(e&1&&(T(0),I(1,"bytes")),e&2){let n=F().$implicit;O(" ",b(1,1,n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.SourceFilesSize)," ")}}function qn(e,i){e&1&&(M(0),p(1,36),m())}function Jn(e,i){if(e&1&&(T(0),I(1,"bytes")),e&2){let n=F().$implicit;O(" ",b(1,1,n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.TargetFilesSize)," ")}}function Qn(e,i){e&1&&(M(0),p(1,37),m())}function Yn(e,i){e&1&&$(0)}function Zn(e,i){if(e&1&&(a(0,"tr")(1,"td"),T(2),o(),a(3,"td"),T(4),o(),a(5,"td"),g(6,Vn,2,4)(7,Kn,2,0,"ng-container"),o(),a(8,"td"),g(9,Un,2,4)(10,Wn,2,0,"ng-container"),o(),a(11,"td"),g(12,jn,2,3)(13,qn,2,0,"ng-container"),o(),a(14,"td"),g(15,Jn,2,3)(16,Qn,2,0,"ng-container"),o(),a(17,"td"),q(18),a(19,"span"),p(20,33),o()(),a(21,"td"),g(22,Yn,1,0,"ng-container",66),o()()),e&2){let n,t=i.$implicit,_=F(3),c=U(51);r(2),O(" ",(n=t.Backup==null?null:t.Backup.Name)!==null&&n!==void 0?n:_.MISSING_BACKUP_NAME," "),r(2),O(" ",_.getBackendType(t.Backup==null?null:t.Backup.TargetURL)," "),r(2),E(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.LastBackupDate?6:7),r(3),E(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.LastBackupDuration?9:10),r(3),E(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.SourceFilesSize?12:13),r(3),E(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.TargetFilesSize?15:16);let N=_.getBackupVersionCount(t);r(5),y(N)(N),x(20),r(2),S("ngTemplateOutlet",c)("ngTemplateOutletContext",D(10,dn,t))}}function et(e,i){if(e&1){let n=B();a(0,"spk-table",67),Ue("sortByColumnChange",function(_){k(n);let c=F(2);return Ke(c.sortByColumn,_)||(c.sortByColumn=_),P(_)}),a(1,"tr",68)(2,"th",69),s(3,25),g(4,Gn,2,0,"ng-container",70),u(),o(),a(5,"th",71),s(6,26),g(7,vn,2,0,"ng-container",70),u(),o(),a(8,"th",72),s(9,27),g(10,hn,2,0,"ng-container",70),u(),o(),a(11,"th",73),s(12,28),g(13,Xn,2,0,"ng-container",70),u(),o(),a(14,"th",74),s(15,29),g(16,wn,2,0,"ng-container",70),u(),o(),a(17,"th",75),s(18,30),g(19,zn,2,0,"ng-container",70),u(),o(),a(20,"th"),p(21,31),o(),a(22,"th"),p(23,32),o()(),V(24,Zn,23,12,"tr",null,z),o()}if(e&2){let n=F(2),t=U(53);S("data",n.backups())("loading",n.backupsLoading()),Ve("sortByColumn",n.sortByColumn),r(4),S("ngTemplateOutlet",t),r(3),S("ngTemplateOutlet",t),r(3),S("ngTemplateOutlet",t),r(3),S("ngTemplateOutlet",t),r(3),S("ngTemplateOutlet",t),r(3),S("ngTemplateOutlet",t),r(5),K(n.backups())}}function nt(e,i){if(e&1&&g(0,bn,3,1,"div",62)(1,et,26,9,"spk-table",63),e&2){let n=F();E(n.viewMode()==="list"?0:n.viewMode()==="details"?1:-1)}}function tt(e,i){e&1&&(a(0,"div",76),d(1,"spk-progress-bar",77),a(2,"div",51)(3,"h3"),p(4,38),o()()())}function it(e,i){e&1&&p(0,39,1)}function ot(e,i){e&1&&(a(0,"spk-icon"),T(1,"check"),o())}function at(e,i){e&1&&(a(0,"spk-icon"),T(1,"dots-three-vertical"),o())}function _t(e,i){if(e&1){let n=B();a(0,"button",78),f("click",function(){let _=k(n).$implicit,c=F();return P(c.startBackup(_.Backup==null?null:_.Backup.ID))}),s(1,39),d(2,"spk-icon"),g(3,it,1,0),u(),o(),a(4,"button",79)(5,"spk-icon"),T(6,"pencil-simple"),o()(),a(7,"spk-menu",80)(8,"button",52),g(9,ot,2,0,"spk-icon")(10,at,2,0,"spk-icon"),o(),M(11,60),a(12,"h3",81),T(13,"Operations"),o(),a(14,"button",82),s(15,40),d(16,"spk-icon"),u(),o(),a(17,"button",82),s(18,41),d(19,"spk-icon"),u(),o(),a(20,"button",83),f("click",function(){let _=k(n).$implicit,c=F();return P(c.deleteBackup(_.Backup==null?null:_.Backup.ID))}),s(21,42),d(22,"spk-icon"),u(),o(),d(23,"spk-divider"),a(24,"h3",81),T(25,"Advanced"),o(),a(26,"button",82),s(27,43),d(28,"spk-icon"),u(),o(),a(29,"button",57),f("click",function(){let _=k(n).$implicit,c=F();return P(c.verifyFiles(_.Backup==null?null:_.Backup.ID))}),s(30,44),d(31,"spk-icon"),u(),o(),a(32,"button",57),f("click",function(){let _=k(n).$implicit,c=F();return P(c.compressBackup(_.Backup==null?null:_.Backup.ID))}),s(33,45),d(34,"spk-icon"),u(),o(),a(35,"button",82),s(36,46),d(37,"spk-icon"),u(),o(),d(38,"spk-divider"),a(39,"h3",81),T(40,"Reporting"),o(),a(41,"button",82),s(42,47),d(43,"spk-icon"),u(),o(),a(44,"button",57),f("click",function(){let _=k(n).$implicit,c=F();return P(c.createErrorReport(_.Backup==null?null:_.Backup.ID))}),s(45,48),d(46,"spk-icon"),u(),o(),m(),o()}if(e&2){let n=i.$implicit,t=F();R("loader",t.startingBackup()===(n.Backup==null?null:n.Backup.ID)),r(3),E(t.viewMode()==="list"?3:-1),r(),S("routerLink",D(17,En,n.Backup==null?null:n.Backup.ID)),r(3),S("right",!0),r(),R("loader",t.loadingId()===(n.Backup==null?null:n.Backup.ID))("success",t.successId()===(n.Backup==null?null:n.Backup.ID)),r(),E(t.successId()===(n.Backup==null?null:n.Backup.ID)?9:10),r(5),S("routerLink",D(19,Mn,n.Backup==null?null:n.Backup.ID)),r(3),S("routerLink",D(21,mn,n.Backup==null?null:n.Backup.ID)),r(3),R("loader",t.deletingBackup()===(n.Backup==null?null:n.Backup.ID)),r(6),S("routerLink",D(23,On,n.Backup==null?null:n.Backup.ID)),r(9),S("routerLink",D(25,Nn,n.Backup==null?null:n.Backup.ID)),r(6),S("routerLink",D(27,kn,n.Backup==null?null:n.Backup.ID))}}function lt(e,i){e&1&&(a(0,"spk-icon",84),T(1,"funnel-simple"),o(),a(2,"spk-icon",85),T(3,"sort-ascending"),o(),a(4,"spk-icon",86),T(5,"sort-descending"),o())}var gn={file:{Display:$localize`Local`,Icon:null}},ee=class e{#e=L(ln);#t=L(qe);#n=L(_n);#i=L(cn);MISSING_BACKUP_NAME=$localize`Backup name missing`;sortOrderOptions=this.#e.orderByOptions;orderBy=this.#e.orderBy;backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;startingBackup=this.#e.startingBackup;deletingBackup=this.#e.deletingBackup;timeType=this.#e.timeType;viewMode=Fn("list","viewMode");sortByColumn=H("name");loadingId=H(null);successId=H(null);sortEffect=We(()=>this.#e.setOrderBy(this.sortByColumn()));ngOnInit(){this.#e.getBackups(!0)}setOrderBy(i){this.#e.setOrderBy(i)}setTimeType(i){this.#e.setTimeType(i)}startBackup(i){this.#i.resumeDialogCheck(()=>this.#e.startBackup(i))}getBackendIcon(i){if(!i)return"";let n=i.split("://")[0],t=Z.find(c=>c.key===n);if(!t)return"database";let _=gn[t.key];return _?.Icon?_.Icon:"database"}getBackendType(i){if(!i)return"";let n=i.split("://")[0],t=Z.find(c=>c.key===n);if(!t)return"";let _=gn[t.key];if(_?.Display)return _.Display;if(t.key==="s3"){let c="http://null?"+i.split("?")[1],C=new URL(c).searchParams.get("s3-server-name")?.toLowerCase()??"";for(let[A,v]of Object.entries(sn))if(C.endsWith(A))return v}return t.displayName}getBackupVersionCount(i){return parseInt(i?.Backup?.Metadata?.BackupListCount??"",10)||0}deleteBackup(i){this.loadingId.set(i),this.#t.open(rn,{data:{title:$localize`Confirm delete`,message:$localize`Are you sure you want to delete this backup?`,confirmText:$localize`Delete backup`,cancelText:$localize`Cancel`},closed:n=>{n&&this.#e.deleteBackup(i)}})}verifyFiles(i){this.loadingId.set(i),this.#n.postApiV1BackupByIdVerify({id:i}).pipe(w(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(i),setTimeout(()=>this.successId.set(null),2e3)}})}compressBackup(i){this.loadingId.set(i),this.#n.postApiV1BackupByIdCompact({id:i}).pipe(w(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(i),setTimeout(()=>this.successId.set(null),2e3)}})}createErrorReport(i){this.loadingId.set(i),this.#n.postApiV1BackupByIdCreatereport({id:i}).pipe(w(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(i),setTimeout(()=>this.successId.set(null),2e3)}})}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=he({type:e,selectors:[["app-home"]],decls:54,vars:11,consts:()=>{let i;i=$localize`Backups`;let n;n=$localize`Backups are stored in the cloud and can be restored at any time.`;let t;t=$localize` Add ${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let _;_=$localize`Restores`;let c;c=$localize`Restores allow you to restore your data from the cloud.`;let N;N=$localize` Start ${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let C;C=$localize`My backups`;let A;A=$localize`${"\uFFFD#31\uFFFD"}:START_TAG_SPK_ICON:rows${"\uFFFD/#31\uFFFD"}:CLOSE_TAG_SPK_ICON: List `;let v;v=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SPK_ICON:list${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SPK_ICON: Details `;let ne;ne=$localize` Time: ${"\uFFFD#38\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#39\uFFFD"}:START_TAG_SPK_ICON:clock${"\uFFFD/#39\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let te;te=$localize`Relative time`;let ie;ie=$localize`Actual time`;let oe;oe=$localize` Order by: ${"\uFFFD#3\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#4\uFFFD"}:START_TAG_SPK_ICON:arrows-down-up${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let ae;ae=$localize` ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let _e;_e=$localize`Last successful backup:`;let le;le=$localize`Duration:`;let re;re=$localize`Source:`;let ce;ce=$localize`Destination:`;let h;h=$localize`{VAR_PLURAL, plural, =0 {No version yet} =1 {1 Version} other {{INTERPOLATION} Versions}}`,h=j(h,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let se;se=$localize` ${h}:ICU@@6502601490918455200: `;let ue;ue=$localize`N/A`;let pe;pe=$localize`N/A`;let Fe;Fe=$localize`N/A`;let ge;ge=$localize`No backups founds`;let de;de=$localize` Backup ${"\uFFFD*4:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*4:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Te;Te=$localize` Type ${"\uFFFD*7:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*7:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Se;Se=$localize` Last successful backup ${"\uFFFD*10:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*10:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Ce;Ce=$localize` Duration ${"\uFFFD*13:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*13:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Ee;Ee=$localize` Source ${"\uFFFD*16:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*16:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Me;Me=$localize` Destination ${"\uFFFD*19:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*19:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let me;me=$localize`Version`;let Oe;Oe=$localize`Actions`;let X;X=$localize`{VAR_PLURAL, plural, =0 {No version yet} =1 {1 Version} other {{INTERPOLATION} Versions}}`,X=j(X,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let Ne;Ne=$localize` ${X}:ICU@@6502601490918455200: `;let ke;ke=$localize`N/A`;let Pe;Pe=$localize`N/A`;let fe;fe=$localize`N/A`;let $e;$e=$localize`N/A`;let De;De=$localize`Loading backups...`;let Ie;Ie=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:play-circle${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:${"\uFFFD*3:1\uFFFD"}:START_BLOCK_IF: Start ${"\uFFFD/*3:1\uFFFD"}:CLOSE_BLOCK_IF:`;let Ae;Ae=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SPK_ICON:clock-counter-clockwise${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SPK_ICON: Restore `;let Re;Re=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SPK_ICON:export${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SPK_ICON: Export `;let He;He=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:x-circle${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON: Delete `;let ye;ye=$localize`${"\uFFFD#28\uFFFD"}:START_TAG_SPK_ICON:database${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SPK_ICON: Database `;let xe;xe=$localize`${"\uFFFD#31\uFFFD"}:START_TAG_SPK_ICON:check-square-offset${"\uFFFD/#31\uFFFD"}:CLOSE_TAG_SPK_ICON: Verify files `;let Le;Le=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SPK_ICON:file-archive${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SPK_ICON: Compress now `;let Be;Be=$localize`${"\uFFFD#37\uFFFD"}:START_TAG_SPK_ICON:terminal-window${"\uFFFD/#37\uFFFD"}:CLOSE_TAG_SPK_ICON: Commandline `;let be;be=$localize`${"\uFFFD#43\uFFFD"}:START_TAG_SPK_ICON:notepad${"\uFFFD/#43\uFFFD"}:CLOSE_TAG_SPK_ICON: Log `;let Ge;return Ge=$localize`${"\uFFFD#46\uFFFD"}:START_TAG_SPK_ICON:file-plus${"\uFFFD/#46\uFFFD"}:CLOSE_TAG_SPK_ICON: Create error report `,[["actions",""],["sortIcons",""],i,n,t,_,c,N,C,A,v,ne,te,ie,oe,ae,_e,le,re,ce,se,ue,pe,Fe,ge,de,Te,Se,Ce,Ee,Me,me,Oe,Ne,ke,Pe,fe,$e,De,Ie,Ae,Re,He,ye,xe,Le,Be,be,Ge,[1,"type-a",3,"routerLink"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["type","button","spk-button",""],["src","assets/images/restore.png","alt","","width","48px"],[1,"content"],[1,"actions"],[1,"small"],["type","button",3,"click"],[1,"table-overview"],["type","button","spk-button","",1,"small","table-buttons"],["menu",""],["type","button",3,"active"],[1,"backups"],[1,"type-b",3,"data","loading","sortByColumn"],[1,"backup"],[1,"simple","success"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"type-b",3,"sortByColumnChange","data","loading","sortByColumn"],["table-header",""],["spkSort","name"],[4,"ngTemplateOutlet"],["spkSort","type"],["spkSort","lastrun"],["spkSort","duration"],["spkSort","sourcesize"],["spkSort","destinationsize"],[1,"loading-list"],[1,"indeterminate","primary"],["spk-button","",3,"click"],["type","button","spk-button","",3,"routerLink"],[3,"right"],["title",""],["type","button",3,"routerLink"],[3,"click"],[1,"filter"],[1,"asc"],[1,"desc"]]},template:function(n,t){if(n&1){let _=B();d(0,"app-status-bar"),a(1,"section")(2,"header")(3,"spk-card",49),d(4,"img",50),a(5,"div",51)(6,"h3"),p(7,2),o(),a(8,"p"),p(9,3),o()(),a(10,"button",52),s(11,4),d(12,"spk-icon"),u(),o()(),a(13,"spk-card",49),d(14,"img",53),a(15,"div",51)(16,"h3"),p(17,5),o(),a(18,"p"),p(19,6),o()(),a(20,"button",52),s(21,7),d(22,"spk-icon"),u(),o()()(),a(23,"div",54)(24,"h2"),M(25),p(26,8),m(),a(27,"div",55)(28,"spk-button-group",56)(29,"button",57),f("click",function(){return k(_),P(t.viewMode.set("list"))}),s(30,9),d(31,"spk-icon"),u(),o(),a(32,"button",57),f("click",function(){return k(_),P(t.viewMode.set("details"))}),s(33,10),d(34,"spk-icon"),u(),o()(),a(35,"spk-menu",58)(36,"button",59),s(37,11),d(38,"strong")(39,"spk-icon"),u(),o(),M(40,60),a(41,"button",57),f("click",function(){return k(_),P(t.setTimeType("relative"))}),p(42,12),o(),a(43,"button",57),f("click",function(){return k(_),P(t.setTimeType("actual"))}),p(44,13),o(),m(),o(),g(45,fn,8,1,"spk-menu",58),o()(),g(46,nt,2,1)(47,tt,5,0),Xe(48,46,Tn,null,47),o()(),g(50,_t,47,29,"ng-template",null,0,Q)(52,lt,6,0,"ng-template",null,1,Q)}n&2&&(r(3),S("routerLink",J(9,Sn)),r(10),S("routerLink",J(10,Cn)),r(16),R("active",t.viewMode()==="list"),r(3),R("active",t.viewMode()==="details"),r(7),y(t.timeType()),x(37),r(6),E(t.viewMode()==="list"?45:-1),r(3),we(!t.backupsLoading()))},dependencies:[je,un,Ye,Qe,Y,en,nn,tn,Je],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem 0}header[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;padding:0 2rem;gap:1rem}spk-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}spk-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.content[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{padding:0 2rem}.content[_ngcontent-%COMP%] .table-buttons[_ngcontent-%COMP%]{min-height:40px}.backups[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem;gap:.5rem}.backup[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem;gap:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;max-width:40%}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font:var(--paragraph-30);color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--base-12)}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.sortable[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none}.sortable[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{margin-left:.5rem;font-size:1rem;justify-self:flex-end;display:none}.sortable[_ngcontent-%COMP%]:not(.sort-asc):not(.sort-desc) spk-icon.filter[_ngcontent-%COMP%]{display:block}.sortable.sort-asc[_ngcontent-%COMP%] spk-icon.asc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}.sortable.sort-desc[_ngcontent-%COMP%] spk-icon.desc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}"],changeDetection:0})};export{ee as default};
@@ -1 +1 @@
1
- import{b as a,c as b,d as c}from"./chunk-RXHYUPYG.js";import"./chunk-KHGD372Q.js";import"./chunk-LDJVMU7P.js";import"./chunk-LJDOQTEF.js";import"./chunk-B64M2BXZ.js";import"./chunk-NF3MS2YP.js";import"./chunk-XR4SRVOQ.js";import"./chunk-WZRSQ7XL.js";import"./chunk-3AIKVVWP.js";import"./chunk-RHW5QVAY.js";import"./chunk-5ENRUF35.js";import"./chunk-5LKXKKAK.js";import"./chunk-HFNFJ7G2.js";import"./chunk-AL5KGNEF.js";import"./chunk-FRSQ5NDX.js";import"./chunk-M3WT5B3C.js";import"./chunk-AHUC7M75.js";import"./chunk-7CGTOI24.js";export{a as createDestinationForm,b as createDestinationFormGroup,c as default};
1
+ import{b as a,c as b,d as c}from"./chunk-IQFSWP4W.js";import"./chunk-KHGD372Q.js";import"./chunk-LDJVMU7P.js";import"./chunk-LJDOQTEF.js";import"./chunk-YKOEKIFQ.js";import"./chunk-NF3MS2YP.js";import"./chunk-XR4SRVOQ.js";import"./chunk-WZRSQ7XL.js";import"./chunk-3AIKVVWP.js";import"./chunk-RHW5QVAY.js";import"./chunk-5ENRUF35.js";import"./chunk-5LKXKKAK.js";import"./chunk-HFNFJ7G2.js";import"./chunk-AL5KGNEF.js";import"./chunk-FRSQ5NDX.js";import"./chunk-M3WT5B3C.js";import"./chunk-AHUC7M75.js";import"./chunk-7CGTOI24.js";export{a as createDestinationForm,b as createDestinationFormGroup,c as default};
@@ -0,0 +1 @@
1
+ import{a as h}from"./chunk-XR4SRVOQ.js";import{d as k,r as C}from"./chunk-5ENRUF35.js";import{h as b}from"./chunk-FRSQ5NDX.js";import{T as P,Z as v,r as D,va as F}from"./chunk-AHUC7M75.js";import{a}from"./chunk-7CGTOI24.js";var d=class t{#t=v(b);s3Providers=h(this.getS3Config("Providers"));s3Regions=h(this.getS3Config("Regions"));s3RegionHosts=h(this.getS3Config("RegionHosts"));s3StorageClasses=h(this.getS3Config("StorageClasses"));storjSatellites=h(this.getStorjConfig("Satellites"));storjAuthenticationMethods=h(this.getStorjConfig("AuthenticationMethods"));openstackProviders=h(this.getOpenstackConfig("Providers"));openstackVersions=h(this.getOpenstackConfig("Versions"));gcsLocations=h(this.getGcsConfig("Locations"));gcsStorageClasses=h(this.getGcsConfig("StorageClasses"));getS3Config(e){return this.#t.postApiV1WebmoduleByModulekey({modulekey:"s3-getconfig",requestBody:{"s3-config":e}}).pipe(D(r=>this.#e(r)))}createS3IamUser(e,r){return this.#t.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"CanCreateUser","s3-username":e,"s3-password":r}})}createS3PolicyIAM(e){return this.#t.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"GetPolicyDoc",path:e}})}getStorjConfig(e){return this.#t.postApiV1WebmoduleByModulekey({modulekey:"storj-getconfig",requestBody:{"storj-config":e}}).pipe(D(r=>this.#e(r)))}getOpenstackConfig(e){return this.#t.postApiV1WebmoduleByModulekey({modulekey:"openstack-getconfig",requestBody:{"openstack-config":e}}).pipe(D(r=>this.#e(r)))}getGcsConfig(e){return this.#t.postApiV1WebmoduleByModulekey({modulekey:"gcs-getconfig",requestBody:{"gcs-config":e}}).pipe(D(r=>this.#e(r)))}#e(e){return(e.Result&&typeof e.Result=="object"&&Object.entries(e.Result).map(([r,n])=>({key:r,value:n})))??[]}static \u0275fac=function(r){return new(r||t)};static \u0275prov=P({token:t,factory:t.\u0275fac,providedIn:"root"})};var o=new C,m={type:"error",message:$localize`Using double leading slashes is most likely wrong, and will result in objects being created with a leading slash in the name.`},f=[{key:"file",displayName:"File system",description:"Store backups on your local file system.",customFields:{path:{type:"FolderTree",name:"path",doubleSlash:m,shortDescription:"File path",longDescription:"The path to store the backup",formElement:t=>o.control(t??"")}},mapper:{to:t=>{let e=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${t.custom.path}${e}`},from:(t,e,r)=>{let s=r.startsWith("file:///")?r.split("file:///")[1]:r.split("file://")[1],p=s.startsWith("%"),g=s.slice(1).startsWith(":\\")||p?s:"/"+s;return a({destinationType:t,custom:{path:g}},i(t,e))}}},{key:"ssh",displayName:"SSH",description:"Store backups in SSH.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"The server to connect to",formElement:t=>o.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"The port to connect to",formElement:t=>o.control(t??"",[k.required,k.max(65535)])},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",doubleSlash:{type:"warning",message:$localize`Using double leading slashes makes the path absolute, pointing to the root of the filesystem.`},formElement:t=>o.control(t??"")}},dynamicFields:[{type:"String",name:"auth-username",shortDescription:"Username for authentication",longDescription:"Username for authentication with the server",formElement:t=>o.control(t??"")},{type:"Password",name:"auth-password",shortDescription:"Password for authentication",longDescription:"Password for authentication with the server. If a private key is used, this value is used as the password to decrypt the private key.",formElement:t=>o.control(t??"")}],advancedFields:[{type:"FileTree",name:"ssh-keyfile",accepts:".key,",shortDescription:"Private key path",longDescription:"This is a path to a private key file locally on the machine"},{type:"FreeText",name:"ssh-key",shortDescription:"SSH private key (PEM format)",longDescription:"Enter a PEM formatted SSH private key. OpenSSL, OpenSSH, and ssh.com formats are supported."}],mapper:{to:t=>{let e=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{port:r,server:n,path:s}=t.custom;return`${t.destinationType}://${n+y(r)+l(s)+e}`},from:(t,e,r)=>a({destinationType:t,custom:{server:e.hostname,port:e.port,path:e.pathname}},i(t,e))}},{key:"s3",displayName:"S3 Compatible",description:"Store backups in any S3 compatible bucket.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:t=>o.control(t??"")},path:{type:"Path",name:"path",doubleSlash:m,shortDescription:"Folder path",longDescription:"Folder path",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"s3-server-name",shortDescription:"Server",type:"NonValidatedSelectableString",loadOptions:t=>t.get(d).s3Providers},"use-ssl","auth-username","auth-password"],advancedFields:[{name:"s3-client",type:"Enumeration",options:["aws","minio"]},{name:"s3-storage-class",type:"NonValidatedSelectableString",loadOptions:t=>t.get(d).s3StorageClasses}],mapper:{to:t=>{let{bucket:e,path:r}=t.custom,n=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${e+l(r)+n}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.pathname,bucket:e.hostname}},i(t,e))}},{key:"gcs",displayName:"Google Cloud Storage",description:"Store backups in Google Cloud Storage.",oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:m,shortDescription:"Bucket name",longDescription:"Bucket name",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"gcs-location",type:"NonValidatedSelectableString",loadOptions:t=>t.get(d).gcsLocations},{name:"gcs-storage-class",type:"NonValidatedSelectableString",loadOptions:t=>t.get(d).gcsStorageClasses},"authid"],mapper:{to:t=>{let e=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${t.custom.path}${e}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.hostname+e.pathname}},i(t,e))}},{key:"googledrive",displayName:"Google Drive",description:"Store backups in Google Drive.",oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:m,shortDescription:"Folder path",longDescription:"Folder path",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"authid",type:"Password"}],mapper:{to:t=>{let e=t.custom.path,r=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${e}${r}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.hostname+e.pathname}},i(t,e))}},{key:"pcloud",displayName:"pCloud",description:"Store backups in pCloud.",oauthField:"authid",customFields:{server:{type:"Enumeration",name:"server",loadOptions:()=>F([{key:"pCloud Global",value:"api.pcloud.com"},{key:"pCloud Europe",value:"eapi.pcloud.com"}]),shortDescription:"Server",longDescription:"Server",formElement:t=>o.control(t??"")},path:{type:"Path",name:"path",doubleSlash:m,shortDescription:"Folder path",longDescription:"Folder path",formElement:t=>o.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let e=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{server:r,path:n}=t.custom;return`${t.destinationType}://${r+l(n)+e}`},from:(t,e,r)=>{let n=e.pathname.replace(/^\//,"");return a({destinationType:t,custom:{server:e.hostname,path:n}},i(t,e))}}},{key:"azure",displayName:"Azure Blob Storage",description:"Store backups in Azure Blob Storage.",customFields:{path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Container name",longDescription:"Container name",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:t=>{let e=t.custom.path,r=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${e}${r}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.hostname+e.pathname}},i(t,e))}},{key:"onedrivev2",displayName:"OneDrive",description:"Store backups in OneDrive.",oauthField:"authid",customFields:{path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let e=t.custom.path,r=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${e}${r}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.hostname+e.pathname}},i(t,e))}},{key:"od4b",displayName:"OneDrive Business",description:"Store backups in OneDrive Business.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>o.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>o.control(t??"")},path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:t=>{let e=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{port:r,server:n,path:s}=t.custom;return`${t.destinationType}://${n+y(r)+l(s)+e}`},from:(t,e,r)=>a({destinationType:t,custom:{server:e.hostname,port:e.port,path:e.pathname}},i(t,e))}},{key:"mssp",displayName:"Microsoft SharePoint",description:"Store backups in Microsoft SharePoint.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>o.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>o.control(t??"")},path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:t=>{let e=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{port:r,server:n,path:s}=t.custom;return`${t.destinationType}://${n+y(r)+l(s)+e}`},from:(t,e,r)=>a({destinationType:t,custom:{server:e.hostname,port:e.port,path:e.pathname}},i(t,e))}},{key:"sharepoint",displayName:"Microsoft SharePoint v2",description:"Store backups in Microsoft SharePoint.",oauthField:"authid",customFields:{path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let e=t.custom.path,r=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${e}${r}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.hostname+e.pathname}},i(t,e))}},{key:"dropbox",displayName:"Dropbox",description:"Store backups in Dropbox.",oauthField:"authid",customFields:{path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let e=t.custom.path,r=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${e}${r}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.hostname+e.pathname}},i(t,e))}},{key:"box",displayName:"Box.com",description:"Store backups in Box.com.",oauthField:"authid",customFields:{path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let e=t.custom.path,r=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${e}${r}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.hostname+e.pathname}},i(t,e))}},{key:"jottacloud",displayName:"Jottacloud",description:"Store backups in Jottacloud.",oauthField:"authid",customFields:{path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let e=t.custom.path,r=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${e}${r}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.hostname+e.pathname}},i(t,e))}},{key:"b2",displayName:"B2 Cloud Storage",description:"Store backups in B2 Cloud Storage.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:t=>o.control(t??"")},path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path in the bucket",longDescription:"Path in the bucket",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Application ID"},{name:"auth-password",shortDescription:"Application Key"}],mapper:{to:t=>{let{bucket:e,path:r}=t.custom,n=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${e+l(r)+n}`},from:(t,e,r)=>a({destinationType:t,custom:{bucket:e.hostname,path:decodeURIComponent(e.pathname)}},i(t,e))}},{key:"e2",displayName:"IDrive e2",description:"Store backups in IDrive e2.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:t=>o.control(t??"")},path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path in the bucket",longDescription:"Path in the bucket",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Access ID"},{name:"auth-password",shortDescription:"Access Secret"}],mapper:{to:t=>{let{bucket:e,path:r}=t.custom,n=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${e+l(r)+n}`},from:(t,e,r)=>a({destinationType:t,custom:{bucket:e.hostname,path:e.pathname}},i(t,e))}},{key:"mega",displayName:"Mega.nz",description:"Store backups in Mega.nz.",customFields:{path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:t=>{let e=t.custom.path,r=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${e}${r}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.hostname+e.pathname}},i(t,e))}},{key:"msgroup",displayName:"Microsoft Office 365 Group",description:"Store backups in Microsoft Office 365 Group.",oauthField:"authid",customFields:{groupEmail:{type:"Email",name:"groupEmail",shortDescription:"Group email",longDescription:"Group email",formElement:t=>o.control(t??"",[k.email])},path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let e=t.custom.path,r=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${e}${r}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.hostname+e.pathname}},i(t,e))}},{key:"cloudfiles",displayName:"Rackspace CloudFiles",description:"Store backups in Rackspace CloudFiles.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>o.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>o.control(t??"")},path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:t=>{let e=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{port:r,server:n,path:s}=t.custom;return`${t.destinationType}://${n+y(r)+l(s)+e}`},from:(t,e,r)=>a({destinationType:t,custom:{server:e.hostname,port:e.port,path:e.pathname}},i(t,e))}},{key:"rclone",displayName:"Rclone",description:"Store backups in Rclone.",dynamicFields:[{name:"rclone-local-repository",shortDescription:"Local repository",defaultValue:""},{name:"rclone-remote-repository",shortDescription:"Remote repository",defaultValue:""},{name:"rclone-remote-path",shortDescription:"Path on remote repository",defaultValue:""}],mapper:{to:t=>{let e=t.dynamic["rclone-remote-repository"],r=t.dynamic["rclone-remote-path"],n=Object.entries(t.dynamic).filter(([p])=>!["rclone-remote-repository","rclone-remote-path"].includes(p)),s=c([...Object.entries(t.advanced),...n]);return`${t.destinationType}://${e}/${r+s}`},from:(t,e,r)=>{let{advanced:n,dynamic:s}=i(t,e);return a({destinationType:t,dynamic:a({"rclone-remote-repository":e.hostname,"rclone-remote-path":e.pathname},s)},n)}}},{key:"openstack",displayName:"OpenStack Object Storage",description:"Store backups in OpenStack Object Storage.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket",longDescription:"Bucket",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"openstack-authuri",shortDescription:"Auth URI",type:"Enumeration",loadOptions:t=>t.get(d).openstackProviders},{name:"openstack-version",shortDescription:"Version",type:"Enumeration",loadOptions:t=>t.get(d).openstackVersions},{name:"openstack-domain-name",shortDescription:"Domain name"},{name:"openstack-tenant-name",shortDescription:"Tenant name"},{name:"openstack-region",shortDescription:"Region"}],mapper:{to:t=>{let e=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{bucket:r}=t.custom;return`${t.destinationType}://${r+e}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.pathname,bucket:e.hostname}},i(t,e))}},{key:"webdav",displayName:"WebDAV",description:"Store backups in WebDAV.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>o.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>o.control(t??"")},path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"use-ssl",shortDescription:"Use SSL"},{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:t=>{let{port:e,server:r,path:n}=t.custom,s=t.dynamic["use-ssl"],p=c([...Object.entries(t.advanced),...Object.entries(t.dynamic).filter(([u])=>u!=="use-ssl")]);return`${t.destinationType}${s?"s":""}://${r+y(e)+l(n)+p}`},from:(t,e,r)=>a({destinationType:t,custom:{server:e.hostname,port:e.port,path:e.pathname}},i(t,e))}},{key:"aftp",displayName:"FTP",description:"Store backups in FTP.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>o.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>o.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",doubleSlash:{type:"warning",message:$localize`Using double leading slashes makes the path absolute, pointing to the root of the filesystem.`},formElement:t=>o.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:t=>{let{port:e,server:r,path:n}=t.custom,s=c([...Object.entries(t.advanced),...Object.entries(t.dynamic).filter(([p])=>p!=="use-ssl")]);return`${t.destinationType}://${r+y(e)+l(n)+s}`},from:(t,e,r)=>a({destinationType:t,custom:{server:e.hostname,port:e.port,path:e.pathname}},i(t,e))}},{key:"sia",displayName:"Sia Decentrilized Cloud",description:"Store backups in Sia Decentrilized Cloud.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>o.control(t??"")}},dynamicFields:["sia-targetpath","sia-password","sia-redundancy"],mapper:{to:t=>{let e=t.custom.server,r=t.dynamic["sia-targetpath"],n=c([...Object.entries(t.advanced),...Object.entries(t.dynamic).filter(([s])=>s!=="sia-targetpath")]);return`${t.destinationType}://${e+l(r)+n}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.pathname}},i(t,e))}},{key:"cos",displayName:"Tencent COS",description:"Store backups in Tencent COS.",customFields:{path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"cos-bucket",shortDescription:"Bucket",order:1},{name:"cos-region",shortDescription:"Region",order:2},{name:"cos-app-id",shortDescription:"COS App Id",order:3},{name:"cos-secret-id",shortDescription:"COS Secret Id",order:4},{name:"cos-secret-key",shortDescription:"COS Secret Key",order:5}],mapper:{to:t=>{let e=t.custom.path,r=c([...Object.entries(t.advanced),...Object.entries(t.dynamic).filter(([n])=>n!=="cos-targetpath")]);return`${t.destinationType}://${e+r}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.pathname}},i(t,e))}},{key:"tahoe",displayName:"Tahoe LAFS",description:"Store backups in Tahoe LAFS.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>o.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>o.control(t??"")},path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"use-ssl",shortDescription:"Use SSL"}],mapper:{to:t=>{let{port:e,server:r,path:n,username:s,password:p}=t.custom,u={"auth-username":s,"auth-password":p},g=t.dynamic["use-ssl"],S=c([...Object.entries(t.advanced),...Object.entries(t.dynamic).filter(([O])=>O!=="use-ssl"),...Object.entries(u)]);return`${t.destinationType}${g?"s":""}://${r+y(e)+l(n)+S}`},from:(t,e,r)=>a({destinationType:t,custom:{server:e.hostname,port:e.port,path:e.pathname}},i(t,e))}},{key:"cifs",displayName:"CIFS",description:"Store backups in CIFS.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>o.control(t??"")},share:{type:"String",name:"share",shortDescription:"Share Name",longDescription:"Share Name",formElement:t=>o.control(t??"")},path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:["transport","auth-username","auth-password","auth-domain"],mapper:{to:t=>{let{share:e,server:r,path:n,username:s,password:p}=t.custom,u={"auth-username":s,"auth-password":p},g=new Map([...Object.entries(u),...Object.entries(t.advanced),...Object.entries(t.dynamic)]),S=c(Array.from(g));return`${t.destinationType}://${r+l(e)+l(n)+S}`},from:(t,e,r)=>{let n=e.pathname.split("/")[1],s=e.pathname.split("/").slice(2).join("/");return a({destinationType:t,custom:{server:e.hostname,share:n,path:s}},i(t,e))}}},{key:"filen",displayName:"Filen.io",description:"Store backups in Filen.io.",customFields:{path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on Filen",longDescription:"Path on Filen",formElement:t=>o.control(t??"")}},dynamicFields:["auth-username","auth-password"],mapper:{to:t=>{let{path:e,username:r,password:n}=t.custom,s={"auth-username":r,"auth-password":n},p=new Map([...Object.entries(s),...Object.entries(t.advanced),...Object.entries(t.dynamic)]),u=c(Array.from(p));return`${t.destinationType}://${e+u}`},from:(t,e,r)=>{let n=e.hostname??"";return e.pathname&&n!==""&&e.pathname[0]!="/"&&(n+="/"),n+=e.pathname,a({destinationType:t,custom:{path:n}},i(t,e))}}},{key:"filejump",displayName:"Filejump",description:"Store backups in Filejump.",customFields:{path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on Filejump",longDescription:"Path on Filejump",formElement:t=>o.control(t??"")}},dynamicFields:[{type:"Password",name:"api-token",shortDescription:"API Token",longDescription:"Filejump API Token",formElement:t=>o.control(t??"")}],mapper:{to:t=>{let{path:e,username:r,password:n,apitoken:s}=t.custom,p=(s||"").trim()===""?{"auth-username":r,"auth-password":n}:{"api-token":s},u=new Map([...Object.entries(p),...Object.entries(t.advanced),...Object.entries(t.dynamic)]),g=c(Array.from(u));return`${t.destinationType}://${e+g}`},from:(t,e,r)=>{let n=e.hostname??"";return e.pathname&&n!==""&&e.pathname[0]!="/"&&(n+="/"),n+=e.pathname,a({destinationType:t,custom:{path:n}},i(t,e))}}},{key:"storj",customKey:"storjAccessGrant",displayName:"Storj Access Grant",description:"Store backups in Storj Access Grant.",dynamicFields:[{name:"storj-shared-access",shortDescription:"Access Grant"},{name:"storj-bucket",shortDescription:"Bucket"},{name:"storj-folder",shortDescription:"Path on server",doubleSlash:m}],mapper:{to:t=>`storj://storj.io/config?storj-auth-method=Access%20grant&storj-satellite=us1.storj.io%3A7777&storj-api-key&storj-secret&${c([...Object.entries(t.advanced),...Object.entries(t.dynamic)],!0)}`,from:(t,e,r)=>a({destinationType:t},i(t,e))}},{key:"storj",customKey:"storjApiKey",displayName:"Storj API Key",description:"Store backups in Storj API Key.",dynamicFields:[{name:"storj-satellite",shortDescription:"Satellite",type:"Enumeration",loadOptions:t=>t.get(d).storjSatellites},{name:"storj-api-key",shortDescription:"API Key"},{name:"storj-secret",shortDescription:"Secret"},{name:"storj-bucket",shortDescription:"Bucket"},{name:"storj-folder",shortDescription:"Path on server",doubleSlash:m}],mapper:{to:t=>`storj://storj.io/config?storj-auth-method=API%20key&${c([...Object.entries(t.advanced),...Object.entries(t.dynamic)],!0)}`,from:(t,e,r)=>a({destinationType:t},i(t,e))}}],W={".amazonaws.com":"Amazon S3",".mycloudyplace.com":"MyCloudyPlace S3",".impossibleapi.net":"Impossible Cloud S3",".scw.cloud":"Scaleway S3",".hosteurope.de":"Hosteurope S3",".dunkel.de":"Dunkel S3",".dreamhost.com":"DreamHost S3",".dincloud.com":"dinCloud S3",".polisystems.ch":"Poli Systems S3",".softlayer.net":"IBM COS (S3)",".storadera.com":"Storadera S3",".wasabisys.com":"Wasabi S3",".infomaniak.com":"Infomaniak S3",".infomaniak.cloud":"Infomaniak S3",".sakurastorage.jp":"\u3055\u304F\u3089\u306E\u30AF\u30E9\u30A6\u30C9 S3",".lyvecloud.seagate.com":"Seagate Lyve S3",".digitaloceanspaces.com":"DigitalOcean S3",".backblazeb2.com":"Backblaze B2 S3",".cloudian.com":"Cloudian S3",".min.io":"MinIO S3",".linodeobjects.com":"Linode S3",".bunnycdn.com":"BunnyCDN S3",".azure.com":"Microsoft Azure S3",".googleapis.com":"Google Cloud Storage S3",".ibm.com":"IBM Cloud S3",".oracle.com":"Oracle Cloud S3",".cloudflare.com":"Cloudflare S3",".alibaba.com":"Alibaba Cloud S3",".huawei.com":"Huawei Cloud S3",".tencent.com":"Tencent Cloud S3",".baidu.com":"Baidu Cloud S3",".jd.com":"JD Cloud S3",".ucloud.cn":"UCloud S3",".qiniu.com":"Qiniu Cloud S3",".aliyuncs.com":"Aliyun S3",".tcloud.com":"TCloud S3",".tencentcloudapi.com":"Tencent Cloud S3"};function y(t){return t==null||t===""?"":":"+t.toString()}function l(t){return t==null?"":t.startsWith("/")?t:"/"+t}function i(t,e){let r={},n={},s=f.find(p=>p.key===t);return e.searchParams.forEach((p,u)=>{s?.dynamicFields?.some(S=>S===u||S?.name===u)?n[u]=decodeURIComponent(p):r[u]=decodeURIComponent(p)}),{advanced:r,dynamic:n}}function c(t,e=!1){let r=t.map(([s,p])=>`${s}=${p?encodeURIComponent(p.toString()):""}`).join("&");return r?(e?"":"?")+r:""}function q(t){let e=t.destinationType,r=f.find(n=>n.customKey===e||n.key===e);if(!r)throw new Error("Invalid destination type");return r?.mapper.to(t)??""}function H(t){let e=URL.canParse(t),r=t.split("://")[0],n=t.split("://")[1],s="http://"+n;if(n.startsWith("%")&&r==="file")return f.find(p=>p.customKey===r||p.key===r)?.mapper.from(r,new URL("http://localhost"),t);try{let p=new URL(s);return f.find(u=>u.customKey===r||u.key===r)?.mapper.from(r,p,t)}catch(p){console.error("Error while parsing target path",p)}if(!e)throw new Error("Invalid target path");return null}export{q as a,H as b,f as c,W as d};
@@ -0,0 +1 @@
1
+ import{a as x}from"./chunk-HTX2RSBS.js";import{a as Q}from"./chunk-3AIKVVWP.js";import{b as U,d as H}from"./chunk-5LKXKKAK.js";import{b as K,c as j,e as W,g as q,p as Y}from"./chunk-AL5KGNEF.js";import{h as J}from"./chunk-FRSQ5NDX.js";import{Bb as v,Cb as L,Db as r,Eb as c,Fb as g,Gb as y,Hb as R,Jb as f,Pb as D,Pc as B,Qb as V,Ra as M,Rb as p,Ua as a,Vb as C,Wb as s,Z as d,ea as T,fa as I,gb as S,jc as F,kc as h,lb as A,lc as z,rc as G,sa as O,sc as X,tc as u,ub as m,yb as b,zb as _}from"./chunk-AHUC7M75.js";function it(n,e){if(n&1&&F(0),n&2){s();let t=u(0);z(" ",t.Message," ")}}function nt(n,e){if(n&1&&(r(0,"div"),D(1,1),g(2,"a",15),V(),c()),n&2){s();let t=u(0);a(2),m("href",t.DownloadLink,M)}}function ot(n,e){if(n&1){let t=f();r(0,"button",14),C("click",function(){T(t);let i=s(),l=u(0);return I(i.doRepair(l.BackupID))}),p(1,2),c()}}function at(n,e){if(n&1){let t=f();r(0,"button",14),C("click",function(){T(t);let i=s(),l=u(0);return I(i.doDownloadBugreport(l))}),p(1,3),c()}}function rt(n,e){if(n&1&&g(0,"spk-progress-bar",17),n&2){let t,o=s(2);m("value",(t=o.serverState())==null?null:t.UpdateDownloadProgress)}}function lt(n,e){if(n&1){let t=f();r(0,"div",13),y(1),p(2,4),R(),r(3,"a",16),F(4),c(),A(5,rt,1,1,"spk-progress-bar",17),r(6,"button",14),C("click",function(){T(t);let i=s();return I(i.doShowUpdate())}),p(7,5),c()()}if(n&2){let t,o,i=s(),l=u(0);a(3),m("href",(t=i.serverState())==null?null:t.UpdateDownloadLink,M),a(),h(l.Message),a(),_(((o=i.serverState())==null?null:o.UpdaterState)==="Downloading"?5:-1)}}function ct(n,e){if(n&1){let t=f();r(0,"button",14),C("click",function(){T(t);let i=s(),l=u(0);return I(i.doShowLog(l.BackupID))}),p(1,6),c()}}function st(n,e){if(n&1){let t=f();r(0,"button",14),C("click",function(){T(t);let i=s();return I(i.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),p(1,7),c()}}function _t(n,e){if(n&1){let t=f();r(0,"button",14),C("click",function(){T(t);let i=s();return I(i.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),p(1,8),c()}}var dt={Error:"error",Warning:"warn",Information:"primary"},E=class n{#t=d(H);#o=d(U);#a=d(W);#e=d(j);#i=d(x);#n=d(J);serverState=this.#i.serverState;index=O.required();notification=O.required();deleteNotificationByIndex(){this.#i.deleteNotification(this.index())}deleteAllNotifications(){this.#i.deleteAllNotifications()}getAlertType(e){return e&&dt[e]||"primary"}doShowLog(e){this.#n.getApiV1BackupByIdIsactive({id:e}).subscribe({next:t=>{this.#t.navigate(["/backup/"+e+"/log"])},error:t=>{if(t.status===404){let o={title:$localize`Error`,message:$localize`The backup is missing, has it been deleted?`,confirmText:$localize`OK`,cancelText:null};parseInt(e)+""!=e&&(o={title:$localize`Error`,message:$localize`The backup was temporary and does not exist anymore, so the log data is lost`,confirmText:$localize`OK`,cancelText:null}),this.#a.open(Q,{maxWidth:"550px",width:"100%",data:o})}else this.#e.error($localize`Failed to find backup: `+t.message)}})}doRepair(e){this.#n.postApiV1BackupByIdRepair({id:e}).subscribe({next:()=>{this.#e.success($localize`Backup repaired`),this.#t.navigate(["./"],{onSameUrlNavigation:"reload",relativeTo:this.#o})},error:t=>{this.#e.error($localize`Failed to repair backup: `+t.message)}})}doShowUpdate(){this.#t.navigate(["/about/changelog"])}doShowLink(e){window.open(e,"_blank")}doDownloadBugreport(e){let t=e.Action.slice(19);this.#n.postApiV1AuthIssuetokenByOperation({operation:`bugreport/${t}`}).subscribe({next:o=>{if(!o.Token){this.#e.error("Failed to get bug report URL: No token generated");return}e.DownloadLink=o.Token},error:o=>{this.#e.error(`Failed to get bug report URL: ${o.message}`)}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=S({type:n,selectors:[["app-notification"]],inputs:{index:[1,"index"],notification:[1,"notification"]},decls:16,vars:12,consts:()=>{let e;e=$localize`Dismiss`;let t;t=$localize` If the backup file was not downloaded automatically, ${"\uFFFD#2\uFFFD"}:START_LINK:right click and choose "Save as …"${"\uFFFD/#2\uFFFD"}:CLOSE_LINK:`;let o;o=$localize`Repair`;let i;i=$localize`Download`;let l;l=$localize`New update found:`;let k;k=$localize`Show Update`;let P;P=$localize`Show Log`;let w;w=$localize` Show Help `;let $;return $=$localize` Show Help `,[e,t,o,i,l,k,P,w,$,["sparkle-alert-title",""],["sparkle-alert-content","",1,"content"],[1,"actions"],["spk-button","",1,"small","outlined"],[1,"message"],["spk-button","",1,"small","outlined",3,"click"],["target","_blank",3,"href"],[3,"href"],[3,"value"]]},template:function(t,o){if(t&1){let i=f();G(0),r(1,"spk-alert")(2,"div",9),F(3),c(),r(4,"div",10),A(5,it,1,1)(6,nt,3,1,"div"),r(7,"div",11),A(8,ot,2,0,"button",12)(9,at,2,0,"button",12)(10,lt,8,3,"div",13)(11,ct,2,0,"button",12)(12,st,2,0,"button",12)(13,_t,2,0,"button",12),r(14,"button",14),C("click",function(){return T(i),I(o.deleteNotificationByIndex())}),p(15,0),c()()()()}if(t&2){let i=X(o.notification());a(),b(o.getAlertType(i.Type)),a(2),h(i.Title),a(2),_(i.Action!=="update:new"&&i.Action!=="update:manual"?5:-1),a(),_(i!=null&&i.DownloadLink?6:-1),a(2),_(i.Message!=null&&i.Message.includes("please run repair")?8:-1),a(),_(i.Action!=null&&i.Action.startsWith("bug-report:created:")&&!i.DownloadLink?9:-1),a(),_(i.Action==="update:new"?10:-1),a(),_(i.Action==="backup:show-log"?11:-1),a(),_(i.Action==="config:issue:unencrypted-database"?12:-1),a(),_(i.Action==="config:issue:windows-folder-used"?13:-1)}},dependencies:[Y,q,K],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};var pt=(n,e)=>e.ID;function Nt(n,e){if(n&1&&g(0,"app-notification",0),n&2){let t=e.$implicit,o=e.$index;m("index",o)("notification",t)}}var Z=class n{#t=d(x);notificationFilterPredicate=O();notifications=B(()=>{let e=this.notificationFilterPredicate()?.predicate,t=this.#t.notifications();return typeof e!="function"?t:t.filter(e)});static \u0275fac=function(t){return new(t||n)};static \u0275cmp=S({type:n,selectors:[["app-notifications"]],inputs:{notificationFilterPredicate:[1,"notificationFilterPredicate"]},decls:2,vars:0,consts:[[3,"index","notification"]],template:function(t,o){t&1&&v(0,Nt,1,2,"app-notification",0,pt),t&2&&L(o.notifications())},dependencies:[E],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;justify-content:flex-end}"],changeDetection:0})};export{E as a,Z as b};
package/index.html CHANGED
@@ -63,5 +63,5 @@
63
63
  <body>
64
64
  <app-root></app-root>
65
65
  <div class="loading">Connecting ...</div>
66
- <link rel="modulepreload" href="chunk-OEIF7NQ5.js"><link rel="modulepreload" href="chunk-WZRSQ7XL.js"><link rel="modulepreload" href="chunk-HTX2RSBS.js"><link rel="modulepreload" href="chunk-OHZGASM5.js"><link rel="modulepreload" href="chunk-65UN5LE6.js"><link rel="modulepreload" href="chunk-WFM6YWRN.js"><link rel="modulepreload" href="chunk-3AIKVVWP.js"><link rel="modulepreload" href="chunk-RHW5QVAY.js"><link rel="modulepreload" href="chunk-RSZISHXB.js"><link rel="modulepreload" href="chunk-ZQSBINUM.js"><script src="polyfills-6QHLTIIN.js" type="module"></script><script src="main-PDJMO4FF.js" type="module"></script></body>
66
+ <link rel="modulepreload" href="chunk-OEIF7NQ5.js"><link rel="modulepreload" href="chunk-WZRSQ7XL.js"><link rel="modulepreload" href="chunk-HTX2RSBS.js"><link rel="modulepreload" href="chunk-OHZGASM5.js"><link rel="modulepreload" href="chunk-65UN5LE6.js"><link rel="modulepreload" href="chunk-WFM6YWRN.js"><link rel="modulepreload" href="chunk-3AIKVVWP.js"><link rel="modulepreload" href="chunk-RHW5QVAY.js"><link rel="modulepreload" href="chunk-RSZISHXB.js"><link rel="modulepreload" href="chunk-ZQSBINUM.js"><script src="polyfills-6QHLTIIN.js" type="module"></script><script src="main-AYZBQHF7.js" type="module"></script></body>
67
67
  </html>
@@ -1 +1 @@
1
- import{b as ye,c as be}from"./chunk-OEIF7NQ5.js";import{a as L}from"./chunk-WZRSQ7XL.js";import{a as ue}from"./chunk-HTX2RSBS.js";import{a as I}from"./chunk-OHZGASM5.js";import"./chunk-65UN5LE6.js";import"./chunk-WFM6YWRN.js";import"./chunk-3AIKVVWP.js";import{a as x}from"./chunk-RHW5QVAY.js";import{a as me}from"./chunk-RSZISHXB.js";import{a as v,b as de,c as E}from"./chunk-ZQSBINUM.js";import{a as C}from"./chunk-3XVU2YA6.js";import{c as se,d as ie,g as ae,h as pe}from"./chunk-5LKXKKAK.js";import{a as re}from"./chunk-HFNFJ7G2.js";import{c as ce}from"./chunk-AL5KGNEF.js";import{a as Z,b as ee,d as te,e as oe,f as ne,i as le}from"./chunk-FRSQ5NDX.js";import{a as fe}from"./chunk-RHII5WE3.js";import{pa as Q,ua as Y}from"./chunk-M3WT5B3C.js";import{a as ge}from"./chunk-2P3DXYGR.js";import{b as he}from"./chunk-TCDECRYI.js";import{A as N,B as F,F as w,Fb as _,Fc as z,Gc as q,L as G,N as T,P as J,Qc as X,T as k,W as B,Z as s,f as W,gb as K,i as j,ka as $,n as D,o as U,r as R,va as d}from"./chunk-AHUC7M75.js";import"./chunk-7CGTOI24.js";var M=class t{#o=s(C);#s=s(v);ngOnInit(){this.#s.fetchConfig(),this.#o.clearAllNotCurrentVersion()}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=K({type:t,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&_(0,"router-outlet")},dependencies:[se],encapsulation:2})};var ve={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var h=new B("ENVIRONMENT");var A=class t{#o=s(le);isLoaded=d(!1);webmodules=d(null);preload(e=!1){let o=this.#o.getApiV1Webmodules().pipe(J(n=>this.webmodules.set(n)),w(()=>this.isLoaded.set(!0)));if(e)return o;o.subscribe()}static \u0275fac=function(o){return new(o||t)};static \u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})};var Ie=()=>{let t=s(E);return t.token()?!0:t.checkProxyAuthed().pipe(T(e=>e?D(!0):t.refreshToken().pipe(R(()=>!0))))},Me=()=>{let t=s(v),e=s(I),o=s($),n=t.relayIsEnabled()?"longpoll":"websocket",i=[o.get(L).preload(!0),o.get(L).preloadFilterGroups(!0),o.get(A).preload(!0)];return t.configLoaded===null?N(i).pipe(R(()=>n)):t.configLoaded?.pipe(T(()=>N(i)))},Se=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-UXUVYBYP.js")},{path:"logout",loadComponent:()=>import("./chunk-UABJ67OY.js")},{path:"",canActivate:[Ie],children:[{path:"",canActivate:[Me],loadComponent:()=>import("./chunk-HXN7IX3Q.js"),children:[{path:"",loadComponent:()=>import("./chunk-MUBWT5H2.js")},{path:"add-backup",loadComponent:()=>import("./chunk-BAX2AJJJ.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-K5C3JCVH.js")},{path:"backup/import",loadComponent:()=>import("./chunk-4YUBZYBH.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-4FUHLIJW.js"),loadChildren:()=>import("./chunk-ADO3ABTT.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-4FUHLIJW.js"),loadChildren:()=>import("./chunk-ADO3ABTT.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-DX6BDDDV.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-YY3JAYQZ.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-4RIDBZOK.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-CPTR6AJI.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-3KUVV3SB.js")},{path:"from-config",loadComponent:()=>import("./chunk-AACJQG7X.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-7NBGN46A.js"),loadChildren:()=>import("./chunk-W4RKRM2O.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-7NBGN46A.js"),loadChildren:()=>import("./chunk-W4RKRM2O.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-7NBGN46A.js"),loadChildren:()=>import("./chunk-W4RKRM2O.js")},{path:"settings",loadComponent:()=>import("./chunk-PHIZVVHX.js")},{path:"about",loadComponent:()=>import("./chunk-NPZU4SBS.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-6KSS7VQS.js")},{path:"changelog",loadComponent:()=>import("./chunk-2SQBD7LN.js")},{path:"libraries",loadComponent:()=>import("./chunk-2GE6FFGI.js")},{path:"system-info",loadComponent:()=>import("./chunk-ELZWH543.js")},{path:"server-settings",loadComponent:()=>import("./chunk-WU3ALGNP.js")},{path:"logs",loadChildren:()=>import("./chunk-QVNFX6ZC.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-SSJ4VQB4.js")}]}]}]}]}];var P=null,Re=(t,e)=>{let o=s(E),n=s(ie),i=s(C),l=s(h),r=i.getItem("locale"),u=s(ce),a=ye(r),p=t.url==="/api/v1/auth/login",m=t.url==="/api/v1/auth/refresh",S=t.url==="/api/v1/progressstate",g=t.url==="/api/v1/remoteoperation/test",y=t.url.startsWith("/api/v2/"),b=o.token(),H=t,V=t.headers.has("custom-proxy-check")||b===de;if(b&&t.url.startsWith(l.baseUrl)&&!V){let c=t.headers.set("Authorization",`Bearer ${b}`);r&&r!=="en-US"&&(c=c.set("X-Ui-Language",a)),H=t.clone({headers:c})}return e(H).pipe(R(c=>{if(c.type===4&&c.status===200&&y){let f=c.body;if(f?.Success===!1)throw{status:200,message:f?.Error??"Unknown error",error:{Error:f?.Error??"Unknown error"},body:f}}return c}),F(c=>{let f=c.error?.Error||`Error Code: ${c.status}, Message: ${c.message}`;return!V&&(S&&c.status===404||g||u.error(f),m&&c.status===401&&(o.logout(),n.navigate(["/logout"])),!p&&!m&&c.status===401)?(P??=o.refreshToken().pipe(G()),P.pipe(T(()=>e(t.clone({headers:t.headers.set("Authorization",`Bearer ${o.token()}`)}))),w(()=>P=null))):U(()=>({error:c,message:f}))}))};var Ae="1.0.0",Te=`portal-proxy-client-${x()}`,Oe=1,O=class t{#o=1e3;#s=s(h);#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=X(()=>{let e=this.#i(),o=this.#l(),n=this.#a();if(!n||!e||!o||o<this.#o){this.#c&&window.clearInterval(this.#c);return}this.#c=window.setInterval(()=>{this.connectToMachineServer(n)},o)});utf8Atob(e){let o=Uint8Array.from(atob(e),i=>i.charCodeAt(0)),n=this.#m.decode(o);return n?JSON.parse(n):null}connectToMachineServer(e,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(e),this.#i.set(!0)},this.#e.onerror=()=>{this.#t.set("error")},this.#e.onmessage=l=>{let r=JSON.parse(l.data);if(this.wsState()==="connect"){if(r.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${r.type}'`);return}let a={token:e,publicKey:"",clientVersion:Ae,protocolVersion:Oe},p=this.createResponse(r,"authportal",a);this.#t.set("welcome"),this.#e?.send(p)}else if(this.wsState()==="welcome"){if(r.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${r.type}'`);return}var u=JSON.parse(r.payload??"");if(u.accepted===!1){this.disconnectFromMachineServer("Authentication failed");return}for(this.#t.set("authenticated"),this.#n.set(!0);this.#p.length>0;){let a=this.#p.pop();a&&this.#r[a.messageId]&&this.activateCommand(a)}}else if(this.wsState()==="authenticated"){if(r.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${r.type}'`);return}let a=this.#r[r.messageId];if(a){if(r.errorMessage){a.reject(r.errorMessage);return}else{let p=JSON.parse(r.payload??"");p.body=p?.body==null?null:this.utf8Atob(p.body),a.resolve(p)}delete this.#r[r.messageId],window.clearTimeout(a.timer)}}})}disconnectFromMachineServer(e=null){e&&console.error(e),this.#e?.close(),this.#e=null,this.#t.set("disconnected"),this.#n.set(!1)}createResponse(e,o,n){let i={from:Te,to:e.from,type:o,messageId:e.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(e,o,n,i,l,r,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(e),new Promise((a,p)=>{let m=x(),g={from:Te,to:o,type:"command",messageId:m,payload:JSON.stringify({method:n,path:i,body:l,headers:r})},y={resolve:a,reject:p,timer:window.setTimeout(()=>{let b=this.#r[m];b&&(delete this.#r[m],b.reject("Timeout"))},u)};this.#r[m]=y,this.#n()?this.activateCommand(g):this.#p.push(g)})}activateCommand(e){this.#e?.send(JSON.stringify(e))}static \u0275fac=function(o){return new(o||t)};static \u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})};function Ne(t){if(typeof t!="string")return null;let o=new TextEncoder().encode(t);return window.btoa(String.fromCharCode(...o))}function we(t,e,o){let n=t.relayconfigState.config();if(n===null)return o(e);let i=Ne(e.body),l={};e.headers.keys().forEach(p=>{l[p]=e.headers.get(p)??""});let r=e.headers.get("timeout"),u=r!==null?parseInt(r):t.defaultTimeout;e.url.startsWith("/api/v1/serverstate")&&e.url.includes("longpoll=true")&&(u=1e3*99);let a=t.relayWebsocket.sendCommand(n.accessToken,n.clientId,e.method,e.url,i,l,u);return new W(p=>{a.then(m=>{let S=new Z;l!=null&&Object.keys(l).forEach(y=>{S.set(y,l[y])});let g=new ee({body:m.body,status:m.code,statusText:"OK",headers:S});p.next(g),p.complete()})})}var ke=(t,e)=>{let o={relayconfigState:s(v),defaultTimeout:s(h).defaultTimeout,relayWebsocket:s(O)},n=o.relayconfigState.config();if(o.relayconfigState.configLoaded!==null&&n===null){let i=new j;return o.relayconfigState.configLoaded.subscribe(l=>{l&&we(o,t,e).subscribe(i)}),i}return we(o,t,e)};var Ee={providers:[z(),ae(Se,pe()),te(ne(),oe([ke,Re])),C,{provide:h,useValue:ve},{provide:q,useValue:be()},ue,I,he,Y,me,Q,fe,ge]};re(M,Ee);
1
+ import{b as ye,c as be}from"./chunk-OEIF7NQ5.js";import{a as L}from"./chunk-WZRSQ7XL.js";import{a as ue}from"./chunk-HTX2RSBS.js";import{a as I}from"./chunk-OHZGASM5.js";import"./chunk-65UN5LE6.js";import"./chunk-WFM6YWRN.js";import"./chunk-3AIKVVWP.js";import{a as x}from"./chunk-RHW5QVAY.js";import{a as me}from"./chunk-RSZISHXB.js";import{a as v,b as de,c as E}from"./chunk-ZQSBINUM.js";import{a as C}from"./chunk-3XVU2YA6.js";import{c as se,d as ie,g as ae,h as pe}from"./chunk-5LKXKKAK.js";import{a as re}from"./chunk-HFNFJ7G2.js";import{c as ce}from"./chunk-AL5KGNEF.js";import{a as Z,b as ee,d as te,e as oe,f as ne,i as le}from"./chunk-FRSQ5NDX.js";import{a as fe}from"./chunk-RHII5WE3.js";import{pa as Q,ua as Y}from"./chunk-M3WT5B3C.js";import{a as ge}from"./chunk-2P3DXYGR.js";import{b as he}from"./chunk-TCDECRYI.js";import{A as N,B as F,F as w,Fb as _,Fc as z,Gc as q,L as G,N as T,P as J,Qc as X,T as k,W as B,Z as s,f as W,gb as K,i as j,ka as $,n as D,o as U,r as R,va as d}from"./chunk-AHUC7M75.js";import"./chunk-7CGTOI24.js";var M=class t{#o=s(C);#s=s(v);ngOnInit(){this.#s.fetchConfig(),this.#o.clearAllNotCurrentVersion()}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=K({type:t,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&_(0,"router-outlet")},dependencies:[se],encapsulation:2})};var ve={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var h=new B("ENVIRONMENT");var A=class t{#o=s(le);isLoaded=d(!1);webmodules=d(null);preload(e=!1){let o=this.#o.getApiV1Webmodules().pipe(J(n=>this.webmodules.set(n)),w(()=>this.isLoaded.set(!0)));if(e)return o;o.subscribe()}static \u0275fac=function(o){return new(o||t)};static \u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})};var Ie=()=>{let t=s(E);return t.token()?!0:t.checkProxyAuthed().pipe(T(e=>e?D(!0):t.refreshToken().pipe(R(()=>!0))))},Me=()=>{let t=s(v),e=s(I),o=s($),n=t.relayIsEnabled()?"longpoll":"websocket",i=[o.get(L).preload(!0),o.get(L).preloadFilterGroups(!0),o.get(A).preload(!0)];return t.configLoaded===null?N(i).pipe(R(()=>n)):t.configLoaded?.pipe(T(()=>N(i)))},Se=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-UXUVYBYP.js")},{path:"logout",loadComponent:()=>import("./chunk-UABJ67OY.js")},{path:"",canActivate:[Ie],children:[{path:"",canActivate:[Me],loadComponent:()=>import("./chunk-LWC5O2JV.js"),children:[{path:"",loadComponent:()=>import("./chunk-VYJFDVMS.js")},{path:"add-backup",loadComponent:()=>import("./chunk-BAX2AJJJ.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-K5C3JCVH.js")},{path:"backup/import",loadComponent:()=>import("./chunk-4YUBZYBH.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-Q2WRB27A.js"),loadChildren:()=>import("./chunk-AZ2DJOXS.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-Q2WRB27A.js"),loadChildren:()=>import("./chunk-AZ2DJOXS.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-DX6BDDDV.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-YY3JAYQZ.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-NUC2S6S3.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-CPTR6AJI.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-3KUVV3SB.js")},{path:"from-config",loadComponent:()=>import("./chunk-AACJQG7X.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-FAY3FX6V.js"),loadChildren:()=>import("./chunk-UDYPOSWB.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-FAY3FX6V.js"),loadChildren:()=>import("./chunk-UDYPOSWB.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-FAY3FX6V.js"),loadChildren:()=>import("./chunk-UDYPOSWB.js")},{path:"settings",loadComponent:()=>import("./chunk-EXY7CUIT.js")},{path:"about",loadComponent:()=>import("./chunk-NPZU4SBS.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-6KSS7VQS.js")},{path:"changelog",loadComponent:()=>import("./chunk-2SQBD7LN.js")},{path:"libraries",loadComponent:()=>import("./chunk-2GE6FFGI.js")},{path:"system-info",loadComponent:()=>import("./chunk-ELZWH543.js")},{path:"server-settings",loadComponent:()=>import("./chunk-WU3ALGNP.js")},{path:"logs",loadChildren:()=>import("./chunk-QVNFX6ZC.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-SSJ4VQB4.js")}]}]}]}]}];var P=null,Re=(t,e)=>{let o=s(E),n=s(ie),i=s(C),l=s(h),r=i.getItem("locale"),u=s(ce),a=ye(r),p=t.url==="/api/v1/auth/login",m=t.url==="/api/v1/auth/refresh",S=t.url==="/api/v1/progressstate",g=t.url==="/api/v1/remoteoperation/test",y=t.url.startsWith("/api/v2/"),b=o.token(),H=t,V=t.headers.has("custom-proxy-check")||b===de;if(b&&t.url.startsWith(l.baseUrl)&&!V){let c=t.headers.set("Authorization",`Bearer ${b}`);r&&r!=="en-US"&&(c=c.set("X-Ui-Language",a)),H=t.clone({headers:c})}return e(H).pipe(R(c=>{if(c.type===4&&c.status===200&&y){let f=c.body;if(f?.Success===!1)throw{status:200,message:f?.Error??"Unknown error",error:{Error:f?.Error??"Unknown error"},body:f}}return c}),F(c=>{let f=c.error?.Error||`Error Code: ${c.status}, Message: ${c.message}`;return!V&&(S&&c.status===404||g||u.error(f),m&&c.status===401&&(o.logout(),n.navigate(["/logout"])),!p&&!m&&c.status===401)?(P??=o.refreshToken().pipe(G()),P.pipe(T(()=>e(t.clone({headers:t.headers.set("Authorization",`Bearer ${o.token()}`)}))),w(()=>P=null))):U(()=>({error:c,message:f}))}))};var Ae="1.0.0",Te=`portal-proxy-client-${x()}`,Oe=1,O=class t{#o=1e3;#s=s(h);#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=X(()=>{let e=this.#i(),o=this.#l(),n=this.#a();if(!n||!e||!o||o<this.#o){this.#c&&window.clearInterval(this.#c);return}this.#c=window.setInterval(()=>{this.connectToMachineServer(n)},o)});utf8Atob(e){let o=Uint8Array.from(atob(e),i=>i.charCodeAt(0)),n=this.#m.decode(o);return n?JSON.parse(n):null}connectToMachineServer(e,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(e),this.#i.set(!0)},this.#e.onerror=()=>{this.#t.set("error")},this.#e.onmessage=l=>{let r=JSON.parse(l.data);if(this.wsState()==="connect"){if(r.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${r.type}'`);return}let a={token:e,publicKey:"",clientVersion:Ae,protocolVersion:Oe},p=this.createResponse(r,"authportal",a);this.#t.set("welcome"),this.#e?.send(p)}else if(this.wsState()==="welcome"){if(r.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${r.type}'`);return}var u=JSON.parse(r.payload??"");if(u.accepted===!1){this.disconnectFromMachineServer("Authentication failed");return}for(this.#t.set("authenticated"),this.#n.set(!0);this.#p.length>0;){let a=this.#p.pop();a&&this.#r[a.messageId]&&this.activateCommand(a)}}else if(this.wsState()==="authenticated"){if(r.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${r.type}'`);return}let a=this.#r[r.messageId];if(a){if(r.errorMessage){a.reject(r.errorMessage);return}else{let p=JSON.parse(r.payload??"");p.body=p?.body==null?null:this.utf8Atob(p.body),a.resolve(p)}delete this.#r[r.messageId],window.clearTimeout(a.timer)}}})}disconnectFromMachineServer(e=null){e&&console.error(e),this.#e?.close(),this.#e=null,this.#t.set("disconnected"),this.#n.set(!1)}createResponse(e,o,n){let i={from:Te,to:e.from,type:o,messageId:e.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(e,o,n,i,l,r,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(e),new Promise((a,p)=>{let m=x(),g={from:Te,to:o,type:"command",messageId:m,payload:JSON.stringify({method:n,path:i,body:l,headers:r})},y={resolve:a,reject:p,timer:window.setTimeout(()=>{let b=this.#r[m];b&&(delete this.#r[m],b.reject("Timeout"))},u)};this.#r[m]=y,this.#n()?this.activateCommand(g):this.#p.push(g)})}activateCommand(e){this.#e?.send(JSON.stringify(e))}static \u0275fac=function(o){return new(o||t)};static \u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})};function Ne(t){if(typeof t!="string")return null;let o=new TextEncoder().encode(t);return window.btoa(String.fromCharCode(...o))}function we(t,e,o){let n=t.relayconfigState.config();if(n===null)return o(e);let i=Ne(e.body),l={};e.headers.keys().forEach(p=>{l[p]=e.headers.get(p)??""});let r=e.headers.get("timeout"),u=r!==null?parseInt(r):t.defaultTimeout;e.url.startsWith("/api/v1/serverstate")&&e.url.includes("longpoll=true")&&(u=1e3*99);let a=t.relayWebsocket.sendCommand(n.accessToken,n.clientId,e.method,e.url,i,l,u);return new W(p=>{a.then(m=>{let S=new Z;l!=null&&Object.keys(l).forEach(y=>{S.set(y,l[y])});let g=new ee({body:m.body,status:m.code,statusText:"OK",headers:S});p.next(g),p.complete()})})}var ke=(t,e)=>{let o={relayconfigState:s(v),defaultTimeout:s(h).defaultTimeout,relayWebsocket:s(O)},n=o.relayconfigState.config();if(o.relayconfigState.configLoaded!==null&&n===null){let i=new j;return o.relayconfigState.configLoaded.subscribe(l=>{l&&we(o,t,e).subscribe(i)}),i}return we(o,t,e)};var Ee={providers:[z(),ae(Se,pe()),te(ne(),oe([ke,Re])),C,{provide:h,useValue:ve},{provide:q,useValue:be()},ue,I,he,Y,me,Q,fe,ge]};re(M,Ee);
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.119",
2
+ "version": "0.0.120",
3
3
  "name": "@duplicati/ngclient",
4
4
  "license": "MIT",
5
5
  "contributors": [
package/chunk-6WZGDK7U.js DELETED
@@ -1 +0,0 @@
1
- import{a as W}from"./chunk-HTX2RSBS.js";import{a as K}from"./chunk-3AIKVVWP.js";import{b as V,d as z}from"./chunk-5LKXKKAK.js";import{b as G,c as X,e as B,p as U}from"./chunk-AL5KGNEF.js";import{h as H}from"./chunk-FRSQ5NDX.js";import{Bb as P,Cb as h,Db as l,Eb as _,Fb as O,Gb as b,Hb as R,Jb as T,Pb as v,Pc as D,Qb as y,Ra as g,Rb as d,Ua as r,Vb as C,Wb as a,Z as f,ea as u,fa as N,gb as k,jc as m,kc as A,lb as S,lc as L,sa as $,ub as I,yb as w,zb as s}from"./chunk-AHUC7M75.js";var Y=(i,t)=>t.ID;function q(i,t){if(i&1&&m(0),i&2){let e=a().$implicit;L(" ",e.Message," ")}}function J(i,t){if(i&1&&(l(0,"div"),v(1,1),O(2,"a",16),y(),_()),i&2){let e=a().$implicit;r(2),I("href",e.DownloadLink,g)}}function Q(i,t){if(i&1){let e=T();l(0,"button",15),C("click",function(){u(e);let o=a().$implicit,c=a();return N(c.doRepair(o.BackupID))}),d(1,2),_()}}function Z(i,t){if(i&1){let e=T();l(0,"button",15),C("click",function(){u(e);let o=a().$implicit,c=a();return N(c.doDownloadBugreport(o))}),d(1,3),_()}}function ee(i,t){if(i&1&&O(0,"spk-progress-bar",18),i&2){let e,n=a(3);I("value",(e=n.serverState())==null?null:e.UpdateDownloadProgress)}}function te(i,t){if(i&1){let e=T();l(0,"div",14),b(1),d(2,4),R(),l(3,"a",17),m(4),_(),S(5,ee,1,1,"spk-progress-bar",18),l(6,"button",15),C("click",function(){u(e);let o=a(2);return N(o.doShowUpdate())}),d(7,5),_()()}if(i&2){let e,n,o=a().$implicit,c=a();r(3),I("href",(e=c.serverState())==null?null:e.UpdateDownloadLink,g),r(),A(o.Message),r(),s(((n=c.serverState())==null?null:n.UpdaterState)==="Downloading"?5:-1)}}function ie(i,t){if(i&1){let e=T();l(0,"button",15),C("click",function(){u(e);let o=a().$implicit,c=a();return N(c.doShowLog(o.BackupID))}),d(1,6),_()}}function ne(i,t){if(i&1){let e=T();l(0,"button",15),C("click",function(){u(e);let o=a(2);return N(o.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),d(1,7),_()}}function oe(i,t){if(i&1){let e=T();l(0,"button",15),C("click",function(){u(e);let o=a(2);return N(o.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),d(1,8),_()}}function ae(i,t){if(i&1){let e=T();l(0,"spk-alert")(1,"div",10),m(2),_(),l(3,"div",11),S(4,q,1,1)(5,J,3,1,"div"),l(6,"div",12),S(7,Q,2,0,"button",13)(8,Z,2,0,"button",13)(9,te,8,3,"div",14)(10,ie,2,0,"button",13)(11,ne,2,0,"button",13)(12,oe,2,0,"button",13),l(13,"button",15),C("click",function(){let o=u(e).$index,c=a();return N(c.deleteNotificationByIndex(o))}),d(14,0),_()()()()}if(i&2){let e=t.$implicit,n=a();w(n.getAlertType(e.Type)),r(2),A(e.Title),r(2),s(e.Action!=="update:new"&&e.Action!=="update:manual"?4:-1),r(),s(e!=null&&e.DownloadLink?5:-1),r(2),s(e.Message!=null&&e.Message.includes("please run repair")?7:-1),r(),s(e.Action!=null&&e.Action.startsWith("bug-report:created:")&&!e.DownloadLink?8:-1),r(),s(e.Action==="update:new"?9:-1),r(),s(e.Action==="backup:show-log"?10:-1),r(),s(e.Action==="config:issue:unencrypted-database"?11:-1),r(),s(e.Action==="config:issue:windows-folder-used"?12:-1)}}var re={Error:"error",Warning:"warn",Information:"primary"},j=class i{#i=f(z);#o=f(V);#a=f(B);#e=f(X);#n=f(H);#t=f(W);notificationFilterPredicate=$();serverState=this.#t.serverState;notifications=D(()=>{let t=this.notificationFilterPredicate()?.predicate,e=this.#t.notifications();return typeof t!="function"?e:e.filter(t)});deleteNotificationByIndex(t){this.#t.deleteNotification(t)}deleteAllNotifications(){this.#t.deleteAllNotifications()}getAlertType(t){return t&&re[t]||"primary"}doShowLog(t){this.#n.getApiV1BackupByIdIsactive({id:t}).subscribe({next:e=>{this.#i.navigate(["/backup/"+t+"/log"])},error:e=>{if(e.status===404){let n={title:$localize`Error`,message:$localize`The backup is missing, has it been deleted?`,confirmText:$localize`OK`,cancelText:null};parseInt(t)+""!=t&&(n={title:$localize`Error`,message:$localize`The backup was temporary and does not exist anymore, so the log data is lost`,confirmText:$localize`OK`,cancelText:null}),this.#a.open(K,{maxWidth:"550px",width:"100%",data:n})}else this.#e.error($localize`Failed to find backup: `+e.message)}})}doRepair(t){this.#n.postApiV1BackupByIdRepair({id:t}).subscribe({next:()=>{this.#e.success($localize`Backup repaired`),this.#i.navigate(["./"],{onSameUrlNavigation:"reload",relativeTo:this.#o})},error:e=>{this.#e.error($localize`Failed to repair backup: `+e.message)}})}doShowUpdate(){this.#i.navigate(["/about/changelog"])}doShowLink(t){window.open(t,"_blank")}doDownloadBugreport(t){let e=t.Action.slice(19);this.#n.postApiV1AuthIssuetokenByOperation({operation:`bugreport/${e}`}).subscribe({next:n=>{if(!n.Token){this.#e.error("Failed to get bug report URL: No token generated");return}t.DownloadLink=n.Token},error:n=>{this.#e.error(`Failed to get bug report URL: ${n.message}`)}})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=k({type:i,selectors:[["app-notifications"]],inputs:{notificationFilterPredicate:[1,"notificationFilterPredicate"]},decls:2,vars:0,consts:()=>{let t;t=$localize`Dismiss`;let e;e=$localize` If the backup file was not downloaded automatically, ${"\uFFFD#2\uFFFD"}:START_LINK:right click and choose "Save as …"${"\uFFFD/#2\uFFFD"}:CLOSE_LINK:`;let n;n=$localize`Repair`;let o;o=$localize`Download`;let c;c=$localize`New update found:`;let F;F=$localize`Show Update`;let x;x=$localize`Show Log`;let E;E=$localize` Show Help `;let M;return M=$localize` Show Help `,[t,e,n,o,c,F,x,E,M,[3,"class"],["sparkle-alert-title",""],["sparkle-alert-content","",1,"content"],[1,"actions"],["spk-button","",1,"small","outlined"],[1,"message"],["spk-button","",1,"small","outlined",3,"click"],["target","_blank",3,"href"],[3,"href"],[3,"value"]]},template:function(e,n){e&1&&P(0,ae,15,11,"spk-alert",9,Y),e&2&&h(n.notifications())},dependencies:[G,U],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;justify-content:flex-end}"],changeDetection:0})};export{j as a};
package/chunk-ADO3ABTT.js DELETED
@@ -1 +0,0 @@
1
- import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-JRZGF4BZ.js")},{path:"destination",loadComponent:()=>import("./chunk-HHSMSBNM.js")},{path:"source-data",loadComponent:()=>import("./chunk-PKRMVTCU.js")},{path:"schedule",loadComponent:()=>import("./chunk-DCYB2NQH.js")},{path:"options",loadComponent:()=>import("./chunk-GYUN7KFJ.js")}];export{o as default};
package/chunk-B64M2BXZ.js DELETED
@@ -1 +0,0 @@
1
- import{a as h}from"./chunk-XR4SRVOQ.js";import{d as f,r as C}from"./chunk-5ENRUF35.js";import{h as b}from"./chunk-FRSQ5NDX.js";import{T as P,Z as v,r as D,va as F}from"./chunk-AHUC7M75.js";import{a}from"./chunk-7CGTOI24.js";var d=class t{#t=v(b);s3Providers=h(this.getS3Config("Providers"));s3Regions=h(this.getS3Config("Regions"));s3RegionHosts=h(this.getS3Config("RegionHosts"));s3StorageClasses=h(this.getS3Config("StorageClasses"));storjSatellites=h(this.getStorjConfig("Satellites"));storjAuthenticationMethods=h(this.getStorjConfig("AuthenticationMethods"));openstackProviders=h(this.getOpenstackConfig("Providers"));openstackVersions=h(this.getOpenstackConfig("Versions"));gcsLocations=h(this.getGcsConfig("Locations"));gcsStorageClasses=h(this.getGcsConfig("StorageClasses"));getS3Config(e){return this.#t.postApiV1WebmoduleByModulekey({modulekey:"s3-getconfig",requestBody:{"s3-config":e}}).pipe(D(r=>this.#e(r)))}createS3IamUser(e,r){return this.#t.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"CanCreateUser","s3-username":e,"s3-password":r}})}createS3PolicyIAM(e){return this.#t.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"GetPolicyDoc",path:e}})}getStorjConfig(e){return this.#t.postApiV1WebmoduleByModulekey({modulekey:"storj-getconfig",requestBody:{"storj-config":e}}).pipe(D(r=>this.#e(r)))}getOpenstackConfig(e){return this.#t.postApiV1WebmoduleByModulekey({modulekey:"openstack-getconfig",requestBody:{"openstack-config":e}}).pipe(D(r=>this.#e(r)))}getGcsConfig(e){return this.#t.postApiV1WebmoduleByModulekey({modulekey:"gcs-getconfig",requestBody:{"gcs-config":e}}).pipe(D(r=>this.#e(r)))}#e(e){return(e.Result&&typeof e.Result=="object"&&Object.entries(e.Result).map(([r,n])=>({key:r,value:n})))??[]}static \u0275fac=function(r){return new(r||t)};static \u0275prov=P({token:t,factory:t.\u0275fac,providedIn:"root"})};var o=new C,m={type:"error",message:$localize`Using double leading slashes is most likely wrong, and will result in objects being created with a leading slash in the name.`},k=[{key:"file",displayName:"File system",description:"Store backups on your local file system.",customFields:{path:{type:"FolderTree",name:"path",doubleSlash:m,shortDescription:"File path",longDescription:"The path to store the backup",formElement:t=>o.control(t??"")}},mapper:{to:t=>{let e=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${t.custom.path}${e}`},from:(t,e,r)=>{let s=r.startsWith("file:///")?r.split("file:///")[1]:r.split("file://")[1],p=s.startsWith("%"),g=s.slice(1).startsWith(":\\")||p?s:"/"+s;return a({destinationType:t,custom:{path:g}},i(t,e))}}},{key:"ssh",displayName:"SSH",description:"Store backups in SSH.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"The server to connect to",formElement:t=>o.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"The port to connect to",formElement:t=>o.control(t??"",[f.required,f.max(65535)])},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",doubleSlash:{type:"warning",message:$localize`Using double leading slashes makes the path absolute, pointing to the root of the filesystem.`},formElement:t=>o.control(t??"")}},dynamicFields:["auth-username"],advancedFields:[{type:"FileTree",name:"ssh-keyfile",accepts:".key,",shortDescription:"Private key path",longDescription:"This is a path to a private key file locally on the machine"},{type:"FreeText",name:"ssh-key",shortDescription:"SSH private key (PEM format)",longDescription:"Enter a PEM formatted SSH private key. OpenSSL, OpenSSH, and ssh.com formats are supported."}],mapper:{to:t=>{let e=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{port:r,server:n,path:s}=t.custom;return`${t.destinationType}://${n+y(r)+l(s)+e}`},from:(t,e,r)=>a({destinationType:t,custom:{server:e.hostname,port:e.port,path:e.pathname}},i(t,e))}},{key:"s3",displayName:"S3 Compatible",description:"Store backups in any S3 compatible bucket.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:t=>o.control(t??"")},path:{type:"Path",name:"path",doubleSlash:m,shortDescription:"Folder path",longDescription:"Folder path",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"s3-server-name",shortDescription:"Server",type:"NonValidatedSelectableString",loadOptions:t=>t.get(d).s3Providers},"use-ssl","auth-username","auth-password"],advancedFields:[{name:"s3-client",type:"Enumeration",options:["aws","minio"]},{name:"s3-storage-class",type:"NonValidatedSelectableString",loadOptions:t=>t.get(d).s3StorageClasses}],mapper:{to:t=>{let{bucket:e,path:r}=t.custom,n=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${e+l(r)+n}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.pathname,bucket:e.hostname}},i(t,e))}},{key:"gcs",displayName:"Google Cloud Storage",description:"Store backups in Google Cloud Storage.",oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:m,shortDescription:"Bucket name",longDescription:"Bucket name",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"gcs-location",type:"NonValidatedSelectableString",loadOptions:t=>t.get(d).gcsLocations},{name:"gcs-storage-class",type:"NonValidatedSelectableString",loadOptions:t=>t.get(d).gcsStorageClasses},"authid"],mapper:{to:t=>{let e=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${t.custom.path}${e}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.hostname+e.pathname}},i(t,e))}},{key:"googledrive",displayName:"Google Drive",description:"Store backups in Google Drive.",oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:m,shortDescription:"Folder path",longDescription:"Folder path",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"authid",type:"Password"}],mapper:{to:t=>{let e=t.custom.path,r=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${e}${r}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.hostname+e.pathname}},i(t,e))}},{key:"pcloud",displayName:"pCloud",description:"Store backups in pCloud.",oauthField:"authid",customFields:{server:{type:"Enumeration",name:"server",loadOptions:()=>F([{key:"pCloud Global",value:"api.pcloud.com"},{key:"pCloud Europe",value:"eapi.pcloud.com"}]),shortDescription:"Server",longDescription:"Server",formElement:t=>o.control(t??"")},path:{type:"Path",name:"path",doubleSlash:m,shortDescription:"Folder path",longDescription:"Folder path",formElement:t=>o.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let e=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{server:r,path:n}=t.custom;return`${t.destinationType}://${r+l(n)+e}`},from:(t,e,r)=>{let n=e.pathname.replace(/^\//,"");return a({destinationType:t,custom:{server:e.hostname,path:n}},i(t,e))}}},{key:"azure",displayName:"Azure Blob Storage",description:"Store backups in Azure Blob Storage.",customFields:{path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Container name",longDescription:"Container name",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:t=>{let e=t.custom.path,r=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${e}${r}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.hostname+e.pathname}},i(t,e))}},{key:"onedrivev2",displayName:"OneDrive",description:"Store backups in OneDrive.",oauthField:"authid",customFields:{path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let e=t.custom.path,r=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${e}${r}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.hostname+e.pathname}},i(t,e))}},{key:"od4b",displayName:"OneDrive Business",description:"Store backups in OneDrive Business.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>o.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>o.control(t??"")},path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:t=>{let e=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{port:r,server:n,path:s}=t.custom;return`${t.destinationType}://${n+y(r)+l(s)+e}`},from:(t,e,r)=>a({destinationType:t,custom:{server:e.hostname,port:e.port,path:e.pathname}},i(t,e))}},{key:"mssp",displayName:"Microsoft SharePoint",description:"Store backups in Microsoft SharePoint.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>o.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>o.control(t??"")},path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:t=>{let e=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{port:r,server:n,path:s}=t.custom;return`${t.destinationType}://${n+y(r)+l(s)+e}`},from:(t,e,r)=>a({destinationType:t,custom:{server:e.hostname,port:e.port,path:e.pathname}},i(t,e))}},{key:"sharepoint",displayName:"Microsoft SharePoint v2",description:"Store backups in Microsoft SharePoint.",oauthField:"authid",customFields:{path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let e=t.custom.path,r=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${e}${r}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.hostname+e.pathname}},i(t,e))}},{key:"dropbox",displayName:"Dropbox",description:"Store backups in Dropbox.",oauthField:"authid",customFields:{path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let e=t.custom.path,r=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${e}${r}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.hostname+e.pathname}},i(t,e))}},{key:"box",displayName:"Box.com",description:"Store backups in Box.com.",oauthField:"authid",customFields:{path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let e=t.custom.path,r=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${e}${r}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.hostname+e.pathname}},i(t,e))}},{key:"jottacloud",displayName:"Jottacloud",description:"Store backups in Jottacloud.",oauthField:"authid",customFields:{path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let e=t.custom.path,r=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${e}${r}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.hostname+e.pathname}},i(t,e))}},{key:"b2",displayName:"B2 Cloud Storage",description:"Store backups in B2 Cloud Storage.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:t=>o.control(t??"")},path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path in the bucket",longDescription:"Path in the bucket",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Application ID"},{name:"auth-password",shortDescription:"Application Key"}],mapper:{to:t=>{let{bucket:e,path:r}=t.custom,n=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${e+l(r)+n}`},from:(t,e,r)=>a({destinationType:t,custom:{bucket:e.hostname,path:decodeURIComponent(e.pathname)}},i(t,e))}},{key:"e2",displayName:"IDrive e2",description:"Store backups in IDrive e2.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:t=>o.control(t??"")},path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path in the bucket",longDescription:"Path in the bucket",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Access ID"},{name:"auth-password",shortDescription:"Access Secret"}],mapper:{to:t=>{let{bucket:e,path:r}=t.custom,n=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${e+l(r)+n}`},from:(t,e,r)=>a({destinationType:t,custom:{bucket:e.hostname,path:e.pathname}},i(t,e))}},{key:"mega",displayName:"Mega.nz",description:"Store backups in Mega.nz.",customFields:{path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:t=>{let e=t.custom.path,r=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${e}${r}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.hostname+e.pathname}},i(t,e))}},{key:"msgroup",displayName:"Microsoft Office 365 Group",description:"Store backups in Microsoft Office 365 Group.",oauthField:"authid",customFields:{groupEmail:{type:"Email",name:"groupEmail",shortDescription:"Group email",longDescription:"Group email",formElement:t=>o.control(t??"",[f.email])},path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let e=t.custom.path,r=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${e}${r}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.hostname+e.pathname}},i(t,e))}},{key:"cloudfiles",displayName:"Rackspace CloudFiles",description:"Store backups in Rackspace CloudFiles.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>o.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>o.control(t??"")},path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:t=>{let e=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{port:r,server:n,path:s}=t.custom;return`${t.destinationType}://${n+y(r)+l(s)+e}`},from:(t,e,r)=>a({destinationType:t,custom:{server:e.hostname,port:e.port,path:e.pathname}},i(t,e))}},{key:"rclone",displayName:"Rclone",description:"Store backups in Rclone.",dynamicFields:[{name:"rclone-local-repository",shortDescription:"Local repository",defaultValue:""},{name:"rclone-remote-repository",shortDescription:"Remote repository",defaultValue:""},{name:"rclone-remote-path",shortDescription:"Path on remote repository",defaultValue:""}],mapper:{to:t=>{let e=t.dynamic["rclone-remote-repository"],r=t.dynamic["rclone-remote-path"],n=Object.entries(t.dynamic).filter(([p])=>!["rclone-remote-repository","rclone-remote-path"].includes(p)),s=c([...Object.entries(t.advanced),...n]);return`${t.destinationType}://${e}/${r+s}`},from:(t,e,r)=>{let{advanced:n,dynamic:s}=i(t,e);return a({destinationType:t,dynamic:a({"rclone-remote-repository":e.hostname,"rclone-remote-path":e.pathname},s)},n)}}},{key:"openstack",displayName:"OpenStack Object Storage",description:"Store backups in OpenStack Object Storage.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket",longDescription:"Bucket",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"openstack-authuri",shortDescription:"Auth URI",type:"Enumeration",loadOptions:t=>t.get(d).openstackProviders},{name:"openstack-version",shortDescription:"Version",type:"Enumeration",loadOptions:t=>t.get(d).openstackVersions},{name:"openstack-domain-name",shortDescription:"Domain name"},{name:"openstack-tenant-name",shortDescription:"Tenant name"},{name:"openstack-region",shortDescription:"Region"}],mapper:{to:t=>{let e=c([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{bucket:r}=t.custom;return`${t.destinationType}://${r+e}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.pathname,bucket:e.hostname}},i(t,e))}},{key:"webdav",displayName:"WebDAV",description:"Store backups in WebDAV.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>o.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>o.control(t??"")},path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"use-ssl",shortDescription:"Use SSL"},{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:t=>{let{port:e,server:r,path:n}=t.custom,s=t.dynamic["use-ssl"],p=c([...Object.entries(t.advanced),...Object.entries(t.dynamic).filter(([u])=>u!=="use-ssl")]);return`${t.destinationType}${s?"s":""}://${r+y(e)+l(n)+p}`},from:(t,e,r)=>a({destinationType:t,custom:{server:e.hostname,port:e.port,path:e.pathname}},i(t,e))}},{key:"aftp",displayName:"FTP",description:"Store backups in FTP.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>o.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>o.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",doubleSlash:{type:"warning",message:$localize`Using double leading slashes makes the path absolute, pointing to the root of the filesystem.`},formElement:t=>o.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:t=>{let{port:e,server:r,path:n}=t.custom,s=c([...Object.entries(t.advanced),...Object.entries(t.dynamic).filter(([p])=>p!=="use-ssl")]);return`${t.destinationType}://${r+y(e)+l(n)+s}`},from:(t,e,r)=>a({destinationType:t,custom:{server:e.hostname,port:e.port,path:e.pathname}},i(t,e))}},{key:"sia",displayName:"Sia Decentrilized Cloud",description:"Store backups in Sia Decentrilized Cloud.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>o.control(t??"")}},dynamicFields:["sia-targetpath","sia-password","sia-redundancy"],mapper:{to:t=>{let e=t.custom.server,r=t.dynamic["sia-targetpath"],n=c([...Object.entries(t.advanced),...Object.entries(t.dynamic).filter(([s])=>s!=="sia-targetpath")]);return`${t.destinationType}://${e+l(r)+n}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.pathname}},i(t,e))}},{key:"cos",displayName:"Tencent COS",description:"Store backups in Tencent COS.",customFields:{path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"cos-bucket",shortDescription:"Bucket",order:1},{name:"cos-region",shortDescription:"Region",order:2},{name:"cos-app-id",shortDescription:"COS App Id",order:3},{name:"cos-secret-id",shortDescription:"COS Secret Id",order:4},{name:"cos-secret-key",shortDescription:"COS Secret Key",order:5}],mapper:{to:t=>{let e=t.custom.path,r=c([...Object.entries(t.advanced),...Object.entries(t.dynamic).filter(([n])=>n!=="cos-targetpath")]);return`${t.destinationType}://${e+r}`},from:(t,e,r)=>a({destinationType:t,custom:{path:e.pathname}},i(t,e))}},{key:"tahoe",displayName:"Tahoe LAFS",description:"Store backups in Tahoe LAFS.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>o.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>o.control(t??"")},path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:[{name:"use-ssl",shortDescription:"Use SSL"}],mapper:{to:t=>{let{port:e,server:r,path:n,username:s,password:p}=t.custom,u={"auth-username":s,"auth-password":p},g=t.dynamic["use-ssl"],S=c([...Object.entries(t.advanced),...Object.entries(t.dynamic).filter(([O])=>O!=="use-ssl"),...Object.entries(u)]);return`${t.destinationType}${g?"s":""}://${r+y(e)+l(n)+S}`},from:(t,e,r)=>a({destinationType:t,custom:{server:e.hostname,port:e.port,path:e.pathname}},i(t,e))}},{key:"cifs",displayName:"CIFS",description:"Store backups in CIFS.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>o.control(t??"")},share:{type:"String",name:"share",shortDescription:"Share Name",longDescription:"Share Name",formElement:t=>o.control(t??"")},path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>o.control(t??"")}},dynamicFields:["transport","auth-username","auth-password","auth-domain"],mapper:{to:t=>{let{share:e,server:r,path:n,username:s,password:p}=t.custom,u={"auth-username":s,"auth-password":p},g=new Map([...Object.entries(u),...Object.entries(t.advanced),...Object.entries(t.dynamic)]),S=c(Array.from(g));return`${t.destinationType}://${r+l(e)+l(n)+S}`},from:(t,e,r)=>{let n=e.pathname.split("/")[1],s=e.pathname.split("/").slice(2).join("/");return a({destinationType:t,custom:{server:e.hostname,share:n,path:s}},i(t,e))}}},{key:"filen",displayName:"Filen.io",description:"Store backups in Filen.io.",customFields:{path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on Filen",longDescription:"Path on Filen",formElement:t=>o.control(t??"")}},dynamicFields:["auth-username","auth-password"],mapper:{to:t=>{let{path:e,username:r,password:n}=t.custom,s={"auth-username":r,"auth-password":n},p=new Map([...Object.entries(s),...Object.entries(t.advanced),...Object.entries(t.dynamic)]),u=c(Array.from(p));return`${t.destinationType}://${e+u}`},from:(t,e,r)=>{let n=e.hostname??"";return e.pathname&&n!==""&&e.pathname[0]!="/"&&(n+="/"),n+=e.pathname,a({destinationType:t,custom:{path:n}},i(t,e))}}},{key:"filejump",displayName:"Filejump",description:"Store backups in Filejump.",customFields:{path:{type:"String",name:"path",doubleSlash:m,shortDescription:"Path on Filejump",longDescription:"Path on Filejump",formElement:t=>o.control(t??"")}},dynamicFields:[{type:"Password",name:"api-token",shortDescription:"API Token",longDescription:"Filejump API Token",formElement:t=>o.control(t??"")}],mapper:{to:t=>{let{path:e,username:r,password:n,apitoken:s}=t.custom,p=(s||"").trim()===""?{"auth-username":r,"auth-password":n}:{"api-token":s},u=new Map([...Object.entries(p),...Object.entries(t.advanced),...Object.entries(t.dynamic)]),g=c(Array.from(u));return`${t.destinationType}://${e+g}`},from:(t,e,r)=>{let n=e.hostname??"";return e.pathname&&n!==""&&e.pathname[0]!="/"&&(n+="/"),n+=e.pathname,a({destinationType:t,custom:{path:n}},i(t,e))}}},{key:"storj",customKey:"storjAccessGrant",displayName:"Storj Access Grant",description:"Store backups in Storj Access Grant.",dynamicFields:[{name:"storj-shared-access",shortDescription:"Access Grant"},{name:"storj-bucket",shortDescription:"Bucket"},{name:"storj-folder",shortDescription:"Path on server",doubleSlash:m}],mapper:{to:t=>`storj://storj.io/config?storj-auth-method=Access%20grant&storj-satellite=us1.storj.io%3A7777&storj-api-key&storj-secret&${c([...Object.entries(t.advanced),...Object.entries(t.dynamic)],!0)}`,from:(t,e,r)=>a({destinationType:t},i(t,e))}},{key:"storj",customKey:"storjApiKey",displayName:"Storj API Key",description:"Store backups in Storj API Key.",dynamicFields:[{name:"storj-satellite",shortDescription:"Satellite",type:"Enumeration",loadOptions:t=>t.get(d).storjSatellites},{name:"storj-api-key",shortDescription:"API Key"},{name:"storj-secret",shortDescription:"Secret"},{name:"storj-bucket",shortDescription:"Bucket"},{name:"storj-folder",shortDescription:"Path on server",doubleSlash:m}],mapper:{to:t=>`storj://storj.io/config?storj-auth-method=API%20key&${c([...Object.entries(t.advanced),...Object.entries(t.dynamic)],!0)}`,from:(t,e,r)=>a({destinationType:t},i(t,e))}}],W={".amazonaws.com":"Amazon S3",".mycloudyplace.com":"MyCloudyPlace S3",".impossibleapi.net":"Impossible Cloud S3",".scw.cloud":"Scaleway S3",".hosteurope.de":"Hosteurope S3",".dunkel.de":"Dunkel S3",".dreamhost.com":"DreamHost S3",".dincloud.com":"dinCloud S3",".polisystems.ch":"Poli Systems S3",".softlayer.net":"IBM COS (S3)",".storadera.com":"Storadera S3",".wasabisys.com":"Wasabi S3",".infomaniak.com":"Infomaniak S3",".infomaniak.cloud":"Infomaniak S3",".sakurastorage.jp":"\u3055\u304F\u3089\u306E\u30AF\u30E9\u30A6\u30C9 S3",".lyvecloud.seagate.com":"Seagate Lyve S3",".digitaloceanspaces.com":"DigitalOcean S3",".backblazeb2.com":"Backblaze B2 S3",".cloudian.com":"Cloudian S3",".min.io":"MinIO S3",".linodeobjects.com":"Linode S3",".bunnycdn.com":"BunnyCDN S3",".azure.com":"Microsoft Azure S3",".googleapis.com":"Google Cloud Storage S3",".ibm.com":"IBM Cloud S3",".oracle.com":"Oracle Cloud S3",".cloudflare.com":"Cloudflare S3",".alibaba.com":"Alibaba Cloud S3",".huawei.com":"Huawei Cloud S3",".tencent.com":"Tencent Cloud S3",".baidu.com":"Baidu Cloud S3",".jd.com":"JD Cloud S3",".ucloud.cn":"UCloud S3",".qiniu.com":"Qiniu Cloud S3",".aliyuncs.com":"Aliyun S3",".tcloud.com":"TCloud S3",".tencentcloudapi.com":"Tencent Cloud S3"};function y(t){return t==null||t===""?"":":"+t.toString()}function l(t){return t==null?"":t.startsWith("/")?t:"/"+t}function i(t,e){let r={},n={},s=k.find(p=>p.key===t);return e.searchParams.forEach((p,u)=>{s?.dynamicFields?.some(S=>S===u||S?.name===u)?n[u]=decodeURIComponent(p):r[u]=decodeURIComponent(p)}),{advanced:r,dynamic:n}}function c(t,e=!1){let r=t.map(([s,p])=>`${s}=${p?encodeURIComponent(p.toString()):""}`).join("&");return r?(e?"":"?")+r:""}function q(t){let e=t.destinationType,r=k.find(n=>n.customKey===e||n.key===e);if(!r)throw new Error("Invalid destination type");return r?.mapper.to(t)??""}function H(t){let e=URL.canParse(t),r=t.split("://")[0],n=t.split("://")[1],s="http://"+n;if(n.startsWith("%")&&r==="file")return k.find(p=>p.customKey===r||p.key===r)?.mapper.from(r,new URL("http://localhost"),t);try{let p=new URL(s);return k.find(u=>u.customKey===r||u.key===r)?.mapper.from(r,p,t)}catch(p){console.error("Error while parsing target path",p)}if(!e)throw new Error("Invalid target path");return null}export{q as a,H as b,k as c,W as d};