@duplicati/ngclient 0.0.221 → 0.0.223

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 (120) hide show
  1. package/{chunk-I5DD3Q6J.js → chunk-22JSUCD3.js} +1 -1
  2. package/{chunk-BMACDVWX.js → chunk-2CKH2RVA.js} +1 -1
  3. package/{chunk-IQL3REGJ.js → chunk-2KD757N6.js} +1 -1
  4. package/{chunk-MTL3FBSM.js → chunk-2VLJLCTO.js} +1 -1
  5. package/{chunk-OPHQNXYO.js → chunk-2YUSBRXY.js} +1 -1
  6. package/{chunk-OCUE5GMT.js → chunk-35ZRBDWM.js} +1 -1
  7. package/{chunk-JP2Z2HMH.js → chunk-3BIHFX4H.js} +1 -1
  8. package/chunk-3D6EL52D.js +1 -0
  9. package/chunk-4IRGFIAU.js +1 -0
  10. package/chunk-4J64RICN.js +1 -0
  11. package/{chunk-DSYNIXJF.js → chunk-5E3B4AEF.js} +1 -1
  12. package/{chunk-ANSV4G2K.js → chunk-5W4BSVZJ.js} +1 -1
  13. package/chunk-6JGOGUIX.js +1 -0
  14. package/chunk-6RIKNAXD.js +1 -0
  15. package/{chunk-WJBMMY2Y.js → chunk-6V4CDRLK.js} +1 -1
  16. package/{chunk-OLWLWDXZ.js → chunk-7AXKIK5Z.js} +1 -1
  17. package/{chunk-CZVTBPNE.js → chunk-7SP45FHP.js} +1 -1
  18. package/{chunk-E4NQOMJX.js → chunk-AFHEXZUZ.js} +1 -1
  19. package/{chunk-F3JYPWPK.js → chunk-AXG7WHBS.js} +1 -1
  20. package/{chunk-736PM4LG.js → chunk-AXLO5KWF.js} +1 -1
  21. package/{chunk-EKVZKEQJ.js → chunk-B4QFOJXL.js} +1 -1
  22. package/{chunk-TCXCC5BM.js → chunk-BPHX6VXP.js} +1 -1
  23. package/{chunk-DE4JIJWO.js → chunk-CEDH3C4K.js} +1 -1
  24. package/{chunk-VKQQDCUN.js → chunk-CJKZ27FM.js} +1 -1
  25. package/{chunk-YCJYEQF7.js → chunk-COEGVUM3.js} +1 -1
  26. package/chunk-CQJRBQ6I.js +1 -0
  27. package/{chunk-YMFI2Q2X.js → chunk-CUYURNCQ.js} +1 -1
  28. package/{chunk-ELCA5MKF.js → chunk-CWBB6FON.js} +1 -1
  29. package/{chunk-FR5RTIOE.js → chunk-DT3A5ZZG.js} +1 -1
  30. package/{chunk-ACTJSKQZ.js → chunk-EAVDZEBJ.js} +1 -1
  31. package/{chunk-FD5CKX3J.js → chunk-F5RBSCC2.js} +1 -1
  32. package/{chunk-JSZIISFS.js → chunk-FNWC6U3F.js} +1 -1
  33. package/{chunk-QDDVZ4CR.js → chunk-FQINMZH2.js} +1 -1
  34. package/chunk-FXBX5QMR.js +1 -0
  35. package/{chunk-23SRH7FI.js → chunk-GA3CAVSK.js} +1 -1
  36. package/chunk-GBSP3YAH.js +2 -0
  37. package/{chunk-GW34KK5A.js → chunk-GBUTPGY5.js} +1 -1
  38. package/{chunk-JPCUISZG.js → chunk-GNKCBZMS.js} +1 -1
  39. package/{chunk-N2AU7VKX.js → chunk-HDDAGHHE.js} +1 -1
  40. package/{chunk-RDLRXAJU.js → chunk-HDGXP6C6.js} +1 -1
  41. package/chunk-HLHUPBCV.js +1 -0
  42. package/chunk-HPXIWKIK.js +1 -0
  43. package/chunk-HWOUAWOE.js +1 -0
  44. package/{chunk-TVFRVP7K.js → chunk-JB26UVQP.js} +1 -1
  45. package/chunk-JLANSXSK.js +1 -0
  46. package/chunk-JYRKUYG6.js +1 -0
  47. package/chunk-K5XGRFWJ.js +4 -0
  48. package/{chunk-77IXQ4GU.js → chunk-KI2HT2TI.js} +1 -1
  49. package/{chunk-N2GI5QYJ.js → chunk-LNKXSLIG.js} +1 -1
  50. package/chunk-MJPEKJ3T.js +2 -0
  51. package/{chunk-RGFJ5UMA.js → chunk-N3TVNDVH.js} +1 -1
  52. package/chunk-NDOIWI7D.js +1 -0
  53. package/chunk-NFATJ2CP.js +1 -0
  54. package/{chunk-PPSQGUOL.js → chunk-O5RZGVMD.js} +1 -1
  55. package/chunk-OETM3ZQK.js +1 -0
  56. package/chunk-OQGMZ5Z4.js +1 -0
  57. package/{chunk-TISQKN7N.js → chunk-PDGW22XJ.js} +1 -1
  58. package/{chunk-IMQUTGIK.js → chunk-PEOYNJJM.js} +1 -1
  59. package/{chunk-CAQ3XMFP.js → chunk-PNQ5BDQN.js} +1 -1
  60. package/chunk-PVSB5UU6.js +1 -0
  61. package/{chunk-AXQQEOTT.js → chunk-QGAOYLQU.js} +1 -1
  62. package/{chunk-APSPCDGV.js → chunk-QLW7KAXY.js} +1 -1
  63. package/chunk-QZEIAQ3M.js +1 -0
  64. package/chunk-R6FKSUPU.js +1 -0
  65. package/{chunk-FBU3EBFO.js → chunk-RDT3GMNM.js} +1 -1
  66. package/{chunk-UTXZPAY6.js → chunk-RM2KGG7J.js} +1 -1
  67. package/chunk-RTGUYIWH.js +11 -0
  68. package/{chunk-PIGMTUUT.js → chunk-SKLSR5GH.js} +1 -1
  69. package/{chunk-JPMKWWZP.js → chunk-SL34UKL5.js} +1 -1
  70. package/{chunk-FDYBIC4O.js → chunk-SZLRIYOM.js} +1 -1
  71. package/chunk-TI76HSL2.js +1 -0
  72. package/{chunk-5KJPC3V5.js → chunk-TOV6NJCD.js} +1 -1
  73. package/chunk-TPKKLIFK.js +1 -0
  74. package/{chunk-IG7XUEED.js → chunk-UOMUNAOT.js} +1 -1
  75. package/{chunk-LE24LKH7.js → chunk-UXIWNORE.js} +1 -1
  76. package/{chunk-KZTFESBJ.js → chunk-V2M5YF4E.js} +1 -1
  77. package/{chunk-O2SMJYPC.js → chunk-V2UO7ES2.js} +1 -1
  78. package/{chunk-6JS7B4FW.js → chunk-VNXFTYQQ.js} +1 -1
  79. package/{chunk-4E7D5F6K.js → chunk-WJVFREPL.js} +1 -1
  80. package/{chunk-XBAZKJ47.js → chunk-WKQ3ICDB.js} +1 -1
  81. package/{chunk-OJVUCHRP.js → chunk-WULWYGYR.js} +1 -1
  82. package/chunk-X5W2K6AN.js +2 -0
  83. package/{chunk-GKGMP6VF.js → chunk-XWML36YQ.js} +1 -1
  84. package/{chunk-BKEJZADV.js → chunk-XXXS73XL.js} +1 -1
  85. package/{chunk-ZC23RK4J.js → chunk-YF6JHIN5.js} +1 -1
  86. package/{chunk-3L3SRTPU.js → chunk-YFA6MJ2B.js} +1 -1
  87. package/{chunk-IRT2UBDI.js → chunk-YKF5ZW55.js} +1 -1
  88. package/{chunk-F2ZC26DC.js → chunk-ZKIZ7IIA.js} +1 -1
  89. package/{chunk-BLSV7CNZ.js → chunk-ZTENLO77.js} +1 -1
  90. package/{chunk-6NVCDJR6.js → chunk-ZYYLNYSK.js} +1 -1
  91. package/index.html +1 -1
  92. package/main-NENDDABN.js +1 -0
  93. package/package.json +1 -1
  94. package/chunk-43WATFQS.js +0 -11
  95. package/chunk-4J6L5OV3.js +0 -1
  96. package/chunk-5JGSXUKD.js +0 -1
  97. package/chunk-5YE4H57F.js +0 -1
  98. package/chunk-5ZRRLJA4.js +0 -1
  99. package/chunk-ACTATISC.js +0 -1
  100. package/chunk-COI6UMB5.js +0 -1
  101. package/chunk-DHFLXFWF.js +0 -1
  102. package/chunk-ESLC5LVP.js +0 -1
  103. package/chunk-F3ETZKLK.js +0 -1
  104. package/chunk-G2BDKU26.js +0 -2
  105. package/chunk-NPFPMA4P.js +0 -1
  106. package/chunk-O56QUSSI.js +0 -2
  107. package/chunk-OL7ADIFI.js +0 -1
  108. package/chunk-QQWV3FEH.js +0 -1
  109. package/chunk-SACQFUJE.js +0 -1
  110. package/chunk-TQTOIWBK.js +0 -4
  111. package/chunk-TWAHUXIN.js +0 -1
  112. package/chunk-TZ7MW3NZ.js +0 -2
  113. package/chunk-UZ4POLDC.js +0 -1
  114. package/chunk-XPVATEBM.js +0 -1
  115. package/chunk-XWTB7XRI.js +0 -1
  116. package/chunk-YPNN5FBK.js +0 -1
  117. package/chunk-YWBZLU6M.js +0 -1
  118. package/chunk-YYD2JU6T.js +0 -1
  119. package/chunk-ZNYN6ES6.js +0 -1
  120. package/main-IUT3IXX4.js +0 -1
