@duplicati/ngclient 0.0.41 → 0.0.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import{a as L}from"./chunk-EUZXGGH4.js";import{n as w}from"./chunk-ED3PEZLO.js";import{a as M,b as x}from"./chunk-AKLJ23OZ.js";import{a as G}from"./chunk-OVIL3KMN.js";import{Ab as E,E as g,Eb as r,Fb as o,Gb as R,Kc as p,L as b,Mc as v,R as B,Ra as u,Sb as f,X as l,Xb as _,Za as i,fb as A,ib as I,ic as h,l as T,lb as D,lc as k,p as C,vb as y,vc as N,wc as O}from"./chunk-MR4RE3IB.js";import{a as d,b as S}from"./chunk-C6Q5SG76.js";var c=class a{#t=l(G);transform(e,...t){return this.#t.locale(),this.#t(e).fromNow()}static \u0275fac=function(t){return new(t||a)};static \u0275pipe=I({name:"appRelativeTime",type:a,pure:!0})};var m=class a{#t=1e3;#d=l(x);#o=l(M);#n=l(L);#e=i(!1);#i=i(!1);#u=i(this.#t);#p=i(null);#l=i(!1);#s=i(!1);#a=i(null);#S=i(!1);statusData=this.#p.asReadonly();serverState=p(()=>{let e=this.#a();return e?(e.ProposedSchedule=e?.ProposedSchedule?.map(t=>{let s=t.Item1?this.#n.getBackupById(t.Item1):null;return S(d({},t),{backup:s})}),e):null});isFetching=this.#i.asReadonly();#r=null;#g=v(()=>{let e=this.#e(),t=this.#u();if(!e||!t||t<this.#t){this.#r&&window.clearInterval(this.#r);return}this.#r=window.setInterval(()=>{this.#m()},t)});start(){this.#l.set(!0),this.#c()}stop(){this.#l.set(!1)}startPollingProgress(){this.#m(),this.#e.set(!0)}stopPollingProgress(){this.#e.set(!1)}setProgressStatePollingInterval(e){if(e<this.#t){console.error(`Polling interval must be at least ${this.#t}ms`);return}this.#u.set(e)}serverStateEffect=v(()=>{if(this.#S()){this.stopPollingProgress();return}!this.#s()&&this.#l()?setTimeout(()=>{this.startPollingProgress(),this.#c()},1e3):this.stopPollingProgress()});#c(){if(this.#s())return;this.#s.set(!0);let e=this.#a()?.LastEventID,t=e==null?{}:{lastEventId:e,longpoll:!0,duration:"299s"};this.#o.getApiV1Serverstate(t).pipe(g(()=>this.#s.set(!1))).subscribe({next:s=>{this.#a()?.LastDataUpdateID!==s.LastDataUpdateID&&this.#n.getBackups(),this.#a.set(s)}})}#m(){this.#i.set(!0),this.#d.getApiV1Progressstate().pipe(b(e=>{let t=e.TaskID??null;return t===null?T(e):this.#o.getApiV1TaskByTaskid({taskid:t}).pipe(C(s=>S(d({},e),{task:s??null})))}),g(()=>this.#i.set(!1))).subscribe({next:e=>{let t=e.TaskID??null,s=e.BackupID??null;if(t!==null&&s!==null){let n=this.#n.getBackupById(s);e.backup=n}e.task?.Status==="Completed"?this.#e.set(!1):this.#e.set(!0),this.#p.set(e)},error:e=>{e.status===404&&this.#e.set(!1)}})}static \u0275fac=function(t){return new(t||a)};static \u0275prov=B({token:a,factory:a.\u0275fac,providedIn:"root"})};function V(a,e){if(a&1&&(r(0,"div",4),h(1),o(),R(2,"spk-progress-bar",5)),a&2){let t,s,n=_();u(),k("",(t=n.statusData())==null||t.task==null?null:t.task.Status," - ",(t=n.statusData())==null||t.backup==null||t.backup.Backup==null?null:t.backup.Backup.Name,""),u(),y("value",(s=n.statusData())!=null&&s.OverallProgress?((s=n.statusData())==null?null:s.OverallProgress)*100:3)}}function j(a,e){if(a&1&&(r(0,"div",4),h(1),N(2,"appRelativeTime"),o()),a&2){let t,s=_();u(),k("",(t=s.nextBackup().backup)==null||t.Backup==null?null:t.Backup.Name," - ",O(2,2,s.nextBackup().time),"")}}function F(a,e){a&1&&(r(0,"div",4),f(1,0),o())}function X(a,e){a&1&&(r(0,"div",4),f(1,1),o())}var U=new Date,P=class a{#t=l(m);minsAgo=U.setMinutes(U.getMinutes()-1);statusData=this.#t.statusData;serverState=this.#t.serverState;nextBackup=p(()=>({backup:this.serverState()?.ProposedSchedule?.[0]?.backup,time:this.serverState()?.ProposedSchedule?.[0]?.Item2}));ngOnInit(){this.#t.start()}ngOnDestroy(){this.#t.stop()}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=A({type:a,selectors:[["app-status-bar"]],decls:6,vars:1,consts:()=>{let e;e=$localize`No scheduled tasks`;let t;return t=$localize`Loading...`,[e,t,[1,"current-backup"],[1,"current-backup-progress"],[1,"label"],[1,"raised","primary",3,"value"]]},template:function(t,s){if(t&1&&(r(0,"div",2)(1,"div",3),D(2,V,3,3)(3,j,3,4,"div",4)(4,F,2,0,"div",4)(5,X,2,0,"div",4),o()()),t&2){let n;u(2),E(!((n=s.statusData())==null||n.task==null)&&n.task.Status&&((n=s.statusData())==null||n.task==null?null:n.task.Status)!=="Completed"?2:s.nextBackup().backup||s.nextBackup().time?3:!s.statusData()||((n=s.statusData())==null||n.task==null?null:n.task.Status)==="Completed"?4:5)}},dependencies:[w,c],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;min-height:3.875rem;border-bottom:1px solid var(--base-level-40)}.current-backup[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.current-backup-progress[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:18.75rem}.current-backup-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{P as a};
@@ -1 +1 @@
1
- import{a as G}from"./chunk-XVJY4Y25.js";import{a as v}from"./chunk-EUZXGGH4.js";import{a as h,g as y,h as b,n as L}from"./chunk-ED3PEZLO.js";import{a as B}from"./chunk-AKLJ23OZ.js";import"./chunk-5XX7BU4I.js";import"./chunk-OVIL3KMN.js";import"./chunk-5ZK3D2RS.js";import{Ab as C,Bb as f,Cb as k,Db as O,Eb as a,Fb as r,Gb as p,Hb as M,Ib as P,Qb as N,Ra as l,Rb as F,Sb as _,Tb as $,Ub as D,X as c,Xb as d,fb as E,ic as A,lb as u,lc as I,sb as g,sc as x,tb as R,vb as T}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var X=()=>[b,y,h,import("./chunk-HEBDWN5N.js").then(e=>e.RouterLink)],w=e=>["/restore-flow",e];function z(e,o){if(e&1&&(a(0,"spk-card",5),p(1,"img",6),a(2,"div",7)(3,"h3"),_(4,1),r(),a(5,"p"),A(6),r()(),a(7,"button",8),N(8,2),p(9,"spk-icon"),F(),r()()),e&2){let t,i,n=o.$implicit;l(4),$((t=n.Backup==null?null:n.Backup.Name)!==null&&t!==void 0?t:"Backup name missing"),D(4),l(2),I(" ",(i=n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.SourceSizeString)!==null&&i!==void 0?i:"-"," / ",(i=n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.BackupListCount)!==null&&i!==void 0?i:"-"," "),l(),T("routerLink",x(4,w,n.Backup==null?null:n.Backup.ID))}}function W(e,o){if(e&1&&k(0,z,10,6,"spk-card",5,f),e&2){let t=d(2);O(t.backups())}}function K(e,o){e&1&&(M(0),_(1,3),P())}function j(e,o){if(e&1&&u(0,W,2,0)(1,K,2,0,"ng-container"),e&2){let t=d();C(t.backups().length?0:1)}}function q(e,o){e&1&&(a(0,"div",9),p(1,"spk-progress-bar",10),a(2,"div",7)(3,"h3"),_(4,4),r()()())}var m=class e{#e=c(v);#t=c(B);backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;ngOnInit(){this.#e.getBackups()}restoreNow(o){this.#t.postApiV1BackupByIdRestore({id:o.Backup?.ID,requestBody:{}})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=E({type:e,selectors:[["app-restore"]],decls:8,vars:1,consts:()=>{let o;o=$localize`Where do you want to restore from?`;let t;t=$localize`Restore ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let i;i=$localize` Restore ${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let n;n=$localize`No backups founds`;let S;return S=$localize`Loading backups...`,[o,t,i,n,S,[1,"type-a"],["src","assets/images/folder.png","alt","","width","48px"],[1,"text"],["spk-button","",3,"routerLink"],[1,"loading-list"],[1,"indeterminate","primary"]]},template:function(t,i){t&1&&(p(0,"app-status-bar"),a(1,"section")(2,"h2"),_(3,0),r(),u(4,j,2,1)(5,q,5,0),g(6,4,X,null,5),r()),t&2&&(l(6),R(!i.backupsLoading()))},dependencies:[G,L],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{font:var(--title-30);text-align:center;padding:2rem}section[_ngcontent-%COMP%]{max-width:43.75rem;margin:0 auto;padding:2rem 0;display:flex;flex-direction:column;gap:1rem}spk-divider[_ngcontent-%COMP%]{color:var(--base-level-60)}spk-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;--card-padding: 2rem}spk-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}"],changeDetection:0})};export{m as default};
1
+ import{a as G}from"./chunk-27GCJTV5.js";import{a as v}from"./chunk-EUZXGGH4.js";import{a as h,g as y,h as b,n as L}from"./chunk-ED3PEZLO.js";import{a as B}from"./chunk-AKLJ23OZ.js";import"./chunk-5XX7BU4I.js";import"./chunk-OVIL3KMN.js";import"./chunk-5ZK3D2RS.js";import{Ab as C,Bb as f,Cb as k,Db as O,Eb as a,Fb as r,Gb as p,Hb as M,Ib as P,Qb as N,Ra as l,Rb as F,Sb as _,Tb as $,Ub as D,X as c,Xb as d,fb as E,ic as A,lb as u,lc as I,sb as g,sc as x,tb as R,vb as T}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var X=()=>[b,y,h,import("./chunk-HEBDWN5N.js").then(e=>e.RouterLink)],w=e=>["/restore-flow",e];function z(e,o){if(e&1&&(a(0,"spk-card",5),p(1,"img",6),a(2,"div",7)(3,"h3"),_(4,1),r(),a(5,"p"),A(6),r()(),a(7,"button",8),N(8,2),p(9,"spk-icon"),F(),r()()),e&2){let t,i,n=o.$implicit;l(4),$((t=n.Backup==null?null:n.Backup.Name)!==null&&t!==void 0?t:"Backup name missing"),D(4),l(2),I(" ",(i=n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.SourceSizeString)!==null&&i!==void 0?i:"-"," / ",(i=n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.BackupListCount)!==null&&i!==void 0?i:"-"," "),l(),T("routerLink",x(4,w,n.Backup==null?null:n.Backup.ID))}}function W(e,o){if(e&1&&k(0,z,10,6,"spk-card",5,f),e&2){let t=d(2);O(t.backups())}}function K(e,o){e&1&&(M(0),_(1,3),P())}function j(e,o){if(e&1&&u(0,W,2,0)(1,K,2,0,"ng-container"),e&2){let t=d();C(t.backups().length?0:1)}}function q(e,o){e&1&&(a(0,"div",9),p(1,"spk-progress-bar",10),a(2,"div",7)(3,"h3"),_(4,4),r()()())}var m=class e{#e=c(v);#t=c(B);backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;ngOnInit(){this.#e.getBackups()}restoreNow(o){this.#t.postApiV1BackupByIdRestore({id:o.Backup?.ID,requestBody:{}})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=E({type:e,selectors:[["app-restore"]],decls:8,vars:1,consts:()=>{let o;o=$localize`Where do you want to restore from?`;let t;t=$localize`Restore ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let i;i=$localize` Restore ${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let n;n=$localize`No backups founds`;let S;return S=$localize`Loading backups...`,[o,t,i,n,S,[1,"type-a"],["src","assets/images/folder.png","alt","","width","48px"],[1,"text"],["spk-button","",3,"routerLink"],[1,"loading-list"],[1,"indeterminate","primary"]]},template:function(t,i){t&1&&(p(0,"app-status-bar"),a(1,"section")(2,"h2"),_(3,0),r(),u(4,j,2,1)(5,q,5,0),g(6,4,X,null,5),r()),t&2&&(l(6),R(!i.backupsLoading()))},dependencies:[G,L],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{font:var(--title-30);text-align:center;padding:2rem}section[_ngcontent-%COMP%]{max-width:43.75rem;margin:0 auto;padding:2rem 0;display:flex;flex-direction:column;gap:1rem}spk-divider[_ngcontent-%COMP%]{color:var(--base-level-60)}spk-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;--card-padding: 2rem}spk-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}"],changeDetection:0})};export{m as default};
@@ -0,0 +1,6 @@
1
+ import{a as We,b as Ve}from"./chunk-WWJ757LM.js";import{a as Et,b as Kt}from"./chunk-DNHLTHLR.js";import{a as st}from"./chunk-3NZI2UZ4.js";import{b as W}from"./chunk-KFGIVU27.js";import{a as we,b as ie,c as xe,d as oe,e as Te,f as lt,g as bt,h as Ee,i as Re,k as pt,l as De,m as ve,n as Vt,o as he,p as ee,q as ct,r as Ne}from"./chunk-7TWD5GBS.js";import{a as re,b as _t,d as Lt,e as Ut,g as Ge,i as mt,k as ae,m as ut,n as Bt,p as se,q as le,v as be,w as He}from"./chunk-ED3PEZLO.js";import{a as Xe}from"./chunk-AKLJ23OZ.js";import{H as Se,X as ne}from"./chunk-J3H4BCHI.js";import{c as Gt}from"./chunk-5XX7BU4I.js";import{ia as at}from"./chunk-5ZK3D2RS.js";import{$b as X,Ab as g,Bb as I,Cb as M,Db as w,E as Ye,Eb as a,Fb as r,Gb as m,Hb as U,Ib as B,Jb as Ue,Kb as P,Kc as V,Mc as rt,Qb as T,R as Me,Ra as s,Rb as E,Sb as k,Tb as Je,Ub as et,Vb as ke,Wb as C,X as x,Xb as p,Za as O,_a as Fe,_b as K,ac as L,ea as f,fa as S,fb as J,fc as ge,gc as Ce,hc as fe,ic as c,ja as xt,jc as b,kc as G,lb as F,lc as $t,mc as It,nc as Mt,oc as wt,p as Qe,qa as Ze,ra as it,rc as Rt,sc as Be,tc as vt,uc as tt,vb as _,xb as Pe,yc as ot}from"./chunk-MR4RE3IB.js";import{a as z,c as kt}from"./chunk-C6Q5SG76.js";function tn(t,n){if(t&1&&(a(0,"p"),c(1),r()),t&2){let e=p();s(),b(e._data().message)}}var nn={title:$localize`Are you sure?`,confirmText:$localize`Confirm`,cancelText:$localize`Cancel`},Ke=class t{data=it();_data=V(()=>z(z({},nn),this.data()));closed=Ze();close(n="confirm"){this.closed.emit(n==="confirm")}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=J({type:t,selectors:[["app-confirm-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:10,vars:4,consts:[["header",""],["content",""],["footer",""],["spk-button","",1,"",3,"click"],["spk-button","",1,"raised","primary",3,"click"]],template:function(e,i){e&1&&(a(0,"header",0)(1,"h3"),c(2),r()(),a(3,"div",1),F(4,tn,2,1,"p"),r(),a(5,"footer",2)(6,"button",3),C("click",function(){return i.close("cancel")}),c(7),r(),a(8,"button",4),C("click",function(){return i.close("confirm")}),c(9),r()()),e&2&&(s(2),b(i._data().title),s(2),g(i._data().message?4:-1),s(3),b(i._data().cancelText),s(2),b(i._data().confirmText))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};var dt=class t{fromString(n){if(!n)return null;let e=n.match(/(\d+)([smhDWMY])/);return e&&{value:parseInt(e[1]),unit:e[2]}}toString(n,e){return`${n}${e}`}static \u0275fac=function(e){return new(e||t)};static \u0275prov=Me({token:t,factory:t.\u0275fac,providedIn:"root"})};var ze=class t{#e=x(Xe);s3Providers=W(this.getS3Config("Providers"));s3Regions=W(this.getS3Config("Regions"));s3RegionHosts=W(this.getS3Config("RegionHosts"));s3StorageClasses=W(this.getS3Config("StorageClasses"));storjSatellites=W(this.getStorjConfig("Satellites"));storjAuthenticationMethods=W(this.getStorjConfig("AuthenticationMethods"));openstackProviders=W(this.getOpenstackConfig("Providers"));openstackVersions=W(this.getOpenstackConfig("Versions"));gcsLocations=W(this.getGcsConfig("Locations"));gcsStorageClasses=W(this.getGcsConfig("StorageClasses"));getS3Config(n){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-getconfig",requestBody:{"s3-config":n}}).pipe(Qe(e=>this.#t(e)))}createS3IamUser(n,e){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"CanCreateUser","s3-username":n,"s3-password":e}})}createS3PolicyIAM(n){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"GetPolicyDoc",path:n}})}getStorjConfig(n){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"storj-getconfig",requestBody:{"storj-config":n}}).pipe(Qe(e=>this.#t(e)))}getOpenstackConfig(n){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"openstack-getconfig",requestBody:{"openstack-config":n}}).pipe(Qe(e=>this.#t(e)))}getGcsConfig(n){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"gcs-getconfig",requestBody:{"gcs-config":n}}).pipe(Qe(e=>this.#t(e)))}#t(n){return(n.Result&&typeof n.Result=="object"&&Object.entries(n.Result).map(([e,i])=>({key:e,value:i})))??[]}static \u0275fac=function(e){return new(e||t)};static \u0275prov=Me({token:t,factory:t.\u0275fac,providedIn:"root"})};function zt(t){return t==null?"":":"+t.toString()}function Xt(t){return t==null?"":t.startsWith("/")?t:"/"+t}function ce(t,n){let e={},i={};return n.searchParams.forEach((o,l)=>{ye[t].dynamicFields?.includes(l)?i[l]=decodeURIComponent(o):e[l]=decodeURIComponent(o)}),{advanced:e,dynamic:i}}function _e(t){let n=t.map(([e,i])=>`${e}=${i?encodeURIComponent(i.toString()):""}`).join("&");return n?"?"+n:""}function Ft(t){let n=t.destinationType;if(!n||!ye.hasOwnProperty(n))throw new Error("Invalid destination type");return ye[n].mapper.to(t)??""}function Dt(t){let n=URL.canParse(t),e=t.split("://")[0],i="http://"+t.split("://")[1],o=new URL(i);if(!n)throw new Error("Invalid target path");return ye[e].mapper.from(e,o,t)}var te=new ee,ye={file:{title:"File system",description:"Store backups on your local file system.",customFields:{path:{type:"FolderTree",name:"path",shortDescription:"File path",longDescription:"The path to store the backup",formElement:t=>te.control(t??"")}},mapper:{to:t=>{let n=_e([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${t.custom.path}${n}`},from:(t,n,e)=>{let i=e.indexOf("file:///")===0,o=e.split(i?"///":"//")[1].substring(0,1)+n.hostname.substring(1);return z({destinationType:t,custom:{path:`${i?"/":""}${o}${n.pathname}`}},ce(t,n))}}},ssh:{title:"SSH",description:"Store backups in SSH.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"The server to connect to",formElement:t=>te.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"The port to connect to",formElement:t=>te.control(t??"",[xe.required,xe.max(65535)])},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:t=>te.control(t??"")}},dynamicFields:["auth-username"],advancedFields:[{type:"FileTree",name:"ssh-keyfile",accepts:".key,",shortDescription:"This is a path to a private key file locally on the machine",longDescription:"This is a path to a private key file locally on the machine"}],mapper:{to:t=>{let n=_e([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{port:e,server:i,path:o}=t.custom;return`${t.destinationType}://${i+zt(e)+Xt(o)+n}`},from:(t,n,e)=>z({destinationType:t,custom:{server:n.hostname,port:n.port,path:n.pathname}},ce(t,n))}},s3:{title:"S3 compatible bucket",description:"Store backups in any S3 compatible bucket.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:t=>te.control(t??"")},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:t=>te.control(t??"")}},dynamicFields:[{name:"s3-server-name",shortDescription:"Server",type:"NonValidatedSelectableString",loadOptions:t=>t.get(ze).s3Providers},"use-ssl","auth-username","auth-password"],advancedFields:[{name:"s3-client",type:"Enumeration",options:["aws","minio"]},{name:"s3-storage-class",type:"NonValidatedSelectableString",loadOptions:t=>t.get(ze).s3StorageClasses}],mapper:{to:t=>{let n=_e([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${t.custom.bucket}${t.custom.path.startsWith("/")?t.custom.path:"/"+t.custom.path}${n}`},from:(t,n,e)=>z({destinationType:t,custom:{path:n.pathname,bucket:n.hostname}},ce(t,n))}},gcs:{title:"Google Cloud Storage",description:"Store backups in Google Cloud Storage.",oauthField:"authid",customFields:{path:{type:"Path",name:"path",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:t=>te.control(t??"")}},dynamicFields:[{name:"gcs-location",type:"NonValidatedSelectableString",loadOptions:t=>t.get(ze).gcsLocations},{name:"gcs-storage-class",type:"NonValidatedSelectableString",loadOptions:t=>t.get(ze).gcsStorageClasses},"authid"],mapper:{to:t=>{let n=_e([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${t.custom.path}${n}`},from:(t,n,e)=>z({destinationType:t,custom:{path:n.hostname+n.pathname}},ce(t,n))}},googledrive:{title:"Google Drive",description:"Store backups in Google Drive.",oauthField:"authid",customFields:{path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:t=>te.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=t.custom.path,e=_e([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>z({destinationType:t,custom:{path:n.hostname+n.pathname}},ce(t,n))}},azure:{title:"Azure Blob Storage",description:"Store backups in Azure Blob Storage.",customFields:{path:{type:"String",name:"path",shortDescription:"Container name",longDescription:"Container name",formElement:t=>te.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:t=>{let n=t.custom.path,e=_e([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>z({destinationType:t,custom:{path:n.hostname+n.pathname}},ce(t,n))}},onedrivev2:{title:"OneDrive",description:"Store backups in OneDrive.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>te.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=t.custom.path,e=_e([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>z({destinationType:t,custom:{path:n.hostname+n.pathname}},ce(t,n))}},dropbox:{title:"Dropbox",description:"Store backups in Dropbox.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>te.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=t.custom.path,e=_e([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>z({destinationType:t,custom:{path:n.hostname+n.pathname}},ce(t,n))}},box:{title:"Box.com",description:"Store backups in Box.com.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>te.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=t.custom.path,e=_e([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>z({destinationType:t,custom:{path:n.hostname+n.pathname}},ce(t,n))}},jottacloud:{title:"Jottacloud",description:"Store backups in Jottacloud.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>te.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=t.custom.path,e=_e([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>z({destinationType:t,custom:{path:n.hostname+n.pathname}},ce(t,n))}}};var Ht=/[a-zA-Z0-9_\-\+\.!@#$%^&*?_~()-]/,gt=class t{generate(n,e=Ht){let i;do i=this.generatePassword(n,e);while(this.calculatePasswordStrength(i)<5);return i}generatePassword(n,e=Ht){let i=this;return Array.apply(null,{length:n}).map(()=>{let o;for(;;)if(o=String.fromCharCode(i.#e()),e.test(o))return o},this).join("")}calculatePasswordStrength(n){let e=1;return n.length>=8&&e++,n.match(/[a-z]/)&&n.match(/[A-Z]/)&&e++,n.match(/\d+/)&&e++,n.match(/.[!,@,#,$,%,^,&,*,?,_,~,(,),-]/)&&e++,Math.min(e,5)}#e(){if(window.crypto&&window.crypto.getRandomValues){let n=new Uint8Array(1);return window.crypto.getRandomValues(n),n[0]}else if(window.msCrypto&&window.msCrypto.getRandomValues){let n=new Uint8Array(1);return window.msCrypto.getRandomValues(n),n[0]}else return Math.floor(Math.random()*256)}static \u0275fac=function(e){return new(e||t)};static \u0275prov=Me({token:t,factory:t.\u0275fac,providedIn:"root"})};var on=["formRef"];function rn(t,n){if(t&1&&(a(0,"spk-option",27),c(1),r()),t&2){let e=n.$implicit;_("value",e.Key),s(),b(e.DisplayName)}}function an(t,n){if(t&1&&m(0,"spk-progress-bar",38),t&2){let e=p(3);Pe("warn",e.calculatePasswordStrength()===1)("tertiary",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),_("value",e.calculatePasswordStrength()*(100/5))}}function sn(t,n){t&1&&(a(0,"span",33),k(1,9),r())}function ln(t,n){t&1&&(T(0,7,1),m(1,"spk-icon"),E())}function pn(t,n){t&1&&(T(0,7,2),m(1,"spk-icon"),E())}function cn(t,n){t&1&&(T(0,10,1),m(1,"spk-icon",40),E())}function _n(t,n){t&1&&(T(0,10,2),m(1,"spk-icon"),E())}function mn(t,n){if(t&1){let e=P();a(0,"button",39),C("click",function(){f(e);let o=p(3);return S(o.copyPassword())}),T(1,10),F(2,cn,2,0)(3,_n,2,0),E(),r()}if(t&2){let e=p(3);s(2),g(e.copiedPassword()?2:3)}}function un(t,n){t&1&&(a(0,"spk-alert",37),k(1,11),r())}function dn(t,n){if(t&1){let e=P();a(0,"div",28)(1,"spk-form-field")(2,"label",29),T(3,6),m(4,"sup"),E(),r(),m(5,"input",30),r(),F(6,an,1,9,"spk-progress-bar",31),a(7,"spk-form-field"),m(8,"input",32),F(9,sn,2,0,"span",33),r(),a(10,"div",34)(11,"button",35),C("click",function(){f(e);let o=p(2);return S(o.showPassword.set(!o.showPassword()))}),T(12,7),F(13,ln,2,0)(14,pn,2,0),E(),r(),a(15,"button",35),C("click",function(){f(e);let o=p(2);return S(o.generatePassword())}),T(16,8),m(17,"spk-icon"),E(),r(),F(18,mn,4,1,"button",36),r(),F(19,un,2,0,"spk-alert",37),r()}if(t&2){let e=p(2);s(5),_("type",e.showPassword()?"text":"password"),s(),g(e.generalForm.value.password?6:-1),s(2),_("type",e.showPassword()?"text":"password"),s(),g(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),s(4),g(e.showPassword()?13:14),s(5),g(e.showCopyPassword()?18:-1),s(),g(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function Fn(t,n){if(t&1&&(a(0,"spk-select",24)(1,"label",25),k(2,5),r(),m(3,"input",26),M(4,rn,2,2,"spk-option",27,I),r(),F(6,dn,20,7,"div",28)),t&2){let e=p();_("displayFn",e.displayFn()),s(4),w(e.encryptionOptions()),s(2),g(e.encryptionFieldSignal()!==""?6:-1)}}function gn(t,n){if(t&1&&(a(0,"button",22),T(1,12),m(2,"spk-icon"),E(),r()),t&2){let e=p();_("disabled",e.generalForm.invalid)}}function Cn(t,n){if(t&1&&(a(0,"spk-tooltip",23)(1,"button",22),T(2,13),m(3,"spk-icon"),E(),r()()),t&2){let e=p();_("disabled",!(e.showCopyPassword()&&!e.copiedPassword())),s(),_("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var qe=new ee,Wt=(t={name:"",description:"",encryption:"",password:"",repeatPassword:""})=>qe.group({name:qe.control(t.name,[xe.required]),description:qe.control(t.description),encryption:qe.control(t.encryption,[Kt()]),password:qe.control(t.password,[Et(n=>n?.value.encryption!=="",[xe.required])]),repeatPassword:qe.control(t.repeatPassword,[Et(n=>n?.value.encryption!=="",[xe.required])])}),Nt={Key:"",DisplayName:"None"},ht=class t{#e=x(ne);#t=x(Se);#i=x(gt);#o=x(pe);#n=x(st);formRef=Fe.required("formRef");generalForm=this.#o.generalForm;generalFormSignal=this.#o.generalFormSignal;encryptionFieldSignal=this.#o.encryptionFieldSignal;encryptionOptions=this.#o.encryptionOptions;isNew=this.#o.isNew;showPassword=O(!1);copiedPassword=O(!1);showCopyPassword=O(!1);encryptionEffect=rt(()=>{this.encryptionFieldSignal()===""&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});calculatePasswordStrength=V(()=>{let e=this.generalFormSignal()?.password??"";return this.#i.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#o.exit()}async copyPassword(){let n=this.generalForm.controls.password.value;await this.#r(n??""),this.copiedPassword.set(!0)}async#r(n){try{await navigator.clipboard.writeText(n)}catch{try{let i=document.createElement("textarea");i.value=n,document.body.appendChild(i),i.select(),document.execCommand("copy"),document.body.removeChild(i)}catch(i){console.error("Failed to copy text: ",i)}}}displayFn(){let n=this.#n.systemInfo()?.EncryptionModules??[];return e=>{let i=[Nt,...n].find(o=>o.Key===e);return i?`${i.DisplayName}`:""}}generatePassword(){this.copiedPassword.set(!1);let n=this.#i.generate(16);this.generalForm.controls.password.setValue(n),this.generalForm.controls.repeatPassword.setValue(n),this.showCopyPassword.set(!0)}next(){this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=J({type:t,selectors:[["app-general"]],viewQuery:function(e,i){e&1&&ge(i.formRef,on,5),e&2&&Ce()},decls:20,vars:3,consts:()=>{let n;n=$localize`Your backup name`;let e;e=$localize`Your backup description`;let i;i=$localize`General backup settings`;let o;o=$localize` Backup name ${"\uFFFD#7\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#7\uFFFD"}:CLOSE_SUPERSCRIPT:`;let l;l=$localize`Backup description`;let u;u=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Exit `;let A;A=$localize`Encryption`;let $;$=$localize`Encryption`;let N;N=$localize`Password`;let q;q=$localize`Repeat password`;let Q;Q=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let v;v=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,v=ke(v);let Y;Y=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Generate password `;let Z;Z=$localize`Passwords do not match`;let D;D=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SPK_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,D=ke(D);let d;d=$localize` Tip: Be sure to save your password. If you loose it you will lose access to your backups. `;let h;h=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let H;return H=$localize` Continue ${"\uFFFD#3\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],i,o,l,u,$,Q,v,Y,Z,D,d,h,H,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],["for","backupName"],["type","text","tabindex","1","placeholder",n,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","spk-button","",3,"click"],["spk-button","","type","submit",1,"raised","primary",3,"disabled"],["message","Remember to copy the password",1,"primary",3,"disabled"],[3,"displayFn"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",A,"formControlName","encryption"],[3,"value"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",N,"formControlName","password",3,"type"],[1,"raised",3,"warn","tertiary","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",q,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["spk-button","","type","button",1,"small",3,"click"],["spk-button","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["spk-button","","type","button",1,"small","copy",3,"click"],[1,"spk-success"]]},template:function(e,i){if(e&1){let o=P();a(0,"form",14,0),C("submit",function(){return f(o),S(i.next())}),a(2,"h3",15),k(3,1),r(),a(4,"spk-form-field")(5,"label",16),T(6,2),m(7,"sup"),E(),r(),m(8,"input",17),r(),a(9,"spk-form-field")(10,"label",18),k(11,3),r(),m(12,"textarea",19),r(),F(13,Fn,7,2),a(14,"div",20)(15,"button",21),C("click",function(){return f(o),S(i.exit())}),T(16,4),m(17,"spk-icon"),E(),r(),F(18,gn,3,1,"button",22)(19,Cn,4,2,"spk-tooltip",23),r()()}e&2&&(_("formGroup",i.generalForm),s(13),g(i.isNew()?13:-1),s(5),g(i.encryptionFieldSignal()===""?18:19))},dependencies:[Ne,Ee,ie,oe,Te,De,he,ae,le,Ge,re,se,Bt,_t,He],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--warn-500)}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.copy[_ngcontent-%COMP%] spk-icon.spk-success[_ngcontent-%COMP%]{color:var(--success-500)}"],changeDetection:0})};var fn=["formRef"],Sn=(t,n)=>({index:t,formView:n,formGroupName:"advancedOptions",destinationType:null,oauthField:null}),Tn=t=>({$implicit:t});function En(t,n){if(t&1&&(a(0,"spk-option",17),c(1),r()),t&2){let e=n.$implicit;_("value",e),s(),b(e)}}function Dn(t,n){if(t&1&&(a(0,"spk-option",17),c(1),r()),t&2){let e=n.$implicit;_("value",e.value),s(),b(e.name)}}function hn(t,n){if(t&1){let e=P();T(0,7,1),a(1,"button",29,2),C("click",function(){let o=f(e).$implicit,l=p();return S(l.addNewOption(o))}),r(),E()}if(t&2){let e=n.$implicit;s(),Je(e.name),et(0)}}function Nn(t,n){t&1&&Ue(0)}function An(t,n){if(t&1&&F(0,Nn,1,0,"ng-container",30),t&2){let e=n.$implicit,i=n.$index;p();let o=fe(35);_("ngTemplateOutlet",o)("ngTemplateOutletContext",Be(5,Tn,vt(2,Sn,i,e)))}}function yn(t,n){if(t&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),c(2,"question"),r()()),t&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function On(t,n){if(t&1&&(a(0,"app-file-tree",33)(1,"label",39),c(2),F(3,yn,3,1,"spk-tooltip",40),r(),m(4,"input",41),r()),t&2){let e,i=p().$implicit,o=p();_("startingPath",o.getFormFieldValue(0,i.formGroupName,i.formView.name))("accepts",i.formView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),s(),X("for","destination-",i.formGroupName,"-",i.index,""),s(),G(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),s(),g(i.formView.longDescription?3:-1),s(),X("id","destination-",i.formGroupName,"-",i.index,""),K("formControlName",i.formView.name)}}function Pn(t,n){if(t&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),c(2,"question"),r()()),t&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function kn(t,n){if(t&1&&(a(0,"app-file-tree",34)(1,"label",39),c(2),F(3,Pn,3,1,"spk-tooltip",40),r(),m(4,"input",41),r()),t&2){let e,i=p().$implicit,o=p();_("startingPath",o.getFormFieldValue(0,i.formGroupName,i.formView.name)),s(),X("for","destination-",i.formGroupName,"-",i.index,""),s(),G(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),s(),g(i.formView.longDescription?3:-1),s(),X("id","destination-",i.formGroupName,"-",i.index,""),K("formControlName",i.formView.name)}}function xn(t,n){if(t&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),c(2,"question"),r()()),t&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function $n(t,n){t&1&&(a(0,"spk-icon",42),c(1,"link"),r())}function In(t,n){t&1&&(a(0,"spk-icon",42),c(1,"textbox"),r())}function Mn(t,n){if(t&1&&(a(0,"spk-form-field")(1,"label",39),c(2),F(3,xn,3,1,"spk-tooltip",40),r(),m(4,"input",41),F(5,$n,2,0,"spk-icon",42)(6,In,2,0,"spk-icon",42),r()),t&2){let e,i=p().$implicit;s(),X("for","destination-",i.formGroupName,"-",i.index,""),s(),G(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),s(),g(i.formView.longDescription?3:-1),s(),X("id","destination-",i.formGroupName,"-",i.index,""),K("formControlName",i.formView.name),s(),g(i.formView.type==="Path"?5:6)}}function wn(t,n){if(t&1){let e=P();a(0,"span",46),C("click",function(){f(e);let o=p(2).$implicit,l=p();return S(l.oauthStartTokenCreation(o.formViewType))}),c(1,"AuthID"),r()}}function Rn(t,n){t&1&&(a(0,"spk-icon",42),c(1,"password"),r())}function vn(t,n){if(t&1){let e=P();a(0,"spk-icon",47),C("click",function(){f(e);let o=p(2).$implicit;return S(o.formView.showPassword=!o.formView.showPassword)}),c(1," eye "),r()}}function Gn(t,n){if(t&1){let e=P();a(0,"spk-icon",47),C("click",function(){f(e);let o=p(2).$implicit;return S(o.formView.showPassword=!o.formView.showPassword)}),c(1," eye-slash "),r()}}function bn(t,n){if(t&1&&(a(0,"spk-form-field")(1,"label",39),c(2),r(),m(3,"input",43),F(4,wn,2,0,"span",44)(5,Rn,2,0,"spk-icon",42)(6,vn,2,0,"spk-icon",45)(7,Gn,2,0,"spk-icon",45),r()),t&2){let e,i=p().$implicit;s(),X("for","destination-",i.formGroupName,"-",i.index,""),s(),G(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),s(),X("id","destination-",i.formGroupName,"-",i.index,""),K("formControlName",i.formView.name),_("type",i.formView.showPassword?"text":"password"),s(),g(i.oauthField===i.formView.name?4:5),s(2),g(i.formView.showPassword?6:7)}}function Vn(t,n){if(t&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),c(2,"question"),r()()),t&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Ln(t,n){if(t&1&&(a(0,"spk-option",17),c(1),r()),t&2){let e=n.$implicit;_("value",e),s(),b(e)}}function Un(t,n){if(t&1&&(a(0,"spk-select")(1,"label",39),c(2),F(3,Vn,3,1,"spk-tooltip",40),r(),m(4,"input",48),M(5,Ln,2,2,"spk-option",17,I),r()),t&2){let e,i=p().$implicit;s(),X("for","destination-",i.formGroupName,"-",i.index,""),s(),G(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),s(),g(i.formView.longDescription?3:-1),s(),X("id","destination-",i.formGroupName,"-",i.index,""),K("formControlName",i.formView.name),s(),w(i.formView.options)}}function Bn(t,n){if(t&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),c(2,"question"),r()()),t&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Kn(t,n){if(t&1&&(a(0,"spk-option",17),c(1),r()),t&2){let e=n.$implicit;_("value",e),s(),b(e)}}function zn(t,n){if(t&1&&(a(0,"div",35)(1,"label",39),c(2),F(3,Bn,3,1,"spk-tooltip",40),r(),a(4,"div",49)(5,"spk-form-field"),m(6,"input",50),a(7,"spk-icon",42),c(8,"resize"),r()(),a(9,"spk-select"),m(10,"label")(11,"input",51),M(12,Kn,2,2,"spk-option",17,I),r()()()),t&2){let e,i=p().$implicit,o=p();_("formGroupName",i.formView.name),s(),X("for","destination-",i.formGroupName,"-",i.index,""),s(),G(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),s(),g(i.formView.longDescription?3:-1),s(3),X("id","destination-",i.formGroupName,"-",i.index,""),s(6),w(o.sizeOptions())}}function Xn(t,n){if(t&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),c(2,"question"),r()()),t&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Hn(t,n){if(t&1&&(a(0,"spk-form-field")(1,"label",39),c(2),F(3,Xn,3,1,"spk-tooltip",40),r(),m(4,"input",52),a(5,"spk-icon",42),c(6,"numpad"),r()()),t&2){let e,i=p().$implicit;s(),X("for","destination-",i.formGroupName,"-",i.index,""),s(),G(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),s(),g(i.formView.longDescription?3:-1),s(),X("id","destination-",i.formGroupName,"-",i.index,""),K("formControlName",i.formView.name)}}function Wn(t,n){if(t&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),c(2,"question"),r()()),t&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function jn(t,n){if(t&1&&(a(0,"spk-toggle",36)(1,"label",39),c(2),F(3,Wn,3,1,"spk-tooltip",40),r(),m(4,"input",53),r()),t&2){let e,i=p().$implicit;s(),X("for","destination-",i.formGroupName,"-",i.index,""),s(),G(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),s(),g(i.formView.longDescription?3:-1),s(),X("id","destination-",i.formGroupName,"-",i.index,""),K("formControlName",i.formView.name)}}function qn(t,n){if(t&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),c(2,"question"),r()()),t&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Qn(t,n){t&1&&(a(0,"spk-option",55),c(1,"None"),r()),t&2&&_("value","None")}function Yn(t,n){if(t&1&&(a(0,"spk-option",17),c(1),m(2,"spk-checkbox",56),r()),t&2){let e=p().$implicit;_("value",e),s(),G(" ",e," ")}}function Zn(t,n){if(t&1&&F(0,Qn,2,1,"spk-option",55)(1,Yn,3,2,"spk-option",17),t&2){let e=n.$implicit;g(e==="None"?0:1)}}function Jn(t,n){if(t&1&&(a(0,"spk-select",37)(1,"label",39),c(2),F(3,qn,3,1,"spk-tooltip",40),r(),m(4,"input",54),M(5,Zn,2,1,null,null,I),r()),t&2){let e,i=p().$implicit;_("selectMultiple",!0),s(),X("for","destination-",i.formGroupName,"-",i.index,""),s(),G(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),s(),g(i.formView.longDescription?3:-1),s(),K("formControlName",i.formView.name),s(),w(i.formView.options)}}function ei(t,n){if(t&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),c(2,"question"),r()()),t&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function ti(t,n){if(t&1&&(a(0,"spk-form-field")(1,"label",39),c(2),F(3,ei,3,1,"spk-tooltip",40),r(),m(4,"input",41),r()),t&2){let e,i=p().$implicit;s(),X("for","destination-",i.formGroupName,"-",i.index,""),s(),G(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),s(),g(i.formView.longDescription?3:-1),s(),X("id","destination-",i.formGroupName,"-",i.index,""),K("formControlName",i.formView.name)}}function ni(t,n){if(t&1){let e=P();a(0,"div",31),U(1,32),F(2,On,5,14,"app-file-tree",33)(3,kn,5,10,"app-file-tree",34)(4,Mn,7,10,"spk-form-field")(5,bn,8,11,"spk-form-field")(6,Un,7,9,"spk-select")(7,zn,14,9,"div",35)(8,Hn,7,9,"spk-form-field")(9,jn,5,9,"spk-toggle",36)(10,Jn,7,7,"spk-select",37)(11,ti,5,9,"spk-form-field"),B(),a(12,"button",38),C("click",function(){let o=f(e).$implicit,l=p();return S(l.removeFormView(o.formView,0))}),a(13,"spk-icon"),c(14,"x-circle"),r()()()}if(t&2){let e=n.$implicit;s(),_("formGroupName",e.formGroupName),s(),g(e.formView.type==="FileTree"?2:e.formView.type==="FolderTree"?3:e.formView.type==="String"||e.formView.type==="Path"?4:e.formView.type==="Password"?5:e.formView.type==="Enumeration"?6:e.formView.type==="Size"?7:e.formView.type==="Integer"?8:e.formView.type==="Boolean"?9:e.formView.type==="Flags"?10:e.formView.type==="Timespan"?11:-1)}}var $e=new ee,ii=["Bytes","KB","MB","GB","TB","PB"],oi=[{value:"",name:"Keep all backups"},{value:"time",name:"Delete backups that are older than"},{value:"versions",name:"Keep a specific number of backups"},{value:"smart",name:"Smart backup retention"},{value:"custom",name:"Custom backup retention"}],jt=(t={remoteVolumeSize:50,size:"MB",backupRetention:"",advancedOptions:[]})=>$e.group({remoteVolumeSize:$e.group({size:$e.control(t.remoteVolumeSize),unit:$e.control(t.size)}),backupRetention:$e.control(t.backupRetention),advancedOptions:$e.group({})}),Er=(t,n)=>$e.group({name:$e.control(t),value:$e.control(n)}),At=class t{#e=x(pe);#t=x(ne);#i=x(Se);formRef=Fe.required("formRef");optionsForm=this.#e.optionsForm;selectedOptions=this.#e.selectedOptions;nonSelectedOptions=this.#e.nonSelectedOptions;isSubmitting=this.#e.isSubmitting;sizeOptions=O(ii);rentationOptions=O(oi);oauthStartTokenCreation(n){}getFormFieldValue(n,e,i){return this.optionsForm.controls.advancedOptions.controls[i].value}removeFormView(n,e){this.#e.removeOptionFromFormGroup(n)}addNewOption(n){this.#e.addOptionToFormGroup(n)}retentionOptionDisplayFn(){let n=this.rentationOptions();return e=>{let i=n.find(o=>o.value===e);return i?i.name:""}}displayFn(){let n=this.#e.advancedOptions();return e=>{let i=n.find(o=>o.name===e);return i?`${i.name}`:""}}goBack(){this.#t.navigate(["schedule"],{relativeTo:this.#i.parent})}submit(){this.#e.submit()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=J({type:t,selectors:[["app-options"]],viewQuery:function(e,i){e&1&&ge(i.formRef,fn,5),e&2&&Ce()},decls:43,vars:5,consts:()=>{let n;n=$localize`Select an option...`;let e;e=$localize`Options`;let i;i=$localize`Remote volume size`;let o;o=$localize` The backups will be split up into multiple files called volumes. Here you can set the maximum size of the individual volume files. ${"\uFFFD#16\uFFFD"}:START_LINK:Read more${"\uFFFD/#16\uFFFD"}:CLOSE_LINK:`;let l;l=$localize`Backup retention`;let u;u=$localize` Advanced options ${"\uFFFD#26\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#27\uFFFD"}:START_TAG_BUTTON: Add advanced option ${"\uFFFD#28\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#27\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#29\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD*31:1\uFFFD"}:START_BLOCK_FOR:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON_1:${"\uFFFD0:1\uFFFD"}:INTERPOLATION:${"[\uFFFD/#27\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/*31:1\uFFFD"}:CLOSE_BLOCK_FOR:${"\uFFFD/#29\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#26\uFFFD"}:CLOSE_TAG_SPK_MENU:`,u=ke(u);let A;A=$localize`${"\uFFFD#39\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#39\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let $;return $=$localize`${"\uFFFD#42\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#42\uFFFD"}:CLOSE_TAG_SPK_ICON: Submit `,[["formRef",""],["fieldTemplate",""],["option",""],e,i,o,l,u,A,$,[3,"submit","formGroup"],[1,"title-30"],[1,"remote-volume-wrap"],["formGroupName","remoteVolumeSize",1,"row-inputs"],["for","size"],["type","number","id","size","formControlName","size"],["type","text","placeholder",n,"formControlName","unit"],[3,"value"],["href","#",1,"spk-primary"],[3,"displayFn"],["type","text","formControlName","backupRetention"],[3,"disallowToggle"],["title",""],["spk-button","","type","button",1,"outlined","small"],["menu",""],["type","button"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["type","button",3,"click"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"field-row"],[3,"formGroupName"],[3,"startingPath","accepts","showFiles","showHiddenNodes","selectFiles"],[3,"startingPath"],[1,"form-column",3,"formGroupName"],[1,"primary","raised"],[1,"primary",3,"selectMultiple"],["spk-button","","type","button",1,"outlined",3,"click"],[3,"for"],[1,"primary",3,"message"],["type","text",3,"id","formControlName"],["prefix",""],["autocomplete","off",3,"type","id","formControlName"],["prefix","",1,"link"],["suffix","",1,"clickable"],["prefix","",1,"link",3,"click"],["suffix","",1,"clickable",3,"click"],["type","search",3,"id","formControlName"],[1,"form-row"],["type","number","formControlName","size",3,"id"],["type","search","formControlName","unit"],["type","number",3,"id","formControlName"],["type","checkbox",3,"id","formControlName"],["type","text","id","text",3,"formControlName"],["deselect","",3,"value"],[1,"raised","primary"]]},template:function(e,i){if(e&1){let o=P();a(0,"form",10,0),C("submit",function(){return f(o),S(i.submit())}),a(2,"h3",11),k(3,3),r(),a(4,"div",12)(5,"div",13)(6,"spk-form-field")(7,"label",14),k(8,4),r(),m(9,"input",15),r(),a(10,"spk-select"),m(11,"input",16),M(12,En,2,2,"spk-option",17,I),r()(),a(14,"p"),T(15,5),m(16,"a",18),E(),r()(),a(17,"spk-select",19)(18,"label",14),k(19,6),r(),m(20,"input",20),M(21,Dn,2,2,"spk-option",17,I),r(),a(23,"app-toggle-card",21),U(24,22),T(25,7),a(26,"spk-menu")(27,"button",23),m(28,"spk-icon"),r(),U(29,24),M(30,hn,3,1,"button",25,I),B(),r(),E(),B(),M(32,An,1,7,"ng-container",null,I),r(),F(34,ni,15,2,"ng-template",null,1,ot),a(36,"div",26)(37,"button",27),C("click",function(){return f(o),S(i.goBack())}),T(38,8),m(39,"spk-icon"),E(),r(),a(40,"button",28),T(41,9),m(42,"spk-icon"),E(),r()()()}e&2&&(_("formGroup",i.optionsForm),s(12),w(i.sizeOptions()),s(5),_("displayFn",i.retentionOptionDisplayFn()),s(4),w(i.rentationOptions()),s(2),_("disallowToggle",!0),s(7),w(i.nonSelectedOptions()),s(2),w(i.selectedOptions()),s(8),Pe("loader",i.isSubmitting()))},dependencies:[Ne,Ee,ie,Re,we,oe,Te,De,he,ve,at,ut,le,Ge,re,ae,be,mt,se,He,We,Ve],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.form-column[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.form-column[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 40px;align-items:flex-end}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var ri=["formRef"];function ai(t,n){if(t&1&&(a(0,"spk-option",38),c(1),r()),t&2){let e=n.$implicit;_("value",e.key),s(),b(e.label)}}function si(t,n){if(t&1){let e=P();a(0,"div",26)(1,"spk-form-field")(2,"label",27),k(3,8),r(),a(4,"input",28,1),C("focus",function(){f(e);let o=fe(5);return S(o.showPicker())}),r(),a(6,"spk-icon",29),c(7,"clock"),r()(),a(8,"spk-form-field"),m(9,"label",30),a(10,"input",31,2),C("focus",function(){f(e);let o=fe(11);return S(o.showPicker())}),r(),a(12,"spk-icon",29),c(13,"calendar"),r()()(),U(14,32),a(15,"div",33)(16,"spk-form-field")(17,"label",34),k(18,9),r(),m(19,"input",35),r(),a(20,"spk-select",36),m(21,"input",37),M(22,ai,2,2,"spk-option",38,I),r()(),a(24,"app-toggle-card",39),U(25,40),k(26,10),B(),a(27,"div",41)(28,"spk-toggle",21),T(29,11),m(30,"input",42),E(),r(),a(31,"spk-toggle",21),T(32,12),m(33,"input",43),E(),r(),a(34,"spk-toggle",21),T(35,13),m(36,"input",44),E(),r(),a(37,"spk-toggle",21),T(38,14),m(39,"input",45),E(),r(),a(40,"spk-toggle",21),T(41,15),m(42,"input",46),E(),r(),a(43,"spk-toggle",21),T(44,16),m(45,"input",47),E(),r(),a(46,"spk-toggle",21),T(47,17),m(48,"input",48),E(),r()()(),B()}if(t&2){let e=p();s(20),_("displayFn",e.displayFn),s(2),w(e.unitOptions),s(2),_("disallowToggle",!0)}}var j=new ee,qt=[{key:"s",label:$localize`Seconds`},{key:"m",label:$localize`Minutes`},{key:"h",label:$localize`Hours`},{key:"D",label:$localize`Days`},{key:"W",label:$localize`Weeks`},{key:"M",label:$localize`Months`},{key:"Y",label:$localize`Years`}],Qt=(t={autoRun:!1,nextTime:{time:"13:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!1,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}})=>j.group({autoRun:j.control(t.autoRun),nextTime:j.group({time:j.control(t.nextTime.time),date:j.control(t.nextTime.date)}),runAgain:j.group({repeatValue:j.control(t.runAgain.repeatValue),repeatUnit:j.control(t.runAgain.repeatUnit),allowedDays:j.group({mon:j.control(t.runAgain.allowedDays.mon),tue:j.control(t.runAgain.allowedDays.tue),wed:j.control(t.runAgain.allowedDays.wed),thu:j.control(t.runAgain.allowedDays.thu),fri:j.control(t.runAgain.allowedDays.fri),sat:j.control(t.runAgain.allowedDays.sat),sun:j.control(t.runAgain.allowedDays.sun)})})}),yt=class t{#e=x(pe);#t=x(ne);#i=x(Se);formRef=Fe.required("formRef");scheduleForm=this.#e.scheduleForm;scheduleFormSignal=this.#e.scheduleFormSignal;unitOptions=qt;displayFn(n){let e=qt.find(i=>i.key===n);return e?`${e.label}`:""}goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#i.parent})}next(){this.#t.navigate(["options"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=J({type:t,selectors:[["app-schedule"]],viewQuery:function(e,i){e&1&&ge(i.formRef,ri,5),e&2&&Ce()},decls:18,vars:2,consts:()=>{let n;n=$localize`Schedule`;let e;e=$localize` Automatically run backups ${"\uFFFD#7\uFFFD\uFFFD/#7\uFFFD"}:TAG_INPUT:`;let i;i=$localize`If a date was missed, the job will run as soon as possible.`;let o;o=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let l;l=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let u;u=$localize`Next time`;let A;A=$localize`Run again every`;let $;$=$localize`Allowed days`;let N;N=$localize` Monday ${"\uFFFD#30\uFFFD\uFFFD/#30\uFFFD"}:TAG_INPUT:`;let q;q=$localize` Tuesday ${"\uFFFD#33\uFFFD\uFFFD/#33\uFFFD"}:TAG_INPUT:`;let Q;Q=$localize` Wednesday ${"\uFFFD#36\uFFFD\uFFFD/#36\uFFFD"}:TAG_INPUT:`;let v;v=$localize` Thursday ${"\uFFFD#39\uFFFD\uFFFD/#39\uFFFD"}:TAG_INPUT:`;let Y;Y=$localize` Friday ${"\uFFFD#42\uFFFD\uFFFD/#42\uFFFD"}:TAG_INPUT:`;let Z;Z=$localize` Saturday ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`;let D;return D=$localize` Sunday ${"\uFFFD#48\uFFFD\uFFFD/#48\uFFFD"}:TAG_INPUT:`,[["formRef",""],["timeRef",""],["dateRef",""],n,e,i,o,l,u,A,$,N,q,Q,v,Y,Z,D,[3,"submit","formGroup"],[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox","formControlName","autoRun"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["formGroupName","nextTime",1,"row-inputs"],["for","time"],["type","time","id","time","formControlName","time",3,"focus"],["suffix",""],["for","date"],["type","date","id","date","formControlName","date",3,"focus"],["formGroupName","runAgain"],[1,"row-inputs"],["for","repeatValue"],["type","number","id","repeatValue","formControlName","repeatValue"],[3,"displayFn"],["type","text","id","repeatUnit","formControlName","repeatUnit"],[3,"value"],["formGroupName","allowedDays",3,"disallowToggle"],["title",""],[1,"days-wrap"],["type","checkbox","formControlName","mon"],["type","checkbox","formControlName","tue"],["type","checkbox","formControlName","wed"],["type","checkbox","formControlName","thu"],["type","checkbox","formControlName","fri"],["type","checkbox","formControlName","sat"],["type","checkbox","formControlName","sun"]]},template:function(e,i){if(e&1){let o=P();a(0,"form",18,0),C("submit",function(){return f(o),S(i.next())}),a(2,"h3",19),k(3,3),r(),a(4,"div",20)(5,"spk-toggle",21),T(6,4),m(7,"input",22),E(),r(),a(8,"p"),k(9,5),r()(),F(10,si,49,2),a(11,"div",23)(12,"button",24),C("click",function(){return f(o),S(i.goBack())}),T(13,6),m(14,"spk-icon"),E(),r(),a(15,"button",25),T(16,7),m(17,"spk-icon"),E(),r()()()}if(e&2){let o;_("formGroup",i.scheduleForm),s(10),g((o=i.scheduleFormSignal())!=null&&o.autoRun?10:-1)}},dependencies:[Ne,Ee,ie,Re,we,oe,Te,De,he,ve,ae,le,se,be,re,Ge,Ve],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};function li(t,n){if(t&1&&(a(0,"spk-option",2),c(1),r()),t&2){let e=n.$implicit;_("value",e.value),s(),b(e.key)}}function pi(t,n){if(t&1&&(a(0,"spk-option",2),c(1),r()),t&2){let e=n.$implicit;_("value",e.value),s(),b(e.key)}}function ci(t,n){if(t&1){let e=P();a(0,"spk-select",0)(1,"input",5),C("ngModelChange",function(o){f(e);let l=p(2);return S(l.updateStateExpression(o))}),r(),M(2,pi,2,2,"spk-option",2,I),r()}if(t&2){let e,i=p(2);_("hideClearButton",!0)("displayFn",i.displayFn),s(),_("ngModel",(e=i.pathState())==null?null:e.expression),s(),w(i.fileGroupOptions())}}function _i(t,n){if(t&1){let e=P();a(0,"spk-form-field")(1,"input",5),C("ngModelChange",function(o){f(e);let l=p(2);return S(l.updateStateExpression(o))}),r()()}if(t&2){let e,i=p(2);s(),_("ngModel",(e=i.pathState())==null?null:e.expression)}}function mi(t,n){if(t&1){let e=P();a(0,"spk-select",0)(1,"input",1),C("ngModelChange",function(o){f(e);let l=p();return S(l.updateStateType(o))}),r(),M(2,li,2,2,"spk-option",2,I),r(),F(4,ci,4,3,"spk-select",0)(5,_i,2,1,"spk-form-field"),a(6,"div",3),C("click",function(){f(e);let o=p();return S(o.removeFilter())}),a(7,"spk-icon",4),c(8,"x-circle"),r()()}if(t&2){let e,i,o=p();_("hideClearButton",!0)("displayFn",o.displayFn),s(),_("ngModel",(e=o.pathState())==null?null:e.type),s(),w(o.expressionOptions()),s(2),g(((i=o.pathState())==null?null:i.type)==="-FileGroup"||((i=o.pathState())==null?null:i.type)==="+FileGroup"?4:5)}}var Yt=[{key:"Excludes folders where name contains",value:"-FolderNameIncludes"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileNameIncludes"},{key:"Excludes file extension",value:"-Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Excludes file group",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"}],ui=[{key:"Applications",value:"Applications"},{key:"CacheFiles",value:"Cache Files"},{key:"TemporaryFiles",value:"Temporary Files"},{key:"OperatingSystem",value:"Operating System"},{key:"SystemFiles",value:"System Files"},{key:"DefaultExcludes",value:"Standard Excludes"}],Ct=class t{path=it.required();pathChange=Ze();remove=Ze();expressionOptions=O(Yt);fileGroupOptions=O(ui);pathState=O(null);typeState=V(()=>{let n=this.pathState();return n?n.type:null});pathEffect=rt(()=>{let n=this.path(),e=n.slice(1),i=n.startsWith("-")?"-":"+";return e.startsWith("/")&&e.endsWith("/")?this.pathState.set({type:`${i}Folder`,path:e,expression:e}):e.startsWith("*")&&e.endsWith("*/")?this.pathState.set({type:`${i}FolderNameIncludes`,path:e,expression:e.slice(1,-2)}):e.startsWith("[.*")&&e.endsWith("[^\\/]*]")?this.pathState.set({type:`${i}FileNameIncludes`,path:e,expression:e.slice(3,-7)}):e.startsWith("{")&&e.endsWith("}")?this.pathState.set({type:`${i}FileGroup`,path:e,expression:e.slice(1,-1)}):e.startsWith("[")&&e.endsWith("]")?this.pathState.set({type:`${i}Regex`,path:e,expression:e.slice(1,-1)}):e.startsWith("*.")?this.pathState.set({type:`${i}Extension`,path:e,expression:e.slice(2)}):this.pathState.set({type:`${i}Expression`,path:e,expression:e})});updateStateType(n){this.pathState.update(e=>(e.type=n,e.path=this.#t(e),e)),this.#e()}updateStateExpression(n){this.pathState.update(e=>(e.expression=n,e.path=this.#t(e),e)),this.#e()}#e(){setTimeout(()=>this.pathChange.emit(this.pathState().path))}#t(n){let e=n.type.slice(0,1),i=n.type.slice(1);if(i==="Folder"){let o=n.expression.endsWith("/"),l=n.expression.startsWith("/");return o&&l?`${e}${n.expression}`:o?`${e}${n.expression}/`:l?`${e}/${n.expression}`:`${e}/${n.expression}/`}return i==="FolderNameIncludes"?`${e}*${n.expression}*/`:i==="FileNameIncludes"?`${e}[.*${n.expression}[^\\/]*]`:i==="FileGroup"?`${e}{${n.expression}}`:i==="Regex"?`${e}[${n.expression}]`:i==="Extension"?`${e}*.${n.expression}`:`${e}${n.expression}`}removeFilter(){this.remove.emit()}displayFn(n){let e=Yt.find(i=>i.value===n);return e?e.key:""}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=J({type:t,selectors:[["app-filter"]],inputs:{path:[1,"path"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:1,vars:1,consts:()=>{let n;return n=$localize`Select an option...`,[[3,"hideClearButton","displayFn"],["type","text","placeholder",n,3,"ngModelChange","ngModel"],[3,"value"],[1,"filter-removal",3,"click"],[1,"spk-primary"],["type","text",3,"ngModelChange","ngModel"]]},template:function(e,i){e&1&&F(0,mi,9,4),e&2&&g(i.pathState()?0:-1)},dependencies:[ct,ie,oe,bt,le,se,re,ae],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] spk-select[_ngcontent-%COMP%]{--miw: initial}[_nghost-%COMP%] .filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var di=["formRef"];function Fi(t,n){if(t&1){let e=P();a(0,"app-filter",42),C("pathChange",function(o){let l=f(e).$index,u=p(2);return S(u.patchPathAt(o,l))})("remove",function(){let o=f(e).$index,l=p(2);return S(l.removePathAt(o))}),r()}if(t&2){let e=n.$implicit;_("path",e)}}function gi(t,n){if(t&1&&M(0,Fi,1,1,"app-filter",41,I),t&2){let e=p();w(e.pathArray())}}function Ci(t,n){if(t&1&&(a(0,"spk-option",45),c(1),r()),t&2){let e=n.$implicit;_("value",e),s(),b(e)}}function fi(t,n){if(t&1&&(a(0,"div",40)(1,"spk-form-field"),m(2,"input",43),r(),a(3,"spk-select"),m(4,"input",44),M(5,Ci,2,2,"spk-option",45,I),r()()),t&2){let e=p();s(5),w(e.sizeOptions())}}var Ie=new ee,Si=["Bytes","KB","MB","GB","TB","PB"],Zt=(t={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>Ie.group({path:Ie.control(t.path),excludes:Ie.group({hidden:Ie.control(t.excludes.hidden),system:Ie.control(t.excludes.system),temporary:Ie.control(t.excludes.temporary),filesLargerThan:Ie.group({size:Ie.control(null),unit:Ie.control(null)})})}),Ot=class t{#e=x(pe);#t=x(ne);#i=x(Se);formRef=Fe.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new lt("");filesLargerThan=V(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);sizeOptions=O(Si);pathSignal=W(this.sourceDataForm.controls.path.valueChanges);pathArray=V(()=>this.pathSignal()?.split("\0").filter(n=>n.startsWith("-")||n.startsWith("+"))??[]);addFilter(n="-*"){let e=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(`${e}\0${n}`)}patchPathAt(n,e){let o=this.sourceDataForm.controls.path.value.split("\0").filter(u=>!u.startsWith("-")&&!u.startsWith("+")).join("\0"),l=this.pathArray().map((u,A)=>A===e?`${n}`:`${u}`).join("\0");this.sourceDataForm.controls.path.setValue(`${o}\0${l}`)}removePathAt(n){let i=this.sourceDataForm.controls.path.value.split("\0").filter(l=>!l.startsWith("-")&&!l.startsWith("+")).join("\0"),o=this.pathArray().filter((l,u)=>u!==n).join("\0");this.sourceDataForm.controls.path.setValue(`${i}\0${o}`)}getPath(){return this.sourceDataForm.value.path??null}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let n=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(`${n}\0${this.newPathCtrl.value}`),this.newPathCtrl.setValue("")}goBack(){this.#t.navigate(["destination"],{relativeTo:this.#i.parent})}next(){this.#t.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=J({type:t,selectors:[["app-source-data"]],viewQuery:function(e,i){e&1&&ge(i.formRef,di,5),e&2&&Ce()},decls:55,vars:12,consts:()=>{let n;n=$localize`Path`;let e;e=$localize`Add a direct path`;let i;i=$localize`Hidden files`;let o;o=$localize`System files`;let l;l=$localize`Temporary files`;let u;u=$localize`Source Data`;let A;A=$localize`Folder path`;let $;$=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let N;N=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let q;q=$localize`Source Data`;let Q;Q=$localize`Add Path`;let v;v=$localize`Add a path directly from your machine.`;let Y;Y=$localize`Filters`;let Z;Z=$localize`Customize your filters.`;let D;D=$localize`Add filter`;let d;d=$localize`Exclude`;let h;h=$localize`Choose if there’s any files you want to exclude.`;let H;H=$localize` Hidden files ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`;let y;y=$localize` System files ${"\uFFFD#48\uFFFD\uFFFD/#48\uFFFD"}:TAG_INPUT:`;let ue;ue=$localize` Temporary files ${"\uFFFD#51\uFFFD\uFFFD/#51\uFFFD"}:TAG_INPUT:`;let Oe;Oe=$localize` Files larger than `;let Le;return Le=$localize`Select an option...`,[["formRef",""],u,A,$,N,q,Q,v,Y,Z,D,d,h,H,y,ue,Oe,[3,"submit","formGroup"],[1,"left"],[1,"title-30"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",n,"formControlName","path"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],["description",""],[1,"row-inputs"],["type","text","placeholder",e,3,"formControl"],["spk-button","","type","button",1,"raised","primary",3,"click"],["type","button","spk-button","","action","",3,"click"],["formGroupName","excludes",3,"disallowToggle"],[1,"raised","primary"],["type","checkbox","placeholder",i,"formControlName","hidden"],["type","checkbox","placeholder",o,"formControlName","system"],["type","checkbox","placeholder",l,"formControlName","temporary"],[1,"raised","primary",3,"click"],["formGroupName","filesLargerThan",1,"row-inputs"],[3,"path"],[3,"pathChange","remove","path"],["type","number","formControlName","size"],["type","text","formControlName","unit","placeholder",Le],[3,"value"]]},template:function(e,i){if(e&1){let o=P();a(0,"form",17,0),C("submit",function(){return f(o),S(i.next())}),a(2,"div",18)(3,"h3",19),k(4,1),r(),a(5,"app-file-tree",20)(6,"label",21),k(7,2),r(),m(8,"input",22),r(),a(9,"div",23)(10,"button",24),C("click",function(){return f(o),S(i.goBack())}),T(11,3),m(12,"spk-icon"),E(),r(),a(13,"button",25),T(14,4),m(15,"spk-icon"),E(),r()()(),a(16,"div",26)(17,"h3",19),k(18,5),r(),a(19,"app-toggle-card",27),U(20,28),k(21,6),B(),a(22,"p",29),k(23,7),r(),a(24,"div",30)(25,"spk-form-field"),m(26,"input",31),r(),a(27,"button",32),C("click",function(){return f(o),S(i.addNewPath())}),a(28,"spk-icon"),c(29,"plus"),r()()()(),a(30,"app-toggle-card",27),U(31,28),k(32,8),B(),a(33,"p",29),k(34,9),r(),a(35,"button",33),C("click",function(){return f(o),S(i.addFilter())}),k(36,10),r(),F(37,gi,2,0),r(),a(38,"app-toggle-card",34),U(39,28),k(40,11),B(),a(41,"p",29),k(42,12),r(),a(43,"spk-toggle",35),T(44,13),m(45,"input",36),E(),r(),a(46,"spk-toggle",35),T(47,14),m(48,"input",37),E(),r(),a(49,"spk-toggle",35),T(50,15),m(51,"input",38),E(),r(),a(52,"spk-toggle",39),C("click",function(){return f(o),S(i.toggleFilesLargerThan())}),k(53,16),r(),F(54,fi,7,0,"div",40),r()()()}if(e&2){let o;_("formGroup",i.sourceDataForm),s(5),_("multiSelect",!0)("startingPath",i.getPath())("showFiles",!0),s(14),_("disallowToggle",!0),s(7),_("formControl",i.newPathCtrl),s(4),_("disallowToggle",!0),s(7),g((o=i.pathSignal())!=null&&o.length?37:-1),s(),_("disallowToggle",!0),s(14),Pe("active",i.filesLargerThan()),s(2),g(i.filesLargerThan()?54:-1)}},dependencies:[ct,Ee,ie,Re,we,oe,Te,Ne,pt,De,he,ve,ae,se,re,Ge,le,be,We,Ve,Ct],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-level-40)}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.5rem}"],changeDetection:0})};var me=new ee,pe=class t{#e=x(ne);#t=x(st);#i=x(Xe);#o=x(dt);generalForm=Wt();sourceDataForm=Zt();scheduleForm=Qt();destinationForm=Jt();optionsForm=jt();isDraft=O(!1);backupId=O(null);isSubmitting=O(!1);finishedLoading=O(!1);backupDefaults=O(null);isNew=V(()=>this.backupId()==="new");selectedOptions=O([]);selectedAdvancedFormPair=O([]);destinationFormPair=O({oauthField:null,custom:[],dynamic:[],advanced:[]});notSelectedAdvancedFormPair=V(()=>{let n=this.destinationFormPair()?.advanced??[],e=this.selectedAdvancedFormPair()??[];return n.filter(i=>e.findIndex(o=>o.name===i.name)===-1)});selectedHttpOptions=O([]);notSelectedHttpOptions=V(()=>{let n=this.httpOptions(),e=this.selectedHttpOptions()??[];return n.filter(i=>e.findIndex(o=>o.name===i.name)===-1)});sourceDataFormSignal=W(this.sourceDataForm.valueChanges);destinationFormSignal=W(this.destinationForm.valueChanges);generalFormSignal=W(this.generalForm.valueChanges);encryptionFieldSignal=W(this.generalForm.controls.encryption.valueChanges);scheduleFormSignal=W(this.scheduleForm.valueChanges);destinationOptions=V(()=>this.#t.backendModules()??[]);httpOptions=V(()=>this.#t.systemInfo()?.GenericModules?.find(n=>n.Key==="http-options")?.Options?.map(this.#n)??[]);advancedOptions=V(()=>this.#t.systemInfo()?.Options?.map(this.#n)??[]);#n(n){return{name:n.Name,type:n.Type,shortDescription:n.ShortDescription??void 0,longDescription:n.LongDescription??void 0,options:n.ValidValues}}encryptionOptions=V(()=>{let n=this.#t.systemInfo()?.EncryptionModules??[];return[Nt,...n]});nonSelectedOptions=V(()=>this.advancedOptions().sort((n,e)=>n?.name&&e?.name?n?.name.localeCompare(e?.name):0).filter(n=>this.selectedOptions()?.findIndex(e=>e.name===n.name)===-1));addAdvancedFormPairByName(n,e,i){let o=this.notSelectedAdvancedFormPair().find(l=>l.name===n);o&&this.addAdvancedFormPair(o,e,i)}addHttpOptionByName(n,e,i){let o=this.notSelectedHttpOptions().find(l=>l.name===n);o&&this.addHttpOption(o,e,i)}addAdvancedFormPair(n,e,i){let o=this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced,l=i??n.defaultValue;this.createFormField(o,n,l),this.selectedAdvancedFormPair.set([...this.selectedAdvancedFormPair(),n])}addHttpOption(n,e,i){let o=this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced,l=i??n.defaultValue;this.createFormField(o,n,l),this.selectedHttpOptions.set([...this.selectedHttpOptions(),n])}removeAdvancedFormPair(n,e){this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced.removeControl(n.name),this.selectedAdvancedFormPair().findIndex(o=>o.name===n.name)!==-1?this.selectedAdvancedFormPair.update(o=>(o=o.filter(l=>l.name!==n.name),o)):this.selectedHttpOptions.update(o=>(o=o.filter(l=>l.name!==n.name),o))}removeHttpOption(n,e){this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced.removeControl(n.name),this.selectedHttpOptions.update(i=>(i=i.filter(o=>o.name!==n.name),i))}submit(){this.isSubmitting.set(!0);let n=this.#l(),e=this.backupId();e==="new"||!e||this.isDraft()?this.#i.postApiV1Backups({requestBody:n}).pipe(Ye(()=>this.isSubmitting.set(!1))).subscribe({next:i=>{console.log("submitted res",i),this.exit()},error:i=>{console.error("submitted error",i)}}):this.#i.putApiV1BackupById({id:e,requestBody:n}).pipe(Ye(()=>this.isSubmitting.set(!1))).subscribe({next:i=>{console.log("submitted res",i),this.exit()},error:i=>{console.error("submitted error",i)}})}exit(){this.#c(),this.#e.navigate(["/"])}updateFieldsFromTargetUrl(n){this.#r(),setTimeout(()=>{this.#s(n)})}#r(){this.destinationFormPair.set({oauthField:null,custom:[],dynamic:[],advanced:[]}),this.selectedAdvancedFormPair.set([]),this.selectedHttpOptions.set([]),this.destinationForm.controls.destinations.clear(),this.destinationForm.reset()}mapSourceDataToForm(n){let e=n.Sources??"",i=n.Filters?.map(N=>`${N.Include?"":"-"}${N.Expression}`)??[],o=n.Settings?.find(N=>N.Name==="--exclude-files-attributes")?.Value??"",l=n.Settings?.find(N=>N.Name==="--skip-files-larger-than")??null,u=l?.Value.replace(/[0-9]/g,"")??null,A=l?.Value.replace(/[^0-9]/g,"")??null,$={path:[...e,...i].join("\0"),excludes:{hiddenFiles:o.includes("hidden"),systemFiles:o.includes("system"),tempFiles:o.includes("temporary"),filesLargerThan:u&&A?{size:parseInt(A),unit:u.toUpperCase()}:null}};this.sourceDataForm.patchValue($)}mapDestinationToForm(n){let e=n.TargetURL?Dt(n.TargetURL):null;e&&this.addDestinationFormGroup(e.destinationType,{custom:e.custom,dynamic:e.dynamic,advanced:e.advanced},!0)}#s(n){let e=Dt(n);e&&this.addDestinationFormGroup(e.destinationType,{custom:e.custom,dynamic:e.dynamic,advanced:e.advanced},!0)}mapGeneralToForm(n){let e=n.Settings?.find(l=>l.Name==="encryption-module"),i=e?.Value&&e.Value.length?e.Value:"",o={name:n.Name??"",description:n.Description??""};i&&i!==""&&(o.encryption=i),this.generalForm.patchValue(o)}mapScheduleToForm(n){if(!n){this.scheduleForm.patchValue({autoRun:!0});return}let e=this.#o.fromString(n.Repeat)??null,o={nextTime:this.#p(n.Time),runAgain:{repeatValue:e?.value??1,repeatUnit:e?.unit??"D",allowedDays:{mon:n.AllowedDays?.includes("mon")??!1,tue:n.AllowedDays?.includes("tue")??!1,wed:n.AllowedDays?.includes("wed")??!1,thu:n.AllowedDays?.includes("thu")??!1,fri:n.AllowedDays?.includes("fri")??!1,sat:n.AllowedDays?.includes("sat")??!1,sun:n.AllowedDays?.includes("sun")??!1}}};this.scheduleForm.patchValue(o)}mapOptionsToForms(n){let e=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than"],i=this.advancedOptions();n.Settings?.forEach(o=>{if(o.Name==="encryption-module")return this.generalForm.controls.encryption.setValue(o.Value??"");if(!(o.Name&&e.includes(o.Name))){if(o.Name==="dblock-size"){let l=o.Value?.replace(/[^0-9]/g,""),u=o.Value?.replace(/[0-9]/g,"");return this.optionsForm.controls.remoteVolumeSize.setValue({size:l?parseInt(l):null,unit:u?u.toUpperCase():null})}if(o.Name&&o.Value){let l=i.find(u=>u.name===o.Name);if(!l)return;this.addOptionToFormGroup(l,o.Value)}}})}getCurrentTargetUrl(){return this.#a(this.destinationForm.controls.destinations)}#l(){let n=this.generalForm.value,e=this.optionsForm.value,i=this.scheduleForm.value,o=this.sourceDataForm.value,u=this.destinationForm.value.destinations?.length?this.#a(this.destinationForm.controls.destinations):[],A=null;i.runAgain?.repeatUnit&&i.runAgain?.repeatValue&&(A=this.#o.toString(i.runAgain.repeatValue,i.runAgain.repeatUnit));let $=i.runAgain?.allowedDays?Object.entries(i.runAgain?.allowedDays).filter(([d,h])=>h).map(([d,h])=>d):[],N=o.path?.split("\0")??[],q=n.encryption===""?{Name:"--no-encryption",Value:"True"}:{Name:"encryption-module",Value:n.encryption??null},Q=this.advancedOptions(),v=Object.entries(e.advancedOptions??{}).filter(([d,h])=>d&&h).map(([d,h])=>{let H=Q.find(y=>y.name===d);return H?.type==="Size"?{Name:d,Value:`${h.size}${h.unit.toLowerCase()}`}:H?.type==="Integer"?{Name:d,Value:h.toString()}:H?.type==="Boolean"?{Name:d,Value:h.toString()}:{Name:d,Value:h}}),Y=[q,...v],Z=Object.entries(o.excludes??{}).filter(([d,h])=>h&&d!=="filesLargerThan").map(([d])=>d),D=o.excludes?.filesLargerThan;return Z.length&&Y.push({Name:"--exclude-files-attributes",Value:Z.join(",")}),D&&D.size!==null&&D.unit!==null&&Y.push({Name:"--skip-files-larger-than",Value:`${D.size}${D.unit}`}),{Backup:{Name:n.name,Description:n.description,TargetURL:u[0]??null,Sources:N.filter(d=>!d.startsWith("-")),Settings:Y,Filters:N.filter(d=>d.startsWith("-")).map((d,h)=>({Order:h,Include:!1,Expression:d.slice(1)}))},Schedule:i.autoRun?{Repeat:A,Time:i.nextTime?.date?new Date(`${i.nextTime.date}T${i.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:$}:null}}#a(n){return n.controls.map(e=>Ft(e.value))}#p(n){if(!n||n?.indexOf("T")===-1)return{time:n??"13:00"};let e=new Date(n),i={time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`};return n.indexOf("T")!==-1&&(i.date=e.toISOString().split("T")[0]),i}removeOptionFromFormGroup(n){let e=n.name;e&&(this.optionsForm.controls.advancedOptions.removeControl(e),this.selectedOptions.update(i=>(i=i.filter(o=>o.name!==e),i)))}addOptionToFormGroup(n,e){let i=this.optionsForm.controls.advancedOptions;this.createFormField(i,n,e??n.defaultValue),this.selectedOptions.update(o=>(o.push(n),o))}createFormField(n,e,i){if(e.type==="String"||e.type==="FileTree"||e.type==="FolderTree"||e.type==="Password"||e.type==="Enumeration"||e.type==="NonValidatedSelectableString"||e.type==="Path"){n.addControl(e.name,me.control(i));return}if(e.type==="Size"){let o=i.replace(/[0-9]/g,""),l=i.replace(/[^0-9]/g,"");n.addControl(e.name,me.group({size:me.control(l?parseInt(l):50),unit:me.control(o?o.toUpperCase():"MB")}));return}if(e.type==="Integer"){n.addControl(e.name,me.control(i?parseInt(i):0));return}if(e.type==="Boolean"){n.addControl(e.name,me.control(i==="true"));return}if(e.type==="Flags"){n.addControl(e.name,me.control(i??""));return}if(e.type==="Timespan"){n.addControl(e.name,me.control(i,[xe.pattern(/([-+]?\d{1,3}[smhDWMY])+/)]));return}}addDestinationFormGroup(n,e,i=!1){let o=this.destinationOptions().find(D=>D.Key===n),l=this.httpOptions();if(!o||!o.Options)return;let u=ye.hasOwnProperty(n)&&ye[n],A=u&&u.oauthField?u.oauthField:null,$=u&&u.customFields?u.customFields:{},N=u&&u.dynamicFields?u.dynamicFields:[],q=u&&u.advancedFields?u.advancedFields:[],Q=u&&u.ignoredAdvancedFields?u.ignoredAdvancedFields:[];this.destinationFormPair.set({oauthField:A,custom:[],dynamic:[],advanced:[]});let v=me.group({}),Y=me.group({}),Z=me.group({});$&&Object.entries($).forEach(([D,d],h)=>{let ue=d,{formElement:H}=ue,y=kt(ue,["formElement"]);v.addControl(D,H(e?.custom[D])),this.destinationFormPair.update(Oe=>(Oe.custom.push(z({order:900+h},y)),Oe))});for(let D=0;D<o.Options.length;D++){let d=o.Options[D];if(d.Deprecated)continue;let h=N.find(H=>H===d.Name||H.name===d.Name);if(h){let H=h&&typeof h!="string",y={name:d.Name,type:d.Type,shortDescription:d.ShortDescription??void 0,longDescription:d.LongDescription??void 0,options:d.ValidValues,order:900+D},ue=H?z(z({},y),h):y,Le=e?.dynamic[d.Name]??d.DefaultValue;this.createFormField(Y,ue,Le),this.destinationFormPair.update(R=>(R.dynamic.push(ue),R))}else{if(Q.find(de=>de===d.Name))continue;let y=q.find(de=>de===d.Name||de.name===d.Name),ue=y&&typeof y!="string",Oe=e?.advanced[d.Name],Le=Oe??d.DefaultValue,R={name:d.Name,type:d.Type,shortDescription:d.ShortDescription??void 0,longDescription:d.LongDescription??void 0,options:d.ValidValues,defaultValue:Le,order:900+D},Tt=ue?z(z({},R),y):R;i&&Oe&&(this.createFormField(Z,Tt,Le),this.selectedAdvancedFormPair.update(de=>(de.push(Tt),de))),this.destinationFormPair.update(de=>(de.advanced.push(Tt),de))}}for(let D=0;D<l.length;D++){let d=l[D],h=e?.advanced[d.name],H=h??d.defaultValue;i&&h&&(this.createFormField(Z,d,H),this.selectedHttpOptions.update(y=>(y.push(d),y)))}this.destinationFormPair.update(D=>({oauthField:D.oauthField,custom:D.custom.sort((d,h)=>d.order-h.order),dynamic:D.dynamic.sort((d,h)=>d.order-h.order),advanced:D.advanced.sort((d,h)=>d.order-h.order)})),this.destinationForm.controls.destinations.push(en({key:o.Key,customGroup:v,dynamicGroup:Y,advancedGroup:Z}))}#c(){this.generalForm.reset(),this.destinationForm.controls.destinations.clear(),this.destinationForm.reset(),this.sourceDataForm.reset(),this.scheduleForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=Me({token:t,factory:t.\u0275fac,providedIn:"root"})};var Ti=["formRef"],Ei=(t,n,e,i)=>({index:t,formView:n,formGroupName:"custom",destinationType:e,oauthField:i}),St=t=>({$implicit:t}),Di=(t,n,e,i)=>({index:t,formView:n,formGroupName:"dynamic",destinationType:e,oauthField:i}),hi=(t,n,e,i)=>({index:t,formView:n,formGroupName:"advanced",destinationType:e,oauthField:i}),Ni=(t,n,e,i)=>({index:t,formView:n,formGroupName:"advanced",asHttpOptions:!0,destinationType:e,oauthField:i}),Ai=()=>({maxWidth:"700px",width:"100%"});function yi(t,n){t&1&&(T(0,2,2),m(1,"spk-icon"),E())}function Oi(t,n){t&1&&k(0,2,3)}function Pi(t,n){if(t&1){let e=P();T(0,2,1),a(1,"button",19),C("click",function(){f(e);let o=p();return S(o.testDestination())}),F(2,yi,2,0)(3,Oi,1,0),r(),E()}if(t&2){let e=p();s(),Pe("success",e.successfulTest()),s(),g(e.successfulTest()?2:3)}}function ki(t,n){if(t&1){let e=P();a(0,"p",25),C("click",function(){f(e);let o=p();return S(o.removeDestinationFormGroup(o.destinationCount()-1))}),T(1,5),m(2,"span",26),E(),r()}}function xi(t,n){t&1&&(a(0,"p"),k(1,6),r())}function $i(t,n){if(t&1){let e=P();a(0,"div",31),C("click",function(){let o=f(e).$implicit,l=p(2);return S(l.addDestinationFormGroup(o.key))}),a(1,"h3"),c(2),r(),a(3,"p"),c(4),r()()}if(t&2){let e=n.$implicit;s(2),b(e.title),s(2),b(e.description)}}function Ii(t,n){if(t&1){let e=P();a(0,"button",32),C("click",function(){let o=f(e).$implicit,l=p(2);return S(l.addDestinationFormGroup(o.key))}),c(1),r()}if(t&2){let e=n.$implicit;s(),G(" ",e.title," ")}}function Mi(t,n){if(t&1&&(a(0,"div",27),M(1,$i,5,2,"div",28,I),r(),a(3,"spk-menu")(4,"button",29),k(5,7),r(),U(6,18),M(7,Ii,2,1,"button",30,I),B(),r()),t&2){let e=p();s(),w(e.destinationTypeOptionsFocused()),s(6),w(e.destinationTypeOptionsNotFocused())}}function wi(t,n){t&1&&Ue(0)}function Ri(t,n){if(t&1&&F(0,wi,1,0,"ng-container",37),t&2){let e,i=n.$implicit,o=n.$index;p();let l=fe(29),u=p();_("ngTemplateOutlet",l)("ngTemplateOutletContext",Be(7,St,tt(2,Ei,o,i,(e=u.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,u.destinationFormPair().oauthField)))}}function vi(t,n){t&1&&Ue(0)}function Gi(t,n){if(t&1&&F(0,vi,1,0,"ng-container",37),t&2){let e,i=n.$implicit,o=n.$index;p();let l=fe(29),u=p();_("ngTemplateOutlet",l)("ngTemplateOutletContext",Be(7,St,tt(2,Di,o,i,(e=u.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,u.destinationFormPair().oauthField)))}}function bi(t,n){if(t&1){let e=P();T(0,8,1),a(1,"button",32),C("click",function(){let o=f(e).$implicit,l=p(2);return S(l.addAdvancedFormPair(o,0))}),r(),E()}if(t&2){let e=n.$implicit;s(),Je(e.name),et(0)}}function Vi(t,n){t&1&&Ue(0)}function Li(t,n){if(t&1&&F(0,Vi,1,0,"ng-container",37),t&2){let e,i=n.$implicit,o=n.$index;p();let l=fe(29),u=p();_("ngTemplateOutlet",l)("ngTemplateOutletContext",Be(7,St,tt(2,hi,o,i,(e=u.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,u.destinationFormPair().oauthField)))}}function Ui(t,n){if(t&1){let e=P();T(0,9,1),a(1,"button",32),C("click",function(){let o=f(e).$implicit,l=p(2);return S(l.addHttpOption(o,0))}),r(),E()}if(t&2){let e=n.$implicit;s(),Je(e.name),et(0)}}function Bi(t,n){t&1&&Ue(0)}function Ki(t,n){if(t&1&&F(0,Bi,1,0,"ng-container",37),t&2){let e,i=n.$implicit,o=n.$index;p();let l=fe(29),u=p();_("ngTemplateOutlet",l)("ngTemplateOutletContext",Be(7,St,tt(2,Ni,o,i,(e=u.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,u.destinationFormPair().oauthField)))}}function zi(t,n){if(t&1&&(a(0,"spk-tooltip",47)(1,"spk-icon"),c(2,"question"),r()()),t&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Xi(t,n){if(t&1&&(a(0,"app-file-tree",40)(1,"label",46),c(2),F(3,zi,3,1,"spk-tooltip",47),r(),m(4,"input",48),r()),t&2){let e,i=p().$implicit,o=p(2);_("startingPath",o.getFormFieldValue(0,i.formGroupName,i.formView.name))("accepts",i.formView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),s(),L("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),s(),G(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),s(),g(i.formView.longDescription?3:-1),s(),L("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),K("formControlName",i.formView.name)}}function Hi(t,n){if(t&1&&(a(0,"spk-tooltip",47)(1,"spk-icon"),c(2,"question"),r()()),t&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Wi(t,n){if(t&1&&(a(0,"app-file-tree",41)(1,"label",46),c(2),F(3,Hi,3,1,"spk-tooltip",47),r(),m(4,"input",48),r()),t&2){let e,i=p().$implicit,o=p(2);_("startingPath",o.getFormFieldValue(0,i.formGroupName,i.formView.name)),s(),L("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),s(),G(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),s(),g(i.formView.longDescription?3:-1),s(),L("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),K("formControlName",i.formView.name)}}function ji(t,n){if(t&1&&(a(0,"spk-tooltip",47)(1,"spk-icon"),c(2,"question"),r()()),t&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function qi(t,n){t&1&&(a(0,"spk-icon",49),c(1,"link"),r())}function Qi(t,n){t&1&&(a(0,"spk-icon",49),c(1,"textbox"),r())}function Yi(t,n){if(t&1&&(a(0,"spk-form-field")(1,"label",46),c(2),F(3,ji,3,1,"spk-tooltip",47),r(),m(4,"input",48),F(5,qi,2,0,"spk-icon",49)(6,Qi,2,0,"spk-icon",49),r()),t&2){let e,i=p().$implicit;s(),L("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),s(),G(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),s(),g(i.formView.longDescription?3:-1),s(),L("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),K("formControlName",i.formView.name),s(),g(i.formView.type==="Path"?5:6)}}function Zi(t,n){if(t&1){let e=P();a(0,"span",53),C("click",function(){f(e);let o=p(2).$implicit,l=p(2);return S(l.oauthStartTokenCreation(o.destinationType))}),c(1,"AuthID"),r()}}function Ji(t,n){t&1&&(a(0,"spk-icon",49),c(1,"password"),r())}function eo(t,n){if(t&1){let e=P();a(0,"spk-icon",54),C("click",function(){f(e);let o=p(2).$implicit;return S(o.formView.showPassword=!o.formView.showPassword)}),c(1," eye "),r()}}function to(t,n){if(t&1){let e=P();a(0,"spk-icon",54),C("click",function(){f(e);let o=p(2).$implicit;return S(o.formView.showPassword=!o.formView.showPassword)}),c(1," eye-slash "),r()}}function no(t,n){if(t&1&&(a(0,"spk-form-field")(1,"label",46),c(2),r(),m(3,"input",50),F(4,Zi,2,0,"span",51)(5,Ji,2,0,"spk-icon",49)(6,eo,2,0,"spk-icon",52)(7,to,2,0,"spk-icon",52),r()),t&2){let e,i=p().$implicit;s(),L("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),s(),G(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),s(),L("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),K("formControlName",i.formView.name),_("type",i.formView.showPassword?"text":"password"),s(),g(i.oauthField===i.formView.name?4:5),s(2),g(i.formView.showPassword?6:7)}}function io(t,n){if(t&1&&(a(0,"spk-tooltip",47)(1,"spk-icon"),c(2,"question"),r()()),t&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function oo(t,n){if(t&1&&(a(0,"spk-option",56),c(1),r()),t&2){let e=n.$implicit;_("value",e),s(),b(e)}}function ro(t,n){if(t&1&&(a(0,"spk-select")(1,"label",46),c(2),F(3,io,3,1,"spk-tooltip",47),r(),m(4,"input",55),M(5,oo,2,2,"spk-option",56,I),r()),t&2){let e,i=p().$implicit;s(),L("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),s(),G(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),s(),g(i.formView.longDescription?3:-1),s(),L("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),K("formControlName",i.formView.name),s(),w(i.formView.options)}}function ao(t,n){if(t&1&&(a(0,"spk-tooltip",47)(1,"spk-icon"),c(2,"question"),r()()),t&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function so(t,n){if(t&1&&(a(0,"spk-option",56),c(1),r()),t&2){let e=n.$implicit;_("value",e.value),s(),$t(" ",e.key," ",e.value?"("+e.value+")":""," ")}}function lo(t,n){if(t&1&&(a(0,"spk-select",42)(1,"label",46),c(2),F(3,ao,3,1,"spk-tooltip",47),r(),m(4,"input",55),U(5,57),M(6,so,2,3,"spk-option",56,I),B(),r()),t&2){let e,i=p().$implicit,o=p(2);_("isFreeText",!0),s(),L("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),s(),G(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),s(),g(i.formView.longDescription?3:-1),s(),L("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),K("formControlName",i.formView.name),s(2),w(i.formView.loadOptions(o.injector)())}}function po(t,n){if(t&1&&(a(0,"spk-tooltip",47)(1,"spk-icon"),c(2,"question"),r()()),t&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function co(t,n){if(t&1&&(a(0,"spk-option",56),c(1),r()),t&2){let e=n.$implicit;_("value",e),s(),b(e)}}function _o(t,n){if(t&1&&(a(0,"div",43)(1,"label",46),c(2),F(3,po,3,1,"spk-tooltip",47),r(),a(4,"div",58)(5,"spk-form-field"),m(6,"input",59),a(7,"spk-icon",49),c(8,"resize"),r()(),a(9,"spk-select"),m(10,"label")(11,"input",60),M(12,co,2,2,"spk-option",56,I),r()()()),t&2){let e,i=p().$implicit,o=p(2);_("formGroupName",i.formView.name),s(),L("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),s(),G(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),s(),g(i.formView.longDescription?3:-1),s(3),L("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),s(6),w(o.sizeOptions())}}function mo(t,n){if(t&1&&(a(0,"spk-tooltip",47)(1,"spk-icon"),c(2,"question"),r()()),t&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function uo(t,n){if(t&1&&(a(0,"spk-form-field")(1,"label",46),c(2),F(3,mo,3,1,"spk-tooltip",47),r(),m(4,"input",61),a(5,"spk-icon",49),c(6,"numpad"),r()()),t&2){let e,i=p().$implicit;s(),L("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),s(),G(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),s(),g(i.formView.longDescription?3:-1),s(),L("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),K("formControlName",i.formView.name)}}function Fo(t,n){if(t&1&&(a(0,"spk-tooltip",47)(1,"spk-icon"),c(2,"question"),r()()),t&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function go(t,n){if(t&1&&(a(0,"spk-toggle",44)(1,"label",46),c(2),F(3,Fo,3,1,"spk-tooltip",47),r(),m(4,"input",62),r()),t&2){let e,i=p().$implicit;s(),L("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),s(),G(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),s(),g(i.formView.longDescription?3:-1),s(),L("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),K("formControlName",i.formView.name)}}function Co(t,n){if(t&1&&(a(0,"spk-tooltip",47)(1,"spk-icon"),c(2,"question"),r()()),t&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function fo(t,n){t&1&&(a(0,"spk-option",64),c(1,"None"),r()),t&2&&_("value","None")}function So(t,n){if(t&1&&(a(0,"spk-option",56),c(1),m(2,"spk-checkbox",65),r()),t&2){let e=p().$implicit;_("value",e),s(),G(" ",e," ")}}function To(t,n){if(t&1&&F(0,fo,2,1,"spk-option",64)(1,So,3,2,"spk-option",56),t&2){let e=n.$implicit;g(e==="None"?0:1)}}function Eo(t,n){if(t&1&&(a(0,"spk-select",45)(1,"label",46),c(2),F(3,Co,3,1,"spk-tooltip",47),r(),m(4,"input",63),M(5,To,2,1,null,null,I),r()),t&2){let e,i=p().$implicit;_("selectMultiple",!0),s(),L("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),s(),G(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),s(),g(i.formView.longDescription?3:-1),s(),K("formControlName",i.formView.name),s(),w(i.formView.options)}}function Do(t,n){if(t&1&&(a(0,"spk-tooltip",47)(1,"spk-icon"),c(2,"question"),r()()),t&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function ho(t,n){if(t&1&&(a(0,"spk-form-field")(1,"label",46),c(2),F(3,Do,3,1,"spk-tooltip",47),r(),m(4,"input",48),r()),t&2){let e,i=p().$implicit;s(),L("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),s(),G(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),s(),g(i.formView.longDescription?3:-1),s(),L("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),K("formControlName",i.formView.name)}}function No(t,n){if(t&1){let e=P();a(0,"button",66),C("click",function(){f(e);let o=p().$implicit,l=p(2);return S(l.removeFormView(o.formView,0))}),a(1,"spk-icon"),c(2,"x-circle"),r()()}}function Ao(t,n){if(t&1&&(a(0,"div",38),U(1,39),F(2,Xi,5,16,"app-file-tree",40)(3,Wi,5,12,"app-file-tree",41)(4,Yi,7,12,"spk-form-field")(5,no,8,13,"spk-form-field")(6,ro,7,11,"spk-select")(7,lo,8,12,"spk-select",42)(8,_o,14,11,"div",43)(9,uo,7,11,"spk-form-field")(10,go,5,11,"spk-toggle",44)(11,Eo,7,8,"spk-select",45)(12,ho,5,11,"spk-form-field"),B(),F(13,No,3,0,"button",29),r()),t&2){let e=n.$implicit;Pe("single-field",e.formGroupName!=="advanced"),s(),_("formGroupName",e.formGroupName),s(),g(e.formView.type==="FileTree"?2:e.formView.type==="FolderTree"?3:e.formView.type==="String"||e.formView.type==="Path"?4:e.formView.type==="Password"?5:e.formView.type==="Enumeration"?6:e.formView.type==="NonValidatedSelectableString"?7:e.formView.type==="Size"?8:e.formView.type==="Integer"?9:e.formView.type==="Boolean"?10:e.formView.type==="Flags"?11:e.formView.type==="Timespan"?12:-1),s(11),g(e.formGroupName==="advanced"?13:-1)}}function yo(t,n){if(t&1&&(U(0,20)(1,33),M(2,Ri,1,9,"ng-container",null,I),M(4,Gi,1,9,"ng-container",null,I),a(6,"app-toggle-card",34),U(7,35),T(8,8),a(9,"spk-menu")(10,"button",36),m(11,"spk-icon"),r(),U(12,18),M(13,bi,2,1,"button",30,I),B(),r(),E(),B(),M(15,Li,1,9,"ng-container",null,I),r(),a(17,"app-toggle-card",34),U(18,35),T(19,9),a(20,"spk-menu")(21,"button",36),m(22,"spk-icon"),r(),U(23,18),M(24,Ui,2,1,"button",30,I),B(),r(),E(),B(),M(26,Ki,1,9,"ng-container",null,I),r(),F(28,Ao,14,5,"ng-template",null,1,ot),B()()),t&2){let e=p();s(2),w(e.destinationFormPair().custom),s(2),w(e.destinationFormPair().dynamic),s(2),_("disallowToggle",!0),s(4),_("disabled",e.notSelectedAdvancedFormPair().length===0),s(3),w(e.notSelectedAdvancedFormPair()),s(2),w(e.selectedAdvancedFormPair()),s(2),_("disallowToggle",!0),s(4),_("disabled",e.notSelectedHttpOptions().length===0),s(3),w(e.notSelectedHttpOptions()),s(2),w(e.selectedHttpOptions())}}function Oo(t,n){if(t&1){let e=P();a(0,"spk-dialog",67),wt("isOpenChange",function(o){f(e);let l=p();return Mt(l.targetUrlDialogOpen,o)||(l.targetUrlDialogOpen=o),S(o)}),a(1,"header",68)(2,"h2"),k(3,10),r(),a(4,"spk-alert",69),k(5,11),r()(),a(6,"div",70)(7,"spk-form-field"),m(8,"textarea",71),r()(),a(9,"footer",72)(10,"button",22),C("click",function(){f(e);let o=p();return S(o.closeTargetUrlDialog(!1))}),c(11,"Cancel"),r(),a(12,"button",73),C("click",function(){f(e);let o=p();return S(o.closeTargetUrlDialog(!0))}),T(13,12),m(14,"spk-icon"),E(),r()()()}if(t&2){let e=p();It("isOpen",e.targetUrlDialogOpen),_("options",Rt(3,Ai)),s(8),_("formControl",e.targetUrlCtrl)}}var Po=["Bytes","KB","MB","GB","TB","PB"],ft=new ee,Jt=(t={destinations:[]})=>ft.group({destinations:ft.array(t.destinations)}),en=({key:t,customGroup:n,dynamicGroup:e,advancedGroup:i})=>ft.group({destinationType:ft.control(t),custom:n,dynamic:e,advanced:i}),Pt=class t{#e=x(ne);#t=x(Se);#i=x(Gt);#o=x(Xe);#n=x(pe);#r=x(Ut);injector=x(xt);formRef=Fe.required("formRef");destinationForm=this.#n.destinationForm;destinationFormPair=this.#n.destinationFormPair;selectedAdvancedFormPair=this.#n.selectedAdvancedFormPair;notSelectedAdvancedFormPair=this.#n.notSelectedAdvancedFormPair;selectedHttpOptions=this.#n.selectedHttpOptions;notSelectedHttpOptions=this.#n.notSelectedHttpOptions;destinationOptions=this.#n.destinationOptions;destinationFormSignal=this.#n.destinationFormSignal;destinationCount=V(()=>this.destinationFormSignal()?.destinations?.length??0);sizeOptions=O(Po);successfulTest=O(!1);destinationTypeOptionsInFocus=O(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=O(Object.entries(ye).map(([n,{title:e,description:i}])=>({key:n,title:e,description:i})));destinationTypeOptionsFocused=V(()=>{let n=this.destinationTypeOptionsInFocus(),e=this.destinationTypeOptions();return n.map(i=>e.find(o=>o.key===i))});destinationTypeOptionsNotFocused=V(()=>{let n=this.destinationTypeOptionsInFocus();return this.destinationTypeOptions().filter(i=>!n.includes(i.key))});getFormFieldValue(n,e,i){return((this.destinationForm.controls.destinations.controls?.[n]).controls?.[e]).controls[i].value}addDestinationFormGroup(n){this.#n.addDestinationFormGroup(n)}addAdvancedFormPair(n,e){this.#n.addAdvancedFormPair(n,e)}removeFormView(n,e){this.#n.removeAdvancedFormPair(n,e)}addHttpOption(n,e){this.#n.addHttpOption(n,e)}targetUrl=V(()=>this.#n.getCurrentTargetUrl()[0]);targetUrlCtrl=new lt;targetUrlInitial=O(null);targetUrlDialogOpen=O(!1);openTargetUrlDialog(){let e=this.#n.getCurrentTargetUrl()[0];this.targetUrlCtrl.setValue(e),this.targetUrlInitial.set(e),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl.value,i=this.targetUrlInitial();!n||e===i||this.#n.updateFieldsFromTargetUrl(this.targetUrlCtrl.value)}testDestination(n=0){let i=this.#n.getCurrentTargetUrl()[n];i&&this.#o.postApiV1RemoteoperationTest({requestBody:{path:i}}).subscribe({next:()=>{this.successfulTest.set(!0),setTimeout(()=>{this.successfulTest.set(!1)},3e3)},error:o=>{let l=o.error.error.Error;if(l==="missing-folder"&&this.#r.open(Ke,{data:{title:$localize`Create folder`,message:$localize`The remote destination folder does not exist, do you want to create it?`},closed:u=>{u&&this.#o.postApiV1RemoteoperationCreate({requestBody:{path:i}}).subscribe()}}),l.startsWith("incorrect-cert:")){let u=l.split("incorrect-cert:")[1];this.#r.open(Ke,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
2
+ If this is a self-signed certificate, you can choose to trust this certificate.
3
+ The server reported the certificate hash: ${u}`,confirmText:"Trust the certificate",cancelText:"Cancel"},closed:A=>{A&&this.#n.addHttpOptionByName("accept-specified-ssl-hash",u)}})}if(l.startsWith("incorrect-host-key:")){let u=l.split('incorrect-host-key:"')[1].split('",')[0],A=l.split('accepted-host-key:"')[1].split('",')[0];A?this.#r.open(Ke,{maxWidth:"500px",data:{title:"The host key has changed",message:`The host key has changed, please check with the server administrator if this is correct,
4
+ otherwise you could be the victim of a MAN-IN-THE-MIDDLE attack.
5
+ Do you want to REPLACE your CURRENT host key ${A}
6
+ with the REPORTED host key: ${u}?`,confirmText:"Approve",cancelText:"Cancel"},closed:$=>{$&&this.#n.addAdvancedFormPairByName("ssh-fingerprint",n,u)}}):this.#r.open(Ke,{maxWidth:"500px",data:{title:"Approve host key?",message:`No certificate was specified, please verify that the reported host key is correct: ${u}`,confirmText:"Approve",cancelText:"Cancel"},closed:$=>{$&&this.#n.addAdvancedFormPairByName("ssh-fingerprint",n,u)}})}}})}mapToTargetUrl(n){return Ft(n.value)}removeDestinationFormGroup(n){this.destinationForm.controls.destinations.removeAt(n)}displayFn(n){let e=this.destinationOptions().find(i=>i.Key===n);return e?`${e.DisplayName}`:""}goBack(){this.#e.navigate(["general"],{relativeTo:this.#t.parent})}next(){this.#e.navigate(["source-data"],{relativeTo:this.#t.parent})}#s=O("https://duplicati-oauth-handler.appspot.com/").asReadonly();#l=O(Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2)).asReadonly();#a=O(!1);#p=O(null);keyCreation(){}oauthStartTokenCreation(n){this.#a.set(!0);let e=450,i=600,o=this.#s()+"?type="+n+"&token="+this.#l(),l=screen.width/2-e/2,u=screen.height/2-i/2,A=window.open(o,"_blank","height="+i+",width="+e+",menubar=0,status=0,titlebar=0,toolbar=0,left="+l+",top="+u);A?.addEventListener("blur",$=>{console.log("event blur",$)}),A?.addEventListener("beforeunload",$=>{console.log("event beforeunload",$),this.#i.get(this.#s()+"fetch?callback=JSON_CALLBACK",{params:{token:this.#l()}}).pipe(Ye(()=>this.#a.set(!1))).subscribe({next:N=>{console.log("res",N),N?.authid&&this.#p.set(N.authid)}})})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=J({type:t,selectors:[["app-destination"]],viewQuery:function(e,i){e&1&&ge(i.formRef,Ti,5),e&2&&Ce()},decls:25,vars:6,consts:()=>{let n;n=$localize` Backup destination ${"\uFFFD#5\uFFFD"}:START_TAG_DIV:${"\uFFFD*6:1\uFFFD"}:START_BLOCK_IF_1:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON:${"\uFFFD*2:2\uFFFD"}:START_BLOCK_IF: Connected ${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/*2:2\uFFFD|\uFFFD/*6:1\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*3:3\uFFFD"}:START_BLOCK_ELSE: Test destination ${"\uFFFD/*3:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*2:2\uFFFD|\uFFFD/*6:1\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD#7\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:dots-three-vertical${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#10\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD#11\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:link${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SPK_MENU:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_DIV:`,n=ke(n);let e;e=$localize`${"\uFFFD#20\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#20\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let i;i=$localize`${"\uFFFD#23\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#23\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let o;o=$localize` Want to select another destination? ${"\uFFFD#2\uFFFD"}:START_TAG_SPAN:Click here${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPAN:`;let l;l=$localize`More destinations are coming soon.`;let u;u=$localize`Other destinations`;let A;A=$localize` Advanced options ${"\uFFFD#9\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#10\uFFFD"}:START_TAG_BUTTON: Add advanced option ${"\uFFFD#11\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#10\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#12\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD*14:1\uFFFD"}:START_BLOCK_FOR:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON_1: ${"\uFFFD0:1\uFFFD"}:INTERPOLATION: ${"[\uFFFD/#10\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/*14:1\uFFFD"}:CLOSE_BLOCK_FOR:${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_MENU:`,A=ke(A);let $;$=$localize` Http options ${"\uFFFD#20\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#21\uFFFD"}:START_TAG_BUTTON: Add http option ${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#21\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#23\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD*25:1\uFFFD"}:START_BLOCK_FOR:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON_1: ${"\uFFFD0:1\uFFFD"}:INTERPOLATION: ${"[\uFFFD/#21\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/*25:1\uFFFD"}:CLOSE_BLOCK_FOR:${"\uFFFD/#23\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#20\uFFFD"}:CLOSE_TAG_SPK_MENU:`,$=ke($);let N;N=$localize`Edit target URL`;let q;q=$localize` Be careful, this will overwrite everything you have in your destination. `;let Q;return Q=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SPK_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],["fieldTemplate",""],n,e,i,o,l,u,A,$,N,q,Q,[3,"submit","formGroup"],[1,"title-30"],[1,"actions"],["spk-button","","type","button",1,"small",3,"success"],["spk-button","","type","button",1,"small"],["menu",""],["spk-button","","type","button",1,"small",3,"click"],["formArrayName","destinations"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[3,"isOpen","options"],[3,"click"],[1,"spk-primary"],[1,"most-common-destinations"],[1,"tile"],["spk-button","","type","button",1,"outlined"],["item","","type","button"],[1,"tile",3,"click"],["item","","type","button",3,"click"],["formGroupName","0"],[3,"disallowToggle"],["title",""],["spk-button","","type","button",1,"outlined","small",3,"disabled"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"field-row"],[3,"formGroupName"],[3,"startingPath","accepts","showFiles","showHiddenNodes","selectFiles"],[3,"startingPath"],[3,"isFreeText"],[1,"form-column",3,"formGroupName"],[1,"primary","raised"],[1,"primary",3,"selectMultiple"],[3,"for"],[1,"primary",3,"message"],["type","text",3,"id","formControlName"],["prefix",""],["autocomplete","off",3,"type","id","formControlName"],["prefix","",1,"link"],["suffix","",1,"clickable"],["prefix","",1,"link",3,"click"],["suffix","",1,"clickable",3,"click"],["type","search",3,"id","formControlName"],[3,"value"],["options",""],[1,"form-row"],["type","number","formControlName","size",3,"id"],["type","search","formControlName","unit"],["type","number",3,"id","formControlName"],["type","checkbox",3,"id","formControlName"],["type","text","id","text",3,"formControlName"],["deselect","",3,"value"],[1,"raised","primary"],["spk-button","","type","button",1,"outlined",3,"click"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"warning"],["content",""],["id","targetUrl","autocomplete","off",3,"formControl"],["footer",""],["spk-button","","type","submit",1,"raised","primary",3,"click"]]},template:function(e,i){if(e&1){let o=P();a(0,"form",13,0),C("submit",function(){return f(o),S(i.next())}),a(2,"header")(3,"h3",14),T(4,2),a(5,"div",15),F(6,Pi,4,3,"button",16),a(7,"spk-menu")(8,"button",17),m(9,"spk-icon"),r(),U(10,18),a(11,"button",19),C("click",function(){return f(o),S(i.openTargetUrlDialog())}),m(12,"spk-icon"),r(),B(),r()(),E(),r(),F(13,ki,3,0,"p")(14,xi,2,0,"p"),r(),F(15,Mi,9,0)(16,yo,30,4,"ng-container",20),a(17,"div",21)(18,"button",22),C("click",function(){return f(o),S(i.goBack())}),T(19,3),m(20,"spk-icon"),E(),r(),a(21,"button",23),T(22,4),m(23,"spk-icon"),E(),r()()(),F(24,Oo,15,4,"spk-dialog",24)}if(e&2){let o;_("formGroup",i.destinationForm),s(6),g(i.destinationCount()>0?6:-1),s(7),g(i.destinationCount()>0?13:14),s(2),g(i.destinationCount()===0?15:-1),s(),g(!((o=i.destinationFormSignal())==null||o.destinations==null)&&o.destinations.length?16:-1),s(8),g(i.targetUrlDialogOpen()?24:-1)}},dependencies:[Ne,Ee,ie,Re,we,oe,Te,pt,De,he,ve,Vt,at,ae,le,ut,mt,se,re,be,He,Lt,_t,Ve,We],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}.form-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.form-column[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.form-column[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 1fr;gap:.5rem;align-items:flex-end}.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-level-40);border-radius:var(--shape-3);box-shadow:var(--shadow-1);background-color:var(--base-level-20);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{Jt as a,en as b,Pt as c,Wt as d,Nt as e,ht as f,jt as g,Er as h,At as i,Qt as j,yt as k,Zt as l,Ot as m,pe as n};
@@ -1 +1 @@
1
- import{a as ue}from"./chunk-XVJY4Y25.js";import{a as se}from"./chunk-EUZXGGH4.js";import{a as R,g as x,h as le,j as ce,m as pe,n as re}from"./chunk-ED3PEZLO.js";import"./chunk-AKLJ23OZ.js";import{Y as I}from"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-OVIL3KMN.js";import"./chunk-5ZK3D2RS.js";import{Ab as S,Bb as ee,Cb as ne,Db as te,Eb as i,Fb as o,Gb as r,Hb as M,Ib as E,Kb as ie,Qb as m,Ra as l,Rb as O,Sb as c,Tb as oe,Ub as _e,Wb as $,X as J,Xb as s,ea as F,fa as N,fb as Q,ic as u,kc as T,lb as d,rc as A,sb as Y,sc as H,tb as Z,vb as C,vc as k,wc as P,xb as f,xc as ae}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var de=()=>[I,x,R,ce,pe,import("./chunk-4TN5W4QO.js").then(e=>e.DatePipe),import("./chunk-BEZGDXHL.js").then(e=>e.DurationFormatPipe),import("./chunk-KMNTAMUY.js").then(e=>e.BytesPipe)],Me=()=>["/add-backup"],Ee=()=>["/restore"],ge=e=>["/backup",e],Ce=e=>["/backup",e,"export"];function Se(e,_){if(e&1&&(u(0," - "),M(1),c(2,14),E(),u(3),k(4,"durationFormat")),e&2){let n=s().$implicit;l(3),T(" ",P(4,1,n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDuration)," ")}}function me(e,_){e&1&&(M(0),c(1,15),E())}function Oe(e,_){if(e&1&&(u(0),k(1,"bytes")),e&2){let n=s().$implicit;T(" ",P(1,1,n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.SourceFilesSize)," ")}}function Te(e,_){e&1&&(M(0),c(1,16),E())}function ke(e,_){if(e&1&&(u(0),k(1,"bytes")),e&2){let n=s().$implicit;T(" ",P(1,1,n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.TargetFilesSize)," ")}}function Pe(e,_){e&1&&(M(0),c(1,17),E())}function Fe(e,_){if(e&1&&(i(0,"spk-chip",30),c(1,18),o()),e&2){let n=s().$implicit;l(),oe(n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.BackupListCount),_e(1)}}function Ne(e,_){e&1&&(i(0,"spk-chip",31),c(1,19),o())}function fe(e,_){if(e&1){let n=ie();i(0,"div",29)(1,"div",24)(2,"h3"),u(3),i(4,"spk-icon"),u(5,"database"),o()(),i(6,"p")(7,"span"),c(8,8),o(),u(9),k(10,"date"),d(11,Se,5,3)(12,me,2,0,"ng-container"),o(),i(13,"p")(14,"span"),c(15,9),o(),d(16,Oe,2,3)(17,Te,2,0,"ng-container"),o(),i(18,"p")(19,"span"),c(20,10),o(),d(21,ke,2,3)(22,Pe,2,0,"ng-container"),o()(),d(23,Fe,2,1,"spk-chip",30)(24,Ne,2,0,"spk-chip",31),i(25,"div",32)(26,"button",33),$("click",function(){let p=F(n).$implicit,g=s(3);return N(g.startBackup(p.Backup==null?null:p.Backup.ID))}),m(27,11),r(28,"spk-icon"),O(),o(),i(29,"button",34)(30,"spk-icon"),u(31,"pencil-simple"),o()(),i(32,"spk-menu",35)(33,"button",25)(34,"spk-icon"),u(35,"dots-three-vertical"),o()(),M(36,36),i(37,"button",37,0),m(39,12),r(40,"spk-icon"),O(),o(),i(41,"button",38,0),$("click",function(){let p=F(n).$implicit,g=s(3);return N(g.deleteBackup(p.Backup==null?null:p.Backup.ID))}),m(43,13),r(44,"spk-icon"),O(),o(),E(),o()()()}if(e&2){let n,t=_.$implicit,p=s(3);l(3),T(" ",(n=t.Backup==null?null:t.Backup.Name)!==null&&n!==void 0?n:p.MISSING_BACKUP_NAME," "),l(6),T(" ",ae(10,13,t.Backup==null||t.Backup.Metadata==null?null:t.Backup.Metadata.LastBackupDate,"short")," "),l(2),S(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.LastBackupDuration?11:12),l(5),S(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.SourceFilesSize?16:17),l(5),S(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.TargetFilesSize?21:22),l(2),S(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.BackupListCount?23:24),l(3),f("loader",p.startingBackup()),l(3),C("routerLink",H(16,ge,t.Backup==null?null:t.Backup.ID)),l(3),C("right",!0),l(5),C("routerLink",H(18,Ce,t.Backup==null?null:t.Backup.ID)),l(4),f("loader",p.deletingBackup()===(t.Backup==null?null:t.Backup.ID))}}function $e(e,_){if(e&1&&ne(0,fe,45,20,"div",29,ee),e&2){let n=s(2);te(n.backups())}}function Ae(e,_){e&1&&(M(0),c(1,20),E())}function He(e,_){if(e&1&&d(0,$e,2,0)(1,Ae,2,0,"ng-container"),e&2){let n=s();S(n.backups().length?0:1)}}function Ie(e,_){e&1&&(i(0,"div",39),r(1,"spk-progress-bar",40),i(2,"div",24)(3,"h3"),c(4,21),o()()())}var D=class e{#e=J(se);MISSING_BACKUP_NAME=$localize`Backup name missing`;backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;startingBackup=this.#e.startingBackup;deletingBackup=this.#e.deletingBackup;ngOnInit(){this.#e.getBackups(!0)}startBackup(_){this.#e.startBackup(_)}deleteBackup(_){_&&window.confirm("Are you sure you want to delete this backup?")&&this.#e.deleteBackup(_)}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=Q({type:e,selectors:[["app-home"]],decls:31,vars:5,consts:()=>{let _;_=$localize`Backups`;let n;n=$localize`Backups are stored in the cloud and can be restored at any time.`;let t;t=$localize` Add ${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let p;p=$localize`Restores`;let g;g=$localize`Restores are stored in the cloud and can be restored at any time.`;let B;B=$localize` Start ${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let b;b=$localize`My backups`;let L;L=$localize`Last successful backup:`;let y;y=$localize`Source:`;let G;G=$localize`Destination:`;let h;h=$localize`${"\uFFFD#28\uFFFD"}:START_TAG_SPK_ICON:play-circle${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SPK_ICON: Start `;let v;v=$localize` Export ${"\uFFFD#40\uFFFD"}:START_TAG_SPK_ICON:export${"\uFFFD/#40\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let X;X=$localize` Delete ${"\uFFFD#44\uFFFD"}:START_TAG_SPK_ICON:x-circle${"\uFFFD/#44\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let z;z=$localize`took`;let w;w=$localize`N/A`;let K;K=$localize`N/A`;let V;V=$localize`N/A`;let j;j=$localize` ${"\uFFFD0\uFFFD"}:INTERPOLATION: Version `;let U;U=$localize`No version yet`;let W;W=$localize`No backups founds`;let q;return q=$localize`Loading backups...`,[["option",""],_,n,t,p,g,B,b,L,y,G,h,v,X,z,w,K,V,j,U,W,q,[1,"type-a",3,"routerLink"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["spk-button",""],["src","assets/images/restore.png","alt","","width","48px"],[1,"content"],[1,"backups"],[1,"backup"],[1,"simple","success"],[1,"simple"],[1,"actions"],["spk-button","",3,"click"],["spk-button","",3,"routerLink"],[3,"right"],["menu",""],[3,"routerLink"],[3,"click"],[1,"loading-list"],[1,"indeterminate","primary"]]},template:function(n,t){n&1&&(r(0,"app-status-bar"),i(1,"section")(2,"header")(3,"spk-card",22),r(4,"img",23),i(5,"div",24)(6,"h3"),c(7,1),o(),i(8,"p"),c(9,2),o()(),i(10,"button",25),m(11,3),r(12,"spk-icon"),O(),o()(),i(13,"spk-card",22),r(14,"img",26),i(15,"div",24)(16,"h3"),c(17,4),o(),i(18,"p"),c(19,5),o()(),i(20,"button",25),m(21,6),r(22,"spk-icon"),O(),o()()(),i(23,"div",27)(24,"h2"),c(25,7),o(),i(26,"div",28),d(27,He,2,1)(28,Ie,5,0),Y(29,27,de,null,28),o()()()),n&2&&(l(3),C("routerLink",A(3,Me)),l(10),C("routerLink",A(4,Ee)),l(16),Z(!t.backupsLoading()))},dependencies:[I,ue,le,x,R,re],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem 0}header[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;padding:0 2rem;gap:1rem}spk-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}spk-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem;gap:1rem}.backups[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.backup[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem;gap:1rem;border:1px solid var(--base-level-40);border-radius:var(--shape-3);box-shadow:var(--shadow-1)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;max-width:40%}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{color:var(--base-level-60)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font:var(--paragraph-30);color:var(--base-level-60)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--base-level-70)}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{D as default};
1
+ import{a as ue}from"./chunk-27GCJTV5.js";import{a as se}from"./chunk-EUZXGGH4.js";import{a as R,g as x,h as le,j as ce,m as pe,n as re}from"./chunk-ED3PEZLO.js";import"./chunk-AKLJ23OZ.js";import{Y as I}from"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-OVIL3KMN.js";import"./chunk-5ZK3D2RS.js";import{Ab as S,Bb as ee,Cb as ne,Db as te,Eb as i,Fb as o,Gb as r,Hb as M,Ib as E,Kb as ie,Qb as m,Ra as l,Rb as O,Sb as c,Tb as oe,Ub as _e,Wb as $,X as J,Xb as s,ea as F,fa as N,fb as Q,ic as u,kc as T,lb as d,rc as A,sb as Y,sc as H,tb as Z,vb as C,vc as k,wc as P,xb as f,xc as ae}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var de=()=>[I,x,R,ce,pe,import("./chunk-4TN5W4QO.js").then(e=>e.DatePipe),import("./chunk-BEZGDXHL.js").then(e=>e.DurationFormatPipe),import("./chunk-KMNTAMUY.js").then(e=>e.BytesPipe)],Me=()=>["/add-backup"],Ee=()=>["/restore"],ge=e=>["/backup",e],Ce=e=>["/backup",e,"export"];function Se(e,_){if(e&1&&(u(0," - "),M(1),c(2,14),E(),u(3),k(4,"durationFormat")),e&2){let n=s().$implicit;l(3),T(" ",P(4,1,n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDuration)," ")}}function me(e,_){e&1&&(M(0),c(1,15),E())}function Oe(e,_){if(e&1&&(u(0),k(1,"bytes")),e&2){let n=s().$implicit;T(" ",P(1,1,n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.SourceFilesSize)," ")}}function Te(e,_){e&1&&(M(0),c(1,16),E())}function ke(e,_){if(e&1&&(u(0),k(1,"bytes")),e&2){let n=s().$implicit;T(" ",P(1,1,n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.TargetFilesSize)," ")}}function Pe(e,_){e&1&&(M(0),c(1,17),E())}function Fe(e,_){if(e&1&&(i(0,"spk-chip",30),c(1,18),o()),e&2){let n=s().$implicit;l(),oe(n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.BackupListCount),_e(1)}}function Ne(e,_){e&1&&(i(0,"spk-chip",31),c(1,19),o())}function fe(e,_){if(e&1){let n=ie();i(0,"div",29)(1,"div",24)(2,"h3"),u(3),i(4,"spk-icon"),u(5,"database"),o()(),i(6,"p")(7,"span"),c(8,8),o(),u(9),k(10,"date"),d(11,Se,5,3)(12,me,2,0,"ng-container"),o(),i(13,"p")(14,"span"),c(15,9),o(),d(16,Oe,2,3)(17,Te,2,0,"ng-container"),o(),i(18,"p")(19,"span"),c(20,10),o(),d(21,ke,2,3)(22,Pe,2,0,"ng-container"),o()(),d(23,Fe,2,1,"spk-chip",30)(24,Ne,2,0,"spk-chip",31),i(25,"div",32)(26,"button",33),$("click",function(){let p=F(n).$implicit,g=s(3);return N(g.startBackup(p.Backup==null?null:p.Backup.ID))}),m(27,11),r(28,"spk-icon"),O(),o(),i(29,"button",34)(30,"spk-icon"),u(31,"pencil-simple"),o()(),i(32,"spk-menu",35)(33,"button",25)(34,"spk-icon"),u(35,"dots-three-vertical"),o()(),M(36,36),i(37,"button",37,0),m(39,12),r(40,"spk-icon"),O(),o(),i(41,"button",38,0),$("click",function(){let p=F(n).$implicit,g=s(3);return N(g.deleteBackup(p.Backup==null?null:p.Backup.ID))}),m(43,13),r(44,"spk-icon"),O(),o(),E(),o()()()}if(e&2){let n,t=_.$implicit,p=s(3);l(3),T(" ",(n=t.Backup==null?null:t.Backup.Name)!==null&&n!==void 0?n:p.MISSING_BACKUP_NAME," "),l(6),T(" ",ae(10,13,t.Backup==null||t.Backup.Metadata==null?null:t.Backup.Metadata.LastBackupDate,"short")," "),l(2),S(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.LastBackupDuration?11:12),l(5),S(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.SourceFilesSize?16:17),l(5),S(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.TargetFilesSize?21:22),l(2),S(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.BackupListCount?23:24),l(3),f("loader",p.startingBackup()),l(3),C("routerLink",H(16,ge,t.Backup==null?null:t.Backup.ID)),l(3),C("right",!0),l(5),C("routerLink",H(18,Ce,t.Backup==null?null:t.Backup.ID)),l(4),f("loader",p.deletingBackup()===(t.Backup==null?null:t.Backup.ID))}}function $e(e,_){if(e&1&&ne(0,fe,45,20,"div",29,ee),e&2){let n=s(2);te(n.backups())}}function Ae(e,_){e&1&&(M(0),c(1,20),E())}function He(e,_){if(e&1&&d(0,$e,2,0)(1,Ae,2,0,"ng-container"),e&2){let n=s();S(n.backups().length?0:1)}}function Ie(e,_){e&1&&(i(0,"div",39),r(1,"spk-progress-bar",40),i(2,"div",24)(3,"h3"),c(4,21),o()()())}var D=class e{#e=J(se);MISSING_BACKUP_NAME=$localize`Backup name missing`;backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;startingBackup=this.#e.startingBackup;deletingBackup=this.#e.deletingBackup;ngOnInit(){this.#e.getBackups(!0)}startBackup(_){this.#e.startBackup(_)}deleteBackup(_){_&&window.confirm("Are you sure you want to delete this backup?")&&this.#e.deleteBackup(_)}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=Q({type:e,selectors:[["app-home"]],decls:31,vars:5,consts:()=>{let _;_=$localize`Backups`;let n;n=$localize`Backups are stored in the cloud and can be restored at any time.`;let t;t=$localize` Add ${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let p;p=$localize`Restores`;let g;g=$localize`Restores are stored in the cloud and can be restored at any time.`;let B;B=$localize` Start ${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let b;b=$localize`My backups`;let L;L=$localize`Last successful backup:`;let y;y=$localize`Source:`;let G;G=$localize`Destination:`;let h;h=$localize`${"\uFFFD#28\uFFFD"}:START_TAG_SPK_ICON:play-circle${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SPK_ICON: Start `;let v;v=$localize` Export ${"\uFFFD#40\uFFFD"}:START_TAG_SPK_ICON:export${"\uFFFD/#40\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let X;X=$localize` Delete ${"\uFFFD#44\uFFFD"}:START_TAG_SPK_ICON:x-circle${"\uFFFD/#44\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let z;z=$localize`took`;let w;w=$localize`N/A`;let K;K=$localize`N/A`;let V;V=$localize`N/A`;let j;j=$localize` ${"\uFFFD0\uFFFD"}:INTERPOLATION: Version `;let U;U=$localize`No version yet`;let W;W=$localize`No backups founds`;let q;return q=$localize`Loading backups...`,[["option",""],_,n,t,p,g,B,b,L,y,G,h,v,X,z,w,K,V,j,U,W,q,[1,"type-a",3,"routerLink"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["spk-button",""],["src","assets/images/restore.png","alt","","width","48px"],[1,"content"],[1,"backups"],[1,"backup"],[1,"simple","success"],[1,"simple"],[1,"actions"],["spk-button","",3,"click"],["spk-button","",3,"routerLink"],[3,"right"],["menu",""],[3,"routerLink"],[3,"click"],[1,"loading-list"],[1,"indeterminate","primary"]]},template:function(n,t){n&1&&(r(0,"app-status-bar"),i(1,"section")(2,"header")(3,"spk-card",22),r(4,"img",23),i(5,"div",24)(6,"h3"),c(7,1),o(),i(8,"p"),c(9,2),o()(),i(10,"button",25),m(11,3),r(12,"spk-icon"),O(),o()(),i(13,"spk-card",22),r(14,"img",26),i(15,"div",24)(16,"h3"),c(17,4),o(),i(18,"p"),c(19,5),o()(),i(20,"button",25),m(21,6),r(22,"spk-icon"),O(),o()()(),i(23,"div",27)(24,"h2"),c(25,7),o(),i(26,"div",28),d(27,He,2,1)(28,Ie,5,0),Y(29,27,de,null,28),o()()()),n&2&&(l(3),C("routerLink",A(3,Me)),l(10),C("routerLink",A(4,Ee)),l(16),Z(!t.backupsLoading()))},dependencies:[I,ue,le,x,R,re],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem 0}header[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;padding:0 2rem;gap:1rem}spk-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}spk-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem;gap:1rem}.backups[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.backup[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem;gap:1rem;border:1px solid var(--base-level-40);border-radius:var(--shape-3);box-shadow:var(--shadow-1)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;max-width:40%}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{color:var(--base-level-60)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font:var(--paragraph-30);color:var(--base-level-60)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--base-level-70)}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{D as default};
@@ -1 +1 @@
1
- import{a,b,c}from"./chunk-5PPKS4ML.js";import"./chunk-G6GQ2MDC.js";import"./chunk-DNHLTHLR.js";import"./chunk-3NZI2UZ4.js";import"./chunk-KFGIVU27.js";import"./chunk-7TWD5GBS.js";import"./chunk-ED3PEZLO.js";import"./chunk-AKLJ23OZ.js";import"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";export{a as createDestinationForm,b as createDestinationFormGroup,c as default};
1
+ import{a,b,c}from"./chunk-45JBSR2F.js";import"./chunk-WWJ757LM.js";import"./chunk-DNHLTHLR.js";import"./chunk-3NZI2UZ4.js";import"./chunk-KFGIVU27.js";import"./chunk-7TWD5GBS.js";import"./chunk-ED3PEZLO.js";import"./chunk-AKLJ23OZ.js";import"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";export{a as createDestinationForm,b as createDestinationFormGroup,c as default};
@@ -1 +1 @@
1
- import{d as a,e as b,f as c}from"./chunk-5PPKS4ML.js";import"./chunk-G6GQ2MDC.js";import"./chunk-DNHLTHLR.js";import"./chunk-3NZI2UZ4.js";import"./chunk-KFGIVU27.js";import"./chunk-7TWD5GBS.js";import"./chunk-ED3PEZLO.js";import"./chunk-AKLJ23OZ.js";import"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";export{b as NONE_OPTION,a as createGeneralForm,c as default};
1
+ import{d as a,e as b,f as c}from"./chunk-45JBSR2F.js";import"./chunk-WWJ757LM.js";import"./chunk-DNHLTHLR.js";import"./chunk-3NZI2UZ4.js";import"./chunk-KFGIVU27.js";import"./chunk-7TWD5GBS.js";import"./chunk-ED3PEZLO.js";import"./chunk-AKLJ23OZ.js";import"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";export{b as NONE_OPTION,a as createGeneralForm,c as default};
@@ -1 +1 @@
1
- import{a,b}from"./chunk-UMG632SX.js";import"./chunk-K7H3KYW7.js";import"./chunk-G6GQ2MDC.js";import"./chunk-3NZI2UZ4.js";import"./chunk-KFGIVU27.js";import"./chunk-7TWD5GBS.js";import"./chunk-ED3PEZLO.js";import"./chunk-AKLJ23OZ.js";import"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";export{a as createRestoreOptionsForm,b as default};
1
+ import{a,b}from"./chunk-M2HNXB57.js";import"./chunk-K7H3KYW7.js";import"./chunk-WWJ757LM.js";import"./chunk-3NZI2UZ4.js";import"./chunk-KFGIVU27.js";import"./chunk-7TWD5GBS.js";import"./chunk-ED3PEZLO.js";import"./chunk-AKLJ23OZ.js";import"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";export{a as createRestoreOptionsForm,b as default};
@@ -1 +1 @@
1
- import{e as E}from"./chunk-UMG632SX.js";import"./chunk-K7H3KYW7.js";import"./chunk-G6GQ2MDC.js";import"./chunk-3NZI2UZ4.js";import"./chunk-KFGIVU27.js";import"./chunk-7TWD5GBS.js";import{o as g,s as O}from"./chunk-ED3PEZLO.js";import"./chunk-AKLJ23OZ.js";import{H as u,L as R,Y as m,Z as T}from"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import{Eb as n,Fb as r,Gb as a,Qb as _,Ra as p,Rb as l,X as s,fb as S,sc as d,vb as F}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var k=t=>["/restore-flow",t,"select-files"],f=t=>["/restore-flow",t,"options"],c=class t{#t=s(u);#e=s(E);backupId=this.#e.backupId;ngOnInit(){this.#e.init(this.#t.snapshot.params.id)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=S({type:t,selectors:[["app-restore-flow"]],decls:9,vars:6,consts:()=>{let o;o=$localize`${"\uFFFD#3\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SPK_RADIO: Select files `;let e;return e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SPK_RADIO: Options `,[o,e,["step","","routerLinkActive","active",3,"routerLink"]]},template:function(e,i){e&1&&(n(0,"spk-stepper")(1,"div",2),_(2,0),a(3,"spk-radio"),l(),r(),n(4,"div",2),_(5,1),a(6,"spk-radio"),l(),r()(),n(7,"section"),a(8,"router-outlet"),r()),e&2&&(p(),F("routerLink",d(2,k,i.backupId())),p(3),F("routerLink",d(4,f,i.backupId())))},dependencies:[O,g,R,m,T],styles:["[_nghost-%COMP%]{display:block}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{c as default};
1
+ import{e as E}from"./chunk-M2HNXB57.js";import"./chunk-K7H3KYW7.js";import"./chunk-WWJ757LM.js";import"./chunk-3NZI2UZ4.js";import"./chunk-KFGIVU27.js";import"./chunk-7TWD5GBS.js";import{o as g,s as O}from"./chunk-ED3PEZLO.js";import"./chunk-AKLJ23OZ.js";import{H as u,L as R,Y as m,Z as T}from"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import{Eb as n,Fb as r,Gb as a,Qb as _,Ra as p,Rb as l,X as s,fb as S,sc as d,vb as F}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var k=t=>["/restore-flow",t,"select-files"],f=t=>["/restore-flow",t,"options"],c=class t{#t=s(u);#e=s(E);backupId=this.#e.backupId;ngOnInit(){this.#e.init(this.#t.snapshot.params.id)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=S({type:t,selectors:[["app-restore-flow"]],decls:9,vars:6,consts:()=>{let o;o=$localize`${"\uFFFD#3\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SPK_RADIO: Select files `;let e;return e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SPK_RADIO: Options `,[o,e,["step","","routerLinkActive","active",3,"routerLink"]]},template:function(e,i){e&1&&(n(0,"spk-stepper")(1,"div",2),_(2,0),a(3,"spk-radio"),l(),r(),n(4,"div",2),_(5,1),a(6,"spk-radio"),l(),r()(),n(7,"section"),a(8,"router-outlet"),r()),e&2&&(p(),F("routerLink",d(2,k,i.backupId())),p(3),F("routerLink",d(4,f,i.backupId())))},dependencies:[O,g,R,m,T],styles:["[_nghost-%COMP%]{display:block}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{c as default};
@@ -1 +1 @@
1
- import{a as Me}from"./chunk-K7H3KYW7.js";import{a as X,b as Re}from"./chunk-G6GQ2MDC.js";import{b as H}from"./chunk-KFGIVU27.js";import{a as ge,b as A,d as D,e as y,h as v,j as Ee,l as b,o as G,p as w,r as x}from"./chunk-7TWD5GBS.js";import{a as W,g as V,n as fe,o as Ce,p as Pe,q as Ne,v as Ie}from"./chunk-ED3PEZLO.js";import{a as k}from"./chunk-AKLJ23OZ.js";import{H as $,X as f}from"./chunk-J3H4BCHI.js";import{pa as h}from"./chunk-5ZK3D2RS.js";import{Ab as j,B as se,Bb as Fe,Cb as ue,Db as Se,E as z,Eb as n,Fb as l,Gb as a,Hb as I,Ib as R,K as le,Kb as M,Kc as de,L as ae,Qb as F,R as _e,Ra as m,Rb as u,Sb as T,Wb as E,X as _,Xb as U,Za as O,c as oe,ea as d,fa as g,fb as N,ic as L,l as ie,lb as K,lc as me,p as ne,qc as ce,v as re,vb as c,vc as Oe,xb as pe,xc as Te}from"./chunk-MR4RE3IB.js";function De(r,t){r&1&&a(0,"spk-progress-bar",7)}function ye(r,t){if(r&1&&(n(0,"spk-option",13),L(1),Oe(2,"date"),l()),r&2){let e=t.$implicit;c("value",e.Version),m(),me(" ",e.Version,": ",Te(2,3,e.Time,"d MMM y, h:mm")," ")}}function ve(r,t){if(r&1&&(n(0,"app-file-tree",14)(1,"label",15),T(2,4),l(),a(3,"input",16),l()),r&2){let e=U(2);c("rootPath",e.rootPath())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function be(r,t){if(r&1&&(n(0,"spk-select",11),a(1,"input",12),ue(2,ye,3,6,"spk-option",13,Fe),l(),K(4,ve,4,4,"app-file-tree",14)),r&2){let e=U();c("displayFn",e.displayFn()),m(2),Se(e.versionOptions()),m(2),j(e.rootPathLoaded()?4:-1)}}var B=new w,he=()=>B.group({filesToRestore:B.control(""),selectedOption:B.control(null),passphrase:B.control(null)}),q=class r{#t=_(k);#e=_(C);#o=_(f);#i=_($);#n=_(h);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;backupSettings=de(()=>{let t=this.backupId(),e=this.selectFilesFormSignal()?.selectedOption;if(typeof e!="number"||!t)return null;let i=this.versionOptions()?.find(s=>s.Version===e)?.Time??null;return i?{id:t,time:i}:null});rootPathLoaded=O(!1);rootPath=Me([this.selectFilesFormSignal,this.backupId],oe(le([null,null]),ae(([t,e])=>{let o=t?.selectedOption,i=e;if(typeof o!="number"||!i)return ie("/");let s=this.versionOptions()?.find(p=>p.Version===o);return this.#t.getApiV1BackupByIdFiles({id:i,time:s?.Time??"",prefixOnly:!1,folderContents:!0}).pipe(ne(p=>(this.rootPathLoaded.set(!0),p.Files[0].Path)))})));displayFn(){let t=this.versionOptions();return e=>{if(!e)return"";let o=t?.find(i=>i.Version?.toString()===e);return o?`${o.Version}: ${this.#n.transform(o.Time,"d MMM y, h:mm")}`:""}}next(){this.#o.navigate(["options"],{relativeTo:this.#i.parent})}exit(){this.#e.exit()}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=N({type:r,selectors:[["app-select-files"]],features:[ce([h])],decls:13,vars:2,consts:()=>{let t;t=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON: Exit `;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let i;i=$localize`Select an option...`;let s;return s=$localize`Path`,[["formRef",""],t,e,o,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"],[3,"displayFn"],["type","text","placeholder",i,"formControlName","selectedOption"],[3,"value"],[3,"rootPath","backupSettings","multiSelect","showFiles"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,o){if(e&1){let i=M();n(0,"form",5,0),E("submit",function(){return d(i),g(o.next())}),n(2,"h3",6),T(3,1),l(),K(4,De,1,0,"spk-progress-bar",7)(5,be,5,2),n(6,"div",8)(7,"button",9),E("click",function(){return d(i),g(o.exit())}),F(8,2),a(9,"spk-icon"),u(),l(),n(10,"button",10),F(11,3),a(12,"spk-icon"),u(),l()()()}e&2&&(c("formGroup",o.selectFilesForm),m(4),j(o.versionOptionsLoading()?4:5))},dependencies:[x,v,A,D,y,b,G,h,X,V,Pe,W,Ne,fe],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 C=class r{#t=_(f);#e=_(k);backupId=O(null);backup=O(null);selectFilesForm=he();optionsForm=$e();optionsFormSignal=H(this.optionsForm.valueChanges);selectFilesFormSignal=H(this.selectFilesForm.valueChanges);versionOptionsLoading=O(!1);versionOptions=O([]);isSubmitting=O(!1);init(t){this.backupId.set(t),this.#o(t,!0)}submit(){this.isSubmitting.set(!0);let t=this.backupId(),e=this.optionsForm.value,o=this.selectFilesForm.value,i=this.versionOptions()?.find(s=>s.Version===o.selectedOption);this.#e.postApiV1BackupByIdRestore({id:t??"",requestBody:{paths:o.filesToRestore?.split("\0").map(s=>`${s}*`)??[],passphrase:o.passphrase??null,time:i?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!0}}).pipe(z(()=>this.isSubmitting.set(!1))).subscribe({next:()=>this.exit(),error:s=>{console.error("restore error",s)}})}exit(){this.#i(),this.#t.navigate(["/"])}getVersionOptions(){this.versionOptions()}#o(t,e=!1){this.versionOptionsLoading.set(!0),re([this.#e.getApiV1BackupById({id:t}),this.#e.getApiV1BackupByIdFilesets({id:t})]).pipe(se(1),z(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([o,i])=>{this.versionOptions.set(i),this.backup.set(o),e&&this.selectFilesForm.controls.selectedOption.setValue(i[0].Version)}})}#i(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||r)};static \u0275prov=_e({token:r,factory:r.\u0275fac,providedIn:"root"})};var P=new w,$e=()=>P.group({restoreFrom:P.control("orignal"),restoreFromPath:P.control(""),handleExisting:P.control("overwrite"),permissions:P.control(!1)}),J=class r{#t=_(C);#e=_(f);#o=_($);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||r)};static \u0275cmp=N({type:r,selectors:[["app-options"]],decls:39,vars:6,consts:()=>{let t;t=$localize`Restore options`;let e;e=$localize`Where do you want to restore files from?`;let o;o=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let i;i=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let s;s=$localize`How do you want to handle existing files?`;let p;p=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let Q;Q=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let Y;Y=$localize`Permissions`;let Z;Z=$localize` Restore read/write permissions ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let ee;ee=$localize`${"\uFFFD#35\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#35\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let te;return te=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SPK_ICON: Submit `,[["formRef",""],t,e,o,i,s,p,Q,Y,Z,ee,te,[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"],["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","permissions"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"]]},template:function(e,o){if(e&1){let i=M();n(0,"form",12,0),E("submit",function(){return d(i),g(o.submit())}),n(2,"h3",13),T(3,1),l(),n(4,"app-toggle-card",14),I(5,15),T(6,2),R(),n(7,"spk-radio",16),F(8,3),a(9,"input",17),u(),l(),n(10,"spk-radio",16),F(11,4),a(12,"input",18),u(),l(),n(13,"app-file-tree",19)(14,"label",20),L(15,"Path"),l(),a(16,"input",21),l()(),n(17,"app-toggle-card",14),I(18,15),T(19,5),R(),n(20,"spk-radio",16),F(21,6),a(22,"input",22),u(),l(),n(23,"spk-radio",16),F(24,7),a(25,"input",23),u(),l()(),n(26,"app-toggle-card"),I(27,15),T(28,8),R(),n(29,"spk-toggle",24),F(30,9),a(31,"input",25),u(),l()(),n(32,"div",26)(33,"button",27),E("click",function(){return d(i),g(o.goBack())}),F(34,10),a(35,"spk-icon"),u(),l(),n(36,"button",28),F(37,11),a(38,"spk-icon"),u(),l()()()}if(e&2){let i;c("formGroup",o.optionsForm),m(4),c("disallowToggle",!0),m(9),c("disabled",((i=o.optionsFormSignal())==null?null:i.restoreFrom)!=="pickLocation"),m(4),c("disallowToggle",!0),m(19),pe("loader",o.isSubmitting())}},dependencies:[x,v,A,ge,Ee,D,y,b,G,Re,X,Ie,Ce,V,W],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{$e as a,J as b,he as c,q as d,C as e};
1
+ import{a as Me}from"./chunk-K7H3KYW7.js";import{a as X,b as Re}from"./chunk-WWJ757LM.js";import{b as H}from"./chunk-KFGIVU27.js";import{a as ge,b as A,d as D,e as y,h as v,j as Ee,l as b,o as G,p as w,r as x}from"./chunk-7TWD5GBS.js";import{a as W,g as V,n as fe,o as Ce,p as Pe,q as Ne,v as Ie}from"./chunk-ED3PEZLO.js";import{a as k}from"./chunk-AKLJ23OZ.js";import{H as $,X as f}from"./chunk-J3H4BCHI.js";import{pa as h}from"./chunk-5ZK3D2RS.js";import{Ab as j,B as se,Bb as Fe,Cb as ue,Db as Se,E as z,Eb as n,Fb as l,Gb as a,Hb as I,Ib as R,K as le,Kb as M,Kc as de,L as ae,Qb as F,R as _e,Ra as m,Rb as u,Sb as T,Wb as E,X as _,Xb as U,Za as O,c as oe,ea as d,fa as g,fb as N,ic as L,l as ie,lb as K,lc as me,p as ne,qc as ce,v as re,vb as c,vc as Oe,xb as pe,xc as Te}from"./chunk-MR4RE3IB.js";function De(r,t){r&1&&a(0,"spk-progress-bar",7)}function ye(r,t){if(r&1&&(n(0,"spk-option",13),L(1),Oe(2,"date"),l()),r&2){let e=t.$implicit;c("value",e.Version),m(),me(" ",e.Version,": ",Te(2,3,e.Time,"d MMM y, h:mm")," ")}}function ve(r,t){if(r&1&&(n(0,"app-file-tree",14)(1,"label",15),T(2,4),l(),a(3,"input",16),l()),r&2){let e=U(2);c("rootPath",e.rootPath())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function be(r,t){if(r&1&&(n(0,"spk-select",11),a(1,"input",12),ue(2,ye,3,6,"spk-option",13,Fe),l(),K(4,ve,4,4,"app-file-tree",14)),r&2){let e=U();c("displayFn",e.displayFn()),m(2),Se(e.versionOptions()),m(2),j(e.rootPathLoaded()?4:-1)}}var B=new w,he=()=>B.group({filesToRestore:B.control(""),selectedOption:B.control(null),passphrase:B.control(null)}),q=class r{#t=_(k);#e=_(C);#o=_(f);#i=_($);#n=_(h);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;backupSettings=de(()=>{let t=this.backupId(),e=this.selectFilesFormSignal()?.selectedOption;if(typeof e!="number"||!t)return null;let i=this.versionOptions()?.find(s=>s.Version===e)?.Time??null;return i?{id:t,time:i}:null});rootPathLoaded=O(!1);rootPath=Me([this.selectFilesFormSignal,this.backupId],oe(le([null,null]),ae(([t,e])=>{let o=t?.selectedOption,i=e;if(typeof o!="number"||!i)return ie("/");let s=this.versionOptions()?.find(p=>p.Version===o);return this.#t.getApiV1BackupByIdFiles({id:i,time:s?.Time??"",prefixOnly:!1,folderContents:!0}).pipe(ne(p=>(this.rootPathLoaded.set(!0),p.Files[0].Path)))})));displayFn(){let t=this.versionOptions();return e=>{if(!e)return"";let o=t?.find(i=>i.Version?.toString()===e);return o?`${o.Version}: ${this.#n.transform(o.Time,"d MMM y, h:mm")}`:""}}next(){this.#o.navigate(["options"],{relativeTo:this.#i.parent})}exit(){this.#e.exit()}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=N({type:r,selectors:[["app-select-files"]],features:[ce([h])],decls:13,vars:2,consts:()=>{let t;t=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON: Exit `;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let i;i=$localize`Select an option...`;let s;return s=$localize`Path`,[["formRef",""],t,e,o,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"],[3,"displayFn"],["type","text","placeholder",i,"formControlName","selectedOption"],[3,"value"],[3,"rootPath","backupSettings","multiSelect","showFiles"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,o){if(e&1){let i=M();n(0,"form",5,0),E("submit",function(){return d(i),g(o.next())}),n(2,"h3",6),T(3,1),l(),K(4,De,1,0,"spk-progress-bar",7)(5,be,5,2),n(6,"div",8)(7,"button",9),E("click",function(){return d(i),g(o.exit())}),F(8,2),a(9,"spk-icon"),u(),l(),n(10,"button",10),F(11,3),a(12,"spk-icon"),u(),l()()()}e&2&&(c("formGroup",o.selectFilesForm),m(4),j(o.versionOptionsLoading()?4:5))},dependencies:[x,v,A,D,y,b,G,h,X,V,Pe,W,Ne,fe],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 C=class r{#t=_(f);#e=_(k);backupId=O(null);backup=O(null);selectFilesForm=he();optionsForm=$e();optionsFormSignal=H(this.optionsForm.valueChanges);selectFilesFormSignal=H(this.selectFilesForm.valueChanges);versionOptionsLoading=O(!1);versionOptions=O([]);isSubmitting=O(!1);init(t){this.backupId.set(t),this.#o(t,!0)}submit(){this.isSubmitting.set(!0);let t=this.backupId(),e=this.optionsForm.value,o=this.selectFilesForm.value,i=this.versionOptions()?.find(s=>s.Version===o.selectedOption);this.#e.postApiV1BackupByIdRestore({id:t??"",requestBody:{paths:o.filesToRestore?.split("\0").map(s=>`${s}*`)??[],passphrase:o.passphrase??null,time:i?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!0}}).pipe(z(()=>this.isSubmitting.set(!1))).subscribe({next:()=>this.exit(),error:s=>{console.error("restore error",s)}})}exit(){this.#i(),this.#t.navigate(["/"])}getVersionOptions(){this.versionOptions()}#o(t,e=!1){this.versionOptionsLoading.set(!0),re([this.#e.getApiV1BackupById({id:t}),this.#e.getApiV1BackupByIdFilesets({id:t})]).pipe(se(1),z(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([o,i])=>{this.versionOptions.set(i),this.backup.set(o),e&&this.selectFilesForm.controls.selectedOption.setValue(i[0].Version)}})}#i(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||r)};static \u0275prov=_e({token:r,factory:r.\u0275fac,providedIn:"root"})};var P=new w,$e=()=>P.group({restoreFrom:P.control("orignal"),restoreFromPath:P.control(""),handleExisting:P.control("overwrite"),permissions:P.control(!1)}),J=class r{#t=_(C);#e=_(f);#o=_($);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||r)};static \u0275cmp=N({type:r,selectors:[["app-options"]],decls:39,vars:6,consts:()=>{let t;t=$localize`Restore options`;let e;e=$localize`Where do you want to restore files from?`;let o;o=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let i;i=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let s;s=$localize`How do you want to handle existing files?`;let p;p=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let Q;Q=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let Y;Y=$localize`Permissions`;let Z;Z=$localize` Restore read/write permissions ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let ee;ee=$localize`${"\uFFFD#35\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#35\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let te;return te=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SPK_ICON: Submit `,[["formRef",""],t,e,o,i,s,p,Q,Y,Z,ee,te,[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"],["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","permissions"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"]]},template:function(e,o){if(e&1){let i=M();n(0,"form",12,0),E("submit",function(){return d(i),g(o.submit())}),n(2,"h3",13),T(3,1),l(),n(4,"app-toggle-card",14),I(5,15),T(6,2),R(),n(7,"spk-radio",16),F(8,3),a(9,"input",17),u(),l(),n(10,"spk-radio",16),F(11,4),a(12,"input",18),u(),l(),n(13,"app-file-tree",19)(14,"label",20),L(15,"Path"),l(),a(16,"input",21),l()(),n(17,"app-toggle-card",14),I(18,15),T(19,5),R(),n(20,"spk-radio",16),F(21,6),a(22,"input",22),u(),l(),n(23,"spk-radio",16),F(24,7),a(25,"input",23),u(),l()(),n(26,"app-toggle-card"),I(27,15),T(28,8),R(),n(29,"spk-toggle",24),F(30,9),a(31,"input",25),u(),l()(),n(32,"div",26)(33,"button",27),E("click",function(){return d(i),g(o.goBack())}),F(34,10),a(35,"spk-icon"),u(),l(),n(36,"button",28),F(37,11),a(38,"spk-icon"),u(),l()()()}if(e&2){let i;c("formGroup",o.optionsForm),m(4),c("disallowToggle",!0),m(9),c("disabled",((i=o.optionsFormSignal())==null?null:i.restoreFrom)!=="pickLocation"),m(4),c("disallowToggle",!0),m(19),pe("loader",o.isSubmitting())}},dependencies:[x,v,A,ge,Ee,D,y,b,G,Re,X,Ie,Ce,V,W],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{$e as a,J as b,he as c,q as d,C as e};
@@ -1 +1 @@
1
- import{c as a,d as b}from"./chunk-UMG632SX.js";import"./chunk-K7H3KYW7.js";import"./chunk-G6GQ2MDC.js";import"./chunk-3NZI2UZ4.js";import"./chunk-KFGIVU27.js";import"./chunk-7TWD5GBS.js";import"./chunk-ED3PEZLO.js";import"./chunk-AKLJ23OZ.js";import"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";export{a as createRestoreSelectFilesForm,b as default};
1
+ import{c as a,d as b}from"./chunk-M2HNXB57.js";import"./chunk-K7H3KYW7.js";import"./chunk-WWJ757LM.js";import"./chunk-3NZI2UZ4.js";import"./chunk-KFGIVU27.js";import"./chunk-7TWD5GBS.js";import"./chunk-ED3PEZLO.js";import"./chunk-AKLJ23OZ.js";import"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";export{a as createRestoreSelectFilesForm,b as default};
@@ -1 +1 @@
1
- import{a as k}from"./chunk-XVJY4Y25.js";import"./chunk-EUZXGGH4.js";import{a as T,g as M,h as f}from"./chunk-ED3PEZLO.js";import"./chunk-AKLJ23OZ.js";import{Y as S}from"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-OVIL3KMN.js";import"./chunk-5ZK3D2RS.js";import{Eb as e,Fb as n,Gb as _,Qb as s,Ra as c,Rb as l,Sb as i,fb as D,rc as d,vb as r}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var E=()=>["/backup/new"],F=()=>["/backup/import"],u=class C{static \u0275fac=function(t){return new(t||C)};static \u0275cmp=D({type:C,selectors:[["app-add-backup"]],decls:23,vars:4,consts:()=>{let a;a=$localize`Add a new backup`;let t;t=$localize`New backup`;let p;p=$localize`Configure a new backup. Choose your destination, source data and schedule.`;let A;A=$localize` Add a new backup ${"\uFFFD#13\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let g;g=$localize`Import from file`;let P;P=$localize`Import backup configuration from a file. During import you can adjust the setings.`;let m;return m=$localize` Import from file ${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:upload-simple${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[a,t,p,A,g,P,m,[1,"backup-types"],[1,"type-a"],["src","assets/images/new-backup.png"],["spk-button","",1,"raised","primary",3,"routerLink"]]},template:function(t,p){t&1&&(_(0,"app-status-bar"),e(1,"section")(2,"h2"),i(3,0),n(),e(4,"div",7)(5,"spk-card",8),_(6,"img",9),e(7,"h3"),i(8,1),n(),e(9,"p"),i(10,2),n(),e(11,"button",10),s(12,3),_(13,"spk-icon"),l(),n()(),e(14,"spk-card",8),_(15,"img",9),e(16,"h3"),i(17,4),n(),e(18,"p"),i(19,5),n(),e(20,"button",10),s(21,6),_(22,"spk-icon"),l(),n()()()()),t&2&&(c(11),r("routerLink",d(2,E)),c(9),r("routerLink",d(3,F)))},dependencies:[k,M,f,T,S],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;align-items:center;flex-direction:column;gap:2rem;padding:2rem 0}div.backup-types[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;max-width:700px}spk-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:1rem;padding-bottom:3rem}spk-card[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:300px}spk-card[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;text-align:center;width:75%}"],changeDetection:0})};export{u as default};
1
+ import{a as k}from"./chunk-27GCJTV5.js";import"./chunk-EUZXGGH4.js";import{a as T,g as M,h as f}from"./chunk-ED3PEZLO.js";import"./chunk-AKLJ23OZ.js";import{Y as S}from"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-OVIL3KMN.js";import"./chunk-5ZK3D2RS.js";import{Eb as e,Fb as n,Gb as _,Qb as s,Ra as c,Rb as l,Sb as i,fb as D,rc as d,vb as r}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var E=()=>["/backup/new"],F=()=>["/backup/import"],u=class C{static \u0275fac=function(t){return new(t||C)};static \u0275cmp=D({type:C,selectors:[["app-add-backup"]],decls:23,vars:4,consts:()=>{let a;a=$localize`Add a new backup`;let t;t=$localize`New backup`;let p;p=$localize`Configure a new backup. Choose your destination, source data and schedule.`;let A;A=$localize` Add a new backup ${"\uFFFD#13\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let g;g=$localize`Import from file`;let P;P=$localize`Import backup configuration from a file. During import you can adjust the setings.`;let m;return m=$localize` Import from file ${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:upload-simple${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[a,t,p,A,g,P,m,[1,"backup-types"],[1,"type-a"],["src","assets/images/new-backup.png"],["spk-button","",1,"raised","primary",3,"routerLink"]]},template:function(t,p){t&1&&(_(0,"app-status-bar"),e(1,"section")(2,"h2"),i(3,0),n(),e(4,"div",7)(5,"spk-card",8),_(6,"img",9),e(7,"h3"),i(8,1),n(),e(9,"p"),i(10,2),n(),e(11,"button",10),s(12,3),_(13,"spk-icon"),l(),n()(),e(14,"spk-card",8),_(15,"img",9),e(16,"h3"),i(17,4),n(),e(18,"p"),i(19,5),n(),e(20,"button",10),s(21,6),_(22,"spk-icon"),l(),n()()()()),t&2&&(c(11),r("routerLink",d(2,E)),c(9),r("routerLink",d(3,F)))},dependencies:[k,M,f,T,S],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;align-items:center;flex-direction:column;gap:2rem;padding:2rem 0}div.backup-types[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;max-width:700px}spk-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:1rem;padding-bottom:3rem}spk-card[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:300px}spk-card[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;text-align:center;width:75%}"],changeDetection:0})};export{u as default};