@duplicati/ngclient 0.0.201 → 0.0.203

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.
Files changed (47) hide show
  1. package/assets/sh.woff2 +0 -0
  2. package/{chunk-NEC5ZCCT.js → chunk-2BXGPMD6.js} +1 -1
  3. package/chunk-2Y2B4SFQ.js +1 -0
  4. package/{chunk-YDE34GTN.js → chunk-3QV6WLWV.js} +1 -1
  5. package/{chunk-V7OCP4NF.js → chunk-5REQ64AK.js} +1 -1
  6. package/{chunk-HETNGT36.js → chunk-7DCQVM6E.js} +1 -1
  7. package/{chunk-4GYWPC2V.js → chunk-7OT4OWQG.js} +1 -1
  8. package/chunk-7SNTP57H.js +1 -0
  9. package/chunk-BFTGDQ4K.js +1 -0
  10. package/{chunk-UK6PJVXG.js → chunk-C25WT56X.js} +1 -1
  11. package/chunk-C64L6XY3.js +1 -0
  12. package/{chunk-WNG24347.js → chunk-C7N24TZM.js} +1 -1
  13. package/{chunk-56MQ46JU.js → chunk-DJEDUAEJ.js} +1 -1
  14. package/{chunk-C5RNVTX6.js → chunk-DUYRB53D.js} +1 -1
  15. package/{chunk-F5SNXI4Q.js → chunk-EE27B3OV.js} +1 -1
  16. package/{chunk-ZMSYEF6G.js → chunk-GRVTXORM.js} +1 -1
  17. package/chunk-HRHF3TYJ.js +1 -0
  18. package/{chunk-XHIPGS6J.js → chunk-IGYSPFE7.js} +1 -1
  19. package/{chunk-MI7UAY44.js → chunk-JRLBD7M4.js} +1 -1
  20. package/chunk-K6G7ALTG.js +1 -0
  21. package/{chunk-JZRRR52Q.js → chunk-NDRKUUWC.js} +1 -1
  22. package/{chunk-POPZ47SS.js → chunk-OL7C46LY.js} +1 -1
  23. package/chunk-P3D2ZP6W.js +11 -0
  24. package/{chunk-44X4A7WY.js → chunk-PMRQJTYP.js} +1 -1
  25. package/{chunk-AMTYI2HA.js → chunk-Q2UQ5J3C.js} +1 -1
  26. package/{chunk-NQAH5AL7.js → chunk-QBBHHRS4.js} +1 -1
  27. package/{chunk-VIXVL2MX.js → chunk-S53N5WRU.js} +1 -1
  28. package/chunk-SXUG3CGT.js +1 -0
  29. package/{chunk-FRPWQ4C3.js → chunk-T4BXBCQI.js} +1 -1
  30. package/{chunk-ZESQ7CXK.js → chunk-TKB2SB6D.js} +1 -1
  31. package/{chunk-O64YAUSG.js → chunk-TX7JDBPD.js} +1 -1
  32. package/chunk-W3YBKYPJ.js +1 -0
  33. package/{chunk-BAGYEJI6.js → chunk-W67KMV7H.js} +1 -1
  34. package/{chunk-LODLMHG5.js → chunk-XLMLR5EV.js} +1 -1
  35. package/{chunk-XZH2SXWG.js → chunk-XS4CJ2AE.js} +1 -1
  36. package/index.html +1 -1
  37. package/{main-CMOWV2QF.js → main-MW67CCYR.js} +1 -1
  38. package/package.json +1 -1
  39. package/chunk-3TJKPVBA.js +0 -1
  40. package/chunk-4AQZL2UM.js +0 -1
  41. package/chunk-LPAIFT5I.js +0 -11
  42. package/chunk-MUFBZIQA.js +0 -1
  43. package/chunk-P7OUKLCO.js +0 -1
  44. package/chunk-PE34XFKC.js +0 -1
  45. package/chunk-SQNRZYPW.js +0 -1
  46. package/chunk-VLC2XPEM.js +0 -1
  47. package/chunk-VVQRXJRI.js +0 -1