@@ -1 +1 @@
1
- import{a as tt}from"./chunk-TZ7MW3NZ.js";import{k as Ze,n as et}from"./chunk-43WATFQS.js";import{a as ce}from"./chunk-UZ4POLDC.js";import{a as Qe}from"./chunk-YCJYEQF7.js";import{a as A}from"./chunk-IMQUTGIK.js";import{b as Ee}from"./chunk-IQL3REGJ.js";import{b as Ke}from"./chunk-E4NQOMJX.js";import{a as Z}from"./chunk-YYD2JU6T.js";import{B as Q,H as _e,L as Ue,M as Ye,P as He,V as je,W as qe,b as Ve,c as V,e as J,f as z,i as Je,j as X,l as ze,p as U,q as Y,r as H,s as Xe,t as j,v as q,z as le}from"./chunk-VKQQDCUN.js";import{d as K}from"./chunk-DSYNIXJF.js";import{b,d as $}from"./chunk-NPFPMA4P.js";import{ha as ae}from"./chunk-ZC23RK4J.js";import{$b as E,A as De,Ac as me,Cb as O,D as oe,Db as r,Eb as a,F as P,Fb as d,Fc as Se,Gc as We,Hc as Be,I as be,Jb as G,Kb as k,L as $e,M as ne,Mb as D,Qc as h,Sa as c,Tb as m,Ub as S,V as Ae,Vb as F,Wb as de,Xb as pe,Zb as N,_ as p,da as I,ea as M,g as Me,gb as B,kc as xe,lb as ve,m as Le,nc as y,pa as _,pc as Ge,qc as ke,ra as W,sc as ie,tc as se,uc as re,w as ue,wb as T,x as ye,xb as g,zc as we}from"./chunk-TQTOIWBK.js";function _t(i,t){i&1&&(r(0,"p"),F(1,3),a())}function ct(i,t){i&1&&(r(0,"sh-form-field")(1,"label",11),F(2,4),a(),d(3,"input",12),a())}var ot=new H,st=()=>ot.group({passphrase:ot.control("")}),Te=class i{#e=p(K);#t=p(v);#i=p($);#n=p(b);encryptionForm=this.#t.encryptionForm;creatingTemporaryBackup=_(!1);settings=_([]);hasEncryptedBackup=h(()=>{let t=this.#t.destinationTestSignal();return t==="testing"||typeof t=="string"?!0:t?.containsEncryptedBackupFiles??!0});showEncryptionField=_(!1);next(){let t=this.#t.destinationTargetUrl();if(!t)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,o=[];e?o.push({Name:"--passphrase",Value:e}):o.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(n=>{let s=n.Name?.trim();s&&s!=="--"&&(s.startsWith("--")||(s=`--${s}`),o.push({Name:s,Value:n.Value??""}))}),this.#e.postApiV1Backups({requestBody:{Backup:{TargetURL:t,Settings:o}},temporary:!0}).pipe(P(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:n=>{let s=n.ID;this.#i.navigate([`/restore-draft/${s}`])},error:n=>{console.error(n)}})}back(){this.#t.isFileRestore()?this.#i.navigate(["destination"],{relativeTo:this.#n.parent}):this.#t.exit()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,selectors:[["app-restore-encryption"]],decls:14,vars:5,consts:()=>{let t;t=$localize`Advanced options`;let e;e=$localize`${"\uFFFD#10\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let o;o=$localize`${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let n;n=$localize`The backup does not contain encrypted files.`;let s;s=$localize`Enter backup passphrase if defined.`;let l;return l=$localize`Password`,[t,e,o,n,l,[3,"submit","formGroup"],["title",""],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["for","password"],["type","password","id","password","autocomplete","disabled","placeholder",s,"formControlName","passphrase"]]},template:function(e,o){e&1&&(r(0,"form",5),N("submit",function(){return o.next()}),T(1,_t,2,0,"p"),T(2,ct,4,0,"sh-form-field"),r(3,"sh-toggle-card"),G(4,6),F(5,0),k(),r(6,"app-options-list",7),re("optionsChange",function(s){return se(o.settings,s)||(o.settings=s),s}),a()(),r(7,"div",8)(8,"button",9),N("click",function(){return o.back()}),m(9,1),d(10,"sh-icon"),S(),a(),r(11,"button",10),m(12,2),d(13,"sh-icon"),S(),a()()()),e&2&&(O("formGroup",o.encryptionForm),c(),g(o.hasEncryptedBackup()?-1:1),c(),g(o.hasEncryptedBackup()||o.showEncryptionField()?2:-1),c(4),ie("options",o.settings),O("hasFreeTextSettings",!0))},dependencies:[j,X,V,J,z,Y,U,_e,q,Q,je,tt],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var rt=()=>({standalone:!0});function ut(i,t){i&1&&d(0,"sh-progress-bar",13)}function dt(i,t){if(i&1&&(y(0),Se(1,"bytes")),i&2){let e=E().$implicit;Ge(" (",We(1,1,e.FileSizes),") ")}}function pt(i,t){i&1&&(r(0,"span",20),F(1,4),a())}function mt(i,t){if(i&1&&(r(0,"div",19),y(1),Se(2,"date"),T(3,dt,2,3),T(4,pt,2,0,"span",20),a()),i&2){let e=t.$implicit;c(),ke(" ",e.Version,": ",Be(2,4,e.Time,"medium")," "),c(2),g(e.FileSizes?3:-1),c(),g(e.IsFullBackup===!1?4:-1)}}function St(i,t){i&1&&d(0,"sh-progress-bar",13)}function Et(i,t){i&1&&(r(0,"sh-icon",28),y(1,"spinner"),a())}function Tt(i,t){i&1&&(r(0,"sh-icon"),y(1,"magnifying-glass"),a())}function gt(i,t){if(i&1){let e=D();r(0,"button",31),N("click",function(){I(e);let n=E(4);return M(n.clearSearch())}),r(1,"sh-icon"),y(2,"x-circle"),a(),r(3,"span"),F(4,8),a()()}}function Ft(i,t){i&1&&(r(0,"span"),F(1,9),a())}function Ct(i,t){if(i&1&&(r(0,"span"),F(1,10),a()),i&2){let e=E(5);c(),de(e.searchResults().length),pe(1)}}function Ot(i,t){if(i&1&&(r(0,"div",30),T(1,Ft,2,0,"span")(2,Ct,2,1,"span"),a()),i&2){let e=E(4);c(),g(e.searchResults().length===0?1:2)}}function Nt(i,t){if(i&1){let e=D();r(0,"div",24)(1,"sh-form-field")(2,"label",25),F(3,6),a(),r(4,"input",26),re("ngModelChange",function(n){I(e);let s=E(3);return se(s.searchQuery,n)||(s.searchQuery=n),M(n)}),N("keydown.enter",function(n){I(e);let s=E(3);return n.preventDefault(),M(s.performSearch())}),a()(),r(5,"button",27),N("click",function(){I(e);let n=E(3);return M(n.performSearch())}),T(6,Et,2,0,"sh-icon",28)(7,Tt,2,0,"sh-icon"),r(8,"span"),F(9,7),a()(),T(10,gt,5,0,"button",29),a(),T(11,Ot,3,1,"div",30)}if(i&2){let e=E(3);c(4),ie("ngModel",e.searchQuery),O("ngModelOptions",me(6,rt)),c(),O("disabled",e.isSearching()||!e.searchQuery().trim()),c(),g(e.isSearching()?6:7),c(4),g(e.isSearchMode()?10:-1),c(),g(e.isSearchMode()&&!e.isSearching()?11:-1)}}function ht(i,t){if(i&1){let e=D();T(0,Nt,12,7),r(1,"app-file-tree",21),N("hasExtendedData",function(n){I(e);let s=E(2);return M(s.extendedDataType.set(n))}),r(2,"label",22),F(3,5),a(),d(4,"input",23),a()}if(i&2){let e=E(2);g(e.canSearch()?0:-1),c(),O("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)("loadExtendedData",!0)("searchMode",e.isSearchMode())("searchResults",e.searchResults())}}function ft(i,t){if(i&1){let e=D();r(0,"sh-select",17),N("cleared",function(){I(e);let n=E();return M(n.abortLoading())}),r(1,"input",18),re("ngModelChange",function(n){I(e);let s=E();return se(s.selectOption,n)||(s.selectOption=n),M(n)}),a(),ve(2,mt,5,7,"ng-template"),a(),T(3,St,1,0,"sh-progress-bar",13),T(4,ht,5,9)}if(i&2){let e=E();O("options",e.versionOptions())("isClearable",!1),c(),ie("ngModel",e.selectOption),O("ngModelOptions",me(6,rt)),c(2),g(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),c(),g(e.showFileTree()?4:-1)}}var Fe=new H,at=()=>Fe.group({filesToRestore:Fe.control(""),passphrase:Fe.control(null)}),Ce=class i{#e=p(K);#t=p(v);#i=p(Ke);#n=p(Z);#o=p($);#s=p(b);#a=p(ae);#l=null;#_=null;#r=_([]);selectFilesForm=this.#t.selectFilesForm;selectFilesFormSignal=this.#t.selectFilesFormSignal;selectOption=this.#t.selectOption;backupId=this.#t.backupId;versionOptionsLoading=this.#t.versionOptionsLoading;versionOptions=this.#t.versionOptions;isFileRestore=this.#t.isFileRestore;extendedDataType=this.#t.extendedDataType;needsDatabaseRepair=h(()=>this.#t.backup()?.Backup?.IsTemporary??!0);showFileTree=_(!1);backupSettings=_(null);rootPaths=_([]);initialNodes=_([]);loadingRootPath=_(!1);isRepairing=h(()=>this.#r().length>0);loadedVersions=_({});canSearch=h(()=>this.#n.hasV2ListOperations());searchQuery=_("");isSearching=_(!1);searchResults=_([]);hasSearched=_(!1);isSearchMode=h(()=>this.searchQuery().length>0&&this.hasSearched());loadingEffect=W(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let o=e[0].Version;this.selectOption.set(o.toString())}});backupSettingsEffect=W(()=>{let t=this.backupId(),e=this.selectOption(),o=this.isRepairing(),n=this.loadedVersions();if(!e||!t)return;let l=this.versionOptions()?.find(x=>x.Version===parseInt(e))?.Time??null;if(!l)return;let u=`${t}+${l}`,R=n[u];if(this.needsDatabaseRepair()&&(!R||o))return;let L={id:t+"",time:l};this.backupSettings.set(L),this.getRootPath(L)});repairEffect=W(()=>{if(!this.needsDatabaseRepair())return;let t=this.selectOption(),e=this.versionOptions();if(t){let o=e.find(l=>l.Version===parseInt(t));if(o===void 0)return;let n=this.backupId(),s=`${n}+${o.Time}`;if(this.#_===s||(this.#_=s,this.#r().includes(s)))return;this.#r.update(l=>[...l,s]),this.#e.postApiV1BackupByIdRepairupdate({id:n,requestBody:{only_paths:!0,time:o.Time}}).pipe(ne(this.abortLoading$),P(()=>{this.#_=null})).subscribe(l=>{let u=l.ID;this.#i.waitForTaskToComplete(u).pipe(oe(1)).subscribe(()=>{this.#r.update(R=>R.filter(L=>L!==s)),this.loadedVersions.update(R=>(R[s]=!0,R))})})}});getRootPath(t){let e={id:t.id+"",time:t.time,prefixOnly:!0,folderContents:!1},o=t.id+"";this.isRepairing()||this.#l===o||(this.#l=o,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#n.hasV2ListOperations()?this.#e.postApiV2BackupListFolder({requestBody:{BackupId:t.id,Time:t.time,Paths:null,PageSize:0,Page:0,ReturnExtended:!0}}).pipe(ne(this.abortLoading$),P(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#l=null})).subscribe({next:n=>{let s=(n.Data??[]).find(u=>u.Metadata&&u.Metadata.ExtType&&u.Metadata.ExtType.length>0);s&&this.extendedDataType.set(s.Metadata.ExtType);let l=(n.Data??[]).map(u=>u.Path??"");l.length>0?(this.initialNodes.set([]),this.rootPaths.set(l)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#e.getApiV1BackupByIdFiles(e).pipe(ne(this.abortLoading$),P(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:n=>{let s=n.Files.map(l=>l.Path??"");s.length>0?(this.initialNodes.set([]),this.rootPaths.set(s)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new Me;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let t=this.versionOptions();return e=>{if(!e)return"";let o=t?.find(n=>typeof n.Version=="number"&&n.Version.toString()===e);return o?`${o.Version}: ${this.#a.transform(o.Time,"medium")}`:""}}next(){this.#o.navigate(["options"],{relativeTo:this.#s.parent})}back(){this.#t.isFileRestore()?this.#o.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#t.exit()}performSearch(){let t=this.searchQuery().trim(),e=this.backupSettings();if(!t||!e)return;let n=this.versionOptions()?.find(s=>s.Version===parseInt(this.selectOption()??""))?.Version;n!=null&&(this.isSearching.set(!0),this.searchResults.set([]),this.hasSearched.set(!0),this.#e.postApiV2BackupSearch({requestBody:{BackupId:e.id,Time:null,Version:[n],Filters:[t],Paths:null,PageSize:1e3,Page:0,ReturnExtended:!0}}).pipe(ne(this.abortLoading$),P(()=>this.isSearching.set(!1))).subscribe({next:s=>{this.searchResults.set(s.Data??[])},error:()=>{this.searchResults.set([])}}))}clearSearch(){this.searchQuery.set(""),this.searchResults.set([]),this.hasSearched.set(!1)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,selectors:[["app-select-files"]],features:[we([ae])],decls:13,vars:3,consts:()=>{let t;t=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let n;n=$localize`Select an option...`;let s;s=$localize`(partial)`;let l;l=$localize`Path`;let u;u=$localize`Enter search term...`;let R;R=$localize`Search files`;let L;L=$localize`Search`;let x;x=$localize`Clear`;let ee;ee=$localize`0 results found`;let te;return te=$localize`Found ${"\uFFFD0\uFFFD"}:INTERPOLATION: result(s)`,[["formRef",""],t,e,o,s,l,R,L,x,ee,te,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",n,3,"ngModelChange","ngModel","ngModelOptions"],[1,"custom-option"],[1,"partial"],[3,"hasExtendedData","rootPaths","initialNodes","backupSettings","multiSelect","showFiles","loadExtendedData","searchMode","searchResults"],["for","path"],["type","text","id","path","formControlName","filesToRestore"],[1,"search-container"],["for","search"],["type","text","id","search","placeholder",u,3,"ngModelChange","keydown.enter","ngModel","ngModelOptions"],["shButton","","type","button",1,"small",3,"click","disabled"],[1,"spinner"],["shButton","","type","button",1,"small","secondary"],[1,"search-results-info"],["shButton","","type","button",1,"small","secondary",3,"click"]]},template:function(e,o){e&1&&(r(0,"form",11,0),N("submit",function(){return o.next()}),r(2,"h3",12),F(3,1),a(),T(4,ut,1,0,"sh-progress-bar",13)(5,ft,5,7),r(6,"div",14)(7,"button",15),N("click",function(){return o.back()}),m(8,2),d(9,"sh-icon"),S(),a(),r(10,"button",16),m(11,3),d(12,"sh-icon"),S(),a()()()),e&2&&(O("formGroup",o.selectFilesForm),c(4),g(o.versionOptionsLoading()?4:5),c(5),de(o.isFileRestore()?"Back":"Exit"),pe(8))},dependencies:[Xe,X,V,J,z,Je,j,Y,U,ce,Q,_e,q,He,Ue,ae,Qe],styles:["[_nghost-%COMP%]{display:block;margin-top:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}.search-container[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.search-container[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%]{flex:1}.search-results-info[_ngcontent-%COMP%]{color:var(--base-8);font-size:var(--small)}"],changeDetection:0})};var v=class i{#e=p($);#t=p(b);#i=p(Z);#n=p(le);#o=p(K);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);destinationTestSignal=_(null);selectFilesForm=at();optionsForm=lt();encryptionForm=st();optionsFormSignal=Ee(this.optionsForm.valueChanges);selectFilesFormSignal=Ee(this.selectFilesForm.valueChanges);selectOption=_(null);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isFileRestore=_(!1);isFullWidthPage=_(!1);extendedDataType=_(null);alternateRestorePath=_(null);alternateRestorePathSourcePrefix=_(null);init(t,e=!1){this.backupId.set(t),this.isFileRestore.set(e),this.alternateRestorePath.set(null),this.extendedDataType.set(null),e&&this.#e.navigate(["/restore-from-files/destination"]),e||this.getBackup()}updateTargetUrl(t){this.destinationTargetUrl.set(t)}setAlternateRestorePath(t,e){this.alternateRestorePath.set(t),this.alternateRestorePathSourcePrefix.set(e)}submit(){this.isSubmitting.set(!0);let t=this.backupId();this.backup()?.Backup?.IsTemporary??!1?this.#o.postApiV1BackupByIdCopytotemp({id:this.backupId()??""}).subscribe({next:o=>{this.#s(o.ID??"")},error:o=>this.showErrorDialog($localize`An error occurred while copying the backup to a temporary location: ${o.message}`)}):this.#s(t??"")}showErrorDialog(t){this.#n.open(A,{data:{title:$localize`Error occured`,message:t,confirmText:$localize`OK`,cancelText:void 0},closed:e=>{}})}#s(t){let e=this.optionsForm.value,o=this.selectFilesForm.value,n=this.selectOption(),s=this.versionOptions()?.find(l=>l.Version===(n&&parseInt(n)));this.#o.postApiV1BackupByIdRestore({id:t??"",requestBody:{paths:o.filesToRestore?.split("\0").map(l=>l.endsWith("/")||l.endsWith("\\")?`${l}*`:l)??[],passphrase:o.passphrase??null,time:s?.Time,restore_path:this.alternateRestorePath()??e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata,source_prefix:this.alternateRestorePathSourcePrefix(),connection_string_id:null}}).pipe(P(()=>this.isSubmitting.set(!1))).subscribe({next:l=>{this.#e.navigate([`./${l.ID}`,"progress"],{relativeTo:this.#t})},error:l=>{console.error("restore error",l)}})}exit(){this.#n.open(A,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:t=>{t&&(this.#a(),this.#e.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(t,e=2){return this.#o.postApiV2BackupListFilesets({requestBody:{BackupId:t}}).pipe(De(o=>{let n=o?.error?.body?.StatusCode??o?.error?.requestBody?.StatusCode;return n==="EncryptedStorageNoPassphrase"||n==="FolderMissing"||n==="EmptyRemoteFolder"||e===0?Le(()=>o):ye(1e3).pipe($e(()=>this.loadFilesetsWithRetryv2(t,e-1)))}))}getBackup(){let t=this.backupId();this.versionOptionsLoading.set(!0),this.#i.hasV2ListOperations()?ue([this.#o.getApiV1BackupById({id:t}),this.loadFilesetsWithRetryv2(t)]).pipe(oe(1),P(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,o])=>{if(o.Error)throw new Error(o.Error);if(!(e.Backup?.IsTemporary??!0)&&e?.Backup?.DBPathExists===!1){this.#n.open(A,{data:{title:$localize`Missing Local Database`,message:$localize`The local database for this backup is missing. Please repair or recreate the local database before restoring.`,confirmText:$localize`OK`,cancelText:void 0},closed:s=>{this.#e.navigate(["/backup",t,"database"])}});return}this.versionOptions.set((o.Data??[]).map(s=>({Version:s.Version??-1,IsFullBackup:s.IsFullBackup??void 0,Time:s.Time??"<missing>",FileCount:s.FileCount??void 0,FileSizes:s.FileSizes??void 0}))),this.backup.set(e)},error:e=>{let o=e?.error?.body?.StatusCode??e?.error?.requestBody?.StatusCode,n=o==="EncryptedStorageNoPassphrase",s=o==="FolderMissing",l=o==="EmptyRemoteFolder",u=$localize`An error occurred while loading the backup filesets: ${e.message}`;n&&(u=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),s&&(u=$localize`The backup storage folder was not found.`),l&&(u=$localize`The backup storage folder does not contain any filesets.`),this.#n.open(A,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:R=>{this.#e.navigate([n?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):ue([this.#o.getApiV1BackupById({id:t}),this.#o.getApiV1BackupByIdFilesets({id:t}).pipe(be(3))]).pipe(oe(1),P(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,o])=>{this.versionOptions.set(o.map(n=>({Version:n.Version??-1,IsFullBackup:(n.IsFullBackup??1)==1,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(e)}})}#a(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=Ae({token:i,factory:i.\u0275fac,providedIn:"root"})};function Rt(i,t){if(i&1){let e=D();r(0,"sh-radio",27),m(1,6),d(2,"input",31),S(),a(),r(3,"sh-radio",27),m(4,7),r(5,"input",32),N("click",function(){I(e);let n=E(2);return M(n.chooseCustomRemoteDestination())}),a(),S(),a()}}function Pt(i,t){if(i&1){let e=D();r(0,"sh-radio",27),m(1,8),d(2,"input",31),S(),a(),r(3,"sh-radio",27),m(4,9),r(5,"input",32),N("click",function(){I(e);let n=E(2);return M(n.chooseCustomRemoteDestination())}),a(),S(),a()}}function It(i,t){if(i&1&&(r(0,"app-file-tree",29)(1,"label",33),y(2,"Path"),a(),d(3,"input",34),a()),i&2){let e,o=E(2);O("disabled",((e=o.optionsFormSignal())==null?null:e.restoreFrom)!=="pickLocation")("enableCreateFolder",!0)}}function Mt(i,t){if(i&1&&(r(0,"app-file-tree",30)(1,"label",33),y(2,"Path"),a(),d(3,"input",34),a()),i&2){let e=E(2);O("customRemoteMode",e.extendedDataType())("backupId",e.backupId())("sourcePrefix",e.remoteCustomSourcePrefix())("destinationUrl",e.customDestinationUrl())}}function Lt(i,t){if(i&1&&(T(0,Rt,6,0)(1,Pt,6,0),r(2,"sh-radio",27),m(3,5),d(4,"input",28),S(),a(),T(5,It,4,2,"app-file-tree",29),T(6,Mt,4,4,"app-file-tree",30)),i&2){let e,o=E();g(o.extendedDataType()==="o365"?0:o.extendedDataType()==="gsuite"?1:-1),c(5),g(((e=o.optionsFormSignal())==null?null:e.restoreFrom)==="pickLocation"?5:-1),c(),g(o.showCustomRemoteRestoreTree()?6:-1)}}function yt(i,t){if(i&1&&(r(0,"sh-radio",27),m(1,10),d(2,"input",35),S(),a(),r(3,"sh-radio",27),m(4,11),d(5,"input",28),S(),a(),r(6,"app-file-tree",29)(7,"label",33),y(8,"Path"),a(),d(9,"input",34),a()),i&2){let e,o=E();c(6),O("disabled",((e=o.optionsFormSignal())==null?null:e.restoreFrom)!=="pickLocation")("enableCreateFolder",!0)}}function Dt(i,t){i&1&&(r(0,"app-toggle-card",22),G(1,23),F(2,12),k(),r(3,"sh-toggle",27),m(4,13),d(5,"input",36),S(),a()()),i&2&&O("disableToggle",!0)}function bt(i,t){i&1&&(r(0,"app-toggle-card",22),G(1,23),F(2,14),k(),r(3,"sh-radio",27),m(4,15),d(5,"input",37),S(),a(),r(6,"sh-radio",27),m(7,16),d(8,"input",38),S(),a()(),r(9,"app-toggle-card"),G(10,23),F(11,17),k(),r(12,"sh-toggle",39),m(13,18),d(14,"input",40),S(),a(),r(15,"sh-toggle",39),m(16,19),d(17,"input",41),S(),a()()),i&2&&O("disableToggle",!0)}var w=new H,lt=()=>w.group({restoreFrom:w.control("original"),restoreFromPath:w.control(""),handleExisting:w.control("saveTimestamp"),permissions:w.control(!1),includeMetadata:w.control(!0),customRemoteIgnoreExisting:w.control(!1)}),Oe=class i{#e=p(v);#t=p($);#i=p(b);#n=p(Z);#o=p(le);optionsForm=this.#e.optionsForm;optionsFormSignal=this.#e.optionsFormSignal;isSubmitting=this.#e.isSubmitting;extendedData=this.#e.extendedDataType;remoteCustomTargetUrl=_(null);backupId=h(()=>this.#e.backup()?.Backup?.ID??null);extendedDataType=h(()=>{let t=this.#e.extendedDataType();return t==="o365"?"o365":t==="gsuite"?"gsuite":null});remoteCustomSourceEntry=h(()=>this.#e.backup()?.Backup?.Sources?.filter(t=>t.startsWith("@")&&(t.includes("|office365://")||t.includes("|googleworkspace://")))[0]??null);remoteCustomSourceUrl=h(()=>this.remoteCustomSourceEntry()?.split("|")[1]??null);remoteCustomSourcePrefix=h(()=>this.remoteCustomSourceEntry()?.split("|")[0]??null);customDestinationUrl=h(()=>{let t=this.optionsFormSignal()?.restoreFrom,e=this.extendedDataType()!==null;return t==="same-custom"&&e?this.remoteCustomSourceUrl():t==="other-custom"&&e?this.remoteCustomTargetUrl():null});showCustomRemoteRestoreTree=h(()=>!!(this.optionsFormSignal()?.restoreFrom==="same-custom"&&this.customDestinationUrl()&&this.backupId()||this.optionsFormSignal()?.restoreFrom==="other-custom"&&this.customDestinationUrl()));isCustomRemoteRestore=h(()=>{let t=this.optionsFormSignal()?.restoreFrom;return t==="same-custom"||t==="other-custom"});chooseCustomRemoteDestination(){let t=this.extendedDataType()==="o365"?"office365://":"googleworkspace://";return this.#o.open(et,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{targetUrlModel:this.remoteCustomTargetUrl()||this.remoteCustomSourceUrl()||t,moduleType:"RestoreDestinationProvider",askToCreate:!0,expectedResult:"any",suppressErrorDialogs:!0,backupId:this.backupId(),sourcePrefix:this.remoteCustomSourcePrefix()}}).closed.subscribe(o=>{o&&(this.remoteCustomTargetUrl.set(o),this.optionsForm.controls.restoreFrom.setValue("other-custom"))}),!1}#s=W(()=>{let t=this.optionsFormSignal()?.restoreFrom;this.extendedDataType()!=null&&(t==="original"||t===void 0)&&(this.optionsForm.controls.restoreFrom.setValue("pickLocation"),this.optionsForm.controls.handleExisting.setValue("overwrite")),this.extendedDataType()==null&&(t==="same-custom"||t==="other-custom")&&(this.optionsForm.controls.restoreFrom.setValue("original"),this.optionsForm.controls.handleExisting.setValue("saveTimestamp"))});goBack(){this.#t.navigate(["select-files"],{relativeTo:this.#i.parent})}submit(){let t=this.#e.selectFilesFormSignal()?.filesToRestore??[];if(t.length>0&&this.optionsFormSignal()?.restoreFrom=="original"&&(t[0].includes("/")?"/":"\\")!==this.#n.systemInfo()?.DirectorySeparator){this.#o.open(A,{data:{title:$localize`Confirm target folder`,message:$localize`This backup was created on another operating system. Restoring files without specifying a destination folder can cause files to be restored in unexpected places. Are you sure you want to continue without choosing a destination folder?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:n=>{n&&this.#e.submit()}});return}if(this.optionsFormSignal()?.restoreFrom==="same-custom"||this.optionsFormSignal()?.restoreFrom==="other-custom"){let o=this.optionsFormSignal()?.restoreFromPath;if(o&&o.startsWith("/")&&(o=o.substring(1)),!o||o.trim()===""){this.#o.open(A,{data:{title:$localize`No path specified`,message:this.extendedDataType()==="gsuite"?$localize`Please choose a path to restore to in the Google Workspace account.`:$localize`Please choose a path to restore to in the Microsoft 365 tenant.`,confirmText:$localize`OK`,cancelText:void 0}});return}let n=this.optionsFormSignal()?.customRemoteIgnoreExisting,s=this.customDestinationUrl()?.substring(this.customDestinationUrl().indexOf("?")),l=this.extendedDataType()==="gsuite"?`@googleworkspace://${encodeURIComponent(o)}${s}&google-ignore-existing=${n?"true":"false"}`:`@office365://${encodeURIComponent(o)}${s}&office365-ignore-existing=${n?"true":"false"}`;this.#e.setAlternateRestorePath(l,this.remoteCustomSourcePrefix()),this.optionsForm.controls.includeMetadata.setValue(!0),this.optionsForm.controls.permissions.setValue(!0)}else this.#e.setAlternateRestorePath(null,null);this.#e.submit()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,selectors:[["app-advanced-options-settings"]],decls:18,vars:6,consts:()=>{let t;t=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let o;o=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let n;n=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `;let s;s=$localize` Local file system ${"\uFFFD#4\uFFFD\uFFFD/#4\uFFFD"}:TAG_INPUT:`;let l;l=$localize` Same Microsoft 365 Tenant ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Different Microsoft 365 Tenant ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let R;R=$localize` Same Google Workspace Account ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let L;L=$localize` Different Google Workspace Account ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let x;x=$localize` Original location ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let ee;ee=$localize` Pick location ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let te;te=$localize`Restore settings`;let f;f=$localize` Ignore existing resources in the destination ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let Ne;Ne=$localize`How do you want to handle existing files?`;let he;he=$localize` Overwrite ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let fe;fe=$localize` Save different versions with timestamp in file name ${"\uFFFD#8\uFFFD\uFFFD/#8\uFFFD"}:TAG_INPUT:`;let Re;Re=$localize`Metadata settings`;let Pe;Pe=$localize` Restore file metadata ${"\uFFFD#14\uFFFD\uFFFD/#14\uFFFD"}:TAG_INPUT:`;let Ie;return Ie=$localize` Restore read/write permissions ${"\uFFFD#17\uFFFD\uFFFD/#17\uFFFD"}:TAG_INPUT:`,[["formRef",""],t,e,o,n,s,l,u,R,L,x,ee,te,f,Ne,he,fe,Re,Pe,Ie,[3,"submit","formGroup"],[1,"title-30"],[3,"disableToggle"],["title",""],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],[1,"raised","primary"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled","enableCreateFolder"],[3,"customRemoteMode","backupId","sourcePrefix","destinationUrl"],["type","radio","name","restoreFrom","value","same-custom","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","other-custom","formControlName","restoreFrom",3,"click"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","restoreFrom","value","original","formControlName","restoreFrom"],["type","checkbox","formControlName","customRemoteIgnoreExisting"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","includeMetadata"],["type","checkbox","formControlName","permissions"]]},template:function(e,o){e&1&&(r(0,"form",20,0),N("submit",function(){return o.submit()}),r(2,"h3",21),F(3,1),a(),r(4,"app-toggle-card",22),G(5,23),F(6,2),k(),T(7,Lt,7,3)(8,yt,10,2),a(),T(9,Dt,6,1,"app-toggle-card",22)(10,bt,18,1),r(11,"div",24)(12,"button",25),N("click",function(){return o.goBack()}),m(13,3),d(14,"sh-icon"),S(),a(),r(15,"button",26),m(16,4),d(17,"sh-icon"),S(),a()()()),e&2&&(O("formGroup",o.optionsForm),c(4),O("disableToggle",!0),c(3),g(o.extendedDataType()!==null?7:8),c(2),g(o.isCustomRemoteRestore()?9:10),c(6),xe("loading",o.isSubmitting()))},dependencies:[j,X,V,Ve,ze,J,z,Y,U,Ze,ce,qe,Ye,Q,q],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{lt as a,Oe as b,st as c,Te as d,at as e,Ce as f,v as g};
1
+ import{a as tt}from"./chunk-MJPEKJ3T.js";import{k as Ze,n as et}from"./chunk-RTGUYIWH.js";import{a as ce}from"./chunk-TPKKLIFK.js";import{a as Qe}from"./chunk-COEGVUM3.js";import{a as A}from"./chunk-PEOYNJJM.js";import{b as Ee}from"./chunk-2KD757N6.js";import{b as Ke}from"./chunk-AFHEXZUZ.js";import{a as Z}from"./chunk-JYRKUYG6.js";import{B as Q,H as _e,L as Ue,M as Ye,P as He,V as je,W as qe,b as Ve,c as V,e as J,f as z,i as Je,j as X,l as ze,p as U,q as Y,r as H,s as Xe,t as j,v as q,z as le}from"./chunk-CJKZ27FM.js";import{d as K}from"./chunk-5E3B4AEF.js";import{b,d as $}from"./chunk-CQJRBQ6I.js";import{ha as ae}from"./chunk-YF6JHIN5.js";import{$ as p,Ac as we,B as De,Bc as me,Db as O,E as oe,Eb as r,Fb as a,G as P,Gb as d,Gc as Se,Hc as We,Ic as Be,J as be,Kb as G,Lb as k,M as $e,N as ne,Nb as D,Rc as h,Ta as c,Ub as m,Vb as S,W as Ae,Wb as F,Xb as de,Yb as pe,_b as N,ac as E,ea as I,fa as M,g as Me,hb as B,lc as xe,m as Le,mb as ve,oc as y,qa as _,qc as Ge,rc as ke,sa as W,tc as ie,uc as se,vc as re,w as ue,x as ye,xb as T,yb as g}from"./chunk-K5XGRFWJ.js";function _t(i,t){i&1&&(r(0,"p"),F(1,3),a())}function ct(i,t){i&1&&(r(0,"sh-form-field")(1,"label",11),F(2,4),a(),d(3,"input",12),a())}var ot=new H,st=()=>ot.group({passphrase:ot.control("")}),Te=class i{#e=p(K);#t=p(v);#i=p($);#n=p(b);encryptionForm=this.#t.encryptionForm;creatingTemporaryBackup=_(!1);settings=_([]);hasEncryptedBackup=h(()=>{let t=this.#t.destinationTestSignal();return t==="testing"||typeof t=="string"?!0:t?.containsEncryptedBackupFiles??!0});showEncryptionField=_(!1);next(){let t=this.#t.destinationTargetUrl();if(!t)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,o=[];e?o.push({Name:"--passphrase",Value:e}):o.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(n=>{let s=n.Name?.trim();s&&s!=="--"&&(s.startsWith("--")||(s=`--${s}`),o.push({Name:s,Value:n.Value??""}))}),this.#e.postApiV1Backups({requestBody:{Backup:{TargetURL:t,Settings:o}},temporary:!0}).pipe(P(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:n=>{let s=n.ID;this.#i.navigate([`/restore-draft/${s}`])},error:n=>{console.error(n)}})}back(){this.#t.isFileRestore()?this.#i.navigate(["destination"],{relativeTo:this.#n.parent}):this.#t.exit()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,selectors:[["app-restore-encryption"]],decls:14,vars:5,consts:()=>{let t;t=$localize`Advanced options`;let e;e=$localize`${"\uFFFD#10\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let o;o=$localize`${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let n;n=$localize`The backup does not contain encrypted files.`;let s;s=$localize`Enter backup passphrase if defined.`;let l;return l=$localize`Password`,[t,e,o,n,l,[3,"submit","formGroup"],["title",""],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["for","password"],["type","password","id","password","autocomplete","disabled","placeholder",s,"formControlName","passphrase"]]},template:function(e,o){e&1&&(r(0,"form",5),N("submit",function(){return o.next()}),T(1,_t,2,0,"p"),T(2,ct,4,0,"sh-form-field"),r(3,"sh-toggle-card"),G(4,6),F(5,0),k(),r(6,"app-options-list",7),re("optionsChange",function(s){return se(o.settings,s)||(o.settings=s),s}),a()(),r(7,"div",8)(8,"button",9),N("click",function(){return o.back()}),m(9,1),d(10,"sh-icon"),S(),a(),r(11,"button",10),m(12,2),d(13,"sh-icon"),S(),a()()()),e&2&&(O("formGroup",o.encryptionForm),c(),g(o.hasEncryptedBackup()?-1:1),c(),g(o.hasEncryptedBackup()||o.showEncryptionField()?2:-1),c(4),ie("options",o.settings),O("hasFreeTextSettings",!0))},dependencies:[j,X,V,J,z,Y,U,_e,q,Q,je,tt],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var rt=()=>({standalone:!0});function ut(i,t){i&1&&d(0,"sh-progress-bar",13)}function dt(i,t){if(i&1&&(y(0),Se(1,"bytes")),i&2){let e=E().$implicit;Ge(" (",We(1,1,e.FileSizes),") ")}}function pt(i,t){i&1&&(r(0,"span",20),F(1,4),a())}function mt(i,t){if(i&1&&(r(0,"div",19),y(1),Se(2,"date"),T(3,dt,2,3),T(4,pt,2,0,"span",20),a()),i&2){let e=t.$implicit;c(),ke(" ",e.Version,": ",Be(2,4,e.Time,"medium")," "),c(2),g(e.FileSizes?3:-1),c(),g(e.IsFullBackup===!1?4:-1)}}function St(i,t){i&1&&d(0,"sh-progress-bar",13)}function Et(i,t){i&1&&(r(0,"sh-icon",28),y(1,"spinner"),a())}function Tt(i,t){i&1&&(r(0,"sh-icon"),y(1,"magnifying-glass"),a())}function gt(i,t){if(i&1){let e=D();r(0,"button",31),N("click",function(){I(e);let n=E(4);return M(n.clearSearch())}),r(1,"sh-icon"),y(2,"x-circle"),a(),r(3,"span"),F(4,8),a()()}}function Ft(i,t){i&1&&(r(0,"span"),F(1,9),a())}function Ct(i,t){if(i&1&&(r(0,"span"),F(1,10),a()),i&2){let e=E(5);c(),de(e.searchResults().length),pe(1)}}function Ot(i,t){if(i&1&&(r(0,"div",30),T(1,Ft,2,0,"span")(2,Ct,2,1,"span"),a()),i&2){let e=E(4);c(),g(e.searchResults().length===0?1:2)}}function Nt(i,t){if(i&1){let e=D();r(0,"div",24)(1,"sh-form-field")(2,"label",25),F(3,6),a(),r(4,"input",26),re("ngModelChange",function(n){I(e);let s=E(3);return se(s.searchQuery,n)||(s.searchQuery=n),M(n)}),N("keydown.enter",function(n){I(e);let s=E(3);return n.preventDefault(),M(s.performSearch())}),a()(),r(5,"button",27),N("click",function(){I(e);let n=E(3);return M(n.performSearch())}),T(6,Et,2,0,"sh-icon",28)(7,Tt,2,0,"sh-icon"),r(8,"span"),F(9,7),a()(),T(10,gt,5,0,"button",29),a(),T(11,Ot,3,1,"div",30)}if(i&2){let e=E(3);c(4),ie("ngModel",e.searchQuery),O("ngModelOptions",me(6,rt)),c(),O("disabled",e.isSearching()||!e.searchQuery().trim()),c(),g(e.isSearching()?6:7),c(4),g(e.isSearchMode()?10:-1),c(),g(e.isSearchMode()&&!e.isSearching()?11:-1)}}function ht(i,t){if(i&1){let e=D();T(0,Nt,12,7),r(1,"app-file-tree",21),N("hasExtendedData",function(n){I(e);let s=E(2);return M(s.extendedDataType.set(n))}),r(2,"label",22),F(3,5),a(),d(4,"input",23),a()}if(i&2){let e=E(2);g(e.canSearch()?0:-1),c(),O("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)("loadExtendedData",!0)("searchMode",e.isSearchMode())("searchResults",e.searchResults())}}function ft(i,t){if(i&1){let e=D();r(0,"sh-select",17),N("cleared",function(){I(e);let n=E();return M(n.abortLoading())}),r(1,"input",18),re("ngModelChange",function(n){I(e);let s=E();return se(s.selectOption,n)||(s.selectOption=n),M(n)}),a(),ve(2,mt,5,7,"ng-template"),a(),T(3,St,1,0,"sh-progress-bar",13),T(4,ht,5,9)}if(i&2){let e=E();O("options",e.versionOptions())("isClearable",!1),c(),ie("ngModel",e.selectOption),O("ngModelOptions",me(6,rt)),c(2),g(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),c(),g(e.showFileTree()?4:-1)}}var Fe=new H,at=()=>Fe.group({filesToRestore:Fe.control(""),passphrase:Fe.control(null)}),Ce=class i{#e=p(K);#t=p(v);#i=p(Ke);#n=p(Z);#o=p($);#s=p(b);#a=p(ae);#l=null;#_=null;#r=_([]);selectFilesForm=this.#t.selectFilesForm;selectFilesFormSignal=this.#t.selectFilesFormSignal;selectOption=this.#t.selectOption;backupId=this.#t.backupId;versionOptionsLoading=this.#t.versionOptionsLoading;versionOptions=this.#t.versionOptions;isFileRestore=this.#t.isFileRestore;extendedDataType=this.#t.extendedDataType;needsDatabaseRepair=h(()=>this.#t.backup()?.Backup?.IsTemporary??!0);showFileTree=_(!1);backupSettings=_(null);rootPaths=_([]);initialNodes=_([]);loadingRootPath=_(!1);isRepairing=h(()=>this.#r().length>0);loadedVersions=_({});canSearch=h(()=>this.#n.hasV2ListOperations());searchQuery=_("");isSearching=_(!1);searchResults=_([]);hasSearched=_(!1);isSearchMode=h(()=>this.searchQuery().length>0&&this.hasSearched());loadingEffect=W(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let o=e[0].Version;this.selectOption.set(o.toString())}});backupSettingsEffect=W(()=>{let t=this.backupId(),e=this.selectOption(),o=this.isRepairing(),n=this.loadedVersions();if(!e||!t)return;let l=this.versionOptions()?.find(x=>x.Version===parseInt(e))?.Time??null;if(!l)return;let u=`${t}+${l}`,R=n[u];if(this.needsDatabaseRepair()&&(!R||o))return;let L={id:t+"",time:l};this.backupSettings.set(L),this.getRootPath(L)});repairEffect=W(()=>{if(!this.needsDatabaseRepair())return;let t=this.selectOption(),e=this.versionOptions();if(t){let o=e.find(l=>l.Version===parseInt(t));if(o===void 0)return;let n=this.backupId(),s=`${n}+${o.Time}`;if(this.#_===s||(this.#_=s,this.#r().includes(s)))return;this.#r.update(l=>[...l,s]),this.#e.postApiV1BackupByIdRepairupdate({id:n,requestBody:{only_paths:!0,time:o.Time}}).pipe(ne(this.abortLoading$),P(()=>{this.#_=null})).subscribe(l=>{let u=l.ID;this.#i.waitForTaskToComplete(u).pipe(oe(1)).subscribe(()=>{this.#r.update(R=>R.filter(L=>L!==s)),this.loadedVersions.update(R=>(R[s]=!0,R))})})}});getRootPath(t){let e={id:t.id+"",time:t.time,prefixOnly:!0,folderContents:!1},o=t.id+"";this.isRepairing()||this.#l===o||(this.#l=o,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#n.hasV2ListOperations()?this.#e.postApiV2BackupListFolder({requestBody:{BackupId:t.id,Time:t.time,Paths:null,PageSize:0,Page:0,ReturnExtended:!0}}).pipe(ne(this.abortLoading$),P(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#l=null})).subscribe({next:n=>{let s=(n.Data??[]).find(u=>u.Metadata&&u.Metadata.ExtType&&u.Metadata.ExtType.length>0);s&&this.extendedDataType.set(s.Metadata.ExtType);let l=(n.Data??[]).map(u=>u.Path??"");l.length>0?(this.initialNodes.set([]),this.rootPaths.set(l)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#e.getApiV1BackupByIdFiles(e).pipe(ne(this.abortLoading$),P(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:n=>{let s=n.Files.map(l=>l.Path??"");s.length>0?(this.initialNodes.set([]),this.rootPaths.set(s)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new Me;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let t=this.versionOptions();return e=>{if(!e)return"";let o=t?.find(n=>typeof n.Version=="number"&&n.Version.toString()===e);return o?`${o.Version}: ${this.#a.transform(o.Time,"medium")}`:""}}next(){this.#o.navigate(["options"],{relativeTo:this.#s.parent})}back(){this.#t.isFileRestore()?this.#o.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#t.exit()}performSearch(){let t=this.searchQuery().trim(),e=this.backupSettings();if(!t||!e)return;let n=this.versionOptions()?.find(s=>s.Version===parseInt(this.selectOption()??""))?.Version;n!=null&&(this.isSearching.set(!0),this.searchResults.set([]),this.hasSearched.set(!0),this.#e.postApiV2BackupSearch({requestBody:{BackupId:e.id,Time:null,Version:[n],Filters:[t],Paths:null,PageSize:1e3,Page:0,ReturnExtended:!0}}).pipe(ne(this.abortLoading$),P(()=>this.isSearching.set(!1))).subscribe({next:s=>{this.searchResults.set(s.Data??[])},error:()=>{this.searchResults.set([])}}))}clearSearch(){this.searchQuery.set(""),this.searchResults.set([]),this.hasSearched.set(!1)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,selectors:[["app-select-files"]],features:[we([ae])],decls:13,vars:3,consts:()=>{let t;t=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let n;n=$localize`Select an option...`;let s;s=$localize`(partial)`;let l;l=$localize`Path`;let u;u=$localize`Enter search term...`;let R;R=$localize`Search files`;let L;L=$localize`Search`;let x;x=$localize`Clear`;let ee;ee=$localize`0 results found`;let te;return te=$localize`Found ${"\uFFFD0\uFFFD"}:INTERPOLATION: result(s)`,[["formRef",""],t,e,o,s,l,R,L,x,ee,te,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",n,3,"ngModelChange","ngModel","ngModelOptions"],[1,"custom-option"],[1,"partial"],[3,"hasExtendedData","rootPaths","initialNodes","backupSettings","multiSelect","showFiles","loadExtendedData","searchMode","searchResults"],["for","path"],["type","text","id","path","formControlName","filesToRestore"],[1,"search-container"],["for","search"],["type","text","id","search","placeholder",u,3,"ngModelChange","keydown.enter","ngModel","ngModelOptions"],["shButton","","type","button",1,"small",3,"click","disabled"],[1,"spinner"],["shButton","","type","button",1,"small","secondary"],[1,"search-results-info"],["shButton","","type","button",1,"small","secondary",3,"click"]]},template:function(e,o){e&1&&(r(0,"form",11,0),N("submit",function(){return o.next()}),r(2,"h3",12),F(3,1),a(),T(4,ut,1,0,"sh-progress-bar",13)(5,ft,5,7),r(6,"div",14)(7,"button",15),N("click",function(){return o.back()}),m(8,2),d(9,"sh-icon"),S(),a(),r(10,"button",16),m(11,3),d(12,"sh-icon"),S(),a()()()),e&2&&(O("formGroup",o.selectFilesForm),c(4),g(o.versionOptionsLoading()?4:5),c(5),de(o.isFileRestore()?"Back":"Exit"),pe(8))},dependencies:[Xe,X,V,J,z,Je,j,Y,U,ce,Q,_e,q,He,Ue,ae,Qe],styles:["[_nghost-%COMP%]{display:block;margin-top:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}.search-container[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.search-container[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%]{flex:1}.search-results-info[_ngcontent-%COMP%]{color:var(--base-8);font-size:var(--small)}"],changeDetection:0})};var v=class i{#e=p($);#t=p(b);#i=p(Z);#n=p(le);#o=p(K);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);destinationTestSignal=_(null);selectFilesForm=at();optionsForm=lt();encryptionForm=st();optionsFormSignal=Ee(this.optionsForm.valueChanges);selectFilesFormSignal=Ee(this.selectFilesForm.valueChanges);selectOption=_(null);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isFileRestore=_(!1);isFullWidthPage=_(!1);extendedDataType=_(null);alternateRestorePath=_(null);alternateRestorePathSourcePrefix=_(null);init(t,e=!1){this.backupId.set(t),this.isFileRestore.set(e),this.alternateRestorePath.set(null),this.extendedDataType.set(null),e&&this.#e.navigate(["/restore-from-files/destination"]),e||this.getBackup()}updateTargetUrl(t){this.destinationTargetUrl.set(t)}setAlternateRestorePath(t,e){this.alternateRestorePath.set(t),this.alternateRestorePathSourcePrefix.set(e)}submit(){this.isSubmitting.set(!0);let t=this.backupId();this.backup()?.Backup?.IsTemporary??!1?this.#o.postApiV1BackupByIdCopytotemp({id:this.backupId()??""}).subscribe({next:o=>{this.#s(o.ID??"")},error:o=>this.showErrorDialog($localize`An error occurred while copying the backup to a temporary location: ${o.message}`)}):this.#s(t??"")}showErrorDialog(t){this.#n.open(A,{data:{title:$localize`Error occured`,message:t,confirmText:$localize`OK`,cancelText:void 0},closed:e=>{}})}#s(t){let e=this.optionsForm.value,o=this.selectFilesForm.value,n=this.selectOption(),s=this.versionOptions()?.find(l=>l.Version===(n&&parseInt(n)));this.#o.postApiV1BackupByIdRestore({id:t??"",requestBody:{paths:o.filesToRestore?.split("\0").map(l=>l.endsWith("/")||l.endsWith("\\")?`${l}*`:l)??[],passphrase:o.passphrase??null,time:s?.Time,restore_path:this.alternateRestorePath()??e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata,source_prefix:this.alternateRestorePathSourcePrefix(),connection_string_id:null}}).pipe(P(()=>this.isSubmitting.set(!1))).subscribe({next:l=>{this.#e.navigate([`./${l.ID}`,"progress"],{relativeTo:this.#t})},error:l=>{console.error("restore error",l)}})}exit(){this.#n.open(A,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:t=>{t&&(this.#a(),this.#e.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(t,e=2){return this.#o.postApiV2BackupListFilesets({requestBody:{BackupId:t}}).pipe(De(o=>{let n=o?.error?.body?.StatusCode??o?.error?.requestBody?.StatusCode;return n==="EncryptedStorageNoPassphrase"||n==="FolderMissing"||n==="EmptyRemoteFolder"||e===0?Le(()=>o):ye(1e3).pipe($e(()=>this.loadFilesetsWithRetryv2(t,e-1)))}))}getBackup(){let t=this.backupId();this.versionOptionsLoading.set(!0),this.#i.hasV2ListOperations()?ue([this.#o.getApiV1BackupById({id:t}),this.loadFilesetsWithRetryv2(t)]).pipe(oe(1),P(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,o])=>{if(o.Error)throw new Error(o.Error);if(!(e.Backup?.IsTemporary??!0)&&e?.Backup?.DBPathExists===!1){this.#n.open(A,{data:{title:$localize`Missing Local Database`,message:$localize`The local database for this backup is missing. Please repair or recreate the local database before restoring.`,confirmText:$localize`OK`,cancelText:void 0},closed:s=>{this.#e.navigate(["/backup",t,"database"])}});return}this.versionOptions.set((o.Data??[]).map(s=>({Version:s.Version??-1,IsFullBackup:s.IsFullBackup??void 0,Time:s.Time??"<missing>",FileCount:s.FileCount??void 0,FileSizes:s.FileSizes??void 0}))),this.backup.set(e)},error:e=>{let o=e?.error?.body?.StatusCode??e?.error?.requestBody?.StatusCode,n=o==="EncryptedStorageNoPassphrase",s=o==="FolderMissing",l=o==="EmptyRemoteFolder",u=$localize`An error occurred while loading the backup filesets: ${e.message}`;n&&(u=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),s&&(u=$localize`The backup storage folder was not found.`),l&&(u=$localize`The backup storage folder does not contain any filesets.`),this.#n.open(A,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:R=>{this.#e.navigate([n?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):ue([this.#o.getApiV1BackupById({id:t}),this.#o.getApiV1BackupByIdFilesets({id:t}).pipe(be(3))]).pipe(oe(1),P(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,o])=>{this.versionOptions.set(o.map(n=>({Version:n.Version??-1,IsFullBackup:(n.IsFullBackup??1)==1,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(e)}})}#a(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=Ae({token:i,factory:i.\u0275fac,providedIn:"root"})};function Rt(i,t){if(i&1){let e=D();r(0,"sh-radio",27),m(1,6),d(2,"input",31),S(),a(),r(3,"sh-radio",27),m(4,7),r(5,"input",32),N("click",function(){I(e);let n=E(2);return M(n.chooseCustomRemoteDestination())}),a(),S(),a()}}function Pt(i,t){if(i&1){let e=D();r(0,"sh-radio",27),m(1,8),d(2,"input",31),S(),a(),r(3,"sh-radio",27),m(4,9),r(5,"input",32),N("click",function(){I(e);let n=E(2);return M(n.chooseCustomRemoteDestination())}),a(),S(),a()}}function It(i,t){if(i&1&&(r(0,"app-file-tree",29)(1,"label",33),y(2,"Path"),a(),d(3,"input",34),a()),i&2){let e,o=E(2);O("disabled",((e=o.optionsFormSignal())==null?null:e.restoreFrom)!=="pickLocation")("enableCreateFolder",!0)("resolvePaths",!0)}}function Mt(i,t){if(i&1&&(r(0,"app-file-tree",30)(1,"label",33),y(2,"Path"),a(),d(3,"input",34),a()),i&2){let e=E(2);O("customRemoteMode",e.extendedDataType())("backupId",e.backupId())("sourcePrefix",e.remoteCustomSourcePrefix())("destinationUrl",e.customDestinationUrl())}}function Lt(i,t){if(i&1&&(T(0,Rt,6,0)(1,Pt,6,0),r(2,"sh-radio",27),m(3,5),d(4,"input",28),S(),a(),T(5,It,4,3,"app-file-tree",29),T(6,Mt,4,4,"app-file-tree",30)),i&2){let e,o=E();g(o.extendedDataType()==="o365"?0:o.extendedDataType()==="gsuite"?1:-1),c(5),g(((e=o.optionsFormSignal())==null?null:e.restoreFrom)==="pickLocation"?5:-1),c(),g(o.showCustomRemoteRestoreTree()?6:-1)}}function yt(i,t){if(i&1&&(r(0,"sh-radio",27),m(1,10),d(2,"input",35),S(),a(),r(3,"sh-radio",27),m(4,11),d(5,"input",28),S(),a(),r(6,"app-file-tree",29)(7,"label",33),y(8,"Path"),a(),d(9,"input",34),a()),i&2){let e,o=E();c(6),O("disabled",((e=o.optionsFormSignal())==null?null:e.restoreFrom)!=="pickLocation")("enableCreateFolder",!0)("resolvePaths",!0)}}function Dt(i,t){i&1&&(r(0,"app-toggle-card",22),G(1,23),F(2,12),k(),r(3,"sh-toggle",27),m(4,13),d(5,"input",36),S(),a()()),i&2&&O("disableToggle",!0)}function bt(i,t){i&1&&(r(0,"app-toggle-card",22),G(1,23),F(2,14),k(),r(3,"sh-radio",27),m(4,15),d(5,"input",37),S(),a(),r(6,"sh-radio",27),m(7,16),d(8,"input",38),S(),a()(),r(9,"app-toggle-card"),G(10,23),F(11,17),k(),r(12,"sh-toggle",39),m(13,18),d(14,"input",40),S(),a(),r(15,"sh-toggle",39),m(16,19),d(17,"input",41),S(),a()()),i&2&&O("disableToggle",!0)}var w=new H,lt=()=>w.group({restoreFrom:w.control("original"),restoreFromPath:w.control(""),handleExisting:w.control("saveTimestamp"),permissions:w.control(!1),includeMetadata:w.control(!0),customRemoteIgnoreExisting:w.control(!1)}),Oe=class i{#e=p(v);#t=p($);#i=p(b);#n=p(Z);#o=p(le);optionsForm=this.#e.optionsForm;optionsFormSignal=this.#e.optionsFormSignal;isSubmitting=this.#e.isSubmitting;extendedData=this.#e.extendedDataType;remoteCustomTargetUrl=_(null);backupId=h(()=>this.#e.backup()?.Backup?.ID??null);extendedDataType=h(()=>{let t=this.#e.extendedDataType();return t==="o365"?"o365":t==="gsuite"?"gsuite":null});remoteCustomSourceEntry=h(()=>this.#e.backup()?.Backup?.Sources?.filter(t=>t.startsWith("@")&&(t.includes("|office365://")||t.includes("|googleworkspace://")))[0]??null);remoteCustomSourceUrl=h(()=>this.remoteCustomSourceEntry()?.split("|")[1]??null);remoteCustomSourcePrefix=h(()=>this.remoteCustomSourceEntry()?.split("|")[0]??null);customDestinationUrl=h(()=>{let t=this.optionsFormSignal()?.restoreFrom,e=this.extendedDataType()!==null;return t==="same-custom"&&e?this.remoteCustomSourceUrl():t==="other-custom"&&e?this.remoteCustomTargetUrl():null});showCustomRemoteRestoreTree=h(()=>!!(this.optionsFormSignal()?.restoreFrom==="same-custom"&&this.customDestinationUrl()&&this.backupId()||this.optionsFormSignal()?.restoreFrom==="other-custom"&&this.customDestinationUrl()));isCustomRemoteRestore=h(()=>{let t=this.optionsFormSignal()?.restoreFrom;return t==="same-custom"||t==="other-custom"});chooseCustomRemoteDestination(){let t=this.extendedDataType()==="o365"?"office365://":"googleworkspace://";return this.#o.open(et,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{targetUrlModel:this.remoteCustomTargetUrl()||this.remoteCustomSourceUrl()||t,moduleType:"RestoreDestinationProvider",askToCreate:!0,expectedResult:"any",suppressErrorDialogs:!0,backupId:this.backupId(),sourcePrefix:this.remoteCustomSourcePrefix()}}).closed.subscribe(o=>{o&&(this.remoteCustomTargetUrl.set(o),this.optionsForm.controls.restoreFrom.setValue("other-custom"))}),!1}#s=W(()=>{let t=this.optionsFormSignal()?.restoreFrom;this.extendedDataType()!=null&&(t==="original"||t===void 0)&&(this.optionsForm.controls.restoreFrom.setValue("pickLocation"),this.optionsForm.controls.handleExisting.setValue("overwrite")),this.extendedDataType()==null&&(t==="same-custom"||t==="other-custom")&&(this.optionsForm.controls.restoreFrom.setValue("original"),this.optionsForm.controls.handleExisting.setValue("saveTimestamp"))});goBack(){this.#t.navigate(["select-files"],{relativeTo:this.#i.parent})}submit(){let t=this.#e.selectFilesFormSignal()?.filesToRestore??[];if(t.length>0&&this.optionsFormSignal()?.restoreFrom=="original"&&(t[0].includes("/")?"/":"\\")!==this.#n.systemInfo()?.DirectorySeparator){this.#o.open(A,{data:{title:$localize`Confirm target folder`,message:$localize`This backup was created on another operating system. Restoring files without specifying a destination folder can cause files to be restored in unexpected places. Are you sure you want to continue without choosing a destination folder?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:n=>{n&&this.#e.submit()}});return}if(this.optionsFormSignal()?.restoreFrom==="same-custom"||this.optionsFormSignal()?.restoreFrom==="other-custom"){let o=this.optionsFormSignal()?.restoreFromPath;if(o&&o.startsWith("/")&&(o=o.substring(1)),!o||o.trim()===""){this.#o.open(A,{data:{title:$localize`No path specified`,message:this.extendedDataType()==="gsuite"?$localize`Please choose a path to restore to in the Google Workspace account.`:$localize`Please choose a path to restore to in the Microsoft 365 tenant.`,confirmText:$localize`OK`,cancelText:void 0}});return}let n=this.optionsFormSignal()?.customRemoteIgnoreExisting,s=this.customDestinationUrl()?.substring(this.customDestinationUrl().indexOf("?")),l=this.extendedDataType()==="gsuite"?`@googleworkspace://${encodeURIComponent(o)}${s}&google-ignore-existing=${n?"true":"false"}`:`@office365://${encodeURIComponent(o)}${s}&office365-ignore-existing=${n?"true":"false"}`;this.#e.setAlternateRestorePath(l,this.remoteCustomSourcePrefix()),this.optionsForm.controls.includeMetadata.setValue(!0),this.optionsForm.controls.permissions.setValue(!0)}else this.#e.setAlternateRestorePath(null,null);this.#e.submit()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,selectors:[["app-advanced-options-settings"]],decls:18,vars:6,consts:()=>{let t;t=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let o;o=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let n;n=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `;let s;s=$localize` Local file system ${"\uFFFD#4\uFFFD\uFFFD/#4\uFFFD"}:TAG_INPUT:`;let l;l=$localize` Same Microsoft 365 Tenant ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Different Microsoft 365 Tenant ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let R;R=$localize` Same Google Workspace Account ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let L;L=$localize` Different Google Workspace Account ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let x;x=$localize` Original location ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let ee;ee=$localize` Pick location ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let te;te=$localize`Restore settings`;let f;f=$localize` Ignore existing resources in the destination ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let Ne;Ne=$localize`How do you want to handle existing files?`;let he;he=$localize` Overwrite ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let fe;fe=$localize` Save different versions with timestamp in file name ${"\uFFFD#8\uFFFD\uFFFD/#8\uFFFD"}:TAG_INPUT:`;let Re;Re=$localize`Metadata settings`;let Pe;Pe=$localize` Restore file metadata ${"\uFFFD#14\uFFFD\uFFFD/#14\uFFFD"}:TAG_INPUT:`;let Ie;return Ie=$localize` Restore read/write permissions ${"\uFFFD#17\uFFFD\uFFFD/#17\uFFFD"}:TAG_INPUT:`,[["formRef",""],t,e,o,n,s,l,u,R,L,x,ee,te,f,Ne,he,fe,Re,Pe,Ie,[3,"submit","formGroup"],[1,"title-30"],[3,"disableToggle"],["title",""],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],[1,"raised","primary"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled","enableCreateFolder","resolvePaths"],[3,"customRemoteMode","backupId","sourcePrefix","destinationUrl"],["type","radio","name","restoreFrom","value","same-custom","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","other-custom","formControlName","restoreFrom",3,"click"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","restoreFrom","value","original","formControlName","restoreFrom"],["type","checkbox","formControlName","customRemoteIgnoreExisting"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","includeMetadata"],["type","checkbox","formControlName","permissions"]]},template:function(e,o){e&1&&(r(0,"form",20,0),N("submit",function(){return o.submit()}),r(2,"h3",21),F(3,1),a(),r(4,"app-toggle-card",22),G(5,23),F(6,2),k(),T(7,Lt,7,3)(8,yt,10,3),a(),T(9,Dt,6,1,"app-toggle-card",22)(10,bt,18,1),r(11,"div",24)(12,"button",25),N("click",function(){return o.goBack()}),m(13,3),d(14,"sh-icon"),S(),a(),r(15,"button",26),m(16,4),d(17,"sh-icon"),S(),a()()()),e&2&&(O("formGroup",o.optionsForm),c(4),O("disableToggle",!0),c(3),g(o.extendedDataType()!==null?7:8),c(2),g(o.isCustomRemoteRestore()?9:10),c(6),xe("loading",o.isSubmitting()))},dependencies:[j,X,V,Ve,ze,J,z,Y,U,Ze,ce,qe,Ye,Q,q],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{lt as a,Oe as b,st as c,Te as d,at as e,Ce as f,v as g};
@@ -1 +1 @@
1
- import{a as w}from"./chunk-YYD2JU6T.js";import{J as k,v as D}from"./chunk-VKQQDCUN.js";import"./chunk-DSYNIXJF.js";import"./chunk-N2AU7VKX.js";import{aa as A}from"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import{$b as a,Ab as I,Bb as v,Bc as m,Cb as f,Cc as F,Db as r,Eb as l,Jc as $,Lb as g,Mb as M,Qc as R,Sa as c,Vb as N,Zb as E,_ as O,da as T,ea as h,gb as x,ic as C,jc as P,kc as y,lb as p,nc as s,oc as b,pa as _,wb as d,xb as u}from"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";var Y=e=>({children:e,level:0}),L=e=>({$implicit:e}),j=(e,t)=>({children:e,level:t}),V=(e,t)=>t.id;function z(e,t){if(e&1&&(r(0,"sh-icon"),s(1,"caret-down"),l()),e&2){let n=a().$implicit;y("open",n.isOpen())}}function B(e,t){e&1&&(r(0,"sh-icon"),s(1,"dot"),l())}function J(e,t){e&1&&g(0)}function U(e,t){if(e&1&&p(0,J,1,0,"ng-container",3),e&2){let n=a().$implicit,o=a().$implicit;a();let i=C(3);f("ngTemplateOutlet",i)("ngTemplateOutletContext",m(5,L,F(2,j,n.children,o.level+1)))}}function X(e,t){if(e&1){let n=M();r(0,"div",4,1),E("click",function(){let i=T(n).$implicit,G=a(2);return h(i.children.length>0&&G.toggleNode(i))}),d(2,z,2,2,"sh-icon",5)(3,B,2,0,"sh-icon"),r(4,"div",6),s(5),l()(),d(6,U,1,7,"ng-container")}if(e&2){let n=t.$implicit;y("cannot-toggle",n.children.length===0)("open",n.isOpen()),c(2),u(n.children.length>0?2:3),c(3),b(n.text),c(),u(n.isOpen()?6:-1)}}function q(e,t){if(e&1&&(r(0,"sh-list"),I(1,X,7,7,null,null,V),l()),e&2){let n=t.$implicit;P("padding-left",n.level*.25,"rem"),c(),v(n.children)}}function H(e,t){e&1&&g(0)}var S=class e{#e=O(w);treeStructure=R(()=>{let t=this.#e.systemInfo();return this.processObject(t,0)});toggleNode(t){t.isOpen.update(n=>!n)}processObject(t,n){let o=[];for(let i in t)typeof t[i]=="object"?o.push({id:i,text:i,children:this.processObject(t[i],n+1),level:n,isOpen:_(!1)}):o.push({id:i,text:`${i}: ${t[i]}`,children:[],level:n,isOpen:_(!1)});return o}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=x({type:e,selectors:[["app-server-settings"]],decls:5,vars:6,consts:()=>{let t;return t=$localize`System info`,[["recursiveTree",""],["treeNode",""],t,[4,"ngTemplateOutlet","ngTemplateOutletContext"],["action","",3,"click"],[3,"open"],[1,"text"]]},template:function(n,o){if(n&1&&(r(0,"h3"),N(1,2),l(),p(2,q,3,2,"ng-template",null,0,$)(4,H,1,0,"ng-container",3)),n&2){let i=C(3);c(4),f("ngTemplateOutlet",i)("ngTemplateOutletContext",m(4,L,m(2,Y,o.treeStructure())))}},dependencies:[k,D,A],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;padding:0 2.5rem}h3[_ngcontent-%COMP%]{font:var(--title-30);margin:0 0 1.25rem}sh-icon[_ngcontent-%COMP%]{font-size:1rem}sh-list[_ngcontent-%COMP%]{padding:0}sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0}sh-list[_ngcontent-%COMP%] [action].cannot-toggle[_ngcontent-%COMP%]{cursor:initial}"],changeDetection:0})};export{S as default};
1
+ import{a as w}from"./chunk-JYRKUYG6.js";import{J as k,v as D}from"./chunk-CJKZ27FM.js";import"./chunk-5E3B4AEF.js";import"./chunk-HDDAGHHE.js";import{aa as A}from"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as O,Bb as I,Cb as v,Cc as m,Db as f,Dc as F,Eb as r,Fb as l,Kc as $,Mb as g,Nb as M,Rc as R,Ta as c,Wb as N,_b as E,ac as a,ea as T,fa as h,hb as x,jc as C,kc as P,lc as y,mb as p,oc as s,pc as b,qa as _,xb as d,yb as u}from"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";var Y=e=>({children:e,level:0}),L=e=>({$implicit:e}),j=(e,t)=>({children:e,level:t}),V=(e,t)=>t.id;function z(e,t){if(e&1&&(r(0,"sh-icon"),s(1,"caret-down"),l()),e&2){let n=a().$implicit;y("open",n.isOpen())}}function B(e,t){e&1&&(r(0,"sh-icon"),s(1,"dot"),l())}function J(e,t){e&1&&g(0)}function U(e,t){if(e&1&&p(0,J,1,0,"ng-container",3),e&2){let n=a().$implicit,o=a().$implicit;a();let i=C(3);f("ngTemplateOutlet",i)("ngTemplateOutletContext",m(5,L,F(2,j,n.children,o.level+1)))}}function X(e,t){if(e&1){let n=M();r(0,"div",4,1),E("click",function(){let i=T(n).$implicit,G=a(2);return h(i.children.length>0&&G.toggleNode(i))}),d(2,z,2,2,"sh-icon",5)(3,B,2,0,"sh-icon"),r(4,"div",6),s(5),l()(),d(6,U,1,7,"ng-container")}if(e&2){let n=t.$implicit;y("cannot-toggle",n.children.length===0)("open",n.isOpen()),c(2),u(n.children.length>0?2:3),c(3),b(n.text),c(),u(n.isOpen()?6:-1)}}function q(e,t){if(e&1&&(r(0,"sh-list"),I(1,X,7,7,null,null,V),l()),e&2){let n=t.$implicit;P("padding-left",n.level*.25,"rem"),c(),v(n.children)}}function H(e,t){e&1&&g(0)}var S=class e{#e=O(w);treeStructure=R(()=>{let t=this.#e.systemInfo();return this.processObject(t,0)});toggleNode(t){t.isOpen.update(n=>!n)}processObject(t,n){let o=[];for(let i in t)typeof t[i]=="object"?o.push({id:i,text:i,children:this.processObject(t[i],n+1),level:n,isOpen:_(!1)}):o.push({id:i,text:`${i}: ${t[i]}`,children:[],level:n,isOpen:_(!1)});return o}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=x({type:e,selectors:[["app-server-settings"]],decls:5,vars:6,consts:()=>{let t;return t=$localize`System info`,[["recursiveTree",""],["treeNode",""],t,[4,"ngTemplateOutlet","ngTemplateOutletContext"],["action","",3,"click"],[3,"open"],[1,"text"]]},template:function(n,o){if(n&1&&(r(0,"h3"),N(1,2),l(),p(2,q,3,2,"ng-template",null,0,$)(4,H,1,0,"ng-container",3)),n&2){let i=C(3);c(4),f("ngTemplateOutlet",i)("ngTemplateOutletContext",m(4,L,m(2,Y,o.treeStructure())))}},dependencies:[k,D,A],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;padding:0 2.5rem}h3[_ngcontent-%COMP%]{font:var(--title-30);margin:0 0 1.25rem}sh-icon[_ngcontent-%COMP%]{font-size:1rem}sh-list[_ngcontent-%COMP%]{padding:0}sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0}sh-list[_ngcontent-%COMP%] [action].cannot-toggle[_ngcontent-%COMP%]{cursor:initial}"],changeDetection:0})};export{S as default};
@@ -0,0 +1,2 @@
1
+ import{a as ge,c as fe,d as xe}from"./chunk-TPKKLIFK.js";import{h as Ce}from"./chunk-X5W2K6AN.js";import{a as ue}from"./chunk-JYRKUYG6.js";import{B as le,H as _e,K as se,P as pe,V as me,W as ce,Y as de,b as ee,c as te,e as ne,i as ie,k as oe,s as ae,v as re}from"./chunk-CJKZ27FM.js";import{aa as Z}from"./chunk-YF6JHIN5.js";import{$ as j,$c as Y,Bb as A,Bc as W,Cb as D,Cc as T,Db as p,Eb as _,Fb as s,Gb as b,Kb as R,Kc as v,Lb as M,Mb as f,Nb as x,Rc as H,Ta as l,Ub as k,Vb as G,Wb as Q,Xc as J,_b as C,ac as r,ea as d,fa as u,hb as q,jc as g,lc as B,mb as S,oc as c,pc as z,qa as P,qc as U,wc as K,xb as F,xc as N,yb as h,yc as O,zb as $}from"./chunk-K5XGRFWJ.js";import{a as L,b as E}from"./chunk-7CGTOI24.js";var Te=[{name:"send-mail-to",type:"Email"},{name:"send-mail-from",type:"Email"},{name:"log-file",type:"FileTree"},{name:"compression-extension-file",type:"FileTree"},{name:"dbpath",type:"FileTree"},{name:"restore-path",type:"FileTree"},{name:"gpg-program-path",type:"FileTree"}];var Fe=()=>({updateOn:"blur"}),y=t=>({formView:t}),w=t=>({$implicit:t});function he(t,i){if(t&1){let e=x();_(0,"button",14),C("click",function(){d(e);let n=r();return u(n.showTextArea.set(!1))}),k(1,6),b(2,"sh-icon"),G(),s()}}function ye(t,i){if(t&1){let e=x();_(0,"button",18,1),C("click",function(){let n=d(e).$implicit,a=r(3);return u(a.addSetting(n))}),_(2,"div",19),c(3),_(4,"p"),c(5),s()()()}if(t&2){let e=i.$implicit;B("deprecated",e.deprecatedDescription),l(3),U(" ",e.shortDescription," "),l(2),z(e.name)}}function we(t,i){if(t&1&&(_(0,"h3",10),c(1),s(),A(2,ye,6,4,"button",17,$)),t&2){let e=i.$implicit;l(),z(e.displayName),l(),D(e.options)}}function Ve(t,i){if(t&1){let e=x();_(0,"sh-menu")(1,"button",20)(2,"sh-icon"),c(3,"dots-three-vertical"),s()(),R(4,16),_(5,"button",14),C("click",function(){d(e);let n=r(2);return u(n.addFreeTextSetting())}),k(6,8),b(7,"sh-icon"),G(),s(),_(8,"button",21),C("click",function(){d(e);let n=r(2);return u(n.showTextArea.set(!0))}),_(9,"sh-icon"),c(10,"link"),s(),c(11," Edit contents as text "),s(),M(),s()}}function Le(t,i){if(t&1&&(_(0,"sh-menu",15)(1,"button",12),k(2,7),b(3,"sh-icon"),G(),s(),R(4,16),A(5,we,4,1,null,null,$),M(),s(),F(7,Ve,12,0,"sh-menu")),t&2){let e=r();p("searchable",!0),l(5),D(e.nonSelectedOptionsGrouped()),l(2),h(e.hasFreeTextSettings()?7:-1)}}function Ie(t,i){if(t&1){let e=x();_(0,"textarea",22),C("ngModelChange",function(n){d(e);let a=r();return u(a.updateSettingsFromText(n))}),s()}if(t&2){let e=r();p("ngModel",e.settingsAsText())("ngModelOptions",W(2,Fe))}}function be(t,i){t&1&&(_(0,"div",23),c(1,"Add a setting above to get started."),s())}function Me(t,i){t&1&&(_(0,"sh-icon",31),c(1," warning-octagon "),s())}function Ne(t,i){if(t&1&&(_(0,"sh-icon",32),c(1,"archive"),s()),t&2){let e=r(2).$implicit;p("shTooltip",e.FormView.deprecatedDescription)}}function ve(t,i){if(t&1&&(_(0,"sh-icon",33),c(1,"question"),s()),t&2){let e=r(2).$implicit;p("shTooltip",e.FormView.longDescription)}}function Ee(t,i){if(t&1&&(F(0,Me,2,0,"sh-icon",31),_(1,"span"),c(2),s(),F(3,Ne,2,1,"sh-icon",32)(4,ve,2,1,"sh-icon",33)),t&2){let e=r().$implicit,o=O(1);h(o?0:-1),l(),B("deprecated",e.FormView.deprecatedDescription),l(),z(e.FormView.shortDescription),l(),h(e.FormView.deprecatedDescription?3:e.FormView.longDescription?4:-1)}}function Pe(t,i){t&1&&f(0)}function $e(t,i){if(t&1){let e=x();_(0,"div",25)(1,"label"),S(2,Pe,1,0,"ng-container",34),s(),_(3,"div")(4,"sh-form-field")(5,"input",35),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.updateFreeTextSettingName(a,n))}),s(),_(6,"sh-icon",36),c(7,"rectangle-dashed"),s()()(),_(8,"div")(9,"sh-form-field")(10,"input",35),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.updateSettingValue(a,n))}),s(),_(11,"sh-icon",36),c(12,"textbox"),s()()()()}if(t&2){let e=r().$implicit,o=g(3);l(2),p("ngTemplateOutlet",o),l(3),p("ngModel",e.Name),l(5),p("ngModel",e.Value())}}function Ae(t,i){t&1&&f(0)}function De(t,i){if(t&1){let e=x();_(0,"app-file-tree",26)(1,"label",37),S(2,Ae,1,0,"ng-container",34),s(),_(3,"input",38),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.updateSettingValue(a,n))}),s()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);p("startingPath",e.Value())("accepts",e.FormView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0)("resolvePaths",!0),l(),p("for",n),l(),p("ngTemplateOutlet",o),l(),p("id",n)("ngModel",e.Value())}}function Re(t,i){if(t&1){let e=x();_(0,"app-file-tree",27),b(1,"label",37),_(2,"input",38),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.updateSettingValue(a,n))}),s()()}if(t&2){let e=r().$implicit,o=O(0);p("startingPath",e.Value())("resolvePaths",!0),l(),p("for",o),l(),p("id",o)("ngModel",e.Value())}}function ke(t,i){t&1&&f(0)}function Ge(t,i){t&1&&f(0)}function Be(t,i){t&1&&(_(0,"sh-icon",36),c(1,"link"),s())}function ze(t,i){t&1&&(_(0,"sh-icon",36),c(1,"hard-drives"),s())}function Ue(t,i){t&1&&(_(0,"sh-icon",36),c(1,"jar"),s())}function Ke(t,i){t&1&&(_(0,"sh-icon",36),c(1,"envelope"),s())}function He(t,i){t&1&&(_(0,"sh-icon",36),c(1,"textbox"),s())}function Je(t,i){if(t&1){let e=x();_(0,"sh-form-field")(1,"label",37),S(2,ke,1,0,"ng-container",34)(3,Ge,1,0,"ng-container",39),s(),_(4,"input",40),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.updateSettingValue(a,n))}),s(),F(5,Be,2,0,"sh-icon",36)(6,ze,2,0,"sh-icon",36)(7,Ue,2,0,"sh-icon",36)(8,Ke,2,0,"sh-icon",36)(9,He,2,0,"sh-icon",36),s()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),p("for",n),l(),p("ngTemplateOutlet",o),l(),p("ngTemplateOutlet",a)("ngTemplateOutletContext",T(10,w,T(8,y,e.FormView))),l(),p("type",e.FormView.type==="Email"?"email":"text")("id",n)("ngModel",e.Value()),l(),h(e.FormView.type==="Path"?5:e.FormView.type==="Hostname"?6:e.FormView.type==="Bucketname"?7:e.FormView.type==="Email"?8:9)}}function Xe(t,i){t&1&&f(0)}function je(t,i){t&1&&f(0)}function qe(t,i){if(t&1){let e=x();_(0,"sh-icon",43),C("click",function(){d(e);let n=r(2).$implicit;return u(n.showPassword=!n.showPassword)}),c(1," eye "),s()}}function Qe(t,i){if(t&1){let e=x();_(0,"sh-icon",43),C("click",function(){d(e);let n=r(2).$implicit;return u(n.showPassword=!n.showPassword)}),c(1," eye-slash "),s()}}function We(t,i){if(t&1){let e=x();_(0,"sh-form-field")(1,"label",37),S(2,Xe,1,0,"ng-container",34)(3,je,1,0,"ng-container",39),s(),_(4,"input",41),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.updateSettingValue(a,n))}),s(),_(5,"sh-icon",36),c(6,"password"),s(),F(7,qe,2,0,"sh-icon",42)(8,Qe,2,0,"sh-icon",42),s()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),p("for",n),l(),p("ngTemplateOutlet",o),l(),p("ngTemplateOutlet",a)("ngTemplateOutletContext",T(10,w,T(8,y,e.FormView))),l(),p("type",e.showPassword?"text":"password")("id",n)("ngModel",e.Value()),l(3),h(e.showPassword?7:8)}}function Ye(t,i){t&1&&f(0)}function Ze(t,i){t&1&&f(0)}function et(t,i){if(t&1&&c(0),t&2){let e=i.$implicit;U(" ",e," ")}}function tt(t,i){if(t&1){let e=x();_(0,"sh-select",44)(1,"label",37),S(2,Ye,1,0,"ng-container",34)(3,Ze,1,0,"ng-container",39),s(),_(4,"input",38),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.updateSettingValue(a,n))}),s()(),S(5,et,1,1,"ng-template",null,3,v)}if(t&2){let e=g(6),o=r().$implicit,n=g(3),a=O(0);r(2);let m=g(10);p("options",o.FormView.options)("isClearable",!1)("optionTemplate",e),l(),p("for",a),l(),p("ngTemplateOutlet",n),l(),p("ngTemplateOutlet",m)("ngTemplateOutletContext",T(11,w,T(9,y,o.FormView))),l(),p("id",a)("ngModel",o.Value())}}function nt(t,i){t&1&&f(0)}function it(t,i){t&1&&f(0)}function ot(t,i){if(t&1){let e=x();_(0,"app-size",45),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.updateSettingValue(a,n))}),_(1,"label",37),S(2,nt,1,0,"ng-container",34)(3,it,1,0,"ng-container",39),s()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);p("inputType",e.Name)("ngModel",e.Value())("customId",n),l(),p("for",n),l(),p("ngTemplateOutlet",o),l(),p("ngTemplateOutlet",a)("ngTemplateOutletContext",T(9,w,T(7,y,e.FormView)))}}function at(t,i){t&1&&f(0)}function rt(t,i){t&1&&f(0)}function lt(t,i){if(t&1){let e=x();_(0,"sh-form-field")(1,"label",37),S(2,at,1,0,"ng-container",34)(3,rt,1,0,"ng-container",39),s(),_(4,"input",46),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.updateSettingValue(a,n))}),s(),_(5,"sh-icon",36),c(6,"numpad"),s()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),p("for",n),l(),p("ngTemplateOutlet",o),l(),p("ngTemplateOutlet",a)("ngTemplateOutletContext",T(8,w,T(6,y,e.FormView))),l(),p("id",n)("ngModel",e.Value())}}function _t(t,i){t&1&&f(0)}function st(t,i){t&1&&f(0)}function pt(t,i){if(t&1){let e=x();_(0,"sh-toggle",29)(1,"label",37),S(2,_t,1,0,"ng-container",34)(3,st,1,0,"ng-container",39),s(),_(4,"input",47),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.updateSettingValue(a,n))}),s()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),p("for",n),l(),p("ngTemplateOutlet",o),l(),p("ngTemplateOutlet",a)("ngTemplateOutletContext",T(8,w,T(6,y,e.FormView))),l(),p("id",n)("ngModel",e.Value())}}function mt(t,i){t&1&&f(0)}function ct(t,i){t&1&&f(0)}function dt(t,i){if(t&1&&c(0),t&2){let e=i.$implicit;U(" ",e," ")}}function ut(t,i){if(t&1){let e=x();_(0,"sh-select",48)(1,"label",37),S(2,mt,1,0,"ng-container",34)(3,ct,1,0,"ng-container",39),s(),_(4,"input",49),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.updateSettingValue(a,n))}),s()(),S(5,dt,1,1,"ng-template",null,4,v)}if(t&2){let e=g(6),o=r().$implicit,n=g(3),a=O(0);r(2);let m=g(10);p("options",o.FormView.options)("selectMultiple",!0)("optionTemplate",e),l(),p("for",a),l(),p("ngTemplateOutlet",n),l(),p("ngTemplateOutlet",m)("ngTemplateOutletContext",T(10,w,T(8,y,o.FormView))),l(),p("ngModel",o.Value())}}function Ct(t,i){t&1&&f(0)}function gt(t,i){t&1&&f(0)}function ft(t,i){if(t&1){let e=x();_(0,"app-timespan",45),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.updateSettingValue(a,n))}),_(1,"label",37),S(2,Ct,1,0,"ng-container",34)(3,gt,1,0,"ng-container",39),s()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);p("inputType",e.Name)("ngModel",e.Value())("customId",n),l(),p("for",n),l(),p("ngTemplateOutlet",o),l(),p("ngTemplateOutlet",a)("ngTemplateOutletContext",T(9,w,T(7,y,e.FormView)))}}function xt(t,i){if(t&1){let e=x();K(0)(1),S(2,Ee,5,5,"ng-template",null,2,v),_(4,"div",24),F(5,$e,13,3,"div",25)(6,De,4,10,"app-file-tree",26)(7,Re,3,5,"app-file-tree",27)(8,Je,10,12,"sh-form-field")(9,We,9,12,"sh-form-field")(10,tt,7,13)(11,ot,4,11,"app-size",28)(12,lt,7,10,"sh-form-field")(13,pt,5,10,"sh-toggle",29)(14,ut,7,12)(15,ft,4,11,"app-timespan",28),_(16,"button",30),C("click",function(){let n=d(e).$implicit,a=r(2);return u(a.removeSetting(n))}),_(17,"sh-icon"),c(18,"x-bold"),s()()()}if(t&2){let e=i.$implicit,o=i.$index,n=r(2);N("destination-"+e.Name+o),l(),N(n.inAppOptions(e.Name)),l(3),B("align-remove-start",e.FormView.type==="FolderTree"||e.FormView.type==="FileTree"||e.FormView.type==="Boolean"),l(),h(e.FormView.type==="FreeText"?5:e.FormView.type==="FileTree"?6:e.FormView.type==="FolderTree"?7:e.FormView.type==="String"||e.FormView.type==="Path"||e.FormView.type==="Decimal"||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==="Size"?11:e.FormView.type==="Integer"?12:e.FormView.type==="Boolean"?13:e.FormView.type==="Flags"?14:e.FormView.type==="Timespan"||e.FormView.type==="DateTime"?15:-1)}}function Tt(t,i){if(t&1&&(F(0,be,2,0,"div",23),A(1,xt,19,5,null,null,$)),t&2){let e=r();h(e.selectedSettings().length===0?0:-1),l(),D(e.selectedSettings())}}function St(t,i){if(t&1&&(_(0,"sh-icon",50),c(1,"x-circle"),s()),t&2){r();let e=O(0);p("shTooltip",(e==null?null:e.message)??"Invalid value")}}function Ot(t,i){if(t&1&&(_(0,"sh-icon",32),c(1,"warning"),s()),t&2){r();let e=O(0);p("shTooltip",(e==null?null:e.message)??"Invalid value")}}function Ft(t,i){if(t&1&&(K(0),F(1,St,2,1,"sh-icon",50)(2,Ot,2,1,"sh-icon",32)),t&2){r();let e=O(0),o=r().$implicit,n=N(o.formView.validate(e));l(),h((n==null?null:n.type)==="error"?1:(n==null?null:n.type)==="warning"?2:-1)}}function ht(t,i){if(t&1&&(K(0),F(1,Ft,3,2)),t&2){let e=r().$implicit,n=(N(e.Value())??"").toString().trim()==="";l(),h(!n&&e.formView.validate?1:-1)}}function yt(t,i){if(t&1&&F(0,ht,2,2),t&2){let e=i.$implicit;h(e.Value?0:-1)}}var Se=class t{#e=j(ue);options=Y.required();hiddenOptions=J([]);hasFreeTextSettings=J(!1);applicationOptions=J();showTextArea=P(!1);allOptionsGrouped=this.#e.allOptionsGrouped;allOptions=this.#e.allOptions;selectedSettings=H(()=>{let i=this.hiddenOptions();return this.options().map(n=>{let a=this.allOptions().find(V=>V.name===n.Name?.replace("--","")),m=n.Value??"";if(a&&i.includes(a.name))return null;if(a){if(a.type==="Boolean"&&(m=this.isTrue(m)),a.type==="Integer"&&(m=parseInt(m)||0),a.type==="Enumeration"&&a.options){let I=m?.trim().toLowerCase(),X=a.options.find(Oe=>(Oe??"").trim().toLocaleLowerCase()===I);X&&(m=X)}let V=Te.find(I=>I.name===a?.name);return V&&(a=L(L({},a),V)),E(L({},n),{Value:P(m),FormView:a})}else if(this.hasFreeTextSettings())return E(L({},n),{Value:P(m),FormView:{name:n.Name,type:"FreeText",shortDescription:"Custom settings argument",longDescription:"Custom settings argument"}});return null}).filter(n=>n!==null)});nonSelectedOptionsGrouped=H(()=>{let i=this.options().map(o=>o.Name?.replace("--","")),e=this.hiddenOptions();return this.allOptionsGrouped().map(o=>E(L({},o),{options:o.options.filter(n=>!i.includes(n.name)&&!e.includes(n.name))})).filter(o=>o.options.length>0)});settingsAsText=H(()=>this.selectedSettings().map(i=>{let e=i.Value(),o="";return typeof e=="boolean"?o=this.isTrue(e)?"True":"False":(typeof e=="number"||e!=null)&&(o=e.toString()),`${i.Name??""}=${o}`}).join(`
2
+ `));updateSettingsFromText(i){if(typeof i!="string")return;let e=Ce(i);this.options.update(()=>e)}isTrue(i){if(typeof i=="boolean")return i;if(typeof i=="string"){let e=i.toLowerCase();return e==="true"||e==="1"||e==="yes"||e==="on"}return!1}inAppOptions(i){let e=this.applicationOptions()?.findIndex(o=>o.Name?.replace("--","")===i);return e===void 0?!1:e>-1}addFreeTextSetting(){this.hasFreeTextSettings()&&this.options.update(i=>[...i,{Filter:null,Name:"",Value:""}])}addSetting(i){this.options.update(e=>{let o=i.defaultValue??"";return i.type==="Boolean"&&(o=this.isTrue(o)),i.type==="Integer"&&(o=parseInt(o)||0),[...e,{Name:i.name,Value:o}]})}updateSettingValue(i,e){this.options.update(o=>{let n=[...o],a=n.findIndex(m=>m.Name===i.Name);if(i.FormView.type==="Boolean")return n[a].Value=this.isTrue(e)?"True":"False",n;if(i.FormView.type==="Integer")return n[a].Value=e.toString(),n;if(i.FormView.type==="Enumeration"&&i.FormView.options){let m=e?.trim().toLowerCase()??"",V=i.FormView.options.find(I=>(I??"").trim().toLocaleLowerCase()===m);if(V)return n[a].Value=V,n}return n[a].Value=e,n})}updateFreeTextSettingName(i,e){this.options.update(o=>{let n=[...o],a=n.findIndex(m=>m.Name===i.Name);return n[a].Name=e,n})}removeSetting(i){this.options.update(e=>e.filter(o=>o.Name!==i.Name))}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=q({type:t,selectors:[["app-options-list"]],inputs:{options:[1,"options"],hiddenOptions:[1,"hiddenOptions"],hasFreeTextSettings:[1,"hasFreeTextSettings"],applicationOptions:[1,"applicationOptions"]},outputs:{options:"optionsChange"},decls:11,vars:4,consts:()=>{let i;i=$localize`Advanced options`;let e;e=$localize` Show editor ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let o;o=$localize` Add advanced option ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`;let n;n=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:pen${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: New custom option `;let a;return a=$localize`By adding this option it will override the matching global option`,[["validateTemplate",""],["option",""],["defaultLabel",""],["enumOptionTemplate",""],["optionTemplate",""],i,e,o,n,[3,"disableToggle","isActive"],["title",""],[1,"actions"],["shButton","","type","button",1,"outlined","small"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModel","ngModelOptions"],["shButton","","type","button",1,"outlined","small",3,"click"],[3,"searchable"],["menu",""],["type","button",3,"deprecated"],["type","button",3,"click"],[1,"option-col"],["shButton","","type","button",1,"small"],["shButton","","type","button",1,"small",3,"click"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModelChange","ngModel","ngModelOptions"],[1,"placeholder"],[1,"field-row"],[1,"form-column"],[3,"startingPath","accepts","showFiles","showHiddenNodes","selectFiles","resolvePaths"],[3,"startingPath","resolvePaths"],[3,"inputType","ngModel","customId"],[1,"primary","raised"],["shButton","","type","button",1,"outlined","small","remove-btn",3,"click"],["shTooltip",a,1,"error"],[1,"warn",3,"shTooltip"],[1,"primary",3,"shTooltip"],[4,"ngTemplateOutlet"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],[3,"for"],["type","text",3,"ngModelChange","id","ngModel"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"ngModelChange","type","id","ngModel"],["autocomplete","new-password",3,"ngModelChange","type","id","ngModel"],["suffix","",1,"clickable"],["suffix","",1,"clickable",3,"click"],[3,"options","isClearable","optionTemplate"],[3,"ngModelChange","inputType","ngModel","customId"],["type","number",3,"ngModelChange","id","ngModel"],["type","checkbox",3,"ngModelChange","id","ngModel"],[1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["type","text","id","text",3,"ngModelChange","ngModel"],[1,"error",3,"shTooltip"]]},template:function(e,o){e&1&&(_(0,"sh-toggle-card",9),R(1,10)(2),Q(3,5),M(),_(4,"div",11),F(5,he,3,0,"button",12)(6,Le,8,2),s(),M(),F(7,Ie,1,3,"textarea",13)(8,Tt,3,1),s(),S(9,yt,1,1,"ng-template",null,0,v)),e&2&&(p("disableToggle",!0)("isActive",!0),l(5),h(o.showTextArea()?5:6),l(2),h(o.showTextArea()?7:8))},dependencies:[ae,te,oe,ee,ne,ie,ge,fe,xe,Z,me,_e,le,se,de,re,pe,ce],styles:["[_nghost-%COMP%]{display:block}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}sh-toggle[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1rem}.placeholder[_ngcontent-%COMP%]{color:var(--base-9);text-align:center;padding:2rem 1rem}.field-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;position:relative;z-index:1;max-width:32.5rem;width:100%}.field-row[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{align-self:flex-end}.field-row[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:first-child{max-width:28rem;width:100%}.field-row.align-remove-start[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{align-self:flex-start}.option-col[_ngcontent-%COMP%]{display:flex;flex-direction:column}.option-col[_ngcontent-%COMP%] .fill[_ngcontent-%COMP%]{color:var(--base-12)}.form-column[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-direction:column}label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}sh-icon[_ngcontent-%COMP%]{font-size:1rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:flex-end}.deprecated[_ngcontent-%COMP%]{text-decoration:line-through}.raw-text-area[_ngcontent-%COMP%]{min-height:12rem;white-space:pre}"],changeDetection:0})};export{Se as a};
@@ -1 +1 @@
1
- import{d}from"./chunk-DSYNIXJF.js";import{F as n,Qc as s,V as o,_ as r,pa as l,ra as g}from"./chunk-TQTOIWBK.js";var u=[{value:"Disabled",label:$localize`Disabled`},{value:"Verbose",label:$localize`Verbose`},{value:"ExplicitOnly",label:$localize`Explicit only`},{value:"Profiling",label:$localize`Profiling`},{value:"Retry",label:$localize`Retry`},{value:"Information",label:$localize`Information`},{value:"DryRun",label:$localize`Dry run`},{value:"Warning",label:$localize`Warning`},{value:"Error",label:$localize`Error`}],v=class a{#l=r(d);#e=l([]);LOG_LEVELS=u;logLevel=l("Disabled");logLevelByLabel=s(()=>u.find(e=>e.value===this.logLevel())?.label);whenFilter=l(null);backupIdFilter=l(null);id=l(0);logs=s(()=>this.whenFilter()&&this.backupIdFilter()?this.#e().filter(e=>e.BackupID===this.backupIdFilter()&&new Date(e.When).getTime()>=this.whenFilter()&&e.BackupID===this.backupIdFilter()):this.#e());timerInterval;logsLoading=l(!1);isPolling=l(!1);pagination=l({offset:0,pagesize:100});logLevelEffect=g(()=>{this.isPolling()?(this.#e.set([]),this.id.set(0),queueMicrotask(()=>this.loadLogs()),this.timerInterval&&clearInterval(this.timerInterval),this.timerInterval=setInterval(()=>{this.loadLogs()},3e3)):this.clearPolling()});setWhenFilter(e){this.whenFilter.set(e)}setBackupIdFilter(e){this.backupIdFilter.set(e)}loadLogs(){this.logsLoading.set(!0),this.#l.getApiV1LogdataPoll({id:this.id(),level:this.logLevel(),pagesize:this.pagination().pagesize}).pipe(n(()=>this.logsLoading.set(!1))).subscribe({next:e=>{let i=e.reverse(),t=this.#i(i);t>0&&this.id.set(t),this.#e.set([...i,...this.#e()])}})}updateLogLevel(e){this.logLevel.set(e),e==="Disabled"&&this.clearPolling()}#i(e){return e.reduce((i,t)=>Math.max(i,t.ID),0)}destroy(){this.logLevel.set("Disabled"),this.clearPolling()}clearPolling(){this.timerInterval&&clearInterval(this.timerInterval),this.timerInterval=void 0}static \u0275fac=function(i){return new(i||a)};static \u0275prov=o({token:a,factory:a.\u0275fac,providedIn:"root"})};export{v as a};
1
+ import{d}from"./chunk-5E3B4AEF.js";import{$ as r,G as n,Rc as s,W as o,qa as l,sa as g}from"./chunk-K5XGRFWJ.js";var u=[{value:"Disabled",label:$localize`Disabled`},{value:"Verbose",label:$localize`Verbose`},{value:"ExplicitOnly",label:$localize`Explicit only`},{value:"Profiling",label:$localize`Profiling`},{value:"Retry",label:$localize`Retry`},{value:"Information",label:$localize`Information`},{value:"DryRun",label:$localize`Dry run`},{value:"Warning",label:$localize`Warning`},{value:"Error",label:$localize`Error`}],v=class a{#l=r(d);#e=l([]);LOG_LEVELS=u;logLevel=l("Disabled");logLevelByLabel=s(()=>u.find(e=>e.value===this.logLevel())?.label);whenFilter=l(null);backupIdFilter=l(null);id=l(0);logs=s(()=>this.whenFilter()&&this.backupIdFilter()?this.#e().filter(e=>e.BackupID===this.backupIdFilter()&&new Date(e.When).getTime()>=this.whenFilter()&&e.BackupID===this.backupIdFilter()):this.#e());timerInterval;logsLoading=l(!1);isPolling=l(!1);pagination=l({offset:0,pagesize:100});logLevelEffect=g(()=>{this.isPolling()?(this.#e.set([]),this.id.set(0),queueMicrotask(()=>this.loadLogs()),this.timerInterval&&clearInterval(this.timerInterval),this.timerInterval=setInterval(()=>{this.loadLogs()},3e3)):this.clearPolling()});setWhenFilter(e){this.whenFilter.set(e)}setBackupIdFilter(e){this.backupIdFilter.set(e)}loadLogs(){this.logsLoading.set(!0),this.#l.getApiV1LogdataPoll({id:this.id(),level:this.logLevel(),pagesize:this.pagination().pagesize}).pipe(n(()=>this.logsLoading.set(!1))).subscribe({next:e=>{let i=e.reverse(),t=this.#i(i);t>0&&this.id.set(t),this.#e.set([...i,...this.#e()])}})}updateLogLevel(e){this.logLevel.set(e),e==="Disabled"&&this.clearPolling()}#i(e){return e.reduce((i,t)=>Math.max(i,t.ID),0)}destroy(){this.logLevel.set("Disabled"),this.clearPolling()}clearPolling(){this.timerInterval&&clearInterval(this.timerInterval),this.timerInterval=void 0}static \u0275fac=function(i){return new(i||a)};static \u0275prov=o({token:a,factory:a.\u0275fac,providedIn:"root"})};export{v as a};
@@ -0,0 +1 @@
1
+ import{a as ne}from"./chunk-MJPEKJ3T.js";import{q as ee}from"./chunk-RTGUYIWH.js";import"./chunk-PNQ5BDQN.js";import{d as Z}from"./chunk-TPKKLIFK.js";import"./chunk-X5W2K6AN.js";import"./chunk-6Q6SSTBK.js";import"./chunk-COEGVUM3.js";import"./chunk-QGAOYLQU.js";import"./chunk-RM2KGG7J.js";import"./chunk-PEOYNJJM.js";import"./chunk-QZEIAQ3M.js";import"./chunk-2KD757N6.js";import"./chunk-AFHEXZUZ.js";import"./chunk-JYRKUYG6.js";import"./chunk-VNXFTYQQ.js";import{B as j,H as Q,P as q,c as X,e as W,i as z,k as V,s as H,v as Y}from"./chunk-CJKZ27FM.js";import"./chunk-5E3B4AEF.js";import{b as U,d as J}from"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as C,Bc as D,Db as m,Eb as i,Fb as a,Gb as P,Nb as g,Ta as p,Ub as N,Vb as E,Wb as l,Yc as K,_b as f,ac as c,ea as O,fa as S,hb as $,hc as v,ic as B,lc as x,qa as w,tc as d,uc as T,vc as u,xb as L,yb as G}from"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";var te=["formRef"],ie=()=>["--skip-files-larger-than","encryption-module","no-encryption","--no-encryption","--dbpath","--exclude-files-attributes","keep-time","keep-versions","retention-policy"];function oe(s,r){s&1&&(i(0,"p"),l(1,4),a())}function ae(s,r){if(s&1){let n=g();i(0,"p"),l(1,5),a(),i(2,"app-timespan",21),u("ngModelChange",function(o){O(n);let t=c();return T(t.optionsFields.backupRetentionTime,o)||(t.optionsFields.backupRetentionTime=o),S(o)}),i(3,"label",22),l(4,6),a()()}if(s&2){let n=c();p(2),m("customId","backupRetentionTime"),d("ngModel",n.optionsFields.backupRetentionTime)}}function se(s,r){if(s&1){let n=g();i(0,"p"),l(1,7),a(),i(2,"sh-form-field")(3,"label",23),l(4,8),a(),i(5,"input",24),u("ngModelChange",function(o){O(n);let t=c();return T(t.optionsFields.backupRetentionVersions,o)||(t.optionsFields.backupRetentionVersions=o),S(o)}),a()()}if(s&2){let n=c();p(5),d("ngModel",n.optionsFields.backupRetentionVersions)}}function _e(s,r){s&1&&(i(0,"p"),l(1,9),a())}function le(s,r){if(s&1){let n=g();i(0,"p"),l(1,10),a(),i(2,"sh-form-field")(3,"p"),l(4,11),a(),i(5,"label",25),l(6,12),a(),i(7,"input",26),u("ngModelChange",function(o){O(n);let t=c();return T(t.optionsFields.backupRetentionCustom,o)||(t.optionsFields.backupRetentionCustom=o),S(o)}),a()()}if(s&2){let n=c();p(7),d("ngModel",n.optionsFields.backupRetentionCustom)}}var re=[{value:"all",name:$localize`Keep all backups`},{value:"time",name:$localize`Delete backups that are older than`},{value:"versions",name:$localize`Keep a specific number of backups`},{value:"smart",name:$localize`Smart backup retention`},{value:"custom",name:$localize`Custom backup retention`}],h=class s{#e=C(ee);#n=C(J);#t=C(U);formRef=K.required("formRef");isSubmitting=this.#e.isSubmitting;settings=this.#e.settings;optionsFields=this.#e.optionsFields;applicationOptions=this.#e.applicationOptions;retentionOptions=w(re);goBack(){this.#n.navigate(["schedule"],{relativeTo:this.#t.parent})}submit(){switch(this.#e.validateBeforeSubmit()){case"general":this.#n.navigate(["general"],{relativeTo:this.#t.parent});return;case"destination":this.#n.navigate(["destination"],{relativeTo:this.#t.parent});return;case"source":this.#n.navigate(["source-data"],{relativeTo:this.#t.parent});return}this.#e.submit()}static \u0275fac=function(n){return new(n||s)};static \u0275cmp=$({type:s,selectors:[["app-advanced-options-settings"]],viewQuery:function(n,e){n&1&&v(e.formRef,te,5),n&2&&B()},decls:20,vars:12,consts:()=>{let r;r=$localize`Options`;let n;n=$localize`Backup retention`;let e;e=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `;let t;t=$localize`Nothing will be deleted. The backup size will grow with each change.`;let M;M=$localize`If at least one newer backup is found, all backups older than this date are deleted.`;let I;I=$localize`Time to keep versions`;let R;R=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let b;b=$localize`Number of versions`;let y;y=$localize` Over time backups will be deleted automatically. There will remain one backup for each of the last 7 days, each of the last 4 weeks, each of the last 12 months. There will always be at least one remaining backup. `;let A;A=$localize` Enter a retention strategy manually. Placeholders are D/W/Y for days/weeks/years and U for unlimited. The syntax is: 7D:1D,4W:1W,36M:1M. This example keeps one backup for each of the next 7 days, one for each of the next 4 weeks, and one for each of the next 36 months. This can also be written as 1W:1D,1M:1W,3Y:1M. `;let k;k=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let F;return F=$localize`Retention expression`,[r,n,e,o,t,M,I,R,b,y,A,k,F,[1,"title-30"],["value","value","label","name",3,"options","inlineSearch","isClearable"],["for","size"],["type","text",3,"ngModelChange","ngModel"],[3,"optionsChange","options","applicationOptions","hasFreeTextSettings","hiddenOptions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],[3,"ngModelChange","customId","ngModel"],["for","backupRetentionTime"],["for","backupRetentionVersions"],["type","number","id","backupRetentionVersions",3,"ngModelChange","ngModel"],["for","backupRetentionCustom"],["type","text","id","backupRetentionCustom",3,"ngModelChange","ngModel"]]},template:function(n,e){n&1&&(i(0,"section")(1,"h3",13),l(2,0),a(),i(3,"sh-select",14)(4,"label",15),l(5,1),a(),i(6,"input",16),u("ngModelChange",function(t){return T(e.optionsFields.backupRetention,t)||(e.optionsFields.backupRetention=t),t}),a()(),L(7,oe,2,0,"p")(8,ae,5,2)(9,se,6,1)(10,_e,2,0,"p")(11,le,8,1),i(12,"app-options-list",17),u("optionsChange",function(t){return T(e.settings,t)||(e.settings=t),t}),a(),i(13,"div",18)(14,"button",19),f("click",function(){return e.goBack()}),N(15,2),P(16,"sh-icon"),E(),a(),i(17,"button",20),f("click",function(){return e.submit()}),N(18,3),P(19,"sh-icon"),E(),a()()()),n&2&&(p(3),m("options",e.retentionOptions())("inlineSearch",!0)("isClearable",!1),p(3),d("ngModel",e.optionsFields.backupRetention),p(),G(e.optionsFields.backupRetention()==="all"?7:e.optionsFields.backupRetention()==="time"?8:e.optionsFields.backupRetention()==="versions"?9:e.optionsFields.backupRetention()==="smart"?10:e.optionsFields.backupRetention()==="custom"?11:-1),p(5),d("options",e.settings),m("applicationOptions",e.applicationOptions())("hasFreeTextSettings",!0)("hiddenOptions",D(11,ie)),p(5),x("loading",e.isSubmitting()))},dependencies:[H,X,V,W,z,ne,Z,j,Y,q,Q],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:37.5rem;padding:2.5rem}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.remote-volume-wrap[_ngcontent-%COMP%] p.warning[_ngcontent-%COMP%]{color:#7d7d00}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 2.5rem;align-items:flex-end}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}"],changeDetection:0})};export{h as default};
@@ -0,0 +1 @@
1
+ import{e as a,f as b}from"./chunk-KI2HT2TI.js";import"./chunk-MJPEKJ3T.js";import"./chunk-RTGUYIWH.js";import"./chunk-PNQ5BDQN.js";import"./chunk-TPKKLIFK.js";import"./chunk-X5W2K6AN.js";import"./chunk-6Q6SSTBK.js";import"./chunk-COEGVUM3.js";import"./chunk-QGAOYLQU.js";import"./chunk-RM2KGG7J.js";import"./chunk-PEOYNJJM.js";import"./chunk-QZEIAQ3M.js";import"./chunk-2KD757N6.js";import"./chunk-AFHEXZUZ.js";import"./chunk-JYRKUYG6.js";import"./chunk-VNXFTYQQ.js";import"./chunk-CJKZ27FM.js";import"./chunk-5E3B4AEF.js";import"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";export{a as createRestoreSelectFilesForm,b as default};
@@ -1,3 +1,3 @@
1
- import{a as Ce}from"./chunk-TZ7MW3NZ.js";import{a as pe}from"./chunk-TVFRVP7K.js";import"./chunk-QDDVZ4CR.js";import"./chunk-BLSV7CNZ.js";import"./chunk-F2ZC26DC.js";import{l as ge,q as b}from"./chunk-43WATFQS.js";import"./chunk-CAQ3XMFP.js";import"./chunk-UZ4POLDC.js";import"./chunk-O56QUSSI.js";import{b as _e}from"./chunk-F3JYPWPK.js";import"./chunk-736PM4LG.js";import"./chunk-TCXCC5BM.js";import"./chunk-GKGMP6VF.js";import{a as de}from"./chunk-6Q6SSTBK.js";import"./chunk-YCJYEQF7.js";import"./chunk-AXQQEOTT.js";import"./chunk-UTXZPAY6.js";import"./chunk-IMQUTGIK.js";import"./chunk-ANSV4G2K.js";import"./chunk-F3ETZKLK.js";import{b as A}from"./chunk-IQL3REGJ.js";import"./chunk-E4NQOMJX.js";import{a as ue}from"./chunk-YYD2JU6T.js";import"./chunk-6JS7B4FW.js";import{B as oe,G as ie,H as ae,L as se,P as re,Y as le,c as H,e as z,f as W,j,p as Q,q as Y,r as Z,s as ee,t as te,v as ne}from"./chunk-VKQQDCUN.js";import{b as ce,d as me}from"./chunk-DSYNIXJF.js";import{b as K,d as J,e as X}from"./chunk-NPFPMA4P.js";import"./chunk-O2SMJYPC.js";import"./chunk-N2AU7VKX.js";import"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import{$b as F,Ac as V,Cb as C,Db as m,Eb as a,Fb as r,Mb as G,Qc as q,Sa as d,Tb as _,Ub as p,V as L,Vb as B,Wb as U,Xb as x,Zb as I,_ as u,da as h,ea as S,gb as R,kc as v,pa as E,ra as $,sc as M,tc as D,uc as O,wb as y,xb as k,zc as w}from"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";var f=class c{#e=new Map;saveState(t){let e=de();return this.#e.set(e,t),e}getState(t){return this.#e.get(t)}static \u0275fac=function(e){return new(e||c)};static \u0275prov=L({token:c,factory:c.\u0275fac,providedIn:"root"})};var he=()=>["backup"];function Se(c,t){c&1&&r(0,"sh-progress-bar",10)}function Te(c,t){if(c&1){let e=G();m(0,"form",11)(1,"sh-select",12)(2,"label",13),_(3,1),r(4,"sh-icon",14),p(),a(),r(5,"input",15),a(),m(6,"sh-form-field")(7,"label",16),_(8,2),r(9,"sh-icon",17),p(),a(),r(10,"textarea",18),a(),m(11,"sh-form-field")(12,"label",19),_(13,3),r(14,"sh-icon",20),p(),a(),r(15,"textarea",21),a()(),m(16,"sh-divider"),B(17,4),a(),m(18,"form",11)(19,"sh-form-field")(20,"label",22),_(21,5),r(22,"sh-icon",23),p(),a(),r(23,"input",24),a(),m(24,"sh-form-field")(25,"label",25),_(26,6),r(27,"sh-icon",26),p(),a(),r(28,"input",27),a(),m(29,"app-filters",28),O("filtersChange",function(i){h(e);let s=F();return D(s.filters,i)||(s.filters=i),S(i)}),I("filtersChange",function(i){h(e);let s=F();return S(s.updateFilters(i))}),a()(),m(30,"app-options-list",29),O("optionsChange",function(i){h(e);let s=F();return D(s.settings,i)||(s.settings=i),S(i)}),a(),m(31,"div",30)(32,"button",31),I("click",function(){h(e);let i=F();return S(i.submit())}),_(33,7),r(34,"sh-icon"),p(),a()()}if(c&2){let e=F();C("formGroup",e.baseCmdForm),d(),C("options",e.commandOptions()??V(11,he))("inlineSearch",!0),d(17),C("formGroup",e.standardFields),d(11),M("filters",e.filters),C("osType",e.osType()??""),d(),M("options",e.settings),C("hasFreeTextSettings",!0),d(2),v("loading",e.isSubmitting()),d(2),U(e.baseCmdForm.value.command),x(33)}}var l=new Z,P=class c{#e=u(b);#n=u(me);#o=u(J);#t=u(K);#a=u(ce);#s=u(_e);#i=u(f);#r=u(ue);osType=q(()=>this.#r.systemInfo()?.OSType);#l=A(this.#t.params);commandOptions=A(this.#a.getApiV1Commandline());isSubmitting=E(!1);optionsFields=this.#e.optionsFields;standardFields=l.group({"backup-id":l.control(""),"backup-name":l.control(""),dbpath:l.control(""),filters:l.array([])});baseCmdForm=l.group({command:l.control("backup"),targetUrl:l.control(""),arguments:l.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;filters=E([]);settings=this.#e.settings;updateFilters(t){this.standardFields.controls.filters.clear(),t.forEach(e=>this.standardFields.controls.filters.push(l.control(e))),this.filters.set(t)}#m=$(()=>{let t=this.#l()?.id;this.#e.backupId.set(t),this.getBackup(t)});getBackup(t){this.#n.getApiV1BackupById({id:t}).subscribe({next:e=>{this.#e.mapScheduleToForm(e.Schedule??null),e.Backup&&(this.#e.mapGeneralToForm(e.Backup),this.mapStandardFieldsToForm(e.Backup),this.mapBaseCmdToForm(e.Backup),this.#e.mapOptionsToForms(e.Backup,!0)),this.applyStateFromUrl(),this.#e.finishedLoading.set(!0)}})}mapStandardFieldsToForm(t){if(this.standardFields.patchValue({dbpath:t.DBPath,"backup-id":t.ID,"backup-name":t.Name}),this.standardFields.controls.filters.clear(),t.Filters&&t.Filters.length){let e=t.Filters.map(n=>`${n.Include?"":"-"}${n.Expression}`);e.forEach(n=>{this.standardFields.controls.filters.push(l.control(n))}),this.filters.set(e)}else this.filters.set([])}submit(){this.#s.resumeDialogCheck(()=>this.#c())}#c(){this.isSubmitting.set(!0);let t=this.updateUrl(),e=this.baseCmdForm.value,n=e.targetUrl??"",i=(e.arguments??"").split(`
1
+ import{a as Ce}from"./chunk-MJPEKJ3T.js";import{a as pe}from"./chunk-JB26UVQP.js";import"./chunk-FQINMZH2.js";import"./chunk-ZTENLO77.js";import"./chunk-ZKIZ7IIA.js";import{l as ge,q as b}from"./chunk-RTGUYIWH.js";import"./chunk-PNQ5BDQN.js";import"./chunk-TPKKLIFK.js";import"./chunk-X5W2K6AN.js";import{b as _e}from"./chunk-AXG7WHBS.js";import"./chunk-AXLO5KWF.js";import"./chunk-BPHX6VXP.js";import"./chunk-XWML36YQ.js";import{a as de}from"./chunk-6Q6SSTBK.js";import"./chunk-COEGVUM3.js";import"./chunk-QGAOYLQU.js";import"./chunk-RM2KGG7J.js";import"./chunk-PEOYNJJM.js";import"./chunk-5W4BSVZJ.js";import"./chunk-QZEIAQ3M.js";import{b as A}from"./chunk-2KD757N6.js";import"./chunk-AFHEXZUZ.js";import{a as ue}from"./chunk-JYRKUYG6.js";import"./chunk-VNXFTYQQ.js";import{B as oe,G as ie,H as ae,L as se,P as re,Y as le,c as H,e as z,f as W,j,p as Q,q as Y,r as Z,s as ee,t as te,v as ne}from"./chunk-CJKZ27FM.js";import{b as ce,d as me}from"./chunk-5E3B4AEF.js";import{b as K,d as J,e as X}from"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as u,Ac as w,Bc as V,Db as C,Eb as m,Fb as a,Gb as r,Nb as G,Rc as q,Ta as d,Ub as _,Vb as p,W as L,Wb as B,Xb as U,Yb as x,_b as I,ac as F,ea as h,fa as S,hb as R,lc as v,qa as E,sa as $,tc as M,uc as D,vc as O,xb as y,yb as k}from"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";var f=class c{#e=new Map;saveState(t){let e=de();return this.#e.set(e,t),e}getState(t){return this.#e.get(t)}static \u0275fac=function(e){return new(e||c)};static \u0275prov=L({token:c,factory:c.\u0275fac,providedIn:"root"})};var he=()=>["backup"];function Se(c,t){c&1&&r(0,"sh-progress-bar",10)}function Te(c,t){if(c&1){let e=G();m(0,"form",11)(1,"sh-select",12)(2,"label",13),_(3,1),r(4,"sh-icon",14),p(),a(),r(5,"input",15),a(),m(6,"sh-form-field")(7,"label",16),_(8,2),r(9,"sh-icon",17),p(),a(),r(10,"textarea",18),a(),m(11,"sh-form-field")(12,"label",19),_(13,3),r(14,"sh-icon",20),p(),a(),r(15,"textarea",21),a()(),m(16,"sh-divider"),B(17,4),a(),m(18,"form",11)(19,"sh-form-field")(20,"label",22),_(21,5),r(22,"sh-icon",23),p(),a(),r(23,"input",24),a(),m(24,"sh-form-field")(25,"label",25),_(26,6),r(27,"sh-icon",26),p(),a(),r(28,"input",27),a(),m(29,"app-filters",28),O("filtersChange",function(i){h(e);let s=F();return D(s.filters,i)||(s.filters=i),S(i)}),I("filtersChange",function(i){h(e);let s=F();return S(s.updateFilters(i))}),a()(),m(30,"app-options-list",29),O("optionsChange",function(i){h(e);let s=F();return D(s.settings,i)||(s.settings=i),S(i)}),a(),m(31,"div",30)(32,"button",31),I("click",function(){h(e);let i=F();return S(i.submit())}),_(33,7),r(34,"sh-icon"),p(),a()()}if(c&2){let e=F();C("formGroup",e.baseCmdForm),d(),C("options",e.commandOptions()??V(11,he))("inlineSearch",!0),d(17),C("formGroup",e.standardFields),d(11),M("filters",e.filters),C("osType",e.osType()??""),d(),M("options",e.settings),C("hasFreeTextSettings",!0),d(2),v("loading",e.isSubmitting()),d(2),U(e.baseCmdForm.value.command),x(33)}}var l=new Z,P=class c{#e=u(b);#n=u(me);#o=u(J);#t=u(K);#a=u(ce);#s=u(_e);#i=u(f);#r=u(ue);osType=q(()=>this.#r.systemInfo()?.OSType);#l=A(this.#t.params);commandOptions=A(this.#a.getApiV1Commandline());isSubmitting=E(!1);optionsFields=this.#e.optionsFields;standardFields=l.group({"backup-id":l.control(""),"backup-name":l.control(""),dbpath:l.control(""),filters:l.array([])});baseCmdForm=l.group({command:l.control("backup"),targetUrl:l.control(""),arguments:l.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;filters=E([]);settings=this.#e.settings;updateFilters(t){this.standardFields.controls.filters.clear(),t.forEach(e=>this.standardFields.controls.filters.push(l.control(e))),this.filters.set(t)}#m=$(()=>{let t=this.#l()?.id;this.#e.backupId.set(t),this.getBackup(t)});getBackup(t){this.#n.getApiV1BackupById({id:t}).subscribe({next:e=>{this.#e.mapScheduleToForm(e.Schedule??null),e.Backup&&(this.#e.mapGeneralToForm(e.Backup),this.mapStandardFieldsToForm(e.Backup),this.mapBaseCmdToForm(e.Backup),this.#e.mapOptionsToForms(e.Backup,!0)),this.applyStateFromUrl(),this.#e.finishedLoading.set(!0)}})}mapStandardFieldsToForm(t){if(this.standardFields.patchValue({dbpath:t.DBPath,"backup-id":t.ID,"backup-name":t.Name}),this.standardFields.controls.filters.clear(),t.Filters&&t.Filters.length){let e=t.Filters.map(n=>`${n.Include?"":"-"}${n.Expression}`);e.forEach(n=>{this.standardFields.controls.filters.push(l.control(n))}),this.filters.set(e)}else this.filters.set([])}submit(){this.#s.resumeDialogCheck(()=>this.#c())}#c(){this.isSubmitting.set(!0);let t=this.updateUrl(),e=this.baseCmdForm.value,n=e.targetUrl??"",i=(e.arguments??"").split(`
2
2
  `)??[],s=[n,...i].filter(o=>o.length>0),g=this.standardFields.value,T=g.filters??[],N=[e.command,...s,`--backup-name=${g["backup-name"]}`,`--dbpath=${g.dbpath}`,`--backup-id=${g["backup-id"]}`,...T.filter(o=>o).map(o=>o.startsWith("-")?`--exclude=${o?.slice(1)}`:`--include=${o}`),...this.#e.mapFormsToSettings(["backup-id","backup-name","dbpath"]).map(o=>`${o.Name.startsWith("--")?"":"--"}${o.Name}=${o.Value}`),"--disable-module=console-password-input"];this.#n.postApiV1Commandline({requestBody:N}).subscribe({next:o=>{o.Status==="OK"&&this.#o.navigate(["backup",this.backupId(),"commandline",o.ID],{queryParams:{state:t}})},error:()=>{this.isSubmitting.set(!1)}})}mapBaseCmdToForm(t){let e=t.TargetURL??null;e&&this.baseCmdForm.patchValue({targetUrl:e??"",arguments:t.Sources?.join(`
