@duplicati/ngclient 0.0.140 → 0.0.141

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{g as mt}from"./chunk-JI7GCFQB.js";import{a as Et,b as Ot,c as Ct}from"./chunk-CDXBWYCI.js";import"./chunk-X7SFNRJF.js";import"./chunk-N57J64DN.js";import"./chunk-2G6TVFPZ.js";import{a as Dt}from"./chunk-AH5TLYN4.js";import{h as dt}from"./chunk-ZAFFTZSE.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-B26UYXA3.js";import"./chunk-LDIZ5E5Z.js";import"./chunk-J6BHRR34.js";import{a as m}from"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import{c as _t,e as ct,f as ut,g as Tt,i as pt,j as gt,s as St}from"./chunk-NSIELNIY.js";import"./chunk-3ZVSHKLD.js";import{b as nt,d as it}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{a as ot,b as at,d as st,e as Ft,l as rt,o as lt}from"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import{Ab as p,Bb as L,Cb as b,Eb as E,Hc as G,Kb as u,Lb as T,Mb as f,Nb as k,Ob as $,Oc as et,Pb as w,Qa as r,Qb as S,Rb as l,Z as O,Zb as Q,_b as q,ab as H,bc as Y,da as _,ea as c,ec as N,fc as B,gc as J,ha as j,jc as A,kc as M,lc as P,na as C,rc as Z,sb as D,sc as tt,tb as d,ub as y,vb as h,wb as x,xb as I,yb as s,zb as F}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";var Rt=["formRef"],It=()=>({maxWidth:"700px",width:"100%"});function Nt(i,n){if(i&1){let t=E();u(0,2,1),s(1,"button",30),S("click",function(){_(t);let e=l();return c(e.testDestination(0,!0))}),F(),T()}if(i&2){let t=l();r(),Y("loader",t.testSignal()=="testing"),I("disabled",t.testSignal()=="testing")}}function ft(i,n){if(i&1){let t=E();u(0,2,2),s(1,"button",20),S("click",function(){_(t);let e=l();return c(e.copyTargetUrl())}),p(2,"spk-icon"),F(),T()}}function kt(i,n){i&1&&(s(0,"spk-alert"),u(1,5),p(2,"spk-icon",31),T(),F())}function $t(i,n){i&1&&(s(0,"spk-alert",21),u(1,6),p(2,"spk-icon",31),T(),F())}function At(i,n){if(i&1&&(s(0,"spk-alert",22),u(1,7),p(2,"spk-icon",31),T(),F()),i&2){let t=l();r(2),k(t.testErrorMessage()),$(1)}}function Mt(i,n){if(i&1&&(s(0,"spk-alert",23),u(1,8),p(2,"spk-icon",31),T(),F()),i&2){let t=l();r(2),k(t.testErrorMessage()),$(1)}}function Pt(i,n){if(i&1){let t=E();s(0,"p",32),S("click",function(){_(t);let e=l();return c(e.removeDestination())}),u(1,9),p(2,"strong")(3,"br")(4,"span",33),T(),F()}if(i&2){let t,o=l();r(4),k((t=o.selectedDestinationType())==null?null:t.displayName),$(1)}}function yt(i,n){if(i&1){let t=E();s(0,"div",39),S("click",function(){let e=_(t).$implicit,a=l(2);return c(a.setDestination(e.key))}),s(1,"h3"),N(2),F(),s(3,"p"),N(4),F()()}if(i&2){let t=n.$implicit;r(2),B(t.displayName),r(2),B(t.description)}}function ht(i,n){if(i&1){let t=E();s(0,"button",40,1),S("click",function(){let e=_(t).$implicit,a=l(2);return c(a.setDestination(e.key))}),N(2),F()}if(i&2){let t=n.$implicit;r(2),J(" ",t.displayName," ")}}function xt(i,n){if(i&1&&(s(0,"div",34),h(1,yt,5,2,"div",35,y),F(),s(3,"spk-menu",36)(4,"button",37),f(5,10),F(),L(6,19),h(7,ht,3,1,"button",38,y),b(),F()),i&2){let t=l();r(),x(t.destinationTypeOptionsFocused()),r(2),I("searchable",!0),r(4),x(t.destinationTypeOptions())}}function Lt(i,n){if(i&1){let t=E();s(0,"app-single-destination",41),P("targetUrlChange",function(e){_(t);let a=l();return M(a.targetUrlModel,e)||(a.targetUrlModel=e),c(e)}),F()}if(i&2){let t=l();A("targetUrl",t.targetUrlModel)}}function bt(i,n){i&1&&(u(0,4,1),p(1,"spk-icon",28),T())}function wt(i,n){i&1&&(u(0,4,2),p(1,"spk-icon"),T())}function Bt(i,n){if(i&1){let t=E();s(0,"spk-dialog",42),P("isOpenChange",function(e){_(t);let a=l();return M(a.targetUrlDialogOpen,e)||(a.targetUrlDialogOpen=e),c(e)}),s(1,"header",43)(2,"h2"),f(3,11),F(),s(4,"spk-alert",22),f(5,12),F()(),s(6,"div",44)(7,"spk-form-field")(8,"textarea",45),P("ngModelChange",function(e){_(t);let a=l();return M(a.targetUrlCtrl,e)||(a.targetUrlCtrl=e),c(e)}),F()()(),s(9,"footer",46)(10,"button",26),S("click",function(){_(t);let e=l();return c(e.closeTargetUrlDialog(!1))}),N(11,"Cancel"),F(),s(12,"button",47),S("click",function(){_(t);let e=l();return c(e.closeTargetUrlDialog(!0))}),u(13,13),p(14,"spk-icon"),T(),F()()()}if(i&2){let t=l();A("isOpen",t.targetUrlDialogOpen),I("options",tt(3,It)),r(8),A("ngModel",t.targetUrlCtrl)}}var v=class i{#i=O(it);#o=O(nt);#e=O(Ft);#a=O(Et);injector=O(j);#t=O(mt);#s=O(Ot);formRef=et.required("formRef");targetUrlModel=this.#t.destinationTargetUrl;targetUrlCtrl=C(null);targetUrlInitial=C(null);targetUrlDialogOpen=C(!1);toggleNewDestination=C(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;destinationTypeOptionsInFocus=C(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#s.destinationTypeOptions;destinationTypeOptionsFocused=G(()=>{let n=this.destinationTypeOptionsInFocus(),t=this.destinationTypeOptions();return n.map(o=>t.find(e=>e.key===o))});selectedDestinationType=G(()=>{let n=this.#t.destinationTargetUrl();if(!n)return null;let t=n.split("://")[0];return Dt(t)});copyTargetUrl(){navigator.clipboard.writeText(this.#t.destinationTargetUrl()??"")}openTargetUrlDialog(){let n=this.#t.destinationTargetUrl();this.targetUrlCtrl.set(n),this.targetUrlInitial.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),o=this.targetUrlInitial();!n||t===o||!t||this.#t.updateTargetUrl(t)}testDestination(n,t,o){let e=this.#t.destinationTargetUrl();e&&(this.#t.setTestState("testing"),this.#a.testDestination(e,n,!0,t).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),a.containsBackup===!1?(this.#t.setTestState("warning",$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`),t||this.#e.open(m,{data:{title:$localize`Folder contains no backup`,message:$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!1&&(this.#t.setTestState("warning",$localize`The remote destination is empty. Please check if the destination details are correct.`),t||this.#e.open(m,{data:{title:$localize`Folder is empty`,message:$localize`The remote destination is empty. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})),o?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){o?.();return}let R=e.includes("?");a.action==="trust-cert"&&this.#t.updateTargetUrl(e+`${R?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.updateTargetUrl(e+`${R?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):o?.()}}))}setDestination(n){this.#t.updateTargetUrl(`${n}://`)}removeDestination(){this.#t.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let n=this.testSignal();if(n===""){this.#e.open(m,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:t=>{t?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open(m,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(n!=="success"){this.#e.open(m,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:t=>{t&&this.#n()}});return}this.#n()}#n(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=H({type:i,selectors:[["app-restore-destination"]],viewQuery:function(t,o){t&1&&Q(o.formRef,Rt,5),t&2&&q()},features:[Z([dt])],decls:30,vars:9,consts:()=>{let n;n=$localize` Backup destination ${"\uFFFD#5\uFFFD"}:START_TAG_DIV:${"[\uFFFD*6:1\uFFFD|\uFFFD*13:2\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON: Test destination ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*6:1\uFFFD|\uFFFD/*13:2\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD#7\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SPK_ICON:dots-three-vertical${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#10\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD#11\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SPK_ICON:link${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD*6:1\uFFFD|\uFFFD*13:2\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:2\uFFFD"}:START_TAG_BUTTON_3:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SPK_ICON:copy${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copy url to clipboard ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*6:1\uFFFD|\uFFFD/*13:2\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SPK_MENU:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_DIV:`,n=w(n);let t;t=$localize`${"\uFFFD#24\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#24\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let o;o=$localize`${"\uFFFD*27:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SPK_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"\uFFFD/*27:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*28:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SPK_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"\uFFFD/*28:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,o=w(o);let e;e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: Testing connection... `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: Connection tested successfully. `;let R;R=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let U;U=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let K;K=$localize` Current destination type ${"\uFFFD#2\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:.${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#3\uFFFD\uFFFD/#3\uFFFD"}:LINE_BREAK: Want to select another? ${"\uFFFD#4\uFFFD"}:START_TAG_SPAN:Click here${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SPAN:`;let V;V=$localize`All destinations`;let W;W=$localize`Edit target URL`;let z;z=$localize`Be careful, this will overwrite everything you have in your destination.`;let X;return X=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SPK_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],["option",""],n,t,o,e,a,R,U,K,V,W,z,X,[3,"submit"],[1,"title-30"],[1,"actions"],["spk-button","","type","button",1,"small",3,"disabled","loader"],["spk-button","","type","button",1,"small"],["menu",""],["spk-button","","type","button",1,"small",3,"click"],[1,"success"],[1,"warn"],[1,"error"],[3,"targetUrl"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["spk-button","","type","button",1,"small",3,"click","disabled"],["icon",""],[3,"click"],[1,"spk-primary"],[1,"most-common-destinations"],[1,"tile"],[3,"searchable"],["spk-button","","type","button",1,"outlined"],["type","button"],[1,"tile",3,"click"],["type","button",3,"click"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["spk-button","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,o){if(t&1){let e=E();s(0,"form",14,0),S("submit",function(){return _(e),c(o.next())}),s(2,"header")(3,"h3",15),u(4,2),s(5,"div",16),D(6,Nt,2,3,"button",17),s(7,"spk-menu")(8,"button",18),p(9,"spk-icon"),F(),L(10,19),s(11,"button",20),S("click",function(){return _(e),c(o.openTargetUrlDialog())}),p(12,"spk-icon"),F(),D(13,ft,3,0,"button",18),b(),F()(),T(),F(),D(14,kt,3,0,"spk-alert")(15,$t,3,0,"spk-alert",21)(16,At,3,1,"spk-alert",22)(17,Mt,3,1,"spk-alert",23),D(18,Pt,5,1,"p"),F(),D(19,xt,9,1),D(20,Lt,1,1,"app-single-destination",24),s(21,"div",25)(22,"button",26),S("click",function(){return _(e),c(o.goBack())}),u(23,3),p(24,"spk-icon"),T(),F(),s(25,"button",27),u(26,4),D(27,bt,2,0,"spk-icon",28)(28,wt,2,0,"spk-icon"),T(),F()()(),D(29,Bt,15,4,"spk-dialog",29)}if(t&2){let e=!!o.targetUrlModel();r(6),d(e?6:-1),r(7),d(e?13:-1),r(),d(o.testSignal()=="testing"?14:o.testSignal()=="success"?15:o.testSignal()=="warning"?16:o.testSignal()=="error"?17:-1),r(4),d(e?18:-1),r(),d(e?-1:19),r(),d(e?20:-1),r(5),I("disabled",o.testSignal()=="testing"||!e),r(2),d(o.testSignal()=="testing"?27:28),r(2),d(o.targetUrlDialogOpen()?29:-1)}},dependencies:[Ct,St,gt,_t,ct,ut,pt,Tt,rt,lt,ot,st,at],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] spk-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-500)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-500)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}"],changeDetection:0})};export{v as default};
1
+ import{g as mt}from"./chunk-JA3Y722G.js";import{a as Et,b as Ot,c as Ct}from"./chunk-CDXBWYCI.js";import"./chunk-X7SFNRJF.js";import"./chunk-N57J64DN.js";import"./chunk-2G6TVFPZ.js";import{a as Dt}from"./chunk-AH5TLYN4.js";import{h as dt}from"./chunk-ZAFFTZSE.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-B26UYXA3.js";import"./chunk-LDIZ5E5Z.js";import"./chunk-J6BHRR34.js";import{a as m}from"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import{c as _t,e as ct,f as ut,g as Tt,i as pt,j as gt,s as St}from"./chunk-NSIELNIY.js";import"./chunk-3ZVSHKLD.js";import{b as nt,d as it}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{a as ot,b as at,d as st,e as Ft,l as rt,o as lt}from"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import{Ab as p,Bb as L,Cb as b,Eb as E,Hc as G,Kb as u,Lb as T,Mb as f,Nb as k,Ob as $,Oc as et,Pb as w,Qa as r,Qb as S,Rb as l,Z as O,Zb as Q,_b as q,ab as H,bc as Y,da as _,ea as c,ec as N,fc as B,gc as J,ha as j,jc as A,kc as M,lc as P,na as C,rc as Z,sb as D,sc as tt,tb as d,ub as y,vb as h,wb as x,xb as I,yb as s,zb as F}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";var Rt=["formRef"],It=()=>({maxWidth:"700px",width:"100%"});function Nt(i,n){if(i&1){let t=E();u(0,2,1),s(1,"button",30),S("click",function(){_(t);let e=l();return c(e.testDestination(0,!0))}),F(),T()}if(i&2){let t=l();r(),Y("loader",t.testSignal()=="testing"),I("disabled",t.testSignal()=="testing")}}function ft(i,n){if(i&1){let t=E();u(0,2,2),s(1,"button",20),S("click",function(){_(t);let e=l();return c(e.copyTargetUrl())}),p(2,"spk-icon"),F(),T()}}function kt(i,n){i&1&&(s(0,"spk-alert"),u(1,5),p(2,"spk-icon",31),T(),F())}function $t(i,n){i&1&&(s(0,"spk-alert",21),u(1,6),p(2,"spk-icon",31),T(),F())}function At(i,n){if(i&1&&(s(0,"spk-alert",22),u(1,7),p(2,"spk-icon",31),T(),F()),i&2){let t=l();r(2),k(t.testErrorMessage()),$(1)}}function Mt(i,n){if(i&1&&(s(0,"spk-alert",23),u(1,8),p(2,"spk-icon",31),T(),F()),i&2){let t=l();r(2),k(t.testErrorMessage()),$(1)}}function Pt(i,n){if(i&1){let t=E();s(0,"p",32),S("click",function(){_(t);let e=l();return c(e.removeDestination())}),u(1,9),p(2,"strong")(3,"br")(4,"span",33),T(),F()}if(i&2){let t,o=l();r(4),k((t=o.selectedDestinationType())==null?null:t.displayName),$(1)}}function yt(i,n){if(i&1){let t=E();s(0,"div",39),S("click",function(){let e=_(t).$implicit,a=l(2);return c(a.setDestination(e.key))}),s(1,"h3"),N(2),F(),s(3,"p"),N(4),F()()}if(i&2){let t=n.$implicit;r(2),B(t.displayName),r(2),B(t.description)}}function ht(i,n){if(i&1){let t=E();s(0,"button",40,1),S("click",function(){let e=_(t).$implicit,a=l(2);return c(a.setDestination(e.key))}),N(2),F()}if(i&2){let t=n.$implicit;r(2),J(" ",t.displayName," ")}}function xt(i,n){if(i&1&&(s(0,"div",34),h(1,yt,5,2,"div",35,y),F(),s(3,"spk-menu",36)(4,"button",37),f(5,10),F(),L(6,19),h(7,ht,3,1,"button",38,y),b(),F()),i&2){let t=l();r(),x(t.destinationTypeOptionsFocused()),r(2),I("searchable",!0),r(4),x(t.destinationTypeOptions())}}function Lt(i,n){if(i&1){let t=E();s(0,"app-single-destination",41),P("targetUrlChange",function(e){_(t);let a=l();return M(a.targetUrlModel,e)||(a.targetUrlModel=e),c(e)}),F()}if(i&2){let t=l();A("targetUrl",t.targetUrlModel)}}function bt(i,n){i&1&&(u(0,4,1),p(1,"spk-icon",28),T())}function wt(i,n){i&1&&(u(0,4,2),p(1,"spk-icon"),T())}function Bt(i,n){if(i&1){let t=E();s(0,"spk-dialog",42),P("isOpenChange",function(e){_(t);let a=l();return M(a.targetUrlDialogOpen,e)||(a.targetUrlDialogOpen=e),c(e)}),s(1,"header",43)(2,"h2"),f(3,11),F(),s(4,"spk-alert",22),f(5,12),F()(),s(6,"div",44)(7,"spk-form-field")(8,"textarea",45),P("ngModelChange",function(e){_(t);let a=l();return M(a.targetUrlCtrl,e)||(a.targetUrlCtrl=e),c(e)}),F()()(),s(9,"footer",46)(10,"button",26),S("click",function(){_(t);let e=l();return c(e.closeTargetUrlDialog(!1))}),N(11,"Cancel"),F(),s(12,"button",47),S("click",function(){_(t);let e=l();return c(e.closeTargetUrlDialog(!0))}),u(13,13),p(14,"spk-icon"),T(),F()()()}if(i&2){let t=l();A("isOpen",t.targetUrlDialogOpen),I("options",tt(3,It)),r(8),A("ngModel",t.targetUrlCtrl)}}var v=class i{#i=O(it);#o=O(nt);#e=O(Ft);#a=O(Et);injector=O(j);#t=O(mt);#s=O(Ot);formRef=et.required("formRef");targetUrlModel=this.#t.destinationTargetUrl;targetUrlCtrl=C(null);targetUrlInitial=C(null);targetUrlDialogOpen=C(!1);toggleNewDestination=C(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;destinationTypeOptionsInFocus=C(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#s.destinationTypeOptions;destinationTypeOptionsFocused=G(()=>{let n=this.destinationTypeOptionsInFocus(),t=this.destinationTypeOptions();return n.map(o=>t.find(e=>e.key===o))});selectedDestinationType=G(()=>{let n=this.#t.destinationTargetUrl();if(!n)return null;let t=n.split("://")[0];return Dt(t)});copyTargetUrl(){navigator.clipboard.writeText(this.#t.destinationTargetUrl()??"")}openTargetUrlDialog(){let n=this.#t.destinationTargetUrl();this.targetUrlCtrl.set(n),this.targetUrlInitial.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),o=this.targetUrlInitial();!n||t===o||!t||this.#t.updateTargetUrl(t)}testDestination(n,t,o){let e=this.#t.destinationTargetUrl();e&&(this.#t.setTestState("testing"),this.#a.testDestination(e,n,!0,t).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),a.containsBackup===!1?(this.#t.setTestState("warning",$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`),t||this.#e.open(m,{data:{title:$localize`Folder contains no backup`,message:$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!1&&(this.#t.setTestState("warning",$localize`The remote destination is empty. Please check if the destination details are correct.`),t||this.#e.open(m,{data:{title:$localize`Folder is empty`,message:$localize`The remote destination is empty. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})),o?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){o?.();return}let R=e.includes("?");a.action==="trust-cert"&&this.#t.updateTargetUrl(e+`${R?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.updateTargetUrl(e+`${R?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):o?.()}}))}setDestination(n){this.#t.updateTargetUrl(`${n}://`)}removeDestination(){this.#t.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let n=this.testSignal();if(n===""){this.#e.open(m,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:t=>{t?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open(m,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(n!=="success"){this.#e.open(m,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:t=>{t&&this.#n()}});return}this.#n()}#n(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=H({type:i,selectors:[["app-restore-destination"]],viewQuery:function(t,o){t&1&&Q(o.formRef,Rt,5),t&2&&q()},features:[Z([dt])],decls:30,vars:9,consts:()=>{let n;n=$localize` Backup destination ${"\uFFFD#5\uFFFD"}:START_TAG_DIV:${"[\uFFFD*6:1\uFFFD|\uFFFD*13:2\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON: Test destination ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*6:1\uFFFD|\uFFFD/*13:2\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD#7\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SPK_ICON:dots-three-vertical${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#10\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD#11\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SPK_ICON:link${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD*6:1\uFFFD|\uFFFD*13:2\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:2\uFFFD"}:START_TAG_BUTTON_3:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SPK_ICON:copy${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copy url to clipboard ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*6:1\uFFFD|\uFFFD/*13:2\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SPK_MENU:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_DIV:`,n=w(n);let t;t=$localize`${"\uFFFD#24\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#24\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let o;o=$localize`${"\uFFFD*27:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SPK_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"\uFFFD/*27:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*28:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SPK_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"\uFFFD/*28:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,o=w(o);let e;e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: Testing connection... `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: Connection tested successfully. `;let R;R=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let U;U=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let K;K=$localize` Current destination type ${"\uFFFD#2\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:.${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#3\uFFFD\uFFFD/#3\uFFFD"}:LINE_BREAK: Want to select another? ${"\uFFFD#4\uFFFD"}:START_TAG_SPAN:Click here${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SPAN:`;let V;V=$localize`All destinations`;let W;W=$localize`Edit target URL`;let z;z=$localize`Be careful, this will overwrite everything you have in your destination.`;let X;return X=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SPK_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],["option",""],n,t,o,e,a,R,U,K,V,W,z,X,[3,"submit"],[1,"title-30"],[1,"actions"],["spk-button","","type","button",1,"small",3,"disabled","loader"],["spk-button","","type","button",1,"small"],["menu",""],["spk-button","","type","button",1,"small",3,"click"],[1,"success"],[1,"warn"],[1,"error"],[3,"targetUrl"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["spk-button","","type","button",1,"small",3,"click","disabled"],["icon",""],[3,"click"],[1,"spk-primary"],[1,"most-common-destinations"],[1,"tile"],[3,"searchable"],["spk-button","","type","button",1,"outlined"],["type","button"],[1,"tile",3,"click"],["type","button",3,"click"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["spk-button","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,o){if(t&1){let e=E();s(0,"form",14,0),S("submit",function(){return _(e),c(o.next())}),s(2,"header")(3,"h3",15),u(4,2),s(5,"div",16),D(6,Nt,2,3,"button",17),s(7,"spk-menu")(8,"button",18),p(9,"spk-icon"),F(),L(10,19),s(11,"button",20),S("click",function(){return _(e),c(o.openTargetUrlDialog())}),p(12,"spk-icon"),F(),D(13,ft,3,0,"button",18),b(),F()(),T(),F(),D(14,kt,3,0,"spk-alert")(15,$t,3,0,"spk-alert",21)(16,At,3,1,"spk-alert",22)(17,Mt,3,1,"spk-alert",23),D(18,Pt,5,1,"p"),F(),D(19,xt,9,1),D(20,Lt,1,1,"app-single-destination",24),s(21,"div",25)(22,"button",26),S("click",function(){return _(e),c(o.goBack())}),u(23,3),p(24,"spk-icon"),T(),F(),s(25,"button",27),u(26,4),D(27,bt,2,0,"spk-icon",28)(28,wt,2,0,"spk-icon"),T(),F()()(),D(29,Bt,15,4,"spk-dialog",29)}if(t&2){let e=!!o.targetUrlModel();r(6),d(e?6:-1),r(7),d(e?13:-1),r(),d(o.testSignal()=="testing"?14:o.testSignal()=="success"?15:o.testSignal()=="warning"?16:o.testSignal()=="error"?17:-1),r(4),d(e?18:-1),r(),d(e?-1:19),r(),d(e?20:-1),r(5),I("disabled",o.testSignal()=="testing"||!e),r(2),d(o.testSignal()=="testing"?27:28),r(2),d(o.targetUrlDialogOpen()?29:-1)}},dependencies:[Ct,St,gt,_t,ct,ut,pt,Tt,rt,lt,ot,st,at],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] spk-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-500)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-500)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}"],changeDetection:0})};export{v as default};
@@ -1 +1 @@
1
- import{e as a,f as b}from"./chunk-JI7GCFQB.js";import"./chunk-N57J64DN.js";import"./chunk-2G6TVFPZ.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-LDIZ5E5Z.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import"./chunk-NSIELNIY.js";import"./chunk-3ZVSHKLD.js";import"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";export{a as createRestoreSelectFilesForm,b as default};
1
+ import{e as a,f as b}from"./chunk-JA3Y722G.js";import"./chunk-N57J64DN.js";import"./chunk-2G6TVFPZ.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-LDIZ5E5Z.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import"./chunk-NSIELNIY.js";import"./chunk-3ZVSHKLD.js";import"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";export{a as createRestoreSelectFilesForm,b as default};
@@ -1 +1 @@
1
- import{c as a,d as b}from"./chunk-JI7GCFQB.js";import"./chunk-N57J64DN.js";import"./chunk-2G6TVFPZ.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-LDIZ5E5Z.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import"./chunk-NSIELNIY.js";import"./chunk-3ZVSHKLD.js";import"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";export{a as createEncryptionForm,b as default};
1
+ import{c as a,d as b}from"./chunk-JA3Y722G.js";import"./chunk-N57J64DN.js";import"./chunk-2G6TVFPZ.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-LDIZ5E5Z.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import"./chunk-NSIELNIY.js";import"./chunk-3ZVSHKLD.js";import"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";export{a as createEncryptionForm,b as default};
@@ -1 +1 @@
1
- import{g as m}from"./chunk-JI7GCFQB.js";import"./chunk-N57J64DN.js";import"./chunk-2G6TVFPZ.js";import{a as y}from"./chunk-XIOHRQ3X.js";import{h as w}from"./chunk-ZAFFTZSE.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-B26UYXA3.js";import{b as u}from"./chunk-LDIZ5E5Z.js";import"./chunk-WZRDKVOR.js";import"./chunk-ULLALJQ2.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import"./chunk-NSIELNIY.js";import"./chunk-7QJG4IIT.js";import"./chunk-3ZVSHKLD.js";import{a as L,b as M,c as N,d as I,e as h,f as G}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{q as W,v}from"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-UZK7ABRM.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-B6OIHB5W.js";import{Ab as s,Ic as $,Kb as F,Lb as l,Qa as r,Rb as E,Z as c,ab as P,bc as D,na as C,rc as A,sb as T,sc as S,tb as g,tc as O,xb as _,yb as i,zb as n}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";var x=()=>["/restore-from-files/destination"],K=()=>["/restore-from-files/encryption"],X=()=>["/restore-from-files/select-files"],b=()=>["/restore-from-files/options"],z=t=>["/restore",t,"select-files"],B=t=>["/restore",t,"options"];function U(t,o){t&1&&(i(0,"div",6),F(1,0),s(2,"spk-radio"),l(),n(),i(3,"div",6),F(4,1),s(5,"spk-radio"),l(),n(),i(6,"div",6),F(7,2),s(8,"spk-radio"),l(),n(),i(9,"div",6),F(10,3),s(11,"spk-radio"),l(),n()),t&2&&(_("routerLink",S(4,x)),r(3),_("routerLink",S(5,K)),r(3),_("routerLink",S(6,X)),r(3),_("routerLink",S(7,b)))}function j(t,o){if(t&1&&(i(0,"div",6),F(1,4),s(2,"spk-radio"),l(),n(),i(3,"div",6),F(4,5),s(5,"spk-radio"),l(),n()),t&2){let e=E(2);_("routerLink",O(2,z,e.backupId())),r(3),_("routerLink",O(4,B,e.backupId()))}}function H(t,o){if(t&1&&(i(0,"spk-stepper"),T(1,U,12,8)(2,j,6,6),n()),t&2){let e=E();r(),g(e.isFileRestore()?1:2)}}var k=class t{#e=c(M);#o=c(I);#t=c(m);#i=u(this.#e.params);#n=u(this.#e.url);#s=u(this.#e.children[0].url);backupId=this.#t.backupId;isFileRestore=this.#t.isFileRestore;isProgressPage=C(!1);paramsChanged=$(()=>{let o=this.#s(),e=this.#i()?.id,a=!!this.#n()?.find(d=>d.path==="restore-from-files"),R=!!o?.find(d=>d.path==="progress");this.isProgressPage.set(R),this.#t.init(e,a)});ngOnInit(){this.#o.events.subscribe(o=>{if(o instanceof L){let e=o.urlAfterRedirects;this.isProgressPage.set(e.includes("progress"))}})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=P({type:t,selectors:[["app-restore-flow"]],hostVars:2,hostBindings:function(e,a){e&2&&D("full-width",a.isProgressPage())},features:[A([m,w])],decls:4,vars:1,consts:()=>{let o;o=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_RADIO: Destination `;let e;e=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_RADIO: Encryption `;let a;a=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SPK_RADIO: Select files `;let R;R=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SPK_RADIO: Options `;let d;d=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_RADIO: Select files `;let f;return f=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_RADIO: Options `,[o,e,a,R,d,f,["step","","routerLinkActive","active",3,"routerLink"]]},template:function(e,a){e&1&&(s(0,"app-status-bar"),T(1,H,3,1,"spk-stepper"),i(2,"section"),s(3,"router-outlet"),n()),e&2&&(r(),g(a.isProgressPage()?-1:1))},dependencies:[v,W,y,N,h,G],styles:["[_nghost-%COMP%]{display:block}.full-width[_nghost-%COMP%] section[_ngcontent-%COMP%]{max-width:62.5rem}spk-stepper[_ngcontent-%COMP%]{max-width:31.25rem;margin:2.5rem auto}section[_ngcontent-%COMP%]{max-width:31.25rem;margin:0 auto 2.5rem}"],changeDetection:0})};export{k as default};
1
+ import{g as m}from"./chunk-JA3Y722G.js";import"./chunk-N57J64DN.js";import"./chunk-2G6TVFPZ.js";import{a as y}from"./chunk-XIOHRQ3X.js";import{h as w}from"./chunk-ZAFFTZSE.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-B26UYXA3.js";import{b as u}from"./chunk-LDIZ5E5Z.js";import"./chunk-WZRDKVOR.js";import"./chunk-ULLALJQ2.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import"./chunk-NSIELNIY.js";import"./chunk-7QJG4IIT.js";import"./chunk-3ZVSHKLD.js";import{a as L,b as M,c as N,d as I,e as h,f as G}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{q as W,v}from"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-UZK7ABRM.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-B6OIHB5W.js";import{Ab as s,Ic as $,Kb as F,Lb as l,Qa as r,Rb as E,Z as c,ab as P,bc as D,na as C,rc as A,sb as T,sc as S,tb as g,tc as O,xb as _,yb as i,zb as n}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";var x=()=>["/restore-from-files/destination"],K=()=>["/restore-from-files/encryption"],X=()=>["/restore-from-files/select-files"],b=()=>["/restore-from-files/options"],z=t=>["/restore",t,"select-files"],B=t=>["/restore",t,"options"];function U(t,o){t&1&&(i(0,"div",6),F(1,0),s(2,"spk-radio"),l(),n(),i(3,"div",6),F(4,1),s(5,"spk-radio"),l(),n(),i(6,"div",6),F(7,2),s(8,"spk-radio"),l(),n(),i(9,"div",6),F(10,3),s(11,"spk-radio"),l(),n()),t&2&&(_("routerLink",S(4,x)),r(3),_("routerLink",S(5,K)),r(3),_("routerLink",S(6,X)),r(3),_("routerLink",S(7,b)))}function j(t,o){if(t&1&&(i(0,"div",6),F(1,4),s(2,"spk-radio"),l(),n(),i(3,"div",6),F(4,5),s(5,"spk-radio"),l(),n()),t&2){let e=E(2);_("routerLink",O(2,z,e.backupId())),r(3),_("routerLink",O(4,B,e.backupId()))}}function H(t,o){if(t&1&&(i(0,"spk-stepper"),T(1,U,12,8)(2,j,6,6),n()),t&2){let e=E();r(),g(e.isFileRestore()?1:2)}}var k=class t{#e=c(M);#o=c(I);#t=c(m);#i=u(this.#e.params);#n=u(this.#e.url);#s=u(this.#e.children[0].url);backupId=this.#t.backupId;isFileRestore=this.#t.isFileRestore;isProgressPage=C(!1);paramsChanged=$(()=>{let o=this.#s(),e=this.#i()?.id,a=!!this.#n()?.find(d=>d.path==="restore-from-files"),R=!!o?.find(d=>d.path==="progress");this.isProgressPage.set(R),this.#t.init(e,a)});ngOnInit(){this.#o.events.subscribe(o=>{if(o instanceof L){let e=o.urlAfterRedirects;this.isProgressPage.set(e.includes("progress"))}})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=P({type:t,selectors:[["app-restore-flow"]],hostVars:2,hostBindings:function(e,a){e&2&&D("full-width",a.isProgressPage())},features:[A([m,w])],decls:4,vars:1,consts:()=>{let o;o=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_RADIO: Destination `;let e;e=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_RADIO: Encryption `;let a;a=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SPK_RADIO: Select files `;let R;R=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SPK_RADIO: Options `;let d;d=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_RADIO: Select files `;let f;return f=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_RADIO: Options `,[o,e,a,R,d,f,["step","","routerLinkActive","active",3,"routerLink"]]},template:function(e,a){e&1&&(s(0,"app-status-bar"),T(1,H,3,1,"spk-stepper"),i(2,"section"),s(3,"router-outlet"),n()),e&2&&(r(),g(a.isProgressPage()?-1:1))},dependencies:[v,W,y,N,h,G],styles:["[_nghost-%COMP%]{display:block}.full-width[_nghost-%COMP%] section[_ngcontent-%COMP%]{max-width:62.5rem}spk-stepper[_ngcontent-%COMP%]{max-width:31.25rem;margin:2.5rem auto}section[_ngcontent-%COMP%]{max-width:31.25rem;margin:0 auto 2.5rem}"],changeDetection:0})};export{k as default};
@@ -1 +1 @@
1
- import{a as J}from"./chunk-Q6W2U6VI.js";import"./chunk-32366MQR.js";import{g as q}from"./chunk-JI7GCFQB.js";import"./chunk-N57J64DN.js";import"./chunk-2G6TVFPZ.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-LDIZ5E5Z.js";import{b as Z}from"./chunk-JPMOGXHN.js";import"./chunk-QRRKPBY6.js";import{a as K}from"./chunk-WZRDKVOR.js";import"./chunk-ULLALJQ2.js";import{a as H}from"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import{a as V}from"./chunk-WXARH2SG.js";import"./chunk-NSIELNIY.js";import"./chunk-7QJG4IIT.js";import"./chunk-3ZVSHKLD.js";import{b as w}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{a as W,h as X,p as z,s as B}from"./chunk-Y5IRBMLB.js";import{h as j}from"./chunk-DNJOKPEL.js";import{qa as b}from"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import{Ab as S,Bb as T,Cb as u,Hc as x,Kb as y,Lb as v,Mb as r,Nb as D,Ob as I,Qa as _,Rb as g,Z as R,ab as L,ec as M,fa as C,ga as f,hc as F,na as A,sb as p,tb as O,wc as d,xb as P,xc as m,yb as i,zb as s}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";function Q(n,t){n&1&&(i(0,"div",17),C(),i(1,"svg",19),S(2,"circle",20),s(),f(),i(3,"spk-icon",21),r(4,3),s()())}function U(n,t){n&1&&(i(0,"div",18),C(),i(1,"svg",19),S(2,"circle",20),s(),f(),i(3,"spk-icon",22),r(4,4),s()())}function Y(n,t){if(n&1&&(i(0,"spk-card",10),T(1,16),r(2,2),u(),p(3,Q,5,0,"div",17)(4,U,5,0,"div",18),s()),n&2){let e=g();_(3),O(e.restoreResult()=="success"?3:4)}}function ee(n,t){if(n&1&&(M(0),d(1,"number"),d(2,"number")),n&2){let e,o=g(2);F(" ",m(1,2,(e=o.statusData())==null?null:e.ProcessedFileCount)," of ",m(2,4,(e=o.statusData())==null?null:e.TotalFileCount)," ")}}function te(n,t){n&1&&(T(0),r(1,8),u())}function ne(n,t){if(n&1&&(M(0),d(1,"bytes"),d(2,"bytes")),n&2){let e,o=g(2);F(" ",m(1,2,(e=o.statusData())==null?null:e.ProcessedFileSize)," of ",m(2,4,(e=o.statusData())==null?null:e.TotalFileSize)," ")}}function oe(n,t){n&1&&(T(0),r(1,9),u())}function ie(n,t){if(n&1&&(i(0,"spk-card",10)(1,"h3"),y(2,5),S(3,"spk-spinner",23),v(),s(),i(4,"div",24),S(5,"spk-progress-bar",25),i(6,"p")(7,"span"),r(8,6),s(),p(9,ee,3,6)(10,te,2,0,"ng-container"),s(),i(11,"p")(12,"span"),r(13,7),s(),p(14,ne,3,6)(15,oe,2,0,"ng-container"),s()()()),n&2){let e,o,l,E,c=g();_(3),D((e=c.statusData())==null?null:e.statusText),I(2),_(2),P("value",(o=c.statusData())==null?null:o.OverallProgress),_(4),O((l=c.statusData())!=null&&l.ProcessedFileCount?9:10),_(5),O((E=c.statusData())!=null&&E.ProcessedFileSize?14:15)}}var N=class n{#i=R(j);#s=R(H);#t=R(K);#n=R(q);#r=R(w);statusData=this.#t.statusData;backupId=this.#n.backupId;restoreResult=A("");#e=null;lastRestoreStarted=x(()=>{if(this.#e)return this.#e;let t=this.#t.statusData()?.backup?.Backup?.Metadata?.LastRestoreStarted??null;if(!t)return null;let e=this.fixDate(t);return this.#e=e,e});notificationFilterPredicate=()=>{let t=this.lastRestoreStarted();return{predicate:e=>(e.BackupID===this.#n.backupId()&&t&&t.getTime()<=new Date(e.Timestamp).getTime())??!1}};ngOnInit(){let t=this.#r.snapshot.params.taskid?.toString()??"";this.#i.getApiV1TaskByTaskid({taskid:t}).subscribe({next:e=>{if(e.TaskStarted&&(this.#e=new Date(e.TaskStarted)),!e.TaskFinished&&e.ID){this.#a(e.ID);return}this.#o(e)},error:e=>{console.error("Error fetching task:",e),this.restoreResult.set("error"),alert("Failed to fetch task details. Please try again later.")}})}#a(t){this.#s.waitForTaskToComplete(t).subscribe(e=>{this.#o(e)})}#o(t){t.TaskFinished!=null&&this.restoreResult.set(t.Status==="Completed"&&t.ErrorMessage==null?"success":"error")}fixDate(t){return new Date(`${t.slice(0,4)}-${t.slice(4,6)}-${t.slice(6,8)}T${t.slice(9,11)}:${t.slice(11,13)}:${t.slice(13,15)}Z`)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=L({type:n,selectors:[["app-restore-progress"]],decls:12,vars:6,consts:()=>{let t;t=$localize`Notifications`;let e;e=$localize`Logs`;let o;o=$localize`Restore completed`;let l;l=$localize`check-bold`;let E;E=$localize`warning-octagon`;let c;c=$localize` Restore progress: ${"\uFFFD0\uFFFD"}:INTERPOLATION: ${"\uFFFD#3\uFFFD"}:START_TAG_SPK_SPINNER:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SPK_SPINNER:`;let G;G=$localize`Files processed:`;let k;k=$localize`Size processed:`;let $;$=$localize`N/A`;let h;return h=$localize`N/A`,[t,e,o,l,E,c,G,k,$,h,[1,"progress","type-a"],[1,"notifications","type-a"],[1,"notification-list"],[3,"notificationFilterPredicate"],[1,"logs","type-a"],[3,"asSimpleList","polling","whenFilter","backupIdFilter"],["title",""],[1,"complete-success"],[1,"complete-failure"],[1,"border-svg"],["cx","50","cy","50","r","45",1,"border-circle"],[1,"success"],[1,"error"],[1,"primary"],[1,"progress-content"],[3,"value"]]},template:function(e,o){if(e&1&&(i(0,"section"),p(1,Y,5,1,"spk-card",10)(2,ie,16,4,"spk-card",10),i(3,"spk-card",11)(4,"h3"),r(5,0),s(),i(6,"div",12),S(7,"app-notifications",13),s()(),i(8,"spk-card",14)(9,"h3"),r(10,1),s(),S(11,"app-logs-live",15),s()()),e&2){let l;_(),O(o.restoreResult()!=""?1:2),_(6),P("notificationFilterPredicate",o.notificationFilterPredicate()),_(4),P("asSimpleList",!0)("polling",o.restoreResult()=="")("whenFilter",(l=o.lastRestoreStarted())==null?null:l.getTime())("backupIdFilter",o.backupId())}},dependencies:[J,z,B,W,X,Z,V,b],styles:['[_nghost-%COMP%]{display:block;padding:0 1.25rem;margin-top:32px}section[_ngcontent-%COMP%]{display:grid;gap:1.25rem;grid-template-columns:2fr 1fr;grid-template-areas:"progress notifications" "logs logs"}section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-bottom:1rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]{grid-area:progress}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]:has(.complete-check){display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1.25rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] spk-spinner[_ngcontent-%COMP%]{--spinner-size: 1.25rem;--spinner-thickness: .1875rem}section[_ngcontent-%COMP%] .notifications[_ngcontent-%COMP%]{grid-area:notifications}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%]{grid-area:logs}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%] app-logs-live[_ngcontent-%COMP%]{max-height:50rem;overflow:auto}.notification-list[_ngcontent-%COMP%]{max-height:15rem;overflow:auto}.complete-success[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--success-8)}.complete-success[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-success[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--success-8)}.complete-failure[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--error-8)}.complete-failure[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-failure[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--error-8)}.border-svg[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}.border-circle[_ngcontent-%COMP%]{fill:none;stroke-width:.3125rem;stroke-dasharray:282.74;stroke-dashoffset:282.74;animation:_ngcontent-%COMP%_draw-border 1.2s linear forwards}@keyframes _ngcontent-%COMP%_draw-border{to{stroke-dashoffset:0}}@keyframes _ngcontent-%COMP%_reveal-icon{to{opacity:1}}.progress-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.progress-content[_ngcontent-%COMP%] spk-progress-bar[_ngcontent-%COMP%]{margin-bottom:.75rem}.progress-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-right:.25rem}'],changeDetection:0})};export{N as default};
1
+ import{a as J}from"./chunk-Q6W2U6VI.js";import"./chunk-32366MQR.js";import{g as q}from"./chunk-JA3Y722G.js";import"./chunk-N57J64DN.js";import"./chunk-2G6TVFPZ.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-LDIZ5E5Z.js";import{b as Z}from"./chunk-JPMOGXHN.js";import"./chunk-QRRKPBY6.js";import{a as K}from"./chunk-WZRDKVOR.js";import"./chunk-ULLALJQ2.js";import{a as H}from"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import{a as V}from"./chunk-WXARH2SG.js";import"./chunk-NSIELNIY.js";import"./chunk-7QJG4IIT.js";import"./chunk-3ZVSHKLD.js";import{b as w}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{a as W,h as X,p as z,s as B}from"./chunk-Y5IRBMLB.js";import{h as j}from"./chunk-DNJOKPEL.js";import{qa as b}from"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import{Ab as S,Bb as T,Cb as u,Hc as x,Kb as y,Lb as v,Mb as r,Nb as D,Ob as I,Qa as _,Rb as g,Z as R,ab as L,ec as M,fa as C,ga as f,hc as F,na as A,sb as p,tb as O,wc as d,xb as P,xc as m,yb as i,zb as s}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";function Q(n,t){n&1&&(i(0,"div",17),C(),i(1,"svg",19),S(2,"circle",20),s(),f(),i(3,"spk-icon",21),r(4,3),s()())}function U(n,t){n&1&&(i(0,"div",18),C(),i(1,"svg",19),S(2,"circle",20),s(),f(),i(3,"spk-icon",22),r(4,4),s()())}function Y(n,t){if(n&1&&(i(0,"spk-card",10),T(1,16),r(2,2),u(),p(3,Q,5,0,"div",17)(4,U,5,0,"div",18),s()),n&2){let e=g();_(3),O(e.restoreResult()=="success"?3:4)}}function ee(n,t){if(n&1&&(M(0),d(1,"number"),d(2,"number")),n&2){let e,o=g(2);F(" ",m(1,2,(e=o.statusData())==null?null:e.ProcessedFileCount)," of ",m(2,4,(e=o.statusData())==null?null:e.TotalFileCount)," ")}}function te(n,t){n&1&&(T(0),r(1,8),u())}function ne(n,t){if(n&1&&(M(0),d(1,"bytes"),d(2,"bytes")),n&2){let e,o=g(2);F(" ",m(1,2,(e=o.statusData())==null?null:e.ProcessedFileSize)," of ",m(2,4,(e=o.statusData())==null?null:e.TotalFileSize)," ")}}function oe(n,t){n&1&&(T(0),r(1,9),u())}function ie(n,t){if(n&1&&(i(0,"spk-card",10)(1,"h3"),y(2,5),S(3,"spk-spinner",23),v(),s(),i(4,"div",24),S(5,"spk-progress-bar",25),i(6,"p")(7,"span"),r(8,6),s(),p(9,ee,3,6)(10,te,2,0,"ng-container"),s(),i(11,"p")(12,"span"),r(13,7),s(),p(14,ne,3,6)(15,oe,2,0,"ng-container"),s()()()),n&2){let e,o,l,E,c=g();_(3),D((e=c.statusData())==null?null:e.statusText),I(2),_(2),P("value",(o=c.statusData())==null?null:o.OverallProgress),_(4),O((l=c.statusData())!=null&&l.ProcessedFileCount?9:10),_(5),O((E=c.statusData())!=null&&E.ProcessedFileSize?14:15)}}var N=class n{#i=R(j);#s=R(H);#t=R(K);#n=R(q);#r=R(w);statusData=this.#t.statusData;backupId=this.#n.backupId;restoreResult=A("");#e=null;lastRestoreStarted=x(()=>{if(this.#e)return this.#e;let t=this.#t.statusData()?.backup?.Backup?.Metadata?.LastRestoreStarted??null;if(!t)return null;let e=this.fixDate(t);return this.#e=e,e});notificationFilterPredicate=()=>{let t=this.lastRestoreStarted();return{predicate:e=>(e.BackupID===this.#n.backupId()&&t&&t.getTime()<=new Date(e.Timestamp).getTime())??!1}};ngOnInit(){let t=this.#r.snapshot.params.taskid?.toString()??"";this.#i.getApiV1TaskByTaskid({taskid:t}).subscribe({next:e=>{if(e.TaskStarted&&(this.#e=new Date(e.TaskStarted)),!e.TaskFinished&&e.ID){this.#a(e.ID);return}this.#o(e)},error:e=>{console.error("Error fetching task:",e),this.restoreResult.set("error"),alert("Failed to fetch task details. Please try again later.")}})}#a(t){this.#s.waitForTaskToComplete(t).subscribe(e=>{this.#o(e)})}#o(t){t.TaskFinished!=null&&this.restoreResult.set(t.Status==="Completed"&&t.ErrorMessage==null?"success":"error")}fixDate(t){return new Date(`${t.slice(0,4)}-${t.slice(4,6)}-${t.slice(6,8)}T${t.slice(9,11)}:${t.slice(11,13)}:${t.slice(13,15)}Z`)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=L({type:n,selectors:[["app-restore-progress"]],decls:12,vars:6,consts:()=>{let t;t=$localize`Notifications`;let e;e=$localize`Logs`;let o;o=$localize`Restore completed`;let l;l=$localize`check-bold`;let E;E=$localize`warning-octagon`;let c;c=$localize` Restore progress: ${"\uFFFD0\uFFFD"}:INTERPOLATION: ${"\uFFFD#3\uFFFD"}:START_TAG_SPK_SPINNER:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SPK_SPINNER:`;let G;G=$localize`Files processed:`;let k;k=$localize`Size processed:`;let $;$=$localize`N/A`;let h;return h=$localize`N/A`,[t,e,o,l,E,c,G,k,$,h,[1,"progress","type-a"],[1,"notifications","type-a"],[1,"notification-list"],[3,"notificationFilterPredicate"],[1,"logs","type-a"],[3,"asSimpleList","polling","whenFilter","backupIdFilter"],["title",""],[1,"complete-success"],[1,"complete-failure"],[1,"border-svg"],["cx","50","cy","50","r","45",1,"border-circle"],[1,"success"],[1,"error"],[1,"primary"],[1,"progress-content"],[3,"value"]]},template:function(e,o){if(e&1&&(i(0,"section"),p(1,Y,5,1,"spk-card",10)(2,ie,16,4,"spk-card",10),i(3,"spk-card",11)(4,"h3"),r(5,0),s(),i(6,"div",12),S(7,"app-notifications",13),s()(),i(8,"spk-card",14)(9,"h3"),r(10,1),s(),S(11,"app-logs-live",15),s()()),e&2){let l;_(),O(o.restoreResult()!=""?1:2),_(6),P("notificationFilterPredicate",o.notificationFilterPredicate()),_(4),P("asSimpleList",!0)("polling",o.restoreResult()=="")("whenFilter",(l=o.lastRestoreStarted())==null?null:l.getTime())("backupIdFilter",o.backupId())}},dependencies:[J,z,B,W,X,Z,V,b],styles:['[_nghost-%COMP%]{display:block;padding:0 1.25rem;margin-top:32px}section[_ngcontent-%COMP%]{display:grid;gap:1.25rem;grid-template-columns:2fr 1fr;grid-template-areas:"progress notifications" "logs logs"}section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-bottom:1rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]{grid-area:progress}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]:has(.complete-check){display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1.25rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] spk-spinner[_ngcontent-%COMP%]{--spinner-size: 1.25rem;--spinner-thickness: .1875rem}section[_ngcontent-%COMP%] .notifications[_ngcontent-%COMP%]{grid-area:notifications}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%]{grid-area:logs}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%] app-logs-live[_ngcontent-%COMP%]{max-height:50rem;overflow:auto}.notification-list[_ngcontent-%COMP%]{max-height:15rem;overflow:auto}.complete-success[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--success-8)}.complete-success[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-success[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--success-8)}.complete-failure[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--error-8)}.complete-failure[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-failure[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--error-8)}.border-svg[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}.border-circle[_ngcontent-%COMP%]{fill:none;stroke-width:.3125rem;stroke-dasharray:282.74;stroke-dashoffset:282.74;animation:_ngcontent-%COMP%_draw-border 1.2s linear forwards}@keyframes _ngcontent-%COMP%_draw-border{to{stroke-dashoffset:0}}@keyframes _ngcontent-%COMP%_reveal-icon{to{opacity:1}}.progress-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.progress-content[_ngcontent-%COMP%] spk-progress-bar[_ngcontent-%COMP%]{margin-bottom:.75rem}.progress-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-right:.25rem}'],changeDetection:0})};export{N as default};
@@ -0,0 +1 @@
1
+ import{a as Ue}from"./chunk-N57J64DN.js";import{a as se}from"./chunk-WZNH4JPF.js";import{a as ne}from"./chunk-BCHZRC5K.js";import{b as pe}from"./chunk-LDIZ5E5Z.js";import{a as Ve}from"./chunk-J6BHRR34.js";import{a as H}from"./chunk-2BX65XJQ.js";import{a as oe}from"./chunk-6JQM2X3B.js";import{a as xe}from"./chunk-WXARH2SG.js";import{b as We,c as G,e as B,f as x,i as ze,j as V,l as Xe,o as W,q as z,r as X,s as Ye,t as Y}from"./chunk-NSIELNIY.js";import{b as N,d as h}from"./chunk-2W6BEUGU.js";import{A as Be,a as A,e as De,g as v,l as Ae,p as ve,q as we,t as Ge}from"./chunk-Y5IRBMLB.js";import{h as w}from"./chunk-DNJOKPEL.js";import{la as ie}from"./chunk-CWLTHXVS.js";import{Ab as c,B as Oe,Bb as L,Cb as $,Eb as j,F as K,H as O,Hc as le,Ic as D,Kb as F,L as fe,Lb as m,Mb as g,Nb as he,Ob as Pe,P as Ce,Q,Qa as d,Qb as f,Rb as b,U as Re,Z as p,ab as M,bc as Ie,da as C,ea as R,ec as q,fb as Ne,gc as Me,hc as ye,i as ge,jc as Z,kc as ee,lc as te,na as _,o as Te,rc as ke,sb as y,sc as Le,tb as k,wc as ae,x as re,xb as S,xc as $e,y as Ee,yb as r,yc as be,zb as l}from"./chunk-BTMXQPBB.js";var Ke=new X,He=()=>Ke.group({passphrase:Ke.control("")}),_e=class a{#t=p(w);#e=p(P);#o=p(h);#n=p(N);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=_(!1);settings=_([]);next(){let i=this.#e.destinationTargetUrl();if(!i)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,t=[];e?t.push({Name:"--passphrase",Value:e}):t.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(o=>{let n=o.Name?.trim();n&&n!=="--"&&(n.startsWith("--")||(n=`--${n}`),t.push({Name:n,Value:o.Value??""}))}),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:i,Settings:t}},temporary:!0}).pipe(O(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:o=>{let n=o.ID;this.#o.navigate([`/restore-draft/${n}`])},error:o=>{console.error(o)}})}back(){this.#e.isFileRestore()?this.#o.navigate(["destination"],{relativeTo:this.#n.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-restore-encryption"]],decls:16,vars:3,consts:()=>{let i;i=$localize`Enter backup passphrase if defined.`;let e;e=$localize`Password`;let t;t=$localize`Advanced options`;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Back `;let n;return n=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `,[e,t,o,n,[3,"submit","formGroup"],["for","password"],["type","password","id","password","placeholder",i,"formControlName","passphrase"],["title",""],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"]]},template:function(e,t){e&1&&(r(0,"form",4),f("submit",function(){return t.next()}),r(1,"spk-form-field")(2,"label",5),g(3,0),l(),c(4,"input",6),l(),r(5,"app-toggle-card"),L(6,7),g(7,1),$(),r(8,"app-options-list",8),te("optionsChange",function(n){return ee(t.settings,n)||(t.settings=n),n}),l()(),r(9,"div",9)(10,"button",10),f("click",function(){return t.back()}),F(11,2),c(12,"spk-icon"),m(),l(),r(13,"button",11),F(14,3),c(15,"spk-icon"),m(),l()()()),e&2&&(S("formGroup",t.encryptionForm),d(8),Z("options",t.settings),S("hasFreeTextSettings",!0))},dependencies:[Y,V,G,B,x,W,z,Ae,A,v,ne,Ue],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var Ze=()=>({standalone:!0});function et(a,i){a&1&&c(0,"spk-progress-bar",8)}function tt(a,i){if(a&1&&(q(0),ae(1,"bytes")),a&2){let e=b().$implicit;Me(" (",$e(1,1,e.FileSizes),") ")}}function it(a,i){a&1&&(r(0,"span",16),g(1,4),l())}function ot(a,i){if(a&1&&(r(0,"div",15),q(1),ae(2,"date"),y(3,tt,2,3),y(4,it,2,0,"span",16),l()),a&2){let e=i.$implicit;d(),ye(" ",e.Version,": ",be(2,4,e.Time,"medium")," "),d(2),k(e.FileSizes?3:-1),d(),k(e.IsFullBackup===!1?4:-1)}}function nt(a,i){a&1&&c(0,"spk-progress-bar",8)}function st(a,i){if(a&1&&(r(0,"app-file-tree",14)(1,"label",17),g(2,5),l(),c(3,"input",18),l()),a&2){let e=b(2);S("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function rt(a,i){if(a&1){let e=j();r(0,"spk-select",12),f("cleared",function(){C(e);let o=b();return R(o.abortLoading())}),r(1,"input",13),te("ngModelChange",function(o){C(e);let n=b();return ee(n.selectOption,o)||(n.selectOption=o),R(o)}),l(),Ne(2,ot,5,7,"ng-template"),l(),y(3,nt,1,0,"spk-progress-bar",8),y(4,st,4,5,"app-file-tree",14)}if(a&2){let e=b();S("options",e.versionOptions())("isClearable",!1),d(),Z("ngModel",e.selectOption),S("ngModelOptions",Le(6,Ze)),d(2),k(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),d(),k(e.showFileTree()?4:-1)}}var ue=new X,Je=()=>ue.group({filesToRestore:ue.control(""),passphrase:ue.control(null)}),de=class a{#t=p(w);#e=p(P);#o=p(Ve);#n=p(oe);#i=p(h);#s=p(N);#l=p(ie);#a=null;#p=null;#r=_([]);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;selectOption=this.#e.selectOption;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;isFileRestore=this.#e.isFileRestore;needsDatabaseRepair=le(()=>this.#e.backup()?.Backup?.IsTemporary??!0);showFileTree=_(!1);backupSettings=_(null);rootPaths=_([]);initialNodes=_([]);loadingRootPath=_(!1);isRepairing=le(()=>this.#r().length>0);loadedVersions=_({});loadingEffect=D(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let t=e[0].Version;this.selectOption.set(t.toString())}});backupSettingsEffect=D(()=>{let i=this.backupId(),e=this.selectOption(),t=this.isRepairing(),o=this.loadedVersions();if(!e||!i)return;let s=this.versionOptions()?.find(J=>J.Version===parseInt(e))?.Time??null;if(!s)return;let u=`${i}+${s}`,E=o[u];if(this.needsDatabaseRepair()&&(!E||t))return;let I={id:i+"",time:s};this.backupSettings.set(I),this.getRootPath(I)});repairEffect=D(()=>{if(!this.needsDatabaseRepair())return;let i=this.selectOption(),e=this.versionOptions();if(i){let t=e.find(s=>s.Version===parseInt(i));if(t===void 0)return;let o=this.backupId(),n=`${o}+${t.Time}`;if(this.#p===n||(this.#p=n,this.#r().includes(n)))return;this.#r.update(s=>[...s,n]),this.#t.postApiV1BackupByIdRepairupdate({id:o,requestBody:{only_paths:!0,time:t.Time}}).pipe(Q(this.abortLoading$),O(()=>{this.#p=null})).subscribe(s=>{let u=s.ID;this.#o.waitForTaskToComplete(u).pipe(K(1)).subscribe(()=>{this.#r.update(E=>E.filter(I=>I!==n)),this.loadedVersions.update(E=>(E[n]=!0,E))})})}});getRootPath(i){let e={id:i.id+"",time:i.time,prefixOnly:!0,folderContents:!1},t=i.id+"";this.isRepairing()||this.#a===t||(this.#a=t,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#n.hasV2ListOperations()?this.#t.postApiV2BackupListFolder({requestBody:{BackupId:i.id,Time:i.time,Paths:null,PageSize:0,Page:0}}).pipe(Q(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#a=null})).subscribe({next:o=>{let n=(o.Data??[]).map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#t.getApiV1BackupByIdFiles(e).pipe(Q(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:o=>{let n=o.Files.map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new ge;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let i=this.versionOptions();return e=>{if(!e)return"";let t=i?.find(o=>typeof o.Version=="number"&&o.Version.toString()===e);return t?`${t.Version}: ${this.#l.transform(t.Time,"medium")}`:""}}next(){this.#i.navigate(["options"],{relativeTo:this.#s.parent})}back(){this.#e.isFileRestore()?this.#i.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-select-files"]],features:[ke([ie])],decls:13,vars:3,consts:()=>{let i;i=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let t;t=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let o;o=$localize`Select an option...`;let n;n=$localize`(partial)`;let s;return s=$localize`Path`,[["formRef",""],i,e,t,n,s,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",o,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","initialNodes","backupSettings","multiSelect","showFiles"],[1,"custom-option"],[1,"partial"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,t){if(e&1){let o=j();r(0,"form",6,0),f("submit",function(){return C(o),R(t.next())}),r(2,"h3",7),g(3,1),l(),y(4,et,1,0,"spk-progress-bar",8)(5,rt,5,7),r(6,"div",9)(7,"button",10),f("click",function(){return C(o),R(t.back())}),F(8,2),c(9,"spk-icon"),m(),l(),r(10,"button",11),F(11,3),c(12,"spk-icon"),m(),l()()()}e&2&&(S("formGroup",t.selectFilesForm),d(4),k(t.versionOptionsLoading()?4:5),d(5),he(t.isFileRestore()?"Back":"Exit"),Pe(8))},dependencies:[Ye,V,G,B,x,ze,Y,W,z,ie,xe,se,v,A,Ge,ve],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}"],changeDetection:0})};var P=class a{#t=p(h);#e=p(N);#o=p(oe);#n=p(De);#i=p(w);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);selectFilesForm=Je();optionsForm=Qe();encryptionForm=He();optionsFormSignal=pe(this.optionsForm.valueChanges);selectFilesFormSignal=pe(this.selectFilesForm.valueChanges);selectOption=_(null);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isFileRestore=_(!1);isFullWidthPage=_(!1);#s=_("");#l=_(null);#a=null;testSignal=this.#s.asReadonly();testErrorMessage=this.#l.asReadonly();#p=D(()=>{let i=this.destinationTargetUrl(),e=this.#s(),t=this.#a;this.#a=i,!(e==="testing"||t===null||t===i)&&(this.#s.set(""),this.#l.set(null))});init(i,e=!1){this.backupId.set(i),this.isFileRestore.set(e),e&&this.#t.navigate(["/restore-from-files/destination"]),e||this.getBackup(!0)}setTestState(i,e){this.#s.set(i),this.#l.set(e??null)}updateTargetUrl(i){this.destinationTargetUrl.set(i)}submit(){this.isSubmitting.set(!0);let i=this.backupId();this.backup()?.Backup?.IsTemporary??!1?this.#i.postApiV1BackupByIdCopytotemp({id:this.backupId()??""}).subscribe({next:t=>{this.#r(t.ID??"")},error:t=>this.showErrorDialog($localize`An error occurred while copying the backup to a temporary location: ${t.message}`)}):this.#r(i??"")}showErrorDialog(i){this.#n.open(H,{data:{title:$localize`Error occured`,message:i,confirmText:$localize`OK`,cancelText:void 0},closed:e=>{}})}#r(i){let e=this.optionsForm.value,t=this.selectFilesForm.value,o=this.selectOption(),n=this.versionOptions()?.find(s=>s.Version===(o&&parseInt(o)));this.#i.postApiV1BackupByIdRestore({id:i??"",requestBody:{paths:t.filesToRestore?.split("\0").map(s=>s.endsWith("/")||s.endsWith("\\")?`${s}*`:s)??[],passphrase:t.passphrase??null,time:n?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata}}).pipe(O(()=>this.isSubmitting.set(!1))).subscribe({next:s=>{this.#t.navigate([`./${s.ID}`,"progress"],{relativeTo:this.#e})},error:s=>{console.error("restore error",s)}})}exit(){this.#n.open(H,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:i=>{i&&(this.#_(),this.#t.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(i,e=2){return this.#i.postApiV2BackupListFilesets({requestBody:{BackupId:i}}).pipe(Oe(t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder";return o||n||s||e===0?Te(()=>t):Ee(1e3).pipe(Ce(()=>this.loadFilesetsWithRetryv2(i,e-1)))}))}getBackup(i=!1){let e=this.backupId();this.versionOptionsLoading.set(!0),this.#o.hasV2ListOperations()?re([this.#i.getApiV1BackupById({id:e}),this.loadFilesetsWithRetryv2(e)]).pipe(K(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{if(o.Error)throw new Error(o.Error);if(!(t.Backup?.IsTemporary??!0)&&t?.Backup?.DBPathExists===!1){this.#n.open(H,{data:{title:$localize`Missing Local Database`,message:$localize`The local database for this backup is missing. Please repair or recreate the local database before restoring.`,confirmText:$localize`OK`,cancelText:void 0},closed:s=>{this.#t.navigate(["/backup",e,"database"])}});return}this.versionOptions.set((o.Data??[]).map(s=>({Version:s.Version??-1,IsFullBackup:s.IsFullBackup??void 0,Time:s.Time??"<missing>",FileCount:s.FileCount??void 0,FileSizes:s.FileSizes??void 0}))),this.backup.set(t)},error:t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder",u=$localize`An error occurred while loading the backup filesets: ${t.message}`;o&&(u=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),n&&(u=$localize`The backup storage folder was not found.`),s&&(u=$localize`The backup storage folder does not contain any filesets.`),this.#n.open(H,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:E=>{this.#t.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):re([this.#i.getApiV1BackupById({id:e}),this.#i.getApiV1BackupByIdFilesets({id:e}).pipe(fe(3))]).pipe(K(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{this.versionOptions.set(o.map(n=>({Version:n.Version??-1,IsFullBackup:(n.IsFullBackup??1)==1,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(t)}})}#_(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||a)};static \u0275prov=Re({token:a,factory:a.\u0275fac,providedIn:"root"})};var U=new X,Qe=()=>U.group({restoreFrom:U.control("orignal"),restoreFromPath:U.control(""),handleExisting:U.control("overwrite"),permissions:U.control(!1),includeMetadata:U.control(!0)}),Fe=class a{#t=p(P);#e=p(h);#o=p(N);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;isSubmitting=this.#t.isSubmitting;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#o.parent})}submit(){this.#t.submit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-advanced-options-settings"]],decls:42,vars:7,consts:()=>{let i;i=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let t;t=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let o;o=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let n;n=$localize`How do you want to handle existing files?`;let s;s=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let E;E=$localize`Metadata settings`;let I;I=$localize` Restore file metadata ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let J;J=$localize` Restore read/write permissions ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let me;me=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let Se;return Se=$localize`${"\uFFFD#41\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#41\uFFFD"}:CLOSE_TAG_SPK_ICON: Submit `,[["formRef",""],i,e,t,o,n,s,u,E,I,J,me,Se,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"raised","primary"],["type","radio","name","restoreFrom","value","orignal","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled","enableCreateFolder"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","includeMetadata"],["type","checkbox","formControlName","permissions"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"]]},template:function(e,t){if(e&1){let o=j();r(0,"form",13,0),f("submit",function(){return C(o),R(t.submit())}),r(2,"h3",14),g(3,1),l(),r(4,"app-toggle-card",15),L(5,16),g(6,2),$(),r(7,"spk-radio",17),F(8,3),c(9,"input",18),m(),l(),r(10,"spk-radio",17),F(11,4),c(12,"input",19),m(),l(),r(13,"app-file-tree",20)(14,"label",21),q(15,"Path"),l(),c(16,"input",22),l()(),r(17,"app-toggle-card",15),L(18,16),g(19,5),$(),r(20,"spk-radio",17),F(21,6),c(22,"input",23),m(),l(),r(23,"spk-radio",17),F(24,7),c(25,"input",24),m(),l()(),r(26,"app-toggle-card"),L(27,16),g(28,8),$(),r(29,"spk-toggle",25),F(30,9),c(31,"input",26),m(),l(),r(32,"spk-toggle",25),F(33,10),c(34,"input",27),m(),l()(),r(35,"div",28)(36,"button",29),f("click",function(){return C(o),R(t.goBack())}),F(37,11),c(38,"spk-icon"),m(),l(),r(39,"button",30),F(40,12),c(41,"spk-icon"),m(),l()()()}if(e&2){let o;S("formGroup",t.optionsForm),d(4),S("disallowToggle",!0),d(9),S("disabled",((o=t.optionsFormSignal())==null?null:o.restoreFrom)!=="pickLocation")("enableCreateFolder",!0),d(4),S("disallowToggle",!0),d(22),Ie("loader",t.isSubmitting())}},dependencies:[Y,V,G,We,Xe,B,x,W,z,ne,se,Be,we,v,A],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{Qe as a,Fe as b,He as c,_e as d,Je as e,de as f,P as g};
@@ -1 +1 @@
1
- import{a,b}from"./chunk-JI7GCFQB.js";import"./chunk-N57J64DN.js";import"./chunk-2G6TVFPZ.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-LDIZ5E5Z.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import"./chunk-NSIELNIY.js";import"./chunk-3ZVSHKLD.js";import"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";export{a as createRestoreOptionsForm,b as default};
1
+ import{a,b}from"./chunk-JA3Y722G.js";import"./chunk-N57J64DN.js";import"./chunk-2G6TVFPZ.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-LDIZ5E5Z.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import"./chunk-NSIELNIY.js";import"./chunk-3ZVSHKLD.js";import"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";export{a as createRestoreOptionsForm,b as default};
@@ -0,0 +1 @@
1
+ import"./chunk-EUDKD2JW.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-EBXKOOS2.js")},{path:"encryption",loadComponent:()=>import("./chunk-F3LCHCDX.js")},{path:"select-files",loadComponent:()=>import("./chunk-EJZXEK6Z.js")},{path:"options",loadComponent:()=>import("./chunk-UKPX2XRO.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-IVBTBJGC.js")}],t=o;export{t as default};
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-V5YSQG4X.js"><link rel="modulepreload" href="chunk-QRRKPBY6.js"><link rel="modulepreload" href="chunk-WZRDKVOR.js"><link rel="modulepreload" href="chunk-ULLALJQ2.js"><link rel="modulepreload" href="chunk-J6BHRR34.js"><link rel="modulepreload" href="chunk-2BX65XJQ.js"><link rel="modulepreload" href="chunk-RHW5QVAY.js"><link rel="modulepreload" href="chunk-6JQM2X3B.js"><link rel="modulepreload" href="chunk-WXARH2SG.js"><link rel="modulepreload" href="chunk-7QJG4IIT.js"><script src="polyfills-COBLRUJG.js" type="module"></script><script src="main-3QA34PNU.js" type="module"></script></body>
66
+ <link rel="modulepreload" href="chunk-V5YSQG4X.js"><link rel="modulepreload" href="chunk-QRRKPBY6.js"><link rel="modulepreload" href="chunk-WZRDKVOR.js"><link rel="modulepreload" href="chunk-ULLALJQ2.js"><link rel="modulepreload" href="chunk-J6BHRR34.js"><link rel="modulepreload" href="chunk-2BX65XJQ.js"><link rel="modulepreload" href="chunk-RHW5QVAY.js"><link rel="modulepreload" href="chunk-6JQM2X3B.js"><link rel="modulepreload" href="chunk-WXARH2SG.js"><link rel="modulepreload" href="chunk-7QJG4IIT.js"><script src="polyfills-COBLRUJG.js" type="module"></script><script src="main-A5QFJ7CT.js" type="module"></script></body>
67
67
  </html>