package/chunk-4AQZL2UM.js DELETED
@@ -1 +0,0 @@
1
- import{a as Ze}from"./chunk-POPZ47SS.js";import{h as Ke,n as Qe}from"./chunk-LPAIFT5I.js";import{d as re}from"./chunk-MUFBZIQA.js";import{a as je}from"./chunk-SZUNW4JO.js";import{a as y}from"./chunk-HSHF5HR7.js";import{b as _e}from"./chunk-VDSX2M4H.js";import{b as qe}from"./chunk-ZU6T3TW3.js";import{a as K}from"./chunk-HUZXJWCG.js";import{B as j,H as ze,L as Je,M as Xe,P as Ue,V as Ye,W as He,b as we,c as B,e as V,f as W,i as Be,j as z,l as Ve,p as J,q as X,r as U,s as We,t as Y,u as H,z as se}from"./chunk-UNMDSCAN.js";import{c as q}from"./chunk-CFNARBNK.js";import{b as L,d as D}from"./chunk-I27PVH6D.js";import{fa as ne}from"./chunk-7AVOHYTE.js";import{$ as R,Ab as l,Bb as u,C as Q,Cc as le,Dc as ke,E as h,Ec as xe,Fb as v,Gb as A,H as Pe,Ib as G,K as Ie,L as ee,Mc as I,Pa as p,Pb as d,Qb as m,R as Me,Rb as T,Sb as De,Tb as ye,Vb as f,W as c,Xb as E,aa as P,cb as w,g as Ce,gc as $e,hb as Le,jc as k,la as _,lc as be,m as Ne,mc as ve,na as M,oc as te,pc as ie,qc as oe,sb as O,tb as C,v as ae,w as he,wc as Ae,xc as Ge,yb as S,z as Re,zb as r}from"./chunk-26Z7TPJB.js";var et=new U,ot=()=>et.group({passphrase:et.control("")}),ce=class s{#e=c(q);#t=c($);#n=c(D);#o=c(L);encryptionForm=this.#t.encryptionForm;creatingTemporaryBackup=_(!1);settings=_([]);next(){let i=this.#t.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.#e.postApiV1Backups({requestBody:{Backup:{TargetURL:i,Settings:t}},temporary:!0}).pipe(h(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:o=>{let n=o.ID;this.#n.navigate([`/restore-draft/${n}`])},error:o=>{console.error(o)}})}back(){this.#t.isFileRestore()?this.#n.navigate(["destination"],{relativeTo:this.#o.parent}):this.#t.exit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=w({type:s,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),T(3,0),l(),u(4,"input",6),l(),r(5,"sh-toggle-card"),v(6,7),T(7,1),A(),r(8,"app-options-list",8),oe("optionsChange",function(n){return ie(t.settings,n)||(t.settings=n),n}),l()(),r(9,"div",9)(10,"button",10),f("click",function(){return t.back()}),d(11,2),u(12,"sh-icon"),m(),l(),r(13,"button",11),d(14,3),u(15,"sh-icon"),m(),l()()()),e&2&&(S("formGroup",t.encryptionForm),p(8),te("options",t.settings),S("hasFreeTextSettings",!0))},dependencies:[Y,z,B,V,W,X,J,ze,H,j,Ye,Ze],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 rt=()=>({standalone:!0});function at(s,i){s&1&&u(0,"sh-progress-bar",8)}function lt(s,i){if(s&1&&(k(0),le(1,"bytes")),s&2){let e=E().$implicit;be(" (",ke(1,1,e.FileSizes),") ")}}function _t(s,i){s&1&&(r(0,"span",16),T(1,4),l())}function ct(s,i){if(s&1&&(r(0,"div",15),k(1),le(2,"date"),O(3,lt,2,3),O(4,_t,2,0,"span",16),l()),s&2){let e=i.$implicit;p(),ve(" ",e.Version,": ",xe(2,4,e.Time,"medium")," "),p(2),C(e.FileSizes?3:-1),p(),C(e.IsFullBackup===!1?4:-1)}}function ut(s,i){s&1&&u(0,"sh-progress-bar",8)}function pt(s,i){if(s&1){let e=G();r(0,"app-file-tree",17),f("hasExtendedData",function(o){R(e);let n=E(2);return P(n.extendedDataType.set(o))}),r(1,"label",18),T(2,5),l(),u(3,"input",19),l()}if(s&2){let e=E(2);S("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)("loadExtendedData",!0)}}function dt(s,i){if(s&1){let e=G();r(0,"sh-select",12),f("cleared",function(){R(e);let o=E();return P(o.abortLoading())}),r(1,"input",13),oe("ngModelChange",function(o){R(e);let n=E();return ie(n.selectOption,o)||(n.selectOption=o),P(o)}),l(),Le(2,ct,5,7,"ng-template"),l(),O(3,ut,1,0,"sh-progress-bar",8),O(4,pt,4,6,"app-file-tree",14)}if(s&2){let e=E();S("options",e.versionOptions())("isClearable",!1),p(),te("ngModel",e.selectOption),S("ngModelOptions",Ge(6,rt)),p(2),C(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),p(),C(e.showFileTree()?4:-1)}}var pe=new U,nt=()=>pe.group({filesToRestore:pe.control(""),passphrase:pe.control(null)}),de=class s{#e=c(q);#t=c($);#n=c(qe);#o=c(K);#i=c(D);#s=c(L);#l=c(ne);#a=null;#_=null;#r=_([]);selectFilesForm=this.#t.selectFilesForm;selectFilesFormSignal=this.#t.selectFilesFormSignal;selectOption=this.#t.selectOption;backupId=this.#t.backupId;versionOptionsLoading=this.#t.versionOptionsLoading;versionOptions=this.#t.versionOptions;isFileRestore=this.#t.isFileRestore;extendedDataType=this.#t.extendedDataType;needsDatabaseRepair=I(()=>this.#t.backup()?.Backup?.IsTemporary??!0);showFileTree=_(!1);backupSettings=_(null);rootPaths=_([]);initialNodes=_([]);loadingRootPath=_(!1);isRepairing=I(()=>this.#r().length>0);loadedVersions=_({});loadingEffect=M(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let t=e[0].Version;this.selectOption.set(t.toString())}});backupSettingsEffect=M(()=>{let i=this.backupId(),e=this.selectOption(),t=this.isRepairing(),o=this.loadedVersions();if(!e||!i)return;let a=this.versionOptions()?.find(Z=>Z.Version===parseInt(e))?.Time??null;if(!a)return;let g=`${i}+${a}`,N=o[g];if(this.needsDatabaseRepair()&&(!N||t))return;let b={id:i+"",time:a};this.backupSettings.set(b),this.getRootPath(b)});repairEffect=M(()=>{if(!this.needsDatabaseRepair())return;let i=this.selectOption(),e=this.versionOptions();if(i){let t=e.find(a=>a.Version===parseInt(i));if(t===void 0)return;let o=this.backupId(),n=`${o}+${t.Time}`;if(this.#_===n||(this.#_=n,this.#r().includes(n)))return;this.#r.update(a=>[...a,n]),this.#e.postApiV1BackupByIdRepairupdate({id:o,requestBody:{only_paths:!0,time:t.Time}}).pipe(ee(this.abortLoading$),h(()=>{this.#_=null})).subscribe(a=>{let g=a.ID;this.#n.waitForTaskToComplete(g).pipe(Q(1)).subscribe(()=>{this.#r.update(N=>N.filter(b=>b!==n)),this.loadedVersions.update(N=>(N[n]=!0,N))})})}});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.#o.hasV2ListOperations()?this.#e.postApiV2BackupListFolder({requestBody:{BackupId:i.id,Time:i.time,Paths:null,PageSize:0,Page:0}}).pipe(ee(this.abortLoading$),h(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#a=null})).subscribe({next:o=>{let n=(o.Data??[]).map(a=>a.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#e.getApiV1BackupByIdFiles(e).pipe(ee(this.abortLoading$),h(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:o=>{let n=o.Files.map(a=>a.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new Ce;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.#t.isFileRestore()?this.#i.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#t.exit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=w({type:s,selectors:[["app-select-files"]],features:[Ae([ne])],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 a;return a=$localize`Path`,[["formRef",""],i,e,t,n,a,[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","loadExtendedData"],[1,"custom-option"],[1,"partial"],[3,"hasExtendedData","rootPaths","initialNodes","backupSettings","multiSelect","showFiles","loadExtendedData"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,t){if(e&1){let o=G();r(0,"form",6,0),f("submit",function(){return R(o),P(t.next())}),r(2,"h3",7),T(3,1),l(),O(4,at,1,0,"sh-progress-bar",8)(5,dt,5,7),r(6,"div",9)(7,"button",10),f("click",function(){return R(o),P(t.back())}),d(8,2),u(9,"sh-icon"),m(),l(),r(10,"button",11),d(11,3),u(12,"sh-icon"),m(),l()()()}e&2&&(S("formGroup",t.selectFilesForm),p(4),C(t.versionOptionsLoading()?4:5),p(5),De(t.isFileRestore()?"Back":"Exit"),ye(8))},dependencies:[We,z,B,V,W,Be,Y,X,J,re,j,H,Ue,Je,ne,je],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 $=class s{#e=c(D);#t=c(L);#n=c(K);#o=c(se);#i=c(q);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);selectFilesForm=nt();optionsForm=st();encryptionForm=ot();optionsFormSignal=_e(this.optionsForm.valueChanges);selectFilesFormSignal=_e(this.selectFilesForm.valueChanges);selectOption=_(null);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isFileRestore=_(!1);isFullWidthPage=_(!1);extendedDataType=_(null);alternateRestorePath=_(null);#s=_("");#l=_(null);#a=null;testSignal=this.#s.asReadonly();testErrorMessage=this.#l.asReadonly();#_=M(()=>{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),this.alternateRestorePath.set(null),this.extendedDataType.set(null),e&&this.#e.navigate(["/restore-from-files/destination"]),e||this.getBackup()}setTestState(i,e){this.#s.set(i),this.#l.set(e??null)}updateTargetUrl(i){this.destinationTargetUrl.set(i)}setAlternateRestorePath(i){this.alternateRestorePath.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.#o.open(y,{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(a=>a.Version===(o&&parseInt(o)));this.#i.postApiV1BackupByIdRestore({id:i??"",requestBody:{paths:t.filesToRestore?.split("\0").map(a=>a.endsWith("/")||a.endsWith("\\")?`${a}*`:a)??[],passphrase:t.passphrase??null,time:n?.Time,restore_path:this.alternateRestorePath()??e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata}}).pipe(h(()=>this.isSubmitting.set(!1))).subscribe({next:a=>{this.#e.navigate([`./${a.ID}`,"progress"],{relativeTo:this.#t})},error:a=>{console.error("restore error",a)}})}exit(){this.#o.open(y,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:i=>{i&&(this.#c(),this.#e.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(i,e=2){return this.#i.postApiV2BackupListFilesets({requestBody:{BackupId:i}}).pipe(Re(t=>{let o=t?.error?.body?.StatusCode??t?.error?.requestBody?.StatusCode;return o==="EncryptedStorageNoPassphrase"||o==="FolderMissing"||o==="EmptyRemoteFolder"||e===0?Ne(()=>t):he(1e3).pipe(Ie(()=>this.loadFilesetsWithRetryv2(i,e-1)))}))}getBackup(){let i=this.backupId();this.versionOptionsLoading.set(!0),this.#n.hasV2ListOperations()?ae([this.#i.getApiV1BackupById({id:i}),this.loadFilesetsWithRetryv2(i)]).pipe(Q(1),h(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,t])=>{if(t.Error)throw new Error(t.Error);if(!(e.Backup?.IsTemporary??!0)&&e?.Backup?.DBPathExists===!1){this.#o.open(y,{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:n=>{this.#e.navigate(["/backup",i,"database"])}});return}this.versionOptions.set((t.Data??[]).map(n=>({Version:n.Version??-1,IsFullBackup:n.IsFullBackup??void 0,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(e)},error:e=>{let t=e?.error?.body?.StatusCode??e?.error?.requestBody?.StatusCode,o=t==="EncryptedStorageNoPassphrase",n=t==="FolderMissing",a=t==="EmptyRemoteFolder",g=$localize`An error occurred while loading the backup filesets: ${e.message}`;o&&(g=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),n&&(g=$localize`The backup storage folder was not found.`),a&&(g=$localize`The backup storage folder does not contain any filesets.`),this.#o.open(y,{data:{title:$localize`Failed to load backup filesets`,message:g,confirmText:$localize`OK`,cancelText:void 0},closed:N=>{this.#e.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):ae([this.#i.getApiV1BackupById({id:i}),this.#i.getApiV1BackupByIdFilesets({id:i}).pipe(Pe(3))]).pipe(Q(1),h(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,t])=>{this.versionOptions.set(t.map(o=>({Version:o.Version??-1,IsFullBackup:(o.IsFullBackup??1)==1,Time:o.Time??"<missing>",FileCount:o.FileCount??void 0,FileSizes:o.FileSizes??void 0}))),this.backup.set(e)}})}#c(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||s)};static \u0275prov=Me({token:s,factory:s.\u0275fac,providedIn:"root"})};function mt(s,i){if(s&1&&(r(0,"app-file-tree",29)(1,"label",31),k(2,"Path"),l(),u(3,"input",32),l()),s&2){let e,t=E(2);S("disabled",((e=t.optionsFormSignal())==null?null:e.restoreFrom)!=="pickLocation")("enableCreateFolder",!0)}}function gt(s,i){if(s&1&&(r(0,"app-file-tree",30)(1,"label",31),k(2,"Path"),l(),u(3,"input",32),l()),s&2){let e=E(2);S("office365Mode",!0)("backupId",e.backupId())("destinationUrl",e.office365destinationUrl())}}function Ft(s,i){if(s&1){let e=G();r(0,"sh-radio",25),d(1,5),u(2,"input",26),m(),l(),r(3,"sh-radio",25),d(4,6),r(5,"input",27),f("click",function(){R(e);let o=E();return P(o.chooseOfficeTenant())}),l(),m(),l(),r(6,"sh-radio",25),d(7,7),u(8,"input",28),m(),l(),O(9,mt,4,2,"app-file-tree",29),O(10,gt,4,3,"app-file-tree",30)}if(s&2){let e,t=E();p(9),C(((e=t.optionsFormSignal())==null?null:e.restoreFrom)==="pickLocation"?9:-1),p(),C(t.showOffice365RestoreTree()?10:-1)}}function St(s,i){if(s&1&&(r(0,"sh-radio",25),d(1,8),u(2,"input",33),m(),l(),r(3,"sh-radio",25),d(4,9),u(5,"input",28),m(),l(),r(6,"app-file-tree",29)(7,"label",31),k(8,"Path"),l(),u(9,"input",32),l()),s&2){let e,t=E();p(6),S("disabled",((e=t.optionsFormSignal())==null?null:e.restoreFrom)!=="pickLocation")("enableCreateFolder",!0)}}function Tt(s,i){s&1&&(r(0,"app-toggle-card",20),v(1,21),T(2,10),A(),r(3,"sh-toggle",25),d(4,11),u(5,"input",34),m(),l()()),s&2&&S("disallowToggle",!0)}function Et(s,i){s&1&&(r(0,"app-toggle-card",20),v(1,21),T(2,12),A(),r(3,"sh-radio",25),d(4,13),u(5,"input",35),m(),l(),r(6,"sh-radio",25),d(7,14),u(8,"input",36),m(),l()(),r(9,"app-toggle-card"),v(10,21),T(11,15),A(),r(12,"sh-toggle",37),d(13,16),u(14,"input",38),m(),l(),r(15,"sh-toggle",37),d(16,17),u(17,"input",39),m(),l()()),s&2&&S("disallowToggle",!0)}var x=new U,st=()=>x.group({restoreFrom:x.control("original"),restoreFromPath:x.control(""),handleExisting:x.control("saveTimestamp"),permissions:x.control(!1),includeMetadata:x.control(!0),officeIgnoreExisting:x.control(!1)}),me=class s{#e=c($);#t=c(D);#n=c(L);#o=c(K);#i=c(se);optionsForm=this.#e.optionsForm;optionsFormSignal=this.#e.optionsFormSignal;isSubmitting=this.#e.isSubmitting;extendedData=this.#e.extendedDataType;office365CustomTargetUrl=_(null);backupId=I(()=>this.#e.backup()?.Backup?.ID??null);hasOffice365Data=I(()=>this.extendedData()==="o365");office365SourceUrl=I(()=>{let i=this.#e.backup()?.Backup?.Sources?.filter(t=>t.startsWith("@")&&t.includes("|office365"))[0];if(!i)return null;let e=i.split("|");return e.length>=2?e[1]:null});office365destinationUrl=I(()=>{let i=this.optionsFormSignal()?.restoreFrom,e=this.hasOffice365Data();return i==="same-o365"&&e?this.office365SourceUrl():i==="other-o365"&&e?this.office365CustomTargetUrl():null});showOffice365RestoreTree=I(()=>!!(this.optionsFormSignal()?.restoreFrom==="same-o365"&&this.office365destinationUrl()&&this.backupId()||this.optionsFormSignal()?.restoreFrom==="other-o365"&&this.office365destinationUrl()));isOffice365Restore=I(()=>{let i=this.optionsFormSignal()?.restoreFrom;return i==="same-o365"||i==="other-o365"});chooseOfficeTenant(){return this.#i.open(Qe,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{targetUrlModel:this.office365CustomTargetUrl()||this.office365SourceUrl()||"office365://",moduleType:"RestoreDestinationProvider"}}).closed.subscribe(e=>{e&&(this.office365CustomTargetUrl.set(e),this.optionsForm.controls.restoreFrom.setValue("other-o365"))}),!1}#s=M(()=>{let i=this.optionsFormSignal()?.restoreFrom;this.hasOffice365Data()&&(i==="original"||i===void 0)&&(this.optionsForm.controls.restoreFrom.setValue("pickLocation"),this.optionsForm.controls.handleExisting.setValue("overwrite")),!this.hasOffice365Data()&&(i==="same-o365"||i==="other-o365")&&(this.optionsForm.controls.restoreFrom.setValue("original"),this.optionsForm.controls.handleExisting.setValue("saveTimestamp"))});goBack(){this.#t.navigate(["select-files"],{relativeTo:this.#n.parent})}submit(){let i=this.#e.selectFilesFormSignal()?.filesToRestore??[];if(i.length>0&&this.optionsFormSignal()?.restoreFrom=="original"&&(i[0].includes("/")?"/":"\\")!==this.#o.systemInfo()?.DirectorySeparator){this.#i.open(y,{data:{title:$localize`Confirm target folder`,message:$localize`This backup was created on another operating system. Restoring files without specifying a destination folder can cause files to be restored in unexpected places. Are you sure you want to continue without choosing a destination folder?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:o=>{o&&this.#e.submit()}});return}if(this.optionsFormSignal()?.restoreFrom==="same-o365"||this.optionsFormSignal()?.restoreFrom==="other-o365"){let t=this.optionsFormSignal()?.restoreFromPath;if(t&&t.startsWith("/")&&(t=t.substring(1)),!t||t.trim()===""){this.#i.open(y,{data:{title:$localize`No path specified`,message:$localize`Please choose a path to restore to in the Office 365 tenant.`,confirmText:$localize`OK`,cancelText:void 0}});return}let o=this.optionsFormSignal()?.officeIgnoreExisting,n=this.office365destinationUrl()?.substring(this.office365destinationUrl().indexOf("?")),a=`@office365://${t}${n}&office365-ignore-existing=${o?"true":"false"}`;this.#e.setAlternateRestorePath(a),this.optionsForm.controls.includeMetadata.setValue(!0),this.optionsForm.controls.permissions.setValue(!0)}else this.#e.setAlternateRestorePath(null);this.#e.submit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=w({type:s,selectors:[["app-advanced-options-settings"]],decls:18,vars:6,consts:()=>{let i;i=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let t;t=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `;let n;n=$localize` Same Office 365 Tenant ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let a;a=$localize` Different Office 365 Tenant ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let g;g=$localize` Local file system ${"\uFFFD#8\uFFFD\uFFFD/#8\uFFFD"}:TAG_INPUT:`;let N;N=$localize` Original location ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let b;b=$localize` Pick location ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let Z;Z=$localize`Restore settings`;let ge;ge=$localize` Ignore existing resources in the destination ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let Fe;Fe=$localize`How do you want to handle existing files?`;let Se;Se=$localize` Overwrite ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let Te;Te=$localize` Save different versions with timestamp in file name ${"\uFFFD#8\uFFFD\uFFFD/#8\uFFFD"}:TAG_INPUT:`;let Ee;Ee=$localize`Metadata settings`;let fe;fe=$localize` Restore file metadata ${"\uFFFD#14\uFFFD\uFFFD/#14\uFFFD"}:TAG_INPUT:`;let Oe;return Oe=$localize` Restore read/write permissions ${"\uFFFD#17\uFFFD\uFFFD/#17\uFFFD"}:TAG_INPUT:`,[["formRef",""],i,e,t,o,n,a,g,N,b,Z,ge,Fe,Se,Te,Ee,fe,Oe,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],[1,"raised","primary"],["type","radio","name","restoreFrom","value","same-o365","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","other-o365","formControlName","restoreFrom",3,"click"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled","enableCreateFolder"],[3,"office365Mode","backupId","destinationUrl"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","restoreFrom","value","original","formControlName","restoreFrom"],["type","checkbox","formControlName","officeIgnoreExisting"],["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"]]},template:function(e,t){if(e&1){let o=G();r(0,"form",18,0),f("submit",function(){return R(o),P(t.submit())}),r(2,"h3",19),T(3,1),l(),r(4,"app-toggle-card",20),v(5,21),T(6,2),A(),O(7,Ft,11,2)(8,St,10,2),l(),O(9,Tt,6,1,"app-toggle-card",20)(10,Et,18,1),r(11,"div",22)(12,"button",23),f("click",function(){return R(o),P(t.goBack())}),d(13,3),u(14,"sh-icon"),m(),l(),r(15,"button",24),d(16,4),u(17,"sh-icon"),m(),l()()()}e&2&&(S("formGroup",t.optionsForm),p(4),S("disallowToggle",!0),p(3),C(t.hasOffice365Data()?7:8),p(2),C(t.isOffice365Restore()?9:10),p(6),$e("loader",t.isSubmitting()))},dependencies:[Y,z,B,we,Ve,V,W,X,J,Ke,re,He,Xe,j,H],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{st as a,me as b,ot as c,ce as d,nt as e,de as f,$ as g};
package/chunk-LPAIFT5I.js DELETED
@@ -1,11 +0,0 @@
1
- import{b as Pt,c as yt,d as Ot,e as Nn}from"./chunk-MUFBZIQA.js";import{a as Cn,b as ve,c as At,d as gn,e as Tn,f as It,h as Sn,i as fn,j as En}from"./chunk-IMHM7ISI.js";import{a as hn,b as Vt,c as Fn}from"./chunk-6LAXPU22.js";import{a as mn}from"./chunk-TL4WOQKT.js";import{a as Q}from"./chunk-HSHF5HR7.js";import{a as Dt}from"./chunk-D6IP567E.js";import{a as pn,b as Ge}from"./chunk-VDSX2M4H.js";import{a as fe}from"./chunk-HUZXJWCG.js";import{B as ie,C as cn,E as St,F as dn,H as Se,K as ft,L as Et,O as un,P as $e,V as ht,W as je,Y as Ft,a as ln,b as _t,c as re,d as ct,e as se,f as dt,h as rn,i as ge,j as ut,k as pt,n as sn,o as _n,p as mt,q as Ct,r as gt,s as Te,t as He,u as ne,w as Tt,z as Le}from"./chunk-UNMDSCAN.js";import{c as Nt}from"./chunk-CFNARBNK.js";import{b as We,d as Re,e as an}from"./chunk-I27PVH6D.js";import{_ as on}from"./chunk-7AVOHYTE.js";import{$ as m,Ab as r,Ac as st,Bb as A,D as jt,E as Be,Fb as ae,Gb as Z,Gc as Ve,Hb as ee,Ib as N,K as qt,M as Yt,Ma as rt,Mc as O,Pa as _,Pb as I,Qb as P,Qc as Ue,R as xe,Rb as x,Rc as Y,Sc as Xe,Ub as Ze,Uc as we,Vb as h,W as y,Xb as s,Yb as Ke,Zb as ye,aa as C,cb as X,cc as ze,da as Qt,dc as Je,ec as H,f as lt,fc as tn,gc as Ce,hb as z,jc as p,kb as Zt,kc as et,l as Wt,la as F,lc as B,mc as tt,na as oe,oc as $,p as Ht,pc as R,qc as G,rb as en,rc as ce,sb as T,sc as j,tb as S,tc as f,ub as Ne,uc as bt,wb as De,wc as nn,xb as Ae,xc as Oe,yb as d,yc as te,zb as l,zc as de}from"./chunk-26Z7TPJB.js";import{a as W,b as me}from"./chunk-7CGTOI24.js";var Mt=class n{fromString(t){if(!t)return null;let e=t.match(/(\d+)([smhDWMY])/);return e&&{value:parseInt(e[1]),unit:e[2]}}toString(t,e){return`${t}${e}`}static \u0275fac=function(e){return new(e||n)};static \u0275prov=xe({token:n,factory:n.\u0275fac,providedIn:"root"})};function nt(n){if(Zt(n))return n();if(Array.isArray(n))return n.map(t=>nt(t));if(typeof n=="object"&&n!==null){let t={};for(let e in n)n.hasOwnProperty(e)&&(t[e]=nt(n[e]));return t}return n}function On(n,t){if(n&1){let e=N();l(0,"div",26)(1,"sh-form-field")(2,"label",27),x(3,7),r(),l(4,"input",28,0),G("ngModelChange",function(o){m(e);let a=s(2);return R(a.scheduleFields.nextTime.time,o)||(a.scheduleFields.nextTime.time=o),C(o)}),r(),l(6,"sh-icon",29),p(7,"clock"),r()(),l(8,"sh-datepicker-input",30)(9,"label",31),p(10,"\xA0"),r(),l(11,"input",32,1),G("ngModelChange",function(o){m(e);let a=s(2);return R(a.scheduleFields.nextTime.date,o)||(a.scheduleFields.nextTime.date=o),C(o)}),r(),l(13,"sh-icon",29),p(14,"calendar"),r()()(),l(15,"div",26)(16,"sh-form-field")(17,"label",33),x(18,8),r(),l(19,"input",34),G("ngModelChange",function(o){m(e);let a=s(2);return R(a.scheduleFields.runAgain.repeatValue,o)||(a.scheduleFields.runAgain.repeatValue=o),C(o)}),r()(),l(20,"sh-select",35)(21,"input",36),G("ngModelChange",function(o){m(e);let a=s(2);return R(a.scheduleFields.runAgain.repeatUnit,o)||(a.scheduleFields.runAgain.repeatUnit=o),C(o)}),r()()(),l(22,"sh-toggle-card",37),ae(23,38),x(24,9),Z(),l(25,"div",39)(26,"sh-toggle",24),I(27,10),l(28,"input",25),G("ngModelChange",function(o){m(e);let a=s(2);return R(a.scheduleFields.runAgain.allowedDays.mon,o)||(a.scheduleFields.runAgain.allowedDays.mon=o),C(o)}),r(),P(),r(),l(29,"sh-toggle",24),I(30,11),l(31,"input",25),G("ngModelChange",function(o){m(e);let a=s(2);return R(a.scheduleFields.runAgain.allowedDays.tue,o)||(a.scheduleFields.runAgain.allowedDays.tue=o),C(o)}),r(),P(),r(),l(32,"sh-toggle",24),I(33,12),l(34,"input",25),G("ngModelChange",function(o){m(e);let a=s(2);return R(a.scheduleFields.runAgain.allowedDays.wed,o)||(a.scheduleFields.runAgain.allowedDays.wed=o),C(o)}),r(),P(),r(),l(35,"sh-toggle",24),I(36,13),l(37,"input",25),G("ngModelChange",function(o){m(e);let a=s(2);return R(a.scheduleFields.runAgain.allowedDays.thu,o)||(a.scheduleFields.runAgain.allowedDays.thu=o),C(o)}),r(),P(),r(),l(38,"sh-toggle",24),I(39,14),l(40,"input",25),G("ngModelChange",function(o){m(e);let a=s(2);return R(a.scheduleFields.runAgain.allowedDays.fri,o)||(a.scheduleFields.runAgain.allowedDays.fri=o),C(o)}),r(),P(),r(),l(41,"sh-toggle",24),I(42,15),l(43,"input",25),G("ngModelChange",function(o){m(e);let a=s(2);return R(a.scheduleFields.runAgain.allowedDays.sat,o)||(a.scheduleFields.runAgain.allowedDays.sat=o),C(o)}),r(),P(),r(),l(44,"sh-toggle",24),I(45,16),l(46,"input",25),G("ngModelChange",function(o){m(e);let a=s(2);return R(a.scheduleFields.runAgain.allowedDays.sun,o)||(a.scheduleFields.runAgain.allowedDays.sun=o),C(o)}),r(),P(),r()()()}if(n&2){let e=s(2);_(4),$("ngModel",e.scheduleFields.nextTime.time),_(7),$("ngModel",e.scheduleFields.nextTime.date),_(8),$("ngModel",e.scheduleFields.runAgain.repeatValue),_(),d("options",e.unitOptions)("isClearable",!1),_(),$("ngModel",e.scheduleFields.runAgain.repeatUnit),_(),d("disallowToggle",!0),_(6),$("ngModel",e.scheduleFields.runAgain.allowedDays.mon),_(3),$("ngModel",e.scheduleFields.runAgain.allowedDays.tue),_(3),$("ngModel",e.scheduleFields.runAgain.allowedDays.wed),_(3),$("ngModel",e.scheduleFields.runAgain.allowedDays.thu),_(3),$("ngModel",e.scheduleFields.runAgain.allowedDays.fri),_(3),$("ngModel",e.scheduleFields.runAgain.allowedDays.sat),_(3),$("ngModel",e.scheduleFields.runAgain.allowedDays.sun)}}function Mn(n,t){if(n&1){let e=N();l(0,"div",23)(1,"sh-toggle",24),I(2,5),l(3,"input",25),G("ngModelChange",function(o){m(e);let a=s();return R(a.scheduleFields.autoRun,o)||(a.scheduleFields.autoRun=o),C(o)}),r(),P(),r(),l(4,"p"),x(5,6),r()(),T(6,On,47,14)}if(n&2){let e=s();_(3),$("ngModel",e.scheduleFields.autoRun),_(3),S(e.scheduleFields.autoRun()?6:-1)}}var xn=[{key:"s",label:$localize`Seconds`},{key:"m",label:$localize`Minutes`},{key:"h",label:$localize`Hours`},{key:"D",label:$localize`Days`},{key:"W",label:$localize`Weeks`},{key:"M",label:$localize`Months`},{key:"Y",label:$localize`Years`}],xt=[{key:$localize`Daily 13:00`,value:"daily",data:{autoRun:!0,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!0,sun:!0}}}},{key:$localize`Weekdays 13:00`,value:"weekdays",data:{autoRun:!0,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!1,sun:!1}}}},{key:$localize`Weekly monday 13:00`,value:"weekly",data:{autoRun:!0,nextTime:{time:"13:00:00",date:wn().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"W",allowedDays:{mon:!0,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}}},{key:$localize`Don't run automatically`,value:"disabled",data:{autoRun:!1,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!0,sun:!0}}}},{key:$localize`Custom`,value:"custom",data:{autoRun:!0,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!0,sun:!0}}}}];function Dn(n){if(!n.autoRun)return null;let t=[n.runAgain.allowedDays.mon?"Monday":null,n.runAgain.allowedDays.tue?"Tuesday":null,n.runAgain.allowedDays.wed?"Wednesday":null,n.runAgain.allowedDays.thu?"Thursday":null,n.runAgain.allowedDays.fri?"Friday":null,n.runAgain.allowedDays.sat?"Saturday":null,n.runAgain.allowedDays.sun?"Sunday":null].filter(c=>c!==null),e=n.nextTime.time.split(":"),i=new Date(n.nextTime.date);i.setHours(parseInt(e[0])),i.setMinutes(parseInt(e[1]));let o=n.runAgain.repeatValue,a=n.runAgain.repeatUnit;return{Time:i.toISOString(),Repeat:`${o}${a}`,AllowedDays:t}}function wn(){let n=new Date,t=n.getDay(),e=t===1?7:(8-t)%7;return n.setDate(n.getDate()+e),n.setHours(12,0,0,0),n}var kt=()=>({autoRun:F(!0),nextTime:{time:F("13:00"),date:F(new Date().toISOString().split("T")[0])},runAgain:{repeatValue:F(1),repeatUnit:F("D"),allowedDays:{mon:F(!0),tue:F(!0),wed:F(!0),thu:F(!0),fri:F(!0),sat:F(!0),sun:F(!0)}}}),Ut=class n{#e=y(Pe);#t=y(Re);#n=y(We);unitOptions=xn;scheduleFields=this.#e.scheduleFields;scheduleType=this.#e.scheduleType;scheduleOptions=xt;updateScheduleType(t){let e=xt.find(i=>i.value===t);if(e&&e?.value!=="custom"){this.scheduleType.set(e.value);let i=e.data;this.scheduleFields.autoRun.set(i.autoRun??!1),this.scheduleFields.nextTime.time.set(i.nextTime?.time??"13:00"),this.scheduleFields.nextTime.date.set(i.nextTime?.date??new Date().toISOString().split("T")[0]),this.scheduleFields.runAgain.repeatValue.set(i.runAgain?.repeatValue??1),this.scheduleFields.runAgain.repeatUnit.set(i.runAgain?.repeatUnit??"D"),this.scheduleFields.runAgain.allowedDays.mon.set(i.runAgain?.allowedDays?.mon??!0),this.scheduleFields.runAgain.allowedDays.tue.set(i.runAgain?.allowedDays?.tue??!0),this.scheduleFields.runAgain.allowedDays.wed.set(i.runAgain?.allowedDays?.wed??!0),this.scheduleFields.runAgain.allowedDays.thu.set(i.runAgain?.allowedDays?.thu??!0),this.scheduleFields.runAgain.allowedDays.fri.set(i.runAgain?.allowedDays?.fri??!0),this.scheduleFields.runAgain.allowedDays.sat.set(i.runAgain?.allowedDays?.sat??!0),this.scheduleFields.runAgain.allowedDays.sun.set(i.runAgain?.allowedDays?.sun??!0)}else this.scheduleType.set("custom")}goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#n.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["options"],{relativeTo:this.#n.parent})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=X({type:n,selectors:[["app-schedule"]],decls:12,vars:4,consts:()=>{let t;t=$localize`Select an option...`;let e;e=$localize`Schedule`;let i;i=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let a;a=$localize` Automatically run backups ${"\uFFFD#3\uFFFD\uFFFD/#3\uFFFD"}:TAG_INPUT:`;let c;c=$localize`If a date was missed, the job will run as soon as possible.`;let u;u=$localize`Next time`;let g;g=$localize`Run again every`;let E;E=$localize`Allowed days`;let v;v=$localize` Monday ${"\uFFFD#28\uFFFD\uFFFD/#28\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Tuesday ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let q;q=$localize` Wednesday ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let L;L=$localize` Thursday ${"\uFFFD#37\uFFFD\uFFFD/#37\uFFFD"}:TAG_INPUT:`;let D;D=$localize` Friday ${"\uFFFD#40\uFFFD\uFFFD/#40\uFFFD"}:TAG_INPUT:`;let b;b=$localize` Saturday ${"\uFFFD#43\uFFFD\uFFFD/#43\uFFFD"}:TAG_INPUT:`;let V;return V=$localize` Sunday ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],e,i,o,a,c,u,g,E,v,K,q,L,D,b,V,[1,"title-30"],["label","key","value","value",3,"isClearable","options"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"row-inputs"],["for","time"],["type","time","id","time",3,"ngModelChange","ngModel"],["suffix",""],[1,"primary","sharp"],["for","date"],["type","text","id","date",3,"ngModelChange","ngModel"],["for","repeatValue"],["type","number","id","repeatValue",3,"ngModelChange","ngModel"],["value","key","label","label",3,"options","isClearable"],["type","text","id","repeatUnit",3,"ngModelChange","ngModel"],[3,"disallowToggle"],["title",""],[1,"days-wrap"]]},template:function(e,i){e&1&&(l(0,"h3",17),x(1,2),r(),l(2,"sh-select",18)(3,"input",19),h("ngModelChange",function(a){return i.updateScheduleType(a)}),r()(),T(4,Mn,7,2),l(5,"div",20)(6,"button",21),h("click",function(){return i.goBack()}),I(7,3),A(8,"sh-icon"),P(),r(),l(9,"button",22),h("click",function(){return i.next()}),I(10,4),A(11,"sh-icon"),P(),r()()),e&2&&(_(2),d("isClearable",!1)("options",i.scheduleOptions),_(),d("ngModel",i.scheduleType()),_(),S(i.scheduleType()==="custom"?4:-1))},dependencies:[Te,re,pt,_t,se,ge,Se,je,ne,ie,$e,ht,dn],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 1.5rem;display:flex;flex-direction:column;gap:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var Rn=[[["","title",""]],[["","description",""]],[["","action",""]],"*"],Ln=["[title]","[description]","[action]","*"];function $n(n,t){n&1&&p(0,"Title")}function Gn(n,t){n&1&&(l(0,"sh-icon"),p(1,"caret-down"),r())}var it=class n{isActive=we(!1);disallowToggle=Y(!1);ngOnInit(){this.disallowToggle()&&this.isActive.set(!0)}toggle(){this.isActive.set(!this.isActive())}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=X({type:n,selectors:[["app-toggle-card"]],hostVars:2,hostBindings:function(e,i){e&2&&Ce("active",i.isActive())},inputs:{isActive:[1,"isActive"],disallowToggle:[1,"disallowToggle"]},outputs:{isActive:"isActiveChange"},ngContentSelectors:Ln,decls:11,vars:1,consts:[[1,"title"],[3,"click"],[1,"actions"],[1,"content"]],template:function(e,i){e&1&&(Ke(Rn),l(0,"header")(1,"div",0)(2,"h3",1),h("click",function(){return i.disallowToggle()||i.toggle()}),ye(3,0,null,$n,1,0),T(5,Gn,2,0,"sh-icon"),r(),ye(6,1),r(),l(7,"div",2),ye(8,2),r()(),l(9,"div",3),ye(10,3),r()),e&2&&(_(5),S(i.disallowToggle()?-1:5))},dependencies:[ne],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;border-radius:var(--shape-3);background-color:var(--base-2)}.active[_nghost-%COMP%] .content[_ngcontent-%COMP%]{max-height:1000px;transition:max-height 1s linear;padding:0 1rem 1rem}.active[_nghost-%COMP%] sh-icon[_ngcontent-%COMP%]{transform:rotate(180deg)}[_nghost-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;font:var(--paragraph-10);cursor:pointer;-webkit-user-select:none;user-select:none}[_nghost-%COMP%] sh-icon[_ngcontent-%COMP%]{transform:rotate(0);transform-origin:center;transition:transform .2s ease}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem}header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;flex:1 0}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]:empty{display:none}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0 1rem;overflow:hidden;max-height:0;transition:max-height .25s linear,padding .25s linear}.content[_ngcontent-%COMP%]:empty{display:none}"],changeDetection:0})};var be=class n{#e=y(fe);#t(t){return t.flatMap(e=>{if(!e?.Key)return null;let i=gn(e.Key);if(i.length<=1){let o=At(e.Key);return o.isDefaultEntry===!0?[me(W({},o),{displayName:e.DisplayName||o.displayName||e.Key,description:e.Description||o.description||""})]:o}else return i}).filter(e=>e!==null)}#n(t){return t.map(e=>({key:e.customKey??e.key,customKey:e.customKey??null,displayName:e.displayName,description:e.description,icon:e.icon,searchTerms:[e.displayName,e.description,e.key,e.searchTerms??"",e.customKey??""].join(" "),sortOrder:e.sortOrder??0}))}backendDestinationOptions=O(()=>{let t=this.#e.backendModules(),e=this.#t(t);return this.#n(e)});sourceProviderOptions=O(()=>{let t=this.#e.sourceProviderModules(),e=this.#t(t.length?t:this.#e.backendModules());return this.#n(e)});restoreDestinationOptions=O(()=>{let t=this.#e.restoreDestinationProviderModules(),e=this.#t(t.length?t:this.#e.backendModules());return this.#n(e)});destinationTypeOptions=this.backendDestinationOptions;allModules=O(()=>[...this.#e.backendModules(),...this.#e.sourceProviderModules(),...this.#e.restoreDestinationProviderModules()].reduce((t,e)=>(t.find(i=>i.Key===e.Key)||t.push(e),t),[]));static \u0275fac=function(e){return new(e||n)};static \u0275prov=xe({token:n,factory:n.\u0275fac,providedIn:"root"})};function vn(n,t){if(n&1){let e=N();l(0,"sh-select",2)(1,"input",6),G("ngModelChange",function(o){m(e);let a=s();return R(a.internalPath,o)||(a.internalPath=o),C(o)}),h("ngModelChange",function(){m(e);let o=s();return C(o.updateFilter())}),r()()}if(n&2){let e=s();d("options",e.fileGroupOptions())("isClearable",!1)("selectMultiple",!0),_(),$("ngModel",e.internalPath)}}function bn(n,t){if(n&1&&(ae(0,7),p(1),Z()),n&2){let e,i=s(2);_(),et((e=i.currentExpressionOption())==null?null:e.startsWith)}}function Vn(n,t){if(n&1&&(ae(0,8),p(1),Z()),n&2){let e,i=s(2);_(),et((e=i.currentExpressionOption())==null?null:e.endsWith)}}function Un(n,t){if(n&1){let e=N();l(0,"sh-form-field",3)(1,"input",6),G("ngModelChange",function(o){m(e);let a=s();return R(a.internalPath,o)||(a.internalPath=o),C(o)}),h("ngModelChange",function(){m(e);let o=s();return C(o.updateFilter())}),r(),T(2,bn,2,1,"ng-container",7),T(3,Vn,2,1,"ng-container",8),r()}if(n&2){let e,i,o=s();_(),$("ngModel",o.internalPath),_(),S(!((e=o.currentExpressionOption())==null||e.startsWith==null)&&e.startsWith.length?2:-1),_(),S(!((i=o.currentExpressionOption())==null||i.endsWith==null)&&i.endsWith.length?3:-1)}}var kn=[{key:"Applications",value:"Applications"},{key:"CacheFiles",value:"Cache Files"},{key:"TemporaryFiles",value:"Temporary Files"},{key:"OperatingSystem",value:"Operating System"},{key:"SystemFiles",value:"System Files"},{key:"DefaultExcludes",value:"Standard Excludes"}],Bn=[{key:"Excludes folders where name contains",value:"-FolderName"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileName"},{key:"Excludes file extension",value:"-Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Exclude file groups",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"},{key:"None",value:"-Unknown"}],wt=class n{path=Y.required();osType=Y();pathChange=Ue();remove=Ue();internalPath=F("");pathType=F("-Expression");currentExpressionOption=O(()=>{let t=this.pathType();return this.expressionOptions().find(e=>e.value===t)});fileGroupOptions=F(kn);expressionOptions=O(()=>{let e=this.osType()==="Windows"?"\\":"/";return Bn.map(i=>i.value==="-Folder"||i.value==="+Folder"?me(W({},i),{startsWith:"",endsWith:""}):i.value==="-FolderName"||i.value==="+FolderName"?me(W({},i),{startsWith:"*",endsWith:`*${e}`}):i.value==="-FileName"||i.value==="+FileName"?me(W({},i),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):i.value==="-FileGroup"||i.value==="+FileGroup"?me(W({},i),{startsWith:"{",endsWith:"}"}):i.value==="-Regex"||i.value==="+Regex"?me(W({},i),{startsWith:"[",endsWith:"]"}):i.value==="-Extension"||i.value==="+Extension"?me(W({},i),{startsWith:"*.",endsWith:""}):me(W({},i),{startsWith:"",endsWith:""}))});pathEffect=oe(()=>{let t=this.path(),e=t.slice(1),i=t.startsWith("-")?"-":"+",o=this.osType()==="Windows",a=o?"\\":"/";e.startsWith("%")&&e.endsWith(a)||o&&e.slice(2).startsWith(a)&&e.endsWith(a)||e.startsWith(a)&&e.endsWith(a)?(this.pathType.set(`${i}Folder`),this.internalPath.set(e)):e.startsWith("*")&&e.endsWith(`*${a}`)?(this.pathType.set(`${i}FolderName`),this.internalPath.set(e.slice(1,-2))):e.startsWith("[.*")&&e.endsWith(`[^\\${a}]*]`)?(this.pathType.set(`${i}FileName`),this.internalPath.set(e.slice(3,-7))):e.startsWith("{")&&e.endsWith("}")?(this.pathType.set(`${i}FileGroup`),this.internalPath.set(e.slice(1,-1))):e.startsWith("[")&&e.endsWith("]")?(this.pathType.set(`${i}Regex`),this.internalPath.set(e.slice(1,-1))):e.startsWith("*.")?(this.pathType.set(`${i}Extension`),this.internalPath.set(e.slice(2))):(this.pathType.set(`${i}Expression`),this.internalPath.set(e))});updateFilter(){let t=this.internalPath(),e=this.currentExpressionOption();t!==""&&this.pathChange.emit(`${e?.value.slice(0,1)}${e?.startsWith??""}${t}${e?.endsWith??""}`)}removeFilter(){this.remove.emit()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=X({type:n,selectors:[["app-new-filter"]],inputs:{path:[1,"path"],osType:[1,"osType"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:7,vars:4,consts:()=>{let t;return t=$localize`Select an option...`,[["value","value","label","key",3,"options","isClearable"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],["value","key","label","value",1,"expression-input",3,"options","isClearable","selectMultiple"],[1,"expression-input"],[1,"filter-removal",3,"click"],[1,"sh-primary"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],["suffix",""]]},template:function(e,i){if(e&1&&(l(0,"sh-select",0)(1,"input",1),G("ngModelChange",function(a){return R(i.pathType,a)||(i.pathType=a),a}),h("ngModelChange",function(){return i.updateFilter()}),r()(),T(2,vn,2,4,"sh-select",2)(3,Un,4,3,"sh-form-field",3),l(4,"div",4),h("click",function(){return i.removeFilter()}),l(5,"sh-icon",5),p(6,"x-circle"),r()()),e&2){let o;d("options",i.expressionOptions())("isClearable",!1),_(),$("ngModel",i.pathType),_(),S(((o=i.currentExpressionOption())==null?null:o.value)=="-FileGroup"||((o=i.currentExpressionOption())==null?null:o.value)=="+FileGroup"?2:3)}},dependencies:[Te,re,se,ge,$e,Se,ne],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}.expression-input[_ngcontent-%COMP%]{--ff-suffix-bg: var(--base-2)}.filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var Kn=["*"];function zn(n,t){n&1&&(l(0,"sh-chip",4),p(1,"Special"),r())}function Jn(n,t){n&1&&(l(0,"sh-chip",5),p(1,"Deprecated"),r())}function Xn(n,t){if(n&1&&(l(0,"sh-card",0)(1,"div",1),A(2,"img",2),r(),l(3,"div",3),p(4),T(5,zn,2,0,"sh-chip",4)(6,Jn,2,0,"sh-chip",5),r(),l(7,"div",6),p(8),r(),l(9,"div",7),ye(10),r()()),n&2){s();let e=f(0);_(2),d("src",bt(e.icon),rt)("alt",bt(e.displayName)),_(2),B(" ",e.displayName," "),_(),S((e.sortOrder??0)==-2?5:(e.sortOrder??0)<0?6:-1),_(3),et(e.description)}}var Ye=class n{destination=Y();targetUrl=Y();selectedDestinationType=O(()=>{let t=this.targetUrl();return t?ve(t)??null:null});destinationFromTargetUrl=O(()=>{let t=this.selectedDestinationType();return t?{key:t.customKey??t.key,customKey:t.customKey??null,displayName:t.displayName,description:t.description,icon:t.icon}:null});destinationItem=O(()=>{let t=this.destination(),e=this.destinationFromTargetUrl();return t||e||null});static \u0275fac=function(e){return new(e||n)};static \u0275cmp=X({type:n,selectors:[["app-destination-list-item"]],inputs:{destination:[1,"destination"],targetUrl:[1,"targetUrl"]},ngContentSelectors:Kn,decls:2,vars:2,consts:[[1,"type-b"],[1,"icon"],[3,"src","alt"],[1,"name"],[1,"small","simple","primary"],[1,"small","simple","warn"],[1,"description"],[1,"actions"]],template:function(e,i){if(e&1&&(Ke(),ce(0),T(1,Xn,11,7,"sh-card",0)),e&2){let o=j(i.destinationItem());_(),S(o?1:-1)}},dependencies:[cn,St],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 Wn(n,t){if(n&1){let e=N();l(0,"app-destination-list-item",3)(1,"button",4),h("click",function(){let o=m(e).$implicit,a=s();return C(a.setDestination.emit(o.customKey??o.key))}),I(2,0),A(3,"sh-icon"),P(),r()()}if(n&2){let e=t.$implicit;d("destination",e)}}var Rt=class n{#e=y(be);showAsSources=Y(!1);moduleType=Y("Backend");setDestination=Ue();destinationSearchTerm=F("");destinationTypeOptions=O(()=>{switch(this.moduleType()){case"SourceProvider":return this.#e.sourceProviderOptions();case"RestoreDestinationProvider":return this.#e.restoreDestinationOptions();default:return this.#e.backendDestinationOptions()}});destinationTypeOptionsFocused=O(()=>{let t=this.destinationTypeOptions(),e=this.destinationSearchTerm().toLowerCase(),i=[...t].sort((o,a)=>{let c=o.sortOrder??0,u=a.sortOrder??0;return c!==u?u-c:o.displayName.localeCompare(a.displayName)}).filter(o=>{let a=o.sortOrder??0;return a<0&&e?.length&&(o.key.toLocaleLowerCase()===e.toLocaleLowerCase()||o.customKey?.toLocaleLowerCase()===e.toLocaleLowerCase())?!0:a>=0});return e?i.filter(o=>o.searchTerms.toLowerCase().includes(e)):i});static \u0275fac=function(e){return new(e||n)};static \u0275cmp=X({type:n,selectors:[["app-destination-list"]],inputs:{showAsSources:[1,"showAsSources"],moduleType:[1,"moduleType"]},outputs:{setDestination:"setDestination"},decls:5,vars:1,consts:()=>{let t;t=$localize`Search for destination...`;let e;return e=$localize` Choose ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`,[e,["type","text","placeholder",t,3,"ngModelChange","ngModel"],[1,"list"],[3,"destination"],["shButton","","type","button",3,"click"]]},template:function(e,i){e&1&&(l(0,"sh-form-field")(1,"input",1),G("ngModelChange",function(a){return R(i.destinationSearchTerm,a)||(i.destinationSearchTerm=a),a}),r()(),l(2,"div",2),De(3,Wn,4,1,"app-destination-list-item",3,Ne),r()),e&2&&(_(),$("ngModel",i.destinationSearchTerm),_(2),Ae(i.destinationTypeOptionsFocused()))},dependencies:[Ye,Te,re,se,ge,Se,ie,ne],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 Hn=["fileInput"],jn=[[["label"]]],qn=["label"],Lt=class n{customId=Y();content=F("");readonly=F(!1);placeholder=Y("Drop a file here or use the browse button");fileInputRef=Xe("fileInput");onFileSelected(t){let e=t.target;e.files&&e.files.length>0&&this.readFile(e.files[0])}onFileDrop(t){t.preventDefault(),t.dataTransfer?.files&&t.dataTransfer.files.length>0&&this.readFile(t.dataTransfer.files[0])}onDragOver(t){t.preventDefault()}readFile(t){let e=new FileReader;e.onload=()=>{this.content.set(e.result)},e.readAsText(t)}triggerBrowse(){return this.fileInputRef()?.nativeElement.click(),!1}onChange=()=>{};onTouched=()=>{};onChangeEffect=oe(()=>{this.onChange(this.content())});writeValue(t){this.content.set(t)}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.readonly.set(t)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=X({type:n,selectors:[["app-file-drop-textarea"]],viewQuery:function(e,i){e&1&&ze(i.fileInputRef,Hn,5),e&2&&Je()},inputs:{customId:[1,"customId"],placeholder:[1,"placeholder"]},features:[nn([{provide:ln,useExisting:n,multi:!0}])],ngContentSelectors:qn,decls:9,vars:3,consts:[["fileInput",""],[1,"browse-btn"],["shButton","","type","button",1,"small","outlined",3,"click"],[1,"textarea-container","textarea-wrap",3,"drop","dragover"],["rows","10",3,"ngModelChange","placeholder","ngModel","disabled"],["type","file",1,"hidden",3,"change"]],template:function(e,i){if(e&1){let o=N();Ke(jn),ye(0,0,["ngProjectAs","label",5,["label"]]),l(1,"div",1)(2,"button",2),h("click",function(){return m(o),C(i.triggerBrowse())}),l(3,"sh-icon"),p(4,"upload"),r()()(),l(5,"div",3),h("drop",function(c){return m(o),C(i.onFileDrop(c))})("dragover",function(c){return m(o),C(i.onDragOver(c))}),l(6,"textarea",4),G("ngModelChange",function(c){return m(o),R(i.content,c)||(i.content=c),C(c)}),r()(),l(7,"input",5,0),h("change",function(c){return m(o),C(i.onFileSelected(c))}),r()}e&2&&(_(6),d("placeholder",i.placeholder()),$("ngModel",i.content),d("disabled",i.readonly()))},dependencies:[Te,re,se,ge,ne,ie],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label browsebtn" "input input";grid-template-columns:8fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .browse-btn[_ngcontent-%COMP%]{grid-area:browsebtn}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%]{grid-area:input;width:100%;border:none;font:var(--code-20)}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{width:100%;color:var(--base-8);background-color:var(--base-1);border:1px solid var(--base-4);border-radius:var(--shape-3);padding:.5rem;resize:vertical;box-shadow:var(--box-shadow-10)}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%] .dark[_ngcontent-%COMP%]{background-color:var(--base-2)}[_nghost-%COMP%] .hidden[_ngcontent-%COMP%]{display:none}'],changeDetection:0})};var Yn=(n,t,e,i)=>({index:n,fieldGroup:"custom",formView:t,destinationType:e,oauthField:i}),le=n=>({$implicit:n}),Qn=(n,t,e,i)=>({index:n,fieldGroup:"dynamic",formView:t,destinationType:e,oauthField:i}),Zn=()=>({updateOn:"blur"}),ei=(n,t,e,i)=>({index:n,formView:t,fieldGroup:"advanced",destinationType:e,oauthField:i}),Ee=(n,t)=>({fieldGroup:n,formView:t}),ti=()=>["/connect/logon"];function ni(n,t){n&1&&ee(0)}function ii(n,t){if(n&1&&z(0,ni,1,0,"ng-container",24),n&2){let e=t.$implicit,i=t.$index;s();let o=H(15);s();let a=f(0),c=f(1);d("ngTemplateOutlet",o)("ngTemplateOutletContext",te(7,le,st(2,Yn,i,e,a,c.oauthField)))}}function oi(n,t){n&1&&ee(0)}function ai(n,t){if(n&1&&z(0,oi,1,0,"ng-container",24),n&2){let e=t.$implicit,i=t.$index;s();let o=H(15);s();let a=f(0),c=f(1);d("ngTemplateOutlet",o)("ngTemplateOutletContext",te(7,le,st(2,Qn,i,e,a,c.oauthField)))}}function li(n,t){if(n&1){let e=N();l(0,"button",25),h("click",function(){m(e);let o=s(2);return C(o.showTextArea.set(!1))}),I(1,8),A(2,"sh-icon"),P(),r()}}function ri(n,t){if(n&1){let e=N();l(0,"button",32,2),h("click",function(){let o=m(e).$implicit,a=s(3);return C(a.addAdvancedOption(o))}),p(2),r()}if(n&2){let e=t.$implicit;_(2),B(" ",e.name," ")}}function si(n,t){if(n&1){let e=N();l(0,"div",22)(1,"sh-menu",26)(2,"button",27),I(3,9),A(4,"sh-icon"),P(),r(),ae(5,28),De(6,ri,3,1,"button",29,Ne),Z(),r(),l(8,"sh-menu")(9,"button",30)(10,"sh-icon"),p(11,"dots-three-vertical"),r()(),ae(12,28),l(13,"button",31),h("click",function(){m(e);let o=s(2);return C(o.showTextArea.set(!0))}),l(14,"sh-icon"),p(15,"link"),r(),p(16," Edit contents as text "),r(),Z(),r()()}if(n&2){s();let e=f(9);_(),d("searchable",!0),_(),d("disabled",e.length===0),_(4),Ae(e)}}function _i(n,t){if(n&1){let e=N();l(0,"textarea",33),h("ngModelChange",function(o){m(e);let a=s(2);return C(a.updateSettingsFromText(o))}),r()}if(n&2){let e=s(2);d("ngModel",e.settingsAsText())("ngModelOptions",Oe(2,Zn))}}function ci(n,t){n&1&&ee(0)}function di(n,t){if(n&1&&z(0,ci,1,0,"ng-container",24),n&2){let e=t.$implicit,i=t.$index;s(2);let o=H(15),a=s(),c=f(0),u=f(1),g=a.getFormView("advanced",e)??a.getDefaultFormView(e);d("ngTemplateOutlet",o)("ngTemplateOutletContext",te(7,le,st(2,ei,i,g,c,u.oauthField)))}}function ui(n,t){if(n&1&&De(0,di,1,9,"ng-container",null,Ne),n&2){let e=s(2);Ae(e.advancedFormFieldNames())}}function pi(n,t){n&1&&(l(0,"sup",42),p(1,"*"),r())}function mi(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(2).$implicit;d("shTooltip",e.formView.longDescription)}}function Ci(n,t){if(n&1){let e=N();l(0,"app-file-tree",35)(1,"label",41),T(2,pi,2,0,"sup",42),p(3),T(4,mi,2,1,"sh-icon",43),r(),l(5,"input",44),h("ngModelChange",function(o){m(e);let a=s().$implicit,c=s(2);return C(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()()}if(n&2){let e=s().$implicit,i=f(1),o=f(2),a=f(3),c=f(4),u=f(5);d("startingPath",a)("accepts",e.formView.accepts)("showFiles",!0)("hideShortcuts",!0)("showHiddenNodes",!0)("selectFiles",!0),_(),d("for",u),_(),S(e.formView.isMandatory&&c?2:-1),_(),B(" ",i," "),_(),S(e.formView.longDescription?4:-1),_(),d("id",u)("ngModel",o)}}function gi(n,t){n&1&&(l(0,"sup",45),p(1,"*"),r())}function Ti(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(2).$implicit;d("shTooltip",e.formView.longDescription)}}function Si(n,t){if(n&1){let e=N();l(0,"app-file-tree",36)(1,"label",41),T(2,gi,2,0,"sup",45),p(3),T(4,Ti,2,1,"sh-icon",43),r(),l(5,"input",44),h("ngModelChange",function(o){m(e);let a=s().$implicit,c=s(2);return C(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()()}if(n&2){let e=s().$implicit,i=f(1),o=f(2),a=f(3),c=f(4),u=f(5);d("hideShortcuts",!0)("enableCreateFolder",!0)("startingPath",a),_(),d("for",u),_(),S(e.formView.isMandatory&&c?2:-1),_(),B(" ",i," "),_(),S(e.formView.longDescription?4:-1),_(),d("id",u)("ngModel",o)}}function fi(n,t){n&1&&(l(0,"sup",46),p(1,"*"),r())}function Ei(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(2).$implicit;d("shTooltip",e.formView.longDescription)}}function hi(n,t){n&1&&(l(0,"sh-icon",47),p(1," warning "),r())}function Fi(n,t){n&1&&ee(0)}function Ni(n,t){if(n&1&&(l(0,"sh-icon",51),p(1," link "),r()),n&2){s();let e=f(8),i=f(9);Ce("error",e&&i==="error")("warn",e&&i==="warning"),d("shTooltip",e)}}function Di(n,t){n&1&&(l(0,"sh-icon",50),p(1,"envelope"),r())}function Ai(n,t){n&1&&(l(0,"sh-icon",50),p(1,"hard-drives"),r())}function Ii(n,t){n&1&&(l(0,"sh-icon",50),p(1,"jar"),r())}function Pi(n,t){n&1&&(l(0,"sh-icon",50),p(1,"textbox"),r())}function yi(n,t){if(n&1){let e=N();l(0,"sh-form-field")(1,"label",41),T(2,fi,2,0,"sup",46),p(3),T(4,Ei,2,1,"sh-icon",43),T(5,hi,2,0,"sh-icon",47),z(6,Fi,1,0,"ng-container",24),r(),l(7,"input",48),h("keydown",function(o){m(e);let a=s().$implicit,c=s(2);return C(c.onKeyDown(a.fieldGroup,a.formView.name,a.formView.type,o))})("ngModelChange",function(o){m(e);let a=s().$implicit,c=s(2);return C(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),ce(8)(9),T(10,Ni,2,5,"sh-icon",49)(11,Di,2,0,"sh-icon",50)(12,Ai,2,0,"sh-icon",50)(13,Ii,2,0,"sh-icon",50)(14,Pi,2,0,"sh-icon",50),r()}if(n&2){let e=s().$implicit,i=f(1),o=f(2),a=f(3),c=f(4),u=f(5);s();let g=H(17);_(),d("for",u),_(),S(e.formView.isMandatory&&c?2:-1),_(),B(" ",i," "),_(),S(e.formView.longDescription?4:-1),_(),S(c&&e.formView.type==="Path"?5:-1),_(),d("ngTemplateOutlet",g)("ngTemplateOutletContext",te(16,le,de(13,Ee,e.fieldGroup,e.formView))),_(),d("type",e.formView.type==="Email"?"email":"text")("id",u)("ngModel",o);let E=a,v=s().hasLeadingSlash(E??"");_(),j(v&&(e.formView.doubleSlash==null?null:e.formView.doubleSlash.message)),_(),j(e.formView.doubleSlash==null?null:e.formView.doubleSlash.type),_(),S(e.formView.type==="Path"?10:e.formView.type==="Email"?11:e.formView.type==="Hostname"?12:e.formView.type==="Bucketname"||e.formView.type==="BucketnameB2"?13:14)}}function Oi(n,t){n&1&&(l(0,"sup",52),p(1,"*"),r())}function Mi(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(2).$implicit;d("shTooltip",e.formView.longDescription)}}function xi(n,t){n&1&&ee(0)}function wi(n,t){if(n&1){let e=N();l(0,"span",56),h("click",function(){m(e);let o=s(2).$implicit,a=s(2);return C(a.oauthStartTokenCreation(o.destinationType,o.fieldGroup,o.formView.name,o.formView.oauthVersion))}),p(1," AuthID "),r()}}function Ri(n,t){n&1&&(l(0,"sh-icon",50),p(1,"password"),r())}function Li(n,t){if(n&1){let e=N();l(0,"sh-icon",57),h("click",function(){m(e);let o=s(2).$implicit;return C(o.formView.showPassword=!o.formView.showPassword)}),p(1," eye "),r()}}function $i(n,t){if(n&1){let e=N();l(0,"sh-icon",57),h("click",function(){m(e);let o=s(2).$implicit;return C(o.formView.showPassword=!o.formView.showPassword)}),p(1," eye-slash "),r()}}function Gi(n,t){if(n&1){let e=N();l(0,"sh-form-field")(1,"label",41),T(2,Oi,2,0,"sup",52),p(3),T(4,Mi,2,1,"sh-icon",43),z(5,xi,1,0,"ng-container",24),r(),l(6,"input",53),h("ngModelChange",function(o){m(e);let a=s().$implicit,c=s(2);return C(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),T(7,wi,2,0,"span",54)(8,Ri,2,0,"sh-icon",50),T(9,Li,2,0,"sh-icon",55)(10,$i,2,0,"sh-icon",55),r()}if(n&2){let e=s().$implicit,i=f(1),o=f(2),a=f(4),c=f(5);s();let u=H(17);_(),d("for",c),_(),S(e.formView.isMandatory&&a?2:-1),_(),B(" ",i," "),_(),S(e.formView.longDescription?4:-1),_(),d("ngTemplateOutlet",u)("ngTemplateOutletContext",te(14,le,de(11,Ee,e.fieldGroup,e.formView))),_(),d("type",e.formView.showPassword?"text":"password")("id",c)("ngModel",o),_(),S(e.oauthField===e.formView.name?7:8),_(2),S(e.formView.showPassword?9:10)}}function vi(n,t){n&1&&(l(0,"sup",59),p(1,"*"),r())}function bi(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(3).$implicit;d("shTooltip",e.formView.longDescription)}}function Vi(n,t){n&1&&ee(0)}function Ui(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;tt(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function ki(n,t){if(n&1){let e=N();l(0,"sh-select",58)(1,"label",41),T(2,vi,2,0,"sup",59),p(3),T(4,bi,2,1,"sh-icon",43),z(5,Vi,1,0,"ng-container",24),r(),l(6,"input",44),h("ngModelChange",function(o){m(e);let a=s(2).$implicit,c=s(2);return C(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()(),z(7,Ui,1,2,"ng-template",null,3,Ve)}if(n&2){let e=H(8);s();let i=f(0),o=s().$implicit,a=f(1),c=f(2),u=f(4),g=f(5);s();let E=H(17);d("options",i)("isClearable",!1)("optionTemplate",e),_(),d("for",g),_(),S(o.formView.isMandatory&&u?2:-1),_(),B(" ",a," "),_(),S(o.formView.longDescription?4:-1),_(),d("ngTemplateOutlet",E)("ngTemplateOutletContext",te(14,le,de(11,Ee,o.fieldGroup,o.formView))),_(),d("id",g)("ngModel",c)}}function Bi(n,t){if(n&1&&(ce(0),T(1,ki,9,16)),n&2){let e=s().$implicit,i=j(s(2).mapOptions(e.formView));_(),S(i?1:-1)}}function Ki(n,t){n&1&&(l(0,"sup",62),p(1,"*"),r())}function zi(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(3).$implicit;d("shTooltip",e.formView.longDescription)}}function Ji(n,t){n&1&&ee(0)}function Xi(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;tt(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function Wi(n,t){if(n&1){let e=N();l(0,"sh-select",61)(1,"label",41),T(2,Ki,2,0,"sup",62),p(3),T(4,zi,2,1,"sh-icon",43),z(5,Ji,1,0,"ng-container",24),r(),l(6,"input",44),h("ngModelChange",function(o){m(e);let a=s(2).$implicit,c=s(2);return C(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()(),z(7,Xi,1,2,"ng-template",null,4,Ve)}if(n&2){let e=H(8);s();let i=f(0),o=s().$implicit,a=f(1),c=f(2),u=f(4),g=f(5);s();let E=H(17);d("options",i)("asFreeText",!0)("inlineSearch",!0)("optionTemplate",e),_(),d("for",g),_(),S(o.formView.isMandatory&&u?2:-1),_(),B(" ",a," "),_(),S(o.formView.longDescription?4:-1),_(),d("ngTemplateOutlet",E)("ngTemplateOutletContext",te(15,le,de(12,Ee,o.fieldGroup,o.formView))),_(),d("id",g)("ngModel",c)}}function Hi(n,t){n&1&&A(0,"sh-progress-bar",60)}function ji(n,t){if(n&1&&(ce(0),T(1,Wi,9,17)(2,Hi,1,0,"sh-progress-bar",60)),n&2){let e=s().$implicit,i=f(2),o=j(s(2).mapOptionsWithFreeText(e.formView,i));_(),S(o?1:2)}}function qi(n,t){n&1&&(l(0,"sup",64),p(1,"*"),r())}function Yi(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(2).$implicit;d("shTooltip",e.formView.longDescription)}}function Qi(n,t){n&1&&ee(0)}function Zi(n,t){if(n&1){let e=N();l(0,"app-size",63),h("ngModelChange",function(o){m(e);let a=s().$implicit,c=s(2);return C(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),l(1,"label",41),T(2,qi,2,0,"sup",64),p(3),T(4,Yi,2,1,"sh-icon",43),z(5,Qi,1,0,"ng-container",24),r()()}if(n&2){let e=s().$implicit,i=f(1),o=f(2),a=f(4),c=f(5);s();let u=H(17);d("inputType",e.Name)("ngModel",o)("customId",c),_(),d("for",c),_(),S(e.formView.isMandatory&&a?2:-1),_(),B(" ",i," "),_(),S(e.formView.longDescription?4:-1),_(),d("ngTemplateOutlet",u)("ngTemplateOutletContext",te(12,le,de(9,Ee,e.fieldGroup,e.formView)))}}function eo(n,t){n&1&&(l(0,"sup",65),p(1,"*"),r())}function to(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(2).$implicit;d("shTooltip",e.formView.longDescription)}}function no(n,t){n&1&&ee(0)}function io(n,t){if(n&1){let e=N();l(0,"sh-form-field")(1,"label",41),T(2,eo,2,0,"sup",65),p(3),T(4,to,2,1,"sh-icon",43),z(5,no,1,0,"ng-container",24),r(),l(6,"input",66),h("ngModelChange",function(o){m(e);let a=s().$implicit,c=s(2);return C(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),l(7,"sh-icon",50),p(8,"numpad"),r()()}if(n&2){let e=s().$implicit,i=f(1),o=f(2),a=f(4),c=f(5);s();let u=H(17);_(),d("for",c),_(),S(e.formView.isMandatory&&a?2:-1),_(),B(" ",i," "),_(),S(e.formView.longDescription?4:-1),_(),d("ngTemplateOutlet",u)("ngTemplateOutletContext",te(11,le,de(8,Ee,e.fieldGroup,e.formView))),_(),d("id",c)("ngModel",o)}}function oo(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(2).$implicit;d("shTooltip",e.formView.longDescription)}}function ao(n,t){n&1&&ee(0)}function lo(n,t){if(n&1){let e=N();l(0,"sh-toggle",67),h("click",function(){m(e);let o=s().$implicit,a=f(2),c=s(2);return C(c.updateFieldValue(o.fieldGroup,o.formView.name,c.isTrue(a)?"false":"true"))}),l(1,"label",41),p(2),T(3,oo,2,1,"sh-icon",43),z(4,ao,1,0,"ng-container",24),r()()}if(n&2){let e=s().$implicit,i=f(1),o=f(2),a=f(5);s();let c=H(17),u=s();Ce("active",u.isTrue(o)),_(),d("for",a),_(),B(" ",i," "),_(),S(e.formView.longDescription?3:-1),_(),d("ngTemplateOutlet",c)("ngTemplateOutletContext",te(10,le,de(7,Ee,e.fieldGroup,e.formView)))}}function ro(n,t){n&1&&(l(0,"sup",69),p(1,"*"),r())}function so(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(3).$implicit;d("shTooltip",e.formView.longDescription)}}function _o(n,t){n&1&&ee(0)}function co(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;tt(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function uo(n,t){if(n&1){let e=N();l(0,"sh-select",68)(1,"label",41),T(2,ro,2,0,"sup",69),p(3),T(4,so,2,1,"sh-icon",43),z(5,_o,1,0,"ng-container",24),r(),l(6,"input",70),h("ngModelChange",function(o){m(e);let a=s(2).$implicit,c=s(2);return C(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()(),z(7,co,1,2,"ng-template",null,5,Ve)}if(n&2){let e=H(8);s();let i=f(0),o=s().$implicit,a=f(1),c=f(2),u=f(4),g=f(5);s();let E=H(17);d("options",i)("selectMultiple",!0)("optionTemplate",e),_(),d("for",g),_(),S(o.formView.isMandatory&&u?2:-1),_(),B(" ",a," "),_(),S(o.formView.longDescription?4:-1),_(),d("ngTemplateOutlet",E)("ngTemplateOutletContext",te(13,le,de(10,Ee,o.fieldGroup,o.formView))),_(),d("ngModel",c)}}function po(n,t){if(n&1&&(ce(0),T(1,uo,9,15)),n&2){let e=s().$implicit,i=j(s(2).mapOptions(e.formView));_(),S(i?1:-1)}}function mo(n,t){n&1&&(l(0,"sup",71),p(1,"*"),r())}function Co(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(2).$implicit;d("shTooltip",e.formView.longDescription)}}function go(n,t){n&1&&ee(0)}function To(n,t){if(n&1){let e=N();l(0,"app-timespan",63),h("ngModelChange",function(o){m(e);let a=s().$implicit,c=s(2);return C(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),l(1,"label",41),T(2,mo,2,0,"sup",71),p(3),T(4,Co,2,1,"sh-icon",43),z(5,go,1,0,"ng-container",24),r()()}if(n&2){let e=s().$implicit,i=f(1),o=f(2),a=f(4),c=f(5);s();let u=H(17);d("inputType",e.formView.name)("ngModel",o)("customId",c),_(),d("for",c),_(),S(e.formView.isMandatory&&a?2:-1),_(),B(" ",i," "),_(),S(e.formView.longDescription?4:-1),_(),d("ngTemplateOutlet",u)("ngTemplateOutletContext",te(12,le,de(9,Ee,e.fieldGroup,e.formView)))}}function So(n,t){n&1&&(l(0,"sup",73),p(1,"*"),r())}function fo(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(2).$implicit;d("shTooltip",e.formView.longDescription)}}function Eo(n,t){n&1&&ee(0)}function ho(n,t){if(n&1){let e=N();l(0,"app-file-drop-textarea",72),h("ngModelChange",function(o){m(e);let a=s().$implicit,c=s(2);return C(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),l(1,"label"),T(2,So,2,0,"sup",73),p(3),T(4,fo,2,1,"sh-icon",43),z(5,Eo,1,0,"ng-container",24),r()()}if(n&2){let e=s().$implicit,i=f(2),o=f(4),a=f(5);s();let c=H(17);d("ngModel",i)("customId",a)("placeholder",e.formView.longDescription),_(2),S(e.formView.isMandatory&&o?2:-1),_(),B(" ",e.formView.shortDescription??e.formView.name," "),_(),S(e.formView.longDescription?4:-1),_(),d("ngTemplateOutlet",c)("ngTemplateOutletContext",te(11,le,de(8,Ee,e.fieldGroup,e.formView)))}}function Fo(n,t){n&1&&(A(0,"sh-spinner"),l(1,"span"),x(2,10),r()),n&2&&tn("--spinner-size","16px")("--spinner-thickness","2px")}function No(n,t){n&1&&(l(0,"div",76),x(1,11),r())}function Do(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;tt(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function Ao(n,t){if(n&1){let e=N();l(0,"sh-select",77)(1,"label",41)(2,"sup",78),p(3,"*"),r(),l(4,"span"),x(5,12),r()(),l(6,"input",44),h("ngModelChange",function(o){m(e);let a=s(4).$implicit,c=s(2);return C(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()(),z(7,Do,1,2,"ng-template",null,6,Ve)}if(n&2){s(4);let e=f(2),i=f(5),o=s(2);d("options",o.restoreBackupIdOptions())("isClearable",!1),_(),d("for",i),_(5),d("id",i)("ngModel",e)}}function Io(n,t){if(n&1&&T(0,Fo,3,4)(1,No,2,0,"div",76)(2,Ao,9,5),n&2){let e=s(5);S(e.isLoadingRestoreBackupIdOptions()?0:e.restoreBackupIdOptions().length==0?1:2)}}function Po(n,t){n&1&&(l(0,"sup",79),p(1,"*"),r())}function yo(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(4).$implicit;d("shTooltip",e.formView.longDescription)}}function Oo(n,t){n&1&&ee(0)}function Mo(n,t){if(n&1){let e=N();l(0,"button",81),h("click",function(){m(e),s(4);let o=f(5),a=s(2);return C(a.toggleDisabled(o))}),I(1,13),A(2,"sh-icon"),P(),r()}}function xo(n,t){if(n&1){let e=N();l(0,"sh-form-field")(1,"label",41),T(2,Po,2,0,"sup",79),p(3),T(4,yo,2,1,"sh-icon",43),z(5,Oo,1,0,"ng-container",24),r(),l(6,"input",80),h("ngModelChange",function(o){m(e);let a=s(3).$implicit,c=s(2);return C(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),l(7,"sh-icon",50),p(8,"textbox"),r()(),T(9,Mo,3,0,"button",40)}if(n&2){let e=s(3).$implicit,i=f(1),o=f(2),a=f(4),c=f(5);s();let u=H(17),g=s();_(),d("for",c),_(),S(e.formView.isMandatory&&a?2:-1),_(),B(" ",i," "),_(),S(e.formView.longDescription?4:-1),_(),d("ngTemplateOutlet",u)("ngTemplateOutletContext",te(15,le,de(12,Ee,e.fieldGroup,e.formView))),_(),d("type","text")("id",c)("ngModel",o)("placeholder",e.formView.longDescription)("disabled",!0),_(3),S(g.getIsDisabled(c)?9:-1)}}function wo(n,t){if(n&1&&(l(0,"div",74),T(1,Io,3,1)(2,xo,10,17),r()),n&2){let e=s(4);_(),S(e.isRestoreFlow()?1:2)}}function Ro(n,t){if(n&1){let e=N();l(0,"div",82),I(1,14),A(2,"div")(3,"div"),P(),r(),l(4,"button",81),h("click",function(){m(e);let o=s(5);return C(o.openConsole())}),I(5,15),A(6,"sh-icon"),P(),r()}}function Lo(n,t){n&1&&(l(0,"div",82),x(1,16),r(),l(2,"button",83),I(3,17),A(4,"sh-icon"),P(),r()),n&2&&(_(2),d("routerLink",Oe(1,ti)))}function $o(n,t){if(n&1&&(l(0,"div",75),T(1,Ro,7,0)(2,Lo,5,2),r()),n&2){let e=s(4);_(),S(e.isConnectedToConsole()?1:2)}}function Go(n,t){if(n&1&&T(0,wo,3,1,"div",74)(1,$o,3,1,"div",75),n&2){let e=s(3);S(e.isConnectedToConsole()&&e.hasStorageApiKey()?0:1)}}function vo(n,t){n&1&&(l(0,"sup",85),p(1,"*"),r())}function bo(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(3).$implicit;d("shTooltip",e.formView.longDescription)}}function Vo(n,t){n&1&&ee(0)}function Uo(n,t){if(n&1){let e=N();l(0,"div",84)(1,"sh-form-field")(2,"label",41),T(3,vo,2,0,"sup",85),p(4),T(5,bo,2,1,"sh-icon",43),z(6,Vo,1,0,"ng-container",24),r(),l(7,"input",86),h("ngModelChange",function(o){m(e);let a=s(2).$implicit,c=s(2);return C(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),l(8,"sh-icon",50),p(9,"textbox"),r()(),l(10,"button",87),h("click",function(){m(e);let o=s(4);return C(o.authenticateFilen())}),I(11,18),A(12,"sh-icon"),P(),r()()}if(n&2){let e=s(2).$implicit,i=f(1),o=f(2),a=f(4),c=f(5);s();let u=H(17),g=s();_(2),d("for",c),_(),S(e.formView.isMandatory&&a?3:-1),_(),B(" ",i," "),_(),S(e.formView.longDescription?5:-1),_(),d("ngTemplateOutlet",u)("ngTemplateOutletContext",te(12,le,de(9,Ee,e.fieldGroup,e.formView))),_(),d("id",c)("ngModel",o),_(3),d("disabled",g.isAuthenticatingFilen())}}function ko(n,t){if(n&1&&T(0,Uo,13,14,"div",84),n&2){let e=s(3);S(e.hasFilenApiKey()?-1:0)}}function Bo(n,t){if(n&1){let e=N();l(0,"button",81),h("click",function(){m(e);let o=s().$implicit,a=s(2);return C(a.removeAdvancedOption(o.formView.name))}),l(1,"sh-icon"),p(2,"x-circle"),r()()}}function Ko(n,t){if(n&1&&(l(0,"div",34),ce(1)(2)(3)(4)(5),T(6,Ci,6,12,"app-file-tree",35)(7,Si,6,9,"app-file-tree",36)(8,yi,15,18,"sh-form-field")(9,Gi,11,16,"sh-form-field")(10,Bi,2,2)(11,ji,3,2)(12,Zi,6,14,"app-size",37)(13,io,9,13,"sh-form-field")(14,lo,5,12,"sh-toggle",38)(15,po,2,2)(16,To,6,14,"app-timespan",37)(17,ho,6,13,"app-file-drop-textarea",39)(18,Go,2,1)(19,ko,1,1),T(20,Bo,3,0,"button",40),r()),n&2){let e=t.$implicit;s();let i=f(0),o=s();Ce("single-field",e.fieldGroup!=="advanced"),_(),j(e.formView.shortDescription??e.formView.name),_(),j(o.getFieldGroup(i,e.fieldGroup)[e.formView.name]),_();let a=j(o.getFieldValue(e.fieldGroup,e.formView.name));_(),j((a??"").toString().trim()===""),_(),j("destination-"+e.fieldGroup+"-"+e.index+"-"+(e.asHttpOptions?"http":"other")),_(),S(e.formView.type==="FileTree"?6:e.formView.type==="FolderTree"?7:e.formView.type==="String"||e.formView.type==="Path"||e.formView.type==="Email"||e.formView.type==="Hostname"||e.formView.type==="Bucketname"||e.formView.type==="BucketnameB2"?8:e.formView.type==="Password"?9:e.formView.type==="Enumeration"?10:e.formView.type==="NonValidatedSelectableString"?11:e.formView.type==="Size"?12:e.formView.type==="Integer"?13:e.formView.type==="Boolean"?14:e.formView.type==="Flags"?15:e.formView.type==="Timespan"||e.formView.type==="DateTime"?16:e.formView.type==="FreeText"?17:e.formView.type==="DuplicatiBackupId"?18:e.formView.type==="Filen2FACode"?19:-1),_(14),S(e.fieldGroup==="advanced"?20:-1)}}function zo(n,t){if(n&1&&(l(0,"sh-icon",88),p(1,"x-circle"),r()),n&2){s();let e=f(0);d("shTooltip",(e==null?null:e.message)??"Invalid value")}}function Jo(n,t){if(n&1&&(l(0,"sh-icon",89),p(1,"warning"),r()),n&2){s();let e=f(0);d("shTooltip",(e==null?null:e.message)??"Invalid value")}}function Xo(n,t){if(n&1&&(ce(0),T(1,zo,2,1,"sh-icon",88)(2,Jo,2,1,"sh-icon",89)),n&2){let e=s().$implicit,i=f(0),o=j(e.formView.validate(i));_(),S((o==null?null:o.type)==="error"?1:(o==null?null:o.type)==="warning"?2:-1)}}function Wo(n,t){if(n&1&&(ce(0),T(1,Xo,3,2)),n&2){let e=t.$implicit,o=(j(s(2).getFieldValue(e.fieldGroup,e.formView.name))??"").toString().trim()==="";_(),S(!o&&e.formView.validate?1:-1)}}function Ho(n,t){if(n&1&&(ce(0),De(1,ii,1,9,"ng-container",null,Ne),De(3,ai,1,9,"ng-container",null,Ne),l(5,"sh-toggle-card",19),ae(6,20)(7),x(8,7),Z(),ce(9),T(10,li,3,0,"button",21)(11,si,17,2,"div",22),Z(),T(12,_i,1,3,"textarea",23)(13,ui,2,0),r(),z(14,Ko,21,9,"ng-template",null,0,Ve)(16,Wo,2,2,"ng-template",null,1,Ve)),n&2){let e=s(),i=f(1);j(e.destinationForm()),_(),Ae(i.custom),_(2),Ae(i.dynamic),_(2),d("disallowToggle",!0),_(4),j(e.nonSelectedAdvancedFormViews()),_(),S(e.showTextArea()?10:11),_(2),S(e.showTextArea()?12:13)}}var $t=class n{#e=y(Pe);#t=y(fe);#n=y(Dt);#i=y(be);#a=y(mn);#l=y(Cn);#o=y(Le);injector=y(Qt);targetUrl=we.required();useBackupState=Y(!1);#r=null;destinationType=O(()=>{let t=this.targetUrl();if(!t)return null;let e=ve(t);return this.#r=e?.customKey??e?.key,this.#r});refreshView=F(!1);destinationForm=F({custom:{},dynamic:{},advanced:{}});advancedFormFieldNames=O(()=>Object.keys(this.destinationForm().advanced??{}));destinationFormConfig=F(null);showTextArea=F(!1);isLoadingRestoreBackupIdOptions=F(!1);isRestoreFlow=O(()=>!this.useBackupState());restoreBackupIdOptions=Ge(pn(this.targetUrl).pipe(Ht(t=>{if(!t)return{authKey:null,url:null,isRestore:this.isRestoreFlow(),hasKey:this.hasStorageApiKey()};let e=t.indexOf("?"),i=e>=0?t.substring(e+1):"",o=new URLSearchParams(i),a=o.get("duplicati-auth-apiid")??"",c=o.get("duplicati-auth-apikey")??"";return{authKey:`${a}|${c}`,url:t}}),jt((t,e)=>t.authKey===e.authKey),Yt(({url:t})=>{this.lastRestoreAuthQueryUrl=t}),qt(({url:t})=>t&&t.startsWith("duplicati://")&&this.hasStorageApiKey()&&this.isRestoreFlow()?(this.isLoadingRestoreBackupIdOptions.set(!0),this.#l.getDuplicatiStorageBackups(t).pipe(Be(()=>this.isLoadingRestoreBackupIdOptions.set(!1)))):Wt([]))),{initialValue:[]});isConnectedToConsole=O(()=>this.#a.state()==="connected");hasStorageApiKey=O(()=>(this.#n.serverSettings()?.["remote-control-storage-api-id"]??"").length>0);isAuthenticatingFilen=F(!1);hasFilenApiKey=O(()=>{let e=this.destinationForm().advanced["api-key"];return e&&e.length>0});nonSelectedAdvancedFormViews=O(()=>{let t=this.destinationFormConfig();if(!t)return[];let e=this.advancedFormFieldNames();return t.advanced.filter(i=>e.findIndex(o=>o===i.name)===-1)});destinationTypeEffect=oe(()=>{let t=this.targetUrl(),e=ve(t??""),i=e.key,o=e.customKey??i,a=this.#i.allModules().find(L=>L.Key===i)??{Key:i,DisplayName:e.displayName,Description:e.description,Options:[]};if(!a||!a.Options||!i)return;let c=e&&e.oauthField?e.oauthField:null,u=e&&e.customFields?e.customFields:{},g=e&&e.dynamicFields?e.dynamicFields:[],E=e&&e.advancedFields?e.advancedFields:[],v=e&&e.ignoredAdvancedFields?e.ignoredAdvancedFields:[],K={destinationType:o,oauthField:c,custom:[],dynamic:[],advanced:[]};u&&Object.entries(u).forEach(([L,D],b)=>{let V=D.order??b,M=D.validate;!M&&D.type==="Bucketname"&&(M=J=>fn(J)?null:{type:"error",message:$localize`Invalid bucket name.`}),M&&D.type==="Hostname"&&(M=J=>En(J)?null:{type:"error",message:$localize`Invalid hostname.`}),K.custom.push(W({order:900+V,validate:M},D))});for(let L=0;L<a.Options.length;L++){let D=a.Options[L];if(D.Deprecated)continue;let b=g.find(V=>V===D.Name||D.Aliases?.includes(V.name)||V.name===D.Name);if(b){let V=D.Aliases?.indexOf(b.name)??-1,M=D.Aliases&&V>-1?D.Aliases[V]:D.Name,J=b&&typeof b!="string",ue=J?b?.defaultValue??D.DefaultValue:D.DefaultValue,pe=J&&b?.order!==void 0?b.order:L,w={name:M,type:D.Type,shortDescription:D.ShortDescription??void 0,longDescription:D.LongDescription??void 0,options:D.ValidValues,order:900+pe},he=J?W(W({},w),b):w;K.dynamic.push(he)}else{let V=D.Name;if(v.find(Fe=>Fe===V))continue;let J=E.find(Fe=>Fe===V||Fe.name===V),ue=J&&typeof J!="string",pe=ue&&J?.order!==void 0?J.order:L,w={name:V,type:D.Type,shortDescription:D.ShortDescription??void 0,longDescription:D.LongDescription??void 0,options:D.ValidValues,defaultValue:D.DefaultValue,order:900+pe},he=ue?W(W({},w),J):w;K.advanced.push(he)}}if(K.custom.sort((L,D)=>L.order-D.order),K.dynamic.sort((L,D)=>L.order-D.order),K.advanced.sort((L,D)=>L.order-D.order),this.destinationFormConfig.set(K),!t)return;let q=It(t);q&&this.destinationForm.set({custom:q.custom,dynamic:q.dynamic,advanced:q.advanced})});destinationFormEffect=oe(()=>{let t=this.#r,e=this.destinationForm(),i=this.refreshView();if(!e||!t)return;let o=Tn({destinationType:t,custom:e.custom,dynamic:e.dynamic,advanced:e.advanced});o&&this.targetUrl.set(o)});getFieldValue(t,e){let o=this.destinationForm()[t][e];return o||null}getFormView(t,e){let o=this.destinationFormConfig()?.[t].find(a=>a.name===e);return o||null}getDefaultFormView(t){return{name:t,type:"String",shortDescription:t,longDescription:$localize`This is an undocumented option.`}}getFieldGroup(t,e){return t[e]}hasLeadingSlash(t){return t?.startsWith("/")??!1}addAdvancedOption(t){let e=this.destinationForm();e.advanced[t.name]=t.defaultValue,this.destinationForm.set(W({},e))}isTrue(t){if(typeof t=="boolean")return t;if(typeof t=="string"){let e=t.toLowerCase();return e==="true"||e==="1"||e==="yes"||e==="on"}return!1}onKeyDown(t,e,i,o){if(i==="Hostname"||i==="Bucketname"){if(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Home","End"].includes(o.key))return;if(o.key=="/"||o.key=="\\"||o.key==":"){o.preventDefault();return}}}updateFieldValue(t,e,i){let o=this.destinationForm();o[t][e]=i,this.destinationForm.set(W({},o))}removeAdvancedOption(t){let e=this.destinationForm();delete e.advanced[t],this.destinationForm.set(W({},e))}mapOptions(t){let e=t.loadOptions;if(e)return e(this.injector)();let i=t.options;return i?i.map(o=>({key:o,value:o})):null}mapOptionsWithFreeText(t,e){let i=this.mapOptions(t);return i?(e&&e.length>0&&(i.find(a=>a.value===e)||i.push({key:e,value:e})),i):null}#s=F(!1);oauthStartTokenCreation(t,e,i,o){this.#s.set(!0);let a=(o??1)==2?this.#t.defaultOAuthUrlV2():this.#t.defaultOAuthUrl(),c=this.#n.serverSettings()?.["--oauth-url"];if(c&&c.length>0&&(a=c),this.useBackupState()){let D=this.#e.mapFormsToSettings().find(b=>b.Name==="--oauth-url")?.Value;D&&D.length>0&&(a=D)}let u=this.destinationForm().advanced["oauth-url"];u&&u.length>0&&(a=u);let g=`${a}?type=${t}`,E=450,v=600,K=screen.width/2-E/2,q=screen.height/2-v/2,L=window.open(g,"_blank","height="+v+",width="+E+",menubar=0,status=0,titlebar=0,toolbar=0,left="+K+",top="+q);return window.addEventListener("message",D=>{let b=D.data.startsWith("authid:"),V=b?D.data.replace("authid:",""):null;b&&(this.destinationForm.update(M=>(M[e][i]=V,M)),this.#s.set(!1),this.refreshView.set(!this.refreshView()),L?.close())}),!1}settingsAsText=O(()=>{let t=this.destinationForm().advanced;return Object.entries(t).map(([e,i])=>{let o=e??"",a="";return typeof i=="boolean"?a=this.isTrue(i)?"True":"False":(typeof i=="number"||i!=null)&&(a=i.toString()),`${o}=${a}`}).join(`
2
- `)});updateSettingsFromText(t){if(typeof t!="string")return;let e=Sn(t);this.destinationForm.update(i=>me(W({},i),{advanced:e}))}getIsDisabled(t){return document.getElementById(t)?.disabled??!0}toggleDisabled(t){let e=document.getElementById(t);e&&(e.disabled=!e.disabled)}openConsole(){this.#a.openConsole()}#_(t){var e=this.useBackupState()?this.#e.backupId():null;this.isAuthenticatingFilen.set(!0),this.#l.getFilenApiKey(t,e).pipe(Be(()=>this.isAuthenticatingFilen.set(!1))).subscribe({next:i=>{if(i.length===0){this.#o.open(Q,{data:{title:$localize`Authentication failed`,message:$localize`No API key was returned from the Filen server.`,confirmText:$localize`OK`}});return}this.destinationForm.update(o=>(o.advanced["api-key"]=i,o.dynamic["two-factor-code"]=null,o)),this.refreshView.set(!this.refreshView())},error:i=>{console.error("Error authenticating Filen",i),this.#o.open(Q,{data:{title:$localize`Authentication failed`,message:$localize`An error occurred while requesting the Filen API key: ${i.message}`,confirmText:$localize`OK`}})}})}authenticateFilen(){let t=this.targetUrl();if(!t)return;let i=this.destinationForm().advanced["api-key"];if(i&&i.length>0){this.#o.open(Q,{data:{title:$localize`Confirm re-authenticate?`,message:$localize`You already have an API key. Are you sure you want to re-authenticate?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:o=>{if(o){var a=new URL(t);a.searchParams.delete("api-key"),this.#_(a.toString())}}});return}this.#_(t)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=X({type:n,selectors:[["app-single-destination"]],inputs:{targetUrl:[1,"targetUrl"],useBackupState:[1,"useBackupState"]},outputs:{targetUrl:"targetUrlChange"},decls:3,vars:3,consts:()=>{let t;t=$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 i;i=$localize` Add advanced option ${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let o;o=$localize`This field is mandatory`;let a;a=$localize`This field is mandatory`;let c;c=$localize`This field is mandatory`;let u;u=$localize`An empty path means storing data in the initial or root folder, which is not recommended`;let g;g=$localize`This field is mandatory`;let E;E=$localize`This field is mandatory`;let v;v=$localize`This field is mandatory`;let K;K=$localize`This field is mandatory`;let q;q=$localize`This field is mandatory`;let L;L=$localize`This field is mandatory`;let D;D=$localize`This field is mandatory`;let b;b=$localize`This field is mandatory`;let V;V=$localize`Loading available backups...`;let M;M=$localize`No backups found from this machine, contact support`;let J;J=$localize`This field is mandatory`;let ue;ue=$localize`Pick the backup to restore from`;let pe;pe=$localize`This field is mandatory`;let w;w=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:pencil${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let he;he=$localize`${"[\uFFFD#2\uFFFD|\uFFFD#3\uFFFD]"}:START_TAG_DIV:An API key with storage access is required to use Duplicati storage.${"[\uFFFD/#2\uFFFD|\uFFFD/#3\uFFFD]"}:CLOSE_TAG_DIV:${"[\uFFFD#2\uFFFD|\uFFFD#3\uFFFD]"}:START_TAG_DIV:Visit the console and assign an API key to this machine.${"[\uFFFD/#2\uFFFD|\uFFFD/#3\uFFFD]"}:CLOSE_TAG_DIV:`,he=Ze(he);let Fe;Fe=$localize` Visit console ${"\uFFFD#6\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_ICON:`;let Qe;Qe=$localize`Connect to the console to use Duplicati storage.`;let U;U=$localize` Connect now ${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let Jt;Jt=$localize`This field is mandatory`;let Xt;return Xt=$localize` Authenticate now ${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["fieldTemplate",""],["validateTemplate",""],["option",""],["enumOptionTemplate",""],["nonValidatedOptionTemplate",""],["optionTemplate",""],["backupIdOptionTemplate",""],t,e,i,V,M,ue,w,he,Fe,Qe,U,Xt,[1,"advanced-options",3,"disallowToggle"],["title",""],["shButton","","type","button",1,"outlined","small"],[1,"actions"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModel","ngModelOptions"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["shButton","","type","button",1,"outlined","small",3,"click"],[3,"searchable"],["shButton","","type","button",1,"outlined","small",3,"disabled"],["menu",""],["type","button"],["shButton","","type","button",1,"small"],["shButton","","type","button",1,"small",3,"click"],["type","button",3,"click"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModelChange","ngModel","ngModelOptions"],[1,"field-row"],[3,"startingPath","accepts","showFiles","hideShortcuts","showHiddenNodes","selectFiles"],[3,"hideShortcuts","enableCreateFolder","startingPath"],[3,"inputType","ngModel","customId"],[1,"primary","raised",3,"active"],[3,"ngModel","customId","placeholder"],["shButton","","type","button",1,"outlined"],[3,"for"],["shTooltip",o],[1,"primary",3,"shTooltip"],["type","text",3,"ngModelChange","id","ngModel"],["shTooltip",a],["shTooltip",c],["shTooltip",u,1,"warn"],["autocomplete","off",3,"keydown","ngModelChange","type","id","ngModel"],["prefix","",3,"error","warn","shTooltip"],["prefix",""],["prefix","",3,"shTooltip"],["shTooltip",g],["autocomplete","off",3,"ngModelChange","type","id","ngModel"],["prefix","",1,"link"],["suffix","",1,"clickable"],["prefix","",1,"link",3,"click"],["suffix","",1,"clickable",3,"click"],["label","key","value","value",3,"options","isClearable","optionTemplate"],["shTooltip",E],[1,"indeterminate","primary"],["label","key","value","value",3,"options","asFreeText","inlineSearch","optionTemplate"],["shTooltip",v],[3,"ngModelChange","inputType","ngModel","customId"],["shTooltip",K],["shTooltip",q],["type","number",3,"ngModelChange","id","ngModel"],[1,"primary","raised",3,"click"],["key","key","value","value",1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["shTooltip",L],["type","text","id","text",3,"ngModelChange","ngModel"],["shTooltip",D],[3,"ngModelChange","ngModel","customId","placeholder"],["shTooltip",b],[1,"duplicati-backup-id"],[1,"duplicati-backup-id-console"],[1,"no-backups-found"],[3,"options","isClearable"],["shTooltip",J],["shTooltip",pe],["autocomplete","off",3,"ngModelChange","type","id","ngModel","placeholder","disabled"],["shButton","","type","button",1,"outlined",3,"click"],[1,"info"],["shButton","","type","button",1,"outlined",3,"routerLink"],[1,"filen-2fa-setup"],["shTooltip",Jt],["type","text","autocomplete","off",3,"ngModelChange","id","ngModel"],["shButton","","type","button",1,"outlined",3,"click","disabled"],[1,"error",3,"shTooltip"],[1,"warn",3,"shTooltip"]]},template:function(e,i){if(e&1&&(ce(0)(1),T(2,Ho,18,5)),e&2){let o=j(i.destinationType());_();let a=j(i.destinationFormConfig());_(),S(o&&a?2:-1)}},dependencies:[He,re,pt,se,Te,ge,on,an,Ot,yt,Nn,Lt,Se,ie,ne,ht,ft,$e,Ft,je,Et,un],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.advanced-options[_ngcontent-%COMP%]{position:relative;z-index:1}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}label[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1rem}.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}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.raw-text-area[_ngcontent-%COMP%]{min-height:12rem;white-space:pre}.filen-2fa-setup[_ngcontent-%COMP%], .duplicati-backup-id[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:8px;align-items:flex-end}.duplicati-backup-id[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{width:100%}.duplicati-backup-id-console[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:8px;align-items:center}.duplicati-backup-id-console[_ngcontent-%COMP%] .info[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:4px}"],changeDetection:0})};var Gt=class n{#e=y(Nt);#t=y(Le);#n=y(fe);testDestination(t,e,i,o,a,c){return this.#n.hasV2TestOperations()?this.testDestinationv2(t,e,i,o,a,c):this.testDestinationv1(t,e,i,o,a,c)}testDestinationv2(t,e,i,o,a,c){return new lt(u=>{this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:t,BackupId:e=="new"?null:e,AutoCreate:!1,Options:null,DestinationType:a}}).subscribe({next:g=>{if(g.Success){this.emitSuccessV2(u,t,i,g);return}this.handleGenericError(u,t,i,g.Error??"Unknown error",c)},error:g=>{let E=g?.error?.body??g?.error?.requestBody;if(E?.Data?.FolderExists===!1||E?.StatusCode==="missing-folder"){o?this.handleMissingFolder(u,t,e,i):this.handleGenericError(u,t,i,$localize`The remote destination folder does not exist.`,c);return}if(E?.Data?.HostCertificate){this.handleMissingCertificate(u,t,i,E.Data?.HostCertificate);return}if(E?.Data?.ReportedHostKey){this.handleIncorrectKey(u,t,i,E.Data.ReportedHostKey,E.Data.AcceptedHostKey??null);return}this.handleGenericError(u,t,i,g?.message??"Unknown error",c)}})})}testDestinationv1(t,e,i,o,a,c){return new lt(u=>{this.#e.postApiV1RemoteoperationTest({requestBody:{path:t,backupId:e=="new"?null:e},type:a}).subscribe({next:g=>{u.next({action:"success",targetUrl:t,testAgain:!1,destinationIndex:i}),u.complete()},error:g=>{this.handleDestinationErrorv1(g.message,t,e,i,o,c).subscribe(E=>{u.next(E)})}})})}handleMissingFolder(t,e,i,o){this.#t.open(Q,{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:a=>{if(!a){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,BackupId:i=="new"?null:i}}).subscribe({next:c=>{if(c.Success){this.emitSuccessV2(t,e,o,c);return}else this.handleFolderCreateFailure(t,e,o,c.Error??$localize`Unknown error`)},error:c=>{this.handleFolderCreateFailure(t,e,o,c.message??$localize`Unknown error`)}}):this.#e.postApiV1RemoteoperationCreate({requestBody:{path:e,backupId:i=="new"?null:i}}).subscribe({next:()=>{this.handleFolderCreated(t,e,o)},error:c=>{this.handleFolderCreateFailure(t,e,o,c.message??$localize`Unknown error`)}})}})}handleFolderCreateFailure(t,e,i,o){this.#t.open(Q,{data:{title:$localize`Error creating folder`,message:$localize`The remote destination folder could not be created. ${o}`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:i}),t.complete()}})}emitSuccessV2(t,e,i,o){t.next({action:"success",targetUrl:e,testAgain:!1,destinationIndex:i,anyFilesFound:!o.Data?.FolderIsEmpty,containsBackup:o.Data?.FolderContainsBackupFiles??void 0,containsEncryptedBackupFiles:o.Data?.FolderContainsEncryptedBackupFiles??void 0}),t.complete()}handleFolderCreated(t,e,i){this.#t.open(Q,{data:{title:$localize`Folder created`,message:$localize`The remote destination folder was created successfully.`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"test-again",targetUrl:e,testAgain:!0,destinationIndex:i}),t.complete()}})}reportNoAction(t,e,i,o){t.next({action:"generic-error",targetUrl:e,errorMessage:o,testAgain:!1,destinationIndex:i}),t.complete()}handleMissingCertificate(t,e,i,o){this.#t.open(Q,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
3
- If this is a self-signed certificate, you can choose to trust this certificate.
4
- The server reported the certificate hash: ${o}`,confirmText:$localize`Trust the certificate`,cancelText:$localize`Cancel`},closed:a=>{if(!a){this.reportNoAction(t,e,i,$localize`The server certificate is not trusted.`);return}t.next({action:"trust-cert",targetUrl:e,testAgain:!0,certData:o,destinationIndex:i}),t.complete()}})}handleIncorrectKey(t,e,i,o,a){a?this.#t.open(Q,{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,
5
- otherwise you could be the victim of a MAN-IN-THE-MIDDLE attack.
6
- Do you want to REPLACE your CURRENT host key ${a}
7
- with the REPORTED host key: ${o}?`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:c=>{if(!c){this.reportNoAction(t,e,i,$localize`The host key was not approved.`);return}t.next({action:"approve-host-key",targetUrl:e,testAgain:!0,reportedHostKey:o,destinationIndex:i}),t.complete()}}):this.#t.open(Q,{maxWidth:"500px",data:{title:$localize`Approve host key?`,message:$localize`No certificate was specified, please verify that the reported host key is correct: ${o}`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:c=>{if(!c){this.reportNoAction(t,e,i,$localize`The host key was not approved.`);return}t.next({action:"approve-host-key",targetUrl:e,testAgain:!0,reportedHostKey:o,destinationIndex:i}),t.complete()}})}handleGenericError(t,e,i,o,a){function c(){t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:i,errorMessage:o}),t.complete()}if(a){c();return}this.#t.open(Q,{maxWidth:"500px",data:{title:$localize`Test connection failed`,message:o,cancelText:$localize`OK`},closed:u=>c()})}handleDestinationErrorv1(t,e,i,o,a,c){return new lt(u=>{if(t==="missing-folder"){a?this.handleMissingFolder(u,e,i,o):this.handleGenericError(u,e,o,$localize`The remote destination folder does not exist.`,c);return}if(t.startsWith("incorrect-cert:")){let g=t.split("incorrect-cert:")[1];this.handleMissingCertificate(u,e,o,g);return}if(t.startsWith("incorrect-host-key:")){let g=t.split('incorrect-host-key:"')[1].split('",')[0],E=t.split('accepted-host-key:"')[1].split('",')[0];this.handleIncorrectKey(u,e,o,g,E);return}this.handleGenericError(u,e,o,t,c)})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=xe({token:n,factory:n.\u0275fac,providedIn:"root"})};function jo(n,t){if(n&1){let e=N();l(0,"sh-alert",0),p(1," Make sure to test the configuration "),l(2,"button",3),h("click",function(){m(e);let o=s(2);return C(o.testDestination())}),p(3,"Test now"),r()()}}function qo(n,t){n&1&&(l(0,"sh-alert",0),p(1,"Testing connection..."),r())}function Yo(n,t){n&1&&(l(0,"sh-alert",1),p(1,"Connection tested successfully."),r())}function Qo(n,t){if(n&1&&(l(0,"sh-alert",2),p(1),r()),n&2){let e=s(2);_(),B(" ",e.testErrorMessage()," ")}}function Zo(n,t){if(n&1&&T(0,jo,4,0,"sh-alert",0)(1,qo,2,0,"sh-alert",0)(2,Yo,2,0,"sh-alert",1)(3,Qo,2,1,"sh-alert",2),n&2){let e=s();S(e.testSignal()===""?0:e.testSignal()==="testing"?1:e.testSignal()==="containsBackup"||e.testSignal()==="success"?2:e.testSignal()==="warning"||e.testSignal()==="error"?3:-1)}}var vt=class n{#e=y(Gt);targetUrl=we.required();testSignal=we.required();moduleType=we.required();testErrorMessage=F(null);isExpectedValidTargetUrl=O(()=>{let t=this.targetUrl();return!(!t||!It(t))});prevTargetUrl=null;targetUrlEffect=oe(()=>{let t=this.targetUrl();t!==this.prevTargetUrl&&(this.prevTargetUrl=t,this.resetTestState())});setTestState(t,e){this.testSignal.set(t),this.testErrorMessage.set(e??null)}resetTestState(){this.testSignal.set(""),this.testErrorMessage.set(null)}testDestination(){let t=this.targetUrl();t&&(this.setTestState("testing"),this.#e.testDestination(t,null,0,!0,this.moduleType(),!0).subscribe({next:e=>{if(e.action==="success"&&e.containsBackup===!0){this.setTestState("containsBackup");return}else if(e.action==="success"){this.setTestState("success");return}if(this.setTestState("error",e.errorMessage??$localize`An error occurred while testing the destination.`),e.action==="generic-error")return;let i=t.includes("?");e.action==="trust-cert"&&this.targetUrl.set(t+`${i?"&":"?"}accept-specified-ssl-hash=${e.certData}`),e.action==="approve-host-key"&&this.targetUrl.set(t+`${i?"&":"?"}ssh-fingerprint=${e.reportedHostKey}`),e.testAgain&&this.testDestination()}}))}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=X({type:n,selectors:[["app-test-url"]],inputs:{targetUrl:[1,"targetUrl"],testSignal:[1,"testSignal"],moduleType:[1,"moduleType"]},outputs:{targetUrl:"targetUrlChange",testSignal:"testSignalChange",moduleType:"moduleTypeChange"},decls:1,vars:1,consts:[[1,"simple","primary"],[1,"simple","success"],[1,"simple","warn"],["shButton","",1,"primary","small",3,"click"]],template:function(e,i){e&1&&T(0,Zo,4,1),e&2&&S(i.isExpectedValidTargetUrl()?0:-1)},dependencies:[Tt,ie],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};function ea(n,t){if(n&1){let e=N();l(0,"app-destination-list",10),h("setDestination",function(o){m(e);let a=s();return C(a.setDestination(o))}),r()}if(n&2){let e=s();d("showAsSources",!0)("moduleType",e.moduleType())}}function ta(n,t){if(n&1){let e=N();l(0,"app-destination-list-item",11)(1,"button",8),h("click",function(){m(e);let o=s();return C(o.removeDestination())}),x(2,3),r()(),l(3,"app-test-url",12),G("targetUrlChange",function(o){m(e);let a=s();return R(a.targetUrlModel,o)||(a.targetUrlModel=o),C(o)})("testSignalChange",function(o){m(e);let a=s();return R(a.testSignal,o)||(a.testSignal=o),C(o)}),r(),l(4,"app-single-destination",13),G("targetUrlChange",function(o){m(e);let a=s();return R(a.targetUrlModel,o)||(a.targetUrlModel=o),C(o)}),r()}if(n&2){let e=s();d("targetUrl",e.targetUrlModel()),_(3),$("targetUrl",e.targetUrlModel)("testSignal",e.testSignal),d("moduleType",e.moduleType()),_(),$("targetUrl",e.targetUrlModel)}}var ot=class n{data=Y();closed=Ue();targetUrlModel=F(null);moduleType=F("Backend");dataEffect=oe(()=>{let t=this.data();t?.targetUrlModel&&this.targetUrlModel.set(t.targetUrlModel),t?.moduleType&&this.moduleType.set(t.moduleType)});testSignal=F("");setTargetUrl(t,e=!1){this.targetUrlModel.set(t)}setDestination(t){let e=At(t??"");if(e){if(e.mapper.default){let i=e.mapper.default("");this.setTargetUrl(i,!0);return}this.setTargetUrl(`${t}://`,!0)}}submit(){this.closed.emit(this.targetUrlModel())}removeDestination(){this.setTargetUrl(null,!0)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=X({type:n,selectors:[["app-target-url-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:11,vars:5,consts:()=>{let t;t=$localize`Remote source`;let e;e=$localize`Cancel`;let i;i=$localize` Use remote source `;let o;return o=$localize`Change`,[t,e,i,o,[1,"title-30"],["content",""],[3,"showAsSources","moduleType"],["footer","",1,"sticky"],["shButton","","type","button",3,"click"],["shButton","","type","button",1,"raised","primary",3,"click","disabled"],[3,"setDestination","showAsSources","moduleType"],[1,"current-destination",3,"targetUrl"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal","moduleType"],[3,"targetUrlChange","targetUrl"]]},template:function(e,i){if(e&1){let o=N();l(0,"header")(1,"h3",4),x(2,0),r()(),l(3,"section",5),T(4,ea,1,2,"app-destination-list",6),T(5,ta,5,5),r(),l(6,"footer",7)(7,"button",8),h("click",function(){return m(o),C(i.closed.emit(null))}),x(8,1),r(),l(9,"button",9),h("click",function(){return m(o),C(i.submit())}),x(10,2),r()()}if(e&2){let o=!!i.targetUrlModel();_(4),S(o?-1:4),_(),S(o?5:-1),_(4),Ce("loading",i.testSignal()==="testing"),d("disabled",!o||i.testSignal()===""||i.testSignal()==="testing")}},dependencies:[$t,Rt,Ye,ie,vt],styles:["[_nghost-%COMP%]{--dialog-p: 1.5rem;display:flex;flex-direction:column;gap:1rem}header[_ngcontent-%COMP%]{display:flex;padding:1.5rem 1.5rem 0}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}footer[_ngcontent-%COMP%]{z-index:1}"],changeDetection:0})};var na=["formRef"],An=()=>({updateOn:"blur",standalone:!0}),Kt=()=>({standalone:!0});function ia(n,t){n&1&&x(0,7,1)}function oa(n,t){n&1&&x(0,7,2)}function aa(n,t){if(n&1){let e=N();l(0,"sh-form-field")(1,"textarea",46),G("ngModelChange",function(o){m(e);let a=s();return R(a.bulkPaths,o)||(a.bulkPaths=o),C(o)}),h("ngModelChange",function(){m(e);let o=s();return C(o.savePathBulkEdit())}),r()()}if(n&2){let e=s();_(),$("ngModel",e.bulkPaths),d("ngModelOptions",Oe(2,An))}}function la(n,t){if(n&1){let e=N();l(0,"sh-form-field",50)(1,"input",51),G("ngModelChange",function(o){m(e);let a=s(3);return R(a.editingPath,o)||(a.editingPath=o),C(o)}),r()(),l(2,"button",34),h("click",function(){m(e);let o=s(3);return C(o.updatePath())}),l(3,"sh-icon"),p(4,"floppy-disk"),r()(),l(5,"button",34),h("click",function(){m(e);let o=s(3);return C(o.cancelEditPath())}),l(6,"sh-icon"),p(7,"x-bold"),r()()}if(n&2){let e=s(3);_(),$("ngModel",e.editingPath),d("ngModelOptions",Oe(2,Kt))}}function ra(n,t){if(n&1&&(l(0,"sh-chip"),A(1,"img",52),p(2),r()),n&2){let e=s(2).$implicit,i=s(2);_(),d("src",i.getBackendIcon(e),rt),_(),B(" ",i.getRemotePathDisplayName(e)," ")}}function sa(n,t){if(n&1&&(l(0,"sh-form-field",50),A(1,"input",53),r()),n&2){let e=s(2).$implicit;en("readonly",!0),_(),d("ngModel",e)("ngModelOptions",Oe(3,Kt))}}function _a(n,t){if(n&1){let e=N();T(0,ra,3,2,"sh-chip")(1,sa,2,4,"sh-form-field",50),l(2,"button",34),h("click",function(){m(e);let o=s().$implicit,a=s(2);return C(a.editPath(o))}),l(3,"sh-icon"),p(4,"pen"),r()(),l(5,"button",34),h("click",function(){m(e);let o=s().$implicit,a=s(2);return C(a.removePath(o))}),l(6,"sh-icon"),p(7,"trash-simple"),r()()}if(n&2){let e=s().$implicit;S(e.startsWith("@")?0:1)}}function ca(n,t){if(n&1&&(l(0,"div",47),T(1,la,8,3)(2,_a,8,1),r()),n&2){let e=t.$implicit,i=s(2);_(),S(i.oldPath()===e?1:2)}}function da(n,t){if(n&1){let e=N();De(0,ca,3,1,"div",47,Ne),l(2,"div",45)(3,"sh-form-field"),A(4,"input",48),r(),l(5,"button",49),h("click",function(){m(e);let o=s();return C(o.addNewPath())}),l(6,"sh-icon"),p(7,"plus"),r()()()}if(n&2){let e=s();Ae(e.nonFilterPaths()),_(4),d("formControl",e.newPathCtrl)}}function ua(n,t){if(n&1){let e=N();l(0,"button",54),h("click",function(){m(e);let o=s();return C(o.addFilter())}),I(1,18),A(2,"sh-icon"),P(),r()}}function pa(n,t){n&1&&x(0,10,1)}function ma(n,t){n&1&&x(0,10,2)}function Ca(n,t){if(n&1){let e=N();l(0,"sh-form-field")(1,"textarea",46),G("ngModelChange",function(o){m(e);let a=s();return R(a.bulkFilters,o)||(a.bulkFilters=o),C(o)}),h("ngModelChange",function(){m(e);let o=s();return C(o.saveBulkFilterEdit())}),r()()}if(n&2){let e=s();_(),$("ngModel",e.bulkFilters),d("ngModelOptions",Oe(2,An))}}function ga(n,t){if(n&1){let e=N();l(0,"app-new-filter",56),h("pathChange",function(o){let a=m(e).$index,c=s(3);return C(c.patchPathAt(o,a))})("remove",function(){let o=m(e).$index,a=s(3);return C(a.removePathAt(o))}),r()}if(n&2){let e=t.$implicit,i=s(3);d("path",e)("osType",i.osType()??"")}}function Ta(n,t){if(n&1&&De(0,ga,1,2,"app-new-filter",55,Ne),n&2){let e=s(2);Ae(e.pathArray())}}function Sa(n,t){if(n&1&&(l(0,"div",38),T(1,Ta,2,0),r()),n&2){let e,i=s();_(),S((e=i.pathSignal())!=null&&e.length?1:-1)}}function fa(n,t){if(n&1){let e=N();l(0,"div",45)(1,"app-size",57),h("ngModelChange",function(o){m(e);let a=s();return C(a.updateFilesLargerThan(o))}),r()()}if(n&2){let e=s();_(),d("ngModel",e.filesLargerThan())("ngModelOptions",Oe(2,Kt))}}var Me=new gt,In=(n={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>Me.group({path:Me.control(n.path),excludes:Me.group({hidden:Me.control(n.excludes.hidden),system:Me.control(n.excludes.system),temporary:Me.control(n.excludes.temporary),filesLargerThan:Me.group({size:Me.control(null),unit:Me.control(null)})})}),Bt=class n{#e=y(Pe);#t=y(Le);#n=y(Re);#i=y(We);#a=y(fe);#l=y(be);formRef=Xe.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new rn("");filesLargerThan=O(()=>{let t=this.sourceDataFormSignal()?.excludes?.filesLargerThan??{};return t.size!==null&&t.unit!==null?`${t.size}${t.unit}`:null});osType=this.#e.osType;pathSignal=Ge(this.sourceDataForm.controls.path.valueChanges);pathArray=O(()=>this.pathSignal()?.split("\0").filter(t=>t.startsWith("-")||t.startsWith("+")||t==="___none___")??[]);nonFilterPaths=O(()=>this.pathSignal()?.split("\0").filter(t=>!t.startsWith("-")&&!t.startsWith("+")&&t!==""));oldPath=F(null);editingPath=F(null);addingNewPath=F(!1);bulkPathEditMode=F(!1);bulkPaths=F("");bulkFilterEditMode=F(!1);bulkFilters=F("");openRemoteDestinationDialog(){this.#t.open(ot,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{targetUrlModel:null,moduleType:"SourceProvider"}}).closed.subscribe(e=>{if(!e)return;let i=Math.random().toString(36).substring(2,10),a=`@${this.#a.systemInfo()?.PathSeparator==="\\"?"X:\\":"/"}dupl-${i}|${e}`;this.addPath(a)})}togglePathBulkEdit(){if(this.bulkPathEditMode())this.bulkPathEditMode.set(!1);else{let t=this.nonFilterPaths()?.join(`
8
- `)??"";this.bulkPaths.set(t),this.bulkPathEditMode.set(!0)}}savePathBulkEdit(){let t=this.bulkPaths().split(`
9
- `).filter(a=>a.trim()!=="")??[],e=this.pathArray(),i=[...t,...e],o=[...new Set(i)].join("\0");this.sourceDataForm.controls.path.setValue(o)}toggleBulkFilterEdit(){if(this.bulkFilterEditMode())this.bulkFilterEditMode.set(!1);else{let t=this.pathArray().filter(e=>e!=="___none___"&&(e.startsWith("-")||e.startsWith("+"))).join(`
10
- `);this.bulkFilters.set(t),this.bulkFilterEditMode.set(!0)}}saveBulkFilterEdit(){let t=this.bulkFilters().split(`
11
- `).filter(a=>a.trim()!==""&&(a.startsWith("-")||a.startsWith("+")))??[],i=[...this.nonFilterPaths()??[],...t],o=[...new Set(i)].join("\0");this.sourceDataForm.controls.path.setValue(o)}editPath(t){if(t&&t.startsWith("@")){this.#t.open(ot,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{targetUrlModel:t.split("|")[1]||null,moduleType:"SourceProvider"}}).closed.subscribe(i=>{if(!i)return;let a=`${t.split("|")[0]}|${i}`,c=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(c?.replace(t,a)??"")});return}this.oldPath.set(t),this.editingPath.set(t)}updateFilesLargerThan(t){let{size:e,unit:i}=Pt(t);this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:e,unit:i})}updatePath(){let t=this.oldPath(),e=this.editingPath();if(!t||!e||e===t){this.oldPath.set(null),this.editingPath.set(null);return}let i=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(i?.replace(t,e)??""),this.oldPath.set(null),this.editingPath.set(null)}cancelEditPath(){this.oldPath.set(null),this.editingPath.set(null)}removePath(t){let i=(this.sourceDataForm.controls.path.value??"").split("\0"),o=i.indexOf(t);if(o===-1)return;i.splice(o,1);let a=i.filter(c=>c&&c!=="").join("\0");this.sourceDataForm.controls.path.setValue(a)}addPath(t){let i=[this.sourceDataForm.controls.path.value,t].filter(o=>o&&o!=="").join("\0");this.sourceDataForm.controls.path.setValue(i)}addFilter(t="-*"){let i=[this.sourceDataForm.controls.path.value,t].filter(o=>o&&o!=="").join("\0");this.sourceDataForm.controls.path.setValue(i)}patchPathAt(t,e){let o=this.sourceDataForm.controls.path.value.split("\0").filter(u=>!u.startsWith("-")&&!u.startsWith("+")).join("\0"),a=this.pathArray().map((u,g)=>g===e?`${t}`:`${u}`).join("\0"),c=[o,a].filter(u=>u&&u!=="").join("\0");this.sourceDataForm.controls.path.setValue(c)}removePathAt(t){let i=this.sourceDataForm.controls.path.value.split("\0").filter(c=>!c.startsWith("-")&&!c.startsWith("+")).join("\0"),o=this.pathArray().filter((c,u)=>u!==t).join("\0"),a=[i,o].filter(c=>c&&c!=="").join("\0");this.sourceDataForm.controls.path.setValue(a)}getPath(){return this.sourceDataForm.value.path??null}getBackendIcon(t){if(!t)return"";let e=t.split("|")[1];return ve(e).icon??"database"}getRemotePathDisplayName(t){if(!t)return"";let e=t.split("|")[1],i=ve(e);return i?i.displayName:"Unknown"}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let t=this.sourceDataForm.controls.path.value,e=this.newPathCtrl.value,i=t?.split("\0")||[];e&&!i.includes(e)&&i.push(e);let o=i.filter(a=>a&&a!=="").join("\0");this.sourceDataForm.controls.path.setValue(o),this.newPathCtrl.setValue("")}goBack(){this.#n.navigate(["destination"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#n.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=X({type:n,selectors:[["app-source-data"]],viewQuery:function(e,i){e&1&&ze(i.formRef,na,5),e&2&&Je()},decls:77,vars:15,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Hidden files`;let i;i=$localize`System files`;let o;o=$localize`Temporary files`;let a;a=$localize`Source Data`;let c;c=$localize`Folder path`;let u;u=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let g;g=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let E;E=$localize`Paths`;let v;v=$localize`${"\uFFFD#24\uFFFD"}:START_TAG_SH_ICON:cloud-arrow-down${"\uFFFD/#24\uFFFD"}:CLOSE_TAG_SH_ICON: Add remote path `;let K;K=$localize`${"\uFFFD#32\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#32\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD*33:1\uFFFD"}:START_BLOCK_IF: Edit contents as list ${"\uFFFD/*33:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*34:2\uFFFD"}:START_BLOCK_ELSE: Edit contents as text ${"\uFFFD/*34:2\uFFFD"}:CLOSE_BLOCK_ELSE:`;let q;q=$localize`Add a path directly from your machine.`;let L;L=$localize`Filters`;let D;D=$localize`${"\uFFFD#53\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#53\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD*54:1\uFFFD"}:START_BLOCK_IF: Edit contents as list ${"\uFFFD/*54:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*55:2\uFFFD"}:START_BLOCK_ELSE: Edit contents as text ${"\uFFFD/*55:2\uFFFD"}:CLOSE_BLOCK_ELSE:`;let b;b=$localize`Customize your filters.`;let V;V=$localize`Exclude`;let M;M=$localize`Choose if there’s any files you want to exclude.`;let J;J=$localize` Files with the Hidden attribute ${"\uFFFD#67\uFFFD\uFFFD/#67\uFFFD"}:TAG_INPUT:`;let ue;ue=$localize` Files with the System attribute ${"\uFFFD#70\uFFFD\uFFFD/#70\uFFFD"}:TAG_INPUT:`;let pe;pe=$localize` Files with the Temporary attribute ${"\uFFFD#73\uFFFD\uFFFD/#73\uFFFD"}:TAG_INPUT:`;let w;w=$localize` Files larger than `;let he;he=$localize`Add a direct path`;let Fe;Fe=$localize`Edit path`;let Qe;return Qe=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Add filter `,[["formRef",""],a,c,u,g,E,v,K,q,L,D,b,V,M,J,ue,pe,w,Qe,[3,"submit","formGroup"],[1,"left"],[1,"title-30"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",t,"formControlName","path"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],[1,"spacer"],["shButton","","type","button"],["menu",""],["shButton","","type","button",1,"small",3,"click"],["description",""],[1,"paths"],["type","button","shButton",""],[1,"filters"],["formGroupName","excludes",3,"disallowToggle"],[1,"raised","primary"],["type","checkbox","placeholder",e,"formControlName","hidden"],["type","checkbox","placeholder",i,"formControlName","system"],["type","checkbox","placeholder",o,"formControlName","temporary"],[1,"raised","primary",3,"click"],[1,"row-inputs"],["wrap","off","rows","10",1,"bulk-textarea",3,"ngModelChange","ngModel","ngModelOptions"],[1,"path"],["type","text","placeholder",he,3,"formControl"],["shButton","","type","button",1,"raised","primary",3,"click"],[1,"small"],["type","text","placeholder",Fe,3,"ngModelChange","ngModel","ngModelOptions"],["alt","",1,"provider-icon",3,"src"],["type","text",3,"ngModel","ngModelOptions"],["type","button","shButton","",3,"click"],[3,"path","osType"],[3,"pathChange","remove","path","osType"],[3,"ngModelChange","ngModel","ngModelOptions"]]},template:function(e,i){if(e&1){let o=N();l(0,"form",19,0),h("submit",function(){return m(o),C(i.next())}),l(2,"div",20)(3,"h3",21),x(4,1),r(),l(5,"app-file-tree",22)(6,"label",23),x(7,2),r(),A(8,"input",24),r(),l(9,"div",25)(10,"button",26),h("click",function(){return m(o),C(i.goBack())}),I(11,3),A(12,"sh-icon"),P(),r(),l(13,"button",27),I(14,4),A(15,"sh-icon"),P(),r()()(),l(16,"div",28)(17,"app-toggle-card",29),ae(18,30),l(19,"span"),x(20,5),r(),A(21,"div",31),l(22,"button",26),h("click",function(){return m(o),C(i.openRemoteDestinationDialog())}),I(23,6),A(24,"sh-icon"),P(),r(),l(25,"sh-menu")(26,"button",32)(27,"sh-icon"),p(28,"dots-three-vertical"),r()(),ae(29,33),l(30,"button",34),h("click",function(){return m(o),C(i.togglePathBulkEdit())}),I(31,7),A(32,"sh-icon"),T(33,ia,1,0)(34,oa,1,0),P(),r(),Z(),r(),Z(),l(35,"p",35),x(36,8),r(),l(37,"div",36),T(38,aa,2,3,"sh-form-field")(39,da,8,1),r()(),l(40,"app-toggle-card",29),ae(41,30),l(42,"span"),x(43,9),r(),A(44,"div",31),T(45,ua,3,0,"button",37),l(46,"sh-menu")(47,"button",32)(48,"sh-icon"),p(49,"dots-three-vertical"),r()(),ae(50,33),l(51,"button",34),h("click",function(){return m(o),C(i.toggleBulkFilterEdit())}),I(52,10),A(53,"sh-icon"),T(54,pa,1,0)(55,ma,1,0),P(),r(),Z(),r(),Z(),l(56,"p",35),x(57,11),r(),T(58,Ca,2,3,"sh-form-field")(59,Sa,2,1,"div",38),r(),l(60,"app-toggle-card",39),ae(61,30),x(62,12),Z(),l(63,"p",35),x(64,13),r(),l(65,"sh-toggle",40),I(66,14),A(67,"input",41),P(),r(),l(68,"sh-toggle",40),I(69,15),A(70,"input",42),P(),r(),l(71,"sh-toggle",40),I(72,16),A(73,"input",43),P(),r(),l(74,"sh-toggle",44),h("click",function(){return m(o),C(i.toggleFilesLargerThan())}),x(75,17),r(),T(76,fa,2,3,"div",45),r()()()}e&2&&(d("formGroup",i.sourceDataForm),_(5),d("multiSelect",!0)("startingPath",i.getPath())("showFiles",!0),_(12),d("disallowToggle",!0),_(16),S(i.bulkPathEditMode()?33:34),_(5),S(i.bulkPathEditMode()?38:39),_(2),d("disallowToggle",!0),_(5),S(i.bulkFilterEditMode()?-1:45),_(9),S(i.bulkFilterEditMode()?54:55),_(4),S(i.bulkFilterEditMode()?58:59),_(2),d("disallowToggle",!0),_(14),Ce("active",i.filesLargerThan()),_(2),S(i.filesLargerThan()?76:-1))},dependencies:[Te,ut,re,_t,se,dt,ge,He,sn,Ct,mt,_n,Se,ne,ie,je,ft,wt,Ot,it,yt,St],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-4)}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}sh-divider[_ngcontent-%COMP%]{margin:.75rem 0}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.25rem}.paths[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.path[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content min-content;gap:.25rem;align-items:center}.path[_ngcontent-%COMP%] sh-chip[_ngcontent-%COMP%]{width:100%}.path[_ngcontent-%COMP%] .provider-icon[_ngcontent-%COMP%]{width:1rem;height:1rem;margin-right:.5rem}.bulk-textarea[_ngcontent-%COMP%]{width:100%;font-family:monospace;min-height:12.5rem}sh-menu[_ngcontent-%COMP%]{margin-left:.25rem}.paths[_ngcontent-%COMP%], .filters[_ngcontent-%COMP%]{max-height:200px;overflow-y:auto}"],changeDetection:0})};var Pn="1W:1D,4W:1W,12M:1M",Pe=class n{#e=y(Re);#t=y(fe);#n=y(Le);#i=y(Nt);#a=y(Dt);#l=y(Mt);generalForm=yn();sourceDataForm=In();scheduleFields=kt();scheduleType=F("daily");settings=F([]);optionsFields={remoteVolumeSize:F("50MB"),backupRetention:F("all"),backupRetentionTime:F(""),backupRetentionVersions:F(0),backupRetentionCustom:F("")};targetUrlModel=F(null);backupMetadata=F(null);isDraft=F(!1);backupId=F(null);backupName=O(()=>this.generalFormSignal()?.name??"");isSubmitting=F(!1);finishedLoading=F(!1);backupDefaults=F(null);applicationOptions=F(null);isNew=O(()=>this.backupId()==="new");osType=O(()=>this.#t.systemInfo()?.OSType);selectedOptions=F([]);sourceDataFormSignal=Ge(this.sourceDataForm.valueChanges);generalFormSignal=Ge(this.generalForm.valueChanges);encryptionFieldSignal=Ge(this.generalForm.controls.encryption.valueChanges);advancedOptions=O(()=>this.#t.systemInfo()?.Options?.map(this.#u)??[]);#o=F("");#r=F(null);#s=null;testSignal=this.#o.asReadonly();testErrorMessage=this.#r.asReadonly();#_=oe(()=>{let t=this.targetUrlModel(),e=this.#o(),i=this.#s;this.#s=t,!(e==="testing"||i===null||i===t)&&(this.#o.set(""),this.#r.set(null))});setTestState(t,e){this.#o.set(t),this.#r.set(e??null)}#u(t){return{name:t.Name,type:t.Type,shortDescription:t.ShortDescription??void 0,longDescription:t.LongDescription??void 0,options:t.ValidValues}}encryptionOptions=O(()=>{let t=this.#t.systemInfo()?.EncryptionModules??[];return[at,...t]});nonSelectedOptions=O(()=>this.advancedOptions().sort((t,e)=>t?.name&&e?.name?t?.name.localeCompare(e?.name):0).filter(t=>this.selectedOptions()?.findIndex(e=>e.name===t.name)===-1));submit(t=!1){this.isSubmitting.set(!0);let e=this.#c(),i=this.backupId();this.isDraft()&&e.Backup&&(e.Backup.Metadata=this.backupMetadata()),i==="new"||!i||this.isDraft()?this.#i.postApiV1Backups({requestBody:e}).pipe(Be(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}}):this.#i.putApiV1BackupById({id:i,requestBody:e}).pipe(Be(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}})}validateBeforeSubmit(){this.generalForm.markAllAsTouched(),this.sourceDataForm.markAllAsTouched();var t=this.#c(),e=(t.Backup.Name??"").trim()!=="",i=this.generalForm.controls.encryption.value==="-"||this.generalForm.controls.password.value===this.generalForm.controls.repeatPassword.value&&this.generalForm.controls.password.value!=="";if(!e||!i||this.generalForm.invalid)return this.#n.open(Q,{data:{title:$localize`Validation Error`,message:this.isNew()?$localize`Please fix the errors indicated before creating the backup.`:$localize`Please fix the errors indicated before saving.`,confirmText:$localize`OK`}}),"general";if((this.targetUrlModel()??"").trim()==="")return this.#n.open(Q,{data:{title:$localize`Destination required`,message:this.isNew()?$localize`You must setup a destination before creating the backup.`:$localize`Please setup a destination before saving.`,confirmText:$localize`OK`}}),"destination";var a=(t.Backup.Sources??[]).filter(c=>c.trim()!=="").length>0;return!a||!this.sourceDataForm.valid?(this.#n.open(Q,{data:{title:$localize`Source data required`,message:this.isNew()?$localize`You must setup source data before creating the backup.`:$localize`Please add at least one source path before saving.`,confirmText:$localize`OK`}}),"source"):""}exit(t){if(!t){this.#d(),this.#e.navigate(["/"]);return}this.#n.open(Q,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#d(),this.#e.navigate(["/"]))}})}mapSourceDataToForm(t){let e=t.Sources??"",i=t.Filters?.map(u=>`${u.Include?"":"-"}${u.Expression}`)??[],o=t.Settings?.find(u=>u.Name==="--exclude-files-attributes")?.Value?.toLowerCase()?.split(",")??[],a=t.Settings?.find(u=>u.Name==="--skip-files-larger-than")?.Value?.toUpperCase()??null,c={path:[...e,...i].join("\0"),excludes:{hidden:o.includes("hidden"),system:o.includes("system"),temporary:o.includes("temporary"),filesLargerThan:a===null?void 0:Pt(a)}};this.sourceDataForm.patchValue(c)}mapDestinationToForm(t){this.targetUrlModel.set(t.TargetURL??"")}mapGeneralToForm(t){let e=t.Name??"",i=t.Description??"",o=t.Settings?.find(E=>E.Name==="encryption-module"),a=t.Settings?.find(E=>E.Name==="passphrase")?.Value??"",c=o?.Value&&o.Value.length?o.Value:"",u=t.Settings?.find(E=>E.Name==="compression-module")?.Value??"",g={name:t.Name??"",description:t.Description??""};e&&e!==""&&(g.name=e),i&&i!==""&&(g.description=i),c&&c!==""&&(g.encryption=c),a&&a!==""&&(g.password=a,g.repeatPassword=a),u&&u!==""&&(g.compression=u),this.generalForm.patchValue(g)}mapScheduleToForm(t){if(!t){this.scheduleType.set("disabled"),this.scheduleFields.autoRun.set(!1);return}let e=this.#l.fromString(t.Repeat)??null,i=this.#p(t.Time);this.scheduleFields.autoRun.set(!0),i.date&&this.scheduleFields.nextTime.date.set(i.date),this.scheduleFields.nextTime.time.set(i.time),this.scheduleFields.runAgain.repeatUnit.set(e?.unit??"D"),this.scheduleFields.runAgain.repeatValue.set(e?.value??1),this.scheduleFields.runAgain.allowedDays.mon.set(t.AllowedDays?.includes("mon")??!1),this.scheduleFields.runAgain.allowedDays.tue.set(t.AllowedDays?.includes("tue")??!1),this.scheduleFields.runAgain.allowedDays.wed.set(t.AllowedDays?.includes("wed")??!1),this.scheduleFields.runAgain.allowedDays.thu.set(t.AllowedDays?.includes("thu")??!1),this.scheduleFields.runAgain.allowedDays.fri.set(t.AllowedDays?.includes("fri")??!1),this.scheduleFields.runAgain.allowedDays.sat.set(t.AllowedDays?.includes("sat")??!1),this.scheduleFields.runAgain.allowedDays.sun.set(t.AllowedDays?.includes("sun")??!1);let o=nt(this.scheduleFields),a=xt.find(c=>JSON.stringify(c.data)===JSON.stringify(o));a?this.scheduleType.set(a.value):this.scheduleType.set("custom")}mapOptionsToForms(t,e=!1){let i=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","passphrase","keep-time","keep-versions","retention-policy"],o=(t.Settings??[]).map(g=>g);if(e){let g=this.#a.serverSettings()??{};Object.keys(g).filter(E=>E.startsWith("--")).forEach(E=>{o.find(K=>K.Name===E)||o.push({Name:E,Value:g[E],Filter:null})})}let a=o.filter(g=>!i.includes(g.Name)),c=o.filter(g=>i.includes(g.Name));this.settings.set(a??[]),a?.forEach(g=>{if(g.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(g.Value??"")});var u="all";c?.forEach(g=>{if(g.Name==="dblock-size"&&this.optionsFields.remoteVolumeSize.set(g.Value??"50MB"),g.Name==="keep-time"&&(g.Value??"")!=="")return u="time",this.optionsFields.backupRetentionTime.set(g.Value??"");if(g.Name==="keep-versions"&&(g.Value??"")!=="")return u="versions",this.optionsFields.backupRetentionVersions.set(g.Value?parseInt(g.Value):null);if(g.Name==="retention-policy"&&(g.Value??"")!=="")if(g.Value===Pn)u="smart";else return u="custom",this.optionsFields.backupRetentionCustom.set(g.Value??"")}),this.optionsFields.backupRetention.set(u)}storeMetadata(t,e){this.backupMetadata.set(e?t.Metadata??null:null)}getScheduleFormValue(){let t=nt(this.scheduleFields);return Dn(t)}#c(){let t=this.generalForm.value,e=this.getScheduleFormValue(),i=this.sourceDataForm.value,o=this.targetUrlModel(),a=i.path?.split("\0")??[],c=this.mapFormsToSettings(),u=Object.entries(i.excludes??{}).filter(([E,v])=>v&&E!=="filesLargerThan").map(([E])=>E),g=i.excludes?.filesLargerThan;return u.length&&c.push({Name:"--exclude-files-attributes",Value:u.join(",")}),g&&g.size!==null&&g.unit!==null&&c.push({Name:"--skip-files-larger-than",Value:`${g.size}${g.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:o??null,Sources:a.filter(E=>!(E.startsWith("-")||E.startsWith("+"))),Settings:c,Filters:a.filter(E=>E.startsWith("-")||E.startsWith("+")).map((E,v)=>({Order:v,Include:E.startsWith("+"),Expression:E.slice(1)}))},Schedule:e}}mapFormsToSettings(t=[]){let e=this.generalForm.value,i=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","encryption-module","passphrase","keep-time","keep-versions","retention-policy","dblock-size","compression-module"],o=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&e.encryption!==at.Key&&(o=[{Name:"encryption-module",Value:e.encryption??null},{Name:"passphrase",Value:e.password??null}]);let a=[{Name:"compression-module",Value:e.compression}];e.compression===""&&(a=[]);let c=[{Name:"dblock-size",Value:this.optionsFields.remoteVolumeSize()}];switch(this.optionsFields.backupRetention()){case"time":c.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":c.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":c.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":c.push({Name:"retention-policy",Value:Pn});break}let u=[...t,...i],g=this.settings().filter(E=>!u.includes(E.Name)).map(E=>{let v=E.Value;return typeof E.Value=="number"&&(v=E.Value.toString()),typeof E.Value=="boolean"&&(v=E.Value?"True":"False"),{Name:E.Name?.startsWith("--")?E.Name:`--${E.Name}`,Value:v}});return[...o,...a,...c,...g]}#p(t){if(!t||t?.indexOf("T")===-1)return{time:t??"13:00"};let e=new Date(t);return{time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`,date:e.toISOString().split("T")[0]}}setTargetUrl(t,e=!1){e&&(this.#s=null),this.targetUrlModel.set(t)}#d(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleFields=kt(),this.optionsFields.remoteVolumeSize.set("50MB"),this.optionsFields.backupRetention.set("all"),this.settings.set([]),this.targetUrlModel.set(null)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=xe({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ea=["formRef"];function ha(n,t){n&1&&(l(0,"sh-alert",17),I(1,5),A(2,"sh-icon",26),P(),r())}function Fa(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;B(" ",e.DisplayName," ")}}function Na(n,t){if(n&1&&A(0,"sh-progress-bar",40),n&2){let e=s(3);Ce("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),d("value",e.calculatePasswordStrength()*(100/5))}}function Da(n,t){n&1&&(l(0,"span",35),x(1,10),r())}function Aa(n,t){n&1&&(I(0,8,1),A(1,"sh-icon"),P())}function Ia(n,t){n&1&&(I(0,8,2),A(1,"sh-icon"),P())}function Pa(n,t){n&1&&(I(0,11,1),A(1,"sh-icon",42),P())}function ya(n,t){n&1&&(I(0,11,2),A(1,"sh-icon"),P())}function Oa(n,t){if(n&1){let e=N();l(0,"button",41),h("click",function(){m(e);let o=s(3);return C(o.copyPassword())}),I(1,11),T(2,Pa,2,0)(3,ya,2,0),P(),r()}if(n&2){let e=s(3);_(2),S(e.copiedPassword()?2:3)}}function Ma(n,t){n&1&&(l(0,"sh-alert",39),x(1,12),r())}function xa(n,t){if(n&1){let e=N();l(0,"div",30)(1,"sh-form-field")(2,"label",31),I(3,7),A(4,"sup"),P(),r(),A(5,"input",32),r(),T(6,Na,1,9,"sh-progress-bar",33),l(7,"sh-form-field"),A(8,"input",34),T(9,Da,2,0,"span",35),r(),l(10,"div",36)(11,"button",37),h("click",function(){m(e);let o=s(2);return C(o.showPassword.set(!o.showPassword()))}),I(12,8),T(13,Aa,2,0)(14,Ia,2,0),P(),r(),l(15,"button",37),h("click",function(){m(e);let o=s(2);return C(o.generatePassword())}),I(16,9),A(17,"sh-icon"),P(),r(),T(18,Oa,4,1,"button",38),r(),T(19,Ma,2,0,"sh-alert",39),r()}if(n&2){let e=s(2);_(5),d("type",e.showPassword()?"text":"password"),_(),S(e.generalForm.value.password?6:-1),_(2),d("type",e.showPassword()?"text":"password"),_(),S(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),_(4),S(e.showPassword()?13:14),_(5),S(e.showCopyPassword()?18:-1),_(),S(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function wa(n,t){if(n&1&&(l(0,"sh-select",27)(1,"label",28),x(2,6),r(),A(3,"input",29),z(4,Fa,1,1,"ng-template"),r(),T(5,xa,20,7,"div",30)),n&2){let e=s();d("options",e.encryptionOptions())("isClearable",!1),_(5),S(e.encryptionFieldSignal()!==e.noneOptionKey?5:-1)}}function Ra(n,t){if(n&1&&(l(0,"button",24),I(1,13),A(2,"sh-icon"),P(),r()),n&2){let e=s();d("disabled",e.nameAndDescriptionValid()===!1)}}function La(n,t){if(n&1&&(l(0,"button",25),I(1,14),A(2,"sh-icon"),P(),r()),n&2){let e=s();d("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var ke=new gt,yn=(n={name:"",description:"",encryption:"",password:"",repeatPassword:"",compression:""})=>ke.group({name:ke.control(n.name,[ct.required]),description:ke.control(n.description),encryption:ke.control(n.encryption,[Fn()]),password:ke.control(n.password,[Vt(t=>t?.value.encryption!=="-",[ct.required])]),repeatPassword:ke.control(n.repeatPassword,[Vt(t=>t?.value.encryption!=="-",[ct.required])]),compression:ke.control(n.compression)}),at={Key:"-",DisplayName:"None"},zt=class n{#e=y(Re);#t=y(We);#n=y(hn);#i=y(Pe);#a=y(fe);formRef=Xe.required("formRef");generalForm=this.#i.generalForm;generalFormSignal=this.#i.generalFormSignal;encryptionFieldSignal=this.#i.encryptionFieldSignal;encryptionOptions=this.#i.encryptionOptions;isNew=this.#i.isNew;showPassword=F(!1);copiedPassword=F(!1);showCopyPassword=F(!1);noneOptionKey=at.Key;encryptionEffect=oe(()=>{this.encryptionFieldSignal()===at.Key&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=O(()=>{let t=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=O(()=>{let e=this.generalFormSignal()?.password??"";return this.#n.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#i.exit(!0)}async copyPassword(){let t=this.generalForm.controls.password.value;await this.#l(t??""),this.copiedPassword.set(!0)}async#l(t){try{await navigator.clipboard.writeText(t)}catch{try{let i=document.createElement("textarea");i.value=t,document.body.appendChild(i),i.select(),document.execCommand("copy"),document.body.removeChild(i)}catch(i){console.error("Failed to copy text: ",i)}}}generatePassword(){this.copiedPassword.set(!1);let t=this.#n.generate(16);this.generalForm.controls.password.setValue(t),this.generalForm.controls.repeatPassword.setValue(t),this.showCopyPassword.set(!0)}next(){this.#i.isNew()||this.#i.submit(!0),this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=X({type:n,selectors:[["app-general"]],viewQuery:function(e,i){e&1&&ze(i.formRef,Ea,5),e&2&&Je()},decls:21,vars:4,consts:()=>{let t;t=$localize`Your backup name`;let e;e=$localize`Your backup description`;let i;i=$localize`Remember to copy the password`;let o;o=$localize`General backup settings`;let a;a=$localize` Backup name ${"\uFFFD#8\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#8\uFFFD"}:CLOSE_SUPERSCRIPT:`;let c;c=$localize`Backup description`;let u;u=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Exit `;let g;g=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Encrypted backup `;let E;E=$localize`Encryption`;let v;v=$localize`Encryption`;let K;K=$localize`Password`;let q;q=$localize`Repeat password`;let L;L=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let D;D=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,D=Ze(D);let b;b=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let V;V=$localize`Passwords do not match`;let M;M=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,M=Ze(M);let J;J=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let ue;ue=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let pe;return pe=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],o,a,c,u,g,v,L,D,b,V,M,J,ue,pe,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],[1,"primary"],["for","backupName"],["type","text","tabindex","1","placeholder",t,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","shButton","",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],["shButton","","type","submit","shTooltip",i,1,"raised","primary",3,"disabled"],["icon",""],["value","Key","label","DisplayName",3,"options","isClearable"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",E,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",K,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",q,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["shButton","","type","button",1,"small","copy",3,"click"],[1,"sh-success"]]},template:function(e,i){if(e&1){let o=N();l(0,"form",15,0),h("submit",function(){return m(o),C(i.next())}),l(2,"h3",16),x(3,1),r(),T(4,ha,3,0,"sh-alert",17),l(5,"sh-form-field")(6,"label",18),I(7,2),A(8,"sup"),P(),r(),A(9,"input",19),r(),l(10,"sh-form-field")(11,"label",20),x(12,3),r(),A(13,"textarea",21),r(),T(14,wa,6,3),l(15,"div",22)(16,"button",23),h("click",function(){return m(o),C(i.exit())}),I(17,4),A(18,"sh-icon"),P(),r(),T(19,Ra,3,1,"button",24)(20,La,3,1,"button",25),r()()}if(e&2){let o;d("formGroup",i.generalForm),_(4),S(!i.isNew()&&((o=i.generalFormSignal())==null?null:o.encryption)!==""?4:-1),_(10),S(i.isNew()?14:-1),_(5),S(i.encryptionFieldSignal()===i.noneOptionKey||!i.isNew()?19:20)}},dependencies:[He,ut,re,se,dt,Ct,mt,Se,$e,ie,ne,Et,Tt,Ft],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--error-8)}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.copy[_ngcontent-%COMP%] sh-icon.sh-success[_ngcontent-%COMP%]{color:var(--success-8)}"],changeDetection:0})};export{yn as a,at as b,zt as c,xt as d,Dn as e,kt as f,Ut as g,it as h,be as i,Ye as j,Rt as k,$t as l,Gt as m,ot as n,In as o,Bt as p,Pe as q};
package/chunk-MUFBZIQA.js DELETED
@@ -1 +0,0 @@
1
- import{a as He}from"./chunk-HSHF5HR7.js";import{a as je}from"./chunk-HUZXJWCG.js";import{A as ke,B as de,H as J,J as $e,K as Be,L as Ve,P as We,W as Ge,a as ae,c as G,e as z,i as j,k as ce,s as H,u as Ie,y as Ae,z as Le}from"./chunk-UNMDSCAN.js";import{c as ze}from"./chunk-CFNARBNK.js";import{_ as we}from"./chunk-7AVOHYTE.js";import{$ as N,Ab as d,Bb as oe,E as ue,Fb as Ee,Gb as Me,Gc as xe,Hb as pe,Ib as A,Mc as x,Pa as u,Pb as be,Qb as Pe,Qc as Re,Rb as I,Rc as m,Sb as K,Sc as he,Tb as Q,Vb as D,W as ee,Xb as p,Yb as W,Zb as O,aa as S,cb as V,cc as Ne,dc as Se,ec as ge,fc as re,gc as w,hb as q,jc as P,kc as ve,l as me,la as T,lc as Oe,mc as Fe,na as R,oc as L,p as X,pc as k,qc as $,rb as te,sb as F,tb as y,ub as Te,v as fe,wb as ie,wc as se,xb as ne,xc as ye,yb as b,yc as le,z as Ce,zb as c,zc as De}from"./chunk-26Z7TPJB.js";import{a as Y,b as Z}from"./chunk-7CGTOI24.js";var Ze=[[["label"]],[["","prefix",""]],[["","suffix",""]]],et=["label","[prefix]","[suffix]"];function tt(o,t){if(o&1&&P(0),o&2){let e=t.$implicit,i=p();Fe("",e.label,"",i.hasPerSecond()?"/s":"")}}var it=["throttle-upload","throttle-download"],nt=[{value:"B",label:"Bytes"},{value:"KB",label:"KB"},{value:"MB",label:"MB"},{value:"GB",label:"GB"},{value:"TB",label:"TB"},{value:"PB",label:"PB"}],ot=o=>{if(!o||typeof o!="string"||o.length===0)return{size:0,unit:"MB"};let t=o.match(/^(\d+)(bytes|kb|mb|gb|tb|pb|b|kib|mib|gib|tib|pib)$/i);return t&&(t[2].toUpperCase()==="B"||t[2].toUpperCase()==="BYTES")?{size:1,unit:"KB"}:{size:t?parseInt(t[1],10):0,unit:t?t[2].toUpperCase():"MB"}},Je=class o{customId=m();inputType=m();timespan=T(0);unit=T("MB");sizeOptions=T(nt);readonly=T(!1);hasPerSecond=x(()=>{let t=this.inputType();return t&&it.includes(t)});onChange=()=>{};onTouched=()=>{};onChangeEffect=R(()=>{this.onChange(this.getValue())});writeValue(t){if(t){let e=ot(t);e?queueMicrotask(()=>{this.timespan.set(e.size),this.unit.set(e.unit)}):(this.timespan.set(0),this.unit.set("MB"))}else this.timespan.set(0),this.unit.set("MB")}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.readonly.set(t)}getValue(){return`${this.timespan()}${this.unit()}`}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=V({type:o,selectors:[["app-size"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[se([{provide:ae,useExisting:o,multi:!0}])],ngContentSelectors:et,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(e,i){e&1&&(W(Ze),c(0,"div",0),O(1,0,["ngProjectAs","label",5,["label"]]),d(),c(2,"sh-form-field")(3,"input",1),$("ngModelChange",function(r){return k(i.timespan,r)||(i.timespan=r),r}),d(),O(4,1),O(5,2),d(),c(6,"sh-select",2)(7,"input",3),$("ngModelChange",function(r){return k(i.unit,r)||(i.unit=r),r}),d(),q(8,tt,1,2,"ng-template"),d()),e&2&&(u(2),te("readonly",i.readonly()||void 0),u(),b("id",i.customId()),L("ngModel",i.timespan),b("disabled",i.readonly()),u(3),re("--miw",0),b("options",i.sizeOptions())("readonly",i.readonly())("isClearable",!1),u(),L("ngModel",i.unit))},dependencies:[We,J,H,G,ce,z,j],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 rt=["treeContainer"],st=["formRef"],lt=[[["label"]],[["label"]],[["input"]]],at=["label","label","input"],ct=o=>({children:o,level:0}),Ke=o=>({$implicit:o}),dt=(o,t)=>({children:o,level:t}),ut=()=>({maxWidth:"700px",width:"100%"}),pt=(o,t)=>t.id;function gt(o,t){if(o&1){let e=A();c(0,"sh-button-group",10)(1,"button",20),D("click",function(){N(e);let n=p();return S(n.pathDiscoveryMethod.set("browse"))}),I(2,4),d(),c(3,"button",20),D("click",function(){N(e);let n=p();return S(n.pathDiscoveryMethod.set("path"))}),I(4,5),d()()}if(o&2){let e=p();u(),w("active",e.pathDiscoveryMethod()==="browse"),u(2),w("active",e.pathDiscoveryMethod()==="path")}}function ht(o,t){o&1&&oe(0,"sh-progress-bar",13)}function _t(o,t){o&1&&(c(0,"sh-icon",25),P(1,"caret-down"),d())}function mt(o,t){o&1&&oe(0,"sh-icon",25)}function ft(o,t){o&1&&(c(0,"sh-icon",25),P(1,"caret-right"),d())}function Ct(o,t){o&1&&(c(0,"sh-icon",23),P(1,"folder-open"),d())}function Tt(o,t){o&1&&(c(0,"sh-icon",23),P(1,"folder-user"),d())}function Et(o,t){o&1&&(c(0,"sh-icon",23),P(1,"file"),d())}function Mt(o,t){o&1&&(c(0,"sh-icon",23),P(1,"folder"),d())}function bt(o,t){if(o&1&&(F(0,_t,2,0,"sh-icon",25)(1,mt,1,0,"sh-icon",25)(2,ft,2,0,"sh-icon",25),F(3,Ct,2,0,"sh-icon",23)(4,Tt,2,0,"sh-icon",23)(5,Et,2,0,"sh-icon",23)(6,Mt,2,0,"sh-icon",23)),o&2){let e=p(2).$implicit;y(e.children.length?0:e.cls==="file"?1:2),u(3),y(e.children.length?3:e.id==="%HOME%"?4:e.cls==="file"?5:6)}}function Pt(o,t){o&1&&(c(0,"sh-icon",23),P(1,"desktop-tower"),d())}function Nt(o,t){o&1&&pe(0)}function St(o,t){if(o&1&&q(0,Nt,1,0,"ng-container",14),o&2){let e=p(2).$implicit,i=p().$implicit;p();let n=ge(7);b("ngTemplateOutlet",n)("ngTemplateOutletContext",le(5,Ke,De(2,dt,e.children,i.level+1)))}}function vt(o,t){if(o&1){let e=A();c(0,"div",21,3),D("click",function(){N(e);let n=p().$implicit,r=p(2);return S(r.toggleNode(n.id,n))}),c(2,"div",22),F(3,bt,7,2)(4,Pt,2,0,"sh-icon",23),d(),c(5,"div",24),D("click",function(n){N(e);let r=p().$implicit,a=p(2);return S(a.toggleSelectedNode(n,r))}),P(6),d()(),F(7,St,1,7,"ng-container")}if(o&2){let e=p().$implicit,i=p().$implicit,n=p();w("accepted",e.accepted===!0)("active",e.evalState===n.TreeEvalEnum.Included)("indeterminate",e.isIndeterminate)("open",e.children.length)("usually-hidden",e.hidden)("root",i.level===0),u(2),w("file",e.cls==="file"),u(),y(e.id!=="/"?3:4),u(3),Oe(" ",e.text," "),u(),y(e.children.length>0?7:-1)}}function Ot(o,t){if(o&1&&F(0,vt,8,17),o&2){let e=t.$implicit,i=p(2);y(e.hidden&&i._showHiddenNodes()||!e.hidden?0:-1)}}function Ft(o,t){if(o&1&&(c(0,"sh-list"),ie(1,Ot,1,1,null,null,pt),d()),o&2){let e=t.$implicit;re("padding-left",e.level*.25,"rem"),u(),ne(e.children)}}function yt(o,t){o&1&&pe(0)}function Dt(o,t){if(o&1){let e=A();c(0,"sh-toggle",26),D("click",function(){N(e);let n=p();return S(n._showHiddenNodes.set(!n._showHiddenNodes()))}),I(1,6),d()}if(o&2){let e=p();w("active",e._showHiddenNodes()),u(),K(e.showFiles()?"files":"folders"),Q(1)}}function xt(o,t){if(o&1){let e=A();c(0,"button",27),D("click",function(){N(e);let n=p();return S(n.openCreateFolderDialog())}),I(1,7),d()}if(o&2){let e=p();b("disabled",!e.isCurrentPathFolder())}}function Rt(o,t){if(o&1){let e=A();c(0,"sh-dialog",28),$("isOpenChange",function(n){N(e);let r=p();return k(r.createFolderDialogOpen,n)||(r.createFolderDialogOpen=n),S(n)}),c(1,"header",29)(2,"h2"),I(3,8),d()(),c(4,"div",30)(5,"div"),P(6," Folder will be created under "),c(7,"pre"),P(8),d()(),c(9,"sh-form-field")(10,"textarea",31),$("ngModelChange",function(n){N(e);let r=p();return k(r.createFolderPath,n)||(r.createFolderPath=n),S(n)}),d()()(),c(11,"footer",32)(12,"button",33),D("click",function(){N(e);let n=p();return S(n.closeCreateFolderDialog(!1))}),P(13,"Cancel"),d(),c(14,"button",34),D("click",function(){N(e);let n=p();return S(n.closeCreateFolderDialog(!0))}),be(15,9),oe(16,"sh-icon"),Pe(),d()()()}if(o&2){let e,i=p();L("isOpen",i.createFolderDialogOpen),b("options",ye(5,ut)),u(8),ve(i.currentPath()),u(2),L("ngModel",i.createFolderPath),u(4),b("disabled",!((e=i.createFolderPath())!=null&&e.length))}}var Qe=(r=>(r[r.ExcludedByParent=-2]="ExcludedByParent",r[r.Excluded=-1]="Excluded",r[r.None=0]="None",r[r.Included=1]="Included",r[r.IncludedByParent=2]="IncludedByParent",r))(Qe||{}),v="/",_e=class o{#e=ee(ze);#n=ee(je);#d=ee(Le);multiSelect=m(!1);disabled=m(!1);showFiles=m(!1);selectFiles=m(!1);accepts=m(null);startingPath=m(null);rootPaths=m([]);initialNodes=m([]);backupSettings=m(null);pathRefreshTrigger=m(!1);showHiddenNodes=m(!1);enableCreateFolder=m(!1);hideShortcuts=m(!1);office365Mode=m(!1);backupId=m("");destinationUrl=m("");loadExtendedData=m(!0);hasExtendedData=Re();_showHiddenNodes=T(!1);createFolderDialogOpen=T(!1);createFolderPath=T(null);treeContainerRef=he("treeContainer");formRef=he("formRef");pathDiscoveryMethod=T("browse");isLoading=T(!1);currentPath=T("/");#o=T(null);treeSearchQuery=T("");treeNodes=T([]);pathDelimiter=x(()=>this.#n.systemInfo()?.DirectorySeparator??"");filterGroups=this.#n.filterGroups();isByBackupSettings=x(()=>{let t=this.backupSettings();return!(t===void 0||t?.id===void 0||t?.time===void 0)});searchableTreeNodes=x(()=>{let t=this.treeSearchQuery();return t?this.treeNodes().filter(e=>e.text?.toLowerCase().includes(t.toLowerCase())):this.treeNodes()});TreeEvalEnum=Qe;treeStructure=x(()=>{let t=this.showHiddenNodes(),e=this.currentPath().split("\0").filter(l=>l!==""&&l!==v),i=structuredClone(e);for(let l=0;l<i.length;l++){let f=i[l].slice(1);if(f.startsWith("{")&&f.endsWith("}")){let h=f.slice(1,-1),_=this.filterGroups?.FilterGroups[h];if(_&&_.length){let E=_.map(M=>`-${M}`);i.splice(l,1,...E)}}}let n=this.searchableTreeNodes(),r=this.rootPaths(),a=this.accepts(),C=this.pathDelimiter(),s=[];return r.length>0?s=r.map(l=>{let g=this.#r(i,l,"folder",null);return{id:l,resolvedpath:l,text:l,parentPath:"",children:[],evalState:g,isIndeterminate:!1,cls:this.#t(l,C)?"folder":"file"}}):s=[{id:v,resolvedpath:v,text:$localize`Computer`,parentPath:"",children:[],evalState:0,isIndeterminate:!1,cls:"folder"}],s.map(l=>{let g=new Map;if(!l.id)return;let f=l.id;a&&(l.accepted=!0),g.set(f,l);let h=r.length>0?n.filter(_=>_.parentPath.startsWith(f)):n;for(let _ of h){if(!_.id)continue;let E=_.id;if(!_.cls||g.has(E))continue;let M=g.get(_.parentPath),U=_.hidden===!0&&t?0:this.#r(i,E,_.cls,M),B=Z(Y({},_),{isIndeterminate:this.isIndeterminate(i,E),evalState:U,children:[]});a&&(B.accepted=this.matchAccepts(a,B)),g.set(E,B),M&&M.children.push(B)}return l}),s});#u(t){let e=this.pathDelimiter();return t?t.endsWith(e)||t===v?t:t+e:v}#r(t,e,i,n){if(n&&n.evalState===-1)return-2;let r=0,a=this.pathDelimiter(),C=t.filter(g=>!g.startsWith("-")&&!g.startsWith("+")),s=t.filter(g=>g.startsWith("-")||g.startsWith("+")),l=this.multiSelect();if(C.length===0)return r;for(let g=0;g<C.length;g++){let f=C[g];if(e===f){r=1;break}if(!l||!this.#t(f,a))continue;if(e?.startsWith(f)){r=1;break}}if(s.length===0)return r;for(let g=0;g<s.length;g++){let f=s[g],h=f.slice(1),_=f.startsWith("-")?-1:1;if(this.#t(h,a)){if(i!=="folder")continue;if(e===h){r=_;break}}if(h.startsWith("*")&&h.endsWith(`*${a}`)){if(i!=="folder")continue;let M=h.slice(1,-2);if(M==="")break;if(e?.includes(M+a)){r=_;break}}if(h.startsWith("[.*")&&h.endsWith(`[^\\${a}]*]`)){if(i!=="file")continue;let M=h.slice(3,-7);if(new RegExp(M).test(e)){r=_;break}}if(h.startsWith("[")&&h.endsWith("]")){let M=h.slice(1,-1),U=this.translateCSharpRegex(M);if(new RegExp(`${U}`).test(e)){r=_;break}}if(h.startsWith("*.")){if(i!=="file"||h.replace("*.","").length===0)continue;if(this.#s(e,h,!0)){r=_;break}}if(h==="")continue;if(h===e){r=_;break}if(this.#s(e,h,!0)){r=_;break}}return r}translateCSharpRegex(t){let e=t;e=e.replace(/^@/,"");let i=/\(\?<(?<name>\w+)>(?<pattern>[^)]+)\)/g;return e=e.replace(i,(n,r,a)=>`(${a})`),e=e.replace(/\\/g,"\\\\"),e}isIndeterminate(t,e){return t.filter(i=>!i.startsWith("-")&&this.#t(i,this.pathDelimiter())).some(i=>i.startsWith(e))}isCurrentPathFolder(){let t=this.currentPath();return t?t.endsWith(this.pathDelimiter())||t.startsWith("%")&&t.endsWith("%")&&!t.includes(this.pathDelimiter()):!1}#s(t,e,i=!1){let n=e.replace(/\*/g,".*").replace(/\?/g,".").replace(/\[!([^\]]+)\]/g,"[^$1]");return new RegExp(`${n}${i?"$":""}`).test(t)}showHiddenNodesEffect=R(()=>this._showHiddenNodes.set(this.showHiddenNodes()));pathDiscoveryMethodEffect=R(()=>{let t=this.pathDiscoveryMethod(),e=this.#o();t==="browse"&&e&&this.currentPath.set(e.value)});matchAccepts(t,e){if(!t||e.cls==="folder"||e.id===v)return!0;let i=t.split(",");if(i.length===0)return!0;let n="."+e.id.slice(e.id.indexOf("."));return n?i.some(r=>n.endsWith(r)):!1}currentPathEffect=R(()=>{let t=this.#o();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))});inputValueChangeAbortController=null;inputRefEffect=R(()=>{let t=this.formRef()?.nativeElement?.querySelector("input");t&&(this.#p(t),this.inputValueChangeAbortController&&this.inputValueChangeAbortController.abort(),this.inputValueChangeAbortController=new AbortController,t.addEventListener("inputValueChanged",e=>{this.currentPath.set(e.detail.value)},{signal:this.inputValueChangeAbortController.signal}),this.#o.set(t),t.autocomplete="off")});ngOnInit(){let t=this.startingPath();if(t)this.currentPath.set(t),this.#m(t);else{let e=this.rootPaths(),i=this.initialNodes();e&&e.length>0?(i&&i.length>0&&this.treeNodes.set(i.map(n=>({id:n.id,leaf:n.leaf,cls:n.cls,text:this.#c(n.text,n?.Metadata),iconCls:n.iconCls,fileSize:n.fileSize,resolvedpath:n.resolvedpath,parentPath:this.getParentPath(n.id??"")}))),this.#i(null,e[0])):this.#i(null,v)}}getParentPath(t){let e=this.pathDelimiter(),i=t.split(e);return i.length<=1?v:(i.pop(),i.length!==0&&i.pop(),i.join(e)+e)}toggleSelectedNode(t,e){if(e.id===v||(t.stopPropagation(),e.evalState===-2))return;if(this.selectFiles()&&e.cls==="folder"){this.toggleNode(e.id,e);return}if(this.accepts()&&!e.accepted)return;let n=this.currentPath().split("\0").filter(s=>s!==""&&s!==v),a=this.isChildOfSelected(e)?`-${e.id}`:e.id,C=this.#t(e.id,this.pathDelimiter());if(this.multiSelect())if(n.includes(e.id))this.currentPath.set(n.filter(s=>s!==e.id&&!(C&&s.startsWith(a))).join("\0"));else if(n.some(s=>s==a))this.currentPath.set(n.filter(s=>s!==a).join("\0"));else{let s=C?n.filter(l=>!l.startsWith(e.id)):n;this.currentPath.set([...s,a].join("\0"))}else n.includes(e.id)?this.currentPath.set(n.filter(s=>s!==e.id).join("\0")):this.currentPath.set(e.id)}isChildOfSelected(t){return this.currentPath().split("\0").filter(i=>i!==""&&i!==v&&this.#t(i,this.pathDelimiter())).some(i=>t.id?.startsWith(i)||`-${t.id}`.startsWith(i))}toggleNode(t,e=null){e?.cls==="folder"&&(e?.children.length?this.treeNodes.update(i=>i.filter(n=>!n.id?.startsWith(e.id)||n.id===e.id)):this.#i(e,t))}openCreateFolderDialog(){return this.createFolderPath.set(null),this.createFolderDialogOpen.set(!0),!1}closeCreateFolderDialog(t){if(t&&this.createFolderPath()?.length&&this.isCurrentPathFolder()){let e=this.createFolderPath()?.trim();if(e){let i=this.currentPath(),n=this.#u(e),r=i+n;this.#e.postApiV1RemoteoperationCreate({requestBody:{path:"file://"+r}}).subscribe({next:()=>{this.currentPath.set(r),this.#i(null,i),setTimeout(()=>{this.#l()},500),this.createFolderDialogOpen.set(!1)},error:a=>{let C=a?.message?.match(/user-information\s*:\s*(.*?)(?:\s*,|$)/i),s=C?C[1]:a?.message||$localize`An error occurred while trying to create the folder.`;this.#d.open(He,{data:{title:$localize`Cannot create folder`,message:s,confirmText:$localize`OK`,cancelText:void 0}})}})}}else this.createFolderDialogOpen.set(!1);return!1}#l(){setTimeout(()=>{let e=this.treeContainerRef()?.nativeElement?.querySelector(".active");e&&e.scrollIntoView({behavior:"smooth",block:"center"})},100)}#p(t){return Object.defineProperty(t,"value",{configurable:!0,get(){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").get.call(this)},set(e){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").set.call(this,e),this.dispatchEvent(new CustomEvent("inputValueChanged",{bubbles:!0,cancelable:!0,detail:{value:e}})),e}}),t}#g(t){return this.#e.postApiV1Filesystem({showHidden:!0,requestBody:{path:t},onlyFolders:!this.showFiles()})}#h(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"office365",requestBody:{"backup-id":this.backupId()??"",operation:"ListDestinationRestoreTargets",url:this.destinationUrl()??"",path:t??"/"}}).pipe(X(e=>{let i=e.Result;return Object.keys(i).map(n=>({Path:n,Metadata:JSON.parse(i[n])}))}))}#_(t){let e=this.backupSettings();if(this.#n.hasV2ListOperations())return this.#e.postApiV2BackupListFolder({requestBody:{BackupId:e.id,Time:e.time,Paths:t?[t]:null,PageSize:0,Page:0,ReturnExtended:this.office365Mode()||this.loadExtendedData()}}).pipe(X(i=>i.Data??[]));{let i={id:e.id+"",prefixOnly:!1,folderContents:!0,time:e.time,filter:t?"@"+t:void 0};return this.#e.getApiV1BackupByIdFiles(i).pipe(X(n=>n.Files??[]))}}#a(t){return this.office365Mode()?this.#h(t):this.isByBackupSettings()?this.#_(t):this.#g(t)}#m(t){let e=this.pathDelimiter(),i=t.split("\0").filter(s=>s.startsWith("-")).map(s=>s.slice(1,-1)),r=t.split("\0").filter(s=>!s.startsWith("-")).filter(Boolean).map(s=>{let l=s.split(e);return l.at(-1)!==""&&l.pop(),l}),a=[v];r.forEach(s=>{s.forEach((l,g)=>{let f=s.slice(0,g+1).join(e);f!==""&&(a.includes(f)||a.push(f))})}),this.isLoading.set(!0);let C=a.map(s=>this.#a(s).pipe(X(l=>({status:"success",value:l,url:s})),Ce(l=>me({status:"error",value:l,url:s}))));fe(C).pipe(ue(()=>this.isLoading.set(!1))).subscribe({next:s=>{let l=s.filter(f=>f.status==="success"),g=s.filter(f=>f.status==="error");this.treeNodes.update(f=>{let h=l.flatMap(E=>Array.isArray(E.value)?E.value.map(M=>Z(Y({},M),{parentPath:E.url})):[]),_=[...new Map([...f,...h].map(E=>[E.id,E])).values()];return this.#l(),this.hideShortcuts()?_.filter(E=>!E.id.startsWith("%")):_})}})}#c(t,e){if(e){let i=e["o365:Name"]||e["o365:DisplayName"];if(i)return i}return t}#f(t){t&&t.ExtType&&t.ExtType.length>0&&this.hasExtendedData.emit(t.ExtType)}#t(t,e){return t.startsWith("%")&&t.endsWith("%")||t.endsWith(e)}#i(t=null,e=v){let i=this.pathDelimiter();this.isLoading.set(!0),this.#a(e).pipe(ue(()=>this.isLoading.set(!1))).subscribe({next:n=>{let r=this.isByBackupSettings()||this.office365Mode()?n.map(a=>(this.#f(a.Metadata),{text:this.#c(a.Path.split(i).filter(s=>s!=="").pop(),a.Metadata),id:a.Path,cls:this.#t(a.Path,i)?"folder":"file",leaf:t!==null,resolvedpath:a.Path,hidden:!1})):n;this.treeNodes.update(a=>{let C=r.map(l=>{let g=this.#t(l.id,i)?"folder":"file";return Z(Y({},l),{cls:g,parentPath:e})}),s=[...new Map([...a,...C].map(l=>[l.id,l])).values()];return this.hideShortcuts()?s.filter(l=>!l.id.startsWith("%")):s})}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=V({type:o,selectors:[["app-file-tree"]],viewQuery:function(e,i){e&1&&Ne(i.treeContainerRef,rt,5)(i.formRef,st,5),e&2&&Se(2)},hostVars:2,hostBindings:function(e,i){e&2&&w("disabled",i.disabled())},inputs:{multiSelect:[1,"multiSelect"],disabled:[1,"disabled"],showFiles:[1,"showFiles"],selectFiles:[1,"selectFiles"],accepts:[1,"accepts"],startingPath:[1,"startingPath"],rootPaths:[1,"rootPaths"],initialNodes:[1,"initialNodes"],backupSettings:[1,"backupSettings"],pathRefreshTrigger:[1,"pathRefreshTrigger"],showHiddenNodes:[1,"showHiddenNodes"],enableCreateFolder:[1,"enableCreateFolder"],hideShortcuts:[1,"hideShortcuts"],office365Mode:[1,"office365Mode"],backupId:[1,"backupId"],destinationUrl:[1,"destinationUrl"],loadExtendedData:[1,"loadExtendedData"]},outputs:{hasExtendedData:"hasExtendedData"},ngContentSelectors:at,decls:18,vars:17,consts:()=>{let t;t=$localize` Browse path `;let e;e=$localize` Manually type path `;let i;i=$localize` Show hidden ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let n;n=$localize` Create folder `;let r;r=$localize`Enter new folder path`;let a;return a=$localize` Create folder ${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:folder-plus${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["treeContainer",""],["recursiveTree",""],["formRef",""],["treeNode",""],t,e,i,n,r,a,[1,"type-b","small"],[1,"section"],[1,"browse-files"],[1,"indeterminate","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"footer"],[1,"primary","raised","browse-files-toggle",3,"active"],["shButton","","type","button",1,"small","create-folder",3,"disabled"],[1,"form-field"],[3,"isOpen","options"],["type","button",3,"click"],["action","",3,"click"],[1,"icon"],[1,"primary"],[1,"text",3,"click"],[1,"small"],[1,"primary","raised","browse-files-toggle",3,"click"],["shButton","","type","button",1,"small","create-folder",3,"click","disabled"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click","disabled"]]},template:function(e,i){if(e&1&&(W(lt),F(0,gt,5,4,"sh-button-group",10),c(1,"div",11),O(2,0,["ngProjectAs","label",5,["label"]]),c(3,"div",12,0),F(5,ht,1,0,"sh-progress-bar",13),q(6,Ft,3,2,"ng-template",null,1,xe)(8,yt,1,0,"ng-container",14),d(),c(9,"div",15),F(10,Dt,2,3,"sh-toggle",16),F(11,xt,2,1,"button",17),d()(),c(12,"div",18,2)(14,"sh-form-field"),O(15,1,["ngProjectAs","label",5,["label"]]),O(16,2,["ngProjectAs","input",5,["input"]]),d()(),F(17,Rt,17,6,"sh-dialog",19)),e&2){let n=ge(7);y(!i.multiSelect()&&!i.office365Mode()?0:-1),u(),w("hidden",i.pathDiscoveryMethod()!=="browse"),u(2),w("visualize-accepted",i.accepts()),u(2),y(i.isLoading()?5:-1),u(3),b("ngTemplateOutlet",n)("ngTemplateOutletContext",le(15,Ke,le(13,ct,i.treeStructure()))),u(2),y(!i.accepts()&&!i.isByBackupSettings()&&!i.office365Mode()?10:-1),u(),y(i.enableCreateFolder()&&!i.office365Mode()?11:-1),u(),w("hidden",i.pathDiscoveryMethod()!=="path"),u(5),y(i.createFolderDialogOpen()?17:-1)}},dependencies:[de,ke,Ge,Ie,J,$e,Ve,Ae,we,H,G,z,j],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem}.disabled[_nghost-%COMP%]{opacity:.5;-webkit-user-select:none;user-select:none;pointer-events:none;position:relative}.disabled[_nghost-%COMP%]:before{content:"";position:absolute;inset:0;background:transparent}.fill[_nghost-%COMP%]{height:auto;overflow:hidden;flex:1 0}.fill[_nghost-%COMP%] .section[_ngcontent-%COMP%]{height:auto;overflow:hidden;flex:1 0;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto 1fr;grid-template-areas:"label toggle" "tree tree"}.fill[_nghost-%COMP%] .browse-files[_ngcontent-%COMP%]{resize:none;height:initial;grid-area:tree}.fill[_nghost-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.fill[_nghost-%COMP%] sh-toggle[_ngcontent-%COMP%]{grid-area:toggle;flex-direction:row-reverse}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.form-field.hidden[_ngcontent-%COMP%]{display:none}.browse-files[_ngcontent-%COMP%]{display:flex;gap:.5rem;padding:.5rem 1rem;height:12.5rem;border:1px solid var(--base-4);border-radius:var(--shape-3);overflow:auto;resize:vertical;background:var(--base-1);position:relative}.browse-files[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]:not(.accepted){opacity:.5}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action].accepted[_ngcontent-%COMP%]{opacity:1}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%]{--list-active-bg: var(--base-3);gap:.125rem;padding:0;height:min-content;min-width:min-content}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0;gap:0;border:1px solid transparent}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].active[_ngcontent-%COMP%]{border-color:transparent;--list-active-bg: var(--primary-2)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].indeterminate[_ngcontent-%COMP%]{border-color:var(--primary-4)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].usually-hidden[_ngcontent-%COMP%]{opacity:.6}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%]{gap:.25rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]:has(sh-icon:nth-child(2)){width:3rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:1.5rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;height:100%;width:max-content;display:flex;align-items:center}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:3rem;gap:.25rem;height:1.5rem;display:flex;align-items:center;justify-content:center;cursor:pointer}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon.file[_ngcontent-%COMP%]{width:3rem;padding:0 .25rem}.browse-files-toggle[_ngcontent-%COMP%]{color:var(--base-9)}.hidden[_ngcontent-%COMP%]{display:none}.footer[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:space-between;align-items:center}'],changeDetection:0})};var wt=[[["label"]],[["","prefix",""]],[["","suffix",""]]],It=["label","[prefix]","[suffix]"];function At(o,t){if(o&1){let e=A();c(0,"button",7),D("click",function(){let n=N(e).$implicit,r=p();return S(r.updateUnit(n.value))}),I(1,1),d()}if(o&2){let e=t.$implicit;u(),K(e.label),Q(1)}}var Lt=[{value:"s",label:$localize`Seconds`},{value:"m",label:$localize`Minutes`},{value:"h",label:$localize`Hours`}],kt=[{value:"Y",label:$localize`Years`},{value:"M",label:$localize`Months`},{value:"W",label:$localize`Weeks`},{value:"D",label:$localize`Days`}],$t=["retry-delay","web-timeout","read-write-timeout","run-script-timeout","list-timeout","short-timeout"],Ye=class o{customId=m();inputType=m();timespan=T(0);#e="D";unit=T(this.#e);unitLabel=x(()=>{let t=this.timeOptions(),e=t.findIndex(i=>i.value===this.unit());return t[e]?.label??this.unit()});isShortTime=x(()=>{let t=this.inputType();return t&&$t.includes(t.replace("--",""))});timeOptions=x(()=>this.isShortTime()?Lt:kt);readonly=T(!1);onChange=()=>{};onTouched=()=>{};onChangeEffect=R(()=>{this.onChange(this.getValue())});inputTypeEffect=R(()=>{let t=this.timeOptions(),e=this.isShortTime()?"s":"D";this.#e=e,this.unit.set(e)});updateUnit(t){this.unit.set(t)}writeValue(t){let e=this.isShortTime();if(t){let i=e?/(\d+)([smh])/i:/^(\d+)([YMWD])$/i,n=t.match(i);n?(this.timespan.set(parseInt(n[1],10)),this.unit.set(n[2])):(this.timespan.set(0),this.unit.set(this.#e))}else this.timespan.set(0),this.unit.set(this.#e)}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.readonly.set(t)}getValue(){return`${this.timespan()}${this.unit()}`}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=V({type:o,selectors:[["app-timespan"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[se([{provide:ae,useExisting:o,multi:!0}])],ngContentSelectors:It,decls:11,vars:6,consts:()=>{let t;t=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let e;return e=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`,[t,e,["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(e,i){e&1&&(W(wt),O(0,0,["ngProjectAs","label",5,["label"]]),c(1,"sh-form-field")(2,"input",2),$("ngModelChange",function(r){return k(i.timespan,r)||(i.timespan=r),r}),d(),O(3,1),O(4,2),d(),c(5,"sh-menu",3)(6,"button",4),I(7,0),d(),Ee(8,5),ie(9,At,2,1,"button",6,Te),Me(),d()),e&2&&(u(),te("readonly",i.readonly()||void 0),u(),b("id",i.customId()),L("ngModel",i.timespan),b("disabled",i.readonly()),u(3),b("openIndicator",!0),u(2),K(i.unitLabel()),Q(7),u(2),ne(i.timeOptions()))},dependencies:[Be,J,H,G,ce,z,j,de],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{nt as a,ot as b,Je as c,_e as d,Ye as e};
package/chunk-P7OUKLCO.js DELETED
@@ -1 +0,0 @@
1
- import{g as he}from"./chunk-4AQZL2UM.js";import"./chunk-POPZ47SS.js";import{i as Re,j as Ne,k as pe,l as Ie,m as me,q as De}from"./chunk-LPAIFT5I.js";import"./chunk-MUFBZIQA.js";import{b as Oe,c as Ce}from"./chunk-IMHM7ISI.js";import"./chunk-6LAXPU22.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import{a as I}from"./chunk-HSHF5HR7.js";import"./chunk-D6IP567E.js";import"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import{B as de,H as ue,K as Fe,c as oe,e as ae,f as se,g as re,i as _e,j as le,s as ce,u as Te,w as Ee,y as Se,z as ge}from"./chunk-UNMDSCAN.js";import"./chunk-CFNARBNK.js";import{b as ne,d as ie}from"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import{$ as T,Ab as r,Bb as d,Fb as K,Gb as j,Ib as C,Mc as A,Pa as l,Pb as S,Qb as g,Rb as p,Sb as P,Sc as te,Tb as $,Ub as Q,Vb as u,W as R,Xb as _,aa as E,cb as H,cc as q,da as X,dc as Y,jc as L,la as N,oc as h,pc as f,qc as M,rc as y,sb as F,sc as x,tb as O,tc as w,wc as Z,xc as ee,yb as D,zb as s}from"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";var fe=["formRef"],Me=()=>({maxWidth:"700px",width:"100%"});function Ae(o,n){if(o&1){let e=C();s(0,"button",31),u("click",function(){T(e);let t=_();return E(t.testDestination(0,!0))}),p(1,4),r()}if(o&2){let e=_();D("disabled",e.testSignal()=="testing")}}function Pe(o,n){if(o&1){let e=C();s(0,"button",32),u("click",function(){T(e);let t=_();return E(t.openTargetUrlDialog())}),S(1,5),d(2,"sh-icon"),g(),r()}}function $e(o,n){if(o&1){let e=C();s(0,"button",32),u("click",function(){T(e);let t=_(2);return E(t.copyTargetUrl())}),S(1,7),d(2,"sh-icon"),g(),r()}}function Le(o,n){if(o&1){let e=C();s(0,"sh-menu")(1,"button",20)(2,"sh-icon"),L(3,"dots-three-vertical"),r()(),K(4,33),s(5,"button",32),u("click",function(){T(e);let t=_();return E(t.openTargetUrlDialog())}),S(6,6),d(7,"sh-icon"),g(),r(),F(8,$e,3,0,"button",20),j(),r()}if(o&2){_();let e=w(0);l(8),O(e?8:-1)}}function ye(o,n){o&1&&(s(0,"sh-alert"),S(1,8),d(2,"sh-icon",34),g(),r())}function xe(o,n){o&1&&(s(0,"sh-alert",21),S(1,9),d(2,"sh-icon",34),g(),r())}function we(o,n){if(o&1&&(s(0,"sh-alert",22),S(1,10),d(2,"sh-icon",34),g(),r()),o&2){let e=_();l(2),P(e.testErrorMessage()),$(1)}}function Ge(o,n){if(o&1&&(s(0,"sh-alert",23),S(1,11),d(2,"sh-icon",34),g(),r()),o&2){let e=_();l(2),P(e.testErrorMessage()),$(1)}}function be(o,n){if(o&1){let e=C();s(0,"app-destination-list-item",24)(1,"button",27),u("click",function(){T(e);let t=_();return E(t.removeDestination())}),p(2,12),r()()}if(o&2){_();let e=w(15);D("destination",e)}}function Ue(o,n){if(o&1){let e=C();s(0,"app-destination-list",35),u("setDestination",function(t){T(e);let a=_();return E(a.setDestination(t))}),r()}}function ke(o,n){if(o&1){let e=C();s(0,"app-single-destination",36),M("targetUrlChange",function(t){T(e);let a=_();return f(a.targetUrlModel,t)||(a.targetUrlModel=t),E(t)}),r()}if(o&2){let e=_();h("targetUrl",e.targetUrlModel)}}function ve(o,n){o&1&&(S(0,3,1),d(1,"sh-icon",29),g())}function We(o,n){o&1&&(S(0,3,2),d(1,"sh-icon"),g())}function Be(o,n){if(o&1){let e=C();s(0,"sh-dialog",37),M("isOpenChange",function(t){T(e);let a=_();return f(a.targetUrlDialogOpen,t)||(a.targetUrlDialogOpen=t),E(t)}),s(1,"header",38)(2,"div",39)(3,"h2"),p(4,13),r(),s(5,"sh-alert",22),p(6,14),r()()(),s(7,"div",40)(8,"sh-form-field")(9,"textarea",41),M("ngModelChange",function(t){T(e);let a=_();return f(a.targetUrlCtrl,t)||(a.targetUrlCtrl=t),E(t)}),r()()(),s(10,"footer",42)(11,"button",27),u("click",function(){T(e);let t=_();return E(t.closeTargetUrlDialog(!1))}),L(12,"Cancel"),r(),s(13,"button",43),u("click",function(){T(e);let t=_();return E(t.closeTargetUrlDialog(!0))}),S(14,15),d(15,"sh-icon"),g(),r()()()}if(o&2){let e=_();h("isOpen",e.targetUrlDialogOpen),D("options",ee(3,Me)),l(9),h("ngModel",e.targetUrlCtrl)}}var G=class o{#i=R(ie);#o=R(ne);#t=R(ge);#a=R(me);injector=R(X);#e=R(he);#s=R(Re);formRef=te.required("formRef");targetUrlModel=this.#e.destinationTargetUrl;targetUrlCtrl=N(null);targetUrlInitial=N(null);targetUrlDialogOpen=N(!1);toggleNewDestination=N(!0);testSignal=this.#e.testSignal;testErrorMessage=this.#e.testErrorMessage;destinationTypeOptionsInFocus=N(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#s.destinationTypeOptions;destinationTypeOptionsFocused=A(()=>{let n=this.destinationTypeOptionsInFocus(),e=this.destinationTypeOptions();return n.map(i=>e.find(t=>t.key===i))});selectedDestinationType=A(()=>{let n=this.#e.destinationTargetUrl();return n?Oe(n):null});selectedDestinationTypeOption=A(()=>{let n=this.selectedDestinationType();return n?{key:n.customKey??n.key,customKey:n.customKey??null,displayName:n.displayName,description:n.description,icon:n.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.#e.destinationTargetUrl()??"")}openTargetUrlDialog(){let n=this.#e.destinationTargetUrl();this.targetUrlCtrl.set(n),this.targetUrlInitial.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl(),i=this.targetUrlInitial();!n||e===i||!e||this.#e.updateTargetUrl(e)}testDestination(n,e,i){let t=this.#e.destinationTargetUrl();t&&(this.#e.setTestState("testing"),this.#a.testDestination(t,this.#e.backupId(),n,!1,"Backend",e).subscribe({next:a=>{if(a.action==="success"){this.#e.setTestState("success"),a.containsBackup===!1?(this.#e.setTestState("warning",$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`),e||this.#t.open(I,{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.#e.setTestState("warning",$localize`The remote destination is empty. Please check if the destination details are correct.`),e||this.#t.open(I,{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}})),i?.();return}if(this.#e.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){i?.();return}let m=t.includes("?");a.action==="trust-cert"&&this.#e.updateTargetUrl(t+`${m?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#e.updateTargetUrl(t+`${m?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,e):i?.()}}))}setDestination(n){let e=Ce(n??"");if(e){if(e.mapper.default){let i=e.mapper.default("");this.#e.updateTargetUrl(i);return}this.#e.updateTargetUrl(`${n}://`)}}removeDestination(){this.#e.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let n=this.testSignal();if(n===""){this.#t.open(I,{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:e=>{e?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#t.open(I,{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.#t.open(I,{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:e=>{e&&this.#n()}});return}this.#n()}#n(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=H({type:o,selectors:[["app-restore-destination"]],viewQuery:function(e,i){e&1&&q(i.formRef,fe,5),e&2&&Y()},features:[Z([De])],decls:28,vars:11,consts:()=>{let n;n=$localize`Backup destination`;let e;e=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let i;i=$localize`${"\uFFFD*25: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/*25:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*26: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/*26:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,i=Q(i);let t;t=$localize` Test destination `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Set target URL `;let m;m=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let b;b=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let U;U=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let k;k=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let v;v=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let W;W=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let B;B=$localize`Change`;let V;V=$localize`Edit target URL`;let z;z=$localize`Be careful, this will overwrite everything you have in your destination.`;let J;return J=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],n,e,i,t,a,m,b,U,k,v,W,B,V,z,J,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"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",""],[1,"target-dialog-header"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(e,i){if(e&1){let t=C();y(0),s(1,"form",16,0),u("submit",function(){return T(t),E(i.next())}),s(3,"header")(4,"h3",17)(5,"span"),p(6,1),r(),s(7,"div",18),F(8,Ae,2,1,"button",19),F(9,Pe,3,0,"button",20)(10,Le,9,1,"sh-menu"),r()(),F(11,ye,3,0,"sh-alert")(12,xe,3,0,"sh-alert",21)(13,we,3,1,"sh-alert",22)(14,Ge,3,1,"sh-alert",23),y(15),F(16,be,3,1,"app-destination-list-item",24),r(),F(17,Ue,1,0,"app-destination-list"),F(18,ke,1,1,"app-single-destination",25),s(19,"div",26)(20,"button",27),u("click",function(){return T(t),E(i.goBack())}),S(21,2),d(22,"sh-icon"),g(),r(),s(23,"button",28),S(24,3),F(25,ve,2,0,"sh-icon",29)(26,We,2,0,"sh-icon"),g(),r()()(),F(27,Be,16,4,"sh-dialog",30)}if(e&2){let t=x(!!i.targetUrlModel());l(8),O(t?8:-1),l(),O(t?10:9),l(2),O(i.testSignal()=="testing"?11:i.testSignal()=="success"?12:i.testSignal()=="warning"?13:i.testSignal()=="error"?14:-1),l(4);let a=x(i.selectedDestinationTypeOption());l(),O(a?16:-1),l(),O(t?-1:17),l(),O(t?18:-1),l(5),D("disabled",i.testSignal()=="testing"||!t),l(2),O(i.testSignal()=="testing"?25:26),l(2),O(i.targetUrlDialogOpen()?27:-1)}},dependencies:[Ie,pe,Ne,ce,le,oe,ae,se,_e,re,de,ue,Fe,Te,Se,Ee],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem}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}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}"],changeDetection:0})};export{G as default};
package/chunk-PE34XFKC.js DELETED
@@ -1 +0,0 @@
1
- import{a as ae}from"./chunk-ZHGDQABC.js";import"./chunk-MMEFBZO4.js";import{a as se}from"./chunk-Q74O3CWJ.js";import{a as Z,b as k}from"./chunk-3TJKPVBA.js";import{a as ie}from"./chunk-QHBOEY2O.js";import"./chunk-NK5WD6WE.js";import"./chunk-B62TPRVG.js";import"./chunk-6Q6SSTBK.js";import{a as te}from"./chunk-SZUNW4JO.js";import"./chunk-HSHF5HR7.js";import"./chunk-5LBG6MOL.js";import{b as ne}from"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import{B as Q,C as X,L as Y,u as J,z as K}from"./chunk-UNMDSCAN.js";import{c as ee}from"./chunk-CFNARBNK.js";import"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import{R as $,S as H,fa as U,ka as q,oa as G}from"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import{$ as B,Ab as i,Bb as T,Cc as p,Dc as u,Ec as F,Fb as j,Gb as L,Ib as W,Mc as I,Pa as r,R as A,Vb as b,W as g,Xb as _,aa as z,cb as V,hb as f,jc as a,kc as m,la as M,lc as v,mc as y,na as N,yb as d,zb as s}from"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";var E=class o{#e=g(k);#i=g(ne);#n=M([]);recentFiles=this.#n.asReadonly();#r=5;#o=1e4;#l=M(null);etaData=this.#l.asReadonly();#s=null;#t=null;#a=null;constructor(){N(()=>{let e=this.#e.statusData();e&&e.CurrentFilename&&e.CurrentFilesize!==void 0&&this.#c(e.CurrentFilename,e.CurrentFilesize)},{allowSignalWrites:!0})}#c(e,n){let t=new Date;this.#n.update(l=>{let c=l.filter(C=>t.getTime()-C.timestamp.getTime()<this.#o);return c.length>0&&c[0].filename===e?c:[{filename:e,filesize:n,timestamp:t},...c].slice(0,this.#r)})}activateView(){this.#s=new Date;let e=this.#e.statusData();e&&e.ProcessedFileCount!==void 0&&e.ProcessedFileSize!==void 0&&(this.#t={files:e.ProcessedFileCount,bytes:e.ProcessedFileSize}),this.#a=setInterval(()=>{this.#d(),this.#p()},1e3)}deactivateView(){this.#s=null,this.#t=null,this.#a&&(clearInterval(this.#a),this.#a=null)}#p(){let e=new Date;this.#n.update(n=>n.filter(t=>e.getTime()-t.timestamp.getTime()<this.#o))}#d(){if(!this.#s||!this.#t)return;let e=this.#e.statusData();if(!e)return;let n=new Date,t=(n.getTime()-this.#s.getTime())/1e3;if(t<5)return;let l=e.ProcessedFileCount||0,c=e.ProcessedFileSize||0,O=l-this.#t.files,C=c-this.#t.bytes,P=O/t,x=C/t,re=(e.TotalFileCount||0)-l,oe=(e.TotalFileSize||0)-c,h=null,S=null;P>0&&(h=re/P),x>0&&(S=oe/x);let D=null,w="bytes";if(h!==null&&S!==null){let le=Math.max(h,S);D=new Date(n.getTime()+le*1e3),w=h>S?"files":"bytes"}else h!==null?(D=new Date(n.getTime()+h*1e3),w="files"):S!==null&&(D=new Date(n.getTime()+S*1e3),w="bytes");this.#l.set({startTime:this.#s,filesProcessedAtStart:this.#t.files,bytesProcessedAtStart:this.#t.bytes,currentFilesPerSecond:P,currentBytesPerSecond:x,estimatedCompletion:D,metric:w})}static \u0275fac=function(n){return new(n||o)};static \u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"})};function pe(o,e){if(o&1&&(s(0,"div",25)(1,"div",26),a(2),i(),s(3,"div",27),a(4),p(5,"bytes"),i()()),o&2){let n,t,l=_();r(2),m((n=l.statusData())==null?null:n.CurrentFilename),r(2),m(u(5,2,(t=l.statusData())==null?null:t.CurrentFilesize))}}function de(o,e){if(o&1&&(s(0,"div",28)(1,"span",26),a(2),i(),s(3,"span",27),a(4),p(5,"bytes"),i()()),o&2){let n=e.$implicit;r(2),m(n.filename),r(2),m(u(5,2,n.filesize))}}function me(o,e){if(o&1&&(s(0,"div",29)(1,"div",30),a(2),p(3,"date"),p(4,"relativeTime"),i(),s(5,"div",31)(6,"div"),a(7),p(8,"number"),i(),s(9,"div"),a(10),p(11,"bytes"),i()()()),o&2){let n,t,l,c=_();r(2),y(" ETA: ",F(3,4,(n=c.etaData())==null?null:n.estimatedCompletion,"mediumTime")," (",u(4,7,(n=c.etaData())==null?null:n.estimatedCompletion),") "),r(5),v("",F(8,9,(t=c.etaData())==null?null:t.currentFilesPerSecond,"1.1-1")," files/s"),r(3),v("",u(11,12,(l=c.etaData())==null?null:l.currentBytesPerSecond),"/s")}}function ue(o,e){if(o&1&&(s(0,"div",34)(1,"div",35)(2,"span",36),a(3),i(),s(4,"span",37),a(5),p(6,"bytes"),i()(),T(7,"sh-progress-bar",2),i()),o&2){let n=e.$implicit;r(3),m(n.BackendPath),r(2),v("",u(6,3,n.BackendSpeed),"/s"),r(2),d("value",(n.BackendFileProgress||0)/(n.BackendFileSize||1)*100)}}function ge(o,e){if(o&1&&(s(0,"div",32),f(1,ue,8,5,"div",33),i()),o&2){let n,t=_();r(),d("ngForOf",(n=t.statusData())==null?null:n.ActiveTransfers)}}function fe(o,e){if(o&1&&(s(0,"div",21)(1,"span",5),a(2,"Next Task:"),i(),s(3,"div",6)(4,"div"),a(5),i(),s(6,"div",38),a(7),p(8,"date"),p(9,"relativeTime"),i()()()),o&2){let n,t=_();r(5),m((n=t.nextBackup().backup)==null?null:n.Name),r(2),y(" ",F(8,3,t.nextBackup().time,"medium")," (",u(9,6,t.nextBackup().time),") ")}}function _e(o,e){if(o&1){let n=W();j(0),s(1,"button",39),b("click",function(){B(n);let l=_();return z(l.stop())}),s(2,"sh-icon"),a(3,"stop"),i(),a(4," Stop "),i(),s(5,"button",39),b("click",function(){B(n);let l=_();return z(l.abort())}),s(6,"sh-icon"),a(7,"close"),i(),a(8," Abort "),i(),L()}}var R=class o{#e=g(k);#i=g(E);#n=g(ee);#r=g(K);statusData=this.#e.statusData;serverState=this.#e.serverState;recentFiles=this.#i.recentFiles;etaData=this.#i.etaData;transfersExpanded=M(!1);clientIsRunning=this.#e.clientIsRunning;statusText=I(()=>{let e=this.statusData()?.Phase;return e?Z[e]||e:""});progress=I(()=>{let e=this.statusData();return e?(e.OverallProgress||0)*100:0});nextBackup=I(()=>({backup:this.serverState()?.ProposedSchedule?.[0]?.backup,time:this.serverState()?.ProposedSchedule?.[0]?.Item2}));ngOnInit(){this.#i.activateView()}ngOnDestroy(){this.#i.deactivateView()}toggleTransfers(){this.transfersExpanded.update(e=>!e)}isTaskRunning(){return!!this.statusData()?.TaskID}taskStartTime(){return this.etaData()?.startTime}currentBackupId(){return this.statusData()?.BackupID}pauseResume(){if(this.clientIsRunning()){this.#r.open(se,{maxWidth:"550px",width:"100%"});return}this.#e.pauseResume().subscribe()}stop(){let e=this.statusData()?.TaskID;e&&this.#n.postApiV1TaskByTaskidStop({taskid:e}).subscribe()}abort(){let e=this.statusData()?.TaskID;e&&this.#n.postApiV1TaskByTaskidAbort({taskid:e}).subscribe()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=V({type:o,selectors:[["app-status"]],decls:62,vars:27,consts:[[1,"status-page"],[1,"progress-section"],[3,"value"],[1,"stats-grid"],[1,"stat-item"],[1,"label"],[1,"value"],[1,"files-section"],["class","current-file",4,"ngIf"],[1,"recent-files"],["class","recent-file",4,"ngFor","ngForOf"],[1,"speed-section"],[1,"speed-header"],[1,"aggregate-speed"],["class","eta-info",4,"ngIf"],[1,"transfers-toggle"],["shButton","",3,"click"],["class","transfer-details",4,"ngIf"],[1,"logs-section"],[3,"asSimpleList","polling","whenFilter","backupIdFilter"],[1,"server-status-section"],[1,"status-row"],["class","status-row",4,"ngIf"],[1,"actions"],[4,"ngIf"],[1,"current-file"],[1,"filename"],[1,"filesize"],[1,"recent-file"],[1,"eta-info"],[1,"eta-time"],[1,"speed-metrics"],[1,"transfer-details"],["class","transfer-item",4,"ngFor","ngForOf"],[1,"transfer-item"],[1,"transfer-info"],[1,"path"],[1,"speed"],[1,"sub-text"],["shButton","","color","warn",3,"click"]],template:function(n,t){if(n&1&&(s(0,"div",0)(1,"sh-card")(2,"div",1)(3,"h2"),a(4),i(),T(5,"sh-progress-bar",2),s(6,"div",3)(7,"div",4)(8,"span",5),a(9,"Files"),i(),s(10,"span",6),a(11),i()(),s(12,"div",4)(13,"span",5),a(14,"Size"),i(),s(15,"span",6),a(16),p(17,"bytes"),p(18,"bytes"),i()()()()(),s(19,"sh-card")(20,"div",7)(21,"h3"),a(22,"Current File"),i(),f(23,pe,6,4,"div",8),s(24,"h3"),a(25,"Recent Files"),i(),s(26,"div",9),f(27,de,6,4,"div",10),i()()(),s(28,"sh-card")(29,"div",11)(30,"div",12)(31,"h3"),a(32,"Transfer Speed"),i(),s(33,"div",13),a(34),p(35,"bytes"),i()(),f(36,me,12,14,"div",14),s(37,"div",15)(38,"button",16),b("click",function(){return t.toggleTransfers()}),a(39),i()(),f(40,ge,2,1,"div",17),i()(),s(41,"sh-card")(42,"div",18)(43,"h3"),a(44,"Live Logs"),i(),T(45,"app-logs-live",19),i()(),s(46,"sh-card")(47,"div",20)(48,"h3"),a(49,"Server Status"),i(),s(50,"div",21)(51,"span",5),a(52,"State:"),i(),s(53,"span",6),a(54),i()(),f(55,fe,10,8,"div",22),s(56,"div",23)(57,"button",16),b("click",function(){return t.pauseResume()}),s(58,"sh-icon"),a(59),i(),a(60),i(),f(61,_e,9,0,"ng-container",24),i()()()()),n&2){let l,c,O,C,P,x;r(4),m(t.statusText()),r(),d("value",t.progress()),r(6),y("",(l=t.statusData())==null?null:l.ProcessedFileCount," / ",(l=t.statusData())==null?null:l.TotalFileCount),r(5),y(" ",u(17,21,(c=t.statusData())==null?null:c.ProcessedFileSize)," / ",u(18,23,(c=t.statusData())==null?null:c.TotalFileSize)," "),r(7),d("ngIf",(O=t.statusData())==null?null:O.CurrentFilename),r(4),d("ngForOf",t.recentFiles()),r(7),v("",u(35,25,(C=t.statusData())==null?null:C.BackendSpeed),"/s"),r(2),d("ngIf",t.etaData()),r(3),v(" ",t.transfersExpanded()?"Hide Details":"Show Details"," "),r(),d("ngIf",t.transfersExpanded()),r(5),d("asSimpleList",!0)("polling",t.isTaskRunning())("whenFilter",(P=t.taskStartTime())==null?null:P.getTime())("backupIdFilter",t.currentBackupId()),r(9),m((x=t.serverState())==null?null:x.ProgramState),r(),d("ngIf",t.nextBackup()),r(4),m(t.clientIsRunning()?"pause":"play_arrow"),r(),v(" ",t.clientIsRunning()?"Pause":"Resume"," "),r(),d("ngIf",t.isTaskRunning())}},dependencies:[G,$,H,X,Y,Q,J,ae,q,U,te,ie],styles:["[_nghost-%COMP%]{display:block;padding:20px;max-width:1200px;margin:0 auto}.status-page[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr;gap:20px}@media(min-width:768px){.status-page[_ngcontent-%COMP%]{grid-template-columns:repeat(2,1fr)}}@media(min-width:1024px){.status-page[_ngcontent-%COMP%]{grid-template-columns:repeat(3,1fr)}}sh-card[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:column}.progress-section[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin-top:0;margin-bottom:15px;font-size:1.2rem;color:var(--text-primary)}.progress-section[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{margin-bottom:15px;height:20px;--progress-bar-color: var(--primary-color)}.progress-section[_ngcontent-%COMP%] .stats-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:10px}.progress-section[_ngcontent-%COMP%] .stats-grid[_ngcontent-%COMP%] .stat-item[_ngcontent-%COMP%]{display:flex;flex-direction:column}.progress-section[_ngcontent-%COMP%] .stats-grid[_ngcontent-%COMP%] .stat-item[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{font-size:.8rem;color:var(--text-secondary)}.progress-section[_ngcontent-%COMP%] .stats-grid[_ngcontent-%COMP%] .stat-item[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{font-weight:500}.files-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-top:0;margin-bottom:10px;font-size:1rem;color:var(--text-secondary)}.files-section[_ngcontent-%COMP%] .current-file[_ngcontent-%COMP%]{margin-bottom:20px;padding:10px;background:var(--bg-secondary);border-radius:4px}.files-section[_ngcontent-%COMP%] .current-file[_ngcontent-%COMP%] .filename[_ngcontent-%COMP%]{font-weight:500;word-break:break-all;margin-bottom:5px}.files-section[_ngcontent-%COMP%] .current-file[_ngcontent-%COMP%] .filesize[_ngcontent-%COMP%]{font-size:.8rem;color:var(--text-secondary)}.files-section[_ngcontent-%COMP%] .recent-files[_ngcontent-%COMP%] .recent-file[_ngcontent-%COMP%]{display:flex;justify-content:space-between;padding:5px 0;border-bottom:1px solid var(--border-color);font-size:.9rem}.files-section[_ngcontent-%COMP%] .recent-files[_ngcontent-%COMP%] .recent-file[_ngcontent-%COMP%]:last-child{border-bottom:none}.files-section[_ngcontent-%COMP%] .recent-files[_ngcontent-%COMP%] .recent-file[_ngcontent-%COMP%] .filename[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-right:10px}.files-section[_ngcontent-%COMP%] .recent-files[_ngcontent-%COMP%] .recent-file[_ngcontent-%COMP%] .filesize[_ngcontent-%COMP%]{color:var(--text-secondary);white-space:nowrap}.speed-section[_ngcontent-%COMP%] .speed-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px}.speed-section[_ngcontent-%COMP%] .speed-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1rem;color:var(--text-secondary)}.speed-section[_ngcontent-%COMP%] .speed-header[_ngcontent-%COMP%] .aggregate-speed[_ngcontent-%COMP%]{font-size:1.2rem;font-weight:700;color:var(--primary-color)}.speed-section[_ngcontent-%COMP%] .eta-info[_ngcontent-%COMP%]{margin-bottom:15px;padding:10px;background:var(--bg-secondary);border-radius:4px}.speed-section[_ngcontent-%COMP%] .eta-info[_ngcontent-%COMP%] .eta-time[_ngcontent-%COMP%]{font-weight:500;margin-bottom:5px}.speed-section[_ngcontent-%COMP%] .eta-info[_ngcontent-%COMP%] .speed-metrics[_ngcontent-%COMP%]{display:flex;justify-content:space-between;font-size:.8rem;color:var(--text-secondary)}.speed-section[_ngcontent-%COMP%] .transfers-toggle[_ngcontent-%COMP%]{margin-bottom:10px;text-align:right}.speed-section[_ngcontent-%COMP%] .transfer-details[_ngcontent-%COMP%]{max-height:200px;overflow-y:auto}.speed-section[_ngcontent-%COMP%] .transfer-details[_ngcontent-%COMP%] .transfer-item[_ngcontent-%COMP%]{margin-bottom:10px}.speed-section[_ngcontent-%COMP%] .transfer-details[_ngcontent-%COMP%] .transfer-item[_ngcontent-%COMP%] .transfer-info[_ngcontent-%COMP%]{display:flex;justify-content:space-between;font-size:.8rem;margin-bottom:2px}.speed-section[_ngcontent-%COMP%] .transfer-details[_ngcontent-%COMP%] .transfer-item[_ngcontent-%COMP%] .transfer-info[_ngcontent-%COMP%] .path[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-right:10px}.speed-section[_ngcontent-%COMP%] .transfer-details[_ngcontent-%COMP%] .transfer-item[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{height:4px}.logs-section[_ngcontent-%COMP%]{grid-column:1/-1}.logs-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-top:0;margin-bottom:10px;font-size:1rem;color:var(--text-secondary)}.logs-section[_ngcontent-%COMP%] app-logs-live[_ngcontent-%COMP%]{height:300px;display:block;border:1px solid var(--border-color);border-radius:4px}.server-status-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-top:0;margin-bottom:15px;font-size:1rem;color:var(--text-secondary)}.server-status-section[_ngcontent-%COMP%] .status-row[_ngcontent-%COMP%]{display:flex;margin-bottom:10px}.server-status-section[_ngcontent-%COMP%] .status-row[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{width:100px;color:var(--text-secondary)}.server-status-section[_ngcontent-%COMP%] .status-row[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{flex:1;font-weight:500}.server-status-section[_ngcontent-%COMP%] .status-row[_ngcontent-%COMP%] .value[_ngcontent-%COMP%] .sub-text[_ngcontent-%COMP%]{font-size:.8rem;color:var(--text-secondary)}.server-status-section[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{margin-top:20px;display:flex;gap:10px;flex-wrap:wrap}"],changeDetection:0})};export{R as default};
package/chunk-SQNRZYPW.js DELETED
@@ -1 +0,0 @@
1
- import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-P7OUKLCO.js")},{path:"encryption",loadComponent:()=>import("./chunk-MI7UAY44.js")},{path:"select-files",loadComponent:()=>import("./chunk-V7OCP4NF.js")},{path:"options",loadComponent:()=>import("./chunk-56MQ46JU.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-4GYWPC2V.js")}],t=o;export{t as default};