@duplicati/ngclient 0.0.161 → 0.0.162

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import{a as U}from"./chunk-GXGIGJ4W.js";import{a as Q}from"./chunk-S4OFJD2F.js";import{d as B}from"./chunk-6XI3IP27.js";import{d as D}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B as H,D as K,G as j,b as R,c as $,d as y,e as A,f as v,j as k,o as x,q as J,r as X,t as q,u as V,w as z}from"./chunk-RPUPXDQE.js";import"./chunk-OJ3H3ZRA.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import{Cb as L,Db as t,Eb as i,Fb as r,H as f,Mb as I,Rc as G,Sa as p,Tb as u,Ub as c,Vb as E,Xc as w,Zb as M,_ as d,cb as N,ea as C,fa as h,gc as O,hc as P,kc as b,pa as m,xb as S,yb as T}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var W=["passwordInput"];function Y(s,n){s&1&&(t(0,"sh-alert",6),E(1,4),i())}var g=new X,F=class s{#e=d(D);#n=d(B);rememberMe=Q("rememberMe",!1,!0);failedLogin=m(!1);successLogin=m(!1);isLoading=m(!1);loginForm=g.group({user:g.control(""),pass:g.control("",y.required),rememberMe:g.control(this.rememberMe())});passwordInput=w("passwordInput");passwordEffect=G(()=>{this.failedLogin()&&queueMicrotask(()=>this.passwordInput()?.nativeElement?.focus())});ngOnInit(){this.loginForm.controls.rememberMe.valueChanges.subscribe(n=>this.rememberMe.set(n??!1)),queueMicrotask(()=>this.passwordInput()?.nativeElement?.focus())}submit(){let n=this.loginForm.value.pass,e=this.loginForm.value.user;this.rememberMe.set(this.loginForm.value.rememberMe??!1),!e&&n&&(this.isLoading.set(!0),this.#n.login(n,this.rememberMe()).pipe(f(()=>{this.isLoading.set(!1),this.failedLogin.set(!0)})).subscribe({next:()=>{this.successLogin.set(!0),this.#e.navigate(["/"])}}))}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=N({type:s,selectors:[["app-login"]],viewQuery:function(e,o){e&1&&O(o.passwordInput,W,5),e&2&&P()},decls:22,vars:4,consts:()=>{let n;n=$localize`Enter your password`;let e;e=$localize` Password ${"\uFFFD#10\uFFFD"}:START_LINK:${"\uFFFD#11\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#10\uFFFD"}:CLOSE_LINK:`;let o;o=$localize` Login ${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON:`;let a;a=$localize` Keep me logged in ${"\uFFFD#19\uFFFD\uFFFD/#19\uFFFD"}:TAG_INPUT:`;let _;return _=$localize` Remember to enter a password, if you can't remember the password open the duplicati client on the machine in question and make sure you open it through the tray icon then go into settings to change the password. `,[["passwordInput",""],e,o,a,_,[3,"submit","formGroup"],["type","warning"],[1,"logo-login"],[1,"inner"],[1,"login-row"],["type","text","hidden","","autocomplete","off","name","username","formControlName","user"],["for","password"],["href","https://docs.duplicati.com/detailed-descriptions/duplicati-access-password","target","_blank","rel","noopener noreferrer"],["type","password","name","password","autocomplete","current-password","placeholder",n,"tabindex","1","formControlName","pass"],["shButton","","type","submit",1,"raised","primary"],[1,"raised","primary"],["type","checkbox","id","rememberMe","tabindex","2","formControlName","rememberMe"],[1,"login-row","checkbox"],["for","rememberMe",1,"remember-me"]]},template:function(e,o){if(e&1){let a=I();t(0,"form",5),M("submit",function(){return C(a),h(o.submit())}),S(1,Y,2,0,"sh-alert",6),t(2,"div",7),r(3,"app-logo"),i(),t(4,"div",8)(5,"div",9),r(6,"input",10),t(7,"sh-form-field")(8,"label",11),u(9,1),t(10,"a",12),r(11,"sh-icon"),i(),c(),i(),r(12,"input",13,0),i(),t(14,"button",14),u(15,2),r(16,"sh-icon"),c(),i()(),t(17,"sh-checkbox",15),u(18,3),r(19,"input",16),c(),i(),t(20,"div",17),r(21,"label",18),i()()()}e&2&&(L("formGroup",o.loginForm),p(),T(o.failedLogin()&&!o.successLogin()?1:-1),p(13),b("loader",o.isLoading()))},dependencies:[q,k,$,R,A,v,x,J,U,j,V,H,z,K],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:.75rem}form[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:1rem}form[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%] .checkbox[_ngcontent-%COMP%]{align-self:flex-start}sh-alert[_ngcontent-%COMP%]{max-width:20rem;margin:0 auto}h3[_ngcontent-%COMP%]{font:var(--title-30)}.login-row[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.logo-login[_ngcontent-%COMP%]{top:0;left:0;padding:1.25rem;position:fixed}"],changeDetection:0})};export{F as default};
@@ -1 +1 @@
1
- import"./chunk-EUDKD2JW.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-2PUCHKOK.js")},{path:"encryption",loadComponent:()=>import("./chunk-U562AGPC.js")},{path:"select-files",loadComponent:()=>import("./chunk-IUK3B6GX.js")},{path:"options",loadComponent:()=>import("./chunk-U7GOWS7E.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-SWAQMTBY.js")}],t=o;export{t as default};
1
+ import"./chunk-EUDKD2JW.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-WBPAKJQO.js")},{path:"encryption",loadComponent:()=>import("./chunk-U562AGPC.js")},{path:"select-files",loadComponent:()=>import("./chunk-IUK3B6GX.js")},{path:"options",loadComponent:()=>import("./chunk-U7GOWS7E.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-SWAQMTBY.js")}],t=o;export{t as default};
@@ -1 +1 @@
1
- import{d as a,e as b}from"./chunk-C7EUC34O.js";import"./chunk-HYQ6MPYI.js";import"./chunk-YCORZV4Z.js";import"./chunk-4VY6SMSL.js";import"./chunk-Z27IQRKV.js";import"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import"./chunk-RPUPXDQE.js";import"./chunk-OJ3H3ZRA.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";export{a as SCHEDULE_FIELD_DEFAULTS,b as default};
1
+ import{d as a,e as b}from"./chunk-BNUMPQFL.js";import"./chunk-HYQ6MPYI.js";import"./chunk-YCORZV4Z.js";import"./chunk-4VY6SMSL.js";import"./chunk-Z27IQRKV.js";import"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import"./chunk-RPUPXDQE.js";import"./chunk-OJ3H3ZRA.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";export{a as SCHEDULE_FIELD_DEFAULTS,b as default};
@@ -1 +1 @@
1
- import{a as ut,c as ct,d as dt}from"./chunk-HYQ6MPYI.js";import{a as ye}from"./chunk-YCORZV4Z.js";import{a as rt,b as Ve,c as _t}from"./chunk-4VY6SMSL.js";import{b as re}from"./chunk-Z27IQRKV.js";import{a as lt}from"./chunk-3V4DGTSM.js";import{a as Oe}from"./chunk-5LX6M65H.js";import{b as ie,d as H}from"./chunk-ABYM5HWA.js";import{B as se,G as Y,K as ot,O as le,V as Me,X as at,b as Te,c as z,d as he,e as j,f as Ne,h as Qe,i as oe,j as fe,k as Ze,n as et,o as Pe,p as tt,q as Ae,r as De,s as ae,t as Re,u as q,w as nt,z as it}from"./chunk-RPUPXDQE.js";import{i as st}from"./chunk-OJ3H3ZRA.js";import{$b as u,Ab as $e,Bb as xe,Bc as Se,Cb as T,Db as s,Eb as l,Fb as g,H as we,Jb as B,Kb as k,Mb as x,Qc as G,Rc as ne,Sa as _,Tb as E,Ub as m,V as Ce,Vb as N,Vc as Be,Wc as ke,Xc as Fe,Yb as Ue,Zb as F,_ as O,cb as J,ea as c,fa as d,gc as ge,hb as je,hc as Ee,ic as be,kc as me,nc as U,oc as ve,pa as C,pc as Ye,sc as y,tc as L,ub as qe,uc as I,xb as A,yb as D,zb as Ge}from"./chunk-QONLYWYC.js";import{a as b,b as X}from"./chunk-EUDKD2JW.js";var Le=class a{fromString(t){if(!t)return null;let e=t.match(/(\d+)([smhDWMY])/);return e&&{value:parseInt(e[1]),unit:e[2]}}toString(t,e){return`${t}${e}`}static \u0275fac=function(e){return new(e||a)};static \u0275prov=Ce({token:a,factory:a.\u0275fac,providedIn:"root"})};function Et(a,t){if(a&1){let e=x();s(0,"div",24)(1,"sh-form-field")(2,"label",25),N(3,7),l(),s(4,"input",26,0),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.nextTime().time,i)||(o.scheduleFields.nextTime().time=i),d(i)}),F("focus",function(){c(e);let i=be(5);return d(i.showPicker())}),l(),s(6,"sh-icon",27),U(7,"clock"),l()(),s(8,"sh-form-field"),g(9,"label",28),s(10,"input",29,1),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.nextTime().date,i)||(o.scheduleFields.nextTime().date=i),d(i)}),F("focus",function(){c(e);let i=be(11);return d(i.showPicker())}),l(),s(12,"sh-icon",27),U(13,"calendar"),l()()(),s(14,"div",24)(15,"sh-form-field")(16,"label",30),N(17,8),l(),s(18,"input",31),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().repeatValue,i)||(o.scheduleFields.runAgain().repeatValue=i),d(i)}),l()(),s(19,"sh-select",32)(20,"input",33),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().repeatUnit,i)||(o.scheduleFields.runAgain().repeatUnit=i),d(i)}),l()()(),s(21,"app-toggle-card",34),B(22,35),N(23,9),k(),s(24,"div",36)(25,"sh-toggle",19),E(26,10),s(27,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.mon,i)||(o.scheduleFields.runAgain().allowedDays.mon=i),d(i)}),l(),m(),l(),s(28,"sh-toggle",19),E(29,11),s(30,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.tue,i)||(o.scheduleFields.runAgain().allowedDays.tue=i),d(i)}),l(),m(),l(),s(31,"sh-toggle",19),E(32,12),s(33,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.wed,i)||(o.scheduleFields.runAgain().allowedDays.wed=i),d(i)}),l(),m(),l(),s(34,"sh-toggle",19),E(35,13),s(36,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.thu,i)||(o.scheduleFields.runAgain().allowedDays.thu=i),d(i)}),l(),m(),l(),s(37,"sh-toggle",19),E(38,14),s(39,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.fri,i)||(o.scheduleFields.runAgain().allowedDays.fri=i),d(i)}),l(),m(),l(),s(40,"sh-toggle",19),E(41,15),s(42,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.sat,i)||(o.scheduleFields.runAgain().allowedDays.sat=i),d(i)}),l(),m(),l(),s(43,"sh-toggle",19),E(44,16),s(45,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.sun,i)||(o.scheduleFields.runAgain().allowedDays.sun=i),d(i)}),l(),m(),l()()()}if(a&2){let e=u();_(4),y("ngModel",e.scheduleFields.nextTime().time),_(6),y("ngModel",e.scheduleFields.nextTime().date),_(8),y("ngModel",e.scheduleFields.runAgain().repeatValue),_(),T("options",e.unitOptions)("isClearable",!1),_(),y("ngModel",e.scheduleFields.runAgain().repeatUnit),_(),T("disallowToggle",!0),_(6),y("ngModel",e.scheduleFields.runAgain().allowedDays.mon),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.tue),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.wed),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.thu),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.fri),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.sat),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.sun)}}var mt=[{key:"s",label:$localize`Seconds`},{key:"m",label:$localize`Minutes`},{key:"h",label:$localize`Hours`},{key:"D",label:$localize`Days`},{key:"W",label:$localize`Weeks`},{key:"M",label:$localize`Months`},{key:"Y",label:$localize`Years`}],ee={autoRun:!0,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}}},Ke=class a{#e=O(Q);#t=O(H);#i=O(ie);unitOptions=mt;scheduleFields=this.#e.scheduleFields;goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["options"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=J({type:a,selectors:[["app-schedule"]],decls:16,vars:2,consts:()=>{let t;t=$localize`Schedule`;let e;e=$localize` Automatically run backups ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let n;n=$localize`If a date was missed, the job will run as soon as possible.`;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let r;r=$localize`Next time`;let p;p=$localize`Run again every`;let h;h=$localize`Allowed days`;let S;S=$localize` Monday ${"\uFFFD#27\uFFFD\uFFFD/#27\uFFFD"}:TAG_INPUT:`;let w;w=$localize` Tuesday ${"\uFFFD#30\uFFFD\uFFFD/#30\uFFFD"}:TAG_INPUT:`;let P;P=$localize` Wednesday ${"\uFFFD#33\uFFFD\uFFFD/#33\uFFFD"}:TAG_INPUT:`;let $;$=$localize` Thursday ${"\uFFFD#36\uFFFD\uFFFD/#36\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Friday ${"\uFFFD#39\uFFFD\uFFFD/#39\uFFFD"}:TAG_INPUT:`;let v;v=$localize` Saturday ${"\uFFFD#42\uFFFD\uFFFD/#42\uFFFD"}:TAG_INPUT:`;let W;return W=$localize` Sunday ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],t,e,n,i,o,r,p,h,S,w,P,$,K,v,W,[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],[1,"row-inputs"],["for","time"],["type","time","id","time",3,"ngModelChange","focus","ngModel"],["suffix",""],["for","date"],["type","date","id","date",3,"ngModelChange","focus","ngModel"],["for","repeatValue"],["type","number","id","repeatValue",3,"ngModelChange","ngModel"],["value","key","label","label",3,"options","isClearable"],["type","text","id","repeatUnit",3,"ngModelChange","ngModel"],[3,"disallowToggle"],["title",""],[1,"days-wrap"]]},template:function(e,n){e&1&&(s(0,"h3",17),N(1,2),l(),s(2,"div",18)(3,"sh-toggle",19),E(4,3),s(5,"input",20),I("ngModelChange",function(o){return L(n.scheduleFields.autoRun,o)||(n.scheduleFields.autoRun=o),o}),l(),m(),l(),s(6,"p"),N(7,4),l()(),A(8,Et,46,14),s(9,"div",21)(10,"button",22),F("click",function(){return n.goBack()}),E(11,5),g(12,"sh-icon"),m(),l(),s(13,"button",23),F("click",function(){return n.next()}),E(14,6),g(15,"sh-icon"),m(),l()()),e&2&&(_(5),y("ngModel",n.scheduleFields.autoRun),_(3),D(n.scheduleFields.autoRun()?8:-1))},dependencies:[ae,z,Ze,Te,j,oe,Y,Me,q,se,le,ye],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem 2.5rem 1.5rem;display:flex;flex-direction:column;gap:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};function St(a,t){if(a&1){let e=x();s(0,"sh-select",2)(1,"input",6),I("ngModelChange",function(i){c(e);let o=u();return L(o.internalPath,i)||(o.internalPath=i),d(i)}),F("ngModelChange",function(){c(e);let i=u();return d(i.updateFilter())}),l()()}if(a&2){let e=u();T("options",e.fileGroupOptions())("isClearable",!1)("selectMultiple",!0),_(),y("ngModel",e.internalPath)}}function Ft(a,t){if(a&1&&(B(0,7),U(1),k()),a&2){let e,n=u(2);_(),ve((e=n.currentExpressionOption())==null?null:e.startsWith)}}function Tt(a,t){if(a&1&&(B(0,8),U(1),k()),a&2){let e,n=u(2);_(),ve((e=n.currentExpressionOption())==null?null:e.endsWith)}}function ht(a,t){if(a&1){let e=x();s(0,"sh-form-field",3)(1,"input",6),I("ngModelChange",function(i){c(e);let o=u();return L(o.internalPath,i)||(o.internalPath=i),d(i)}),F("ngModelChange",function(){c(e);let i=u();return d(i.updateFilter())}),l(),A(2,Ft,2,1,"ng-container",7),A(3,Tt,2,1,"ng-container",8),l()}if(a&2){let e,n,i=u();_(),y("ngModel",i.internalPath),_(),D(!((e=i.currentExpressionOption())==null||e.startsWith==null)&&e.startsWith.length?2:-1),_(),D(!((n=i.currentExpressionOption())==null||n.endsWith==null)&&n.endsWith.length?3:-1)}}var Nt=[{key:"Applications",value:"Applications"},{key:"CacheFiles",value:"Cache Files"},{key:"TemporaryFiles",value:"Temporary Files"},{key:"OperatingSystem",value:"Operating System"},{key:"SystemFiles",value:"System Files"},{key:"DefaultExcludes",value:"Standard Excludes"}],ft=[{key:"Excludes folders where name contains",value:"-FolderName"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileName"},{key:"Excludes file extension",value:"-Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Exclude file groups",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"},{key:"None",value:"-Unknown"}],Ie=class a{path=ke.required();osType=ke();pathChange=Be();remove=Be();internalPath=C("");pathType=C("-Expression");currentExpressionOption=G(()=>{let t=this.pathType();return this.expressionOptions().find(e=>e.value===t)});fileGroupOptions=C(Nt);expressionOptions=G(()=>{let e=this.osType()==="Windows"?"\\":"/";return ft.map(n=>n.value==="-Folder"||n.value==="+Folder"?X(b({},n),{startsWith:"",endsWith:""}):n.value==="-FolderName"||n.value==="+FolderName"?X(b({},n),{startsWith:"*",endsWith:`*${e}`}):n.value==="-FileName"||n.value==="+FileName"?X(b({},n),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):n.value==="-FileGroup"||n.value==="+FileGroup"?X(b({},n),{startsWith:"{",endsWith:"}"}):n.value==="-Regex"||n.value==="+Regex"?X(b({},n),{startsWith:"[",endsWith:"]"}):n.value==="-Extension"||n.value==="+Extension"?X(b({},n),{startsWith:"*.",endsWith:""}):X(b({},n),{startsWith:"",endsWith:""}))});pathEffect=ne(()=>{let t=this.path(),e=t.slice(1),n=t.startsWith("-")?"-":"+",i=this.osType()==="Windows",o=i?"\\":"/";e.startsWith("%")&&e.endsWith(o)||i&&e.slice(2).startsWith(o)&&e.endsWith(o)||e.startsWith(o)&&e.endsWith(o)?(this.pathType.set(`${n}Folder`),this.internalPath.set(e)):e.startsWith("*")&&e.endsWith(`*${o}`)?(this.pathType.set(`${n}FolderName`),this.internalPath.set(e.slice(1,-2))):e.startsWith("[.*")&&e.endsWith(`[^\\${o}]*]`)?(this.pathType.set(`${n}FileName`),this.internalPath.set(e.slice(3,-7))):e.startsWith("{")&&e.endsWith("}")?(this.pathType.set(`${n}FileGroup`),this.internalPath.set(e.slice(1,-1))):e.startsWith("[")&&e.endsWith("]")?(this.pathType.set(`${n}Regex`),this.internalPath.set(e.slice(1,-1))):e.startsWith("*.")?(this.pathType.set(`${n}Extension`),this.internalPath.set(e.slice(2))):(this.pathType.set(`${n}Expression`),this.internalPath.set(e))});updateFilter(){let t=this.internalPath(),e=this.currentExpressionOption();t!==""&&this.pathChange.emit(`${e?.value.slice(0,1)}${e?.startsWith??""}${t}${e?.endsWith??""}`)}removeFilter(){this.remove.emit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=J({type:a,selectors:[["app-new-filter"]],inputs:{path:[1,"path"],osType:[1,"osType"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:7,vars:4,consts:()=>{let t;return t=$localize`Select an option...`,[["value","value","label","key",3,"options","isClearable"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],["value","key","label","value",1,"expression-input",3,"options","isClearable","selectMultiple"],[1,"expression-input"],[1,"filter-removal",3,"click"],[1,"sh-primary"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],["suffix",""]]},template:function(e,n){if(e&1&&(s(0,"sh-select",0)(1,"input",1),I("ngModelChange",function(o){return L(n.pathType,o)||(n.pathType=o),o}),F("ngModelChange",function(){return n.updateFilter()}),l()(),A(2,St,2,4,"sh-select",2)(3,ht,4,3,"sh-form-field",3),s(4,"div",4),F("click",function(){return n.removeFilter()}),s(5,"sh-icon",5),U(6,"x-circle"),l()()),e&2){let i;T("options",n.expressionOptions())("isClearable",!1),_(),y("ngModel",n.pathType),_(),D(((i=n.currentExpressionOption())==null?null:i.value)=="-FileGroup"||((i=n.currentExpressionOption())==null?null:i.value)=="+FileGroup"?2:3)}},dependencies:[ae,z,j,oe,le,Y,q],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}.expression-input[_ngcontent-%COMP%]{--ff-suffix-bg: var(--base-2)}.filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var Pt=["formRef"],He=()=>({standalone:!0});function At(a,t){if(a&1){let e=x();s(0,"sh-form-field",41)(1,"input",42),I("ngModelChange",function(i){c(e);let o=u(2);return L(o.editingPath,i)||(o.editingPath=i),d(i)}),l()(),s(2,"button",43),F("click",function(){c(e);let i=u(2);return d(i.updatePath())}),s(3,"sh-icon"),U(4,"floppy-disk"),l()(),s(5,"button",43),F("click",function(){c(e);let i=u(2);return d(i.cancelEditPath())}),s(6,"sh-icon"),U(7,"x-bold"),l()()}if(a&2){let e=u(2);_(),y("ngModel",e.editingPath),T("ngModelOptions",Se(2,He))}}function Dt(a,t){if(a&1){let e=x();s(0,"sh-form-field",41),g(1,"input",44),l(),s(2,"button",43),F("click",function(){c(e);let i=u().$implicit,o=u();return d(o.editPath(i))}),s(3,"sh-icon"),U(4,"pen"),l()(),s(5,"button",43),F("click",function(){c(e);let i=u().$implicit,o=u();return d(o.removePath(i))}),s(6,"sh-icon"),U(7,"trash-simple"),l()()}if(a&2){let e=u().$implicit;qe("readonly",!0),_(),T("ngModel",e)("ngModelOptions",Se(3,He))}}function Rt(a,t){if(a&1&&(s(0,"div",30),A(1,At,8,3)(2,Dt,8,4),l()),a&2){let e=t.$implicit,n=u();_(),D(n.oldPath()===e?1:2)}}function Mt(a,t){if(a&1){let e=x();s(0,"app-new-filter",46),F("pathChange",function(i){let o=c(e).$index,r=u(2);return d(r.patchPathAt(i,o))})("remove",function(){let i=c(e).$index,o=u(2);return d(o.removePathAt(i))}),l()}if(a&2){let e=t.$implicit,n=u(2);T("path",e)("osType",n.osType()??"")}}function Ot(a,t){if(a&1&&$e(0,Mt,1,2,"app-new-filter",45,Ge),a&2){let e=u();xe(e.pathArray())}}function yt(a,t){if(a&1){let e=x();s(0,"div",31)(1,"app-size",47),F("ngModelChange",function(i){c(e);let o=u();return d(o.updateFilesLargerThan(i))}),l()()}if(a&2){let e=u();_(),T("ngModel",e.filesLargerThan())("ngModelOptions",Se(2,He))}}var V=new De,pt=(a={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>V.group({path:V.control(a.path),excludes:V.group({hidden:V.control(a.excludes.hidden),system:V.control(a.excludes.system),temporary:V.control(a.excludes.temporary),filesLargerThan:V.group({size:V.control(null),unit:V.control(null)})})}),Je=class a{#e=O(Q);#t=O(H);#i=O(ie);formRef=Fe.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new Qe("");filesLargerThan=G(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);osType=this.#e.osType;pathSignal=re(this.sourceDataForm.controls.path.valueChanges);pathArray=G(()=>this.pathSignal()?.split("\0").filter(t=>t.startsWith("-")||t.startsWith("+")||t==="___none___")??[]);nonFilterPaths=G(()=>this.pathSignal()?.split("\0").filter(t=>!t.startsWith("-")&&!t.startsWith("+")&&t!==""));oldPath=C(null);editingPath=C(null);addingNewPath=C(!1);editPath(t){this.oldPath.set(t),this.editingPath.set(t)}updateFilesLargerThan(t){let{size:e,unit:n}=ct(t);this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:e,unit:n})}updatePath(){let t=this.oldPath(),e=this.editingPath();if(!t||!e||e===t){this.oldPath.set(null),this.editingPath.set(null);return}let n=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(n?.replace(t,e)??""),this.oldPath.set(null),this.editingPath.set(null)}cancelEditPath(){this.oldPath.set(null),this.editingPath.set(null)}removePath(t){let n=(this.sourceDataForm.controls.path.value??"").split("\0"),i=n.indexOf(t);if(i===-1)return;n.splice(i,1);let o=n.filter(r=>r&&r!=="").join("\0");this.sourceDataForm.controls.path.setValue(o)}addFilter(t="-*"){let n=[this.sourceDataForm.controls.path.value,t].filter(i=>i&&i!=="").join("\0");this.sourceDataForm.controls.path.setValue(n)}patchPathAt(t,e){let i=this.sourceDataForm.controls.path.value.split("\0").filter(p=>!p.startsWith("-")&&!p.startsWith("+")).join("\0"),o=this.pathArray().map((p,h)=>h===e?`${t}`:`${p}`).join("\0"),r=[i,o].filter(p=>p&&p!=="").join("\0");this.sourceDataForm.controls.path.setValue(r)}removePathAt(t){let n=this.sourceDataForm.controls.path.value.split("\0").filter(r=>!r.startsWith("-")&&!r.startsWith("+")).join("\0"),i=this.pathArray().filter((r,p)=>p!==t).join("\0"),o=[n,i].filter(r=>r&&r!=="").join("\0");this.sourceDataForm.controls.path.setValue(o)}getPath(){return this.sourceDataForm.value.path??null}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let t=this.sourceDataForm.controls.path.value,e=this.newPathCtrl.value,n=t?.split("\0")||[];e&&!n.includes(e)&&n.push(e);let i=n.filter(o=>o&&o!=="").join("\0");this.sourceDataForm.controls.path.setValue(i),this.newPathCtrl.setValue("")}goBack(){this.#t.navigate(["destination"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=J({type:a,selectors:[["app-source-data"]],viewQuery:function(e,n){e&1&&ge(n.formRef,Pt,5),e&2&&Ee()},decls:56,vars:12,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Add a direct path`;let n;n=$localize`Hidden files`;let i;i=$localize`System files`;let o;o=$localize`Temporary files`;let r;r=$localize`Source Data`;let p;p=$localize`Folder path`;let h;h=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let S;S=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let w;w=$localize`Paths`;let P;P=$localize`Add a path directly from your machine.`;let $;$=$localize`Filters`;let K;K=$localize`Customize your filters.`;let v;v=$localize`Add filter`;let W;W=$localize`Exclude`;let R;R=$localize`Choose if there’s any files you want to exclude.`;let Z;Z=$localize` Files with the Hidden attribute ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let _e;_e=$localize` Files with the System attribute ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`;let ue;ue=$localize` Files with the Temporary attribute ${"\uFFFD#52\uFFFD\uFFFD/#52\uFFFD"}:TAG_INPUT:`;let ce;ce=$localize` Files larger than `;let f;return f=$localize`Edit path`,[["formRef",""],r,p,h,S,w,P,$,K,v,W,R,Z,_e,ue,ce,[3,"submit","formGroup"],[1,"left"],[1,"title-30"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",t,"formControlName","path"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],["description",""],[1,"paths"],[1,"path"],[1,"row-inputs"],["type","text","placeholder",e,3,"formControl"],["shButton","","type","button",1,"raised","primary",3,"click"],["type","button","shButton","","action","",3,"click"],["formGroupName","excludes",3,"disallowToggle"],[1,"raised","primary"],["type","checkbox","placeholder",n,"formControlName","hidden"],["type","checkbox","placeholder",i,"formControlName","system"],["type","checkbox","placeholder",o,"formControlName","temporary"],[1,"raised","primary",3,"click"],[1,"small"],["type","text","placeholder",f,3,"ngModelChange","ngModel","ngModelOptions"],["shButton","","type","button",1,"small",3,"click"],["type","text",3,"ngModel","ngModelOptions"],[3,"path","osType"],[3,"pathChange","remove","path","osType"],[3,"ngModelChange","ngModel","ngModelOptions"]]},template:function(e,n){if(e&1){let i=x();s(0,"form",16,0),F("submit",function(){return c(i),d(n.next())}),s(2,"div",17)(3,"h3",18),N(4,1),l(),s(5,"app-file-tree",19)(6,"label",20),N(7,2),l(),g(8,"input",21),l(),s(9,"div",22)(10,"button",23),F("click",function(){return c(i),d(n.goBack())}),E(11,3),g(12,"sh-icon"),m(),l(),s(13,"button",24),E(14,4),g(15,"sh-icon"),m(),l()()(),s(16,"div",25)(17,"app-toggle-card",26),B(18,27),N(19,5),k(),s(20,"p",28),N(21,6),l(),s(22,"div",29),$e(23,Rt,3,1,"div",30,Ge),s(25,"div",31)(26,"sh-form-field"),g(27,"input",32),l(),s(28,"button",33),F("click",function(){return c(i),d(n.addNewPath())}),s(29,"sh-icon"),U(30,"plus"),l()()()()(),s(31,"app-toggle-card",26),B(32,27),N(33,7),k(),s(34,"p",28),N(35,8),l(),s(36,"button",34),F("click",function(){return c(i),d(n.addFilter())}),N(37,9),l(),A(38,Ot,2,0),l(),s(39,"app-toggle-card",35),B(40,27),N(41,10),k(),s(42,"p",28),N(43,11),l(),s(44,"sh-toggle",36),E(45,12),g(46,"input",37),m(),l(),s(47,"sh-toggle",36),E(48,13),g(49,"input",38),m(),l(),s(50,"sh-toggle",36),E(51,14),g(52,"input",39),m(),l(),s(53,"sh-toggle",40),F("click",function(){return c(i),d(n.toggleFilesLargerThan())}),N(54,15),l(),A(55,yt,2,3,"div",31),l()()()}if(e&2){let i;T("formGroup",n.sourceDataForm),_(5),T("multiSelect",!0)("startingPath",n.getPath())("showFiles",!0),_(12),T("disallowToggle",!0),_(6),xe(n.nonFilterPaths()),_(4),T("formControl",n.newPathCtrl),_(4),T("disallowToggle",!0),_(7),D((i=n.pathSignal())!=null&&i.length?38:-1),_(),T("disallowToggle",!0),_(14),me("active",n.filesLargerThan()),_(2),D(n.filesLargerThan()?55:-1)}},dependencies:[ae,fe,z,Te,j,Ne,oe,Re,et,Pe,Ae,tt,Y,q,se,Me,Ie,ut,ye,dt],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-4)}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}sh-divider[_ngcontent-%COMP%]{margin:.75rem 0}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.25rem}.paths[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.path[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr min-content min-content;gap:.25rem}"],changeDetection:0})};var Ct="1W:1D,4W:1W,12M:1M",Q=class a{#e=O(H);#t=O(Oe);#i=O(it);#n=O(st);#a=O(Le);generalForm=gt();sourceDataForm=pt();scheduleFields={autoRun:C(ee.autoRun),nextTime:C(ee.nextTime),runAgain:C(ee.runAgain)};settings=C([]);optionsFields={remoteVolumeSize:C("50MB"),backupRetention:C("all"),backupRetentionTime:C(""),backupRetentionVersions:C(0),backupRetentionCustom:C("")};targetUrlModel=C(null);backupMetadata=C(null);isDraft=C(!1);backupId=C(null);backupName=G(()=>this.generalFormSignal()?.name??"");isSubmitting=C(!1);finishedLoading=C(!1);backupDefaults=C(null);applicationOptions=C(null);isNew=G(()=>this.backupId()==="new");osType=G(()=>this.#t.systemInfo()?.OSType);selectedOptions=C([]);sourceDataFormSignal=re(this.sourceDataForm.valueChanges);generalFormSignal=re(this.generalForm.valueChanges);encryptionFieldSignal=re(this.generalForm.controls.encryption.valueChanges);advancedOptions=G(()=>this.#t.systemInfo()?.Options?.map(this.#_)??[]);#o=C("");#s=C(null);#l=null;testSignal=this.#o.asReadonly();testErrorMessage=this.#s.asReadonly();#d=ne(()=>{let t=this.targetUrlModel(),e=this.#o(),n=this.#l;this.#l=t,!(e==="testing"||n===null||n===t)&&(this.#o.set(""),this.#s.set(null))});setTestState(t,e){this.#o.set(t),this.#s.set(e??null)}#_(t){return{name:t.Name,type:t.Type,shortDescription:t.ShortDescription??void 0,longDescription:t.LongDescription??void 0,options:t.ValidValues}}encryptionOptions=G(()=>{let t=this.#t.systemInfo()?.EncryptionModules??[];return[pe,...t]});nonSelectedOptions=G(()=>this.advancedOptions().sort((t,e)=>t?.name&&e?.name?t?.name.localeCompare(e?.name):0).filter(t=>this.selectedOptions()?.findIndex(e=>e.name===t.name)===-1));submit(t=!1){this.isSubmitting.set(!0);let e=this.#u(),n=this.backupId();this.isDraft()&&e.Backup&&(e.Backup.Metadata=this.backupMetadata()),n==="new"||!n||this.isDraft()?this.#n.postApiV1Backups({requestBody:e}).pipe(we(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}}):this.#n.putApiV1BackupById({id:n,requestBody:e}).pipe(we(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}})}exit(t){if(!t){this.#r(),this.#e.navigate(["/"]);return}this.#i.open(lt,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#r(),this.#e.navigate(["/"]))}})}mapSourceDataToForm(t){let e=t.Sources??"",n=t.Filters?.map(p=>`${p.Include?"":"-"}${p.Expression}`)??[],i=t.Settings?.find(p=>p.Name==="--exclude-files-attributes")?.Value??"",o=t.Settings?.find(p=>p.Name==="--skip-files-larger-than")??null,r={path:[...e,...n].join("\0"),excludes:{hiddenFiles:i.includes("hidden"),systemFiles:i.includes("system"),tempFiles:i.includes("temporary"),filesLargerThan:o?.Value?.toUpperCase()??null}};this.sourceDataForm.patchValue(r)}mapDestinationToForm(t){this.targetUrlModel.set(t.TargetURL??"")}mapGeneralToForm(t){let e=t.Name??"",n=t.Description??"",i=t.Settings?.find(S=>S.Name==="encryption-module"),o=t.Settings?.find(S=>S.Name==="passphrase")?.Value??"",r=i?.Value&&i.Value.length?i.Value:"",p=t.Settings?.find(S=>S.Name==="compression-module")?.Value??"",h={name:t.Name??"",description:t.Description??""};e&&e!==""&&(h.name=e),n&&n!==""&&(h.description=n),r&&r!==""&&(h.encryption=r),o&&o!==""&&(h.password=o,h.repeatPassword=o),p&&p!==""&&(h.compression=p),this.generalForm.patchValue(h)}mapScheduleToForm(t){if(!t){this.scheduleFields.autoRun.set(!1);return}let e=this.#a.fromString(t.Repeat)??null,n=this.#c(t.Time);this.scheduleFields.autoRun.set(!0),this.scheduleFields.nextTime.update(i=>b(b({},i),n)),this.scheduleFields.runAgain.set({repeatValue:e?.value??1,repeatUnit:e?.unit??"D",allowedDays:{mon:t.AllowedDays?.includes("mon")??!1,tue:t.AllowedDays?.includes("tue")??!1,wed:t.AllowedDays?.includes("wed")??!1,thu:t.AllowedDays?.includes("thu")??!1,fri:t.AllowedDays?.includes("fri")??!1,sat:t.AllowedDays?.includes("sat")??!1,sun:t.AllowedDays?.includes("sun")??!1}})}mapOptionsToForms(t){let e=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","passphrase","keep-time","keep-versions","retention-policy"],n=t.Settings?.filter(r=>!e.includes(r.Name)),i=t.Settings?.filter(r=>e.includes(r.Name));this.settings.set(n??[]),n?.forEach(r=>{if(r.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(r.Value??"")});var o="all";i?.forEach(r=>{if(r.Name==="dblock-size"&&this.optionsFields.remoteVolumeSize.set(r.Value??"50MB"),r.Name==="keep-time"&&(r.Value??"")!=="")return o="time",this.optionsFields.backupRetentionTime.set(r.Value??"");if(r.Name==="keep-versions"&&(r.Value??"")!=="")return o="versions",this.optionsFields.backupRetentionVersions.set(r.Value?parseInt(r.Value):null);if(r.Name==="retention-policy"&&(r.Value??"")!=="")if(r.Value===Ct)o="smart";else return o="custom",this.optionsFields.backupRetentionCustom.set(r.Value??"")}),this.optionsFields.backupRetention.set(o)}storeMetadata(t,e){this.backupMetadata.set(e?t.Metadata??null:null)}getScheduleFormValue(){return{autoRun:this.scheduleFields.autoRun(),nextTime:this.scheduleFields.nextTime(),runAgain:this.scheduleFields.runAgain()}}#u(){let t=this.generalForm.value,e=this.getScheduleFormValue(),n=this.sourceDataForm.value,i=this.targetUrlModel(),o=null;e.runAgain?.repeatUnit&&e.runAgain?.repeatValue&&(o=this.#a.toString(e.runAgain.repeatValue,e.runAgain.repeatUnit));let r=e.runAgain?.allowedDays?Object.entries(e.runAgain?.allowedDays).filter(([P,$])=>$).map(([P,$])=>P):[],p=n.path?.split("\0")??[],h=this.mapFormsToSettings(),S=Object.entries(n.excludes??{}).filter(([P,$])=>$&&P!=="filesLargerThan").map(([P])=>P),w=n.excludes?.filesLargerThan;return S.length&&h.push({Name:"--exclude-files-attributes",Value:S.join(",")}),w&&w.size!==null&&w.unit!==null&&h.push({Name:"--skip-files-larger-than",Value:`${w.size}${w.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:i??null,Sources:p.filter(P=>!P.startsWith("-")),Settings:h,Filters:p.filter(P=>P.startsWith("-")).map((P,$)=>({Order:$,Include:!1,Expression:P.slice(1)}))},Schedule:e.autoRun?{Repeat:o,Time:e.nextTime?.date?new Date(`${e.nextTime.date}T${e.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:r}:null}}mapFormsToSettings(t=[]){let e=this.generalForm.value,n=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","encryption-module","passphrase","keep-time","keep-versions","retention-policy","dblock-size","compression-module"],i=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&e.encryption!==pe.Key&&(i=[{Name:"encryption-module",Value:e.encryption??null},{Name:"passphrase",Value:e.password??null}]);let o=[{Name:"compression-module",Value:e.compression}];e.compression===""&&(o=[]);let r=[{Name:"dblock-size",Value:this.optionsFields.remoteVolumeSize()}];switch(this.optionsFields.backupRetention()){case"time":r.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":r.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":r.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":r.push({Name:"retention-policy",Value:Ct});break}let p=[...t,...n],h=this.settings().filter(S=>!p.includes(S.Name)).map(S=>{let w=S.Value;return typeof S.Value=="number"&&(w=S.Value.toString()),typeof S.Value=="boolean"&&(w=S.Value?"True":"False"),{Name:S.Name?.startsWith("--")?S.Name:`--${S.Name}`,Value:w}});return[...i,...o,...r,...h]}#c(t){if(!t||t?.indexOf("T")===-1)return{time:t??"13:00"};let e=new Date(t);return{time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`,date:e.toISOString().split("T")[0]}}setTargetUrl(t,e=!1){e&&(this.#l=null),this.targetUrlModel.set(t)}#r(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleFields.autoRun.set(ee.autoRun),this.scheduleFields.nextTime.set(ee.nextTime),this.scheduleFields.runAgain.set(ee.runAgain),this.optionsFields.remoteVolumeSize.set("50MB"),this.optionsFields.backupRetention.set("all"),this.settings.set([]),this.targetUrlModel.set(null)}static \u0275fac=function(e){return new(e||a)};static \u0275prov=Ce({token:a,factory:a.\u0275fac,providedIn:"root"})};var Lt=["formRef"];function It(a,t){a&1&&(s(0,"sh-alert",17),E(1,5),g(2,"sh-icon",26),m(),l())}function wt(a,t){if(a&1&&U(0),a&2){let e=t.$implicit;Ye(" ",e.DisplayName," ")}}function Gt(a,t){if(a&1&&g(0,"sh-progress-bar",40),a&2){let e=u(3);me("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),T("value",e.calculatePasswordStrength()*(100/5))}}function $t(a,t){a&1&&(s(0,"span",35),N(1,10),l())}function xt(a,t){a&1&&(E(0,8,1),g(1,"sh-icon"),m())}function Ut(a,t){a&1&&(E(0,8,2),g(1,"sh-icon"),m())}function bt(a,t){a&1&&(E(0,11,1),g(1,"sh-icon",42),m())}function vt(a,t){a&1&&(E(0,11,2),g(1,"sh-icon"),m())}function Bt(a,t){if(a&1){let e=x();s(0,"button",41),F("click",function(){c(e);let i=u(3);return d(i.copyPassword())}),E(1,11),A(2,bt,2,0)(3,vt,2,0),m(),l()}if(a&2){let e=u(3);_(2),D(e.copiedPassword()?2:3)}}function kt(a,t){a&1&&(s(0,"sh-alert",39),N(1,12),l())}function Vt(a,t){if(a&1){let e=x();s(0,"div",30)(1,"sh-form-field")(2,"label",31),E(3,7),g(4,"sup"),m(),l(),g(5,"input",32),l(),A(6,Gt,1,9,"sh-progress-bar",33),s(7,"sh-form-field"),g(8,"input",34),A(9,$t,2,0,"span",35),l(),s(10,"div",36)(11,"button",37),F("click",function(){c(e);let i=u(2);return d(i.showPassword.set(!i.showPassword()))}),E(12,8),A(13,xt,2,0)(14,Ut,2,0),m(),l(),s(15,"button",37),F("click",function(){c(e);let i=u(2);return d(i.generatePassword())}),E(16,9),g(17,"sh-icon"),m(),l(),A(18,Bt,4,1,"button",38),l(),A(19,kt,2,0,"sh-alert",39),l()}if(a&2){let e=u(2);_(5),T("type",e.showPassword()?"text":"password"),_(),D(e.generalForm.value.password?6:-1),_(2),T("type",e.showPassword()?"text":"password"),_(),D(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),_(4),D(e.showPassword()?13:14),_(5),D(e.showCopyPassword()?18:-1),_(),D(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function Kt(a,t){if(a&1&&(s(0,"sh-select",27)(1,"label",28),N(2,6),l(),g(3,"input",29),je(4,wt,1,1,"ng-template"),l(),A(5,Vt,20,7,"div",30)),a&2){let e=u();T("options",e.encryptionOptions())("isClearable",!1),_(5),D(e.encryptionFieldSignal()!==e.noneOptionKey?5:-1)}}function Wt(a,t){if(a&1&&(s(0,"button",24),E(1,13),g(2,"sh-icon"),m(),l()),a&2){let e=u();T("disabled",e.nameAndDescriptionValid()===!1)}}function Xt(a,t){if(a&1&&(s(0,"button",25),E(1,14),g(2,"sh-icon"),m(),l()),a&2){let e=u();T("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var te=new De,gt=(a={name:"",description:"",encryption:"",password:"",repeatPassword:"",compression:""})=>te.group({name:te.control(a.name,[he.required]),description:te.control(a.description),encryption:te.control(a.encryption,[_t()]),password:te.control(a.password,[Ve(t=>t?.value.encryption!=="",[he.required])]),repeatPassword:te.control(a.repeatPassword,[Ve(t=>t?.value.encryption!=="",[he.required])]),compression:te.control(a.compression)}),pe={Key:"-",DisplayName:"None"},ze=class a{#e=O(H);#t=O(ie);#i=O(rt);#n=O(Q);#a=O(Oe);formRef=Fe.required("formRef");generalForm=this.#n.generalForm;generalFormSignal=this.#n.generalFormSignal;encryptionFieldSignal=this.#n.encryptionFieldSignal;encryptionOptions=this.#n.encryptionOptions;isNew=this.#n.isNew;showPassword=C(!1);copiedPassword=C(!1);showCopyPassword=C(!1);noneOptionKey=pe.Key;encryptionEffect=ne(()=>{this.encryptionFieldSignal()===pe.Key&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=G(()=>{let t=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=G(()=>{let e=this.generalFormSignal()?.password??"";return this.#i.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#n.exit(!0)}async copyPassword(){let t=this.generalForm.controls.password.value;await this.#o(t??""),this.copiedPassword.set(!0)}async#o(t){try{await navigator.clipboard.writeText(t)}catch{try{let n=document.createElement("textarea");n.value=t,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}catch(n){console.error("Failed to copy text: ",n)}}}generatePassword(){this.copiedPassword.set(!1);let t=this.#i.generate(16);this.generalForm.controls.password.setValue(t),this.generalForm.controls.repeatPassword.setValue(t),this.showCopyPassword.set(!0)}next(){this.#n.isNew()||this.#n.submit(!0),this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=J({type:a,selectors:[["app-general"]],viewQuery:function(e,n){e&1&&ge(n.formRef,Lt,5),e&2&&Ee()},decls:21,vars:4,consts:()=>{let t;t=$localize`Your backup name`;let e;e=$localize`Your backup description`;let n;n=$localize`Remember to copy the password`;let i;i=$localize`General backup settings`;let o;o=$localize` Backup name ${"\uFFFD#8\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#8\uFFFD"}:CLOSE_SUPERSCRIPT:`;let r;r=$localize`Backup description`;let p;p=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Exit `;let h;h=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Encrypted backup `;let S;S=$localize`Encryption`;let w;w=$localize`Encryption`;let P;P=$localize`Password`;let $;$=$localize`Repeat password`;let K;K=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let v;v=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,v=Ue(v);let W;W=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let R;R=$localize`Passwords do not match`;let Z;Z=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,Z=Ue(Z);let _e;_e=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let ue;ue=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let ce;return ce=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],i,o,r,p,h,w,K,v,W,R,Z,_e,ue,ce,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],[1,"primary"],["for","backupName"],["type","text","tabindex","1","placeholder",t,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","shButton","",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],["shButton","","type","submit","shTooltip",n,1,"raised","primary",3,"disabled"],["icon",""],["value","Key","label","DisplayName",3,"options","isClearable"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",S,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",P,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",$,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["shButton","","type","button",1,"small","copy",3,"click"],[1,"sh-success"]]},template:function(e,n){if(e&1){let i=x();s(0,"form",15,0),F("submit",function(){return c(i),d(n.next())}),s(2,"h3",16),N(3,1),l(),A(4,It,3,0,"sh-alert",17),s(5,"sh-form-field")(6,"label",18),E(7,2),g(8,"sup"),m(),l(),g(9,"input",19),l(),s(10,"sh-form-field")(11,"label",20),N(12,3),l(),g(13,"textarea",21),l(),A(14,Kt,6,3),s(15,"div",22)(16,"button",23),F("click",function(){return c(i),d(n.exit())}),E(17,4),g(18,"sh-icon"),m(),l(),A(19,Wt,3,1,"button",24)(20,Xt,3,1,"button",25),l()()}if(e&2){let i;T("formGroup",n.generalForm),_(4),D(!n.isNew()&&((i=n.generalFormSignal())==null?null:i.encryption)!==""?4:-1),_(10),D(n.isNew()?14:-1),_(5),D(n.encryptionFieldSignal()===n.noneOptionKey||!n.isNew()?19:20)}},dependencies:[Re,fe,z,j,Ne,Pe,Ae,Y,le,se,q,ot,nt,at],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--error-8)}.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%] sh-icon.sh-success[_ngcontent-%COMP%]{color:var(--success-8)}"],changeDetection:0})};export{gt as a,pe as b,ze as c,ee as d,Ke as e,pt as f,Je as g,Q as h};
1
+ import{a as ut,c as ct,d as dt}from"./chunk-HYQ6MPYI.js";import{a as ye}from"./chunk-YCORZV4Z.js";import{a as rt,b as Ve,c as _t}from"./chunk-4VY6SMSL.js";import{b as re}from"./chunk-Z27IQRKV.js";import{a as lt}from"./chunk-3V4DGTSM.js";import{a as Oe}from"./chunk-5LX6M65H.js";import{b as ie,d as H}from"./chunk-ABYM5HWA.js";import{B as se,G as Y,K as ot,O as le,V as Me,X as at,b as Te,c as z,d as he,e as j,f as Ne,h as Qe,i as oe,j as fe,k as Ze,n as et,o as Pe,p as tt,q as Ae,r as De,s as ae,t as Re,u as q,w as nt,z as it}from"./chunk-RPUPXDQE.js";import{i as st}from"./chunk-OJ3H3ZRA.js";import{$b as u,Ab as $e,Bb as xe,Bc as Se,Cb as T,Db as s,Eb as l,Fb as g,H as we,Jb as B,Kb as k,Mb as x,Qc as G,Rc as ne,Sa as _,Tb as E,Ub as m,V as Ce,Vb as f,Vc as Be,Wc as ke,Xc as Fe,Yb as Ue,Zb as F,_ as O,cb as J,ea as c,fa as d,gc as ge,hb as je,hc as Ee,ic as be,kc as me,nc as U,oc as ve,pa as C,pc as Ye,sc as y,tc as L,ub as qe,uc as I,xb as A,yb as D,zb as Ge}from"./chunk-QONLYWYC.js";import{a as b,b as X}from"./chunk-EUDKD2JW.js";var Le=class a{fromString(t){if(!t)return null;let e=t.match(/(\d+)([smhDWMY])/);return e&&{value:parseInt(e[1]),unit:e[2]}}toString(t,e){return`${t}${e}`}static \u0275fac=function(e){return new(e||a)};static \u0275prov=Ce({token:a,factory:a.\u0275fac,providedIn:"root"})};function Et(a,t){if(a&1){let e=x();s(0,"div",24)(1,"sh-form-field")(2,"label",25),f(3,7),l(),s(4,"input",26,0),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.nextTime().time,i)||(o.scheduleFields.nextTime().time=i),d(i)}),F("focus",function(){c(e);let i=be(5);return d(i.showPicker())}),l(),s(6,"sh-icon",27),U(7,"clock"),l()(),s(8,"sh-form-field"),g(9,"label",28),s(10,"input",29,1),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.nextTime().date,i)||(o.scheduleFields.nextTime().date=i),d(i)}),F("focus",function(){c(e);let i=be(11);return d(i.showPicker())}),l(),s(12,"sh-icon",27),U(13,"calendar"),l()()(),s(14,"div",24)(15,"sh-form-field")(16,"label",30),f(17,8),l(),s(18,"input",31),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().repeatValue,i)||(o.scheduleFields.runAgain().repeatValue=i),d(i)}),l()(),s(19,"sh-select",32)(20,"input",33),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().repeatUnit,i)||(o.scheduleFields.runAgain().repeatUnit=i),d(i)}),l()()(),s(21,"app-toggle-card",34),B(22,35),f(23,9),k(),s(24,"div",36)(25,"sh-toggle",19),E(26,10),s(27,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.mon,i)||(o.scheduleFields.runAgain().allowedDays.mon=i),d(i)}),l(),m(),l(),s(28,"sh-toggle",19),E(29,11),s(30,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.tue,i)||(o.scheduleFields.runAgain().allowedDays.tue=i),d(i)}),l(),m(),l(),s(31,"sh-toggle",19),E(32,12),s(33,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.wed,i)||(o.scheduleFields.runAgain().allowedDays.wed=i),d(i)}),l(),m(),l(),s(34,"sh-toggle",19),E(35,13),s(36,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.thu,i)||(o.scheduleFields.runAgain().allowedDays.thu=i),d(i)}),l(),m(),l(),s(37,"sh-toggle",19),E(38,14),s(39,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.fri,i)||(o.scheduleFields.runAgain().allowedDays.fri=i),d(i)}),l(),m(),l(),s(40,"sh-toggle",19),E(41,15),s(42,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.sat,i)||(o.scheduleFields.runAgain().allowedDays.sat=i),d(i)}),l(),m(),l(),s(43,"sh-toggle",19),E(44,16),s(45,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.sun,i)||(o.scheduleFields.runAgain().allowedDays.sun=i),d(i)}),l(),m(),l()()()}if(a&2){let e=u();_(4),y("ngModel",e.scheduleFields.nextTime().time),_(6),y("ngModel",e.scheduleFields.nextTime().date),_(8),y("ngModel",e.scheduleFields.runAgain().repeatValue),_(),T("options",e.unitOptions)("isClearable",!1),_(),y("ngModel",e.scheduleFields.runAgain().repeatUnit),_(),T("disallowToggle",!0),_(6),y("ngModel",e.scheduleFields.runAgain().allowedDays.mon),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.tue),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.wed),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.thu),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.fri),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.sat),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.sun)}}var mt=[{key:"s",label:$localize`Seconds`},{key:"m",label:$localize`Minutes`},{key:"h",label:$localize`Hours`},{key:"D",label:$localize`Days`},{key:"W",label:$localize`Weeks`},{key:"M",label:$localize`Months`},{key:"Y",label:$localize`Years`}],ee={autoRun:!0,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}}},Ke=class a{#e=O(Q);#t=O(H);#i=O(ie);unitOptions=mt;scheduleFields=this.#e.scheduleFields;goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["options"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=J({type:a,selectors:[["app-schedule"]],decls:16,vars:2,consts:()=>{let t;t=$localize`Schedule`;let e;e=$localize` Automatically run backups ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let n;n=$localize`If a date was missed, the job will run as soon as possible.`;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let r;r=$localize`Next time`;let p;p=$localize`Run again every`;let h;h=$localize`Allowed days`;let S;S=$localize` Monday ${"\uFFFD#27\uFFFD\uFFFD/#27\uFFFD"}:TAG_INPUT:`;let w;w=$localize` Tuesday ${"\uFFFD#30\uFFFD\uFFFD/#30\uFFFD"}:TAG_INPUT:`;let N;N=$localize` Wednesday ${"\uFFFD#33\uFFFD\uFFFD/#33\uFFFD"}:TAG_INPUT:`;let $;$=$localize` Thursday ${"\uFFFD#36\uFFFD\uFFFD/#36\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Friday ${"\uFFFD#39\uFFFD\uFFFD/#39\uFFFD"}:TAG_INPUT:`;let v;v=$localize` Saturday ${"\uFFFD#42\uFFFD\uFFFD/#42\uFFFD"}:TAG_INPUT:`;let W;return W=$localize` Sunday ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],t,e,n,i,o,r,p,h,S,w,N,$,K,v,W,[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],[1,"row-inputs"],["for","time"],["type","time","id","time",3,"ngModelChange","focus","ngModel"],["suffix",""],["for","date"],["type","date","id","date",3,"ngModelChange","focus","ngModel"],["for","repeatValue"],["type","number","id","repeatValue",3,"ngModelChange","ngModel"],["value","key","label","label",3,"options","isClearable"],["type","text","id","repeatUnit",3,"ngModelChange","ngModel"],[3,"disallowToggle"],["title",""],[1,"days-wrap"]]},template:function(e,n){e&1&&(s(0,"h3",17),f(1,2),l(),s(2,"div",18)(3,"sh-toggle",19),E(4,3),s(5,"input",20),I("ngModelChange",function(o){return L(n.scheduleFields.autoRun,o)||(n.scheduleFields.autoRun=o),o}),l(),m(),l(),s(6,"p"),f(7,4),l()(),A(8,Et,46,14),s(9,"div",21)(10,"button",22),F("click",function(){return n.goBack()}),E(11,5),g(12,"sh-icon"),m(),l(),s(13,"button",23),F("click",function(){return n.next()}),E(14,6),g(15,"sh-icon"),m(),l()()),e&2&&(_(5),y("ngModel",n.scheduleFields.autoRun),_(3),D(n.scheduleFields.autoRun()?8:-1))},dependencies:[ae,z,Ze,Te,j,oe,Y,Me,q,se,le,ye],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem 2.5rem 1.5rem;display:flex;flex-direction:column;gap:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};function St(a,t){if(a&1){let e=x();s(0,"sh-select",2)(1,"input",6),I("ngModelChange",function(i){c(e);let o=u();return L(o.internalPath,i)||(o.internalPath=i),d(i)}),F("ngModelChange",function(){c(e);let i=u();return d(i.updateFilter())}),l()()}if(a&2){let e=u();T("options",e.fileGroupOptions())("isClearable",!1)("selectMultiple",!0),_(),y("ngModel",e.internalPath)}}function Ft(a,t){if(a&1&&(B(0,7),U(1),k()),a&2){let e,n=u(2);_(),ve((e=n.currentExpressionOption())==null?null:e.startsWith)}}function Tt(a,t){if(a&1&&(B(0,8),U(1),k()),a&2){let e,n=u(2);_(),ve((e=n.currentExpressionOption())==null?null:e.endsWith)}}function ht(a,t){if(a&1){let e=x();s(0,"sh-form-field",3)(1,"input",6),I("ngModelChange",function(i){c(e);let o=u();return L(o.internalPath,i)||(o.internalPath=i),d(i)}),F("ngModelChange",function(){c(e);let i=u();return d(i.updateFilter())}),l(),A(2,Ft,2,1,"ng-container",7),A(3,Tt,2,1,"ng-container",8),l()}if(a&2){let e,n,i=u();_(),y("ngModel",i.internalPath),_(),D(!((e=i.currentExpressionOption())==null||e.startsWith==null)&&e.startsWith.length?2:-1),_(),D(!((n=i.currentExpressionOption())==null||n.endsWith==null)&&n.endsWith.length?3:-1)}}var Nt=[{key:"Applications",value:"Applications"},{key:"CacheFiles",value:"Cache Files"},{key:"TemporaryFiles",value:"Temporary Files"},{key:"OperatingSystem",value:"Operating System"},{key:"SystemFiles",value:"System Files"},{key:"DefaultExcludes",value:"Standard Excludes"}],ft=[{key:"Excludes folders where name contains",value:"-FolderName"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileName"},{key:"Excludes file extension",value:"-Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Exclude file groups",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"},{key:"None",value:"-Unknown"}],Ie=class a{path=ke.required();osType=ke();pathChange=Be();remove=Be();internalPath=C("");pathType=C("-Expression");currentExpressionOption=G(()=>{let t=this.pathType();return this.expressionOptions().find(e=>e.value===t)});fileGroupOptions=C(Nt);expressionOptions=G(()=>{let e=this.osType()==="Windows"?"\\":"/";return ft.map(n=>n.value==="-Folder"||n.value==="+Folder"?X(b({},n),{startsWith:"",endsWith:""}):n.value==="-FolderName"||n.value==="+FolderName"?X(b({},n),{startsWith:"*",endsWith:`*${e}`}):n.value==="-FileName"||n.value==="+FileName"?X(b({},n),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):n.value==="-FileGroup"||n.value==="+FileGroup"?X(b({},n),{startsWith:"{",endsWith:"}"}):n.value==="-Regex"||n.value==="+Regex"?X(b({},n),{startsWith:"[",endsWith:"]"}):n.value==="-Extension"||n.value==="+Extension"?X(b({},n),{startsWith:"*.",endsWith:""}):X(b({},n),{startsWith:"",endsWith:""}))});pathEffect=ne(()=>{let t=this.path(),e=t.slice(1),n=t.startsWith("-")?"-":"+",i=this.osType()==="Windows",o=i?"\\":"/";e.startsWith("%")&&e.endsWith(o)||i&&e.slice(2).startsWith(o)&&e.endsWith(o)||e.startsWith(o)&&e.endsWith(o)?(this.pathType.set(`${n}Folder`),this.internalPath.set(e)):e.startsWith("*")&&e.endsWith(`*${o}`)?(this.pathType.set(`${n}FolderName`),this.internalPath.set(e.slice(1,-2))):e.startsWith("[.*")&&e.endsWith(`[^\\${o}]*]`)?(this.pathType.set(`${n}FileName`),this.internalPath.set(e.slice(3,-7))):e.startsWith("{")&&e.endsWith("}")?(this.pathType.set(`${n}FileGroup`),this.internalPath.set(e.slice(1,-1))):e.startsWith("[")&&e.endsWith("]")?(this.pathType.set(`${n}Regex`),this.internalPath.set(e.slice(1,-1))):e.startsWith("*.")?(this.pathType.set(`${n}Extension`),this.internalPath.set(e.slice(2))):(this.pathType.set(`${n}Expression`),this.internalPath.set(e))});updateFilter(){let t=this.internalPath(),e=this.currentExpressionOption();t!==""&&this.pathChange.emit(`${e?.value.slice(0,1)}${e?.startsWith??""}${t}${e?.endsWith??""}`)}removeFilter(){this.remove.emit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=J({type:a,selectors:[["app-new-filter"]],inputs:{path:[1,"path"],osType:[1,"osType"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:7,vars:4,consts:()=>{let t;return t=$localize`Select an option...`,[["value","value","label","key",3,"options","isClearable"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],["value","key","label","value",1,"expression-input",3,"options","isClearable","selectMultiple"],[1,"expression-input"],[1,"filter-removal",3,"click"],[1,"sh-primary"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],["suffix",""]]},template:function(e,n){if(e&1&&(s(0,"sh-select",0)(1,"input",1),I("ngModelChange",function(o){return L(n.pathType,o)||(n.pathType=o),o}),F("ngModelChange",function(){return n.updateFilter()}),l()(),A(2,St,2,4,"sh-select",2)(3,ht,4,3,"sh-form-field",3),s(4,"div",4),F("click",function(){return n.removeFilter()}),s(5,"sh-icon",5),U(6,"x-circle"),l()()),e&2){let i;T("options",n.expressionOptions())("isClearable",!1),_(),y("ngModel",n.pathType),_(),D(((i=n.currentExpressionOption())==null?null:i.value)=="-FileGroup"||((i=n.currentExpressionOption())==null?null:i.value)=="+FileGroup"?2:3)}},dependencies:[ae,z,j,oe,le,Y,q],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}.expression-input[_ngcontent-%COMP%]{--ff-suffix-bg: var(--base-2)}.filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var Pt=["formRef"],He=()=>({standalone:!0});function At(a,t){if(a&1){let e=x();s(0,"sh-form-field",41)(1,"input",42),I("ngModelChange",function(i){c(e);let o=u(2);return L(o.editingPath,i)||(o.editingPath=i),d(i)}),l()(),s(2,"button",43),F("click",function(){c(e);let i=u(2);return d(i.updatePath())}),s(3,"sh-icon"),U(4,"floppy-disk"),l()(),s(5,"button",43),F("click",function(){c(e);let i=u(2);return d(i.cancelEditPath())}),s(6,"sh-icon"),U(7,"x-bold"),l()()}if(a&2){let e=u(2);_(),y("ngModel",e.editingPath),T("ngModelOptions",Se(2,He))}}function Dt(a,t){if(a&1){let e=x();s(0,"sh-form-field",41),g(1,"input",44),l(),s(2,"button",43),F("click",function(){c(e);let i=u().$implicit,o=u();return d(o.editPath(i))}),s(3,"sh-icon"),U(4,"pen"),l()(),s(5,"button",43),F("click",function(){c(e);let i=u().$implicit,o=u();return d(o.removePath(i))}),s(6,"sh-icon"),U(7,"trash-simple"),l()()}if(a&2){let e=u().$implicit;qe("readonly",!0),_(),T("ngModel",e)("ngModelOptions",Se(3,He))}}function Rt(a,t){if(a&1&&(s(0,"div",30),A(1,At,8,3)(2,Dt,8,4),l()),a&2){let e=t.$implicit,n=u();_(),D(n.oldPath()===e?1:2)}}function Mt(a,t){if(a&1){let e=x();s(0,"app-new-filter",46),F("pathChange",function(i){let o=c(e).$index,r=u(2);return d(r.patchPathAt(i,o))})("remove",function(){let i=c(e).$index,o=u(2);return d(o.removePathAt(i))}),l()}if(a&2){let e=t.$implicit,n=u(2);T("path",e)("osType",n.osType()??"")}}function Ot(a,t){if(a&1&&$e(0,Mt,1,2,"app-new-filter",45,Ge),a&2){let e=u();xe(e.pathArray())}}function yt(a,t){if(a&1){let e=x();s(0,"div",31)(1,"app-size",47),F("ngModelChange",function(i){c(e);let o=u();return d(o.updateFilesLargerThan(i))}),l()()}if(a&2){let e=u();_(),T("ngModel",e.filesLargerThan())("ngModelOptions",Se(2,He))}}var V=new De,pt=(a={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>V.group({path:V.control(a.path),excludes:V.group({hidden:V.control(a.excludes.hidden),system:V.control(a.excludes.system),temporary:V.control(a.excludes.temporary),filesLargerThan:V.group({size:V.control(null),unit:V.control(null)})})}),Je=class a{#e=O(Q);#t=O(H);#i=O(ie);formRef=Fe.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new Qe("");filesLargerThan=G(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);osType=this.#e.osType;pathSignal=re(this.sourceDataForm.controls.path.valueChanges);pathArray=G(()=>this.pathSignal()?.split("\0").filter(t=>t.startsWith("-")||t.startsWith("+")||t==="___none___")??[]);nonFilterPaths=G(()=>this.pathSignal()?.split("\0").filter(t=>!t.startsWith("-")&&!t.startsWith("+")&&t!==""));oldPath=C(null);editingPath=C(null);addingNewPath=C(!1);editPath(t){this.oldPath.set(t),this.editingPath.set(t)}updateFilesLargerThan(t){let{size:e,unit:n}=ct(t);this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:e,unit:n})}updatePath(){let t=this.oldPath(),e=this.editingPath();if(!t||!e||e===t){this.oldPath.set(null),this.editingPath.set(null);return}let n=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(n?.replace(t,e)??""),this.oldPath.set(null),this.editingPath.set(null)}cancelEditPath(){this.oldPath.set(null),this.editingPath.set(null)}removePath(t){let n=(this.sourceDataForm.controls.path.value??"").split("\0"),i=n.indexOf(t);if(i===-1)return;n.splice(i,1);let o=n.filter(r=>r&&r!=="").join("\0");this.sourceDataForm.controls.path.setValue(o)}addFilter(t="-*"){let n=[this.sourceDataForm.controls.path.value,t].filter(i=>i&&i!=="").join("\0");this.sourceDataForm.controls.path.setValue(n)}patchPathAt(t,e){let i=this.sourceDataForm.controls.path.value.split("\0").filter(p=>!p.startsWith("-")&&!p.startsWith("+")).join("\0"),o=this.pathArray().map((p,h)=>h===e?`${t}`:`${p}`).join("\0"),r=[i,o].filter(p=>p&&p!=="").join("\0");this.sourceDataForm.controls.path.setValue(r)}removePathAt(t){let n=this.sourceDataForm.controls.path.value.split("\0").filter(r=>!r.startsWith("-")&&!r.startsWith("+")).join("\0"),i=this.pathArray().filter((r,p)=>p!==t).join("\0"),o=[n,i].filter(r=>r&&r!=="").join("\0");this.sourceDataForm.controls.path.setValue(o)}getPath(){return this.sourceDataForm.value.path??null}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let t=this.sourceDataForm.controls.path.value,e=this.newPathCtrl.value,n=t?.split("\0")||[];e&&!n.includes(e)&&n.push(e);let i=n.filter(o=>o&&o!=="").join("\0");this.sourceDataForm.controls.path.setValue(i),this.newPathCtrl.setValue("")}goBack(){this.#t.navigate(["destination"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=J({type:a,selectors:[["app-source-data"]],viewQuery:function(e,n){e&1&&ge(n.formRef,Pt,5),e&2&&Ee()},decls:56,vars:12,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Add a direct path`;let n;n=$localize`Hidden files`;let i;i=$localize`System files`;let o;o=$localize`Temporary files`;let r;r=$localize`Source Data`;let p;p=$localize`Folder path`;let h;h=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let S;S=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let w;w=$localize`Paths`;let N;N=$localize`Add a path directly from your machine.`;let $;$=$localize`Filters`;let K;K=$localize`Customize your filters.`;let v;v=$localize`Add filter`;let W;W=$localize`Exclude`;let R;R=$localize`Choose if there’s any files you want to exclude.`;let Z;Z=$localize` Files with the Hidden attribute ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let _e;_e=$localize` Files with the System attribute ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`;let ue;ue=$localize` Files with the Temporary attribute ${"\uFFFD#52\uFFFD\uFFFD/#52\uFFFD"}:TAG_INPUT:`;let ce;ce=$localize` Files larger than `;let P;return P=$localize`Edit path`,[["formRef",""],r,p,h,S,w,N,$,K,v,W,R,Z,_e,ue,ce,[3,"submit","formGroup"],[1,"left"],[1,"title-30"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",t,"formControlName","path"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],["description",""],[1,"paths"],[1,"path"],[1,"row-inputs"],["type","text","placeholder",e,3,"formControl"],["shButton","","type","button",1,"raised","primary",3,"click"],["type","button","shButton","","action","",3,"click"],["formGroupName","excludes",3,"disallowToggle"],[1,"raised","primary"],["type","checkbox","placeholder",n,"formControlName","hidden"],["type","checkbox","placeholder",i,"formControlName","system"],["type","checkbox","placeholder",o,"formControlName","temporary"],[1,"raised","primary",3,"click"],[1,"small"],["type","text","placeholder",P,3,"ngModelChange","ngModel","ngModelOptions"],["shButton","","type","button",1,"small",3,"click"],["type","text",3,"ngModel","ngModelOptions"],[3,"path","osType"],[3,"pathChange","remove","path","osType"],[3,"ngModelChange","ngModel","ngModelOptions"]]},template:function(e,n){if(e&1){let i=x();s(0,"form",16,0),F("submit",function(){return c(i),d(n.next())}),s(2,"div",17)(3,"h3",18),f(4,1),l(),s(5,"app-file-tree",19)(6,"label",20),f(7,2),l(),g(8,"input",21),l(),s(9,"div",22)(10,"button",23),F("click",function(){return c(i),d(n.goBack())}),E(11,3),g(12,"sh-icon"),m(),l(),s(13,"button",24),E(14,4),g(15,"sh-icon"),m(),l()()(),s(16,"div",25)(17,"app-toggle-card",26),B(18,27),f(19,5),k(),s(20,"p",28),f(21,6),l(),s(22,"div",29),$e(23,Rt,3,1,"div",30,Ge),s(25,"div",31)(26,"sh-form-field"),g(27,"input",32),l(),s(28,"button",33),F("click",function(){return c(i),d(n.addNewPath())}),s(29,"sh-icon"),U(30,"plus"),l()()()()(),s(31,"app-toggle-card",26),B(32,27),f(33,7),k(),s(34,"p",28),f(35,8),l(),s(36,"button",34),F("click",function(){return c(i),d(n.addFilter())}),f(37,9),l(),A(38,Ot,2,0),l(),s(39,"app-toggle-card",35),B(40,27),f(41,10),k(),s(42,"p",28),f(43,11),l(),s(44,"sh-toggle",36),E(45,12),g(46,"input",37),m(),l(),s(47,"sh-toggle",36),E(48,13),g(49,"input",38),m(),l(),s(50,"sh-toggle",36),E(51,14),g(52,"input",39),m(),l(),s(53,"sh-toggle",40),F("click",function(){return c(i),d(n.toggleFilesLargerThan())}),f(54,15),l(),A(55,yt,2,3,"div",31),l()()()}if(e&2){let i;T("formGroup",n.sourceDataForm),_(5),T("multiSelect",!0)("startingPath",n.getPath())("showFiles",!0),_(12),T("disallowToggle",!0),_(6),xe(n.nonFilterPaths()),_(4),T("formControl",n.newPathCtrl),_(4),T("disallowToggle",!0),_(7),D((i=n.pathSignal())!=null&&i.length?38:-1),_(),T("disallowToggle",!0),_(14),me("active",n.filesLargerThan()),_(2),D(n.filesLargerThan()?55:-1)}},dependencies:[ae,fe,z,Te,j,Ne,oe,Re,et,Pe,Ae,tt,Y,q,se,Me,Ie,ut,ye,dt],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-4)}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}sh-divider[_ngcontent-%COMP%]{margin:.75rem 0}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.25rem}.paths[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.path[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr min-content min-content;gap:.25rem}"],changeDetection:0})};var Ct="1W:1D,4W:1W,12M:1M",Q=class a{#e=O(H);#t=O(Oe);#i=O(it);#n=O(st);#a=O(Le);generalForm=gt();sourceDataForm=pt();scheduleFields={autoRun:C(ee.autoRun),nextTime:C(ee.nextTime),runAgain:C(ee.runAgain)};settings=C([]);optionsFields={remoteVolumeSize:C("50MB"),backupRetention:C("all"),backupRetentionTime:C(""),backupRetentionVersions:C(0),backupRetentionCustom:C("")};targetUrlModel=C(null);backupMetadata=C(null);isDraft=C(!1);backupId=C(null);backupName=G(()=>this.generalFormSignal()?.name??"");isSubmitting=C(!1);finishedLoading=C(!1);backupDefaults=C(null);applicationOptions=C(null);isNew=G(()=>this.backupId()==="new");osType=G(()=>this.#t.systemInfo()?.OSType);selectedOptions=C([]);sourceDataFormSignal=re(this.sourceDataForm.valueChanges);generalFormSignal=re(this.generalForm.valueChanges);encryptionFieldSignal=re(this.generalForm.controls.encryption.valueChanges);advancedOptions=G(()=>this.#t.systemInfo()?.Options?.map(this.#_)??[]);#o=C("");#s=C(null);#l=null;testSignal=this.#o.asReadonly();testErrorMessage=this.#s.asReadonly();#d=ne(()=>{let t=this.targetUrlModel(),e=this.#o(),n=this.#l;this.#l=t,!(e==="testing"||n===null||n===t)&&(this.#o.set(""),this.#s.set(null))});setTestState(t,e){this.#o.set(t),this.#s.set(e??null)}#_(t){return{name:t.Name,type:t.Type,shortDescription:t.ShortDescription??void 0,longDescription:t.LongDescription??void 0,options:t.ValidValues}}encryptionOptions=G(()=>{let t=this.#t.systemInfo()?.EncryptionModules??[];return[pe,...t]});nonSelectedOptions=G(()=>this.advancedOptions().sort((t,e)=>t?.name&&e?.name?t?.name.localeCompare(e?.name):0).filter(t=>this.selectedOptions()?.findIndex(e=>e.name===t.name)===-1));submit(t=!1){this.isSubmitting.set(!0);let e=this.#u(),n=this.backupId();this.isDraft()&&e.Backup&&(e.Backup.Metadata=this.backupMetadata()),n==="new"||!n||this.isDraft()?this.#n.postApiV1Backups({requestBody:e}).pipe(we(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}}):this.#n.putApiV1BackupById({id:n,requestBody:e}).pipe(we(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}})}exit(t){if(!t){this.#r(),this.#e.navigate(["/"]);return}this.#i.open(lt,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#r(),this.#e.navigate(["/"]))}})}mapSourceDataToForm(t){let e=t.Sources??"",n=t.Filters?.map(p=>`${p.Include?"":"-"}${p.Expression}`)??[],i=t.Settings?.find(p=>p.Name==="--exclude-files-attributes")?.Value??"",o=t.Settings?.find(p=>p.Name==="--skip-files-larger-than")??null,r={path:[...e,...n].join("\0"),excludes:{hiddenFiles:i.includes("hidden"),systemFiles:i.includes("system"),tempFiles:i.includes("temporary"),filesLargerThan:o?.Value?.toUpperCase()??null}};this.sourceDataForm.patchValue(r)}mapDestinationToForm(t){this.targetUrlModel.set(t.TargetURL??"")}mapGeneralToForm(t){let e=t.Name??"",n=t.Description??"",i=t.Settings?.find(S=>S.Name==="encryption-module"),o=t.Settings?.find(S=>S.Name==="passphrase")?.Value??"",r=i?.Value&&i.Value.length?i.Value:"",p=t.Settings?.find(S=>S.Name==="compression-module")?.Value??"",h={name:t.Name??"",description:t.Description??""};e&&e!==""&&(h.name=e),n&&n!==""&&(h.description=n),r&&r!==""&&(h.encryption=r),o&&o!==""&&(h.password=o,h.repeatPassword=o),p&&p!==""&&(h.compression=p),this.generalForm.patchValue(h)}mapScheduleToForm(t){if(!t){this.scheduleFields.autoRun.set(!1);return}let e=this.#a.fromString(t.Repeat)??null,n=this.#c(t.Time);this.scheduleFields.autoRun.set(!0),this.scheduleFields.nextTime.update(i=>b(b({},i),n)),this.scheduleFields.runAgain.set({repeatValue:e?.value??1,repeatUnit:e?.unit??"D",allowedDays:{mon:t.AllowedDays?.includes("mon")??!1,tue:t.AllowedDays?.includes("tue")??!1,wed:t.AllowedDays?.includes("wed")??!1,thu:t.AllowedDays?.includes("thu")??!1,fri:t.AllowedDays?.includes("fri")??!1,sat:t.AllowedDays?.includes("sat")??!1,sun:t.AllowedDays?.includes("sun")??!1}})}mapOptionsToForms(t){let e=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","passphrase","keep-time","keep-versions","retention-policy"],n=t.Settings?.filter(r=>!e.includes(r.Name)),i=t.Settings?.filter(r=>e.includes(r.Name));this.settings.set(n??[]),n?.forEach(r=>{if(r.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(r.Value??"")});var o="all";i?.forEach(r=>{if(r.Name==="dblock-size"&&this.optionsFields.remoteVolumeSize.set(r.Value??"50MB"),r.Name==="keep-time"&&(r.Value??"")!=="")return o="time",this.optionsFields.backupRetentionTime.set(r.Value??"");if(r.Name==="keep-versions"&&(r.Value??"")!=="")return o="versions",this.optionsFields.backupRetentionVersions.set(r.Value?parseInt(r.Value):null);if(r.Name==="retention-policy"&&(r.Value??"")!=="")if(r.Value===Ct)o="smart";else return o="custom",this.optionsFields.backupRetentionCustom.set(r.Value??"")}),this.optionsFields.backupRetention.set(o)}storeMetadata(t,e){this.backupMetadata.set(e?t.Metadata??null:null)}getScheduleFormValue(){return{autoRun:this.scheduleFields.autoRun(),nextTime:this.scheduleFields.nextTime(),runAgain:this.scheduleFields.runAgain()}}#u(){let t=this.generalForm.value,e=this.getScheduleFormValue(),n=this.sourceDataForm.value,i=this.targetUrlModel(),o=null;e.runAgain?.repeatUnit&&e.runAgain?.repeatValue&&(o=this.#a.toString(e.runAgain.repeatValue,e.runAgain.repeatUnit));let r=e.runAgain?.allowedDays?Object.entries(e.runAgain?.allowedDays).filter(([N,$])=>$).map(([N,$])=>N):[],p=n.path?.split("\0")??[],h=this.mapFormsToSettings(),S=Object.entries(n.excludes??{}).filter(([N,$])=>$&&N!=="filesLargerThan").map(([N])=>N),w=n.excludes?.filesLargerThan;return S.length&&h.push({Name:"--exclude-files-attributes",Value:S.join(",")}),w&&w.size!==null&&w.unit!==null&&h.push({Name:"--skip-files-larger-than",Value:`${w.size}${w.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:i??null,Sources:p.filter(N=>!(N.startsWith("-")||N.startsWith("+"))),Settings:h,Filters:p.filter(N=>N.startsWith("-")||N.startsWith("+")).map((N,$)=>({Order:$,Include:N.startsWith("+"),Expression:N.slice(1)}))},Schedule:e.autoRun?{Repeat:o,Time:e.nextTime?.date?new Date(`${e.nextTime.date}T${e.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:r}:null}}mapFormsToSettings(t=[]){let e=this.generalForm.value,n=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","encryption-module","passphrase","keep-time","keep-versions","retention-policy","dblock-size","compression-module"],i=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&e.encryption!==pe.Key&&(i=[{Name:"encryption-module",Value:e.encryption??null},{Name:"passphrase",Value:e.password??null}]);let o=[{Name:"compression-module",Value:e.compression}];e.compression===""&&(o=[]);let r=[{Name:"dblock-size",Value:this.optionsFields.remoteVolumeSize()}];switch(this.optionsFields.backupRetention()){case"time":r.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":r.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":r.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":r.push({Name:"retention-policy",Value:Ct});break}let p=[...t,...n],h=this.settings().filter(S=>!p.includes(S.Name)).map(S=>{let w=S.Value;return typeof S.Value=="number"&&(w=S.Value.toString()),typeof S.Value=="boolean"&&(w=S.Value?"True":"False"),{Name:S.Name?.startsWith("--")?S.Name:`--${S.Name}`,Value:w}});return[...i,...o,...r,...h]}#c(t){if(!t||t?.indexOf("T")===-1)return{time:t??"13:00"};let e=new Date(t);return{time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`,date:e.toISOString().split("T")[0]}}setTargetUrl(t,e=!1){e&&(this.#l=null),this.targetUrlModel.set(t)}#r(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleFields.autoRun.set(ee.autoRun),this.scheduleFields.nextTime.set(ee.nextTime),this.scheduleFields.runAgain.set(ee.runAgain),this.optionsFields.remoteVolumeSize.set("50MB"),this.optionsFields.backupRetention.set("all"),this.settings.set([]),this.targetUrlModel.set(null)}static \u0275fac=function(e){return new(e||a)};static \u0275prov=Ce({token:a,factory:a.\u0275fac,providedIn:"root"})};var Lt=["formRef"];function It(a,t){a&1&&(s(0,"sh-alert",17),E(1,5),g(2,"sh-icon",26),m(),l())}function wt(a,t){if(a&1&&U(0),a&2){let e=t.$implicit;Ye(" ",e.DisplayName," ")}}function Gt(a,t){if(a&1&&g(0,"sh-progress-bar",40),a&2){let e=u(3);me("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),T("value",e.calculatePasswordStrength()*(100/5))}}function $t(a,t){a&1&&(s(0,"span",35),f(1,10),l())}function xt(a,t){a&1&&(E(0,8,1),g(1,"sh-icon"),m())}function Ut(a,t){a&1&&(E(0,8,2),g(1,"sh-icon"),m())}function bt(a,t){a&1&&(E(0,11,1),g(1,"sh-icon",42),m())}function vt(a,t){a&1&&(E(0,11,2),g(1,"sh-icon"),m())}function Bt(a,t){if(a&1){let e=x();s(0,"button",41),F("click",function(){c(e);let i=u(3);return d(i.copyPassword())}),E(1,11),A(2,bt,2,0)(3,vt,2,0),m(),l()}if(a&2){let e=u(3);_(2),D(e.copiedPassword()?2:3)}}function kt(a,t){a&1&&(s(0,"sh-alert",39),f(1,12),l())}function Vt(a,t){if(a&1){let e=x();s(0,"div",30)(1,"sh-form-field")(2,"label",31),E(3,7),g(4,"sup"),m(),l(),g(5,"input",32),l(),A(6,Gt,1,9,"sh-progress-bar",33),s(7,"sh-form-field"),g(8,"input",34),A(9,$t,2,0,"span",35),l(),s(10,"div",36)(11,"button",37),F("click",function(){c(e);let i=u(2);return d(i.showPassword.set(!i.showPassword()))}),E(12,8),A(13,xt,2,0)(14,Ut,2,0),m(),l(),s(15,"button",37),F("click",function(){c(e);let i=u(2);return d(i.generatePassword())}),E(16,9),g(17,"sh-icon"),m(),l(),A(18,Bt,4,1,"button",38),l(),A(19,kt,2,0,"sh-alert",39),l()}if(a&2){let e=u(2);_(5),T("type",e.showPassword()?"text":"password"),_(),D(e.generalForm.value.password?6:-1),_(2),T("type",e.showPassword()?"text":"password"),_(),D(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),_(4),D(e.showPassword()?13:14),_(5),D(e.showCopyPassword()?18:-1),_(),D(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function Kt(a,t){if(a&1&&(s(0,"sh-select",27)(1,"label",28),f(2,6),l(),g(3,"input",29),je(4,wt,1,1,"ng-template"),l(),A(5,Vt,20,7,"div",30)),a&2){let e=u();T("options",e.encryptionOptions())("isClearable",!1),_(5),D(e.encryptionFieldSignal()!==e.noneOptionKey?5:-1)}}function Wt(a,t){if(a&1&&(s(0,"button",24),E(1,13),g(2,"sh-icon"),m(),l()),a&2){let e=u();T("disabled",e.nameAndDescriptionValid()===!1)}}function Xt(a,t){if(a&1&&(s(0,"button",25),E(1,14),g(2,"sh-icon"),m(),l()),a&2){let e=u();T("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var te=new De,gt=(a={name:"",description:"",encryption:"",password:"",repeatPassword:"",compression:""})=>te.group({name:te.control(a.name,[he.required]),description:te.control(a.description),encryption:te.control(a.encryption,[_t()]),password:te.control(a.password,[Ve(t=>t?.value.encryption!=="",[he.required])]),repeatPassword:te.control(a.repeatPassword,[Ve(t=>t?.value.encryption!=="",[he.required])]),compression:te.control(a.compression)}),pe={Key:"-",DisplayName:"None"},ze=class a{#e=O(H);#t=O(ie);#i=O(rt);#n=O(Q);#a=O(Oe);formRef=Fe.required("formRef");generalForm=this.#n.generalForm;generalFormSignal=this.#n.generalFormSignal;encryptionFieldSignal=this.#n.encryptionFieldSignal;encryptionOptions=this.#n.encryptionOptions;isNew=this.#n.isNew;showPassword=C(!1);copiedPassword=C(!1);showCopyPassword=C(!1);noneOptionKey=pe.Key;encryptionEffect=ne(()=>{this.encryptionFieldSignal()===pe.Key&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=G(()=>{let t=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=G(()=>{let e=this.generalFormSignal()?.password??"";return this.#i.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#n.exit(!0)}async copyPassword(){let t=this.generalForm.controls.password.value;await this.#o(t??""),this.copiedPassword.set(!0)}async#o(t){try{await navigator.clipboard.writeText(t)}catch{try{let n=document.createElement("textarea");n.value=t,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}catch(n){console.error("Failed to copy text: ",n)}}}generatePassword(){this.copiedPassword.set(!1);let t=this.#i.generate(16);this.generalForm.controls.password.setValue(t),this.generalForm.controls.repeatPassword.setValue(t),this.showCopyPassword.set(!0)}next(){this.#n.isNew()||this.#n.submit(!0),this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=J({type:a,selectors:[["app-general"]],viewQuery:function(e,n){e&1&&ge(n.formRef,Lt,5),e&2&&Ee()},decls:21,vars:4,consts:()=>{let t;t=$localize`Your backup name`;let e;e=$localize`Your backup description`;let n;n=$localize`Remember to copy the password`;let i;i=$localize`General backup settings`;let o;o=$localize` Backup name ${"\uFFFD#8\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#8\uFFFD"}:CLOSE_SUPERSCRIPT:`;let r;r=$localize`Backup description`;let p;p=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Exit `;let h;h=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Encrypted backup `;let S;S=$localize`Encryption`;let w;w=$localize`Encryption`;let N;N=$localize`Password`;let $;$=$localize`Repeat password`;let K;K=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let v;v=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,v=Ue(v);let W;W=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let R;R=$localize`Passwords do not match`;let Z;Z=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,Z=Ue(Z);let _e;_e=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let ue;ue=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let ce;return ce=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],i,o,r,p,h,w,K,v,W,R,Z,_e,ue,ce,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],[1,"primary"],["for","backupName"],["type","text","tabindex","1","placeholder",t,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","shButton","",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],["shButton","","type","submit","shTooltip",n,1,"raised","primary",3,"disabled"],["icon",""],["value","Key","label","DisplayName",3,"options","isClearable"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",S,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",N,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",$,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["shButton","","type","button",1,"small","copy",3,"click"],[1,"sh-success"]]},template:function(e,n){if(e&1){let i=x();s(0,"form",15,0),F("submit",function(){return c(i),d(n.next())}),s(2,"h3",16),f(3,1),l(),A(4,It,3,0,"sh-alert",17),s(5,"sh-form-field")(6,"label",18),E(7,2),g(8,"sup"),m(),l(),g(9,"input",19),l(),s(10,"sh-form-field")(11,"label",20),f(12,3),l(),g(13,"textarea",21),l(),A(14,Kt,6,3),s(15,"div",22)(16,"button",23),F("click",function(){return c(i),d(n.exit())}),E(17,4),g(18,"sh-icon"),m(),l(),A(19,Wt,3,1,"button",24)(20,Xt,3,1,"button",25),l()()}if(e&2){let i;T("formGroup",n.generalForm),_(4),D(!n.isNew()&&((i=n.generalFormSignal())==null?null:i.encryption)!==""?4:-1),_(10),D(n.isNew()?14:-1),_(5),D(n.encryptionFieldSignal()===n.noneOptionKey||!n.isNew()?19:20)}},dependencies:[Re,fe,z,j,Ne,Pe,Ae,Y,le,se,q,ot,nt,at],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--error-8)}.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%] sh-icon.sh-success[_ngcontent-%COMP%]{color:var(--success-8)}"],changeDetection:0})};export{gt as a,pe as b,ze as c,ee as d,Ke as e,pt as f,Je as g,Q as h};
@@ -1 +1 @@
1
- import{a as v}from"./chunk-KXJZEADJ.js";import{h as C}from"./chunk-C7EUC34O.js";import"./chunk-HYQ6MPYI.js";import"./chunk-YCORZV4Z.js";import"./chunk-4VY6SMSL.js";import{b as h}from"./chunk-Z27IQRKV.js";import"./chunk-H7ZKBS2Q.js";import{a as G}from"./chunk-2YGOHGD2.js";import"./chunk-BK2MSH26.js";import"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import"./chunk-LN26XMBJ.js";import"./chunk-S4OFJD2F.js";import"./chunk-6XI3IP27.js";import{b as N,c as O,e as B,f as b}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{K as M,L as $,Q as I}from"./chunk-RPUPXDQE.js";import{i as L}from"./chunk-OJ3H3ZRA.js";import"./chunk-I2LW33GO.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-JYWOYPSQ.js";import{$b as D,Ac as E,Cb as d,Db as s,Dc as _,Eb as u,F as f,Fb as r,Rc as k,Sa as n,Tb as c,Ub as p,_ as l,cb as R,nc as A,pc as P,xb as T,yb as g}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var y=(a,e)=>[a,e,"general"],U=(a,e)=>[a,e,"destination"],K=(a,e)=>[a,e,"source-data"],w=(a,e)=>[a,e,"schedule"],H=(a,e)=>[a,e,"options"];function J(a,e){if(a&1&&(s(0,"p"),A(1),u()),a&2){let t=D();n(),P("Editing: ",t.backupName())}}function X(a,e){a&1&&r(0,"sh-progress-bar",7)}function x(a,e){a&1&&(s(0,"section"),r(1,"router-outlet"),u())}var m=class a{#t=l(N);#e=l(C);#a=l(G);#i=l(L);isDraft=this.#e.isDraft;isNew=this.#e.isNew;backupId=this.#e.backupId;backupName=this.#e.backupName;finishedLoading=this.#e.finishedLoading;#o=h(this.#t.params);#n=h(this.#t.url);paramsChanged=k(()=>{let e=this.#o()?.id,t=!!this.#n()?.find(i=>i.path==="backup-draft");this.#e.backupId.set(e),e!=="new"?this.getBackup(e,t):this.getDefaults()});getDefaults(){this.#i.getApiV1Backupdefaults().pipe(f(1)).subscribe({next:e=>{let t=e.Backup;t.Settings=[...t.Settings],this.#e.mapGeneralToForm(t),this.#e.mapDestinationToForm(t),this.#e.mapSourceDataToForm(t),this.#e.mapScheduleToForm(e.Schedule),this.#e.mapOptionsToForms(t),this.#e.applicationOptions.set(e.ApplicationOptions),this.#e.backupDefaults.set(e),this.#e.finishedLoading.set(!0)}})}getBackup(e,t=!1){let i=o=>{this.#e.mapScheduleToForm(o.Schedule??null),o.Backup&&(this.#e.mapGeneralToForm(o.Backup),this.#e.mapDestinationToForm(o.Backup),this.#e.mapSourceDataToForm(o.Backup),this.#e.mapOptionsToForms(o.Backup),this.#e.storeMetadata(o.Backup,t)),this.#e.finishedLoading.set(!0)};if(t){this.isDraft.set(t);let o=this.#a.draftBackups().find(F=>F.id===e);if(!o){alert("Backup not found");return}i(o.data)}else this.#i.getApiV1BackupById({id:e}).subscribe({next:i})}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=R({type:a,selectors:[["app-backup"]],features:[E([C])],decls:21,vars:22,consts:()=>{let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_RADIO: General `;let t;t=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_RADIO: Destination `;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_RADIO: Source Data `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_RADIO: Schedule `;let F;return F=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `,[e,t,i,o,F,[1,"primary"],["step","","routerLinkActive","active",3,"routerLink"],[1,"indeterminate","primary"]]},template:function(t,i){t&1&&(r(0,"app-status-bar"),s(1,"header"),T(2,J,2,1,"p"),s(3,"sh-stepper",5)(4,"div",6),c(5,0),r(6,"sh-radio"),p(),u(),s(7,"div",6),c(8,1),r(9,"sh-radio"),p(),u(),s(10,"div",6),c(11,2),r(12,"sh-radio"),p(),u(),s(13,"div",6),c(14,3),r(15,"sh-radio"),p(),u(),s(16,"div",6),c(17,4),r(18,"sh-radio"),p(),u()()(),T(19,X,1,0,"sh-progress-bar",7)(20,x,2,0,"section")),t&2&&(n(2),g(i.isNew()?-1:2),n(2),d("routerLink",_(7,y,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(10,U,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(13,K,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(16,w,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(19,H,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),g(i.finishedLoading()?20:19))},dependencies:[O,B,b,v,$,I,M],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}header[_ngcontent-%COMP%]{padding:1rem 1.5rem;border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:.5rem}header[_ngcontent-%COMP%] sh-stepper[_ngcontent-%COMP%]{width:100%}section[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;flex:1 0;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:auto}"],changeDetection:0})};export{m as default};
1
+ import{a as v}from"./chunk-KXJZEADJ.js";import{h as C}from"./chunk-BNUMPQFL.js";import"./chunk-HYQ6MPYI.js";import"./chunk-YCORZV4Z.js";import"./chunk-4VY6SMSL.js";import{b as h}from"./chunk-Z27IQRKV.js";import"./chunk-H7ZKBS2Q.js";import{a as G}from"./chunk-2YGOHGD2.js";import"./chunk-BK2MSH26.js";import"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import"./chunk-LN26XMBJ.js";import"./chunk-S4OFJD2F.js";import"./chunk-6XI3IP27.js";import{b as N,c as O,e as B,f as b}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{K as M,L as $,Q as I}from"./chunk-RPUPXDQE.js";import{i as L}from"./chunk-OJ3H3ZRA.js";import"./chunk-I2LW33GO.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-JYWOYPSQ.js";import{$b as D,Ac as E,Cb as d,Db as s,Dc as _,Eb as u,F as f,Fb as r,Rc as k,Sa as n,Tb as c,Ub as p,_ as l,cb as R,nc as A,pc as P,xb as T,yb as g}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var y=(a,e)=>[a,e,"general"],U=(a,e)=>[a,e,"destination"],K=(a,e)=>[a,e,"source-data"],w=(a,e)=>[a,e,"schedule"],H=(a,e)=>[a,e,"options"];function J(a,e){if(a&1&&(s(0,"p"),A(1),u()),a&2){let t=D();n(),P("Editing: ",t.backupName())}}function X(a,e){a&1&&r(0,"sh-progress-bar",7)}function x(a,e){a&1&&(s(0,"section"),r(1,"router-outlet"),u())}var m=class a{#t=l(N);#e=l(C);#a=l(G);#i=l(L);isDraft=this.#e.isDraft;isNew=this.#e.isNew;backupId=this.#e.backupId;backupName=this.#e.backupName;finishedLoading=this.#e.finishedLoading;#o=h(this.#t.params);#n=h(this.#t.url);paramsChanged=k(()=>{let e=this.#o()?.id,t=!!this.#n()?.find(i=>i.path==="backup-draft");this.#e.backupId.set(e),e!=="new"?this.getBackup(e,t):this.getDefaults()});getDefaults(){this.#i.getApiV1Backupdefaults().pipe(f(1)).subscribe({next:e=>{let t=e.Backup;t.Settings=[...t.Settings],this.#e.mapGeneralToForm(t),this.#e.mapDestinationToForm(t),this.#e.mapSourceDataToForm(t),this.#e.mapScheduleToForm(e.Schedule),this.#e.mapOptionsToForms(t),this.#e.applicationOptions.set(e.ApplicationOptions),this.#e.backupDefaults.set(e),this.#e.finishedLoading.set(!0)}})}getBackup(e,t=!1){let i=o=>{this.#e.mapScheduleToForm(o.Schedule??null),o.Backup&&(this.#e.mapGeneralToForm(o.Backup),this.#e.mapDestinationToForm(o.Backup),this.#e.mapSourceDataToForm(o.Backup),this.#e.mapOptionsToForms(o.Backup),this.#e.storeMetadata(o.Backup,t)),this.#e.finishedLoading.set(!0)};if(t){this.isDraft.set(t);let o=this.#a.draftBackups().find(F=>F.id===e);if(!o){alert("Backup not found");return}i(o.data)}else this.#i.getApiV1BackupById({id:e}).subscribe({next:i})}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=R({type:a,selectors:[["app-backup"]],features:[E([C])],decls:21,vars:22,consts:()=>{let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_RADIO: General `;let t;t=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_RADIO: Destination `;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_RADIO: Source Data `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_RADIO: Schedule `;let F;return F=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `,[e,t,i,o,F,[1,"primary"],["step","","routerLinkActive","active",3,"routerLink"],[1,"indeterminate","primary"]]},template:function(t,i){t&1&&(r(0,"app-status-bar"),s(1,"header"),T(2,J,2,1,"p"),s(3,"sh-stepper",5)(4,"div",6),c(5,0),r(6,"sh-radio"),p(),u(),s(7,"div",6),c(8,1),r(9,"sh-radio"),p(),u(),s(10,"div",6),c(11,2),r(12,"sh-radio"),p(),u(),s(13,"div",6),c(14,3),r(15,"sh-radio"),p(),u(),s(16,"div",6),c(17,4),r(18,"sh-radio"),p(),u()()(),T(19,X,1,0,"sh-progress-bar",7)(20,x,2,0,"section")),t&2&&(n(2),g(i.isNew()?-1:2),n(2),d("routerLink",_(7,y,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(10,U,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(13,K,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(16,w,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(19,H,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),g(i.finishedLoading()?20:19))},dependencies:[O,B,b,v,$,I,M],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}header[_ngcontent-%COMP%]{padding:1rem 1.5rem;border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:.5rem}header[_ngcontent-%COMP%] sh-stepper[_ngcontent-%COMP%]{width:100%}section[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;flex:1 0;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:auto}"],changeDetection:0})};export{m as default};
@@ -1 +1 @@
1
- import{f as a,g as b}from"./chunk-C7EUC34O.js";import"./chunk-HYQ6MPYI.js";import"./chunk-YCORZV4Z.js";import"./chunk-4VY6SMSL.js";import"./chunk-Z27IQRKV.js";import"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import"./chunk-RPUPXDQE.js";import"./chunk-OJ3H3ZRA.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";export{a as createSourceDataForm,b as default};
1
+ import{f as a,g as b}from"./chunk-BNUMPQFL.js";import"./chunk-HYQ6MPYI.js";import"./chunk-YCORZV4Z.js";import"./chunk-4VY6SMSL.js";import"./chunk-Z27IQRKV.js";import"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import"./chunk-RPUPXDQE.js";import"./chunk-OJ3H3ZRA.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";export{a as createSourceDataForm,b as default};
@@ -1 +1 @@
1
- import{a,b,c}from"./chunk-C7EUC34O.js";import"./chunk-HYQ6MPYI.js";import"./chunk-YCORZV4Z.js";import"./chunk-4VY6SMSL.js";import"./chunk-Z27IQRKV.js";import"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import"./chunk-RPUPXDQE.js";import"./chunk-OJ3H3ZRA.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";export{b as NONE_OPTION,a as createGeneralForm,c as default};
1
+ import{a,b,c}from"./chunk-BNUMPQFL.js";import"./chunk-HYQ6MPYI.js";import"./chunk-YCORZV4Z.js";import"./chunk-4VY6SMSL.js";import"./chunk-Z27IQRKV.js";import"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import"./chunk-RPUPXDQE.js";import"./chunk-OJ3H3ZRA.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";export{b as NONE_OPTION,a as createGeneralForm,c as default};
@@ -1,3 +1,3 @@
1
- import{a as Se}from"./chunk-E6H2XELA.js";import"./chunk-HHU5JW5J.js";import"./chunk-FSG362SU.js";import{a as Ee}from"./chunk-KXJZEADJ.js";import{h as A}from"./chunk-C7EUC34O.js";import"./chunk-HYQ6MPYI.js";import{a as Me}from"./chunk-YCORZV4Z.js";import"./chunk-4VY6SMSL.js";import{b as O}from"./chunk-Z27IQRKV.js";import{a as ge}from"./chunk-H7ZKBS2Q.js";import"./chunk-2YGOHGD2.js";import"./chunk-BK2MSH26.js";import"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import"./chunk-LN26XMBJ.js";import"./chunk-S4OFJD2F.js";import"./chunk-6XI3IP27.js";import{b as j,d as q,e as Q}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B as _e,F as de,G as Ce,K as ce,O as ue,c as Y,e as Z,f as ee,j as te,n as ne,o as ie,p as oe,q as ae,r as re,s as le,t as se,u as me}from"./chunk-RPUPXDQE.js";import{h as pe,i as Ne}from"./chunk-OJ3H3ZRA.js";import"./chunk-I2LW33GO.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-JYWOYPSQ.js";import{$b as M,Ab as B,Ac as z,Bb as G,Bc as H,Cb as p,Db as a,Eb as n,Fb as r,Jb as f,Kb as F,Mb as y,Rc as W,Sa as m,Tb as g,Ub as E,Vb as C,Wb as v,Xb as U,Zb as x,_ as u,cb as R,ea as S,fa as T,kc as w,pa as D,sc as K,tc as J,uc as X,xb as $,yb as b,zb as k,zc as V}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var Te=()=>["backup"];function fe(l,t){l&1&&r(0,"sh-progress-bar",12)}function Fe(l,t){if(l&1&&(a(0,"sh-form-field"),r(1,"input",32),n()),l&2){let e=t.$implicit,s=t.$index;m(),p("id",V("filter-",s))("formControl",e)}}function Oe(l,t){if(l&1){let e=y();a(0,"form",13)(1,"sh-select",14)(2,"label",15),C(3,1),n(),r(4,"input",16),n(),a(5,"sh-form-field")(6,"label",17),C(7,2),n(),r(8,"textarea",18),n(),a(9,"sh-form-field")(10,"label",19),C(11,3),n(),r(12,"textarea",20),n()(),a(13,"sh-divider"),C(14,4),n(),a(15,"form",13)(16,"sh-form-field")(17,"label",21),C(18,5),n(),r(19,"input",22),n(),a(20,"sh-form-field")(21,"label",23),C(22,6),n(),r(23,"input",24),n(),a(24,"app-toggle-card",25),f(25,26),C(26,7),F(),f(27,27),B(28,Fe,2,3,"sh-form-field",null,k),F(),n()(),a(30,"p"),g(31,8),r(32,"a",28),E(),n(),a(33,"app-options-list",29),X("optionsChange",function(o){S(e);let c=M();return J(c.settings,o)||(c.settings=o),T(o)}),n(),a(34,"div",30)(35,"button",31),x("click",function(){S(e);let o=M();return T(o.submit())}),g(36,9),r(37,"sh-icon"),E(),n()()}if(l&2){let e=M();p("formGroup",e.baseCmdForm),m(),p("options",e.commandOptions()??H(10,Te))("inlineSearch",!0),m(14),p("formGroup",e.standardFields),m(9),p("disallowToggle",!0),m(4),G(e.standardFields.controls.filters.controls),m(5),K("options",e.settings),p("hasFreeTextSettings",!0),m(2),w("loader",e.isSubmitting()),m(2),v(e.baseCmdForm.value.command),U(36)}}var _=new re,P=class l{#e=u(A);#t=u(Ne);#n=u(q);#i=u(j);#o=u(pe);#a=u(ge);#r=O(this.#i.params);commandOptions=O(this.#o.getApiV1Commandline());isSubmitting=D(!1);optionsFields=this.#e.optionsFields;standardFields=_.group({"backup-id":_.control(""),"backup-name":_.control(""),dbpath:_.control(""),filters:_.array([])});baseCmdForm=_.group({command:_.control("backup"),targetUrl:_.control(""),arguments:_.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;settings=this.#e.settings;#s=W(()=>{let t=this.#r()?.id;this.#e.backupId.set(t),this.getBackup(t)});getBackup(t){this.#t.getApiV1BackupById({id:t}).subscribe({next:e=>{this.#e.mapScheduleToForm(e.Schedule??null),e.Backup&&(this.#e.mapGeneralToForm(e.Backup),this.mapStandardFieldsToForm(e.Backup),this.mapBaseCmdToForm(e.Backup),this.#e.mapOptionsToForms(e.Backup)),this.#e.finishedLoading.set(!0)}})}mapStandardFieldsToForm(t){this.standardFields.patchValue({dbpath:t.DBPath,"backup-id":t.ID,"backup-name":t.Name}),t.Filters&&t.Filters.length&&t.Filters.map(e=>{this.standardFields.controls.filters.push(_.control(`${e.Include?"":"-"}${e.Expression}`))})}submit(){this.#a.resumeDialogCheck(()=>this.#l())}#l(){this.isSubmitting.set(!0);let t=this.baseCmdForm.value,e=t.targetUrl??"",s=t.arguments?.split(`
1
+ import{a as Se}from"./chunk-E6H2XELA.js";import"./chunk-HHU5JW5J.js";import"./chunk-FSG362SU.js";import{a as Ee}from"./chunk-KXJZEADJ.js";import{h as A}from"./chunk-BNUMPQFL.js";import"./chunk-HYQ6MPYI.js";import{a as Me}from"./chunk-YCORZV4Z.js";import"./chunk-4VY6SMSL.js";import{b as O}from"./chunk-Z27IQRKV.js";import{a as ge}from"./chunk-H7ZKBS2Q.js";import"./chunk-2YGOHGD2.js";import"./chunk-BK2MSH26.js";import"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import"./chunk-LN26XMBJ.js";import"./chunk-S4OFJD2F.js";import"./chunk-6XI3IP27.js";import{b as j,d as q,e as Q}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B as _e,F as de,G as Ce,K as ce,O as ue,c as Y,e as Z,f as ee,j as te,n as ne,o as ie,p as oe,q as ae,r as re,s as le,t as se,u as me}from"./chunk-RPUPXDQE.js";import{h as pe,i as Ne}from"./chunk-OJ3H3ZRA.js";import"./chunk-I2LW33GO.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-JYWOYPSQ.js";import{$b as M,Ab as B,Ac as z,Bb as G,Bc as H,Cb as p,Db as a,Eb as n,Fb as r,Jb as f,Kb as F,Mb as y,Rc as W,Sa as m,Tb as g,Ub as E,Vb as C,Wb as v,Xb as U,Zb as x,_ as u,cb as R,ea as S,fa as T,kc as w,pa as D,sc as K,tc as J,uc as X,xb as $,yb as b,zb as k,zc as V}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var Te=()=>["backup"];function fe(l,t){l&1&&r(0,"sh-progress-bar",12)}function Fe(l,t){if(l&1&&(a(0,"sh-form-field"),r(1,"input",32),n()),l&2){let e=t.$implicit,s=t.$index;m(),p("id",V("filter-",s))("formControl",e)}}function Oe(l,t){if(l&1){let e=y();a(0,"form",13)(1,"sh-select",14)(2,"label",15),C(3,1),n(),r(4,"input",16),n(),a(5,"sh-form-field")(6,"label",17),C(7,2),n(),r(8,"textarea",18),n(),a(9,"sh-form-field")(10,"label",19),C(11,3),n(),r(12,"textarea",20),n()(),a(13,"sh-divider"),C(14,4),n(),a(15,"form",13)(16,"sh-form-field")(17,"label",21),C(18,5),n(),r(19,"input",22),n(),a(20,"sh-form-field")(21,"label",23),C(22,6),n(),r(23,"input",24),n(),a(24,"app-toggle-card",25),f(25,26),C(26,7),F(),f(27,27),B(28,Fe,2,3,"sh-form-field",null,k),F(),n()(),a(30,"p"),g(31,8),r(32,"a",28),E(),n(),a(33,"app-options-list",29),X("optionsChange",function(o){S(e);let c=M();return J(c.settings,o)||(c.settings=o),T(o)}),n(),a(34,"div",30)(35,"button",31),x("click",function(){S(e);let o=M();return T(o.submit())}),g(36,9),r(37,"sh-icon"),E(),n()()}if(l&2){let e=M();p("formGroup",e.baseCmdForm),m(),p("options",e.commandOptions()??H(10,Te))("inlineSearch",!0),m(14),p("formGroup",e.standardFields),m(9),p("disallowToggle",!0),m(4),G(e.standardFields.controls.filters.controls),m(5),K("options",e.settings),p("hasFreeTextSettings",!0),m(2),w("loader",e.isSubmitting()),m(2),v(e.baseCmdForm.value.command),U(36)}}var _=new re,P=class l{#e=u(A);#t=u(Ne);#n=u(q);#i=u(j);#o=u(pe);#a=u(ge);#r=O(this.#i.params);commandOptions=O(this.#o.getApiV1Commandline());isSubmitting=D(!1);optionsFields=this.#e.optionsFields;standardFields=_.group({"backup-id":_.control(""),"backup-name":_.control(""),dbpath:_.control(""),filters:_.array([])});baseCmdForm=_.group({command:_.control("backup"),targetUrl:_.control(""),arguments:_.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;settings=this.#e.settings;#s=W(()=>{let t=this.#r()?.id;this.#e.backupId.set(t),this.getBackup(t)});getBackup(t){this.#t.getApiV1BackupById({id:t}).subscribe({next:e=>{this.#e.mapScheduleToForm(e.Schedule??null),e.Backup&&(this.#e.mapGeneralToForm(e.Backup),this.mapStandardFieldsToForm(e.Backup),this.mapBaseCmdToForm(e.Backup),this.#e.mapOptionsToForms(e.Backup)),this.#e.finishedLoading.set(!0)}})}mapStandardFieldsToForm(t){this.standardFields.patchValue({dbpath:t.DBPath,"backup-id":t.ID,"backup-name":t.Name}),t.Filters&&t.Filters.length&&t.Filters.map(e=>{this.standardFields.controls.filters.push(_.control(`${e.Include?"":"-"}${e.Expression}`))})}submit(){this.#a.resumeDialogCheck(()=>this.#l())}#l(){this.isSubmitting.set(!0);let t=this.baseCmdForm.value,e=t.targetUrl??"",s=t.arguments?.split(`
2
2
  `).filter(i=>i.length>0)??[],o=this.standardFields.value,c=o.filters??[],N=[t.command,e,...s,`--backup-name=${o["backup-name"]}`,`--dbpath=${o.dbpath}`,`--backup-id=${o["backup-id"]}`,...c.filter(i=>i).map(i=>i.startsWith("-")?`--exclude=${i?.slice(1)}`:`--include=${i}`),...this.#e.mapFormsToSettings(["backup-id","backup-name","dbpath"]).map(i=>`${i.Name.startsWith("--")?"":"--"}${i.Name}=${i.Value}`),"--disable-module=console-password-input"];this.#t.postApiV1Commandline({requestBody:N}).subscribe(i=>{i.Status==="OK"&&this.#n.navigate(["backup",this.backupId(),"commandline",i.ID])})}mapBaseCmdToForm(t){let e=t.TargetURL??null;e&&this.baseCmdForm.patchValue({targetUrl:e??"",arguments:t.Sources?.join(`
3
3
  `)??""})}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=R({type:l,selectors:[["app-commandline"]],features:[z([A])],decls:8,vars:1,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let e;e=$localize`Command`;let s;s=$localize`TargetUrl`;let o;o=$localize`Commandline Arguments`;let c;c=$localize`Advanced options`;let N;N=$localize`Backup ID`;let i;i=$localize`Backup Name`;let I;I=$localize`Filters`;let h;h=$localize` The backups will be split up into multiple files called volumes. Here you can set the maximum size of the individual volume files. ${"\uFFFD#32\uFFFD"}:START_LINK:Read more${"\uFFFD/#32\uFFFD"}:CLOSE_LINK:`;let L;return L=$localize`${"\uFFFD#37\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#37\uFFFD"}:CLOSE_TAG_SH_ICON: Run "${"\uFFFD0\uFFFD"}:INTERPOLATION:" command now `,[t,e,s,o,c,N,i,I,h,L,[1,"back"],["type","button","shButton","","routerLink","/",1,"small"],[1,"indeterminate","primary"],[3,"formGroup"],["placeholder","Select a command...",3,"options","inlineSearch"],["for","command"],["type","text","id","command","formControlName","command"],["for","targetUrl"],["id","targetUrl","autocomplete","off","formControlName","targetUrl"],["for","arguments"],["id","arguments","autocomplete","off","formControlName","arguments"],["for","backup-id"],["id","backup-id","formControlName","backup-id"],["for","backup-name"],["id","backup-name","formControlName","backup-name"],[3,"disallowToggle"],["title",""],["content","","formGroupName","filters"],["href","#",1,"sh-primary"],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","",1,"raised","primary",3,"click"],[3,"id","formControl"]]},template:function(e,s){e&1&&(r(0,"app-status-bar"),a(1,"section")(2,"div",10)(3,"button",11),g(4,0),r(5,"sh-icon"),E(),n()(),$(6,fe,1,0,"sh-progress-bar",12)(7,Oe,38,11),n()),e&2&&(m(6),b(s.finishedLoading()?7:6))},dependencies:[le,te,Y,Z,ee,Ee,Se,Me,se,ne,ie,ae,oe,Q,Ce,_e,de,ue,ce,me],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;max-width:40rem;padding:2.5rem;gap:1.25rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}"],changeDetection:0})};export{P as default};
@@ -0,0 +1 @@
1
+ import"./chunk-EUDKD2JW.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-DRNYRWHF.js")},{path:"destination",loadComponent:()=>import("./chunk-Z6M25FYI.js")},{path:"source-data",loadComponent:()=>import("./chunk-D4PLSKJA.js")},{path:"schedule",loadComponent:()=>import("./chunk-BB5RQS6P.js")},{path:"options",loadComponent:()=>import("./chunk-MGB2HZP6.js")}];export{o as default};
@@ -1 +1 @@
1
- import{a as _e}from"./chunk-E6H2XELA.js";import{a as le}from"./chunk-HHU5JW5J.js";import"./chunk-FSG362SU.js";import{h as ae}from"./chunk-C7EUC34O.js";import{b as oe,c as ie,d as se}from"./chunk-HYQ6MPYI.js";import"./chunk-YCORZV4Z.js";import"./chunk-4VY6SMSL.js";import"./chunk-Z27IQRKV.js";import"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import{b as W,d as V}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B as ee,G as ne,O as te,c as H,e as q,i as Y,k as j,s as Q,u as Z}from"./chunk-RPUPXDQE.js";import"./chunk-OJ3H3ZRA.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import{$b as p,Bc as U,Cb as m,Db as t,Eb as i,Fb as O,Mb as h,Qc as J,Sa as c,Tb as S,Ub as C,Vb as r,Xc as X,Zb as I,_ as g,cb as z,ea as N,fa as P,gc as v,hc as x,kc as K,pa as B,sc as u,tc as d,uc as T,xb as E,yb as f}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var re=["formRef"],ce=()=>["--skip-files-larger-than","dblock-size","encryption-module","no-encryption","--no-encryption","compression-module","--exclude-files-attributes","keep-time","keep-versions","retention-policy"];function pe(a,l){a&1&&(S(0,1,1),O(1,"sh-icon",20),C())}function ue(a,l){a&1&&(t(0,"p",21),r(1,6),i())}function de(a,l){a&1&&(t(0,"p"),r(1,7),i())}function Te(a,l){if(a&1){let n=h();t(0,"p"),r(1,8),i(),t(2,"app-timespan",18),T("ngModelChange",function(s){N(n);let o=p();return d(o.optionsFields.backupRetentionTime,s)||(o.optionsFields.backupRetentionTime=s),P(s)}),t(3,"label",30),r(4,9),i()()}if(a&2){let n=p();c(2),m("customId","backupRetentionTime"),u("ngModel",n.optionsFields.backupRetentionTime)}}function Se(a,l){if(a&1){let n=h();t(0,"p"),r(1,10),i(),t(2,"sh-form-field")(3,"label",31),r(4,11),i(),t(5,"input",32),T("ngModelChange",function(s){N(n);let o=p();return d(o.optionsFields.backupRetentionVersions,s)||(o.optionsFields.backupRetentionVersions=s),P(s)}),i()()}if(a&2){let n=p();c(5),u("ngModel",n.optionsFields.backupRetentionVersions)}}function Ce(a,l){a&1&&(t(0,"p"),r(1,12),i())}function me(a,l){if(a&1){let n=h();t(0,"p"),r(1,13),i(),t(2,"sh-form-field")(3,"p"),r(4,14),i(),t(5,"label",33),r(6,15),i(),t(7,"input",34),T("ngModelChange",function(s){N(n);let o=p();return d(o.optionsFields.backupRetentionCustom,s)||(o.optionsFields.backupRetentionCustom=s),P(s)}),i()()}if(a&2){let n=p();c(7),u("ngModel",n.optionsFields.backupRetentionCustom)}}var Oe=[{value:"all",name:$localize`Keep all backups`},{value:"time",name:$localize`Delete backups that are older than`},{value:"versions",name:$localize`Keep a specific number of backups`},{value:"smart",name:$localize`Smart backup retention`},{value:"custom",name:$localize`Custom backup retention`}],ge=1024*1024*1024*2,Ne=1024*1024*5,F=class a{#e=g(ae);#n=g(V);#t=g(W);formRef=X.required("formRef");isSubmitting=this.#e.isSubmitting;settings=this.#e.settings;optionsFields=this.#e.optionsFields;applicationOptions=this.#e.applicationOptions;retentionOptions=B(Oe);exceededVolumeSize=J(()=>{let{size:l,unit:n}=ie(this.optionsFields.remoteVolumeSize());if(l==null||n===null||n===void 0)return!1;let e=l*Math.pow(1024,oe.findIndex(s=>s.value===n));return e>ge||e<Ne});goBack(){this.#n.navigate(["schedule"],{relativeTo:this.#t.parent})}submit(){this.#e.submit()}static \u0275fac=function(n){return new(n||a)};static \u0275cmp=z({type:a,selectors:[["app-advanced-options-settings"]],viewQuery:function(n,e){n&1&&v(e.formRef,re,5),n&2&&x()},decls:30,vars:16,consts:()=>{let l;l=$localize`Options`;let n;n=$localize` Remote volume size ${"\uFFFD*7:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#1:1\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*7:1\uFFFD"}:CLOSE_BLOCK_IF:`;let e;e=$localize` The backups will be split up into multiple files called volumes. Here you can set the maximum size of the individual volume files. ${"\uFFFD#11\uFFFD"}:START_LINK: Read more ${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-square-out${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#11\uFFFD"}:CLOSE_LINK:`;let s;s=$localize`Backup retention`;let o;o=$localize`${"\uFFFD#26\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#26\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let M;M=$localize`${"\uFFFD#29\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#29\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `;let R;R=$localize` The chosen size is outside the recommended range. This may cause performance issues, excessively large temporary files or other problems. `;let A;A=$localize`Nothing will be deleted. The backup size will grow with each change.`;let b;b=$localize`If at least one newer backup is found, all backups older than this date are deleted.`;let y;y=$localize`Time to keep versions`;let $;$=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let k;k=$localize`Number of versions`;let L;L=$localize` Over time backups will be deleted automatically. There will remain one backup for each of the last 7 days, each of the last 4 weeks, each of the last 12 months. There will always be at least one remaining backup. `;let w;w=$localize` Enter a retention strategy manually. Placeholders are D/W/Y for days/weeks/years and U for unlimited. The syntax is: 7D:1D,4W:1W,36M:1M. This example keeps one backup for each of the next 7 days, one for each of the next 4 weeks, and one for each of the next 36 months. This can also be written as 1W:1D,1M:1W,3Y:1M. `;let G;G=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let D;return D=$localize`Retention expression`,[l,n,e,s,o,M,R,A,b,y,$,k,L,w,G,D,[1,"title-30"],[1,"remote-volume-wrap"],[3,"ngModelChange","customId","ngModel"],["for","size"],[1,"warning"],[1,"warn"],["href","https://forum.duplicati.com/t/choosing-sizes-in-duplicati/17683","target","_blank",1,"sh-primary"],["suffix",""],["value","value","label","name",3,"options","inlineSearch","isClearable"],["type","text",3,"ngModelChange","ngModel"],[3,"optionsChange","options","applicationOptions","hasFreeTextSettings","hiddenOptions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],["for","backupRetentionTime"],["for","backupRetentionVersions"],["type","number","id","backupRetentionVersions",3,"ngModelChange","ngModel"],["for","backupRetentionCustom"],["type","text","id","backupRetentionCustom",3,"ngModelChange","ngModel"]]},template:function(n,e){n&1&&(t(0,"section")(1,"h3",16),r(2,0),i(),t(3,"div",17)(4,"app-size",18),T("ngModelChange",function(o){return d(e.optionsFields.remoteVolumeSize,o)||(e.optionsFields.remoteVolumeSize=o),o}),t(5,"label",19),S(6,1),E(7,pe,2,0,"sh-icon",20),C(),i()(),E(8,ue,2,0,"p",21),t(9,"p"),S(10,2),t(11,"a",22),O(12,"sh-icon",23),i(),C(),i()(),t(13,"sh-select",24)(14,"label",19),r(15,3),i(),t(16,"input",25),T("ngModelChange",function(o){return d(e.optionsFields.backupRetention,o)||(e.optionsFields.backupRetention=o),o}),i()(),E(17,de,2,0,"p")(18,Te,5,2)(19,Se,6,1)(20,Ce,2,0,"p")(21,me,8,1),t(22,"app-options-list",26),T("optionsChange",function(o){return d(e.settings,o)||(e.settings=o),o}),i(),t(23,"div",27)(24,"button",28),I("click",function(){return e.goBack()}),S(25,4),O(26,"sh-icon"),C(),i(),t(27,"button",29),I("click",function(){return e.submit()}),S(28,5),O(29,"sh-icon"),C(),i()()()),n&2&&(c(4),m("customId","size"),u("ngModel",e.optionsFields.remoteVolumeSize),c(3),f(e.exceededVolumeSize()?7:-1),c(),f(e.exceededVolumeSize()?8:-1),c(5),m("options",e.retentionOptions())("inlineSearch",!0)("isClearable",!1),c(3),u("ngModel",e.optionsFields.backupRetention),c(),f(e.optionsFields.backupRetention()==="all"?17:e.optionsFields.backupRetention()==="time"?18:e.optionsFields.backupRetention()==="versions"?19:e.optionsFields.backupRetention()==="smart"?20:e.optionsFields.backupRetention()==="custom"?21:-1),c(5),u("options",e.settings),m("applicationOptions",e.applicationOptions())("hasFreeTextSettings",!0)("hiddenOptions",U(15,ce)),c(5),K("loader",e.isSubmitting()))},dependencies:[Q,H,j,q,Y,_e,se,le,ee,Z,te,ne],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.remote-volume-wrap[_ngcontent-%COMP%] p.warning[_ngcontent-%COMP%]{color:#7d7d00}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 2.5rem;align-items:flex-end}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}"],changeDetection:0})};export{F as default};
1
+ import{a as _e}from"./chunk-E6H2XELA.js";import{a as le}from"./chunk-HHU5JW5J.js";import"./chunk-FSG362SU.js";import{h as ae}from"./chunk-BNUMPQFL.js";import{b as oe,c as ie,d as se}from"./chunk-HYQ6MPYI.js";import"./chunk-YCORZV4Z.js";import"./chunk-4VY6SMSL.js";import"./chunk-Z27IQRKV.js";import"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import{b as W,d as V}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B as ee,G as ne,O as te,c as H,e as q,i as Y,k as j,s as Q,u as Z}from"./chunk-RPUPXDQE.js";import"./chunk-OJ3H3ZRA.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import{$b as p,Bc as U,Cb as m,Db as t,Eb as i,Fb as O,Mb as h,Qc as J,Sa as c,Tb as S,Ub as C,Vb as r,Xc as X,Zb as I,_ as g,cb as z,ea as N,fa as P,gc as v,hc as x,kc as K,pa as B,sc as u,tc as d,uc as T,xb as E,yb as f}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var re=["formRef"],ce=()=>["--skip-files-larger-than","dblock-size","encryption-module","no-encryption","--no-encryption","compression-module","--exclude-files-attributes","keep-time","keep-versions","retention-policy"];function pe(a,l){a&1&&(S(0,1,1),O(1,"sh-icon",20),C())}function ue(a,l){a&1&&(t(0,"p",21),r(1,6),i())}function de(a,l){a&1&&(t(0,"p"),r(1,7),i())}function Te(a,l){if(a&1){let n=h();t(0,"p"),r(1,8),i(),t(2,"app-timespan",18),T("ngModelChange",function(s){N(n);let o=p();return d(o.optionsFields.backupRetentionTime,s)||(o.optionsFields.backupRetentionTime=s),P(s)}),t(3,"label",30),r(4,9),i()()}if(a&2){let n=p();c(2),m("customId","backupRetentionTime"),u("ngModel",n.optionsFields.backupRetentionTime)}}function Se(a,l){if(a&1){let n=h();t(0,"p"),r(1,10),i(),t(2,"sh-form-field")(3,"label",31),r(4,11),i(),t(5,"input",32),T("ngModelChange",function(s){N(n);let o=p();return d(o.optionsFields.backupRetentionVersions,s)||(o.optionsFields.backupRetentionVersions=s),P(s)}),i()()}if(a&2){let n=p();c(5),u("ngModel",n.optionsFields.backupRetentionVersions)}}function Ce(a,l){a&1&&(t(0,"p"),r(1,12),i())}function me(a,l){if(a&1){let n=h();t(0,"p"),r(1,13),i(),t(2,"sh-form-field")(3,"p"),r(4,14),i(),t(5,"label",33),r(6,15),i(),t(7,"input",34),T("ngModelChange",function(s){N(n);let o=p();return d(o.optionsFields.backupRetentionCustom,s)||(o.optionsFields.backupRetentionCustom=s),P(s)}),i()()}if(a&2){let n=p();c(7),u("ngModel",n.optionsFields.backupRetentionCustom)}}var Oe=[{value:"all",name:$localize`Keep all backups`},{value:"time",name:$localize`Delete backups that are older than`},{value:"versions",name:$localize`Keep a specific number of backups`},{value:"smart",name:$localize`Smart backup retention`},{value:"custom",name:$localize`Custom backup retention`}],ge=1024*1024*1024*2,Ne=1024*1024*5,F=class a{#e=g(ae);#n=g(V);#t=g(W);formRef=X.required("formRef");isSubmitting=this.#e.isSubmitting;settings=this.#e.settings;optionsFields=this.#e.optionsFields;applicationOptions=this.#e.applicationOptions;retentionOptions=B(Oe);exceededVolumeSize=J(()=>{let{size:l,unit:n}=ie(this.optionsFields.remoteVolumeSize());if(l==null||n===null||n===void 0)return!1;let e=l*Math.pow(1024,oe.findIndex(s=>s.value===n));return e>ge||e<Ne});goBack(){this.#n.navigate(["schedule"],{relativeTo:this.#t.parent})}submit(){this.#e.submit()}static \u0275fac=function(n){return new(n||a)};static \u0275cmp=z({type:a,selectors:[["app-advanced-options-settings"]],viewQuery:function(n,e){n&1&&v(e.formRef,re,5),n&2&&x()},decls:30,vars:16,consts:()=>{let l;l=$localize`Options`;let n;n=$localize` Remote volume size ${"\uFFFD*7:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#1:1\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*7:1\uFFFD"}:CLOSE_BLOCK_IF:`;let e;e=$localize` The backups will be split up into multiple files called volumes. Here you can set the maximum size of the individual volume files. ${"\uFFFD#11\uFFFD"}:START_LINK: Read more ${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-square-out${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#11\uFFFD"}:CLOSE_LINK:`;let s;s=$localize`Backup retention`;let o;o=$localize`${"\uFFFD#26\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#26\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let M;M=$localize`${"\uFFFD#29\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#29\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `;let R;R=$localize` The chosen size is outside the recommended range. This may cause performance issues, excessively large temporary files or other problems. `;let A;A=$localize`Nothing will be deleted. The backup size will grow with each change.`;let b;b=$localize`If at least one newer backup is found, all backups older than this date are deleted.`;let y;y=$localize`Time to keep versions`;let $;$=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let k;k=$localize`Number of versions`;let L;L=$localize` Over time backups will be deleted automatically. There will remain one backup for each of the last 7 days, each of the last 4 weeks, each of the last 12 months. There will always be at least one remaining backup. `;let w;w=$localize` Enter a retention strategy manually. Placeholders are D/W/Y for days/weeks/years and U for unlimited. The syntax is: 7D:1D,4W:1W,36M:1M. This example keeps one backup for each of the next 7 days, one for each of the next 4 weeks, and one for each of the next 36 months. This can also be written as 1W:1D,1M:1W,3Y:1M. `;let G;G=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let D;return D=$localize`Retention expression`,[l,n,e,s,o,M,R,A,b,y,$,k,L,w,G,D,[1,"title-30"],[1,"remote-volume-wrap"],[3,"ngModelChange","customId","ngModel"],["for","size"],[1,"warning"],[1,"warn"],["href","https://forum.duplicati.com/t/choosing-sizes-in-duplicati/17683","target","_blank",1,"sh-primary"],["suffix",""],["value","value","label","name",3,"options","inlineSearch","isClearable"],["type","text",3,"ngModelChange","ngModel"],[3,"optionsChange","options","applicationOptions","hasFreeTextSettings","hiddenOptions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],["for","backupRetentionTime"],["for","backupRetentionVersions"],["type","number","id","backupRetentionVersions",3,"ngModelChange","ngModel"],["for","backupRetentionCustom"],["type","text","id","backupRetentionCustom",3,"ngModelChange","ngModel"]]},template:function(n,e){n&1&&(t(0,"section")(1,"h3",16),r(2,0),i(),t(3,"div",17)(4,"app-size",18),T("ngModelChange",function(o){return d(e.optionsFields.remoteVolumeSize,o)||(e.optionsFields.remoteVolumeSize=o),o}),t(5,"label",19),S(6,1),E(7,pe,2,0,"sh-icon",20),C(),i()(),E(8,ue,2,0,"p",21),t(9,"p"),S(10,2),t(11,"a",22),O(12,"sh-icon",23),i(),C(),i()(),t(13,"sh-select",24)(14,"label",19),r(15,3),i(),t(16,"input",25),T("ngModelChange",function(o){return d(e.optionsFields.backupRetention,o)||(e.optionsFields.backupRetention=o),o}),i()(),E(17,de,2,0,"p")(18,Te,5,2)(19,Se,6,1)(20,Ce,2,0,"p")(21,me,8,1),t(22,"app-options-list",26),T("optionsChange",function(o){return d(e.settings,o)||(e.settings=o),o}),i(),t(23,"div",27)(24,"button",28),I("click",function(){return e.goBack()}),S(25,4),O(26,"sh-icon"),C(),i(),t(27,"button",29),I("click",function(){return e.submit()}),S(28,5),O(29,"sh-icon"),C(),i()()()),n&2&&(c(4),m("customId","size"),u("ngModel",e.optionsFields.remoteVolumeSize),c(3),f(e.exceededVolumeSize()?7:-1),c(),f(e.exceededVolumeSize()?8:-1),c(5),m("options",e.retentionOptions())("inlineSearch",!0)("isClearable",!1),c(3),u("ngModel",e.optionsFields.backupRetention),c(),f(e.optionsFields.backupRetention()==="all"?17:e.optionsFields.backupRetention()==="time"?18:e.optionsFields.backupRetention()==="versions"?19:e.optionsFields.backupRetention()==="smart"?20:e.optionsFields.backupRetention()==="custom"?21:-1),c(5),u("options",e.settings),m("applicationOptions",e.applicationOptions())("hasFreeTextSettings",!0)("hiddenOptions",U(15,ce)),c(5),K("loader",e.isSubmitting()))},dependencies:[Q,H,j,q,Y,_e,se,le,ee,Z,te,ne],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.remote-volume-wrap[_ngcontent-%COMP%] p.warning[_ngcontent-%COMP%]{color:#7d7d00}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 2.5rem;align-items:flex-end}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}"],changeDetection:0})};export{F as default};
@@ -1,4 +1,4 @@
1
- import{a as ot}from"./chunk-HHU5JW5J.js";import{a as K,b as Ze,c as Ye,e as et}from"./chunk-FSG362SU.js";import{h as it}from"./chunk-C7EUC34O.js";import{a as tt,d as nt}from"./chunk-HYQ6MPYI.js";import{a as Qe}from"./chunk-MHPSC3FM.js";import{a as R}from"./chunk-3V4DGTSM.js";import{a as z}from"./chunk-5LX6M65H.js";import{B as Ce,G as Ke,J as Ue,K as Je,O as Xe,U as He,V as je,X as qe,a as Re,c as de,e as ce,i as pe,k as ke,s as me,t as Be,u as ue,z as ze}from"./chunk-RPUPXDQE.js";import{i as We}from"./chunk-OJ3H3ZRA.js";import{ea as Ge}from"./chunk-5ZSBXGHQ.js";import{$b as s,Ab as X,Ac as Le,Bb as H,Bc as Pe,Cb as m,Cc as se,Db as _,Eb as d,Ec as _e,Fb as ie,Jb as oe,Jc as q,Kb as j,Lb as ae,Mb as E,Qc as P,Rc as W,Sa as l,Tb as Ne,Ub as xe,V as te,Vb as De,Wc as Q,Xc as $e,Zb as x,Zc as be,_ as V,ac as we,bc as Oe,cb as ne,ea as S,f as ee,fa as h,gc as Ae,hb as G,hc as Me,ic as B,ja as ye,kc as re,nc as p,pa as b,pc as A,qc as le,sc as Ve,tc as Fe,uc as ve,vc as L,wc as O,xb as g,xc as c,yb as f,zb as J}from"./chunk-QONLYWYC.js";import{a as M,b as Y}from"./chunk-EUDKD2JW.js";var at=class n{#t=V(We);#e=V(ze);#n=V(z);testDestination(t,e,i,o,a){return this.#n.hasV2TestOperations()?this.testDestinationv2(t,e,i,o,a):this.testDestinationv1(t,e,i,o,a)}testDestinationv2(t,e,i,o,a){return new ee(r=>{this.#t.postApiV2DestinationTest({requestBody:{DestinationUrl:t,BackupId:e=="new"?null:e,AutoCreate:!1,Options:null}}).subscribe({next:u=>{if(u.Success){this.emitSuccessV2(r,t,i,u);return}this.handleGenericError(r,t,i,u.Error??"Unknown error",a)},error:u=>{let T=u?.error?.body;if(T?.Data?.FolderExists===!1||T?.StatusCode==="missing-folder"){o?this.handleMissingFolder(r,t,i):this.handleGenericError(r,t,i,$localize`The remote destination folder does not exist.`,a);return}if(T?.Data?.HostCertificate){this.handleMissingCertificate(r,t,i,T.Data?.HostCertificate);return}if(T?.Data?.ReportedHostKey){this.handleIncorrectKey(r,t,i,T.Data.ReportedHostKey,T.Data.AcceptedHostKey??null);return}this.handleGenericError(r,t,i,u?.message??"Unknown error",a)}})})}testDestinationv1(t,e,i,o,a){return new ee(r=>{this.#t.postApiV1RemoteoperationTest({requestBody:{path:t,backupId:e=="new"?null:e}}).subscribe({next:u=>{r.next({action:"success",targetUrl:t,testAgain:!1,destinationIndex:i}),r.complete()},error:u=>{this.handleDestinationErrorv1(u.message,t,i,o,a).subscribe(T=>{r.next(T)})}})})}handleMissingFolder(t,e,i){this.#e.open(R,{data:{title:$localize`Create folder`,message:$localize`The remote destination folder does not exist, do you want to create it?`,confirmText:$localize`Create folder`,cancelText:$localize`Cancel`},closed:o=>{if(!o){this.reportNoAction(t,e,i,$localize`The remote folder does not exist.`);return}this.#n.hasV2TestOperations()?this.#t.postApiV2DestinationTest({requestBody:{DestinationUrl:e,AutoCreate:!0,Options:null}}).subscribe({next:a=>{if(a.Success){this.emitSuccessV2(t,e,i,a);return}else this.handleFolderCreateFailure(t,e,i,a.Error??$localize`Unknown error`)},error:a=>{this.handleFolderCreateFailure(t,e,i,a.message??$localize`Unknown error`)}}):this.#t.postApiV1RemoteoperationCreate({requestBody:{path:e}}).subscribe({next:()=>{this.handleFolderCreated(t,e,i)},error:a=>{this.handleFolderCreateFailure(t,e,i,a.message??$localize`Unknown error`)}})}})}handleFolderCreateFailure(t,e,i,o){this.#e.open(R,{data:{title:$localize`Error creating folder`,message:$localize`The remote destination folder could not be created. ${o}`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:i}),t.complete()}})}emitSuccessV2(t,e,i,o){t.next({action:"success",targetUrl:e,testAgain:!1,destinationIndex:i,anyFilesFound:!o.Data?.FolderIsEmpty,containsBackup:o.Data?.FolderContainsBackupFiles??void 0,containsEncryptedBackupFiles:o.Data?.FolderContainsEncryptedBackupFiles??void 0}),t.complete()}handleFolderCreated(t,e,i){this.#e.open(R,{data:{title:$localize`Folder created`,message:$localize`The remote destination folder was created successfully.`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"test-again",targetUrl:e,testAgain:!0,destinationIndex:i}),t.complete()}})}reportNoAction(t,e,i,o){t.next({action:"generic-error",targetUrl:e,errorMessage:o,testAgain:!1,destinationIndex:i}),t.complete()}handleMissingCertificate(t,e,i,o){this.#e.open(R,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
1
+ import{a as ot}from"./chunk-HHU5JW5J.js";import{a as K,b as Ze,c as Ye,e as et}from"./chunk-FSG362SU.js";import{h as it}from"./chunk-BNUMPQFL.js";import{a as tt,d as nt}from"./chunk-HYQ6MPYI.js";import{a as Qe}from"./chunk-MHPSC3FM.js";import{a as R}from"./chunk-3V4DGTSM.js";import{a as z}from"./chunk-5LX6M65H.js";import{B as Ce,G as Ke,J as Ue,K as Je,O as Xe,U as He,V as je,X as qe,a as Re,c as de,e as ce,i as pe,k as ke,s as me,t as Be,u as ue,z as ze}from"./chunk-RPUPXDQE.js";import{i as We}from"./chunk-OJ3H3ZRA.js";import{ea as Ge}from"./chunk-5ZSBXGHQ.js";import{$b as s,Ab as X,Ac as Le,Bb as H,Bc as Pe,Cb as m,Cc as se,Db as _,Eb as d,Ec as _e,Fb as ie,Jb as oe,Jc as q,Kb as j,Lb as ae,Mb as E,Qc as P,Rc as W,Sa as l,Tb as Ne,Ub as xe,V as te,Vb as De,Wc as Q,Xc as $e,Zb as x,Zc as be,_ as V,ac as we,bc as Oe,cb as ne,ea as S,f as ee,fa as h,gc as Ae,hb as G,hc as Me,ic as B,ja as ye,kc as re,nc as p,pa as b,pc as A,qc as le,sc as Ve,tc as Fe,uc as ve,vc as L,wc as O,xb as g,xc as c,yb as f,zb as J}from"./chunk-QONLYWYC.js";import{a as M,b as Y}from"./chunk-EUDKD2JW.js";var at=class n{#t=V(We);#e=V(ze);#n=V(z);testDestination(t,e,i,o,a){return this.#n.hasV2TestOperations()?this.testDestinationv2(t,e,i,o,a):this.testDestinationv1(t,e,i,o,a)}testDestinationv2(t,e,i,o,a){return new ee(r=>{this.#t.postApiV2DestinationTest({requestBody:{DestinationUrl:t,BackupId:e=="new"?null:e,AutoCreate:!1,Options:null}}).subscribe({next:u=>{if(u.Success){this.emitSuccessV2(r,t,i,u);return}this.handleGenericError(r,t,i,u.Error??"Unknown error",a)},error:u=>{let T=u?.error?.body;if(T?.Data?.FolderExists===!1||T?.StatusCode==="missing-folder"){o?this.handleMissingFolder(r,t,i):this.handleGenericError(r,t,i,$localize`The remote destination folder does not exist.`,a);return}if(T?.Data?.HostCertificate){this.handleMissingCertificate(r,t,i,T.Data?.HostCertificate);return}if(T?.Data?.ReportedHostKey){this.handleIncorrectKey(r,t,i,T.Data.ReportedHostKey,T.Data.AcceptedHostKey??null);return}this.handleGenericError(r,t,i,u?.message??"Unknown error",a)}})})}testDestinationv1(t,e,i,o,a){return new ee(r=>{this.#t.postApiV1RemoteoperationTest({requestBody:{path:t,backupId:e=="new"?null:e}}).subscribe({next:u=>{r.next({action:"success",targetUrl:t,testAgain:!1,destinationIndex:i}),r.complete()},error:u=>{this.handleDestinationErrorv1(u.message,t,i,o,a).subscribe(T=>{r.next(T)})}})})}handleMissingFolder(t,e,i){this.#e.open(R,{data:{title:$localize`Create folder`,message:$localize`The remote destination folder does not exist, do you want to create it?`,confirmText:$localize`Create folder`,cancelText:$localize`Cancel`},closed:o=>{if(!o){this.reportNoAction(t,e,i,$localize`The remote folder does not exist.`);return}this.#n.hasV2TestOperations()?this.#t.postApiV2DestinationTest({requestBody:{DestinationUrl:e,AutoCreate:!0,Options:null}}).subscribe({next:a=>{if(a.Success){this.emitSuccessV2(t,e,i,a);return}else this.handleFolderCreateFailure(t,e,i,a.Error??$localize`Unknown error`)},error:a=>{this.handleFolderCreateFailure(t,e,i,a.message??$localize`Unknown error`)}}):this.#t.postApiV1RemoteoperationCreate({requestBody:{path:e}}).subscribe({next:()=>{this.handleFolderCreated(t,e,i)},error:a=>{this.handleFolderCreateFailure(t,e,i,a.message??$localize`Unknown error`)}})}})}handleFolderCreateFailure(t,e,i,o){this.#e.open(R,{data:{title:$localize`Error creating folder`,message:$localize`The remote destination folder could not be created. ${o}`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:i}),t.complete()}})}emitSuccessV2(t,e,i,o){t.next({action:"success",targetUrl:e,testAgain:!1,destinationIndex:i,anyFilesFound:!o.Data?.FolderIsEmpty,containsBackup:o.Data?.FolderContainsBackupFiles??void 0,containsEncryptedBackupFiles:o.Data?.FolderContainsEncryptedBackupFiles??void 0}),t.complete()}handleFolderCreated(t,e,i){this.#e.open(R,{data:{title:$localize`Folder created`,message:$localize`The remote destination folder was created successfully.`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"test-again",targetUrl:e,testAgain:!0,destinationIndex:i}),t.complete()}})}reportNoAction(t,e,i,o){t.next({action:"generic-error",targetUrl:e,errorMessage:o,testAgain:!1,destinationIndex:i}),t.complete()}handleMissingCertificate(t,e,i,o){this.#e.open(R,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
2
2
  If this is a self-signed certificate, you can choose to trust this certificate.
3
3
  The server reported the certificate hash: ${o}`,confirmText:$localize`Trust the certificate`,cancelText:$localize`Cancel`},closed:a=>{if(!a){this.reportNoAction(t,e,i,$localize`The server certificate is not trusted.`);return}t.next({action:"trust-cert",targetUrl:e,testAgain:!0,certData:o,destinationIndex:i}),t.complete()}})}handleIncorrectKey(t,e,i,o,a){a?this.#e.open(R,{maxWidth:"500px",data:{title:$localize`The host key has changed`,message:$localize`The host key has changed, please check with the server administrator if this is correct,
4
4
  otherwise you could be the victim of a MAN-IN-THE-MIDDLE attack.
@@ -0,0 +1 @@
1
+ import{a as W}from"./chunk-KXJZEADJ.js";import"./chunk-H7ZKBS2Q.js";import{a as H}from"./chunk-2YGOHGD2.js";import"./chunk-BK2MSH26.js";import"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import"./chunk-LN26XMBJ.js";import"./chunk-S4OFJD2F.js";import"./chunk-6XI3IP27.js";import{e as R}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B as m,C as g,F as w,K as z,u as C}from"./chunk-RPUPXDQE.js";import{i as j}from"./chunk-OJ3H3ZRA.js";import"./chunk-I2LW33GO.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-JYWOYPSQ.js";import{$b as d,Ab as x,Bb as G,Bc as u,Cb as E,Cc as X,Db as t,Eb as o,Fb as r,Jb as b,Kb as y,Sa as c,Tb as p,Ub as T,Vb as _,Wb as B,Xb as v,_ as S,cb as h,ib as I,nc as s,qc as J,sb as $,tb as L,xb as A,yb as k,zb as D}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var q=()=>[g,m,C,R],V=()=>["/restore-from-files"],K=()=>["/restore/from-config"],Q=n=>["/restore",n];function U(n,i){if(n&1&&(t(0,"sh-card",8),r(1,"img",13),t(2,"div",10)(3,"h3"),_(4,4),o(),t(5,"p"),s(6),o()(),t(7,"button",11),p(8,5),r(9,"sh-icon"),T(),o()()),n&2){let e=i.$implicit;E("routerLink",X(4,Q,e.Backup.ID)),c(4),B(e.Backup.Name??"Backup name missing"),v(4),c(2),J(" ",(e.Backup.Metadata==null?null:e.Backup.Metadata.SourceSizeString)??"-"," / ",(e.Backup.Metadata==null?null:e.Backup.Metadata.BackupListCount)??"-"," ")}}function Y(n,i){if(n&1&&x(0,U,10,6,"sh-card",8,D),n&2){let e=d(2);G(e.backups())}}function Z(n,i){n&1&&(b(0),_(1,6),y())}function ee(n,i){if(n&1&&A(0,Y,2,0)(1,Z,2,0,"ng-container"),n&2){let e=d();k(e.backups().length?0:1)}}function te(n,i){n&1&&(t(0,"div",14),r(1,"sh-progress-bar",15),t(2,"div",10)(3,"h3"),_(4,7),o()()())}var O=class n{#e=S(H);#t=S(j);backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;ngOnInit(){this.#e.getBackups(!0)}restoreNow(i){this.#t.postApiV1BackupByIdRestore({id:i.Backup?.ID,requestBody:{}})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=h({type:n,selectors:[["app-restore"]],decls:31,vars:5,consts:()=>{let i;i=$localize`Where do you want to restore from?`;let e;e=$localize`Restore from configuration`;let l;l=$localize`Load destination from an exported job`;let N;N=$localize` Start ${"\uFFFD#24\uFFFD"}:START_TAG_SH_ICON:play-circle${"\uFFFD/#24\uFFFD"}:CLOSE_TAG_SH_ICON:`;let f;f=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let P;P=$localize` Restore ${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON:`;let M;M=$localize`No backups founds`;let F;return F=$localize`Loading backups...`,[i,e,l,N,f,P,M,F,[1,"type-a","actionable",3,"routerLink"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["shButton",""],["src","assets/images/restore.png","alt","","width","48px"],["src","assets/images/folder.png","alt","","width","48px"],[1,"loading-list"],[1,"indeterminate","primary"]]},template:function(e,l){e&1&&(r(0,"app-status-bar"),t(1,"section")(2,"h2"),_(3,0),o(),t(4,"sh-card",8),r(5,"img",9),t(6,"div",10)(7,"h3"),s(8,"Direct restore from backup files"),o(),t(9,"p"),s(10,"Point to your backup files and restore from there."),o()(),t(11,"button",11),s(12," Start "),t(13,"sh-icon"),s(14,"play-circle"),o()()(),t(15,"sh-card",8),r(16,"img",12),t(17,"div",10)(18,"h3"),_(19,1),o(),t(20,"p"),_(21,2),o()(),t(22,"button",11),p(23,3),r(24,"sh-icon"),T(),o()(),t(25,"sh-divider"),s(26,"Or existing"),o(),I(27,ee,2,1)(28,te,5,0),$(29,27,q,null,28),o()),e&2&&(c(4),E("routerLink",u(3,V)),c(11),E("routerLink",u(4,K)),c(14),L(!l.backupsLoading()))},dependencies:[W,g,m,w,C,z,R],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 1rem;display:flex;flex-direction:column;gap:1rem}sh-divider[_ngcontent-%COMP%]{color:var(--base-8)}sh-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;--card-padding: 2rem}sh-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}.actionable[_ngcontent-%COMP%]{cursor:pointer}.actionable[_ngcontent-%COMP%]:after{transition:inset .1s linear}.actionable[_ngcontent-%COMP%]:hover{--card-shp: 0}"],changeDetection:0})};export{O as default};
@@ -1 +1 @@
1
- import{g as C}from"./chunk-F5Z5ZAIL.js";import"./chunk-E6H2XELA.js";import"./chunk-HHU5JW5J.js";import"./chunk-FSG362SU.js";import{a as w}from"./chunk-KXJZEADJ.js";import{h as k}from"./chunk-C7EUC34O.js";import"./chunk-HYQ6MPYI.js";import"./chunk-YCORZV4Z.js";import"./chunk-4VY6SMSL.js";import{b as u}from"./chunk-Z27IQRKV.js";import"./chunk-H7ZKBS2Q.js";import"./chunk-2YGOHGD2.js";import"./chunk-BK2MSH26.js";import"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import"./chunk-LN26XMBJ.js";import"./chunk-S4OFJD2F.js";import"./chunk-6XI3IP27.js";import{a as A,b as $,c as M,d as I,e as G,f as W}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{L as v,Q as y}from"./chunk-RPUPXDQE.js";import"./chunk-OJ3H3ZRA.js";import"./chunk-I2LW33GO.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-JYWOYPSQ.js";import{$b as O,Ac as N,Bc as R,Cb as _,Cc as p,Db as i,Eb as n,Fb as s,Rc as L,Sa as r,Tb as F,Ub as l,_ as c,cb as P,kc as D,pa as f,xb as E,yb as g}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var b=()=>["/restore-from-files/destination"],x=()=>["/restore-from-files/encryption"],H=()=>["/restore-from-files/select-files"],J=()=>["/restore-from-files/options"],X=t=>["/restore",t,"select-files"],z=t=>["/restore",t,"options"];function B(t,o){t&1&&(i(0,"div",7),F(1,0),s(2,"sh-radio"),l(),n(),i(3,"div",7),F(4,1),s(5,"sh-radio"),l(),n(),i(6,"div",7),F(7,2),s(8,"sh-radio"),l(),n(),i(9,"div",7),F(10,3),s(11,"sh-radio"),l(),n()),t&2&&(_("routerLink",R(4,b)),r(3),_("routerLink",R(5,x)),r(3),_("routerLink",R(6,H)),r(3),_("routerLink",R(7,J)))}function U(t,o){if(t&1&&(i(0,"div",7),F(1,4),s(2,"sh-radio"),l(),n(),i(3,"div",7),F(4,5),s(5,"sh-radio"),l(),n()),t&2){let e=O(2);_("routerLink",p(2,X,e.backupId())),r(3),_("routerLink",p(4,z,e.backupId()))}}function j(t,o){if(t&1&&(i(0,"sh-stepper",6),E(1,B,12,8)(2,U,6,6),n()),t&2){let e=O();r(),g(e.isFileRestore()?1:2)}}var h=class t{#e=c($);#o=c(I);#t=c(C);#i=u(this.#e.params);#n=u(this.#e.url);#s=u(this.#e.children[0].url);backupId=this.#t.backupId;isFileRestore=this.#t.isFileRestore;isProgressPage=f(!1);paramsChanged=L(()=>{let o=this.#s(),e=this.#i()?.id,a=!!this.#n()?.find(S=>S.path==="restore-from-files"),T=!!o?.find(S=>S.path==="progress");this.isProgressPage.set(T),this.#t.init(e,a)});ngOnInit(){this.#o.events.subscribe(o=>{if(o instanceof A){let e=o.urlAfterRedirects;this.isProgressPage.set(e.includes("progress"))}})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=P({type:t,selectors:[["app-restore-flow"]],hostVars:2,hostBindings:function(e,a){e&2&&D("full-width",a.isProgressPage())},features:[N([C,k])],decls:4,vars:1,consts:()=>{let o;o=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_RADIO: Destination `;let e;e=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_RADIO: Encryption `;let a;a=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SH_RADIO: Select files `;let T;T=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `;let S;S=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_RADIO: Select files `;let m;return m=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `,[o,e,a,T,S,m,[1,"primary"],["step","","routerLinkActive","active",3,"routerLink"]]},template:function(e,a){e&1&&(s(0,"app-status-bar"),E(1,j,3,1,"sh-stepper",6),i(2,"section"),s(3,"router-outlet"),n()),e&2&&(r(),g(a.isProgressPage()?-1:1))},dependencies:[y,v,w,M,G,W],styles:["[_nghost-%COMP%]{display:block}.full-width[_nghost-%COMP%] section[_ngcontent-%COMP%]{max-width:62.5rem}sh-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{h as default};
1
+ import{g as C}from"./chunk-F5Z5ZAIL.js";import"./chunk-E6H2XELA.js";import"./chunk-HHU5JW5J.js";import"./chunk-FSG362SU.js";import{a as w}from"./chunk-KXJZEADJ.js";import{h as k}from"./chunk-BNUMPQFL.js";import"./chunk-HYQ6MPYI.js";import"./chunk-YCORZV4Z.js";import"./chunk-4VY6SMSL.js";import{b as u}from"./chunk-Z27IQRKV.js";import"./chunk-H7ZKBS2Q.js";import"./chunk-2YGOHGD2.js";import"./chunk-BK2MSH26.js";import"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import"./chunk-LN26XMBJ.js";import"./chunk-S4OFJD2F.js";import"./chunk-6XI3IP27.js";import{a as A,b as $,c as M,d as I,e as G,f as W}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{L as v,Q as y}from"./chunk-RPUPXDQE.js";import"./chunk-OJ3H3ZRA.js";import"./chunk-I2LW33GO.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-JYWOYPSQ.js";import{$b as O,Ac as N,Bc as R,Cb as _,Cc as p,Db as i,Eb as n,Fb as s,Rc as L,Sa as r,Tb as F,Ub as l,_ as c,cb as P,kc as D,pa as f,xb as E,yb as g}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var b=()=>["/restore-from-files/destination"],x=()=>["/restore-from-files/encryption"],H=()=>["/restore-from-files/select-files"],J=()=>["/restore-from-files/options"],X=t=>["/restore",t,"select-files"],z=t=>["/restore",t,"options"];function B(t,o){t&1&&(i(0,"div",7),F(1,0),s(2,"sh-radio"),l(),n(),i(3,"div",7),F(4,1),s(5,"sh-radio"),l(),n(),i(6,"div",7),F(7,2),s(8,"sh-radio"),l(),n(),i(9,"div",7),F(10,3),s(11,"sh-radio"),l(),n()),t&2&&(_("routerLink",R(4,b)),r(3),_("routerLink",R(5,x)),r(3),_("routerLink",R(6,H)),r(3),_("routerLink",R(7,J)))}function U(t,o){if(t&1&&(i(0,"div",7),F(1,4),s(2,"sh-radio"),l(),n(),i(3,"div",7),F(4,5),s(5,"sh-radio"),l(),n()),t&2){let e=O(2);_("routerLink",p(2,X,e.backupId())),r(3),_("routerLink",p(4,z,e.backupId()))}}function j(t,o){if(t&1&&(i(0,"sh-stepper",6),E(1,B,12,8)(2,U,6,6),n()),t&2){let e=O();r(),g(e.isFileRestore()?1:2)}}var h=class t{#e=c($);#o=c(I);#t=c(C);#i=u(this.#e.params);#n=u(this.#e.url);#s=u(this.#e.children[0].url);backupId=this.#t.backupId;isFileRestore=this.#t.isFileRestore;isProgressPage=f(!1);paramsChanged=L(()=>{let o=this.#s(),e=this.#i()?.id,a=!!this.#n()?.find(S=>S.path==="restore-from-files"),T=!!o?.find(S=>S.path==="progress");this.isProgressPage.set(T),this.#t.init(e,a)});ngOnInit(){this.#o.events.subscribe(o=>{if(o instanceof A){let e=o.urlAfterRedirects;this.isProgressPage.set(e.includes("progress"))}})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=P({type:t,selectors:[["app-restore-flow"]],hostVars:2,hostBindings:function(e,a){e&2&&D("full-width",a.isProgressPage())},features:[N([C,k])],decls:4,vars:1,consts:()=>{let o;o=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_RADIO: Destination `;let e;e=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_RADIO: Encryption `;let a;a=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SH_RADIO: Select files `;let T;T=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `;let S;S=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_RADIO: Select files `;let m;return m=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `,[o,e,a,T,S,m,[1,"primary"],["step","","routerLinkActive","active",3,"routerLink"]]},template:function(e,a){e&1&&(s(0,"app-status-bar"),E(1,j,3,1,"sh-stepper",6),i(2,"section"),s(3,"router-outlet"),n()),e&2&&(r(),g(a.isProgressPage()?-1:1))},dependencies:[y,v,w,M,G,W],styles:["[_nghost-%COMP%]{display:block}.full-width[_nghost-%COMP%] section[_ngcontent-%COMP%]{max-width:62.5rem}sh-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{h as default};
@@ -0,0 +1 @@
1
+ import{a as Y,f as _n}from"./chunk-FSG362SU.js";import{a as an}from"./chunk-KXJZEADJ.js";import{a as on}from"./chunk-H7ZKBS2Q.js";import{a as tn}from"./chunk-2YGOHGD2.js";import"./chunk-BK2MSH26.js";import"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import"./chunk-LN26XMBJ.js";import{a as nn}from"./chunk-S4OFJD2F.js";import"./chunk-6XI3IP27.js";import{e as we}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{A as Ve,B as Ue,C as je,E as Ke,F as We,J as qe,K as Qe,R as Ye,S as Ze,u as ze}from"./chunk-RPUPXDQE.js";import{i as en}from"./chunk-OJ3H3ZRA.js";import"./chunk-I2LW33GO.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-JYWOYPSQ.js";import{$b as u,Ab as w,Bb as z,Bc as q,Cb as d,Cc as D,Db as o,Eb as t,Fb as T,Fc as M,Gc as G,H as j,Hc as $,Jb as O,Jc as Q,Kb as N,Lb as f,Mb as H,Pa as K,Rc as Je,Sa as a,Tb as r,Ub as c,Vb as E,Wb as A,Xb as h,Yb as W,Zb as R,_ as v,cb as xe,ea as P,fa as I,hb as m,ib as ke,ic as V,kc as L,nc as s,pa as X,pc as S,sb as ye,sc as be,tb as Be,tc as ve,uc as Xe,xb as g,yb as p,zb as J}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var rn=()=>[import("./chunk-SR4YENFS.js").then(e=>e.NgTemplateOutlet),Ke,Ze,Ye,import("./chunk-WNJSKJGQ.js").then(e=>e.DurationFormatPipe),import("./chunk-FIOBQPE7.js").then(e=>e.BytesPipe),import("./chunk-M7QQEZOU.js").then(e=>e.RelativeTimePipe)],cn=()=>["/add-backup"],sn=()=>["/restore"],ln=e=>({$implicit:e}),un=e=>["/backup",e],Fn=e=>["/restore",e],Cn=e=>["/backup",e,"export"],Tn=e=>["/backup",e,"delete"],En=e=>["/backup",e,"database"],dn=e=>["/backup",e,"commandline"],gn=e=>["/backup",e,"log"];function pn(e,i){if(e&1){let n=H();o(0,"button",54),R("click",function(){let F=P(n).$implicit,C=u(2);return I(C.sortByColumn.set(F.value))}),E(1,15),t()}if(e&2){let n=i.$implicit,_=u(2);L("active",_.orderBy()===n.value),a(),A(n.label),h(1)}}function Sn(e,i){if(e&1&&(o(0,"sh-menu",55)(1,"button",56),r(2,14),T(3,"strong")(4,"sh-icon"),c(),t(),O(5,57),w(6,pn,2,3,"button",58,J),N(),t()),e&2){let n=u();a(4),A(n.orderBy()),h(2),a(2),z(n.sortOrderOptions())}}function On(e,i){if(e&1&&(o(0,"p")(1,"span"),E(2,21),t(),s(3),M(4,"relativeTime"),t()),e&2){let n=u().$implicit,_=u(4);a(3),S(" ",$(4,1,n.Schedule.Time,_.timeType()==="actual")," ")}}function Nn(e,i){if(e&1&&(s(0),M(1,"durationFormat")),e&2){let n=u().$implicit,_=u(4);S(" ",$(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDuration,_.timeType()==="actual")," ")}}function mn(e,i){e&1&&(O(0),s(1,"-"),N())}function Mn(e,i){if(e&1&&(s(0),M(1,"bytes")),e&2){let n=u().$implicit;S(" ",G(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.SourceFilesSize)," ")}}function Pn(e,i){e&1&&(O(0),s(1,"-"),N())}function In(e,i){if(e&1&&(s(0),M(1,"bytes")),e&2){let n=u().$implicit;S(" ",G(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.TargetFilesSize)," ")}}function fn(e,i){e&1&&(O(0),s(1,"-"),N())}function Dn(e,i){e&1&&(o(0,"sh-chip",65),E(1,22),t())}function Rn(e,i){e&1&&f(0)}function $n(e,i){if(e&1&&(o(0,"div",61)(1,"div",48)(2,"h3"),s(3),o(4,"sh-chip"),T(5,"img",62),s(6),t()(),o(7,"p")(8,"span"),E(9,16),t(),s(10),M(11,"relativeTime"),t(),g(12,On,5,4,"p"),o(13,"p")(14,"span"),E(15,17),t(),g(16,Nn,2,4)(17,mn,2,0,"ng-container"),t(),o(18,"p")(19,"span"),E(20,18),t(),g(21,Mn,2,3)(22,Pn,2,0,"ng-container"),t(),o(23,"p")(24,"span"),E(25,19),t(),g(26,In,2,3)(27,fn,2,0,"ng-container"),t()(),o(28,"div",63)(29,"sh-chip",64),E(30,20),t(),g(31,Dn,2,0,"sh-chip",65),t(),o(32,"div",52),m(33,Rn,1,0,"ng-container",66),t()()),e&2){let n=i.$implicit,_=u(4),F=V(51);a(3),S(" ",n.Backup.Name??_.MISSING_BACKUP_NAME," "),a(2),d("src",_.getBackendIcon(n.Backup.TargetURL),K),a(),S(" ",_.getBackendType(n.Backup.TargetURL)," "),a(4),S(" ",$(11,13,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupFinished,_.timeType()==="actual")," "),a(2),p(!(n==null||n.Schedule==null)&&n.Schedule.Time?12:-1),a(4),p(n.Backup.Metadata!=null&&n.Backup.Metadata.LastBackupDuration?16:17),a(5),p(n.Backup.Metadata!=null&&n.Backup.Metadata.SourceFilesSize?21:22),a(5),p(n.Backup.Metadata!=null&&n.Backup.Metadata.TargetFilesSize?26:27);let C=_.getBackupVersionCount(n);a(4),A(C)(C),h(30),a(),p(n.Backup.ExternalID?31:-1),a(2),d("ngTemplateOutlet",F)("ngTemplateOutletContext",D(16,ln,n))}}function An(e,i){if(e&1&&w(0,$n,34,18,"div",61,J),e&2){let n=u(3);z(n.backups())}}function hn(e,i){e&1&&(O(0),E(1,23),N())}function Ln(e,i){if(e&1&&(o(0,"div",59),g(1,An,2,0)(2,hn,2,0,"ng-container"),t()),e&2){let n=u(2);a(),p(n.backups().length?1:2)}}function Hn(e,i){e&1&&(r(0,24,1),f(1),c())}function Gn(e,i){e&1&&(r(0,25,1),f(1),c())}function xn(e,i){e&1&&(r(0,26,1),f(1),c())}function kn(e,i){e&1&&(r(0,27,1),f(1),c())}function yn(e,i){e&1&&(r(0,28,1),f(1),c())}function Bn(e,i){e&1&&(r(0,29,1),f(1),c())}function bn(e,i){e&1&&(r(0,30,1),f(1),c())}function vn(e,i){if(e&1&&(s(0),M(1,"relativeTime")),e&2){let n=u().$implicit,_=u(3);S(" ",$(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDate,_.timeType()==="actual")," ")}}function Xn(e,i){e&1&&(O(0),s(1,"-"),N())}function Jn(e,i){if(e&1&&(s(0),M(1,"relativeTime")),e&2){let n=u().$implicit,_=u(3);S(" ",$(1,1,n.Schedule.Time,_.timeType()==="actual")," ")}}function wn(e,i){e&1&&(O(0),s(1,"-"),N())}function zn(e,i){if(e&1&&(s(0),M(1,"durationFormat")),e&2){let n=u().$implicit,_=u(3);S(" ",$(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDuration,_.timeType()==="actual")," ")}}function Vn(e,i){e&1&&(O(0),s(1,"-"),N())}function Un(e,i){if(e&1&&(s(0),M(1,"bytes")),e&2){let n=u().$implicit;S(" ",G(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.SourceFilesSize)," ")}}function jn(e,i){e&1&&(O(0),s(1,"-"),N())}function Kn(e,i){if(e&1&&(s(0),M(1,"bytes")),e&2){let n=u().$implicit;S(" ",G(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.TargetFilesSize)," ")}}function Wn(e,i){e&1&&(O(0),s(1,"-"),N())}function qn(e,i){e&1&&f(0)}function Qn(e,i){if(e&1&&(o(0,"tr")(1,"td"),s(2),t(),o(3,"td")(4,"sh-chip",53),T(5,"img",62),s(6),t()(),o(7,"td"),g(8,vn,2,4)(9,Xn,2,0,"ng-container"),t(),o(10,"td"),g(11,Jn,2,4)(12,wn,2,0,"ng-container"),t(),o(13,"td"),g(14,zn,2,4)(15,Vn,2,0,"ng-container"),t(),o(16,"td"),g(17,Un,2,3)(18,jn,2,0,"ng-container"),t(),o(19,"td"),g(20,Kn,2,3)(21,Wn,2,0,"ng-container"),t(),o(22,"td")(23,"span"),E(24,33),t()(),o(25,"td"),m(26,qn,1,0,"ng-container",66),t()()),e&2){let n=i.$implicit,_=u(3),F=V(51);a(2),S(" ",n.Backup.Name??_.MISSING_BACKUP_NAME," "),a(3),d("src",_.getBackendIcon(n.Backup.TargetURL),K),a(),S(" ",_.getBackendType(n.Backup.TargetURL)," "),a(2),p(n.Backup.Metadata!=null&&n.Backup.Metadata.LastBackupDate?8:9),a(3),p(!(n==null||n.Schedule==null)&&n.Schedule.Time?11:12),a(3),p(n.Backup.Metadata!=null&&n.Backup.Metadata.LastBackupDuration?14:15),a(3),p(n.Backup.Metadata!=null&&n.Backup.Metadata.SourceFilesSize?17:18),a(3),p(n.Backup.Metadata!=null&&n.Backup.Metadata.TargetFilesSize?20:21);let C=_.getBackupVersionCount(n);a(4),A(C)(C),h(24),a(2),d("ngTemplateOutlet",F)("ngTemplateOutletContext",D(12,ln,n))}}function Yn(e,i){if(e&1){let n=H();o(0,"sh-table",67),Xe("sortByColumnChange",function(F){P(n);let C=u(2);return ve(C.sortByColumn,F)||(C.sortByColumn=F),I(F)}),o(1,"tr",68)(2,"th",69),r(3,24),m(4,Hn,2,0,"ng-container",70),c(),t(),o(5,"th",71),r(6,25),m(7,Gn,2,0,"ng-container",70),c(),t(),o(8,"th",72),r(9,26),m(10,xn,2,0,"ng-container",70),c(),t(),o(11,"th",73),r(12,27),m(13,kn,2,0,"ng-container",70),c(),t(),o(14,"th",74),r(15,28),m(16,yn,2,0,"ng-container",70),c(),t(),o(17,"th",75),r(18,29),m(19,Bn,2,0,"ng-container",70),c(),t(),o(20,"th",76),r(21,30),m(22,bn,2,0,"ng-container",70),c(),t(),o(23,"th"),E(24,31),t(),o(25,"th"),E(26,32),t()(),w(27,Qn,27,14,"tr",null,J),t()}if(e&2){let n=u(2),_=V(53);d("data",n.backups())("loading",n.backupsLoading()),be("sortByColumn",n.sortByColumn),a(4),d("ngTemplateOutlet",_),a(3),d("ngTemplateOutlet",_),a(3),d("ngTemplateOutlet",_),a(3),d("ngTemplateOutlet",_),a(3),d("ngTemplateOutlet",_),a(3),d("ngTemplateOutlet",_),a(3),d("ngTemplateOutlet",_),a(5),z(n.backups())}}function Zn(e,i){if(e&1&&g(0,Ln,3,1,"div",59)(1,Yn,29,10,"sh-table",60),e&2){let n=u();p(n.viewMode()==="list"?0:n.viewMode()==="details"?1:-1)}}function et(e,i){e&1&&(o(0,"div",77),T(1,"sh-progress-bar",78),o(2,"div",48)(3,"h3"),E(4,34),t()()())}function nt(e,i){e&1&&E(0,35,1)}function tt(e,i){e&1&&(o(0,"sh-icon"),s(1,"check"),t())}function it(e,i){e&1&&(o(0,"sh-icon"),s(1,"dots-three-vertical"),t())}function ot(e,i){if(e&1){let n=H();o(0,"button",79),R("click",function(){let F=P(n).$implicit,C=u();return I(C.startBackup(F.Backup.ID))}),r(1,35),T(2,"sh-icon"),g(3,nt,1,0),c(),t(),o(4,"button",80)(5,"sh-icon"),s(6,"pencil-simple"),t()(),o(7,"sh-menu")(8,"button",49),g(9,tt,2,0,"sh-icon")(10,it,2,0,"sh-icon"),t(),O(11,57),o(12,"h3",81),s(13,"Operations"),t(),o(14,"button",82),r(15,36),T(16,"sh-icon"),c(),t(),o(17,"button",82),r(18,37),T(19,"sh-icon"),c(),t(),o(20,"button",82),r(21,38),T(22,"sh-icon"),c(),t(),T(23,"sh-divider"),o(24,"h3",81),E(25,39),t(),o(26,"button",82),r(27,40),T(28,"sh-icon"),c(),t(),o(29,"button",54),R("click",function(){let F=P(n).$implicit,C=u();return I(C.verifyFiles(F.Backup.ID))}),r(30,41),T(31,"sh-icon"),c(),t(),o(32,"button",54),R("click",function(){let F=P(n).$implicit,C=u();return I(C.compressBackup(F.Backup.ID))}),r(33,42),T(34,"sh-icon"),c(),t(),o(35,"button",82),r(36,43),T(37,"sh-icon"),c(),t(),T(38,"sh-divider"),o(39,"h3",81),E(40,44),t(),o(41,"button",82),r(42,45),T(43,"sh-icon"),c(),t(),N(),t()}if(e&2){let n=i.$implicit,_=u();L("loader",_.startingBackup()===n.Backup.ID),a(3),p(_.viewMode()==="list"?3:-1),a(),d("routerLink",D(15,un,n.Backup.ID)),a(4),L("loader",_.loadingId()===n.Backup.ID)("success",_.successId()===n.Backup.ID),a(),p(_.successId()===n.Backup.ID?9:10),a(5),d("routerLink",D(17,Fn,n.Backup.ID)),a(3),d("routerLink",D(19,Cn,n.Backup.ID)),a(3),d("routerLink",D(21,Tn,n.Backup.ID)),a(6),d("routerLink",D(23,En,n.Backup.ID)),a(9),d("routerLink",D(25,dn,n.Backup.ID)),a(6),d("routerLink",D(27,gn,n.Backup.ID))}}function _t(e,i){e&1&&(o(0,"sh-icon",83),s(1,"funnel-simple"),t(),o(2,"sh-icon",84),s(3,"sort-ascending"),t(),o(4,"sh-icon",85),s(5,"sort-descending"),t())}var at={file:{Display:$localize`Local`,Icon:null}},Z=class e{#n=v(en);#t=v(on);#e=v(tn);MISSING_BACKUP_NAME=$localize`Backup name missing`;sortOrderOptions=this.#e.orderByOptions;orderBy=this.#e.orderBy;backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;startingBackup=this.#e.startingBackup;deletingBackup=this.#e.deletingBackup;timeType=this.#e.timeType;viewMode=nn("viewMode","list");sortByColumn=X(this.#e.orderBy());loadingId=X(null);successId=X(null);sortEffect=Je(()=>this.#e.setOrderBy(this.sortByColumn()));ngOnInit(){this.#e.getBackups(!0)}setOrderBy(i){this.#e.setOrderBy(i)}setTimeType(i){this.#e.setTimeType(i)}startBackup(i){this.#t.resumeDialogCheck(()=>this.#e.startBackup(i))}getBackendIcon(i){if(!i)return"";let n=i.split("://")[0];return Y(n).icon??"database"}getBackendType(i){if(!i)return"";let n=i.split("://")[0],_=Y(n);if(!_)return"";let F=at[_.key];if(F?.Display)return F.Display;if(_.key==="s3"){let C="http://null?"+i.split("?")[1],x=new URL(C).searchParams.get("s3-server-name")?.toLowerCase()??"";for(let[k,y]of Object.entries(_n))if(x.endsWith(k))return y}return _.displayName}getBackupVersionCount(i){return parseInt(i?.Backup?.Metadata?.BackupListCount??"",10)||0}verifyFiles(i){this.loadingId.set(i),this.#n.postApiV1BackupByIdVerify({id:i}).pipe(j(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(i),setTimeout(()=>this.successId.set(null),2e3)}})}compressBackup(i){this.loadingId.set(i),this.#n.postApiV1BackupByIdCompact({id:i}).pipe(j(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(i),setTimeout(()=>this.successId.set(null),2e3)}})}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=xe({type:e,selectors:[["app-home"]],decls:54,vars:11,consts:()=>{let i;i=$localize`Backups`;let n;n=$localize`Backups are stored in the cloud and can be restored at any time.`;let _;_=$localize` Add ${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON:`;let F;F=$localize`Restores`;let C;C=$localize`Restores allow you to restore your data from the cloud.`;let U;U=$localize` Start ${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON:`;let x;x=$localize`My backups`;let k;k=$localize`${"\uFFFD#31\uFFFD"}:START_TAG_SH_ICON:rows${"\uFFFD/#31\uFFFD"}:CLOSE_TAG_SH_ICON: List `;let y;y=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SH_ICON:list${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SH_ICON: Details `;let ee;ee=$localize` Time: ${"\uFFFD#38\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#39\uFFFD"}:START_TAG_SH_ICON:clock${"\uFFFD/#39\uFFFD"}:CLOSE_TAG_SH_ICON:`;let ne;ne=$localize`Relative time`;let te;te=$localize`Actual time`;let ie;ie=$localize` Order by: ${"\uFFFD#3\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:arrows-down-up${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let oe;oe=$localize` ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let _e;_e=$localize`Last successful backup:`;let ae;ae=$localize`Duration:`;let le;le=$localize`Source:`;let re;re=$localize`Destination:`;let B;B=$localize`{VAR_PLURAL, plural, =0 {No version yet} =1 {1 Version} other {{INTERPOLATION} Versions}}`,B=W(B,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let ce;ce=$localize` ${B}:ICU@@6502601490918455200: `;let se;se=$localize`Next scheduled run:`;let ue;ue=$localize`Externally managed`;let Fe;Fe=$localize`No backups founds`;let Ce;Ce=$localize` Backup ${"\uFFFD*4:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*4:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Te;Te=$localize` Type ${"\uFFFD*7:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*7:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Ee;Ee=$localize` Last backup ${"\uFFFD*10:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*10:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let de;de=$localize` Next run ${"\uFFFD*13:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*13:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let ge;ge=$localize` Duration ${"\uFFFD*16:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*16:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let pe;pe=$localize` Source ${"\uFFFD*19:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*19:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Se;Se=$localize` Destination ${"\uFFFD*22:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*22:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Oe;Oe=$localize`Version`;let Ne;Ne=$localize`Actions`;let b;b=$localize`{VAR_PLURAL, plural, =0 {No versions} =1 {1 Version} other {{INTERPOLATION} Versions}}`,b=W(b,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let me;me=$localize` ${b}:ICU@@3521773141017690117: `;let Me;Me=$localize`Loading backups...`;let Pe;Pe=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:play-circle${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD*3:1\uFFFD"}:START_BLOCK_IF: Start ${"\uFFFD/*3:1\uFFFD"}:CLOSE_BLOCK_IF:`;let Ie;Ie=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:clock-counter-clockwise${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: Restore `;let fe;fe=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:export${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Export `;let De;De=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON: Delete `;let Re;Re=$localize`Advanced`;let $e;$e=$localize`${"\uFFFD#28\uFFFD"}:START_TAG_SH_ICON:database${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SH_ICON: Database `;let Ae;Ae=$localize`${"\uFFFD#31\uFFFD"}:START_TAG_SH_ICON:check-square-offset${"\uFFFD/#31\uFFFD"}:CLOSE_TAG_SH_ICON: Verify files `;let he;he=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SH_ICON:file-archive${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SH_ICON: Compress now `;let Le;Le=$localize`${"\uFFFD#37\uFFFD"}:START_TAG_SH_ICON:terminal-window${"\uFFFD/#37\uFFFD"}:CLOSE_TAG_SH_ICON: Commandline `;let He;He=$localize`Reporting`;let Ge;return Ge=$localize`${"\uFFFD#43\uFFFD"}:START_TAG_SH_ICON:notepad${"\uFFFD/#43\uFFFD"}:CLOSE_TAG_SH_ICON: Log `,[["actions",""],["sortIcons",""],i,n,_,F,C,U,x,k,y,ee,ne,te,ie,oe,_e,ae,le,re,ce,se,ue,Fe,Ce,Te,Ee,de,ge,pe,Se,Oe,Ne,me,Me,Pe,Ie,fe,De,Re,$e,Ae,he,Le,He,Ge,[1,"type-a","actionable",3,"routerLink"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["type","button","shButton",""],["src","assets/images/restore.png","alt","","width","48px"],[1,"content"],[1,"actions"],[1,"small"],["type","button",3,"click"],[1,"table-overview"],["type","button","shButton","",1,"small"],["menu",""],["type","button",3,"active"],[1,"backups"],[1,"type-b",3,"data","loading","sortByColumn"],[1,"backup"],["alt","",1,"provider-icon",3,"src"],[1,"tags"],[1,"simple","success"],[1,"simple","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"type-b",3,"sortByColumnChange","data","loading","sortByColumn"],["table-header",""],["shSort","name"],[4,"ngTemplateOutlet"],["shSort","type"],["shSort","lastrun"],["shSort","nextrun"],["shSort","duration"],["shSort","sourcesize"],["shSort","destinationsize"],[1,"loading-list"],[1,"indeterminate","primary"],["shButton","",3,"click"],["type","button","shButton","",3,"routerLink"],["title",""],["type","button",3,"routerLink"],[1,"filter"],[1,"asc"],[1,"desc"]]},template:function(n,_){if(n&1){let F=H();T(0,"app-status-bar"),o(1,"section")(2,"header")(3,"sh-card",46),T(4,"img",47),o(5,"div",48)(6,"h3"),E(7,2),t(),o(8,"p"),E(9,3),t()(),o(10,"button",49),r(11,4),T(12,"sh-icon"),c(),t()(),o(13,"sh-card",46),T(14,"img",50),o(15,"div",48)(16,"h3"),E(17,5),t(),o(18,"p"),E(19,6),t()(),o(20,"button",49),r(21,7),T(22,"sh-icon"),c(),t()()(),o(23,"div",51)(24,"h2"),O(25),E(26,8),N(),o(27,"div",52)(28,"sh-button-group",53)(29,"button",54),R("click",function(){return P(F),I(_.viewMode.set("list"))}),r(30,9),T(31,"sh-icon"),c(),t(),o(32,"button",54),R("click",function(){return P(F),I(_.viewMode.set("details"))}),r(33,10),T(34,"sh-icon"),c(),t()(),o(35,"sh-menu",55)(36,"button",56),r(37,11),T(38,"strong")(39,"sh-icon"),c(),t(),O(40,57),o(41,"button",54),R("click",function(){return P(F),I(_.setTimeType("relative"))}),E(42,12),t(),o(43,"button",54),R("click",function(){return P(F),I(_.setTimeType("actual"))}),E(44,13),t(),N(),t(),g(45,Sn,8,1,"sh-menu",55),t()(),ke(46,Zn,2,1)(47,et,5,0),ye(48,46,rn,null,47),t()(),m(50,ot,44,29,"ng-template",null,0,Q)(52,_t,6,0,"ng-template",null,1,Q)}n&2&&(a(3),d("routerLink",q(9,cn)),a(10),d("routerLink",q(10,sn)),a(16),L("active",_.viewMode()==="list"),a(3),L("active",_.viewMode()==="details"),a(7),A(_.timeType()),h(37),a(6),p(_.viewMode()==="list"?45:-1),a(3),Be(!_.backupsLoading()))},dependencies:[we,an,je,Ue,ze,We,qe,Qe,Ve],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem 0}header[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;padding:0 2rem;gap:1rem}sh-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}sh-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.content[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{padding:0 2rem}.backups[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem;gap:.5rem}.backup[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem;gap:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;max-width:40%}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font:var(--paragraph-30);color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--base-12)}.backup[_ngcontent-%COMP%] .tags[_ngcontent-%COMP%]{display:flex;align-items:center;flex-direction:column;gap:.5rem}.provider-icon[_ngcontent-%COMP%]{width:1.25rem;height:1.25rem}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.sortable[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none}.sortable[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{margin-left:.5rem;font-size:1rem;justify-self:flex-end;display:none}.sortable[_ngcontent-%COMP%]:not(.sort-asc):not(.sort-desc) sh-icon.filter[_ngcontent-%COMP%]{display:block}.sortable.sort-asc[_ngcontent-%COMP%] sh-icon.asc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}.sortable.sort-desc[_ngcontent-%COMP%] sh-icon.desc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}.actionable[_ngcontent-%COMP%]{cursor:pointer}.actionable[_ngcontent-%COMP%]:after{transition:inset .1s linear}.actionable[_ngcontent-%COMP%]:hover{--card-shp: 0}"],changeDetection:0})};export{Z as default};
@@ -1 +1 @@
1
- import{g as mt}from"./chunk-F5Z5ZAIL.js";import{a as Ot,b as pt,c as Rt}from"./chunk-PFZASYQH.js";import"./chunk-E6H2XELA.js";import"./chunk-HHU5JW5J.js";import{a as Et}from"./chunk-FSG362SU.js";import{h as Ct}from"./chunk-C7EUC34O.js";import"./chunk-HYQ6MPYI.js";import"./chunk-YCORZV4Z.js";import"./chunk-4VY6SMSL.js";import"./chunk-MHPSC3FM.js";import"./chunk-Z27IQRKV.js";import"./chunk-BK2MSH26.js";import{a as R}from"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import"./chunk-LN26XMBJ.js";import"./chunk-6XI3IP27.js";import{b as nt,d as it}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B as St,G as dt,J as Dt,c as ot,e as at,f as st,g as Ft,i as rt,j as lt,s as _t,u as ct,w as Tt,y as ut,z as gt}from"./chunk-RPUPXDQE.js";import"./chunk-OJ3H3ZRA.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import{$b as l,Ab as L,Ac as Z,Bb as x,Bc as tt,Cb as N,Db as s,Eb as F,Fb as g,Jb as G,Kb as w,Mb as C,Qc as k,Sa as r,Tb as T,Ub as u,Vb as h,Wb as f,Xb as $,Xc as et,Yb as b,Zb as d,_ as O,cb as K,ea as _,fa as c,gc as j,hc as Q,ja as X,kc as q,nc as I,oc as B,pa as p,pc as Y,sc as A,tc as M,uc as P,xb as D,yb as E,zb as y}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var Nt=["formRef"],It=()=>({maxWidth:"700px",width:"100%"});function ht(i,n){if(i&1){let t=C();T(0,2,1),s(1,"button",30),d("click",function(){_(t);let e=l();return c(e.testDestination(0,!0))}),F(),u()}if(i&2){let t=l();r(),q("loader",t.testSignal()=="testing"),N("disabled",t.testSignal()=="testing")}}function ft(i,n){if(i&1){let t=C();T(0,2,2),s(1,"button",20),d("click",function(){_(t);let e=l();return c(e.copyTargetUrl())}),g(2,"sh-icon"),F(),u()}}function $t(i,n){i&1&&(s(0,"sh-alert"),T(1,5),g(2,"sh-icon",31),u(),F())}function At(i,n){i&1&&(s(0,"sh-alert",21),T(1,6),g(2,"sh-icon",31),u(),F())}function Mt(i,n){if(i&1&&(s(0,"sh-alert",22),T(1,7),g(2,"sh-icon",31),u(),F()),i&2){let t=l();r(2),f(t.testErrorMessage()),$(1)}}function Pt(i,n){if(i&1&&(s(0,"sh-alert",23),T(1,8),g(2,"sh-icon",31),u(),F()),i&2){let t=l();r(2),f(t.testErrorMessage()),$(1)}}function yt(i,n){if(i&1){let t=C();s(0,"p",32),d("click",function(){_(t);let e=l();return c(e.removeDestination())}),T(1,9),g(2,"strong")(3,"br")(4,"span",33),u(),F()}if(i&2){let t,o=l();r(4),f((t=o.selectedDestinationType())==null?null:t.displayName),$(1)}}function Lt(i,n){if(i&1){let t=C();s(0,"div",39),d("click",function(){let e=_(t).$implicit,a=l(2);return c(a.setDestination(e.key))}),s(1,"h3"),I(2),F(),s(3,"p"),I(4),F()()}if(i&2){let t=n.$implicit;r(2),B(t.displayName),r(2),B(t.description)}}function xt(i,n){if(i&1){let t=C();s(0,"button",40,1),d("click",function(){let e=_(t).$implicit,a=l(2);return c(a.setDestination(e.key))}),I(2),F()}if(i&2){let t=n.$implicit;r(2),Y(" ",t.displayName," ")}}function Gt(i,n){if(i&1&&(s(0,"div",34),L(1,Lt,5,2,"div",35,y),F(),s(3,"sh-menu",36)(4,"button",37),h(5,10),F(),G(6,19),L(7,xt,3,1,"button",38,y),w(),F()),i&2){let t=l();r(),x(t.destinationTypeOptionsFocused()),r(2),N("searchable",!0),r(4),x(t.destinationTypeOptions())}}function wt(i,n){if(i&1){let t=C();s(0,"app-single-destination",41),P("targetUrlChange",function(e){_(t);let a=l();return M(a.targetUrlModel,e)||(a.targetUrlModel=e),c(e)}),F()}if(i&2){let t=l();A("targetUrl",t.targetUrlModel)}}function bt(i,n){i&1&&(T(0,4,1),g(1,"sh-icon",28),u())}function Bt(i,n){i&1&&(T(0,4,2),g(1,"sh-icon"),u())}function kt(i,n){if(i&1){let t=C();s(0,"sh-dialog",42),P("isOpenChange",function(e){_(t);let a=l();return M(a.targetUrlDialogOpen,e)||(a.targetUrlDialogOpen=e),c(e)}),s(1,"header",43)(2,"h2"),h(3,11),F(),s(4,"sh-alert",22),h(5,12),F()(),s(6,"div",44)(7,"sh-form-field")(8,"textarea",45),P("ngModelChange",function(e){_(t);let a=l();return M(a.targetUrlCtrl,e)||(a.targetUrlCtrl=e),c(e)}),F()()(),s(9,"footer",46)(10,"button",26),d("click",function(){_(t);let e=l();return c(e.closeTargetUrlDialog(!1))}),I(11,"Cancel"),F(),s(12,"button",47),d("click",function(){_(t);let e=l();return c(e.closeTargetUrlDialog(!0))}),T(13,13),g(14,"sh-icon"),u(),F()()()}if(i&2){let t=l();A("isOpen",t.targetUrlDialogOpen),N("options",tt(3,It)),r(8),A("ngModel",t.targetUrlCtrl)}}var v=class i{#i=O(it);#o=O(nt);#e=O(gt);#a=O(Ot);injector=O(X);#t=O(mt);#s=O(pt);formRef=et.required("formRef");targetUrlModel=this.#t.destinationTargetUrl;targetUrlCtrl=p(null);targetUrlInitial=p(null);targetUrlDialogOpen=p(!1);toggleNewDestination=p(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;destinationTypeOptionsInFocus=p(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#s.destinationTypeOptions;destinationTypeOptionsFocused=k(()=>{let n=this.destinationTypeOptionsInFocus(),t=this.destinationTypeOptions();return n.map(o=>t.find(e=>e.key===o))});selectedDestinationType=k(()=>{let n=this.#t.destinationTargetUrl();if(!n)return null;let t=n.split("://")[0];return Et(t)});copyTargetUrl(){navigator.clipboard.writeText(this.#t.destinationTargetUrl()??"")}openTargetUrlDialog(){let n=this.#t.destinationTargetUrl();this.targetUrlCtrl.set(n),this.targetUrlInitial.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),o=this.targetUrlInitial();!n||t===o||!t||this.#t.updateTargetUrl(t)}testDestination(n,t,o){let e=this.#t.destinationTargetUrl();e&&(this.#t.setTestState("testing"),this.#a.testDestination(e,this.#t.backupId(),n,!0,t).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),a.containsBackup===!1?(this.#t.setTestState("warning",$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`),t||this.#e.open(R,{data:{title:$localize`Folder contains no backup`,message:$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!1&&(this.#t.setTestState("warning",$localize`The remote destination is empty. Please check if the destination details are correct.`),t||this.#e.open(R,{data:{title:$localize`Folder is empty`,message:$localize`The remote destination is empty. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})),o?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){o?.();return}let m=e.includes("?");a.action==="trust-cert"&&this.#t.updateTargetUrl(e+`${m?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.updateTargetUrl(e+`${m?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):o?.()}}))}setDestination(n){this.#t.updateTargetUrl(`${n}://`)}removeDestination(){this.#t.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let n=this.testSignal();if(n===""){this.#e.open(R,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:t=>{t?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open(R,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(n!=="success"){this.#e.open(R,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:t=>{t&&this.#n()}});return}this.#n()}#n(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=K({type:i,selectors:[["app-restore-destination"]],viewQuery:function(t,o){t&1&&j(o.formRef,Nt,5),t&2&&Q()},features:[Z([Ct])],decls:30,vars:9,consts:()=>{let n;n=$localize` Backup destination ${"\uFFFD#5\uFFFD"}:START_TAG_DIV:${"[\uFFFD*6:1\uFFFD|\uFFFD*13:2\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON: Test destination ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*6:1\uFFFD|\uFFFD/*13:2\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD#7\uFFFD"}:START_TAG_SH_MENU:${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SH_ICON:dots-three-vertical${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#10\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD#11\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD*6:1\uFFFD|\uFFFD*13:2\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:2\uFFFD"}:START_TAG_BUTTON_3:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*6:1\uFFFD|\uFFFD/*13:2\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_MENU:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_DIV:`,n=b(n);let t;t=$localize`${"\uFFFD#24\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#24\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD*27:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*27:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*28:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*28:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,o=b(o);let e;e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let m;m=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let U;U=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let V;V=$localize` Current destination type ${"\uFFFD#2\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:.${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#3\uFFFD\uFFFD/#3\uFFFD"}:LINE_BREAK: Want to select another? ${"\uFFFD#4\uFFFD"}:START_TAG_SPAN:Click here${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SPAN:`;let W;W=$localize`All destinations`;let z;z=$localize`Edit target URL`;let H;H=$localize`Be careful, this will overwrite everything you have in your destination.`;let J;return J=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],["option",""],n,t,o,e,a,m,U,V,W,z,H,J,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"disabled","loader"],["shButton","","type","button",1,"small"],["menu",""],["shButton","","type","button",1,"small",3,"click"],[1,"success"],[1,"warn"],[1,"error"],[3,"targetUrl"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["icon",""],[3,"click"],[1,"sh-primary"],[1,"most-common-destinations"],[1,"tile"],[3,"searchable"],["shButton","","type","button",1,"outlined"],["type","button"],[1,"tile",3,"click"],["type","button",3,"click"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,o){if(t&1){let e=C();s(0,"form",14,0),d("submit",function(){return _(e),c(o.next())}),s(2,"header")(3,"h3",15),T(4,2),s(5,"div",16),D(6,ht,2,3,"button",17),s(7,"sh-menu")(8,"button",18),g(9,"sh-icon"),F(),G(10,19),s(11,"button",20),d("click",function(){return _(e),c(o.openTargetUrlDialog())}),g(12,"sh-icon"),F(),D(13,ft,3,0,"button",18),w(),F()(),u(),F(),D(14,$t,3,0,"sh-alert")(15,At,3,0,"sh-alert",21)(16,Mt,3,1,"sh-alert",22)(17,Pt,3,1,"sh-alert",23),D(18,yt,5,1,"p"),F(),D(19,Gt,9,1),D(20,wt,1,1,"app-single-destination",24),s(21,"div",25)(22,"button",26),d("click",function(){return _(e),c(o.goBack())}),T(23,3),g(24,"sh-icon"),u(),F(),s(25,"button",27),T(26,4),D(27,bt,2,0,"sh-icon",28)(28,Bt,2,0,"sh-icon"),u(),F()()(),D(29,kt,15,4,"sh-dialog",29)}if(t&2){let e=!!o.targetUrlModel();r(6),E(e?6:-1),r(7),E(e?13:-1),r(),E(o.testSignal()=="testing"?14:o.testSignal()=="success"?15:o.testSignal()=="warning"?16:o.testSignal()=="error"?17:-1),r(4),E(e?18:-1),r(),E(e?-1:19),r(),E(e?20:-1),r(5),N("disabled",o.testSignal()=="testing"||!e),r(2),E(o.testSignal()=="testing"?27:28),r(2),E(o.targetUrlDialogOpen()?29:-1)}},dependencies:[Rt,_t,lt,ot,at,st,rt,Ft,St,dt,Dt,ct,ut,Tt],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}"],changeDetection:0})};export{v as default};
1
+ import{g as mt}from"./chunk-F5Z5ZAIL.js";import{a as Ot,b as pt,c as Rt}from"./chunk-NYILY6CE.js";import"./chunk-E6H2XELA.js";import"./chunk-HHU5JW5J.js";import{a as Et}from"./chunk-FSG362SU.js";import{h as Ct}from"./chunk-BNUMPQFL.js";import"./chunk-HYQ6MPYI.js";import"./chunk-YCORZV4Z.js";import"./chunk-4VY6SMSL.js";import"./chunk-MHPSC3FM.js";import"./chunk-Z27IQRKV.js";import"./chunk-BK2MSH26.js";import{a as R}from"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import"./chunk-LN26XMBJ.js";import"./chunk-6XI3IP27.js";import{b as nt,d as it}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B as St,G as dt,J as Dt,c as ot,e as at,f as st,g as Ft,i as rt,j as lt,s as _t,u as ct,w as Tt,y as ut,z as gt}from"./chunk-RPUPXDQE.js";import"./chunk-OJ3H3ZRA.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import{$b as l,Ab as L,Ac as Z,Bb as x,Bc as tt,Cb as N,Db as s,Eb as F,Fb as g,Jb as G,Kb as w,Mb as C,Qc as k,Sa as r,Tb as T,Ub as u,Vb as h,Wb as f,Xb as $,Xc as et,Yb as b,Zb as d,_ as O,cb as K,ea as _,fa as c,gc as j,hc as Q,ja as X,kc as q,nc as I,oc as B,pa as p,pc as Y,sc as A,tc as M,uc as P,xb as D,yb as E,zb as y}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var Nt=["formRef"],It=()=>({maxWidth:"700px",width:"100%"});function ht(i,n){if(i&1){let t=C();T(0,2,1),s(1,"button",30),d("click",function(){_(t);let e=l();return c(e.testDestination(0,!0))}),F(),u()}if(i&2){let t=l();r(),q("loader",t.testSignal()=="testing"),N("disabled",t.testSignal()=="testing")}}function ft(i,n){if(i&1){let t=C();T(0,2,2),s(1,"button",20),d("click",function(){_(t);let e=l();return c(e.copyTargetUrl())}),g(2,"sh-icon"),F(),u()}}function $t(i,n){i&1&&(s(0,"sh-alert"),T(1,5),g(2,"sh-icon",31),u(),F())}function At(i,n){i&1&&(s(0,"sh-alert",21),T(1,6),g(2,"sh-icon",31),u(),F())}function Mt(i,n){if(i&1&&(s(0,"sh-alert",22),T(1,7),g(2,"sh-icon",31),u(),F()),i&2){let t=l();r(2),f(t.testErrorMessage()),$(1)}}function Pt(i,n){if(i&1&&(s(0,"sh-alert",23),T(1,8),g(2,"sh-icon",31),u(),F()),i&2){let t=l();r(2),f(t.testErrorMessage()),$(1)}}function yt(i,n){if(i&1){let t=C();s(0,"p",32),d("click",function(){_(t);let e=l();return c(e.removeDestination())}),T(1,9),g(2,"strong")(3,"br")(4,"span",33),u(),F()}if(i&2){let t,o=l();r(4),f((t=o.selectedDestinationType())==null?null:t.displayName),$(1)}}function Lt(i,n){if(i&1){let t=C();s(0,"div",39),d("click",function(){let e=_(t).$implicit,a=l(2);return c(a.setDestination(e.key))}),s(1,"h3"),I(2),F(),s(3,"p"),I(4),F()()}if(i&2){let t=n.$implicit;r(2),B(t.displayName),r(2),B(t.description)}}function xt(i,n){if(i&1){let t=C();s(0,"button",40,1),d("click",function(){let e=_(t).$implicit,a=l(2);return c(a.setDestination(e.key))}),I(2),F()}if(i&2){let t=n.$implicit;r(2),Y(" ",t.displayName," ")}}function Gt(i,n){if(i&1&&(s(0,"div",34),L(1,Lt,5,2,"div",35,y),F(),s(3,"sh-menu",36)(4,"button",37),h(5,10),F(),G(6,19),L(7,xt,3,1,"button",38,y),w(),F()),i&2){let t=l();r(),x(t.destinationTypeOptionsFocused()),r(2),N("searchable",!0),r(4),x(t.destinationTypeOptions())}}function wt(i,n){if(i&1){let t=C();s(0,"app-single-destination",41),P("targetUrlChange",function(e){_(t);let a=l();return M(a.targetUrlModel,e)||(a.targetUrlModel=e),c(e)}),F()}if(i&2){let t=l();A("targetUrl",t.targetUrlModel)}}function bt(i,n){i&1&&(T(0,4,1),g(1,"sh-icon",28),u())}function Bt(i,n){i&1&&(T(0,4,2),g(1,"sh-icon"),u())}function kt(i,n){if(i&1){let t=C();s(0,"sh-dialog",42),P("isOpenChange",function(e){_(t);let a=l();return M(a.targetUrlDialogOpen,e)||(a.targetUrlDialogOpen=e),c(e)}),s(1,"header",43)(2,"h2"),h(3,11),F(),s(4,"sh-alert",22),h(5,12),F()(),s(6,"div",44)(7,"sh-form-field")(8,"textarea",45),P("ngModelChange",function(e){_(t);let a=l();return M(a.targetUrlCtrl,e)||(a.targetUrlCtrl=e),c(e)}),F()()(),s(9,"footer",46)(10,"button",26),d("click",function(){_(t);let e=l();return c(e.closeTargetUrlDialog(!1))}),I(11,"Cancel"),F(),s(12,"button",47),d("click",function(){_(t);let e=l();return c(e.closeTargetUrlDialog(!0))}),T(13,13),g(14,"sh-icon"),u(),F()()()}if(i&2){let t=l();A("isOpen",t.targetUrlDialogOpen),N("options",tt(3,It)),r(8),A("ngModel",t.targetUrlCtrl)}}var v=class i{#i=O(it);#o=O(nt);#e=O(gt);#a=O(Ot);injector=O(X);#t=O(mt);#s=O(pt);formRef=et.required("formRef");targetUrlModel=this.#t.destinationTargetUrl;targetUrlCtrl=p(null);targetUrlInitial=p(null);targetUrlDialogOpen=p(!1);toggleNewDestination=p(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;destinationTypeOptionsInFocus=p(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#s.destinationTypeOptions;destinationTypeOptionsFocused=k(()=>{let n=this.destinationTypeOptionsInFocus(),t=this.destinationTypeOptions();return n.map(o=>t.find(e=>e.key===o))});selectedDestinationType=k(()=>{let n=this.#t.destinationTargetUrl();if(!n)return null;let t=n.split("://")[0];return Et(t)});copyTargetUrl(){navigator.clipboard.writeText(this.#t.destinationTargetUrl()??"")}openTargetUrlDialog(){let n=this.#t.destinationTargetUrl();this.targetUrlCtrl.set(n),this.targetUrlInitial.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),o=this.targetUrlInitial();!n||t===o||!t||this.#t.updateTargetUrl(t)}testDestination(n,t,o){let e=this.#t.destinationTargetUrl();e&&(this.#t.setTestState("testing"),this.#a.testDestination(e,this.#t.backupId(),n,!0,t).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),a.containsBackup===!1?(this.#t.setTestState("warning",$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`),t||this.#e.open(R,{data:{title:$localize`Folder contains no backup`,message:$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!1&&(this.#t.setTestState("warning",$localize`The remote destination is empty. Please check if the destination details are correct.`),t||this.#e.open(R,{data:{title:$localize`Folder is empty`,message:$localize`The remote destination is empty. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})),o?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){o?.();return}let m=e.includes("?");a.action==="trust-cert"&&this.#t.updateTargetUrl(e+`${m?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.updateTargetUrl(e+`${m?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):o?.()}}))}setDestination(n){this.#t.updateTargetUrl(`${n}://`)}removeDestination(){this.#t.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let n=this.testSignal();if(n===""){this.#e.open(R,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:t=>{t?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open(R,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(n!=="success"){this.#e.open(R,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:t=>{t&&this.#n()}});return}this.#n()}#n(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=K({type:i,selectors:[["app-restore-destination"]],viewQuery:function(t,o){t&1&&j(o.formRef,Nt,5),t&2&&Q()},features:[Z([Ct])],decls:30,vars:9,consts:()=>{let n;n=$localize` Backup destination ${"\uFFFD#5\uFFFD"}:START_TAG_DIV:${"[\uFFFD*6:1\uFFFD|\uFFFD*13:2\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON: Test destination ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*6:1\uFFFD|\uFFFD/*13:2\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD#7\uFFFD"}:START_TAG_SH_MENU:${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SH_ICON:dots-three-vertical${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#10\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD#11\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD*6:1\uFFFD|\uFFFD*13:2\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:2\uFFFD"}:START_TAG_BUTTON_3:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*6:1\uFFFD|\uFFFD/*13:2\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_MENU:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_DIV:`,n=b(n);let t;t=$localize`${"\uFFFD#24\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#24\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD*27:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*27:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*28:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*28:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,o=b(o);let e;e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let m;m=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let U;U=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let V;V=$localize` Current destination type ${"\uFFFD#2\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:.${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#3\uFFFD\uFFFD/#3\uFFFD"}:LINE_BREAK: Want to select another? ${"\uFFFD#4\uFFFD"}:START_TAG_SPAN:Click here${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SPAN:`;let W;W=$localize`All destinations`;let z;z=$localize`Edit target URL`;let H;H=$localize`Be careful, this will overwrite everything you have in your destination.`;let J;return J=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],["option",""],n,t,o,e,a,m,U,V,W,z,H,J,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"disabled","loader"],["shButton","","type","button",1,"small"],["menu",""],["shButton","","type","button",1,"small",3,"click"],[1,"success"],[1,"warn"],[1,"error"],[3,"targetUrl"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["icon",""],[3,"click"],[1,"sh-primary"],[1,"most-common-destinations"],[1,"tile"],[3,"searchable"],["shButton","","type","button",1,"outlined"],["type","button"],[1,"tile",3,"click"],["type","button",3,"click"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,o){if(t&1){let e=C();s(0,"form",14,0),d("submit",function(){return _(e),c(o.next())}),s(2,"header")(3,"h3",15),T(4,2),s(5,"div",16),D(6,ht,2,3,"button",17),s(7,"sh-menu")(8,"button",18),g(9,"sh-icon"),F(),G(10,19),s(11,"button",20),d("click",function(){return _(e),c(o.openTargetUrlDialog())}),g(12,"sh-icon"),F(),D(13,ft,3,0,"button",18),w(),F()(),u(),F(),D(14,$t,3,0,"sh-alert")(15,At,3,0,"sh-alert",21)(16,Mt,3,1,"sh-alert",22)(17,Pt,3,1,"sh-alert",23),D(18,yt,5,1,"p"),F(),D(19,Gt,9,1),D(20,wt,1,1,"app-single-destination",24),s(21,"div",25)(22,"button",26),d("click",function(){return _(e),c(o.goBack())}),T(23,3),g(24,"sh-icon"),u(),F(),s(25,"button",27),T(26,4),D(27,bt,2,0,"sh-icon",28)(28,Bt,2,0,"sh-icon"),u(),F()()(),D(29,kt,15,4,"sh-dialog",29)}if(t&2){let e=!!o.targetUrlModel();r(6),E(e?6:-1),r(7),E(e?13:-1),r(),E(o.testSignal()=="testing"?14:o.testSignal()=="success"?15:o.testSignal()=="warning"?16:o.testSignal()=="error"?17:-1),r(4),E(e?18:-1),r(),E(e?-1:19),r(),E(e?20:-1),r(5),N("disabled",o.testSignal()=="testing"||!e),r(2),E(o.testSignal()=="testing"?27:28),r(2),E(o.targetUrlDialogOpen()?29:-1)}},dependencies:[Rt,_t,lt,ot,at,st,rt,Ft,St,dt,Dt,ct,ut,Tt],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}"],changeDetection:0})};export{v as default};
@@ -0,0 +1 @@
1
+ import{a as pt}from"./chunk-KXJZEADJ.js";import{a as Ct}from"./chunk-YJPY33RI.js";import{a as gt}from"./chunk-G6VJHFTW.js";import{a as V}from"./chunk-MHPSC3FM.js";import"./chunk-Z27IQRKV.js";import"./chunk-H7ZKBS2Q.js";import"./chunk-2YGOHGD2.js";import"./chunk-BK2MSH26.js";import{a as ct}from"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import{a as ie}from"./chunk-5LX6M65H.js";import"./chunk-LN26XMBJ.js";import"./chunk-S4OFJD2F.js";import{a as nt}from"./chunk-6XI3IP27.js";import"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B as J,E as st,F as at,G as ne,K as rt,L as lt,M as _t,O as dt,V as Tt,X as St,c as K,e as Q,i as Y,m as it,s as Z,t as ee,u as k,w as te,z as ot}from"./chunk-RPUPXDQE.js";import{i as X}from"./chunk-OJ3H3ZRA.js";import"./chunk-I2LW33GO.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-JYWOYPSQ.js";import{$b as S,B as D,Bc as j,Cb as f,Db as i,Eb as o,Fb as R,H as G,Mb as P,Pa as qe,Qc as $,Rc as F,Sa as l,Tb as L,Ub as b,V as We,Vb as r,Wb as re,Xb as le,Xc as tt,Yb as H,Zb as c,_ as N,a as ze,b as Be,c as He,cb as x,ea as u,fa as E,gc as Ye,hb as ae,hc as Ze,ib as je,kc as h,n as w,nc as I,oc as W,pa as T,pc as q,sb as Ke,sc as y,tb as Qe,tc as A,uc as v,xb as p,yb as C,yc as et}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var mt=["formRef"],Nt=()=>[import("./chunk-4NOWNXOS.js").then(s=>s.OptionsListComponent)];function ft(s,e){s&1&&(i(0,"sh-alert",3),r(1,1),o())}function ht(s,e){if(s&1){let t=P();i(0,"app-options-list",5),v("optionsChange",function(a){u(t);let _=S();return A(_.settings,a)||(_.settings=a),E(a)}),o()}if(s&2){let t=S();y("options",t.settings),f("hasFreeTextSettings",!0)}}var z=class s{#e=N(V);#t=N(X);formRef=tt.required("formRef");settings=T([]);isSubmitting=T(!1);isLoadingOptions=T(!0);saved=T(!1);lastRecievedServerSettings=T({});serverSettingsEffect=F(()=>{let e=this.#e.serverSettings();if(e===void 0)return;this.lastRecievedServerSettings.set(e),this.isLoadingOptions.set(!0);let t=Object.entries(e);t.forEach(([n,a],_)=>{if(n.startsWith("--")){let m=n.substring(2);this.settings.update(g=>(g.some(M=>M.Name===m)||g.push({Name:m,Value:a}),g))}_===t.length-1&&this.isLoadingOptions.set(!1)})});submit(){this.isSubmitting.set(!0);let e=this.settings(),t=this.lastRecievedServerSettings(),n=e.map(g=>g.Name),_=Object.keys(t).filter(g=>g.startsWith("--")).filter(g=>!n.includes(g.replace("--",""))),m=e.reduce((g,M)=>{let O=M.Name?.startsWith("--")?M.Name:`--${M.Name}`;return g[O]=M.Value,g},{});_.forEach(g=>{m[g]=null}),this.#t.patchApiV1Serversettings({requestBody:m}).pipe(G(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.#e.refreshServerSettings(),this.saved.set(!0),setTimeout(()=>{this.saved.set(!1)},3e3)}})}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=x({type:s,selectors:[["app-advanced-options-settings"]],viewQuery:function(t,n){t&1&&Ye(n.formRef,mt,5),t&2&&Ze()},decls:8,vars:4,consts:()=>{let e;e=$localize`${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:floppy-disk${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON: Save settings `;let t;return t=$localize`Settings saved`,[e,t,[1,"actions"],[1,"success"],["shButton","","type","button",1,"raised","primary",3,"click"],[3,"optionsChange","options","hasFreeTextSettings"]]},template:function(t,n){t&1&&(i(0,"div",2),p(1,ft,2,0,"sh-alert",3),i(2,"button",4),c("click",function(){return n.submit()}),L(3,0),R(4,"sh-icon"),b(),o()(),je(5,ht,1,2),Ke(6,5,Nt)),t&2&&(l(),C(n.saved()?1:-1),l(),h("loader",n.isSubmitting()),l(4),Qe(!n.isLoadingOptions()))},dependencies:[ee,J,k,te],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40.625rem;justify-self:flex-end}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:flex-end;margin-bottom:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.remote-volume-wrap[_ngcontent-%COMP%] p.warning[_ngcontent-%COMP%]{color:#7d7d00}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 2.5rem;align-items:flex-end}"],changeDetection:0})};var U=class s{#e=N(ot);#t=N(X);#o=N(ie);repeatRegisterTimer=null;state=T("unknown");claimUrl=T(null);registerUrl=T("");status=$(()=>{let e=this.state();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"});sysInfoEffect=F(()=>{let e=this.#o.systemInfo();e&&this.registerUrl.set(e.RemoteControlRegistrationUrl??"")});#n(e){e.RegistrationUrl&&this.claimUrl.set(e.RegistrationUrl),e.IsConnected?this.state.set("connected"):e.IsEnabled?this.state.set("enabled"):e.CanEnable?this.state.set("disabled"):e.IsRegisteringFaulted?this.state.set("registeringfaulted"):e.IsRegistering?e.RegistrationUrl!=null&&e.RegistrationUrl.trim().length>0?this.state.set("registered"):this.state.set("registering"):this.state.set("inactive");let t=this.state();this.repeatRegisterTimer!==null&&(clearTimeout(this.repeatRegisterTimer),this.repeatRegisterTimer=null),t==="registering"&&(this.repeatRegisterTimer=setTimeout(()=>{this.#t.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:""}}).subscribe({next:n=>this.#n(n),error:n=>this.#i(n)})},5e3)),(t==="enabled"||t==="registered")&&(this.repeatRegisterTimer=setTimeout(()=>{this.#t.getApiV1RemotecontrolStatus().subscribe({next:n=>this.#n(n),error:n=>this.#i(n)})},5e3)),e.IsRegistering&&e.CanEnable&&this.#t.deleteApiV1RemotecontrolRegister().subscribe({next:n=>this.#n(n)})}#i(e){this.#t.getApiV1RemotecontrolStatus().subscribe({next:t=>this.#n(t)})}refreshRemoteControlStatus(){this.#t.getApiV1RemotecontrolStatus().subscribe({next:e=>this.#n(e),error:e=>this.#i(e)})}beginRemoteRegistration(){this.state.set("registering"),this.#t.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:this.registerUrl()}}).subscribe({next:e=>this.#n(e),error:e=>this.#i(e)})}cancelRemoteRegistration(){this.#t.deleteApiV1RemotecontrolRegister().subscribe({next:e=>this.#n(e),error:e=>this.#i(e)})}enableRemoteControl(){this.#t.postApiV1RemotecontrolEnable().subscribe({next:e=>this.#n(e),error:e=>this.#i(e)})}disableRemoteControl(){this.#t.postApiV1RemotecontrolDisable().subscribe({next:e=>this.#n(e),error:e=>this.#i(e)})}deleteRemoteControl(){let e=this;this.#e.open(ct,{data:{title:$localize`Confirm delete`,message:$localize`Are you sure you want to delete the remote control registration?`,confirmText:$localize`Delete registration`,cancelText:$localize`Cancel`},closed:t=>{t&&e.#t.deleteApiV1RemotecontrolRegistration().subscribe({next:n=>e.#n(n),error:n=>e.#i(n)})}})}static \u0275fac=function(t){return new(t||s)};static \u0275prov=We({token:s,factory:s.\u0275fac,providedIn:"root"})};function Pt(s,e){if(s&1){let t=P();i(0,"sh-form-field",12)(1,"input",13),v("ngModelChange",function(a){u(t);let _=S(2);return A(_.registerUrl,a)||(_.registerUrl=a),E(a)}),o()(),i(2,"button",14),c("click",function(){u(t);let a=S(2);return E(a.register())}),r(3,0),o()}if(s&2){let t=S(2);l(),y("ngModel",t.registerUrl)}}function Ot(s,e){if(s&1&&(i(0,"div",9)(1,"label"),r(2,1),o(),i(3,"a",15),I(4),o()()),s&2){let t=S(2);l(3),f("href",et(t.claimUrl()),qe),l(),W(t.claimUrl())}}function Rt(s,e){s&1&&(i(0,"div",9)(1,"label"),r(2,2),o()())}function It(s,e){if(s&1){let t=P();i(0,"button",14),c("click",function(){u(t);let a=S(2);return E(a.cancel())}),r(1,3),o()}}function Gt(s,e){if(s&1){let t=P();i(0,"button",14),c("click",function(){u(t);let a=S(2);return E(a.disable())}),r(1,4),o()}}function yt(s,e){if(s&1){let t=P();i(0,"button",14),c("click",function(){u(t);let a=S(2);return E(a.enable())}),r(1,5),o(),i(2,"button",16),c("click",function(){u(t);let a=S(2);return E(a.delete())}),r(3,6),o()}}function At(s,e){s&1&&(L(0,7,1),R(1,"sh-icon"),b())}function vt(s,e){s&1&&(L(0,7,2),R(1,"sh-icon"),b())}function Lt(s,e){if(s&1){let t=P();i(0,"sh-chip",17),c("click",function(){u(t);let a=S(2);return E(a.copyReportingUrl())}),L(1,7),p(2,At,2,0,"sh-icon")(3,vt,2,0,"sh-icon"),b(),o()}if(s&2){let t=S(2);l(2),C(t.copiedReportingUrl()===!0?2:3)}}function bt(s,e){if(s&1&&(i(0,"div",8),p(1,Pt,4,1),p(2,Ot,5,3,"div",9),p(3,Rt,3,0,"div",9),p(4,It,2,0,"button",10),p(5,Gt,2,0,"button",10),p(6,yt,4,0),p(7,Lt,4,1,"sh-chip",11),o()),s&2){let t=S();l(),C(t.state()==="inactive"?1:-1),l(),C(t.state()==="registered"?2:-1),l(),C(t.state()==="registering"?3:-1),l(),C(t.state()==="registering"||t.state()==="registeringfaulted"||t.state()==="registered"?4:-1),l(),C(t.state()==="connected"||t.state()==="enabled"?5:-1),l(),C(t.state()==="disabled"?6:-1),l(),C(t.additionalReportingUrl()!==""?7:-1)}}var oe=class s{#e=N(U);#t=N(V);state=this.#e.state;claimUrl=this.#e.claimUrl;registerUrl=this.#e.registerUrl;additionalReportingUrl=$(()=>{let e=this.#t.serverSettings();return this.#e.state()==="inactive"?"":e&&e["additional-report-url"]||""});copiedReportingUrl=T(!1);ngOnInit(){this.#e.refreshRemoteControlStatus()}cancel(){this.#e.cancelRemoteRegistration()}register(){this.#e.beginRemoteRegistration()}disable(){this.#e.disableRemoteControl()}enable(){this.#e.enableRemoteControl()}delete(){this.#e.deleteRemoteControl()}copyReportingUrl(){let e=this.additionalReportingUrl();e&&(this.copiedReportingUrl.set(!0),setTimeout(()=>this.copiedReportingUrl.set(!1),2e3),navigator.clipboard.writeText(e))}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=x({type:s,selectors:[["app-remote-control"]],decls:1,vars:1,consts:()=>{let e;e=$localize`Register for remote control`;let t;t=$localize`Machine is now registered, open this link to add it to your account:`;let n;n=$localize`Registering, please wait...`;let a;a=$localize`Cancel registration`;let _;_=$localize`Disable remote control`;let m;m=$localize`Enable remote control`;let g;g=$localize`Delete remote control setup`;let M;return M=$localize` Reporting configured by server ${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,M=H(M),[e,t,n,a,_,m,g,M,[1,"field-row"],[1,"field-col"],["type","button","shButton","",1,"raised"],[1,"reporting-url","primary","simple"],["label","Registration URL","for","remoteControlRegisterUrl"],["type","text","sh-input","","id","remoteControlRegisterUrl","name","remoteControlRegisterUrl",3,"ngModelChange","ngModel"],["type","button","shButton","",1,"raised",3,"click"],["target","_blank",3,"href"],["type","button","shButton","",1,"raised","error",3,"click"],[1,"reporting-url","primary","simple",3,"click"]]},template:function(t,n){t&1&&p(0,bt,8,7,"div",8),t&2&&C(n.state()!=="unknown"?0:-1)},dependencies:[Z,K,Q,Y,ne,J,st,k],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{flex:1 0}.reporting-url[_ngcontent-%COMP%]{cursor:pointer;-webkit-user-select:none;user-select:none;margin-top:.25rem}"],changeDetection:0})};function Et(...s){let e=T(...s);return Object.defineProperty(e,"value",{get:e.asReadonly(),set:e.set.bind(e)})}var de=()=>({standalone:!0});function $t(s,e){s&1&&(i(0,"sh-icon",69),I(1,"check"),o())}function Ft(s,e){s&1&&(i(0,"sh-icon",70),I(1,"prohibit"),o())}function wt(s,e){if(s&1){let t=P();i(0,"button",74),c("click",function(){u(t);let a=S(2);return E(a.updatePassphrase())}),r(1,34),o()}if(s&2){let t=S(2);h("loader",t.isUpdating())}}function Dt(s,e){if(s&1){let t=P();i(0,"button",75),c("click",function(){u(t);let a=S(2);return E(a.updatePassphrase())}),r(1,35),o()}if(s&2){let t=S(2);h("loader",t.isUpdating()),f("disabled",!0)}}function xt(s,e){if(s&1){let t=P();i(0,"sh-form-field")(1,"label",65),r(2,31),o(),i(3,"input",66),v("ngModelChange",function(a){u(t);let _=S();return A(_.passphrase,a)||(_.passphrase=a),E(a)}),o()(),i(4,"sh-form-field")(5,"label",67),r(6,32),o(),i(7,"input",68),v("ngModelChange",function(a){u(t);let _=S();return A(_.repeatPassphrase,a)||(_.repeatPassphrase=a),E(a)}),o(),p(8,$t,2,0,"sh-icon",69)(9,Ft,2,0,"sh-icon",70),o(),i(10,"div",48)(11,"button",71),c("click",function(){u(t);let a=S();return E(a.cancelPasswordChange())}),r(12,33),o(),p(13,wt,2,2,"button",72)(14,Dt,2,3,"button",73),o()}if(s&2){let t=S();l(3),y("ngModel",t.passphrase),l(4),f("disabled",t.passphrase().length===0),y("ngModel",t.repeatPassphrase),l(),C(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?8:9),l(3),h("loader",t.isUpdating()),l(2),C(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?13:14)}}function kt(s,e){s&1&&(i(0,"sh-icon",76),I(1,"check"),o())}function Jt(s,e){if(s&1){let t=P();i(0,"div",48)(1,"button",71),c("click",function(){u(t);let a=S();return E(a.openPassphraseForm())}),r(2,36),o(),p(3,kt,2,0,"sh-icon",76),o()}if(s&2){let t=S();l(3),C(t.passwordUpdated()?3:-1)}}function Xt(s,e){if(s&1){let t=P();i(0,"sh-form-field")(1,"label",77),r(2,37),o(),i(3,"textarea",78),v("ngModelChange",function(a){u(t);let _=S();return A(_.allowedHostnames,a)||(_.allowedHostnames=a),E(a)}),o()(),i(4,"sh-alert",79),r(5,38),o(),i(6,"button",74),c("click",function(){u(t);let a=S();return E(a.updateAllowedHostnames())}),r(7,39),o()}if(s&2){let t=S();l(3),y("ngModel",t.allowedHostnames),l(3),h("loader",t.updatingAllowedHosts())}}function Vt(s,e){if(s&1&&I(0),s&2){let t,n=S();q(" ",(t=n.sysinfo())==null?null:t.ServerVersion," ")}}function Ut(s,e){s&1&&R(0,"sh-progress-bar",53)}function zt(s,e){if(s&1&&I(0),s&2){let t=e.$implicit;q(" ",t.label," ")}}function Bt(s,e){if(s&1&&I(0),s&2){let t=e.$implicit;q(" ",t.label," ")}}function Ht(s,e,t){let n=Et(s),a=n[ze];t?.equal&&(a.equal=t.equal);let _;return n.set=m=>{clearTimeout(_),_=setTimeout(()=>Be(a,m),e)},n.update=m=>{clearTimeout(_),_=setTimeout(()=>He(a,m),e)},n}var Wt=[{value:"none",label:$localize`None`},{value:"s",label:$localize`Seconds`},{value:"m",label:$localize`Minutes`},{value:"h",label:$localize`Hours`}],qt=[{value:"none",label:$localize`System default (information)`},{value:"information",label:$localize`Usage statistics, warnings, errors, and crashes`},{value:"warning",label:$localize`Warnings, errors and crashes`},{value:"error",label:$localize`Errors and crashes`},{value:"crash",label:$localize`Crashes only`},{value:"disabled",label:$localize`None / disabled`}],Te=class s{#e=N(gt);#t=N(ie);#o=N(X);#n=N(V);#i=N(U);#s=N(nt);#a=this.#s.getItem("locale")??"en-US";sysinfo=this.#t.systemInfo;isDarkMode=this.#e.isDarkMode;editAs=T("list");previousLang=this.#a;langCtrl=T(this.#a);usageStatistics=T("");updatingUsageStatistics=T(!1);remoteControlStatus=this.#i.status;updatingChannel=T(!1);updateChannel=T("");setNewChannel(e){let t=this.updateChannel();this.updateChannel.set(e),this.#o.patchApiV1Serversettings({requestBody:{"update-channel":e}}).pipe(G(()=>this.updatingChannel.set(!1)),D(()=>(this.updateChannel.set(t),w(null)))).subscribe()}allowRemoteAccess=T(!1);allowedHostnames=T("");loadedAllowedHostnames=T("");updatingRemoteAccess=T(!1);updatingAllowedHosts=T(!1);updateRemoteAccess(){let e=this.allowRemoteAccess(),t=!e;this.allowRemoteAccess.set(t),this.#o.patchApiV1Serversettings({requestBody:{"server-listen-interface":t?"any":"loopback"}}).pipe(G(()=>this.updatingRemoteAccess.set(!1)),D(()=>(this.allowRemoteAccess.set(e),w(null)))).subscribe()}updateAllowedHostnames(){let e=this.loadedAllowedHostnames(),t=this.allowedHostnames();this.updatingAllowedHosts.set(!0),this.#o.patchApiV1Serversettings({requestBody:{"server-listen-interface":"any","allowed-hostnames":t}}).pipe(G(()=>this.updatingAllowedHosts.set(!1)),D(()=>(this.allowedHostnames.set(e),w(null)))).subscribe()}updatingDisableTrayIconLogin=T(!1);disableTrayIconLogin=T(!1);saveDisableTrayIconLogin(){let e=this.disableTrayIconLogin(),t=!e;this.updatingDisableTrayIconLogin.set(!0),this.disableTrayIconLogin.set(t),this.#o.patchApiV1Serversettings({requestBody:{"disable-tray-icon-login":t?"True":"False"}}).pipe(G(()=>this.updatingDisableTrayIconLogin.set(!1)),D(()=>(this.disableTrayIconLogin.set(e),w(null)))).subscribe()}showPassphraseForm=T(!1);isUpdating=T(!1);passphrase=T("");repeatPassphrase=T("");passwordUpdated=T(!1);updatePassphrase(){this.passphrase()===this.repeatPassphrase()&&(this.isUpdating.set(!0),this.#o.patchApiV1Serversettings({requestBody:{"server-passphrase":this.passphrase()}}).pipe(G(()=>this.isUpdating.set(!1))).subscribe({next:()=>{this.showPassphraseForm.set(!1),this.passwordUpdated.set(!0),setTimeout(()=>{this.passwordUpdated.set(!1)},3e3)}}))}openPassphraseForm(){this.showPassphraseForm.set(!0)}cancelPasswordChange(){this.showPassphraseForm.set(!1)}languageOptions=T(Ct);usageStatisticsOptions=T(qt);timeTypeOptions=T(Wt);timeType=T("none");timeValue=Ht(0,300);timeRange=$(()=>this.timeType()==="h"?[0,24]:[0,60]);timeValueEffect=F(()=>{let e=this.timeValue(),t=this.#n.serverSettings();!t||t["startup-delay"]===""&&this.timeType()==="none"||this.updateStartupDelay()});updateLocale(e){!e||e===""||e===this.previousLang||(this.#s.setItem("locale",e),window.location.reload())}updateStartupDelay(){let e=this.timeValue(),t=this.timeType(),n="";t!=="none"&&e!==0&&(n=`${e}${t}`),this.#o.patchApiV1Serversettings({requestBody:{"startup-delay":n}}).subscribe()}updateTimeType(e){this.timeType()==="none"&&this.timeValue.set(0),this.timeType.set(e)}updateUsageStatistics(e){let t=this.usageStatistics();!e||e===""||e===t||(this.usageStatistics.set(e),this.updatingUsageStatistics.set(!0),this.#o.patchApiV1Serversettings({requestBody:{"usage-reporter-level":this.usageStatistics()==="none"?"":this.usageStatistics()}}).pipe(G(()=>this.updatingUsageStatistics.set(!1)),D(()=>(this.usageStatistics.set(t),w(null)))).subscribe())}serverSettingsEffect=F(()=>{let e=this.#n.serverSettings();if(e===void 0)return;let t=e["startup-delay"],n=t.slice(-1),a=t.slice(0,-1),_=["s","m","h"];this.disableTrayIconLogin.set(e["disable-tray-icon-login"]!=="False"),this.updateChannel.set(e["update-channel"]),this.allowRemoteAccess.set(e["server-listen-interface"]==="any"),this.allowedHostnames.set(e["allowed-hostnames"]),this.loadedAllowedHostnames.set(e["allowed-hostnames"]),this.usageStatistics.set(e["usage-reporter-level"]===""?"none":e["usage-reporter-level"]),this.timeType.set(t==""?"none":_.includes(n)?n:"none"),this.timeValue.set(t==""?0:parseInt(a))});setDarkMode(){this.#e.setDarkMode()}setLightMode(){this.#e.setLightMode()}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=x({type:s,selectors:[["app-settings"]],decls:132,vars:46,consts:()=>{let e;e=$localize`Settings`;let t;t=$localize`Configure your backup settings.`;let n;n=$localize`Remote access control`;let a;a=$localize`Color theme`;let _;_=$localize`Customize your application theme`;let m;m=$localize`Passwords`;let g;g=$localize`Change server passphrase`;let M;M=$localize`Language`;let O;O=$localize`Select a language for the platform`;let Se;Se=$localize`Allow remote access (requires restart)`;let ce;ce=$localize` By allowing remote access, the server listens to requests from any machine on your network. If you enable this option, make sure you are always using the computer on a secure firewall protected network. `;let ge;ge=$localize`Allow remote access`;let pe;pe=$localize`Prevent tray icon automatic log-in`;let Ce;Ce=$localize` By default, the tray icon will open the user interface with a token that unlocks the user interface. This ensures that you can access the user interface from the tray icon, while requiring others to enter a password. If you prefer having to type in the password, even when accessing the user interface from the tray icon, enable this option. `;let ue;ue=$localize`Prevent tray icon automatic log-in`;let Ee;Ee=$localize`Update channel`;let me;me=$localize` Default (${"\uFFFD0\uFFFD"}:INTERPOLATION:) `;let Ne;Ne=$localize`Same as the base install version: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let fe;fe=$localize`Stable`;let he;he=$localize`Official stable release.`;let Me;Me=$localize`Beta`;let Pe;Pe=$localize` Try out the new features that we are working on. Test a backup and restore before using this in production environments. `;let Oe;Oe=$localize` Experimental `;let Re;Re=$localize`Early previews of new features. Not for use with important data.`;let Ie;Ie=$localize`Canary`;let Ge;Ge=$localize`Builds for developers and testers only. Not for use with important data.`;let ye;ye=$localize`Pause after startup or hibernation`;let Ae;Ae=$localize` Duplicati will run when started, but will remain in paused state for the duration. Duplicati will occupy minimal system resources and no backups will be run. `;let ve;ve=$localize`Usage statistics`;let B;B=$localize` Usage reports help us improve the user experience and evaluate impact of new features. We use them to generate ${"\uFFFD#119\uFFFD"}:START_LINK:public usage statistics.${"\uFFFD/#119\uFFFD"}:CLOSE_LINK:${"[\uFFFD#120\uFFFD\uFFFD/#120\uFFFD|\uFFFD#121\uFFFD\uFFFD/#121\uFFFD]"}:LINE_BREAK:${"[\uFFFD#120\uFFFD\uFFFD/#120\uFFFD|\uFFFD#121\uFFFD\uFFFD/#121\uFFFD]"}:LINE_BREAK: All usage reports are sent anonymously and do not contain any personal information. They contain information about hardware and operating system, the type of backend, backup duration, overall size of source data and similar data. They do not contain paths, filenames, usernames, passwords or similar sensitive information. `,B=H(B);let Le;Le=$localize`Advanced options`;let be;be=$localize`Enter new password`;let $e;$e=$localize`Repeat password`;let se;se=$localize`Password have to be filled and have to match`;let Fe;Fe=$localize`Passphrase`;let we;we=$localize`Repeat passphrase`;let De;De=$localize`Cancel`;let xe;xe=$localize` Update passphrase `;let ke;ke=$localize` Update passphrase `;let Je;Je=$localize`Change password`;let Xe;Xe=$localize`Allowed hostnames`;let Ve;Ve=$localize` To prevent various DNS based attacks, Duplicati limits the allowed hostnames to the ones listed here. Direct IP access and localhost is always allowed. Multiple hostnames can be supplied with a semicolon separator. If any of the allowed hostnames is an asterisk (*), all hostnames are allowed and this feature is disabled. If the field is empty, only IP address and localhost access is allowed. `;let Ue;return Ue=$localize` Update allowed hostnames `,[e,t,n,a,_,m,g,M,O,Se,ce,ge,pe,Ce,ue,Ee,me,Ne,fe,he,Me,Pe,Oe,Re,Ie,Ge,ye,Ae,ve,B,Le,Fe,we,De,xe,ke,Je,Xe,Ve,Ue,[1,"content"],[1,"title"],[1,"left"],[1,"right"],[1,"themes"],["src","assets/images/light-theme.png","alt","light theme",3,"click"],["src","assets/images/dark-theme.png","alt","dark theme",3,"click"],[1,"right","passphrase-form"],[1,"actions"],["value","value","label","label",3,"options","isClearable","inlineSearch"],["type","text",3,"ngModelChange","ngModel","ngModelOptions"],[1,"right","remote-access-form"],[1,"primary","raised",3,"click"],[1,"indeterminate","primary"],[1,"right","radios"],[1,"radio-option",3,"click"],[1,"primary","raised"],[1,"field-row"],[1,"raised","primary",3,"unit"],["type","range",3,"ngModelChange","min","max","disabled","ngModel","ngModelOptions"],["label","label","value","value",3,"options","isClearable"],["type","text",3,"ngModelChange","ngModel"],["href","#"],["label","label","value","value",3,"options","isLoading"],[1,"advanced-settings"],["for","password"],["type","password","name","password","autocomplete","disabled","placeholder",be,"tabindex","1",3,"ngModelChange","ngModel"],["for","repeatPassword"],["type","password","name","repeatPassword","autocomplete","disabled","placeholder",$e,"tabindex","2",3,"ngModelChange","disabled","ngModel"],["suffix","",1,"sh-success"],["suffix",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"loader"],["shButton","","shTooltip",se,1,"raised","primary",3,"loader","disabled"],["shButton","",1,"raised","primary",3,"click"],["shButton","","shTooltip",se,1,"raised","primary",3,"click","disabled"],[1,"sh-success"],["for","allowedHostnames"],["type","text","id","allowedHostnames",3,"ngModelChange","ngModel"],["type","primary"]]},template:function(t,n){if(t&1&&(R(0,"app-status-bar"),i(1,"div",40)(2,"header")(3,"div",41)(4,"h2"),r(5,0),o(),i(6,"p"),r(7,1),o()()(),i(8,"section")(9,"div",42)(10,"h3"),r(11,2),o(),i(12,"p"),I(13),o()(),i(14,"div",43),R(15,"app-remote-control"),o()(),i(16,"section")(17,"div",42)(18,"h3"),r(19,3),o(),i(20,"p"),r(21,4),o()(),i(22,"div",43)(23,"div",44)(24,"img",45),c("click",function(){return n.setLightMode()}),o(),i(25,"img",46),c("click",function(){return n.setDarkMode()}),o()()()(),i(26,"section")(27,"div",42)(28,"h3"),r(29,5),o(),i(30,"p"),r(31,6),o()(),i(32,"div",47),p(33,xt,15,7)(34,Jt,4,1,"div",48),o()(),i(35,"section")(36,"div",42)(37,"h3"),r(38,7),o(),i(39,"p"),r(40,8),o()(),i(41,"div",43)(42,"sh-select",49)(43,"input",50),c("ngModelChange",function(_){return n.updateLocale(_)}),o()()()(),i(44,"section")(45,"div",42)(46,"h3"),r(47,9),o(),i(48,"p"),r(49,10),o()(),i(50,"div",51)(51,"sh-toggle",52),c("click",function(){return n.updateRemoteAccess()}),i(52,"label"),r(53,11),o()(),p(54,Xt,8,3),o()(),i(55,"section")(56,"div",42)(57,"h3"),r(58,12),o(),i(59,"p"),r(60,13),o()(),i(61,"div",43)(62,"sh-toggle",52),c("click",function(){return n.saveDisableTrayIconLogin()}),i(63,"label"),r(64,14),o()()()(),i(65,"section")(66,"div",42)(67,"h3"),r(68,15),o(),i(69,"p"),p(70,Vt,1,1),o(),p(71,Ut,1,0,"sh-progress-bar",53),o(),i(72,"div",54)(73,"div",55),c("click",function(){return n.setNewChannel("")}),i(74,"sh-radio",56),r(75,16),o(),i(76,"p"),r(77,17),o()(),i(78,"div",55),c("click",function(){return n.setNewChannel("stable")}),i(79,"sh-radio",56),r(80,18),o(),i(81,"p"),r(82,19),o()(),i(83,"div",55),c("click",function(){return n.setNewChannel("beta")}),i(84,"sh-radio",56),r(85,20),o(),i(86,"p"),r(87,21),o()(),i(88,"div",55),c("click",function(){return n.setNewChannel("experimental")}),i(89,"sh-radio",56),r(90,22),o(),i(91,"p"),r(92,23),o()(),i(93,"div",55),c("click",function(){return n.setNewChannel("canary")}),i(94,"sh-radio",56),r(95,24),o(),i(96,"p"),r(97,25),o()()()()(),R(98,"sh-divider"),i(99,"div",40)(100,"section")(101,"div",42)(102,"h3"),r(103,26),o(),i(104,"p"),r(105,27),o()(),i(106,"div",43)(107,"div",57)(108,"sh-range-slider",58)(109,"input",59),v("ngModelChange",function(_){return A(n.timeValue,_)||(n.timeValue=_),_}),o()(),i(110,"sh-select",60)(111,"input",61),c("ngModelChange",function(_){return n.updateTimeType(_)}),o(),ae(112,zt,1,1,"ng-template"),o()()()(),i(113,"section")(114,"div",42)(115,"h3"),r(116,28),o(),i(117,"p"),L(118,29),R(119,"a",62)(120,"br")(121,"br"),b(),o()(),i(122,"div",43)(123,"sh-select",63)(124,"input",50),c("ngModelChange",function(_){return n.updateUsageStatistics(_)}),o(),ae(125,Bt,1,1,"ng-template"),o()()()(),i(126,"div",40)(127,"section")(128,"div",64)(129,"h3"),r(130,30),o(),R(131,"app-advanced-options-settings"),o()()()),t&2){let a,_,m;l(13),W(n.remoteControlStatus()),l(11),h("active",!n.isDarkMode()),l(),h("active",n.isDarkMode()),l(8),C(n.showPassphraseForm()?33:34),l(9),f("options",n.languageOptions())("isClearable",!1)("inlineSearch",!0),l(),f("ngModel",n.langCtrl())("ngModelOptions",j(43,de)),l(8),h("active",n.allowRemoteAccess()),l(3),C(n.allowRemoteAccess()?54:-1),l(8),h("active",n.disableTrayIconLogin()),l(8),C(n.updateChannel()!==""&&((a=n.sysinfo())!=null&&a.ServerVersion)?70:-1),l(),C(n.updatingChannel()?71:-1),l(3),h("active",n.updateChannel()===""),l(),re((_=n.sysinfo())==null?null:_.DefaultUpdateChannel),le(75),l(2),re((m=n.sysinfo())==null?null:m.ServerVersionType),le(77),l(2),h("active",n.updateChannel()==="stable"),l(5),h("active",n.updateChannel()==="beta"),l(5),h("active",n.updateChannel()==="experimental"),l(5),h("active",n.updateChannel()==="canary"),l(14),f("unit",n.timeType()==="none"?"s":n.timeType()),l(),f("min",n.timeRange()[0])("max",n.timeRange()[1])("disabled",n.timeType()==="none"),y("ngModel",n.timeValue),f("ngModelOptions",j(44,de)),l(),f("options",n.timeTypeOptions())("isClearable",!1),l(),f("ngModel",n.timeType()),l(12),f("options",n.usageStatisticsOptions())("isLoading",n.updatingUsageStatistics()),l(),f("ngModel",n.usageStatistics())("ngModelOptions",j(45,de))}},dependencies:[Z,K,it,Q,Y,ee,pt,oe,z,J,lt,_t,rt,Tt,St,ne,k,at,te,dt],styles:["[_nghost-%COMP%]{display:block}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem 2rem}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem 0;background:var(--base-1);border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}section[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;padding:2rem 0;border-top:1px solid var(--base-4)}section[_ngcontent-%COMP%]:first-of-type{border-top:0}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;align-items:flex-start}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] sh-button-group[_ngcontent-%COMP%]{margin-top:.25rem}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;width:50%}.passphrase-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:1rem}.passphrase-form[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.remote-access-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.themes[_ngcontent-%COMP%]{display:flex;gap:.5rem}.themes[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:15rem;border-radius:var(--shape-3);cursor:pointer}.themes[_ngcontent-%COMP%] img.active[_ngcontent-%COMP%]{border:2px solid var(--primary-8)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.radio-option[_ngcontent-%COMP%]{cursor:pointer}.radio-option[_ngcontent-%COMP%] sh-radio[_ngcontent-%COMP%]{color:var(--base-8);margin-bottom:.25rem}.radio-option[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;color:var(--base-9)}.field-col[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{flex:1 0}.advanced-settings[_ngcontent-%COMP%]{grid-column:1/-1;display:grid;grid-template-columns:auto 1fr;gap:1rem}"],changeDetection:0})};export{Ht as debounceSignal,Te as default};
@@ -1 +1 @@
1
- import{a as Lt,b as Rt,c as Bt}from"./chunk-PFZASYQH.js";import"./chunk-HHU5JW5J.js";import{a as Pt}from"./chunk-FSG362SU.js";import{h as yt}from"./chunk-C7EUC34O.js";import"./chunk-HYQ6MPYI.js";import"./chunk-YCORZV4Z.js";import"./chunk-4VY6SMSL.js";import"./chunk-MHPSC3FM.js";import"./chunk-Z27IQRKV.js";import{a as $}from"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import{b as St,d as mt}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B as k,C as $t,G as v,J as Mt,c as x,e as G,f as Nt,g as It,i as U,j as ht,r as Et,s as w,u as b,w as Ot,y as ft,z as At}from"./chunk-RPUPXDQE.js";import"./chunk-OJ3H3ZRA.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import{$b as l,Ab as st,Bb as Ft,Bc as Dt,Cb as m,Db as s,Eb as F,Fb as c,Jb as rt,Kb as lt,Mb as g,Pa as ot,Qc as R,Sa as r,Tb as _,Ub as u,Vb as y,Vc as gt,Wb as z,Wc as pt,Xb as H,Xc as Ct,Yb as J,Zb as D,_ as N,ac as ct,bc as _t,cb as E,ea as T,fa as d,gc as ut,hc as Tt,ja as it,kc as dt,nc as L,oc as X,pa as h,sc as O,tc as f,uc as A,vc as j,wc as W,xb as C,xc as B,yb as S,yc as q,zb as at}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var Ut=["*"],M=class o{destination=pt.required();static \u0275fac=function(t){return new(t||o)};static \u0275cmp=E({type:o,selectors:[["app-destination-list-item"]],inputs:{destination:[1,"destination"]},ngContentSelectors:Ut,decls:9,vars:6,consts:[[1,"type-b"],[1,"icon"],[3,"src","alt"],[1,"name"],[1,"description"],[1,"actions"]],template:function(t,i){if(t&1&&(ct(),s(0,"sh-card",0)(1,"div",1),c(2,"img",2),F(),s(3,"div",3),L(4),F(),s(5,"div",4),L(6),F(),s(7,"div",5),_t(8),F()()),t&2){let e=i.destination();r(2),m("src",q(e.icon),ot)("alt",q(e.displayName)),r(2),X(e.displayName),r(2),X(e.description)}},dependencies:[$t],styles:['[_nghost-%COMP%]{display:block}sh-card[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:3rem 1fr auto;grid-template-areas:"icon name actions" "icon description actions";gap:.25rem 1rem}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{grid-area:icon;display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:var(--shape-2)}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{object-fit:contain;width:100%;border-radius:var(--shape-2);overflow:hidden}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{grid-area:name;font:var(--paragraph-10)}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{grid-area:description;color:var(--base-8)}sh-card[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{grid-area:actions;display:flex;align-items:center;gap:.5rem}'],changeDetection:0})};function bt(o,n){if(o&1){let t=g();s(0,"app-destination-list-item",3)(1,"button",4),D("click",function(){let e=T(t).$implicit,a=l();return d(a.setDestination.emit(e.key))}),_(2,0),c(3,"sh-icon"),u(),F()()}if(o&2){let t=n.$implicit;m("destination",t)}}var K=class o{#i=N(Rt);setDestination=gt();destinationSearchTerm=h("");destinationTypeOptions=this.#i.destinationTypeOptions;destinationTypeOptionsFocused=R(()=>{let n=this.destinationTypeOptions(),t=this.destinationSearchTerm().toLowerCase(),i=[...n].sort((e,a)=>{let I=e.sortOrder??0,P=a.sortOrder??0;return I!==P?P-I:e.displayName.localeCompare(a.displayName)}).filter(e=>(e.sortOrder??0)>=0);return t?i.filter(e=>e.searchTerms.toLowerCase().includes(t)):i});static \u0275fac=function(t){return new(t||o)};static \u0275cmp=E({type:o,selectors:[["app-destination-list"]],outputs:{setDestination:"setDestination"},decls:5,vars:1,consts:()=>{let n;n=$localize`Search for destination...`;let t;return t=$localize` Choose ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`,[t,["type","text","placeholder",n,3,"ngModelChange","ngModel"],[1,"list"],[3,"destination"],["shButton","","type","button",3,"click"]]},template:function(t,i){t&1&&(s(0,"sh-form-field")(1,"input",1),A("ngModelChange",function(a){return f(i.destinationSearchTerm,a)||(i.destinationSearchTerm=a),a}),F()(),s(2,"div",2),st(3,bt,4,1,"app-destination-list-item",3,at),F()),t&2&&(r(),O("ngModel",i.destinationSearchTerm),r(2),Ft(i.destinationTypeOptionsFocused()))},dependencies:[M,w,x,G,U,v,k,b],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:hidden}.list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:auto;padding-bottom:1rem;border-bottom:.0625rem solid var(--base-4)}"],changeDetection:0})};var kt=["formRef"],vt=()=>({maxWidth:"700px",width:"100%"});function Kt(o,n){if(o&1){let t=g();_(0,1,1),s(1,"button",28),D("click",function(){T(t);let e=l();return d(e.testDestination(0,!0))}),F(),u()}if(o&2){let t=l();r(),dt("loader",t.testSignal()=="testing"),m("disabled",t.testSignal()=="testing")}}function Vt(o,n){if(o&1){let t=g();_(0,1,2),s(1,"button",29),D("click",function(){T(t);let e=l();return d(e.openTargetUrlDialog())}),c(2,"sh-icon"),F(),u()}}function zt(o,n){if(o&1){let t=g();_(0,1,4),s(1,"button",29),D("click",function(){T(t);let e=l(2);return d(e.copyTargetUrl())}),c(2,"sh-icon"),F(),u()}}function Ht(o,n){if(o&1){let t=g();_(0,1,3),s(1,"sh-menu")(2,"button",17),c(3,"sh-icon"),F(),rt(4,30),s(5,"button",29),D("click",function(){T(t);let e=l();return d(e.openTargetUrlDialog())}),c(6,"sh-icon"),F(),C(7,zt,3,0,"button",17),lt(),F(),u()}if(o&2){l();let t=B(0);r(7),S(t?7:-1)}}function Jt(o,n){o&1&&(s(0,"sh-alert"),_(1,4),c(2,"sh-icon",31),u(),F())}function Xt(o,n){o&1&&(s(0,"sh-alert",18),_(1,5),c(2,"sh-icon",31),u(),F())}function jt(o,n){if(o&1&&(s(0,"sh-alert",19),_(1,6),c(2,"sh-icon",31),u(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function Wt(o,n){if(o&1&&(s(0,"sh-alert",20),_(1,7),c(2,"sh-icon",31),u(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function qt(o,n){if(o&1){let t=g();s(0,"app-destination-list-item",21)(1,"button",24),D("click",function(){T(t);let e=l();return d(e.removeDestination())}),y(2,8),F()()}if(o&2){l();let t=B(14);m("destination",t)}}function Qt(o,n){if(o&1){let t=g();s(0,"app-destination-list",32),D("setDestination",function(e){T(t);let a=l();return d(a.setDestination(e))}),F()}}function Yt(o,n){if(o&1){let t=g();s(0,"app-single-destination",33),A("targetUrlChange",function(e){T(t);let a=l();return f(a.targetUrlModel,e)||(a.targetUrlModel=e),d(e)}),F()}if(o&2){let t=l();O("targetUrl",t.targetUrlModel),m("useBackupState",!0)}}function Zt(o,n){o&1&&(_(0,3,1),c(1,"sh-icon",26),u())}function te(o,n){o&1&&(_(0,3,2),c(1,"sh-icon"),u())}function ee(o,n){o&1&&(s(0,"h2"),y(1,11),F())}function ne(o,n){o&1&&(s(0,"h2"),y(1,12),F())}function ie(o,n){if(o&1){let t=g();s(0,"sh-dialog",34),A("isOpenChange",function(e){T(t);let a=l();return f(a.targetUrlDialogOpen,e)||(a.targetUrlDialogOpen=e),d(e)}),s(1,"header",35),C(2,ee,2,0,"h2")(3,ne,2,0,"h2"),s(4,"sh-alert",19),y(5,9),F()(),s(6,"div",36)(7,"sh-form-field")(8,"textarea",37),A("ngModelChange",function(e){T(t);let a=l();return f(a.targetUrlCtrl,e)||(a.targetUrlCtrl=e),d(e)}),F()()(),s(9,"footer",38)(10,"button",24),D("click",function(){T(t);let e=l();return d(e.closeTargetUrlDialog(!1))}),L(11,"Cancel"),F(),s(12,"button",39),D("click",function(){T(t);let e=l();return d(e.closeTargetUrlDialog(!0))}),_(13,10),c(14,"sh-icon"),u(),F()()()}if(o&2){let t=l(),i=B(0);O("isOpen",t.targetUrlDialogOpen),m("options",Dt(4,vt)),r(2),S(i?3:2),r(6),O("ngModel",t.targetUrlCtrl)}}var V=new Et,Le=(o={destinations:[]})=>V.group({destinations:V.array(o.destinations)}),Re=({key:o,customGroup:n,dynamicGroup:t,advancedGroup:i})=>V.group({destinationType:V.control(o),custom:n,dynamic:t,advanced:i}),Q=class o{#i=N(mt);#o=N(St);#t=N(yt);#e=N(At);#a=N(Lt);injector=N(it);formRef=Ct.required("formRef");targetUrlModel=this.#t.targetUrlModel;targetUrlCtrl=h(null);targetUrlInitial=h(null);targetUrlDialogOpen=h(!1);toggleNewDestination=h(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;selectedDestinationType=R(()=>{let n=this.targetUrlModel();if(!n)return null;let t=n.split("://")[0];return Pt(t)??null});selectedDestinationTypeOption=R(()=>{let n=this.selectedDestinationType();return n?{key:n.customKey??n.key,customKey:n.customKey??null,displayName:n.displayName,description:n.description,icon:n.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.targetUrlModel()??"")}openTargetUrlDialog(){let n=this.targetUrlModel();this.targetUrlCtrl.set(n),this.targetUrlInitial.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),i=this.targetUrlInitial();!n||t===i||!t||this.#t.setTargetUrl(t)}testDestination(n,t,i){let e=this.targetUrlModel();e&&(this.#t.setTestState("testing"),this.#a.testDestination(e,this.#t.backupId(),n,!0,!0).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),this.#t.isNew()&&(a.containsBackup===!0?(this.#t.setTestState("warning",$localize`The remote destination already contains a backup. Please use a different folder for each backup.`),t||this.#e.open($,{data:{title:$localize`Folder contains backup`,message:$localize`The remote destination already contains a backup. You must use a different folder for each backup.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!0&&(this.#t.setTestState("warning",$localize`The remote destination contains unknown files.`),t||this.#e.open($,{data:{title:$localize`Folder is not empty`,message:$localize`The remote destination is not empty. It is recommended to use an empty folder for the backup.`,confirmText:$localize`OK`,cancelText:void 0}}))),i?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){i?.();return}let I=e.includes("?");a.action==="trust-cert"&&this.#t.setTargetUrl(e+`${I?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.setTargetUrl(e+`${I?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):i?.()}}))}setDestination(n){this.#t.setTargetUrl(`${n}://`,!0)}removeDestination(){this.#t.setTargetUrl(null,!0)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let n=this.#t.isNew(),t=this.testSignal();if(!n){this.#n();return}if(t===""){this.#e.open($,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:i=>{i?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open($,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(t!=="success"){this.#e.open($,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:i=>{i&&this.#n()}});return}this.#n()}#n(){this.#t.isNew()||this.#t.submit(!0),this.#i.navigate(["source-data"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=E({type:o,selectors:[["app-destination"]],viewQuery:function(t,i){t&1&&ut(i.formRef,kt,5),t&2&&Tt()},decls:27,vars:11,consts:()=>{let n;n=$localize` Backup destination ${"\uFFFD#6\uFFFD"}:START_TAG_DIV:${"[\uFFFD*7:1\uFFFD|\uFFFD*7:4\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON: Test destination ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*8:2\uFFFD"}:START_BLOCK_IF_1:${"[\uFFFD#1:2\uFFFD|\uFFFD#5:3\uFFFD]"}:START_TAG_BUTTON_1:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Set target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*9:3\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:3\uFFFD"}:START_TAG_SH_MENU:${"\uFFFD#2:3\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:dots-three-vertical${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#4:3\uFFFD"}:START_TAG_NG_CONTAINER:${"[\uFFFD#1:2\uFFFD|\uFFFD#5:3\uFFFD]"}:START_TAG_BUTTON_1:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD*7:1\uFFFD|\uFFFD*7:4\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:4\uFFFD"}:START_TAG_BUTTON_3:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD/#4:3\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#1:3\uFFFD"}:CLOSE_TAG_SH_MENU:${"\uFFFD/*9:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_DIV:`,n=J(n);let t;t=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let i;i=$localize`${"\uFFFD*24:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*24:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*25:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*25:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,i=J(i);let e;e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let I;I=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let P;P=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let Y;Y=$localize`Change`;let Z;Z=$localize`Be careful, this will overwrite everything you have in your destination.`;let tt;tt=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`;let et;et=$localize`Set target URL`;let nt;return nt=$localize`Edit target URL`,[["formRef",""],n,t,i,e,a,I,P,Y,Z,tt,et,nt,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"loader","disabled"],["shButton","","type","button",1,"small"],[1,"success"],[1,"warn"],[1,"error"],[1,"current-destination",3,"destination"],[3,"targetUrl","useBackupState"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["shButton","","type","button",1,"small",3,"click"],["menu",""],["icon",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl","useBackupState"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,i){if(t&1){let e=g();j(0),s(1,"form",13,0),D("submit",function(){return T(e),d(i.next())}),s(3,"header")(4,"h3",14),_(5,1),s(6,"div",15),C(7,Kt,2,3,"button",16),C(8,Vt,3,0,"button",17)(9,Ht,8,1,"sh-menu"),F(),u(),F(),C(10,Jt,3,0,"sh-alert")(11,Xt,3,0,"sh-alert",18)(12,jt,3,1,"sh-alert",19)(13,Wt,3,1,"sh-alert",20),j(14),C(15,qt,3,1,"app-destination-list-item",21),F(),C(16,Qt,1,0,"app-destination-list"),C(17,Yt,1,2,"app-single-destination",22),s(18,"div",23)(19,"button",24),D("click",function(){return T(e),d(i.goBack())}),_(20,2),c(21,"sh-icon"),u(),F(),s(22,"button",25),_(23,3),C(24,Zt,2,0,"sh-icon",26)(25,te,2,0,"sh-icon"),u(),F()()(),C(26,ie,15,5,"sh-dialog",27)}if(t&2){let e=W(!!i.targetUrlModel());r(7),S(e?7:-1),r(),S(e?9:8),r(2),S(i.testSignal()=="testing"?10:i.testSignal()=="success"?11:i.testSignal()=="warning"?12:i.testSignal()=="error"?13:-1),r(4);let a=W(i.selectedDestinationTypeOption());r(),S(a?15:-1),r(),S(e?-1:16),r(),S(e?17:-1),r(5),m("disabled",i.testSignal()=="testing"||!e),r(2),S(i.testSignal()=="testing"?24:25),r(2),S(i.targetUrlDialogOpen()?26:-1)}},dependencies:[Bt,K,M,w,ht,x,G,Nt,U,It,k,v,Mt,b,ft,Ot],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 0}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;height:100%;padding:0 0 2.5rem}.current-destination[_ngcontent-%COMP%]{margin:1rem 0 0}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}"],changeDetection:0})};export{Le as createDestinationForm,Re as createDestinationFormGroup,Q as default};
1
+ import{a as Lt,b as Rt,c as Bt}from"./chunk-NYILY6CE.js";import"./chunk-HHU5JW5J.js";import{a as Pt}from"./chunk-FSG362SU.js";import{h as yt}from"./chunk-BNUMPQFL.js";import"./chunk-HYQ6MPYI.js";import"./chunk-YCORZV4Z.js";import"./chunk-4VY6SMSL.js";import"./chunk-MHPSC3FM.js";import"./chunk-Z27IQRKV.js";import{a as $}from"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import{b as St,d as mt}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B as k,C as $t,G as v,J as Mt,c as x,e as G,f as Nt,g as It,i as U,j as ht,r as Et,s as w,u as b,w as Ot,y as ft,z as At}from"./chunk-RPUPXDQE.js";import"./chunk-OJ3H3ZRA.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import{$b as l,Ab as st,Bb as Ft,Bc as Dt,Cb as m,Db as s,Eb as F,Fb as c,Jb as rt,Kb as lt,Mb as g,Pa as ot,Qc as R,Sa as r,Tb as _,Ub as u,Vb as y,Vc as gt,Wb as z,Wc as pt,Xb as H,Xc as Ct,Yb as J,Zb as D,_ as N,ac as ct,bc as _t,cb as E,ea as T,fa as d,gc as ut,hc as Tt,ja as it,kc as dt,nc as L,oc as X,pa as h,sc as O,tc as f,uc as A,vc as j,wc as W,xb as C,xc as B,yb as S,yc as q,zb as at}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var Ut=["*"],M=class o{destination=pt.required();static \u0275fac=function(t){return new(t||o)};static \u0275cmp=E({type:o,selectors:[["app-destination-list-item"]],inputs:{destination:[1,"destination"]},ngContentSelectors:Ut,decls:9,vars:6,consts:[[1,"type-b"],[1,"icon"],[3,"src","alt"],[1,"name"],[1,"description"],[1,"actions"]],template:function(t,i){if(t&1&&(ct(),s(0,"sh-card",0)(1,"div",1),c(2,"img",2),F(),s(3,"div",3),L(4),F(),s(5,"div",4),L(6),F(),s(7,"div",5),_t(8),F()()),t&2){let e=i.destination();r(2),m("src",q(e.icon),ot)("alt",q(e.displayName)),r(2),X(e.displayName),r(2),X(e.description)}},dependencies:[$t],styles:['[_nghost-%COMP%]{display:block}sh-card[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:3rem 1fr auto;grid-template-areas:"icon name actions" "icon description actions";gap:.25rem 1rem}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{grid-area:icon;display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:var(--shape-2)}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{object-fit:contain;width:100%;border-radius:var(--shape-2);overflow:hidden}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{grid-area:name;font:var(--paragraph-10)}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{grid-area:description;color:var(--base-8)}sh-card[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{grid-area:actions;display:flex;align-items:center;gap:.5rem}'],changeDetection:0})};function bt(o,n){if(o&1){let t=g();s(0,"app-destination-list-item",3)(1,"button",4),D("click",function(){let e=T(t).$implicit,a=l();return d(a.setDestination.emit(e.key))}),_(2,0),c(3,"sh-icon"),u(),F()()}if(o&2){let t=n.$implicit;m("destination",t)}}var K=class o{#i=N(Rt);setDestination=gt();destinationSearchTerm=h("");destinationTypeOptions=this.#i.destinationTypeOptions;destinationTypeOptionsFocused=R(()=>{let n=this.destinationTypeOptions(),t=this.destinationSearchTerm().toLowerCase(),i=[...n].sort((e,a)=>{let I=e.sortOrder??0,P=a.sortOrder??0;return I!==P?P-I:e.displayName.localeCompare(a.displayName)}).filter(e=>(e.sortOrder??0)>=0);return t?i.filter(e=>e.searchTerms.toLowerCase().includes(t)):i});static \u0275fac=function(t){return new(t||o)};static \u0275cmp=E({type:o,selectors:[["app-destination-list"]],outputs:{setDestination:"setDestination"},decls:5,vars:1,consts:()=>{let n;n=$localize`Search for destination...`;let t;return t=$localize` Choose ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`,[t,["type","text","placeholder",n,3,"ngModelChange","ngModel"],[1,"list"],[3,"destination"],["shButton","","type","button",3,"click"]]},template:function(t,i){t&1&&(s(0,"sh-form-field")(1,"input",1),A("ngModelChange",function(a){return f(i.destinationSearchTerm,a)||(i.destinationSearchTerm=a),a}),F()(),s(2,"div",2),st(3,bt,4,1,"app-destination-list-item",3,at),F()),t&2&&(r(),O("ngModel",i.destinationSearchTerm),r(2),Ft(i.destinationTypeOptionsFocused()))},dependencies:[M,w,x,G,U,v,k,b],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:hidden}.list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:auto;padding-bottom:1rem;border-bottom:.0625rem solid var(--base-4)}"],changeDetection:0})};var kt=["formRef"],vt=()=>({maxWidth:"700px",width:"100%"});function Kt(o,n){if(o&1){let t=g();_(0,1,1),s(1,"button",28),D("click",function(){T(t);let e=l();return d(e.testDestination(0,!0))}),F(),u()}if(o&2){let t=l();r(),dt("loader",t.testSignal()=="testing"),m("disabled",t.testSignal()=="testing")}}function Vt(o,n){if(o&1){let t=g();_(0,1,2),s(1,"button",29),D("click",function(){T(t);let e=l();return d(e.openTargetUrlDialog())}),c(2,"sh-icon"),F(),u()}}function zt(o,n){if(o&1){let t=g();_(0,1,4),s(1,"button",29),D("click",function(){T(t);let e=l(2);return d(e.copyTargetUrl())}),c(2,"sh-icon"),F(),u()}}function Ht(o,n){if(o&1){let t=g();_(0,1,3),s(1,"sh-menu")(2,"button",17),c(3,"sh-icon"),F(),rt(4,30),s(5,"button",29),D("click",function(){T(t);let e=l();return d(e.openTargetUrlDialog())}),c(6,"sh-icon"),F(),C(7,zt,3,0,"button",17),lt(),F(),u()}if(o&2){l();let t=B(0);r(7),S(t?7:-1)}}function Jt(o,n){o&1&&(s(0,"sh-alert"),_(1,4),c(2,"sh-icon",31),u(),F())}function Xt(o,n){o&1&&(s(0,"sh-alert",18),_(1,5),c(2,"sh-icon",31),u(),F())}function jt(o,n){if(o&1&&(s(0,"sh-alert",19),_(1,6),c(2,"sh-icon",31),u(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function Wt(o,n){if(o&1&&(s(0,"sh-alert",20),_(1,7),c(2,"sh-icon",31),u(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function qt(o,n){if(o&1){let t=g();s(0,"app-destination-list-item",21)(1,"button",24),D("click",function(){T(t);let e=l();return d(e.removeDestination())}),y(2,8),F()()}if(o&2){l();let t=B(14);m("destination",t)}}function Qt(o,n){if(o&1){let t=g();s(0,"app-destination-list",32),D("setDestination",function(e){T(t);let a=l();return d(a.setDestination(e))}),F()}}function Yt(o,n){if(o&1){let t=g();s(0,"app-single-destination",33),A("targetUrlChange",function(e){T(t);let a=l();return f(a.targetUrlModel,e)||(a.targetUrlModel=e),d(e)}),F()}if(o&2){let t=l();O("targetUrl",t.targetUrlModel),m("useBackupState",!0)}}function Zt(o,n){o&1&&(_(0,3,1),c(1,"sh-icon",26),u())}function te(o,n){o&1&&(_(0,3,2),c(1,"sh-icon"),u())}function ee(o,n){o&1&&(s(0,"h2"),y(1,11),F())}function ne(o,n){o&1&&(s(0,"h2"),y(1,12),F())}function ie(o,n){if(o&1){let t=g();s(0,"sh-dialog",34),A("isOpenChange",function(e){T(t);let a=l();return f(a.targetUrlDialogOpen,e)||(a.targetUrlDialogOpen=e),d(e)}),s(1,"header",35),C(2,ee,2,0,"h2")(3,ne,2,0,"h2"),s(4,"sh-alert",19),y(5,9),F()(),s(6,"div",36)(7,"sh-form-field")(8,"textarea",37),A("ngModelChange",function(e){T(t);let a=l();return f(a.targetUrlCtrl,e)||(a.targetUrlCtrl=e),d(e)}),F()()(),s(9,"footer",38)(10,"button",24),D("click",function(){T(t);let e=l();return d(e.closeTargetUrlDialog(!1))}),L(11,"Cancel"),F(),s(12,"button",39),D("click",function(){T(t);let e=l();return d(e.closeTargetUrlDialog(!0))}),_(13,10),c(14,"sh-icon"),u(),F()()()}if(o&2){let t=l(),i=B(0);O("isOpen",t.targetUrlDialogOpen),m("options",Dt(4,vt)),r(2),S(i?3:2),r(6),O("ngModel",t.targetUrlCtrl)}}var V=new Et,Le=(o={destinations:[]})=>V.group({destinations:V.array(o.destinations)}),Re=({key:o,customGroup:n,dynamicGroup:t,advancedGroup:i})=>V.group({destinationType:V.control(o),custom:n,dynamic:t,advanced:i}),Q=class o{#i=N(mt);#o=N(St);#t=N(yt);#e=N(At);#a=N(Lt);injector=N(it);formRef=Ct.required("formRef");targetUrlModel=this.#t.targetUrlModel;targetUrlCtrl=h(null);targetUrlInitial=h(null);targetUrlDialogOpen=h(!1);toggleNewDestination=h(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;selectedDestinationType=R(()=>{let n=this.targetUrlModel();if(!n)return null;let t=n.split("://")[0];return Pt(t)??null});selectedDestinationTypeOption=R(()=>{let n=this.selectedDestinationType();return n?{key:n.customKey??n.key,customKey:n.customKey??null,displayName:n.displayName,description:n.description,icon:n.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.targetUrlModel()??"")}openTargetUrlDialog(){let n=this.targetUrlModel();this.targetUrlCtrl.set(n),this.targetUrlInitial.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),i=this.targetUrlInitial();!n||t===i||!t||this.#t.setTargetUrl(t)}testDestination(n,t,i){let e=this.targetUrlModel();e&&(this.#t.setTestState("testing"),this.#a.testDestination(e,this.#t.backupId(),n,!0,!0).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),this.#t.isNew()&&(a.containsBackup===!0?(this.#t.setTestState("warning",$localize`The remote destination already contains a backup. Please use a different folder for each backup.`),t||this.#e.open($,{data:{title:$localize`Folder contains backup`,message:$localize`The remote destination already contains a backup. You must use a different folder for each backup.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!0&&(this.#t.setTestState("warning",$localize`The remote destination contains unknown files.`),t||this.#e.open($,{data:{title:$localize`Folder is not empty`,message:$localize`The remote destination is not empty. It is recommended to use an empty folder for the backup.`,confirmText:$localize`OK`,cancelText:void 0}}))),i?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){i?.();return}let I=e.includes("?");a.action==="trust-cert"&&this.#t.setTargetUrl(e+`${I?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.setTargetUrl(e+`${I?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):i?.()}}))}setDestination(n){this.#t.setTargetUrl(`${n}://`,!0)}removeDestination(){this.#t.setTargetUrl(null,!0)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let n=this.#t.isNew(),t=this.testSignal();if(!n){this.#n();return}if(t===""){this.#e.open($,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:i=>{i?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open($,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(t!=="success"){this.#e.open($,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:i=>{i&&this.#n()}});return}this.#n()}#n(){this.#t.isNew()||this.#t.submit(!0),this.#i.navigate(["source-data"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=E({type:o,selectors:[["app-destination"]],viewQuery:function(t,i){t&1&&ut(i.formRef,kt,5),t&2&&Tt()},decls:27,vars:11,consts:()=>{let n;n=$localize` Backup destination ${"\uFFFD#6\uFFFD"}:START_TAG_DIV:${"[\uFFFD*7:1\uFFFD|\uFFFD*7:4\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON: Test destination ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*8:2\uFFFD"}:START_BLOCK_IF_1:${"[\uFFFD#1:2\uFFFD|\uFFFD#5:3\uFFFD]"}:START_TAG_BUTTON_1:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Set target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*9:3\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:3\uFFFD"}:START_TAG_SH_MENU:${"\uFFFD#2:3\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:dots-three-vertical${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#4:3\uFFFD"}:START_TAG_NG_CONTAINER:${"[\uFFFD#1:2\uFFFD|\uFFFD#5:3\uFFFD]"}:START_TAG_BUTTON_1:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD*7:1\uFFFD|\uFFFD*7:4\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:4\uFFFD"}:START_TAG_BUTTON_3:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD/#4:3\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#1:3\uFFFD"}:CLOSE_TAG_SH_MENU:${"\uFFFD/*9:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_DIV:`,n=J(n);let t;t=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let i;i=$localize`${"\uFFFD*24:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*24:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*25:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*25:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,i=J(i);let e;e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let I;I=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let P;P=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let Y;Y=$localize`Change`;let Z;Z=$localize`Be careful, this will overwrite everything you have in your destination.`;let tt;tt=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`;let et;et=$localize`Set target URL`;let nt;return nt=$localize`Edit target URL`,[["formRef",""],n,t,i,e,a,I,P,Y,Z,tt,et,nt,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"loader","disabled"],["shButton","","type","button",1,"small"],[1,"success"],[1,"warn"],[1,"error"],[1,"current-destination",3,"destination"],[3,"targetUrl","useBackupState"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["shButton","","type","button",1,"small",3,"click"],["menu",""],["icon",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl","useBackupState"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,i){if(t&1){let e=g();j(0),s(1,"form",13,0),D("submit",function(){return T(e),d(i.next())}),s(3,"header")(4,"h3",14),_(5,1),s(6,"div",15),C(7,Kt,2,3,"button",16),C(8,Vt,3,0,"button",17)(9,Ht,8,1,"sh-menu"),F(),u(),F(),C(10,Jt,3,0,"sh-alert")(11,Xt,3,0,"sh-alert",18)(12,jt,3,1,"sh-alert",19)(13,Wt,3,1,"sh-alert",20),j(14),C(15,qt,3,1,"app-destination-list-item",21),F(),C(16,Qt,1,0,"app-destination-list"),C(17,Yt,1,2,"app-single-destination",22),s(18,"div",23)(19,"button",24),D("click",function(){return T(e),d(i.goBack())}),_(20,2),c(21,"sh-icon"),u(),F(),s(22,"button",25),_(23,3),C(24,Zt,2,0,"sh-icon",26)(25,te,2,0,"sh-icon"),u(),F()()(),C(26,ie,15,5,"sh-dialog",27)}if(t&2){let e=W(!!i.targetUrlModel());r(7),S(e?7:-1),r(),S(e?9:8),r(2),S(i.testSignal()=="testing"?10:i.testSignal()=="success"?11:i.testSignal()=="warning"?12:i.testSignal()=="error"?13:-1),r(4);let a=W(i.selectedDestinationTypeOption());r(),S(a?15:-1),r(),S(e?-1:16),r(),S(e?17:-1),r(5),m("disabled",i.testSignal()=="testing"||!e),r(2),S(i.testSignal()=="testing"?24:25),r(2),S(i.targetUrlDialogOpen()?26:-1)}},dependencies:[Bt,K,M,w,ht,x,G,Nt,U,It,k,v,Mt,b,ft,Ot],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 0}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;height:100%;padding:0 0 2.5rem}.current-destination[_ngcontent-%COMP%]{margin:1rem 0 0}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}"],changeDetection:0})};export{Le as createDestinationForm,Re as createDestinationFormGroup,Q as default};
package/index.html CHANGED
@@ -83,5 +83,5 @@
83
83
  <body>
84
84
  <app-root></app-root>
85
85
  <div class="loading">Connecting ...</div>
86
- <link rel="modulepreload" href="chunk-YJPY33RI.js"><link rel="modulepreload" href="chunk-XXVFRNSP.js"><link rel="modulepreload" href="chunk-H7ZKBS2Q.js"><link rel="modulepreload" href="chunk-2YGOHGD2.js"><link rel="modulepreload" href="chunk-BK2MSH26.js"><link rel="modulepreload" href="chunk-3V4DGTSM.js"><link rel="modulepreload" href="chunk-6Q6SSTBK.js"><link rel="modulepreload" href="chunk-5LX6M65H.js"><link rel="modulepreload" href="chunk-LN26XMBJ.js"><link rel="modulepreload" href="chunk-S4OFJD2F.js"><script src="polyfills-S663R3NQ.js" type="module"></script><script src="main-L6FT73U5.js" type="module"></script></body>
86
+ <link rel="modulepreload" href="chunk-YJPY33RI.js"><link rel="modulepreload" href="chunk-XXVFRNSP.js"><link rel="modulepreload" href="chunk-H7ZKBS2Q.js"><link rel="modulepreload" href="chunk-2YGOHGD2.js"><link rel="modulepreload" href="chunk-BK2MSH26.js"><link rel="modulepreload" href="chunk-3V4DGTSM.js"><link rel="modulepreload" href="chunk-6Q6SSTBK.js"><link rel="modulepreload" href="chunk-5LX6M65H.js"><link rel="modulepreload" href="chunk-LN26XMBJ.js"><link rel="modulepreload" href="chunk-S4OFJD2F.js"><script src="polyfills-S663R3NQ.js" type="module"></script><script src="main-IH6ESA7A.js" type="module"></script></body>
87
87
  </html>
@@ -1 +1 @@
1
- import{b as Ce,c as Se}from"./chunk-YJPY33RI.js";import{a as ge}from"./chunk-XXVFRNSP.js";import{a as I}from"./chunk-H7ZKBS2Q.js";import"./chunk-2YGOHGD2.js";import"./chunk-BK2MSH26.js";import"./chunk-3V4DGTSM.js";import{a as P}from"./chunk-6Q6SSTBK.js";import{a as L}from"./chunk-5LX6M65H.js";import{a as he}from"./chunk-LN26XMBJ.js";import"./chunk-S4OFJD2F.js";import{a as b,b as v,c as fe,d as k}from"./chunk-6XI3IP27.js";import{c as ae,d as pe,g as ce,h as le}from"./chunk-ABYM5HWA.js";import{a as ee}from"./chunk-Z35OG2DV.js";import{v as me,x as de}from"./chunk-RPUPXDQE.js";import{a as te,b as oe,c as ne,e as re,f as se,g as ie,j as ue}from"./chunk-OJ3H3ZRA.js";import{a as be}from"./chunk-I2LW33GO.js";import{la as Y,qa as Z}from"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import{a as ve}from"./chunk-UCS5RU7N.js";import{b as ye}from"./chunk-JYWOYPSQ.js";import{A as x,B,Fb as z,H as T,Lc as q,Mc as X,N as G,P as R,R as J,Rc as Q,V as M,Y as _,_ as s,cb as K,f as j,i as U,ja as $,n as W,o as F,pa as d,r as S}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var E=class e{#o=s(b);#s=s(v);ngOnInit(){this.#s.fetchConfig(),this.#o.clearAllNotCurrentVersion()}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=K({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&z(0,"router-outlet")},dependencies:[ae],encapsulation:2})};var we={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var h=new _("ENVIRONMENT");var A=class e{#o=s(ue);isLoaded=d(!1);webmodules=d(null);preload(t=!1){let o=this.#o.getApiV1Webmodules().pipe(J(n=>this.webmodules.set(n)),T(()=>this.isLoaded.set(!0)));if(t)return o;o.subscribe()}static \u0275fac=function(o){return new(o||e)};static \u0275prov=M({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ne=()=>{let e=s(k);return e.token()?!0:e.checkProxyAuthed().pipe(R(t=>t?W(!0):e.refreshToken().pipe(S(()=>!0))))},Oe=()=>{let e=s(v),t=s(I),o=s($),n=e.relayIsEnabled()?"longpoll":"websocket",i=[o.get(L).preload(!0),o.get(L).preloadFilterGroups(!0),o.get(A).preload(!0)];return e.configLoaded===null?x(i).pipe(S(()=>n)):e.configLoaded?.pipe(R(()=>x(i)))},Te=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-A366Q7F5.js")},{path:"logout",loadComponent:()=>import("./chunk-2KU5X7TN.js")},{path:"",canActivate:[Ne],children:[{path:"",canActivate:[Oe],loadComponent:()=>import("./chunk-4FWCJIJ4.js"),children:[{path:"",loadComponent:()=>import("./chunk-HJBNADRP.js")},{path:"add-backup",loadComponent:()=>import("./chunk-DJQOPNQJ.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-GMUNZKVL.js")},{path:"backup/import",loadComponent:()=>import("./chunk-AUR4SBGD.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-NSPJ3ZXL.js"),loadChildren:()=>import("./chunk-MTNOIKEK.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-NSPJ3ZXL.js"),loadChildren:()=>import("./chunk-MTNOIKEK.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-SPMSFKWG.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-YYJFEUNT.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-MWXDEOZO.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-5CTM5KYC.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-2MIEBBFN.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-KIIJBHZE.js")},{path:"from-config",loadComponent:()=>import("./chunk-B32YSHV5.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-3S7YCGEK.js"),loadChildren:()=>import("./chunk-MBYGBVHF.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-3S7YCGEK.js"),loadChildren:()=>import("./chunk-MBYGBVHF.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-3S7YCGEK.js"),loadChildren:()=>import("./chunk-MBYGBVHF.js")},{path:"settings",loadComponent:()=>import("./chunk-P6IZFXXC.js")},{path:"about",loadComponent:()=>import("./chunk-H44BDPZE.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-BF2IYOUB.js")},{path:"changelog",loadComponent:()=>import("./chunk-Z7WHLTVV.js")},{path:"libraries",loadComponent:()=>import("./chunk-CSL7HCLZ.js")},{path:"system-info",loadComponent:()=>import("./chunk-4KEA3KF7.js")},{path:"server-settings",loadComponent:()=>import("./chunk-CTAP3SAA.js")},{path:"logs",loadChildren:()=>import("./chunk-QF5WMLMJ.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-BZ2XGEV5.js")}]}]}]}]}];var V=null,Me=(e,t)=>{let o=s(k),n=s(pe),i=s(b),l=s(h),r=i.getItem("locale"),u=s(de),p=Ce(r),a=e.url==="/api/v1/auth/login",m=e.url==="/api/v1/auth/refresh",C=e.url==="/api/v1/progressstate",g=e.url==="/api/v1/remoteoperation/test",y=e.url==="/api/v1/filesystem/validate",w=e.url.startsWith("/api/v2/"),O=o.token(),D=e,H=e.headers.has("custom-proxy-check")||O===fe;if(O&&e.url.startsWith(l.baseUrl)&&!H){let c=e.headers.set("Authorization",`Bearer ${O}`);r&&r!=="en-US"&&(c=c.set("X-Ui-Language",p)),D=e.clone({headers:c})}return t(D).pipe(S(c=>{if(c.type===4&&c.status===200&&w){let f=c.body;if(f?.Success===!1)throw{status:200,message:f?.Error??"Unknown error",error:{Error:f?.Error??"Unknown error"},requestBody:f}}return c}),B(c=>{let f=c.error?.Error||`Error Code: ${c.status}, Message: ${c.message}`;return!H&&(C&&c.status===404||g||y||u.error(f),m&&c.status===401&&(o.logout(),n.navigate(["/logout"])),!a&&!m&&c.status===401)?(V??=o.refreshToken().pipe(G()),V.pipe(R(()=>t(e.clone({headers:e.headers.set("Authorization",`Bearer ${o.token()}`)}))),T(()=>V=null))):F(()=>({error:c,message:f}))}))};var xe="1.0.0",ke=`portal-proxy-client-${P()}`,Le=1,N=class e{#o=1e3;#s=s(h);#t=d("disconnected");#l=d(this.#o);#i=d(!1);#n=d(!1);#a=d(null);isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#t.asReadonly();#p=[];#r={};#e=null;#m=new TextDecoder("utf-8");#c=null;#d=Q(()=>{let t=this.#i(),o=this.#l(),n=this.#a();if(!n||!t||!o||o<this.#o){this.#c&&window.clearInterval(this.#c);return}this.#c=window.setInterval(()=>{this.connectToMachineServer(n)},o)});utf8Atob(t){let o=Uint8Array.from(atob(t),i=>i.charCodeAt(0)),n=this.#m.decode(o);return n?JSON.parse(n):null}connectToMachineServer(t,o){let n=o?.reconnect??!1,i=this.wsState();(i==="disconnected"||i==="error"||n)&&(this.#e?.close(),this.#e=null),!this.#e&&(this.#e=new WebSocket(this.#s.machineServerUrl),this.#t.set("connecting"),this.#e.onopen=()=>{this.#t.set("connect"),this.#n.set(!0),this.#i.set(!1),this.#a.set(null)},this.#e.onclose=()=>{this.#t.set("disconnected"),this.#n.set(!1),this.#a.set(t),this.#i.set(!0)},this.#e.onerror=()=>{this.#t.set("error")},this.#e.onmessage=l=>{let r=JSON.parse(l.data);if(this.wsState()==="connect"){if(r.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${r.type}'`);return}let p={token:t,publicKey:"",clientVersion:xe,protocolVersion:Le},a=this.createResponse(r,"authportal",p);this.#t.set("welcome"),this.#e?.send(a)}else if(this.wsState()==="welcome"){if(r.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${r.type}'`);return}var u=JSON.parse(r.payload??"");if(u.accepted===!1){this.disconnectFromMachineServer("Authentication failed");return}for(this.#t.set("authenticated"),this.#n.set(!0);this.#p.length>0;){let p=this.#p.pop();p&&this.#r[p.messageId]&&this.activateCommand(p)}}else if(this.wsState()==="authenticated"){if(r.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${r.type}'`);return}let p=this.#r[r.messageId];if(p){if(r.errorMessage){p.reject(r.errorMessage);return}else{let a=JSON.parse(r.payload??"");a.body=a?.body==null?null:this.utf8Atob(a.body),p.resolve(a)}delete this.#r[r.messageId],window.clearTimeout(p.timer)}}})}disconnectFromMachineServer(t=null){t&&console.error(t),this.#e?.close(),this.#e=null,this.#t.set("disconnected"),this.#n.set(!1)}createResponse(t,o,n){let i={from:ke,to:t.from,type:o,messageId:t.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(t,o,n,i,l,r,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(t),new Promise((p,a)=>{let m=P(),g={from:ke,to:o,type:"command",messageId:m,payload:JSON.stringify({method:n,path:i,requestBody:l,headers:r})},y={resolve:p,reject:a,timer:window.setTimeout(()=>{let w=this.#r[m];w&&(delete this.#r[m],w.reject("Timeout"))},u)};this.#r[m]=y,this.#n()?this.activateCommand(g):this.#p.push(g)})}activateCommand(t){this.#e?.send(JSON.stringify(t))}static \u0275fac=function(o){return new(o||e)};static \u0275prov=M({token:e,factory:e.\u0275fac,providedIn:"root"})};function Pe(e){if(typeof e!="string")return null;let o=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...o))}function Ie(e,t,o){let n=e.relayconfigState.config();if(n===null)return o(t);let i=Pe(t.body),l={};t.headers.keys().forEach(a=>{l[a]=t.headers.get(a)??""});let r=t.headers.get("timeout"),u=r!==null?parseInt(r):e.defaultTimeout;t.url.startsWith("/api/v1/serverstate")&&t.url.includes("longpoll=true")&&(u=1e3*99);let p=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,t.method,t.url,i,l,u);return new j(a=>{p.then(m=>{let C=new te;l!=null&&Object.keys(l).forEach(y=>{C.set(y,l[y])});let g=new oe({body:m.body,status:m.code,statusText:"OK",headers:C});a.next(g),a.complete()}).catch(m=>{a.error(new ne({error:m??"Unknown error",status:0,statusText:m??"Unknown error"}))})})}var Ee=(e,t)=>{let o={relayconfigState:s(v),defaultTimeout:s(h).defaultTimeout,relayWebsocket:s(N)},n=o.relayconfigState.config();if(o.relayconfigState.configLoaded!==null&&n===null){let i=new U;return o.relayconfigState.configLoaded.subscribe(l=>{l&&Ie(o,e,t).subscribe(i)}),i}return Ie(o,e,t)};var Ae={providers:[q(),ce(Te,le()),re(ie(),se([Ee,Me])),b,{provide:h,useValue:we},{provide:X,useValue:Se()},{provide:me,useValue:{alertVariant:"simple"}},ge,I,ye,Z,he,Y,be,ve]};ee(E,Ae);
1
+ import{b as Ce,c as Se}from"./chunk-YJPY33RI.js";import{a as ge}from"./chunk-XXVFRNSP.js";import{a as I}from"./chunk-H7ZKBS2Q.js";import"./chunk-2YGOHGD2.js";import"./chunk-BK2MSH26.js";import"./chunk-3V4DGTSM.js";import{a as P}from"./chunk-6Q6SSTBK.js";import{a as L}from"./chunk-5LX6M65H.js";import{a as he}from"./chunk-LN26XMBJ.js";import"./chunk-S4OFJD2F.js";import{a as b,b as v,c as fe,d as k}from"./chunk-6XI3IP27.js";import{c as ae,d as pe,g as ce,h as le}from"./chunk-ABYM5HWA.js";import{a as ee}from"./chunk-Z35OG2DV.js";import{v as me,x as de}from"./chunk-RPUPXDQE.js";import{a as te,b as oe,c as ne,e as re,f as se,g as ie,j as ue}from"./chunk-OJ3H3ZRA.js";import{a as be}from"./chunk-I2LW33GO.js";import{la as Y,qa as Z}from"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import{a as ve}from"./chunk-UCS5RU7N.js";import{b as ye}from"./chunk-JYWOYPSQ.js";import{A as x,B,Fb as z,H as T,Lc as q,Mc as X,N as G,P as R,R as J,Rc as Q,V as M,Y as _,_ as s,cb as K,f as j,i as U,ja as $,n as W,o as F,pa as d,r as S}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var E=class e{#o=s(b);#s=s(v);ngOnInit(){this.#s.fetchConfig(),this.#o.clearAllNotCurrentVersion()}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=K({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&z(0,"router-outlet")},dependencies:[ae],encapsulation:2})};var we={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var h=new _("ENVIRONMENT");var A=class e{#o=s(ue);isLoaded=d(!1);webmodules=d(null);preload(t=!1){let o=this.#o.getApiV1Webmodules().pipe(J(n=>this.webmodules.set(n)),T(()=>this.isLoaded.set(!0)));if(t)return o;o.subscribe()}static \u0275fac=function(o){return new(o||e)};static \u0275prov=M({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ne=()=>{let e=s(k);return e.token()?!0:e.checkProxyAuthed().pipe(R(t=>t?W(!0):e.refreshToken().pipe(S(()=>!0))))},Oe=()=>{let e=s(v),t=s(I),o=s($),n=e.relayIsEnabled()?"longpoll":"websocket",i=[o.get(L).preload(!0),o.get(L).preloadFilterGroups(!0),o.get(A).preload(!0)];return e.configLoaded===null?x(i).pipe(S(()=>n)):e.configLoaded?.pipe(R(()=>x(i)))},Te=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-5MWPORZW.js")},{path:"logout",loadComponent:()=>import("./chunk-2KU5X7TN.js")},{path:"",canActivate:[Ne],children:[{path:"",canActivate:[Oe],loadComponent:()=>import("./chunk-4FWCJIJ4.js"),children:[{path:"",loadComponent:()=>import("./chunk-U3Q7TTKT.js")},{path:"add-backup",loadComponent:()=>import("./chunk-DJQOPNQJ.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-GMUNZKVL.js")},{path:"backup/import",loadComponent:()=>import("./chunk-AUR4SBGD.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-CATZTYW5.js"),loadChildren:()=>import("./chunk-KK24REOX.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-CATZTYW5.js"),loadChildren:()=>import("./chunk-KK24REOX.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-SPMSFKWG.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-YYJFEUNT.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-FYTYEGRJ.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-5CTM5KYC.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-2MIEBBFN.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-PB6FTE7O.js")},{path:"from-config",loadComponent:()=>import("./chunk-B32YSHV5.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-PXDRFPNP.js"),loadChildren:()=>import("./chunk-7U37G3C3.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-PXDRFPNP.js"),loadChildren:()=>import("./chunk-7U37G3C3.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-PXDRFPNP.js"),loadChildren:()=>import("./chunk-7U37G3C3.js")},{path:"settings",loadComponent:()=>import("./chunk-XZDYDGZ7.js")},{path:"about",loadComponent:()=>import("./chunk-H44BDPZE.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-BF2IYOUB.js")},{path:"changelog",loadComponent:()=>import("./chunk-Z7WHLTVV.js")},{path:"libraries",loadComponent:()=>import("./chunk-CSL7HCLZ.js")},{path:"system-info",loadComponent:()=>import("./chunk-4KEA3KF7.js")},{path:"server-settings",loadComponent:()=>import("./chunk-CTAP3SAA.js")},{path:"logs",loadChildren:()=>import("./chunk-QF5WMLMJ.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-BZ2XGEV5.js")}]}]}]}]}];var V=null,Me=(e,t)=>{let o=s(k),n=s(pe),i=s(b),l=s(h),r=i.getItem("locale"),u=s(de),p=Ce(r),a=e.url==="/api/v1/auth/login",m=e.url==="/api/v1/auth/refresh",C=e.url==="/api/v1/progressstate",g=e.url==="/api/v1/remoteoperation/test",y=e.url==="/api/v1/filesystem/validate",w=e.url.startsWith("/api/v2/"),O=o.token(),D=e,H=e.headers.has("custom-proxy-check")||O===fe;if(O&&e.url.startsWith(l.baseUrl)&&!H){let c=e.headers.set("Authorization",`Bearer ${O}`);r&&r!=="en-US"&&(c=c.set("X-Ui-Language",p)),D=e.clone({headers:c})}return t(D).pipe(S(c=>{if(c.type===4&&c.status===200&&w){let f=c.body;if(f?.Success===!1)throw{status:200,message:f?.Error??"Unknown error",error:{Error:f?.Error??"Unknown error"},requestBody:f}}return c}),B(c=>{let f=c.error?.Error||`Error Code: ${c.status}, Message: ${c.message}`;return!H&&(C&&c.status===404||g||y||u.error(f),m&&c.status===401&&(o.logout(),n.navigate(["/logout"])),!a&&!m&&c.status===401)?(V??=o.refreshToken().pipe(G()),V.pipe(R(()=>t(e.clone({headers:e.headers.set("Authorization",`Bearer ${o.token()}`)}))),T(()=>V=null))):F(()=>({error:c,message:f}))}))};var xe="1.0.0",ke=`portal-proxy-client-${P()}`,Le=1,N=class e{#o=1e3;#s=s(h);#t=d("disconnected");#l=d(this.#o);#i=d(!1);#n=d(!1);#a=d(null);isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#t.asReadonly();#p=[];#r={};#e=null;#m=new TextDecoder("utf-8");#c=null;#d=Q(()=>{let t=this.#i(),o=this.#l(),n=this.#a();if(!n||!t||!o||o<this.#o){this.#c&&window.clearInterval(this.#c);return}this.#c=window.setInterval(()=>{this.connectToMachineServer(n)},o)});utf8Atob(t){let o=Uint8Array.from(atob(t),i=>i.charCodeAt(0)),n=this.#m.decode(o);return n?JSON.parse(n):null}connectToMachineServer(t,o){let n=o?.reconnect??!1,i=this.wsState();(i==="disconnected"||i==="error"||n)&&(this.#e?.close(),this.#e=null),!this.#e&&(this.#e=new WebSocket(this.#s.machineServerUrl),this.#t.set("connecting"),this.#e.onopen=()=>{this.#t.set("connect"),this.#n.set(!0),this.#i.set(!1),this.#a.set(null)},this.#e.onclose=()=>{this.#t.set("disconnected"),this.#n.set(!1),this.#a.set(t),this.#i.set(!0)},this.#e.onerror=()=>{this.#t.set("error")},this.#e.onmessage=l=>{let r=JSON.parse(l.data);if(this.wsState()==="connect"){if(r.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${r.type}'`);return}let p={token:t,publicKey:"",clientVersion:xe,protocolVersion:Le},a=this.createResponse(r,"authportal",p);this.#t.set("welcome"),this.#e?.send(a)}else if(this.wsState()==="welcome"){if(r.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${r.type}'`);return}var u=JSON.parse(r.payload??"");if(u.accepted===!1){this.disconnectFromMachineServer("Authentication failed");return}for(this.#t.set("authenticated"),this.#n.set(!0);this.#p.length>0;){let p=this.#p.pop();p&&this.#r[p.messageId]&&this.activateCommand(p)}}else if(this.wsState()==="authenticated"){if(r.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${r.type}'`);return}let p=this.#r[r.messageId];if(p){if(r.errorMessage){p.reject(r.errorMessage);return}else{let a=JSON.parse(r.payload??"");a.body=a?.body==null?null:this.utf8Atob(a.body),p.resolve(a)}delete this.#r[r.messageId],window.clearTimeout(p.timer)}}})}disconnectFromMachineServer(t=null){t&&console.error(t),this.#e?.close(),this.#e=null,this.#t.set("disconnected"),this.#n.set(!1)}createResponse(t,o,n){let i={from:ke,to:t.from,type:o,messageId:t.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(t,o,n,i,l,r,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(t),new Promise((p,a)=>{let m=P(),g={from:ke,to:o,type:"command",messageId:m,payload:JSON.stringify({method:n,path:i,requestBody:l,headers:r})},y={resolve:p,reject:a,timer:window.setTimeout(()=>{let w=this.#r[m];w&&(delete this.#r[m],w.reject("Timeout"))},u)};this.#r[m]=y,this.#n()?this.activateCommand(g):this.#p.push(g)})}activateCommand(t){this.#e?.send(JSON.stringify(t))}static \u0275fac=function(o){return new(o||e)};static \u0275prov=M({token:e,factory:e.\u0275fac,providedIn:"root"})};function Pe(e){if(typeof e!="string")return null;let o=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...o))}function Ie(e,t,o){let n=e.relayconfigState.config();if(n===null)return o(t);let i=Pe(t.body),l={};t.headers.keys().forEach(a=>{l[a]=t.headers.get(a)??""});let r=t.headers.get("timeout"),u=r!==null?parseInt(r):e.defaultTimeout;t.url.startsWith("/api/v1/serverstate")&&t.url.includes("longpoll=true")&&(u=1e3*99);let p=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,t.method,t.url,i,l,u);return new j(a=>{p.then(m=>{let C=new te;l!=null&&Object.keys(l).forEach(y=>{C.set(y,l[y])});let g=new oe({body:m.body,status:m.code,statusText:"OK",headers:C});a.next(g),a.complete()}).catch(m=>{a.error(new ne({error:m??"Unknown error",status:0,statusText:m??"Unknown error"}))})})}var Ee=(e,t)=>{let o={relayconfigState:s(v),defaultTimeout:s(h).defaultTimeout,relayWebsocket:s(N)},n=o.relayconfigState.config();if(o.relayconfigState.configLoaded!==null&&n===null){let i=new U;return o.relayconfigState.configLoaded.subscribe(l=>{l&&Ie(o,e,t).subscribe(i)}),i}return Ie(o,e,t)};var Ae={providers:[q(),ce(Te,le()),re(ie(),se([Ee,Me])),b,{provide:h,useValue:we},{provide:X,useValue:Se()},{provide:me,useValue:{alertVariant:"simple"}},ge,I,ye,Z,he,Y,be,ve]};ee(E,Ae);
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.161",
2
+ "version": "0.0.162",
3
3
  "name": "@duplicati/ngclient",
4
4
  "license": "MIT",
5
5
  "contributors": [
package/chunk-A366Q7F5.js DELETED
@@ -1 +0,0 @@
1
- import{a as z}from"./chunk-GXGIGJ4W.js";import{a as Q}from"./chunk-S4OFJD2F.js";import{d as B}from"./chunk-6XI3IP27.js";import{d as E}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B as q,D as $,G as j,b as x,c as O,d as P,e as I,f as T,j as F,o as D,q as G,r as k,t as R,u as A,w as V}from"./chunk-RPUPXDQE.js";import"./chunk-OJ3H3ZRA.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import{Cb as _,Db as t,Eb as o,Fb as s,H as u,Mb as M,Rc as N,Sa as c,Xc as y,Zb as w,_ as p,cb as h,ea as g,fa as f,gc as L,hc as v,kc as S,nc as r,pa as m,xb as C,yb as b}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var X=["passwordInput"];function H(a,e){a&1&&(t(0,"sh-alert",2),r(1," Remember to enter a password, if you can't remember the password open the duplicati client on the machine in question and make sure you open it through the tray icon then go into settings to change the password. "),o())}var l=new k,d=class a{#e=p(E);#t=p(B);rememberMe=Q("rememberMe",!1,!0);failedLogin=m(!1);successLogin=m(!1);isLoading=m(!1);loginForm=l.group({user:l.control(""),pass:l.control("",P.required),rememberMe:l.control(this.rememberMe())});passwordInput=y("passwordInput");passwordEffect=N(()=>{this.failedLogin()&&queueMicrotask(()=>this.passwordInput()?.nativeElement?.focus())});ngOnInit(){this.loginForm.controls.rememberMe.valueChanges.subscribe(e=>this.rememberMe.set(e??!1)),queueMicrotask(()=>this.passwordInput()?.nativeElement?.focus())}submit(){let e=this.loginForm.value.pass,n=this.loginForm.value.user;this.rememberMe.set(this.loginForm.value.rememberMe??!1),!n&&e&&(this.isLoading.set(!0),this.#t.login(e,this.rememberMe()).pipe(u(()=>{this.isLoading.set(!1),this.failedLogin.set(!0)})).subscribe({next:()=>{this.successLogin.set(!0),this.#e.navigate(["/"])}}))}static \u0275fac=function(n){return new(n||a)};static \u0275cmp=h({type:a,selectors:[["app-login"]],viewQuery:function(n,i){n&1&&L(i.passwordInput,X,5),n&2&&v()},decls:24,vars:4,consts:()=>{let e;return e=$localize`Enter your password`,[["passwordInput",""],[3,"submit","formGroup"],["type","warning"],[1,"logo-login"],[1,"inner"],[1,"login-row"],["type","text","hidden","","autocomplete","off","name","username","formControlName","user"],["for","password"],["href","https://docs.duplicati.com/detailed-descriptions/duplicati-access-password","target","_blank","rel","noopener noreferrer"],["type","password","name","password","autocomplete","current-password","placeholder",e,"tabindex","1","formControlName","pass"],["shButton","","type","submit",1,"raised","primary"],[1,"raised","primary"],["type","checkbox","id","rememberMe","tabindex","2","formControlName","rememberMe"],[1,"login-row","checkbox"],["for","rememberMe",1,"remember-me"]]},template:function(n,i){if(n&1){let J=M();t(0,"form",1),w("submit",function(){return g(J),f(i.submit())}),C(1,H,2,0,"sh-alert",2),t(2,"div",3),s(3,"app-logo"),o(),t(4,"div",4)(5,"div",5),s(6,"input",6),t(7,"sh-form-field")(8,"label",7),r(9," Password "),t(10,"a",8)(11,"sh-icon"),r(12,"question"),o()()(),s(13,"input",9,0),o(),t(15,"button",10),r(16," Login "),t(17,"sh-icon"),r(18,"arrow-right"),o()()(),t(19,"sh-checkbox",11),r(20," Keep me logged in "),s(21,"input",12),o(),t(22,"div",13),s(23,"label",14),o()()()}n&2&&(_("formGroup",i.loginForm),c(),b(i.failedLogin()&&!i.successLogin()?1:-1),c(14),S("loader",i.isLoading()))},dependencies:[R,F,O,x,I,T,D,G,z,j,A,q,V,$],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:.75rem}form[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:1rem}form[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%] .checkbox[_ngcontent-%COMP%]{align-self:flex-start}sh-alert[_ngcontent-%COMP%]{max-width:20rem;margin:0 auto}h3[_ngcontent-%COMP%]{font:var(--title-30)}.login-row[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.logo-login[_ngcontent-%COMP%]{top:0;left:0;padding:1.25rem;position:fixed}"],changeDetection:0})};export{d as default};
package/chunk-HJBNADRP.js DELETED
@@ -1 +0,0 @@
1
- import{a as Y,f as tn}from"./chunk-FSG362SU.js";import{a as on}from"./chunk-KXJZEADJ.js";import{a as nn}from"./chunk-H7ZKBS2Q.js";import{a as en}from"./chunk-2YGOHGD2.js";import"./chunk-BK2MSH26.js";import"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import"./chunk-LN26XMBJ.js";import{a as Ze}from"./chunk-S4OFJD2F.js";import"./chunk-6XI3IP27.js";import{e as Xe}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{A as we,B as ze,C as Ve,E as Ue,F as je,J as Ke,K as We,R as qe,S as Qe,u as Je}from"./chunk-RPUPXDQE.js";import{i as Ye}from"./chunk-OJ3H3ZRA.js";import"./chunk-I2LW33GO.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-JYWOYPSQ.js";import{$b as u,Ab as w,Bb as z,Bc as q,Cb as E,Cc as D,Db as o,Eb as t,Fb as T,Fc as M,Gc as G,H as j,Hc as R,Jb as O,Jc as Q,Kb as m,Lb as f,Mb as H,Pa as K,Rc as ve,Sa as a,Tb as c,Ub as s,Vb as d,Wb as h,Xb as A,Yb as W,Zb as $,_ as v,cb as He,ea as P,fa as I,hb as N,ib as Ge,ic as V,kc as L,nc as r,pa as X,pc as S,sb as xe,sc as ye,tb as ke,tc as Be,uc as be,xb as g,yb as p,zb as J}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var an=()=>[import("./chunk-SR4YENFS.js").then(e=>e.NgTemplateOutlet),Ue,Qe,qe,import("./chunk-WNJSKJGQ.js").then(e=>e.DurationFormatPipe),import("./chunk-FIOBQPE7.js").then(e=>e.BytesPipe),import("./chunk-M7QQEZOU.js").then(e=>e.RelativeTimePipe)],ln=()=>["/add-backup"],rn=()=>["/restore"],_n=e=>({$implicit:e}),cn=e=>["/backup",e],sn=e=>["/restore",e],un=e=>["/backup",e,"export"],Fn=e=>["/backup",e,"delete"],Cn=e=>["/backup",e,"database"],Tn=e=>["/backup",e,"commandline"],En=e=>["/backup",e,"log"];function dn(e,i){if(e&1){let n=H();o(0,"button",52),$("click",function(){let F=P(n).$implicit,C=u(2);return I(C.sortByColumn.set(F.value))}),d(1,15),t()}if(e&2){let n=i.$implicit,_=u(2);L("active",_.orderBy()===n.value),a(),h(n.label),A(1)}}function gn(e,i){if(e&1&&(o(0,"sh-menu",53)(1,"button",54),c(2,14),T(3,"strong")(4,"sh-icon"),s(),t(),O(5,55),w(6,dn,2,3,"button",56,J),m(),t()),e&2){let n=u();a(4),h(n.orderBy()),A(2),a(2),z(n.sortOrderOptions())}}function pn(e,i){if(e&1&&(o(0,"p")(1,"span"),d(2,21),t(),r(3),M(4,"relativeTime"),t()),e&2){let n=u().$implicit,_=u(4);a(3),S(" ",R(4,1,n.Schedule.Time,_.timeType()==="actual")," ")}}function Sn(e,i){if(e&1&&(r(0),M(1,"durationFormat")),e&2){let n=u().$implicit,_=u(4);S(" ",R(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDuration,_.timeType()==="actual")," ")}}function On(e,i){e&1&&(O(0),r(1,"-"),m())}function mn(e,i){if(e&1&&(r(0),M(1,"bytes")),e&2){let n=u().$implicit;S(" ",G(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.SourceFilesSize)," ")}}function Nn(e,i){e&1&&(O(0),r(1,"-"),m())}function Mn(e,i){if(e&1&&(r(0),M(1,"bytes")),e&2){let n=u().$implicit;S(" ",G(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.TargetFilesSize)," ")}}function Pn(e,i){e&1&&(O(0),r(1,"-"),m())}function In(e,i){e&1&&(o(0,"sh-chip",63),d(1,22),t())}function fn(e,i){e&1&&f(0)}function Dn(e,i){if(e&1&&(o(0,"div",59)(1,"div",46)(2,"h3"),r(3),o(4,"sh-chip"),T(5,"img",60),r(6),t()(),o(7,"p")(8,"span"),d(9,16),t(),r(10),M(11,"relativeTime"),t(),g(12,pn,5,4,"p"),o(13,"p")(14,"span"),d(15,17),t(),g(16,Sn,2,4)(17,On,2,0,"ng-container"),t(),o(18,"p")(19,"span"),d(20,18),t(),g(21,mn,2,3)(22,Nn,2,0,"ng-container"),t(),o(23,"p")(24,"span"),d(25,19),t(),g(26,Mn,2,3)(27,Pn,2,0,"ng-container"),t()(),o(28,"div",61)(29,"sh-chip",62),d(30,20),t(),g(31,In,2,0,"sh-chip",63),t(),o(32,"div",50),N(33,fn,1,0,"ng-container",64),t()()),e&2){let n=i.$implicit,_=u(4),F=V(51);a(3),S(" ",n.Backup.Name??_.MISSING_BACKUP_NAME," "),a(2),E("src",_.getBackendIcon(n.Backup.TargetURL),K),a(),S(" ",_.getBackendType(n.Backup.TargetURL)," "),a(4),S(" ",R(11,13,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupFinished,_.timeType()==="actual")," "),a(2),p(!(n==null||n.Schedule==null)&&n.Schedule.Time?12:-1),a(4),p(n.Backup.Metadata!=null&&n.Backup.Metadata.LastBackupDuration?16:17),a(5),p(n.Backup.Metadata!=null&&n.Backup.Metadata.SourceFilesSize?21:22),a(5),p(n.Backup.Metadata!=null&&n.Backup.Metadata.TargetFilesSize?26:27);let C=_.getBackupVersionCount(n);a(4),h(C)(C),A(30),a(),p(n.Backup.ExternalID?31:-1),a(2),E("ngTemplateOutlet",F)("ngTemplateOutletContext",D(16,_n,n))}}function $n(e,i){if(e&1&&w(0,Dn,34,18,"div",59,J),e&2){let n=u(3);z(n.backups())}}function Rn(e,i){e&1&&(O(0),d(1,23),m())}function hn(e,i){if(e&1&&(o(0,"div",57),g(1,$n,2,0)(2,Rn,2,0,"ng-container"),t()),e&2){let n=u(2);a(),p(n.backups().length?1:2)}}function An(e,i){e&1&&(c(0,24,1),f(1),s())}function Ln(e,i){e&1&&(c(0,25,1),f(1),s())}function Hn(e,i){e&1&&(c(0,26,1),f(1),s())}function Gn(e,i){e&1&&(c(0,27,1),f(1),s())}function xn(e,i){e&1&&(c(0,28,1),f(1),s())}function kn(e,i){e&1&&(c(0,29,1),f(1),s())}function yn(e,i){e&1&&(c(0,30,1),f(1),s())}function Bn(e,i){if(e&1&&(r(0),M(1,"relativeTime")),e&2){let n=u().$implicit,_=u(3);S(" ",R(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDate,_.timeType()==="actual")," ")}}function bn(e,i){e&1&&(O(0),r(1,"-"),m())}function vn(e,i){if(e&1&&(r(0),M(1,"relativeTime")),e&2){let n=u().$implicit,_=u(3);S(" ",R(1,1,n.Schedule.Time,_.timeType()==="actual")," ")}}function Xn(e,i){e&1&&(O(0),r(1,"-"),m())}function Jn(e,i){if(e&1&&(r(0),M(1,"durationFormat")),e&2){let n=u().$implicit,_=u(3);S(" ",R(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDuration,_.timeType()==="actual")," ")}}function wn(e,i){e&1&&(O(0),r(1,"-"),m())}function zn(e,i){if(e&1&&(r(0),M(1,"bytes")),e&2){let n=u().$implicit;S(" ",G(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.SourceFilesSize)," ")}}function Vn(e,i){e&1&&(O(0),r(1,"-"),m())}function Un(e,i){if(e&1&&(r(0),M(1,"bytes")),e&2){let n=u().$implicit;S(" ",G(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.TargetFilesSize)," ")}}function jn(e,i){e&1&&(O(0),r(1,"-"),m())}function Kn(e,i){e&1&&f(0)}function Wn(e,i){if(e&1&&(o(0,"tr")(1,"td"),r(2),t(),o(3,"td")(4,"sh-chip",51),T(5,"img",60),r(6),t()(),o(7,"td"),g(8,Bn,2,4)(9,bn,2,0,"ng-container"),t(),o(10,"td"),g(11,vn,2,4)(12,Xn,2,0,"ng-container"),t(),o(13,"td"),g(14,Jn,2,4)(15,wn,2,0,"ng-container"),t(),o(16,"td"),g(17,zn,2,3)(18,Vn,2,0,"ng-container"),t(),o(19,"td"),g(20,Un,2,3)(21,jn,2,0,"ng-container"),t(),o(22,"td")(23,"span"),d(24,33),t()(),o(25,"td"),N(26,Kn,1,0,"ng-container",64),t()()),e&2){let n=i.$implicit,_=u(3),F=V(51);a(2),S(" ",n.Backup.Name??_.MISSING_BACKUP_NAME," "),a(3),E("src",_.getBackendIcon(n.Backup.TargetURL),K),a(),S(" ",_.getBackendType(n.Backup.TargetURL)," "),a(2),p(n.Backup.Metadata!=null&&n.Backup.Metadata.LastBackupDate?8:9),a(3),p(!(n==null||n.Schedule==null)&&n.Schedule.Time?11:12),a(3),p(n.Backup.Metadata!=null&&n.Backup.Metadata.LastBackupDuration?14:15),a(3),p(n.Backup.Metadata!=null&&n.Backup.Metadata.SourceFilesSize?17:18),a(3),p(n.Backup.Metadata!=null&&n.Backup.Metadata.TargetFilesSize?20:21);let C=_.getBackupVersionCount(n);a(4),h(C)(C),A(24),a(2),E("ngTemplateOutlet",F)("ngTemplateOutletContext",D(12,_n,n))}}function qn(e,i){if(e&1){let n=H();o(0,"sh-table",65),be("sortByColumnChange",function(F){P(n);let C=u(2);return Be(C.sortByColumn,F)||(C.sortByColumn=F),I(F)}),o(1,"tr",66)(2,"th",67),c(3,24),N(4,An,2,0,"ng-container",68),s(),t(),o(5,"th",69),c(6,25),N(7,Ln,2,0,"ng-container",68),s(),t(),o(8,"th",70),c(9,26),N(10,Hn,2,0,"ng-container",68),s(),t(),o(11,"th",71),c(12,27),N(13,Gn,2,0,"ng-container",68),s(),t(),o(14,"th",72),c(15,28),N(16,xn,2,0,"ng-container",68),s(),t(),o(17,"th",73),c(18,29),N(19,kn,2,0,"ng-container",68),s(),t(),o(20,"th",74),c(21,30),N(22,yn,2,0,"ng-container",68),s(),t(),o(23,"th"),d(24,31),t(),o(25,"th"),d(26,32),t()(),w(27,Wn,27,14,"tr",null,J),t()}if(e&2){let n=u(2),_=V(53);E("data",n.backups())("loading",n.backupsLoading()),ye("sortByColumn",n.sortByColumn),a(4),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(5),z(n.backups())}}function Qn(e,i){if(e&1&&g(0,hn,3,1,"div",57)(1,qn,29,10,"sh-table",58),e&2){let n=u();p(n.viewMode()==="list"?0:n.viewMode()==="details"?1:-1)}}function Yn(e,i){e&1&&(o(0,"div",75),T(1,"sh-progress-bar",76),o(2,"div",46)(3,"h3"),d(4,34),t()()())}function Zn(e,i){e&1&&d(0,35,1)}function et(e,i){e&1&&(o(0,"sh-icon"),r(1,"check"),t())}function nt(e,i){e&1&&(o(0,"sh-icon"),r(1,"dots-three-vertical"),t())}function tt(e,i){if(e&1){let n=H();o(0,"button",77),$("click",function(){let F=P(n).$implicit,C=u();return I(C.startBackup(F.Backup.ID))}),c(1,35),T(2,"sh-icon"),g(3,Zn,1,0),s(),t(),o(4,"button",78)(5,"sh-icon"),r(6,"pencil-simple"),t()(),o(7,"sh-menu")(8,"button",47),g(9,et,2,0,"sh-icon")(10,nt,2,0,"sh-icon"),t(),O(11,55),o(12,"h3",79),r(13,"Operations"),t(),o(14,"button",80),c(15,36),T(16,"sh-icon"),s(),t(),o(17,"button",80),c(18,37),T(19,"sh-icon"),s(),t(),o(20,"button",80),c(21,38),T(22,"sh-icon"),s(),t(),T(23,"sh-divider"),o(24,"h3",79),r(25,"Advanced"),t(),o(26,"button",80),c(27,39),T(28,"sh-icon"),s(),t(),o(29,"button",52),$("click",function(){let F=P(n).$implicit,C=u();return I(C.verifyFiles(F.Backup.ID))}),c(30,40),T(31,"sh-icon"),s(),t(),o(32,"button",52),$("click",function(){let F=P(n).$implicit,C=u();return I(C.compressBackup(F.Backup.ID))}),c(33,41),T(34,"sh-icon"),s(),t(),o(35,"button",80),c(36,42),T(37,"sh-icon"),s(),t(),T(38,"sh-divider"),o(39,"h3",79),r(40,"Reporting"),t(),o(41,"button",80),c(42,43),T(43,"sh-icon"),s(),t(),m(),t()}if(e&2){let n=i.$implicit,_=u();L("loader",_.startingBackup()===n.Backup.ID),a(3),p(_.viewMode()==="list"?3:-1),a(),E("routerLink",D(15,cn,n.Backup.ID)),a(4),L("loader",_.loadingId()===n.Backup.ID)("success",_.successId()===n.Backup.ID),a(),p(_.successId()===n.Backup.ID?9:10),a(5),E("routerLink",D(17,sn,n.Backup.ID)),a(3),E("routerLink",D(19,un,n.Backup.ID)),a(3),E("routerLink",D(21,Fn,n.Backup.ID)),a(6),E("routerLink",D(23,Cn,n.Backup.ID)),a(9),E("routerLink",D(25,Tn,n.Backup.ID)),a(6),E("routerLink",D(27,En,n.Backup.ID))}}function it(e,i){e&1&&(o(0,"sh-icon",81),r(1,"funnel-simple"),t(),o(2,"sh-icon",82),r(3,"sort-ascending"),t(),o(4,"sh-icon",83),r(5,"sort-descending"),t())}var ot={file:{Display:$localize`Local`,Icon:null}},Z=class e{#n=v(Ye);#t=v(nn);#e=v(en);MISSING_BACKUP_NAME=$localize`Backup name missing`;sortOrderOptions=this.#e.orderByOptions;orderBy=this.#e.orderBy;backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;startingBackup=this.#e.startingBackup;deletingBackup=this.#e.deletingBackup;timeType=this.#e.timeType;viewMode=Ze("viewMode","list");sortByColumn=X(this.#e.orderBy());loadingId=X(null);successId=X(null);sortEffect=ve(()=>this.#e.setOrderBy(this.sortByColumn()));ngOnInit(){this.#e.getBackups(!0)}setOrderBy(i){this.#e.setOrderBy(i)}setTimeType(i){this.#e.setTimeType(i)}startBackup(i){this.#t.resumeDialogCheck(()=>this.#e.startBackup(i))}getBackendIcon(i){if(!i)return"";let n=i.split("://")[0];return Y(n).icon??"database"}getBackendType(i){if(!i)return"";let n=i.split("://")[0],_=Y(n);if(!_)return"";let F=ot[_.key];if(F?.Display)return F.Display;if(_.key==="s3"){let C="http://null?"+i.split("?")[1],x=new URL(C).searchParams.get("s3-server-name")?.toLowerCase()??"";for(let[k,y]of Object.entries(tn))if(x.endsWith(k))return y}return _.displayName}getBackupVersionCount(i){return parseInt(i?.Backup?.Metadata?.BackupListCount??"",10)||0}verifyFiles(i){this.loadingId.set(i),this.#n.postApiV1BackupByIdVerify({id:i}).pipe(j(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(i),setTimeout(()=>this.successId.set(null),2e3)}})}compressBackup(i){this.loadingId.set(i),this.#n.postApiV1BackupByIdCompact({id:i}).pipe(j(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(i),setTimeout(()=>this.successId.set(null),2e3)}})}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=He({type:e,selectors:[["app-home"]],decls:54,vars:11,consts:()=>{let i;i=$localize`Backups`;let n;n=$localize`Backups are stored in the cloud and can be restored at any time.`;let _;_=$localize` Add ${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON:`;let F;F=$localize`Restores`;let C;C=$localize`Restores allow you to restore your data from the cloud.`;let U;U=$localize` Start ${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON:`;let x;x=$localize`My backups`;let k;k=$localize`${"\uFFFD#31\uFFFD"}:START_TAG_SH_ICON:rows${"\uFFFD/#31\uFFFD"}:CLOSE_TAG_SH_ICON: List `;let y;y=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SH_ICON:list${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SH_ICON: Details `;let ee;ee=$localize` Time: ${"\uFFFD#38\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#39\uFFFD"}:START_TAG_SH_ICON:clock${"\uFFFD/#39\uFFFD"}:CLOSE_TAG_SH_ICON:`;let ne;ne=$localize`Relative time`;let te;te=$localize`Actual time`;let ie;ie=$localize` Order by: ${"\uFFFD#3\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:arrows-down-up${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let oe;oe=$localize` ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let _e;_e=$localize`Last successful backup:`;let ae;ae=$localize`Duration:`;let le;le=$localize`Source:`;let re;re=$localize`Destination:`;let B;B=$localize`{VAR_PLURAL, plural, =0 {No version yet} =1 {1 Version} other {{INTERPOLATION} Versions}}`,B=W(B,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let ce;ce=$localize` ${B}:ICU@@6502601490918455200: `;let se;se=$localize`Next scheduled run:`;let ue;ue=$localize`Externally managed`;let Fe;Fe=$localize`No backups founds`;let Ce;Ce=$localize` Backup ${"\uFFFD*4:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*4:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Te;Te=$localize` Type ${"\uFFFD*7:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*7:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Ee;Ee=$localize` Last backup ${"\uFFFD*10:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*10:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let de;de=$localize` Next run ${"\uFFFD*13:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*13:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let ge;ge=$localize` Duration ${"\uFFFD*16:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*16:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let pe;pe=$localize` Source ${"\uFFFD*19:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*19:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Se;Se=$localize` Destination ${"\uFFFD*22:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*22:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Oe;Oe=$localize`Version`;let me;me=$localize`Actions`;let b;b=$localize`{VAR_PLURAL, plural, =0 {No versions} =1 {1 Version} other {{INTERPOLATION} Versions}}`,b=W(b,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let Ne;Ne=$localize` ${b}:ICU@@3521773141017690117: `;let Me;Me=$localize`Loading backups...`;let Pe;Pe=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:play-circle${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD*3:1\uFFFD"}:START_BLOCK_IF: Start ${"\uFFFD/*3:1\uFFFD"}:CLOSE_BLOCK_IF:`;let Ie;Ie=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:clock-counter-clockwise${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: Restore `;let fe;fe=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:export${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Export `;let De;De=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON: Delete `;let $e;$e=$localize`${"\uFFFD#28\uFFFD"}:START_TAG_SH_ICON:database${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SH_ICON: Database `;let Re;Re=$localize`${"\uFFFD#31\uFFFD"}:START_TAG_SH_ICON:check-square-offset${"\uFFFD/#31\uFFFD"}:CLOSE_TAG_SH_ICON: Verify files `;let he;he=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SH_ICON:file-archive${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SH_ICON: Compress now `;let Ae;Ae=$localize`${"\uFFFD#37\uFFFD"}:START_TAG_SH_ICON:terminal-window${"\uFFFD/#37\uFFFD"}:CLOSE_TAG_SH_ICON: Commandline `;let Le;return Le=$localize`${"\uFFFD#43\uFFFD"}:START_TAG_SH_ICON:notepad${"\uFFFD/#43\uFFFD"}:CLOSE_TAG_SH_ICON: Log `,[["actions",""],["sortIcons",""],i,n,_,F,C,U,x,k,y,ee,ne,te,ie,oe,_e,ae,le,re,ce,se,ue,Fe,Ce,Te,Ee,de,ge,pe,Se,Oe,me,Ne,Me,Pe,Ie,fe,De,$e,Re,he,Ae,Le,[1,"type-a","actionable",3,"routerLink"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["type","button","shButton",""],["src","assets/images/restore.png","alt","","width","48px"],[1,"content"],[1,"actions"],[1,"small"],["type","button",3,"click"],[1,"table-overview"],["type","button","shButton","",1,"small"],["menu",""],["type","button",3,"active"],[1,"backups"],[1,"type-b",3,"data","loading","sortByColumn"],[1,"backup"],["alt","",1,"provider-icon",3,"src"],[1,"tags"],[1,"simple","success"],[1,"simple","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"type-b",3,"sortByColumnChange","data","loading","sortByColumn"],["table-header",""],["shSort","name"],[4,"ngTemplateOutlet"],["shSort","type"],["shSort","lastrun"],["shSort","nextrun"],["shSort","duration"],["shSort","sourcesize"],["shSort","destinationsize"],[1,"loading-list"],[1,"indeterminate","primary"],["shButton","",3,"click"],["type","button","shButton","",3,"routerLink"],["title",""],["type","button",3,"routerLink"],[1,"filter"],[1,"asc"],[1,"desc"]]},template:function(n,_){if(n&1){let F=H();T(0,"app-status-bar"),o(1,"section")(2,"header")(3,"sh-card",44),T(4,"img",45),o(5,"div",46)(6,"h3"),d(7,2),t(),o(8,"p"),d(9,3),t()(),o(10,"button",47),c(11,4),T(12,"sh-icon"),s(),t()(),o(13,"sh-card",44),T(14,"img",48),o(15,"div",46)(16,"h3"),d(17,5),t(),o(18,"p"),d(19,6),t()(),o(20,"button",47),c(21,7),T(22,"sh-icon"),s(),t()()(),o(23,"div",49)(24,"h2"),O(25),d(26,8),m(),o(27,"div",50)(28,"sh-button-group",51)(29,"button",52),$("click",function(){return P(F),I(_.viewMode.set("list"))}),c(30,9),T(31,"sh-icon"),s(),t(),o(32,"button",52),$("click",function(){return P(F),I(_.viewMode.set("details"))}),c(33,10),T(34,"sh-icon"),s(),t()(),o(35,"sh-menu",53)(36,"button",54),c(37,11),T(38,"strong")(39,"sh-icon"),s(),t(),O(40,55),o(41,"button",52),$("click",function(){return P(F),I(_.setTimeType("relative"))}),d(42,12),t(),o(43,"button",52),$("click",function(){return P(F),I(_.setTimeType("actual"))}),d(44,13),t(),m(),t(),g(45,gn,8,1,"sh-menu",53),t()(),Ge(46,Qn,2,1)(47,Yn,5,0),xe(48,46,an,null,47),t()(),N(50,tt,44,29,"ng-template",null,0,Q)(52,it,6,0,"ng-template",null,1,Q)}n&2&&(a(3),E("routerLink",q(9,ln)),a(10),E("routerLink",q(10,rn)),a(16),L("active",_.viewMode()==="list"),a(3),L("active",_.viewMode()==="details"),a(7),h(_.timeType()),A(37),a(6),p(_.viewMode()==="list"?45:-1),a(3),ke(!_.backupsLoading()))},dependencies:[Xe,on,Ve,ze,Je,je,Ke,We,we],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem 0}header[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;padding:0 2rem;gap:1rem}sh-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}sh-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.content[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{padding:0 2rem}.backups[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem;gap:.5rem}.backup[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem;gap:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;max-width:40%}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font:var(--paragraph-30);color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--base-12)}.backup[_ngcontent-%COMP%] .tags[_ngcontent-%COMP%]{display:flex;align-items:center;flex-direction:column;gap:.5rem}.provider-icon[_ngcontent-%COMP%]{width:1.25rem;height:1.25rem}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.sortable[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none}.sortable[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{margin-left:.5rem;font-size:1rem;justify-self:flex-end;display:none}.sortable[_ngcontent-%COMP%]:not(.sort-asc):not(.sort-desc) sh-icon.filter[_ngcontent-%COMP%]{display:block}.sortable.sort-asc[_ngcontent-%COMP%] sh-icon.asc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}.sortable.sort-desc[_ngcontent-%COMP%] sh-icon.desc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}.actionable[_ngcontent-%COMP%]{cursor:pointer}.actionable[_ngcontent-%COMP%]:after{transition:inset .1s linear}.actionable[_ngcontent-%COMP%]:hover{--card-shp: 0}"],changeDetection:0})};export{Z as default};
package/chunk-KIIJBHZE.js DELETED
@@ -1 +0,0 @@
1
- import{a as z}from"./chunk-KXJZEADJ.js";import"./chunk-H7ZKBS2Q.js";import{a as X}from"./chunk-2YGOHGD2.js";import"./chunk-BK2MSH26.js";import"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import"./chunk-LN26XMBJ.js";import"./chunk-S4OFJD2F.js";import"./chunk-6XI3IP27.js";import{e as E}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B as g,C,F as v,K as w,u as S}from"./chunk-RPUPXDQE.js";import{i as J}from"./chunk-OJ3H3ZRA.js";import"./chunk-I2LW33GO.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-JYWOYPSQ.js";import{$b as m,Ab as x,Bb as I,Bc as u,Cb as p,Cc as G,Db as e,Eb as i,Fb as a,Jb as L,Kb as $,Sa as s,Tb as b,Ub as D,Vb as c,Wb as y,Xb as A,_ as d,cb as O,ib as N,nc as r,qc as B,sb as h,tb as P,xb as M,yb as F,zb as k}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var j=()=>[C,g,S,E],W=()=>["/restore-from-files"],H=()=>["/restore/from-config"],q=n=>["/restore",n];function V(n,o){if(n&1&&(e(0,"sh-card",5),a(1,"img",10),e(2,"div",7)(3,"h3"),c(4,1),i(),e(5,"p"),r(6),i()(),e(7,"button",8),b(8,2),a(9,"sh-icon"),D(),i()()),n&2){let t=o.$implicit;p("routerLink",G(4,q,t.Backup.ID)),s(4),y(t.Backup.Name??"Backup name missing"),A(4),s(2),B(" ",(t.Backup.Metadata==null?null:t.Backup.Metadata.SourceSizeString)??"-"," / ",(t.Backup.Metadata==null?null:t.Backup.Metadata.BackupListCount)??"-"," ")}}function K(n,o){if(n&1&&x(0,V,10,6,"sh-card",5,k),n&2){let t=m(2);I(t.backups())}}function Q(n,o){n&1&&(L(0),c(1,3),$())}function U(n,o){if(n&1&&M(0,K,2,0)(1,Q,2,0,"ng-container"),n&2){let t=m();F(t.backups().length?0:1)}}function Y(n,o){n&1&&(e(0,"div",11),a(1,"sh-progress-bar",12),e(2,"div",7)(3,"h3"),c(4,4),i()()())}var T=class n{#e=d(X);#t=d(J);backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;ngOnInit(){this.#e.getBackups(!0)}restoreNow(o){this.#t.postApiV1BackupByIdRestore({id:o.Backup?.ID,requestBody:{}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=O({type:n,selectors:[["app-restore"]],decls:32,vars:5,consts:()=>{let o;o=$localize`Where do you want to restore from?`;let t;t=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let _;_=$localize` Restore ${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON:`;let R;R=$localize`No backups founds`;let f;return f=$localize`Loading backups...`,[o,t,_,R,f,[1,"type-a","actionable",3,"routerLink"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["shButton",""],["src","assets/images/restore.png","alt","","width","48px"],["src","assets/images/folder.png","alt","","width","48px"],[1,"loading-list"],[1,"indeterminate","primary"]]},template:function(t,_){t&1&&(a(0,"app-status-bar"),e(1,"section")(2,"h2"),c(3,0),i(),e(4,"sh-card",5),a(5,"img",6),e(6,"div",7)(7,"h3"),r(8,"Direct restore from backup files"),i(),e(9,"p"),r(10,"Point to your backup files and restore from there."),i()(),e(11,"button",8),r(12," Start "),e(13,"sh-icon"),r(14,"play-circle"),i()()(),e(15,"sh-card",5),a(16,"img",9),e(17,"div",7)(18,"h3"),r(19,"Restore from configuration"),i(),e(20,"p"),r(21,"Load destination from an exported job"),i()(),e(22,"button",8),r(23," Start "),e(24,"sh-icon"),r(25,"play-circle"),i()()(),e(26,"sh-divider"),r(27,"Or existing"),i(),N(28,U,2,1)(29,Y,5,0),h(30,28,j,null,29),i()),t&2&&(s(4),p("routerLink",u(3,W)),s(11),p("routerLink",u(4,H)),s(15),P(!_.backupsLoading()))},dependencies:[z,C,g,v,S,w,E],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 1rem;display:flex;flex-direction:column;gap:1rem}sh-divider[_ngcontent-%COMP%]{color:var(--base-8)}sh-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;--card-padding: 2rem}sh-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}.actionable[_ngcontent-%COMP%]{cursor:pointer}.actionable[_ngcontent-%COMP%]:after{transition:inset .1s linear}.actionable[_ngcontent-%COMP%]:hover{--card-shp: 0}"],changeDetection:0})};export{T as default};
package/chunk-MTNOIKEK.js DELETED
@@ -1 +0,0 @@
1
- import"./chunk-EUDKD2JW.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-EYFTFGJS.js")},{path:"destination",loadComponent:()=>import("./chunk-NCDXMDW5.js")},{path:"source-data",loadComponent:()=>import("./chunk-QWNOIRT4.js")},{path:"schedule",loadComponent:()=>import("./chunk-XJ7KXQWK.js")},{path:"options",loadComponent:()=>import("./chunk-R2FAS2C3.js")}];export{o as default};
package/chunk-P6IZFXXC.js DELETED
@@ -1 +0,0 @@
1
- import{a as pt}from"./chunk-KXJZEADJ.js";import{a as Ct}from"./chunk-YJPY33RI.js";import{a as gt}from"./chunk-G6VJHFTW.js";import{a as k}from"./chunk-MHPSC3FM.js";import"./chunk-Z27IQRKV.js";import"./chunk-H7ZKBS2Q.js";import"./chunk-2YGOHGD2.js";import"./chunk-BK2MSH26.js";import{a as ct}from"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import{a as ne}from"./chunk-5LX6M65H.js";import"./chunk-LN26XMBJ.js";import"./chunk-S4OFJD2F.js";import{a as nt}from"./chunk-6XI3IP27.js";import"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B as D,E as st,F as at,G as te,K as rt,L as lt,M as _t,O as dt,V as Tt,X as St,c as j,e as K,i as Q,m as it,s as Y,t as Z,u as F,w as ee,z as ot}from"./chunk-RPUPXDQE.js";import{i as x}from"./chunk-OJ3H3ZRA.js";import"./chunk-I2LW33GO.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-JYWOYPSQ.js";import{$b as S,B as $,Bc as q,Cb as h,Db as i,Eb as o,Fb as I,H as R,Mb as P,Pa as He,Qc as A,Rc as b,Sa as l,Tb as z,Ub as B,V as We,Vb as r,Wb as ae,Xb as re,Xc as tt,Yb as Qe,Zb as c,_ as N,a as Ue,b as ze,c as Be,cb as w,ea as u,fa as m,gc as Ye,hb as se,hc as Ze,ib as qe,kc as M,n as L,nc as O,oc as W,pa as T,pc as H,sb as je,sc as G,tb as Ke,tc as y,uc as v,xb as p,yb as C,yc as et}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var Et=["formRef"],Nt=()=>[import("./chunk-4NOWNXOS.js").then(s=>s.OptionsListComponent)];function ft(s,e){s&1&&(i(0,"sh-alert",3),r(1,1),o())}function ht(s,e){if(s&1){let t=P();i(0,"app-options-list",5),v("optionsChange",function(a){u(t);let _=S();return y(_.settings,a)||(_.settings=a),m(a)}),o()}if(s&2){let t=S();G("options",t.settings),h("hasFreeTextSettings",!0)}}var X=class s{#e=N(k);#t=N(x);formRef=tt.required("formRef");settings=T([]);isSubmitting=T(!1);isLoadingOptions=T(!0);saved=T(!1);lastRecievedServerSettings=T({});serverSettingsEffect=b(()=>{let e=this.#e.serverSettings();if(e===void 0)return;this.lastRecievedServerSettings.set(e),this.isLoadingOptions.set(!0);let t=Object.entries(e);t.forEach(([n,a],_)=>{if(n.startsWith("--")){let E=n.substring(2);this.settings.update(g=>(g.some(f=>f.Name===E)||g.push({Name:E,Value:a}),g))}_===t.length-1&&this.isLoadingOptions.set(!1)})});submit(){this.isSubmitting.set(!0);let e=this.settings(),t=this.lastRecievedServerSettings(),n=e.map(g=>g.Name),_=Object.keys(t).filter(g=>g.startsWith("--")).filter(g=>!n.includes(g.replace("--",""))),E=e.reduce((g,f)=>{let V=f.Name?.startsWith("--")?f.Name:`--${f.Name}`;return g[V]=f.Value,g},{});_.forEach(g=>{E[g]=null}),this.#t.patchApiV1Serversettings({requestBody:E}).pipe(R(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.#e.refreshServerSettings(),this.saved.set(!0),setTimeout(()=>{this.saved.set(!1)},3e3)}})}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=w({type:s,selectors:[["app-advanced-options-settings"]],viewQuery:function(t,n){t&1&&Ye(n.formRef,Et,5),t&2&&Ze()},decls:8,vars:4,consts:()=>{let e;e=$localize`${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:floppy-disk${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON: Save settings `;let t;return t=$localize`Settings saved`,[e,t,[1,"actions"],[1,"success"],["shButton","","type","button",1,"raised","primary",3,"click"],[3,"optionsChange","options","hasFreeTextSettings"]]},template:function(t,n){t&1&&(i(0,"div",2),p(1,ft,2,0,"sh-alert",3),i(2,"button",4),c("click",function(){return n.submit()}),z(3,0),I(4,"sh-icon"),B(),o()(),qe(5,ht,1,2),je(6,5,Nt)),t&2&&(l(),C(n.saved()?1:-1),l(),M("loader",n.isSubmitting()),l(4),Ke(!n.isLoadingOptions()))},dependencies:[Z,D,F,ee],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40.625rem;justify-self:flex-end}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:flex-end;margin-bottom:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.remote-volume-wrap[_ngcontent-%COMP%] p.warning[_ngcontent-%COMP%]{color:#7d7d00}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 2.5rem;align-items:flex-end}"],changeDetection:0})};var J=class s{#e=N(ot);#t=N(x);#o=N(ne);repeatRegisterTimer=null;state=T("unknown");claimUrl=T(null);registerUrl=T("");status=A(()=>{let e=this.state();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"});sysInfoEffect=b(()=>{let e=this.#o.systemInfo();e&&this.registerUrl.set(e.RemoteControlRegistrationUrl??"")});#n(e){e.RegistrationUrl&&this.claimUrl.set(e.RegistrationUrl),e.IsConnected?this.state.set("connected"):e.IsEnabled?this.state.set("enabled"):e.CanEnable?this.state.set("disabled"):e.IsRegisteringFaulted?this.state.set("registeringfaulted"):e.IsRegistering?e.RegistrationUrl!=null&&e.RegistrationUrl.trim().length>0?this.state.set("registered"):this.state.set("registering"):this.state.set("inactive");let t=this.state();this.repeatRegisterTimer!==null&&(clearTimeout(this.repeatRegisterTimer),this.repeatRegisterTimer=null),t==="registering"&&(this.repeatRegisterTimer=setTimeout(()=>{this.#t.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:""}}).subscribe({next:n=>this.#n(n),error:n=>this.#i(n)})},5e3)),(t==="enabled"||t==="registered")&&(this.repeatRegisterTimer=setTimeout(()=>{this.#t.getApiV1RemotecontrolStatus().subscribe({next:n=>this.#n(n),error:n=>this.#i(n)})},5e3)),e.IsRegistering&&e.CanEnable&&this.#t.deleteApiV1RemotecontrolRegister().subscribe({next:n=>this.#n(n)})}#i(e){this.#t.getApiV1RemotecontrolStatus().subscribe({next:t=>this.#n(t)})}refreshRemoteControlStatus(){this.#t.getApiV1RemotecontrolStatus().subscribe({next:e=>this.#n(e),error:e=>this.#i(e)})}beginRemoteRegistration(){this.state.set("registering"),this.#t.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:this.registerUrl()}}).subscribe({next:e=>this.#n(e),error:e=>this.#i(e)})}cancelRemoteRegistration(){this.#t.deleteApiV1RemotecontrolRegister().subscribe({next:e=>this.#n(e),error:e=>this.#i(e)})}enableRemoteControl(){this.#t.postApiV1RemotecontrolEnable().subscribe({next:e=>this.#n(e),error:e=>this.#i(e)})}disableRemoteControl(){this.#t.postApiV1RemotecontrolDisable().subscribe({next:e=>this.#n(e),error:e=>this.#i(e)})}deleteRemoteControl(){let e=this;this.#e.open(ct,{data:{title:$localize`Confirm delete`,message:$localize`Are you sure you want to delete the remote control registration?`,confirmText:$localize`Delete registration`,cancelText:$localize`Cancel`},closed:t=>{t&&e.#t.deleteApiV1RemotecontrolRegistration().subscribe({next:n=>e.#n(n),error:n=>e.#i(n)})}})}static \u0275fac=function(t){return new(t||s)};static \u0275prov=We({token:s,factory:s.\u0275fac,providedIn:"root"})};function Pt(s,e){if(s&1){let t=P();i(0,"sh-form-field",11)(1,"input",12),v("ngModelChange",function(a){u(t);let _=S(2);return y(_.registerUrl,a)||(_.registerUrl=a),m(a)}),o()(),i(2,"button",13),c("click",function(){u(t);let a=S(2);return m(a.register())}),r(3,0),o()}if(s&2){let t=S(2);l(),G("ngModel",t.registerUrl)}}function Ot(s,e){if(s&1&&(i(0,"div",8)(1,"label"),r(2,1),o(),i(3,"a",14),O(4),o()()),s&2){let t=S(2);l(3),h("href",et(t.claimUrl()),He),l(),W(t.claimUrl())}}function Rt(s,e){s&1&&(i(0,"div",8)(1,"label"),r(2,2),o()())}function It(s,e){if(s&1){let t=P();i(0,"button",13),c("click",function(){u(t);let a=S(2);return m(a.cancel())}),r(1,3),o()}}function Gt(s,e){if(s&1){let t=P();i(0,"button",13),c("click",function(){u(t);let a=S(2);return m(a.disable())}),r(1,4),o()}}function yt(s,e){if(s&1){let t=P();i(0,"button",13),c("click",function(){u(t);let a=S(2);return m(a.enable())}),r(1,5),o(),i(2,"button",15),c("click",function(){u(t);let a=S(2);return m(a.delete())}),r(3,6),o()}}function vt(s,e){s&1&&(i(0,"sh-icon"),O(1,"check"),o())}function At(s,e){s&1&&(i(0,"sh-icon"),O(1,"copy"),o())}function bt(s,e){if(s&1){let t=P();i(0,"sh-chip",16),c("click",function(){u(t);let a=S(2);return m(a.copyReportingUrl())}),O(1," Reporting configured by server "),p(2,vt,2,0,"sh-icon")(3,At,2,0,"sh-icon"),o()}if(s&2){let t=S(2);l(2),C(t.copiedReportingUrl()===!0?2:3)}}function Lt(s,e){if(s&1&&(i(0,"div",7),p(1,Pt,4,1),p(2,Ot,5,3,"div",8),p(3,Rt,3,0,"div",8),p(4,It,2,0,"button",9),p(5,Gt,2,0,"button",9),p(6,yt,4,0),p(7,bt,4,1,"sh-chip",10),o()),s&2){let t=S();l(),C(t.state()==="inactive"?1:-1),l(),C(t.state()==="registered"?2:-1),l(),C(t.state()==="registering"?3:-1),l(),C(t.state()==="registering"||t.state()==="registeringfaulted"||t.state()==="registered"?4:-1),l(),C(t.state()==="connected"||t.state()==="enabled"?5:-1),l(),C(t.state()==="disabled"?6:-1),l(),C(t.additionalReportingUrl()!==""?7:-1)}}var ie=class s{#e=N(J);#t=N(k);state=this.#e.state;claimUrl=this.#e.claimUrl;registerUrl=this.#e.registerUrl;additionalReportingUrl=A(()=>{let e=this.#t.serverSettings();return this.#e.state()==="inactive"?"":e&&e["additional-report-url"]||""});copiedReportingUrl=T(!1);ngOnInit(){this.#e.refreshRemoteControlStatus()}cancel(){this.#e.cancelRemoteRegistration()}register(){this.#e.beginRemoteRegistration()}disable(){this.#e.disableRemoteControl()}enable(){this.#e.enableRemoteControl()}delete(){this.#e.deleteRemoteControl()}copyReportingUrl(){let e=this.additionalReportingUrl();e&&(this.copiedReportingUrl.set(!0),setTimeout(()=>this.copiedReportingUrl.set(!1),2e3),navigator.clipboard.writeText(e))}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=w({type:s,selectors:[["app-remote-control"]],decls:1,vars:1,consts:()=>{let e;e=$localize`Register for remote control`;let t;t=$localize`Machine is now registered, open this link to add it to your account:`;let n;n=$localize`Registering, please wait...`;let a;a=$localize`Cancel registration`;let _;_=$localize`Disable remote control`;let E;E=$localize`Enable remote control`;let g;return g=$localize`Delete remote control setup`,[e,t,n,a,_,E,g,[1,"field-row"],[1,"field-col"],["type","button","shButton","",1,"raised"],[1,"reporting-url","primary","simple"],["label","Registration URL","for","remoteControlRegisterUrl"],["type","text","sh-input","","id","remoteControlRegisterUrl","name","remoteControlRegisterUrl",3,"ngModelChange","ngModel"],["type","button","shButton","",1,"raised",3,"click"],["target","_blank",3,"href"],["type","button","shButton","",1,"raised","error",3,"click"],[1,"reporting-url","primary","simple",3,"click"]]},template:function(t,n){t&1&&p(0,Lt,8,7,"div",7),t&2&&C(n.state()!=="unknown"?0:-1)},dependencies:[Y,j,K,Q,te,D,st,F],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{flex:1 0}.reporting-url[_ngcontent-%COMP%]{cursor:pointer;-webkit-user-select:none;user-select:none;margin-top:.25rem}"],changeDetection:0})};function mt(...s){let e=T(...s);return Object.defineProperty(e,"value",{get:e.asReadonly(),set:e.set.bind(e)})}var _e=()=>({standalone:!0});function $t(s,e){s&1&&(i(0,"sh-icon",69),O(1,"check"),o())}function wt(s,e){s&1&&(i(0,"sh-icon",70),O(1,"prohibit"),o())}function Ft(s,e){if(s&1){let t=P();i(0,"button",74),c("click",function(){u(t);let a=S(2);return m(a.updatePassphrase())}),r(1,34),o()}if(s&2){let t=S(2);M("loader",t.isUpdating())}}function Dt(s,e){if(s&1){let t=P();i(0,"button",75),c("click",function(){u(t);let a=S(2);return m(a.updatePassphrase())}),r(1,35),o()}if(s&2){let t=S(2);M("loader",t.isUpdating()),h("disabled",!0)}}function xt(s,e){if(s&1){let t=P();i(0,"sh-form-field")(1,"label",65),r(2,31),o(),i(3,"input",66),v("ngModelChange",function(a){u(t);let _=S();return y(_.passphrase,a)||(_.passphrase=a),m(a)}),o()(),i(4,"sh-form-field")(5,"label",67),r(6,32),o(),i(7,"input",68),v("ngModelChange",function(a){u(t);let _=S();return y(_.repeatPassphrase,a)||(_.repeatPassphrase=a),m(a)}),o(),p(8,$t,2,0,"sh-icon",69)(9,wt,2,0,"sh-icon",70),o(),i(10,"div",48)(11,"button",71),c("click",function(){u(t);let a=S();return m(a.cancelPasswordChange())}),r(12,33),o(),p(13,Ft,2,2,"button",72)(14,Dt,2,3,"button",73),o()}if(s&2){let t=S();l(3),G("ngModel",t.passphrase),l(4),h("disabled",t.passphrase().length===0),G("ngModel",t.repeatPassphrase),l(),C(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?8:9),l(3),M("loader",t.isUpdating()),l(2),C(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?13:14)}}function kt(s,e){s&1&&(i(0,"sh-icon",76),O(1,"check"),o())}function Jt(s,e){if(s&1){let t=P();i(0,"div",48)(1,"button",71),c("click",function(){u(t);let a=S();return m(a.openPassphraseForm())}),r(2,36),o(),p(3,kt,2,0,"sh-icon",76),o()}if(s&2){let t=S();l(3),C(t.passwordUpdated()?3:-1)}}function Xt(s,e){if(s&1){let t=P();i(0,"sh-form-field")(1,"label",77),r(2,37),o(),i(3,"textarea",78),v("ngModelChange",function(a){u(t);let _=S();return y(_.allowedHostnames,a)||(_.allowedHostnames=a),m(a)}),o()(),i(4,"sh-alert",79),r(5,38),o(),i(6,"button",74),c("click",function(){u(t);let a=S();return m(a.updateAllowedHostnames())}),r(7,39),o()}if(s&2){let t=S();l(3),G("ngModel",t.allowedHostnames),l(3),M("loader",t.updatingAllowedHosts())}}function Vt(s,e){if(s&1&&O(0),s&2){let t,n=S();H(" ",(t=n.sysinfo())==null?null:t.ServerVersion," ")}}function Ut(s,e){s&1&&I(0,"sh-progress-bar",53)}function zt(s,e){if(s&1&&O(0),s&2){let t=e.$implicit;H(" ",t.label," ")}}function Bt(s,e){if(s&1&&O(0),s&2){let t=e.$implicit;H(" ",t.label," ")}}function Wt(s,e,t){let n=mt(s),a=n[Ue];t?.equal&&(a.equal=t.equal);let _;return n.set=E=>{clearTimeout(_),_=setTimeout(()=>ze(a,E),e)},n.update=E=>{clearTimeout(_),_=setTimeout(()=>Be(a,E),e)},n}var Ht=[{value:"none",label:$localize`None`},{value:"s",label:$localize`Seconds`},{value:"m",label:$localize`Minutes`},{value:"h",label:$localize`Hours`}],qt=[{value:"none",label:$localize`System default (information)`},{value:"information",label:$localize`Usage statistics, warnings, errors, and crashes`},{value:"warning",label:$localize`Warnings, errors and crashes`},{value:"error",label:$localize`Errors and crashes`},{value:"crash",label:$localize`Crashes only`},{value:"disabled",label:$localize`None / disabled`}],de=class s{#e=N(gt);#t=N(ne);#o=N(x);#n=N(k);#i=N(J);#s=N(nt);#a=this.#s.getItem("locale")??"en-US";sysinfo=this.#t.systemInfo;isDarkMode=this.#e.isDarkMode;editAs=T("list");previousLang=this.#a;langCtrl=T(this.#a);usageStatistics=T("");updatingUsageStatistics=T(!1);remoteControlStatus=this.#i.status;updatingChannel=T(!1);updateChannel=T("");setNewChannel(e){let t=this.updateChannel();this.updateChannel.set(e),this.#o.patchApiV1Serversettings({requestBody:{"update-channel":e}}).pipe(R(()=>this.updatingChannel.set(!1)),$(()=>(this.updateChannel.set(t),L(null)))).subscribe()}allowRemoteAccess=T(!1);allowedHostnames=T("");loadedAllowedHostnames=T("");updatingRemoteAccess=T(!1);updatingAllowedHosts=T(!1);updateRemoteAccess(){let e=this.allowRemoteAccess(),t=!e;this.allowRemoteAccess.set(t),this.#o.patchApiV1Serversettings({requestBody:{"server-listen-interface":t?"any":"loopback"}}).pipe(R(()=>this.updatingRemoteAccess.set(!1)),$(()=>(this.allowRemoteAccess.set(e),L(null)))).subscribe()}updateAllowedHostnames(){let e=this.loadedAllowedHostnames(),t=this.allowedHostnames();this.updatingAllowedHosts.set(!0),this.#o.patchApiV1Serversettings({requestBody:{"server-listen-interface":"any","allowed-hostnames":t}}).pipe(R(()=>this.updatingAllowedHosts.set(!1)),$(()=>(this.allowedHostnames.set(e),L(null)))).subscribe()}updatingDisableTrayIconLogin=T(!1);disableTrayIconLogin=T(!1);saveDisableTrayIconLogin(){let e=this.disableTrayIconLogin(),t=!e;this.updatingDisableTrayIconLogin.set(!0),this.disableTrayIconLogin.set(t),this.#o.patchApiV1Serversettings({requestBody:{"disable-tray-icon-login":t?"True":"False"}}).pipe(R(()=>this.updatingDisableTrayIconLogin.set(!1)),$(()=>(this.disableTrayIconLogin.set(e),L(null)))).subscribe()}showPassphraseForm=T(!1);isUpdating=T(!1);passphrase=T("");repeatPassphrase=T("");passwordUpdated=T(!1);updatePassphrase(){this.passphrase()===this.repeatPassphrase()&&(this.isUpdating.set(!0),this.#o.patchApiV1Serversettings({requestBody:{"server-passphrase":this.passphrase()}}).pipe(R(()=>this.isUpdating.set(!1))).subscribe({next:()=>{this.showPassphraseForm.set(!1),this.passwordUpdated.set(!0),setTimeout(()=>{this.passwordUpdated.set(!1)},3e3)}}))}openPassphraseForm(){this.showPassphraseForm.set(!0)}cancelPasswordChange(){this.showPassphraseForm.set(!1)}languageOptions=T(Ct);usageStatisticsOptions=T(qt);timeTypeOptions=T(Ht);timeType=T("none");timeValue=Wt(0,300);timeRange=A(()=>this.timeType()==="h"?[0,24]:[0,60]);timeValueEffect=b(()=>{let e=this.timeValue(),t=this.#n.serverSettings();!t||t["startup-delay"]===""&&this.timeType()==="none"||this.updateStartupDelay()});updateLocale(e){!e||e===""||e===this.previousLang||(this.#s.setItem("locale",e),window.location.reload())}updateStartupDelay(){let e=this.timeValue(),t=this.timeType(),n="";t!=="none"&&e!==0&&(n=`${e}${t}`),this.#o.patchApiV1Serversettings({requestBody:{"startup-delay":n}}).subscribe()}updateTimeType(e){this.timeType()==="none"&&this.timeValue.set(0),this.timeType.set(e)}updateUsageStatistics(e){let t=this.usageStatistics();!e||e===""||e===t||(this.usageStatistics.set(e),this.updatingUsageStatistics.set(!0),this.#o.patchApiV1Serversettings({requestBody:{"usage-reporter-level":this.usageStatistics()==="none"?"":this.usageStatistics()}}).pipe(R(()=>this.updatingUsageStatistics.set(!1)),$(()=>(this.usageStatistics.set(t),L(null)))).subscribe())}serverSettingsEffect=b(()=>{let e=this.#n.serverSettings();if(e===void 0)return;let t=e["startup-delay"],n=t.slice(-1),a=t.slice(0,-1),_=["s","m","h"];this.disableTrayIconLogin.set(e["disable-tray-icon-login"]!=="False"),this.updateChannel.set(e["update-channel"]),this.allowRemoteAccess.set(e["server-listen-interface"]==="any"),this.allowedHostnames.set(e["allowed-hostnames"]),this.loadedAllowedHostnames.set(e["allowed-hostnames"]),this.usageStatistics.set(e["usage-reporter-level"]===""?"none":e["usage-reporter-level"]),this.timeType.set(t==""?"none":_.includes(n)?n:"none"),this.timeValue.set(t==""?0:parseInt(a))});setDarkMode(){this.#e.setDarkMode()}setLightMode(){this.#e.setLightMode()}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=w({type:s,selectors:[["app-settings"]],decls:132,vars:46,consts:()=>{let e;e=$localize`Settings`;let t;t=$localize`Configure your backup settings.`;let n;n=$localize`Remote access control`;let a;a=$localize`Color theme`;let _;_=$localize`Customize your application theme`;let E;E=$localize`Passwords`;let g;g=$localize`Change server passphrase`;let f;f=$localize`Language`;let V;V=$localize`Select a language for the platform`;let Te;Te=$localize`Allow remote access (requires restart)`;let Se;Se=$localize` By allowing remote access, the server listens to requests from any machine on your network. If you enable this option, make sure you are always using the computer on a secure firewall protected network. `;let ce;ce=$localize`Allow remote access`;let ge;ge=$localize`Prevent tray icon automatic log-in`;let pe;pe=$localize` By default, the tray icon will open the user interface with a token that unlocks the user interface. This ensures that you can access the user interface from the tray icon, while requiring others to enter a password. If you prefer having to type in the password, even when accessing the user interface from the tray icon, enable this option. `;let Ce;Ce=$localize`Prevent tray icon automatic log-in`;let ue;ue=$localize`Update channel`;let me;me=$localize` Default (${"\uFFFD0\uFFFD"}:INTERPOLATION:) `;let Ee;Ee=$localize`Same as the base install version: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let Ne;Ne=$localize`Stable`;let fe;fe=$localize`Official stable release.`;let he;he=$localize`Beta`;let Me;Me=$localize` Try out the new features that we are working on. Test a backup and restore before using this in production environments. `;let Pe;Pe=$localize` Experimental `;let Oe;Oe=$localize`Early previews of new features. Not for use with important data.`;let Re;Re=$localize`Canary`;let Ie;Ie=$localize`Builds for developers and testers only. Not for use with important data.`;let Ge;Ge=$localize`Pause after startup or hibernation`;let ye;ye=$localize` Duplicati will run when started, but will remain in paused state for the duration. Duplicati will occupy minimal system resources and no backups will be run. `;let ve;ve=$localize`Usage statistics`;let U;U=$localize` Usage reports help us improve the user experience and evaluate impact of new features. We use them to generate ${"\uFFFD#119\uFFFD"}:START_LINK:public usage statistics.${"\uFFFD/#119\uFFFD"}:CLOSE_LINK:${"[\uFFFD#120\uFFFD\uFFFD/#120\uFFFD|\uFFFD#121\uFFFD\uFFFD/#121\uFFFD]"}:LINE_BREAK:${"[\uFFFD#120\uFFFD\uFFFD/#120\uFFFD|\uFFFD#121\uFFFD\uFFFD/#121\uFFFD]"}:LINE_BREAK: All usage reports are sent anonymously and do not contain any personal information. They contain information about hardware and operating system, the type of backend, backup duration, overall size of source data and similar data. They do not contain paths, filenames, usernames, passwords or similar sensitive information. `,U=Qe(U);let Ae;Ae=$localize`Advanced options`;let be;be=$localize`Enter new password`;let Le;Le=$localize`Repeat password`;let oe;oe=$localize`Password have to be filled and have to match`;let $e;$e=$localize`Passphrase`;let we;we=$localize`Repeat passphrase`;let Fe;Fe=$localize`Cancel`;let De;De=$localize` Update passphrase `;let xe;xe=$localize` Update passphrase `;let ke;ke=$localize`Change password`;let Je;Je=$localize`Allowed hostnames`;let Xe;Xe=$localize` To prevent various DNS based attacks, Duplicati limits the allowed hostnames to the ones listed here. Direct IP access and localhost is always allowed. Multiple hostnames can be supplied with a semicolon separator. If any of the allowed hostnames is an asterisk (*), all hostnames are allowed and this feature is disabled. If the field is empty, only IP address and localhost access is allowed. `;let Ve;return Ve=$localize` Update allowed hostnames `,[e,t,n,a,_,E,g,f,V,Te,Se,ce,ge,pe,Ce,ue,me,Ee,Ne,fe,he,Me,Pe,Oe,Re,Ie,Ge,ye,ve,U,Ae,$e,we,Fe,De,xe,ke,Je,Xe,Ve,[1,"content"],[1,"title"],[1,"left"],[1,"right"],[1,"themes"],["src","assets/images/light-theme.png","alt","light theme",3,"click"],["src","assets/images/dark-theme.png","alt","dark theme",3,"click"],[1,"right","passphrase-form"],[1,"actions"],["value","value","label","label",3,"options","isClearable","inlineSearch"],["type","text",3,"ngModelChange","ngModel","ngModelOptions"],[1,"right","remote-access-form"],[1,"primary","raised",3,"click"],[1,"indeterminate","primary"],[1,"right","radios"],[1,"radio-option",3,"click"],[1,"primary","raised"],[1,"field-row"],[1,"raised","primary",3,"unit"],["type","range",3,"ngModelChange","min","max","disabled","ngModel","ngModelOptions"],["label","label","value","value",3,"options","isClearable"],["type","text",3,"ngModelChange","ngModel"],["href","#"],["label","label","value","value",3,"options","isLoading"],[1,"advanced-settings"],["for","password"],["type","password","name","password","autocomplete","disabled","placeholder",be,"tabindex","1",3,"ngModelChange","ngModel"],["for","repeatPassword"],["type","password","name","repeatPassword","autocomplete","disabled","placeholder",Le,"tabindex","2",3,"ngModelChange","disabled","ngModel"],["suffix","",1,"sh-success"],["suffix",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"loader"],["shButton","","shTooltip",oe,1,"raised","primary",3,"loader","disabled"],["shButton","",1,"raised","primary",3,"click"],["shButton","","shTooltip",oe,1,"raised","primary",3,"click","disabled"],[1,"sh-success"],["for","allowedHostnames"],["type","text","id","allowedHostnames",3,"ngModelChange","ngModel"],["type","primary"]]},template:function(t,n){if(t&1&&(I(0,"app-status-bar"),i(1,"div",40)(2,"header")(3,"div",41)(4,"h2"),r(5,0),o(),i(6,"p"),r(7,1),o()()(),i(8,"section")(9,"div",42)(10,"h3"),r(11,2),o(),i(12,"p"),O(13),o()(),i(14,"div",43),I(15,"app-remote-control"),o()(),i(16,"section")(17,"div",42)(18,"h3"),r(19,3),o(),i(20,"p"),r(21,4),o()(),i(22,"div",43)(23,"div",44)(24,"img",45),c("click",function(){return n.setLightMode()}),o(),i(25,"img",46),c("click",function(){return n.setDarkMode()}),o()()()(),i(26,"section")(27,"div",42)(28,"h3"),r(29,5),o(),i(30,"p"),r(31,6),o()(),i(32,"div",47),p(33,xt,15,7)(34,Jt,4,1,"div",48),o()(),i(35,"section")(36,"div",42)(37,"h3"),r(38,7),o(),i(39,"p"),r(40,8),o()(),i(41,"div",43)(42,"sh-select",49)(43,"input",50),c("ngModelChange",function(_){return n.updateLocale(_)}),o()()()(),i(44,"section")(45,"div",42)(46,"h3"),r(47,9),o(),i(48,"p"),r(49,10),o()(),i(50,"div",51)(51,"sh-toggle",52),c("click",function(){return n.updateRemoteAccess()}),i(52,"label"),r(53,11),o()(),p(54,Xt,8,3),o()(),i(55,"section")(56,"div",42)(57,"h3"),r(58,12),o(),i(59,"p"),r(60,13),o()(),i(61,"div",43)(62,"sh-toggle",52),c("click",function(){return n.saveDisableTrayIconLogin()}),i(63,"label"),r(64,14),o()()()(),i(65,"section")(66,"div",42)(67,"h3"),r(68,15),o(),i(69,"p"),p(70,Vt,1,1),o(),p(71,Ut,1,0,"sh-progress-bar",53),o(),i(72,"div",54)(73,"div",55),c("click",function(){return n.setNewChannel("")}),i(74,"sh-radio",56),r(75,16),o(),i(76,"p"),r(77,17),o()(),i(78,"div",55),c("click",function(){return n.setNewChannel("stable")}),i(79,"sh-radio",56),r(80,18),o(),i(81,"p"),r(82,19),o()(),i(83,"div",55),c("click",function(){return n.setNewChannel("beta")}),i(84,"sh-radio",56),r(85,20),o(),i(86,"p"),r(87,21),o()(),i(88,"div",55),c("click",function(){return n.setNewChannel("experimental")}),i(89,"sh-radio",56),r(90,22),o(),i(91,"p"),r(92,23),o()(),i(93,"div",55),c("click",function(){return n.setNewChannel("canary")}),i(94,"sh-radio",56),r(95,24),o(),i(96,"p"),r(97,25),o()()()()(),I(98,"sh-divider"),i(99,"div",40)(100,"section")(101,"div",42)(102,"h3"),r(103,26),o(),i(104,"p"),r(105,27),o()(),i(106,"div",43)(107,"div",57)(108,"sh-range-slider",58)(109,"input",59),v("ngModelChange",function(_){return y(n.timeValue,_)||(n.timeValue=_),_}),o()(),i(110,"sh-select",60)(111,"input",61),c("ngModelChange",function(_){return n.updateTimeType(_)}),o(),se(112,zt,1,1,"ng-template"),o()()()(),i(113,"section")(114,"div",42)(115,"h3"),r(116,28),o(),i(117,"p"),z(118,29),I(119,"a",62)(120,"br")(121,"br"),B(),o()(),i(122,"div",43)(123,"sh-select",63)(124,"input",50),c("ngModelChange",function(_){return n.updateUsageStatistics(_)}),o(),se(125,Bt,1,1,"ng-template"),o()()()(),i(126,"div",40)(127,"section")(128,"div",64)(129,"h3"),r(130,30),o(),I(131,"app-advanced-options-settings"),o()()()),t&2){let a,_,E;l(13),W(n.remoteControlStatus()),l(11),M("active",!n.isDarkMode()),l(),M("active",n.isDarkMode()),l(8),C(n.showPassphraseForm()?33:34),l(9),h("options",n.languageOptions())("isClearable",!1)("inlineSearch",!0),l(),h("ngModel",n.langCtrl())("ngModelOptions",q(43,_e)),l(8),M("active",n.allowRemoteAccess()),l(3),C(n.allowRemoteAccess()?54:-1),l(8),M("active",n.disableTrayIconLogin()),l(8),C(n.updateChannel()!==""&&((a=n.sysinfo())!=null&&a.ServerVersion)?70:-1),l(),C(n.updatingChannel()?71:-1),l(3),M("active",n.updateChannel()===""),l(),ae((_=n.sysinfo())==null?null:_.DefaultUpdateChannel),re(75),l(2),ae((E=n.sysinfo())==null?null:E.ServerVersionType),re(77),l(2),M("active",n.updateChannel()==="stable"),l(5),M("active",n.updateChannel()==="beta"),l(5),M("active",n.updateChannel()==="experimental"),l(5),M("active",n.updateChannel()==="canary"),l(14),h("unit",n.timeType()==="none"?"s":n.timeType()),l(),h("min",n.timeRange()[0])("max",n.timeRange()[1])("disabled",n.timeType()==="none"),G("ngModel",n.timeValue),h("ngModelOptions",q(44,_e)),l(),h("options",n.timeTypeOptions())("isClearable",!1),l(),h("ngModel",n.timeType()),l(12),h("options",n.usageStatisticsOptions())("isLoading",n.updatingUsageStatistics()),l(),h("ngModel",n.usageStatistics())("ngModelOptions",q(45,_e))}},dependencies:[Y,j,it,K,Q,Z,pt,ie,X,D,lt,_t,rt,Tt,St,te,F,at,ee,dt],styles:["[_nghost-%COMP%]{display:block}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem 2rem}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem 0;background:var(--base-1);border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}section[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;padding:2rem 0;border-top:1px solid var(--base-4)}section[_ngcontent-%COMP%]:first-of-type{border-top:0}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;align-items:flex-start}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] sh-button-group[_ngcontent-%COMP%]{margin-top:.25rem}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;width:50%}.passphrase-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:1rem}.passphrase-form[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.remote-access-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.themes[_ngcontent-%COMP%]{display:flex;gap:.5rem}.themes[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:15rem;border-radius:var(--shape-3);cursor:pointer}.themes[_ngcontent-%COMP%] img.active[_ngcontent-%COMP%]{border:2px solid var(--primary-8)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.radio-option[_ngcontent-%COMP%]{cursor:pointer}.radio-option[_ngcontent-%COMP%] sh-radio[_ngcontent-%COMP%]{color:var(--base-8);margin-bottom:.25rem}.radio-option[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;color:var(--base-9)}.field-col[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{flex:1 0}.advanced-settings[_ngcontent-%COMP%]{grid-column:1/-1;display:grid;grid-template-columns:auto 1fr;gap:1rem}"],changeDetection:0})};export{Wt as debounceSignal,de as default};