@duplicati/ngclient 0.0.145 → 0.0.146

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{e as a,f as b}from"./chunk-PN3U7MRX.js";import"./chunk-L6CWVBZ6.js";import"./chunk-OMMUXRXE.js";import"./chunk-N6ABN43N.js";import"./chunk-DDWLL7XA.js";import"./chunk-O64ZZGQZ.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-UKQFDBNO.js";import"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";export{a as createRestoreSelectFilesForm,b as default};
1
+ import{e as a,f as b}from"./chunk-JDXKHOL3.js";import"./chunk-EAV46VM2.js";import"./chunk-HIIPI6XR.js";import"./chunk-N6ABN43N.js";import"./chunk-DDWLL7XA.js";import"./chunk-O64ZZGQZ.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-UKQFDBNO.js";import"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";export{a as createRestoreSelectFilesForm,b as default};
@@ -1,4 +1,4 @@
1
- import{a as nt}from"./chunk-7IQY6U5W.js";import{a as it,b as ot}from"./chunk-OMMUXRXE.js";import{a as H,b as Je,c as Ye}from"./chunk-KDYD6LMI.js";import{h as tt}from"./chunk-MSLKIHQQ.js";import{a as et}from"./chunk-N6ABN43N.js";import{a as B}from"./chunk-DELLEGXW.js";import{a as X}from"./chunk-VTSUHAP5.js";import{a as Qe,c as Ce,e as ge,i as fe,k as Ze,s as Te}from"./chunk-N5SC4SKW.js";import{A as je,C as qe,a as me,e as Be,g as ue,l as ze,o as Ke,p as Ue,t as Xe,z as He}from"./chunk-H7K35UUX.js";import{h as We}from"./chunk-NOPMCS2Z.js";import{ea as Re}from"./chunk-RUXCS4ZK.js";import{Ab as d,Ac as ce,Bb as _,Cb as U,Cc as pe,Gb as le,Hb as Z,Hc as ee,Ib as se,Jb as E,Oc as y,Pc as te,Qb as J,Ra as l,Rb as Y,Sb as Ae,Uc as Ie,V as G,Wb as x,Xc as ke,Y as ye,Yb as s,Zb as Oe,_ as v,_b as ve,ac as Fe,bb as re,bc as Me,cc as Ve,ea as S,f as ae,fa as h,gb as R,gc as z,ia as we,ic as de,lc as p,nc as F,oa as k,oc as _e,qc as Le,rc as be,sc as Pe,tc as b,ub as C,uc as A,vb as g,vc as c,wb as q,xb as W,yb as Q,yc as $e,zb as m,zc as Ge}from"./chunk-HNWRQABR.js";import{a as M,b as oe}from"./chunk-EUDKD2JW.js";var at=class n{#e=v(We);#t=v(Be);#n=v(X);testDestination(t,e,o,i){return this.#n.hasV2TestOperations()?this.testDestinationv2(t,e,o,i):this.testDestinationv1(t,e,o,i)}testDestinationv2(t,e,o,i){return new ae(a=>{this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:t,AutoCreate:!1,Options:null}}).subscribe({next:r=>{if(r.Success){this.emitSuccessV2(a,t,e,r);return}this.handleGenericError(a,t,e,r.Error??"Unknown error",i)},error:r=>{let u=r?.error?.body;if(u?.Data?.FolderExists===!1||u?.StatusCode==="missing-folder"){o?this.handleMissingFolder(a,t,e):this.handleGenericError(a,t,e,$localize`The remote destination folder does not exist.`,i);return}if(u?.Data?.HostCertificate){this.handleMissingCertificate(a,t,e,u.Data?.HostCertificate);return}if(u?.Data?.ReportedHostKey){this.handleIncorrectKey(a,t,e,u.Data.ReportedHostKey,u.Data.AcceptedHostKey??null);return}this.handleGenericError(a,t,e,r?.message??"Unknown error",i)}})})}testDestinationv1(t,e,o,i){return new ae(a=>{this.#e.postApiV1RemoteoperationTest({requestBody:{path:t}}).subscribe({next:r=>{a.next({action:"success",targetUrl:t,testAgain:!1,destinationIndex:e}),a.complete()},error:r=>{this.handleDestinationErrorv1(r.message,t,e,o,i).subscribe(u=>{a.next(u)})}})})}handleMissingFolder(t,e,o){this.#t.open(B,{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:i=>{if(!i){this.reportNoAction(t,e,o,$localize`The remote folder does not exist.`);return}this.#n.hasV2TestOperations()?this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:e,AutoCreate:!0,Options:null}}).subscribe({next:a=>{if(a.Success){this.emitSuccessV2(t,e,o,a);return}else this.handleFolderCreateFailure(t,e,o,a.Error??$localize`Unknown error`)},error:a=>{this.handleFolderCreateFailure(t,e,o,a.message??$localize`Unknown error`)}}):this.#e.postApiV1RemoteoperationCreate({requestBody:{path:e}}).subscribe({next:()=>{this.handleFolderCreated(t,e,o)},error:a=>{this.handleFolderCreateFailure(t,e,o,a.message??$localize`Unknown error`)}})}})}handleFolderCreateFailure(t,e,o,i){this.#t.open(B,{data:{title:$localize`Error creating folder`,message:$localize`The remote destination folder could not be created. ${i}`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:o}),t.complete()}})}emitSuccessV2(t,e,o,i){t.next({action:"success",targetUrl:e,testAgain:!1,destinationIndex:o,anyFilesFound:!i.Data?.FolderIsEmpty,containsBackup:i.Data?.FolderContainsBackupFiles??void 0,containsEncryptedBackupFiles:i.Data?.FolderContainsEncryptedBackupFiles??void 0}),t.complete()}handleFolderCreated(t,e,o){this.#t.open(B,{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:o}),t.complete()}})}reportNoAction(t,e,o,i){t.next({action:"generic-error",targetUrl:e,errorMessage:i,testAgain:!1,destinationIndex:o}),t.complete()}handleMissingCertificate(t,e,o,i){this.#t.open(B,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
1
+ import{a as nt}from"./chunk-7IQY6U5W.js";import{a as it,b as ot}from"./chunk-HIIPI6XR.js";import{a as H,b as Je,c as Ye}from"./chunk-KDYD6LMI.js";import{h as tt}from"./chunk-MSLKIHQQ.js";import{a as et}from"./chunk-N6ABN43N.js";import{a as B}from"./chunk-DELLEGXW.js";import{a as X}from"./chunk-VTSUHAP5.js";import{a as Qe,c as Ce,e as ge,i as fe,k as Ze,s as Te}from"./chunk-N5SC4SKW.js";import{A as je,C as qe,a as me,e as Be,g as ue,l as ze,o as Ke,p as Ue,t as Xe,z as He}from"./chunk-H7K35UUX.js";import{h as We}from"./chunk-NOPMCS2Z.js";import{ea as Re}from"./chunk-RUXCS4ZK.js";import{Ab as d,Ac as ce,Bb as _,Cb as U,Cc as pe,Gb as le,Hb as Z,Hc as ee,Ib as se,Jb as E,Oc as y,Pc as te,Qb as J,Ra as l,Rb as Y,Sb as Ae,Uc as Ie,V as G,Wb as x,Xc as ke,Y as ye,Yb as s,Zb as Oe,_ as v,_b as ve,ac as Fe,bb as re,bc as Me,cc as Ve,ea as S,f as ae,fa as h,gb as R,gc as z,ia as we,ic as de,lc as p,nc as F,oa as k,oc as _e,qc as Le,rc as be,sc as Pe,tc as b,ub as C,uc as A,vb as g,vc as c,wb as q,xb as W,yb as Q,yc as $e,zb as m,zc as Ge}from"./chunk-HNWRQABR.js";import{a as M,b as oe}from"./chunk-EUDKD2JW.js";var at=class n{#e=v(We);#t=v(Be);#n=v(X);testDestination(t,e,o,i){return this.#n.hasV2TestOperations()?this.testDestinationv2(t,e,o,i):this.testDestinationv1(t,e,o,i)}testDestinationv2(t,e,o,i){return new ae(a=>{this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:t,AutoCreate:!1,Options:null}}).subscribe({next:r=>{if(r.Success){this.emitSuccessV2(a,t,e,r);return}this.handleGenericError(a,t,e,r.Error??"Unknown error",i)},error:r=>{let u=r?.error?.body;if(u?.Data?.FolderExists===!1||u?.StatusCode==="missing-folder"){o?this.handleMissingFolder(a,t,e):this.handleGenericError(a,t,e,$localize`The remote destination folder does not exist.`,i);return}if(u?.Data?.HostCertificate){this.handleMissingCertificate(a,t,e,u.Data?.HostCertificate);return}if(u?.Data?.ReportedHostKey){this.handleIncorrectKey(a,t,e,u.Data.ReportedHostKey,u.Data.AcceptedHostKey??null);return}this.handleGenericError(a,t,e,r?.message??"Unknown error",i)}})})}testDestinationv1(t,e,o,i){return new ae(a=>{this.#e.postApiV1RemoteoperationTest({requestBody:{path:t}}).subscribe({next:r=>{a.next({action:"success",targetUrl:t,testAgain:!1,destinationIndex:e}),a.complete()},error:r=>{this.handleDestinationErrorv1(r.message,t,e,o,i).subscribe(u=>{a.next(u)})}})})}handleMissingFolder(t,e,o){this.#t.open(B,{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:i=>{if(!i){this.reportNoAction(t,e,o,$localize`The remote folder does not exist.`);return}this.#n.hasV2TestOperations()?this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:e,AutoCreate:!0,Options:null}}).subscribe({next:a=>{if(a.Success){this.emitSuccessV2(t,e,o,a);return}else this.handleFolderCreateFailure(t,e,o,a.Error??$localize`Unknown error`)},error:a=>{this.handleFolderCreateFailure(t,e,o,a.message??$localize`Unknown error`)}}):this.#e.postApiV1RemoteoperationCreate({requestBody:{path:e}}).subscribe({next:()=>{this.handleFolderCreated(t,e,o)},error:a=>{this.handleFolderCreateFailure(t,e,o,a.message??$localize`Unknown error`)}})}})}handleFolderCreateFailure(t,e,o,i){this.#t.open(B,{data:{title:$localize`Error creating folder`,message:$localize`The remote destination folder could not be created. ${i}`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:o}),t.complete()}})}emitSuccessV2(t,e,o,i){t.next({action:"success",targetUrl:e,testAgain:!1,destinationIndex:o,anyFilesFound:!i.Data?.FolderIsEmpty,containsBackup:i.Data?.FolderContainsBackupFiles??void 0,containsEncryptedBackupFiles:i.Data?.FolderContainsEncryptedBackupFiles??void 0}),t.complete()}handleFolderCreated(t,e,o){this.#t.open(B,{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:o}),t.complete()}})}reportNoAction(t,e,o,i){t.next({action:"generic-error",targetUrl:e,errorMessage:i,testAgain:!1,destinationIndex:o}),t.complete()}handleMissingCertificate(t,e,o,i){this.#t.open(B,{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: ${i}`,confirmText:$localize`Trust the certificate`,cancelText:$localize`Cancel`},closed:a=>{if(!a){this.reportNoAction(t,e,o,$localize`The server certificate is not trusted.`);return}t.next({action:"trust-cert",targetUrl:e,testAgain:!0,certData:i,destinationIndex:o}),t.complete()}})}handleIncorrectKey(t,e,o,i,a){a?this.#t.open(B,{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.
@@ -1,3 +1,3 @@
1
- import{a as Ee}from"./chunk-L6CWVBZ6.js";import"./chunk-OMMUXRXE.js";import{a as fe}from"./chunk-NJEX2N4Q.js";import{h as O}from"./chunk-MSLKIHQQ.js";import"./chunk-N6ABN43N.js";import{a as Se}from"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import{b as T}from"./chunk-O64ZZGQZ.js";import{a as se}from"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import{c as le,e as me,f as de,j as _e,n as ce,o as ue,p as pe,q as Ce,r as ge,s as Ne,t as Me}from"./chunk-N5SC4SKW.js";import"./chunk-Z3EPZZGY.js";import"./chunk-UKQFDBNO.js";import{b as q,d as Z,e as J}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as Q,e as Y,g as ee,k as te,l as ne,p as ie,t as oe}from"./chunk-H7K35UUX.js";import{g as ae,h as re}from"./chunk-NOPMCS2Z.js";import"./chunk-TDKBGGNK.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-6OPAGPKF.js";import{Ab as a,Bb as n,Cb as r,Gb as A,Hb as h,Jb as v,Pc as j,Qb as N,Ra as m,Rb as M,Sb as u,Tb as G,Ub as U,Wb as x,Yb as f,_ as c,bb as $,ea as S,fa as E,ic as w,oa as F,qc as K,rc as X,sc as z,ub as b,vb as B,wb as k,xb as R,xc as V,yb as y,yc as H,zb as C,zc as W}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var Fe=()=>["backup"];function Ae(s,t){s&1&&r(0,"sh-progress-bar",12)}function he(s,t){if(s&1&&(a(0,"sh-form-field"),r(1,"input",32),n()),s&2){let e=t.$implicit,l=t.$index;m(),C("id",V("filter-",l))("formControl",e)}}function Te(s,t){if(s&1){let e=v();a(0,"form",13)(1,"sh-select",14)(2,"label",15),u(3,1),n(),r(4,"input",16),n(),a(5,"sh-form-field")(6,"label",17),u(7,2),n(),r(8,"textarea",18),n(),a(9,"sh-form-field")(10,"label",19),u(11,3),n(),r(12,"textarea",20),n()(),a(13,"sh-divider"),u(14,4),n(),a(15,"form",13)(16,"sh-form-field")(17,"label",21),u(18,5),n(),r(19,"input",22),n(),a(20,"sh-form-field")(21,"label",23),u(22,6),n(),r(23,"input",24),n(),a(24,"app-toggle-card",25),A(25,26),u(26,7),h(),A(27,27),R(28,he,2,3,"sh-form-field",null,k),h(),n()(),a(30,"p"),N(31,8),r(32,"a",28),M(),n(),a(33,"app-options-list",29),z("optionsChange",function(o){S(e);let p=f();return X(p.settings,o)||(p.settings=o),E(o)}),n(),a(34,"div",30)(35,"button",31),x("click",function(){S(e);let o=f();return E(o.submit())}),N(36,9),r(37,"sh-icon"),M(),n()()}if(s&2){let e=f();C("formGroup",e.baseCmdForm),m(),C("options",e.commandOptions()??W(10,Fe))("inlineSearch",!0),m(14),C("formGroup",e.standardFields),m(9),C("disallowToggle",!0),m(4),y(e.standardFields.controls.filters.controls),m(5),K("options",e.settings),C("hasFreeTextSettings",!0),m(2),w("loader",e.isSubmitting()),m(2),G(e.baseCmdForm.value.command),U(36)}}var d=new ge,Oe=["Bytes","KB","MB","GB","TB","PB"],P=class s{#e=c(O);#t=c(re);#n=c(Z);#i=c(q);#o=c(ae);#a=c(se);#l=c(Y);#r=T(this.#i.params);commandOptions=T(this.#o.getApiV1Commandline());sizeOptions=F(Oe);isSubmitting=F(!1);optionsFields=this.#e.optionsFields;standardFields=d.group({"backup-id":d.control(""),"backup-name":d.control(""),dbpath:d.control(""),filters:d.array([])});baseCmdForm=d.group({command:d.control("backup"),targetUrl:d.control(""),arguments:d.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;settings=this.#e.settings;#m=j(()=>{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(d.control(`${e.Include?"":"-"}${e.Expression}`))})}submit(){this.#a.resumeDialogCheck(()=>this.#s())}#s(){this.isSubmitting.set(!0);let t=this.baseCmdForm.value,e=t.targetUrl??"",l=t.arguments?.split(`
1
+ import{a as Ee}from"./chunk-EAV46VM2.js";import"./chunk-HIIPI6XR.js";import{a as fe}from"./chunk-NJEX2N4Q.js";import{h as O}from"./chunk-MSLKIHQQ.js";import"./chunk-N6ABN43N.js";import{a as Se}from"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import{b as T}from"./chunk-O64ZZGQZ.js";import{a as se}from"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import{c as le,e as me,f as de,j as _e,n as ce,o as ue,p as pe,q as Ce,r as ge,s as Ne,t as Me}from"./chunk-N5SC4SKW.js";import"./chunk-Z3EPZZGY.js";import"./chunk-UKQFDBNO.js";import{b as q,d as Z,e as J}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as Q,e as Y,g as ee,k as te,l as ne,p as ie,t as oe}from"./chunk-H7K35UUX.js";import{g as ae,h as re}from"./chunk-NOPMCS2Z.js";import"./chunk-TDKBGGNK.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-6OPAGPKF.js";import{Ab as a,Bb as n,Cb as r,Gb as A,Hb as h,Jb as v,Pc as j,Qb as N,Ra as m,Rb as M,Sb as u,Tb as G,Ub as U,Wb as x,Yb as f,_ as c,bb as $,ea as S,fa as E,ic as w,oa as F,qc as K,rc as X,sc as z,ub as b,vb as B,wb as k,xb as R,xc as V,yb as y,yc as H,zb as C,zc as W}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var Fe=()=>["backup"];function Ae(s,t){s&1&&r(0,"sh-progress-bar",12)}function he(s,t){if(s&1&&(a(0,"sh-form-field"),r(1,"input",32),n()),s&2){let e=t.$implicit,l=t.$index;m(),C("id",V("filter-",l))("formControl",e)}}function Te(s,t){if(s&1){let e=v();a(0,"form",13)(1,"sh-select",14)(2,"label",15),u(3,1),n(),r(4,"input",16),n(),a(5,"sh-form-field")(6,"label",17),u(7,2),n(),r(8,"textarea",18),n(),a(9,"sh-form-field")(10,"label",19),u(11,3),n(),r(12,"textarea",20),n()(),a(13,"sh-divider"),u(14,4),n(),a(15,"form",13)(16,"sh-form-field")(17,"label",21),u(18,5),n(),r(19,"input",22),n(),a(20,"sh-form-field")(21,"label",23),u(22,6),n(),r(23,"input",24),n(),a(24,"app-toggle-card",25),A(25,26),u(26,7),h(),A(27,27),R(28,he,2,3,"sh-form-field",null,k),h(),n()(),a(30,"p"),N(31,8),r(32,"a",28),M(),n(),a(33,"app-options-list",29),z("optionsChange",function(o){S(e);let p=f();return X(p.settings,o)||(p.settings=o),E(o)}),n(),a(34,"div",30)(35,"button",31),x("click",function(){S(e);let o=f();return E(o.submit())}),N(36,9),r(37,"sh-icon"),M(),n()()}if(s&2){let e=f();C("formGroup",e.baseCmdForm),m(),C("options",e.commandOptions()??W(10,Fe))("inlineSearch",!0),m(14),C("formGroup",e.standardFields),m(9),C("disallowToggle",!0),m(4),y(e.standardFields.controls.filters.controls),m(5),K("options",e.settings),C("hasFreeTextSettings",!0),m(2),w("loader",e.isSubmitting()),m(2),G(e.baseCmdForm.value.command),U(36)}}var d=new ge,Oe=["Bytes","KB","MB","GB","TB","PB"],P=class s{#e=c(O);#t=c(re);#n=c(Z);#i=c(q);#o=c(ae);#a=c(se);#l=c(Y);#r=T(this.#i.params);commandOptions=T(this.#o.getApiV1Commandline());sizeOptions=F(Oe);isSubmitting=F(!1);optionsFields=this.#e.optionsFields;standardFields=d.group({"backup-id":d.control(""),"backup-name":d.control(""),dbpath:d.control(""),filters:d.array([])});baseCmdForm=d.group({command:d.control("backup"),targetUrl:d.control(""),arguments:d.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;settings=this.#e.settings;#m=j(()=>{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(d.control(`${e.Include?"":"-"}${e.Expression}`))})}submit(){this.#a.resumeDialogCheck(()=>this.#s())}#s(){this.isSubmitting.set(!0);let t=this.baseCmdForm.value,e=t.targetUrl??"",l=t.arguments?.split(`
2
2
  `).filter(i=>i.length>0)??[],o=this.standardFields.value,p=o.filters??[],g=[t.command,e,...l,`--backup-name=${o["backup-name"]}`,`--dbpath=${o.dbpath}`,`--backup-id=${o["backup-id"]}`,...p.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:g}).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||s)};static \u0275cmp=$({type:s,selectors:[["app-commandline"]],features:[H([O])],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 l;l=$localize`TargetUrl`;let o;o=$localize`Commandline Arguments`;let p;p=$localize`Advanced options`;let g;g=$localize`Backup ID`;let i;i=$localize`Backup Name`;let I;I=$localize`Filters`;let D;D=$localize` The backups will be split up into multiple files called volumes. Here you can set the maximum size of the individual volume files. ${"\uFFFD#32\uFFFD"}:START_LINK:Read more${"\uFFFD/#32\uFFFD"}:CLOSE_LINK:`;let L;return L=$localize`${"\uFFFD#37\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#37\uFFFD"}:CLOSE_TAG_SH_ICON: Run "${"\uFFFD0\uFFFD"}:INTERPOLATION:" command now `,[t,e,l,o,p,g,i,I,D,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,l){e&1&&(r(0,"app-status-bar"),a(1,"section")(2,"div",10)(3,"button",11),N(4,0),r(5,"sh-icon"),M(),n()(),b(6,Ae,1,0,"sh-progress-bar",12)(7,Te,38,11),n()),e&2&&(m(6),B(l.finishedLoading()?7:6))},dependencies:[Ne,_e,le,me,de,fe,Ee,Se,Me,ce,ue,Ce,pe,J,ne,ee,te,oe,ie,Q],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;max-width:40rem;padding:2.5rem;gap:1.25rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.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:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-NEEEYVL7.js")},{path:"encryption",loadComponent:()=>import("./chunk-S2DE2CVG.js")},{path:"select-files",loadComponent:()=>import("./chunk-2J72DAGY.js")},{path:"options",loadComponent:()=>import("./chunk-JISUMMWT.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-MIXCKY7O.js")}],t=o;export{t as default};
@@ -1,3 +1,3 @@
1
- import{a as de,b as me}from"./chunk-OMMUXRXE.js";import{a as ce}from"./chunk-N6ABN43N.js";import{a as oe}from"./chunk-VTSUHAP5.js";import{b as re,c as ae,e as le,i as se,k as _e,s as pe}from"./chunk-N5SC4SKW.js";import{A as ne,C as ie,a as Q,g as W,l as Y,o as Z,t as ee,z as te}from"./chunk-H7K35UUX.js";import{ea as J}from"./chunk-RUXCS4ZK.js";import{Ab as a,Bb as s,Cb as w,Gb as v,Hb as V,Hc as D,Ib as T,Jb as g,Oc as k,Qb as b,Ra as p,Rb as $,Sb as X,Uc as R,Wb as C,Xc as q,Yb as l,_ as K,bb as U,ea as m,fa as u,gb as f,gc as x,ic as B,lc as d,mc as G,nc as A,oa as M,tc as H,ub as h,uc as z,vb as O,vc as S,wb as N,xb as P,yb as E,zb as c,zc as j}from"./chunk-HNWRQABR.js";import{a as I,b as L}from"./chunk-EUDKD2JW.js";var ge=()=>({updateOn:"blur"});function fe(t,i){if(t&1){let e=g();a(0,"button",13),C("click",function(){m(e);let n=l();return u(n.showTextArea.set(!1))}),b(1,5),w(2,"sh-icon"),$(),s()}}function xe(t,i){if(t&1){let e=g();a(0,"button",17,0),C("click",function(){let n=m(e).$implicit,r=l(3);return u(r.addSetting(n))}),d(2),s()}if(t&2){let e=i.$implicit;B("deprecated",e.deprecatedDescription),p(2),A(" ",e.name," ")}}function Se(t,i){if(t&1&&(a(0,"h3",9),d(1),s(),P(2,xe,3,3,"button",16,N)),t&2){let e=i.$implicit;p(),G(e.displayName),p(),E(e.options)}}function Te(t,i){if(t&1){let e=g();a(0,"sh-menu")(1,"button",18)(2,"sh-icon"),d(3,"dots-three-vertical"),s()(),v(4,15),a(5,"button",13),C("click",function(){m(e);let n=l(2);return u(n.addFreeTextSetting())}),b(6,7),w(7,"sh-icon"),$(),s(),a(8,"button",19),C("click",function(){m(e);let n=l(2);return u(n.showTextArea.set(!0))}),a(9,"sh-icon"),d(10,"link"),s(),d(11," Edit contents as text "),s(),V(),s()}}function he(t,i){if(t&1&&(a(0,"sh-menu",14)(1,"button",11),b(2,6),w(3,"sh-icon"),$(),s(),v(4,15),P(5,Se,4,1,null,null,N),V(),s(),h(7,Te,12,0,"sh-menu")),t&2){let e=l();c("searchable",!0),p(5),E(e.nonSelectedOptionsGrouped()),p(2),O(e.hasFreeTextSettings()?7:-1)}}function Oe(t,i){if(t&1){let e=g();a(0,"textarea",20),C("ngModelChange",function(n){m(e);let r=l();return u(r.updateSettingsFromText(n))}),s()}if(t&2){let e=l();c("ngModel",e.settingsAsText())("ngModelOptions",j(2,ge))}}function Fe(t,i){t&1&&(a(0,"div",21),d(1,"Add a setting above to get started."),s())}function we(t,i){t&1&&(a(0,"sh-icon",29),d(1," warning-octagon "),s())}function Ve(t,i){if(t&1&&(a(0,"sh-icon",30),d(1,"archive"),s()),t&2){let e=l(2).$implicit;c("shTooltip",e.FormView.deprecatedDescription)}}function ye(t,i){if(t&1&&(a(0,"sh-icon",31),d(1,"question"),s()),t&2){let e=l(2).$implicit;c("shTooltip",e.FormView.longDescription)}}function Ie(t,i){if(t&1&&(h(0,we,2,0,"sh-icon",29),a(1,"span"),d(2),s(),h(3,Ve,2,1,"sh-icon",30)(4,ye,2,1,"sh-icon",31)),t&2){let e=l().$implicit,o=S(1);O(o?0:-1),p(),B("deprecated",e.FormView.deprecatedDescription),p(),G(e.FormView.shortDescription),p(),O(e.FormView.deprecatedDescription?3:e.FormView.longDescription?4:-1)}}function Le(t,i){t&1&&T(0)}function Me(t,i){if(t&1){let e=g();a(0,"div",23)(1,"label"),f(2,Le,1,0,"ng-container",32),s(),a(3,"div")(4,"sh-form-field")(5,"input",33),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateFreeTextSettingName(r,n))}),s(),a(6,"sh-icon",34),d(7,"rectangle-dashed"),s()()(),a(8,"div")(9,"sh-form-field")(10,"input",33),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s(),a(11,"sh-icon",34),d(12,"textbox"),s()()()()}if(t&2){let e=l().$implicit,o=x(3);p(2),c("ngTemplateOutlet",o),p(3),c("ngModel",e.Name),p(5),c("ngModel",e.Value())}}function Ne(t,i){t&1&&T(0)}function Pe(t,i){if(t&1){let e=g();a(0,"app-file-tree",24)(1,"label",35),f(2,Ne,1,0,"ng-container",32),s(),a(3,"input",36),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s()()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);c("startingPath",e.Value())("accepts",e.FormView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),p(),c("for",n),p(),c("ngTemplateOutlet",o),p(),c("id",n)("ngModel",e.Value())}}function Ee(t,i){if(t&1){let e=g();a(0,"app-file-tree",25),w(1,"label",35),a(2,"input",36),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s()()}if(t&2){let e=l().$implicit,o=S(0);c("startingPath",e.Value()),p(),c("for",o),p(),c("id",o)("ngModel",e.Value())}}function ve(t,i){t&1&&T(0)}function be(t,i){t&1&&(a(0,"sh-icon",34),d(1,"link"),s())}function $e(t,i){t&1&&(a(0,"sh-icon",34),d(1,"textbox"),s())}function Ae(t,i){if(t&1){let e=g();a(0,"sh-form-field")(1,"label",35),f(2,ve,1,0,"ng-container",32),s(),a(3,"input",36),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s(),h(4,be,2,0,"sh-icon",34)(5,$e,2,0,"sh-icon",34),s()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);p(),c("for",n),p(),c("ngTemplateOutlet",o),p(),c("id",n)("ngModel",e.Value()),p(),O(e.FormView.type==="Path"?4:5)}}function De(t,i){t&1&&T(0)}function ke(t,i){if(t&1){let e=g();a(0,"sh-icon",39),C("click",function(){m(e);let n=l(2).$implicit;return u(n.showPassword=!n.showPassword)}),d(1," eye "),s()}}function Re(t,i){if(t&1){let e=g();a(0,"sh-icon",39),C("click",function(){m(e);let n=l(2).$implicit;return u(n.showPassword=!n.showPassword)}),d(1," eye-slash "),s()}}function Be(t,i){if(t&1){let e=g();a(0,"sh-form-field")(1,"label",35),f(2,De,1,0,"ng-container",32),s(),a(3,"input",37),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s(),a(4,"sh-icon",34),d(5,"password"),s(),h(6,ke,2,0,"sh-icon",38)(7,Re,2,0,"sh-icon",38),s()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);p(),c("for",n),p(),c("ngTemplateOutlet",o),p(),c("type",e.showPassword?"text":"password")("id",n)("ngModel",e.Value()),p(3),O(e.showPassword?6:7)}}function Ge(t,i){t&1&&T(0)}function ze(t,i){if(t&1&&d(0),t&2){let e=i.$implicit;A(" ",e," ")}}function Ke(t,i){if(t&1){let e=g();a(0,"sh-select",40)(1,"label",35),f(2,Ge,1,0,"ng-container",32),s(),a(3,"input",36),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s()(),f(4,ze,1,1,"ng-template",null,2,D)}if(t&2){let e=x(5),o=l().$implicit,n=x(3),r=S(0);c("options",o.FormView.options)("isClearable",!1)("optionTemplate",e),p(),c("for",r),p(),c("ngTemplateOutlet",n),p(),c("id",r)("ngModel",o.Value())}}function Ue(t,i){t&1&&T(0)}function Xe(t,i){if(t&1){let e=g();a(0,"app-size",41),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),a(1,"label",35),f(2,Ue,1,0,"ng-container",32),s()()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);c("inputType",e.Name)("ngModel",e.Value())("customId",n),p(),c("for",n),p(),c("ngTemplateOutlet",o)}}function He(t,i){t&1&&T(0)}function je(t,i){if(t&1){let e=g();a(0,"sh-form-field")(1,"label",35),f(2,He,1,0,"ng-container",32),s(),a(3,"input",42),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s(),a(4,"sh-icon",34),d(5,"numpad"),s()()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);p(),c("for",n),p(),c("ngTemplateOutlet",o),p(),c("id",n)("ngModel",e.Value())}}function qe(t,i){t&1&&T(0)}function Je(t,i){if(t&1){let e=g();a(0,"sh-toggle",27)(1,"label",35),f(2,qe,1,0,"ng-container",32),s(),a(3,"input",43),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s()()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);p(),c("for",n),p(),c("ngTemplateOutlet",o),p(),c("id",n)("ngModel",e.Value())}}function Qe(t,i){t&1&&T(0)}function We(t,i){if(t&1&&d(0),t&2){let e=i.$implicit;A(" ",e," ")}}function Ye(t,i){if(t&1){let e=g();a(0,"sh-select",44)(1,"label",35),f(2,Qe,1,0,"ng-container",32),s(),a(3,"input",45),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s()(),f(4,We,1,1,"ng-template",null,3,D)}if(t&2){let e=x(5),o=l().$implicit,n=x(3),r=S(0);c("options",o.FormView.options)("selectMultiple",!0)("optionTemplate",e),p(),c("for",r),p(),c("ngTemplateOutlet",n),p(),c("ngModel",o.Value())}}function Ze(t,i){t&1&&T(0)}function et(t,i){if(t&1){let e=g();a(0,"app-timespan",41),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),a(1,"label",35),f(2,Ze,1,0,"ng-container",32),s()()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);c("inputType",e.Name)("ngModel",e.Value())("customId",n),p(),c("for",n),p(),c("ngTemplateOutlet",o)}}function tt(t,i){if(t&1){let e=g();H(0)(1),f(2,Ie,5,5,"ng-template",null,1,D),a(4,"div",22),h(5,Me,13,3,"div",23)(6,Pe,4,9,"app-file-tree",24)(7,Ee,3,4,"app-file-tree",25)(8,Ae,6,5,"sh-form-field")(9,Be,8,6,"sh-form-field")(10,Ke,6,7)(11,Xe,3,5,"app-size",26)(12,je,6,4,"sh-form-field")(13,Je,4,4,"sh-toggle",27)(14,Ye,6,6)(15,et,3,5,"app-timespan",26),a(16,"button",28),C("click",function(){let n=m(e).$implicit,r=l(2);return u(r.removeSetting(n))}),a(17,"sh-icon"),d(18,"x-bold"),s()()()}if(t&2){let e=i.$implicit,o=i.$index,n=l(2);z("destination-"+e.Name+o),p(),z(n.inAppOptions(e.Name)),p(4),O(e.FormView.type==="FreeText"?5:e.FormView.type==="FileTree"?6:e.FormView.type==="FolderTree"?7:e.FormView.type==="String"||e.FormView.type==="Path"||e.FormView.type==="Decimal"?8:e.FormView.type==="Password"?9:e.FormView.type==="Enumeration"?10:e.FormView.type==="Size"?11:e.FormView.type==="Integer"?12:e.FormView.type==="Boolean"?13:e.FormView.type==="Flags"?14:e.FormView.type==="Timespan"||e.FormView.type==="DateTime"?15:-1)}}function nt(t,i){if(t&1&&(h(0,Fe,2,0,"div",21),P(1,tt,19,3,null,null,N)),t&2){let e=l();O(e.selectedSettings().length===0?0:-1),p(),E(e.selectedSettings())}}var ue=class t{#e=K(oe);options=q.required();hiddenOptions=R([]);hasFreeTextSettings=R(!1);applicationOptions=R();showTextArea=M(!1);allOptionsGrouped=this.#e.allOptionsGrouped;allOptions=this.#e.allOptions;selectedSettings=k(()=>{let i=this.hiddenOptions();return this.options().map(n=>{let r=this.allOptions().find(F=>F.name===n.Name?.replace("--","")),_=n.Value??"";if(r&&i.includes(r.name))return null;if(r){if(r.type==="Boolean"&&(_=this.isTrue(_)),r.type==="Integer"&&(_=parseInt(_)||0),r.type==="Enumeration"&&r.options){let F=_?.trim().toLowerCase(),y=r.options.find(Ce=>(Ce??"").trim().toLocaleLowerCase()===F);y&&(_=y)}return L(I({},n),{Value:M(_),FormView:r})}else if(this.hasFreeTextSettings())return L(I({},n),{Value:M(_),FormView:{name:n.Name,type:"FreeText",shortDescription:"Custom settings argument",longDescription:"Custom settings argument"}});return null}).filter(n=>n!==null)});nonSelectedOptionsGrouped=k(()=>{let i=this.options().map(o=>o.Name?.replace("--","")),e=this.hiddenOptions();return this.allOptionsGrouped().map(o=>L(I({},o),{options:o.options.filter(n=>!i.includes(n.name)&&!e.includes(n.name))})).filter(o=>o.options.length>0)});settingsAsText=k(()=>this.selectedSettings().map(i=>{let e=i.Value(),o="";return typeof e=="boolean"?o=this.isTrue(e)?"True":"False":(typeof e=="number"||e!=null)&&(o=e.toString()),`${i.Name??""}=${o}`}).join(`
1
+ import{a as de,b as me}from"./chunk-HIIPI6XR.js";import{a as ce}from"./chunk-N6ABN43N.js";import{a as oe}from"./chunk-VTSUHAP5.js";import{b as re,c as ae,e as le,i as se,k as _e,s as pe}from"./chunk-N5SC4SKW.js";import{A as ne,C as ie,a as Q,g as W,l as Y,o as Z,t as ee,z as te}from"./chunk-H7K35UUX.js";import{ea as J}from"./chunk-RUXCS4ZK.js";import{Ab as a,Bb as s,Cb as w,Gb as v,Hb as V,Hc as D,Ib as T,Jb as g,Oc as k,Qb as b,Ra as p,Rb as $,Sb as X,Uc as R,Wb as C,Xc as q,Yb as l,_ as K,bb as U,ea as m,fa as u,gb as f,gc as x,ic as B,lc as d,mc as G,nc as A,oa as M,tc as H,ub as h,uc as z,vb as O,vc as S,wb as N,xb as P,yb as E,zb as c,zc as j}from"./chunk-HNWRQABR.js";import{a as I,b as L}from"./chunk-EUDKD2JW.js";var ge=()=>({updateOn:"blur"});function fe(t,i){if(t&1){let e=g();a(0,"button",13),C("click",function(){m(e);let n=l();return u(n.showTextArea.set(!1))}),b(1,5),w(2,"sh-icon"),$(),s()}}function xe(t,i){if(t&1){let e=g();a(0,"button",17,0),C("click",function(){let n=m(e).$implicit,r=l(3);return u(r.addSetting(n))}),d(2),s()}if(t&2){let e=i.$implicit;B("deprecated",e.deprecatedDescription),p(2),A(" ",e.name," ")}}function Se(t,i){if(t&1&&(a(0,"h3",9),d(1),s(),P(2,xe,3,3,"button",16,N)),t&2){let e=i.$implicit;p(),G(e.displayName),p(),E(e.options)}}function Te(t,i){if(t&1){let e=g();a(0,"sh-menu")(1,"button",18)(2,"sh-icon"),d(3,"dots-three-vertical"),s()(),v(4,15),a(5,"button",13),C("click",function(){m(e);let n=l(2);return u(n.addFreeTextSetting())}),b(6,7),w(7,"sh-icon"),$(),s(),a(8,"button",19),C("click",function(){m(e);let n=l(2);return u(n.showTextArea.set(!0))}),a(9,"sh-icon"),d(10,"link"),s(),d(11," Edit contents as text "),s(),V(),s()}}function he(t,i){if(t&1&&(a(0,"sh-menu",14)(1,"button",11),b(2,6),w(3,"sh-icon"),$(),s(),v(4,15),P(5,Se,4,1,null,null,N),V(),s(),h(7,Te,12,0,"sh-menu")),t&2){let e=l();c("searchable",!0),p(5),E(e.nonSelectedOptionsGrouped()),p(2),O(e.hasFreeTextSettings()?7:-1)}}function Oe(t,i){if(t&1){let e=g();a(0,"textarea",20),C("ngModelChange",function(n){m(e);let r=l();return u(r.updateSettingsFromText(n))}),s()}if(t&2){let e=l();c("ngModel",e.settingsAsText())("ngModelOptions",j(2,ge))}}function Fe(t,i){t&1&&(a(0,"div",21),d(1,"Add a setting above to get started."),s())}function we(t,i){t&1&&(a(0,"sh-icon",29),d(1," warning-octagon "),s())}function Ve(t,i){if(t&1&&(a(0,"sh-icon",30),d(1,"archive"),s()),t&2){let e=l(2).$implicit;c("shTooltip",e.FormView.deprecatedDescription)}}function ye(t,i){if(t&1&&(a(0,"sh-icon",31),d(1,"question"),s()),t&2){let e=l(2).$implicit;c("shTooltip",e.FormView.longDescription)}}function Ie(t,i){if(t&1&&(h(0,we,2,0,"sh-icon",29),a(1,"span"),d(2),s(),h(3,Ve,2,1,"sh-icon",30)(4,ye,2,1,"sh-icon",31)),t&2){let e=l().$implicit,o=S(1);O(o?0:-1),p(),B("deprecated",e.FormView.deprecatedDescription),p(),G(e.FormView.shortDescription),p(),O(e.FormView.deprecatedDescription?3:e.FormView.longDescription?4:-1)}}function Le(t,i){t&1&&T(0)}function Me(t,i){if(t&1){let e=g();a(0,"div",23)(1,"label"),f(2,Le,1,0,"ng-container",32),s(),a(3,"div")(4,"sh-form-field")(5,"input",33),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateFreeTextSettingName(r,n))}),s(),a(6,"sh-icon",34),d(7,"rectangle-dashed"),s()()(),a(8,"div")(9,"sh-form-field")(10,"input",33),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s(),a(11,"sh-icon",34),d(12,"textbox"),s()()()()}if(t&2){let e=l().$implicit,o=x(3);p(2),c("ngTemplateOutlet",o),p(3),c("ngModel",e.Name),p(5),c("ngModel",e.Value())}}function Ne(t,i){t&1&&T(0)}function Pe(t,i){if(t&1){let e=g();a(0,"app-file-tree",24)(1,"label",35),f(2,Ne,1,0,"ng-container",32),s(),a(3,"input",36),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s()()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);c("startingPath",e.Value())("accepts",e.FormView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),p(),c("for",n),p(),c("ngTemplateOutlet",o),p(),c("id",n)("ngModel",e.Value())}}function Ee(t,i){if(t&1){let e=g();a(0,"app-file-tree",25),w(1,"label",35),a(2,"input",36),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s()()}if(t&2){let e=l().$implicit,o=S(0);c("startingPath",e.Value()),p(),c("for",o),p(),c("id",o)("ngModel",e.Value())}}function ve(t,i){t&1&&T(0)}function be(t,i){t&1&&(a(0,"sh-icon",34),d(1,"link"),s())}function $e(t,i){t&1&&(a(0,"sh-icon",34),d(1,"textbox"),s())}function Ae(t,i){if(t&1){let e=g();a(0,"sh-form-field")(1,"label",35),f(2,ve,1,0,"ng-container",32),s(),a(3,"input",36),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s(),h(4,be,2,0,"sh-icon",34)(5,$e,2,0,"sh-icon",34),s()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);p(),c("for",n),p(),c("ngTemplateOutlet",o),p(),c("id",n)("ngModel",e.Value()),p(),O(e.FormView.type==="Path"?4:5)}}function De(t,i){t&1&&T(0)}function ke(t,i){if(t&1){let e=g();a(0,"sh-icon",39),C("click",function(){m(e);let n=l(2).$implicit;return u(n.showPassword=!n.showPassword)}),d(1," eye "),s()}}function Re(t,i){if(t&1){let e=g();a(0,"sh-icon",39),C("click",function(){m(e);let n=l(2).$implicit;return u(n.showPassword=!n.showPassword)}),d(1," eye-slash "),s()}}function Be(t,i){if(t&1){let e=g();a(0,"sh-form-field")(1,"label",35),f(2,De,1,0,"ng-container",32),s(),a(3,"input",37),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s(),a(4,"sh-icon",34),d(5,"password"),s(),h(6,ke,2,0,"sh-icon",38)(7,Re,2,0,"sh-icon",38),s()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);p(),c("for",n),p(),c("ngTemplateOutlet",o),p(),c("type",e.showPassword?"text":"password")("id",n)("ngModel",e.Value()),p(3),O(e.showPassword?6:7)}}function Ge(t,i){t&1&&T(0)}function ze(t,i){if(t&1&&d(0),t&2){let e=i.$implicit;A(" ",e," ")}}function Ke(t,i){if(t&1){let e=g();a(0,"sh-select",40)(1,"label",35),f(2,Ge,1,0,"ng-container",32),s(),a(3,"input",36),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s()(),f(4,ze,1,1,"ng-template",null,2,D)}if(t&2){let e=x(5),o=l().$implicit,n=x(3),r=S(0);c("options",o.FormView.options)("isClearable",!1)("optionTemplate",e),p(),c("for",r),p(),c("ngTemplateOutlet",n),p(),c("id",r)("ngModel",o.Value())}}function Ue(t,i){t&1&&T(0)}function Xe(t,i){if(t&1){let e=g();a(0,"app-size",41),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),a(1,"label",35),f(2,Ue,1,0,"ng-container",32),s()()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);c("inputType",e.Name)("ngModel",e.Value())("customId",n),p(),c("for",n),p(),c("ngTemplateOutlet",o)}}function He(t,i){t&1&&T(0)}function je(t,i){if(t&1){let e=g();a(0,"sh-form-field")(1,"label",35),f(2,He,1,0,"ng-container",32),s(),a(3,"input",42),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s(),a(4,"sh-icon",34),d(5,"numpad"),s()()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);p(),c("for",n),p(),c("ngTemplateOutlet",o),p(),c("id",n)("ngModel",e.Value())}}function qe(t,i){t&1&&T(0)}function Je(t,i){if(t&1){let e=g();a(0,"sh-toggle",27)(1,"label",35),f(2,qe,1,0,"ng-container",32),s(),a(3,"input",43),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s()()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);p(),c("for",n),p(),c("ngTemplateOutlet",o),p(),c("id",n)("ngModel",e.Value())}}function Qe(t,i){t&1&&T(0)}function We(t,i){if(t&1&&d(0),t&2){let e=i.$implicit;A(" ",e," ")}}function Ye(t,i){if(t&1){let e=g();a(0,"sh-select",44)(1,"label",35),f(2,Qe,1,0,"ng-container",32),s(),a(3,"input",45),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s()(),f(4,We,1,1,"ng-template",null,3,D)}if(t&2){let e=x(5),o=l().$implicit,n=x(3),r=S(0);c("options",o.FormView.options)("selectMultiple",!0)("optionTemplate",e),p(),c("for",r),p(),c("ngTemplateOutlet",n),p(),c("ngModel",o.Value())}}function Ze(t,i){t&1&&T(0)}function et(t,i){if(t&1){let e=g();a(0,"app-timespan",41),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),a(1,"label",35),f(2,Ze,1,0,"ng-container",32),s()()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);c("inputType",e.Name)("ngModel",e.Value())("customId",n),p(),c("for",n),p(),c("ngTemplateOutlet",o)}}function tt(t,i){if(t&1){let e=g();H(0)(1),f(2,Ie,5,5,"ng-template",null,1,D),a(4,"div",22),h(5,Me,13,3,"div",23)(6,Pe,4,9,"app-file-tree",24)(7,Ee,3,4,"app-file-tree",25)(8,Ae,6,5,"sh-form-field")(9,Be,8,6,"sh-form-field")(10,Ke,6,7)(11,Xe,3,5,"app-size",26)(12,je,6,4,"sh-form-field")(13,Je,4,4,"sh-toggle",27)(14,Ye,6,6)(15,et,3,5,"app-timespan",26),a(16,"button",28),C("click",function(){let n=m(e).$implicit,r=l(2);return u(r.removeSetting(n))}),a(17,"sh-icon"),d(18,"x-bold"),s()()()}if(t&2){let e=i.$implicit,o=i.$index,n=l(2);z("destination-"+e.Name+o),p(),z(n.inAppOptions(e.Name)),p(4),O(e.FormView.type==="FreeText"?5:e.FormView.type==="FileTree"?6:e.FormView.type==="FolderTree"?7:e.FormView.type==="String"||e.FormView.type==="Path"||e.FormView.type==="Decimal"?8:e.FormView.type==="Password"?9:e.FormView.type==="Enumeration"?10:e.FormView.type==="Size"?11:e.FormView.type==="Integer"?12:e.FormView.type==="Boolean"?13:e.FormView.type==="Flags"?14:e.FormView.type==="Timespan"||e.FormView.type==="DateTime"?15:-1)}}function nt(t,i){if(t&1&&(h(0,Fe,2,0,"div",21),P(1,tt,19,3,null,null,N)),t&2){let e=l();O(e.selectedSettings().length===0?0:-1),p(),E(e.selectedSettings())}}var ue=class t{#e=K(oe);options=q.required();hiddenOptions=R([]);hasFreeTextSettings=R(!1);applicationOptions=R();showTextArea=M(!1);allOptionsGrouped=this.#e.allOptionsGrouped;allOptions=this.#e.allOptions;selectedSettings=k(()=>{let i=this.hiddenOptions();return this.options().map(n=>{let r=this.allOptions().find(F=>F.name===n.Name?.replace("--","")),_=n.Value??"";if(r&&i.includes(r.name))return null;if(r){if(r.type==="Boolean"&&(_=this.isTrue(_)),r.type==="Integer"&&(_=parseInt(_)||0),r.type==="Enumeration"&&r.options){let F=_?.trim().toLowerCase(),y=r.options.find(Ce=>(Ce??"").trim().toLocaleLowerCase()===F);y&&(_=y)}return L(I({},n),{Value:M(_),FormView:r})}else if(this.hasFreeTextSettings())return L(I({},n),{Value:M(_),FormView:{name:n.Name,type:"FreeText",shortDescription:"Custom settings argument",longDescription:"Custom settings argument"}});return null}).filter(n=>n!==null)});nonSelectedOptionsGrouped=k(()=>{let i=this.options().map(o=>o.Name?.replace("--","")),e=this.hiddenOptions();return this.allOptionsGrouped().map(o=>L(I({},o),{options:o.options.filter(n=>!i.includes(n.name)&&!e.includes(n.name))})).filter(o=>o.options.length>0)});settingsAsText=k(()=>this.selectedSettings().map(i=>{let e=i.Value(),o="";return typeof e=="boolean"?o=this.isTrue(e)?"True":"False":(typeof e=="number"||e!=null)&&(o=e.toString()),`${i.Name??""}=${o}`}).join(`
2
2
  `));updateSettingsFromText(i){if(typeof i!="string")return;let e=i.split(`
3
3
  `).map(n=>n.trim()).filter(n=>n.length>0),o=[];for(let n of e){let[r,_]=n.split("=").map(F=>F.trim());r&&r.trim().length>0&&_!==void 0&&o.push({Name:`${r}`,Value:_})}this.options.update(()=>o)}isTrue(i){if(typeof i=="boolean")return i;if(typeof i=="string"){let e=i.toLowerCase();return e==="true"||e==="1"||e==="yes"||e==="on"}return!1}inAppOptions(i){let e=this.applicationOptions()?.findIndex(o=>o.Name?.replace("--","")===i);return e===void 0?!1:e>-1}addFreeTextSetting(){this.hasFreeTextSettings()&&this.options.update(i=>[...i,{Filter:null,Name:"",Value:""}])}addSetting(i){this.options.update(e=>{let o=i.defaultValue??"";return i.type==="Boolean"&&(o=this.isTrue(o)),i.type==="Integer"&&(o=parseInt(o)||0),[...e,{Name:i.name,Value:o}]})}updateSettingValue(i,e){this.options.update(o=>{let n=[...o],r=n.findIndex(_=>_.Name===i.Name);if(i.FormView.type==="Boolean")return n[r].Value=this.isTrue(e)?"True":"False",n;if(i.FormView.type==="Integer")return n[r].Value=e.toString(),n;if(i.FormView.type==="Enumeration"&&i.FormView.options){let _=e?.trim().toLowerCase()??"",F=i.FormView.options.find(y=>(y??"").trim().toLocaleLowerCase()===_);if(F)return n[r].Value=F,n}return n[r].Value=e,n})}updateFreeTextSettingName(i,e){this.options.update(o=>{let n=[...o],r=n.findIndex(_=>_.Name===i.Name);return n[r].Name=e,n})}removeSetting(i){this.options.update(e=>e.filter(o=>o.Name!==i.Name))}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=U({type:t,selectors:[["app-options-list"]],inputs:{options:[1,"options"],hiddenOptions:[1,"hiddenOptions"],hasFreeTextSettings:[1,"hasFreeTextSettings"],applicationOptions:[1,"applicationOptions"]},outputs:{options:"optionsChange"},decls:9,vars:3,consts:()=>{let i;i=$localize`Advanced options`;let e;e=$localize` Show editor ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let o;o=$localize` Add advanced option ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`;let n;n=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:pen${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: New custom option `;let r;return r=$localize`By adding this option it will override the matching global option`,[["option",""],["defaultLabel",""],["enumOptionTemplate",""],["optionTemplate",""],i,e,o,n,[3,"disallowToggle"],["title",""],[1,"actions"],["shButton","","type","button",1,"outlined","small"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModel","ngModelOptions"],["shButton","","type","button",1,"outlined","small",3,"click"],[3,"searchable"],["menu",""],["type","button",3,"deprecated"],["type","button",3,"click"],["shButton","","type","button",1,"small"],["shButton","","type","button",1,"small",3,"click"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModelChange","ngModel","ngModelOptions"],[1,"placeholder"],[1,"field-row"],[1,"form-column"],[3,"startingPath","accepts","showFiles","showHiddenNodes","selectFiles"],[3,"startingPath"],[3,"inputType","ngModel","customId"],[1,"primary","raised"],["shButton","","type","button",1,"outlined","remove-btn",3,"click"],["shTooltip",r,1,"error"],[1,"warn",3,"shTooltip"],[1,"primary",3,"shTooltip"],[4,"ngTemplateOutlet"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],[3,"for"],["type","text",3,"ngModelChange","id","ngModel"],["autocomplete","off",3,"ngModelChange","type","id","ngModel"],["suffix","",1,"clickable"],["suffix","",1,"clickable",3,"click"],[3,"options","isClearable","optionTemplate"],[3,"ngModelChange","inputType","ngModel","customId"],["type","number",3,"ngModelChange","id","ngModel"],["type","checkbox",3,"ngModelChange","id","ngModel"],[1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["type","text","id","text",3,"ngModelChange","ngModel"]]},template:function(e,o){e&1&&(a(0,"sh-toggle-card",8),v(1,9)(2),X(3,4),V(),a(4,"div",10),h(5,fe,3,0,"button",11)(6,he,8,2),s(),V(),h(7,Oe,1,3,"textarea",12)(8,nt,3,1),s()),e&2&&(c("disallowToggle",!0),p(5),O(o.showTextArea()?5:6),p(2),O(o.showTextArea()?7:8))},dependencies:[pe,ae,_e,re,le,se,ce,te,Y,W,Z,ie,Q,ee,ne,de,me,J],styles:["[_nghost-%COMP%]{display:block}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}sh-toggle[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1rem}.placeholder[_ngcontent-%COMP%]{color:var(--base-9);text-align:center;padding:2rem 1rem}.field-row[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr 2.5rem;gap:.5rem;position:relative;z-index:1}.field-row[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{align-self:flex-end}.form-column[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-direction:column}label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}sh-icon[_ngcontent-%COMP%]{font-size:1rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:flex-end}.deprecated[_ngcontent-%COMP%]{text-decoration:line-through}.raw-text-area[_ngcontent-%COMP%]{min-height:12rem;white-space:pre}"],changeDetection:0})};export{ue as a};
@@ -1 +1 @@
1
- import{g as h}from"./chunk-PN3U7MRX.js";import"./chunk-L6CWVBZ6.js";import"./chunk-OMMUXRXE.js";import{a as w}from"./chunk-NJEX2N4Q.js";import{h as k}from"./chunk-MSLKIHQQ.js";import"./chunk-N6ABN43N.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import{b as T}from"./chunk-O64ZZGQZ.js";import"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-Z3EPZZGY.js";import"./chunk-UKQFDBNO.js";import{a as L,b as M,c as N,d as I,e as G,f as W}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{q as v,v as y}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-TDKBGGNK.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-6OPAGPKF.js";import{Ab as i,Ac as p,Bb as n,Cb as s,Pc as $,Qb as F,Ra as r,Rb as l,Yb as O,_ as u,bb as D,ic as P,oa as C,ub as g,vb as E,yc as A,zb as _,zc as R}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var b=()=>["/restore-from-files/destination"],x=()=>["/restore-from-files/encryption"],H=()=>["/restore-from-files/select-files"],X=()=>["/restore-from-files/options"],z=t=>["/restore",t,"select-files"],B=t=>["/restore",t,"options"];function U(t,o){t&1&&(i(0,"div",6),F(1,0),s(2,"sh-radio"),l(),n(),i(3,"div",6),F(4,1),s(5,"sh-radio"),l(),n(),i(6,"div",6),F(7,2),s(8,"sh-radio"),l(),n(),i(9,"div",6),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,X)))}function j(t,o){if(t&1&&(i(0,"div",6),F(1,4),s(2,"sh-radio"),l(),n(),i(3,"div",6),F(4,5),s(5,"sh-radio"),l(),n()),t&2){let e=O(2);_("routerLink",p(2,z,e.backupId())),r(3),_("routerLink",p(4,B,e.backupId()))}}function V(t,o){if(t&1&&(i(0,"sh-stepper"),g(1,U,12,8)(2,j,6,6),n()),t&2){let e=O();r(),E(e.isFileRestore()?1:2)}}var m=class t{#e=u(M);#o=u(I);#t=u(h);#i=T(this.#e.params);#n=T(this.#e.url);#s=T(this.#e.children[0].url);backupId=this.#t.backupId;isFileRestore=this.#t.isFileRestore;isProgressPage=C(!1);paramsChanged=$(()=>{let o=this.#s(),e=this.#i()?.id,a=!!this.#n()?.find(d=>d.path==="restore-from-files"),c=!!o?.find(d=>d.path==="progress");this.isProgressPage.set(c),this.#t.init(e,a)});ngOnInit(){this.#o.events.subscribe(o=>{if(o instanceof L){let e=o.urlAfterRedirects;this.isProgressPage.set(e.includes("progress"))}})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=D({type:t,selectors:[["app-restore-flow"]],hostVars:2,hostBindings:function(e,a){e&2&&P("full-width",a.isProgressPage())},features:[A([h,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 c;c=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `;let d;d=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_RADIO: Select files `;let f;return f=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `,[o,e,a,c,d,f,["step","","routerLinkActive","active",3,"routerLink"]]},template:function(e,a){e&1&&(s(0,"app-status-bar"),g(1,V,3,1,"sh-stepper"),i(2,"section"),s(3,"router-outlet"),n()),e&2&&(r(),E(a.isProgressPage()?-1:1))},dependencies:[y,v,w,N,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{m as default};
1
+ import{g as h}from"./chunk-JDXKHOL3.js";import"./chunk-EAV46VM2.js";import"./chunk-HIIPI6XR.js";import{a as w}from"./chunk-NJEX2N4Q.js";import{h as k}from"./chunk-MSLKIHQQ.js";import"./chunk-N6ABN43N.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import{b as T}from"./chunk-O64ZZGQZ.js";import"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-Z3EPZZGY.js";import"./chunk-UKQFDBNO.js";import{a as L,b as M,c as N,d as I,e as G,f as W}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{q as v,v as y}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-TDKBGGNK.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-6OPAGPKF.js";import{Ab as i,Ac as p,Bb as n,Cb as s,Pc as $,Qb as F,Ra as r,Rb as l,Yb as O,_ as u,bb as D,ic as P,oa as C,ub as g,vb as E,yc as A,zb as _,zc as R}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var b=()=>["/restore-from-files/destination"],x=()=>["/restore-from-files/encryption"],H=()=>["/restore-from-files/select-files"],X=()=>["/restore-from-files/options"],z=t=>["/restore",t,"select-files"],B=t=>["/restore",t,"options"];function U(t,o){t&1&&(i(0,"div",6),F(1,0),s(2,"sh-radio"),l(),n(),i(3,"div",6),F(4,1),s(5,"sh-radio"),l(),n(),i(6,"div",6),F(7,2),s(8,"sh-radio"),l(),n(),i(9,"div",6),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,X)))}function j(t,o){if(t&1&&(i(0,"div",6),F(1,4),s(2,"sh-radio"),l(),n(),i(3,"div",6),F(4,5),s(5,"sh-radio"),l(),n()),t&2){let e=O(2);_("routerLink",p(2,z,e.backupId())),r(3),_("routerLink",p(4,B,e.backupId()))}}function V(t,o){if(t&1&&(i(0,"sh-stepper"),g(1,U,12,8)(2,j,6,6),n()),t&2){let e=O();r(),E(e.isFileRestore()?1:2)}}var m=class t{#e=u(M);#o=u(I);#t=u(h);#i=T(this.#e.params);#n=T(this.#e.url);#s=T(this.#e.children[0].url);backupId=this.#t.backupId;isFileRestore=this.#t.isFileRestore;isProgressPage=C(!1);paramsChanged=$(()=>{let o=this.#s(),e=this.#i()?.id,a=!!this.#n()?.find(d=>d.path==="restore-from-files"),c=!!o?.find(d=>d.path==="progress");this.isProgressPage.set(c),this.#t.init(e,a)});ngOnInit(){this.#o.events.subscribe(o=>{if(o instanceof L){let e=o.urlAfterRedirects;this.isProgressPage.set(e.includes("progress"))}})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=D({type:t,selectors:[["app-restore-flow"]],hostVars:2,hostBindings:function(e,a){e&2&&P("full-width",a.isProgressPage())},features:[A([h,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 c;c=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `;let d;d=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_RADIO: Select files `;let f;return f=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `,[o,e,a,c,d,f,["step","","routerLinkActive","active",3,"routerLink"]]},template:function(e,a){e&1&&(s(0,"app-status-bar"),g(1,V,3,1,"sh-stepper"),i(2,"section"),s(3,"router-outlet"),n()),e&2&&(r(),E(a.isProgressPage()?-1:1))},dependencies:[y,v,w,N,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{m as default};
@@ -0,0 +1 @@
1
+ import{a as v,c as N,e as E,i as O,k as P,s as D}from"./chunk-N5SC4SKW.js";import{l as S,o as X,t as Y}from"./chunk-H7K35UUX.js";import{Ab as p,Bb as s,Gb as L,Hb as x,Jb as W,Oc as m,Pc as f,Ra as a,Sb as I,Tb as F,Ub as A,Uc as g,Wb as j,Yb as b,Zb as T,_b as d,bb as C,ea as $,fa as w,gb as z,hc as G,lc as U,oa as l,oc as k,qc as c,rc as h,sc as _,tb as M,wb as B,xb as R,yb as V,yc as y,zb as u}from"./chunk-HNWRQABR.js";var Q=[[["label"]],[["","prefix",""]],[["","suffix",""]]],ee=["label","[prefix]","[suffix]"];function te(i,e){if(i&1&&U(0),i&2){let t=e.$implicit,n=b();k("",t.label,"",n.hasPerSecond()?"/s":"")}}var ne=[{value:"bytes",label:"Bytes"},{value:"KB",label:"KB"},{value:"MB",label:"MB"},{value:"GB",label:"GB"},{value:"TB",label:"TB"},{value:"PB",label:"PB"}],ie=["throttle-upload","throttle-download"],H=class i{customId=g();inputType=g();timespan=l(0);unit=l("MB");sizeOptions=l(ne);readonly=l(!1);hasPerSecond=m(()=>{let e=this.inputType();return e&&ie.includes(e)});onChange=()=>{};onTouched=()=>{};onChangeEffect=f(()=>{this.onChange(this.getValue())});writeValue(e){if(e){let t=e.match(/^(\d+)(bytes|kb|mb|gb|tb|pb|b)$/i);t?queueMicrotask(()=>{this.timespan.set(parseInt(t[1],10)),this.unit.set(t[2].toUpperCase())}):(this.timespan.set(0),this.unit.set("MB"))}else this.timespan.set(0),this.unit.set("MB")}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.readonly.set(e)}getValue(){return`${this.timespan()}${this.unit()}`}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=C({type:i,selectors:[["app-size"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[y([{provide:v,useExisting:i,multi:!0}])],ngContentSelectors:ee,decls:9,vars:10,consts:[[1,"label"],["type","number",3,"ngModelChange","id","ngModel","disabled"],["value","value","label","label",3,"options","readonly","isClearable"],["type","text",3,"ngModelChange","ngModel"]],template:function(t,n){t&1&&(T(Q),p(0,"div",0),d(1,0,["ngProjectAs","label",5,["label"]]),s(),p(2,"sh-form-field")(3,"input",1),_("ngModelChange",function(o){return h(n.timespan,o)||(n.timespan=o),o}),s(),d(4,1),d(5,2),s(),p(6,"sh-select",2)(7,"input",3),_("ngModelChange",function(o){return h(n.unit,o)||(n.unit=o),o}),s(),z(8,te,1,2,"ng-template"),s()),t&2&&(a(2),M("readonly",n.readonly()||void 0),a(),u("id",n.customId()),c("ngModel",n.timespan),u("disabled",n.readonly()),a(3),G("--miw",0),u("options",n.sizeOptions())("readonly",n.readonly())("isClearable",!1),a(),c("ngModel",n.unit))},dependencies:[Y,S,D,N,P,E,O],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label label" "input unit";grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}[_nghost-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:unit}'],changeDetection:0})};var oe=[[["label"]],[["","prefix",""]],[["","suffix",""]]],ae=["label","[prefix]","[suffix]"];function se(i,e){if(i&1){let t=W();p(0,"button",7),j("click",function(){let r=$(t).$implicit,o=b();return w(o.updateUnit(r.value))}),I(1,1),s()}if(i&2){let t=e.$implicit;a(),F(t.label),A(1)}}var le=[{value:"s",label:$localize`Seconds`},{value:"m",label:$localize`Minutes`},{value:"h",label:$localize`Hours`}],re=[{value:"Y",label:$localize`Years`},{value:"M",label:$localize`Months`},{value:"W",label:$localize`Weeks`},{value:"D",label:$localize`Days`}],ue=["retry-delay","web-timeout","read-write-timeout","run-script-timeout","list-timeout","short-timeout"],K=class i{customId=g();inputType=g();timespan=l(0);#e="D";unit=l(this.#e);unitLabel=m(()=>{let e=this.timeOptions(),t=e.findIndex(n=>n.value===this.unit());return e[t]?.label??this.unit()});isShortTime=m(()=>{let e=this.inputType();return e&&ue.includes(e.replace("--",""))});timeOptions=m(()=>this.isShortTime()?le:re);readonly=l(!1);onChange=()=>{};onTouched=()=>{};onChangeEffect=f(()=>{this.onChange(this.getValue())});inputTypeEffect=f(()=>{let e=this.timeOptions(),t=this.isShortTime()?"s":"D";this.#e=t,this.unit.set(t)});updateUnit(e){this.unit.set(e)}writeValue(e){let t=this.isShortTime();if(e){let n=t?/(\d+)([smh])/i:/^(\d+)([YMWD])$/i,r=e.match(n);r?(this.timespan.set(parseInt(r[1],10)),this.unit.set(r[2])):(this.timespan.set(0),this.unit.set(this.#e))}else this.timespan.set(0),this.unit.set(this.#e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.readonly.set(e)}getValue(){return`${this.timespan()}${this.unit()}`}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=C({type:i,selectors:[["app-timespan"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[y([{provide:v,useExisting:i,multi:!0}])],ngContentSelectors:ae,decls:11,vars:6,consts:()=>{let e;e=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let t;return t=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`,[e,t,["type","number",3,"ngModelChange","id","ngModel","disabled"],[3,"openIndicator"],["shButton","","type","button",1,"trigger"],["menu",""],["shButton","","type","button",1,"small"],["shButton","","type","button",1,"small",3,"click"]]},template:function(t,n){t&1&&(T(oe),d(0,0,["ngProjectAs","label",5,["label"]]),p(1,"sh-form-field")(2,"input",2),_("ngModelChange",function(o){return h(n.timespan,o)||(n.timespan=o),o}),s(),d(3,1),d(4,2),s(),p(5,"sh-menu",3)(6,"button",4),I(7,0),s(),L(8,5),R(9,se,2,1,"button",6,B),x(),s()),t&2&&(a(),M("readonly",n.readonly()||void 0),a(),u("id",n.customId()),c("ngModel",n.timespan),u("disabled",n.readonly()),a(3),u("openIndicator",!0),a(2),F(n.unitLabel()),A(7),a(2),V(n.timeOptions()))},dependencies:[X,S,D,N,P,E,O],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label label" "input unit";grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}[_nghost-%COMP%] sh-menu[_ngcontent-%COMP%]{grid-area:unit}[_nghost-%COMP%] sh-menu[_ngcontent-%COMP%] button.trigger[_ngcontent-%COMP%]{width:100%}'],changeDetection:0})};export{H as a,K as b};
@@ -1 +1 @@
1
- import{a as Ue}from"./chunk-L6CWVBZ6.js";import{a as se}from"./chunk-N6ABN43N.js";import{a as ne}from"./chunk-DDWLL7XA.js";import{b as pe}from"./chunk-O64ZZGQZ.js";import{a as Ve}from"./chunk-UIJYCGKA.js";import{a as K}from"./chunk-DELLEGXW.js";import{a as oe}from"./chunk-VTSUHAP5.js";import{a as xe}from"./chunk-UP5EOICU.js";import{b as We,c as G,e as B,f as x,i as ze,j as V,l as Xe,o as W,q as z,r as X,s as Ye,t as Y}from"./chunk-N5SC4SKW.js";import{b as R,d as N}from"./chunk-LVP2TPMO.js";import{A as Be,a as A,e as ve,g as k,l as Ae,p as ke,q as we,t as Ge}from"./chunk-H7K35UUX.js";import{h as w}from"./chunk-NOPMCS2Z.js";import{la as ie}from"./chunk-RUXCS4ZK.js";import{Ab as r,B as Oe,Bb as l,Cb as c,Dc as ae,Ec as $e,F as H,Fc as De,Gb as L,H as O,Hb as $,Jb as j,L as fe,Oc as le,P as he,Pc as v,Q,Qb as m,Ra as d,Rb as g,Sb as S,Tb as Ne,Ub as Pe,V as Ce,Wb as f,Yb as D,_ as p,bb as M,ea as h,fa as C,gb as Re,i as Se,ic as Ie,lc as q,nc as Me,o as Te,oa as _,oc as ye,qc as Z,rc as ee,sc as te,ub as y,vb as b,x as re,y as Ee,yc as be,zb as F,zc as Le}from"./chunk-HNWRQABR.js";var He=new X,Ke=()=>He.group({passphrase:He.control("")}),_e=class a{#t=p(w);#e=p(P);#o=p(N);#n=p(R);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=_(!1);settings=_([]);next(){let i=this.#e.destinationTargetUrl();if(!i)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,t=[];e?t.push({Name:"--passphrase",Value:e}):t.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(o=>{let n=o.Name?.trim();n&&n!=="--"&&(n.startsWith("--")||(n=`--${n}`),t.push({Name:n,Value:o.Value??""}))}),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:i,Settings:t}},temporary:!0}).pipe(O(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:o=>{let n=o.ID;this.#o.navigate([`/restore-draft/${n}`])},error:o=>{console.error(o)}})}back(){this.#e.isFileRestore()?this.#o.navigate(["destination"],{relativeTo:this.#n.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-restore-encryption"]],decls:16,vars:3,consts:()=>{let i;i=$localize`Enter backup passphrase if defined.`;let e;e=$localize`Password`;let t;t=$localize`Advanced options`;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let n;return n=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `,[e,t,o,n,[3,"submit","formGroup"],["for","password"],["type","password","id","password","placeholder",i,"formControlName","passphrase"],["title",""],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){e&1&&(r(0,"form",4),f("submit",function(){return t.next()}),r(1,"sh-form-field")(2,"label",5),S(3,0),l(),c(4,"input",6),l(),r(5,"app-toggle-card"),L(6,7),S(7,1),$(),r(8,"app-options-list",8),te("optionsChange",function(n){return ee(t.settings,n)||(t.settings=n),n}),l()(),r(9,"div",9)(10,"button",10),f("click",function(){return t.back()}),m(11,2),c(12,"sh-icon"),g(),l(),r(13,"button",11),m(14,3),c(15,"sh-icon"),g(),l()()()),e&2&&(F("formGroup",t.encryptionForm),d(8),Z("options",t.settings),F("hasFreeTextSettings",!0))},dependencies:[Y,V,G,B,x,W,z,Ae,A,k,ne,Ue],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var Ze=()=>({standalone:!0});function et(a,i){a&1&&c(0,"sh-progress-bar",8)}function tt(a,i){if(a&1&&(q(0),ae(1,"bytes")),a&2){let e=D().$implicit;Me(" (",$e(1,1,e.FileSizes),") ")}}function it(a,i){a&1&&(r(0,"span",16),S(1,4),l())}function ot(a,i){if(a&1&&(r(0,"div",15),q(1),ae(2,"date"),y(3,tt,2,3),y(4,it,2,0,"span",16),l()),a&2){let e=i.$implicit;d(),ye(" ",e.Version,": ",De(2,4,e.Time,"medium")," "),d(2),b(e.FileSizes?3:-1),d(),b(e.IsFullBackup===!1?4:-1)}}function nt(a,i){a&1&&c(0,"sh-progress-bar",8)}function st(a,i){if(a&1&&(r(0,"app-file-tree",14)(1,"label",17),S(2,5),l(),c(3,"input",18),l()),a&2){let e=D(2);F("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function rt(a,i){if(a&1){let e=j();r(0,"sh-select",12),f("cleared",function(){h(e);let o=D();return C(o.abortLoading())}),r(1,"input",13),te("ngModelChange",function(o){h(e);let n=D();return ee(n.selectOption,o)||(n.selectOption=o),C(o)}),l(),Re(2,ot,5,7,"ng-template"),l(),y(3,nt,1,0,"sh-progress-bar",8),y(4,st,4,5,"app-file-tree",14)}if(a&2){let e=D();F("options",e.versionOptions())("isClearable",!1),d(),Z("ngModel",e.selectOption),F("ngModelOptions",Le(6,Ze)),d(2),b(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),d(),b(e.showFileTree()?4:-1)}}var ue=new X,Je=()=>ue.group({filesToRestore:ue.control(""),passphrase:ue.control(null)}),de=class a{#t=p(w);#e=p(P);#o=p(Ve);#n=p(oe);#i=p(N);#s=p(R);#l=p(ie);#a=null;#p=null;#r=_([]);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;selectOption=this.#e.selectOption;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;isFileRestore=this.#e.isFileRestore;needsDatabaseRepair=le(()=>this.#e.backup()?.Backup?.IsTemporary??!0);showFileTree=_(!1);backupSettings=_(null);rootPaths=_([]);initialNodes=_([]);loadingRootPath=_(!1);isRepairing=le(()=>this.#r().length>0);loadedVersions=_({});loadingEffect=v(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let t=e[0].Version;this.selectOption.set(t.toString())}});backupSettingsEffect=v(()=>{let i=this.backupId(),e=this.selectOption(),t=this.isRepairing(),o=this.loadedVersions();if(!e||!i)return;let s=this.versionOptions()?.find(J=>J.Version===parseInt(e))?.Time??null;if(!s)return;let u=`${i}+${s}`,E=o[u];if(this.needsDatabaseRepair()&&(!E||t))return;let I={id:i+"",time:s};this.backupSettings.set(I),this.getRootPath(I)});repairEffect=v(()=>{if(!this.needsDatabaseRepair())return;let i=this.selectOption(),e=this.versionOptions();if(i){let t=e.find(s=>s.Version===parseInt(i));if(t===void 0)return;let o=this.backupId(),n=`${o}+${t.Time}`;if(this.#p===n||(this.#p=n,this.#r().includes(n)))return;this.#r.update(s=>[...s,n]),this.#t.postApiV1BackupByIdRepairupdate({id:o,requestBody:{only_paths:!0,time:t.Time}}).pipe(Q(this.abortLoading$),O(()=>{this.#p=null})).subscribe(s=>{let u=s.ID;this.#o.waitForTaskToComplete(u).pipe(H(1)).subscribe(()=>{this.#r.update(E=>E.filter(I=>I!==n)),this.loadedVersions.update(E=>(E[n]=!0,E))})})}});getRootPath(i){let e={id:i.id+"",time:i.time,prefixOnly:!0,folderContents:!1},t=i.id+"";this.isRepairing()||this.#a===t||(this.#a=t,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#n.hasV2ListOperations()?this.#t.postApiV2BackupListFolder({requestBody:{BackupId:i.id,Time:i.time,Paths:null,PageSize:0,Page:0}}).pipe(Q(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#a=null})).subscribe({next:o=>{let n=(o.Data??[]).map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#t.getApiV1BackupByIdFiles(e).pipe(Q(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:o=>{let n=o.Files.map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new Se;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let i=this.versionOptions();return e=>{if(!e)return"";let t=i?.find(o=>typeof o.Version=="number"&&o.Version.toString()===e);return t?`${t.Version}: ${this.#l.transform(t.Time,"medium")}`:""}}next(){this.#i.navigate(["options"],{relativeTo:this.#s.parent})}back(){this.#e.isFileRestore()?this.#i.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-select-files"]],features:[be([ie])],decls:13,vars:3,consts:()=>{let i;i=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let t;t=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let o;o=$localize`Select an option...`;let n;n=$localize`(partial)`;let s;return s=$localize`Path`,[["formRef",""],i,e,t,n,s,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",o,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","initialNodes","backupSettings","multiSelect","showFiles"],[1,"custom-option"],[1,"partial"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,t){if(e&1){let o=j();r(0,"form",6,0),f("submit",function(){return h(o),C(t.next())}),r(2,"h3",7),S(3,1),l(),y(4,et,1,0,"sh-progress-bar",8)(5,rt,5,7),r(6,"div",9)(7,"button",10),f("click",function(){return h(o),C(t.back())}),m(8,2),c(9,"sh-icon"),g(),l(),r(10,"button",11),m(11,3),c(12,"sh-icon"),g(),l()()()}e&2&&(F("formGroup",t.selectFilesForm),d(4),b(t.versionOptionsLoading()?4:5),d(5),Ne(t.isFileRestore()?"Back":"Exit"),Pe(8))},dependencies:[Ye,V,G,B,x,ze,Y,W,z,se,k,A,Ge,ke,ie,xe],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}"],changeDetection:0})};var P=class a{#t=p(N);#e=p(R);#o=p(oe);#n=p(ve);#i=p(w);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);selectFilesForm=Je();optionsForm=Qe();encryptionForm=Ke();optionsFormSignal=pe(this.optionsForm.valueChanges);selectFilesFormSignal=pe(this.selectFilesForm.valueChanges);selectOption=_(null);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isFileRestore=_(!1);isFullWidthPage=_(!1);#s=_("");#l=_(null);#a=null;testSignal=this.#s.asReadonly();testErrorMessage=this.#l.asReadonly();#p=v(()=>{let i=this.destinationTargetUrl(),e=this.#s(),t=this.#a;this.#a=i,!(e==="testing"||t===null||t===i)&&(this.#s.set(""),this.#l.set(null))});init(i,e=!1){this.backupId.set(i),this.isFileRestore.set(e),e&&this.#t.navigate(["/restore-from-files/destination"]),e||this.getBackup(!0)}setTestState(i,e){this.#s.set(i),this.#l.set(e??null)}updateTargetUrl(i){this.destinationTargetUrl.set(i)}submit(){this.isSubmitting.set(!0);let i=this.backupId();this.backup()?.Backup?.IsTemporary??!1?this.#i.postApiV1BackupByIdCopytotemp({id:this.backupId()??""}).subscribe({next:t=>{this.#r(t.ID??"")},error:t=>this.showErrorDialog($localize`An error occurred while copying the backup to a temporary location: ${t.message}`)}):this.#r(i??"")}showErrorDialog(i){this.#n.open(K,{data:{title:$localize`Error occured`,message:i,confirmText:$localize`OK`,cancelText:void 0},closed:e=>{}})}#r(i){let e=this.optionsForm.value,t=this.selectFilesForm.value,o=this.selectOption(),n=this.versionOptions()?.find(s=>s.Version===(o&&parseInt(o)));this.#i.postApiV1BackupByIdRestore({id:i??"",requestBody:{paths:t.filesToRestore?.split("\0").map(s=>s.endsWith("/")||s.endsWith("\\")?`${s}*`:s)??[],passphrase:t.passphrase??null,time:n?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata}}).pipe(O(()=>this.isSubmitting.set(!1))).subscribe({next:s=>{this.#t.navigate([`./${s.ID}`,"progress"],{relativeTo:this.#e})},error:s=>{console.error("restore error",s)}})}exit(){this.#n.open(K,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:i=>{i&&(this.#_(),this.#t.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(i,e=2){return this.#i.postApiV2BackupListFilesets({requestBody:{BackupId:i}}).pipe(Oe(t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder";return o||n||s||e===0?Te(()=>t):Ee(1e3).pipe(he(()=>this.loadFilesetsWithRetryv2(i,e-1)))}))}getBackup(i=!1){let e=this.backupId();this.versionOptionsLoading.set(!0),this.#o.hasV2ListOperations()?re([this.#i.getApiV1BackupById({id:e}),this.loadFilesetsWithRetryv2(e)]).pipe(H(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{if(o.Error)throw new Error(o.Error);if(!(t.Backup?.IsTemporary??!0)&&t?.Backup?.DBPathExists===!1){this.#n.open(K,{data:{title:$localize`Missing Local Database`,message:$localize`The local database for this backup is missing. Please repair or recreate the local database before restoring.`,confirmText:$localize`OK`,cancelText:void 0},closed:s=>{this.#t.navigate(["/backup",e,"database"])}});return}this.versionOptions.set((o.Data??[]).map(s=>({Version:s.Version??-1,IsFullBackup:s.IsFullBackup??void 0,Time:s.Time??"<missing>",FileCount:s.FileCount??void 0,FileSizes:s.FileSizes??void 0}))),this.backup.set(t)},error:t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder",u=$localize`An error occurred while loading the backup filesets: ${t.message}`;o&&(u=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),n&&(u=$localize`The backup storage folder was not found.`),s&&(u=$localize`The backup storage folder does not contain any filesets.`),this.#n.open(K,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:E=>{this.#t.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):re([this.#i.getApiV1BackupById({id:e}),this.#i.getApiV1BackupByIdFilesets({id:e}).pipe(fe(3))]).pipe(H(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{this.versionOptions.set(o.map(n=>({Version:n.Version??-1,IsFullBackup:(n.IsFullBackup??1)==1,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(t)}})}#_(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||a)};static \u0275prov=Ce({token:a,factory:a.\u0275fac,providedIn:"root"})};var U=new X,Qe=()=>U.group({restoreFrom:U.control("orignal"),restoreFromPath:U.control(""),handleExisting:U.control("overwrite"),permissions:U.control(!1),includeMetadata:U.control(!0)}),me=class a{#t=p(P);#e=p(N);#o=p(R);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;isSubmitting=this.#t.isSubmitting;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#o.parent})}submit(){this.#t.submit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-advanced-options-settings"]],decls:42,vars:7,consts:()=>{let i;i=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let t;t=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let o;o=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let n;n=$localize`How do you want to handle existing files?`;let s;s=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let E;E=$localize`Metadata settings`;let I;I=$localize` Restore file metadata ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let J;J=$localize` Restore read/write permissions ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let ge;ge=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let Fe;return Fe=$localize`${"\uFFFD#41\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#41\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `,[["formRef",""],i,e,t,o,n,s,u,E,I,J,ge,Fe,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"raised","primary"],["type","radio","name","restoreFrom","value","orignal","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled","enableCreateFolder"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","includeMetadata"],["type","checkbox","formControlName","permissions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){if(e&1){let o=j();r(0,"form",13,0),f("submit",function(){return h(o),C(t.submit())}),r(2,"h3",14),S(3,1),l(),r(4,"app-toggle-card",15),L(5,16),S(6,2),$(),r(7,"sh-radio",17),m(8,3),c(9,"input",18),g(),l(),r(10,"sh-radio",17),m(11,4),c(12,"input",19),g(),l(),r(13,"app-file-tree",20)(14,"label",21),q(15,"Path"),l(),c(16,"input",22),l()(),r(17,"app-toggle-card",15),L(18,16),S(19,5),$(),r(20,"sh-radio",17),m(21,6),c(22,"input",23),g(),l(),r(23,"sh-radio",17),m(24,7),c(25,"input",24),g(),l()(),r(26,"app-toggle-card"),L(27,16),S(28,8),$(),r(29,"sh-toggle",25),m(30,9),c(31,"input",26),g(),l(),r(32,"sh-toggle",25),m(33,10),c(34,"input",27),g(),l()(),r(35,"div",28)(36,"button",29),f("click",function(){return h(o),C(t.goBack())}),m(37,11),c(38,"sh-icon"),g(),l(),r(39,"button",30),m(40,12),c(41,"sh-icon"),g(),l()()()}if(e&2){let o;F("formGroup",t.optionsForm),d(4),F("disallowToggle",!0),d(9),F("disabled",((o=t.optionsFormSignal())==null?null:o.restoreFrom)!=="pickLocation")("enableCreateFolder",!0),d(4),F("disallowToggle",!0),d(22),Ie("loader",t.isSubmitting())}},dependencies:[Y,V,G,We,Xe,B,x,W,z,ne,se,Be,we,k,A],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{Qe as a,me as b,Ke as c,_e as d,Je as e,de as f,P as g};
1
+ import{a as Ue}from"./chunk-EAV46VM2.js";import{a as se}from"./chunk-N6ABN43N.js";import{a as ne}from"./chunk-DDWLL7XA.js";import{b as pe}from"./chunk-O64ZZGQZ.js";import{a as Ve}from"./chunk-UIJYCGKA.js";import{a as K}from"./chunk-DELLEGXW.js";import{a as oe}from"./chunk-VTSUHAP5.js";import{a as xe}from"./chunk-UP5EOICU.js";import{b as We,c as G,e as B,f as x,i as ze,j as V,l as Xe,o as W,q as z,r as X,s as Ye,t as Y}from"./chunk-N5SC4SKW.js";import{b as R,d as N}from"./chunk-LVP2TPMO.js";import{A as Be,a as A,e as ve,g as k,l as Ae,p as ke,q as we,t as Ge}from"./chunk-H7K35UUX.js";import{h as w}from"./chunk-NOPMCS2Z.js";import{la as ie}from"./chunk-RUXCS4ZK.js";import{Ab as r,B as Oe,Bb as l,Cb as c,Dc as ae,Ec as $e,F as H,Fc as De,Gb as L,H as O,Hb as $,Jb as j,L as fe,Oc as le,P as he,Pc as v,Q,Qb as m,Ra as d,Rb as g,Sb as S,Tb as Ne,Ub as Pe,V as Ce,Wb as f,Yb as D,_ as p,bb as M,ea as h,fa as C,gb as Re,i as Se,ic as Ie,lc as q,nc as Me,o as Te,oa as _,oc as ye,qc as Z,rc as ee,sc as te,ub as y,vb as b,x as re,y as Ee,yc as be,zb as F,zc as Le}from"./chunk-HNWRQABR.js";var He=new X,Ke=()=>He.group({passphrase:He.control("")}),_e=class a{#t=p(w);#e=p(P);#o=p(N);#n=p(R);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=_(!1);settings=_([]);next(){let i=this.#e.destinationTargetUrl();if(!i)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,t=[];e?t.push({Name:"--passphrase",Value:e}):t.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(o=>{let n=o.Name?.trim();n&&n!=="--"&&(n.startsWith("--")||(n=`--${n}`),t.push({Name:n,Value:o.Value??""}))}),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:i,Settings:t}},temporary:!0}).pipe(O(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:o=>{let n=o.ID;this.#o.navigate([`/restore-draft/${n}`])},error:o=>{console.error(o)}})}back(){this.#e.isFileRestore()?this.#o.navigate(["destination"],{relativeTo:this.#n.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-restore-encryption"]],decls:16,vars:3,consts:()=>{let i;i=$localize`Enter backup passphrase if defined.`;let e;e=$localize`Password`;let t;t=$localize`Advanced options`;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let n;return n=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `,[e,t,o,n,[3,"submit","formGroup"],["for","password"],["type","password","id","password","placeholder",i,"formControlName","passphrase"],["title",""],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){e&1&&(r(0,"form",4),f("submit",function(){return t.next()}),r(1,"sh-form-field")(2,"label",5),S(3,0),l(),c(4,"input",6),l(),r(5,"app-toggle-card"),L(6,7),S(7,1),$(),r(8,"app-options-list",8),te("optionsChange",function(n){return ee(t.settings,n)||(t.settings=n),n}),l()(),r(9,"div",9)(10,"button",10),f("click",function(){return t.back()}),m(11,2),c(12,"sh-icon"),g(),l(),r(13,"button",11),m(14,3),c(15,"sh-icon"),g(),l()()()),e&2&&(F("formGroup",t.encryptionForm),d(8),Z("options",t.settings),F("hasFreeTextSettings",!0))},dependencies:[Y,V,G,B,x,W,z,Ae,A,k,ne,Ue],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var Ze=()=>({standalone:!0});function et(a,i){a&1&&c(0,"sh-progress-bar",8)}function tt(a,i){if(a&1&&(q(0),ae(1,"bytes")),a&2){let e=D().$implicit;Me(" (",$e(1,1,e.FileSizes),") ")}}function it(a,i){a&1&&(r(0,"span",16),S(1,4),l())}function ot(a,i){if(a&1&&(r(0,"div",15),q(1),ae(2,"date"),y(3,tt,2,3),y(4,it,2,0,"span",16),l()),a&2){let e=i.$implicit;d(),ye(" ",e.Version,": ",De(2,4,e.Time,"medium")," "),d(2),b(e.FileSizes?3:-1),d(),b(e.IsFullBackup===!1?4:-1)}}function nt(a,i){a&1&&c(0,"sh-progress-bar",8)}function st(a,i){if(a&1&&(r(0,"app-file-tree",14)(1,"label",17),S(2,5),l(),c(3,"input",18),l()),a&2){let e=D(2);F("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function rt(a,i){if(a&1){let e=j();r(0,"sh-select",12),f("cleared",function(){h(e);let o=D();return C(o.abortLoading())}),r(1,"input",13),te("ngModelChange",function(o){h(e);let n=D();return ee(n.selectOption,o)||(n.selectOption=o),C(o)}),l(),Re(2,ot,5,7,"ng-template"),l(),y(3,nt,1,0,"sh-progress-bar",8),y(4,st,4,5,"app-file-tree",14)}if(a&2){let e=D();F("options",e.versionOptions())("isClearable",!1),d(),Z("ngModel",e.selectOption),F("ngModelOptions",Le(6,Ze)),d(2),b(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),d(),b(e.showFileTree()?4:-1)}}var ue=new X,Je=()=>ue.group({filesToRestore:ue.control(""),passphrase:ue.control(null)}),de=class a{#t=p(w);#e=p(P);#o=p(Ve);#n=p(oe);#i=p(N);#s=p(R);#l=p(ie);#a=null;#p=null;#r=_([]);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;selectOption=this.#e.selectOption;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;isFileRestore=this.#e.isFileRestore;needsDatabaseRepair=le(()=>this.#e.backup()?.Backup?.IsTemporary??!0);showFileTree=_(!1);backupSettings=_(null);rootPaths=_([]);initialNodes=_([]);loadingRootPath=_(!1);isRepairing=le(()=>this.#r().length>0);loadedVersions=_({});loadingEffect=v(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let t=e[0].Version;this.selectOption.set(t.toString())}});backupSettingsEffect=v(()=>{let i=this.backupId(),e=this.selectOption(),t=this.isRepairing(),o=this.loadedVersions();if(!e||!i)return;let s=this.versionOptions()?.find(J=>J.Version===parseInt(e))?.Time??null;if(!s)return;let u=`${i}+${s}`,E=o[u];if(this.needsDatabaseRepair()&&(!E||t))return;let I={id:i+"",time:s};this.backupSettings.set(I),this.getRootPath(I)});repairEffect=v(()=>{if(!this.needsDatabaseRepair())return;let i=this.selectOption(),e=this.versionOptions();if(i){let t=e.find(s=>s.Version===parseInt(i));if(t===void 0)return;let o=this.backupId(),n=`${o}+${t.Time}`;if(this.#p===n||(this.#p=n,this.#r().includes(n)))return;this.#r.update(s=>[...s,n]),this.#t.postApiV1BackupByIdRepairupdate({id:o,requestBody:{only_paths:!0,time:t.Time}}).pipe(Q(this.abortLoading$),O(()=>{this.#p=null})).subscribe(s=>{let u=s.ID;this.#o.waitForTaskToComplete(u).pipe(H(1)).subscribe(()=>{this.#r.update(E=>E.filter(I=>I!==n)),this.loadedVersions.update(E=>(E[n]=!0,E))})})}});getRootPath(i){let e={id:i.id+"",time:i.time,prefixOnly:!0,folderContents:!1},t=i.id+"";this.isRepairing()||this.#a===t||(this.#a=t,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#n.hasV2ListOperations()?this.#t.postApiV2BackupListFolder({requestBody:{BackupId:i.id,Time:i.time,Paths:null,PageSize:0,Page:0}}).pipe(Q(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#a=null})).subscribe({next:o=>{let n=(o.Data??[]).map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#t.getApiV1BackupByIdFiles(e).pipe(Q(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:o=>{let n=o.Files.map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new Se;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let i=this.versionOptions();return e=>{if(!e)return"";let t=i?.find(o=>typeof o.Version=="number"&&o.Version.toString()===e);return t?`${t.Version}: ${this.#l.transform(t.Time,"medium")}`:""}}next(){this.#i.navigate(["options"],{relativeTo:this.#s.parent})}back(){this.#e.isFileRestore()?this.#i.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-select-files"]],features:[be([ie])],decls:13,vars:3,consts:()=>{let i;i=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let t;t=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let o;o=$localize`Select an option...`;let n;n=$localize`(partial)`;let s;return s=$localize`Path`,[["formRef",""],i,e,t,n,s,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",o,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","initialNodes","backupSettings","multiSelect","showFiles"],[1,"custom-option"],[1,"partial"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,t){if(e&1){let o=j();r(0,"form",6,0),f("submit",function(){return h(o),C(t.next())}),r(2,"h3",7),S(3,1),l(),y(4,et,1,0,"sh-progress-bar",8)(5,rt,5,7),r(6,"div",9)(7,"button",10),f("click",function(){return h(o),C(t.back())}),m(8,2),c(9,"sh-icon"),g(),l(),r(10,"button",11),m(11,3),c(12,"sh-icon"),g(),l()()()}e&2&&(F("formGroup",t.selectFilesForm),d(4),b(t.versionOptionsLoading()?4:5),d(5),Ne(t.isFileRestore()?"Back":"Exit"),Pe(8))},dependencies:[Ye,V,G,B,x,ze,Y,W,z,se,k,A,Ge,ke,ie,xe],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}"],changeDetection:0})};var P=class a{#t=p(N);#e=p(R);#o=p(oe);#n=p(ve);#i=p(w);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);selectFilesForm=Je();optionsForm=Qe();encryptionForm=Ke();optionsFormSignal=pe(this.optionsForm.valueChanges);selectFilesFormSignal=pe(this.selectFilesForm.valueChanges);selectOption=_(null);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isFileRestore=_(!1);isFullWidthPage=_(!1);#s=_("");#l=_(null);#a=null;testSignal=this.#s.asReadonly();testErrorMessage=this.#l.asReadonly();#p=v(()=>{let i=this.destinationTargetUrl(),e=this.#s(),t=this.#a;this.#a=i,!(e==="testing"||t===null||t===i)&&(this.#s.set(""),this.#l.set(null))});init(i,e=!1){this.backupId.set(i),this.isFileRestore.set(e),e&&this.#t.navigate(["/restore-from-files/destination"]),e||this.getBackup(!0)}setTestState(i,e){this.#s.set(i),this.#l.set(e??null)}updateTargetUrl(i){this.destinationTargetUrl.set(i)}submit(){this.isSubmitting.set(!0);let i=this.backupId();this.backup()?.Backup?.IsTemporary??!1?this.#i.postApiV1BackupByIdCopytotemp({id:this.backupId()??""}).subscribe({next:t=>{this.#r(t.ID??"")},error:t=>this.showErrorDialog($localize`An error occurred while copying the backup to a temporary location: ${t.message}`)}):this.#r(i??"")}showErrorDialog(i){this.#n.open(K,{data:{title:$localize`Error occured`,message:i,confirmText:$localize`OK`,cancelText:void 0},closed:e=>{}})}#r(i){let e=this.optionsForm.value,t=this.selectFilesForm.value,o=this.selectOption(),n=this.versionOptions()?.find(s=>s.Version===(o&&parseInt(o)));this.#i.postApiV1BackupByIdRestore({id:i??"",requestBody:{paths:t.filesToRestore?.split("\0").map(s=>s.endsWith("/")||s.endsWith("\\")?`${s}*`:s)??[],passphrase:t.passphrase??null,time:n?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata}}).pipe(O(()=>this.isSubmitting.set(!1))).subscribe({next:s=>{this.#t.navigate([`./${s.ID}`,"progress"],{relativeTo:this.#e})},error:s=>{console.error("restore error",s)}})}exit(){this.#n.open(K,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:i=>{i&&(this.#_(),this.#t.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(i,e=2){return this.#i.postApiV2BackupListFilesets({requestBody:{BackupId:i}}).pipe(Oe(t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder";return o||n||s||e===0?Te(()=>t):Ee(1e3).pipe(he(()=>this.loadFilesetsWithRetryv2(i,e-1)))}))}getBackup(i=!1){let e=this.backupId();this.versionOptionsLoading.set(!0),this.#o.hasV2ListOperations()?re([this.#i.getApiV1BackupById({id:e}),this.loadFilesetsWithRetryv2(e)]).pipe(H(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{if(o.Error)throw new Error(o.Error);if(!(t.Backup?.IsTemporary??!0)&&t?.Backup?.DBPathExists===!1){this.#n.open(K,{data:{title:$localize`Missing Local Database`,message:$localize`The local database for this backup is missing. Please repair or recreate the local database before restoring.`,confirmText:$localize`OK`,cancelText:void 0},closed:s=>{this.#t.navigate(["/backup",e,"database"])}});return}this.versionOptions.set((o.Data??[]).map(s=>({Version:s.Version??-1,IsFullBackup:s.IsFullBackup??void 0,Time:s.Time??"<missing>",FileCount:s.FileCount??void 0,FileSizes:s.FileSizes??void 0}))),this.backup.set(t)},error:t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder",u=$localize`An error occurred while loading the backup filesets: ${t.message}`;o&&(u=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),n&&(u=$localize`The backup storage folder was not found.`),s&&(u=$localize`The backup storage folder does not contain any filesets.`),this.#n.open(K,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:E=>{this.#t.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):re([this.#i.getApiV1BackupById({id:e}),this.#i.getApiV1BackupByIdFilesets({id:e}).pipe(fe(3))]).pipe(H(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{this.versionOptions.set(o.map(n=>({Version:n.Version??-1,IsFullBackup:(n.IsFullBackup??1)==1,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(t)}})}#_(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||a)};static \u0275prov=Ce({token:a,factory:a.\u0275fac,providedIn:"root"})};var U=new X,Qe=()=>U.group({restoreFrom:U.control("orignal"),restoreFromPath:U.control(""),handleExisting:U.control("overwrite"),permissions:U.control(!1),includeMetadata:U.control(!0)}),me=class a{#t=p(P);#e=p(N);#o=p(R);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;isSubmitting=this.#t.isSubmitting;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#o.parent})}submit(){this.#t.submit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-advanced-options-settings"]],decls:42,vars:7,consts:()=>{let i;i=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let t;t=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let o;o=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let n;n=$localize`How do you want to handle existing files?`;let s;s=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let E;E=$localize`Metadata settings`;let I;I=$localize` Restore file metadata ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let J;J=$localize` Restore read/write permissions ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let ge;ge=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let Fe;return Fe=$localize`${"\uFFFD#41\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#41\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `,[["formRef",""],i,e,t,o,n,s,u,E,I,J,ge,Fe,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"raised","primary"],["type","radio","name","restoreFrom","value","orignal","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled","enableCreateFolder"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","includeMetadata"],["type","checkbox","formControlName","permissions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){if(e&1){let o=j();r(0,"form",13,0),f("submit",function(){return h(o),C(t.submit())}),r(2,"h3",14),S(3,1),l(),r(4,"app-toggle-card",15),L(5,16),S(6,2),$(),r(7,"sh-radio",17),m(8,3),c(9,"input",18),g(),l(),r(10,"sh-radio",17),m(11,4),c(12,"input",19),g(),l(),r(13,"app-file-tree",20)(14,"label",21),q(15,"Path"),l(),c(16,"input",22),l()(),r(17,"app-toggle-card",15),L(18,16),S(19,5),$(),r(20,"sh-radio",17),m(21,6),c(22,"input",23),g(),l(),r(23,"sh-radio",17),m(24,7),c(25,"input",24),g(),l()(),r(26,"app-toggle-card"),L(27,16),S(28,8),$(),r(29,"sh-toggle",25),m(30,9),c(31,"input",26),g(),l(),r(32,"sh-toggle",25),m(33,10),c(34,"input",27),g(),l()(),r(35,"div",28)(36,"button",29),f("click",function(){return h(o),C(t.goBack())}),m(37,11),c(38,"sh-icon"),g(),l(),r(39,"button",30),m(40,12),c(41,"sh-icon"),g(),l()()()}if(e&2){let o;F("formGroup",t.optionsForm),d(4),F("disallowToggle",!0),d(9),F("disabled",((o=t.optionsFormSignal())==null?null:o.restoreFrom)!=="pickLocation")("enableCreateFolder",!0),d(4),F("disallowToggle",!0),d(22),Ie("loader",t.isSubmitting())}},dependencies:[Y,V,G,We,Xe,B,x,W,z,ne,se,Be,we,k,A],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{Qe as a,me as b,Ke as c,_e as d,Je as e,de as f,P as g};
@@ -1 +1 @@
1
- import{a,b}from"./chunk-PN3U7MRX.js";import"./chunk-L6CWVBZ6.js";import"./chunk-OMMUXRXE.js";import"./chunk-N6ABN43N.js";import"./chunk-DDWLL7XA.js";import"./chunk-O64ZZGQZ.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-UKQFDBNO.js";import"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";export{a as createRestoreOptionsForm,b as default};
1
+ import{a,b}from"./chunk-JDXKHOL3.js";import"./chunk-EAV46VM2.js";import"./chunk-HIIPI6XR.js";import"./chunk-N6ABN43N.js";import"./chunk-DDWLL7XA.js";import"./chunk-O64ZZGQZ.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-UKQFDBNO.js";import"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";export{a as createRestoreOptionsForm,b as default};
@@ -1 +1 @@
1
- import{a as K}from"./chunk-62QANGOE.js";import"./chunk-ESUPNSKH.js";import{g as J}from"./chunk-PN3U7MRX.js";import"./chunk-L6CWVBZ6.js";import"./chunk-OMMUXRXE.js";import"./chunk-N6ABN43N.js";import"./chunk-DDWLL7XA.js";import"./chunk-O64ZZGQZ.js";import{b as q}from"./chunk-DNDTLTUM.js";import"./chunk-QDFDQHU3.js";import{a as Z}from"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import{a as V}from"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import{a as H}from"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-Z3EPZZGY.js";import"./chunk-UKQFDBNO.js";import{b as w}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as W,h as X,p as z,s as B}from"./chunk-H7K35UUX.js";import{h as j}from"./chunk-NOPMCS2Z.js";import{qa as k}from"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as i,Bb as s,Cb as S,Dc as d,Ec as m,Gb as u,Hb as T,Oc as b,Qb as v,Ra as _,Rb as D,Sb as r,Tb as I,Ub as x,Yb as g,_ as R,bb as y,ga as C,ha as f,lc as M,oa as L,oc as h,ub as p,vb as O,zb as P}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";function Q(n,t){n&1&&(i(0,"div",17),C(),i(1,"svg",19),S(2,"circle",20),s(),f(),i(3,"sh-icon",21),r(4,3),s()())}function U(n,t){n&1&&(i(0,"div",18),C(),i(1,"svg",19),S(2,"circle",20),s(),f(),i(3,"sh-icon",22),r(4,4),s()())}function Y(n,t){if(n&1&&(i(0,"sh-card",10),u(1,16),r(2,2),T(),p(3,Q,5,0,"div",17)(4,U,5,0,"div",18),s()),n&2){let e=g();_(3),O(e.restoreResult()=="success"?3:4)}}function ee(n,t){if(n&1&&(M(0),d(1,"number"),d(2,"number")),n&2){let e,o=g(2);h(" ",m(1,2,(e=o.statusData())==null?null:e.ProcessedFileCount)," of ",m(2,4,(e=o.statusData())==null?null:e.TotalFileCount)," ")}}function te(n,t){n&1&&(u(0),r(1,8),T())}function ne(n,t){if(n&1&&(M(0),d(1,"bytes"),d(2,"bytes")),n&2){let e,o=g(2);h(" ",m(1,2,(e=o.statusData())==null?null:e.ProcessedFileSize)," of ",m(2,4,(e=o.statusData())==null?null:e.TotalFileSize)," ")}}function oe(n,t){n&1&&(u(0),r(1,9),T())}function ie(n,t){if(n&1&&(i(0,"sh-card",10)(1,"h3"),v(2,5),S(3,"sh-spinner",23),D(),s(),i(4,"div",24),S(5,"sh-progress-bar",25),i(6,"p")(7,"span"),r(8,6),s(),p(9,ee,3,6)(10,te,2,0,"ng-container"),s(),i(11,"p")(12,"span"),r(13,7),s(),p(14,ne,3,6)(15,oe,2,0,"ng-container"),s()()()),n&2){let e,o,l,E,c=g();_(3),I((e=c.statusData())==null?null:e.statusText),x(2),_(2),P("value",(o=c.statusData())==null?null:o.OverallProgress),_(4),O((l=c.statusData())!=null&&l.ProcessedFileCount?9:10),_(5),O((E=c.statusData())!=null&&E.ProcessedFileSize?14:15)}}var F=class n{#i=R(j);#s=R(V);#t=R(Z);#n=R(J);#r=R(w);statusData=this.#t.statusData;backupId=this.#n.backupId;restoreResult=L("");#e=null;lastRestoreStarted=b(()=>{if(this.#e)return this.#e;let t=this.#t.statusData()?.backup?.Backup?.Metadata?.LastRestoreStarted??null;if(!t)return null;let e=this.fixDate(t);return this.#e=e,e});notificationFilterPredicate=()=>{let t=this.lastRestoreStarted();return{predicate:e=>(e.BackupID===this.#n.backupId()&&t&&t.getTime()<=new Date(e.Timestamp).getTime())??!1}};ngOnInit(){let t=this.#r.snapshot.params.taskid?.toString()??"";this.#i.getApiV1TaskByTaskid({taskid:t}).subscribe({next:e=>{if(e.TaskStarted&&(this.#e=new Date(e.TaskStarted)),!e.TaskFinished&&e.ID){this.#a(e.ID);return}this.#o(e)},error:e=>{console.error("Error fetching task:",e),this.restoreResult.set("error"),alert("Failed to fetch task details. Please try again later.")}})}#a(t){this.#s.waitForTaskToComplete(t).subscribe(e=>{this.#o(e)})}#o(t){t.TaskFinished!=null&&this.restoreResult.set(t.Status==="Completed"&&t.ErrorMessage==null?"success":"error")}fixDate(t){return new Date(`${t.slice(0,4)}-${t.slice(4,6)}-${t.slice(6,8)}T${t.slice(9,11)}:${t.slice(11,13)}:${t.slice(13,15)}Z`)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=y({type:n,selectors:[["app-restore-progress"]],decls:12,vars:6,consts:()=>{let t;t=$localize`Notifications`;let e;e=$localize`Logs`;let o;o=$localize`Restore completed`;let l;l=$localize`check-bold`;let E;E=$localize`warning-octagon`;let c;c=$localize` Restore progress: ${"\uFFFD0\uFFFD"}:INTERPOLATION: ${"\uFFFD#3\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let N;N=$localize`Files processed:`;let G;G=$localize`Size processed:`;let $;$=$localize`N/A`;let A;return A=$localize`N/A`,[t,e,o,l,E,c,N,G,$,A,[1,"progress","type-a"],[1,"notifications","type-a"],[1,"notification-list"],[3,"notificationFilterPredicate"],[1,"logs","type-a"],[3,"asSimpleList","polling","whenFilter","backupIdFilter"],["title",""],[1,"complete-success"],[1,"complete-failure"],[1,"border-svg"],["cx","50","cy","50","r","45",1,"border-circle"],[1,"success"],[1,"error"],[1,"primary"],[1,"progress-content"],[3,"value"]]},template:function(e,o){if(e&1&&(i(0,"section"),p(1,Y,5,1,"sh-card",10)(2,ie,16,4,"sh-card",10),i(3,"sh-card",11)(4,"h3"),r(5,0),s(),i(6,"div",12),S(7,"app-notifications",13),s()(),i(8,"sh-card",14)(9,"h3"),r(10,1),s(),S(11,"app-logs-live",15),s()()),e&2){let l;_(),O(o.restoreResult()!=""?1:2),_(6),P("notificationFilterPredicate",o.notificationFilterPredicate()),_(4),P("asSimpleList",!0)("polling",o.restoreResult()=="")("whenFilter",(l=o.lastRestoreStarted())==null?null:l.getTime())("backupIdFilter",o.backupId())}},dependencies:[K,z,B,W,X,q,H,k],styles:['[_nghost-%COMP%]{display:block;padding:0 1.25rem;margin-top:32px}section[_ngcontent-%COMP%]{display:grid;gap:1.25rem;grid-template-columns:2fr 1fr;grid-template-areas:"progress notifications" "logs logs"}section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-bottom:1rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]{grid-area:progress}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]:has(.complete-check){display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1.25rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] sh-spinner[_ngcontent-%COMP%]{--spinner-size: 1.25rem;--spinner-thickness: .1875rem}section[_ngcontent-%COMP%] .notifications[_ngcontent-%COMP%]{grid-area:notifications}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%]{grid-area:logs}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%] app-logs-live[_ngcontent-%COMP%]{max-height:50rem;overflow:auto}.notification-list[_ngcontent-%COMP%]{max-height:15rem;overflow:auto}.complete-success[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--success-8)}.complete-success[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-success[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--success-8)}.complete-failure[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--error-8)}.complete-failure[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-failure[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--error-8)}.border-svg[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}.border-circle[_ngcontent-%COMP%]{fill:none;stroke-width:.3125rem;stroke-dasharray:282.74;stroke-dashoffset:282.74;animation:_ngcontent-%COMP%_draw-border 1.2s linear forwards}@keyframes _ngcontent-%COMP%_draw-border{to{stroke-dashoffset:0}}@keyframes _ngcontent-%COMP%_reveal-icon{to{opacity:1}}.progress-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.progress-content[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{margin-bottom:.75rem}.progress-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-right:.25rem}'],changeDetection:0})};export{F as default};
1
+ import{a as K}from"./chunk-62QANGOE.js";import"./chunk-ESUPNSKH.js";import{g as J}from"./chunk-JDXKHOL3.js";import"./chunk-EAV46VM2.js";import"./chunk-HIIPI6XR.js";import"./chunk-N6ABN43N.js";import"./chunk-DDWLL7XA.js";import"./chunk-O64ZZGQZ.js";import{b as q}from"./chunk-DNDTLTUM.js";import"./chunk-QDFDQHU3.js";import{a as Z}from"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import{a as V}from"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import{a as H}from"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-Z3EPZZGY.js";import"./chunk-UKQFDBNO.js";import{b as w}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as W,h as X,p as z,s as B}from"./chunk-H7K35UUX.js";import{h as j}from"./chunk-NOPMCS2Z.js";import{qa as k}from"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as i,Bb as s,Cb as S,Dc as d,Ec as m,Gb as u,Hb as T,Oc as b,Qb as v,Ra as _,Rb as D,Sb as r,Tb as I,Ub as x,Yb as g,_ as R,bb as y,ga as C,ha as f,lc as M,oa as L,oc as h,ub as p,vb as O,zb as P}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";function Q(n,t){n&1&&(i(0,"div",17),C(),i(1,"svg",19),S(2,"circle",20),s(),f(),i(3,"sh-icon",21),r(4,3),s()())}function U(n,t){n&1&&(i(0,"div",18),C(),i(1,"svg",19),S(2,"circle",20),s(),f(),i(3,"sh-icon",22),r(4,4),s()())}function Y(n,t){if(n&1&&(i(0,"sh-card",10),u(1,16),r(2,2),T(),p(3,Q,5,0,"div",17)(4,U,5,0,"div",18),s()),n&2){let e=g();_(3),O(e.restoreResult()=="success"?3:4)}}function ee(n,t){if(n&1&&(M(0),d(1,"number"),d(2,"number")),n&2){let e,o=g(2);h(" ",m(1,2,(e=o.statusData())==null?null:e.ProcessedFileCount)," of ",m(2,4,(e=o.statusData())==null?null:e.TotalFileCount)," ")}}function te(n,t){n&1&&(u(0),r(1,8),T())}function ne(n,t){if(n&1&&(M(0),d(1,"bytes"),d(2,"bytes")),n&2){let e,o=g(2);h(" ",m(1,2,(e=o.statusData())==null?null:e.ProcessedFileSize)," of ",m(2,4,(e=o.statusData())==null?null:e.TotalFileSize)," ")}}function oe(n,t){n&1&&(u(0),r(1,9),T())}function ie(n,t){if(n&1&&(i(0,"sh-card",10)(1,"h3"),v(2,5),S(3,"sh-spinner",23),D(),s(),i(4,"div",24),S(5,"sh-progress-bar",25),i(6,"p")(7,"span"),r(8,6),s(),p(9,ee,3,6)(10,te,2,0,"ng-container"),s(),i(11,"p")(12,"span"),r(13,7),s(),p(14,ne,3,6)(15,oe,2,0,"ng-container"),s()()()),n&2){let e,o,l,E,c=g();_(3),I((e=c.statusData())==null?null:e.statusText),x(2),_(2),P("value",(o=c.statusData())==null?null:o.OverallProgress),_(4),O((l=c.statusData())!=null&&l.ProcessedFileCount?9:10),_(5),O((E=c.statusData())!=null&&E.ProcessedFileSize?14:15)}}var F=class n{#i=R(j);#s=R(V);#t=R(Z);#n=R(J);#r=R(w);statusData=this.#t.statusData;backupId=this.#n.backupId;restoreResult=L("");#e=null;lastRestoreStarted=b(()=>{if(this.#e)return this.#e;let t=this.#t.statusData()?.backup?.Backup?.Metadata?.LastRestoreStarted??null;if(!t)return null;let e=this.fixDate(t);return this.#e=e,e});notificationFilterPredicate=()=>{let t=this.lastRestoreStarted();return{predicate:e=>(e.BackupID===this.#n.backupId()&&t&&t.getTime()<=new Date(e.Timestamp).getTime())??!1}};ngOnInit(){let t=this.#r.snapshot.params.taskid?.toString()??"";this.#i.getApiV1TaskByTaskid({taskid:t}).subscribe({next:e=>{if(e.TaskStarted&&(this.#e=new Date(e.TaskStarted)),!e.TaskFinished&&e.ID){this.#a(e.ID);return}this.#o(e)},error:e=>{console.error("Error fetching task:",e),this.restoreResult.set("error"),alert("Failed to fetch task details. Please try again later.")}})}#a(t){this.#s.waitForTaskToComplete(t).subscribe(e=>{this.#o(e)})}#o(t){t.TaskFinished!=null&&this.restoreResult.set(t.Status==="Completed"&&t.ErrorMessage==null?"success":"error")}fixDate(t){return new Date(`${t.slice(0,4)}-${t.slice(4,6)}-${t.slice(6,8)}T${t.slice(9,11)}:${t.slice(11,13)}:${t.slice(13,15)}Z`)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=y({type:n,selectors:[["app-restore-progress"]],decls:12,vars:6,consts:()=>{let t;t=$localize`Notifications`;let e;e=$localize`Logs`;let o;o=$localize`Restore completed`;let l;l=$localize`check-bold`;let E;E=$localize`warning-octagon`;let c;c=$localize` Restore progress: ${"\uFFFD0\uFFFD"}:INTERPOLATION: ${"\uFFFD#3\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let N;N=$localize`Files processed:`;let G;G=$localize`Size processed:`;let $;$=$localize`N/A`;let A;return A=$localize`N/A`,[t,e,o,l,E,c,N,G,$,A,[1,"progress","type-a"],[1,"notifications","type-a"],[1,"notification-list"],[3,"notificationFilterPredicate"],[1,"logs","type-a"],[3,"asSimpleList","polling","whenFilter","backupIdFilter"],["title",""],[1,"complete-success"],[1,"complete-failure"],[1,"border-svg"],["cx","50","cy","50","r","45",1,"border-circle"],[1,"success"],[1,"error"],[1,"primary"],[1,"progress-content"],[3,"value"]]},template:function(e,o){if(e&1&&(i(0,"section"),p(1,Y,5,1,"sh-card",10)(2,ie,16,4,"sh-card",10),i(3,"sh-card",11)(4,"h3"),r(5,0),s(),i(6,"div",12),S(7,"app-notifications",13),s()(),i(8,"sh-card",14)(9,"h3"),r(10,1),s(),S(11,"app-logs-live",15),s()()),e&2){let l;_(),O(o.restoreResult()!=""?1:2),_(6),P("notificationFilterPredicate",o.notificationFilterPredicate()),_(4),P("asSimpleList",!0)("polling",o.restoreResult()=="")("whenFilter",(l=o.lastRestoreStarted())==null?null:l.getTime())("backupIdFilter",o.backupId())}},dependencies:[K,z,B,W,X,q,H,k],styles:['[_nghost-%COMP%]{display:block;padding:0 1.25rem;margin-top:32px}section[_ngcontent-%COMP%]{display:grid;gap:1.25rem;grid-template-columns:2fr 1fr;grid-template-areas:"progress notifications" "logs logs"}section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-bottom:1rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]{grid-area:progress}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]:has(.complete-check){display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1.25rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] sh-spinner[_ngcontent-%COMP%]{--spinner-size: 1.25rem;--spinner-thickness: .1875rem}section[_ngcontent-%COMP%] .notifications[_ngcontent-%COMP%]{grid-area:notifications}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%]{grid-area:logs}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%] app-logs-live[_ngcontent-%COMP%]{max-height:50rem;overflow:auto}.notification-list[_ngcontent-%COMP%]{max-height:15rem;overflow:auto}.complete-success[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--success-8)}.complete-success[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-success[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--success-8)}.complete-failure[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--error-8)}.complete-failure[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-failure[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--error-8)}.border-svg[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}.border-circle[_ngcontent-%COMP%]{fill:none;stroke-width:.3125rem;stroke-dasharray:282.74;stroke-dashoffset:282.74;animation:_ngcontent-%COMP%_draw-border 1.2s linear forwards}@keyframes _ngcontent-%COMP%_draw-border{to{stroke-dashoffset:0}}@keyframes _ngcontent-%COMP%_reveal-icon{to{opacity:1}}.progress-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.progress-content[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{margin-bottom:.75rem}.progress-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-right:.25rem}'],changeDetection:0})};export{F as default};
@@ -1 +1 @@
1
- import{g as ht}from"./chunk-PN3U7MRX.js";import{a as pt,b as Ot,c as Ct,d as mt,e as Rt}from"./chunk-QYI4IMJE.js";import"./chunk-7IQY6U5W.js";import"./chunk-L6CWVBZ6.js";import"./chunk-OMMUXRXE.js";import{a as Dt}from"./chunk-KDYD6LMI.js";import{h as Et}from"./chunk-MSLKIHQQ.js";import"./chunk-N6ABN43N.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import"./chunk-O64ZZGQZ.js";import"./chunk-UIJYCGKA.js";import{a as m}from"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import{c as _t,e as ct,f as ut,g as Tt,i as gt,j as St,s as dt}from"./chunk-N5SC4SKW.js";import"./chunk-UKQFDBNO.js";import{b as nt,d as it}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as ot,b as at,d as st,e as rt,l as Ft,o as lt}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as s,Bb as r,Cb as g,Gb as w,Hb as b,Jb as p,Oc as v,Qb as u,Ra as F,Rb as T,Sb as N,Tb as f,Ub as $,Vb as B,Vc as et,Wb as d,Yb as l,_ as O,bb as j,ea as _,ec as Q,fa as c,fc as q,ia as K,ic as Y,lc as I,mc as k,nc as J,oa as C,qc as A,rc as M,sc as y,ub as D,vb as E,wb as P,xb as x,yb as L,yc as Z,zb as h,zc as tt}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var It=["formRef"],Nt=()=>({maxWidth:"700px",width:"100%"});function ft(i,n){if(i&1){let t=p();u(0,2,1),s(1,"button",30),d("click",function(){_(t);let e=l();return c(e.testDestination(0,!0))}),r(),T()}if(i&2){let t=l();F(),Y("loader",t.testSignal()=="testing"),h("disabled",t.testSignal()=="testing")}}function $t(i,n){if(i&1){let t=p();u(0,2,2),s(1,"button",20),d("click",function(){_(t);let e=l();return c(e.copyTargetUrl())}),g(2,"sh-icon"),r(),T()}}function At(i,n){i&1&&(s(0,"sh-alert"),u(1,5),g(2,"sh-icon",31),T(),r())}function Mt(i,n){i&1&&(s(0,"sh-alert",21),u(1,6),g(2,"sh-icon",31),T(),r())}function yt(i,n){if(i&1&&(s(0,"sh-alert",22),u(1,7),g(2,"sh-icon",31),T(),r()),i&2){let t=l();F(2),f(t.testErrorMessage()),$(1)}}function Pt(i,n){if(i&1&&(s(0,"sh-alert",23),u(1,8),g(2,"sh-icon",31),T(),r()),i&2){let t=l();F(2),f(t.testErrorMessage()),$(1)}}function xt(i,n){if(i&1){let t=p();s(0,"p",32),d("click",function(){_(t);let e=l();return c(e.removeDestination())}),u(1,9),g(2,"strong")(3,"br")(4,"span",33),T(),r()}if(i&2){let t,o=l();F(4),f((t=o.selectedDestinationType())==null?null:t.displayName),$(1)}}function Lt(i,n){if(i&1){let t=p();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),r(),s(3,"p"),I(4),r()()}if(i&2){let t=n.$implicit;F(2),k(t.displayName),F(2),k(t.description)}}function wt(i,n){if(i&1){let t=p();s(0,"button",40,1),d("click",function(){let e=_(t).$implicit,a=l(2);return c(a.setDestination(e.key))}),I(2),r()}if(i&2){let t=n.$implicit;F(2),J(" ",t.displayName," ")}}function bt(i,n){if(i&1&&(s(0,"div",34),x(1,Lt,5,2,"div",35,P),r(),s(3,"sh-menu",36)(4,"button",37),N(5,10),r(),w(6,19),x(7,wt,3,1,"button",38,P),b(),r()),i&2){let t=l();F(),L(t.destinationTypeOptionsFocused()),F(2),h("searchable",!0),F(4),L(t.destinationTypeOptions())}}function Bt(i,n){if(i&1){let t=p();s(0,"app-single-destination",41),y("targetUrlChange",function(e){_(t);let a=l();return M(a.targetUrlModel,e)||(a.targetUrlModel=e),c(e)}),r()}if(i&2){let t=l();A("targetUrl",t.targetUrlModel)}}function kt(i,n){i&1&&(u(0,4,1),g(1,"sh-icon",28),T())}function vt(i,n){i&1&&(u(0,4,2),g(1,"sh-icon"),T())}function Gt(i,n){if(i&1){let t=p();s(0,"sh-dialog",42),y("isOpenChange",function(e){_(t);let a=l();return M(a.targetUrlDialogOpen,e)||(a.targetUrlDialogOpen=e),c(e)}),s(1,"header",43)(2,"h2"),N(3,11),r(),s(4,"sh-alert",22),N(5,12),r()(),s(6,"div",44)(7,"sh-form-field")(8,"textarea",45),y("ngModelChange",function(e){_(t);let a=l();return M(a.targetUrlCtrl,e)||(a.targetUrlCtrl=e),c(e)}),r()()(),s(9,"footer",46)(10,"button",26),d("click",function(){_(t);let e=l();return c(e.closeTargetUrlDialog(!1))}),I(11,"Cancel"),r(),s(12,"button",47),d("click",function(){_(t);let e=l();return c(e.closeTargetUrlDialog(!0))}),u(13,13),g(14,"sh-icon"),T(),r()()()}if(i&2){let t=l();A("isOpen",t.targetUrlDialogOpen),h("options",tt(3,Nt)),F(8),A("ngModel",t.targetUrlCtrl)}}var G=class i{#i=O(it);#o=O(nt);#e=O(rt);#a=O(pt);injector=O(K);#t=O(ht);#s=O(Ot);formRef=et.required("formRef");targetUrlModel=this.#t.destinationTargetUrl;targetUrlCtrl=C(null);targetUrlInitial=C(null);targetUrlDialogOpen=C(!1);toggleNewDestination=C(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;destinationTypeOptionsInFocus=C(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#s.destinationTypeOptions;destinationTypeOptionsFocused=v(()=>{let n=this.destinationTypeOptionsInFocus(),t=this.destinationTypeOptions();return n.map(o=>t.find(e=>e.key===o))});selectedDestinationType=v(()=>{let n=this.#t.destinationTargetUrl();if(!n)return null;let t=n.split("://")[0];return Dt(t)});copyTargetUrl(){navigator.clipboard.writeText(this.#t.destinationTargetUrl()??"")}openTargetUrlDialog(){let n=this.#t.destinationTargetUrl();this.targetUrlCtrl.set(n),this.targetUrlInitial.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),o=this.targetUrlInitial();!n||t===o||!t||this.#t.updateTargetUrl(t)}testDestination(n,t,o){let e=this.#t.destinationTargetUrl();e&&(this.#t.setTestState("testing"),this.#a.testDestination(e,n,!0,t).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),a.containsBackup===!1?(this.#t.setTestState("warning",$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`),t||this.#e.open(m,{data:{title:$localize`Folder contains no backup`,message:$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!1&&(this.#t.setTestState("warning",$localize`The remote destination is empty. Please check if the destination details are correct.`),t||this.#e.open(m,{data:{title:$localize`Folder is empty`,message:$localize`The remote destination is empty. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})),o?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){o?.();return}let R=e.includes("?");a.action==="trust-cert"&&this.#t.updateTargetUrl(e+`${R?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.updateTargetUrl(e+`${R?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):o?.()}}))}setDestination(n){this.#t.updateTargetUrl(`${n}://`)}removeDestination(){this.#t.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let n=this.testSignal();if(n===""){this.#e.open(m,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:t=>{t?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open(m,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(n!=="success"){this.#e.open(m,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:t=>{t&&this.#n()}});return}this.#n()}#n(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=j({type:i,selectors:[["app-restore-destination"]],viewQuery:function(t,o){t&1&&Q(o.formRef,It,5),t&2&&q()},features:[Z([Et,{provide:mt,useClass: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 R;R=$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 X;return X=$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,R,U,V,W,z,H,X,[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=p();s(0,"form",14,0),d("submit",function(){return _(e),c(o.next())}),s(2,"header")(3,"h3",15),u(4,2),s(5,"div",16),D(6,ft,2,3,"button",17),s(7,"sh-menu")(8,"button",18),g(9,"sh-icon"),r(),w(10,19),s(11,"button",20),d("click",function(){return _(e),c(o.openTargetUrlDialog())}),g(12,"sh-icon"),r(),D(13,$t,3,0,"button",18),b(),r()(),T(),r(),D(14,At,3,0,"sh-alert")(15,Mt,3,0,"sh-alert",21)(16,yt,3,1,"sh-alert",22)(17,Pt,3,1,"sh-alert",23),D(18,xt,5,1,"p"),r(),D(19,bt,9,1),D(20,Bt,1,1,"app-single-destination",24),s(21,"div",25)(22,"button",26),d("click",function(){return _(e),c(o.goBack())}),u(23,3),g(24,"sh-icon"),T(),r(),s(25,"button",27),u(26,4),D(27,kt,2,0,"sh-icon",28)(28,vt,2,0,"sh-icon"),T(),r()()(),D(29,Gt,15,4,"sh-dialog",29)}if(t&2){let e=!!o.targetUrlModel();F(6),E(e?6:-1),F(7),E(e?13:-1),F(),E(o.testSignal()=="testing"?14:o.testSignal()=="success"?15:o.testSignal()=="warning"?16:o.testSignal()=="error"?17:-1),F(4),E(e?18:-1),F(),E(e?-1:19),F(),E(e?20:-1),F(5),h("disabled",o.testSignal()=="testing"||!e),F(2),E(o.testSignal()=="testing"?27:28),F(2),E(o.targetUrlDialogOpen()?29:-1)}},dependencies:[Rt,dt,St,_t,ct,ut,gt,Tt,Ft,lt,ot,st,at],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] 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{G as default};
1
+ import{g as ht}from"./chunk-JDXKHOL3.js";import{a as pt,b as Ot,c as Ct,d as mt,e as Rt}from"./chunk-3DEY25P4.js";import"./chunk-7IQY6U5W.js";import"./chunk-EAV46VM2.js";import"./chunk-HIIPI6XR.js";import{a as Dt}from"./chunk-KDYD6LMI.js";import{h as Et}from"./chunk-MSLKIHQQ.js";import"./chunk-N6ABN43N.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import"./chunk-O64ZZGQZ.js";import"./chunk-UIJYCGKA.js";import{a as m}from"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import{c as _t,e as ct,f as ut,g as Tt,i as gt,j as St,s as dt}from"./chunk-N5SC4SKW.js";import"./chunk-UKQFDBNO.js";import{b as nt,d as it}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as ot,b as at,d as st,e as rt,l as Ft,o as lt}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as s,Bb as r,Cb as g,Gb as w,Hb as b,Jb as p,Oc as v,Qb as u,Ra as F,Rb as T,Sb as N,Tb as f,Ub as $,Vb as B,Vc as et,Wb as d,Yb as l,_ as O,bb as j,ea as _,ec as Q,fa as c,fc as q,ia as K,ic as Y,lc as I,mc as k,nc as J,oa as C,qc as A,rc as M,sc as y,ub as D,vb as E,wb as P,xb as x,yb as L,yc as Z,zb as h,zc as tt}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var It=["formRef"],Nt=()=>({maxWidth:"700px",width:"100%"});function ft(i,n){if(i&1){let t=p();u(0,2,1),s(1,"button",30),d("click",function(){_(t);let e=l();return c(e.testDestination(0,!0))}),r(),T()}if(i&2){let t=l();F(),Y("loader",t.testSignal()=="testing"),h("disabled",t.testSignal()=="testing")}}function $t(i,n){if(i&1){let t=p();u(0,2,2),s(1,"button",20),d("click",function(){_(t);let e=l();return c(e.copyTargetUrl())}),g(2,"sh-icon"),r(),T()}}function At(i,n){i&1&&(s(0,"sh-alert"),u(1,5),g(2,"sh-icon",31),T(),r())}function Mt(i,n){i&1&&(s(0,"sh-alert",21),u(1,6),g(2,"sh-icon",31),T(),r())}function yt(i,n){if(i&1&&(s(0,"sh-alert",22),u(1,7),g(2,"sh-icon",31),T(),r()),i&2){let t=l();F(2),f(t.testErrorMessage()),$(1)}}function Pt(i,n){if(i&1&&(s(0,"sh-alert",23),u(1,8),g(2,"sh-icon",31),T(),r()),i&2){let t=l();F(2),f(t.testErrorMessage()),$(1)}}function xt(i,n){if(i&1){let t=p();s(0,"p",32),d("click",function(){_(t);let e=l();return c(e.removeDestination())}),u(1,9),g(2,"strong")(3,"br")(4,"span",33),T(),r()}if(i&2){let t,o=l();F(4),f((t=o.selectedDestinationType())==null?null:t.displayName),$(1)}}function Lt(i,n){if(i&1){let t=p();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),r(),s(3,"p"),I(4),r()()}if(i&2){let t=n.$implicit;F(2),k(t.displayName),F(2),k(t.description)}}function wt(i,n){if(i&1){let t=p();s(0,"button",40,1),d("click",function(){let e=_(t).$implicit,a=l(2);return c(a.setDestination(e.key))}),I(2),r()}if(i&2){let t=n.$implicit;F(2),J(" ",t.displayName," ")}}function bt(i,n){if(i&1&&(s(0,"div",34),x(1,Lt,5,2,"div",35,P),r(),s(3,"sh-menu",36)(4,"button",37),N(5,10),r(),w(6,19),x(7,wt,3,1,"button",38,P),b(),r()),i&2){let t=l();F(),L(t.destinationTypeOptionsFocused()),F(2),h("searchable",!0),F(4),L(t.destinationTypeOptions())}}function Bt(i,n){if(i&1){let t=p();s(0,"app-single-destination",41),y("targetUrlChange",function(e){_(t);let a=l();return M(a.targetUrlModel,e)||(a.targetUrlModel=e),c(e)}),r()}if(i&2){let t=l();A("targetUrl",t.targetUrlModel)}}function kt(i,n){i&1&&(u(0,4,1),g(1,"sh-icon",28),T())}function vt(i,n){i&1&&(u(0,4,2),g(1,"sh-icon"),T())}function Gt(i,n){if(i&1){let t=p();s(0,"sh-dialog",42),y("isOpenChange",function(e){_(t);let a=l();return M(a.targetUrlDialogOpen,e)||(a.targetUrlDialogOpen=e),c(e)}),s(1,"header",43)(2,"h2"),N(3,11),r(),s(4,"sh-alert",22),N(5,12),r()(),s(6,"div",44)(7,"sh-form-field")(8,"textarea",45),y("ngModelChange",function(e){_(t);let a=l();return M(a.targetUrlCtrl,e)||(a.targetUrlCtrl=e),c(e)}),r()()(),s(9,"footer",46)(10,"button",26),d("click",function(){_(t);let e=l();return c(e.closeTargetUrlDialog(!1))}),I(11,"Cancel"),r(),s(12,"button",47),d("click",function(){_(t);let e=l();return c(e.closeTargetUrlDialog(!0))}),u(13,13),g(14,"sh-icon"),T(),r()()()}if(i&2){let t=l();A("isOpen",t.targetUrlDialogOpen),h("options",tt(3,Nt)),F(8),A("ngModel",t.targetUrlCtrl)}}var G=class i{#i=O(it);#o=O(nt);#e=O(rt);#a=O(pt);injector=O(K);#t=O(ht);#s=O(Ot);formRef=et.required("formRef");targetUrlModel=this.#t.destinationTargetUrl;targetUrlCtrl=C(null);targetUrlInitial=C(null);targetUrlDialogOpen=C(!1);toggleNewDestination=C(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;destinationTypeOptionsInFocus=C(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#s.destinationTypeOptions;destinationTypeOptionsFocused=v(()=>{let n=this.destinationTypeOptionsInFocus(),t=this.destinationTypeOptions();return n.map(o=>t.find(e=>e.key===o))});selectedDestinationType=v(()=>{let n=this.#t.destinationTargetUrl();if(!n)return null;let t=n.split("://")[0];return Dt(t)});copyTargetUrl(){navigator.clipboard.writeText(this.#t.destinationTargetUrl()??"")}openTargetUrlDialog(){let n=this.#t.destinationTargetUrl();this.targetUrlCtrl.set(n),this.targetUrlInitial.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),o=this.targetUrlInitial();!n||t===o||!t||this.#t.updateTargetUrl(t)}testDestination(n,t,o){let e=this.#t.destinationTargetUrl();e&&(this.#t.setTestState("testing"),this.#a.testDestination(e,n,!0,t).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),a.containsBackup===!1?(this.#t.setTestState("warning",$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`),t||this.#e.open(m,{data:{title:$localize`Folder contains no backup`,message:$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!1&&(this.#t.setTestState("warning",$localize`The remote destination is empty. Please check if the destination details are correct.`),t||this.#e.open(m,{data:{title:$localize`Folder is empty`,message:$localize`The remote destination is empty. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})),o?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){o?.();return}let R=e.includes("?");a.action==="trust-cert"&&this.#t.updateTargetUrl(e+`${R?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.updateTargetUrl(e+`${R?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):o?.()}}))}setDestination(n){this.#t.updateTargetUrl(`${n}://`)}removeDestination(){this.#t.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let n=this.testSignal();if(n===""){this.#e.open(m,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:t=>{t?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open(m,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(n!=="success"){this.#e.open(m,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:t=>{t&&this.#n()}});return}this.#n()}#n(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=j({type:i,selectors:[["app-restore-destination"]],viewQuery:function(t,o){t&1&&Q(o.formRef,It,5),t&2&&q()},features:[Z([Et,{provide:mt,useClass: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 R;R=$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 X;return X=$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,R,U,V,W,z,H,X,[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=p();s(0,"form",14,0),d("submit",function(){return _(e),c(o.next())}),s(2,"header")(3,"h3",15),u(4,2),s(5,"div",16),D(6,ft,2,3,"button",17),s(7,"sh-menu")(8,"button",18),g(9,"sh-icon"),r(),w(10,19),s(11,"button",20),d("click",function(){return _(e),c(o.openTargetUrlDialog())}),g(12,"sh-icon"),r(),D(13,$t,3,0,"button",18),b(),r()(),T(),r(),D(14,At,3,0,"sh-alert")(15,Mt,3,0,"sh-alert",21)(16,yt,3,1,"sh-alert",22)(17,Pt,3,1,"sh-alert",23),D(18,xt,5,1,"p"),r(),D(19,bt,9,1),D(20,Bt,1,1,"app-single-destination",24),s(21,"div",25)(22,"button",26),d("click",function(){return _(e),c(o.goBack())}),u(23,3),g(24,"sh-icon"),T(),r(),s(25,"button",27),u(26,4),D(27,kt,2,0,"sh-icon",28)(28,vt,2,0,"sh-icon"),T(),r()()(),D(29,Gt,15,4,"sh-dialog",29)}if(t&2){let e=!!o.targetUrlModel();F(6),E(e?6:-1),F(7),E(e?13:-1),F(),E(o.testSignal()=="testing"?14:o.testSignal()=="success"?15:o.testSignal()=="warning"?16:o.testSignal()=="error"?17:-1),F(4),E(e?18:-1),F(),E(e?-1:19),F(),E(e?20:-1),F(5),h("disabled",o.testSignal()=="testing"||!e),F(2),E(o.testSignal()=="testing"?27:28),F(2),E(o.targetUrlDialogOpen()?29:-1)}},dependencies:[Rt,dt,St,_t,ct,ut,gt,Tt,Ft,lt,ot,st,at],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] 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{G as default};
@@ -1 +1 @@
1
- import{a}from"./chunk-L6CWVBZ6.js";import"./chunk-OMMUXRXE.js";import"./chunk-N6ABN43N.js";import"./chunk-DELLEGXW.js";import"./chunk-VTSUHAP5.js";import"./chunk-N5SC4SKW.js";import"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";export{a as OptionsListComponent};
1
+ import{a}from"./chunk-EAV46VM2.js";import"./chunk-HIIPI6XR.js";import"./chunk-N6ABN43N.js";import"./chunk-DELLEGXW.js";import"./chunk-VTSUHAP5.js";import"./chunk-N5SC4SKW.js";import"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";export{a as OptionsListComponent};
@@ -1 +1 @@
1
- import{a as xt,b as Lt,c as Rt,d as Ut,e as wt}from"./chunk-QYI4IMJE.js";import"./chunk-7IQY6U5W.js";import"./chunk-OMMUXRXE.js";import{a as Pt}from"./chunk-KDYD6LMI.js";import{h as Bt}from"./chunk-MSLKIHQQ.js";import"./chunk-N6ABN43N.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import"./chunk-O64ZZGQZ.js";import{a as $}from"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import{c as b,e as v,f as At,g as $t,i as k,j as Mt,r as yt,s as G}from"./chunk-N5SC4SKW.js";import{b as St,d as Ct}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as U,b as ht,d as It,e as Nt,g as ft,h as Ot,l as w,o as Et}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as s,Bb as F,Cb as c,Gb as Ft,Hb as rt,Jb as g,Oa as it,Oc as L,Qb as u,Ra as r,Rb as _,Sb as B,Tb as z,Tc as gt,Ub as H,Uc as pt,Vb as X,Vc as mt,Wb as D,Yb as l,Zb as lt,_ as C,_b as ct,bb as f,ea as d,ec as ut,fa as T,fc as _t,ia as nt,ic as dt,lc as x,mc as W,oa as I,qc as O,rc as E,sc as A,tc as j,ub as m,uc as q,vb as S,vc as R,wb as ot,wc as Q,xb as at,yb as st,yc as Tt,zb as h,zc as Dt}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var kt=["*"],M=class o{destination=pt.required();static \u0275fac=function(t){return new(t||o)};static \u0275cmp=f({type:o,selectors:[["app-destination-list-item"]],inputs:{destination:[1,"destination"]},ngContentSelectors:kt,decls:9,vars:6,consts:[[1,"type-b"],[1,"icon"],[3,"src","alt"],[1,"name"],[1,"description"],[1,"actions"]],template:function(t,n){if(t&1&&(lt(),s(0,"sh-card",0)(1,"div",1),c(2,"img",2),F(),s(3,"div",3),x(4),F(),s(5,"div",4),x(6),F(),s(7,"div",5),ct(8),F()()),t&2){let i=n.destination();r(2),h("src",Q(i.icon),it)("alt",Q(i.displayName)),r(2),W(i.displayName),r(2),W(i.description)}},dependencies:[Ot],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 Kt(o,e){if(o&1){let t=g();s(0,"app-destination-list-item",3)(1,"button",4),D("click",function(){let i=d(t).$implicit,a=l();return T(a.setDestination.emit(i.key))}),u(2,0),c(3,"sh-icon"),_(),F()()}if(o&2){let t=e.$implicit;h("destination",t)}}var K=class o{#i=C(Lt);setDestination=gt();destinationSearchTerm=I("");destinationTypeOptionsInFocus=I(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#i.destinationTypeOptions;destinationTypeOptionsFocused=L(()=>{let e=new Set(this.destinationTypeOptionsInFocus()),t=this.destinationTypeOptions(),n=this.destinationSearchTerm().toLowerCase(),i=[...t].sort((a,N)=>{let y=e.has(a.key),P=e.has(N.key);return y&&!P?-1:!y&&P?1:0});return n?i.filter(a=>a.displayName.toLowerCase().includes(n)):i});static \u0275fac=function(t){return new(t||o)};static \u0275cmp=f({type:o,selectors:[["app-destination-list"]],outputs:{setDestination:"setDestination"},decls:5,vars:1,consts:()=>{let e;e=$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",e,3,"ngModelChange","ngModel"],[1,"list"],[3,"destination"],["shButton","","type","button",3,"click"]]},template:function(t,n){t&1&&(s(0,"sh-form-field")(1,"input",1),A("ngModelChange",function(a){return E(n.destinationSearchTerm,a)||(n.destinationSearchTerm=a),a}),F()(),s(2,"div",2),at(3,Kt,4,1,"app-destination-list-item",3,ot),F()),t&2&&(r(),O("ngModel",n.destinationSearchTerm),r(2),st(n.destinationTypeOptionsFocused()))},dependencies:[M,G,b,v,k,w,ft,U],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 Vt=["formRef"],zt=()=>({maxWidth:"700px",width:"100%"});function Ht(o,e){if(o&1){let t=g();u(0,1,1),s(1,"button",28),D("click",function(){d(t);let i=l();return T(i.testDestination(0,!0))}),F(),_()}if(o&2){let t=l();r(),dt("loader",t.testSignal()=="testing"),h("disabled",t.testSignal()=="testing")}}function Xt(o,e){if(o&1){let t=g();u(0,1,2),s(1,"button",29),D("click",function(){d(t);let i=l();return T(i.openTargetUrlDialog())}),c(2,"sh-icon"),F(),_()}}function Wt(o,e){if(o&1){let t=g();u(0,1,4),s(1,"button",29),D("click",function(){d(t);let i=l(2);return T(i.copyTargetUrl())}),c(2,"sh-icon"),F(),_()}}function jt(o,e){if(o&1){let t=g();u(0,1,3),s(1,"sh-menu")(2,"button",17),c(3,"sh-icon"),F(),Ft(4,30),s(5,"button",29),D("click",function(){d(t);let i=l();return T(i.openTargetUrlDialog())}),c(6,"sh-icon"),F(),m(7,Wt,3,0,"button",17),rt(),F(),_()}if(o&2){l();let t=R(0);r(7),S(t?7:-1)}}function qt(o,e){o&1&&(s(0,"sh-alert"),u(1,4),c(2,"sh-icon",31),_(),F())}function Qt(o,e){o&1&&(s(0,"sh-alert",18),u(1,5),c(2,"sh-icon",31),_(),F())}function Yt(o,e){if(o&1&&(s(0,"sh-alert",19),u(1,6),c(2,"sh-icon",31),_(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function Jt(o,e){if(o&1&&(s(0,"sh-alert",20),u(1,7),c(2,"sh-icon",31),_(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function Zt(o,e){if(o&1){let t=g();s(0,"app-destination-list-item",21)(1,"button",24),D("click",function(){d(t);let i=l();return T(i.removeDestination())}),B(2,8),F()()}if(o&2){l();let t=R(14);h("destination",t)}}function te(o,e){if(o&1){let t=g();s(0,"app-destination-list",32),D("setDestination",function(i){d(t);let a=l();return T(a.setDestination(i))}),F()}}function ee(o,e){if(o&1){let t=g();s(0,"app-single-destination",33),A("targetUrlChange",function(i){d(t);let a=l();return E(a.targetUrlModel,i)||(a.targetUrlModel=i),T(i)}),F()}if(o&2){let t=l();O("targetUrl",t.targetUrlModel)}}function ne(o,e){o&1&&(u(0,3,1),c(1,"sh-icon",26),_())}function ie(o,e){o&1&&(u(0,3,2),c(1,"sh-icon"),_())}function oe(o,e){o&1&&(s(0,"h2"),B(1,11),F())}function ae(o,e){o&1&&(s(0,"h2"),B(1,12),F())}function se(o,e){if(o&1){let t=g();s(0,"sh-dialog",34),A("isOpenChange",function(i){d(t);let a=l();return E(a.targetUrlDialogOpen,i)||(a.targetUrlDialogOpen=i),T(i)}),s(1,"header",35),m(2,oe,2,0,"h2")(3,ae,2,0,"h2"),s(4,"sh-alert",19),B(5,9),F()(),s(6,"div",36)(7,"sh-form-field")(8,"textarea",37),A("ngModelChange",function(i){d(t);let a=l();return E(a.targetUrlCtrl,i)||(a.targetUrlCtrl=i),T(i)}),F()()(),s(9,"footer",38)(10,"button",24),D("click",function(){d(t);let i=l();return T(i.closeTargetUrlDialog(!1))}),x(11,"Cancel"),F(),s(12,"button",39),D("click",function(){d(t);let i=l();return T(i.closeTargetUrlDialog(!0))}),u(13,10),c(14,"sh-icon"),_(),F()()()}if(o&2){let t=l(),n=R(0);O("isOpen",t.targetUrlDialogOpen),h("options",Dt(4,zt)),r(2),S(n?3:2),r(6),O("ngModel",t.targetUrlCtrl)}}var V=new yt,we=(o={destinations:[]})=>V.group({destinations:V.array(o.destinations)}),be=({key:o,customGroup:e,dynamicGroup:t,advancedGroup:n})=>V.group({destinationType:V.control(o),custom:e,dynamic:t,advanced:n}),Y=class o{#i=C(Ct);#o=C(St);#t=C(Bt);#e=C(Nt);#a=C(xt);injector=C(nt);formRef=mt.required("formRef");targetUrlModel=this.#t.targetUrlModel;targetUrlCtrl=I(null);targetUrlInitial=I(null);targetUrlDialogOpen=I(!1);toggleNewDestination=I(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;selectedDestinationType=L(()=>{let e=this.targetUrlModel();if(!e)return null;let t=e.split("://")[0];return Pt(t)??null});selectedDestinationTypeOption=L(()=>{let e=this.selectedDestinationType();return e?{key:e.customKey??e.key,customKey:e.customKey??null,displayName:e.displayName,description:e.description,icon:e.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.targetUrlModel()??"")}openTargetUrlDialog(){let e=this.targetUrlModel();this.targetUrlCtrl.set(e),this.targetUrlInitial.set(e),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(e=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),n=this.targetUrlInitial();!e||t===n||!t||this.#t.setTargetUrl(t)}testDestination(e,t,n){let i=this.targetUrlModel();i&&(this.#t.setTestState("testing"),this.#a.testDestination(i,e,!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}}))),n?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){n?.();return}let N=i.includes("?");a.action==="trust-cert"&&this.#t.setTargetUrl(i+`${N?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.setTargetUrl(i+`${N?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):n?.()}}))}setDestination(e){this.#t.setTargetUrl(`${e}://`,!0)}removeDestination(){this.#t.setTargetUrl(null,!0)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let e=this.#t.isNew(),t=this.testSignal();if(!e){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:n=>{n?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:n=>{n&&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=f({type:o,selectors:[["app-destination"]],viewQuery:function(t,n){t&1&&ut(n.formRef,Vt,5),t&2&&_t()},features:[Tt([{provide:Ut,useClass:Rt}])],decls:27,vars:11,consts:()=>{let e;e=$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:`,e=X(e);let t;t=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let n;n=$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 `,n=X(n);let i;i=$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 N;N=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let y;y=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let P;P=$localize`Change`;let J;J=$localize`Be careful, this will overwrite everything you have in your destination.`;let Z;Z=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`;let tt;tt=$localize`Set target URL`;let et;return et=$localize`Edit target URL`,[["formRef",""],e,t,n,i,a,N,y,P,J,Z,tt,et,[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"],[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"],[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,n){if(t&1){let i=g();j(0),s(1,"form",13,0),D("submit",function(){return d(i),T(n.next())}),s(3,"header")(4,"h3",14),u(5,1),s(6,"div",15),m(7,Ht,2,3,"button",16),m(8,Xt,3,0,"button",17)(9,jt,8,1,"sh-menu"),F(),_(),F(),m(10,qt,3,0,"sh-alert")(11,Qt,3,0,"sh-alert",18)(12,Yt,3,1,"sh-alert",19)(13,Jt,3,1,"sh-alert",20),j(14),m(15,Zt,3,1,"app-destination-list-item",21),F(),m(16,te,1,0,"app-destination-list"),m(17,ee,1,1,"app-single-destination",22),s(18,"div",23)(19,"button",24),D("click",function(){return d(i),T(n.goBack())}),u(20,2),c(21,"sh-icon"),_(),F(),s(22,"button",25),u(23,3),m(24,ne,2,0,"sh-icon",26)(25,ie,2,0,"sh-icon"),_(),F()()(),m(26,se,15,5,"sh-dialog",27)}if(t&2){let i=q(!!n.targetUrlModel());r(7),S(i?7:-1),r(),S(i?9:8),r(2),S(n.testSignal()=="testing"?10:n.testSignal()=="success"?11:n.testSignal()=="warning"?12:n.testSignal()=="error"?13:-1),r(4);let a=q(n.selectedDestinationTypeOption());r(),S(a?15:-1),r(),S(i?-1:16),r(),S(i?17:-1),r(5),h("disabled",n.testSignal()=="testing"||!i),r(2),S(n.testSignal()=="testing"?24:25),r(2),S(n.targetUrlDialogOpen()?26:-1)}},dependencies:[wt,K,M,G,Mt,b,v,At,k,$t,w,Et,U,It,ht],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%;overflow:hidden;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{we as createDestinationForm,be as createDestinationFormGroup,Y as default};
1
+ import{a as xt,b as Lt,c as Rt,d as Ut,e as wt}from"./chunk-3DEY25P4.js";import"./chunk-7IQY6U5W.js";import"./chunk-HIIPI6XR.js";import{a as Pt}from"./chunk-KDYD6LMI.js";import{h as Bt}from"./chunk-MSLKIHQQ.js";import"./chunk-N6ABN43N.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import"./chunk-O64ZZGQZ.js";import{a as $}from"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import{c as b,e as v,f as At,g as $t,i as k,j as Mt,r as yt,s as G}from"./chunk-N5SC4SKW.js";import{b as St,d as Ct}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as U,b as ht,d as It,e as Nt,g as ft,h as Ot,l as w,o as Et}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as s,Bb as F,Cb as c,Gb as Ft,Hb as rt,Jb as g,Oa as it,Oc as L,Qb as u,Ra as r,Rb as _,Sb as B,Tb as z,Tc as gt,Ub as H,Uc as pt,Vb as X,Vc as mt,Wb as D,Yb as l,Zb as lt,_ as C,_b as ct,bb as f,ea as d,ec as ut,fa as T,fc as _t,ia as nt,ic as dt,lc as x,mc as W,oa as I,qc as O,rc as E,sc as A,tc as j,ub as m,uc as q,vb as S,vc as R,wb as ot,wc as Q,xb as at,yb as st,yc as Tt,zb as h,zc as Dt}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var kt=["*"],M=class o{destination=pt.required();static \u0275fac=function(t){return new(t||o)};static \u0275cmp=f({type:o,selectors:[["app-destination-list-item"]],inputs:{destination:[1,"destination"]},ngContentSelectors:kt,decls:9,vars:6,consts:[[1,"type-b"],[1,"icon"],[3,"src","alt"],[1,"name"],[1,"description"],[1,"actions"]],template:function(t,n){if(t&1&&(lt(),s(0,"sh-card",0)(1,"div",1),c(2,"img",2),F(),s(3,"div",3),x(4),F(),s(5,"div",4),x(6),F(),s(7,"div",5),ct(8),F()()),t&2){let i=n.destination();r(2),h("src",Q(i.icon),it)("alt",Q(i.displayName)),r(2),W(i.displayName),r(2),W(i.description)}},dependencies:[Ot],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 Kt(o,e){if(o&1){let t=g();s(0,"app-destination-list-item",3)(1,"button",4),D("click",function(){let i=d(t).$implicit,a=l();return T(a.setDestination.emit(i.key))}),u(2,0),c(3,"sh-icon"),_(),F()()}if(o&2){let t=e.$implicit;h("destination",t)}}var K=class o{#i=C(Lt);setDestination=gt();destinationSearchTerm=I("");destinationTypeOptionsInFocus=I(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#i.destinationTypeOptions;destinationTypeOptionsFocused=L(()=>{let e=new Set(this.destinationTypeOptionsInFocus()),t=this.destinationTypeOptions(),n=this.destinationSearchTerm().toLowerCase(),i=[...t].sort((a,N)=>{let y=e.has(a.key),P=e.has(N.key);return y&&!P?-1:!y&&P?1:0});return n?i.filter(a=>a.displayName.toLowerCase().includes(n)):i});static \u0275fac=function(t){return new(t||o)};static \u0275cmp=f({type:o,selectors:[["app-destination-list"]],outputs:{setDestination:"setDestination"},decls:5,vars:1,consts:()=>{let e;e=$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",e,3,"ngModelChange","ngModel"],[1,"list"],[3,"destination"],["shButton","","type","button",3,"click"]]},template:function(t,n){t&1&&(s(0,"sh-form-field")(1,"input",1),A("ngModelChange",function(a){return E(n.destinationSearchTerm,a)||(n.destinationSearchTerm=a),a}),F()(),s(2,"div",2),at(3,Kt,4,1,"app-destination-list-item",3,ot),F()),t&2&&(r(),O("ngModel",n.destinationSearchTerm),r(2),st(n.destinationTypeOptionsFocused()))},dependencies:[M,G,b,v,k,w,ft,U],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 Vt=["formRef"],zt=()=>({maxWidth:"700px",width:"100%"});function Ht(o,e){if(o&1){let t=g();u(0,1,1),s(1,"button",28),D("click",function(){d(t);let i=l();return T(i.testDestination(0,!0))}),F(),_()}if(o&2){let t=l();r(),dt("loader",t.testSignal()=="testing"),h("disabled",t.testSignal()=="testing")}}function Xt(o,e){if(o&1){let t=g();u(0,1,2),s(1,"button",29),D("click",function(){d(t);let i=l();return T(i.openTargetUrlDialog())}),c(2,"sh-icon"),F(),_()}}function Wt(o,e){if(o&1){let t=g();u(0,1,4),s(1,"button",29),D("click",function(){d(t);let i=l(2);return T(i.copyTargetUrl())}),c(2,"sh-icon"),F(),_()}}function jt(o,e){if(o&1){let t=g();u(0,1,3),s(1,"sh-menu")(2,"button",17),c(3,"sh-icon"),F(),Ft(4,30),s(5,"button",29),D("click",function(){d(t);let i=l();return T(i.openTargetUrlDialog())}),c(6,"sh-icon"),F(),m(7,Wt,3,0,"button",17),rt(),F(),_()}if(o&2){l();let t=R(0);r(7),S(t?7:-1)}}function qt(o,e){o&1&&(s(0,"sh-alert"),u(1,4),c(2,"sh-icon",31),_(),F())}function Qt(o,e){o&1&&(s(0,"sh-alert",18),u(1,5),c(2,"sh-icon",31),_(),F())}function Yt(o,e){if(o&1&&(s(0,"sh-alert",19),u(1,6),c(2,"sh-icon",31),_(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function Jt(o,e){if(o&1&&(s(0,"sh-alert",20),u(1,7),c(2,"sh-icon",31),_(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function Zt(o,e){if(o&1){let t=g();s(0,"app-destination-list-item",21)(1,"button",24),D("click",function(){d(t);let i=l();return T(i.removeDestination())}),B(2,8),F()()}if(o&2){l();let t=R(14);h("destination",t)}}function te(o,e){if(o&1){let t=g();s(0,"app-destination-list",32),D("setDestination",function(i){d(t);let a=l();return T(a.setDestination(i))}),F()}}function ee(o,e){if(o&1){let t=g();s(0,"app-single-destination",33),A("targetUrlChange",function(i){d(t);let a=l();return E(a.targetUrlModel,i)||(a.targetUrlModel=i),T(i)}),F()}if(o&2){let t=l();O("targetUrl",t.targetUrlModel)}}function ne(o,e){o&1&&(u(0,3,1),c(1,"sh-icon",26),_())}function ie(o,e){o&1&&(u(0,3,2),c(1,"sh-icon"),_())}function oe(o,e){o&1&&(s(0,"h2"),B(1,11),F())}function ae(o,e){o&1&&(s(0,"h2"),B(1,12),F())}function se(o,e){if(o&1){let t=g();s(0,"sh-dialog",34),A("isOpenChange",function(i){d(t);let a=l();return E(a.targetUrlDialogOpen,i)||(a.targetUrlDialogOpen=i),T(i)}),s(1,"header",35),m(2,oe,2,0,"h2")(3,ae,2,0,"h2"),s(4,"sh-alert",19),B(5,9),F()(),s(6,"div",36)(7,"sh-form-field")(8,"textarea",37),A("ngModelChange",function(i){d(t);let a=l();return E(a.targetUrlCtrl,i)||(a.targetUrlCtrl=i),T(i)}),F()()(),s(9,"footer",38)(10,"button",24),D("click",function(){d(t);let i=l();return T(i.closeTargetUrlDialog(!1))}),x(11,"Cancel"),F(),s(12,"button",39),D("click",function(){d(t);let i=l();return T(i.closeTargetUrlDialog(!0))}),u(13,10),c(14,"sh-icon"),_(),F()()()}if(o&2){let t=l(),n=R(0);O("isOpen",t.targetUrlDialogOpen),h("options",Dt(4,zt)),r(2),S(n?3:2),r(6),O("ngModel",t.targetUrlCtrl)}}var V=new yt,we=(o={destinations:[]})=>V.group({destinations:V.array(o.destinations)}),be=({key:o,customGroup:e,dynamicGroup:t,advancedGroup:n})=>V.group({destinationType:V.control(o),custom:e,dynamic:t,advanced:n}),Y=class o{#i=C(Ct);#o=C(St);#t=C(Bt);#e=C(Nt);#a=C(xt);injector=C(nt);formRef=mt.required("formRef");targetUrlModel=this.#t.targetUrlModel;targetUrlCtrl=I(null);targetUrlInitial=I(null);targetUrlDialogOpen=I(!1);toggleNewDestination=I(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;selectedDestinationType=L(()=>{let e=this.targetUrlModel();if(!e)return null;let t=e.split("://")[0];return Pt(t)??null});selectedDestinationTypeOption=L(()=>{let e=this.selectedDestinationType();return e?{key:e.customKey??e.key,customKey:e.customKey??null,displayName:e.displayName,description:e.description,icon:e.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.targetUrlModel()??"")}openTargetUrlDialog(){let e=this.targetUrlModel();this.targetUrlCtrl.set(e),this.targetUrlInitial.set(e),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(e=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),n=this.targetUrlInitial();!e||t===n||!t||this.#t.setTargetUrl(t)}testDestination(e,t,n){let i=this.targetUrlModel();i&&(this.#t.setTestState("testing"),this.#a.testDestination(i,e,!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}}))),n?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){n?.();return}let N=i.includes("?");a.action==="trust-cert"&&this.#t.setTargetUrl(i+`${N?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.setTargetUrl(i+`${N?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):n?.()}}))}setDestination(e){this.#t.setTargetUrl(`${e}://`,!0)}removeDestination(){this.#t.setTargetUrl(null,!0)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let e=this.#t.isNew(),t=this.testSignal();if(!e){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:n=>{n?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:n=>{n&&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=f({type:o,selectors:[["app-destination"]],viewQuery:function(t,n){t&1&&ut(n.formRef,Vt,5),t&2&&_t()},features:[Tt([{provide:Ut,useClass:Rt}])],decls:27,vars:11,consts:()=>{let e;e=$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:`,e=X(e);let t;t=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let n;n=$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 `,n=X(n);let i;i=$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 N;N=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let y;y=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let P;P=$localize`Change`;let J;J=$localize`Be careful, this will overwrite everything you have in your destination.`;let Z;Z=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`;let tt;tt=$localize`Set target URL`;let et;return et=$localize`Edit target URL`,[["formRef",""],e,t,n,i,a,N,y,P,J,Z,tt,et,[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"],[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"],[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,n){if(t&1){let i=g();j(0),s(1,"form",13,0),D("submit",function(){return d(i),T(n.next())}),s(3,"header")(4,"h3",14),u(5,1),s(6,"div",15),m(7,Ht,2,3,"button",16),m(8,Xt,3,0,"button",17)(9,jt,8,1,"sh-menu"),F(),_(),F(),m(10,qt,3,0,"sh-alert")(11,Qt,3,0,"sh-alert",18)(12,Yt,3,1,"sh-alert",19)(13,Jt,3,1,"sh-alert",20),j(14),m(15,Zt,3,1,"app-destination-list-item",21),F(),m(16,te,1,0,"app-destination-list"),m(17,ee,1,1,"app-single-destination",22),s(18,"div",23)(19,"button",24),D("click",function(){return d(i),T(n.goBack())}),u(20,2),c(21,"sh-icon"),_(),F(),s(22,"button",25),u(23,3),m(24,ne,2,0,"sh-icon",26)(25,ie,2,0,"sh-icon"),_(),F()()(),m(26,se,15,5,"sh-dialog",27)}if(t&2){let i=q(!!n.targetUrlModel());r(7),S(i?7:-1),r(),S(i?9:8),r(2),S(n.testSignal()=="testing"?10:n.testSignal()=="success"?11:n.testSignal()=="warning"?12:n.testSignal()=="error"?13:-1),r(4);let a=q(n.selectedDestinationTypeOption());r(),S(a?15:-1),r(),S(i?-1:16),r(),S(i?17:-1),r(5),h("disabled",n.testSignal()=="testing"||!i),r(2),S(n.testSignal()=="testing"?24:25),r(2),S(n.targetUrlDialogOpen()?26:-1)}},dependencies:[wt,K,M,G,Mt,b,v,At,k,$t,w,Et,U,It,ht],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%;overflow:hidden;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{we as createDestinationForm,be as createDestinationFormGroup,Y as default};
@@ -1 +1 @@
1
- import{a as te}from"./chunk-7IQY6U5W.js";import{a as pt}from"./chunk-NJEX2N4Q.js";import"./chunk-O64ZZGQZ.js";import{a as Tt}from"./chunk-4TDUWDRL.js";import{a as gt}from"./chunk-EBIM5FBM.js";import"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import{a as ct}from"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import{a as K}from"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import{c as Q,e as Z,i as J,m as St,s as Y,t as ee}from"./chunk-N5SC4SKW.js";import"./chunk-Z3EPZZGY.js";import{a as nt}from"./chunk-UKQFDBNO.js";import"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{A as _t,C as dt,a as H,b as W,e as it,g as q,k as ot,l as j,p as st,q as at,r as lt,t as rt}from"./chunk-H7K35UUX.js";import{h as L}from"./chunk-NOPMCS2Z.js";import"./chunk-TDKBGGNK.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-6OPAGPKF.js";import{Ab as i,B as $,Bb as o,Cb as I,H as R,Jb as P,Oa as qe,Oc as D,Pc as G,Qb as X,Ra as r,Rb as V,Sb as l,Tb as se,Ub as ae,V as We,Vb as Ze,Vc as tt,Wb as g,Yb as S,_ as N,a as Ue,b as Be,bb as w,c as He,ea as u,ec as Je,fa as m,fc as Ye,gb as oe,hb as je,ic as M,lc as O,mc as z,n as b,nc as U,oa as c,qc as y,rb as Ke,rc as v,sb as Qe,sc as A,ub as C,vb as E,wc as et,zb as f,zc as B}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var Ct=["formRef"],Et=()=>[import("./chunk-DFMPWF6R.js").then(s=>s.OptionsListComponent)];function Nt(s,e){s&1&&(i(0,"sh-alert",3),l(1,1),o())}function ft(s,e){if(s&1){let t=P();i(0,"app-options-list",5),A("optionsChange",function(a){u(t);let _=S();return v(_.settings,a)||(_.settings=a),m(a)}),o()}if(s&2){let t=S();y("options",t.settings),f("hasFreeTextSettings",!0)}}var Mt=["Bytes","KB","MB","GB","TB","PB"],x=class s{#e=N(te);#t=N(L);formRef=tt.required("formRef");settings=c([]);isSubmitting=c(!1);isLoadingOptions=c(!0);saved=c(!1);sizeOptions=c(Mt);lastRecievedServerSettings=c({});serverSettingsEffect=G(()=>{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 T=n.substring(2);this.settings.update(p=>(p.some(h=>h.Name===T)||p.push({Name:T,Value:a}),p))}_===t.length-1&&this.isLoadingOptions.set(!1)})});submit(){this.isSubmitting.set(!0);let e=this.settings(),t=this.lastRecievedServerSettings(),n=e.map(p=>p.Name),_=Object.keys(t).filter(p=>p.startsWith("--")).filter(p=>!n.includes(p.replace("--",""))),T=e.reduce((p,h)=>(p[`--${h.Name}`]=h.Value,p),{});_.forEach(p=>{T[p]=null}),this.#t.patchApiV1Serversettings({requestBody:T}).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&&Je(n.formRef,Ct,5),t&2&&Ye()},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),C(1,Nt,2,0,"sh-alert",3),i(2,"button",4),g("click",function(){return n.submit()}),X(3,0),I(4,"sh-icon"),V(),o()(),je(5,ft,1,2),Ke(6,5,Et)),t&2&&(r(),E(n.saved()?1:-1),r(),M("loader",n.isSubmitting()),r(4),Qe(!n.isLoadingOptions()))},dependencies:[ee,q,H,W],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 F=class s{#e=N(it);#t=N(L);#o=N(K);repeatRegisterTimer=null;state=c("unknown");claimUrl=c(null);registerUrl=c("");status=D(()=>{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=G(()=>{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",10)(1,"input",11),A("ngModelChange",function(a){u(t);let _=S(2);return v(_.registerUrl,a)||(_.registerUrl=a),m(a)}),o()(),i(2,"button",12),g("click",function(){u(t);let a=S(2);return m(a.register())}),l(3,0),o()}if(s&2){let t=S(2);r(),y("ngModel",t.registerUrl)}}function Ot(s,e){if(s&1&&(i(0,"div",8)(1,"label"),l(2,1),o(),i(3,"a",13),O(4),o()()),s&2){let t=S(2);r(3),f("href",et(t.claimUrl()),qe),r(),z(t.claimUrl())}}function Rt(s,e){s&1&&(i(0,"div",8)(1,"label"),l(2,2),o()())}function It(s,e){if(s&1){let t=P();i(0,"button",12),g("click",function(){u(t);let a=S(2);return m(a.cancel())}),l(1,3),o()}}function yt(s,e){if(s&1){let t=P();i(0,"button",12),g("click",function(){u(t);let a=S(2);return m(a.disable())}),l(1,4),o()}}function vt(s,e){if(s&1){let t=P();i(0,"button",12),g("click",function(){u(t);let a=S(2);return m(a.enable())}),l(1,5),o(),i(2,"button",14),g("click",function(){u(t);let a=S(2);return m(a.delete())}),l(3,6),o()}}function At(s,e){if(s&1&&(i(0,"div",7),C(1,Pt,4,1),C(2,Ot,5,3,"div",8),C(3,Rt,3,0,"div",8),C(4,It,2,0,"button",9),C(5,yt,2,0,"button",9),C(6,vt,4,0),o()),s&2){let t=S();r(),E(t.state()==="inactive"?1:-1),r(),E(t.state()==="registered"?2:-1),r(),E(t.state()==="registering"?3:-1),r(),E(t.state()==="registering"||t.state()==="registeringfaulted"||t.state()==="registered"?4:-1),r(),E(t.state()==="connected"||t.state()==="enabled"?5:-1),r(),E(t.state()==="disabled"?6:-1)}}var ne=class s{#e=N(F);state=this.#e.state;claimUrl=this.#e.claimUrl;registerUrl=this.#e.registerUrl;ngOnInit(){this.#e.refreshRemoteControlStatus()}cancel(){this.#e.cancelRemoteRegistration()}register(){this.#e.beginRemoteRegistration()}disable(){this.#e.disableRemoteControl()}enable(){this.#e.enableRemoteControl()}delete(){this.#e.deleteRemoteControl()}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 T;T=$localize`Enable remote control`;let p;return p=$localize`Delete remote control setup`,[e,t,n,a,_,T,p,[1,"field-row"],[1,"field-col"],["type","button","shButton","",1,"raised"],["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"]]},template:function(t,n){t&1&&C(0,At,7,6,"div",7),t&2&&E(n.state()!=="unknown"?0:-1)},dependencies:[Y,Q,Z,J,j],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}"],changeDetection:0})};function mt(...s){let e=c(...s);return Object.defineProperty(e,"value",{get:e.asReadonly(),set:e.set.bind(e)})}var re=()=>({standalone:!0});function Gt(s,e){s&1&&(i(0,"sh-icon",69),O(1,"check"),o())}function bt(s,e){s&1&&(i(0,"sh-icon",70),O(1,"prohibit"),o())}function $t(s,e){if(s&1){let t=P();i(0,"button",74),g("click",function(){u(t);let a=S(2);return m(a.updatePassphrase())}),l(1,34),o()}if(s&2){let t=S(2);M("loader",t.isUpdating())}}function wt(s,e){if(s&1){let t=P();i(0,"button",75),g("click",function(){u(t);let a=S(2);return m(a.updatePassphrase())}),l(1,35),o()}if(s&2){let t=S(2);M("loader",t.isUpdating()),f("disabled",!0)}}function Lt(s,e){if(s&1){let t=P();i(0,"sh-form-field")(1,"label",65),l(2,31),o(),i(3,"input",66),A("ngModelChange",function(a){u(t);let _=S();return v(_.passphrase,a)||(_.passphrase=a),m(a)}),o()(),i(4,"sh-form-field")(5,"label",67),l(6,32),o(),i(7,"input",68),A("ngModelChange",function(a){u(t);let _=S();return v(_.repeatPassphrase,a)||(_.repeatPassphrase=a),m(a)}),o(),C(8,Gt,2,0,"sh-icon",69)(9,bt,2,0,"sh-icon",70),o(),i(10,"div",48)(11,"button",71),g("click",function(){u(t);let a=S();return m(a.cancelPasswordChange())}),l(12,33),o(),C(13,$t,2,2,"button",72)(14,wt,2,3,"button",73),o()}if(s&2){let t=S();r(3),y("ngModel",t.passphrase),r(4),f("disabled",t.passphrase().length===0),y("ngModel",t.repeatPassphrase),r(),E(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?8:9),r(3),M("loader",t.isUpdating()),r(2),E(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?13:14)}}function Ft(s,e){s&1&&(i(0,"sh-icon",76),O(1,"check"),o())}function Dt(s,e){if(s&1){let t=P();i(0,"div",48)(1,"button",71),g("click",function(){u(t);let a=S();return m(a.openPassphraseForm())}),l(2,36),o(),C(3,Ft,2,0,"sh-icon",76),o()}if(s&2){let t=S();r(3),E(t.passwordUpdated()?3:-1)}}function xt(s,e){if(s&1){let t=P();i(0,"sh-form-field")(1,"label",77),l(2,37),o(),i(3,"textarea",78),A("ngModelChange",function(a){u(t);let _=S();return v(_.allowedHostnames,a)||(_.allowedHostnames=a),m(a)}),o()(),i(4,"sh-alert",79),l(5,38),o(),i(6,"button",74),g("click",function(){u(t);let a=S();return m(a.updateAllowedHostnames())}),l(7,39),o()}if(s&2){let t=S();r(3),y("ngModel",t.allowedHostnames),r(3),M("loader",t.updatingAllowedHosts())}}function kt(s,e){if(s&1&&O(0),s&2){let t,n=S();U(" ",(t=n.sysinfo())==null?null:t.ServerVersion," ")}}function Xt(s,e){s&1&&I(0,"sh-progress-bar",53)}function Vt(s,e){if(s&1&&O(0),s&2){let t=e.$implicit;U(" ",t.label," ")}}function zt(s,e){if(s&1&&O(0),s&2){let t=e.$implicit;U(" ",t.label," ")}}function Ut(s,e,t){let n=mt(s),a=n[Ue];t?.equal&&(a.equal=t.equal);let _;return n.set=T=>{clearTimeout(_),_=setTimeout(()=>Be(a,T),e)},n.update=T=>{clearTimeout(_),_=setTimeout(()=>He(a,T),e)},n}var Bt=[{value:"none",label:$localize`None`},{value:"s",label:$localize`Seconds`},{value:"m",label:$localize`Minutes`},{value:"h",label:$localize`Hours`}],Ht=[{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:"none",label:$localize`None / disabled`}],_e=class s{#e=N(gt);#t=N(K);#o=N(L);#n=N(te);#i=N(F);#s=N(nt);#a=this.#s.getItem("locale")??"en-US";sysinfo=this.#t.systemInfo;isDarkMode=this.#e.isDarkMode;editAs=c("list");previousLang=this.#a;langCtrl=c(this.#a);usageStatistics=c("");updatingUsageStatistics=c(!1);remoteControlStatus=this.#i.status;updatingChannel=c(!1);updateChannel=c("");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),b(null)))).subscribe()}allowRemoteAccess=c(!1);allowedHostnames=c("");loadedAllowedHostnames=c("");updatingRemoteAccess=c(!1);updatingAllowedHosts=c(!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),b(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),b(null)))).subscribe()}updatingDisableTrayIconLogin=c(!1);disableTrayIconLogin=c(!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),b(null)))).subscribe()}showPassphraseForm=c(!1);isUpdating=c(!1);passphrase=c("");repeatPassphrase=c("");passwordUpdated=c(!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=c(Tt);usageStatisticsOptions=c(Ht);timeTypeOptions=c(Bt);timeType=c("none");timeValue=Ut(0,300);timeRange=D(()=>this.timeType()==="h"?[0,24]:[0,60]);timeValueEffect=G(()=>{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),b(null)))).subscribe())}serverSettingsEffect=G(()=>{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 T;T=$localize`Passwords`;let p;p=$localize`Change server passphrase`;let h;h=$localize`Language`;let de;de=$localize`Select a language for the platform`;let ce;ce=$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 ge;ge=$localize`Allow remote access`;let pe;pe=$localize`Prevent tray icon automatic log-in`;let Te;Te=$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 me;me=$localize`Update channel`;let Ce;Ce=$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 releases`;let Me;Me=$localize`Beta`;let he;he=$localize` Try out the new features that we are working on. Currently the most stable version available. Test Restore data before using this in production environments. `;let Pe;Pe=$localize` Experimental `;let Oe;Oe=$localize`Specific builds for developers only. Not for use with important data.`;let Re;Re=$localize`Canary`;let Ie;Ie=$localize`Individual builds for developers only. Not for use with important data.`;let ye;ye=$localize`Pause after startup or hibernation`;let ve;ve=$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 Ae;Ae=$localize`Usage statistics`;let k;k=$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. `,k=Ze(k);let Ge;Ge=$localize`Advanced options`;let be;be=$localize`Enter new password`;let $e;$e=$localize`Repeat password`;let ie;ie=$localize`Password have to be filled and have to match`;let we;we=$localize`Passphrase`;let Le;Le=$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 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 ze;return ze=$localize` Update allowed hostnames `,[e,t,n,a,_,T,p,h,de,ce,Se,ge,pe,Te,ue,me,Ce,Ee,Ne,fe,Me,he,Pe,Oe,Re,Ie,ye,ve,Ae,k,Ge,we,Le,Fe,De,xe,ke,Xe,Ve,ze,[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",ie,1,"raised","primary",3,"loader","disabled"],["shButton","",1,"raised","primary",3,"click"],["shButton","","shTooltip",ie,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"),l(5,0),o(),i(6,"p"),l(7,1),o()()(),i(8,"section")(9,"div",42)(10,"h3"),l(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"),l(19,3),o(),i(20,"p"),l(21,4),o()(),i(22,"div",43)(23,"div",44)(24,"img",45),g("click",function(){return n.setLightMode()}),o(),i(25,"img",46),g("click",function(){return n.setDarkMode()}),o()()()(),i(26,"section")(27,"div",42)(28,"h3"),l(29,5),o(),i(30,"p"),l(31,6),o()(),i(32,"div",47),C(33,Lt,15,7)(34,Dt,4,1,"div",48),o()(),i(35,"section")(36,"div",42)(37,"h3"),l(38,7),o(),i(39,"p"),l(40,8),o()(),i(41,"div",43)(42,"sh-select",49)(43,"input",50),g("ngModelChange",function(_){return n.updateLocale(_)}),o()()()(),i(44,"section")(45,"div",42)(46,"h3"),l(47,9),o(),i(48,"p"),l(49,10),o()(),i(50,"div",51)(51,"sh-toggle",52),g("click",function(){return n.updateRemoteAccess()}),i(52,"label"),l(53,11),o()(),C(54,xt,8,3),o()(),i(55,"section")(56,"div",42)(57,"h3"),l(58,12),o(),i(59,"p"),l(60,13),o()(),i(61,"div",43)(62,"sh-toggle",52),g("click",function(){return n.saveDisableTrayIconLogin()}),i(63,"label"),l(64,14),o()()()(),i(65,"section")(66,"div",42)(67,"h3"),l(68,15),o(),i(69,"p"),C(70,kt,1,1),o(),C(71,Xt,1,0,"sh-progress-bar",53),o(),i(72,"div",54)(73,"div",55),g("click",function(){return n.setNewChannel("")}),i(74,"sh-radio",56),l(75,16),o(),i(76,"p"),l(77,17),o()(),i(78,"div",55),g("click",function(){return n.setNewChannel("stable")}),i(79,"sh-radio",56),l(80,18),o(),i(81,"p"),l(82,19),o()(),i(83,"div",55),g("click",function(){return n.setNewChannel("beta")}),i(84,"sh-radio",56),l(85,20),o(),i(86,"p"),l(87,21),o()(),i(88,"div",55),g("click",function(){return n.setNewChannel("experimental")}),i(89,"sh-radio",56),l(90,22),o(),i(91,"p"),l(92,23),o()(),i(93,"div",55),g("click",function(){return n.setNewChannel("canary")}),i(94,"sh-radio",56),l(95,24),o(),i(96,"p"),l(97,25),o()()()()(),I(98,"sh-divider"),i(99,"div",40)(100,"section")(101,"div",42)(102,"h3"),l(103,26),o(),i(104,"p"),l(105,27),o()(),i(106,"div",43)(107,"div",57)(108,"sh-range-slider",58)(109,"input",59),A("ngModelChange",function(_){return v(n.timeValue,_)||(n.timeValue=_),_}),o()(),i(110,"sh-select",60)(111,"input",61),g("ngModelChange",function(_){return n.updateTimeType(_)}),o(),oe(112,Vt,1,1,"ng-template"),o()()()(),i(113,"section")(114,"div",42)(115,"h3"),l(116,28),o(),i(117,"p"),X(118,29),I(119,"a",62)(120,"br")(121,"br"),V(),o()(),i(122,"div",43)(123,"sh-select",63)(124,"input",50),g("ngModelChange",function(_){return n.updateUsageStatistics(_)}),o(),oe(125,zt,1,1,"ng-template"),o()()()(),i(126,"div",40)(127,"section")(128,"div",64)(129,"h3"),l(130,30),o(),I(131,"app-advanced-options-settings"),o()()()),t&2){let a,_,T;r(13),z(n.remoteControlStatus()),r(11),M("active",!n.isDarkMode()),r(),M("active",n.isDarkMode()),r(8),E(n.showPassphraseForm()?33:34),r(9),f("options",n.languageOptions())("isClearable",!1)("inlineSearch",!0),r(),f("ngModel",n.langCtrl())("ngModelOptions",B(43,re)),r(8),M("active",n.allowRemoteAccess()),r(3),E(n.allowRemoteAccess()?54:-1),r(8),M("active",n.disableTrayIconLogin()),r(8),E(n.updateChannel()!==""&&((a=n.sysinfo())!=null&&a.ServerVersion)?70:-1),r(),E(n.updatingChannel()?71:-1),r(3),M("active",n.updateChannel()===""),r(),se((_=n.sysinfo())==null?null:_.DefaultUpdateChannel),ae(75),r(2),se((T=n.sysinfo())==null?null:T.ServerVersionType),ae(77),r(2),M("active",n.updateChannel()==="stable"),r(5),M("active",n.updateChannel()==="beta"),r(5),M("active",n.updateChannel()==="experimental"),r(5),M("active",n.updateChannel()==="canary"),r(14),f("unit",n.timeType()==="none"?"s":n.timeType()),r(),f("min",n.timeRange()[0])("max",n.timeRange()[1])("disabled",n.timeType()==="none"),y("ngModel",n.timeValue),f("ngModelOptions",B(44,re)),r(),f("options",n.timeTypeOptions())("isClearable",!1),r(),f("ngModel",n.timeType()),r(12),f("options",n.usageStatisticsOptions())("isLoading",n.updatingUsageStatistics()),r(),f("ngModel",n.usageStatistics())("ngModelOptions",B(45,re))}},dependencies:[Y,Q,St,Z,J,ee,pt,ne,x,q,at,lt,st,_t,dt,j,H,ot,W,rt],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{Ut as debounceSignal,_e as default};
1
+ import{a as te}from"./chunk-7IQY6U5W.js";import{a as pt}from"./chunk-NJEX2N4Q.js";import"./chunk-O64ZZGQZ.js";import{a as Tt}from"./chunk-4TDUWDRL.js";import{a as gt}from"./chunk-EBIM5FBM.js";import"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import{a as ct}from"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import{a as K}from"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import{c as Q,e as Z,i as J,m as St,s as Y,t as ee}from"./chunk-N5SC4SKW.js";import"./chunk-Z3EPZZGY.js";import{a as nt}from"./chunk-UKQFDBNO.js";import"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{A as _t,C as dt,a as H,b as W,e as it,g as q,k as ot,l as j,p as st,q as at,r as lt,t as rt}from"./chunk-H7K35UUX.js";import{h as L}from"./chunk-NOPMCS2Z.js";import"./chunk-TDKBGGNK.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-6OPAGPKF.js";import{Ab as i,B as $,Bb as o,Cb as I,H as R,Jb as P,Oa as qe,Oc as D,Pc as G,Qb as X,Ra as r,Rb as V,Sb as l,Tb as se,Ub as ae,V as We,Vb as Ze,Vc as tt,Wb as g,Yb as S,_ as N,a as Ue,b as Be,bb as w,c as He,ea as u,ec as Je,fa as m,fc as Ye,gb as oe,hb as je,ic as M,lc as O,mc as z,n as b,nc as U,oa as c,qc as y,rb as Ke,rc as v,sb as Qe,sc as A,ub as C,vb as E,wc as et,zb as f,zc as B}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var Ct=["formRef"],Et=()=>[import("./chunk-OPUHTC2R.js").then(s=>s.OptionsListComponent)];function Nt(s,e){s&1&&(i(0,"sh-alert",3),l(1,1),o())}function ft(s,e){if(s&1){let t=P();i(0,"app-options-list",5),A("optionsChange",function(a){u(t);let _=S();return v(_.settings,a)||(_.settings=a),m(a)}),o()}if(s&2){let t=S();y("options",t.settings),f("hasFreeTextSettings",!0)}}var Mt=["Bytes","KB","MB","GB","TB","PB"],x=class s{#e=N(te);#t=N(L);formRef=tt.required("formRef");settings=c([]);isSubmitting=c(!1);isLoadingOptions=c(!0);saved=c(!1);sizeOptions=c(Mt);lastRecievedServerSettings=c({});serverSettingsEffect=G(()=>{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 T=n.substring(2);this.settings.update(p=>(p.some(h=>h.Name===T)||p.push({Name:T,Value:a}),p))}_===t.length-1&&this.isLoadingOptions.set(!1)})});submit(){this.isSubmitting.set(!0);let e=this.settings(),t=this.lastRecievedServerSettings(),n=e.map(p=>p.Name),_=Object.keys(t).filter(p=>p.startsWith("--")).filter(p=>!n.includes(p.replace("--",""))),T=e.reduce((p,h)=>(p[`--${h.Name}`]=h.Value,p),{});_.forEach(p=>{T[p]=null}),this.#t.patchApiV1Serversettings({requestBody:T}).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&&Je(n.formRef,Ct,5),t&2&&Ye()},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),C(1,Nt,2,0,"sh-alert",3),i(2,"button",4),g("click",function(){return n.submit()}),X(3,0),I(4,"sh-icon"),V(),o()(),je(5,ft,1,2),Ke(6,5,Et)),t&2&&(r(),E(n.saved()?1:-1),r(),M("loader",n.isSubmitting()),r(4),Qe(!n.isLoadingOptions()))},dependencies:[ee,q,H,W],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 F=class s{#e=N(it);#t=N(L);#o=N(K);repeatRegisterTimer=null;state=c("unknown");claimUrl=c(null);registerUrl=c("");status=D(()=>{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=G(()=>{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",10)(1,"input",11),A("ngModelChange",function(a){u(t);let _=S(2);return v(_.registerUrl,a)||(_.registerUrl=a),m(a)}),o()(),i(2,"button",12),g("click",function(){u(t);let a=S(2);return m(a.register())}),l(3,0),o()}if(s&2){let t=S(2);r(),y("ngModel",t.registerUrl)}}function Ot(s,e){if(s&1&&(i(0,"div",8)(1,"label"),l(2,1),o(),i(3,"a",13),O(4),o()()),s&2){let t=S(2);r(3),f("href",et(t.claimUrl()),qe),r(),z(t.claimUrl())}}function Rt(s,e){s&1&&(i(0,"div",8)(1,"label"),l(2,2),o()())}function It(s,e){if(s&1){let t=P();i(0,"button",12),g("click",function(){u(t);let a=S(2);return m(a.cancel())}),l(1,3),o()}}function yt(s,e){if(s&1){let t=P();i(0,"button",12),g("click",function(){u(t);let a=S(2);return m(a.disable())}),l(1,4),o()}}function vt(s,e){if(s&1){let t=P();i(0,"button",12),g("click",function(){u(t);let a=S(2);return m(a.enable())}),l(1,5),o(),i(2,"button",14),g("click",function(){u(t);let a=S(2);return m(a.delete())}),l(3,6),o()}}function At(s,e){if(s&1&&(i(0,"div",7),C(1,Pt,4,1),C(2,Ot,5,3,"div",8),C(3,Rt,3,0,"div",8),C(4,It,2,0,"button",9),C(5,yt,2,0,"button",9),C(6,vt,4,0),o()),s&2){let t=S();r(),E(t.state()==="inactive"?1:-1),r(),E(t.state()==="registered"?2:-1),r(),E(t.state()==="registering"?3:-1),r(),E(t.state()==="registering"||t.state()==="registeringfaulted"||t.state()==="registered"?4:-1),r(),E(t.state()==="connected"||t.state()==="enabled"?5:-1),r(),E(t.state()==="disabled"?6:-1)}}var ne=class s{#e=N(F);state=this.#e.state;claimUrl=this.#e.claimUrl;registerUrl=this.#e.registerUrl;ngOnInit(){this.#e.refreshRemoteControlStatus()}cancel(){this.#e.cancelRemoteRegistration()}register(){this.#e.beginRemoteRegistration()}disable(){this.#e.disableRemoteControl()}enable(){this.#e.enableRemoteControl()}delete(){this.#e.deleteRemoteControl()}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 T;T=$localize`Enable remote control`;let p;return p=$localize`Delete remote control setup`,[e,t,n,a,_,T,p,[1,"field-row"],[1,"field-col"],["type","button","shButton","",1,"raised"],["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"]]},template:function(t,n){t&1&&C(0,At,7,6,"div",7),t&2&&E(n.state()!=="unknown"?0:-1)},dependencies:[Y,Q,Z,J,j],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}"],changeDetection:0})};function mt(...s){let e=c(...s);return Object.defineProperty(e,"value",{get:e.asReadonly(),set:e.set.bind(e)})}var re=()=>({standalone:!0});function Gt(s,e){s&1&&(i(0,"sh-icon",69),O(1,"check"),o())}function bt(s,e){s&1&&(i(0,"sh-icon",70),O(1,"prohibit"),o())}function $t(s,e){if(s&1){let t=P();i(0,"button",74),g("click",function(){u(t);let a=S(2);return m(a.updatePassphrase())}),l(1,34),o()}if(s&2){let t=S(2);M("loader",t.isUpdating())}}function wt(s,e){if(s&1){let t=P();i(0,"button",75),g("click",function(){u(t);let a=S(2);return m(a.updatePassphrase())}),l(1,35),o()}if(s&2){let t=S(2);M("loader",t.isUpdating()),f("disabled",!0)}}function Lt(s,e){if(s&1){let t=P();i(0,"sh-form-field")(1,"label",65),l(2,31),o(),i(3,"input",66),A("ngModelChange",function(a){u(t);let _=S();return v(_.passphrase,a)||(_.passphrase=a),m(a)}),o()(),i(4,"sh-form-field")(5,"label",67),l(6,32),o(),i(7,"input",68),A("ngModelChange",function(a){u(t);let _=S();return v(_.repeatPassphrase,a)||(_.repeatPassphrase=a),m(a)}),o(),C(8,Gt,2,0,"sh-icon",69)(9,bt,2,0,"sh-icon",70),o(),i(10,"div",48)(11,"button",71),g("click",function(){u(t);let a=S();return m(a.cancelPasswordChange())}),l(12,33),o(),C(13,$t,2,2,"button",72)(14,wt,2,3,"button",73),o()}if(s&2){let t=S();r(3),y("ngModel",t.passphrase),r(4),f("disabled",t.passphrase().length===0),y("ngModel",t.repeatPassphrase),r(),E(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?8:9),r(3),M("loader",t.isUpdating()),r(2),E(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?13:14)}}function Ft(s,e){s&1&&(i(0,"sh-icon",76),O(1,"check"),o())}function Dt(s,e){if(s&1){let t=P();i(0,"div",48)(1,"button",71),g("click",function(){u(t);let a=S();return m(a.openPassphraseForm())}),l(2,36),o(),C(3,Ft,2,0,"sh-icon",76),o()}if(s&2){let t=S();r(3),E(t.passwordUpdated()?3:-1)}}function xt(s,e){if(s&1){let t=P();i(0,"sh-form-field")(1,"label",77),l(2,37),o(),i(3,"textarea",78),A("ngModelChange",function(a){u(t);let _=S();return v(_.allowedHostnames,a)||(_.allowedHostnames=a),m(a)}),o()(),i(4,"sh-alert",79),l(5,38),o(),i(6,"button",74),g("click",function(){u(t);let a=S();return m(a.updateAllowedHostnames())}),l(7,39),o()}if(s&2){let t=S();r(3),y("ngModel",t.allowedHostnames),r(3),M("loader",t.updatingAllowedHosts())}}function kt(s,e){if(s&1&&O(0),s&2){let t,n=S();U(" ",(t=n.sysinfo())==null?null:t.ServerVersion," ")}}function Xt(s,e){s&1&&I(0,"sh-progress-bar",53)}function Vt(s,e){if(s&1&&O(0),s&2){let t=e.$implicit;U(" ",t.label," ")}}function zt(s,e){if(s&1&&O(0),s&2){let t=e.$implicit;U(" ",t.label," ")}}function Ut(s,e,t){let n=mt(s),a=n[Ue];t?.equal&&(a.equal=t.equal);let _;return n.set=T=>{clearTimeout(_),_=setTimeout(()=>Be(a,T),e)},n.update=T=>{clearTimeout(_),_=setTimeout(()=>He(a,T),e)},n}var Bt=[{value:"none",label:$localize`None`},{value:"s",label:$localize`Seconds`},{value:"m",label:$localize`Minutes`},{value:"h",label:$localize`Hours`}],Ht=[{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:"none",label:$localize`None / disabled`}],_e=class s{#e=N(gt);#t=N(K);#o=N(L);#n=N(te);#i=N(F);#s=N(nt);#a=this.#s.getItem("locale")??"en-US";sysinfo=this.#t.systemInfo;isDarkMode=this.#e.isDarkMode;editAs=c("list");previousLang=this.#a;langCtrl=c(this.#a);usageStatistics=c("");updatingUsageStatistics=c(!1);remoteControlStatus=this.#i.status;updatingChannel=c(!1);updateChannel=c("");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),b(null)))).subscribe()}allowRemoteAccess=c(!1);allowedHostnames=c("");loadedAllowedHostnames=c("");updatingRemoteAccess=c(!1);updatingAllowedHosts=c(!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),b(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),b(null)))).subscribe()}updatingDisableTrayIconLogin=c(!1);disableTrayIconLogin=c(!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),b(null)))).subscribe()}showPassphraseForm=c(!1);isUpdating=c(!1);passphrase=c("");repeatPassphrase=c("");passwordUpdated=c(!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=c(Tt);usageStatisticsOptions=c(Ht);timeTypeOptions=c(Bt);timeType=c("none");timeValue=Ut(0,300);timeRange=D(()=>this.timeType()==="h"?[0,24]:[0,60]);timeValueEffect=G(()=>{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),b(null)))).subscribe())}serverSettingsEffect=G(()=>{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 T;T=$localize`Passwords`;let p;p=$localize`Change server passphrase`;let h;h=$localize`Language`;let de;de=$localize`Select a language for the platform`;let ce;ce=$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 ge;ge=$localize`Allow remote access`;let pe;pe=$localize`Prevent tray icon automatic log-in`;let Te;Te=$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 me;me=$localize`Update channel`;let Ce;Ce=$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 releases`;let Me;Me=$localize`Beta`;let he;he=$localize` Try out the new features that we are working on. Currently the most stable version available. Test Restore data before using this in production environments. `;let Pe;Pe=$localize` Experimental `;let Oe;Oe=$localize`Specific builds for developers only. Not for use with important data.`;let Re;Re=$localize`Canary`;let Ie;Ie=$localize`Individual builds for developers only. Not for use with important data.`;let ye;ye=$localize`Pause after startup or hibernation`;let ve;ve=$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 Ae;Ae=$localize`Usage statistics`;let k;k=$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. `,k=Ze(k);let Ge;Ge=$localize`Advanced options`;let be;be=$localize`Enter new password`;let $e;$e=$localize`Repeat password`;let ie;ie=$localize`Password have to be filled and have to match`;let we;we=$localize`Passphrase`;let Le;Le=$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 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 ze;return ze=$localize` Update allowed hostnames `,[e,t,n,a,_,T,p,h,de,ce,Se,ge,pe,Te,ue,me,Ce,Ee,Ne,fe,Me,he,Pe,Oe,Re,Ie,ye,ve,Ae,k,Ge,we,Le,Fe,De,xe,ke,Xe,Ve,ze,[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",ie,1,"raised","primary",3,"loader","disabled"],["shButton","",1,"raised","primary",3,"click"],["shButton","","shTooltip",ie,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"),l(5,0),o(),i(6,"p"),l(7,1),o()()(),i(8,"section")(9,"div",42)(10,"h3"),l(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"),l(19,3),o(),i(20,"p"),l(21,4),o()(),i(22,"div",43)(23,"div",44)(24,"img",45),g("click",function(){return n.setLightMode()}),o(),i(25,"img",46),g("click",function(){return n.setDarkMode()}),o()()()(),i(26,"section")(27,"div",42)(28,"h3"),l(29,5),o(),i(30,"p"),l(31,6),o()(),i(32,"div",47),C(33,Lt,15,7)(34,Dt,4,1,"div",48),o()(),i(35,"section")(36,"div",42)(37,"h3"),l(38,7),o(),i(39,"p"),l(40,8),o()(),i(41,"div",43)(42,"sh-select",49)(43,"input",50),g("ngModelChange",function(_){return n.updateLocale(_)}),o()()()(),i(44,"section")(45,"div",42)(46,"h3"),l(47,9),o(),i(48,"p"),l(49,10),o()(),i(50,"div",51)(51,"sh-toggle",52),g("click",function(){return n.updateRemoteAccess()}),i(52,"label"),l(53,11),o()(),C(54,xt,8,3),o()(),i(55,"section")(56,"div",42)(57,"h3"),l(58,12),o(),i(59,"p"),l(60,13),o()(),i(61,"div",43)(62,"sh-toggle",52),g("click",function(){return n.saveDisableTrayIconLogin()}),i(63,"label"),l(64,14),o()()()(),i(65,"section")(66,"div",42)(67,"h3"),l(68,15),o(),i(69,"p"),C(70,kt,1,1),o(),C(71,Xt,1,0,"sh-progress-bar",53),o(),i(72,"div",54)(73,"div",55),g("click",function(){return n.setNewChannel("")}),i(74,"sh-radio",56),l(75,16),o(),i(76,"p"),l(77,17),o()(),i(78,"div",55),g("click",function(){return n.setNewChannel("stable")}),i(79,"sh-radio",56),l(80,18),o(),i(81,"p"),l(82,19),o()(),i(83,"div",55),g("click",function(){return n.setNewChannel("beta")}),i(84,"sh-radio",56),l(85,20),o(),i(86,"p"),l(87,21),o()(),i(88,"div",55),g("click",function(){return n.setNewChannel("experimental")}),i(89,"sh-radio",56),l(90,22),o(),i(91,"p"),l(92,23),o()(),i(93,"div",55),g("click",function(){return n.setNewChannel("canary")}),i(94,"sh-radio",56),l(95,24),o(),i(96,"p"),l(97,25),o()()()()(),I(98,"sh-divider"),i(99,"div",40)(100,"section")(101,"div",42)(102,"h3"),l(103,26),o(),i(104,"p"),l(105,27),o()(),i(106,"div",43)(107,"div",57)(108,"sh-range-slider",58)(109,"input",59),A("ngModelChange",function(_){return v(n.timeValue,_)||(n.timeValue=_),_}),o()(),i(110,"sh-select",60)(111,"input",61),g("ngModelChange",function(_){return n.updateTimeType(_)}),o(),oe(112,Vt,1,1,"ng-template"),o()()()(),i(113,"section")(114,"div",42)(115,"h3"),l(116,28),o(),i(117,"p"),X(118,29),I(119,"a",62)(120,"br")(121,"br"),V(),o()(),i(122,"div",43)(123,"sh-select",63)(124,"input",50),g("ngModelChange",function(_){return n.updateUsageStatistics(_)}),o(),oe(125,zt,1,1,"ng-template"),o()()()(),i(126,"div",40)(127,"section")(128,"div",64)(129,"h3"),l(130,30),o(),I(131,"app-advanced-options-settings"),o()()()),t&2){let a,_,T;r(13),z(n.remoteControlStatus()),r(11),M("active",!n.isDarkMode()),r(),M("active",n.isDarkMode()),r(8),E(n.showPassphraseForm()?33:34),r(9),f("options",n.languageOptions())("isClearable",!1)("inlineSearch",!0),r(),f("ngModel",n.langCtrl())("ngModelOptions",B(43,re)),r(8),M("active",n.allowRemoteAccess()),r(3),E(n.allowRemoteAccess()?54:-1),r(8),M("active",n.disableTrayIconLogin()),r(8),E(n.updateChannel()!==""&&((a=n.sysinfo())!=null&&a.ServerVersion)?70:-1),r(),E(n.updatingChannel()?71:-1),r(3),M("active",n.updateChannel()===""),r(),se((_=n.sysinfo())==null?null:_.DefaultUpdateChannel),ae(75),r(2),se((T=n.sysinfo())==null?null:T.ServerVersionType),ae(77),r(2),M("active",n.updateChannel()==="stable"),r(5),M("active",n.updateChannel()==="beta"),r(5),M("active",n.updateChannel()==="experimental"),r(5),M("active",n.updateChannel()==="canary"),r(14),f("unit",n.timeType()==="none"?"s":n.timeType()),r(),f("min",n.timeRange()[0])("max",n.timeRange()[1])("disabled",n.timeType()==="none"),y("ngModel",n.timeValue),f("ngModelOptions",B(44,re)),r(),f("options",n.timeTypeOptions())("isClearable",!1),r(),f("ngModel",n.timeType()),r(12),f("options",n.usageStatisticsOptions())("isLoading",n.updatingUsageStatistics()),r(),f("ngModel",n.usageStatistics())("ngModelOptions",B(45,re))}},dependencies:[Y,Q,St,Z,J,ee,pt,ne,x,q,at,lt,st,_t,dt,j,H,ot,W,rt],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{Ut as debounceSignal,_e as default};
@@ -1 +1 @@
1
- import{c as a,d as b}from"./chunk-PN3U7MRX.js";import"./chunk-L6CWVBZ6.js";import"./chunk-OMMUXRXE.js";import"./chunk-N6ABN43N.js";import"./chunk-DDWLL7XA.js";import"./chunk-O64ZZGQZ.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-UKQFDBNO.js";import"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";export{a as createEncryptionForm,b as default};
1
+ import{c as a,d as b}from"./chunk-JDXKHOL3.js";import"./chunk-EAV46VM2.js";import"./chunk-HIIPI6XR.js";import"./chunk-N6ABN43N.js";import"./chunk-DDWLL7XA.js";import"./chunk-O64ZZGQZ.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-UKQFDBNO.js";import"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";export{a as createEncryptionForm,b as default};
@@ -1 +1 @@
1
- import"./chunk-EUDKD2JW.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-A6VGO6B5.js")},{path:"destination",loadComponent:()=>import("./chunk-FFEDQIYN.js")},{path:"source-data",loadComponent:()=>import("./chunk-BPJCKQYP.js")},{path:"schedule",loadComponent:()=>import("./chunk-UIIHBXLB.js")},{path:"options",loadComponent:()=>import("./chunk-7B43LCPI.js")}];export{o as default};
1
+ import"./chunk-EUDKD2JW.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-A6VGO6B5.js")},{path:"destination",loadComponent:()=>import("./chunk-PKGSUIIS.js")},{path:"source-data",loadComponent:()=>import("./chunk-BPJCKQYP.js")},{path:"schedule",loadComponent:()=>import("./chunk-UIIHBXLB.js")},{path:"options",loadComponent:()=>import("./chunk-UBAVXJ6S.js")}];export{o as default};
@@ -1 +1 @@
1
- import{a as le}from"./chunk-L6CWVBZ6.js";import{a as se,b as ae}from"./chunk-OMMUXRXE.js";import{h as ie}from"./chunk-MSLKIHQQ.js";import"./chunk-N6ABN43N.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import"./chunk-O64ZZGQZ.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import{c as Z,e as J,i as ee,k as ne,s as te,t as oe}from"./chunk-N5SC4SKW.js";import{b as V,d as H}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as q,g as Y,l as Q,t as j}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as t,Bb as i,Cb as g,Jb as F,Oc as I,Qb as S,Ra as c,Rb as O,Sb as r,Vc as W,Wb as M,Yb as p,_ as C,bb as x,ea as P,ec as G,fa as f,fc as K,ic as U,oa as v,qc as u,rc as d,sc as m,ub as h,vb as N,zb as T,zc as X}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var _e=["formRef"],re=()=>["--skip-files-larger-than","dblock-size","encryption-module","no-encryption","--no-encryption","compression-module","--exclude-files-attributes","keep-time","keep-versions","retention-policy"];function ce(s,l){s&1&&(S(0,1,1),g(1,"sh-icon",20),O())}function pe(s,l){s&1&&(t(0,"p",21),r(1,6),i())}function ue(s,l){s&1&&(t(0,"p"),r(1,7),i())}function de(s,l){if(s&1){let n=F();t(0,"p"),r(1,8),i(),t(2,"app-timespan",18),m("ngModelChange",function(a){P(n);let o=p();return d(o.optionsFields.backupRetentionTime,a)||(o.optionsFields.backupRetentionTime=a),f(a)}),t(3,"label",30),r(4,9),i()()}if(s&2){let n=p();c(2),T("customId","backupRetentionTime"),u("ngModel",n.optionsFields.backupRetentionTime)}}function me(s,l){if(s&1){let n=F();t(0,"p"),r(1,10),i(),t(2,"sh-form-field")(3,"label",31),r(4,11),i(),t(5,"input",32),m("ngModelChange",function(a){P(n);let o=p();return d(o.optionsFields.backupRetentionVersions,a)||(o.optionsFields.backupRetentionVersions=a),f(a)}),i()()}if(s&2){let n=p();c(5),u("ngModel",n.optionsFields.backupRetentionVersions)}}function Se(s,l){s&1&&(t(0,"p"),r(1,12),i())}function Oe(s,l){if(s&1){let n=F();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),m("ngModelChange",function(a){P(n);let o=p();return d(o.optionsFields.backupRetentionCustom,a)||(o.optionsFields.backupRetentionCustom=a),f(a)}),i()()}if(s&2){let n=p();c(7),u("ngModel",n.optionsFields.backupRetentionCustom)}}var Te=["Bytes","KB","MB","GB","TB","PB"],ge=[{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`}],Ce=1024*1024*1024*2,Pe=1024*1024*5,E=class s{#e=C(ie);#n=C(H);#t=C(V);formRef=W.required("formRef");selectedOptions=this.#e.selectedOptions;nonSelectedOptions=this.#e.nonSelectedOptions;isSubmitting=this.#e.isSubmitting;settings=this.#e.settings;optionsFields=this.#e.optionsFields;applicationOptions=this.#e.applicationOptions;retentionOptions=v(ge);sizeSplit=I(()=>{let n=this.optionsFields.remoteVolumeSize().match(/^(\d+)(bytes|kb|mb|gb|tb|pb|b)$/i);return{value:n?parseInt(n[1],10):0,unit:n?n[2].toUpperCase():"MB"}});exceededVolumeSize=I(()=>{let l=this.sizeSplit().value,n=this.sizeSplit().unit;if(l==null||n===null||n===void 0)return!1;let e=l*Math.pow(1024,Te.indexOf(n));return e>Ce||e<Pe});goBack(){this.#n.navigate(["schedule"],{relativeTo:this.#t.parent})}submit(){this.#e.submit()}static \u0275fac=function(n){return new(n||s)};static \u0275cmp=x({type:s,selectors:[["app-advanced-options-settings"]],viewQuery:function(n,e){n&1&&G(e.formRef,_e,5),n&2&&K()},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 a;a=$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 b;b=$localize`${"\uFFFD#29\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#29\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `;let A;A=$localize` The chosen size is outside the recommended range. This may cause performance issues, excessively large temporary files or other problems. `;let R;R=$localize`Nothing will be deleted. The backup size will grow with each change.`;let y;y=$localize`If at least one newer backup is found, all backups older than this date are deleted.`;let $;$=$localize`Time to keep versions`;let k;k=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let w;w=$localize`Number of versions`;let D;D=$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 B;B=$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 L;L=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let z;return z=$localize`Retention expression`,[l,n,e,a,o,b,A,R,y,$,k,w,D,B,L,z,[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),m("ngModelChange",function(o){return d(e.optionsFields.remoteVolumeSize,o)||(e.optionsFields.remoteVolumeSize=o),o}),t(5,"label",19),S(6,1),h(7,ce,2,0,"sh-icon",20),O(),i()(),h(8,pe,2,0,"p",21),t(9,"p"),S(10,2),t(11,"a",22),g(12,"sh-icon",23),i(),O(),i()(),t(13,"sh-select",24)(14,"label",19),r(15,3),i(),t(16,"input",25),m("ngModelChange",function(o){return d(e.optionsFields.backupRetention,o)||(e.optionsFields.backupRetention=o),o}),i()(),h(17,ue,2,0,"p")(18,de,5,2)(19,me,6,1)(20,Se,2,0,"p")(21,Oe,8,1),t(22,"app-options-list",26),m("optionsChange",function(o){return d(e.settings,o)||(e.settings=o),o}),i(),t(23,"div",27)(24,"button",28),M("click",function(){return e.goBack()}),S(25,4),g(26,"sh-icon"),O(),i(),t(27,"button",29),M("click",function(){return e.submit()}),S(28,5),g(29,"sh-icon"),O(),i()()()),n&2&&(c(4),T("customId","size"),u("ngModel",e.optionsFields.remoteVolumeSize),c(3),N(e.exceededVolumeSize()?7:-1),c(),N(e.exceededVolumeSize()?8:-1),c(5),T("options",e.retentionOptions())("inlineSearch",!0)("isClearable",!1),c(3),u("ngModel",e.optionsFields.backupRetention),c(),N(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),T("applicationOptions",e.applicationOptions())("hasFreeTextSettings",!0)("hiddenOptions",X(15,re)),c(5),U("loader",e.isSubmitting()))},dependencies:[te,Z,ne,J,ee,oe,le,Y,q,j,se,ae,Q],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{E as default};
1
+ import{a as le}from"./chunk-EAV46VM2.js";import{a as se,b as ae}from"./chunk-HIIPI6XR.js";import{h as ie}from"./chunk-MSLKIHQQ.js";import"./chunk-N6ABN43N.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import"./chunk-O64ZZGQZ.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import{c as Z,e as J,i as ee,k as ne,s as te,t as oe}from"./chunk-N5SC4SKW.js";import{b as V,d as H}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as q,g as Y,l as Q,t as j}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as t,Bb as i,Cb as g,Jb as F,Oc as I,Qb as S,Ra as c,Rb as O,Sb as r,Vc as W,Wb as M,Yb as p,_ as C,bb as x,ea as P,ec as G,fa as f,fc as K,ic as U,oa as v,qc as u,rc as d,sc as m,ub as h,vb as N,zb as T,zc as X}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var _e=["formRef"],re=()=>["--skip-files-larger-than","dblock-size","encryption-module","no-encryption","--no-encryption","compression-module","--exclude-files-attributes","keep-time","keep-versions","retention-policy"];function ce(s,l){s&1&&(S(0,1,1),g(1,"sh-icon",20),O())}function pe(s,l){s&1&&(t(0,"p",21),r(1,6),i())}function ue(s,l){s&1&&(t(0,"p"),r(1,7),i())}function de(s,l){if(s&1){let n=F();t(0,"p"),r(1,8),i(),t(2,"app-timespan",18),m("ngModelChange",function(a){P(n);let o=p();return d(o.optionsFields.backupRetentionTime,a)||(o.optionsFields.backupRetentionTime=a),f(a)}),t(3,"label",30),r(4,9),i()()}if(s&2){let n=p();c(2),T("customId","backupRetentionTime"),u("ngModel",n.optionsFields.backupRetentionTime)}}function me(s,l){if(s&1){let n=F();t(0,"p"),r(1,10),i(),t(2,"sh-form-field")(3,"label",31),r(4,11),i(),t(5,"input",32),m("ngModelChange",function(a){P(n);let o=p();return d(o.optionsFields.backupRetentionVersions,a)||(o.optionsFields.backupRetentionVersions=a),f(a)}),i()()}if(s&2){let n=p();c(5),u("ngModel",n.optionsFields.backupRetentionVersions)}}function Se(s,l){s&1&&(t(0,"p"),r(1,12),i())}function Oe(s,l){if(s&1){let n=F();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),m("ngModelChange",function(a){P(n);let o=p();return d(o.optionsFields.backupRetentionCustom,a)||(o.optionsFields.backupRetentionCustom=a),f(a)}),i()()}if(s&2){let n=p();c(7),u("ngModel",n.optionsFields.backupRetentionCustom)}}var Te=["Bytes","KB","MB","GB","TB","PB"],ge=[{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`}],Ce=1024*1024*1024*2,Pe=1024*1024*5,E=class s{#e=C(ie);#n=C(H);#t=C(V);formRef=W.required("formRef");selectedOptions=this.#e.selectedOptions;nonSelectedOptions=this.#e.nonSelectedOptions;isSubmitting=this.#e.isSubmitting;settings=this.#e.settings;optionsFields=this.#e.optionsFields;applicationOptions=this.#e.applicationOptions;retentionOptions=v(ge);sizeSplit=I(()=>{let n=this.optionsFields.remoteVolumeSize().match(/^(\d+)(bytes|kb|mb|gb|tb|pb|b)$/i);return{value:n?parseInt(n[1],10):0,unit:n?n[2].toUpperCase():"MB"}});exceededVolumeSize=I(()=>{let l=this.sizeSplit().value,n=this.sizeSplit().unit;if(l==null||n===null||n===void 0)return!1;let e=l*Math.pow(1024,Te.indexOf(n));return e>Ce||e<Pe});goBack(){this.#n.navigate(["schedule"],{relativeTo:this.#t.parent})}submit(){this.#e.submit()}static \u0275fac=function(n){return new(n||s)};static \u0275cmp=x({type:s,selectors:[["app-advanced-options-settings"]],viewQuery:function(n,e){n&1&&G(e.formRef,_e,5),n&2&&K()},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 a;a=$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 b;b=$localize`${"\uFFFD#29\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#29\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `;let A;A=$localize` The chosen size is outside the recommended range. This may cause performance issues, excessively large temporary files or other problems. `;let R;R=$localize`Nothing will be deleted. The backup size will grow with each change.`;let y;y=$localize`If at least one newer backup is found, all backups older than this date are deleted.`;let $;$=$localize`Time to keep versions`;let k;k=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let w;w=$localize`Number of versions`;let D;D=$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 B;B=$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 L;L=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let z;return z=$localize`Retention expression`,[l,n,e,a,o,b,A,R,y,$,k,w,D,B,L,z,[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),m("ngModelChange",function(o){return d(e.optionsFields.remoteVolumeSize,o)||(e.optionsFields.remoteVolumeSize=o),o}),t(5,"label",19),S(6,1),h(7,ce,2,0,"sh-icon",20),O(),i()(),h(8,pe,2,0,"p",21),t(9,"p"),S(10,2),t(11,"a",22),g(12,"sh-icon",23),i(),O(),i()(),t(13,"sh-select",24)(14,"label",19),r(15,3),i(),t(16,"input",25),m("ngModelChange",function(o){return d(e.optionsFields.backupRetention,o)||(e.optionsFields.backupRetention=o),o}),i()(),h(17,ue,2,0,"p")(18,de,5,2)(19,me,6,1)(20,Se,2,0,"p")(21,Oe,8,1),t(22,"app-options-list",26),m("optionsChange",function(o){return d(e.settings,o)||(e.settings=o),o}),i(),t(23,"div",27)(24,"button",28),M("click",function(){return e.goBack()}),S(25,4),g(26,"sh-icon"),O(),i(),t(27,"button",29),M("click",function(){return e.submit()}),S(28,5),g(29,"sh-icon"),O(),i()()()),n&2&&(c(4),T("customId","size"),u("ngModel",e.optionsFields.remoteVolumeSize),c(3),N(e.exceededVolumeSize()?7:-1),c(),N(e.exceededVolumeSize()?8:-1),c(5),T("options",e.retentionOptions())("inlineSearch",!0)("isClearable",!1),c(3),u("ngModel",e.optionsFields.backupRetention),c(),N(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),T("applicationOptions",e.applicationOptions())("hasFreeTextSettings",!0)("hiddenOptions",X(15,re)),c(5),U("loader",e.isSubmitting()))},dependencies:[te,Z,ne,J,ee,oe,le,Y,q,j,se,ae,Q],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{E as default};
package/index.html CHANGED
@@ -63,5 +63,5 @@
63
63
  <body>
64
64
  <app-root></app-root>
65
65
  <div class="loading">Connecting ...</div>
66
- <link rel="modulepreload" href="chunk-4TDUWDRL.js"><link rel="modulepreload" href="chunk-QDFDQHU3.js"><link rel="modulepreload" href="chunk-6LTGTS6B.js"><link rel="modulepreload" href="chunk-DVDTYV66.js"><link rel="modulepreload" href="chunk-UIJYCGKA.js"><link rel="modulepreload" href="chunk-DELLEGXW.js"><link rel="modulepreload" href="chunk-RHW5QVAY.js"><link rel="modulepreload" href="chunk-VTSUHAP5.js"><link rel="modulepreload" href="chunk-UP5EOICU.js"><link rel="modulepreload" href="chunk-Z3EPZZGY.js"><script src="polyfills-DNO7R5SL.js" type="module"></script><script src="main-Z5T5HH5Q.js" type="module"></script></body>
66
+ <link rel="modulepreload" href="chunk-4TDUWDRL.js"><link rel="modulepreload" href="chunk-QDFDQHU3.js"><link rel="modulepreload" href="chunk-6LTGTS6B.js"><link rel="modulepreload" href="chunk-DVDTYV66.js"><link rel="modulepreload" href="chunk-UIJYCGKA.js"><link rel="modulepreload" href="chunk-DELLEGXW.js"><link rel="modulepreload" href="chunk-RHW5QVAY.js"><link rel="modulepreload" href="chunk-VTSUHAP5.js"><link rel="modulepreload" href="chunk-UP5EOICU.js"><link rel="modulepreload" href="chunk-Z3EPZZGY.js"><script src="polyfills-DNO7R5SL.js" type="module"></script><script src="main-2APPS76A.js" type="module"></script></body>
67
67
  </html>
@@ -1 +1 @@
1
- import{b as be,c as ve}from"./chunk-4TDUWDRL.js";import{a as he}from"./chunk-QDFDQHU3.js";import{a as I}from"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import{a as D}from"./chunk-RHW5QVAY.js";import{a as L}from"./chunk-VTSUHAP5.js";import{a as de}from"./chunk-UP5EOICU.js";import"./chunk-Z3EPZZGY.js";import{a as b,b as v,c as ue,d as k}from"./chunk-UKQFDBNO.js";import{c as ie,d as ae,g as pe,h as ce}from"./chunk-LVP2TPMO.js";import{a as ee}from"./chunk-43JMN2ZY.js";import{c as le}from"./chunk-H7K35UUX.js";import{a as te,b as oe,d as ne,e as re,f as se,i as me}from"./chunk-NOPMCS2Z.js";import{a as ge}from"./chunk-TDKBGGNK.js";import{la as Y,qa as Z}from"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{a as ye}from"./chunk-DFMGS3IN.js";import{b as fe}from"./chunk-6OPAGPKF.js";import{A as x,B as G,Cb as z,H as w,Jc as q,Kc as X,N as J,P as R,Pc as Q,R as B,V as M,Y as $,_ as s,bb as _,f as W,i as j,ia as K,n as F,o as U,oa as d,r as S}from"./chunk-HNWRQABR.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=_({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&z(0,"router-outlet")},dependencies:[ie],encapsulation:2})};var Se={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var h=new $("ENVIRONMENT");var A=class e{#o=s(me);isLoaded=d(!1);webmodules=d(null);preload(t=!1){let o=this.#o.getApiV1Webmodules().pipe(B(n=>this.webmodules.set(n)),w(()=>this.isLoaded.set(!0)));if(t)return o;o.subscribe()}static \u0275fac=function(o){return new(o||e)};static \u0275prov=M({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ee=()=>{let e=s(k);return e.token()?!0:e.checkProxyAuthed().pipe(R(t=>t?F(!0):e.refreshToken().pipe(S(()=>!0))))},Ae=()=>{let e=s(v),t=s(I),o=s(K),n=e.relayIsEnabled()?"longpoll":"websocket",i=[o.get(L).preload(!0),o.get(L).preloadFilterGroups(!0),o.get(A).preload(!0)];return e.configLoaded===null?x(i).pipe(S(()=>n)):e.configLoaded?.pipe(R(()=>x(i)))},Re=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-FCRM5DER.js")},{path:"logout",loadComponent:()=>import("./chunk-MVNLSG6Z.js")},{path:"",canActivate:[Ee],children:[{path:"",canActivate:[Ae],loadComponent:()=>import("./chunk-AJTK6HBC.js"),children:[{path:"",loadComponent:()=>import("./chunk-ZNWZFRFW.js")},{path:"add-backup",loadComponent:()=>import("./chunk-FZHTJSDJ.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-M6WWZKV7.js")},{path:"backup/import",loadComponent:()=>import("./chunk-FUOS2UGQ.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-7EBTJOD7.js"),loadChildren:()=>import("./chunk-U5C62E46.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-7EBTJOD7.js"),loadChildren:()=>import("./chunk-U5C62E46.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-QITXA3NT.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-J3ONM4TQ.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-KGKIF5H4.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-2UCO57JQ.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-DLMKZACT.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-NJZSEKTD.js")},{path:"from-config",loadComponent:()=>import("./chunk-VHE3K2F5.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-XJZ5GM36.js"),loadChildren:()=>import("./chunk-MAQO5X5Q.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-XJZ5GM36.js"),loadChildren:()=>import("./chunk-MAQO5X5Q.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-XJZ5GM36.js"),loadChildren:()=>import("./chunk-MAQO5X5Q.js")},{path:"settings",loadComponent:()=>import("./chunk-OWDKOVPL.js")},{path:"about",loadComponent:()=>import("./chunk-WS76KLII.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-E66CBA5F.js")},{path:"changelog",loadComponent:()=>import("./chunk-SFSB73YO.js")},{path:"libraries",loadComponent:()=>import("./chunk-TIWH4NKT.js")},{path:"system-info",loadComponent:()=>import("./chunk-IFW3O4YJ.js")},{path:"server-settings",loadComponent:()=>import("./chunk-TKO3OH2C.js")},{path:"logs",loadChildren:()=>import("./chunk-B2D4QGDJ.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-R5RIFWZO.js")}]}]}]}]}];var P=null,Te=(e,t)=>{let o=s(k),n=s(ae),i=s(b),l=s(h),r=i.getItem("locale"),u=s(le),a=be(r),p=e.url==="/api/v1/auth/login",m=e.url==="/api/v1/auth/refresh",C=e.url==="/api/v1/progressstate",g=e.url==="/api/v1/remoteoperation/test",y=e.url==="/api/v1/filesystem/validate",T=e.url.startsWith("/api/v2/"),O=o.token(),V=e,H=e.headers.has("custom-proxy-check")||O===ue;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",a)),V=e.clone({headers:c})}return t(V).pipe(S(c=>{if(c.type===4&&c.status===200&&T){let f=c.body;if(f?.Success===!1)throw{status:200,message:f?.Error??"Unknown error",error:{Error:f?.Error??"Unknown error"},body:f}}return c}),G(c=>{let f=c.error?.Error||`Error Code: ${c.status}, Message: ${c.message}`;return!H&&(C&&c.status===404||g||y||u.error(f),m&&c.status===401&&(o.logout(),n.navigate(["/logout"])),!p&&!m&&c.status===401)?(P??=o.refreshToken().pipe(J()),P.pipe(R(()=>t(e.clone({headers:e.headers.set("Authorization",`Bearer ${o.token()}`)}))),w(()=>P=null))):U(()=>({error:c,message:f}))}))};var Ne="1.0.0",we=`portal-proxy-client-${D()}`,Oe=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 a={token:t,publicKey:"",clientVersion:Ne,protocolVersion:Oe},p=this.createResponse(r,"authportal",a);this.#t.set("welcome"),this.#e?.send(p)}else if(this.wsState()==="welcome"){if(r.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${r.type}'`);return}var u=JSON.parse(r.payload??"");if(u.accepted===!1){this.disconnectFromMachineServer("Authentication failed");return}for(this.#t.set("authenticated"),this.#n.set(!0);this.#p.length>0;){let a=this.#p.pop();a&&this.#r[a.messageId]&&this.activateCommand(a)}}else if(this.wsState()==="authenticated"){if(r.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${r.type}'`);return}let a=this.#r[r.messageId];if(a){if(r.errorMessage){a.reject(r.errorMessage);return}else{let p=JSON.parse(r.payload??"");p.body=p?.body==null?null:this.utf8Atob(p.body),a.resolve(p)}delete this.#r[r.messageId],window.clearTimeout(a.timer)}}})}disconnectFromMachineServer(t=null){t&&console.error(t),this.#e?.close(),this.#e=null,this.#t.set("disconnected"),this.#n.set(!1)}createResponse(t,o,n){let i={from:we,to:t.from,type:o,messageId:t.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(t,o,n,i,l,r,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(t),new Promise((a,p)=>{let m=D(),g={from:we,to:o,type:"command",messageId:m,payload:JSON.stringify({method:n,path:i,body:l,headers:r})},y={resolve:a,reject:p,timer:window.setTimeout(()=>{let T=this.#r[m];T&&(delete this.#r[m],T.reject("Timeout"))},u)};this.#r[m]=y,this.#n()?this.activateCommand(g):this.#p.push(g)})}activateCommand(t){this.#e?.send(JSON.stringify(t))}static \u0275fac=function(o){return new(o||e)};static \u0275prov=M({token:e,factory:e.\u0275fac,providedIn:"root"})};function xe(e){if(typeof e!="string")return null;let o=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...o))}function Me(e,t,o){let n=e.relayconfigState.config();if(n===null)return o(t);let i=xe(t.body),l={};t.headers.keys().forEach(p=>{l[p]=t.headers.get(p)??""});let r=t.headers.get("timeout"),u=r!==null?parseInt(r):e.defaultTimeout;t.url.startsWith("/api/v1/serverstate")&&t.url.includes("longpoll=true")&&(u=1e3*99);let a=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,t.method,t.url,i,l,u);return new W(p=>{a.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});p.next(g),p.complete()})})}var ke=(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 j;return o.relayconfigState.configLoaded.subscribe(l=>{l&&Me(o,e,t).subscribe(i)}),i}return Me(o,e,t)};var Ie={providers:[q(),pe(Re,ce()),ne(se(),re([ke,Te])),b,{provide:h,useValue:Se},{provide:X,useValue:ve()},he,I,fe,Z,de,Y,ge,ye]};ee(E,Ie);
1
+ import{b as be,c as ve}from"./chunk-4TDUWDRL.js";import{a as he}from"./chunk-QDFDQHU3.js";import{a as I}from"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import{a as D}from"./chunk-RHW5QVAY.js";import{a as L}from"./chunk-VTSUHAP5.js";import{a as de}from"./chunk-UP5EOICU.js";import"./chunk-Z3EPZZGY.js";import{a as b,b as v,c as ue,d as k}from"./chunk-UKQFDBNO.js";import{c as ie,d as ae,g as pe,h as ce}from"./chunk-LVP2TPMO.js";import{a as ee}from"./chunk-43JMN2ZY.js";import{c as le}from"./chunk-H7K35UUX.js";import{a as te,b as oe,d as ne,e as re,f as se,i as me}from"./chunk-NOPMCS2Z.js";import{a as ge}from"./chunk-TDKBGGNK.js";import{la as Y,qa as Z}from"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{a as ye}from"./chunk-DFMGS3IN.js";import{b as fe}from"./chunk-6OPAGPKF.js";import{A as x,B as G,Cb as z,H as w,Jc as q,Kc as X,N as J,P as R,Pc as Q,R as B,V as M,Y as $,_ as s,bb as _,f as W,i as j,ia as K,n as F,o as U,oa as d,r as S}from"./chunk-HNWRQABR.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=_({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&z(0,"router-outlet")},dependencies:[ie],encapsulation:2})};var Se={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var h=new $("ENVIRONMENT");var A=class e{#o=s(me);isLoaded=d(!1);webmodules=d(null);preload(t=!1){let o=this.#o.getApiV1Webmodules().pipe(B(n=>this.webmodules.set(n)),w(()=>this.isLoaded.set(!0)));if(t)return o;o.subscribe()}static \u0275fac=function(o){return new(o||e)};static \u0275prov=M({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ee=()=>{let e=s(k);return e.token()?!0:e.checkProxyAuthed().pipe(R(t=>t?F(!0):e.refreshToken().pipe(S(()=>!0))))},Ae=()=>{let e=s(v),t=s(I),o=s(K),n=e.relayIsEnabled()?"longpoll":"websocket",i=[o.get(L).preload(!0),o.get(L).preloadFilterGroups(!0),o.get(A).preload(!0)];return e.configLoaded===null?x(i).pipe(S(()=>n)):e.configLoaded?.pipe(R(()=>x(i)))},Re=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-FCRM5DER.js")},{path:"logout",loadComponent:()=>import("./chunk-MVNLSG6Z.js")},{path:"",canActivate:[Ee],children:[{path:"",canActivate:[Ae],loadComponent:()=>import("./chunk-AJTK6HBC.js"),children:[{path:"",loadComponent:()=>import("./chunk-ZNWZFRFW.js")},{path:"add-backup",loadComponent:()=>import("./chunk-FZHTJSDJ.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-M6WWZKV7.js")},{path:"backup/import",loadComponent:()=>import("./chunk-FUOS2UGQ.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-7EBTJOD7.js"),loadChildren:()=>import("./chunk-UAOG26QT.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-7EBTJOD7.js"),loadChildren:()=>import("./chunk-UAOG26QT.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-QITXA3NT.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-J3ONM4TQ.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-53RHCPJ3.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-2UCO57JQ.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-DLMKZACT.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-NJZSEKTD.js")},{path:"from-config",loadComponent:()=>import("./chunk-VHE3K2F5.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-F3RCXLD4.js"),loadChildren:()=>import("./chunk-A4HR75JB.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-F3RCXLD4.js"),loadChildren:()=>import("./chunk-A4HR75JB.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-F3RCXLD4.js"),loadChildren:()=>import("./chunk-A4HR75JB.js")},{path:"settings",loadComponent:()=>import("./chunk-RSJYY3JM.js")},{path:"about",loadComponent:()=>import("./chunk-WS76KLII.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-E66CBA5F.js")},{path:"changelog",loadComponent:()=>import("./chunk-SFSB73YO.js")},{path:"libraries",loadComponent:()=>import("./chunk-TIWH4NKT.js")},{path:"system-info",loadComponent:()=>import("./chunk-IFW3O4YJ.js")},{path:"server-settings",loadComponent:()=>import("./chunk-TKO3OH2C.js")},{path:"logs",loadChildren:()=>import("./chunk-B2D4QGDJ.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-R5RIFWZO.js")}]}]}]}]}];var P=null,Te=(e,t)=>{let o=s(k),n=s(ae),i=s(b),l=s(h),r=i.getItem("locale"),u=s(le),a=be(r),p=e.url==="/api/v1/auth/login",m=e.url==="/api/v1/auth/refresh",C=e.url==="/api/v1/progressstate",g=e.url==="/api/v1/remoteoperation/test",y=e.url==="/api/v1/filesystem/validate",T=e.url.startsWith("/api/v2/"),O=o.token(),V=e,H=e.headers.has("custom-proxy-check")||O===ue;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",a)),V=e.clone({headers:c})}return t(V).pipe(S(c=>{if(c.type===4&&c.status===200&&T){let f=c.body;if(f?.Success===!1)throw{status:200,message:f?.Error??"Unknown error",error:{Error:f?.Error??"Unknown error"},body:f}}return c}),G(c=>{let f=c.error?.Error||`Error Code: ${c.status}, Message: ${c.message}`;return!H&&(C&&c.status===404||g||y||u.error(f),m&&c.status===401&&(o.logout(),n.navigate(["/logout"])),!p&&!m&&c.status===401)?(P??=o.refreshToken().pipe(J()),P.pipe(R(()=>t(e.clone({headers:e.headers.set("Authorization",`Bearer ${o.token()}`)}))),w(()=>P=null))):U(()=>({error:c,message:f}))}))};var Ne="1.0.0",we=`portal-proxy-client-${D()}`,Oe=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 a={token:t,publicKey:"",clientVersion:Ne,protocolVersion:Oe},p=this.createResponse(r,"authportal",a);this.#t.set("welcome"),this.#e?.send(p)}else if(this.wsState()==="welcome"){if(r.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${r.type}'`);return}var u=JSON.parse(r.payload??"");if(u.accepted===!1){this.disconnectFromMachineServer("Authentication failed");return}for(this.#t.set("authenticated"),this.#n.set(!0);this.#p.length>0;){let a=this.#p.pop();a&&this.#r[a.messageId]&&this.activateCommand(a)}}else if(this.wsState()==="authenticated"){if(r.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${r.type}'`);return}let a=this.#r[r.messageId];if(a){if(r.errorMessage){a.reject(r.errorMessage);return}else{let p=JSON.parse(r.payload??"");p.body=p?.body==null?null:this.utf8Atob(p.body),a.resolve(p)}delete this.#r[r.messageId],window.clearTimeout(a.timer)}}})}disconnectFromMachineServer(t=null){t&&console.error(t),this.#e?.close(),this.#e=null,this.#t.set("disconnected"),this.#n.set(!1)}createResponse(t,o,n){let i={from:we,to:t.from,type:o,messageId:t.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(t,o,n,i,l,r,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(t),new Promise((a,p)=>{let m=D(),g={from:we,to:o,type:"command",messageId:m,payload:JSON.stringify({method:n,path:i,body:l,headers:r})},y={resolve:a,reject:p,timer:window.setTimeout(()=>{let T=this.#r[m];T&&(delete this.#r[m],T.reject("Timeout"))},u)};this.#r[m]=y,this.#n()?this.activateCommand(g):this.#p.push(g)})}activateCommand(t){this.#e?.send(JSON.stringify(t))}static \u0275fac=function(o){return new(o||e)};static \u0275prov=M({token:e,factory:e.\u0275fac,providedIn:"root"})};function xe(e){if(typeof e!="string")return null;let o=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...o))}function Me(e,t,o){let n=e.relayconfigState.config();if(n===null)return o(t);let i=xe(t.body),l={};t.headers.keys().forEach(p=>{l[p]=t.headers.get(p)??""});let r=t.headers.get("timeout"),u=r!==null?parseInt(r):e.defaultTimeout;t.url.startsWith("/api/v1/serverstate")&&t.url.includes("longpoll=true")&&(u=1e3*99);let a=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,t.method,t.url,i,l,u);return new W(p=>{a.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});p.next(g),p.complete()})})}var ke=(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 j;return o.relayconfigState.configLoaded.subscribe(l=>{l&&Me(o,e,t).subscribe(i)}),i}return Me(o,e,t)};var Ie={providers:[q(),pe(Re,ce()),ne(se(),re([ke,Te])),b,{provide:h,useValue:Se},{provide:X,useValue:ve()},he,I,fe,Z,de,Y,ge,ye]};ee(E,Ie);
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.145",
2
+ "version": "0.0.146",
3
3
  "name": "@duplicati/ngclient",
4
4
  "license": "MIT",
5
5
  "contributors": [
package/chunk-MAQO5X5Q.js DELETED
@@ -1 +0,0 @@
1
- import"./chunk-EUDKD2JW.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-FDCY62KM.js")},{path:"encryption",loadComponent:()=>import("./chunk-W6DRPPZU.js")},{path:"select-files",loadComponent:()=>import("./chunk-2UGURIOT.js")},{path:"options",loadComponent:()=>import("./chunk-RPU4AJBK.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-GB3UMYUD.js")}],t=o;export{t as default};
package/chunk-OMMUXRXE.js DELETED
@@ -1 +0,0 @@
1
- import{a as v,c as N,e as E,i as O,k as P,s as D}from"./chunk-N5SC4SKW.js";import{l as S,o as X,t as Y}from"./chunk-H7K35UUX.js";import{Ab as u,Bb as s,Gb as L,Hb as x,Jb as W,Oc as m,Pc as f,Ra as a,Sb as I,Tb as F,Ub as A,Uc as g,Wb as j,Yb as b,Zb as T,_b as d,bb as C,ea as $,fa as w,gb as z,hc as G,lc as U,oa as l,oc as k,qc as c,rc as h,sc as _,tb as M,wb as B,xb as R,yb as V,yc as y,zb as p}from"./chunk-HNWRQABR.js";var Q=[[["label"]],[["","prefix",""]],[["","suffix",""]]],ee=["label","[prefix]","[suffix]"];function te(i,e){if(i&1&&U(0),i&2){let t=e.$implicit,n=b();k("",t.label,"",n.hasPerSecond()?"/s":"")}}var ne=[{value:"bytes",label:"Bytes"},{value:"KB",label:"KB"},{value:"MB",label:"MB"},{value:"GB",label:"GB"},{value:"TB",label:"TB"},{value:"PB",label:"PB"}],ie=["throttle-upload","throttle-download"],H=class i{customId=g();inputType=g();timespan=l(0);unit=l("MB");sizeOptions=l(ne);readonly=l(!1);hasPerSecond=m(()=>{let e=this.inputType();return e&&ie.includes(e)});onChange=()=>{};onTouched=()=>{};onChangeEffect=f(()=>{this.onChange(this.getValue())});writeValue(e){if(e){let t=e.match(/^(\d+)(bytes|kb|mb|gb|tb|pb|b)$/i);t?(this.timespan.set(parseInt(t[1],10)),this.unit.set(t[2].toUpperCase())):(this.timespan.set(0),this.unit.set("MB"))}else this.timespan.set(0),this.unit.set("MB")}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.readonly.set(e)}getValue(){return`${this.timespan()}${this.unit()}`}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=C({type:i,selectors:[["app-size"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[y([{provide:v,useExisting:i,multi:!0}])],ngContentSelectors:ee,decls:9,vars:10,consts:[[1,"label"],["type","number",3,"ngModelChange","id","ngModel","disabled"],["value","value","label","label",3,"options","readonly","isClearable"],["type","text",3,"ngModelChange","ngModel"]],template:function(t,n){t&1&&(T(Q),u(0,"div",0),d(1,0,["ngProjectAs","label",5,["label"]]),s(),u(2,"sh-form-field")(3,"input",1),_("ngModelChange",function(o){return h(n.timespan,o)||(n.timespan=o),o}),s(),d(4,1),d(5,2),s(),u(6,"sh-select",2)(7,"input",3),_("ngModelChange",function(o){return h(n.unit,o)||(n.unit=o),o}),s(),z(8,te,1,2,"ng-template"),s()),t&2&&(a(2),M("readonly",n.readonly()||void 0),a(),p("id",n.customId()),c("ngModel",n.timespan),p("disabled",n.readonly()),a(3),G("--miw",0),p("options",n.sizeOptions())("readonly",n.readonly())("isClearable",!1),a(),c("ngModel",n.unit))},dependencies:[Y,S,D,N,P,E,O],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label label" "input unit";grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}[_nghost-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:unit}'],changeDetection:0})};var oe=[[["label"]],[["","prefix",""]],[["","suffix",""]]],ae=["label","[prefix]","[suffix]"];function se(i,e){if(i&1){let t=W();u(0,"button",7),j("click",function(){let r=$(t).$implicit,o=b();return w(o.updateUnit(r.value))}),I(1,1),s()}if(i&2){let t=e.$implicit;a(),F(t.label),A(1)}}var le=[{value:"s",label:$localize`Seconds`},{value:"m",label:$localize`Minutes`},{value:"h",label:$localize`Hours`}],re=[{value:"Y",label:$localize`Years`},{value:"M",label:$localize`Months`},{value:"W",label:$localize`Weeks`},{value:"D",label:$localize`Days`}],pe=["retry-delay","web-timeout","read-write-timeout","run-script-timeout","list-timeout","short-timeout"],K=class i{customId=g();inputType=g();timespan=l(0);#e="D";unit=l(this.#e);unitLabel=m(()=>{let e=this.timeOptions(),t=e.findIndex(n=>n.value===this.unit());return e[t]?.label??this.unit()});isShortTime=m(()=>{let e=this.inputType();return e&&pe.includes(e.replace("--",""))});timeOptions=m(()=>this.isShortTime()?le:re);readonly=l(!1);onChange=()=>{};onTouched=()=>{};onChangeEffect=f(()=>{this.onChange(this.getValue())});inputTypeEffect=f(()=>{let e=this.timeOptions(),t=this.isShortTime()?"s":"D";this.#e=t,this.unit.set(t)});updateUnit(e){this.unit.set(e)}writeValue(e){let t=this.isShortTime();if(e){let n=t?/(\d+)([smh])/i:/^(\d+)([YMWD])$/i,r=e.match(n);r?(this.timespan.set(parseInt(r[1],10)),this.unit.set(r[2])):(this.timespan.set(0),this.unit.set(this.#e))}else this.timespan.set(0),this.unit.set(this.#e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.readonly.set(e)}getValue(){return`${this.timespan()}${this.unit()}`}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=C({type:i,selectors:[["app-timespan"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[y([{provide:v,useExisting:i,multi:!0}])],ngContentSelectors:ae,decls:11,vars:6,consts:()=>{let e;e=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let t;return t=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`,[e,t,["type","number",3,"ngModelChange","id","ngModel","disabled"],[3,"openIndicator"],["shButton","","type","button",1,"trigger"],["menu",""],["shButton","","type","button",1,"small"],["shButton","","type","button",1,"small",3,"click"]]},template:function(t,n){t&1&&(T(oe),d(0,0,["ngProjectAs","label",5,["label"]]),u(1,"sh-form-field")(2,"input",2),_("ngModelChange",function(o){return h(n.timespan,o)||(n.timespan=o),o}),s(),d(3,1),d(4,2),s(),u(5,"sh-menu",3)(6,"button",4),I(7,0),s(),L(8,5),R(9,se,2,1,"button",6,B),x(),s()),t&2&&(a(),M("readonly",n.readonly()||void 0),a(),p("id",n.customId()),c("ngModel",n.timespan),p("disabled",n.readonly()),a(3),p("openIndicator",!0),a(2),F(n.unitLabel()),A(7),a(2),V(n.timeOptions()))},dependencies:[X,S,D,N,P,E,O],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label label" "input unit";grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}[_nghost-%COMP%] sh-menu[_ngcontent-%COMP%]{grid-area:unit}[_nghost-%COMP%] sh-menu[_ngcontent-%COMP%] button.trigger[_ngcontent-%COMP%]{width:100%}'],changeDetection:0})};export{H as a,K as b};