@duplicati/ngclient 0.0.137 → 0.0.138

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 (86) hide show
  1. package/assets/spk.woff2 +0 -0
  2. package/chunk-23ODVSFI.js +1 -0
  3. package/chunk-2D26BDYB.js +1 -0
  4. package/chunk-3ZVSHKLD.js +1 -0
  5. package/chunk-4DBVVUBO.js +1 -0
  6. package/chunk-5SXTGTAZ.js +1 -0
  7. package/chunk-64ZU74CD.js +1 -0
  8. package/chunk-6DSLFJ4T.js +1 -0
  9. package/chunk-74BJ4GVA.js +1 -0
  10. package/chunk-7IBACL6K.js +1 -0
  11. package/chunk-7QJG4IIT.js +1 -0
  12. package/{chunk-Y73FO7VJ.js → chunk-BQE7QZIT.js} +1 -1
  13. package/chunk-CCA5ZCEA.js +1 -0
  14. package/chunk-CF7KRXOR.js +1 -0
  15. package/chunk-DG7SFNGT.js +1 -0
  16. package/chunk-EMXIHCYQ.js +1 -0
  17. package/chunk-EN6226UP.js +1 -0
  18. package/chunk-GJXR776M.js +1 -0
  19. package/{chunk-SYUL4YZN.js → chunk-GKOS3VYR.js} +1 -1
  20. package/chunk-H52UO57S.js +8 -0
  21. package/chunk-HDDYOVZL.js +1 -0
  22. package/chunk-HRSZZWTB.js +1 -0
  23. package/chunk-IZXB2EWT.js +1 -0
  24. package/{chunk-JM7VAPIC.js → chunk-J6BHRR34.js} +1 -1
  25. package/chunk-JI7GCFQB.js +1 -0
  26. package/chunk-KSQIUDEA.js +1 -0
  27. package/chunk-LPFSQKIK.js +1 -0
  28. package/{chunk-7GUJ7DYP.js → chunk-M3CLGZMQ.js} +1 -1
  29. package/{chunk-7MV7VPDB.js → chunk-MMPTX6PS.js} +1 -1
  30. package/chunk-N57J64DN.js +3 -0
  31. package/chunk-NHAGSIVX.js +1 -0
  32. package/chunk-NZ2KKCDC.js +1 -0
  33. package/{chunk-5LGMQ3QI.js → chunk-OFFMLGEZ.js} +1 -1
  34. package/chunk-PZA4FRVJ.js +1 -0
  35. package/chunk-PZCO6IX3.js +1 -0
  36. package/{chunk-QD2GV7XN.js → chunk-QRRKPBY6.js} +1 -1
  37. package/chunk-RCKA5DTC.js +1 -0
  38. package/chunk-RNMBKZ6Y.js +3 -0
  39. package/chunk-ULLALJQ2.js +1 -0
  40. package/{chunk-ETPRQPCV.js → chunk-UT7GWYPR.js} +1 -1
  41. package/chunk-V6EWWEIG.js +1 -0
  42. package/chunk-V77N2OUE.js +1 -0
  43. package/chunk-WHFO4IFB.js +1 -0
  44. package/chunk-WZNH4JPF.js +1 -0
  45. package/chunk-WZRDKVOR.js +1 -0
  46. package/{chunk-EL7ZWMW3.js → chunk-XIOHRQ3X.js} +1 -1
  47. package/{chunk-WF6EAWTW.js → chunk-ZI2XNFAW.js} +1 -1
  48. package/index.html +1 -1
  49. package/main-4FANBYAP.js +1 -0
  50. package/package.json +1 -1
  51. package/chunk-2YMUOQLP.js +0 -1
  52. package/chunk-3B3CD5KI.js +0 -1
  53. package/chunk-42LUYQ5S.js +0 -1
  54. package/chunk-4AWC7A44.js +0 -1
  55. package/chunk-7E4SLHH6.js +0 -1
  56. package/chunk-A4BYE2OQ.js +0 -1
  57. package/chunk-BEUZGUTP.js +0 -1
  58. package/chunk-BUHA4W4I.js +0 -1
  59. package/chunk-DDOT2PJU.js +0 -3
  60. package/chunk-FY7P6D7L.js +0 -1
  61. package/chunk-FZG6OXT3.js +0 -1
  62. package/chunk-GHXNDRQC.js +0 -1
  63. package/chunk-HN6NEFVX.js +0 -1
  64. package/chunk-HYVO7UIG.js +0 -1
  65. package/chunk-JHBG6CNS.js +0 -1
  66. package/chunk-KTU3Q35O.js +0 -1
  67. package/chunk-KZQCOYF7.js +0 -1
  68. package/chunk-L5Y36SCW.js +0 -1
  69. package/chunk-MFURKVTP.js +0 -1
  70. package/chunk-NMNBM72U.js +0 -1
  71. package/chunk-OZLEURDK.js +0 -6
  72. package/chunk-P4KFR7NY.js +0 -1
  73. package/chunk-P4KOC4NP.js +0 -1
  74. package/chunk-QR64BSPX.js +0 -1
  75. package/chunk-RIVEONGL.js +0 -1
  76. package/chunk-RVPCSXUI.js +0 -1
  77. package/chunk-SMQWGV7N.js +0 -1
  78. package/chunk-UM3LTU7N.js +0 -1
  79. package/chunk-VKUSJRIK.js +0 -1
  80. package/chunk-XIIFTZ5G.js +0 -1
  81. package/chunk-XPQBJ7EY.js +0 -1
  82. package/chunk-YONVHISY.js +0 -1
  83. package/chunk-YR3TOOC3.js +0 -1
  84. package/chunk-YSJGV5SH.js +0 -1
  85. package/chunk-ZZNFOL3R.js +0 -1
  86. package/main-J4GINH4P.js +0 -1
