@duplicati/ngclient 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/spk.woff2 +0 -0
- package/{chunk-MVPI7URN.js → chunk-3E64B4PC.js} +1 -1
- package/chunk-4RT7DNKB.js +1 -0
- package/{chunk-S3XM5X3R.js → chunk-76OEVFIM.js} +1 -1
- package/{chunk-RUP4GIVS.js → chunk-CQGUEKNU.js} +1 -1
- package/chunk-DCCSCFRQ.js +1 -0
- package/{chunk-4W77W5ES.js → chunk-DJSNG6NF.js} +1 -1
- package/chunk-DNHLTHLR.js +1 -0
- package/chunk-E66JBJTH.js +1 -0
- package/{chunk-DMP4KFQP.js → chunk-G3ZRG5MJ.js} +1 -1
- package/chunk-IDQOMEFA.js +1 -0
- package/chunk-LNCAETYE.js +1 -0
- package/{chunk-ZL5O2DGZ.js → chunk-LSGSCARA.js} +1 -1
- package/chunk-M7I5RH5L.js +1 -0
- package/chunk-MFISBPKS.js +1 -0
- package/chunk-MWB5FR2K.js +1 -0
- package/{chunk-X2SVHSJM.js → chunk-OM6QOR75.js} +1 -1
- package/{chunk-AVFON3HN.js → chunk-OYQELNXA.js} +1 -1
- package/chunk-SQQXOHJO.js +1 -0
- package/chunk-UDWDXUOB.js +1 -0
- package/chunk-VOMOARSI.js +1 -0
- package/chunk-WGKAMO4L.js +1 -0
- package/{chunk-CHPE3R64.js → chunk-YJ2MWFHK.js} +1 -1
- package/chunk-YQDGW52C.js +1 -0
- package/{chunk-XJ2LABT6.js → chunk-ZE33Q6DJ.js} +1 -1
- package/chunk-ZXOEQDPM.js +1 -0
- package/index.html +2 -2
- package/main-XRAHISLJ.js +1 -0
- package/package.json +1 -1
- package/styles-GLYEHLO7.css +1 -0
- package/chunk-4KQ5PO6F.js +0 -1
- package/chunk-5FHN6XPA.js +0 -1
- package/chunk-6XCCSABS.js +0 -1
- package/chunk-BQJJKX7Q.js +0 -1
- package/chunk-CMP3TWYX.js +0 -1
- package/chunk-IYC3FMCU.js +0 -1
- package/chunk-JCO3FLHD.js +0 -1
- package/chunk-JZTRJKNF.js +0 -1
- package/chunk-KCVUEWQV.js +0 -1
- package/chunk-LPWDGHUL.js +0 -1
- package/chunk-NN636EFZ.js +0 -1
- package/chunk-VG4KZKV3.js +0 -1
- package/main-BZZ56FAH.js +0 -1
- package/styles-7MWOIMAV.css +0 -1
package/assets/spk.woff2
CHANGED
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as f}from"./chunk-
|
|
1
|
+
import{a as f}from"./chunk-CQGUEKNU.js";import"./chunk-V7LHB36E.js";import"./chunk-WU4K3UNC.js";import{a as u,d as g,e as k}from"./chunk-LNCAETYE.js";import{d as l}from"./chunk-AFUS3PYG.js";import"./chunk-L4EVZZOM.js";import"./chunk-SYBUINNV.js";import{Db as t,Jb as s,Kb as m,Oa as c,Z as r,bb as d,jb as e,kb as n,lb as i}from"./chunk-RBNO3K72.js";var b=()=>["/backup/new"],o=class p{static \u0275fac=function(a){return new(a||p)};static \u0275cmp=r({type:p,selectors:[["app-add-backup"]],standalone:!0,features:[s],decls:15,vars:2,consts:[[1,"backup-types"],[1,"type-a"],["src","assets/images/new-backup.png"],["spk-button","",1,"raised","primary",3,"routerLink"]],template:function(a,x){a&1&&(i(0,"app-status-bar"),e(1,"section")(2,"h2"),t(3,"Add a new backup"),n(),e(4,"div",0)(5,"spk-card",1),i(6,"img",2),e(7,"h3"),t(8,"New backup"),n(),e(9,"p"),t(10,"Configure a new backup. Choose your destination, source data and schedule."),n(),e(11,"button",3),t(12," Add a new backup "),e(13,"spk-icon"),t(14,"plus"),n()()()()()),a&2&&(c(11),d("routerLink",m(1,b)))},dependencies:[f,g,k,u,l],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;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{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as a,m as b}from"./chunk-VOMOARSI.js";import"./chunk-YJ2MWFHK.js";import"./chunk-TIGGJ4KF.js";import"./chunk-DNHLTHLR.js";import"./chunk-P4AWKIXG.js";import"./chunk-C52YH32J.js";import"./chunk-LNCAETYE.js";import"./chunk-AFUS3PYG.js";import"./chunk-L4EVZZOM.js";import"./chunk-SYBUINNV.js";import"./chunk-RBNO3K72.js";export{a as createSourceDataForm,b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as S}from"./chunk-
|
|
1
|
+
import{e as S}from"./chunk-G3ZRG5MJ.js";import"./chunk-5Y47Y3RB.js";import"./chunk-YJ2MWFHK.js";import"./chunk-P4AWKIXG.js";import"./chunk-C52YH32J.js";import{l as C,p as v}from"./chunk-LNCAETYE.js";import{a as f,b as k,d as w,e as g}from"./chunk-AFUS3PYG.js";import"./chunk-L4EVZZOM.js";import"./chunk-SYBUINNV.js";import{Db as p,Jb as d,Lb as l,Oa as s,X as r,Z as u,bb as a,jb as o,kb as n,lb as i}from"./chunk-RBNO3K72.js";var F=e=>["/restore-flow",e,"select-files"],R=e=>["/restore-flow",e,"options"],c=class e{#t=r(f);#e=r(S);backupId=this.#e.backupId;ngOnInit(){this.#e.init(this.#t.snapshot.params.id)}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=u({type:e,selectors:[["app-restore-flow"]],standalone:!0,features:[d],decls:9,vars:6,consts:[["spk-step","","routerLinkActive","active",3,"routerLink"]],template:function(t,m){t&1&&(o(0,"spk-stepper")(1,"div",0),i(2,"spk-radio"),p(3," Select files "),n(),o(4,"div",0),i(5,"spk-radio"),p(6," Options "),n()(),o(7,"section"),i(8,"router-outlet"),n()),t&2&&(s(),a("routerLink",l(2,F,m.backupId())),s(3),a("routerLink",l(4,R,m.backupId())))},dependencies:[v,C,k,w,g],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 N}from"./chunk-V7LHB36E.js";import{a as M}from"./chunk-WU4K3UNC.js";import{k as V}from"./chunk-
|
|
1
|
+
import{a as N}from"./chunk-V7LHB36E.js";import{a as M}from"./chunk-WU4K3UNC.js";import{k as V}from"./chunk-LNCAETYE.js";import{a as O,b as L}from"./chunk-SYBUINNV.js";import{$a as T,$b as d,Db as m,G as h,Gb as b,Jb as A,M as I,Oa as l,Ob as E,Pb as R,R as C,Ua as i,X as r,Z as _,a as k,aa as x,b as S,bb as p,bc as P,fb as w,jb as o,kb as u,lb as c,o as B,rb as v,s as D}from"./chunk-RBNO3K72.js";var f=class a{#t=r(N);transform(e,...t){return this.#t(e).fromNow()}static \u0275fac=function(t){return new(t||a)};static \u0275pipe=x({name:"appRelativeTime",type:a,pure:!0,standalone:!0})};var g=class a{#t=1e3;#d=r(L);#o=r(O);#n=r(M);#e=i(!1);#i=i(!1);#u=i(this.#t);#p=i(null);#r=i(!1);#s=i(!1);#a=i(null);#f=i(!1);statusData=this.#p.asReadonly();serverState=d(()=>{let e=this.#a();return e?(e.ProposedSchedule=e?.ProposedSchedule?.map(t=>{let s=t.Item1?this.#n.getBackupById(t.Item1):null;return S(k({},t),{backup:s})}),e):null});isFetching=this.#i.asReadonly();#l=null;#g=P(()=>{let e=this.#e(),t=this.#u();if(!e||!t||t<this.#t){this.#l&&window.clearInterval(this.#l);return}this.#l=window.setInterval(()=>{this.#m()},t)});start(){this.#r.set(!0),this.#c()}stop(){this.#r.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=P(()=>{if(this.#f()){this.stopPollingProgress();return}!this.#s()&&this.#r()?setTimeout(()=>{this.startPollingProgress(),this.#c()},1e3):this.stopPollingProgress()},{allowSignalWrites:!0});#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(h(()=>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(I(e=>{let t=e.TaskID??null;return t===null?B(e):this.#o.getApiV1TaskByTaskid({taskid:t}).pipe(D(s=>S(k({},e),{task:s??null})))}),h(()=>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=C({token:a,factory:a.\u0275fac,providedIn:"root"})};function G(a,e){if(a&1&&(o(0,"div",2),m(1),u(),c(2,"spk-progress-bar",3)),a&2){let t,s,n=v();l(),b("",(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,""),l(),p("value",(s=n.statusData())!=null&&s.OverallProgress?((s=n.statusData())==null?null:s.OverallProgress)*100:3)}}function F(a,e){if(a&1&&(o(0,"div",2),m(1),E(2,"appRelativeTime"),u(),c(3,"spk-progress-bar",4)),a&2){let t,s=v();l(),b("",(t=s.nextBackup().backup)==null||t.Backup==null?null:t.Backup.Name," - ",R(2,3,s.nextBackup().time),""),l(2),p("value",3)}}function J(a,e){a&1&&(o(0,"div",2),m(1,"No scheduled tasks"),u(),c(2,"spk-progress-bar",4)),a&2&&(l(2),p("value",3))}function U(a,e){a&1&&(o(0,"div",2),m(1,"Loading..."),u(),c(2,"spk-progress-bar",4)),a&2&&(l(2),p("value",3))}var y=class a{#t=r(g);statusData=this.#t.statusData;serverState=this.#t.serverState;nextBackup=d(()=>({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=_({type:a,selectors:[["app-status-bar"]],standalone:!0,features:[A],decls:6,vars:1,consts:[[1,"current-backup"],[1,"current-backup-progress"],[1,"label"],[1,"raised","primary",3,"value"],[1,"raised",3,"value"]],template:function(t,s){if(t&1&&(o(0,"div",0)(1,"div",1),T(2,G,3,3)(3,F,4,5)(4,J,3,1)(5,U,3,1),u()()),t&2){let n;l(2),w(!((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()?3:!s.statusData()||((n=s.statusData())==null||n.task==null?null:n.task.Status)==="Completed"?4:5)}},dependencies:[V,f],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;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{y as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as a,d as b}from"./chunk-G3ZRG5MJ.js";import"./chunk-5Y47Y3RB.js";import"./chunk-YJ2MWFHK.js";import"./chunk-P4AWKIXG.js";import"./chunk-C52YH32J.js";import"./chunk-LNCAETYE.js";import"./chunk-AFUS3PYG.js";import"./chunk-L4EVZZOM.js";import"./chunk-SYBUINNV.js";import"./chunk-RBNO3K72.js";export{a as createRestoreSelectFilesForm,b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as P}from"./chunk-
|
|
1
|
+
import{a as P}from"./chunk-CQGUEKNU.js";import"./chunk-V7LHB36E.js";import{a as I}from"./chunk-WU4K3UNC.js";import{a as y,d as M,e as D,k as R}from"./chunk-LNCAETYE.js";import{d as v}from"./chunk-AFUS3PYG.js";import"./chunk-L4EVZZOM.js";import{a as O}from"./chunk-SYBUINNV.js";import{$a as d,Db as r,Fb as B,Gb as S,Jb as b,Lb as h,Oa as l,X as s,Z as m,bb as k,fb as f,gb as g,hb as C,ib as _,jb as i,kb as p,lb as c,rb as x}from"./chunk-RBNO3K72.js";var w=e=>["/restore-flow",e];function L(e,o){e&1&&c(0,"spk-progress-bar",0)}function T(e,o){if(e&1&&(i(0,"spk-card",1),c(1,"img",2),i(2,"div",3)(3,"h3"),r(4),p(),i(5,"p"),r(6),p()(),i(7,"button",4),r(8," Restore "),i(9,"spk-icon"),r(10,"arrow-right"),p()()()),e&2){let t,a,n=o.$implicit;l(4),B("Restore ",(t=n.Backup==null?null:n.Backup.Name)!==null&&t!==void 0?t:"Backup name missing",""),l(2),S(" ",(a=n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.SourceSizeString)!==null&&a!==void 0?a:"-"," / ",(a=n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.BackupListCount)!==null&&a!==void 0?a:"-"," "),l(),k("routerLink",h(4,w,n.Backup==null?null:n.Backup.ID))}}function E(e,o){if(e&1&&C(0,T,11,6,"spk-card",1,g),e&2){let t=x();_(t.backups())}}function N(e,o){e&1&&r(0," No backups found ")}var u=class e{#e=s(I);#t=s(O);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=m({type:e,selectors:[["app-restore"]],standalone:!0,features:[b],decls:7,vars:1,consts:[[1,"indeterminate","primary"],[1,"type-a"],["src","assets/images/folder.png","alt","","width","48px"],[1,"text"],["spk-button","",3,"routerLink"]],template:function(t,a){t&1&&(c(0,"app-status-bar"),i(1,"section")(2,"h2"),r(3,"Where do you want to restore from?"),p(),d(4,L,1,0,"spk-progress-bar",0)(5,E,2,0)(6,N,1,0),p()),t&2&&(l(4),f(a.backupsLoading()?4:a.backups().length?5:6))},dependencies:[P,D,M,y,R,v],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{u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(t,r,l="conditional"){return a=>{if(!a.parent)return null;let n=null;if(t(a.parent)&&(n=(Array.isArray(r)?r:[r]).find(u=>u(a)!==null)??null),l&&n){let o={};o[l]=n,n=o}return n}}function i(){return t=>(t.parent&&Object.values(t.parent.controls).forEach(r=>{r!==t&&r.updateValueAndValidity()}),null)}export{e as a,i as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as N}from"./chunk-K4KGTWQK.js";import"./chunk-JDCFQ6PF.js";import{b as f,c as d,d as C,e as h,f as b,i as y,l as v,o as F,q as S}from"./chunk-C52YH32J.js";import{a as w,d as _,h as x}from"./chunk-LNCAETYE.js";import{c as g}from"./chunk-AFUS3PYG.js";import"./chunk-L4EVZZOM.js";import"./chunk-SYBUINNV.js";import{Db as i,Jb as c,X as o,Z as m,bb as l,jb as e,kb as n,lb as p,qb as u}from"./chunk-RBNO3K72.js";var k=new F,r=class a{#e=o(g);#t=o(N);loginForm=k.group({pass:k.control("",d.required)});submit(){this.loginForm.value.pass&&this.#t.login(this.loginForm.value.pass).subscribe({next:()=>this.#e.navigate(["/"])})}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=m({type:a,selectors:[["app-login"]],standalone:!0,features:[c],decls:8,vars:1,consts:[[3,"submit","formGroup"],[1,"login-row"],["type","password","placeholder","Enter your password","tabindex","1","formControlName","pass"],["spk-button","","type","submit",1,"raised","primary"]],template:function(t,s){t&1&&(e(0,"form",0),u("submit",function(){return s.submit()}),e(1,"div",1)(2,"spk-form-field"),p(3,"input",2),n(),e(4,"button",3),i(5," Login "),e(6,"spk-icon"),i(7,"arrow-right"),n()()()()),t&2&&l("formGroup",s.loginForm)},dependencies:[S,b,f,C,h,y,v,x,w,_],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{width:100vw;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1.5rem}h3[_ngcontent-%COMP%]{font:var(--title-30)}.login-row[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}"],changeDetection:0})};export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as be}from"./chunk-5Y47Y3RB.js";import{a as L,b as Ce}from"./chunk-
|
|
1
|
+
import{a as be}from"./chunk-5Y47Y3RB.js";import{a as L,b as Ce}from"./chunk-YJ2MWFHK.js";import{b as q}from"./chunk-P4AWKIXG.js";import{a as me,b as O,d as V,e as E,f as T,g as ce,h as ue,i as P,l as R,m as de,n as fe,o as N,q as I}from"./chunk-C52YH32J.js";import{a as B,d as D,k as ge,l as he,n as Fe,q as Se}from"./chunk-LNCAETYE.js";import{a as w,c as C}from"./chunk-AFUS3PYG.js";import{a as M}from"./chunk-SYBUINNV.js";import{$a as $,$b as pe,D as Y,Db as r,G as j,Gb as re,Ib as se,Jb as x,L as Z,M as ee,Oa as u,Ob as le,Qb as ae,R as te,Ua as d,X as p,Z as k,bb as c,f as K,fb as J,gb as ie,ha as f,hb as oe,ia as g,ib as ne,jb as i,kb as n,lb as m,mb as h,mc as _,nb as F,o as Q,pb as y,qb as S,rb as W,s as U,y as X}from"./chunk-RBNO3K72.js";function we(l,t){l&1&&m(0,"spk-progress-bar",3)}function Oe(l,t){if(l&1&&(i(0,"option",10),r(1),le(2,"date"),n()),l&2){let e=t.$implicit;c("value",e.Version),u(),re("",e.Version,": ",ae(2,3,e.Time,"d MMM y, h:mm"),"")}}function Ve(l,t){if(l&1&&(i(0,"app-file-tree",11)(1,"label",12),r(2,"Path"),n(),m(3,"input",13),n()),l&2){let e=W(2);c("rootPath",e.rootPath())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function Ee(l,t){if(l&1&&(i(0,"spk-select",7),m(1,"input",8),h(2,9),oe(3,Oe,3,6,"option",10,ie),F(),n(),$(5,Ve,4,4,"app-file-tree",11)),l&2){let e=W();c("displayFn",e.displayFn()),u(3),ne(e.versionOptions()),u(2),J(e.rootPathLoaded()?5:-1)}}var A=new N,ke=()=>A.group({filesToRestore:A.control(""),selectedOption:A.control(null),passphrase:A.control(null)}),z=class l{#t=p(M);#e=p(b);#i=p(C);#o=p(w);#n=p(_);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;backupSettings=pe(()=>{let t=this.backupId(),e=this.selectFilesFormSignal()?.selectedOption;if(typeof e!="number"||!t)return null;let s=this.versionOptions()?.find(a=>a.Version===e)?.Time??null;return s?{id:t,time:s}:null});rootPathLoaded=d(!1);rootPath=be([this.selectFilesFormSignal,this.backupId],K(Z([null,null]),ee(([t,e])=>{let o=t?.selectedOption,s=e;if(typeof o!="number"||!s)return Q("/");let a=this.versionOptions()?.find(G=>G.Version===o);return this.#t.getApiV1BackupByIdFiles({id:s,time:a?.Time??"",prefixOnly:!1,folderContents:!0}).pipe(U(G=>(this.rootPathLoaded.set(!0),G.Files[0].Path)))})));displayFn(){let t=this.versionOptions();return e=>{if(!e)return"";let o=t?.find(s=>s.Version?.toString()===e);return o?`${o.Version}: ${this.#n.transform(o.Time,"d MMM y, h:mm")}`:""}}next(){this.#i.navigate(["options"],{relativeTo:this.#o.parent})}exit(){this.#e.exit()}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=k({type:l,selectors:[["app-select-files"]],standalone:!0,features:[se([_]),x],decls:15,vars:2,consts:[["formRef",""],[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","number","placeholder","Select an option...","formControlName","selectedOption"],["options",""],[3,"value"],[3,"rootPath","backupSettings","multiSelect","showFiles"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]],template:function(e,o){if(e&1){let s=y();i(0,"form",1,0),S("submit",function(){return f(s),g(o.next())}),i(2,"h3",2),r(3,"Select files"),n(),$(4,we,1,0,"spk-progress-bar",3)(5,Ee,6,2),i(6,"div",4)(7,"button",5),S("click",function(){return f(s),g(o.exit())}),i(8,"spk-icon"),r(9,"arrow-left"),n(),r(10," Exit "),n(),i(11,"button",6)(12,"spk-icon"),r(13,"arrow-right"),n(),r(14," Continue "),n()()()}e&2&&(c("formGroup",o.selectFilesForm),u(4),J(o.versionOptionsLoading()?4:5))},dependencies:[I,T,de,fe,O,ce,V,E,P,R,_,L,D,B,Fe,ge],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 b=class l{#t=p(C);#e=p(M);backupId=d(null);backup=d(null);selectFilesForm=ke();optionsForm=ye();optionsFormSignal=q(this.optionsForm.valueChanges);selectFilesFormSignal=q(this.selectFilesForm.valueChanges);versionOptionsLoading=d(!1);versionOptions=d([]);isSubmitting=d(!1);init(t){this.backupId.set(t),this.#i(t,!0)}submit(){this.isSubmitting.set(!0);let t=this.backupId(),e=this.optionsForm.value,o=this.selectFilesForm.value,s=this.versionOptions()?.find(a=>a.Version===o.selectedOption);this.#e.postApiV1BackupByIdRestore({id:t??"",requestBody:{paths:o.filesToRestore?.split("\0").map(a=>`${a}*`)??[],passphrase:o.passphrase??null,time:s?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!0}}).pipe(j(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.exit()},error:a=>{console.error("restore error",a)}})}exit(){this.#o(),this.#t.navigate(["/"])}getVersionOptions(){this.versionOptions()}#i(t,e=!1){this.versionOptionsLoading.set(!0),X([this.#e.getApiV1BackupById({id:t}),this.#e.getApiV1BackupByIdFilesets({id:t})]).pipe(Y(1),j(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([o,s])=>{this.versionOptions.set(s),this.backup.set(o),e&&this.selectFilesForm.controls.selectedOption.setValue(s[0].Version)}})}#o(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||l)};static \u0275prov=te({token:l,factory:l.\u0275fac,providedIn:"root"})};var v=new N,ye=()=>v.group({restoreFrom:v.control("orignal"),restoreFromPath:v.control(""),handleExisting:v.control("overwrite"),permissions:v.control(!1)}),H=class l{#t=p(b);#e=p(C);#i=p(w);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#i.parent})}submit(){this.#t.submit()}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=k({type:l,selectors:[["app-options"]],standalone:!0,features:[x],decls:41,vars:4,consts:[["formRef",""],[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 s=y();i(0,"form",1,0),S("submit",function(){return f(s),g(o.submit())}),i(2,"h3",2),r(3,"Restore options"),n(),i(4,"app-toggle-card",3),h(5,4),r(6,"Where do you want to restore files from?"),F(),i(7,"spk-radio",5),r(8," Original location "),m(9,"input",6),n(),i(10,"spk-radio",5),r(11," Pick location "),m(12,"input",7),n(),i(13,"app-file-tree",8)(14,"label",9),r(15,"Path"),n(),m(16,"input",10),n()(),i(17,"app-toggle-card",3),h(18,4),r(19,"How do you want to handle existing files?"),F(),i(20,"spk-radio",5),r(21," Overwrite "),m(22,"input",11),n(),i(23,"spk-radio",5),r(24," Save different versions with timestamp in file name "),m(25,"input",12),n()(),i(26,"app-toggle-card"),h(27,4),r(28,"Permissions"),F(),i(29,"spk-toggle",13),r(30," Restore read/write permissions "),m(31,"input",14),n()(),i(32,"div",15)(33,"button",16),S("click",function(){return f(s),g(o.goBack())}),i(34,"spk-icon"),r(35,"arrow-left"),n(),r(36," Go back "),n(),i(37,"button",17)(38,"spk-icon"),r(39,"arrow-right"),n(),r(40," Submit "),n()()()}if(e&2){let s;c("formGroup",o.optionsForm),u(4),c("disallowToggle",!0),u(9),c("disabled",((s=o.optionsFormSignal())==null?null:s.restoreFrom)!=="pickLocation"),u(4),c("disallowToggle",!0)}},dependencies:[I,T,O,me,ue,V,E,P,R,Ce,L,Se,he,D,B],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{ye as a,H as b,ke as c,z as d,b as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as a,k as b}from"./chunk-VOMOARSI.js";import"./chunk-YJ2MWFHK.js";import"./chunk-TIGGJ4KF.js";import"./chunk-DNHLTHLR.js";import"./chunk-P4AWKIXG.js";import"./chunk-C52YH32J.js";import"./chunk-LNCAETYE.js";import"./chunk-AFUS3PYG.js";import"./chunk-L4EVZZOM.js";import"./chunk-SYBUINNV.js";import"./chunk-RBNO3K72.js";export{a as createScheduleForm,b as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$a as I,$b as k,Ab as V,Bb as L,Db as b,Eb as J,Fb as K,Jb as m,Oa as _,R as $,Ra as U,Ua as c,Va as F,Wa as D,X as T,Z as f,a as B,b as R,bb as X,bc as O,cb as W,db as H,eb as q,fb as A,gb as z,ha as d,hb as G,ia as u,ib as Y,jb as l,kb as a,kc as Z,lb as M,ma as Q,pb as E,qb as S,rb as p,sa as N,sb as g,ta as v,tb as r,ua as P}from"./chunk-RBNO3K72.js";var y=["*"];var te=["spk-button",""],ie=["inputWrap"];var ne=[[["label"]],[["","spkPrefix",""]],[["","spkTextPrefix",""]],[["input"]],[["textarea"]],[["","spkTextSuffix",""]],[["","spkSuffix",""]],[["","spkError",""]],[["","spkHint",""]]],oe=["label","[spkPrefix]","[spkTextPrefix]","input","textarea","[spkTextSuffix]","[spkSuffix]","[spkError]","[spkHint]"],se=["actionRef"],re=["menuRef"],le=["*",[["","menu",""]]],ae=["*","[menu]"];var ce=["optionsRef"],pe=["formFieldWrapper"],de=[[["label"]],[["input"]],[["","deselect-indicator",""]],[["","search-indicator",""]],[["","open-indicator",""]],[["","placeholder-text",""]],[["","options",""]]],ue=["label","input","[deselect-indicator]","[search-indicator]","[open-indicator]","[placeholder-text]","[options]"];function he(n,x){if(n&1){let e=E();l(0,"spk-chip",11),S("click",function(i){let o=d(e).$implicit,s=p(3);return u(s.toggleOption(o,i))}),b(1),l(2,"spk-icon"),b(3,"x-circle"),a()()}if(n&2){let e,t=x.$implicit,i=p(3);X("ngClass",i.chipClass()),_(),K(" ",(e=(e=i.displayFn())==null?null:e(t))!==null&&e!==void 0?e:t," ")}}function fe(n,x){if(n&1&&G(0,he,4,2,"spk-chip",10,z),n&2){let e=p(2);Y(e.inputValue().split(","))}}function me(n,x){if(n&1&&(l(0,"div",5),I(1,fe,2,0),a()),n&2){let e=p();_(),A(e.inputValue().length>0?1:-1)}}function ge(n,x){if(n&1&&(l(0,"div",5),b(1),a()),n&2){let e=p();_(),J(e._displayValue())}}function ve(n,x){if(n&1){let e=E();l(0,"div",12),S("click",function(i){d(e);let o=p();return u(o.deselect(i))}),r(1,2),l(2,"spk-icon",13),b(3,"x-circle"),a()()}}function Se(n,x){n&1&&(l(0,"div",7),r(1,3),l(2,"spk-icon",13),b(3,"magnifying-glass"),a()())}function Ce(n,x){if(n&1&&(l(0,"div",14),r(1,4),l(2,"spk-icon",13),b(3,"caret-down"),a()()),n&2){let e=p();H("open",e.isOpen())}}function _e(n,x){if(n&1){let e=E();l(0,"div",15,2)(2,"div",16),S("click",function(){d(e);let i=p();return u(i.close())}),a(),l(3,"div",17)(4,"div",18),r(5,5),a(),r(6,6),a()()}if(n&2){let e=p();q(e.optionsStyle()),H("active",e.delayedIsOpen())}}var ke=["dragImageElement"],ye=[[["","sidenav",""]],[["","sidenav-closed-topbar",""]],"*"],xe=["[sidenav]","[sidenav-closed-topbar]","*"];function we(n,x){if(n&1){let e=E();l(0,"div",7),S("drop",function(i){d(e);let o=p();return u(o.drop(i))})("dragover",function(i){d(e);let o=p();return u(o.dragOver(i))})("dragenter",function(){d(e);let i=p();return u(i.dragEnter())})("dragleave",function(){d(e);let i=p();return u(i.dragLeave())}),a()}}function De(n,x){if(n&1){let e=E();l(0,"div",8),S("dragstart",function(i){d(e);let o=p();return u(o.dragStart(i))})("dragend",function(i){d(e);let o=p();return u(o.dragEnd(i))})("drag",function(i){d(e);let o=p();return u(o.drag(i))})("touchstart",function(i){d(e);let o=p();return u(o.touchStart(i))})("touchmove",function(i){d(e);let o=p();return u(o.touchMove(i))})("touchend",function(i){d(e);let o=p();return u(o.touchEnd(i))})("touchcancel",function(i){d(e);let o=p();return u(o.touchCancel(i))}),a()}}var ee=(()=>{class n{static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=f({type:n,selectors:[["spk-icon"]],standalone:!0,features:[m],ngContentSelectors:y,decls:1,vars:0,template:function(t,i){t&1&&(g(),r(0))},encapsulation:2,changeDetection:0})}}return n})();var Ye=(()=>{class n{constructor(){this.alertHistory=c([]),this.alertHistoryIsOpen=c(!1),this.alertHistoryIsHidden=c(!0)}error(e){this.addAlert({type:"error",title:e??"An error occured"})}success(e){this.addAlert({type:"success",title:e})}question(e){this.addAlert({type:"question",title:e})}warning(e){this.addAlert({type:"warning",title:e})}info(e){this.addAlert({type:"primary",title:e})}addAlert(e){let t=crypto.randomUUID();this.alertHistory.update(i=>[R(B({},e),{isOpen:!0,animateIn:!0,animateOut:!1,id:t}),...i]),setTimeout(()=>{this.alertHistory.update(i=>i.map(o=>R(B({},o),{animateIn:o.id===t?!1:o.animateIn})))},40),setTimeout(()=>{this.hideAlert(t)},2500)}removeAlert(e){this.alertHistory.update(t=>t.map(i=>R(B({},i),{animateOut:i.id===e?!1:i.animateOut}))),setTimeout(()=>{this.alertHistory.update(t=>t.filter(i=>i.id!==e))},300)}hideAlert(e){this.alertHistory.update(t=>t.map(i=>R(B({},i),{isOpen:i.id===e?!1:i.isOpen})))}setHidden(e){this.alertHistoryIsHidden.set(e)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=$({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})(),Je=(()=>{class n{static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=f({type:n,selectors:[["spk-button-group"]],standalone:!0,features:[m],ngContentSelectors:y,decls:1,vars:0,template:function(t,i){t&1&&(g(),r(0))},encapsulation:2,changeDetection:0})}}return n})(),Ke=(()=>{class n{static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=f({type:n,selectors:[["","spk-button",""]],standalone:!0,features:[m],attrs:te,ngContentSelectors:y,decls:1,vars:0,template:function(t,i){t&1&&(g(),r(0))},encapsulation:2,changeDetection:0})}}return n})(),Ze=(()=>{class n{static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=f({type:n,selectors:[["spk-card"]],standalone:!0,features:[m],ngContentSelectors:y,decls:1,vars:0,template:function(t,i){t&1&&(g(),r(0))},encapsulation:2,changeDetection:0})}}return n})(),et=(()=>{class n{#e=T(P);onClick(){this.#e.nativeElement.querySelector("input")&&this.#e.nativeElement.querySelector("input").focus()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=f({type:n,selectors:[["spk-checkbox"]],hostBindings:function(t,i){t&1&&S("click",function(){return i.onClick()})},standalone:!0,features:[m],ngContentSelectors:y,decls:4,vars:0,consts:[[1,"box"],[1,"inherit"]],template:function(t,i){t&1&&(g(),l(0,"div",0)(1,"spk-icon",1),b(2,"check"),a()(),r(3))},dependencies:[ee],encapsulation:2,changeDetection:0})}}return n})(),Ee=(()=>{class n{static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=f({type:n,selectors:[["spk-chip"]],standalone:!0,features:[m],ngContentSelectors:y,decls:1,vars:0,template:function(t,i){t&1&&(g(),r(0))},encapsulation:2,changeDetection:0})}}return n})();var be=(()=>{class n{#e=T(P);onClick(){this.#e.nativeElement.querySelector("input")&&this.#e.nativeElement.querySelector("input").focus(),this.#e.nativeElement.querySelector("textarea")&&this.#e.nativeElement.querySelector("textarea").focus()}ngOnInit(){let e=CSS.supports("field-sizing","content"),t=this.#e.nativeElement.querySelector("textarea");if(!e&&t!==null){let h=function(){s.style.height="auto",s.style.height=s.scrollHeight+"px"},w=function(){window.setTimeout(h,0)};var i=h,o=w;let s=this.#e.nativeElement.querySelector("textarea");s.addEventListener("change",h),s.addEventListener("cut",w),s.addEventListener("paste",w),s.addEventListener("drop",w),s.addEventListener("keydown",w),s.focus(),s.select(),h()}}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=f({type:n,selectors:[["spk-form-field"]],hostBindings:function(t,i){t&1&&S("click",function(){return i.onClick()})},standalone:!0,features:[m],ngContentSelectors:oe,decls:16,vars:0,consts:[[1,"input-wrap"],[1,"prefix"],[1,"prefix-spacer"],[1,"suffix-spacer"],[1,"helpers"],[1,"error"],[1,"hint"]],template:function(t,i){t&1&&(g(ne),r(0),l(1,"div",0)(2,"div",1),r(3,1),r(4,2),a(),M(5,"div",2),r(6,3),r(7,4),r(8,5),M(9,"div",3),r(10,6),a(),l(11,"div",4)(12,"div",5),r(13,7),a(),l(14,"div",6),r(15,8),a()())},encapsulation:2,changeDetection:0})}}return n})(),tt=(()=>{class n{static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=f({type:n,selectors:[["spk-list"]],standalone:!0,features:[m],ngContentSelectors:y,decls:1,vars:0,template:function(t,i){t&1&&(g(),r(0))},encapsulation:2,changeDetection:0})}}return n})(),it=(()=>{class n{constructor(){this.injector=T(Q),this.#e=8,this.above=v(!1),this.right=v(!1),this.closeAction=N(),this.isActive=D(!1),this.optionInFocus=D(null),this.actionRef=F.required("actionRef"),this.menuRef=F.required("menuRef"),this.menuEl=k(()=>this.menuRef()?.nativeElement),this.menuStyle=c({left:"0px",top:"0px"}),this.optionsElTrigger=c(!1),this.options=k(()=>{let e=this.menuEl().querySelectorAll("[option]:not([disabled])");return this.optionsElTrigger(),this.isActive(),Array.from(e)}),this.#t=c(null),this.optionElementInFocus=D(null),this.#l=c(null),this.selectedOption=D(null),this.selectedOptionIndex=D(null),this.#r=document.getElementsByTagName("body")[0],this.optionInFocusEffect=O(()=>{if(this.optionInFocus()===null&&this.#t()){this.#t()?.classList.remove("focused");return}if(this.options().length===0||this.optionInFocus()===null)return;let e=this.options().at(this.optionInFocus());this.#t()&&this.#t()?.classList.remove("focused"),e?(e.classList.add("focused"),e.scrollIntoView({block:"nearest"}),this.#t.set(e),this.optionElementInFocus.set(e)):this.optionElementInFocus.set(null)},{allowSignalWrites:!0,injector:this.injector}),this.controller=null,this.whenActive=O(()=>{this.isActive()?(this.setNewController(),this.#a(),this.calculateMenuPosition(),setTimeout(()=>{let e=this.options().findIndex(t=>t.getAttribute("value")===this.selectedOption()?.getAttribute("value"));this.optionInFocus()===null&&this.optionInFocus.set(e>-1?e:0)},0),window.addEventListener("resize",()=>this.calculateMenuPosition(),{signal:this.controller?.signal}),window.addEventListener("scroll",()=>this.calculateMenuPosition(),{signal:this.controller?.signal}),window.addEventListener("keydown",e=>{e.key==="ArrowDown"?this.optionInFocus()===null||this.optionInFocus()===this.options().length-1?this.optionInFocus.set(0):this.optionInFocus.set(this.optionInFocus()+1):e.key==="ArrowUp"?this.optionInFocus()===null||this.optionInFocus()===0?this.optionInFocus.set(this.options().length-1):this.optionInFocus.set(this.optionInFocus()-1):e.key==="Enter"?(this.optionElementInFocus()&&this.selectOption(this.optionElementInFocus()),this.close("selected")):e.key==="Escape"?this.close("closed"):setTimeout(()=>{this.optionInFocus.set(0),this.optionsElTrigger.set(!this.optionsElTrigger())},0)},{signal:this.controller?.signal})):this.#s()},{allowSignalWrites:!0,injector:this.injector})}#e;#t;#l;#r;setNewController(){this.controller?.abort(),this.controller=new AbortController}deselectOption(){this.#l.set(null),this.selectedOption.set(null),this.selectedOptionIndex.set(null)}setSelectedOption(e){let t=this.options().find(i=>i.hasAttribute("value")&&i.getAttribute("value")===e);t&&this.selectOption(t)}selectOption(e){this.selectedOption()&&this.#l.set(this.selectedOption()),this.selectedOption.set(e),this.selectedOptionIndex.set(this.options().indexOf(e)),e.dispatchEvent(new Event("click",{bubbles:!0,cancelable:!0}))}selectCurrentOption(){let e=this.selectedOptionIndex(),t=this.options().at(e);t&&this.selectOption(t)}#a(){this.#r.appendChild(this.menuEl())}#s(){this.#r.removeChild(this.menuEl())}ngOnInit(){this.#a()}toggle(){this.isActive.set(!this.isActive())}close(e="closed"){this.controller?.abort(),this.isActive.set(!1),this.closeAction.emit(e)}calculateMenuPosition(){if(this.isActive()){let e=this.actionRef()?.nativeElement.getBoundingClientRect(),t=this.menuEl().getBoundingClientRect(),i=e.left,o=e.bottom,s=i,h=o+this.#e,w=s+t.width>window.innerWidth,j=h+t.height>window.innerHeight;if(this.above()){let C=e.top-t.height-this.#e;C>=0&&(h=C)}else j&&(h=e.top-t.height-this.#e);if(this.right()){let C=e.right-t.width;C>=0&&(s=C)}else w&&(h=j?e.top+e.height-t.height:e.top,s=e.left-t.width-this.#e);this.menuStyle.set({left:s+"px",top:h+"px"})}}ngOnDestroy(){this.#r.contains(this.menuEl())&&this.#s()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=f({type:n,selectors:[["spk-menu"]],viewQuery:function(t,i){t&1&&(V(i.actionRef,se,5),V(i.menuRef,re,5)),t&2&&L(2)},hostVars:2,hostBindings:function(t,i){t&2&&H("active",i.isActive())},inputs:{above:[1,"above"],right:[1,"right"],isActive:[1,"isActive"],optionInFocus:[1,"optionInFocus"],optionElementInFocus:[1,"optionElementInFocus"],selectedOption:[1,"selectedOption"],selectedOptionIndex:[1,"selectedOptionIndex"]},outputs:{closeAction:"closeAction",isActive:"isActiveChange",optionInFocus:"optionInFocusChange",optionElementInFocus:"optionElementInFocusChange",selectedOption:"selectedOptionChange",selectedOptionIndex:"selectedOptionIndexChange"},standalone:!0,features:[m],ngContentSelectors:ae,decls:8,vars:8,consts:[["actionRef",""],["menuRef",""],[1,"action",3,"click"],[1,"sparkle-popup-menu"],[1,"sparkle-menu-backdrop",3,"click"],[1,"sparkle-options",3,"click"]],template:function(t,i){if(t&1){let o=E();g(le),l(0,"div",2,0),S("click",function(){return d(o),u(i.toggle())}),r(2),a(),l(3,"div",3,1)(5,"div",4),S("click",function(){return d(o),u(i.close("closed"))}),a(),l(6,"div",5),S("click",function(){return d(o),u(i.close("selected"))}),r(7,1),a()()}t&2&&(_(3),q(i.menuStyle()),H("right",i.right())("above",i.above())("active",i.isActive()))},encapsulation:2,changeDetection:0})}}return n})(),nt=(()=>{class n{constructor(){this.value=v(void 0)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=f({type:n,selectors:[["spk-progress-bar"]],inputs:{value:[1,"value"]},standalone:!0,features:[m],decls:1,vars:2,consts:[[1,"progress-bar"]],template:function(t,i){t&1&&M(0,"div",0),t&2&&W("width",i.value(),"%")},encapsulation:2,changeDetection:0})}}return n})(),ot=(()=>{class n{#e=T(P);onClick(){this.#e.nativeElement.querySelector("input")&&this.#e.nativeElement.querySelector("input").focus()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=f({type:n,selectors:[["spk-radio"]],hostBindings:function(t,i){t&1&&S("click",function(){return i.onClick()})},standalone:!0,features:[m],ngContentSelectors:y,decls:2,vars:0,consts:[[1,"radio"]],template:function(t,i){t&1&&(g(),M(0,"div",0),r(1))},encapsulation:2,changeDetection:0})}}return n})();var st=(()=>{class n{constructor(){this.value=v(null)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=f({type:n,selectors:[["spk-option"]],inputs:{value:[1,"value"]},standalone:!0,features:[m],ngContentSelectors:y,decls:1,vars:0,template:function(t,i){t&1&&(g(),r(0))},encapsulation:2,changeDetection:0})}}return n})(),Oe=["primary","accent","tertiary","warn","success"],rt=(()=>{class n{constructor(){this.#e=8,this.#t=T(U),this.#l=document.getElementsByTagName("body")[0],this.#r=T(P),this.optionsRef=F("optionsRef"),this.formFieldWrapperRef=F.required("formFieldWrapper"),this.inputWrapRef=F.required("inputWrap"),this.inputValue=D(""),this.selectMultiple=v(!1),this.hideClearButton=v(!1),this.displayValue=v(""),this.displayFn=v(null),this.above=v(!1),this.right=v(!1),this.#a=c(!1),this.#s=c(!1),this.#i=c(null),this.#c=c(""),this.#d=c(-1),this.#p=c(!1),this.#n=c(-1),this.isOpen=c(!1),this.delayedIsOpen=c(!1),this.optionsStyle=c({left:"0px",top:"0px"}),this.isSearchInput=k(()=>this.#i()?.type==="search"),this.optionsEl=k(()=>this.optionsRef()?.nativeElement),this.#o=k(()=>{this.#s();let e=this.optionsRef()?.nativeElement.querySelectorAll("option"),t=this.optionsRef()?.nativeElement.querySelectorAll("spk-option");return e?.length?Array.from(e):t?.length?Array.from(t):[]}),this.chipClass=k(()=>Array.from(this.#r.nativeElement.classList).filter(e=>Oe.includes(e)).join(" ")),this._displayValue=k(()=>this.displayFn()?this.displayFn()(this.inputValue()):this.displayValue()??this.inputValue()),this.selectedOption=k(()=>this.#c()?this.#o().find(e=>e.getAttribute("value")===this.#c()):null),this.optionsOpenController=null,this.inputController=null,this.clickController=null,this.inputAbortController=null,this.#g=O(()=>{this.#a();let e=this.#r.nativeElement.querySelector("input");e&&(this.#D(e),e.addEventListener("inputValueChanged",t=>{this.inputValue.set(t.detail.value),this.selectMultiple()&&this.#f()}),this.#i.set(e),e.autocomplete="off",typeof e.value=="string"&&this.inputValue.set(e.value))},{allowSignalWrites:!0}),this.#v=O(()=>{this.inputController&&this.inputController.abort(),this.inputController=new AbortController;let e=this.#i();e&&(e.addEventListener("focus",t=>this.open(t),{signal:this.inputController?.signal}),e.addEventListener("keydown",t=>{(this.selectMultiple()||!this.isSearchInput())&&t.preventDefault(),t.key==="Escape"?this.close():t.key==="ArrowDown"?this.#n()===null||this.#n()<0||this.#n()===this.#o().length-1?this.#n.set(this.#d()):this.#n.set(this.#n()+1):t.key==="ArrowUp"?this.#n()===null||this.#n()<0||this.#n()===0?this.#n.set(this.#o().length-1):this.#n.set(this.#n()-1):t.key==="Enter"?this.#n()>-1&&this.selected(this.getOptionElement(this.#n())):t.key==="Tab"&&this.close(!0)},{signal:this.inputController?.signal}))}),this.#S=O(()=>{this.isOpen()&&this.#y(),setTimeout(()=>{this.delayedIsOpen.set(this.isOpen())},0)}),this.#C=O(()=>{let e=this.inputValue();this.#i()&&(this.#i().value=e??"",this.#i().dispatchEvent(new Event("input")))},{allowSignalWrites:!0}),this.#u=new MutationObserver(e=>{for(var t of e)t.type=="childList"&&t.target.classList.contains("input")&&this.#a.set(!this.#a()),t.type==="attributes"&&t.attributeName})}#e;#t;#l;#r;#a;#s;#i;#c;#d;#p;#n;#o;#g;#v;#S;#C;ngOnInit(){this.#m(),this.#u.observe(this.inputWrapRef().nativeElement,{attributes:!0,childList:!0,subtree:!0})}getOptionElement(e){return this.#o()[e]}deselect(e,t=!1){e?.stopPropagation(),this.#i()&&(this.#i().value="",this.#i().dispatchEvent(new Event("input"))),this.#n.set(this.#d()),this.#p.set(!1),(t||!this.selectMultiple())&&(this.isOpen.set(!1),this.#i()?.blur())}selected(e){if(!e)return;let t=(e.getAttribute("value")||e.getAttribute("ng-reflect-value"))??"",i=this.#o().indexOf(e);if(e.hasAttribute("deselect"))return this.deselect(null,!0);if(this.#n.set(i),e&&!this.selectMultiple()){this.inputValue.set(t);for(let o=0;o<this.#o().length;o++){let s=this.#o()[o];s.getAttribute("value")===t?this.#t.setAttribute(s,"selected","selected"):this.#t.removeAttribute(s,"selected")}}else e&&this.selectMultiple()&&(this.inputValue().includes(t)?(this.#t.removeAttribute(e,"selected"),this.toggleOption(t)):(this.#t.setAttribute(e,"selected","selected"),this.inputValue.set(this.inputValue().length?`${this.inputValue()},${t}`:t)));this.#p.set(!1),this.selectMultiple()?setTimeout(()=>this.#i()?.focus()):(this.isOpen.set(!1),this.#i()?.blur())}toggleOption(e,t){t&&(t.preventDefault(),t.stopPropagation()),this.inputValue.set(this.inputValue().startsWith(e+",")?this.inputValue().replace(e+",",""):this.inputValue().includes(","+e)?this.inputValue().replace(","+e,""):this.inputValue().replace(e,""))}close(e=!1){this.isSearchInput()&&this.#c()&&setTimeout(()=>this.inputValue.set(this.#c())),this.#w(),this.isOpen.set(!1),this.#p.set(!1),e||this.#i()?.blur(),this.#b(),this.#k()}open(e){e.preventDefault(),this.isOpen.set(!0),this.#m(),this.isSearchInput()&&!this.#p()?(this.#c.set(this.inputValue()),this.inputValue.set(""),this.#i().focus(),this.#i().value="",this.#i().dispatchEvent(new Event("input")),this.#n.set(-1)):(this.isSearchInput()||this.selectMultiple())&&this.#i().focus(),this.#p.set(!0),this.#E(),this.#_(),this.#s.set(!this.#s()),this.#f()}#_(){this.clickController&&this.clickController.abort(),this.clickController=new AbortController,window.addEventListener("click",e=>{if(!e.target)return;let t=e.target.closest("option"),i=e.target.closest("spk-option"),o=t||i;this.#o().indexOf(o)>-1&&this.selected(o)},{signal:this.clickController?.signal})}#k(){this.clickController&&this.clickController.abort()}#y(){for(let e=0;e<this.#o().length;e++){let t=this.#o()[e];this.#t.removeClass(t,"focused"),this.#n()===e&&(this.#t.addClass(t,"focused"),t.scrollIntoView({block:"center"}))}}#f(){let e=this.#i();if(!e)return;this.inputValue.set(e.value);let t=e.value.split(",");setTimeout(()=>{let i=this.#o();for(let o=0;o<i.length;o++){let s=i[o].getAttribute("ng-reflect-value");s&&t.includes(s)?this.#t.setAttribute(i[o],"selected","selected"):this.#t.removeAttribute(i[o],"selected")}})}#m(){setTimeout(()=>{this.optionsEl()&&(this.#t.appendChild(this.#l,this.optionsEl()),this.#d.set(this.#x()),this.#s.set(!this.#s()))})}#x(){let e=this.#o();for(let t=0;t<e.length;t++)if(!e[t].hasAttribute("deselect"))return t;return-1}#w(){setTimeout(()=>{this.optionsEl()&&(this.#t.removeChild(this.#l,this.optionsEl()),this.#s.set(!this.#s()))})}#u;#D(e){return Object.defineProperty(e,"value",{configurable:!0,get(){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").get.call(this)},set(t){Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").set.call(this,t);let o=new CustomEvent("inputValueChanged",{bubbles:!0,cancelable:!0,detail:{value:t}});return this.dispatchEvent(o),t}}),e}#E(){this.optionsOpenController=new AbortController,setTimeout(()=>this.#h()),window.addEventListener("resize",()=>this.#h(),{signal:this.optionsOpenController?.signal}),window.addEventListener("scroll",()=>this.#h(),{signal:this.optionsOpenController?.signal})}#b(){this.optionsOpenController&&this.optionsOpenController.abort()}#h(){if(this.optionsEl()){let e=this.formFieldWrapperRef()?.nativeElement.getBoundingClientRect(),t=this.optionsEl().getBoundingClientRect(),i=e.left,o=e.bottom,s=i,h=o+this.#e,w=s+t.width>window.innerWidth,j=h+t.height>window.innerHeight;if(this.above()){let C=e.top-t.height-this.#e;C>=0&&(h=C)}else j&&(h=e.top-t.height-this.#e);if(this.right()){let C=e.right-t.width;C>=0&&(s=C)}else w&&(h=j?e.top+e.height-t.height:e.top,s=e.left-t.width-this.#e);this.optionsStyle.set({left:s+"px",top:h+"px"})}}ngOnDestroy(){this.clickController&&this.clickController.abort(),this.inputController&&this.inputController.abort(),this.optionsOpenController&&this.optionsOpenController.abort(),this.#u.disconnect()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=f({type:n,selectors:[["spk-select"]],viewQuery:function(t,i){t&1&&(V(i.optionsRef,ce,5),V(i.formFieldWrapperRef,pe,5),V(i.inputWrapRef,ie,5)),t&2&&L(3)},inputs:{inputValue:[1,"inputValue"],selectMultiple:[1,"selectMultiple"],hideClearButton:[1,"hideClearButton"],displayValue:[1,"displayValue"],displayFn:[1,"displayFn"],above:[1,"above"],right:[1,"right"]},outputs:{inputValue:"inputValueChange"},standalone:!0,features:[m],ngContentSelectors:ue,decls:13,vars:3,consts:[["formFieldWrapper",""],["inputWrap",""],["optionsRef",""],[3,"click"],["ngProjectAs","input",5,["input"],1,"input"],[1,"display-value"],["spkSuffix","",1,"deselect-indicator"],["spkSuffix","",1,"search-indicator"],["spkSuffix","",1,"select-open-indicator",3,"open"],[1,"sparkle-popup-menu",3,"active","style"],[1,"small","simple",3,"ngClass"],[1,"small","simple",3,"click","ngClass"],["spkSuffix","",1,"deselect-indicator",3,"click"],[1,"default-indicator"],["spkSuffix","",1,"select-open-indicator"],[1,"sparkle-popup-menu"],[1,"sparkle-options-backdrop",3,"click"],[1,"sparkle-options"],[1,"sparkle-options-placerholder"]],template:function(t,i){if(t&1){let o=E();g(de),l(0,"div",null,0)(2,"spk-form-field",3),S("click",function(h){return d(o),u(i.open(h))}),r(3,0,["ngProjectAs","label",5,["label"]]),l(4,"div",4,1),I(6,me,2,1,"div",5)(7,ge,2,1,"div",5),r(8,1),a(),I(9,ve,4,0,"div",6)(10,Se,4,0,"div",7)(11,Ce,4,2,"div",8),a()(),I(12,_e,7,4,"div",9)}t&2&&(_(6),A(i.selectMultiple()?6:i._displayValue()&&i.isSearchInput()&&!i.isOpen()||i._displayValue()&&!i.isSearchInput()?7:-1),_(3),A((i.inputValue()&&!i.isOpen()&&i.inputValue().length>0||i.selectedOption())&&!i.hideClearButton()?9:i.isSearchInput()&&!i.selectedOption()?10:11),_(3),A(i.isOpen()?12:-1))},dependencies:[be,ee,Ee,Z],encapsulation:2,changeDetection:0})}}return n})(),lt=(()=>{class n{constructor(){this.openWidth=280,this.openWidthTreshold=this.openWidth*.9,this.disableDrag=v(!1),this.isOpen=D(!1),this.type=v(""),this.dragImageElement=F.required("dragImageElement"),this.dragIsEnding=c(!1),this.dragIsOnScreen=c(!0),this.isDragging=c(!1),this.dragPositionX=c(0),this.dragActualPositionX=k(()=>{let e=this.dragPositionX(),t=.32;return e>this.openWidthTreshold?this.openWidthTreshold+(e-this.openWidthTreshold)*t:e}),this.draggingStyle=k(()=>this.isDragging()?`translateX(${this.dragActualPositionX()}px)`:this.isOpen()&&this.type()==="overlay"?`translateX(${this.openWidth}px)`:"translateX(0px)"),this.draggingEffect=O(()=>{this.isDragging()&&document.body.classList.add("dragging")})}drop(e){e.stopPropagation(),this.#e(e.clientX)}#e(e){this.isDragging.set(!1),e<=0?this.isOpen.set(!1):e>this.openWidthTreshold?this.isOpen.set(!0):e<this.openWidthTreshold&&(!this.isOpen()&&e<this.openWidthTreshold*.6?this.isOpen.set(!0):this.isOpen.set(!1))}dragEnd(e){(e.clientX<0||!this.dragIsOnScreen())&&this.#e(0)}dragEnter(){this.dragIsOnScreen.set(!0)}dragLeave(){this.dragIsOnScreen.set(!1)}dragOver(e){e.preventDefault(),this.#t(e)}dragStart(e){e.stopPropagation(),this.isDragging.set(!0),this.#t(e)}#t(e){e.dataTransfer?.setDragImage(this.dragImageElement().nativeElement,0,0)}drag(e){e.stopPropagation(),setTimeout(()=>{this.isDragging()&&this.dragIsOnScreen()&&this.dragPositionX.set(e.clientX)}),this.#t(e)}touchStart(e){e.stopPropagation(),this.isDragging.set(!0)}touchMove(e){e.stopPropagation(),setTimeout(()=>{this.isDragging()&&this.dragIsOnScreen()&&this.dragPositionX.set(e.touches[0].clientX)})}touchEnd(e){e.stopPropagation(),this.#e(e.changedTouches[0].clientX)}touchCancel(e){e.stopPropagation(),this.isDragging.set(!1)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=f({type:n,selectors:[["spk-sidenav"]],viewQuery:function(t,i){t&1&&V(i.dragImageElement,ke,5),t&2&&L()},hostVars:10,hostBindings:function(t,i){t&2&&H("open",i.isOpen())("closed",!i.isOpen())("overlay",i.type()==="overlay")("simple",i.type()==="simple")("is-dragging",i.isDragging())},inputs:{disableDrag:[1,"disableDrag"],isOpen:[1,"isOpen"],type:[1,"type"]},outputs:{isOpen:"isOpenChange"},standalone:!0,features:[m],ngContentSelectors:xe,decls:11,vars:4,consts:[["dragImageElement",""],[1,"drag-image"],[1,"dropping-surface"],[1,"sidenav"],[1,"main-wrap"],["draggable","true",1,"dragable"],[1,"closed-topbar"],[1,"dropping-surface",3,"drop","dragover","dragenter","dragleave"],["draggable","true",1,"dragable",3,"dragstart","dragend","drag","touchstart","touchmove","touchend","touchcancel"]],template:function(t,i){t&1&&(g(ye),M(0,"div",1,0),I(2,we,1,0,"div",2),l(3,"div",3),r(4),a(),l(5,"div",4),I(6,De,1,0,"div",5),l(7,"div",6),r(8,1),a(),l(9,"main"),r(10,2),a()()),t&2&&(_(2),A(i.isDragging()?2:-1),_(3),W("transform",i.draggingStyle()),_(),A(i.disableDrag()?-1:6))},encapsulation:2,changeDetection:0})}}return n})();var at=(()=>{class n{static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=f({type:n,selectors:[["spk-stepper"]],standalone:!0,features:[m],ngContentSelectors:y,decls:1,vars:0,template:function(t,i){t&1&&(g(),r(0))},encapsulation:2,changeDetection:0})}}return n})();var ct=(()=>{class n{static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=f({type:n,selectors:[["spk-toggle"]],standalone:!0,features:[m],ngContentSelectors:y,decls:3,vars:0,consts:[[1,"box"],[1,"knob"]],template:function(t,i){t&1&&(g(),l(0,"div",0),M(1,"div",1),a(),r(2))},encapsulation:2,changeDetection:0})}}return n})();export{ee as a,Ye as b,Je as c,Ke as d,Ze as e,et as f,Ee as g,be as h,tt as i,it as j,nt as k,ot as l,st as m,rt as n,lt as o,at as p,ct as q};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as me}from"./chunk-5Y47Y3RB.js";import{a as le}from"./chunk-K3HFPUKT.js";import"./chunk-JDCFQ6PF.js";import{a as ae}from"./chunk-RUP4GIVS.js";import"./chunk-V7LHB36E.js";import"./chunk-WU4K3UNC.js";import{b as se}from"./chunk-P4AWKIXG.js";import{b as L,d as $,e as W,f as q,h as z,i as j,j as H,l as J,m as K,n as Q,o as X,p as Y,q as Z}from"./chunk-C52YH32J.js";import{a as re}from"./chunk-TIGGJ4KF.js";import{d as ee,h as te,l as ne,n as ie}from"./chunk-KCVUEWQV.js";import{a as oe}from"./chunk-SYBUINNV.js";import{$a as O,$b as G,Db as r,Eb as E,Fb as b,Jb as A,L as v,La as D,Oa as s,Ua as h,X as y,Z as I,bb as S,bc as B,db as M,f as F,fb as C,gb as x,ha as u,hb as T,ia as d,ib as k,jb as n,kb as o,lb as p,mb as R,nb as w,pb as _,qb as m,rb as c,s as U,ub as N}from"./chunk-RBNO3K72.js";function ue(a,e){if(a&1){let t=_();n(0,"spk-form-field",28),p(1,"input",29),o(),n(2,"button",30),m("click",function(){u(t);let l=c(2);return d(l.beginRemoteRegistration())}),r(3," Register for remote control "),o()}}function de(a,e){if(a&1&&(n(0,"div",26)(1,"label"),r(2,"Machine is now registered, open this link to add it to your account:"),o(),n(3,"a",31),r(4),o()()),a&2){let t=c(2);s(3),N("href",t.remoteControlClaimUrl(),D),s(),E(t.remoteControlClaimUrl())}}function ge(a,e){a&1&&(n(0,"div",26)(1,"label"),r(2,"Registering, please wait..."),o()())}function Ce(a,e){if(a&1){let t=_();n(0,"button",30),m("click",function(){u(t);let l=c(2);return d(l.cancelRemoteRegistration())}),r(1," Cancel registration "),o()}}function _e(a,e){if(a&1){let t=_();n(0,"button",30),m("click",function(){u(t);let l=c(2);return d(l.disableRemoteControl())}),r(1," Disable remote control "),o()}}function fe(a,e){if(a&1){let t=_();n(0,"button",30),m("click",function(){u(t);let l=c(2);return d(l.enableRemoteControl())}),r(1," Enable remote control "),o(),n(2,"button",32),m("click",function(){u(t);let l=c(2);return d(l.deleteRemoteControl())}),r(3," Delete remote control setup "),o()}}function Se(a,e){if(a&1&&(n(0,"div",5),O(1,ue,4,0)(2,de,5,2,"div",26)(3,ge,3,0,"div",26)(4,Ce,2,0,"button",27)(5,_e,2,0,"button",27)(6,fe,4,0),o()),a&2){let t=c();s(),C(t.remoteControlState()==="inactive"?1:-1),s(),C(t.remoteControlState()==="registered"?2:-1),s(),C(t.remoteControlState()==="registering"?3:-1),s(),C(t.remoteControlState()==="registering"||t.remoteControlState()==="registeringfaulted"||t.remoteControlState()==="registered"?4:-1),s(),C(t.remoteControlState()==="connected"||t.remoteControlState()==="enabled"?5:-1),s(),C(t.remoteControlState()==="disabled"?6:-1)}}function he(a,e){if(a&1){let t=_();n(0,"option",33),m("click",function(){let l=u(t).$implicit,g=c();return d(g.pauseSettings.controls.timeType.setValue(l.value))}),r(1),o()}if(a&2){let t=e.$implicit;S("value",t.value),s(),b(" ",t.label," ")}}function be(a,e){if(a&1){let t=_();n(0,"option",33),m("click",function(){let l=u(t).$implicit,g=c();return d(g.pauseSettings.controls.time.setValue(l))}),r(1),o()}if(a&2){let t=e.$implicit;S("value",t),s(),E(t)}}function ve(a,e){if(a&1){let t=_();n(0,"option",33),m("click",function(){let l=u(t).$implicit,g=c();return d(g.settingsForm.controls.usageStatistics.setValue(l.value))}),r(1),o()}if(a&2){let t=e.$implicit;S("value",t.value),s(),b(" ",t.label," ")}}var f=new X,pe=[{value:"s",label:"Seconds"},{value:"m",label:"Minutes"},{value:"h",label:"Hours"}],V=[{value:"en",label:"English"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"es",label:"Spanish"},{value:"it",label:"Italian"}],ce=[{value:"",label:"System default (information)"},{value:"information",label:"Usage statistics, warnings, errors, and crashes"},{value:"warning",label:"Warnings, errors and crashes"},{value:"error",label:"Errors and crashes"},{value:"crash",label:"Crashes only"},{value:"none",label:"None / disabled"}],P=class a{#i=y(le);#o=y(re);#e=y(oe);sysinfo=this.#o.systemInfo;isDarkMode=this.#i.isDarkMode;editAs=h("list");settingsForm=f.group({pauseSettings:f.group({time:f.control(0),timeType:f.control("s")}),language:f.control("en"),usageStatistics:f.control(""),updateChannel:f.control(""),remoteControlRegisterUrl:f.control("")});remoteControlState=h("unknown");remoteControlClaimUrl=h(null);sysInfoEffect=B(()=>{this.settingsForm.controls.remoteControlRegisterUrl.patchValue(this.sysinfo()?.RemoteControlRegistrationUrl??"")},{allowSignalWrites:!0});get pauseSettings(){return this.settingsForm.controls.pauseSettings}langSignal=se(this.settingsForm.controls.language.valueChanges);timeTypeOptions=h(pe);timeOptions=me([this.pauseSettings.controls.timeType.valueChanges.pipe(v("s")),this.pauseSettings.controls.time.valueChanges.pipe(v(null))],F(U(([e,t])=>{let i=this.#r(e);return t!==null?i.filter(l=>l.toString().includes(t.toString())):i}),v([])));languageOptions=G(()=>this.langSignal()?V.filter(e=>e.value===this.langSignal()):V);usageStatisticsOptions=h(ce);ngOnInit(){this.refreshRemoteControlStatus(),this.getServerSettings()}submit(){let e=`${this.pauseSettings.controls.time.value}${this.pauseSettings.controls.timeType.value}`;this.#e.patchApiV1Serversettings({requestBody:{"usage-reporter-level":this.settingsForm.controls.usageStatistics.value,"startup-delay":e==="0s"?"":e,"update-channel":this.settingsForm.controls.updateChannel.value}}).subscribe({next:t=>{console.log("res",t)},error:t=>{console.error("err",t)}})}getServerSettings(){return this.#e.getApiV1Serversettings().subscribe({next:e=>{let t=e["startup-delay"];this.settingsForm.patchValue({pauseSettings:{time:parseInt(t.substring(0,t.length-1)==""?"0":t.substring(0,t.length-1)),timeType:t.substring(-1)===""?"s":t.substring(-1)},usageStatistics:e["usage-reporter-level"],updateChannel:e["update-channel"]})}})}languageDisplay(e){return e?V.find(t=>t.value===e)?.label??null:null}typeDisplay(e){return e==null?null:pe.find(t=>t.value===e)?.label??null}usageDisplay(e){return typeof e!="string"?null:ce.find(t=>t.value===e)?.label??null}setDarkMode(){this.#i.setDarkMode()}setLightMode(){this.#i.setLightMode()}#r(e){let t=e==="h"?25:61;return new Array(t).fill(0).map((i,l)=>l)}repeatRegisterTimer=null;#t(e){e.RegistrationUrl&&this.remoteControlClaimUrl.set(e.RegistrationUrl),console.log(e),e.IsConnected?this.remoteControlState.set("connected"):e.IsEnabled?this.remoteControlState.set("enabled"):e.CanEnable?this.remoteControlState.set("disabled"):e.IsRegisteringFaulted?this.remoteControlState.set("registeringfaulted"):e.IsRegistering?e.RegistrationUrl!=null&&e.RegistrationUrl.trim().length>0?this.remoteControlState.set("registered"):this.remoteControlState.set("registering"):this.remoteControlState.set("inactive");let t=this.remoteControlState();console.log(t),this.repeatRegisterTimer!==null&&(clearTimeout(this.repeatRegisterTimer),this.repeatRegisterTimer=null),t==="registering"&&(this.repeatRegisterTimer=setTimeout(()=>{this.#e.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:""}}).subscribe({next:i=>{this.#t(i)},error:i=>{this.#n(i)}})},5e3)),(t==="enabled"||t==="registered")&&(this.repeatRegisterTimer=setTimeout(()=>{this.#e.getApiV1RemotecontrolStatus().subscribe({next:i=>{this.#t(i)},error:i=>{this.#n(i)}})},5e3)),e.IsRegistering&&e.CanEnable&&this.#e.deleteApiV1RemotecontrolRegister().subscribe({next:i=>{this.#t(i)}})}#n(e){this.#e.getApiV1RemotecontrolStatus().subscribe({next:t=>{this.#t(t)}})}refreshRemoteControlStatus(){this.#e.getApiV1RemotecontrolStatus().subscribe({next:e=>{this.#t(e)},error:e=>{this.#n(e)}})}beginRemoteRegistration(){this.remoteControlState.set("registering");let e=this.settingsForm.controls.remoteControlRegisterUrl.value;this.#e.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:e}}).subscribe({next:t=>{this.#t(t)},error:t=>{this.#n(t)}})}cancelRemoteRegistration(){this.#e.deleteApiV1RemotecontrolRegister().subscribe({next:e=>{this.#t(e)},error:e=>{this.#n(e)}})}enableRemoteControl(){this.#e.postApiV1RemotecontrolEnable().subscribe({next:e=>{this.#t(e)},error:e=>{this.#n(e)}})}disableRemoteControl(){this.#e.postApiV1RemotecontrolDisable().subscribe({next:e=>{this.#t(e)},error:e=>{this.#n(e)}})}deleteRemoteControl(){let e=this;confirm("Are you sure you want to delete the remote control registration?")&&e.#e.deleteApiV1RemotecontrolRegistration().subscribe({next:t=>{e.#t(t)},error:t=>{e.#n(t)}})}getRemoteControlStatusText(){let e=this.remoteControlState();return e==="enabled"?"Remote control is enabled but not connected":e==="connected"?"Remote control is connected":e==="registering"?"Registering machine...":e==="registeringfaulted"?"Registration failed":e==="registered"?"Registered, waiting for accept":e==="disabled"?"Remote control is configured but not enabled":e==="unknown"?"...loading...":"Remote control is not set up"}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=I({type:a,selectors:[["app-settings"]],standalone:!0,features:[A],decls:100,vars:11,consts:[[1,"content",3,"submit","formGroup"],[1,"title"],["type","submit","spk-button","",1,"raised","primary"],[1,"left"],[1,"right","remote-control"],[1,"field-row"],[1,"right"],["formGroupName","pauseSettings",1,"field-row"],[3,"displayValue"],["type","text","formControlName","timeType"],["options",""],[3,"value"],["type","search","formControlName","time"],[1,"themes"],["src","assets/images/light-theme.png","alt","light theme",3,"click"],["src","assets/images/dark-theme.png","alt","dark theme",3,"click"],[1,"right","radios"],[1,"radio-option",3,"click"],[1,"outlined","primary"],["type","radio","name","updateChannel","value","","formControlName","updateChannel"],["type","radio","name","updateChannel","value","stable","formControlName","updateChannel"],["type","radio","name","updateChannel","value","beta","formControlName","updateChannel"],["type","radio","name","updateChannel","value","experimental","formControlName","updateChannel"],["type","radio","name","updateChannel","value","canary","formControlName","updateChannel"],["href","#"],["type","text","formControlName","usageStatistics"],[1,"field-col"],["type","button","spk-button","",1,"raised"],["label","Registration URL","for","remoteControlRegisterUrl"],["type","text","spk-input","","id","remoteControlRegisterUrl","name","remoteControlRegisterUrl","formControlName","remoteControlRegisterUrl"],["type","button","spk-button","",1,"raised",3,"click"],["target","_blank",3,"href"],["type","button","spk-button","",1,"raised","warn",3,"click"],[3,"click","value"]],template:function(t,i){if(t&1&&(p(0,"app-status-bar"),n(1,"form",0),m("submit",function(){return i.submit()}),n(2,"header")(3,"div",1)(4,"h2"),r(5,"Settings"),o(),n(6,"p"),r(7,"Configure your backup settings."),o()(),n(8,"button",2),r(9,"Save changes"),o()(),n(10,"section")(11,"div",3)(12,"h3"),r(13,"Remote access control"),o(),n(14,"p"),r(15),o()(),n(16,"div",4),O(17,Se,7,6,"div",5),o()(),n(18,"section")(19,"div",3)(20,"h3"),r(21,"Pause after startup or hibernation"),o(),n(22,"p"),r(23," Duplicati will run when started, but will remain in paused state for the duration. Duplicati will occupy minimal system resources and no backups will be run. "),o()(),n(24,"div",6)(25,"div",7)(26,"spk-select",8),p(27,"input",9),R(28,10),T(29,he,2,2,"option",11,x),w(),o(),n(31,"spk-select"),p(32,"input",12),R(33,10),T(34,be,2,2,"option",11,x),w(),o()()()(),n(36,"section")(37,"div",3)(38,"h3"),r(39,"Color theme"),o(),n(40,"p"),r(41,"Customize your application theme"),o()(),n(42,"div",6)(43,"div",13)(44,"img",14),m("click",function(){return i.setLightMode()}),o(),n(45,"img",15),m("click",function(){return i.setDarkMode()}),o()()()(),n(46,"section")(47,"div",3)(48,"h3"),r(49,"Update channel"),o(),n(50,"p"),r(51,"Lorem ipsum dolor sit amet, consectetur adipiscing elit."),o()(),n(52,"div",16)(53,"div",17),m("click",function(){return i.settingsForm.controls.updateChannel.setValue("")}),n(54,"spk-radio",18),r(55),p(56,"input",19),o(),n(57,"p"),r(58),o()(),n(59,"div",17),m("click",function(){return i.settingsForm.controls.updateChannel.setValue("stable")}),n(60,"spk-radio",18),r(61," Stable "),p(62,"input",20),o(),n(63,"p"),r(64,"Official releases"),o()(),n(65,"div",17),m("click",function(){return i.settingsForm.controls.updateChannel.setValue("beta")}),n(66,"spk-radio",18),r(67," Beta "),p(68,"input",21),o(),n(69,"p"),r(70," Try out the new features that we are working on. Currently the most stable version available. Test Restore data before using this in production environments. "),o()(),n(71,"div",17),m("click",function(){return i.settingsForm.controls.updateChannel.setValue("experimental")}),n(72,"spk-radio",18),r(73," Experimental "),p(74,"input",22),o(),n(75,"p"),r(76,"Specific builds for developers only. Not for use with important data."),o()(),n(77,"div",17),m("click",function(){return i.settingsForm.controls.updateChannel.setValue("canary")}),n(78,"spk-radio",18),r(79," Canary "),p(80,"input",23),o(),n(81,"p"),r(82,"Individual builds for developers only. Not for use with important data."),o()()()(),n(83,"section")(84,"div",3)(85,"h3"),r(86,"Usage statistics"),o(),n(87,"p"),r(88," Usage reports help us improve the user experience and evaluate impact of new features. We use them to generate "),n(89,"a",24),r(90,"public usage statistics."),o(),p(91,"br")(92,"br"),r(93," All usage reports are sent anonymously and do not contain any personal information. They contain information about hardware and operating system, the type of backend, backup duration, overall size of source data and similar data. They do not contain paths, filenames, usernames, passwords or similar sensitive information. "),o()(),n(94,"div",6)(95,"spk-select",8),p(96,"input",25),R(97,10),T(98,ve,2,2,"option",11,x),w(),o()()()()),t&2){let l,g;s(),S("formGroup",i.settingsForm),s(14),E(i.getRemoteControlStatusText()),s(2),C(i.remoteControlState()!=="unknown"?17:-1),s(9),S("displayValue",i.typeDisplay(i.settingsForm.value.pauseSettings==null?null:i.settingsForm.value.pauseSettings.timeType)),s(3),k(i.timeTypeOptions()),s(5),k(i.timeOptions()),s(10),M("active",!i.isDarkMode()),s(),M("active",i.isDarkMode()),s(10),b(" Default (",(l=i.sysinfo())==null?null:l.DefaultUpdateChannel,") "),s(3),b("Same as the base install version: ",(g=i.sysinfo())==null?null:g.ServerVersionType,""),s(37),S("displayValue",i.usageDisplay(i.settingsForm.controls.usageStatistics.value)),s(3),k(i.usageStatisticsOptions())}},dependencies:[Y,q,K,Q,L,z,$,W,Z,j,J,H,ae,ee,ne,te,ie],styles:["[_nghost-%COMP%]{display:block}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem 2rem}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem 0}header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}section[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;padding:2rem 0;border-top:1px solid var(--base-level-40)}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;align-items:flex-start}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] spk-button-group[_ngcontent-%COMP%]{margin-top:.25rem}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;width:50%}.themes[_ngcontent-%COMP%]{display:flex;gap:.5rem}.themes[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:240px;border-radius:var(--shape-3);cursor:pointer}.themes[_ngcontent-%COMP%] img.active[_ngcontent-%COMP%]{border:2px solid var(--primary-500)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.radio-option[_ngcontent-%COMP%]{cursor:pointer}.radio-option[_ngcontent-%COMP%] spk-radio[_ngcontent-%COMP%]{color:var(--base-level-60);margin-bottom:.25rem}.radio-option[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;color:var(--base-level-60R)}.field-col[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] spk-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] spk-select[_ngcontent-%COMP%]{flex:1 0}.remote-control[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap}"],changeDetection:0})};export{P as default};
|
|
1
|
+
import{a as me}from"./chunk-5Y47Y3RB.js";import{a as le}from"./chunk-K3HFPUKT.js";import{a as re}from"./chunk-TIGGJ4KF.js";import"./chunk-JDCFQ6PF.js";import{a as ae}from"./chunk-CQGUEKNU.js";import"./chunk-V7LHB36E.js";import{b as se}from"./chunk-P4AWKIXG.js";import"./chunk-WU4K3UNC.js";import{b as L,d as $,e as W,f as q,h as z,i as j,j as H,l as J,m as K,n as Q,o as X,p as Y,q as Z}from"./chunk-C52YH32J.js";import{d as ee,h as te,l as ne,n as ie}from"./chunk-LNCAETYE.js";import{a as oe}from"./chunk-SYBUINNV.js";import{$a as O,$b as G,Db as r,Eb as E,Fb as b,Jb as A,L as v,La as D,Oa as s,Ua as h,X as y,Z as I,bb as S,bc as B,db as M,f as F,fb as C,gb as x,ha as u,hb as T,ia as d,ib as k,jb as n,kb as o,lb as p,mb as R,nb as w,pb as _,qb as m,rb as c,s as U,ub as N}from"./chunk-RBNO3K72.js";function ue(a,e){if(a&1){let t=_();n(0,"spk-form-field",28),p(1,"input",29),o(),n(2,"button",30),m("click",function(){u(t);let l=c(2);return d(l.beginRemoteRegistration())}),r(3," Register for remote control "),o()}}function de(a,e){if(a&1&&(n(0,"div",26)(1,"label"),r(2,"Machine is now registered, open this link to add it to your account:"),o(),n(3,"a",31),r(4),o()()),a&2){let t=c(2);s(3),N("href",t.remoteControlClaimUrl(),D),s(),E(t.remoteControlClaimUrl())}}function ge(a,e){a&1&&(n(0,"div",26)(1,"label"),r(2,"Registering, please wait..."),o()())}function Ce(a,e){if(a&1){let t=_();n(0,"button",30),m("click",function(){u(t);let l=c(2);return d(l.cancelRemoteRegistration())}),r(1," Cancel registration "),o()}}function _e(a,e){if(a&1){let t=_();n(0,"button",30),m("click",function(){u(t);let l=c(2);return d(l.disableRemoteControl())}),r(1," Disable remote control "),o()}}function fe(a,e){if(a&1){let t=_();n(0,"button",30),m("click",function(){u(t);let l=c(2);return d(l.enableRemoteControl())}),r(1," Enable remote control "),o(),n(2,"button",32),m("click",function(){u(t);let l=c(2);return d(l.deleteRemoteControl())}),r(3," Delete remote control setup "),o()}}function Se(a,e){if(a&1&&(n(0,"div",5),O(1,ue,4,0)(2,de,5,2,"div",26)(3,ge,3,0,"div",26)(4,Ce,2,0,"button",27)(5,_e,2,0,"button",27)(6,fe,4,0),o()),a&2){let t=c();s(),C(t.remoteControlState()==="inactive"?1:-1),s(),C(t.remoteControlState()==="registered"?2:-1),s(),C(t.remoteControlState()==="registering"?3:-1),s(),C(t.remoteControlState()==="registering"||t.remoteControlState()==="registeringfaulted"||t.remoteControlState()==="registered"?4:-1),s(),C(t.remoteControlState()==="connected"||t.remoteControlState()==="enabled"?5:-1),s(),C(t.remoteControlState()==="disabled"?6:-1)}}function he(a,e){if(a&1){let t=_();n(0,"option",33),m("click",function(){let l=u(t).$implicit,g=c();return d(g.pauseSettings.controls.timeType.setValue(l.value))}),r(1),o()}if(a&2){let t=e.$implicit;S("value",t.value),s(),b(" ",t.label," ")}}function be(a,e){if(a&1){let t=_();n(0,"option",33),m("click",function(){let l=u(t).$implicit,g=c();return d(g.pauseSettings.controls.time.setValue(l))}),r(1),o()}if(a&2){let t=e.$implicit;S("value",t),s(),E(t)}}function ve(a,e){if(a&1){let t=_();n(0,"option",33),m("click",function(){let l=u(t).$implicit,g=c();return d(g.settingsForm.controls.usageStatistics.setValue(l.value))}),r(1),o()}if(a&2){let t=e.$implicit;S("value",t.value),s(),b(" ",t.label," ")}}var f=new X,pe=[{value:"s",label:"Seconds"},{value:"m",label:"Minutes"},{value:"h",label:"Hours"}],V=[{value:"en",label:"English"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"es",label:"Spanish"},{value:"it",label:"Italian"}],ce=[{value:"",label:"System default (information)"},{value:"information",label:"Usage statistics, warnings, errors, and crashes"},{value:"warning",label:"Warnings, errors and crashes"},{value:"error",label:"Errors and crashes"},{value:"crash",label:"Crashes only"},{value:"none",label:"None / disabled"}],P=class a{#i=y(le);#o=y(re);#e=y(oe);sysinfo=this.#o.systemInfo;isDarkMode=this.#i.isDarkMode;editAs=h("list");settingsForm=f.group({pauseSettings:f.group({time:f.control(0),timeType:f.control("s")}),language:f.control("en"),usageStatistics:f.control(""),updateChannel:f.control(""),remoteControlRegisterUrl:f.control("")});remoteControlState=h("unknown");remoteControlClaimUrl=h(null);sysInfoEffect=B(()=>{this.settingsForm.controls.remoteControlRegisterUrl.patchValue(this.sysinfo()?.RemoteControlRegistrationUrl??"")},{allowSignalWrites:!0});get pauseSettings(){return this.settingsForm.controls.pauseSettings}langSignal=se(this.settingsForm.controls.language.valueChanges);timeTypeOptions=h(pe);timeOptions=me([this.pauseSettings.controls.timeType.valueChanges.pipe(v("s")),this.pauseSettings.controls.time.valueChanges.pipe(v(null))],F(U(([e,t])=>{let i=this.#r(e);return t!==null?i.filter(l=>l.toString().includes(t.toString())):i}),v([])));languageOptions=G(()=>this.langSignal()?V.filter(e=>e.value===this.langSignal()):V);usageStatisticsOptions=h(ce);ngOnInit(){this.refreshRemoteControlStatus(),this.getServerSettings()}submit(){let e=`${this.pauseSettings.controls.time.value}${this.pauseSettings.controls.timeType.value}`;this.#e.patchApiV1Serversettings({requestBody:{"usage-reporter-level":this.settingsForm.controls.usageStatistics.value,"startup-delay":e==="0s"?"":e,"update-channel":this.settingsForm.controls.updateChannel.value}}).subscribe({next:t=>{console.log("res",t)},error:t=>{console.error("err",t)}})}getServerSettings(){return this.#e.getApiV1Serversettings().subscribe({next:e=>{let t=e["startup-delay"];this.settingsForm.patchValue({pauseSettings:{time:parseInt(t.substring(0,t.length-1)==""?"0":t.substring(0,t.length-1)),timeType:t.substring(-1)===""?"s":t.substring(-1)},usageStatistics:e["usage-reporter-level"],updateChannel:e["update-channel"]})}})}languageDisplay(e){return e?V.find(t=>t.value===e)?.label??null:null}typeDisplay(e){return e==null?null:pe.find(t=>t.value===e)?.label??null}usageDisplay(e){return typeof e!="string"?null:ce.find(t=>t.value===e)?.label??null}setDarkMode(){this.#i.setDarkMode()}setLightMode(){this.#i.setLightMode()}#r(e){let t=e==="h"?25:61;return new Array(t).fill(0).map((i,l)=>l)}repeatRegisterTimer=null;#t(e){e.RegistrationUrl&&this.remoteControlClaimUrl.set(e.RegistrationUrl),console.log(e),e.IsConnected?this.remoteControlState.set("connected"):e.IsEnabled?this.remoteControlState.set("enabled"):e.CanEnable?this.remoteControlState.set("disabled"):e.IsRegisteringFaulted?this.remoteControlState.set("registeringfaulted"):e.IsRegistering?e.RegistrationUrl!=null&&e.RegistrationUrl.trim().length>0?this.remoteControlState.set("registered"):this.remoteControlState.set("registering"):this.remoteControlState.set("inactive");let t=this.remoteControlState();console.log(t),this.repeatRegisterTimer!==null&&(clearTimeout(this.repeatRegisterTimer),this.repeatRegisterTimer=null),t==="registering"&&(this.repeatRegisterTimer=setTimeout(()=>{this.#e.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:""}}).subscribe({next:i=>{this.#t(i)},error:i=>{this.#n(i)}})},5e3)),(t==="enabled"||t==="registered")&&(this.repeatRegisterTimer=setTimeout(()=>{this.#e.getApiV1RemotecontrolStatus().subscribe({next:i=>{this.#t(i)},error:i=>{this.#n(i)}})},5e3)),e.IsRegistering&&e.CanEnable&&this.#e.deleteApiV1RemotecontrolRegister().subscribe({next:i=>{this.#t(i)}})}#n(e){this.#e.getApiV1RemotecontrolStatus().subscribe({next:t=>{this.#t(t)}})}refreshRemoteControlStatus(){this.#e.getApiV1RemotecontrolStatus().subscribe({next:e=>{this.#t(e)},error:e=>{this.#n(e)}})}beginRemoteRegistration(){this.remoteControlState.set("registering");let e=this.settingsForm.controls.remoteControlRegisterUrl.value;this.#e.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:e}}).subscribe({next:t=>{this.#t(t)},error:t=>{this.#n(t)}})}cancelRemoteRegistration(){this.#e.deleteApiV1RemotecontrolRegister().subscribe({next:e=>{this.#t(e)},error:e=>{this.#n(e)}})}enableRemoteControl(){this.#e.postApiV1RemotecontrolEnable().subscribe({next:e=>{this.#t(e)},error:e=>{this.#n(e)}})}disableRemoteControl(){this.#e.postApiV1RemotecontrolDisable().subscribe({next:e=>{this.#t(e)},error:e=>{this.#n(e)}})}deleteRemoteControl(){let e=this;confirm("Are you sure you want to delete the remote control registration?")&&e.#e.deleteApiV1RemotecontrolRegistration().subscribe({next:t=>{e.#t(t)},error:t=>{e.#n(t)}})}getRemoteControlStatusText(){let e=this.remoteControlState();return e==="enabled"?"Remote control is enabled but not connected":e==="connected"?"Remote control is connected":e==="registering"?"Registering machine...":e==="registeringfaulted"?"Registration failed":e==="registered"?"Registered, waiting for accept":e==="disabled"?"Remote control is configured but not enabled":e==="unknown"?"...loading...":"Remote control is not set up"}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=I({type:a,selectors:[["app-settings"]],standalone:!0,features:[A],decls:100,vars:11,consts:[[1,"content",3,"submit","formGroup"],[1,"title"],["type","submit","spk-button","",1,"raised","primary"],[1,"left"],[1,"right","remote-control"],[1,"field-row"],[1,"right"],["formGroupName","pauseSettings",1,"field-row"],[3,"displayValue"],["type","text","formControlName","timeType"],["options",""],[3,"value"],["type","search","formControlName","time"],[1,"themes"],["src","assets/images/light-theme.png","alt","light theme",3,"click"],["src","assets/images/dark-theme.png","alt","dark theme",3,"click"],[1,"right","radios"],[1,"radio-option",3,"click"],[1,"outlined","primary"],["type","radio","name","updateChannel","value","","formControlName","updateChannel"],["type","radio","name","updateChannel","value","stable","formControlName","updateChannel"],["type","radio","name","updateChannel","value","beta","formControlName","updateChannel"],["type","radio","name","updateChannel","value","experimental","formControlName","updateChannel"],["type","radio","name","updateChannel","value","canary","formControlName","updateChannel"],["href","#"],["type","text","formControlName","usageStatistics"],[1,"field-col"],["type","button","spk-button","",1,"raised"],["label","Registration URL","for","remoteControlRegisterUrl"],["type","text","spk-input","","id","remoteControlRegisterUrl","name","remoteControlRegisterUrl","formControlName","remoteControlRegisterUrl"],["type","button","spk-button","",1,"raised",3,"click"],["target","_blank",3,"href"],["type","button","spk-button","",1,"raised","warn",3,"click"],[3,"click","value"]],template:function(t,i){if(t&1&&(p(0,"app-status-bar"),n(1,"form",0),m("submit",function(){return i.submit()}),n(2,"header")(3,"div",1)(4,"h2"),r(5,"Settings"),o(),n(6,"p"),r(7,"Configure your backup settings."),o()(),n(8,"button",2),r(9,"Save changes"),o()(),n(10,"section")(11,"div",3)(12,"h3"),r(13,"Remote access control"),o(),n(14,"p"),r(15),o()(),n(16,"div",4),O(17,Se,7,6,"div",5),o()(),n(18,"section")(19,"div",3)(20,"h3"),r(21,"Pause after startup or hibernation"),o(),n(22,"p"),r(23," Duplicati will run when started, but will remain in paused state for the duration. Duplicati will occupy minimal system resources and no backups will be run. "),o()(),n(24,"div",6)(25,"div",7)(26,"spk-select",8),p(27,"input",9),R(28,10),T(29,he,2,2,"option",11,x),w(),o(),n(31,"spk-select"),p(32,"input",12),R(33,10),T(34,be,2,2,"option",11,x),w(),o()()()(),n(36,"section")(37,"div",3)(38,"h3"),r(39,"Color theme"),o(),n(40,"p"),r(41,"Customize your application theme"),o()(),n(42,"div",6)(43,"div",13)(44,"img",14),m("click",function(){return i.setLightMode()}),o(),n(45,"img",15),m("click",function(){return i.setDarkMode()}),o()()()(),n(46,"section")(47,"div",3)(48,"h3"),r(49,"Update channel"),o(),n(50,"p"),r(51,"Lorem ipsum dolor sit amet, consectetur adipiscing elit."),o()(),n(52,"div",16)(53,"div",17),m("click",function(){return i.settingsForm.controls.updateChannel.setValue("")}),n(54,"spk-radio",18),r(55),p(56,"input",19),o(),n(57,"p"),r(58),o()(),n(59,"div",17),m("click",function(){return i.settingsForm.controls.updateChannel.setValue("stable")}),n(60,"spk-radio",18),r(61," Stable "),p(62,"input",20),o(),n(63,"p"),r(64,"Official releases"),o()(),n(65,"div",17),m("click",function(){return i.settingsForm.controls.updateChannel.setValue("beta")}),n(66,"spk-radio",18),r(67," Beta "),p(68,"input",21),o(),n(69,"p"),r(70," Try out the new features that we are working on. Currently the most stable version available. Test Restore data before using this in production environments. "),o()(),n(71,"div",17),m("click",function(){return i.settingsForm.controls.updateChannel.setValue("experimental")}),n(72,"spk-radio",18),r(73," Experimental "),p(74,"input",22),o(),n(75,"p"),r(76,"Specific builds for developers only. Not for use with important data."),o()(),n(77,"div",17),m("click",function(){return i.settingsForm.controls.updateChannel.setValue("canary")}),n(78,"spk-radio",18),r(79," Canary "),p(80,"input",23),o(),n(81,"p"),r(82,"Individual builds for developers only. Not for use with important data."),o()()()(),n(83,"section")(84,"div",3)(85,"h3"),r(86,"Usage statistics"),o(),n(87,"p"),r(88," Usage reports help us improve the user experience and evaluate impact of new features. We use them to generate "),n(89,"a",24),r(90,"public usage statistics."),o(),p(91,"br")(92,"br"),r(93," All usage reports are sent anonymously and do not contain any personal information. They contain information about hardware and operating system, the type of backend, backup duration, overall size of source data and similar data. They do not contain paths, filenames, usernames, passwords or similar sensitive information. "),o()(),n(94,"div",6)(95,"spk-select",8),p(96,"input",25),R(97,10),T(98,ve,2,2,"option",11,x),w(),o()()()()),t&2){let l,g;s(),S("formGroup",i.settingsForm),s(14),E(i.getRemoteControlStatusText()),s(2),C(i.remoteControlState()!=="unknown"?17:-1),s(9),S("displayValue",i.typeDisplay(i.settingsForm.value.pauseSettings==null?null:i.settingsForm.value.pauseSettings.timeType)),s(3),k(i.timeTypeOptions()),s(5),k(i.timeOptions()),s(10),M("active",!i.isDarkMode()),s(),M("active",i.isDarkMode()),s(10),b(" Default (",(l=i.sysinfo())==null?null:l.DefaultUpdateChannel,") "),s(3),b("Same as the base install version: ",(g=i.sysinfo())==null?null:g.ServerVersionType,""),s(37),S("displayValue",i.usageDisplay(i.settingsForm.controls.usageStatistics.value)),s(3),k(i.usageStatisticsOptions())}},dependencies:[Y,q,K,Q,L,z,$,W,Z,j,J,H,ae,ee,ne,te,ie],styles:["[_nghost-%COMP%]{display:block}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem 2rem}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem 0}header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}section[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;padding:2rem 0;border-top:1px solid var(--base-level-40)}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;align-items:flex-start}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] spk-button-group[_ngcontent-%COMP%]{margin-top:.25rem}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;width:50%}.themes[_ngcontent-%COMP%]{display:flex;gap:.5rem}.themes[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:240px;border-radius:var(--shape-3);cursor:pointer}.themes[_ngcontent-%COMP%] img.active[_ngcontent-%COMP%]{border:2px solid var(--primary-500)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.radio-option[_ngcontent-%COMP%]{cursor:pointer}.radio-option[_ngcontent-%COMP%] spk-radio[_ngcontent-%COMP%]{color:var(--base-level-60);margin-bottom:.25rem}.radio-option[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;color:var(--base-level-60R)}.field-col[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] spk-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] spk-select[_ngcontent-%COMP%]{flex:1 0}.remote-control[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap}"],changeDetection:0})};export{P as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as a,e as b,f as c}from"./chunk-VOMOARSI.js";import"./chunk-YJ2MWFHK.js";import"./chunk-TIGGJ4KF.js";import"./chunk-DNHLTHLR.js";import"./chunk-P4AWKIXG.js";import"./chunk-C52YH32J.js";import"./chunk-LNCAETYE.js";import"./chunk-AFUS3PYG.js";import"./chunk-L4EVZZOM.js";import"./chunk-SYBUINNV.js";import"./chunk-RBNO3K72.js";export{b as NONE_OPTION,a as createGeneralForm,c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as I,b as E,d as B,e as M,f as w,i as N,l as P,o as A,q as T}from"./chunk-C52YH32J.js";import{a as L,d as R,h as V,q as j}from"./chunk-LNCAETYE.js";import{d as D}from"./chunk-AFUS3PYG.js";import"./chunk-L4EVZZOM.js";import{a as G}from"./chunk-SYBUINNV.js";import{Db as o,Eb as C,G as b,Jb as S,Kb as F,Oa as m,Ob as _,Pb as v,Ua as f,X as h,Z as k,bb as d,db as y,jb as t,kb as e,lb as s,nc as x,qb as c}from"./chunk-RBNO3K72.js";var O=()=>["/"],p=new A,u=class g{#e=h(G);isImporting=f(!1);importForm=p.group({config:p.control(""),cmdline:p.control(!1),importMetadata:p.control(!1),direct:p.control(!1),passphrase:p.control("")});selectedFile=f(null);onFileDropped(r){let n=r.target?.files?.item(0);if(n){let a=new FileReader;a.onload=this.#t.bind(this),a.readAsArrayBuffer(n)}}#t(r){let i=r.target?.result;this.importForm.patchValue({config:this.#o(i)})}#o(r){let i=new Uint8Array(r),n=i.byteLength,a="";for(let l=0;l<n;l++)a+=String.fromCharCode(i[l]);return btoa(a)}submit(){this.isImporting.set(!0),this.#e.postApiV1BackupsImport({requestBody:this.importForm.value}).pipe(b(()=>this.isImporting.set(!1))).subscribe({next:r=>{console.log("res",r)},error:r=>{console.error("err",r)}})}static \u0275fac=function(i){return new(i||g)};static \u0275cmp=k({type:g,selectors:[["app-import"]],standalone:!0,features:[S],decls:34,vars:8,consts:[[1,"actions"],["spk-button","",1,"outlined",3,"routerLink"],["spk-button","",1,"raised","primary",3,"click"],["autocomplete","off",3,"formGroup"],["spkDragDrop","",3,"fileDropped"],["for","file"],["type","file","accept",".json,.aes",3,"change"],["spkSuffix",""],["for","passphrase"],["type","password","formControlName","passphrase"],[1,"primary","raised"],["for","importMetadata"],["type","checkbox","formControlName","importMetadata"],["for","direct"],["type","checkbox","formControlName","direct"]],template:function(i,n){i&1&&(t(0,"header")(1,"h3"),o(2," Import backup configuration "),t(3,"div",0)(4,"button",1)(5,"spk-icon"),o(6,"arrow-left"),e(),o(7," Back "),e(),t(8,"button",2),c("click",function(){return n.submit()}),t(9,"spk-icon"),o(10,"download-simple"),e(),o(11," Import "),e()()()(),t(12,"form",3)(13,"spk-form-field",4),c("fileDropped",function(l){return n.onFileDropped(l)}),t(14,"label",5),o(15,"Select a configuration file"),e(),t(16,"input",6),c("change",function(l){return n.onFileDropped(l)}),e(),t(17,"spk-icon",7),o(18,"upload"),e()(),t(19,"spk-form-field")(20,"label",8),o(21,"Passphrase"),e(),s(22,"input",9),e(),t(23,"spk-toggle",10)(24,"label",11),o(25,"Import Metadata"),e(),s(26,"input",12),e(),t(27,"spk-toggle",10)(28,"label",13),o(29,"Save now"),e(),s(30,"input",14),e(),t(31,"pre"),o(32),_(33,"json"),e()()),i&2&&(m(4),d("routerLink",F(7,O)),m(4),y("loading",n.isImporting()),m(4),d("formGroup",n.importForm),m(20),C(v(33,5,n.importForm.value)))},dependencies:[T,w,E,I,B,M,N,P,D,V,L,R,j,x],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:3rem}h3[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;justify-content:space-between}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;max-width:31.25rem}"],changeDetection:0})};export{u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c}from"./chunk-VOMOARSI.js";import"./chunk-YJ2MWFHK.js";import"./chunk-TIGGJ4KF.js";import"./chunk-DNHLTHLR.js";import"./chunk-P4AWKIXG.js";import"./chunk-C52YH32J.js";import"./chunk-LNCAETYE.js";import"./chunk-AFUS3PYG.js";import"./chunk-L4EVZZOM.js";import"./chunk-SYBUINNV.js";import"./chunk-RBNO3K72.js";export{a as createDestinationForm,b as createDestinationFormGroup,c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as c}from"./chunk-
|
|
1
|
+
import{d as c}from"./chunk-LNCAETYE.js";import{b as l,d as m,e as p}from"./chunk-AFUS3PYG.js";import"./chunk-L4EVZZOM.js";import{Db as n,Jb as s,Z as a,jb as e,kb as t,lb as u}from"./chunk-RBNO3K72.js";var i=class r{static \u0275fac=function(o){return new(o||r)};static \u0275cmp=a({type:r,selectors:[["app-about"]],standalone:!0,features:[s],decls:13,vars:0,consts:[[1,"nav"],["spk-button","","routerLink","/about/general","routerLinkActive","primary",1,"raised"],["spk-button","","routerLink","/about/changelog","routerLinkActive","primary",1,"raised"],["spk-button","","routerLink","/about/libraries","routerLinkActive","primary",1,"raised"],["spk-button","","routerLink","/about/system-info","routerLinkActive","primary",1,"raised"],["spk-button","","routerLink","/about/logs","routerLinkActive","primary",1,"raised"]],template:function(o,b){o&1&&(e(0,"div",0)(1,"button",1),n(2,"General"),t(),e(3,"button",2),n(4,"Changelog"),t(),e(5,"button",3),n(6,"Libraries"),t(),e(7,"button",4),n(8,"System info"),t(),e(9,"button",5),n(10,"Logs"),t()(),e(11,"section"),u(12,"router-outlet"),t())},dependencies:[c,l,m,p],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:0;padding:2.5rem}.nav[_ngcontent-%COMP%]{display:flex;gap:.5rem}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:2rem 0}"],changeDetection:0})};export{i as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as M}from"./chunk-P4AWKIXG.js";import{k as b}from"./chunk-
|
|
1
|
+
import{b as M}from"./chunk-P4AWKIXG.js";import{k as b}from"./chunk-LNCAETYE.js";import{c as S}from"./chunk-L4EVZZOM.js";import{a as k}from"./chunk-SYBUINNV.js";import{$a as d,Db as h,G as p,Jb as v,Ka as c,Oa as g,Ua as f,X as i,Z as m,bb as u,fb as C,jb as y,kb as o,lb as r,s as l}from"./chunk-RBNO3K72.js";function D(n,e){n&1&&r(0,"spk-progress-bar",0)}var a=class n{#e=i(S);#n=i(k);isLoading=f(!0);generalInfo=M(this.#n.getApiV1Acknowledgements().pipe(l(e=>e.Acknowledgements?this.#e.bypassSecurityTrustHtml(e.Acknowledgements.replace(/\r/g,`
|
|
2
2
|
`)):""),p(()=>this.isLoading.set(!1))));static \u0275fac=function(t){return new(t||n)};static \u0275cmp=m({type:n,selectors:[["app-general"]],standalone:!0,features:[v],decls:5,vars:2,consts:[[1,"indeterminate","primary"],[3,"innerHTML"]],template:function(t,s){t&1&&(d(0,D,1,0,"spk-progress-bar",0),y(1,"section")(2,"h3"),h(3,"General"),o(),r(4,"div",1),o()),t&2&&(C(s.isLoading()?0:-1),g(4),u("innerHTML",s.generalInfo(),c))},dependencies:[b],styles:["[_nghost-%COMP%]{display:block;position:relative}h3[_ngcontent-%COMP%]{font:var(--title-30)}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}spk-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0}"],changeDetection:0})};export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-G3ZRG5MJ.js";import"./chunk-5Y47Y3RB.js";import"./chunk-YJ2MWFHK.js";import"./chunk-P4AWKIXG.js";import"./chunk-C52YH32J.js";import"./chunk-LNCAETYE.js";import"./chunk-AFUS3PYG.js";import"./chunk-L4EVZZOM.js";import"./chunk-SYBUINNV.js";import"./chunk-RBNO3K72.js";export{a as createRestoreOptionsForm,b as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as a,h as b,i as c}from"./chunk-VOMOARSI.js";import"./chunk-YJ2MWFHK.js";import"./chunk-TIGGJ4KF.js";import"./chunk-DNHLTHLR.js";import"./chunk-P4AWKIXG.js";import"./chunk-C52YH32J.js";import"./chunk-LNCAETYE.js";import"./chunk-AFUS3PYG.js";import"./chunk-L4EVZZOM.js";import"./chunk-SYBUINNV.js";import"./chunk-RBNO3K72.js";export{b as createAdvancedOption,a as createOptionsForm,c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Ue,b as Ce}from"./chunk-YJ2MWFHK.js";import{a as ge}from"./chunk-TIGGJ4KF.js";import{a as Ye,b as yt}from"./chunk-DNHLTHLR.js";import{b as Se}from"./chunk-P4AWKIXG.js";import{a as we,b as H,c as he,d as Y,e as J,f as Z,g as ue,i as X,j as _e,k as Le,l as ee,m as te,n as ne,o as I,q as ie}from"./chunk-C52YH32J.js";import{a as oe,d as fe,f as ft,h as ae,j as ze,m as gt,n as re,q as De}from"./chunk-LNCAETYE.js";import{a as W,c as M}from"./chunk-AFUS3PYG.js";import{a as Ct}from"./chunk-SYBUINNV.js";import{$a as f,$b as K,Ab as j,Bb as q,Cb as xe,D as lt,Db as r,Eb as G,Fb as A,G as ye,Hb as ct,Jb as Q,L as st,Lb as Be,Nb as $e,Oa as s,R as be,Rb as dt,Ua as S,Va as U,X as h,Z as z,a as se,ab as $,b as Me,bb as c,c as rt,db as pt,fb as _,gb as w,ha as g,hb as D,ia as C,ib as T,jb as a,kb as o,lb as m,lc as ut,mb as k,nb as v,ob as Re,pb as F,qb as y,rb as p,ub as pe,uc as _t,vb as N,wb as mt}from"./chunk-RBNO3K72.js";var je=class t{fromString(i){if(!i)return null;let e=i.match(/(\d+)([smhDWMY])/);return e&&{value:parseInt(e[1]),unit:e[2]}}toString(i,e){return`${i}${e}`}static \u0275fac=function(e){return new(e||t)};static \u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"})};var ve=new I,Ve={file:{customFields:{path:{type:"file-tree",name:"path",shortDescription:"File path",longDescription:"The path to store the backup",formElement:t=>ve.control(t??"")}}},ssh:{customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"The server to connect to",formElement:t=>ve.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"The port to connect to",formElement:t=>ve.control(t??"")},path:{type:"Path",name:"path",shortDescription:"File path on the server",longDescription:"File path on the server",formElement:t=>ve.control(t??"")}},dynamicFields:["auth-username"]},s3:{customFields:{path:{type:"Path",name:"path",shortDescription:"File path on the server",longDescription:"File path on the server",formElement:t=>ve.control(t??"")},bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:t=>ve.control(t??"")}},dynamicFields:["use-ssl","s3-server-name","auth-username","auth-password"]},gcs:{dynamicFields:["gcs-location","gcs-storage-class","authid"]},googledrive:{oauthField:"authid",customFields:{path:{type:"Path",name:"path",shortDescription:"File path on the server",longDescription:"File path on the server",formElement:t=>ve.control(t??"")}},dynamicFields:["authid"]}};function Te(t,i){let e={},n={};return i.searchParams.forEach((l,d)=>{Ve[t].dynamicFields?.includes(d)?n[d]=decodeURIComponent(l):e[d]=decodeURIComponent(l)}),{advanced:e,dynamic:n}}function Ie(t){let i=t.map(([e,n])=>`${e}=${n?encodeURIComponent(n.toString()):""}`).join("&");return i?"?"+i:""}var Ee={file:{to:t=>{let i=Ie([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${t.custom.path}${i}`},from:(t,i,e)=>{let n=e.indexOf("file:///")===0,l=e.split(n?"///":"//")[1].substring(0,1)+i.hostname.substring(1);return se({destinationType:t,custom:{path:`${n?"/":""}${l}${i.pathname}`}},Te(t,i))}},ssh:{to:t=>{let i=Ie([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${t.custom.server}${t.custom.port?":"+t.custom.port:""}${t.custom.path.startsWith("/")?t.custom.path:"/"+t.custom.path}${i}`},from:(t,i,e)=>se({destinationType:t,custom:{server:i.hostname,port:i.port,path:i.pathname}},Te(t,i))},s3:{to:t=>{let i=Ie([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${t.custom.bucket}${t.custom.path}${i}`},from:(t,i,e)=>se({destinationType:t,custom:{path:i.pathname,bucket:i.hostname}},Te(t,i))},gcs:{to:t=>{let i=t.dynamic["gcs-location"]??"";delete t.dynamic["gcs-location"];let e=Ie([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${i}${e}`},from:(t,i,e)=>{let{advanced:n,dynamic:l}=Te(t,i);return{destinationType:t,advanced:n,dynamic:Me(se({},l),{"gcs-location":i.hostname+i.pathname})}}},googledrive:{to:t=>{let i=t.custom.path,e=Ie([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${i}${e}`},from:(t,i,e)=>{let n=e.replace("googledrive://","");return se({destinationType:t,custom:{path:n}},Te(t,i))}},fallbackMapper:{to:t=>"",from:(t,i,e)=>se({destinationType:t},Te(t,i))}};function Ne(t){let i=t.destinationType;return!i||!Ee.hasOwnProperty(i)?Ee.fallbackMapper.to(t)??"":Ee[i].to(t)??""}function xt(t){let i=URL.canParse(t),e=t.split("://")[0],n="http://"+t.split("://")[1],l=new URL(n);if(!Ee.hasOwnProperty(e))return Ee.fallbackMapper.from(e,l);if(!i)throw new Error("Invalid target path");return Ee[e].from(e,l,t)}var Dt=/[a-zA-Z0-9_\-\+\.]/,qe=class t{generate(i,e=Dt){let n=this;return Array.apply(null,{length:i}).map(()=>{let l;for(;;)if(l=String.fromCharCode(n.#e()),e.test(l))return l},this).join("")}#e(){if(window.crypto&&window.crypto.getRandomValues){let i=new Uint8Array(1);return window.crypto.getRandomValues(i),i[0]}else if(window.msCrypto&&window.msCrypto.getRandomValues){let i=new Uint8Array(1);return window.msCrypto.getRandomValues(i),i[0]}else return Math.floor(Math.random()*256)}static \u0275fac=function(e){return new(e||t)};static \u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"})};var Tt=["formRef"];function Et(t,i){if(t&1&&(a(0,"option",14),r(1),o()),t&2){let e=i.$implicit;c("value",e.Key),s(),G(e.DisplayName)}}function Nt(t,i){t&1&&(a(0,"spk-icon"),r(1,"eye-slash"),o(),r(2," hide "))}function Ot(t,i){t&1&&(a(0,"spk-icon"),r(1,"eye"),o(),r(2," show "))}function Pt(t,i){t&1&&(a(0,"spk-icon",23),r(1,"check"),o())}function Vt(t,i){t&1&&(a(0,"spk-icon"),r(1,"copy"),o())}function It(t,i){if(t&1){let e=F();a(0,"button",22),y("click",function(){g(e);let l=p(3);return C(l.copyPassword())}),f(1,Pt,2,0,"spk-icon",23)(2,Vt,2,0,"spk-icon"),r(3),o()}if(t&2){let e=p(3);s(),_(e.copiedPassword()?1:2),s(2),A(" ",e.copiedPassword()?"Copied":"Copy"," password ")}}function Gt(t,i){if(t&1){let e=F();a(0,"div",15)(1,"spk-form-field")(2,"label",16),r(3,"Create a password"),o(),m(4,"input",17),o(),a(5,"spk-form-field"),m(6,"input",18),o(),a(7,"div",19)(8,"button",20),y("click",function(){g(e);let l=p(2);return C(l.showPassword.set(!l.showPassword()))}),f(9,Nt,3,0)(10,Ot,3,0),o(),a(11,"button",20),y("click",function(){g(e);let l=p(2);return C(l.generatePassword())}),a(12,"spk-icon"),r(13,"password"),o(),r(14," Generate password "),o(),f(15,It,4,2,"button",21),o()()}if(t&2){let e=p(2);s(4),c("type",e.showPassword()?"text":"password"),s(2),c("type",e.showPassword()?"text":"password"),s(3),_(e.showPassword()?9:10),s(6),_(e.showCopyPassword()?15:-1)}}function At(t,i){if(t&1&&(a(0,"spk-select",10)(1,"label",11),r(2,"Encryption"),o(),m(3,"input",12),k(4,13),D(5,Et,2,2,"option",14,w),v(),o(),f(7,Gt,16,4,"div",15)),t&2){let e,n=p();c("displayValue",n.displayFn((e=n.generalForm.value.encryption)!==null&&e!==void 0?e:"")),s(5),T(n.encryptionOptions()),s(2),_(n.encryptionFieldSignal()!=="none"?7:-1)}}var Oe=new I,ht=(t={name:"",description:"",encryption:"none",password:"",repeatPassword:""})=>Oe.group({name:Oe.control(t.name,[he.required]),description:Oe.control(t.description),encryption:Oe.control(t.encryption,[he.required,yt()]),password:Oe.control(t.password,[Ye(i=>i?.value.encryption!=="none",[he.required])]),repeatPassword:Oe.control(t.repeatPassword,[Ye(i=>i?.value.encryption!=="none",[he.required])])}),Ze={Key:"none",DisplayName:"None"},Je=class t{#e=h(M);#t=h(W);#n=h(qe);#i=h(R);#o=h(ge);formRef=U.required("formRef");generalForm=this.#i.generalForm;encryptionFieldSignal=this.#i.encryptionFieldSignal;encryptionOptions=this.#i.encryptionOptions;isNew=this.#i.isNew;showPassword=S(!1);copiedPassword=S(!1);showCopyPassword=S(!1);ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#i.exit()}async copyPassword(){let i=this.generalForm.controls.password.value;await this.#a(i??""),this.copiedPassword.set(!0)}async#a(i){try{await navigator.clipboard.writeText(i)}catch{try{let n=document.createElement("textarea");n.value=i,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}catch(n){console.error("Failed to copy text: ",n)}}}displayFn(i){let e=this.#o.systemInfo()?.EncryptionModules??[],n=[Ze,...e].find(l=>l.Key===i);return n?`${n.DisplayName}`:""}generatePassword(){this.copiedPassword.set(!1);let i=this.#n.generate(16);this.generalForm.controls.password.setValue(i),this.generalForm.controls.repeatPassword.setValue(i),this.showCopyPassword.set(!0)}next(){this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=z({type:t,selectors:[["app-general"]],viewQuery:function(e,n){e&1&&j(n.formRef,Tt,5),e&2&&q()},standalone:!0,features:[Q],decls:23,vars:4,consts:[["formRef",""],["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],["for","backupName"],["type","text","tabindex","1","placeholder","Your backup name","formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder","Your backup description","formControlName","description"],[1,"form-actions"],["spk-button","",3,"click"],["spk-button","","type","submit",1,"raised","primary",3,"disabled"],[3,"displayValue"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder","Encryption","formControlName","encryption"],["options",""],[3,"value"],[1,"passwords"],["for","password"],["id","password","tabindex","4","placeholder","Password","formControlName","password",3,"type"],["id","repeatPassword","tabindex","5","placeholder","Repeat password","formControlName","repeatPassword",3,"type"],[1,"password-actions"],["spk-button","","type","button",1,"small",3,"click"],["spk-button","","type","button",1,"small","copy"],["spk-button","","type","button",1,"small","copy",3,"click"],[1,"spk-success"]],template:function(e,n){if(e&1){let l=F();a(0,"form",1,0),y("submit",function(){return g(l),C(n.next())}),a(2,"h3",2),r(3,"General backup settings"),o(),a(4,"spk-form-field")(5,"label",3),r(6,"Backup name"),o(),m(7,"input",4),o(),a(8,"spk-form-field")(9,"label",5),r(10,"Backup description"),o(),m(11,"textarea",6),o(),f(12,At,8,2),a(13,"div",7)(14,"button",8),y("click",function(){return g(l),C(n.exit())}),a(15,"spk-icon"),r(16,"arrow-left"),o(),r(17," Exit "),o(),a(18,"div")(19,"button",9)(20,"spk-icon"),r(21,"arrow-right"),o(),r(22," Continue "),o()()()()}e&2&&(c("formGroup",n.generalForm),s(12),_(n.isNew()?12:-1),s(6),$("spk-tooltip-primary",n.generalForm.valid&&n.encryptionFieldSignal()==="none"||n.copiedPassword()?void 0:"Remember to copy the password"),s(),c("disabled",n.generalForm.invalid||n.encryptionFieldSignal()!=="none"&&n.showCopyPassword()&&!n.copiedPassword()))},dependencies:[ie,Z,te,ne,H,Y,J,X,ee,ae,re,fe,oe],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.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 Mt=["formRef"];function Rt(t,i){if(t&1&&(a(0,"option",9),r(1),o()),t&2){let e=i.$implicit;c("value",e),s(),G(e)}}function Bt(t,i){if(t&1&&(a(0,"option",9),r(1),o()),t&2){let e=i.$implicit;c("value",e),s(),G(e)}}function $t(t,i){if(t&1){let e=F();a(0,"button",22),y("click",function(){let l=g(e).$implicit,d=p();return C(d.addNewOption(l))}),r(1),o()}if(t&2){let e=i.$implicit;s(),G(e.Name)}}function Lt(t,i){t&1&&(a(0,"label",23),r(1,"Name"),o())}function zt(t,i){t&1&&(a(0,"label",25),r(1,"Value"),o())}function Ut(t,i){if(t&1){let e=F();a(0,"div",18)(1,"spk-form-field"),f(2,Lt,2,0,"label",23),m(3,"input",24),o(),a(4,"spk-form-field"),f(5,zt,2,0,"label",25),m(6,"input",26),o(),a(7,"button",27),y("click",function(){let l=g(e).$index,d=p();return C(d.optionsForm.controls.advancedOptions.removeAt(l))}),a(8,"spk-icon"),r(9,"x-circle"),o()()()}if(t&2){let e=i.$implicit,n=i.$index;c("formGroup",e),s(2),_(n===0?2:-1),s(3),_(n===0?5:-1)}}var me=new I,jt=["Bytes","KB","MB","GB","TB","PB"],qt=["Local folder","Local drive","Remote drive","Cloud drive"],St=(t={remoteVolumeSize:0,size:"GB",backupRetention:"Local folder",advancedOptions:[]})=>me.group({remoteVolumeSize:me.group({size:me.control(t.remoteVolumeSize),unit:me.control(t.size)}),backupRetention:me.control(t.backupRetention),advancedOptions:me.array([])}),et=(t,i)=>me.group({name:me.control(t),value:me.control(i)}),Xe=class t{#e=h(ge);#t=h(R);#n=h(M);#i=h(W);formRef=U.required("formRef");optionsForm=this.#t.optionsForm;sizeOptions=S(jt);rentationOptions=S(qt);selectionAdvancedOptions=Se(this.optionsForm.controls.advancedOptions.valueChanges.pipe(st([])));advancedOptions=S(this.#e.systemInfo()?.Options??[]);nonSelectedAdvancedOptions=K(()=>this.advancedOptions().filter(i=>this.selectionAdvancedOptions()?.findIndex(e=>e.name===i.Name)===-1));addNewOption(i){this.optionsForm.controls.advancedOptions.push(et(i.Name,i.DefaultValue))}displayFn(){let i=this.advancedOptions();return e=>{let n=i.find(l=>l.Name===e);return n?`${n.Name}`:""}}goBack(){this.#n.navigate(["schedule"],{relativeTo:this.#i.parent})}submit(){this.#t.submit()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=z({type:t,selectors:[["app-options"]],viewQuery:function(e,n){e&1&&j(n.formRef,Mt,5),e&2&&q()},standalone:!0,features:[Q],decls:49,vars:2,consts:[["formRef",""],[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","Select an option...","formControlName","unit"],["options",""],[3,"value"],["href","#",1,"spk-primary"],["type","text","placeholder","Local folder or drive","formControlName","backupRetention"],[3,"disallowToggle"],["title",""],["spk-button","","type","button",1,"outlined","small"],["menu",""],["spk-menu-item","","type","button"],["formArrayName","advancedOptions"],[1,"advanced-option",3,"formGroup"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["spk-menu-item","","type","button",3,"click"],["for","name"],["type","text","id","name","formControlName","name"],["for","value"],["type","text","id","value","formControlName","value"],["spk-button","","type","button",1,"icon",3,"click"]],template:function(e,n){if(e&1){let l=F();a(0,"form",1,0),y("submit",function(){return g(l),C(n.submit())}),a(2,"h3",2),r(3,"Options"),o(),a(4,"div",3)(5,"div",4)(6,"spk-form-field")(7,"label",5),r(8,"Remote volume size"),o(),m(9,"input",6),o(),a(10,"spk-select"),m(11,"input",7),k(12,8),D(13,Rt,2,2,"option",9,w),v(),o()(),a(15,"p"),r(16," The backups will be split up into multiple files called volumes. Here you can set the maximum size of the individual volume files. "),a(17,"a",10),r(18,"Read more"),o()()(),a(19,"spk-select")(20,"label",5),r(21,"Backup retention"),o(),m(22,"input",11),k(23,8),D(24,Bt,2,2,"option",9,w),v(),o(),a(26,"app-toggle-card",12),k(27,13),r(28," Advanced options "),a(29,"spk-menu")(30,"button",14),r(31," Add advanced option "),a(32,"spk-icon"),r(33,"plus"),o()(),k(34,15),D(35,$t,2,1,"button",16,w),v(),o(),v(),k(37,17),D(38,Ut,10,3,"div",18,w),v(),o(),a(40,"div",19)(41,"button",20),y("click",function(){return g(l),C(n.goBack())}),a(42,"spk-icon"),r(43,"arrow-left"),o(),r(44," Go back "),o(),a(45,"button",21)(46,"spk-icon"),r(47,"arrow-right"),o(),r(48," Submit "),o()()()}e&2&&(c("formGroup",n.optionsForm),s(13),T(n.sizeOptions()),s(11),T(n.rentationOptions()),s(2),c("disallowToggle",!0),s(9),T(n.nonSelectedAdvancedOptions()),s(3),T(n.optionsForm.controls.advancedOptions.controls))},dependencies:[ie,Z,te,ne,H,ue,Y,J,X,ee,_e,Le,ze,re,fe,oe,ae,Ce],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.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 Qt=["formRef"];function Kt(t,i){if(t&1&&(a(0,"option",24),r(1),o()),t&2){let e=i.$implicit;c("value",e.key),s(),G(e.label)}}function Wt(t,i){if(t&1){let e=F();a(0,"div",11)(1,"spk-form-field")(2,"label",12),r(3,"Next time"),o(),a(4,"input",13,1),y("focus",function(){g(e);let l=xe(5);return C(l.showPicker())}),o(),a(6,"spk-icon",14),r(7,"clock"),o()(),a(8,"spk-form-field"),m(9,"label",15),a(10,"input",16,2),y("focus",function(){g(e);let l=xe(11);return C(l.showPicker())}),o(),a(12,"spk-icon",14),r(13,"calendar"),o()()(),k(14,17),a(15,"div",18)(16,"spk-form-field")(17,"label",19),r(18,"Run again every"),o(),m(19,"input",20),o(),a(20,"spk-select",21),m(21,"input",22),k(22,23),D(23,Kt,2,2,"option",24,w),v(),o()(),a(25,"app-toggle-card",25),k(26,26),r(27,"Allowed days"),v(),a(28,"div",27)(29,"spk-toggle",6),r(30," Monday "),m(31,"input",28),o(),a(32,"spk-toggle",6),r(33," Tuesday "),m(34,"input",29),o(),a(35,"spk-toggle",6),r(36," Wednesday "),m(37,"input",30),o(),a(38,"spk-toggle",6),r(39," Thursday "),m(40,"input",31),o(),a(41,"spk-toggle",6),r(42," Friday "),m(43,"input",32),o(),a(44,"spk-toggle",6),r(45," Saturday "),m(46,"input",33),o(),a(47,"spk-toggle",6),r(48," Sunday "),m(49,"input",34),o()()(),v()}if(t&2){let e=p();s(20),c("displayFn",e.displayFn),s(3),T(e.unitOptions),s(2),c("disallowToggle",!0)}}var P=new I,kt=[{key:"s",label:"Seconds"},{key:"m",label:"Minutes"},{key:"h",label:"Hours"},{key:"D",label:"Days"},{key:"W",label:"Weeks"},{key:"M",label:"Months"},{key:"Y",label:"Years"}],vt=(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}}})=>P.group({autoRun:P.control(t.autoRun),nextTime:P.group({time:P.control(t.nextTime.time),date:P.control(t.nextTime.date)}),runAgain:P.group({repeatValue:P.control(t.runAgain.repeatValue),repeatUnit:P.control(t.runAgain.repeatUnit),allowedDays:P.group({mon:P.control(t.runAgain.allowedDays.mon),tue:P.control(t.runAgain.allowedDays.tue),wed:P.control(t.runAgain.allowedDays.wed),thu:P.control(t.runAgain.allowedDays.thu),fri:P.control(t.runAgain.allowedDays.fri),sat:P.control(t.runAgain.allowedDays.sat),sun:P.control(t.runAgain.allowedDays.sun)})})}),tt=class t{#e=h(R);#t=h(M);#n=h(W);formRef=U.required("formRef");scheduleForm=this.#e.scheduleForm;scheduleFormSignal=this.#e.scheduleFormSignal;unitOptions=kt;displayFn(i){let e=kt.find(n=>n.key===i);return e?`${e.label}`:""}goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#n.parent})}next(){this.#t.navigate(["options"],{relativeTo:this.#n.parent})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=z({type:t,selectors:[["app-schedule"]],viewQuery:function(e,n){e&1&&j(n.formRef,Qt,5),e&2&&q()},standalone:!0,features:[Q],decls:20,vars:2,consts:[["formRef",""],["timeRef",""],["dateRef",""],[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"],["spkSuffix",""],["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"],["options",""],[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,n){if(e&1){let l=F();a(0,"form",3,0),y("submit",function(){return g(l),C(n.next())}),a(2,"h3",4),r(3,"Schedule"),o(),a(4,"div",5)(5,"spk-toggle",6),r(6," Automatically run backups "),m(7,"input",7),o(),a(8,"p"),r(9,"If a date was missed, the job will run as soon as possible."),o()(),f(10,Wt,50,2),a(11,"div",8)(12,"button",9),y("click",function(){return g(l),C(n.goBack())}),a(13,"spk-icon"),r(14,"arrow-left"),o(),r(15," Go back "),o(),a(16,"button",10)(17,"spk-icon"),r(18,"arrow-right"),o(),r(19," Continue "),o()()()}if(e&2){let l;c("formGroup",n.scheduleForm),s(10),_((l=n.scheduleFormSignal())!=null&&l.autoRun?-1:10)}},dependencies:[ie,Z,te,ne,H,ue,we,Y,J,X,ee,_e,ae,re,De,oe,fe,Ce],styles:["[_nghost-%COMP%]{display:block}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})};var Ht=["formRef"];function Yt(t,i){if(t&1&&(a(0,"option",21),r(1),o()),t&2){let e=i.$implicit;c("value",e),s(),G(e)}}function Jt(t,i){if(t&1&&(a(0,"div",14)(1,"spk-form-field"),m(2,"input",18),o(),a(3,"spk-select"),m(4,"input",19),k(5,20),D(6,Yt,2,2,"option",21,w),v(),o()()),t&2){let e=p(2);s(6),T(e.sizeOptions())}}function Zt(t,i){if(t&1){let e=F();a(0,"form",2,0),y("submit",function(){g(e);let l=p();return C(l.next())}),a(2,"h3",3),r(3,"Source Data"),o(),a(4,"app-file-tree",4)(5,"label",5),r(6,"Folder path"),o(),m(7,"input",6),o(),a(8,"app-toggle-card",7),k(9,8),r(10,"Exclude"),v(),a(11,"spk-toggle",9),r(12," Hidden files "),m(13,"input",10),o(),a(14,"spk-toggle",9),r(15," System files "),m(16,"input",11),o(),a(17,"spk-toggle",9),r(18," Temporary files "),m(19,"input",12),o(),a(20,"spk-toggle",13),y("click",function(){g(e);let l=p();return C(l.toggleFilesLargerThan())}),r(21," Files larger than "),o(),f(22,Jt,8,0,"div",14),o(),a(23,"div",15)(24,"button",16),y("click",function(){g(e);let l=p();return C(l.goBack())}),a(25,"spk-icon"),r(26,"arrow-left"),o(),r(27," Go back "),o(),a(28,"button",17)(29,"spk-icon"),r(30,"arrow-right"),o(),r(31," Continue "),o()()()}if(t&2){let e=p();c("formGroup",e.sourceDataForm),s(4),c("multiSelect",!0)("startingPath",e.getPath()),s(4),c("isActive",!0),s(12),pt("active",e.filesLargerThan()),s(2),_(e.filesLargerThan()?22:-1)}}var ce=new I,Xt=["Bytes","KB","MB","GB","TB","PB"],en=["Contains","Does not contain","Is greater than","Is less than"];var Ft=(t={path:"",excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>ce.group({path:ce.control(t.path),excludes:ce.group({hidden:ce.control(t.excludes.hidden),system:ce.control(t.excludes.system),temporary:ce.control(t.excludes.temporary),filesLargerThan:ce.group({size:ce.control(null),unit:ce.control(null)})})}),nt=class t{#e=h(R);#t=h(M);#n=h(W);formRef=U.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;destinationIsLoaded=this.#e.destinationIsLoaded;filesLargerThan=K(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);sizeOptions=S(Xt);expressionOptions=S(en);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})}goBack(){this.#t.navigate(["destination"],{relativeTo:this.#n.parent})}next(){this.#t.navigate(["schedule"],{relativeTo:this.#n.parent})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=z({type:t,selectors:[["app-source-data"]],viewQuery:function(e,n){e&1&&j(n.formRef,Ht,5),e&2&&q()},standalone:!0,features:[Q],decls:1,vars:1,consts:[["formRef",""],[3,"formGroup"],[3,"submit","formGroup"],[1,"title-30"],[3,"multiSelect","startingPath"],["for","path"],["type","text","id","path","tabindex","4","placeholder","Path","formControlName","path"],["formGroupName","excludes",3,"isActive"],["title",""],[1,"raised","primary"],["type","checkbox","placeholder","Hidden files","formControlName","hidden"],["type","checkbox","placeholder","System files","formControlName","system"],["type","checkbox","placeholder","Temporary files","formControlName","temporary"],[1,"raised","primary",3,"click"],["formGroupName","filesLargerThan",1,"row-inputs"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["type","number","formControlName","size"],["type","text","formControlName","unit","placeholder","Select an option..."],["options",""],[3,"value"]],template:function(e,n){e&1&&f(0,Zt,32,7,"form",1),e&2&&_(n.destinationIsLoaded()?0:-1)},dependencies:[ie,Z,te,ne,H,ue,we,Y,J,X,ee,_e,ae,oe,fe,re,De,Ue,Ce],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}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.5rem}.filter-inputs[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:flex-end}.filter-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.filter-inputs[_ngcontent-%COMP%] .filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var L=new I,R=class t{#e=h(M);#t=h(ge);#n=h(Ct);#i=h(je);destinationOptions=this.#t.backendModules;backupId=S(null);isSubmitting=S(!1);loadingBackup=S(!1);loadingDefaults=S(!0);destinationIsLoaded=S(!1);isNew=K(()=>this.backupId()==="new");backupDefaults=S(null);generalForm=ht();sourceDataForm=Ft();scheduleForm=vt();destinationForm=bt();optionsForm=St();selectedAdvancedFormPair=S([]);notSelectedAdvancedFormPair=S([]);destinationFormPair=S({oauthField:null,custom:[],dynamic:[],advanced:[]});sourceDataFormSignal=Se(this.sourceDataForm.valueChanges);destinationFormSignal=Se(this.destinationForm.valueChanges);encryptionFieldSignal=Se(this.generalForm.controls.encryption.valueChanges);scheduleFormSignal=Se(this.scheduleForm.valueChanges);encryptionOptions=K(()=>{let i=this.#t.systemInfo()?.EncryptionModules??[];return[Ze,...i]});init(i="new"){this.backupId.set(i),i!=="new"?this.getBackup(i):this.getDefaults()}submit(){this.isSubmitting.set(!0);let i=this.#p(),e=this.backupId();e==="new"||!e?this.#n.postApiV1Backups({requestBody:i}).pipe(ye(()=>this.isSubmitting.set(!1))).subscribe({next:n=>{console.log("submitted res",n),this.exit()},error:n=>{console.error("submitted error",n)}}):this.#n.putApiV1BackupById({id:e,requestBody:i}).pipe(ye(()=>this.isSubmitting.set(!1))).subscribe({next:n=>{console.log("submitted res",n),this.exit()},error:n=>{console.error("submitted error",n)}})}exit(){this.#d(),this.#e.navigate(["/"])}getDefaults(){this.loadingDefaults.set(!0),this.#n.getApiV1Backupdefaults().pipe(lt(1),ye(()=>this.loadingDefaults.set(!1))).subscribe({next:i=>{this.#r(i.Schedule),this.#s(i.Backup),this.backupDefaults.set(i),this.destinationIsLoaded.set(!0)}})}getBackup(i){this.loadingBackup.set(!0),this.#n.getApiV1BackupById({id:i}).pipe(ye(()=>this.loadingBackup.set(!1))).subscribe({next:e=>{this.#r(e.Schedule??null),e.Backup&&(this.#l(e.Backup),this.#a(e.Backup),this.#o(e.Backup),this.#s(e.Backup)),this.destinationIsLoaded.set(!0)}})}#o(i){let e=i.Sources??"",n=i.Filters?.map(O=>`${O.Include?"":"-"}${O.Expression}`)??[],l=i.Settings?.find(O=>O.Name==="--exclude-files-attributes")?.Value??"",d=i.Settings?.find(O=>O.Name==="--skip-files-larger-than")??null,b=d?.Value.replace(/[0-9]/g,"")??null,B=d?.Value.replace(/[^0-9]/g,"")??null,le={path:[...e,...n].join("\0"),excludes:{hiddenFiles:l.includes("hidden"),systemFiles:l.includes("system"),tempFiles:l.includes("temporary"),filesLargerThan:b&&B?{size:parseInt(B),unit:b.toUpperCase()}:null}};this.sourceDataForm.patchValue(le)}#a(i){let e=i.TargetURL?xt(i.TargetURL):null;e&&this.addDestinationFormGroup(e.destinationType,{custom:e.custom,dynamic:e.dynamic,advanced:e.advanced})}#l(i){let e=i.Settings?.find(l=>l.Name==="encryption-module"),n=e?.Value&&e.Value.length?e.Value:"none";this.generalForm.patchValue({name:i.Name??"",description:i.Description??"",encryption:n})}#r(i){if(!i){this.scheduleForm.patchValue({autoRun:!0});return}let e=this.#i.fromString(i.Repeat)??null,l={nextTime:this.#c(i.Time),runAgain:{repeatValue:e?.value??1,repeatUnit:e?.unit??"D",allowedDays:{mon:i.AllowedDays?.includes("mon")??!1,tue:i.AllowedDays?.includes("tue")??!1,wed:i.AllowedDays?.includes("wed")??!1,thu:i.AllowedDays?.includes("thu")??!1,fri:i.AllowedDays?.includes("fri")??!1,sat:i.AllowedDays?.includes("sat")??!1,sun:i.AllowedDays?.includes("sun")??!1}}};this.scheduleForm.patchValue(l)}#s(i){let e=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than"];i.Settings?.forEach(n=>{if(n.Name==="encryption-module")return this.generalForm.controls.encryption.setValue(n.Value??"None");n.Name&&e.includes(n.Name)||n.Name&&n.Value&&this.optionsForm.controls.advancedOptions.push(et(n.Name,n.Value))})}mapPub(){this.#p()}#p(){let i=this.generalForm.value,e=this.optionsForm.value,n=this.scheduleForm.value,l=this.sourceDataForm.value,b=this.destinationForm.value.destinations?.length?this.#m(this.destinationForm.controls.destinations):[],B=null;n.runAgain?.repeatUnit&&n.runAgain?.repeatValue&&(B=this.#i.toString(n.runAgain.repeatValue,n.runAgain.repeatUnit));let le=n.runAgain?.allowedDays?Object.entries(n.runAgain?.allowedDays).filter(([x,E])=>E).map(([x,E])=>x):[],O=l.path?.split("\0")??[],Ge=e.advancedOptions?.map(x=>({Name:x.name??null,Value:x.value&&x.value.length?x.value.toString():null}))??[],Fe=[i.encryption==="none"?{Name:"--no-encryption",Value:"True"}:{Name:"encryption-module",Value:i.encryption??null},...Ge.filter(x=>x.Name&&x.Value)],V=Object.entries(l.excludes??{}).filter(([x,E])=>E&&x!=="filesLargerThan").map(([x])=>x),u=l.excludes?.filesLargerThan;return V.length&&Fe.push({Name:"--exclude-files-attributes",Value:V.join(",")}),u&&u.size!==null&&u.unit!==null&&Fe.push({Name:"--skip-files-larger-than",Value:`${u.size}${u.unit}`}),{Backup:{Name:i.name,Description:i.description,TargetURL:b[0]??null,Sources:O.filter(x=>!x.startsWith("-")),Settings:Fe,Filters:O.filter(x=>x.startsWith("-")).map((x,E)=>({Order:E,Include:!1,Expression:x.slice(1)}))},Schedule:n.autoRun?null:{Repeat:B,Time:n.nextTime?.date?new Date(`${n.nextTime.date}T${n.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:le}}}#m(i){return i.controls.map(e=>{if(!e.controls.advanced)return Ne(e.value);let n=Object.keys(e.controls.advanced.controls).filter(l=>e.controls.advanced.controls[l].dirty);return Ne(Me(se({},e.value),{advanced:n.reduce((l,d)=>(l[d]=e.controls.advanced.controls[d].value,l),{})}))})}#c(i){if(!i||i?.indexOf("T")===-1)return{time:i??"13:00"};let e=new Date(i),n={time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`};return i.indexOf("T")!==-1&&(n.date=e.toISOString().split("T")[0]),n}addDestinationFormGroup(i,e){let n=this.destinationOptions().find(V=>V.Key===i);if(!n||!n.Options)return;let l=Ve.hasOwnProperty(i)&&Ve[i],d=l&&l.customFields?l.customFields:{},b=l&&l.dynamicFields?l.dynamicFields:[],B=l&&l.advancedFields?l.advancedFields:[],le=l&&l.oauthField?l.oauthField:null;this.destinationFormPair.set({oauthField:le,custom:[],dynamic:[],advanced:[]}),this.selectedAdvancedFormPair.set([]);let O=L.group({}),Ge=L.group({}),He=L.group({});if(d)for(i in d){let Fe=d[i],{formElement:V}=Fe,u=rt(Fe,["formElement"]);O.addControl(i,V(e?.custom[i])),this.destinationFormPair.update(x=>(x.custom.push(u),x))}for(let V=0;V<n.Options.length;V++){let u=n.Options[V];if(u.Deprecated)continue;let x=b.includes(u.Name),E=x?Ge:He;this.destinationFormPair.update(Pe=>(Pe[x?"dynamic":"advanced"].push({name:u.Name,type:u.Type,shortDescription:u.ShortDescription??void 0,longDescription:u.LongDescription??void 0,options:u.ValidValues}),Pe));let de=(x?e?.dynamic[u.Name]:e?.advanced[u.Name])??u.DefaultValue;if(u.Type==="String"||u.Type==="Password"||u.Type==="Enumeration"||u.Type==="Path"){E.addControl(u.Name,L.control(de));continue}if(u.Type==="Size"){let Pe=de.replace(/[0-9]/g,""),at=de.replace(/[^0-9]/g,"");E.addControl(u.Name,L.group({size:L.control(at?parseInt(at):50),unit:L.control(Pe?Pe.toUpperCase():"MB")}))}if(u.Type==="Integer"){E.addControl(u.Name,L.control(de?parseInt(de):0));continue}if(u.Type==="Boolean"){E.addControl(u.Name,L.control(de==="true"));continue}if(u.Type==="Flags"){E.addControl(u.Name,L.control(de??""));continue}u.Type==="Timespan"&&E.addControl(u.Name,L.control(de,[he.pattern(/([-+]?\d{1,3}[smhDWMY])+/)]))}this.destinationForm.controls.destinations.length!==0&&this.destinationForm.controls.destinations.removeAt(0),this.destinationFormPair.update(V=>({oauthField:V.oauthField,custom:V.custom,dynamic:V.dynamic.sort((u,x)=>b.indexOf(u.name)-b.indexOf(x.name)),advanced:V.advanced.sort((u,x)=>{let E=B.indexOf(u.name),Ae=B.indexOf(x.name);return E===-1&&Ae!==-1?1:E!==-1&&Ae===-1?-1:E-Ae})})),this.notSelectedAdvancedFormPair.set(this.destinationFormPair().advanced),this.destinationForm.controls.destinations.push(wt({key:n.Key,customGroup:O,dynamicGroup:Ge,advancedGroup:He}))}#d(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleForm.reset(),this.destinationForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"})};var tn=["formRef"],nn=(t,i,e,n)=>({destination:t,destinationType:i,index:e,formGroupName:"custom",oauthField:n}),ot=t=>({$implicit:t}),on=(t,i,e,n)=>({destination:t,destinationType:i,index:e,formGroupName:"dynamic",oauthField:n}),an=(t,i,e,n)=>({destination:t,destinationType:i,index:e,formGroupName:"advanced",oauthField:n});function rn(t,i){if(t&1){let e=F();a(0,"p",9),y("click",function(){g(e);let l=p(2);return C(l.removeDestinationFormGroup(l.destinationCount()-1))}),r(1," Wanna select another destination? "),a(2,"span",10),r(3,"Click here"),o()()}}function ln(t,i){if(t&1){let e=F();a(0,"div",11)(1,"div",12),y("click",function(){g(e);let l=p(2);return C(l.addDestinationFormGroup("file"))}),a(2,"h3"),r(3,"File system"),o(),a(4,"p"),r(5,"Store backups on your local file system."),o()(),a(6,"div",12),y("click",function(){g(e);let l=p(2);return C(l.addDestinationFormGroup("gcs"))}),a(7,"h3"),r(8,"Google Cloud Storage"),o(),a(9,"p"),r(10,"Store backups in Google Cloud Storage."),o()(),a(11,"div",12),y("click",function(){g(e);let l=p(2);return C(l.addDestinationFormGroup("s3"))}),a(12,"h3"),r(13,"S3 compatible bucket"),o(),a(14,"p"),r(15,"Store backups in any S3 compatible bucket."),o()(),a(16,"div",12),y("click",function(){g(e);let l=p(2);return C(l.addDestinationFormGroup("ssh"))}),a(17,"h3"),r(18,"SSH"),o(),a(19,"p"),r(20,"Store backups in SSH."),o()(),a(21,"div",12),y("click",function(){g(e);let l=p(2);return C(l.addDestinationFormGroup("googledrive"))}),a(22,"h3"),r(23,"Google Drive"),o(),a(24,"p"),r(25,"Store backups in Google Drive."),o()()(),a(26,"p"),r(27,"More destinations are coming soon."),o()}}function sn(t,i){t&1&&Re(0)}function pn(t,i){if(t&1&&f(0,sn,1,0,"ng-container",15),t&2){let e,n=i.$implicit,l=i.$index;p(2);let d=xe(6),b=p(2);c("ngTemplateOutlet",d)("ngTemplateOutletContext",Be(7,ot,$e(2,nn,n,(e=b.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,l,b.destinationFormPair().oauthField)))}}function mn(t,i){if(t&1&&(k(0),D(1,pn,1,9,"ng-container",null,w),v()),t&2){let e=p(3);s(),T(e.destinationFormPair().custom)}}function cn(t,i){t&1&&Re(0)}function dn(t,i){if(t&1&&f(0,cn,1,0,"ng-container",15),t&2){let e,n=i.$implicit,l=i.$index;p(2);let d=xe(6),b=p(2);c("ngTemplateOutlet",d)("ngTemplateOutletContext",Be(7,ot,$e(2,on,n,(e=b.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,l,b.destinationFormPair().oauthField)))}}function un(t,i){if(t&1&&(k(0),D(1,dn,1,9,"ng-container",null,w),v()),t&2){let e=p(3);s(),T(e.destinationFormPair().dynamic)}}function _n(t,i){if(t&1){let e=F();a(0,"button",20),y("click",function(){let l=g(e).$implicit,d=p(4);return C(d.addAdvancedFormPair(l))}),r(1),o()}if(t&2){let e=i.$implicit;s(),A(" ",e.name," ")}}function fn(t,i){t&1&&Re(0)}function gn(t,i){if(t&1&&f(0,fn,1,0,"ng-container",15),t&2){let e,n=i.$implicit,l=i.$index;p(2);let d=xe(6),b=p(2);c("ngTemplateOutlet",d)("ngTemplateOutletContext",Be(7,ot,$e(2,an,n,(e=b.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,l,b.destinationFormPair().oauthField)))}}function Cn(t,i){if(t&1&&(a(0,"app-toggle-card",14),k(1,16),r(2," Advanced options "),a(3,"spk-menu")(4,"button",17),r(5," Add advanced option "),a(6,"spk-icon"),r(7,"plus"),o()(),k(8,18),D(9,_n,2,1,"button",19,w),v(),o(),v(),k(11),D(12,gn,1,9,"ng-container",null,w),v(),o()),t&2){let e=p(3);c("disallowToggle",!0),s(9),T(e.notSelectedAdvancedFormPair()),s(3),T(e.selectedAdvancedFormPair())}}function yn(t,i){if(t&1&&(a(0,"spk-icon",27),r(1," question "),o()),t&2){let e=p(2).$implicit;$("spk-tooltip-primary",e.destination.longDescription)}}function xn(t,i){if(t&1&&(a(0,"app-file-tree",22)(1,"label",26),r(2),f(3,yn,2,1,"spk-icon",27),o(),m(4,"input",28),o()),t&2){let e,n=p().$implicit,l=p(3);c("startingPath",l.getFormFieldValue(n.index,n.formGroupName,n.destination.name)),s(),mt("for","destination-",n.formGroupName,"-",n.formGroupName,"-",n.index,""),s(),A(" ",(e=n.destination.shortDescription)!==null&&e!==void 0?e:n.destination.name," "),s(),_(n.destination.longDescription?3:-1),s(),N("id","destination-",n.formGroupName,"-",n.index,""),pe("formControlName",n.destination.name)}}function hn(t,i){if(t&1&&(a(0,"spk-icon",27),r(1," question "),o()),t&2){let e=p(2).$implicit;$("spk-tooltip-primary",e.destination.longDescription)}}function Sn(t,i){t&1&&(a(0,"spk-icon",29),r(1,"link"),o())}function kn(t,i){t&1&&(a(0,"spk-icon",29),r(1,"textbox"),o())}function vn(t,i){if(t&1&&(a(0,"spk-form-field")(1,"label",26),r(2),f(3,hn,2,1,"spk-icon",27),o(),m(4,"input",28),f(5,Sn,2,0,"spk-icon",29)(6,kn,2,0,"spk-icon",29),o()),t&2){let e,n=p().$implicit;s(),N("for","destination-",n.formGroupName,"-",n.index,""),s(),A(" ",(e=n.destination.shortDescription)!==null&&e!==void 0?e:n.destination.name," "),s(),_(n.destination.longDescription?3:-1),s(),N("id","destination-",n.formGroupName,"-",n.index,""),pe("formControlName",n.destination.name),s(),_(n.destination.type==="Path"?5:6)}}function Fn(t,i){if(t&1){let e=F();a(0,"span",33),y("click",function(){g(e);let l=p(2).$implicit,d=p(3);return C(d.oauthStartTokenCreation(l.destinationType))}),r(1,"AuthID"),o()}}function bn(t,i){t&1&&(a(0,"spk-icon",29),r(1,"password"),o())}function wn(t,i){if(t&1){let e=F();a(0,"spk-icon",34),y("click",function(){g(e);let l=p(2).$implicit;return C(l.destination.showPassword=!l.destination.showPassword)}),r(1," eye "),o()}}function Dn(t,i){if(t&1){let e=F();a(0,"spk-icon",34),y("click",function(){g(e);let l=p(2).$implicit;return C(l.destination.showPassword=!l.destination.showPassword)}),r(1," eye-slash "),o()}}function Tn(t,i){if(t&1&&(a(0,"spk-form-field")(1,"label",26),r(2),o(),m(3,"input",30),f(4,Fn,2,0,"span",31)(5,bn,2,0,"spk-icon",29)(6,wn,2,0,"spk-icon",32)(7,Dn,2,0,"spk-icon",32),o()),t&2){let e,n=p().$implicit;s(),N("for","destination-",n.formGroupName,"-",n.index,""),s(),ct(" ",(e=n.destination.shortDescription)!==null&&e!==void 0?e:n.destination.name," -- ",n.oauthField," ",n.destinationType," ",n.destination.name," "),s(),N("id","destination-",n.formGroupName,"-",n.index,""),pe("formControlName",n.destination.name),c("type",n.destination.showPassword?"text":"password"),s(),_(n.oauthField===n.destination.name?4:5),s(2),_(n.destination.showPassword?6:7)}}function En(t,i){if(t&1&&(a(0,"spk-icon",27),r(1," question "),o()),t&2){let e=p(2).$implicit;$("spk-tooltip-primary",e.destination.longDescription)}}function Nn(t,i){if(t&1&&(a(0,"option",37),r(1),o()),t&2){let e=i.$implicit;c("value",e),s(),G(e)}}function On(t,i){if(t&1&&(a(0,"spk-select")(1,"label",26),r(2),f(3,En,2,1,"spk-icon",27),o(),m(4,"input",35),k(5,36),D(6,Nn,2,2,"option",37,w),v(),o()),t&2){let e,n=p().$implicit;s(),N("for","destination-",n.formGroupName,"-",n.index,""),s(),A(" ",(e=n.destination.shortDescription)!==null&&e!==void 0?e:n.destination.name," "),s(),_(n.destination.longDescription?3:-1),s(),N("id","destination-",n.formGroupName,"-",n.index,""),pe("formControlName",n.destination.name),s(2),T(n.destination.options)}}function Pn(t,i){if(t&1&&(a(0,"spk-icon",27),r(1," question "),o()),t&2){let e=p(2).$implicit;$("spk-tooltip-primary",e.destination.longDescription)}}function Vn(t,i){if(t&1&&(a(0,"option",37),r(1),o()),t&2){let e=i.$implicit;c("value",e),s(),G(e)}}function In(t,i){if(t&1&&(a(0,"div",23)(1,"label",26),r(2),f(3,Pn,2,1,"spk-icon",27),o(),a(4,"div",38)(5,"spk-form-field"),m(6,"input",39),a(7,"spk-icon",29),r(8,"resize"),o()(),a(9,"spk-select"),m(10,"label")(11,"input",40),k(12,36),D(13,Vn,2,2,"option",37,w),v(),o()()()),t&2){let e,n=p().$implicit,l=p(3);c("formGroupName",n.destination.name),s(),N("for","destination-",n.formGroupName,"-",n.index,""),s(),A(" ",(e=n.destination.shortDescription)!==null&&e!==void 0?e:n.destination.name," "),s(),_(n.destination.longDescription?3:-1),s(3),N("id","destination-",n.formGroupName,"-",n.index,""),s(7),T(l.sizeOptions())}}function Gn(t,i){if(t&1&&(a(0,"spk-icon",27),r(1," question "),o()),t&2){let e=p(2).$implicit;$("spk-tooltip-primary",e.destination.longDescription)}}function An(t,i){if(t&1&&(a(0,"spk-form-field")(1,"label",26),r(2),f(3,Gn,2,1,"spk-icon",27),o(),m(4,"input",41),a(5,"spk-icon",29),r(6,"numpad"),o()()),t&2){let e,n=p().$implicit;s(),N("for","destination-",n.formGroupName,"-",n.index,""),s(),A(" ",(e=n.destination.shortDescription)!==null&&e!==void 0?e:n.destination.name," "),s(),_(n.destination.longDescription?3:-1),s(),N("id","destination-",n.formGroupName,"-",n.index,""),pe("formControlName",n.destination.name)}}function Mn(t,i){if(t&1&&(a(0,"spk-icon",27),r(1," question "),o()),t&2){let e=p(2).$implicit;$("spk-tooltip-primary",e.destination.longDescription)}}function Rn(t,i){if(t&1&&(a(0,"spk-toggle",24)(1,"label",26),r(2),f(3,Mn,2,1,"spk-icon",27),o(),m(4,"input",42),o()),t&2){let e,n=p().$implicit;s(),N("for","destination-",n.formGroupName,"-",n.index,""),s(),A(" ",(e=n.destination.shortDescription)!==null&&e!==void 0?e:n.destination.name," "),s(),_(n.destination.longDescription?3:-1),s(),N("id","destination-",n.formGroupName,"-",n.index,""),pe("formControlName",n.destination.name)}}function Bn(t,i){if(t&1&&(a(0,"spk-icon",27),r(1," question "),o()),t&2){let e=p(2).$implicit;$("spk-tooltip-primary",e.destination.longDescription)}}function $n(t,i){t&1&&(a(0,"spk-option",44),r(1,"None"),o()),t&2&&c("value","None")}function Ln(t,i){if(t&1&&(a(0,"spk-option",37),r(1),m(2,"spk-checkbox",45),o()),t&2){let e=p().$implicit;c("value",e),s(),A(" ",e," ")}}function zn(t,i){if(t&1&&f(0,$n,2,1,"spk-option",44)(1,Ln,3,2,"spk-option",37),t&2){let e=i.$implicit;_(e==="None"?0:1)}}function Un(t,i){if(t&1&&(a(0,"spk-select",25)(1,"label",26),r(2),f(3,Bn,2,1,"spk-icon",27),o(),m(4,"input",43),k(5,36),D(6,zn,2,1,null,null,w),v(),o()),t&2){let e,n=p().$implicit;c("selectMultiple",!0),s(),N("for","destination-",n.formGroupName,"-",n.index,""),s(),A(" ",(e=n.destination.shortDescription)!==null&&e!==void 0?e:n.destination.name," "),s(),_(n.destination.longDescription?3:-1),s(),pe("formControlName",n.destination.name),s(2),T(n.destination.options)}}function jn(t,i){if(t&1&&(a(0,"spk-icon",27),r(1," question "),o()),t&2){let e=p(2).$implicit;$("spk-tooltip-primary",e.destination.longDescription)}}function qn(t,i){if(t&1&&(a(0,"spk-form-field")(1,"label",26),r(2),f(3,jn,2,1,"spk-icon",27),o(),m(4,"input",28)(5,"span",46),o()),t&2){let e,n=p().$implicit;s(),N("for","destination-",n.formGroupName,"-",n.index,""),s(),A(" ",(e=n.destination.shortDescription)!==null&&e!==void 0?e:n.destination.name," "),s(),_(n.destination.longDescription?3:-1),s(),N("id","destination-",n.formGroupName,"-",n.index,""),pe("formControlName",n.destination.name)}}function Qn(t,i){if(t&1&&(k(0,21),f(1,xn,5,11,"app-file-tree",22)(2,vn,7,10,"spk-form-field")(3,Tn,8,14,"spk-form-field")(4,On,8,9,"spk-select")(5,In,15,9,"div",23)(6,An,7,9,"spk-form-field")(7,Rn,5,9,"spk-toggle",24)(8,Un,8,7,"spk-select",25)(9,qn,6,9,"spk-form-field"),v()),t&2){let e=i.$implicit;c("formGroupName",e.formGroupName),s(),_(e.destination.type==="file-tree"?1:e.destination.type==="String"||e.destination.type==="Path"?2:e.destination.type==="Password"?3:e.destination.type==="Enumeration"?4:e.destination.type==="Size"?5:e.destination.type==="Integer"?6:e.destination.type==="Boolean"?7:e.destination.type==="Flags"?8:e.destination.type==="Timespan"?9:-1)}}function Kn(t,i){if(t&1&&(k(0,5)(1,13),f(2,mn,3,0,"ng-container")(3,un,3,0,"ng-container")(4,Cn,14,1,"app-toggle-card",14)(5,Qn,10,2,"ng-template",null,1,dt),v()()),t&2){let e=p(2);s(2),_(e.destinationFormPair().custom.length?2:-1),s(),_(e.destinationFormPair().dynamic.length?3:-1),s(),_(e.destinationFormPair().advanced.length?4:-1)}}function Wn(t,i){if(t&1){let e=F();a(0,"form",3,0),y("submit",function(){g(e);let l=p();return C(l.next())}),a(2,"header")(3,"h3",4),r(4,"Backup destination"),o(),f(5,rn,4,0,"p"),o(),f(6,ln,28,0)(7,Kn,7,3,"ng-container",5),a(8,"div",6)(9,"button",7),y("click",function(){g(e);let l=p();return C(l.goBack())}),a(10,"spk-icon"),r(11,"arrow-left"),o(),r(12," Go back "),o(),a(13,"button",8)(14,"spk-icon"),r(15,"arrow-right"),o(),r(16," Continue "),o()()()}if(t&2){let e,n=p();c("formGroup",n.destinationForm),s(5),_(n.destinationCount()>0?5:-1),s(),_(n.destinationCount()===0?6:-1),s(),_(!((e=n.destinationFormSignal())==null||e.destinations==null)&&e.destinations.length?7:-1)}}var Hn=["Bytes","KB","MB","GB","TB","PB"],We=new I,bt=(t={destinations:[]})=>We.group({destinations:We.array(t.destinations)}),wt=({key:t,customGroup:i,dynamicGroup:e,advancedGroup:n})=>We.group({destinationType:We.control(t),custom:i,dynamic:e,advanced:n}),it=class t{#e=h(M);#t=h(W);#n=h(ge);#i=h(_t);#o=h(R);formRef=U.required("formRef");sysIsLoaded=this.#n.isLoaded;destinationIsLoaded=this.#o.destinationIsLoaded;destinationForm=this.#o.destinationForm;destinationFormPair=this.#o.destinationFormPair;selectedAdvancedFormPair=this.#o.selectedAdvancedFormPair;notSelectedAdvancedFormPair=this.#o.notSelectedAdvancedFormPair;destinationOptions=this.#o.destinationOptions;destinationFormSignal=this.#o.destinationFormSignal;destinationCount=K(()=>this.destinationFormSignal()?.destinations?.length??0);sizeOptions=S(Hn);getFormFieldValue(i,e,n){return((this.destinationForm.controls.destinations.controls?.[i]).controls?.[e]).controls[n].value}addDestinationFormGroup(i){this.#o.addDestinationFormGroup(i)}addAdvancedFormPair(i){this.selectedAdvancedFormPair.update(e=>(e.push(i),e)),this.notSelectedAdvancedFormPair.update(e=>(e=e.filter(n=>n.name!==i.name),e))}targetUrl=K(()=>{let i=this.destinationFormSignal()?.destinations?.[0];return i?Ne(i):""});mapToTargetUrl(i){return Ne(i.value)}removeDestinationFormGroup(i){this.destinationForm.controls.destinations.removeAt(i)}displayFn(i){let e=this.destinationOptions().find(n=>n.Key===i);return e?`${e.DisplayName}`:""}goBack(){this.#e.navigate(["general"],{relativeTo:this.#t.parent})}next(){this.#e.navigate(["source-data"],{relativeTo:this.#t.parent})}#a=S("https://duplicati-oauth-handler.appspot.com/").asReadonly();#l=S(Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2)).asReadonly();#r=S(!1);#s=S(null);keyCreation(){}oauthStartTokenCreation(i){this.#r.set(!0);let e=450,n=600,l=this.#a()+"?type="+i+"&token="+this.#l(),d=screen.width/2-e/2,b=screen.height/2-n/2,B=window.open(l,"_blank","height="+n+",width="+e+",menubar=0,status=0,titlebar=0,toolbar=0,left="+d+",top="+b);B?.addEventListener("blur",le=>{console.log("event blur",le)}),B?.addEventListener("beforeunload",le=>{console.log("event beforeunload",le),this.#i.get(this.#a()+"fetch?callback=JSON_CALLBACK",{params:{token:this.#l()}}).pipe(ye(()=>this.#r.set(!1))).subscribe({next:O=>{console.log("res",O),O?.authid&&this.#s.set(O.authid)}})})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=z({type:t,selectors:[["app-destination"]],viewQuery:function(e,n){e&1&&j(n.formRef,tn,5),e&2&&q()},standalone:!0,features:[Q],decls:1,vars:1,consts:[["formRef",""],["fieldTemplate",""],[3,"formGroup"],[3,"submit","formGroup"],[1,"title-30"],["formArrayName","destinations"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[3,"click"],[1,"spk-primary"],[1,"most-common-destinations"],[1,"tile",3,"click"],["formGroupName","0"],[3,"disallowToggle"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["title",""],["spk-button","","type","button",1,"outlined","small"],["menu",""],["spk-menu-item","","type","button"],["spk-menu-item","","type","button",3,"click"],[3,"formGroupName"],[3,"startingPath"],[1,"form-column",3,"formGroupName"],[1,"primary","raised"],[1,"primary",3,"selectMultiple"],[3,"for"],["spk-tooltip-right",""],["type","text",3,"id","formControlName"],["spkPrefix",""],[3,"type","id","formControlName"],["spkPrefix","",1,"link"],["spkSuffix","",1,"clickable"],["spkPrefix","",1,"link",3,"click"],["spkSuffix","",1,"clickable",3,"click"],["type","search",3,"id","formControlName"],["options",""],[3,"value"],[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"],["spkError",""]],template:function(e,n){e&1&&f(0,Wn,17,4,"form",2),e&2&&_(n.destinationOptions().length&&n.sysIsLoaded()&&n.destinationIsLoaded()?0:-1)},dependencies:[ie,Z,te,ne,H,ue,we,Y,J,X,ee,_e,Le,ut,ae,re,ze,ft,gt,oe,De,Ce,Ue],styles:["[_nghost-%COMP%]{display:block}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}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}[spkprefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-500)}"],changeDetection:0})};export{bt as a,wt as b,it as c,ht as d,Ze as e,Je as f,St as g,et as h,Xe as i,vt as j,tt as k,Ft as l,nt as m,R as n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Y}from"./chunk-CQGUEKNU.js";import{a as J}from"./chunk-V7LHB36E.js";import{a as R}from"./chunk-WU4K3UNC.js";import{a as $,d as A,e as V,g as z,j}from"./chunk-LNCAETYE.js";import{d as N}from"./chunk-AFUS3PYG.js";import"./chunk-L4EVZZOM.js";import"./chunk-SYBUINNV.js";import{$a as s,Db as e,Fb as u,Jb as D,Kb as B,Lb as S,Oa as p,Ob as M,Pb as I,Qb as H,X as _,Z as v,aa as y,bb as m,fb as d,gb as P,ha as f,hb as O,ia as g,ib as E,jb as a,kb as o,lb as x,mb as F,mc as L,nb as w,pb as T,qb as b,rb as c}from"./chunk-RBNO3K72.js";var C=class t{#t=_(J);transform(l,...n){if(!l)return"";let i=l.split(".")[0],r=parseInt(i.split(":")[0])??0,k=parseInt(i.split(":")[1])??0,q=parseInt(i.split(":")[2])??0;return this.#t.duration({hours:r,minutes:k,seconds:q}).humanize()}static \u0275fac=function(n){return new(n||t)};static \u0275pipe=y({name:"durationFormat",type:t,pure:!0,standalone:!0})};var K=()=>["/add-backup"],Q=()=>["/restore"],U=t=>["/backup",t],W=t=>["/backup",t,"export"];function X(t,l){if(t&1&&(e(0),M(1,"durationFormat")),t&2){let n=c().$implicit;u(" - (took ",I(1,1,n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDuration),") ")}}function Z(t,l){t&1&&e(0," N/A ")}function tt(t,l){if(t&1&&e(0),t&2){let n=c().$implicit;u(" ",n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.SourceSizeString," ")}}function et(t,l){t&1&&e(0," N/A ")}function nt(t,l){if(t&1&&e(0),t&2){let n=c().$implicit;u(" ",n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.TargetSizeString," ")}}function it(t,l){t&1&&e(0," N/A ")}function at(t,l){if(t&1&&(a(0,"spk-chip",8),e(1),o()),t&2){let n=c().$implicit;p(),u("",n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.BackupListCount," Version")}}function ot(t,l){t&1&&(a(0,"spk-chip",9),e(1,"No version yet"),o())}function lt(t,l){if(t&1){let n=T();a(0,"div",7)(1,"div",2)(2,"h3"),e(3),a(4,"spk-icon"),e(5,"database"),o()(),a(6,"p")(7,"span"),e(8,"Last successful backup:"),o(),e(9),M(10,"date"),s(11,X,2,3)(12,Z,1,0),o(),a(13,"p")(14,"span"),e(15,"Source:"),o(),s(16,tt,1,1)(17,et,1,0),o(),a(18,"p")(19,"span"),e(20,"Destination:"),o(),s(21,nt,1,1)(22,it,1,0),o()(),s(23,at,2,1,"spk-chip",8)(24,ot,2,0,"spk-chip",9),a(25,"div",10)(26,"button",11),b("click",function(){let r=f(n).$implicit,k=c(2);return g(k.startBackup(r.Backup==null?null:r.Backup.ID))}),a(27,"spk-icon"),e(28,"play-circle"),o(),e(29," Start "),o(),a(30,"button",12)(31,"spk-icon"),e(32,"pencil-simple"),o()(),a(33,"spk-menu",13)(34,"button",3)(35,"spk-icon"),e(36,"dots-three-vertical"),o()(),F(37,14),a(38,"button",15),e(39," Export "),a(40,"spk-icon"),e(41,"export"),o()(),a(42,"button",16),b("click",function(){let r=f(n).$implicit,k=c(2);return g(k.deleteBackup(r.Backup==null?null:r.Backup.ID))}),e(43," Delete "),a(44,"spk-icon"),e(45,"x-circle"),o()(),w(),o()()()}if(t&2){let n,i=l.$implicit;p(3),u(" ",(n=i.Backup==null?null:i.Backup.Name)!==null&&n!==void 0?n:"Backup name missing"," "),p(6),u(" ",H(10,9,i.Backup==null||i.Backup.Metadata==null?null:i.Backup.Metadata.LastBackupDate,"short")," "),p(2),d(!(i.Backup==null||i.Backup.Metadata==null)&&i.Backup.Metadata.LastBackupDuration?11:12),p(5),d(!(i.Backup==null||i.Backup.Metadata==null)&&i.Backup.Metadata.SourceSizeString?16:17),p(5),d(!(i.Backup==null||i.Backup.Metadata==null)&&i.Backup.Metadata.TargetSizeString?21:22),p(2),d(!(i.Backup==null||i.Backup.Metadata==null)&&i.Backup.Metadata.BackupListCount?23:24),p(7),m("routerLink",S(12,U,i.Backup==null?null:i.Backup.ID)),p(3),m("right",!0),p(5),m("routerLink",S(14,W,i.Backup==null?null:i.Backup.ID))}}function pt(t,l){if(t&1&&O(0,lt,46,16,"div",7,P),t&2){let n=c();E(n.backups())}}function ct(t,l){t&1&&e(0," No backups founds ")}var h=class t{#t=_(R);backups=this.#t.backups;backupsLoading=this.#t.backupsLoading;ngOnInit(){this.#t.getBackups(!0)}startBackup(l){this.#t.startBackup(l)}deleteBackup(l){l&&window.confirm("Are you sure you want to delete this backup?")&&this.#t.deleteBackup(l)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=v({type:t,selectors:[["app-home"]],standalone:!0,features:[D],decls:31,vars:5,consts:[[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",""],["spk-menu-item","",3,"routerLink"],["spk-menu-item","",3,"click"]],template:function(n,i){n&1&&(x(0,"app-status-bar"),a(1,"section")(2,"header")(3,"spk-card",0),x(4,"img",1),a(5,"div",2)(6,"h3"),e(7,"Backups"),o(),a(8,"p"),e(9,"Backups are stored in the cloud and can be restored at any time."),o()(),a(10,"button",3),e(11," Add "),a(12,"spk-icon"),e(13,"plus"),o()()(),a(14,"spk-card",0),x(15,"img",4),a(16,"div",2)(17,"h3"),e(18,"Restores"),o(),a(19,"p"),e(20,"Restores are stored in the cloud and can be restored at any time."),o()(),a(21,"button",3),e(22," Start "),a(23,"spk-icon"),e(24,"arrow-right"),o()()()(),a(25,"div",5)(26,"h2"),e(27,"My backups"),o(),a(28,"div",6),s(29,pt,2,0)(30,ct,1,0),o()()()),n&2&&(p(3),m("routerLink",B(3,K)),p(11),m("routerLink",B(4,Q)),p(15),d(i.backups().length?29:30))},dependencies:[N,Y,V,A,$,z,j,L,C],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{h as default};
|