@@ -1 +1 @@
1
- import{b as be,c as Ce}from"./chunk-V5YSQG4X.js";import{a as he}from"./chunk-QRRKPBY6.js";import{a as I}from"./chunk-WZRDKVOR.js";import"./chunk-ULLALJQ2.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import{a as P}from"./chunk-RHW5QVAY.js";import{a as L}from"./chunk-6JQM2X3B.js";import{a as de}from"./chunk-WXARH2SG.js";import"./chunk-7QJG4IIT.js";import{a as b,b as C,c as ue,d as E}from"./chunk-3ZVSHKLD.js";import{c as ie,d as ae,g as pe,h as ce}from"./chunk-2W6BEUGU.js";import{a as ee}from"./chunk-JFOXV66M.js";import{c as le}from"./chunk-Y5IRBMLB.js";import{a as te,b as oe,d as ne,e as re,f as se,i as me}from"./chunk-DNJOKPEL.js";import{a as ge}from"./chunk-UZK7ABRM.js";import{la as Y,qa as Z}from"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import{a as ye}from"./chunk-AM7RYTIO.js";import{b as fe}from"./chunk-B6OIHB5W.js";import{A as x,Ab as z,B as G,Cc as q,Dc as X,H as w,Ic as Q,N as J,P as R,R as B,U as k,X as $,Z as s,ab as _,f as j,ha as K,i as D,n as F,na as d,o as U,r as S}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";var M=class e{#o=s(b);#s=s(C);ngOnInit(){this.#s.fetchConfig(),this.#o.clearAllNotCurrentVersion()}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=_({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&z(0,"router-outlet")},dependencies:[ie],encapsulation:2})};var Se={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var h=new $("ENVIRONMENT");var A=class e{#o=s(me);isLoaded=d(!1);webmodules=d(null);preload(t=!1){let o=this.#o.getApiV1Webmodules().pipe(B(n=>this.webmodules.set(n)),w(()=>this.isLoaded.set(!0)));if(t)return o;o.subscribe()}static \u0275fac=function(o){return new(o||e)};static \u0275prov=k({token:e,factory:e.\u0275fac,providedIn:"root"})};var Me=()=>{let e=s(E);return e.token()?!0:e.checkProxyAuthed().pipe(R(t=>t?F(!0):e.refreshToken().pipe(S(()=>!0))))},Ae=()=>{let e=s(C),t=s(I),o=s(K),n=e.relayIsEnabled()?"longpoll":"websocket",i=[o.get(L).preload(!0),o.get(L).preloadFilterGroups(!0),o.get(A).preload(!0)];return e.configLoaded===null?x(i).pipe(S(()=>n)):e.configLoaded?.pipe(R(()=>x(i)))},Re=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-V77N2OUE.js")},{path:"logout",loadComponent:()=>import("./chunk-ZI2XNFAW.js")},{path:"",canActivate:[Me],children:[{path:"",canActivate:[Ae],loadComponent:()=>import("./chunk-E4GCCYDQ.js"),children:[{path:"",loadComponent:()=>import("./chunk-WPGKMLVU.js")},{path:"add-backup",loadComponent:()=>import("./chunk-NHAGSIVX.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-IZXB2EWT.js")},{path:"backup/import",loadComponent:()=>import("./chunk-64ZU74CD.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-C26ZMSTR.js"),loadChildren:()=>import("./chunk-EQAVG2TR.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-C26ZMSTR.js"),loadChildren:()=>import("./chunk-EQAVG2TR.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-KSQIUDEA.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-H2PTENA3.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-N7RSCHJF.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-6DSLFJ4T.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-NZ2KKCDC.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-2D26BDYB.js")},{path:"from-config",loadComponent:()=>import("./chunk-QBJGIKPM.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-UXWT75NG.js"),loadChildren:()=>import("./chunk-QUB4JNM7.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-UXWT75NG.js"),loadChildren:()=>import("./chunk-QUB4JNM7.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-UXWT75NG.js"),loadChildren:()=>import("./chunk-QUB4JNM7.js")},{path:"settings",loadComponent:()=>import("./chunk-RCKA5DTC.js")},{path:"about",loadComponent:()=>import("./chunk-CCA5ZCEA.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-MMPTX6PS.js")},{path:"changelog",loadComponent:()=>import("./chunk-DBD6FOQL.js")},{path:"libraries",loadComponent:()=>import("./chunk-XBJRRUMO.js")},{path:"system-info",loadComponent:()=>import("./chunk-QVEGV6V6.js")},{path:"server-settings",loadComponent:()=>import("./chunk-EKP3ML6M.js")},{path:"logs",loadChildren:()=>import("./chunk-IBG5YOFG.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-WRWIBPXL.js")}]}]}]}]}];var V=null,Te=(e,t)=>{let o=s(E),n=s(ae),i=s(b),l=s(h),r=i.getItem("locale"),u=s(le),a=be(r),p=e.url==="/api/v1/auth/login",m=e.url==="/api/v1/auth/refresh",v=e.url==="/api/v1/progressstate",g=e.url==="/api/v1/remoteoperation/test",y=e.url==="/api/v1/filesystem/validate",T=e.url.startsWith("/api/v2/"),N=o.token(),H=e,W=e.headers.has("custom-proxy-check")||N===ue;if(N&&e.url.startsWith(l.baseUrl)&&!W){let c=e.headers.set("Authorization",`Bearer ${N}`);r&&r!=="en-US"&&(c=c.set("X-Ui-Language",a)),H=e.clone({headers:c})}return t(H).pipe(S(c=>{if(c.type===4&&c.status===200&&T){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}),G(c=>{let f=c.error?.Error||`Error Code: ${c.status}, Message: ${c.message}`;return!W&&(v&&c.status===404||g||y||u.error(f),m&&c.status===401&&(o.logout(),n.navigate(["/logout"])),!p&&!m&&c.status===401)?(o.clearSessionToken(),V??=o.refreshToken().pipe(J()),V.pipe(R(()=>t(e.clone({headers:e.headers.set("Authorization",`Bearer ${o.token()}`)}))),w(()=>V=null))):U(()=>({error:c,message:f}))}))};var Oe="1.0.0",we=`portal-proxy-client-${P()}`,Ne=1,O=class e{#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=Q(()=>{let t=this.#i(),o=this.#l(),n=this.#a();if(!n||!t||!o||o<this.#o){this.#c&&window.clearInterval(this.#c);return}this.#c=window.setInterval(()=>{this.connectToMachineServer(n)},o)});utf8Atob(t){let o=Uint8Array.from(atob(t),i=>i.charCodeAt(0)),n=this.#m.decode(o);return n?JSON.parse(n):null}connectToMachineServer(t,o){let n=o?.reconnect??!1,i=this.wsState();(i==="disconnected"||i==="error"||n)&&(this.#e?.close(),this.#e=null),!this.#e&&(this.#e=new WebSocket(this.#s.machineServerUrl),this.#t.set("connecting"),this.#e.onopen=()=>{this.#t.set("connect"),this.#n.set(!0),this.#i.set(!1),this.#a.set(null)},this.#e.onclose=()=>{this.#t.set("disconnected"),this.#n.set(!1),this.#a.set(t),this.#i.set(!0)},this.#e.onerror=()=>{this.#t.set("error")},this.#e.onmessage=l=>{let 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:t,publicKey:"",clientVersion:Oe,protocolVersion:Ne},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(t=null){t&&console.error(t),this.#e?.close(),this.#e=null,this.#t.set("disconnected"),this.#n.set(!1)}createResponse(t,o,n){let i={from:we,to:t.from,type:o,messageId:t.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(t,o,n,i,l,r,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(t),new Promise((a,p)=>{let m=P(),g={from:we,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 T=this.#r[m];T&&(delete this.#r[m],T.reject("Timeout"))},u)};this.#r[m]=y,this.#n()?this.activateCommand(g):this.#p.push(g)})}activateCommand(t){this.#e?.send(JSON.stringify(t))}static \u0275fac=function(o){return new(o||e)};static \u0275prov=k({token:e,factory:e.\u0275fac,providedIn:"root"})};function xe(e){if(typeof e!="string")return null;let o=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...o))}function ke(e,t,o){let n=e.relayconfigState.config();if(n===null)return o(t);let i=xe(t.body),l={};t.headers.keys().forEach(p=>{l[p]=t.headers.get(p)??""});let r=t.headers.get("timeout"),u=r!==null?parseInt(r):e.defaultTimeout;t.url.startsWith("/api/v1/serverstate")&&t.url.includes("longpoll=true")&&(u=1e3*99);let a=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,t.method,t.url,i,l,u);return new j(p=>{a.then(m=>{let v=new te;l!=null&&Object.keys(l).forEach(y=>{v.set(y,l[y])});let g=new oe({body:m.body,status:m.code,statusText:"OK",headers:v});p.next(g),p.complete()})})}var Ee=(e,t)=>{let o={relayconfigState:s(C),defaultTimeout:s(h).defaultTimeout,relayWebsocket:s(O)},n=o.relayconfigState.config();if(o.relayconfigState.configLoaded!==null&&n===null){let i=new D;return o.relayconfigState.configLoaded.subscribe(l=>{l&&ke(o,e,t).subscribe(i)}),i}return ke(o,e,t)};var Ie={providers:[q(),pe(Re,ce()),ne(se(),re([Ee,Te])),b,{provide:h,useValue:Se},{provide:X,useValue:Ce()},he,I,fe,Z,de,Y,ge,ye]};ee(M,Ie);
1
+ import{b as be,c as Ce}from"./chunk-V5YSQG4X.js";import{a as he}from"./chunk-QRRKPBY6.js";import{a as I}from"./chunk-WZRDKVOR.js";import"./chunk-ULLALJQ2.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import{a as P}from"./chunk-RHW5QVAY.js";import{a as L}from"./chunk-6JQM2X3B.js";import{a as de}from"./chunk-WXARH2SG.js";import"./chunk-7QJG4IIT.js";import{a as b,b as C,c as ue,d as E}from"./chunk-3ZVSHKLD.js";import{c as ie,d as ae,g as pe,h as ce}from"./chunk-2W6BEUGU.js";import{a as ee}from"./chunk-JFOXV66M.js";import{c as le}from"./chunk-Y5IRBMLB.js";import{a as te,b as oe,d as ne,e as re,f as se,i as me}from"./chunk-DNJOKPEL.js";import{a as ge}from"./chunk-UZK7ABRM.js";import{la as Y,qa as Z}from"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import{a as ye}from"./chunk-AM7RYTIO.js";import{b as fe}from"./chunk-B6OIHB5W.js";import{A as x,Ab as z,B as G,Cc as q,Dc as X,H as w,Ic as Q,N as J,P as R,R as B,U as k,X as $,Z as s,ab as _,f as j,ha as K,i as D,n as F,na as d,o as U,r as S}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";var M=class e{#o=s(b);#s=s(C);ngOnInit(){this.#s.fetchConfig(),this.#o.clearAllNotCurrentVersion()}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=_({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&z(0,"router-outlet")},dependencies:[ie],encapsulation:2})};var Se={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var h=new $("ENVIRONMENT");var A=class e{#o=s(me);isLoaded=d(!1);webmodules=d(null);preload(t=!1){let o=this.#o.getApiV1Webmodules().pipe(B(n=>this.webmodules.set(n)),w(()=>this.isLoaded.set(!0)));if(t)return o;o.subscribe()}static \u0275fac=function(o){return new(o||e)};static \u0275prov=k({token:e,factory:e.\u0275fac,providedIn:"root"})};var Me=()=>{let e=s(E);return e.token()?!0:e.checkProxyAuthed().pipe(R(t=>t?F(!0):e.refreshToken().pipe(S(()=>!0))))},Ae=()=>{let e=s(C),t=s(I),o=s(K),n=e.relayIsEnabled()?"longpoll":"websocket",i=[o.get(L).preload(!0),o.get(L).preloadFilterGroups(!0),o.get(A).preload(!0)];return e.configLoaded===null?x(i).pipe(S(()=>n)):e.configLoaded?.pipe(R(()=>x(i)))},Re=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-V77N2OUE.js")},{path:"logout",loadComponent:()=>import("./chunk-ZI2XNFAW.js")},{path:"",canActivate:[Me],children:[{path:"",canActivate:[Ae],loadComponent:()=>import("./chunk-E4GCCYDQ.js"),children:[{path:"",loadComponent:()=>import("./chunk-WPGKMLVU.js")},{path:"add-backup",loadComponent:()=>import("./chunk-NHAGSIVX.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-IZXB2EWT.js")},{path:"backup/import",loadComponent:()=>import("./chunk-64ZU74CD.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-C26ZMSTR.js"),loadChildren:()=>import("./chunk-EQAVG2TR.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-C26ZMSTR.js"),loadChildren:()=>import("./chunk-EQAVG2TR.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-KSQIUDEA.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-H2PTENA3.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-N7RSCHJF.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-6DSLFJ4T.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-NZ2KKCDC.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-2D26BDYB.js")},{path:"from-config",loadComponent:()=>import("./chunk-QBJGIKPM.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-FTFVEVRT.js"),loadChildren:()=>import("./chunk-VLBSM6YW.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-FTFVEVRT.js"),loadChildren:()=>import("./chunk-VLBSM6YW.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-FTFVEVRT.js"),loadChildren:()=>import("./chunk-VLBSM6YW.js")},{path:"settings",loadComponent:()=>import("./chunk-RCKA5DTC.js")},{path:"about",loadComponent:()=>import("./chunk-CCA5ZCEA.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-MMPTX6PS.js")},{path:"changelog",loadComponent:()=>import("./chunk-DBD6FOQL.js")},{path:"libraries",loadComponent:()=>import("./chunk-XBJRRUMO.js")},{path:"system-info",loadComponent:()=>import("./chunk-QVEGV6V6.js")},{path:"server-settings",loadComponent:()=>import("./chunk-EKP3ML6M.js")},{path:"logs",loadChildren:()=>import("./chunk-IBG5YOFG.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-WRWIBPXL.js")}]}]}]}]}];var V=null,Te=(e,t)=>{let o=s(E),n=s(ae),i=s(b),l=s(h),r=i.getItem("locale"),u=s(le),a=be(r),p=e.url==="/api/v1/auth/login",m=e.url==="/api/v1/auth/refresh",v=e.url==="/api/v1/progressstate",g=e.url==="/api/v1/remoteoperation/test",y=e.url==="/api/v1/filesystem/validate",T=e.url.startsWith("/api/v2/"),N=o.token(),H=e,W=e.headers.has("custom-proxy-check")||N===ue;if(N&&e.url.startsWith(l.baseUrl)&&!W){let c=e.headers.set("Authorization",`Bearer ${N}`);r&&r!=="en-US"&&(c=c.set("X-Ui-Language",a)),H=e.clone({headers:c})}return t(H).pipe(S(c=>{if(c.type===4&&c.status===200&&T){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}),G(c=>{let f=c.error?.Error||`Error Code: ${c.status}, Message: ${c.message}`;return!W&&(v&&c.status===404||g||y||u.error(f),m&&c.status===401&&(o.logout(),n.navigate(["/logout"])),!p&&!m&&c.status===401)?(o.clearSessionToken(),V??=o.refreshToken().pipe(J()),V.pipe(R(()=>t(e.clone({headers:e.headers.set("Authorization",`Bearer ${o.token()}`)}))),w(()=>V=null))):U(()=>({error:c,message:f}))}))};var Oe="1.0.0",we=`portal-proxy-client-${P()}`,Ne=1,O=class e{#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=Q(()=>{let t=this.#i(),o=this.#l(),n=this.#a();if(!n||!t||!o||o<this.#o){this.#c&&window.clearInterval(this.#c);return}this.#c=window.setInterval(()=>{this.connectToMachineServer(n)},o)});utf8Atob(t){let o=Uint8Array.from(atob(t),i=>i.charCodeAt(0)),n=this.#m.decode(o);return n?JSON.parse(n):null}connectToMachineServer(t,o){let n=o?.reconnect??!1,i=this.wsState();(i==="disconnected"||i==="error"||n)&&(this.#e?.close(),this.#e=null),!this.#e&&(this.#e=new WebSocket(this.#s.machineServerUrl),this.#t.set("connecting"),this.#e.onopen=()=>{this.#t.set("connect"),this.#n.set(!0),this.#i.set(!1),this.#a.set(null)},this.#e.onclose=()=>{this.#t.set("disconnected"),this.#n.set(!1),this.#a.set(t),this.#i.set(!0)},this.#e.onerror=()=>{this.#t.set("error")},this.#e.onmessage=l=>{let 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:t,publicKey:"",clientVersion:Oe,protocolVersion:Ne},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(t=null){t&&console.error(t),this.#e?.close(),this.#e=null,this.#t.set("disconnected"),this.#n.set(!1)}createResponse(t,o,n){let i={from:we,to:t.from,type:o,messageId:t.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(t,o,n,i,l,r,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(t),new Promise((a,p)=>{let m=P(),g={from:we,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 T=this.#r[m];T&&(delete this.#r[m],T.reject("Timeout"))},u)};this.#r[m]=y,this.#n()?this.activateCommand(g):this.#p.push(g)})}activateCommand(t){this.#e?.send(JSON.stringify(t))}static \u0275fac=function(o){return new(o||e)};static \u0275prov=k({token:e,factory:e.\u0275fac,providedIn:"root"})};function xe(e){if(typeof e!="string")return null;let o=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...o))}function ke(e,t,o){let n=e.relayconfigState.config();if(n===null)return o(t);let i=xe(t.body),l={};t.headers.keys().forEach(p=>{l[p]=t.headers.get(p)??""});let r=t.headers.get("timeout"),u=r!==null?parseInt(r):e.defaultTimeout;t.url.startsWith("/api/v1/serverstate")&&t.url.includes("longpoll=true")&&(u=1e3*99);let a=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,t.method,t.url,i,l,u);return new j(p=>{a.then(m=>{let v=new te;l!=null&&Object.keys(l).forEach(y=>{v.set(y,l[y])});let g=new oe({body:m.body,status:m.code,statusText:"OK",headers:v});p.next(g),p.complete()})})}var Ee=(e,t)=>{let o={relayconfigState:s(C),defaultTimeout:s(h).defaultTimeout,relayWebsocket:s(O)},n=o.relayconfigState.config();if(o.relayconfigState.configLoaded!==null&&n===null){let i=new D;return o.relayconfigState.configLoaded.subscribe(l=>{l&&ke(o,e,t).subscribe(i)}),i}return ke(o,e,t)};var Ie={providers:[q(),pe(Re,ce()),ne(se(),re([Ee,Te])),b,{provide:h,useValue:Se},{provide:X,useValue:Ce()},he,I,fe,Z,de,Y,ge,ye]};ee(M,Ie);
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.140",
2
+ "version": "0.0.141",
3
3
  "name": "@duplicati/ngclient",
4
4
  "license": "MIT",
5
5
  "contributors": [
package/chunk-JI7GCFQB.js DELETED
@@ -1 +0,0 @@
1
- import{a as Ue}from"./chunk-N57J64DN.js";import{a as se}from"./chunk-WZNH4JPF.js";import{a as ne}from"./chunk-BCHZRC5K.js";import{b as pe}from"./chunk-LDIZ5E5Z.js";import{a as Ve}from"./chunk-J6BHRR34.js";import{a as H}from"./chunk-2BX65XJQ.js";import{a as oe}from"./chunk-6JQM2X3B.js";import{a as xe}from"./chunk-WXARH2SG.js";import{b as We,c as v,e as w,f as G,i as ze,j as B,l as Xe,o as x,q as V,r as W,s as Ye,t as z}from"./chunk-NSIELNIY.js";import{b as N,d as h}from"./chunk-2W6BEUGU.js";import{A as Be,a as b,e as De,g as D,l as Ae,p as ve,q as we,t as Ge}from"./chunk-Y5IRBMLB.js";import{h as A}from"./chunk-DNJOKPEL.js";import{la as ie}from"./chunk-CWLTHXVS.js";import{Ab as c,B as Oe,Bb as M,Cb as k,Eb as j,F as Y,H as O,Hc as le,Ic as L,Kb as d,L as fe,Lb as F,Mb as T,Nb as he,Ob as Pe,P as Ce,Q,Qa as u,Qb as f,Rb as $,U as Re,Z as p,ab as y,bc as Ie,da as C,ea as R,ec as q,fb as Ne,gc as ye,hc as Me,i as ge,jc as Z,kc as ee,lc as te,na as _,o as Te,rc as ke,sb as U,sc as $e,tb as K,wc as ae,x as re,xb as m,xc as Le,y as Ee,yb as r,yc as be,zb as l}from"./chunk-BTMXQPBB.js";var Ke=new W,He=()=>Ke.group({passphrase:Ke.control("")}),_e=class a{#t=p(A);#e=p(P);#o=p(h);#n=p(N);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=_(!1);settings=_([]);next(){let i=this.#e.destinationTargetUrl();if(!i)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,t=[];e?t.push({Name:"--passphrase",Value:e}):t.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(o=>{let n=o.Name?.trim();n&&n!=="--"&&(n.startsWith("--")||(n=`--${n}`),t.push({Name:n,Value:o.Value??""}))}),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:i,Settings:t}},temporary:!0}).pipe(O(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:o=>{let n=o.ID;this.#o.navigate([`/restore-draft/${n}`])},error:o=>{console.error(o)}})}back(){this.#e.isFileRestore()?this.#o.navigate(["destination"],{relativeTo:this.#n.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=y({type:a,selectors:[["app-restore-encryption"]],decls:16,vars:3,consts:()=>{let i;i=$localize`Enter backup passphrase if defined.`;let e;e=$localize`Password`;let t;t=$localize`Advanced options`;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Back `;let n;return n=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `,[e,t,o,n,[3,"submit","formGroup"],["for","password"],["type","password","id","password","placeholder",i,"formControlName","passphrase"],["title",""],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"]]},template:function(e,t){e&1&&(r(0,"form",4),f("submit",function(){return t.next()}),r(1,"spk-form-field")(2,"label",5),T(3,0),l(),c(4,"input",6),l(),r(5,"app-toggle-card"),M(6,7),T(7,1),k(),r(8,"app-options-list",8),te("optionsChange",function(n){return ee(t.settings,n)||(t.settings=n),n}),l()(),r(9,"div",9)(10,"button",10),f("click",function(){return t.back()}),d(11,2),c(12,"spk-icon"),F(),l(),r(13,"button",11),d(14,3),c(15,"spk-icon"),F(),l()()()),e&2&&(m("formGroup",t.encryptionForm),u(8),Z("options",t.settings),m("hasFreeTextSettings",!0))},dependencies:[z,B,v,w,G,x,V,Ae,b,D,ne,Ue],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var Ze=()=>({standalone:!0});function et(a,i){a&1&&c(0,"spk-progress-bar",7)}function tt(a,i){if(a&1&&(q(0),ae(1,"bytes")),a&2){let e=$().$implicit;ye(" (",Le(1,1,e.FileSizes),") ")}}function it(a,i){if(a&1&&(r(0,"div",14),q(1),ae(2,"date"),U(3,tt,2,3),l()),a&2){let e=i.$implicit;u(),Me(" ",e.Version,": ",be(2,3,e.Time,"medium")," "),u(2),K(e.FileSizes?3:-1)}}function ot(a,i){a&1&&c(0,"spk-progress-bar",7)}function nt(a,i){if(a&1&&(r(0,"app-file-tree",13)(1,"label",15),T(2,4),l(),c(3,"input",16),l()),a&2){let e=$(2);m("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function st(a,i){if(a&1){let e=j();r(0,"spk-select",11),f("cleared",function(){C(e);let o=$();return R(o.abortLoading())}),r(1,"input",12),te("ngModelChange",function(o){C(e);let n=$();return ee(n.selectOption,o)||(n.selectOption=o),R(o)}),l(),Ne(2,it,4,6,"ng-template"),l(),U(3,ot,1,0,"spk-progress-bar",7),U(4,nt,4,5,"app-file-tree",13)}if(a&2){let e=$();m("options",e.versionOptions())("isClearable",!1),u(),Z("ngModel",e.selectOption),m("ngModelOptions",$e(6,Ze)),u(2),K(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),u(),K(e.showFileTree()?4:-1)}}var ue=new W,Je=()=>ue.group({filesToRestore:ue.control(""),passphrase:ue.control(null)}),de=class a{#t=p(A);#e=p(P);#o=p(Ve);#n=p(oe);#i=p(h);#s=p(N);#l=p(ie);#a=null;#p=null;#r=_([]);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;selectOption=this.#e.selectOption;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;isFileRestore=this.#e.isFileRestore;needsDatabaseRepair=le(()=>this.#e.backup()?.Backup?.IsTemporary??!0);showFileTree=_(!1);backupSettings=_(null);rootPaths=_([]);initialNodes=_([]);loadingRootPath=_(!1);isRepairing=le(()=>this.#r().length>0);loadedVersions=_({});loadingEffect=L(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let t=e[0].Version;this.selectOption.set(t.toString())}});backupSettingsEffect=L(()=>{let i=this.backupId(),e=this.selectOption(),t=this.isRepairing(),o=this.loadedVersions();if(!e||!i)return;let s=this.versionOptions()?.find(J=>J.Version===parseInt(e))?.Time??null;if(!s)return;let S=`${i}+${s}`,E=o[S];if(this.needsDatabaseRepair()&&(!E||t))return;let I={id:i+"",time:s};this.backupSettings.set(I),this.getRootPath(I)});repairEffect=L(()=>{if(!this.needsDatabaseRepair())return;let i=this.selectOption(),e=this.versionOptions();if(i){let t=e.find(s=>s.Version===parseInt(i));if(t===void 0)return;let o=this.backupId(),n=`${o}+${t.Time}`;if(this.#p===n||(this.#p=n,this.#r().includes(n)))return;this.#r.update(s=>[...s,n]),this.#t.postApiV1BackupByIdRepairupdate({id:o,requestBody:{only_paths:!0,time:t.Time}}).pipe(Q(this.abortLoading$),O(()=>{this.#p=null})).subscribe(s=>{let S=s.ID;this.#o.waitForTaskToComplete(S).pipe(Y(1)).subscribe(()=>{this.#r.update(E=>E.filter(I=>I!==n)),this.loadedVersions.update(E=>(E[n]=!0,E))})})}});getRootPath(i){let e={id:i.id+"",time:i.time,prefixOnly:!0,folderContents:!1},t=i.id+"";this.isRepairing()||this.#a===t||(this.#a=t,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#n.hasV2ListOperations()?this.#t.postApiV2BackupListFolder({requestBody:{BackupId:i.id,Time:i.time,Paths:null,PageSize:0,Page:0}}).pipe(Q(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#a=null})).subscribe({next:o=>{let n=(o.Data??[]).map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#t.getApiV1BackupByIdFiles(e).pipe(Q(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:o=>{let n=o.Files.map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new ge;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let i=this.versionOptions();return e=>{if(!e)return"";let t=i?.find(o=>typeof o.Version=="number"&&o.Version.toString()===e);return t?`${t.Version}: ${this.#l.transform(t.Time,"medium")}`:""}}next(){this.#i.navigate(["options"],{relativeTo:this.#s.parent})}back(){this.#e.isFileRestore()?this.#i.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=y({type:a,selectors:[["app-select-files"]],features:[ke([ie])],decls:13,vars:3,consts:()=>{let i;i=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let t;t=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let o;o=$localize`Select an option...`;let n;return n=$localize`Path`,[["formRef",""],i,e,t,n,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",o,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","initialNodes","backupSettings","multiSelect","showFiles"],[1,"custom-option"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,t){if(e&1){let o=j();r(0,"form",5,0),f("submit",function(){return C(o),R(t.next())}),r(2,"h3",6),T(3,1),l(),U(4,et,1,0,"spk-progress-bar",7)(5,st,5,7),r(6,"div",8)(7,"button",9),f("click",function(){return C(o),R(t.back())}),d(8,2),c(9,"spk-icon"),F(),l(),r(10,"button",10),d(11,3),c(12,"spk-icon"),F(),l()()()}e&2&&(m("formGroup",t.selectFilesForm),u(4),K(t.versionOptionsLoading()?4:5),u(5),he(t.isFileRestore()?"Back":"Exit"),Pe(8))},dependencies:[Ye,B,v,w,G,ze,z,x,V,ie,xe,se,D,b,Ge,ve],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var P=class a{#t=p(h);#e=p(N);#o=p(oe);#n=p(De);#i=p(A);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);selectFilesForm=Je();optionsForm=Qe();encryptionForm=He();optionsFormSignal=pe(this.optionsForm.valueChanges);selectFilesFormSignal=pe(this.selectFilesForm.valueChanges);selectOption=_(null);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isFileRestore=_(!1);isFullWidthPage=_(!1);#s=_("");#l=_(null);#a=null;testSignal=this.#s.asReadonly();testErrorMessage=this.#l.asReadonly();#p=L(()=>{let i=this.destinationTargetUrl(),e=this.#s(),t=this.#a;this.#a=i,!(e==="testing"||t===null||t===i)&&(this.#s.set(""),this.#l.set(null))});init(i,e=!1){this.backupId.set(i),this.isFileRestore.set(e),e&&this.#t.navigate(["/restore-from-files/destination"]),e||this.getBackup(!0)}setTestState(i,e){this.#s.set(i),this.#l.set(e??null)}updateTargetUrl(i){this.destinationTargetUrl.set(i)}submit(){this.isSubmitting.set(!0);let i=this.backupId();this.backup()?.Backup?.IsTemporary??!1?this.#i.postApiV1BackupByIdCopytotemp({id:this.backupId()??""}).subscribe({next:t=>{this.#r(t.ID??"")},error:t=>this.showErrorDialog($localize`An error occurred while copying the backup to a temporary location: ${t.message}`)}):this.#r(i??"")}showErrorDialog(i){this.#n.open(H,{data:{title:$localize`Error occured`,message:i,confirmText:$localize`OK`,cancelText:void 0},closed:e=>{}})}#r(i){let e=this.optionsForm.value,t=this.selectFilesForm.value,o=this.selectOption(),n=this.versionOptions()?.find(s=>s.Version===(o&&parseInt(o)));this.#i.postApiV1BackupByIdRestore({id:i??"",requestBody:{paths:t.filesToRestore?.split("\0").map(s=>s.endsWith("/")||s.endsWith("\\")?`${s}*`:s)??[],passphrase:t.passphrase??null,time:n?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata}}).pipe(O(()=>this.isSubmitting.set(!1))).subscribe({next:s=>{this.#t.navigate([`./${s.ID}`,"progress"],{relativeTo:this.#e})},error:s=>{console.error("restore error",s)}})}exit(){this.#n.open(H,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:i=>{i&&(this.#_(),this.#t.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(i,e=2){return this.#i.postApiV2BackupListFilesets({requestBody:{BackupId:i}}).pipe(Oe(t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder";return o||n||s||e===0?Te(()=>t):Ee(1e3).pipe(Ce(()=>this.loadFilesetsWithRetryv2(i,e-1)))}))}getBackup(i=!1){let e=this.backupId();this.versionOptionsLoading.set(!0),this.#o.hasV2ListOperations()?re([this.#i.getApiV1BackupById({id:e}),this.loadFilesetsWithRetryv2(e)]).pipe(Y(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{if(o.Error)throw new Error(o.Error);if(!(t.Backup?.IsTemporary??!0)&&t?.Backup?.DBPathExists===!1){this.#n.open(H,{data:{title:$localize`Missing Local Database`,message:$localize`The local database for this backup is missing. Please repair or recreate the local database before restoring.`,confirmText:$localize`OK`,cancelText:void 0},closed:s=>{this.#t.navigate(["/backup",e,"database"])}});return}this.versionOptions.set((o.Data??[]).map(s=>({Version:s.Version??-1,IsFullBackup:s.IsFullBackup??void 0,Time:s.Time??"<missing>",FileCount:s.FileCount??void 0,FileSizes:s.FileSizes??void 0}))),this.backup.set(t)},error:t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder",S=$localize`An error occurred while loading the backup filesets: ${t.message}`;o&&(S=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),n&&(S=$localize`The backup storage folder was not found.`),s&&(S=$localize`The backup storage folder does not contain any filesets.`),this.#n.open(H,{data:{title:$localize`Failed to load backup filesets`,message:S,confirmText:$localize`OK`,cancelText:void 0},closed:E=>{this.#t.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):re([this.#i.getApiV1BackupById({id:e}),this.#i.getApiV1BackupByIdFilesets({id:e}).pipe(fe(3))]).pipe(Y(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{this.versionOptions.set(o.map(n=>({Version:n.Version??-1,IsFullBackup:(n.IsFullBackup??1)==1,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(t)}})}#_(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||a)};static \u0275prov=Re({token:a,factory:a.\u0275fac,providedIn:"root"})};var X=new W,Qe=()=>X.group({restoreFrom:X.control("orignal"),restoreFromPath:X.control(""),handleExisting:X.control("overwrite"),permissions:X.control(!1),includeMetadata:X.control(!0)}),Fe=class a{#t=p(P);#e=p(h);#o=p(N);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;isSubmitting=this.#t.isSubmitting;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#o.parent})}submit(){this.#t.submit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=y({type:a,selectors:[["app-advanced-options-settings"]],decls:42,vars:7,consts:()=>{let i;i=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let t;t=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let o;o=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let n;n=$localize`How do you want to handle existing files?`;let s;s=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let S;S=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let E;E=$localize`Metadata settings`;let I;I=$localize` Restore file metadata ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let J;J=$localize` Restore read/write permissions ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let me;me=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let Se;return Se=$localize`${"\uFFFD#41\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#41\uFFFD"}:CLOSE_TAG_SPK_ICON: Submit `,[["formRef",""],i,e,t,o,n,s,S,E,I,J,me,Se,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"raised","primary"],["type","radio","name","restoreFrom","value","orignal","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled","enableCreateFolder"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","includeMetadata"],["type","checkbox","formControlName","permissions"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"]]},template:function(e,t){if(e&1){let o=j();r(0,"form",13,0),f("submit",function(){return C(o),R(t.submit())}),r(2,"h3",14),T(3,1),l(),r(4,"app-toggle-card",15),M(5,16),T(6,2),k(),r(7,"spk-radio",17),d(8,3),c(9,"input",18),F(),l(),r(10,"spk-radio",17),d(11,4),c(12,"input",19),F(),l(),r(13,"app-file-tree",20)(14,"label",21),q(15,"Path"),l(),c(16,"input",22),l()(),r(17,"app-toggle-card",15),M(18,16),T(19,5),k(),r(20,"spk-radio",17),d(21,6),c(22,"input",23),F(),l(),r(23,"spk-radio",17),d(24,7),c(25,"input",24),F(),l()(),r(26,"app-toggle-card"),M(27,16),T(28,8),k(),r(29,"spk-toggle",25),d(30,9),c(31,"input",26),F(),l(),r(32,"spk-toggle",25),d(33,10),c(34,"input",27),F(),l()(),r(35,"div",28)(36,"button",29),f("click",function(){return C(o),R(t.goBack())}),d(37,11),c(38,"spk-icon"),F(),l(),r(39,"button",30),d(40,12),c(41,"spk-icon"),F(),l()()()}if(e&2){let o;m("formGroup",t.optionsForm),u(4),m("disallowToggle",!0),u(9),m("disabled",((o=t.optionsFormSignal())==null?null:o.restoreFrom)!=="pickLocation")("enableCreateFolder",!0),u(4),m("disallowToggle",!0),u(22),Ie("loader",t.isSubmitting())}},dependencies:[z,B,v,We,Xe,w,G,x,V,ne,se,Be,we,D,b],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{Qe as a,Fe as b,He as c,_e as d,Je as e,de as f,P as g};
package/chunk-QUB4JNM7.js DELETED
@@ -1 +0,0 @@
1
- import"./chunk-EUDKD2JW.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-Y2PKBSNM.js")},{path:"encryption",loadComponent:()=>import("./chunk-74BJ4GVA.js")},{path:"select-files",loadComponent:()=>import("./chunk-PZCO6IX3.js")},{path:"options",loadComponent:()=>import("./chunk-PZA4FRVJ.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-QIG4NNIP.js")}],t=o;export{t as default};