package/assets/spk.woff2 CHANGED
Binary file
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-N57J64DN.js";import"./chunk-2G6TVFPZ.js";import"./chunk-WZNH4JPF.js";import"./chunk-2BX65XJQ.js";import"./chunk-6JQM2X3B.js";import"./chunk-NSIELNIY.js";import"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";export{a as OptionsListComponent};
@@ -0,0 +1 @@
1
+ import{a as W}from"./chunk-XIOHRQ3X.js";import"./chunk-WZRDKVOR.js";import{a as z}from"./chunk-ULLALJQ2.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import"./chunk-NSIELNIY.js";import"./chunk-7QJG4IIT.js";import"./chunk-3ZVSHKLD.js";import{e as S}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{a as g,g as E,h as R,k as G,p as w}from"./chunk-Y5IRBMLB.js";import{h as X}from"./chunk-DNJOKPEL.js";import"./chunk-UZK7ABRM.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-B6OIHB5W.js";import{Ab as l,Bb as b,Cb as h,Kb as y,Lb as A,Mb as p,Nb as I,Ob as B,Qa as a,Rb as d,Z as u,ab as T,ec as r,fb as O,hc as L,pb as M,qb as P,sb as F,sc as m,tb as N,tc as v,ub as x,vb as $,wb as D,xb as _,yb as t,zb as i}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";var j=()=>[R,E,g,S],K=()=>["/restore-from-files"],q=()=>["/restore/from-config"],V=n=>["/restore",n];function H(n,o){if(n&1&&(t(0,"spk-card",5),l(1,"img",10),t(2,"div",7)(3,"h3"),p(4,1),i(),t(5,"p"),r(6),i()(),t(7,"button",8),y(8,2),l(9,"spk-icon"),A(),i()()),n&2){let e=o.$implicit;a(4),I((e.Backup==null?null:e.Backup.Name)??"Backup name missing"),B(4),a(2),L(" ",(e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.SourceSizeString)??"-"," / ",(e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.BackupListCount)??"-"," "),a(),_("routerLink",v(4,V,e.Backup==null?null:e.Backup.ID))}}function J(n,o){if(n&1&&$(0,H,10,6,"spk-card",5,x),n&2){let e=d(2);D(e.backups())}}function Q(n,o){n&1&&(b(0),p(1,3),h())}function U(n,o){if(n&1&&F(0,J,2,0)(1,Q,2,0,"ng-container"),n&2){let e=d();N(e.backups().length?0:1)}}function Y(n,o){n&1&&(t(0,"div",11),l(1,"spk-progress-bar",12),t(2,"div",7)(3,"h3"),p(4,4),i()()())}var f=class n{#e=u(z);#t=u(X);backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;ngOnInit(){this.#e.getBackups(!0)}restoreNow(o){this.#t.postApiV1BackupByIdRestore({id:o.Backup?.ID,requestBody:{}})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=T({type:n,selectors:[["app-restore"]],decls:32,vars:5,consts:()=>{let o;o=$localize`Where do you want to restore from?`;let e;e=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let s;s=$localize` Restore ${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let k;k=$localize`No backups founds`;let C;return C=$localize`Loading backups...`,[o,e,s,k,C,[1,"type-a"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["spk-button","",3,"routerLink"],["src","assets/images/restore.png","alt","","width","48px"],["src","assets/images/folder.png","alt","","width","48px"],[1,"loading-list"],[1,"indeterminate","primary"]]},template:function(e,s){e&1&&(l(0,"app-status-bar"),t(1,"section")(2,"h2"),p(3,0),i(),t(4,"spk-card",5),l(5,"img",6),t(6,"div",7)(7,"h3"),r(8,"Direct restore from backup files"),i(),t(9,"p"),r(10,"Point to your backup files and restore from there."),i()(),t(11,"button",8),r(12," Start "),t(13,"spk-icon"),r(14,"play-circle"),i()()(),t(15,"spk-card",5),l(16,"img",9),t(17,"div",7)(18,"h3"),r(19,"Restore from configuration"),i(),t(20,"p"),r(21,"Load destination from an exported job or a storage provider"),i()(),t(22,"button",8),r(23," Start "),t(24,"spk-icon"),r(25,"play-circle"),i()()(),t(26,"spk-divider"),r(27,"Or existing"),i(),O(28,U,2,1)(29,Y,5,0),M(30,28,j,null,29),i()),e&2&&(a(11),_("routerLink",m(3,K)),a(11),_("routerLink",m(4,q)),a(8),P(!s.backupsLoading()))},dependencies:[W,R,E,G,g,w,S],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{font:var(--title-30);text-align:center;padding:2rem}section[_ngcontent-%COMP%]{max-width:43.75rem;margin:0 auto;padding:2rem 1rem;display:flex;flex-direction:column;gap:1rem}spk-divider[_ngcontent-%COMP%]{color:var(--base-8)}spk-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;--card-padding: 2rem}spk-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}"],changeDetection:0})};export{f as default};
@@ -0,0 +1 @@
1
+ import{d as O}from"./chunk-2W6BEUGU.js";import{a as v,c as P,h as y}from"./chunk-DNJOKPEL.js";import{d as T,e as i}from"./chunk-WIDMAJIO.js";import{B as E,F as c,H as A,R as m,U as a,Z as o,f as u,k as I,n as d,na as n,r as S,xa as R}from"./chunk-BTMXQPBB.js";var f=class r{platformId=o(R);STORAGE_VERSION="v1";APP_NAME="duplicati";PERSISTED_PREFIX="persist:";getItemParsed(t,e=!1){return i(this.platformId)?null:JSON.parse(localStorage.getItem(`${this.STORAGE_VERSION}:${e?this.PERSISTED_PREFIX:""}${this.APP_NAME}:${t}`)??"null")}setItemParsed(t,e,s=!1){if(!i(this.platformId))return localStorage.setItem(`${this.STORAGE_VERSION}:${s?this.PERSISTED_PREFIX:""}${this.APP_NAME}:${t}`,JSON.stringify(e))}get length(){return T(this.platformId)?localStorage.length:0}getItem(t){return i(this.platformId)?null:localStorage.getItem(`${this.STORAGE_VERSION}:${this.APP_NAME}:${t}`)??null}setItem(t,e){if(!i(this.platformId))return localStorage.setItem(`${this.STORAGE_VERSION}:${this.APP_NAME}:${t}`,e)}removeItem(t){i(this.platformId)||(localStorage.removeItem(`${this.STORAGE_VERSION}:${this.APP_NAME}:${t}`),localStorage.removeItem(`${this.STORAGE_VERSION}:${this.PERSISTED_PREFIX}${this.APP_NAME}:${t}`))}clearAllNotCurrentVersion(){if(!i(this.platformId))for(var t in localStorage)!t.startsWith(this.STORAGE_VERSION)&&t.includes(this.APP_NAME)&&localStorage.removeItem(t)}clearAll(){i(this.platformId)||localStorage.clear()}clear(){if(!i(this.platformId))for(var t in localStorage)t.includes(this.APP_NAME)&&!t.includes(this.PERSISTED_PREFIX)&&localStorage.removeItem(t)}key(t){return i(this.platformId)?null:localStorage.key(t)}static \u0275fac=function(e){return new(e||r)};static \u0275prov=a({token:r,factory:r.\u0275fac})};var h=class r{#o=o(f);#r=n(null);#e=window.self!==window.top;#s=n(this.#e);relayIsEnabled=this.#s.asReadonly();config=this.#r.asReadonly();configLoaded=this.#e?new I:null;isLoading=n(this.#e);parentIframeListner=null;parentOrigin="*";fetchConfig(){this.#i(),this.#e&&(this.#s.set(!0),this.parentIframeListner=new AbortController,this.#t("connected"),window.addEventListener("message",t=>{if(t.data.startsWith("access:")){let e=t.data.replace("access:",""),s=JSON.parse(e);if(!s?.accessToken||!s?.clientId){this.#t("error:invalid-config"),this.#s.set(!1);return}if(typeof s.clientId!="string"){this.#t("error:invalid-config"),this.#s.set(!1);return}if(typeof s.accessToken!="string"){this.#t("error:invalid-config"),this.#s.set(!1);return}let _=this.#o.getItem("locale")??"en-US",p=s.locale??"en-US";_!==p&&(this.#o.setItem("locale",p),window.location.reload()),this.#r.set(s),this.configLoaded?.next(!0),this.isLoading.set(!1),this.#t("handshake-complete")}},{signal:this.parentIframeListner.signal}))}#t(t){window.parent.postMessage(t,"*")}#i(){this.parentIframeListner&&(this.parentIframeListner.abort(),this.parentIframeListner=null)}setConfig(t){this.#r.set(t)}clearConfig(){this.#r.set(null)}static \u0275fac=function(e){return new(e||r)};static \u0275prov=a({token:r,factory:r.\u0275fac,providedIn:"root"})};var g="PROXY_AUTHED_FAKE_TOKEN",l="accessToken",N=class r{#o=o(O);#r=o(P);#e=o(y);#s=o(h);#t=n(sessionStorage.getItem(l));#i=n(!1);token=this.#t.asReadonly();isLoggingOut=this.#i.asReadonly();login(t,e){return this.#e.postApiV1AuthLogin({requestBody:{Password:t,RememberMe:e}}).pipe(c(1),m(s=>{s.AccessToken?(this.#t.set(s.AccessToken),e&&sessionStorage.setItem(l,s.AccessToken||"")):(this.#t.set(null),sessionStorage.removeItem(l))}))}refreshToken(){return this.#s.relayIsEnabled()?(this.#t.set(g),new u(t=>{t.next({AccessToken:g}),t.complete()})):this.#e.postApiV1AuthRefresh().pipe(c(1),m(t=>t.AccessToken&&this.#t.set(t.AccessToken)))}checkProxyAuthed(){let t=new v({"custom-proxy-check":"true"});return this.#r.get("/api/v1/systeminfo",{headers:t}).pipe(S(()=>(this.#t.set(g),!0)),E(()=>d(!1)))}clearSessionToken(){sessionStorage.removeItem(l)}logout(){this.#i.set(!0),sessionStorage.removeItem(l),this.#e.postApiV1AuthRefreshLogout().pipe(c(1),A(()=>{this.#i.set(!1),this.#t.set(null),this.#o.navigate(["/login"])})).subscribe()}static \u0275fac=function(e){return new(e||r)};static \u0275prov=a({token:r,factory:r.\u0275fac,providedIn:"root"})};export{f as a,h as b,g as c,N as d};
@@ -0,0 +1 @@
1
+ import{a as le}from"./chunk-XIOHRQ3X.js";import{a as re,b}from"./chunk-LDIZ5E5Z.js";import"./chunk-WZRDKVOR.js";import{a as ae}from"./chunk-ULLALJQ2.js";import"./chunk-J6BHRR34.js";import{a as E}from"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import{c as ie,e as ne,i as oe,s as se}from"./chunk-NSIELNIY.js";import"./chunk-7QJG4IIT.js";import"./chunk-3ZVSHKLD.js";import{b as j,e as J}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{C as ee,a as Q,e as Y,g as Z,l as x}from"./chunk-Y5IRBMLB.js";import{h as te}from"./chunk-DNJOKPEL.js";import"./chunk-UZK7ABRM.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-B6OIHB5W.js";import{Ab as p,D as G,F as g,G as K,H as A,Hc as C,Ic as k,Kb as d,Lb as u,Mb as F,Nb as U,Ob as X,Qa as r,Qb as S,Z as h,ab as L,bc as D,dc as z,ec as P,jc as H,kc as W,lc as q,na as l,r as v,sb as V,tb as w,xb as _,yb as n,zb as i}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";function ce(c,t){c&1&&(n(0,"spk-icon",19),P(1,"spinner"),i())}function pe(c,t){c&1&&(n(0,"spk-icon",20),P(1,"check"),i())}function _e(c,t){c&1&&(n(0,"spk-icon",21),P(1,"warning"),i()),c&2&&_("spkTooltip","File not found")}function de(c,t){let a=re(c).pipe(G(t),K());return b(a,{initialValue:c()})}var f=class c{#n=h(j);#o=h(ae);#e=h(te);#a=h(Y);#t=l("");backupId=b(this.#n.params.pipe(v(t=>t.id)));activeBackup=C(()=>this.#o.backups().find(t=>t.Backup?.ID===this.backupId()));backupFilePath=l("");lastValidatedPath=l("");isValidatedPath=C(()=>this.lastValidatedPath()===this.backupFilePath());pathHasChanged=C(()=>this.backupFilePath()!==this.#t());isValidatingPath=l(!1);#i=de(this.backupFilePath,500);isWaitingForValidation=C(()=>this.#i()!=this.backupFilePath()||this.isValidatingPath());backupFilePathEffect=k(()=>{let t=this.#i(),a=this.activeBackup();t!==""&&(this.isValidatingPath.set(!0),this.#e.postApiV1FilesystemValidate({requestBody:{path:t}}).pipe(g(1),A(()=>this.isValidatingPath.set(!1))).subscribe(()=>this.lastValidatedPath.set(t)))});isRestoring=l(!1);isRepairing=l(!1);isDeleting=l(!1);isSavingDbPath=l(!1);isSavingAndRepairing=l(!1);isMovingDb=l(!1);isCreatingBugReport=l(!1);createdReport=l(!1);activeBackupEffect=k(()=>{let t=this.activeBackup();if(!t)return;let a=t.Backup?.DBPath??"";this.backupFilePath.set(a),this.#t.set(a)});repairDatabase(){this.isRepairing.set(!0),this.#e.postApiV1BackupByIdRepair({id:this.backupId()}).pipe(g(1),A(()=>this.isRepairing.set(!1))).subscribe()}deleteDatabase(t=null){this.isValidatedPath()?this.#a.open(E,{data:{title:$localize`Confirm delete?`,message:$localize`Do you really want to delete the database for ${this.activeBackup()?.Backup?.Name}?`,confirmText:$localize`Delete database`,cancelText:$localize`Cancel`},closed:a=>{a&&this.doDeleteDatabase(t)}}):this.doDeleteDatabase(t)}doDeleteDatabase(t=null){this.isDeleting.set(!0),this.#e.postApiV1BackupByIdDeletedb({id:this.backupId()}).pipe(g(1),A(()=>this.isDeleting.set(!1))).subscribe(()=>{this.lastValidatedPath.set(""),t?.()})}restoreDatabase(){this.isValidatedPath()?this.deleteDatabase(()=>{this.doRepairDatabase()}):this.doRepairDatabase()}doRepairDatabase(){this.isRestoring.set(!0),this.#e.postApiV1BackupByIdRepair({id:this.backupId()}).pipe(g(1),A(()=>this.isRestoring.set(!1))).subscribe()}resetDatabasePath(){this.backupFilePath.set(this.#t())}saveDatabasePath(t=null){this.isValidatedPath()?this.#a.open(E,{data:{title:$localize`Confirm reassign?`,message:$localize`The target database path already exists and may belong to another backup. Are you sure you want to assign this backup to an existing database?`,confirmText:$localize`Assign existing database`,cancelText:$localize`Cancel`},closed:a=>{a&&this.doSaveDatabasePath(t)}}):this.doSaveDatabasePath(t)}doSaveDatabasePath(t=null){this.isSavingDbPath.set(!0);let a=this.backupFilePath();this.#e.postApiV1BackupByIdUpdatedb({id:this.backupId(),requestBody:{path:a}}).pipe(A(()=>this.isSavingDbPath.set(!1))).subscribe(()=>{this.#t.set(a),t?.()})}saveAndRepairDatabasePath(){this.saveDatabasePath(()=>(this.isSavingAndRepairing.set(!0),this.#e.postApiV1BackupByIdRepair({id:this.backupId()}).pipe(g(1),A(()=>this.isSavingAndRepairing.set(!1))).subscribe()))}moveDatabasePath(){this.isMovingDb.set(!0);let t=this.backupFilePath();this.#e.postApiV1BackupByIdMovedb({id:this.backupId(),requestBody:{path:t}}).pipe(A(()=>this.isMovingDb.set(!1))).subscribe(()=>this.#t.set(t))}createErrorReport(){this.isCreatingBugReport.set(!0),this.#e.postApiV1BackupByIdCreatereport({id:this.backupId()}).pipe(A(()=>this.isCreatingBugReport.set(!1))).subscribe({next:()=>{this.createdReport.set(!0),window.setTimeout(()=>this.createdReport.set(!1),3e3)}})}static \u0275fac=function(a){return new(a||c)};static \u0275cmp=L({type:c,selectors:[["app-database"]],decls:50,vars:21,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_ICON: Back `;let a;a=$localize`Local database for ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let e;e=$localize` Each backup has a local database associated with it, which stores information about the remote backup on the local machine. This makes it faster to perform many operations, and reduces the amount of data that needs to be downloaded for each operation. `;let o;o=$localize`Maintenance`;let T;T=$localize` If the backup and the remote storage is out of sync, Duplicati will require that you perform a repair operation to synchronize the database. If the repair is unsuccessful, you can delete the local database and re-generate. The bug report button can be used to create a copy of the database with path information removed. This should only be used if a developer requests to investigate an issue with your database. `;let m;m=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SPK_ICON:wrench${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SPK_ICON: Repair `;let B;B=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:trash${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON: Delete `;let I;I=$localize`${"\uFFFD#25\uFFFD"}:START_TAG_SPK_ICON:clock-counter-clockwise${"\uFFFD/#25\uFFFD"}:CLOSE_TAG_SPK_ICON: Restore (delete and repair) `;let M;M=$localize`${"\uFFFD#28\uFFFD"}:START_TAG_SPK_ICON:file-plus${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SPK_ICON: Create bug report database `;let $;$=$localize`Placement`;let N;N=$localize`${"\uFFFD#40\uFFFD"}:START_TAG_SPK_ICON:backspace${"\uFFFD/#40\uFFFD"}:CLOSE_TAG_SPK_ICON: Reset `;let R;R=$localize`${"\uFFFD#43\uFFFD"}:START_TAG_SPK_ICON:floppy-disk${"\uFFFD/#43\uFFFD"}:CLOSE_TAG_SPK_ICON: Save `;let O;O=$localize`${"\uFFFD#46\uFFFD"}:START_TAG_SPK_ICON:wrench${"\uFFFD/#46\uFFFD"}:CLOSE_TAG_SPK_ICON: Save & Repair `;let y;return y=$localize`${"\uFFFD#49\uFFFD"}:START_TAG_SPK_ICON:flow-arrow${"\uFFFD/#49\uFFFD"}:CLOSE_TAG_SPK_ICON: Move existing database `,[t,a,e,o,T,m,B,I,M,$,N,R,O,y,[1,"back"],["type","button","spk-button","","routerLink","/",1,"small"],[1,"actions","maintenance"],["spk-button","",3,"click","disabled"],["type","text",3,"ngModelChange","ngModel"],["prefix","",1,"primary"],["prefix",""],["prefix","",3,"spkTooltip"],[1,"actions","placement"]]},template:function(a,e){if(a&1&&(p(0,"app-status-bar"),n(1,"section")(2,"div",14)(3,"button",15),d(4,0),p(5,"spk-icon"),u(),i()(),n(6,"article")(7,"h1"),F(8,1),i(),n(9,"p"),F(10,2),i()(),n(11,"article")(12,"h2"),F(13,3),i(),n(14,"p"),F(15,4),i(),n(16,"div",16)(17,"button",17),S("click",function(){return e.repairDatabase()}),d(18,5),p(19,"spk-icon"),u(),i(),n(20,"button",17),S("click",function(){return e.deleteDatabase()}),d(21,6),p(22,"spk-icon"),u(),i(),n(23,"button",17),S("click",function(){return e.restoreDatabase()}),d(24,7),p(25,"spk-icon"),u(),i(),n(26,"button",17),S("click",function(){return e.createErrorReport()}),d(27,8),p(28,"spk-icon"),u(),i()()(),n(29,"article")(30,"h2"),F(31,9),i(),n(32,"spk-form-field")(33,"input",18),q("ngModelChange",function(T){return W(e.backupFilePath,T)||(e.backupFilePath=T),T}),i(),V(34,ce,2,0,"spk-icon",19)(35,pe,2,0,"spk-icon",20)(36,_e,2,1,"spk-icon",21),i(),n(37,"div",22)(38,"button",17),S("click",function(){return e.resetDatabasePath()}),d(39,10),p(40,"spk-icon"),u(),i(),n(41,"button",17),S("click",function(){return e.saveDatabasePath()}),d(42,11),p(43,"spk-icon"),u(),i(),n(44,"button",17),S("click",function(){return e.saveAndRepairDatabasePath()}),d(45,12),p(46,"spk-icon"),u(),i(),n(47,"button",17),S("click",function(){return e.moveDatabasePath()}),d(48,13),p(49,"spk-icon"),u(),i()()()()),a&2){let o;r(8),U((o=e.activeBackup())==null||o.Backup==null?null:o.Backup.Name),X(8),r(9),D("loader",e.isRepairing()),_("disabled",!e.isValidatedPath()||e.pathHasChanged()),r(3),D("loader",e.isDeleting()),_("disabled",!e.isValidatedPath()||e.pathHasChanged()),r(3),D("loader",e.isRestoring()),_("disabled",e.pathHasChanged()),r(3),D("loader",e.isCreatingBugReport()),_("disabled",e.isCreatingBugReport()||!e.isValidatedPath()||e.pathHasChanged()),r(6),z(e.isValidatedPath()?"success":"error"),r(),H("ngModel",e.backupFilePath),r(),w(e.isWaitingForValidation()?34:e.isValidatedPath()?35:36),r(4),_("disabled",!e.pathHasChanged()),r(3),_("disabled",!e.pathHasChanged()||e.isWaitingForValidation()),r(3),_("disabled",!e.pathHasChanged()||e.isWaitingForValidation()),r(3),_("disabled",!e.pathHasChanged()||e.isValidatedPath()||e.isWaitingForValidation())}},dependencies:[se,ie,ne,oe,le,Z,x,Q,ee,J],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem}article[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}h1[_ngcontent-%COMP%]{font:var(--title-20)}h2[_ngcontent-%COMP%]{font:var(--title-30)}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{f as default};
@@ -0,0 +1 @@
1
+ import{a as v}from"./chunk-XIOHRQ3X.js";import{h as T}from"./chunk-HRSZZWTB.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-B26UYXA3.js";import{b as m}from"./chunk-LDIZ5E5Z.js";import"./chunk-WZRDKVOR.js";import{a as L}from"./chunk-ULLALJQ2.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import"./chunk-NSIELNIY.js";import"./chunk-7QJG4IIT.js";import"./chunk-3ZVSHKLD.js";import{b as E,c as B,e as b,f as M}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{p as $,q as N,v as I}from"./chunk-Y5IRBMLB.js";import{h as K}from"./chunk-DNJOKPEL.js";import"./chunk-UZK7ABRM.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-B6OIHB5W.js";import{Ab as r,F as C,Ic as O,Kb as d,Lb as c,Qa as n,Rb as R,Z as l,ab as D,ec as A,gc as P,rc as h,sb as k,tb as g,uc as _,xb as u,yb as p,zb as s}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";var G=(a,e)=>[a,e,"general"],y=(a,e)=>[a,e,"destination"],U=(a,e)=>[a,e,"source-data"],w=(a,e)=>[a,e,"schedule"],X=(a,e)=>[a,e,"options"];function x(a,e){if(a&1&&(p(0,"p"),A(1),s()),a&2){let t=R();n(),P("Editing: ",t.backupName())}}function z(a,e){a&1&&r(0,"spk-progress-bar",6)}function j(a,e){a&1&&(p(0,"section"),r(1,"router-outlet"),s())}var f=class a{#t=l(E);#e=l(T);#a=l(L);#i=l(K);isDraft=this.#e.isDraft;isNew=this.#e.isNew;backupId=this.#e.backupId;backupName=this.#e.backupName;finishedLoading=this.#e.finishedLoading;#o=m(this.#t.params);#n=m(this.#t.url);paramsChanged=O(()=>{let e=this.#o()?.id,t=!!this.#n()?.find(i=>i.path==="backup-draft");this.#e.backupId.set(e),e!=="new"?this.getBackup(e,t):this.getDefaults()});getDefaults(){this.#i.getApiV1Backupdefaults().pipe(C(1)).subscribe({next:e=>{let t=e.Backup;t.Settings=[...t.Settings],this.#e.mapGeneralToForm(t),this.#e.mapDestinationToForm(t),this.#e.mapSourceDataToForm(t),this.#e.mapScheduleToForm(e.Schedule),this.#e.mapOptionsToForms(t),this.#e.applicationOptions.set(e.ApplicationOptions),this.#e.backupDefaults.set(e),this.#e.finishedLoading.set(!0)}})}getBackup(e,t=!1){let i=o=>{this.#e.mapScheduleToForm(o.Schedule??null),o.Backup&&(this.#e.mapGeneralToForm(o.Backup),this.#e.mapDestinationToForm(o.Backup),this.#e.mapSourceDataToForm(o.Backup),this.#e.mapOptionsToForms(o.Backup),this.#e.storeMetadata(o.Backup,t)),this.#e.finishedLoading.set(!0)};if(t){this.isDraft.set(t);let o=this.#a.draftBackups().find(F=>F.id===e);if(!o){alert("Backup not found");return}i(o.data)}else this.#i.getApiV1BackupById({id:e}).subscribe({next:i})}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=D({type:a,selectors:[["app-backup"]],features:[h([T])],decls:21,vars:22,consts:()=>{let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SPK_RADIO: General `;let t;t=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_RADIO: Destination `;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_RADIO: Source Data `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_RADIO: Schedule `;let F;return F=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SPK_RADIO: Options `,[e,t,i,o,F,["step","","routerLinkActive","active",3,"routerLink"],[1,"indeterminate","primary"]]},template:function(t,i){t&1&&(r(0,"app-status-bar"),p(1,"header"),k(2,x,2,1,"p"),p(3,"spk-stepper")(4,"div",5),d(5,0),r(6,"spk-radio"),c(),s(),p(7,"div",5),d(8,1),r(9,"spk-radio"),c(),s(),p(10,"div",5),d(11,2),r(12,"spk-radio"),c(),s(),p(13,"div",5),d(14,3),r(15,"spk-radio"),c(),s(),p(16,"div",5),d(17,4),r(18,"spk-radio"),c(),s()()(),k(19,z,1,0,"spk-progress-bar",6)(20,j,2,0,"section")),t&2&&(n(2),g(i.isNew()?-1:2),n(2),u("routerLink",_(7,G,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),u("routerLink",_(10,y,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),u("routerLink",_(13,U,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),u("routerLink",_(16,w,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),u("routerLink",_(19,X,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),g(i.finishedLoading()?20:19))},dependencies:[B,b,M,v,N,I,$],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}header[_ngcontent-%COMP%]{padding:1rem 1.5rem;border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:.5rem}header[_ngcontent-%COMP%] spk-stepper[_ngcontent-%COMP%]{width:100%}section[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;flex:1 0;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:auto}"],changeDetection:0})};export{f as default};
@@ -0,0 +1 @@
1
+ import{a as $}from"./chunk-ULLALJQ2.js";import"./chunk-J6BHRR34.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import{b as v,c as G,e as L,f as w,j as U,o as x,q as K,r as j,t as X}from"./chunk-NSIELNIY.js";import"./chunk-7QJG4IIT.js";import"./chunk-3ZVSHKLD.js";import{d as A,e as O}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{A as B,a as y,c as b,g as h,l as N,m as R}from"./chunk-Y5IRBMLB.js";import{h as E}from"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import{Ab as l,H as g,Kb as D,Lb as P,Mb as _,Pb as I,Qa as s,Qb as d,Z as F,ab as T,bc as k,na as m,sb as S,sc as M,tb as C,xb as u,yb as a,zb as n}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";var V=()=>["/"];function z(c,o){c&1&&(a(0,"spk-form-field")(1,"label",14),_(2,3),n(),l(3,"input",15),n())}var p=new j,f=class c{#e=F(b);#o=F(E);#n=F($);#t=F(A);isImporting=m(!1);isSecureFile=m(!1);importForm=p.group({config:p.control(""),cmdline:p.control(!1),import_metadata:p.control(!1),direct:p.control(!1),passphrase:p.control("")});selectedFile=m([]);onFileDropped(o){let e=o[0];if(e){let t=new FileReader;this.isSecureFile.set(e.type!=="application/json"),t.onload=this.#i.bind(this),t.readAsArrayBuffer(e)}}#i(o){let e=o.target?.result;this.isSecureFile.set(this.#r(e)!=="json"),this.importForm.patchValue({config:this.#a(e)})}#r(o){let e=new Uint8Array(o);if(e.length>=5&&e[0]===65&&e[1]===69&&e[2]===83&&e[4]===0)return"aes";try{let t=new TextDecoder().decode(o),i=JSON.parse(t);if(typeof i=="object"&&i!==null)return"json"}catch{}return"unknown"}#a(o){let e=new Uint8Array(o),t=e.byteLength,i="";for(let r=0;r<t;r++)i+=String.fromCharCode(e[r]);return btoa(i)}submit(){this.isImporting.set(!0);let o=this.importForm.value.direct??!1;this.#o.postApiV1BackupsImport({requestBody:this.importForm.value}).pipe(g(()=>this.isImporting.set(!1))).subscribe({next:e=>{if(o){this.#e.success("Backup imported successfully."),this.#t.navigate(["/"]);return}let t=this.#n.addDraftBackup(e.data);this.#t.navigate(["/backup-draft",t])},error:e=>{this.#e.error(e.message)}})}static \u0275fac=function(e){return new(e||c)};static \u0275cmp=T({type:c,selectors:[["app-import"]],decls:19,vars:8,consts:()=>{let o;o=$localize` Import backup configuration ${"\uFFFD#3\uFFFD"}:START_TAG_DIV:${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"[\uFFFD#5\uFFFD|\uFFFD#7\uFFFD]"}:START_TAG_SPK_ICON:arrow-left${"[\uFFFD/#5\uFFFD|\uFFFD/#7\uFFFD]"}:CLOSE_TAG_SPK_ICON: Back ${"[\uFFFD/#4\uFFFD|\uFFFD/#6\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#6\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#5\uFFFD|\uFFFD#7\uFFFD]"}:START_TAG_SPK_ICON:download-simple${"[\uFFFD/#5\uFFFD|\uFFFD/#7\uFFFD]"}:CLOSE_TAG_SPK_ICON: Import ${"[\uFFFD/#4\uFFFD|\uFFFD/#6\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_DIV:`,o=I(o);let e;e=$localize`Import Metadata`;let t;t=$localize`Save now`;let i;return i=$localize`Passphrase`,[o,e,t,i,[1,"actions"],["spk-button","","type","button",1,"outlined",3,"routerLink"],["spk-button","","type","submit",1,"raised","primary",3,"click","disabled"],["autocomplete","off",3,"formGroup"],["accept",".json,.aes",3,"filesChange","files"],[1,"primary","raised"],["for","importMetadata"],["type","checkbox","formControlName","import_metadata"],["for","direct"],["type","checkbox","formControlName","direct"],["for","passphrase"],["type","password","formControlName","passphrase"]]},template:function(e,t){e&1&&(a(0,"header")(1,"h3"),D(2,0),a(3,"div",4)(4,"button",5),l(5,"spk-icon"),n(),a(6,"button",6),d("click",function(){return t.submit()}),l(7,"spk-icon"),n()(),P(),n()(),a(8,"form",7)(9,"spk-file-upload",8),d("filesChange",function(r){return t.onFileDropped(r)}),n(),S(10,z,4,0,"spk-form-field"),a(11,"spk-toggle",9)(12,"label",10),_(13,1),n(),l(14,"input",11),n(),a(15,"spk-toggle",9)(16,"label",12),_(17,2),n(),l(18,"input",13),n()()),e&2&&(s(4),u("routerLink",M(7,V)),s(2),k("loader",t.isImporting()),u("disabled",t.isImporting()),s(2),u("formGroup",t.importForm),s(),u("files",t.selectedFile()),s(),C(t.isSecureFile()?10:-1))},dependencies:[X,U,G,v,L,w,x,K,O,N,y,h,B,R],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:3rem}h3[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;justify-content:space-between}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;max-width:31.25rem}spk-file-upload[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})};export{f as default};
@@ -0,0 +1 @@
1
+ import{a as R}from"./chunk-XIOHRQ3X.js";import{b as $}from"./chunk-LDIZ5E5Z.js";import"./chunk-WZRDKVOR.js";import"./chunk-ULLALJQ2.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import"./chunk-NSIELNIY.js";import"./chunk-7QJG4IIT.js";import"./chunk-3ZVSHKLD.js";import{b as A,e as N}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{a as k,g as B}from"./chunk-Y5IRBMLB.js";import{h as O}from"./chunk-DNJOKPEL.js";import"./chunk-UZK7ABRM.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-B6OIHB5W.js";import{Ab as _,Hc as M,Kb as c,Lb as d,Mb as l,Pb as g,Qa as i,Qb as I,Z as C,ab as p,ec as E,gc as L,na as r,sb as s,tb as u,ub as f,vb as S,wb as T,yb as F,zb as a}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";function b(e,t){e&1&&l(0,2,1)}function P(e,t){e&1&&l(0,2,2)}function h(e,t){e&1&&l(0,2,3)}function v(e,t){e&1&&l(0,2,4)}function U(e,t){if(e&1&&(E(0),_(1,"br")),e&2){let n=t.$implicit;L(" ",n," ")}}var D=class e{#t=C(O);#e=C(A);#n=$(this.#e.params);runId=M(()=>this.#n()?.runId);offset=r(0);status=r("starting");messageLog=r([]);interval=setInterval(()=>{this.#t.getApiV1CommandlineByRunid({runid:this.runId(),offset:this.offset(),pagesize:100}).subscribe(t=>{this.offset.set(t.Count),this.evalStatus(t),this.messageLog.update(n=>[...n,...t.Items])})},1e3);evalStatus(t){t.Started===!0&&t.Finished===!0&&(this.status.set("finished"),clearInterval(this.interval)),t.Started===!0&&t.Finished===!1&&this.status.set("started")}abort(){this.#t.postApiV1CommandlineByRunidAbort({runid:this.runId()}).subscribe({next:t=>{this.status.set("aborted"),clearInterval(this.interval)}})}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=p({type:e,selectors:[["app-commandline-result"]],decls:18,vars:4,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_ICON: Back `;let n;n=$localize` Running commandline task... ${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON:Abort${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_BUTTON:`;let o;return o=$localize`${"\uFFFD*11:1\uFFFD"}:START_BLOCK_IF: Starting... ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*12:2\uFFFD"}:START_BLOCK_IF_1: Started! ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*13:3\uFFFD"}:START_BLOCK_IF_2: Finished! ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*14:4\uFFFD"}:START_BLOCK_IF_3: Aborted! ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:`,o=g(o),[t,n,o,[1,"back"],["type","button","spk-button","","routerLink","../",1,"small"],["type","button","spk-button","",1,"small",3,"click"],[1,"status"]]},template:function(n,o){n&1&&(_(0,"app-status-bar"),F(1,"section")(2,"div",3)(3,"button",4),c(4,0),_(5,"spk-icon"),d(),a()(),F(6,"h3"),c(7,1),F(8,"button",5),I("click",function(){return o.abort()}),a(),d(),a(),F(9,"div",6),c(10,2),s(11,b,1,0),s(12,P,1,0),s(13,h,1,0),s(14,v,1,0),d(),a(),F(15,"code"),S(16,U,2,1,null,null,f),a()()),n&2&&(i(11),u(o.status()==="starting"?11:-1),i(),u(o.status()==="started"?12:-1),i(),u(o.status()==="finished"?13:-1),i(),u(o.status()==="aborted"?14:-1),i(2),T(o.messageLog()))},dependencies:[R,k,B,N],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;padding:2.5rem;gap:1.25rem}code[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--base-8),#000 70%);color:#fff;padding:2.5rem 2.5rem 2.5rem 1.5rem;border-radius:var(--shape-3);overflow:auto;white-space:pre}"],changeDetection:0})};export{D as default};
@@ -0,0 +1 @@
1
+ import{c as a,d as b}from"./chunk-JI7GCFQB.js";import"./chunk-N57J64DN.js";import"./chunk-2G6TVFPZ.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-LDIZ5E5Z.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import"./chunk-NSIELNIY.js";import"./chunk-3ZVSHKLD.js";import"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";export{a as createEncryptionForm,b as default};
@@ -0,0 +1 @@
1
+ import{a as J}from"./chunk-VPTK3JCV.js";import"./chunk-32366MQR.js";import{g as q}from"./chunk-JI7GCFQB.js";import"./chunk-N57J64DN.js";import"./chunk-2G6TVFPZ.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-LDIZ5E5Z.js";import{b as Z}from"./chunk-HDDYOVZL.js";import"./chunk-QRRKPBY6.js";import{a as K}from"./chunk-WZRDKVOR.js";import"./chunk-ULLALJQ2.js";import{a as H}from"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import{a as V}from"./chunk-WXARH2SG.js";import"./chunk-NSIELNIY.js";import"./chunk-7QJG4IIT.js";import"./chunk-3ZVSHKLD.js";import{b as w}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{a as W,h as X,p as z,s as B}from"./chunk-Y5IRBMLB.js";import{h as j}from"./chunk-DNJOKPEL.js";import{qa as b}from"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import{Ab as S,Bb as T,Cb as u,Hc as x,Kb as y,Lb as v,Mb as r,Nb as D,Ob as I,Qa as _,Rb as g,Z as R,ab as L,ec as M,fa as C,ga as f,hc as F,na as A,sb as p,tb as O,wc as d,xb as P,xc as m,yb as i,zb as s}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";function Q(n,t){n&1&&(i(0,"div",17),C(),i(1,"svg",19),S(2,"circle",20),s(),f(),i(3,"spk-icon",21),r(4,3),s()())}function U(n,t){n&1&&(i(0,"div",18),C(),i(1,"svg",19),S(2,"circle",20),s(),f(),i(3,"spk-icon",22),r(4,4),s()())}function Y(n,t){if(n&1&&(i(0,"spk-card",10),T(1,16),r(2,2),u(),p(3,Q,5,0,"div",17)(4,U,5,0,"div",18),s()),n&2){let e=g();_(3),O(e.restoreResult()=="success"?3:4)}}function ee(n,t){if(n&1&&(M(0),d(1,"number"),d(2,"number")),n&2){let e,o=g(2);F(" ",m(1,2,(e=o.statusData())==null?null:e.ProcessedFileCount)," of ",m(2,4,(e=o.statusData())==null?null:e.TotalFileCount)," ")}}function te(n,t){n&1&&(T(0),r(1,8),u())}function ne(n,t){if(n&1&&(M(0),d(1,"bytes"),d(2,"bytes")),n&2){let e,o=g(2);F(" ",m(1,2,(e=o.statusData())==null?null:e.ProcessedFileSize)," of ",m(2,4,(e=o.statusData())==null?null:e.TotalFileSize)," ")}}function oe(n,t){n&1&&(T(0),r(1,9),u())}function ie(n,t){if(n&1&&(i(0,"spk-card",10)(1,"h3"),y(2,5),S(3,"spk-spinner",23),v(),s(),i(4,"div",24),S(5,"spk-progress-bar",25),i(6,"p")(7,"span"),r(8,6),s(),p(9,ee,3,6)(10,te,2,0,"ng-container"),s(),i(11,"p")(12,"span"),r(13,7),s(),p(14,ne,3,6)(15,oe,2,0,"ng-container"),s()()()),n&2){let e,o,l,E,c=g();_(3),D((e=c.statusData())==null?null:e.statusText),I(2),_(2),P("value",(o=c.statusData())==null?null:o.OverallProgress),_(4),O((l=c.statusData())!=null&&l.ProcessedFileCount?9:10),_(5),O((E=c.statusData())!=null&&E.ProcessedFileSize?14:15)}}var N=class n{#i=R(j);#s=R(H);#t=R(K);#n=R(q);#r=R(w);statusData=this.#t.statusData;backupId=this.#n.backupId;restoreResult=A("");#e=null;lastRestoreStarted=x(()=>{if(this.#e)return this.#e;let t=this.#t.statusData()?.backup?.Backup?.Metadata?.LastRestoreStarted??null;if(!t)return null;let e=this.fixDate(t);return this.#e=e,e});notificationFilterPredicate=()=>{let t=this.lastRestoreStarted();return{predicate:e=>(e.BackupID===this.#n.backupId()&&t&&t.getTime()<=new Date(e.Timestamp).getTime())??!1}};ngOnInit(){let t=this.#r.snapshot.params.taskid?.toString()??"";this.#i.getApiV1TaskByTaskid({taskid:t}).subscribe({next:e=>{if(e.TaskStarted&&(this.#e=new Date(e.TaskStarted)),!e.TaskFinished&&e.ID){this.#a(e.ID);return}this.#o(e)},error:e=>{console.error("Error fetching task:",e),this.restoreResult.set("error"),alert("Failed to fetch task details. Please try again later.")}})}#a(t){this.#s.waitForTaskToComplete(t).subscribe(e=>{this.#o(e)})}#o(t){t.TaskFinished!=null&&this.restoreResult.set(t.Status==="Completed"&&t.ErrorMessage==null?"success":"error")}fixDate(t){return new Date(`${t.slice(0,4)}-${t.slice(4,6)}-${t.slice(6,8)}T${t.slice(9,11)}:${t.slice(11,13)}:${t.slice(13,15)}Z`)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=L({type:n,selectors:[["app-restore-progress"]],decls:12,vars:6,consts:()=>{let t;t=$localize`Notifications`;let e;e=$localize`Logs`;let o;o=$localize`Restore completed`;let l;l=$localize`check-bold`;let E;E=$localize`warning-octagon`;let c;c=$localize` Restore progress: ${"\uFFFD0\uFFFD"}:INTERPOLATION: ${"\uFFFD#3\uFFFD"}:START_TAG_SPK_SPINNER:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SPK_SPINNER:`;let G;G=$localize`Files processed:`;let k;k=$localize`Size processed:`;let $;$=$localize`N/A`;let h;return h=$localize`N/A`,[t,e,o,l,E,c,G,k,$,h,[1,"progress","type-a"],[1,"notifications","type-a"],[1,"notification-list"],[3,"notificationFilterPredicate"],[1,"logs","type-a"],[3,"asSimpleList","polling","whenFilter","backupIdFilter"],["title",""],[1,"complete-success"],[1,"complete-failure"],[1,"border-svg"],["cx","50","cy","50","r","45",1,"border-circle"],[1,"success"],[1,"error"],[1,"primary"],[1,"progress-content"],[3,"value"]]},template:function(e,o){if(e&1&&(i(0,"section"),p(1,Y,5,1,"spk-card",10)(2,ie,16,4,"spk-card",10),i(3,"spk-card",11)(4,"h3"),r(5,0),s(),i(6,"div",12),S(7,"app-notifications",13),s()(),i(8,"spk-card",14)(9,"h3"),r(10,1),s(),S(11,"app-logs-live",15),s()()),e&2){let l;_(),O(o.restoreResult()!=""?1:2),_(6),P("notificationFilterPredicate",o.notificationFilterPredicate()),_(4),P("asSimpleList",!0)("polling",o.restoreResult()=="")("whenFilter",(l=o.lastRestoreStarted())==null?null:l.getTime())("backupIdFilter",o.backupId())}},dependencies:[J,z,B,W,X,Z,V,b],styles:['[_nghost-%COMP%]{display:block;padding:0 1.25rem;margin-top:32px}section[_ngcontent-%COMP%]{display:grid;gap:1.25rem;grid-template-columns:2fr 1fr;grid-template-areas:"progress notifications" "logs logs"}section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-bottom:1rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]{grid-area:progress}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]:has(.complete-check){display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1.25rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] spk-spinner[_ngcontent-%COMP%]{--spinner-size: 1.25rem;--spinner-thickness: .1875rem}section[_ngcontent-%COMP%] .notifications[_ngcontent-%COMP%]{grid-area:notifications}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%]{grid-area:logs}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%] app-logs-live[_ngcontent-%COMP%]{max-height:50rem;overflow:auto}.notification-list[_ngcontent-%COMP%]{max-height:15rem;overflow:auto}.complete-success[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--success-8)}.complete-success[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-success[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--success-8)}.complete-failure[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--error-8)}.complete-failure[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-failure[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--error-8)}.border-svg[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}.border-circle[_ngcontent-%COMP%]{fill:none;stroke-width:.3125rem;stroke-dasharray:282.74;stroke-dashoffset:282.74;animation:_ngcontent-%COMP%_draw-border 1.2s linear forwards}@keyframes _ngcontent-%COMP%_draw-border{to{stroke-dashoffset:0}}@keyframes _ngcontent-%COMP%_reveal-icon{to{opacity:1}}.progress-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.progress-content[_ngcontent-%COMP%] spk-progress-bar[_ngcontent-%COMP%]{margin-bottom:.75rem}.progress-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-right:.25rem}'],changeDetection:0})};export{N as default};
@@ -0,0 +1 @@
1
+ import{a as f}from"./chunk-3ZVSHKLD.js";import{Z as c,a as S,b as i,na as m}from"./chunk-BTMXQPBB.js";function u(...a){let e=m(...a);return Object.defineProperty(e,"value",{get:e.asReadonly(),set:e.set.bind(e)})}function A(a,e,o=!1,s){let l=c(f);e=l.getItemParsed(a,o)??e;let n=u(e),r=n[S];s?.equal&&(r.equal=s.equal);function g(t){t==null?l.removeItem(a):l.setItemParsed(a,t,o)}return n.set=t=>{g(t),i(r,t)},n.update=t=>{let T=t(n());g(T),i(r,T)},n}export{A as a};
@@ -1 +1 @@
1
- import{f as a,g as b}from"./chunk-2YMUOQLP.js";import"./chunk-XIIFTZ5G.js";import"./chunk-BCHZRC5K.js";import"./chunk-B26UYXA3.js";import"./chunk-LDIZ5E5Z.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-NSIELNIY.js";import"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";export{a as createSourceDataForm,b as default};
1
+ import{f as a,g as b}from"./chunk-HRSZZWTB.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-B26UYXA3.js";import"./chunk-LDIZ5E5Z.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-NSIELNIY.js";import"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";export{a as createSourceDataForm,b as default};
@@ -0,0 +1 @@
1
+ import{a as S}from"./chunk-XIOHRQ3X.js";import"./chunk-WZRDKVOR.js";import"./chunk-ULLALJQ2.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import"./chunk-NSIELNIY.js";import"./chunk-7QJG4IIT.js";import"./chunk-3ZVSHKLD.js";import{c as O,e as C,f as d}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{y as M}from"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-UZK7ABRM.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-B6OIHB5W.js";import{Ab as l,Mb as n,ab as A,yb as e,zb as t}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";var s=class a{static \u0275fac=function(o){return new(o||a)};static \u0275cmp=A({type:a,selectors:[["app-about"]],decls:19,vars:0,consts:()=>{let _;_=$localize`General`;let o;o=$localize`Changelog`;let r;r=$localize`Libraries`;let g;g=$localize`System info`;let u;u=$localize`Server settings`;let T;T=$localize`Logs`;let c;return c=$localize`Crash log`,[_,o,r,g,u,T,c,[1,"content"],[1,"primary"],["tab","","routerLink","/about/general","routerLinkActive","active"],["tab","","routerLink","/about/changelog","routerLinkActive","active"],["tab","","routerLink","/about/libraries","routerLinkActive","active"],["tab","","routerLink","/about/system-info","routerLinkActive","active"],["tab","","routerLink","/about/server-settings","routerLinkActive","active"],["tab","","routerLink","/about/logs","routerLinkActive","active"],["tab","","routerLink","/about/crashlogs","routerLinkActive","active"]]},template:function(o,r){o&1&&(l(0,"app-status-bar"),e(1,"div",7)(2,"spk-tabs",8)(3,"button",9),n(4,0),t(),e(5,"button",10),n(6,1),t(),e(7,"button",11),n(8,2),t(),e(9,"button",12),n(10,3),t(),e(11,"button",13),n(12,4),t(),e(13,"button",14),n(14,5),t(),e(15,"button",15),n(16,6),t()(),e(17,"section"),l(18,"router-outlet"),t()())},dependencies:[S,M,O,C,d],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:0}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:1rem 0}.content[_ngcontent-%COMP%] spk-tabs[_ngcontent-%COMP%]{margin:0 2rem}.content[_ngcontent-%COMP%] section[_ngcontent-%COMP%]{padding-left:2rem}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:2rem}"],changeDetection:0})};export{s as default};
@@ -0,0 +1 @@
1
+ import"./chunk-EUDKD2JW.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-LPFSQKIK.js")},{path:"encryption",loadComponent:()=>import("./chunk-74BJ4GVA.js")},{path:"select-files",loadComponent:()=>import("./chunk-PZCO6IX3.js")},{path:"options",loadComponent:()=>import("./chunk-PZA4FRVJ.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-7IBACL6K.js")}],t=o;export{t as default};
@@ -0,0 +1 @@
1
+ import{a as o}from"./chunk-7QJG4IIT.js";import{Ic as i,U as s,na as t}from"./chunk-BTMXQPBB.js";var a=class e{#e=o("darkTheme",null,!0);#t=t(window?.innerWidth<=768);#s=t(!1);isDarkMode=this.#e.asReadonly();isMobile=this.#t.asReadonly();isNavOpen=this.#s.asReadonly();constructor(){window.matchMedia("(prefers-color-scheme:dark)").matches&&this.#e()===null&&this.setDarkMode(),i(()=>{this.#e()?document.body.classList.add("dark"):document.body.classList.remove("dark")})}ngOnInit(){window.addEventListener("resize",this.#i)}toggleNav(){this.#s.set(!this.isNavOpen())}toggleBodyClass(){this.#e.set(!this.isDarkMode())}setDarkMode(){this.#e.set(!0)}setLightMode(){this.#e.set(!1)}#i(){this.#t.set(window.innerWidth<=768)}ngOnDestroy(){window.removeEventListener("resize",this.#i)}static \u0275fac=function(n){return new(n||e)};static \u0275prov=s({token:e,factory:e.\u0275fac,providedIn:"root"})};export{a};
@@ -0,0 +1 @@
1
+ import"./chunk-EUDKD2JW.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-GKOS3VYR.js")},{path:"destination",loadComponent:()=>import("./chunk-UT7GWYPR.js")},{path:"source-data",loadComponent:()=>import("./chunk-BQE7QZIT.js")},{path:"schedule",loadComponent:()=>import("./chunk-OFFMLGEZ.js")},{path:"options",loadComponent:()=>import("./chunk-M3CLGZMQ.js")}];export{o as default};
@@ -0,0 +1 @@
1
+ import{g as m}from"./chunk-JI7GCFQB.js";import"./chunk-N57J64DN.js";import"./chunk-2G6TVFPZ.js";import{a as y}from"./chunk-XIOHRQ3X.js";import{h as w}from"./chunk-HRSZZWTB.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-B26UYXA3.js";import{b as u}from"./chunk-LDIZ5E5Z.js";import"./chunk-WZRDKVOR.js";import"./chunk-ULLALJQ2.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import"./chunk-NSIELNIY.js";import"./chunk-7QJG4IIT.js";import"./chunk-3ZVSHKLD.js";import{a as L,b as M,c as N,d as I,e as h,f as G}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{q as W,v}from"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-UZK7ABRM.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-B6OIHB5W.js";import{Ab as s,Ic as $,Kb as F,Lb as l,Qa as r,Rb as E,Z as c,ab as P,bc as D,na as C,rc as A,sb as T,sc as S,tb as g,tc as O,xb as _,yb as i,zb as n}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";var x=()=>["/restore-from-files/destination"],K=()=>["/restore-from-files/encryption"],X=()=>["/restore-from-files/select-files"],b=()=>["/restore-from-files/options"],z=t=>["/restore",t,"select-files"],B=t=>["/restore",t,"options"];function U(t,o){t&1&&(i(0,"div",6),F(1,0),s(2,"spk-radio"),l(),n(),i(3,"div",6),F(4,1),s(5,"spk-radio"),l(),n(),i(6,"div",6),F(7,2),s(8,"spk-radio"),l(),n(),i(9,"div",6),F(10,3),s(11,"spk-radio"),l(),n()),t&2&&(_("routerLink",S(4,x)),r(3),_("routerLink",S(5,K)),r(3),_("routerLink",S(6,X)),r(3),_("routerLink",S(7,b)))}function j(t,o){if(t&1&&(i(0,"div",6),F(1,4),s(2,"spk-radio"),l(),n(),i(3,"div",6),F(4,5),s(5,"spk-radio"),l(),n()),t&2){let e=E(2);_("routerLink",O(2,z,e.backupId())),r(3),_("routerLink",O(4,B,e.backupId()))}}function H(t,o){if(t&1&&(i(0,"spk-stepper"),T(1,U,12,8)(2,j,6,6),n()),t&2){let e=E();r(),g(e.isFileRestore()?1:2)}}var k=class t{#e=c(M);#o=c(I);#t=c(m);#i=u(this.#e.params);#n=u(this.#e.url);#s=u(this.#e.children[0].url);backupId=this.#t.backupId;isFileRestore=this.#t.isFileRestore;isProgressPage=C(!1);paramsChanged=$(()=>{let o=this.#s(),e=this.#i()?.id,a=!!this.#n()?.find(d=>d.path==="restore-from-files"),R=!!o?.find(d=>d.path==="progress");this.isProgressPage.set(R),this.#t.init(e,a)});ngOnInit(){this.#o.events.subscribe(o=>{if(o instanceof L){let e=o.urlAfterRedirects;this.isProgressPage.set(e.includes("progress"))}})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=P({type:t,selectors:[["app-restore-flow"]],hostVars:2,hostBindings:function(e,a){e&2&&D("full-width",a.isProgressPage())},features:[A([m,w])],decls:4,vars:1,consts:()=>{let o;o=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_RADIO: Destination `;let e;e=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_RADIO: Encryption `;let a;a=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SPK_RADIO: Select files `;let R;R=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SPK_RADIO: Options `;let d;d=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_RADIO: Select files `;let f;return f=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_RADIO: Options `,[o,e,a,R,d,f,["step","","routerLinkActive","active",3,"routerLink"]]},template:function(e,a){e&1&&(s(0,"app-status-bar"),T(1,H,3,1,"spk-stepper"),i(2,"section"),s(3,"router-outlet"),n()),e&2&&(r(),g(a.isProgressPage()?-1:1))},dependencies:[v,W,y,N,h,G],styles:["[_nghost-%COMP%]{display:block}.full-width[_nghost-%COMP%] section[_ngcontent-%COMP%]{max-width:62.5rem}spk-stepper[_ngcontent-%COMP%]{max-width:31.25rem;margin:2.5rem auto}section[_ngcontent-%COMP%]{max-width:31.25rem;margin:0 auto 2.5rem}"],changeDetection:0})};export{k as default};
@@ -0,0 +1 @@
1
+ import{a as Le,b as Re}from"./chunk-HDDYOVZL.js";import{a as $e}from"./chunk-DG7SFNGT.js";import{a as x}from"./chunk-QRRKPBY6.js";import"./chunk-WZRDKVOR.js";import{a as fe}from"./chunk-ULLALJQ2.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import{a as Ie}from"./chunk-ELFZD53L.js";import{c as Pe,d as Oe,e as he,i as De,r as ke,s as Ne,t as Me}from"./chunk-NSIELNIY.js";import"./chunk-7QJG4IIT.js";import{b as de,d as Ee}from"./chunk-3ZVSHKLD.js";import{c as ce,e as pe,f as ue}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{C as Te,a as M,b as G,c as Se,e as ge,g as w,k as Fe,l as Ae,n as Ce,u as me}from"./chunk-Y5IRBMLB.js";import{h as H}from"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import{Ab as l,Eb as f,H as V,Hc as re,Ic as j,Kb as p,Lb as u,Mb as O,Mc as le,Oc as _e,Pb as R,Qa as r,Qb as g,Qc as Q,Rb as c,Z as A,Zb as ne,_b as oe,ab as N,bc as v,da as C,dc as $,ea as m,ec as F,fc as X,gc as K,jc as z,kc as W,lc as q,mc as ie,na as E,nc as se,oc as y,sb as d,sc as ae,tb as S,ub as Z,vb as ee,wb as te,xb as h,yb as s,zb as i}from"./chunk-BTMXQPBB.js";import{a as Y,b as B}from"./chunk-EUDKD2JW.js";var Ge=["scroller"];function we(n,o){n&1&&(s(0,"spk-icon"),F(1,"bell-ringing"),i())}function He(n,o){n&1&&(s(0,"spk-icon"),F(1,"bell"),i())}function xe(n,o){if(n&1&&l(0,"app-notification",8),n&2){c(2);let e=y(6);h("index",0)("notification",e.content)}}function Ue(n,o){if(n&1&&(s(0,"div",11),F(1),i()),n&2){c(3);let e=y(6);r(),K(" ",e.content.content," ")}}function Ye(n,o){if(n&1&&(s(0,"spk-alert")(1,"div",10),F(2),i(),d(3,Ue,2,1,"div",11),i()),n&2){c(2);let e=y(6);$(e.content.type||"error"),r(2),X(e.content.title),r(),S(e.content.content?3:-1)}}function Be(n,o){if(n&1&&(s(0,"div",6),d(1,xe,1,2,"app-notification",8)(2,Ye,4,4,"spk-alert",9),i()),n&2){c();let e=y(6);r(),S(e.type==="notification"?1:2)}}function Ve(n,o){if(n&1){let e=f();s(0,"div",7)(1,"div",12)(2,"h6",13),p(3,2),s(4,"button",5),g("click",function(){C(e);let a=c();return m(a.toggleNotifications())}),l(5,"spk-icon"),i(),u(),i(),s(6,"div",14,0)(8,"div",15),l(9,"app-notifications"),i()()()()}}function Xe(n,o){if(n&1&&(s(0,"div",20),F(1),i()),n&2){let e=c().$implicit;r(),K(" ",e.content," ")}}function Ke(n,o){if(n&1){let e=f();s(0,"spk-alert",18,1),g("click",function(){let a=C(e).$implicit,_=c(2);return m(_.deleteAlertByIndex(a.id))}),s(2,"div",19),F(3),i(),d(4,Xe,2,1,"div",20),i()}if(n&2){let e=o.$implicit;$(e.type),h("id",e.id),r(3),X(e.title),r(),S(e.content?4:-1)}}function ze(n,o){n&1&&(s(0,"p",17),O(1,4),i())}function We(n,o){if(n&1){let e=f();s(0,"div",7)(1,"div",12)(2,"h6",13),p(3,3),s(4,"button",5),g("click",function(){C(e);let a=c();return m(a.toggleAlerts())}),l(5,"spk-icon"),i(),u(),i(),s(6,"div",14,0)(8,"div",15),ee(9,Ke,5,5,"spk-alert",16,Z,!1,ze,2,0,"p",17),i()()()()}if(n&2){let e=c();r(9),te(e.alertHistory())}}var ye=new ke,b=class n{#e=A(Se);#t=A(x);isSubmitting=E(!1);messageSent=E(!1);form=ye.group({message:ye.control("",[Oe.required])});notifications=this.#t.notifications;shownMessage=E(null);shownMessageInterval=null;alertHistory=this.#e.alertHistory;alertHistoryIsOpen=this.#e.alertHistoryIsOpen;alertHistoryIsHidden=this.#e.alertHistoryIsHidden;numberOfOpenAlerts=re(()=>this.alertHistory().filter(o=>o.isOpen).length);scroller=_e("scroller");isAlertsOpen=Q(!1);isNotificationsOpen=Q(!1);previousHistoryCount=E(null);previousNotificationsCount=E(null);constructor(){j(()=>{let o=this.alertHistory(),e=this.notifications();if(e.length===0){this.shownMessage.set(null);return}e.length&&this.previousHistoryCount()!==o.length&&!this.isNotificationsOpen()?(this.shownMessage.set({content:e[0],countDown:3,type:"notification"}),this.previousHistoryCount.set(o.length),this.shownMessageInterval=setInterval(()=>{let t=this.shownMessage();if(t?.countDown===0){this.shownMessage.set(null),this.shownMessageInterval=null;return}t!==null&&this.shownMessage.update(a=>B(Y({},a),{countDown:a.countDown-1}))},1e3)):o.length&&this.previousHistoryCount()!==o.length&&!this.isAlertsOpen()&&(this.shownMessage.set({content:o[0],countDown:3,type:"alert"}),this.previousHistoryCount.set(o.length),this.shownMessageInterval=setInterval(()=>{let t=this.shownMessage();if(t?.countDown===0){this.shownMessage.set(null),this.shownMessageInterval=null;return}t!==null&&this.shownMessage.update(a=>B(Y({},a),{countDown:a.countDown-1}))},1e3))}),j(()=>{this.alertHistoryIsOpen(),this.scrollToBottom()})}resetPreviewMessage(){this.shownMessage.set(null),this.shownMessageInterval=null}toggleAlerts(){this.isAlertsOpen()?this.isAlertsOpen.set(!1):(this.isAlertsOpen.set(!0),this.isNotificationsOpen.set(!1),this.resetPreviewMessage())}toggleNotifications(){this.isNotificationsOpen.set(!this.isNotificationsOpen()),this.isAlertsOpen()&&this.isAlertsOpen.set(!1)}deleteAlertByIndex(o){this.#e.removeAlert(o)}scrollToBottom(){this.scroller()&&this.scroller()?.nativeElement&&this.scroller().nativeElement.scrollTo(0,this.scroller().nativeElement.scrollHeight)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=N({type:n,selectors:[["app-service-hub"]],viewQuery:function(e,t){e&1&&ne(t.scroller,Ge,5),e&2&&oe()},inputs:{isAlertsOpen:[1,"isAlertsOpen"],isNotificationsOpen:[1,"isNotificationsOpen"]},outputs:{isAlertsOpen:"isAlertsOpenChange",isNotificationsOpen:"isNotificationsOpenChange"},decls:10,vars:9,consts:()=>{let o;o=$localize` Notifications ${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"\uFFFD#5\uFFFD"}:START_TAG_SPK_ICON:x-circle${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_BUTTON:`;let e;e=$localize` Alerts ${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"\uFFFD#5\uFFFD"}:START_TAG_SPK_ICON:x-circle${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_BUTTON:`;let t;return t=$localize`No alerts yet`,[["scroller",""],["alerts",""],o,e,t,["spk-button","",3,"click"],[1,"preview-alert-wrap"],[1,"alert-stream-modal"],[3,"index","notification"],[3,"class"],["sparkle-alert-title",""],["sparkle-alert-content",""],[1,"alert-stream-modal-content"],[1,"paragraph-20"],[1,"alert-stream-modal-list-scroller"],[1,"alert-stream-modal-list"],[3,"class","id"],[1,"no-alerts"],[3,"click","id"],["title",""],["content",""]]},template:function(e,t){if(e&1){let a=f();s(0,"button",5),g("click",function(){return C(a),m(t.toggleAlerts())}),s(1,"spk-icon"),F(2,"info"),i()(),s(3,"button",5),g("click",function(){return C(a),m(t.toggleNotifications())}),d(4,we,2,0,"spk-icon")(5,He,2,0,"spk-icon"),i(),ie(6),d(7,Be,3,1,"div",6),d(8,Ve,10,0,"div",7),d(9,We,12,1,"div",7)}if(e&2){$(t.alertHistory().length?"error":""),r(3),$(t.notifications().length?"error":""),r(),S(t.notifications().length?4:5),r(2);let a=se(t.shownMessage());r(),S(a?7:-1),r(),S(t.isNotificationsOpen()?8:-1),r(),S(t.isAlertsOpen()?9:-1)}},dependencies:[Me,G,M,w,Re,Le],styles:["[_nghost-%COMP%]{display:flex;position:fixed;gap:.5rem;bottom:1.5rem;right:1.5rem;z-index:5000}@media only screen and (max-width: 768px){[_nghost-%COMP%]{bottom:1rem;right:1rem}}[_nghost-%COMP%] h6[_ngcontent-%COMP%]{margin:0}.preview-alert-wrap[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column;min-width:15.625rem}.helpdesk-modal[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column}@media only screen and (max-width: 768px){.helpdesk-modal[_ngcontent-%COMP%]{bottom:2.6875rem}}.helpdesk-modal-content[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;gap:1rem;min-width:20rem;border:1px solid var(--base-4);background-color:var(--base-1);border-radius:var(--shape-2)}.helpdesk-modal-content[_ngcontent-%COMP%] .message-sent[_ngcontent-%COMP%]{padding:0 1rem 1rem;text-wrap:pretty}.helpdesk-modal-content[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid var(--base-4);display:flex;align-items:center;justify-content:space-between}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{padding:0 1rem 1rem;display:flex;flex-direction:column;align-items:flex-end;gap:1rem}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{width:100%;text-wrap:pretty}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{width:100%}.alert-stream-modal[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column}@media only screen and (max-width: 768px){.alert-stream-modal[_ngcontent-%COMP%]{bottom:2.6875rem}}.alert-stream-modal-list-scroller[_ngcontent-%COMP%]{overflow-y:auto;max-height:18.75rem}.alert-stream-modal-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:1rem;border-radius:var(--shape-2)}.alert-stream-modal-content[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;min-width:20rem;border:1px solid var(--base-4);background-color:var(--base-1);border-radius:var(--shape-2)}.alert-stream-modal-content[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid var(--base-4);display:flex;align-items:center;justify-content:space-between}.no-alerts[_ngcontent-%COMP%]{padding:1rem;display:flex;flex-direction:column;gap:1rem;text-align:center}"],changeDetection:0})};function qe(n,o){n&1&&(s(0,"spk-icon",14),F(1,"check"),i())}function je(n,o){n&1&&(s(0,"spk-icon",15),F(1,"prohibit"),i())}function Qe(n,o){if(n&1){let e=f();s(0,"button",20),g("click",function(){C(e);let a=c();return m(a.updatePassphrase())}),O(1,5),i()}if(n&2){let e=c();v("loader",e.isUpdating())}}function Je(n,o){if(n&1){let e=f();s(0,"button",21),g("click",function(){C(e);let a=c();return m(a.updatePassphrase())}),O(1,6),i()}if(n&2){let e=c();v("loader",e.isUpdating()),h("disabled",!0)}}var U=class n{#e=A(H);closed=le();isUpdating=E(!1);passphrase=E("");repeatPassphrase=E("");updatePassphrase(){this.passphrase()===this.repeatPassphrase()&&(this.isUpdating.set(!0),this.#e.patchApiV1Serversettings({requestBody:{"server-passphrase":this.passphrase()}}).pipe(V(()=>this.isUpdating.set(!1))).subscribe({next:()=>this.closed.emit()}))}cancel(){this.isUpdating.set(!0),this.#e.patchApiV1Serversettings({requestBody:{"has-asked-for-password-change":"True"}}).pipe(V(()=>this.isUpdating.set(!1))).subscribe({next:()=>this.closed.emit()})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=N({type:n,selectors:[["app-change-passphrase-alert-dialog"]],outputs:{closed:"closed"},decls:23,vars:7,consts:()=>{let o;o=$localize`Enter new password`;let e;e=$localize`Repeat password`;let t;t=$localize`Password have to be filled and have to match`;let a;a=$localize`Change passphrase`;let _;_=$localize` Duplicati needs to be secured with a passphrase and a random passphrase has been generated for you. ${"[\uFFFD#6\uFFFD\uFFFD/#6\uFFFD|\uFFFD#7\uFFFD\uFFFD/#7\uFFFD]"}:LINE_BREAK:${"[\uFFFD#6\uFFFD\uFFFD/#6\uFFFD|\uFFFD#7\uFFFD\uFFFD/#7\uFFFD]"}:LINE_BREAK: If you open Duplicati from the tray icon, you do not need a passphrase, but if you plan to open it from another location you need to set a passphrase you know. Do you want to set a passphrase now? `,_=R(_);let D;D=$localize`Passphrase`;let k;k=$localize`Repeat passphrase`;let I;I=$localize`Not now thanks`;let L;L=$localize` Yes, update passphrase now `;let T;return T=$localize` Yes, update passphrase now `,[a,_,D,k,I,L,T,["header",""],["content",""],["type","warning"],["for","password"],["type","password","name","password","autocomplete","disabled","placeholder",o,"tabindex","1",3,"ngModelChange","ngModel"],["for","repeatPassword"],["type","password","name","repeatPassword","autocomplete","disabled","placeholder",e,"tabindex","2",3,"ngModelChange","disabled","ngModel"],["suffix","",1,"spk-success"],["suffix",""],["footer",""],["spk-button","",3,"click"],["spk-button","",1,"raised","primary",3,"loader"],["spk-button","","spkTooltip",t,1,"raised","primary",3,"loader","disabled"],["spk-button","",1,"raised","primary",3,"click"],["spk-button","","spkTooltip",t,1,"raised","primary",3,"click","disabled"]]},template:function(e,t){e&1&&(s(0,"header",7)(1,"h3"),O(2,0),i()(),s(3,"div",8)(4,"spk-alert",9),p(5,1),l(6,"br")(7,"br"),u(),i(),s(8,"spk-form-field")(9,"label",10),O(10,2),i(),s(11,"input",11),q("ngModelChange",function(_){return W(t.passphrase,_)||(t.passphrase=_),_}),i()(),s(12,"spk-form-field")(13,"label",12),O(14,3),i(),s(15,"input",13),q("ngModelChange",function(_){return W(t.repeatPassphrase,_)||(t.repeatPassphrase=_),_}),i(),d(16,qe,2,0,"spk-icon",14)(17,je,2,0,"spk-icon",15),i()(),s(18,"footer",16)(19,"button",17),g("click",function(){return t.cancel()}),O(20,4),i(),d(21,Qe,2,2,"button",18)(22,Je,2,3,"button",19),i()),e&2&&(r(11),z("ngModel",t.passphrase),r(4),h("disabled",t.passphrase().length===0),z("ngModel",t.repeatPassphrase),r(),S(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?16:17),r(3),v("loader",t.isUpdating()),r(2),S(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?21:22))},dependencies:[Ne,Pe,he,De,G,Ae,M,Te],styles:["[_nghost-%COMP%]{display:block;--dialog-p: 1.5rem}[content][_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}"],changeDetection:0})};var Ze=()=>({exact:!0});function et(n,o){n&1&&(s(0,"spk-icon"),F(1,"sun"),i())}function tt(n,o){n&1&&(s(0,"spk-icon"),F(1,"moon"),i())}function nt(n,o){if(n&1){let e=f();s(0,"button",22),g("click",function(){C(e);let a=c();return m(a.changeDefaultClientTo("ngax"))}),p(1,7),l(2,"spk-icon"),u(),i(),s(3,"button",22),g("click",function(){C(e);let a=c();return m(a.logout())}),p(4,8),l(5,"spk-icon"),u(),i()}}var J=class n{#e=A($e);#t=A(H);#n=A(fe);#o=A(de);#i=A(ge);#s=A(x);#a=A(Ee);relayIsEnabled=this.#o.relayIsEnabled;isDarkMode=this.#e.isDarkMode;ngOnInit(){return this.#s.init(),this.#n.getBackups(!0),this.#t.getApiV1Serversettings().subscribe({next:o=>{let e=o["autogenerated-passphrase"]==="True",t=o["has-asked-for-password-change"]==="True";e&&!t&&this.#i.open(U,{maxWidth:"500px"})}})}toggleBodyClass(){this.#e.toggleBodyClass()}changeDefaultClientTo(o){this.#r(o),window.location.replace(`/${o}`)}logout(){this.#a.logout()}#r(o){var e=new Date;e.setTime(e.getTime()+90*24*60*60*1e3),document.cookie="default-client="+o+"; expires="+e.toUTCString()+"; path=/"}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=N({type:n,selectors:[["app-layout"]],decls:37,vars:4,consts:()=>{let o;o=$localize`${"\uFFFD#10\uFFFD"}:START_TAG_SPK_ICON:house${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_SPK_ICON: Home `;let e;e=$localize`${"\uFFFD#13\uFFFD"}:START_TAG_SPK_ICON:database${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SPK_ICON: Add backup `;let t;t=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SPK_ICON:clock-counter-clockwise${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SPK_ICON: Restore `;let a;a=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SPK_ICON:gear${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SPK_ICON: Settings `;let _;_=$localize`${"\uFFFD#26\uFFFD"}:START_TAG_SPK_ICON:info${"\uFFFD/#26\uFFFD"}:CLOSE_TAG_SPK_ICON: About Duplicati `;let D;D=$localize`${"\uFFFD#29\uFFFD"}:START_TAG_SPK_ICON:files${"[\uFFFD/#29\uFFFD|\uFFFD/#30\uFFFD]"}:CLOSE_TAG_SPK_ICON: Documentation ${"\uFFFD#30\uFFFD"}:START_TAG_SPK_ICON_1:arrow-square-out${"[\uFFFD/#29\uFFFD|\uFFFD/#30\uFFFD]"}:CLOSE_TAG_SPK_ICON:`,D=R(D);let k;k=$localize`${"\uFFFD#33\uFFFD"}:START_TAG_SPK_ICON:chats-circle${"[\uFFFD/#33\uFFFD|\uFFFD/#34\uFFFD]"}:CLOSE_TAG_SPK_ICON: Visit forum ${"\uFFFD#34\uFFFD"}:START_TAG_SPK_ICON_1:arrow-square-out${"[\uFFFD/#33\uFFFD|\uFFFD/#34\uFFFD]"}:CLOSE_TAG_SPK_ICON:`,k=R(k);let I;I=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:skip-back${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: Use old UI `;let L;return L=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_ICON:sign-out${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_ICON: Log out `,[o,e,t,a,_,D,k,I,L,["sidenav",""],["spk-button","",1,"icon","small",3,"click"],[1,"base-1","primary"],["action","","routerLink","/","routerLinkActive","active",3,"routerLinkActiveOptions"],["action","","routerLink","/add-backup","routerLinkActive","active"],["action","","routerLink","/restore","routerLinkActive","active"],["action","","routerLink","/settings","routerLinkActive","active"],[1,"spacer"],[1,"base-1l","primary"],["action","","routerLink","/about","routerLinkActive","active"],["href","https://docs.duplicati.com","target","_blank","action",""],["suffix",""],["href","https://forum.duplicati.com","target","_blank","action",""],["action","",3,"click"]]},template:function(e,t){e&1&&(s(0,"spk-sidenav")(1,"div",9)(2,"header"),l(3,"app-logo"),s(4,"button",10),g("click",function(){return t.toggleBodyClass()}),d(5,et,2,0,"spk-icon")(6,tt,2,0,"spk-icon"),i()(),s(7,"spk-list",11)(8,"button",12),p(9,0),l(10,"spk-icon"),u(),i(),s(11,"button",13),p(12,1),l(13,"spk-icon"),u(),i(),s(14,"button",14),p(15,2),l(16,"spk-icon"),u(),i(),s(17,"button",15),p(18,3),l(19,"spk-icon"),u(),i()(),l(20,"div",16),s(21,"spk-list",17),d(22,nt,6,0),l(23,"spk-divider"),s(24,"button",18),p(25,4),l(26,"spk-icon"),u(),i(),s(27,"a",19),p(28,5),l(29,"spk-icon")(30,"spk-icon",20),u(),i(),s(31,"a",21),p(32,6),l(33,"spk-icon")(34,"spk-icon",20),u(),i()()(),l(35,"router-outlet")(36,"app-service-hub"),i()),e&2&&(r(5),S(t.isDarkMode()?5:6),r(3),h("routerLinkActiveOptions",ae(3,Ze)),r(14),S(t.relayIsEnabled()?-1:22))},dependencies:[ce,pe,ue,me,M,Ce,w,Fe,b,Ie],styles:["[_nghost-%COMP%]{height:100vh;width:100%;overflow:hidden}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1.25rem;gap:.75rem}h3[title][_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}div[sidenav][_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100vh}"],changeDetection:0})};export{J as default};
@@ -1 +1 @@
1
- import{a,b,c}from"./chunk-2YMUOQLP.js";import"./chunk-XIIFTZ5G.js";import"./chunk-BCHZRC5K.js";import"./chunk-B26UYXA3.js";import"./chunk-LDIZ5E5Z.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-NSIELNIY.js";import"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";export{b as NONE_OPTION,a as createGeneralForm,c as default};
1
+ import{a,b,c}from"./chunk-HRSZZWTB.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-B26UYXA3.js";import"./chunk-LDIZ5E5Z.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-NSIELNIY.js";import"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";export{b as NONE_OPTION,a as createGeneralForm,c as default};
@@ -0,0 +1,8 @@
1
+ import{a as it}from"./chunk-X7SFNRJF.js";import{a as tt,b as nt}from"./chunk-2G6TVFPZ.js";import{a as X,b as Ze,c as Je}from"./chunk-V6EWWEIG.js";import{h as et}from"./chunk-HRSZZWTB.js";import{a as Ye}from"./chunk-WZNH4JPF.js";import{a as G}from"./chunk-2BX65XJQ.js";import{a as z}from"./chunk-6JQM2X3B.js";import{a as qe,c as ue,e as Ce,i as fe,k as We,s as ge,t as Qe}from"./chunk-NSIELNIY.js";import{A as Ue,C as He,a as pe,e as Ge,g as me,l as Re,o as Be,p as Ke,t as ze,z as Xe}from"./chunk-Y5IRBMLB.js";import{h as je}from"./chunk-DNJOKPEL.js";import{ea as be}from"./chunk-CWLTHXVS.js";import{$b as B,Ab as K,Ac as J,Bb as re,Cb as W,Db as le,Eb as N,Hc as P,Ic as Y,Kb as Q,Lb as Z,Mb as De,Nc as ee,Qa as l,Qb as E,Qc as $e,Rb as s,Sb as we,Tb as Ae,U as oe,Vb as Fe,Wb as Oe,Xb as ke,Z as k,ab as ae,bc as se,da as T,ea as S,ec as p,f as ie,fb as b,gc as F,ha as ye,hc as _e,jc as Ve,kc as Me,lc as ve,mc as v,na as $,nc as A,oc as c,rc as Pe,sb as f,sc as Le,tb as g,tc as de,ub as H,vb as j,vc as ce,wb as q,xb as m,yb as _,zb as d}from"./chunk-BTMXQPBB.js";import{a as O,b as ne}from"./chunk-EUDKD2JW.js";var ot=class n{#t=k(je);#e=k(Ge);#n=k(z);testDestination(t,e,o,i){return this.#n.hasV2TestOperations()?this.testDestinationv2(t,e,o,i):this.testDestinationv1(t,e,o,i)}testDestinationv2(t,e,o,i){return new ie(a=>{this.#t.postApiV2DestinationTest({requestBody:{DestinationUrl:t,AutoCreate:!1,Options:null}}).subscribe({next:r=>{if(r.Success){this.emitSuccessV2(a,t,e,r);return}this.handleGenericError(a,t,e,r.Error??"Unknown error",i)},error:r=>{let u=r?.error?.body;if(u?.Data?.FolderExists===!1||u?.StatusCode==="missing-folder"){o?this.handleMissingFolder(a,t,e):this.handleGenericError(a,t,e,$localize`The remote destination folder does not exist.`,i);return}if(u?.Data?.HostCertificate){this.handleMissingCertificate(a,t,e,u.Data?.HostCertificate);return}if(u?.Data?.ReportedHostKey){this.handleIncorrectKey(a,t,e,u.Data.ReportedHostKey,u.Data.AcceptedHostKey??null);return}this.handleGenericError(a,t,e,r?.message??"Unknown error",i)}})})}testDestinationv1(t,e,o,i){return new ie(a=>{this.#t.postApiV1RemoteoperationTest({requestBody:{path:t}}).subscribe({next:r=>{a.next({action:"success",targetUrl:t,testAgain:!1,destinationIndex:e}),a.complete()},error:r=>{this.handleDestinationErrorv1(r.message,t,e,o,i).subscribe(u=>{a.next(u)})}})})}handleMissingFolder(t,e,o){this.#e.open(G,{data:{title:$localize`Create folder`,message:$localize`The remote destination folder does not exist, do you want to create it?`,confirmText:$localize`Create folder`,cancelText:$localize`Cancel`},closed:i=>{i&&(this.#n.hasV2TestOperations()?this.#t.postApiV2DestinationTest({requestBody:{DestinationUrl:e,AutoCreate:!0,Options:null}}).subscribe({next:a=>{if(a.Success){this.emitSuccessV2(t,e,o,a);return}else this.handleFolderCreateFailure(t,e,o,a.Error??$localize`Unknown error`)},error:a=>{this.handleFolderCreateFailure(t,e,o,a.message??$localize`Unknown error`)}}):this.#t.postApiV1RemoteoperationCreate({requestBody:{path:e}}).subscribe({next:()=>{this.handleFolderCreated(t,e,o)},error:a=>{this.handleFolderCreateFailure(t,e,o,a.message??$localize`Unknown error`)}}))}})}handleFolderCreateFailure(t,e,o,i){this.#e.open(G,{data:{title:$localize`Error creating folder`,message:$localize`The remote destination folder could not be created. ${i}`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:o}),t.complete()}})}emitSuccessV2(t,e,o,i){t.next({action:"success",targetUrl:e,testAgain:!1,destinationIndex:o,anyFilesFound:!i.Data?.FolderIsEmpty,containsBackup:i.Data?.FolderContainsBackupFiles??void 0,containsEncryptedBackupFiles:i.Data?.FolderContainsEncryptedBackupFiles??void 0}),t.complete()}handleFolderCreated(t,e,o){this.#e.open(G,{data:{title:$localize`Folder created`,message:$localize`The remote destination folder was created successfully.`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"test-again",targetUrl:e,testAgain:!0,destinationIndex:o}),t.complete()}})}reportNoAction(t,e,o){t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:o}),t.complete()}handleMissingCertificate(t,e,o,i){this.#e.open(G,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
2
+ If this is a self-signed certificate, you can choose to trust this certificate.
3
+ The server reported the certificate hash: ${i}`,confirmText:$localize`Trust the certificate`,cancelText:$localize`Cancel`},closed:a=>{if(!a){this.reportNoAction(t,e,o);return}t.next({action:"trust-cert",targetUrl:e,testAgain:!0,certData:i,destinationIndex:o}),t.complete()}})}handleIncorrectKey(t,e,o,i,a){a?this.#e.open(G,{maxWidth:"500px",data:{title:$localize`The host key has changed`,message:$localize`The host key has changed, please check with the server administrator if this is correct,
4
+ otherwise you could be the victim of a MAN-IN-THE-MIDDLE attack.
5
+ Do you want to REPLACE your CURRENT host key ${a}
6
+ with the REPORTED host key: ${i}?`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:r=>{if(!r){this.reportNoAction(t,e,o);return}t.next({action:"approve-host-key",targetUrl:e,testAgain:!0,reportedHostKey:i,destinationIndex:o}),t.complete()}}):this.#e.open(G,{maxWidth:"500px",data:{title:$localize`Approve host key?`,message:$localize`No certificate was specified, please verify that the reported host key is correct: ${i}`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:r=>{if(!r){this.reportNoAction(t,e,o);return}t.next({action:"approve-host-key",targetUrl:e,testAgain:!0,reportedHostKey:i,destinationIndex:o}),t.complete()}})}handleGenericError(t,e,o,i,a){function r(){t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:o,errorMessage:i}),t.complete()}if(a){r();return}this.#e.open(G,{maxWidth:"500px",data:{title:$localize`Test connection failed`,message:i,cancelText:$localize`OK`},closed:u=>r()})}handleDestinationErrorv1(t,e,o,i,a){return new ie(r=>{if(t==="missing-folder"){i?this.handleMissingFolder(r,e,o):this.handleGenericError(r,e,o,$localize`The remote destination folder does not exist.`,a);return}if(t.startsWith("incorrect-cert:")){let u=t.split("incorrect-cert:")[1];this.handleMissingCertificate(r,e,o,u);return}if(t.startsWith("incorrect-host-key:")){let u=t.split('incorrect-host-key:"')[1].split('",')[0],I=t.split('accepted-host-key:"')[1].split('",')[0];this.handleIncorrectKey(r,e,o,u,I);return}this.handleGenericError(r,e,o,t,a)})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=oe({token:n,factory:n.\u0275fac,providedIn:"root"})};var Te=class n{#t=k(z);supportedDestinationTypes=P(()=>this.#t.backendModules().map(t=>{if(!t?.Key)return null;let e=X(t.Key);return e.isDefaultEntry===!0?ne(O({},e),{displayName:t.DisplayName||e.displayName||t.Key,description:t.Description||e.description||""}):e}).filter(t=>t!==null));destinationTypeOptions=P(()=>this.supportedDestinationTypes().map(t=>({key:t.customKey??t.key,customKey:t.customKey??null,displayName:t.displayName,description:t.description})));backendModules=P(()=>this.#t.backendModules()??[]);static \u0275fac=function(e){return new(e||n)};static \u0275prov=oe({token:n,factory:n.\u0275fac,providedIn:"root"})};var st=["fileInput"],_t=[[["label"]]],dt=["label"],Se=class n{customId=ee();content=$("");readonly=$(!1);placeholder=ee("Drop a file here or use the browse button");fileInputRef;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=Y(()=>{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=ae({type:n,selectors:[["app-file-drop-textarea"]],viewQuery:function(e,o){if(e&1&&Fe(st,5),e&2){let i;Oe(i=ke())&&(o.fileInputRef=i.first)}},inputs:{customId:[1,"customId"],placeholder:[1,"placeholder"]},features:[Pe([{provide:qe,useExisting:n,multi:!0}])],ngContentSelectors:dt,decls:9,vars:3,consts:()=>{let t;return t=$localize`${"\uFFFD#4\uFFFD"}:START_TAG_SPK_ICON:upload${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["fileInput",""],t,[1,"browse-btn"],["spk-button","","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,o){if(e&1){let i=N();we(_t),Ae(0,0,["ngProjectAs","label",5,["label"]]),_(1,"div",2)(2,"button",3),E("click",function(){return T(i),S(o.triggerBrowse())}),Q(3,1),K(4,"spk-icon"),Z(),d()(),_(5,"div",4),E("drop",function(r){return T(i),S(o.onFileDrop(r))})("dragover",function(r){return T(i),S(o.onDragOver(r))}),_(6,"textarea",5),ve("ngModelChange",function(r){return T(i),Me(o.content,r)||(o.content=r),S(r)}),d()(),_(7,"input",6,0),E("change",function(r){return T(i),S(o.onFileSelected(r))}),d()}e&2&&(l(6),m("placeholder",o.placeholder()),Ve("ngModel",o.content),m("disabled",o.readonly()))},dependencies:[ge,ue,Ce,fe,pe,me],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 ct=(n,t,e,o)=>({index:n,fieldGroup:"custom",formView:t,destinationType:e,oauthField:o}),he=n=>({$implicit:n}),pt=(n,t,e,o)=>({index:n,fieldGroup:"dynamic",formView:t,destinationType:e,oauthField:o}),mt=()=>({updateOn:"blur"}),ut=(n,t,e,o)=>({index:n,formView:t,fieldGroup:"advanced",destinationType:e,oauthField:o});function Ct(n,t){n&1&&le(0)}function ft(n,t){if(n&1&&b(0,Ct,1,0,"ng-container",13),n&2){let e=t.$implicit,o=t.$index;s();let i=B(15);s();let a=c(0),r=c(1);m("ngTemplateOutlet",i)("ngTemplateOutletContext",de(7,he,ce(2,ct,o,e,a,r.oauthField)))}}function gt(n,t){n&1&&le(0)}function Tt(n,t){if(n&1&&b(0,gt,1,0,"ng-container",13),n&2){let e=t.$implicit,o=t.$index;s();let i=B(15);s();let a=c(0),r=c(1);m("ngTemplateOutlet",i)("ngTemplateOutletContext",de(7,he,ce(2,pt,o,e,a,r.oauthField)))}}function St(n,t){if(n&1){let e=N();_(0,"button",14),E("click",function(){T(e);let i=s(2);return S(i.showTextArea.set(!1))}),Q(1,6),K(2,"spk-icon"),Z(),d()}}function xt(n,t){if(n&1){let e=N();_(0,"button",21,1),E("click",function(){let i=T(e).$implicit,a=s(3);return S(a.addAdvancedOption(i))}),p(2),d()}if(n&2){let e=t.$implicit;l(2),F(" ",e.name," ")}}function Et(n,t){if(n&1){let e=N();_(0,"div",11)(1,"spk-menu",15)(2,"button",16),Q(3,7),K(4,"spk-icon"),Z(),d(),re(5,17),j(6,xt,3,1,"button",18,H),W(),d(),_(8,"spk-menu")(9,"button",19)(10,"spk-icon"),p(11,"dots-three-vertical"),d()(),re(12,17),_(13,"button",20),E("click",function(){T(e);let i=s(2);return S(i.showTextArea.set(!0))}),_(14,"spk-icon"),p(15,"link"),d(),p(16," Edit contents as text "),d(),W(),d()()}if(n&2){s();let e=c(9);l(),m("searchable",!0),l(),m("disabled",e.length===0),l(4),q(e)}}function Nt(n,t){if(n&1){let e=N();_(0,"textarea",22),E("ngModelChange",function(i){T(e);let a=s(2);return S(a.updateSettingsFromText(i))}),d()}if(n&2){let e=s(2);m("ngModel",e.settingsAsText())("ngModelOptions",Le(2,mt))}}function It(n,t){n&1&&le(0)}function ht(n,t){if(n&1&&b(0,It,1,0,"ng-container",13),n&2){let e=t.$implicit,o=t.$index;s(2);let i=B(15),a=s(),r=c(0),u=c(1),I=a.getFormView("advanced",e)??a.getDefaultFormView(e);m("ngTemplateOutlet",i)("ngTemplateOutletContext",de(7,he,ce(2,ut,o,I,r,u.oauthField)))}}function yt(n,t){if(n&1&&j(0,ht,1,9,"ng-container",null,H),n&2){let e=s(2);q(e.advancedFormFieldNames())}}function Dt(n,t){n&1&&(_(0,"sup",31),p(1,"*"),d())}function wt(n,t){if(n&1&&(_(0,"spk-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("spkTooltip",e.formView.longDescription)}}function At(n,t){if(n&1){let e=N();_(0,"app-file-tree",24)(1,"label",30),f(2,Dt,2,0,"sup",31),p(3),f(4,wt,2,1,"spk-icon",32),d(),_(5,"input",33),E("ngModelChange",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),d()()}if(n&2){let e=s().$implicit,o=c(1),i=c(2),a=c(3),r=c(4),u=c(5);m("startingPath",a)("accepts",e.formView.accepts)("showFiles",!0)("hideShortcuts",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),m("for",u),l(),g(e.formView.isMandatory&&r?2:-1),l(),F(" ",o," "),l(),g(e.formView.longDescription?4:-1),l(),m("id",u)("ngModel",i)}}function Ft(n,t){n&1&&(_(0,"sup",34),p(1,"*"),d())}function Ot(n,t){if(n&1&&(_(0,"spk-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("spkTooltip",e.formView.longDescription)}}function kt(n,t){if(n&1){let e=N();_(0,"app-file-tree",25)(1,"label",30),f(2,Ft,2,0,"sup",34),p(3),f(4,Ot,2,1,"spk-icon",32),d(),_(5,"input",33),E("ngModelChange",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),d()()}if(n&2){let e=s().$implicit,o=c(1),i=c(2),a=c(3),r=c(4),u=c(5);m("hideShortcuts",!0)("enableCreateFolder",!0)("startingPath",a),l(),m("for",u),l(),g(e.formView.isMandatory&&r?2:-1),l(),F(" ",o," "),l(),g(e.formView.longDescription?4:-1),l(),m("id",u)("ngModel",i)}}function Vt(n,t){n&1&&(_(0,"sup",35),p(1,"*"),d())}function Mt(n,t){if(n&1&&(_(0,"spk-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("spkTooltip",e.formView.longDescription)}}function vt(n,t){n&1&&(_(0,"spk-icon",36),p(1," warning "),d())}function Pt(n,t){n&1&&(_(0,"spk-icon",37),p(1,"x-circle"),d())}function Lt(n,t){n&1&&(_(0,"spk-icon",38),p(1,"warning"),d())}function $t(n,t){if(n&1&&(_(0,"spk-icon",42),p(1," link "),d()),n&2){s();let e=c(9),o=c(10);se("error",e&&o==="error")("warn",e&&o==="warning"),m("spkTooltip",e)}}function bt(n,t){n&1&&(_(0,"spk-icon",41),p(1,"envelope"),d())}function Gt(n,t){n&1&&(_(0,"spk-icon",41),p(1,"hard-drives"),d())}function Rt(n,t){n&1&&(_(0,"spk-icon",41),p(1,"jar"),d())}function Bt(n,t){n&1&&(_(0,"spk-icon",41),p(1,"textbox"),d())}function Kt(n,t){if(n&1){let e=N();_(0,"spk-form-field")(1,"label",30),f(2,Vt,2,0,"sup",35),p(3),f(4,Mt,2,1,"spk-icon",32),f(5,vt,2,0,"spk-icon",36),f(6,Pt,2,0,"spk-icon",37),f(7,Lt,2,0,"spk-icon",38),d(),_(8,"input",39),E("keydown",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.onKeyDown(a.fieldGroup,a.formView.name,a.formView.type,i))})("ngModelChange",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),d(),v(9)(10),f(11,$t,2,5,"spk-icon",40)(12,bt,2,0,"spk-icon",41)(13,Gt,2,0,"spk-icon",41)(14,Rt,2,0,"spk-icon",41)(15,Bt,2,0,"spk-icon",41),d()}if(n&2){let e=s().$implicit,o=c(1),i=c(2),a=c(3),r=c(4),u=c(5),I=s(2);l(),m("for",u),l(),g(e.formView.isMandatory&&r?2:-1),l(),F(" ",o," "),l(),g(e.formView.longDescription?4:-1),l(),g(r&&e.formView.type==="Path"?5:-1),l(),g(e.formView.type=="Hostname"&&!r&&!I.isValidHostname(a)?6:-1),l(),g(e.formView.type=="Bucketname"&&!r&&!I.isValidBucketname(a)?7:-1),l(),m("type",e.formView.type==="Email"?"email":"text")("id",u)("ngModel",i);let V=a,w=I.hasLeadingSlash(V??"");l(),A(w&&(e.formView.doubleSlash==null?null:e.formView.doubleSlash.message)),l(),A(e.formView.doubleSlash==null?null:e.formView.doubleSlash.type),l(),g(e.formView.type==="Path"?11:e.formView.type==="Email"?12:e.formView.type==="Hostname"?13:e.formView.type==="Bucketname"?14:15)}}function zt(n,t){n&1&&(_(0,"sup",43),p(1,"*"),d())}function Xt(n,t){if(n&1&&(_(0,"spk-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("spkTooltip",e.formView.longDescription)}}function Ut(n,t){if(n&1){let e=N();_(0,"span",47),E("click",function(){T(e);let i=s(2).$implicit,a=s(2);return S(a.oauthStartTokenCreation(i.destinationType,i.fieldGroup,i.formView.name,i.formView.oauthVersion))}),p(1," AuthID "),d()}}function Ht(n,t){n&1&&(_(0,"spk-icon",41),p(1,"password"),d())}function jt(n,t){if(n&1){let e=N();_(0,"spk-icon",48),E("click",function(){T(e);let i=s(2).$implicit;return S(i.formView.showPassword=!i.formView.showPassword)}),p(1," eye "),d()}}function qt(n,t){if(n&1){let e=N();_(0,"spk-icon",48),E("click",function(){T(e);let i=s(2).$implicit;return S(i.formView.showPassword=!i.formView.showPassword)}),p(1," eye-slash "),d()}}function Wt(n,t){if(n&1){let e=N();_(0,"spk-form-field")(1,"label",30),f(2,zt,2,0,"sup",43),p(3),f(4,Xt,2,1,"spk-icon",32),d(),_(5,"input",44),E("ngModelChange",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),d(),f(6,Ut,2,0,"span",45)(7,Ht,2,0,"spk-icon",41),f(8,jt,2,0,"spk-icon",46)(9,qt,2,0,"spk-icon",46),d()}if(n&2){let e=s().$implicit,o=c(1),i=c(2),a=c(4),r=c(5);l(),m("for",r),l(),g(e.formView.isMandatory&&a?2:-1),l(),F(" ",o," "),l(),g(e.formView.longDescription?4:-1),l(),m("type",e.formView.showPassword?"text":"password")("id",r)("ngModel",i),l(),g(e.oauthField===e.formView.name?6:7),l(2),g(e.formView.showPassword?8:9)}}function Qt(n,t){n&1&&(_(0,"sup",50),p(1,"*"),d())}function Zt(n,t){if(n&1&&(_(0,"spk-icon",32),p(1,"question"),d()),n&2){let e=s(3).$implicit;m("spkTooltip",e.formView.longDescription)}}function Jt(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;_e(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function Yt(n,t){if(n&1){let e=N();_(0,"spk-select",49)(1,"label",30),f(2,Qt,2,0,"sup",50),p(3),f(4,Zt,2,1,"spk-icon",32),d(),_(5,"input",33),E("ngModelChange",function(i){T(e);let a=s(2).$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),d()(),b(6,Jt,1,2,"ng-template",null,2,J)}if(n&2){let e=B(7);s();let o=c(0),i=s().$implicit,a=c(1),r=c(2),u=c(4),I=c(5);m("options",o)("isClearable",!1)("optionTemplate",e),l(),m("for",I),l(),g(i.formView.isMandatory&&u?2:-1),l(),F(" ",a," "),l(),g(i.formView.longDescription?4:-1),l(),m("id",I)("ngModel",r)}}function en(n,t){if(n&1&&(v(0),f(1,Yt,8,9)),n&2){let e=s().$implicit,o=A(s(2).mapOptions(e.formView));l(),g(o?1:-1)}}function tn(n,t){n&1&&(_(0,"sup",53),p(1,"*"),d())}function nn(n,t){if(n&1&&(_(0,"spk-icon",32),p(1,"question"),d()),n&2){let e=s(3).$implicit;m("spkTooltip",e.formView.longDescription)}}function on(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;_e(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function an(n,t){if(n&1){let e=N();_(0,"spk-select",52)(1,"label",30),f(2,tn,2,0,"sup",53),p(3),f(4,nn,2,1,"spk-icon",32),d(),_(5,"input",33),E("ngModelChange",function(i){T(e);let a=s(2).$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),d()(),b(6,on,1,2,"ng-template",null,3,J)}if(n&2){let e=B(7);s();let o=c(0),i=s().$implicit,a=c(1),r=c(2),u=c(4),I=c(5);m("options",o)("asFreeText",!0)("inlineSearch",!0)("optionTemplate",e),l(),m("for",I),l(),g(i.formView.isMandatory&&u?2:-1),l(),F(" ",a," "),l(),g(i.formView.longDescription?4:-1),l(),m("id",I)("ngModel",r)}}function rn(n,t){n&1&&K(0,"spk-progress-bar",51)}function ln(n,t){if(n&1&&(v(0),f(1,an,8,10)(2,rn,1,0,"spk-progress-bar",51)),n&2){let e=s().$implicit,o=c(2),i=A(s(2).mapOptionsWithFreeText(e.formView,o));l(),g(i?1:2)}}function sn(n,t){n&1&&(_(0,"sup",55),p(1,"*"),d())}function _n(n,t){if(n&1&&(_(0,"spk-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("spkTooltip",e.formView.longDescription)}}function dn(n,t){if(n&1){let e=N();_(0,"app-size",54),E("ngModelChange",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),_(1,"label",30),f(2,sn,2,0,"sup",55),p(3),f(4,_n,2,1,"spk-icon",32),d()()}if(n&2){let e=s().$implicit,o=c(1),i=c(2),a=c(4),r=c(5);m("inputType",e.Name)("ngModel",i)("customId",r),l(),m("for",r),l(),g(e.formView.isMandatory&&a?2:-1),l(),F(" ",o," "),l(),g(e.formView.longDescription?4:-1)}}function cn(n,t){n&1&&(_(0,"sup",56),p(1,"*"),d())}function pn(n,t){if(n&1&&(_(0,"spk-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("spkTooltip",e.formView.longDescription)}}function mn(n,t){if(n&1){let e=N();_(0,"spk-form-field")(1,"label",30),f(2,cn,2,0,"sup",56),p(3),f(4,pn,2,1,"spk-icon",32),d(),_(5,"input",57),E("ngModelChange",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),d(),_(6,"spk-icon",41),p(7,"numpad"),d()()}if(n&2){let e=s().$implicit,o=c(1),i=c(2),a=c(4),r=c(5);l(),m("for",r),l(),g(e.formView.isMandatory&&a?2:-1),l(),F(" ",o," "),l(),g(e.formView.longDescription?4:-1),l(),m("id",r)("ngModel",i)}}function un(n,t){if(n&1&&(_(0,"spk-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("spkTooltip",e.formView.longDescription)}}function Cn(n,t){if(n&1){let e=N();_(0,"spk-toggle",58),E("click",function(){T(e);let i=s().$implicit,a=c(2),r=s(2);return S(r.updateFieldValue(i.fieldGroup,i.formView.name,r.isTrue(a)?"false":"true"))}),_(1,"label",30),p(2),f(3,un,2,1,"spk-icon",32),d()()}if(n&2){let e=s().$implicit,o=c(1),i=c(2),a=c(5),r=s(2);se("active",r.isTrue(i)),l(),m("for",a),l(),F(" ",o," "),l(),g(e.formView.longDescription?3:-1)}}function fn(n,t){n&1&&(_(0,"sup",60),p(1,"*"),d())}function gn(n,t){if(n&1&&(_(0,"spk-icon",32),p(1,"question"),d()),n&2){let e=s(3).$implicit;m("spkTooltip",e.formView.longDescription)}}function Tn(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;_e(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function Sn(n,t){if(n&1){let e=N();_(0,"spk-select",59)(1,"label",30),f(2,fn,2,0,"sup",60),p(3),f(4,gn,2,1,"spk-icon",32),d(),_(5,"input",61),E("ngModelChange",function(i){T(e);let a=s(2).$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),d()(),b(6,Tn,1,2,"ng-template",null,4,J)}if(n&2){let e=B(7);s();let o=c(0),i=s().$implicit,a=c(1),r=c(2),u=c(4),I=c(5);m("options",o)("selectMultiple",!0)("optionTemplate",e),l(),m("for",I),l(),g(i.formView.isMandatory&&u?2:-1),l(),F(" ",a," "),l(),g(i.formView.longDescription?4:-1),l(),m("ngModel",r)}}function xn(n,t){if(n&1&&(v(0),f(1,Sn,8,8)),n&2){let e=s().$implicit,o=A(s(2).mapOptions(e.formView));l(),g(o?1:-1)}}function En(n,t){n&1&&(_(0,"sup",62),p(1,"*"),d())}function Nn(n,t){if(n&1&&(_(0,"spk-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("spkTooltip",e.formView.longDescription)}}function In(n,t){if(n&1){let e=N();_(0,"app-timespan",54),E("ngModelChange",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),_(1,"label",30),f(2,En,2,0,"sup",62),p(3),f(4,Nn,2,1,"spk-icon",32),d()()}if(n&2){let e=s().$implicit,o=c(1),i=c(2),a=c(4),r=c(5);m("inputType",e.formView.name)("ngModel",i)("customId",r),l(),m("for",r),l(),g(e.formView.isMandatory&&a?2:-1),l(),F(" ",o," "),l(),g(e.formView.longDescription?4:-1)}}function hn(n,t){n&1&&(_(0,"sup",64),p(1,"*"),d())}function yn(n,t){if(n&1&&(_(0,"spk-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("spkTooltip",e.formView.longDescription)}}function Dn(n,t){if(n&1){let e=N();_(0,"app-file-drop-textarea",63),E("ngModelChange",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),_(1,"label"),f(2,hn,2,0,"sup",64),p(3),f(4,yn,2,1,"spk-icon",32),d()()}if(n&2){let e=s().$implicit,o=c(2),i=c(4),a=c(5);m("ngModel",o)("customId",a)("placeholder",e.formView.longDescription),l(2),g(e.formView.isMandatory&&i?2:-1),l(),F(" ",e.formView.shortDescription??e.formView.name," "),l(),g(e.formView.longDescription?4:-1)}}function wn(n,t){if(n&1){let e=N();_(0,"button",65),E("click",function(){T(e);let i=s().$implicit,a=s(2);return S(a.removeAdvancedOption(i.formView.name))}),_(1,"spk-icon"),p(2,"x-circle"),d()()}}function An(n,t){if(n&1&&(_(0,"div",23),v(1)(2)(3)(4)(5),f(6,At,6,12,"app-file-tree",24)(7,kt,6,9,"app-file-tree",25)(8,Kt,16,13,"spk-form-field")(9,Wt,10,9,"spk-form-field")(10,en,2,2)(11,ln,3,2)(12,dn,5,7,"app-size",26)(13,mn,8,6,"spk-form-field")(14,Cn,4,5,"spk-toggle",27)(15,xn,2,2)(16,In,5,7,"app-timespan",26)(17,Dn,5,6,"app-file-drop-textarea",28),f(18,wn,3,0,"button",29),d()),n&2){let e=t.$implicit;s();let o=c(0),i=s();se("single-field",e.fieldGroup!=="advanced"),l(),A(e.formView.shortDescription??e.formView.name),l(),A(i.getFieldGroup(o,e.fieldGroup)[e.formView.name]),l();let a=A(i.getFieldValue(e.fieldGroup,e.formView.name));l(),A((a??"").toString().trim()===""),l(),A("destination-"+e.fieldGroup+"-"+e.index+"-"+(e.asHttpOptions?"http":"other")),l(),g(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"?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:-1),l(12),g(e.fieldGroup==="advanced"?18:-1)}}function Fn(n,t){if(n&1&&(v(0),j(1,ft,1,9,"ng-container",null,H),j(3,Tt,1,9,"ng-container",null,H),_(5,"spk-toggle-card",8),re(6,9)(7),De(8,5),W(),v(9),f(10,St,3,0,"button",10)(11,Et,17,2,"div",11),W(),f(12,Nt,1,3,"textarea",12)(13,yt,2,0),d(),b(14,An,19,9,"ng-template",null,0,J)),n&2){let e=s(),o=c(1);A(e.destinationForm()),l(),q(o.custom),l(2),q(o.dynamic),l(2),m("disallowToggle",!0),l(4),A(e.nonSelectedAdvancedFormViews()),l(),g(e.showTextArea()?10:11),l(2),g(e.showTextArea()?12:13)}}var at=class n{#t=k(et);#e=k(z);#n=k(it);#a=k(Te);injector=k(ye);targetUrl=$e.required();useBackupState=ee(!1);#i=null;destinationType=P(()=>{let t=this.targetUrl();if(!t)return null;let e=X(t.split("://")[0]);return this.#i=e?.customKey??e?.key,this.#i});destinationForm=$({custom:{},dynamic:{},advanced:{}});advancedFormFieldNames=P(()=>Object.keys(this.destinationForm().advanced));destinationFormConfig=$(null);showTextArea=$(!1);nonSelectedAdvancedFormViews=P(()=>{let t=this.destinationFormConfig();if(!t)return[];let e=this.advancedFormFieldNames();return t.advanced.filter(o=>e.findIndex(i=>i===o.name)===-1)});destinationTypeEffect=Y(()=>{let t=this.destinationType()??"",e=X(t),o=e?.key,i=this.#a.backendModules().find(h=>h.Key===o)??{Key:t,DisplayName:t,Description:X(t).description,Options:[]};if(!i||!i.Options||!t)return;let a=e&&e.oauthField?e.oauthField:null,r=e&&e.customFields?e.customFields:{},u=e&&e.dynamicFields?e.dynamicFields:[],I=e&&e.advancedFields?e.advancedFields:[],V=e&&e.ignoredAdvancedFields?e.ignoredAdvancedFields:[],w={destinationType:t,oauthField:a,custom:[],dynamic:[],advanced:[]};r&&Object.entries(r).forEach(([h,C],y)=>{let D=C.order??y;w.custom.push(O({order:900+D},C))});for(let h=0;h<i.Options.length;h++){let C=i.Options[h];if(C.Deprecated)continue;let y=u.find(D=>D===C.Name||C.Aliases?.includes(D.name)||D.name===C.Name);if(y){let D=C.Aliases?.indexOf(y.name)??-1,L=C.Aliases&&D>-1?C.Aliases[D]:C.Name,x=y&&typeof y!="string",xe=x?y?.defaultValue??C.DefaultValue:C.DefaultValue,Ee=x&&y?.order!==void 0?y.order:h,U={name:L,type:C.Type,shortDescription:C.ShortDescription??void 0,longDescription:C.LongDescription??void 0,options:C.ValidValues,order:900+Ee},Ne=x?O(O({},U),y):U;w.dynamic.push(Ne)}else{let D=C.Name;if(V.find(te=>te===D))continue;let x=I.find(te=>te===D||te.name===D),xe=x&&typeof x!="string",Ee=xe&&x?.order!==void 0?x.order:h,U={name:D,type:C.Type,shortDescription:C.ShortDescription??void 0,longDescription:C.LongDescription??void 0,options:C.ValidValues,defaultValue:C.DefaultValue,order:900+Ee},Ne=xe?O(O({},U),x):U;w.advanced.push(Ne)}}w.custom.sort((h,C)=>h.order-C.order),w.dynamic.sort((h,C)=>h.order-C.order),w.advanced.sort((h,C)=>h.order-C.order),this.destinationFormConfig.set(w);let R=this.targetUrl();if(!R)return;let M=Je(R);M&&this.destinationForm.set({custom:M.custom,dynamic:M.dynamic,advanced:M.advanced})});destinationFormEffect=Y(()=>{let t=this.#i,e=this.destinationForm();if(!e||!t)return;let o=Ze({destinationType:t,custom:e.custom,dynamic:e.dynamic,advanced:e.advanced});o&&this.targetUrl.set(o)});getFieldValue(t,e){let i=this.destinationForm()[t][e];return i||null}getFormView(t,e){let i=this.destinationFormConfig()?.[t].find(a=>a.name===e);return i||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(O({},e))}isValidBucketname(t){if(!t)return!1;let e=t.length;return!(e<3||e>63||!/^[a-z0-9.-]+$/.test(t)||!/^[a-z0-9]/.test(t)||!/[a-z0-9]$/.test(t)||/^\d{1,3}(\.\d{1,3}){3}$/.test(t)||/(\.\.)|(\.-)|(-\.)/.test(t))}isValidHostname(t){if(!t||t.length>253)return!1;let e=t.split(".");for(let o of e)if(!o||o.length>63||!/^[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?$/.test(o))return!1;return!0}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,o,i){if(o==="Hostname"||o==="Bucketname"){if(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Home","End"].includes(i.key))return;if(i.key=="/"||i.key=="\\"||i.key==":"){i.preventDefault();return}}}updateFieldValue(t,e,o){let i=this.destinationForm();i[t][e]=o,this.destinationForm.set(O({},i))}removeAdvancedOption(t){let e=this.destinationForm();delete e.advanced[t],this.destinationForm.set(O({},e))}mapOptions(t){let e=t.loadOptions;if(e)return e(this.injector)();let o=t.options;return o?o.map(i=>({key:i,value:i})):null}mapOptionsWithFreeText(t,e){let o=this.mapOptions(t);return o?(e&&e.length>0&&(o.find(a=>a.value===e)||o.push({key:e,value:e})),o):null}#o=$(!1);oauthStartTokenCreation(t,e,o,i){this.#o.set(!0);let a=(i??1)==2?this.#e.defaultOAuthUrlV2():this.#e.defaultOAuthUrl(),r=this.#n.serverSettings()?.["--oauth-url"];if(r&&r.length>0&&(a=r),this.useBackupState()){let C=this.#t.mapFormsToSettings().find(y=>y.Name==="--oauth-url")?.Value;C&&C.length>0&&(a=C)}let u=this.destinationForm().advanced["oauth-url"];u&&u.length>0&&(a=u);let I=`${a}?type=${t}`,V=450,w=600,R=screen.width/2-V/2,M=screen.height/2-w/2,h=window.open(I,"_blank","height="+w+",width="+V+",menubar=0,status=0,titlebar=0,toolbar=0,left="+R+",top="+M);return window.addEventListener("message",C=>{let y=C.data.startsWith("authid:"),D=y?C.data.replace("authid:",""):null;y&&(this.destinationForm.update(L=>(L[e][o]=D,L)),this.#o.set(!1),h?.close())}),!1}settingsAsText=P(()=>{let t=this.destinationForm().advanced;return Object.entries(t).map(([e,o])=>{let i=e??"",a="";return typeof o=="boolean"?a=this.isTrue(o)?"True":"False":(typeof o=="number"||o!=null)&&(a=o.toString()),`${i}=${a}`}).join(`
7
+ `)});updateSettingsFromText(t){if(typeof t!="string")return;let e=t.split(`
8
+ `).map(i=>i.trim()).filter(i=>i.length>0),o={};for(let i of e){let[a,r]=i.split("=").map(u=>u.trim());a&&a.trim().length>0&&r!==void 0&&(o[a]=r)}this.destinationForm.update(i=>ne(O({},i),{advanced:o}))}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=ae({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_SPK_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let o;o=$localize` Add advanced option ${"\uFFFD#4\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let i;i=$localize`This field is mandatory`;let a;a=$localize`This field is mandatory`;let r;r=$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 I;I=$localize`Hostname is invalid`;let V;V=$localize`Bucket name is invalid`;let w;w=$localize`This field is mandatory`;let R;R=$localize`This field is mandatory`;let M;M=$localize`This field is mandatory`;let h;h=$localize`This field is mandatory`;let C;C=$localize`This field is mandatory`;let y;y=$localize`This field is mandatory`;let D;D=$localize`This field is mandatory`;let L;return L=$localize`This field is mandatory`,[["fieldTemplate",""],["option",""],["enumOptionTemplate",""],["nonValidatedOptionTemplate",""],["optionTemplate",""],t,e,o,[1,"advanced-options",3,"disallowToggle"],["title",""],["spk-button","","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"],["spk-button","","type","button",1,"outlined","small",3,"click"],[3,"searchable"],["spk-button","","type","button",1,"outlined","small",3,"disabled"],["menu",""],["type","button"],["spk-button","","type","button",1,"small"],["spk-button","","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"],["spk-button","","type","button",1,"outlined"],[3,"for"],["spkTooltip",i],[1,"primary",3,"spkTooltip"],["type","text",3,"ngModelChange","id","ngModel"],["spkTooltip",a],["spkTooltip",r],["spkTooltip",u,1,"warn"],["spkTooltip",I,1,"error"],["spkTooltip",V,1,"warn"],[3,"keydown","ngModelChange","type","id","ngModel"],["prefix","",3,"error","warn","spkTooltip"],["prefix",""],["prefix","",3,"spkTooltip"],["spkTooltip",w],["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"],["spkTooltip",R],[1,"indeterminate","primary"],["label","key","value","value",3,"options","asFreeText","inlineSearch","optionTemplate"],["spkTooltip",M],[3,"ngModelChange","inputType","ngModel","customId"],["spkTooltip",h],["spkTooltip",C],["type","number",3,"ngModelChange","id","ngModel"],[1,"primary","raised",3,"click"],["key","key","value","value",1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["spkTooltip",y],["type","text","id","text",3,"ngModelChange","ngModel"],["spkTooltip",D],[3,"ngModelChange","ngModel","customId","placeholder"],["spkTooltip",L],["spk-button","","type","button",1,"outlined",3,"click"]]},template:function(e,o){if(e&1&&(v(0)(1),f(2,Fn,16,5)),e&2){let i=A(o.destinationType());l();let a=A(o.destinationFormConfig());l(),g(i&&a?2:-1)}},dependencies:[Qe,ue,We,Ce,ge,fe,be,Ye,tt,nt,Se,Re,me,pe,Xe,Be,ze,He,Ue,Ke],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}spk-select[_ngcontent-%COMP%]{--miw: p2r(120)}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-500)}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-500)}label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}label[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.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}"],changeDetection:0})};export{ot as a,Te as b,at as c};
@@ -0,0 +1 @@
1
+ import{a as x}from"./chunk-QRRKPBY6.js";import{a as Z}from"./chunk-2BX65XJQ.js";import{b as H,d as K}from"./chunk-2W6BEUGU.js";import{b as j,c as W,e as q,g as Y,p as J}from"./chunk-Y5IRBMLB.js";import{h as Q}from"./chunk-DNJOKPEL.js";import{Ab as g,Bb as R,Cb as D,Eb as f,Hc as E,Kb as V,Lb as z,Mb as s,Na as h,Nc as S,Qa as r,Qb as u,Rb as _,Z as N,ab as A,da as C,dc as G,ea as I,ec as F,fc as P,gc as X,mc as B,na as y,nc as U,oc as O,sb as d,tb as p,vb as v,wb as L,xb as m,yb as a,zb as l}from"./chunk-BTMXQPBB.js";function nt(n,e){if(n&1&&F(0),n&2){_();let t=O(0);X(" ",t.Message," ")}}function ot(n,e){if(n&1&&(a(0,"div"),V(1,1),g(2,"a",15),z(),l()),n&2){let t=_();r(2),m("href",t.downloadLink(),h)}}function at(n,e){if(n&1){let t=f();a(0,"button",14),u("click",function(){C(t);let i=_(),c=O(0);return I(i.doRepair(c.BackupID))}),s(1,2),l()}}function rt(n,e){if(n&1){let t=f();a(0,"button",14),u("click",function(){C(t);let i=_(),c=O(0);return I(i.doDownloadBugreport(c))}),s(1,3),l()}}function lt(n,e){if(n&1&&g(0,"spk-progress-bar",17),n&2){let t,o=_(2);m("value",(t=o.serverState())==null?null:t.UpdateDownloadProgress)}}function ct(n,e){if(n&1){let t=f();a(0,"div",13),R(1),s(2,4),D(),a(3,"a",16),F(4),l(),d(5,lt,1,1,"spk-progress-bar",17),a(6,"button",14),u("click",function(){C(t);let i=_();return I(i.doShowUpdate())}),s(7,5),l()()}if(n&2){let t,o,i=_(),c=O(0);r(3),m("href",(t=i.serverState())==null?null:t.UpdateDownloadLink,h),r(),P(c.Message),r(),p(((o=i.serverState())==null?null:o.UpdaterState)==="Downloading"?5:-1)}}function st(n,e){if(n&1){let t=f();a(0,"button",14),u("click",function(){C(t);let i=_(),c=O(0);return I(i.doShowLog(c.BackupID))}),s(1,6),l()}}function _t(n,e){if(n&1){let t=f();a(0,"button",14),u("click",function(){C(t);let i=_();return I(i.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),s(1,7),l()}}function dt(n,e){if(n&1){let t=f();a(0,"button",14),u("click",function(){C(t);let i=_();return I(i.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),s(1,8),l()}}var pt={Error:"error",Warning:"warn",Information:"primary"},M=class n{#t=N(K);#a=N(H);#r=N(q);#e=N(W);#i=N(x);#n=N(Q);#o=y(null);serverState=this.#i.serverState;index=S.required();notification=S.required();downloadLink=E(()=>this.#o()||this.notification().DownloadLink||"");deleteNotificationByIndex(){this.#i.deleteNotification(this.index())}deleteAllNotifications(){this.#i.deleteAllNotifications()}getAlertType(e){return e&&pt[e]||"primary"}doShowLog(e){this.#n.getApiV1BackupByIdIsactive({id:e}).subscribe({next:t=>{this.#t.navigate(["/backup/"+e+"/log"])},error:t=>{if(t.status===404){let o={title:$localize`Error`,message:$localize`The backup is missing, has it been deleted?`,confirmText:$localize`OK`,cancelText:null};parseInt(e)+""!=e&&(o={title:$localize`Error`,message:$localize`The backup was temporary and does not exist anymore, so the log data is lost`,confirmText:$localize`OK`,cancelText:null}),this.#r.open(Z,{maxWidth:"550px",width:"100%",data:o})}else this.#e.error($localize`Failed to find backup: `+t.message)}})}doRepair(e){this.#n.postApiV1BackupByIdRepair({id:e}).subscribe({next:()=>{this.#e.success($localize`Backup repaired`),this.#t.navigate(["./"],{onSameUrlNavigation:"reload",relativeTo:this.#a})},error:t=>{this.#e.error($localize`Failed to repair backup: `+t.message)}})}doShowUpdate(){this.#t.navigate(["/about/changelog"])}doShowLink(e){window.open(e,"_blank")}doDownloadBugreport(e){let t=e.Action.slice(19);this.#n.postApiV1AuthIssuetokenByOperation({operation:"bugreport"}).subscribe({next:o=>{if(!o.Token){this.#e.error("Failed to get bug report URL: No token generated");return}let i=`api/v1/bugreport/${t}?token=${o.Token}`;e.DownloadLink=i,this.#o.set(i),this.triggerDownload(i)},error:o=>{this.#e.error(`Failed to get bug report URL: ${o.message}`)}})}triggerDownload(e){let t=document.createElement("a");t.href=e,t.download="",t.style.display="none",document.body.appendChild(t);try{t.click()}catch{}document.body.removeChild(t)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=A({type:n,selectors:[["app-notification"]],inputs:{index:[1,"index"],notification:[1,"notification"]},decls:16,vars:12,consts:()=>{let e;e=$localize`Dismiss`;let t;t=$localize` If the backup file was not downloaded automatically, ${"\uFFFD#2\uFFFD"}:START_LINK:right click and choose "Save as …"${"\uFFFD/#2\uFFFD"}:CLOSE_LINK:`;let o;o=$localize`Repair`;let i;i=$localize`Download`;let c;c=$localize`New update found:`;let k;k=$localize`Show Update`;let w;w=$localize`Show Log`;let $;$=$localize` Show Help `;let b;return b=$localize` Show Help `,[e,t,o,i,c,k,w,$,b,["sparkle-alert-title",""],["sparkle-alert-content","",1,"content"],[1,"actions"],["spk-button","",1,"small","outlined"],[1,"message"],["spk-button","",1,"small","outlined",3,"click"],["target","_blank",3,"href"],[3,"href"],[3,"value"]]},template:function(t,o){if(t&1){let i=f();B(0),a(1,"spk-alert")(2,"div",9),F(3),l(),a(4,"div",10),d(5,nt,1,1),d(6,ot,3,1,"div"),a(7,"div",11),d(8,at,2,0,"button",12),d(9,rt,2,0,"button",12),d(10,ct,8,3,"div",13),d(11,st,2,0,"button",12),d(12,_t,2,0,"button",12),d(13,dt,2,0,"button",12),a(14,"button",14),u("click",function(){return C(i),I(o.deleteNotificationByIndex())}),s(15,0),l()()()()}if(t&2){let i=U(o.notification());r(),G(o.getAlertType(i.Type)),r(2),P(i.Title),r(2),p(i.Action!=="update:new"&&i.Action!=="update:manual"?5:-1),r(),p(o.downloadLink()?6:-1),r(2),p(i.Message!=null&&i.Message.includes("please run repair")?8:-1),r(),p(i.Action!=null&&i.Action.startsWith("bug-report:created:")&&!o.downloadLink()?9:-1),r(),p(i.Action==="update:new"?10:-1),r(),p(i.Action==="backup:show-log"?11:-1),r(),p(i.Action==="config:issue:unencrypted-database"?12:-1),r(),p(i.Action==="config:issue:windows-folder-used"?13:-1)}},dependencies:[J,Y,j],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};var Nt=(n,e)=>e.ID;function Tt(n,e){if(n&1&&g(0,"app-notification",1),n&2){let t=e.$implicit,o=e.$index;m("index",o)("notification",t)}}function Ct(n,e){n&1&&(a(0,"div",2)(1,"p"),s(2,0),l()())}var tt=class n{#t=N(x);notificationFilterPredicate=S();notifications=E(()=>{let e=this.notificationFilterPredicate()?.predicate,t=this.#t.notifications();return typeof e!="function"?t:t.filter(e)});static \u0275fac=function(t){return new(t||n)};static \u0275cmp=A({type:n,selectors:[["app-notifications"]],inputs:{notificationFilterPredicate:[1,"notificationFilterPredicate"]},decls:3,vars:1,consts:()=>{let e;return e=$localize`No more notifications`,[e,[3,"index","notification"],[1,"notification-list"]]},template:function(t,o){t&1&&v(0,Tt,1,2,"app-notification",1,Nt,!1,Ct,3,0,"div",2),t&2&&L(o.notifications())},dependencies:[M],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;justify-content:flex-end}.notification-list[_ngcontent-%COMP%]{padding:1rem;display:flex;flex-direction:column;gap:1rem;text-align:center}"],changeDetection:0})};export{M as a,tt as b};
@@ -0,0 +1 @@
1
+ import{a as ut}from"./chunk-WZNH4JPF.js";import{a as Oe}from"./chunk-BCHZRC5K.js";import{a as rt,b as Ke,c as _t}from"./chunk-B26UYXA3.js";import{b as re}from"./chunk-LDIZ5E5Z.js";import{a as ot}from"./chunk-2BX65XJQ.js";import{a as Te}from"./chunk-6JQM2X3B.js";import{b as fe,c as Q,d as Ae,e as Z,f as he,h as st,i as le,j as Pe,k as Ne,n as lt,o as De,p as at,q as Me,r as ye,s as ae,t as Re}from"./chunk-NSIELNIY.js";import{b as oe,d as H}from"./chunk-2W6BEUGU.js";import{A as Ee,C as nt,a as j,b as Je,e as et,g as se,l as q,p as tt,t as Y}from"./chunk-Y5IRBMLB.js";import{h as it}from"./chunk-DNJOKPEL.js";import{$b as xe,Ab as g,Bb as B,Cb as v,Eb as x,H as ke,Hc as I,Ic as ie,Kb as C,Lb as m,Mb as f,Mc as ve,Nc as Ve,Oc as Se,Pb as Ge,Qa as _,Qb as E,Rb as u,U as ge,Z as M,Zb as Ce,_b as me,ab as z,bc as Fe,da as c,ea as p,ec as U,fb as Ye,fc as be,gc as Ze,jc as $,kc as w,lc as k,na as d,rb as Qe,sb as y,sc as Be,tb as R,ub as Ie,vb as Le,wb as Ue,xb as T,yb as l,zb as a}from"./chunk-BTMXQPBB.js";import{a as G,b as W}from"./chunk-EUDKD2JW.js";var $e=class s{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||s)};static \u0275prov=ge({token:s,factory:s.\u0275fac,providedIn:"root"})};function Ct(s,t){if(s&1){let e=x();l(0,"div",24)(1,"spk-form-field")(2,"label",25),f(3,7),a(),l(4,"input",26,0),k("ngModelChange",function(i){c(e);let o=u();return w(o.scheduleFields.nextTime().time,i)||(o.scheduleFields.nextTime().time=i),p(i)}),E("focus",function(){c(e);let i=xe(5);return p(i.showPicker())}),a(),l(6,"spk-icon",27),U(7,"clock"),a()(),l(8,"spk-form-field"),g(9,"label",28),l(10,"input",29,1),k("ngModelChange",function(i){c(e);let o=u();return w(o.scheduleFields.nextTime().date,i)||(o.scheduleFields.nextTime().date=i),p(i)}),E("focus",function(){c(e);let i=xe(11);return p(i.showPicker())}),a(),l(12,"spk-icon",27),U(13,"calendar"),a()()(),l(14,"div",24)(15,"spk-form-field")(16,"label",30),f(17,8),a(),l(18,"input",31),k("ngModelChange",function(i){c(e);let o=u();return w(o.scheduleFields.runAgain().repeatValue,i)||(o.scheduleFields.runAgain().repeatValue=i),p(i)}),a()(),l(19,"spk-select",32)(20,"input",33),k("ngModelChange",function(i){c(e);let o=u();return w(o.scheduleFields.runAgain().repeatUnit,i)||(o.scheduleFields.runAgain().repeatUnit=i),p(i)}),a()()(),l(21,"app-toggle-card",34),B(22,35),f(23,9),v(),l(24,"div",36)(25,"spk-toggle",19),C(26,10),l(27,"input",20),k("ngModelChange",function(i){c(e);let o=u();return w(o.scheduleFields.runAgain().allowedDays.mon,i)||(o.scheduleFields.runAgain().allowedDays.mon=i),p(i)}),a(),m(),a(),l(28,"spk-toggle",19),C(29,11),l(30,"input",20),k("ngModelChange",function(i){c(e);let o=u();return w(o.scheduleFields.runAgain().allowedDays.tue,i)||(o.scheduleFields.runAgain().allowedDays.tue=i),p(i)}),a(),m(),a(),l(31,"spk-toggle",19),C(32,12),l(33,"input",20),k("ngModelChange",function(i){c(e);let o=u();return w(o.scheduleFields.runAgain().allowedDays.wed,i)||(o.scheduleFields.runAgain().allowedDays.wed=i),p(i)}),a(),m(),a(),l(34,"spk-toggle",19),C(35,13),l(36,"input",20),k("ngModelChange",function(i){c(e);let o=u();return w(o.scheduleFields.runAgain().allowedDays.thu,i)||(o.scheduleFields.runAgain().allowedDays.thu=i),p(i)}),a(),m(),a(),l(37,"spk-toggle",19),C(38,14),l(39,"input",20),k("ngModelChange",function(i){c(e);let o=u();return w(o.scheduleFields.runAgain().allowedDays.fri,i)||(o.scheduleFields.runAgain().allowedDays.fri=i),p(i)}),a(),m(),a(),l(40,"spk-toggle",19),C(41,15),l(42,"input",20),k("ngModelChange",function(i){c(e);let o=u();return w(o.scheduleFields.runAgain().allowedDays.sat,i)||(o.scheduleFields.runAgain().allowedDays.sat=i),p(i)}),a(),m(),a(),l(43,"spk-toggle",19),C(44,16),l(45,"input",20),k("ngModelChange",function(i){c(e);let o=u();return w(o.scheduleFields.runAgain().allowedDays.sun,i)||(o.scheduleFields.runAgain().allowedDays.sun=i),p(i)}),a(),m(),a()()()}if(s&2){let e=u();_(4),$("ngModel",e.scheduleFields.nextTime().time),_(6),$("ngModel",e.scheduleFields.nextTime().date),_(8),$("ngModel",e.scheduleFields.runAgain().repeatValue),_(),T("options",e.unitOptions)("isClearable",!1),_(),$("ngModel",e.scheduleFields.runAgain().repeatUnit),_(),T("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)}}var mt=[{key:"s",label:$localize`Seconds`},{key:"m",label:$localize`Minutes`},{key:"h",label:$localize`Hours`},{key:"D",label:$localize`Days`},{key:"W",label:$localize`Weeks`},{key:"M",label:$localize`Months`},{key:"Y",label:$localize`Years`}],te={autoRun:!0,nextTime:{time:"13:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!1,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}},Xe=class s{#e=M(J);#t=M(H);#i=M(oe);unitOptions=mt;scheduleFields=this.#e.scheduleFields;goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["options"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=z({type:s,selectors:[["app-schedule"]],decls:16,vars:2,consts:()=>{let t;t=$localize`Schedule`;let e;e=$localize` Automatically run backups ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let n;n=$localize`If a date was missed, the job will run as soon as possible.`;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let r;r=$localize`Next time`;let F;F=$localize`Run again every`;let A;A=$localize`Allowed days`;let S;S=$localize` Monday ${"\uFFFD#27\uFFFD\uFFFD/#27\uFFFD"}:TAG_INPUT:`;let O;O=$localize` Tuesday ${"\uFFFD#30\uFFFD\uFFFD/#30\uFFFD"}:TAG_INPUT:`;let P;P=$localize` Wednesday ${"\uFFFD#33\uFFFD\uFFFD/#33\uFFFD"}:TAG_INPUT:`;let L;L=$localize` Thursday ${"\uFFFD#36\uFFFD\uFFFD/#36\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Friday ${"\uFFFD#39\uFFFD\uFFFD/#39\uFFFD"}:TAG_INPUT:`;let b;b=$localize` Saturday ${"\uFFFD#42\uFFFD\uFFFD/#42\uFFFD"}:TAG_INPUT:`;let X;return X=$localize` Sunday ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],t,e,n,i,o,r,F,A,S,O,P,L,K,b,X,[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","",1,"raised","primary",3,"click"],[1,"row-inputs"],["for","time"],["type","time","id","time",3,"ngModelChange","focus","ngModel"],["suffix",""],["for","date"],["type","date","id","date",3,"ngModelChange","focus","ngModel"],["for","repeatValue"],["type","number","id","repeatValue",3,"ngModelChange","ngModel"],["value","key","label","label",3,"options","isClearable"],["type","text","id","repeatUnit",3,"ngModelChange","ngModel"],[3,"disallowToggle"],["title",""],[1,"days-wrap"]]},template:function(e,n){e&1&&(l(0,"h3",17),f(1,2),a(),l(2,"div",18)(3,"spk-toggle",19),C(4,3),l(5,"input",20),k("ngModelChange",function(o){return w(n.scheduleFields.autoRun,o)||(n.scheduleFields.autoRun=o),o}),a(),m(),a(),l(6,"p"),f(7,4),a()(),y(8,Ct,46,14),l(9,"div",21)(10,"button",22),E("click",function(){return n.goBack()}),C(11,5),g(12,"spk-icon"),m(),a(),l(13,"button",23),E("click",function(){return n.next()}),C(14,6),g(15,"spk-icon"),m(),a()()),e&2&&(_(5),$("ngModel",n.scheduleFields.autoRun),_(3),R(n.scheduleFields.autoRun()?8:-1))},dependencies:[ae,Q,Ne,fe,Z,le,q,Ee,j,se,Y,Oe],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem 2.5rem 1.5rem;display:flex;flex-direction:column;gap:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};function Ft(s,t){if(s&1&&(B(0,4),U(1),v()),s&2){let e,n=u();_(),be((e=n.currentExpressionOption())==null?null:e.startsWith)}}function St(s,t){if(s&1&&(B(0,5),U(1),v()),s&2){let e,n=u();_(),be((e=n.currentExpressionOption())==null?null:e.endsWith)}}var Et=[{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:"Excludes file group",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"},{key:"None",value:"-Unknown"}],we=class s{path=Ve.required();osType=Ve();pathChange=ve();remove=ve();internalPath=d("");pathType=d("-Expression");currentExpressionOption=I(()=>{let t=this.pathType();return this.expressionOptions().find(e=>e.value===t)});expressionOptions=I(()=>{let e=this.osType()==="Windows"?"\\":"/";return Et.map(n=>n.value==="-Folder"||n.value==="+Folder"?W(G({},n),{startsWith:"",endsWith:""}):n.value==="-FolderName"||n.value==="+FolderName"?W(G({},n),{startsWith:"*",endsWith:`*${e}`}):n.value==="-FileName"||n.value==="+FileName"?W(G({},n),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):n.value==="-FileGroup"||n.value==="+FileGroup"?W(G({},n),{startsWith:"{",endsWith:"}"}):n.value==="-Regex"||n.value==="+Regex"?W(G({},n),{startsWith:"[",endsWith:"]"}):n.value==="-Extension"||n.value==="+Extension"?W(G({},n),{startsWith:"*.",endsWith:""}):W(G({},n),{startsWith:"",endsWith:""}))});pathEffect=ie(()=>{let t=this.path(),e=t.slice(1),n=t.startsWith("-")?"-":"+",i=this.osType()==="Windows",o=i?"\\":"/";e.startsWith("%")&&e.endsWith(o)||i&&e.slice(2).startsWith(o)&&e.endsWith(o)||e.startsWith(o)&&e.endsWith(o)?(this.pathType.set(`${n}Folder`),this.internalPath.set(e)):e.startsWith("*")&&e.endsWith(`*${o}`)?(this.pathType.set(`${n}FolderName`),this.internalPath.set(e.slice(1,-2))):e.startsWith("[.*")&&e.endsWith(`[^\\${o}]*]`)?(this.pathType.set(`${n}FileName`),this.internalPath.set(e.slice(3,-7))):e.startsWith("{")&&e.endsWith("}")?(this.pathType.set(`${n}FileGroup`),this.internalPath.set(e.slice(1,-1))):e.startsWith("[")&&e.endsWith("]")?(this.pathType.set(`${n}Regex`),this.internalPath.set(e.slice(1,-1))):e.startsWith("*.")?(this.pathType.set(`${n}Extension`),this.internalPath.set(e.slice(2))):(this.pathType.set(`${n}Expression`),this.internalPath.set(e))});updateFilter(){let t=this.internalPath(),e=this.currentExpressionOption();t!==""&&this.pathChange.emit(`${e?.value.slice(0,1)}${e?.startsWith??""}${t}${e?.endsWith??""}`)}removeFilter(){this.remove.emit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=z({type:s,selectors:[["app-new-filter"]],inputs:{path:[1,"path"],osType:[1,"osType"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:9,vars:6,consts:()=>{let t;return t=$localize`Select an option...`,[["value","value","label","key",3,"options","isClearable"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],[1,"expression-input"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],["suffix",""],[1,"filter-removal",3,"click"],[1,"spk-primary"]]},template:function(e,n){if(e&1&&(l(0,"spk-select",0)(1,"input",1),k("ngModelChange",function(o){return w(n.pathType,o)||(n.pathType=o),o}),E("ngModelChange",function(){return n.updateFilter()}),a()(),l(2,"spk-form-field",2)(3,"input",3),k("ngModelChange",function(o){return w(n.internalPath,o)||(n.internalPath=o),o}),E("ngModelChange",function(){return n.updateFilter()}),a(),y(4,Ft,2,1,"ng-container",4),y(5,St,2,1,"ng-container",5),a(),l(6,"div",6),E("click",function(){return n.removeFilter()}),l(7,"spk-icon",7),U(8,"x-circle"),a()()),e&2){let i,o;T("options",n.expressionOptions())("isClearable",!1),_(),$("ngModel",n.pathType),_(2),$("ngModel",n.internalPath),_(),R(!((i=n.currentExpressionOption())==null||i.startsWith==null)&&i.startsWith.length?4:-1),_(),R(!((o=n.currentExpressionOption())==null||o.endsWith==null)&&o.endsWith.length?5:-1)}},dependencies:[ae,Q,Z,le,Y,q,j],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 Tt=["formRef"],ct=()=>({standalone:!0});function ft(s,t){if(s&1){let e=x();l(0,"spk-form-field",42)(1,"input",43),k("ngModelChange",function(i){c(e);let o=u(2);return w(o.editingPath,i)||(o.editingPath=i),p(i)}),a()(),l(2,"button",44),E("click",function(){c(e);let i=u(2);return p(i.updatePath())}),l(3,"spk-icon"),U(4,"floppy-disk"),a()(),l(5,"button",44),E("click",function(){c(e);let i=u(2);return p(i.cancelEditPath())}),l(6,"spk-icon"),U(7,"x-bold"),a()()}if(s&2){let e=u(2);_(),$("ngModel",e.editingPath),T("ngModelOptions",Be(2,ct))}}function At(s,t){if(s&1){let e=x();l(0,"spk-form-field",42),g(1,"input",45),a(),l(2,"button",44),E("click",function(){c(e);let i=u().$implicit,o=u();return p(o.editPath(i))}),l(3,"spk-icon"),U(4,"pen"),a()(),l(5,"button",44),E("click",function(){c(e);let i=u().$implicit,o=u();return p(o.removePath(i))}),l(6,"spk-icon"),U(7,"trash-simple"),a()()}if(s&2){let e=u().$implicit;Qe("readonly",!0),_(),T("ngModel",e)("ngModelOptions",Be(3,ct))}}function ht(s,t){if(s&1&&(l(0,"div",30),y(1,ft,8,3)(2,At,8,4),a()),s&2){let e=t.$implicit,n=u();_(),R(n.oldPath()===e?1:2)}}function Pt(s,t){if(s&1){let e=x();l(0,"app-new-filter",47),E("pathChange",function(i){let o=c(e).$index,r=u(2);return p(r.patchPathAt(i,o))})("remove",function(){let i=c(e).$index,o=u(2);return p(o.removePathAt(i))}),a()}if(s&2){let e=t.$implicit,n=u(2);T("path",e)("osType",n.osType()??"")}}function Nt(s,t){if(s&1&&Le(0,Pt,1,2,"app-new-filter",46,Ie),s&2){let e=u();Ue(e.pathArray())}}function Dt(s,t){if(s&1&&(l(0,"div",41)(1,"spk-form-field"),g(2,"input",48),a(),l(3,"spk-select",49),g(4,"input",50),a()()),s&2){let e=u();_(3),T("options",e.sizeOptions())("isClearable",!1)}}var V=new ye,Mt=["Bytes","KB","MB","GB","TB","PB"],pt=(s={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>V.group({path:V.control(s.path),excludes:V.group({hidden:V.control(s.excludes.hidden),system:V.control(s.excludes.system),temporary:V.control(s.excludes.temporary),filesLargerThan:V.group({size:V.control(null),unit:V.control(null)})})}),He=class s{#e=M(J);#t=M(H);#i=M(oe);formRef=Se.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new st("");filesLargerThan=I(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);sizeOptions=d(Mt);osType=this.#e.osType;pathSignal=re(this.sourceDataForm.controls.path.valueChanges);pathArray=I(()=>this.pathSignal()?.split("\0").filter(t=>t.startsWith("-")||t.startsWith("+")||t==="___none___")??[]);nonFilterPaths=I(()=>this.pathSignal()?.split("\0").filter(t=>!t.startsWith("-")&&!t.startsWith("+")&&t!==""));oldPath=d(null);editingPath=d(null);addingNewPath=d(!1);editPath(t){this.oldPath.set(t),this.editingPath.set(t)}updatePath(){let t=this.oldPath(),e=this.editingPath();if(!t||!e||e===t){this.oldPath.set(null),this.editingPath.set(null);return}let n=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(n?.replace(t,e)??""),this.oldPath.set(null),this.editingPath.set(null)}cancelEditPath(){this.oldPath.set(null),this.editingPath.set(null)}removePath(t){let e=this.sourceDataForm.controls.path.value??"",n=e.indexOf(t);if(n===-1)return;let i=n===0?t:"\0"+t,o=e.replace(i,"");this.sourceDataForm.controls.path.setValue(o)}addFilter(t="-*"){let e=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(`${e}\0${t}`)}patchPathAt(t,e){let i=this.sourceDataForm.controls.path.value.split("\0").filter(r=>!r.startsWith("-")&&!r.startsWith("+")).join("\0"),o=this.pathArray().map((r,F)=>F===e?`${t}`:`${r}`).join("\0");this.sourceDataForm.controls.path.setValue(`${i}\0${o}`)}removePathAt(t){let n=this.sourceDataForm.controls.path.value.split("\0").filter(o=>!o.startsWith("-")&&!o.startsWith("+")).join("\0"),i=this.pathArray().filter((o,r)=>r!==t).join("\0");this.sourceDataForm.controls.path.setValue(`${n}\0${i}`)}getPath(){return this.sourceDataForm.value.path??null}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let t=this.sourceDataForm.controls.path.value,e=this.newPathCtrl.value;this.sourceDataForm.controls.path.setValue(`${t}\0${e}`),this.newPathCtrl.setValue("")}goBack(){this.#t.navigate(["destination"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=z({type:s,selectors:[["app-source-data"]],viewQuery:function(e,n){e&1&&Ce(n.formRef,Tt,5),e&2&&me()},decls:56,vars:12,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Add a direct path`;let n;n=$localize`Hidden files`;let i;i=$localize`System files`;let o;o=$localize`Temporary files`;let r;r=$localize`Source Data`;let F;F=$localize`Folder path`;let A;A=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let S;S=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let O;O=$localize`Paths`;let P;P=$localize`Add a path directly from your machine.`;let L;L=$localize`Filters`;let K;K=$localize`Customize your filters.`;let b;b=$localize`Add filter`;let X;X=$localize`Exclude`;let D;D=$localize`Choose if there’s any files you want to exclude.`;let ee;ee=$localize` Files with the Hidden attribute ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let _e;_e=$localize` Files with the System attribute ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`;let ue;ue=$localize` Files with the Temporary attribute ${"\uFFFD#52\uFFFD\uFFFD/#52\uFFFD"}:TAG_INPUT:`;let ce;ce=$localize` Files larger than `;let h;h=$localize`Edit path`;let qe;return qe=$localize`Select an option...`,[["formRef",""],r,F,A,S,O,P,L,K,b,X,D,ee,_e,ue,ce,[3,"submit","formGroup"],[1,"left"],[1,"title-30"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",t,"formControlName","path"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],["description",""],[1,"paths"],[1,"path"],[1,"row-inputs"],["type","text","placeholder",e,3,"formControl"],["spk-button","","type","button",1,"raised","primary",3,"click"],["type","button","spk-button","","action","",3,"click"],["formGroupName","excludes",3,"disallowToggle"],[1,"raised","primary"],["type","checkbox","placeholder",n,"formControlName","hidden"],["type","checkbox","placeholder",i,"formControlName","system"],["type","checkbox","placeholder",o,"formControlName","temporary"],[1,"raised","primary",3,"click"],["formGroupName","filesLargerThan",1,"row-inputs"],[1,"small"],["type","text","placeholder",h,3,"ngModelChange","ngModel","ngModelOptions"],["spk-button","","type","button",1,"small",3,"click"],["type","text",3,"ngModel","ngModelOptions"],[3,"path","osType"],[3,"pathChange","remove","path","osType"],["type","number","formControlName","size"],[3,"options","isClearable"],["type","text","formControlName","unit","placeholder",qe]]},template:function(e,n){if(e&1){let i=x();l(0,"form",16,0),E("submit",function(){return c(i),p(n.next())}),l(2,"div",17)(3,"h3",18),f(4,1),a(),l(5,"app-file-tree",19)(6,"label",20),f(7,2),a(),g(8,"input",21),a(),l(9,"div",22)(10,"button",23),E("click",function(){return c(i),p(n.goBack())}),C(11,3),g(12,"spk-icon"),m(),a(),l(13,"button",24),C(14,4),g(15,"spk-icon"),m(),a()()(),l(16,"div",25)(17,"app-toggle-card",26),B(18,27),f(19,5),v(),l(20,"p",28),f(21,6),a(),l(22,"div",29),Le(23,ht,3,1,"div",30,Ie),l(25,"div",31)(26,"spk-form-field"),g(27,"input",32),a(),l(28,"button",33),E("click",function(){return c(i),p(n.addNewPath())}),l(29,"spk-icon"),U(30,"plus"),a()()()()(),l(31,"app-toggle-card",26),B(32,27),f(33,7),v(),l(34,"p",28),f(35,8),a(),l(36,"button",34),E("click",function(){return c(i),p(n.addFilter())}),f(37,9),a(),y(38,Nt,2,0),a(),l(39,"app-toggle-card",35),B(40,27),f(41,10),v(),l(42,"p",28),f(43,11),a(),l(44,"spk-toggle",36),C(45,12),g(46,"input",37),m(),a(),l(47,"spk-toggle",36),C(48,13),g(49,"input",38),m(),a(),l(50,"spk-toggle",36),C(51,14),g(52,"input",39),m(),a(),l(53,"spk-toggle",40),E("click",function(){return c(i),p(n.toggleFilesLargerThan())}),f(54,15),a(),y(55,Dt,5,2,"div",41),a()()()}if(e&2){let i;T("formGroup",n.sourceDataForm),_(5),T("multiSelect",!0)("startingPath",n.getPath())("showFiles",!0),_(12),T("disallowToggle",!0),_(6),Ue(n.nonFilterPaths()),_(4),T("formControl",n.newPathCtrl),_(4),T("disallowToggle",!0),_(7),R((i=n.pathSignal())!=null&&i.length?38:-1),_(),T("disallowToggle",!0),_(14),Fe("active",n.filesLargerThan()),_(2),R(n.filesLargerThan()?55:-1)}},dependencies:[ae,Pe,Q,Ne,fe,Z,he,le,Re,lt,De,Me,at,q,j,se,Ee,Y,we,ut,Oe],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}spk-divider[_ngcontent-%COMP%]{margin:.75rem 0}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.25rem}.paths[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.path[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr min-content min-content;gap:.25rem}"],changeDetection:0})};var dt="1W:1D,4W:1W,12M:1M",J=class s{#e=M(H);#t=M(Te);#i=M(et);#n=M(it);#s=M($e);generalForm=gt();sourceDataForm=pt();scheduleFields={autoRun:d(te.autoRun),nextTime:d(te.nextTime),runAgain:d(te.runAgain)};settings=d([]);optionsFields={remoteVolumeSize:d("50MB"),backupRetention:d("all"),backupRetentionTime:d(""),backupRetentionVersions:d(0),backupRetentionCustom:d("")};targetUrlModel=d(null);backupMetadata=d(null);isDraft=d(!1);backupId=d(null);backupName=I(()=>this.generalFormSignal()?.name??"");isSubmitting=d(!1);finishedLoading=d(!1);backupDefaults=d(null);applicationOptions=d(null);isNew=I(()=>this.backupId()==="new");osType=I(()=>this.#t.systemInfo()?.OSType);selectedOptions=d([]);sourceDataFormSignal=re(this.sourceDataForm.valueChanges);generalFormSignal=re(this.generalForm.valueChanges);encryptionFieldSignal=re(this.generalForm.controls.encryption.valueChanges);advancedOptions=I(()=>this.#t.systemInfo()?.Options?.map(this.#_)??[]);#o=d("");#l=d(null);#a=null;testSignal=this.#o.asReadonly();testErrorMessage=this.#l.asReadonly();#p=ie(()=>{let t=this.targetUrlModel(),e=this.#o(),n=this.#a;this.#a=t,!(e==="testing"||n===null||n===t)&&(this.#o.set(""),this.#l.set(null))});setTestState(t,e){this.#o.set(t),this.#l.set(e??null)}#_(t){return{name:t.Name,type:t.Type,shortDescription:t.ShortDescription??void 0,longDescription:t.LongDescription??void 0,options:t.ValidValues}}encryptionOptions=I(()=>{let t=this.#t.systemInfo()?.EncryptionModules??[];return[de,...t]});nonSelectedOptions=I(()=>this.advancedOptions().sort((t,e)=>t?.name&&e?.name?t?.name.localeCompare(e?.name):0).filter(t=>this.selectedOptions()?.findIndex(e=>e.name===t.name)===-1));submit(t=!1){this.isSubmitting.set(!0);let e=this.#u(),n=this.backupId();this.isDraft()&&e.Backup&&(e.Backup.Metadata=this.backupMetadata()),n==="new"||!n||this.isDraft()?this.#n.postApiV1Backups({requestBody:e}).pipe(ke(()=>this.isSubmitting.set(!1))).subscribe({next:i=>{t||this.exit(!1)},error:i=>{}}):this.#n.putApiV1BackupById({id:n,requestBody:e}).pipe(ke(()=>this.isSubmitting.set(!1))).subscribe({next:i=>{t||this.exit(!1)},error:i=>{}})}exit(t){if(!t){this.#r(),this.#e.navigate(["/"]);return}this.#i.open(ot,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#r(),this.#e.navigate(["/"]))}})}mapSourceDataToForm(t){let e=t.Sources??"",n=t.Filters?.map(F=>`${F.Include?"":"-"}${F.Expression}`)??[],i=t.Settings?.find(F=>F.Name==="--exclude-files-attributes")?.Value??"",o=t.Settings?.find(F=>F.Name==="--skip-files-larger-than")??null,r={path:[...e,...n].join("\0"),excludes:{hiddenFiles:i.includes("hidden"),systemFiles:i.includes("system"),tempFiles:i.includes("temporary"),filesLargerThan:o?.Value?.toUpperCase()??null}};this.sourceDataForm.patchValue(r)}mapDestinationToForm(t){this.targetUrlModel.set(t.TargetURL??"")}mapGeneralToForm(t){let e=t.Name??"",n=t.Description??"",i=t.Settings?.find(S=>S.Name==="encryption-module"),o=t.Settings?.find(S=>S.Name==="passphrase")?.Value??"",r=i?.Value&&i.Value.length?i.Value:"",F=t.Settings?.find(S=>S.Name==="compression-module")?.Value??"",A={name:t.Name??"",description:t.Description??""};e&&e!==""&&(A.name=e),n&&n!==""&&(A.description=n),r&&r!==""&&(A.encryption=r),o&&o!==""&&(A.password=o,A.repeatPassword=o),F&&F!==""&&(A.compression=F),this.generalForm.patchValue(A)}mapScheduleToForm(t){if(!t){this.scheduleFields.autoRun.set(!1);return}let e=this.#s.fromString(t.Repeat)??null,n=this.#c(t.Time);this.scheduleFields.autoRun.set(!0),this.scheduleFields.nextTime.update(i=>G(G({},i),n)),this.scheduleFields.runAgain.set({repeatValue:e?.value??1,repeatUnit:e?.unit??"D",allowedDays:{mon:t.AllowedDays?.includes("mon")??!1,tue:t.AllowedDays?.includes("tue")??!1,wed:t.AllowedDays?.includes("wed")??!1,thu:t.AllowedDays?.includes("thu")??!1,fri:t.AllowedDays?.includes("fri")??!1,sat:t.AllowedDays?.includes("sat")??!1,sun:t.AllowedDays?.includes("sun")??!1}})}mapOptionsToForms(t){let e=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","passphrase","keep-time","keep-versions","retention-policy"],n=t.Settings?.filter(r=>!e.includes(r.Name)),i=t.Settings?.filter(r=>e.includes(r.Name));this.settings.set(n??[]),n?.forEach(r=>{if(r.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(r.Value??"")});var o="all";i?.forEach(r=>{if(r.Name==="dblock-size"&&this.optionsFields.remoteVolumeSize.set(r.Value??"50MB"),r.Name==="keep-time"&&(r.Value??"")!=="")return o="time",this.optionsFields.backupRetentionTime.set(r.Value??"");if(r.Name==="keep-versions"&&(r.Value??"")!=="")return o="versions",this.optionsFields.backupRetentionVersions.set(r.Value?parseInt(r.Value):null);if(r.Name==="retention-policy"&&(r.Value??"")!=="")if(r.Value===dt)o="smart";else return o="custom",this.optionsFields.backupRetentionCustom.set(r.Value??"")}),this.optionsFields.backupRetention.set(o)}storeMetadata(t,e){this.backupMetadata.set(e?t.Metadata??null:null)}getScheduleFormValue(){return{autoRun:this.scheduleFields.autoRun(),nextTime:this.scheduleFields.nextTime(),runAgain:this.scheduleFields.runAgain()}}#u(){let t=this.generalForm.value,e=this.getScheduleFormValue(),n=this.sourceDataForm.value,i=this.targetUrlModel(),o=null;e.runAgain?.repeatUnit&&e.runAgain?.repeatValue&&(o=this.#s.toString(e.runAgain.repeatValue,e.runAgain.repeatUnit));let r=e.runAgain?.allowedDays?Object.entries(e.runAgain?.allowedDays).filter(([P,L])=>L).map(([P,L])=>P):[],F=n.path?.split("\0")??[],A=this.mapFormsToSettings(),S=Object.entries(n.excludes??{}).filter(([P,L])=>L&&P!=="filesLargerThan").map(([P])=>P),O=n.excludes?.filesLargerThan;return S.length&&A.push({Name:"--exclude-files-attributes",Value:S.join(",")}),O&&O.size!==null&&O.unit!==null&&A.push({Name:"--skip-files-larger-than",Value:`${O.size}${O.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:i??null,Sources:F.filter(P=>!P.startsWith("-")),Settings:A,Filters:F.filter(P=>P.startsWith("-")).map((P,L)=>({Order:L,Include:!1,Expression:P.slice(1)}))},Schedule:e.autoRun?{Repeat:o,Time:e.nextTime?.date?new Date(`${e.nextTime.date}T${e.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:r}:null}}mapFormsToSettings(t=[]){let e=this.generalForm.value,n=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","encryption-module","passphrase","keep-time","keep-versions","retention-policy","dblock-size","compression-module"],i=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&e.encryption!==de.Key&&(i=[{Name:"encryption-module",Value:e.encryption??null},{Name:"passphrase",Value:e.password??null}]);let o=[{Name:"compression-module",Value:e.compression}];e.compression===""&&(o=[]);let r=[{Name:"dblock-size",Value:this.optionsFields.remoteVolumeSize()}];switch(this.optionsFields.backupRetention()){case"time":r.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":r.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":r.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":r.push({Name:"retention-policy",Value:dt});break}let F=[...t,...n],A=this.settings().filter(S=>!F.includes(S.Name)).map(S=>{let O=S.Value;return typeof S.Value=="number"&&(O=S.Value.toString()),typeof S.Value=="boolean"&&(O=S.Value?"True":"False"),{Name:S.Name?.startsWith("--")?S.Name:`--${S.Name}`,Value:O}});return[...i,...o,...r,...A]}#c(t){if(!t||t?.indexOf("T")===-1)return{time:t??"13:00"};let e=new Date(t);return{time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`,date:e.toISOString().split("T")[0]}}setTargetUrl(t){this.targetUrlModel.set(t)}#r(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleFields.autoRun.set(te.autoRun),this.scheduleFields.nextTime.set(te.nextTime),this.scheduleFields.runAgain.set(te.runAgain),this.optionsFields.remoteVolumeSize.set("50MB"),this.optionsFields.backupRetention.set("all"),this.settings.set([]),this.targetUrlModel.set(null)}static \u0275fac=function(e){return new(e||s)};static \u0275prov=ge({token:s,factory:s.\u0275fac,providedIn:"root"})};var yt=["formRef"];function Rt(s,t){s&1&&(l(0,"spk-alert",17),C(1,5),g(2,"spk-icon",26),m(),a())}function Ot(s,t){if(s&1&&U(0),s&2){let e=t.$implicit;Ze(" ",e.DisplayName," ")}}function $t(s,t){if(s&1&&g(0,"spk-progress-bar",40),s&2){let e=u(3);Fe("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),T("value",e.calculatePasswordStrength()*(100/5))}}function wt(s,t){s&1&&(l(0,"span",35),f(1,10),a())}function kt(s,t){s&1&&(C(0,8,1),g(1,"spk-icon"),m())}function It(s,t){s&1&&(C(0,8,2),g(1,"spk-icon"),m())}function Lt(s,t){s&1&&(C(0,11,1),g(1,"spk-icon",42),m())}function Ut(s,t){s&1&&(C(0,11,2),g(1,"spk-icon"),m())}function Gt(s,t){if(s&1){let e=x();l(0,"button",41),E("click",function(){c(e);let i=u(3);return p(i.copyPassword())}),C(1,11),y(2,Lt,2,0)(3,Ut,2,0),m(),a()}if(s&2){let e=u(3);_(2),R(e.copiedPassword()?2:3)}}function xt(s,t){s&1&&(l(0,"spk-alert",39),f(1,12),a())}function bt(s,t){if(s&1){let e=x();l(0,"div",30)(1,"spk-form-field")(2,"label",31),C(3,7),g(4,"sup"),m(),a(),g(5,"input",32),a(),y(6,$t,1,9,"spk-progress-bar",33),l(7,"spk-form-field"),g(8,"input",34),y(9,wt,2,0,"span",35),a(),l(10,"div",36)(11,"button",37),E("click",function(){c(e);let i=u(2);return p(i.showPassword.set(!i.showPassword()))}),C(12,8),y(13,kt,2,0)(14,It,2,0),m(),a(),l(15,"button",37),E("click",function(){c(e);let i=u(2);return p(i.generatePassword())}),C(16,9),g(17,"spk-icon"),m(),a(),y(18,Gt,4,1,"button",38),a(),y(19,xt,2,0,"spk-alert",39),a()}if(s&2){let e=u(2);_(5),T("type",e.showPassword()?"text":"password"),_(),R(e.generalForm.value.password?6:-1),_(2),T("type",e.showPassword()?"text":"password"),_(),R(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),_(4),R(e.showPassword()?13:14),_(5),R(e.showCopyPassword()?18:-1),_(),R(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function Bt(s,t){if(s&1&&(l(0,"spk-select",27)(1,"label",28),f(2,6),a(),g(3,"input",29),Ye(4,Ot,1,1,"ng-template"),a(),y(5,bt,20,7,"div",30)),s&2){let e=u();T("options",e.encryptionOptions())("isClearable",!1),_(5),R(e.encryptionFieldSignal()!==e.noneOptionKey?5:-1)}}function vt(s,t){if(s&1&&(l(0,"button",24),C(1,13),g(2,"spk-icon"),m(),a()),s&2){let e=u();T("disabled",e.nameAndDescriptionValid()===!1)}}function Vt(s,t){if(s&1&&(l(0,"button",25),C(1,14),g(2,"spk-icon"),m(),a()),s&2){let e=u();T("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var ne=new ye,gt=(s={name:"",description:"",encryption:"",password:"",repeatPassword:"",compression:""})=>ne.group({name:ne.control(s.name,[Ae.required]),description:ne.control(s.description),encryption:ne.control(s.encryption,[_t()]),password:ne.control(s.password,[Ke(t=>t?.value.encryption!=="",[Ae.required])]),repeatPassword:ne.control(s.repeatPassword,[Ke(t=>t?.value.encryption!=="",[Ae.required])]),compression:ne.control(s.compression)}),de={Key:"-",DisplayName:"None"},je=class s{#e=M(H);#t=M(oe);#i=M(rt);#n=M(J);#s=M(Te);formRef=Se.required("formRef");generalForm=this.#n.generalForm;generalFormSignal=this.#n.generalFormSignal;encryptionFieldSignal=this.#n.encryptionFieldSignal;encryptionOptions=this.#n.encryptionOptions;isNew=this.#n.isNew;showPassword=d(!1);copiedPassword=d(!1);showCopyPassword=d(!1);noneOptionKey=de.Key;encryptionEffect=ie(()=>{this.encryptionFieldSignal()===de.Key&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=I(()=>{let t=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=I(()=>{let e=this.generalFormSignal()?.password??"";return this.#i.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#n.exit(!0)}async copyPassword(){let t=this.generalForm.controls.password.value;await this.#o(t??""),this.copiedPassword.set(!0)}async#o(t){try{await navigator.clipboard.writeText(t)}catch{try{let n=document.createElement("textarea");n.value=t,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}catch(n){console.error("Failed to copy text: ",n)}}}generatePassword(){this.copiedPassword.set(!1);let t=this.#i.generate(16);this.generalForm.controls.password.setValue(t),this.generalForm.controls.repeatPassword.setValue(t),this.showCopyPassword.set(!0)}next(){this.#n.isNew()||this.#n.submit(!0),this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=z({type:s,selectors:[["app-general"]],viewQuery:function(e,n){e&1&&Ce(n.formRef,yt,5),e&2&&me()},decls:21,vars:4,consts:()=>{let t;t=$localize`Your backup name`;let e;e=$localize`Your backup description`;let n;n=$localize`Remember to copy the password`;let i;i=$localize`General backup settings`;let o;o=$localize` Backup name ${"\uFFFD#8\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#8\uFFFD"}:CLOSE_SUPERSCRIPT:`;let r;r=$localize`Backup description`;let F;F=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SPK_ICON: Exit `;let A;A=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: Encrypted backup `;let S;S=$localize`Encryption`;let O;O=$localize`Encryption`;let P;P=$localize`Password`;let L;L=$localize`Repeat password`;let K;K=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let b;b=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,b=Ge(b);let X;X=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Generate password `;let D;D=$localize`Passwords do not match`;let ee;ee=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SPK_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,ee=Ge(ee);let _e;_e=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let ue;ue=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let ce;return ce=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],i,o,r,F,A,O,K,b,X,D,ee,_e,ue,ce,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],[1,"primary"],["for","backupName"],["type","text","tabindex","1","placeholder",t,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","spk-button","",3,"click"],["spk-button","","type","submit",1,"raised","primary",3,"disabled"],["spk-button","","type","submit","spkTooltip",n,1,"raised","primary",3,"disabled"],["icon",""],["value","Key","label","DisplayName",3,"options","isClearable"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",S,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",P,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",L,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["spk-button","","type","button",1,"small",3,"click"],["spk-button","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["spk-button","","type","button",1,"small","copy",3,"click"],[1,"spk-success"]]},template:function(e,n){if(e&1){let i=x();l(0,"form",15,0),E("submit",function(){return c(i),p(n.next())}),l(2,"h3",16),f(3,1),a(),y(4,Rt,3,0,"spk-alert",17),l(5,"spk-form-field")(6,"label",18),C(7,2),g(8,"sup"),m(),a(),g(9,"input",19),a(),l(10,"spk-form-field")(11,"label",20),f(12,3),a(),g(13,"textarea",21),a(),y(14,Bt,6,3),l(15,"div",22)(16,"button",23),E("click",function(){return c(i),p(n.exit())}),C(17,4),g(18,"spk-icon"),m(),a(),y(19,vt,3,1,"button",24)(20,Vt,3,1,"button",25),a()()}if(e&2){let i;T("formGroup",n.generalForm),_(4),R(!n.isNew()&&((i=n.generalFormSignal())==null?null:i.encryption)!==""?4:-1),_(10),R(n.isNew()?14:-1),_(5),R(n.encryptionFieldSignal()===n.noneOptionKey||!n.isNew()?19:20)}},dependencies:[Re,Pe,Q,Z,he,De,Me,q,Y,se,j,tt,Je,nt],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%] spk-icon.spk-success[_ngcontent-%COMP%]{color:var(--success-8)}"],changeDetection:0})};export{gt as a,de as b,je as c,te as d,Xe as e,pt as f,He as g,J as h};
@@ -0,0 +1 @@
1
+ import{a as ke,c as $e,d as L}from"./chunk-B26UYXA3.js";import{b as Re}from"./chunk-LDIZ5E5Z.js";import{a as ue}from"./chunk-ULLALJQ2.js";import"./chunk-J6BHRR34.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import{b as Pe,c as Te,d as g,e as Ce,f as Ee,j as me,o as Se,q as ge,r as fe,t as Oe}from"./chunk-NSIELNIY.js";import"./chunk-7QJG4IIT.js";import"./chunk-3ZVSHKLD.js";import{b as te,d as ne,e as ie}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{A as ce,C as Fe,a as re,b as se,f as ae,g as le,l as _e,p as pe}from"./chunk-Y5IRBMLB.js";import{c as oe,h as de}from"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import{Ab as _,Eb as M,H as I,Hc as N,Ic as B,Kb as p,Lb as c,Mb as m,Nb as h,Ob as y,P as J,Pb as X,Qa as s,Qb as S,Rb as u,Z as T,ab as W,bc as R,da as A,ea as x,ec as D,fc as Y,hc as Z,na as C,sb as F,sc as ee,tb as d,xb as E,yb as a,zb as r}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";var we=()=>["/"];function Ae(t,o){t&1&&(a(0,"spk-toggle",23),p(1,5),_(2,"input",26),c(),r())}function xe(t,o){t&1&&(a(0,"span",29),m(1,9),r())}function De(t,o){if(t&1&&(a(0,"span",29),m(1,10),r()),t&2){let e=u(2);s(),h(e.exportForm.controls.password.errors==null?null:e.exportForm.controls.password.errors.minlength.requiredLength),y(1)}}function Ne(t,o){if(t&1&&_(0,"spk-progress-bar",36),t&2){let e=u(2);R("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),E("value",e.calculatePasswordStrength()*(100/5))}}function Ie(t,o){t&1&&(a(0,"span",29),m(1,11),r())}function Me(t,o){t&1&&(a(0,"span",29),m(1,12),r())}function he(t,o){if(t&1&&(a(0,"span",29),m(1,13),r()),t&2){let e=u(2);s(),h(e.exportForm.controls.repeatPassword.errors==null?null:e.exportForm.controls.repeatPassword.errors.minlength.requiredLength),y(1)}}function ye(t,o){t&1&&(p(0,7,1),_(1,"spk-icon"),c())}function Xe(t,o){t&1&&(p(0,7,2),_(1,"spk-icon"),c())}function Be(t,o){t&1&&(p(0,14,1),_(1,"spk-icon",38),c())}function Le(t,o){t&1&&(p(0,14,2),_(1,"spk-icon"),c())}function be(t,o){if(t&1){let e=M();a(0,"button",37),S("click",function(){A(e);let i=u(2);return x(i.copyPassword())}),p(1,14),F(2,Be,2,0)(3,Le,2,0),c(),r()}if(t&2){let e=u(2);s(2),d(e.copiedPassword()?2:3)}}function ve(t,o){t&1&&(a(0,"spk-alert",35),m(1,15),r())}function Ge(t,o){if(t&1){let e=M();a(0,"div",24)(1,"spk-form-field")(2,"label",27),p(3,6),_(4,"sup"),c(),r(),_(5,"input",28),F(6,xe,2,0,"span",29)(7,De,2,1,"span",29),r(),F(8,Ne,1,9,"spk-progress-bar",30),a(9,"spk-form-field"),_(10,"input",31),F(11,Ie,2,0,"span",29)(12,Me,2,0,"span",29)(13,he,2,1,"span",29),r(),a(14,"div",32)(15,"button",33),S("click",function(){A(e);let i=u();return x(i.showPassword.set(!i.showPassword()))}),p(16,7),F(17,ye,2,0)(18,Xe,2,0),c(),r(),a(19,"button",33),S("click",function(){A(e);let i=u();return x(i.generatePassword())}),p(20,8),_(21,"spk-icon"),c(),r(),F(22,be,4,1,"button",34),r(),F(23,ve,2,0,"spk-alert",35),r()}if(t&2){let e=u();s(5),E("type",e.showPassword()?"text":"password"),s(),d(e.exportForm.controls.password.errors!=null&&e.exportForm.controls.password.errors.required?6:e.exportForm.controls.password.errors!=null&&e.exportForm.controls.password.errors.minlength?7:-1),s(2),d(e.exportForm.value.password?8:-1),s(2),E("type",e.showPassword()?"text":"password"),s(),d(e.exportForm.value.repeatPassword&&e.exportForm.value.repeatPassword!==e.exportForm.value.password?11:e.exportForm.controls.repeatPassword.errors!=null&&e.exportForm.controls.repeatPassword.errors.required?12:e.exportForm.controls.repeatPassword.errors!=null&&e.exportForm.controls.repeatPassword.errors.minlength?13:-1),s(6),d(e.showPassword()?17:18),s(5),d(e.showCopyPassword()?22:-1),s(),d(e.exportForm.value.password&&e.exportForm.value.password===e.exportForm.value.repeatPassword?23:-1)}}function Ke(t,o){if(t&1&&(a(0,"div",25)(1,"code"),D(2),r()()),t&2){let e=u();s(2),Y(e.exportedCmd())}}var k=new fe,b=class t{#o=T(ke);#t=T(de);#e=T(te);#n=T(ne);#i=T(oe);#r=T(ue);isExporting=C(!1);exportType=C("file");exportedCmd=C(null);exportForm=k.group({exportPasswords:k.control(!0),encryption:k.control(!1,[g.required,$e()]),password:k.control("",[L("encryption",!0,[g.required,g.minLength(3)])]),repeatPassword:k.control("",[L("encryption",!0,[g.required,g.minLength(3)])])});exportFormSignal=Re(this.exportForm.valueChanges);encryptionFieldSignal=N(()=>(this.exportFormSignal()?.encryption??!1)&&this.exportType()==="file");activeBackup=N(()=>this.#r.backups().find(o=>o.Backup?.ID===this.#e.snapshot.params.id));showPassword=C(!1);copiedPassword=C(!1);showCopyPassword=C(!1);calculatePasswordStrength=N(()=>{let e=this.exportFormSignal()?.password??"";return this.#o.calculatePasswordStrength(e)});showPasswordEffect=B(()=>{this.showPassword()&&this.exportForm.updateValueAndValidity()});disablePasswordForCommandLine=B(()=>{this.exportType()==="cmd"&&this.exportForm.controls.encryption.setValue(!1)});submit(){this.isExporting.set(!0),this.exportType()==="file"?this.#t.postApiV1AuthIssuetokenByOperation({operation:"export"}).pipe(J(o=>{let e=i=>{let f=Object.entries(i);return f?"?"+f.filter(([O,P])=>P!=null).map(([O,P])=>`${encodeURIComponent(O)}=${encodeURIComponent(P)}`).join("&"):""},n=this.exportFormSignal()?.password?.length?this.exportFormSignal()?.password:void 0;return this.#i.get(`/api/v1/backup/${this.#e.snapshot.params.id}/export${e({"export-passwords":this.exportFormSignal()?.exportPasswords??void 0,passphrase:n,token:o.Token})}`,{responseType:"blob"})}),I(()=>this.isExporting.set(!1))).subscribe({next:o=>{let n=this.activeBackup()?.Backup?.Name??"Backup",i=this.exportFormSignal()?.encryption?"aes":"json";this.downloadFile(o,`${n}-duplicati-config.${i}`),this.#n.navigate(["/"])},error:o=>{}}):this.#t.getApiV1BackupByIdExportCmdline({id:this.#e.snapshot.params.id,exportPasswords:this.exportFormSignal()?.exportPasswords??void 0,passphrase:this.exportFormSignal()?.password??void 0}).pipe(I(()=>this.isExporting.set(!1))).subscribe({next:o=>{this.exportedCmd.set(o.Command??null)},error:o=>{}})}downloadFile(o,e){let n=window.URL.createObjectURL(o),i=document.createElement("a");i.href=n,i.download=e,i.click(),window.URL.revokeObjectURL(n)}async copyPassword(){let o=this.exportForm.controls.password.value;await this.#s(o??""),this.copiedPassword.set(!0)}async#s(o){try{await navigator.clipboard.writeText(o)}catch{try{let n=document.createElement("textarea");n.value=o,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}catch(n){console.error("Failed to copy text: ",n)}}}generatePassword(){this.copiedPassword.set(!1);let o=this.#o.generate(16);this.exportForm.controls.password.setValue(o),this.exportForm.controls.repeatPassword.setValue(o),this.showCopyPassword.set(!0)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=W({type:t,selectors:[["app-export"]],decls:26,vars:15,consts:()=>{let o;o=$localize`Remember to copy the password`;let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SPK_ICON: Back `;let n;n=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:export${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON: Export `;let i;i=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SPK_ICON:terminal-window${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SPK_ICON: As command line `;let f;f=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SPK_ICON:file${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SPK_ICON: To file `;let O;O=$localize` Export passwords ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let P;P=$localize` Encrypt file ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let v;v=$localize`Password`;let G;G=$localize`Repeat password`;let K;K=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let $;$=$localize`${"\uFFFD*17:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: hide ${"\uFFFD/*17:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*18:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: show ${"\uFFFD/*18:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,$=X($);let U;U=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SPK_ICON:password${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SPK_ICON: Generate password `;let z;z=$localize`Passwords are required`;let V;V=$localize` Passwords must be at least ${"\uFFFD0\uFFFD"}:INTERPOLATION: characters long `;let q;q=$localize`Passwords do not match`;let j;j=$localize`Passwords are required`;let H;H=$localize` Passwords must be at least ${"\uFFFD0\uFFFD"}:INTERPOLATION: characters long `;let w;w=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SPK_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,w=X(w);let Q;return Q=$localize` Tip: Be sure to save your password. If you lose it, you will not be able to import the configuration. `,[e,n,i,f,O,P,K,$,U,z,V,q,j,H,w,Q,[1,"actions"],["spk-button","",1,"outlined",3,"routerLink"],["spk-button","","spkTooltip",o,1,"raised","primary",3,"click","disabled"],["autocomplete","off",3,"formGroup"],["type","button",3,"click"],[1,"raised","primary"],["type","checkbox","formControlName","exportPasswords"],[1,"primary","raised"],[1,"passwords"],[1,"cmd-output"],["type","checkbox","formControlName","encryption"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",v,"formControlName","password",3,"type"],["error",""],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",G,"formControlName","repeatPassword",3,"type"],[1,"password-actions"],["spk-button","","type","button",1,"small",3,"click"],["spk-button","","type","button",1,"small","copy"],[1,"primary"],[1,"raised",3,"value"],["spk-button","","type","button",1,"small","copy",3,"click"],[1,"spk-success"]]},template:function(e,n){if(e&1&&(a(0,"header")(1,"h3"),D(2," Export backup configuration "),a(3,"div",16)(4,"button",17),p(5,0),_(6,"spk-icon"),c(),r(),a(7,"button",18),S("click",function(){return n.submit()}),p(8,1),_(9,"spk-icon"),c(),r()()(),a(10,"p"),D(11),r()(),a(12,"form",19)(13,"spk-button-group")(14,"button",20),S("click",function(){return n.exportType.set("cmd")}),p(15,2),_(16,"spk-icon"),c(),r(),a(17,"button",20),S("click",function(){return n.exportType.set("file")}),p(18,3),_(19,"spk-icon"),c(),r()(),a(20,"spk-toggle",21),p(21,4),_(22,"input",22),c(),r(),F(23,Ae,3,0,"spk-toggle",23),F(24,Ge,24,8,"div",24),F(25,Ke,3,1,"div",25),r()),e&2){let i;s(4),E("routerLink",ee(14,we)),s(3),R("loading",n.isExporting()),E("disabled",n.exportForm.invalid||n.showCopyPassword()&&!n.copiedPassword()||n.encryptionFieldSignal()&&n.exportForm.value.repeatPassword!==n.exportForm.value.password),s(4),Z("#",(i=n.activeBackup())==null||i.Backup==null?null:i.Backup.ID,": ",(i=n.activeBackup())==null||i.Backup==null?null:i.Backup.Name),s(),E("formGroup",n.exportForm),s(2),R("active",n.exportType()==="cmd"),s(3),R("active",n.exportType()==="file"),s(6),d(n.exportType()==="file"?23:-1),s(),d(n.encryptionFieldSignal()?24:-1),s(),d(n.exportedCmd()?25:-1)}},dependencies:[Oe,me,Te,Pe,Ce,Ee,Se,ge,ie,ae,ce,re,_e,le,se,pe,Fe],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:3rem}h3[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;justify-content:space-between}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;max-width:31.25rem}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.copy[_ngcontent-%COMP%] spk-icon.spk-success[_ngcontent-%COMP%]{color:var(--success-8)}.hide[_ngcontent-%COMP%]{display:none}"],changeDetection:0})};export{b as default};