3
3
  `)??""})}updateUrl(){let t=this.baseCmdForm.value,e=this.standardFields.value,n=e.filters??[],i=this.settings(),s=this.#i.saveState({command:t.command,targetUrl:t.targetUrl,arguments:t.arguments,backupId:e["backup-id"],backupName:e["backup-name"],dbpath:e.dbpath,filters:n,options:i});return this.#o.navigate([],{relativeTo:this.#t,queryParams:{state:s},replaceUrl:!0}),s}applyStateFromUrl(){let e=this.#t.snapshot.queryParams.state;if(!e)return;let n=this.#i.getState(e);n&&(this.baseCmdForm.patchValue({command:n.command,targetUrl:n.targetUrl,arguments:n.arguments}),this.standardFields.patchValue({"backup-id":n.backupId,"backup-name":n.backupName,dbpath:n.dbpath}),n.filters&&(this.standardFields.controls.filters.clear(),n.filters.forEach(i=>{this.standardFields.controls.filters.push(l.control(i))}),this.filters.set(n.filters)),n.options&&n.options.length>0&&this.settings.set(n.options))}static \u0275fac=function(e){return new(e||c)};static \u0275cmp=R({type:c,selectors:[["app-commandline"]],features:[w([b])],decls:8,vars:1,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let e;e=$localize` Command ${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let n;n=$localize` TargetUrl ${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON:`;let i;i=$localize` Commandline Arguments ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`;let s;s=$localize`Advanced options`;let g;g=$localize` Backup ID ${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON:`;let T;T=$localize` Backup Name ${"\uFFFD#27\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#27\uFFFD"}:CLOSE_TAG_SH_ICON:`;let N;return N=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SH_ICON: Run "${"\uFFFD0\uFFFD"}:INTERPOLATION:" command now `,[t,e,n,i,s,g,T,N,[1,"back"],["type","button","shButton","","routerLink","/",1,"small"],[1,"indeterminate","primary"],[3,"formGroup"],["placeholder","Select a command...",3,"options","inlineSearch"],["for","command"],["shTooltip","Choose the command to execute"],["type","text","id","command","formControlName","command"],["for","targetUrl"],["shTooltip","Enter the URL of the backup target"],["id","targetUrl","autocomplete","off","formControlName","targetUrl"],["for","arguments"],["shTooltip","Enter one argument per line without quotes (e.g., *.txt)"],["id","arguments","autocomplete","off","rows","5","formControlName","arguments","placeholder","Enter one argument per line without quotes (e.g., *.txt)",1,"arguments"],["for","backup-id"],["shTooltip","The ID of the backup configuration this run belongs to (can be empty)"],["id","backup-id","formControlName","backup-id"],["for","backup-name"],["shTooltip","The optional name of the backup"],["id","backup-name","formControlName","backup-name"],[3,"filtersChange","filters","osType"],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","",1,"raised","primary",3,"click"]]},template:function(e,n){e&1&&(r(0,"app-status-bar"),m(1,"section")(2,"div",8)(3,"button",9),_(4,0),r(5,"sh-icon"),p(),a()(),y(6,Se,1,0,"sh-progress-bar",10)(7,Te,35,12),a()),e&2&&(d(6),k(n.finishedLoading()?7:6))},dependencies:[ee,j,H,z,W,pe,Ce,ge,te,Y,Q,X,ae,oe,ie,re,se,ne,le],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;max-width:40rem;padding:2.5rem;gap:1.25rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.arguments[_ngcontent-%COMP%]{min-height:6rem;white-space:pre}"],changeDetection:0})};export{P as default};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-MJPEKJ3T.js";import"./chunk-TPKKLIFK.js";import"./chunk-X5W2K6AN.js";import"./chunk-COEGVUM3.js";import"./chunk-PEOYNJJM.js";import"./chunk-JYRKUYG6.js";import"./chunk-CJKZ27FM.js";import"./chunk-5E3B4AEF.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";export{a as OptionsListComponent};
@@ -0,0 +1 @@
1
+ import"./chunk-7CGTOI24.js";var o=[{path:"",loadComponent:()=>import("./chunk-TOV6NJCD.js"),children:[{path:"",redirectTo:"stored",pathMatch:"full"},{path:"stored",loadComponent:()=>import("./chunk-CWBB6FON.js")},{path:"live",loadComponent:()=>import("./chunk-4J64RICN.js")}]}],t=o;export{t as default};
@@ -1 +1 @@
1
- import{g as pe}from"./chunk-77IXQ4GU.js";import"./chunk-TZ7MW3NZ.js";import{b as ue,c as de,m as Se,q as Ee,r as Ce}from"./chunk-43WATFQS.js";import"./chunk-CAQ3XMFP.js";import"./chunk-UZ4POLDC.js";import{c as Te,d as ge}from"./chunk-O56QUSSI.js";import"./chunk-6Q6SSTBK.js";import"./chunk-YCJYEQF7.js";import"./chunk-AXQQEOTT.js";import"./chunk-UTXZPAY6.js";import{a as M}from"./chunk-IMQUTGIK.js";import"./chunk-F3ETZKLK.js";import"./chunk-IQL3REGJ.js";import"./chunk-E4NQOMJX.js";import"./chunk-YYD2JU6T.js";import"./chunk-6JS7B4FW.js";import{B as le,H as _e,K as ce,c as Q,e as Y,f as Z,g as ee,i as te,j as ne,s as ie,v as oe,w as re,y as ae,z as se}from"./chunk-VKQQDCUN.js";import"./chunk-DSYNIXJF.js";import{b as j,d as q}from"./chunk-NPFPMA4P.js";import"./chunk-O2SMJYPC.js";import"./chunk-N2AU7VKX.js";import"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import{$b as l,Ac as K,Cb as D,Db as r,Eb as a,Fb as O,Jb as V,Kb as W,Mb as S,Qc as $,Sa as T,Tb as E,Ub as C,Vb as I,Xc as w,Yb as z,Zb as u,_ as m,da as _,ea as c,gb as B,gc as J,ha as v,hc as X,nc as y,pa as N,sc as f,tc as R,uc as h,vc as P,wb as p,wc as A,xb as F,xc as L,zc as H}from"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";var Fe=["formRef"],Oe=["testUrl"],me=()=>({maxWidth:"700px",width:"100%"});function Re(o,i){if(o&1){let e=S();r(0,"button",24),u("click",function(){_(e);let t=l();return c(t.openTargetUrlDialog())}),E(1,5),O(2,"sh-icon"),C(),a()}}function Ne(o,i){if(o&1){let e=S();r(0,"button",24),u("click",function(){_(e);let t=l(2);return c(t.copyTargetUrl())}),E(1,7),O(2,"sh-icon"),C(),a()}}function De(o,i){if(o&1){let e=S();r(0,"sh-menu")(1,"button",15)(2,"sh-icon"),y(3,"dots-three-vertical"),a()(),V(4,25),r(5,"button",24),u("click",function(){_(e);let t=l();return c(t.openTargetUrlDialog())}),E(6,6),O(7,"sh-icon"),C(),a(),p(8,Ne,3,0,"button",15),W(),a()}if(o&2){l();let e=L(0);T(8),F(e?8:-1)}}function Ie(o,i){if(o&1){let e=S();r(0,"app-destination-list-item",17)(1,"button",20),u("click",function(){_(e);let t=l();return c(t.removeDestination())}),I(2,8),a()()}if(o&2){l();let e=L(12);D("destination",e)}}function fe(o,i){if(o&1){let e=S();r(0,"app-destination-list",26),u("setDestination",function(t){_(e);let s=l();return c(s.setDestination(t))}),a()}}function he(o,i){if(o&1){let e=S();r(0,"app-single-destination",27),h("targetUrlChange",function(t){_(e);let s=l();return R(s.targetUrlModel,t)||(s.targetUrlModel=t),c(t)}),a()}if(o&2){let e=l();f("targetUrl",e.targetUrlModel)}}function Me(o,i){o&1&&(E(0,4,1),O(1,"sh-icon",22),C())}function ye(o,i){o&1&&(E(0,4,2),O(1,"sh-icon"),C())}function Pe(o,i){if(o&1){let e=S();r(0,"sh-dialog",28),h("isOpenChange",function(t){_(e);let s=l();return R(s.targetUrlDialogOpen,t)||(s.targetUrlDialogOpen=t),c(t)}),r(1,"header",29)(2,"div",30)(3,"h2"),I(4,9),a(),r(5,"sh-alert",31),I(6,10),a()()(),r(7,"div",32)(8,"sh-form-field")(9,"textarea",33),h("ngModelChange",function(t){_(e);let s=l();return R(s.targetUrlCtrl,t)||(s.targetUrlCtrl=t),c(t)}),a()()(),r(10,"footer",34)(11,"button",20),u("click",function(){_(e);let t=l();return c(t.closeTargetUrlDialog(!1))}),y(12,"Cancel"),a(),r(13,"button",35),u("click",function(){_(e);let t=l();return c(t.closeTargetUrlDialog(!0))}),E(14,11),O(15,"sh-icon"),C(),a()()()}if(o&2){let e=l();f("isOpen",e.targetUrlDialogOpen),D("options",K(3,me)),T(9),f("ngModel",e.targetUrlCtrl)}}var x=class o{#i=m(q);#o=m(j);#n=m(se);injector=m(v);#e=m(pe);formRef=w.required("formRef");testUrlComponent=w.required("testUrl");testSignal=this.#e.destinationTestSignal;targetUrlModel=this.#e.destinationTargetUrl;targetUrlCtrl=N(null);targetUrlInitial=N(null);targetUrlDialogOpen=N(!1);toggleNewDestination=N(!0);selectedDestinationType=$(()=>{let i=this.#e.destinationTargetUrl();return i?Te(i):null});selectedDestinationTypeOption=$(()=>{let i=this.selectedDestinationType();return i?{key:i.customKey??i.key,customKey:i.customKey??null,displayName:i.displayName,description:i.description,icon:i.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.#e.destinationTargetUrl()??"")}openTargetUrlDialog(){let i=this.#e.destinationTargetUrl();this.targetUrlCtrl.set(i),this.targetUrlInitial.set(i),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(i=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl(),n=this.targetUrlInitial();!i||e===n||!e||this.#e.updateTargetUrl(e)}setDestination(i){let e=ge(i??"");if(e){if(e.mapper.default){let n=e.mapper.default("");this.#e.updateTargetUrl(n);return}this.#e.updateTargetUrl(`${i}://`)}}removeDestination(){this.#e.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let i=this.testSignal();if(i===null){this.#n.open(M,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:n=>{n?this.testUrlComponent()?.testDestination(!1)?.then(t=>{t.action==="success"&&t.containsBackup?this.#t():this.#n.open(M,{data:{title:$localize`Test did not succeed`,message:t.errorMessage??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#t()}});return}let e=typeof i=="string"?null:i;if(e?.action!=="success"||!e.containsBackup){this.#n.open(M,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Edit destination`,cancelText:$localize`Yes, continue`},closed:n=>{n||this.#t()}});return}this.#t()}#t(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=B({type:o,selectors:[["app-restore-destination"]],viewQuery:function(e,n){e&1&&J(n.formRef,Fe,5)(n.testUrlComponent,Oe,5),e&2&&X(2)},features:[H([Ee])],decls:25,vars:17,consts:()=>{let i;i=$localize`Backup destination`;let e;e=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let n;n=$localize`${"\uFFFD*22:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*22:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*23:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*23:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,n=z(n);let t;t=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Set target URL `;let s;s=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let g;g=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let U;U=$localize`Change`;let b;b=$localize`Edit target URL`;let G;G=$localize`Be careful, this will overwrite everything you have in your destination.`;let k;return k=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],["testUrl",""],i,e,n,t,s,g,U,b,G,k,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal","backupId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","moduleType"],[1,"current-destination",3,"destination"],[3,"targetUrl"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click"],["menu",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"target-dialog-header"],[1,"warn"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(e,n){if(e&1){let t=S();P(0),r(1,"form",12,0),u("submit",function(){return n.next()}),r(3,"header")(4,"h3",13)(5,"span"),I(6,2),a(),r(7,"div",14),p(8,Re,3,0,"button",15)(9,De,9,1,"sh-menu"),a()(),r(10,"app-test-url",16,1),h("targetUrlChange",function(g){return _(t),R(n.targetUrlModel,g)||(n.targetUrlModel=g),c(g)})("testSignalChange",function(g){return _(t),R(n.testSignal,g)||(n.testSignal=g),c(g)}),a(),P(12),p(13,Ie,3,1,"app-destination-list-item",17),a(),p(14,fe,1,0,"app-destination-list"),p(15,he,1,1,"app-single-destination",18),r(16,"div",19)(17,"button",20),u("click",function(){return n.goBack()}),E(18,3),O(19,"sh-icon"),C(),a(),r(20,"button",21),E(21,4),p(22,Me,2,0,"sh-icon",22)(23,ye,2,0,"sh-icon"),C(),a()()(),p(24,Pe,16,4,"sh-dialog",23)}if(e&2){let t=A(!!n.targetUrlModel());T(8),F(t?9:8),T(2),f("targetUrl",n.targetUrlModel)("testSignal",n.testSignal),D("backupId",null)("sourcePrefix",null)("suppressErrorDialogs",!1)("askToCreate",!1)("testExpectation","containsBackup")("moduleType","Backend"),T(2);let s=A(n.selectedDestinationTypeOption());T(),F(s?13:-1),T(),F(t?-1:14),T(),F(t?15:-1),T(5),D("disabled",n.testSignal()=="testing"||!t),T(2),F(n.testSignal()=="testing"?22:23),T(2),F(n.targetUrlDialogOpen()?24:-1)}},dependencies:[Ce,de,ue,ie,ne,Q,Y,Z,te,ee,le,_e,ce,oe,ae,re,Se],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}"],changeDetection:0})};export{x as default};
1
+ import{g as pe}from"./chunk-KI2HT2TI.js";import"./chunk-MJPEKJ3T.js";import{b as ue,c as de,m as Se,q as Ee,r as Ce}from"./chunk-RTGUYIWH.js";import"./chunk-PNQ5BDQN.js";import"./chunk-TPKKLIFK.js";import{c as Te,d as ge}from"./chunk-X5W2K6AN.js";import"./chunk-6Q6SSTBK.js";import"./chunk-COEGVUM3.js";import"./chunk-QGAOYLQU.js";import"./chunk-RM2KGG7J.js";import{a as M}from"./chunk-PEOYNJJM.js";import"./chunk-QZEIAQ3M.js";import"./chunk-2KD757N6.js";import"./chunk-AFHEXZUZ.js";import"./chunk-JYRKUYG6.js";import"./chunk-VNXFTYQQ.js";import{B as le,H as _e,K as ce,c as Q,e as Y,f as Z,g as ee,i as te,j as ne,s as ie,v as oe,w as re,y as ae,z as se}from"./chunk-CJKZ27FM.js";import"./chunk-5E3B4AEF.js";import{b as j,d as q}from"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as m,Ac as H,Bc as K,Db as D,Eb as r,Fb as a,Gb as O,Kb as V,Lb as W,Nb as S,Rc as $,Ta as T,Ub as E,Vb as C,Wb as I,Yc as w,Zb as z,_b as u,ac as l,ea as _,fa as c,hb as B,hc as J,ia as v,ic as X,oc as y,qa as N,tc as f,uc as R,vc as h,wc as P,xb as p,xc as A,yb as F,yc as L}from"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";var Fe=["formRef"],Oe=["testUrl"],me=()=>({maxWidth:"700px",width:"100%"});function Re(o,i){if(o&1){let e=S();r(0,"button",24),u("click",function(){_(e);let t=l();return c(t.openTargetUrlDialog())}),E(1,5),O(2,"sh-icon"),C(),a()}}function Ne(o,i){if(o&1){let e=S();r(0,"button",24),u("click",function(){_(e);let t=l(2);return c(t.copyTargetUrl())}),E(1,7),O(2,"sh-icon"),C(),a()}}function De(o,i){if(o&1){let e=S();r(0,"sh-menu")(1,"button",15)(2,"sh-icon"),y(3,"dots-three-vertical"),a()(),V(4,25),r(5,"button",24),u("click",function(){_(e);let t=l();return c(t.openTargetUrlDialog())}),E(6,6),O(7,"sh-icon"),C(),a(),p(8,Ne,3,0,"button",15),W(),a()}if(o&2){l();let e=L(0);T(8),F(e?8:-1)}}function Ie(o,i){if(o&1){let e=S();r(0,"app-destination-list-item",17)(1,"button",20),u("click",function(){_(e);let t=l();return c(t.removeDestination())}),I(2,8),a()()}if(o&2){l();let e=L(12);D("destination",e)}}function fe(o,i){if(o&1){let e=S();r(0,"app-destination-list",26),u("setDestination",function(t){_(e);let s=l();return c(s.setDestination(t))}),a()}}function he(o,i){if(o&1){let e=S();r(0,"app-single-destination",27),h("targetUrlChange",function(t){_(e);let s=l();return R(s.targetUrlModel,t)||(s.targetUrlModel=t),c(t)}),a()}if(o&2){let e=l();f("targetUrl",e.targetUrlModel)}}function Me(o,i){o&1&&(E(0,4,1),O(1,"sh-icon",22),C())}function ye(o,i){o&1&&(E(0,4,2),O(1,"sh-icon"),C())}function Pe(o,i){if(o&1){let e=S();r(0,"sh-dialog",28),h("isOpenChange",function(t){_(e);let s=l();return R(s.targetUrlDialogOpen,t)||(s.targetUrlDialogOpen=t),c(t)}),r(1,"header",29)(2,"div",30)(3,"h2"),I(4,9),a(),r(5,"sh-alert",31),I(6,10),a()()(),r(7,"div",32)(8,"sh-form-field")(9,"textarea",33),h("ngModelChange",function(t){_(e);let s=l();return R(s.targetUrlCtrl,t)||(s.targetUrlCtrl=t),c(t)}),a()()(),r(10,"footer",34)(11,"button",20),u("click",function(){_(e);let t=l();return c(t.closeTargetUrlDialog(!1))}),y(12,"Cancel"),a(),r(13,"button",35),u("click",function(){_(e);let t=l();return c(t.closeTargetUrlDialog(!0))}),E(14,11),O(15,"sh-icon"),C(),a()()()}if(o&2){let e=l();f("isOpen",e.targetUrlDialogOpen),D("options",K(3,me)),T(9),f("ngModel",e.targetUrlCtrl)}}var x=class o{#i=m(q);#o=m(j);#n=m(se);injector=m(v);#e=m(pe);formRef=w.required("formRef");testUrlComponent=w.required("testUrl");testSignal=this.#e.destinationTestSignal;targetUrlModel=this.#e.destinationTargetUrl;targetUrlCtrl=N(null);targetUrlInitial=N(null);targetUrlDialogOpen=N(!1);toggleNewDestination=N(!0);selectedDestinationType=$(()=>{let i=this.#e.destinationTargetUrl();return i?Te(i):null});selectedDestinationTypeOption=$(()=>{let i=this.selectedDestinationType();return i?{key:i.customKey??i.key,customKey:i.customKey??null,displayName:i.displayName,description:i.description,icon:i.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.#e.destinationTargetUrl()??"")}openTargetUrlDialog(){let i=this.#e.destinationTargetUrl();this.targetUrlCtrl.set(i),this.targetUrlInitial.set(i),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(i=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl(),n=this.targetUrlInitial();!i||e===n||!e||this.#e.updateTargetUrl(e)}setDestination(i){let e=ge(i??"");if(e){if(e.mapper.default){let n=e.mapper.default("");this.#e.updateTargetUrl(n);return}this.#e.updateTargetUrl(`${i}://`)}}removeDestination(){this.#e.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let i=this.testSignal();if(i===null){this.#n.open(M,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:n=>{n?this.testUrlComponent()?.testDestination(!1)?.then(t=>{t.action==="success"&&t.containsBackup?this.#t():this.#n.open(M,{data:{title:$localize`Test did not succeed`,message:t.errorMessage??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#t()}});return}let e=typeof i=="string"?null:i;if(e?.action!=="success"||!e.containsBackup){this.#n.open(M,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Edit destination`,cancelText:$localize`Yes, continue`},closed:n=>{n||this.#t()}});return}this.#t()}#t(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=B({type:o,selectors:[["app-restore-destination"]],viewQuery:function(e,n){e&1&&J(n.formRef,Fe,5)(n.testUrlComponent,Oe,5),e&2&&X(2)},features:[H([Ee])],decls:25,vars:17,consts:()=>{let i;i=$localize`Backup destination`;let e;e=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let n;n=$localize`${"\uFFFD*22:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*22:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*23:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*23:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,n=z(n);let t;t=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Set target URL `;let s;s=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let g;g=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let U;U=$localize`Change`;let b;b=$localize`Edit target URL`;let G;G=$localize`Be careful, this will overwrite everything you have in your destination.`;let k;return k=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],["testUrl",""],i,e,n,t,s,g,U,b,G,k,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal","backupId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","moduleType"],[1,"current-destination",3,"destination"],[3,"targetUrl"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click"],["menu",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"target-dialog-header"],[1,"warn"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(e,n){if(e&1){let t=S();P(0),r(1,"form",12,0),u("submit",function(){return n.next()}),r(3,"header")(4,"h3",13)(5,"span"),I(6,2),a(),r(7,"div",14),p(8,Re,3,0,"button",15)(9,De,9,1,"sh-menu"),a()(),r(10,"app-test-url",16,1),h("targetUrlChange",function(g){return _(t),R(n.targetUrlModel,g)||(n.targetUrlModel=g),c(g)})("testSignalChange",function(g){return _(t),R(n.testSignal,g)||(n.testSignal=g),c(g)}),a(),P(12),p(13,Ie,3,1,"app-destination-list-item",17),a(),p(14,fe,1,0,"app-destination-list"),p(15,he,1,1,"app-single-destination",18),r(16,"div",19)(17,"button",20),u("click",function(){return n.goBack()}),E(18,3),O(19,"sh-icon"),C(),a(),r(20,"button",21),E(21,4),p(22,Me,2,0,"sh-icon",22)(23,ye,2,0,"sh-icon"),C(),a()()(),p(24,Pe,16,4,"sh-dialog",23)}if(e&2){let t=A(!!n.targetUrlModel());T(8),F(t?9:8),T(2),f("targetUrl",n.targetUrlModel)("testSignal",n.testSignal),D("backupId",null)("sourcePrefix",null)("suppressErrorDialogs",!1)("askToCreate",!1)("testExpectation","containsBackup")("moduleType","Backend"),T(2);let s=A(n.selectedDestinationTypeOption());T(),F(s?13:-1),T(),F(t?-1:14),T(),F(t?15:-1),T(5),D("disabled",n.testSignal()=="testing"||!t),T(2),F(n.testSignal()=="testing"?22:23),T(2),F(n.targetUrlDialogOpen()?24:-1)}},dependencies:[Ce,de,ue,ie,ne,Q,Y,Z,te,ee,le,_e,ce,oe,ae,re,Se],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}"],changeDetection:0})};export{x as default};
@@ -1 +1 @@
1
- import{B as y}from"./chunk-VKQQDCUN.js";import{$b as r,Db as i,Eb as o,Mb as C,Qc as D,Sa as n,Vc as b,Wc as T,Zb as g,da as u,ea as _,gb as x,nc as l,oc as m,wb as s,xb as d}from"./chunk-TQTOIWBK.js";import{a as f}from"./chunk-7CGTOI24.js";function v(t,a){if(t&1&&(i(0,"p"),l(1),o()),t&2){let e=r();n(),m(e._data().message)}}function S(t,a){if(t&1){let e=C();i(0,"button",5),g("click",function(){u(e);let p=r();return _(p.close("cancel"))}),l(1),o()}if(t&2){let e=r();n(),m(e._data().cancelText)}}function k(t,a){if(t&1){let e=C();i(0,"button",6),g("click",function(){u(e);let p=r();return _(p.close("confirm"))}),l(1),o()}if(t&2){let e=r();n(),m(e._data().confirmText)}}var w={title:$localize`Are you sure?`,confirmText:void 0,cancelText:$localize`Cancel`},h=class t{data=T();_data=D(()=>f(f({},w),this.data()));closed=b();close(a="confirm"){this.closed.emit(a==="confirm")}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=x({type:t,selectors:[["app-confirm-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:8,vars:4,consts:[["header",""],["content",""],["footer",""],["shButton","",1,""],["shButton","",1,"raised","primary"],["shButton","",1,"",3,"click"],["shButton","",1,"raised","primary",3,"click"]],template:function(e,c){e&1&&(i(0,"header",0)(1,"h3"),l(2),o()(),i(3,"div",1),s(4,v,2,1,"p"),o(),i(5,"footer",2),s(6,S,2,1,"button",3),s(7,k,2,1,"button",4),o()),e&2&&(n(2),m(c._data().title),n(2),d(c._data().message?4:-1),n(2),d(c._data().cancelText?6:-1),n(),d(c._data().confirmText?7:-1))},dependencies:[y],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};export{h as a};
1
+ import{B as y}from"./chunk-CJKZ27FM.js";import{Eb as i,Fb as o,Nb as C,Rc as D,Ta as n,Wc as b,Xc as T,_b as g,ac as r,ea as u,fa as _,hb as x,oc as l,pc as m,xb as s,yb as d}from"./chunk-K5XGRFWJ.js";import{a as f}from"./chunk-7CGTOI24.js";function v(t,a){if(t&1&&(i(0,"p"),l(1),o()),t&2){let e=r();n(),m(e._data().message)}}function S(t,a){if(t&1){let e=C();i(0,"button",5),g("click",function(){u(e);let p=r();return _(p.close("cancel"))}),l(1),o()}if(t&2){let e=r();n(),m(e._data().cancelText)}}function k(t,a){if(t&1){let e=C();i(0,"button",6),g("click",function(){u(e);let p=r();return _(p.close("confirm"))}),l(1),o()}if(t&2){let e=r();n(),m(e._data().confirmText)}}var w={title:$localize`Are you sure?`,confirmText:void 0,cancelText:$localize`Cancel`},h=class t{data=T();_data=D(()=>f(f({},w),this.data()));closed=b();close(a="confirm"){this.closed.emit(a==="confirm")}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=x({type:t,selectors:[["app-confirm-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:8,vars:4,consts:[["header",""],["content",""],["footer",""],["shButton","",1,""],["shButton","",1,"raised","primary"],["shButton","",1,"",3,"click"],["shButton","",1,"raised","primary",3,"click"]],template:function(e,c){e&1&&(i(0,"header",0)(1,"h3"),l(2),o()(),i(3,"div",1),s(4,v,2,1,"p"),o(),i(5,"footer",2),s(6,S,2,1,"button",3),s(7,k,2,1,"button",4),o()),e&2&&(n(2),m(c._data().title),n(2),d(c._data().message?4:-1),n(2),d(c._data().cancelText?6:-1),n(),d(c._data().confirmText?7:-1))},dependencies:[y],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};export{h as a};
@@ -1 +1 @@
1
- import{b as s}from"./chunk-6Q6SSTBK.js";import{V as c}from"./chunk-TQTOIWBK.js";import{a as i}from"./chunk-7CGTOI24.js";var d=/[a-zA-Z0-9_\-\+\.!@#$%^&*?_~()-]/,m=class n{generate(r,t=d){let a;do a=this.generatePassword(r,t);while(this.calculatePasswordStrength(a)<5);return a}generatePassword(r,t=d){return Array.apply(null,{length:r}).map(()=>{let a;for(;;)if(a=String.fromCharCode(s()),t.test(a))return a},this).join("")}calculatePasswordStrength(r){let t=1;return r.length>=8&&t++,r.match(/[a-z]/)&&r.match(/[A-Z]/)&&t++,r.match(/\d+/)&&t++,r.match(/.[!,@,#,$,%,^,&,*,?,_,~,(,),-]/)&&t++,Math.min(t,5)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};function y(n,r,t="conditional"){return a=>{if(!a.parent)return null;let e=null;if(n(a.parent)&&(e=(Array.isArray(r)?r:[r]).find(l=>l(a)!==null)??null),t&&e){let o={};o[t]=e,e=o}return e}}function F(){return n=>(n.parent&&Object.values(n.parent.controls).forEach(r=>{r!==n&&r.updateValueAndValidity()}),null)}function C(n,r,t,a="conditional"){return e=>{if(!e.parent)return null;let o={},l=e.parent.get(n);if(!l)return console.warn("Conditional field not found"),null;if(Array.isArray(r)?l.value?.includes(r):l.value===r){let f=Array.isArray(t)?t:[t];for(let A of f){let u=A(e),p=o||{};if(u!==null){o=i(i({},p),u);break}}}return o}}export{m as a,y as b,F as c,C as d};
1
+ import{b as s}from"./chunk-6Q6SSTBK.js";import{W as c}from"./chunk-K5XGRFWJ.js";import{a as i}from"./chunk-7CGTOI24.js";var d=/[a-zA-Z0-9_\-\+\.!@#$%^&*?_~()-]/,m=class n{generate(r,t=d){let a;do a=this.generatePassword(r,t);while(this.calculatePasswordStrength(a)<5);return a}generatePassword(r,t=d){return Array.apply(null,{length:r}).map(()=>{let a;for(;;)if(a=String.fromCharCode(s()),t.test(a))return a},this).join("")}calculatePasswordStrength(r){let t=1;return r.length>=8&&t++,r.match(/[a-z]/)&&r.match(/[A-Z]/)&&t++,r.match(/\d+/)&&t++,r.match(/.[!,@,#,$,%,^,&,*,?,_,~,(,),-]/)&&t++,Math.min(t,5)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};function y(n,r,t="conditional"){return a=>{if(!a.parent)return null;let e=null;if(n(a.parent)&&(e=(Array.isArray(r)?r:[r]).find(l=>l(a)!==null)??null),t&&e){let o={};o[t]=e,e=o}return e}}function F(){return n=>(n.parent&&Object.values(n.parent.controls).forEach(r=>{r!==n&&r.updateValueAndValidity()}),null)}function C(n,r,t,a="conditional"){return e=>{if(!e.parent)return null;let o={},l=e.parent.get(n);if(!l)return console.warn("Conditional field not found"),null;if(Array.isArray(r)?l.value?.includes(r):l.value===r){let f=Array.isArray(t)?t:[t];for(let A of f){let u=A(e),p=o||{};if(u!==null){o=i(i({},p),u);break}}}return o}}export{m as a,y as b,F as c,C as d};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-ZKIZ7IIA.js";import"./chunk-AXG7WHBS.js";import"./chunk-AXLO5KWF.js";import"./chunk-BPHX6VXP.js";import"./chunk-XWML36YQ.js";import"./chunk-6Q6SSTBK.js";import"./chunk-COEGVUM3.js";import"./chunk-PEOYNJJM.js";import"./chunk-5W4BSVZJ.js";import"./chunk-AFHEXZUZ.js";import"./chunk-JYRKUYG6.js";import"./chunk-VNXFTYQQ.js";import"./chunk-CJKZ27FM.js";import"./chunk-5E3B4AEF.js";import"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";export{a as BackupProgressComponent};
@@ -1 +1 @@
1
- import{a as p}from"./chunk-UTXZPAY6.js";import{a as R}from"./chunk-IMQUTGIK.js";import{a as b}from"./chunk-F3ETZKLK.js";import{a as f,b as d}from"./chunk-E4NQOMJX.js";import{a as m}from"./chunk-YYD2JU6T.js";import{z as u}from"./chunk-VKQQDCUN.js";import{d as h}from"./chunk-DSYNIXJF.js";import{Qc as a,V as g,_ as s,pa as o,ra as n}from"./chunk-TQTOIWBK.js";var S=class l{#c=s(p);#g=s(u);#t=s(h);#o=s(m);#l=s(f);#n=s(d);#u=s(b);constructor(){this.#l.subscribe("remotecontrol")}repeatRegisterTimer=null;#s=null;#r=0;#h=5;#m=2e3;pendingRefresh=!1;state=o("unknown");claimUrl=o(null);registerUrl=o("");customRegisterUrl=o("");status=a(()=>{let e=this.state();return e==="connecting"?$localize`Console connection is enabled but not connected`:e==="connected"?$localize`Connected to console`:e==="registering"?$localize`Registering machine...`:e==="registeringfaulted"?$localize`Registration failed`:e==="registered"?$localize`Registered, waiting for accept`:e==="disabled"?$localize`Console connection is configured but not enabled`:e==="unknown"?$localize`...loading...`:$localize`Console connection is not set up`});sysInfoEffect=n(()=>{let e=this.#o.systemInfo();e&&this.registerUrl.set(e.RemoteControlRegistrationUrl??"")});remoteEffect=n(()=>{let e=this.#l.remoteControlState();e&&this.#e(e)});pendingRefreshEffect=n(()=>{this.#n.isConnectionMethodSet()&&this.pendingRefresh&&(this.pendingRefresh=!1,this.refreshRemoteControlStatus())});#a=a(()=>{let e=this.#n.getConnectionMethod()==="websocket",i=this.#o.hasWsRemoteControl();return e&&i});#f(e){e.RegistrationUrl&&this.claimUrl.set(e.RegistrationUrl),e.IsConnected?this.state.set("connected"):e.IsEnabled?this.state.set("connecting"):e.CanEnable?this.state.set("disabled"):e.IsRegisteringFaulted?this.state.set("registeringfaulted"):e.IsRegistering?e.RegistrationUrl!=null&&e.RegistrationUrl.trim().length>0?this.state.set("registered"):this.state.set("registering"):this.state.set("inactive")}#e(e){if(this.#r=0,this.#f(e),this.#a())return;let i=this.state();this.repeatRegisterTimer!==null&&(clearTimeout(this.repeatRegisterTimer),this.repeatRegisterTimer=null),i==="registering"&&(this.repeatRegisterTimer=setTimeout(()=>{this.#t.postApiV1RemotecontrolRegisterWait().subscribe({next:t=>this.#e(t),error:t=>this.#i(t)})},5e3)),(i==="connecting"||i==="registered")&&(this.repeatRegisterTimer=setTimeout(()=>{this.#t.getApiV1RemotecontrolStatus().subscribe({next:t=>this.#e(t),error:t=>this.#i(t)})},5e3)),e.IsRegistering&&e.CanEnable&&this.#t.deleteApiV1RemotecontrolRegister().subscribe({next:t=>this.#e(t)})}#i(e){if(this.#s!==null&&(clearTimeout(this.#s),this.#s=null),this.#r>=this.#h){this.state.set("registeringfaulted"),this.#r=0;return}let i=this.#m*Math.pow(2,this.#r);this.#r++,this.#s=setTimeout(()=>{this.#s=null,this.#t.getApiV1RemotecontrolStatus().subscribe({next:t=>this.#e(t),error:t=>this.#i(t)})},i)}refreshRemoteControlStatus(){if(!this.#a()){if(!this.#n.isConnectionMethodSet()){this.pendingRefresh=!0;return}this.#t.getApiV1RemotecontrolStatus().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)})}}beginRemoteRegistration(e=!1){this.state.set("registering"),this.#t.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:e?this.customRegisterUrl():this.registerUrl()}}).subscribe({next:i=>this.#e(i),error:i=>this.#i(i)})}cancelRemoteRegistration(){this.#t.deleteApiV1RemotecontrolRegister().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)})}enableRemoteControl(){this.#t.postApiV1RemotecontrolEnable().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)})}disableRemoteControl(){this.#t.postApiV1RemotecontrolDisable().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)})}deleteRemoteControl(){let e=this;this.#g.open(R,{data:{title:$localize`Confirm delete`,message:$localize`Are you sure you want to delete the console registration?`,confirmText:$localize`Delete registration`,cancelText:$localize`Cancel`},closed:i=>{i&&e.#t.deleteApiV1RemotecontrolRegistration().subscribe({next:t=>e.#e(t),error:t=>e.#i(t)})}})}openConsole(e="/app/machines",i){let t=this.#u.serverSettings(),C=this.#o.systemInfo(),r="https://app.duplicati.com",c=C?.RemoteControlDashboardUrl??"";if(c.length>0&&(r=c),t&&t["remote-control-dashboard-url"]&&(r=t["remote-control-dashboard-url"]),r=new URL(r).origin+e,i){let y=new URLSearchParams(i);r+=`?${y.toString()}`}this.#c.open(r,"_blank")}static \u0275fac=function(i){return new(i||l)};static \u0275prov=g({token:l,factory:l.\u0275fac,providedIn:"root"})};export{S as a};
1
+ import{a as p}from"./chunk-RM2KGG7J.js";import{a as R}from"./chunk-PEOYNJJM.js";import{a as b}from"./chunk-QZEIAQ3M.js";import{a as f,b as d}from"./chunk-AFHEXZUZ.js";import{a as m}from"./chunk-JYRKUYG6.js";import{z as u}from"./chunk-CJKZ27FM.js";import{d as h}from"./chunk-5E3B4AEF.js";import{$ as s,Rc as a,W as g,qa as o,sa as n}from"./chunk-K5XGRFWJ.js";var S=class l{#c=s(p);#g=s(u);#t=s(h);#o=s(m);#l=s(f);#n=s(d);#u=s(b);constructor(){this.#l.subscribe("remotecontrol")}repeatRegisterTimer=null;#s=null;#r=0;#h=5;#m=2e3;pendingRefresh=!1;state=o("unknown");claimUrl=o(null);registerUrl=o("");customRegisterUrl=o("");status=a(()=>{let e=this.state();return e==="connecting"?$localize`Console connection is enabled but not connected`:e==="connected"?$localize`Connected to console`:e==="registering"?$localize`Registering machine...`:e==="registeringfaulted"?$localize`Registration failed`:e==="registered"?$localize`Registered, waiting for accept`:e==="disabled"?$localize`Console connection is configured but not enabled`:e==="unknown"?$localize`...loading...`:$localize`Console connection is not set up`});sysInfoEffect=n(()=>{let e=this.#o.systemInfo();e&&this.registerUrl.set(e.RemoteControlRegistrationUrl??"")});remoteEffect=n(()=>{let e=this.#l.remoteControlState();e&&this.#e(e)});pendingRefreshEffect=n(()=>{this.#n.isConnectionMethodSet()&&this.pendingRefresh&&(this.pendingRefresh=!1,this.refreshRemoteControlStatus())});#a=a(()=>{let e=this.#n.getConnectionMethod()==="websocket",i=this.#o.hasWsRemoteControl();return e&&i});#f(e){e.RegistrationUrl&&this.claimUrl.set(e.RegistrationUrl),e.IsConnected?this.state.set("connected"):e.IsEnabled?this.state.set("connecting"):e.CanEnable?this.state.set("disabled"):e.IsRegisteringFaulted?this.state.set("registeringfaulted"):e.IsRegistering?e.RegistrationUrl!=null&&e.RegistrationUrl.trim().length>0?this.state.set("registered"):this.state.set("registering"):this.state.set("inactive")}#e(e){if(this.#r=0,this.#f(e),this.#a())return;let i=this.state();this.repeatRegisterTimer!==null&&(clearTimeout(this.repeatRegisterTimer),this.repeatRegisterTimer=null),i==="registering"&&(this.repeatRegisterTimer=setTimeout(()=>{this.#t.postApiV1RemotecontrolRegisterWait().subscribe({next:t=>this.#e(t),error:t=>this.#i(t)})},5e3)),(i==="connecting"||i==="registered")&&(this.repeatRegisterTimer=setTimeout(()=>{this.#t.getApiV1RemotecontrolStatus().subscribe({next:t=>this.#e(t),error:t=>this.#i(t)})},5e3)),e.IsRegistering&&e.CanEnable&&this.#t.deleteApiV1RemotecontrolRegister().subscribe({next:t=>this.#e(t)})}#i(e){if(this.#s!==null&&(clearTimeout(this.#s),this.#s=null),this.#r>=this.#h){this.state.set("registeringfaulted"),this.#r=0;return}let i=this.#m*Math.pow(2,this.#r);this.#r++,this.#s=setTimeout(()=>{this.#s=null,this.#t.getApiV1RemotecontrolStatus().subscribe({next:t=>this.#e(t),error:t=>this.#i(t)})},i)}refreshRemoteControlStatus(){if(!this.#a()){if(!this.#n.isConnectionMethodSet()){this.pendingRefresh=!0;return}this.#t.getApiV1RemotecontrolStatus().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)})}}beginRemoteRegistration(e=!1){this.state.set("registering"),this.#t.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:e?this.customRegisterUrl():this.registerUrl()}}).subscribe({next:i=>this.#e(i),error:i=>this.#i(i)})}cancelRemoteRegistration(){this.#t.deleteApiV1RemotecontrolRegister().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)})}enableRemoteControl(){this.#t.postApiV1RemotecontrolEnable().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)})}disableRemoteControl(){this.#t.postApiV1RemotecontrolDisable().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)})}deleteRemoteControl(){let e=this;this.#g.open(R,{data:{title:$localize`Confirm delete`,message:$localize`Are you sure you want to delete the console registration?`,confirmText:$localize`Delete registration`,cancelText:$localize`Cancel`},closed:i=>{i&&e.#t.deleteApiV1RemotecontrolRegistration().subscribe({next:t=>e.#e(t),error:t=>e.#i(t)})}})}openConsole(e="/app/machines",i){let t=this.#u.serverSettings(),C=this.#o.systemInfo(),r="https://app.duplicati.com",c=C?.RemoteControlDashboardUrl??"";if(c.length>0&&(r=c),t&&t["remote-control-dashboard-url"]&&(r=t["remote-control-dashboard-url"]),r=new URL(r).origin+e,i){let y=new URLSearchParams(i);r+=`?${y.toString()}`}this.#c.open(r,"_blank")}static \u0275fac=function(i){return new(i||l)};static \u0275prov=g({token:l,factory:l.\u0275fac,providedIn:"root"})};export{S as a};