@duplicati/ngclient 0.0.219 → 0.0.221
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.
- package/assets/dest-icons/drime.png +0 -0
- package/{chunk-7C2YZVSQ.js → chunk-3L3SRTPU.js} +1 -1
- package/{chunk-DJXLNIMV.js → chunk-43WATFQS.js} +6 -6
- package/chunk-5JGSXUKD.js +1 -0
- package/chunk-5YE4H57F.js +1 -0
- package/{chunk-PG4G4RLP.js → chunk-5ZRRLJA4.js} +1 -1
- package/{chunk-XDBSTUYC.js → chunk-6NVCDJR6.js} +1 -1
- package/{chunk-WOKYULBU.js → chunk-736PM4LG.js} +1 -1
- package/{chunk-XXVDL5TR.js → chunk-77IXQ4GU.js} +1 -1
- package/chunk-APSPCDGV.js +1 -0
- package/chunk-AXQQEOTT.js +1 -0
- package/{chunk-EADZVBRA.js → chunk-BMACDVWX.js} +1 -1
- package/{chunk-3RCF6UT4.js → chunk-COI6UMB5.js} +1 -1
- package/{chunk-RLWICOKH.js → chunk-CZVTBPNE.js} +1 -1
- package/{chunk-GN7AO4B6.js → chunk-DE4JIJWO.js} +1 -1
- package/{chunk-ZHQI6LYB.js → chunk-DHFLXFWF.js} +1 -1
- package/chunk-E4NQOMJX.js +1 -0
- package/chunk-ESLC5LVP.js +1 -0
- package/{chunk-I6MIXWIT.js → chunk-F2ZC26DC.js} +1 -1
- package/{chunk-BACKG7KA.js → chunk-F3ETZKLK.js} +1 -1
- package/{chunk-RJ2JM7C7.js → chunk-F3JYPWPK.js} +1 -1
- package/{chunk-4OJPTRZJ.js → chunk-FDYBIC4O.js} +1 -1
- package/{chunk-PXI3UZ4R.js → chunk-FR5RTIOE.js} +1 -1
- package/{chunk-NKUA7I47.js → chunk-G2BDKU26.js} +1 -1
- package/{chunk-2J2554EV.js → chunk-GW34KK5A.js} +1 -1
- package/{chunk-22AR7ES3.js → chunk-I5DD3Q6J.js} +1 -1
- package/{chunk-NHS6CQO2.js → chunk-JP2Z2HMH.js} +1 -1
- package/{chunk-EDLHTWBA.js → chunk-JPMKWWZP.js} +1 -1
- package/{chunk-ZP3QZ43W.js → chunk-JSZIISFS.js} +1 -1
- package/chunk-LE24LKH7.js +1 -0
- package/{chunk-X276XFCH.js → chunk-MTL3FBSM.js} +1 -1
- package/{chunk-37ODVJFS.js → chunk-N2GI5QYJ.js} +1 -1
- package/chunk-O56QUSSI.js +2 -0
- package/{chunk-RRDLQLTM.js → chunk-OCUE5GMT.js} +1 -1
- package/{chunk-BZXBH4CN.js → chunk-OJVUCHRP.js} +1 -1
- package/chunk-OL7ADIFI.js +1 -0
- package/{chunk-P4R3ERID.js → chunk-OLWLWDXZ.js} +1 -1
- package/chunk-PPSQGUOL.js +3 -0
- package/{chunk-XEG3CP74.js → chunk-QQWV3FEH.js} +1 -1
- package/{chunk-ZYRB2TUK.js → chunk-RDLRXAJU.js} +1 -1
- package/{chunk-ZNYRWXQR.js → chunk-SACQFUJE.js} +1 -1
- package/{chunk-M3PW6DLD.js → chunk-TISQKN7N.js} +1 -1
- package/{chunk-IFSZJSGH.js → chunk-TVFRVP7K.js} +1 -1
- package/chunk-TWAHUXIN.js +1 -0
- package/{chunk-GRE6GKVP.js → chunk-TZ7MW3NZ.js} +1 -1
- package/{chunk-VC55KFAX.js → chunk-UZ4POLDC.js} +1 -1
- package/{chunk-KDV2OE64.js → chunk-WJBMMY2Y.js} +1 -1
- package/{chunk-NX35OQ3V.js → chunk-XBAZKJ47.js} +1 -1
- package/chunk-XPVATEBM.js +1 -0
- package/{chunk-5RNU5BNO.js → chunk-YMFI2Q2X.js} +1 -1
- package/chunk-YPNN5FBK.js +1 -0
- package/{chunk-C6PICAXB.js → chunk-YYD2JU6T.js} +1 -1
- package/index.html +1 -1
- package/{main-JR6IVB6K.js → main-IUT3IXX4.js} +1 -1
- package/package.json +1 -1
- package/chunk-4OA2FFS5.js +0 -1
- package/chunk-AIAUP7OE.js +0 -1
- package/chunk-C3PQFWVO.js +0 -1
- package/chunk-DSZ644JT.js +0 -1
- package/chunk-EPIYGHPM.js +0 -1
- package/chunk-EXMYBMGI.js +0 -1
- package/chunk-N3NJW75G.js +0 -1
- package/chunk-OHYENIPP.js +0 -1
- package/chunk-QOWXL7ZL.js +0 -1
- package/chunk-QZQS7M3D.js +0 -1
- package/chunk-X4BDJA6L.js +0 -3
- package/chunk-YWUUX3S6.js +0 -1
- package/chunk-ZEFSBETQ.js +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-TISQKN7N.js")},{path:"encryption",loadComponent:()=>import("./chunk-YPNN5FBK.js")},{path:"select-files",loadComponent:()=>import("./chunk-5ZRRLJA4.js")},{path:"options",loadComponent:()=>import("./chunk-OL7ADIFI.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-6NVCDJR6.js")}],t=o;export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-ESLC5LVP.js")},{path:"destination",loadComponent:()=>import("./chunk-BMACDVWX.js")},{path:"source-data",loadComponent:()=>import("./chunk-QQWV3FEH.js")},{path:"schedule",loadComponent:()=>import("./chunk-TWAHUXIN.js")},{path:"options",loadComponent:()=>import("./chunk-SACQFUJE.js")}];export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as a,f as b}from"./chunk-
|
|
1
|
+
import{e as a,f as b}from"./chunk-77IXQ4GU.js";import"./chunk-TZ7MW3NZ.js";import"./chunk-43WATFQS.js";import"./chunk-CAQ3XMFP.js";import"./chunk-UZ4POLDC.js";import"./chunk-O56QUSSI.js";import"./chunk-6Q6SSTBK.js";import"./chunk-YCJYEQF7.js";import"./chunk-AXQQEOTT.js";import"./chunk-UTXZPAY6.js";import"./chunk-IMQUTGIK.js";import"./chunk-F3ETZKLK.js";import"./chunk-IQL3REGJ.js";import"./chunk-E4NQOMJX.js";import"./chunk-YYD2JU6T.js";import"./chunk-6JS7B4FW.js";import"./chunk-VKQQDCUN.js";import"./chunk-DSYNIXJF.js";import"./chunk-NPFPMA4P.js";import"./chunk-O2SMJYPC.js";import"./chunk-N2AU7VKX.js";import"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";export{a as createRestoreSelectFilesForm,b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as q}from"./chunk-
|
|
1
|
+
import{g as q}from"./chunk-77IXQ4GU.js";import{a as K}from"./chunk-IRT2UBDI.js";import"./chunk-RGFJ5UMA.js";import"./chunk-TZ7MW3NZ.js";import{b as Z}from"./chunk-3L3SRTPU.js";import"./chunk-43WATFQS.js";import"./chunk-CAQ3XMFP.js";import"./chunk-UZ4POLDC.js";import"./chunk-O56QUSSI.js";import"./chunk-LE24LKH7.js";import{b as V}from"./chunk-F3JYPWPK.js";import"./chunk-736PM4LG.js";import"./chunk-6Q6SSTBK.js";import{a as j}from"./chunk-YCJYEQF7.js";import"./chunk-AXQQEOTT.js";import"./chunk-UTXZPAY6.js";import"./chunk-IMQUTGIK.js";import"./chunk-ANSV4G2K.js";import"./chunk-F3ETZKLK.js";import"./chunk-IQL3REGJ.js";import{b as H}from"./chunk-E4NQOMJX.js";import"./chunk-YYD2JU6T.js";import"./chunk-6JS7B4FW.js";import{C as W,L as X,O as z,v as J}from"./chunk-VKQQDCUN.js";import{d as B}from"./chunk-DSYNIXJF.js";import{b as w}from"./chunk-NPFPMA4P.js";import"./chunk-O2SMJYPC.js";import"./chunk-N2AU7VKX.js";import{ma as k}from"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import{$b as g,Cb as C,Db as i,Eb as s,Fb as c,Fc as T,Gc as d,Jb as P,Kb as m,Qc as x,Sa as a,Tb as A,Ub as D,Vb as r,Wb as b,Xb as v,_ as S,fa as u,ga as f,gb as I,nc as M,pa as y,qc as N,wb as O,xb as p}from"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";function Q(n,t){n&1&&(i(0,"div",17),u(),i(1,"svg",19),c(2,"circle",20),s(),f(),i(3,"sh-icon",21),r(4,3),s()())}function U(n,t){n&1&&(i(0,"div",18),u(),i(1,"svg",19),c(2,"circle",20),s(),f(),i(3,"sh-icon",22),r(4,4),s()())}function Y(n,t){if(n&1&&(i(0,"sh-card",10),P(1,16),r(2,2),m(),O(3,Q,5,0,"div",17)(4,U,5,0,"div",18),s()),n&2){let e=g();a(3),p(e.restoreResult()=="success"?3:4)}}function ee(n,t){if(n&1&&(M(0),T(1,"number"),T(2,"number")),n&2){let e,o=g(2);N(" ",d(1,2,(e=o.statusData())==null?null:e.ProcessedFileCount)," of ",d(2,4,(e=o.statusData())==null?null:e.TotalFileCount)," ")}}function te(n,t){n&1&&(P(0),r(1,8),m())}function ne(n,t){if(n&1&&(M(0),T(1,"bytes"),T(2,"bytes")),n&2){let e,o=g(2);N(" ",d(1,2,(e=o.statusData())==null?null:e.ProcessedFileSize)," of ",d(2,4,(e=o.statusData())==null?null:e.TotalFileSize)," ")}}function oe(n,t){n&1&&(P(0),r(1,9),m())}function ie(n,t){if(n&1&&(i(0,"sh-card",10)(1,"h3"),A(2,5),c(3,"sh-spinner",23),D(),s(),i(4,"div",24),c(5,"sh-progress-bar",25),i(6,"p")(7,"span"),r(8,6),s(),O(9,ee,3,6)(10,te,2,0,"ng-container"),s(),i(11,"p")(12,"span"),r(13,7),s(),O(14,ne,3,6)(15,oe,2,0,"ng-container"),s()()()),n&2){let e,o,l,E,R=g();a(3),b((e=R.statusData())==null?null:e.statusText),v(2),a(2),C("value",(o=R.statusData())==null?null:o.OverallProgress),a(4),p((l=R.statusData())!=null&&l.ProcessedFileCount?9:10),a(5),p((E=R.statusData())!=null&&E.ProcessedFileSize?14:15)}}var G=class n{#i=S(B);#s=S(H);#t=S(V);#n=S(q);#r=S(w);statusData=this.#t.statusData;backupId=this.#n.backupId;restoreResult=y("");#e=null;lastRestoreStarted=x(()=>{if(this.#e)return this.#e;let t=this.#t.statusData()?.backup?.Backup?.Metadata?.LastRestoreStarted??null;if(!t)return null;let e=this.fixDate(t);return this.#e=e,e});notificationFilterPredicate=()=>{let t=this.lastRestoreStarted();return{predicate:e=>(e.BackupID===this.#n.backupId()&&t&&t.getTime()<=new Date(e.Timestamp).getTime())??!1}};ngOnInit(){let t=this.#r.snapshot.params.taskid?.toString()??"";this.#i.getApiV1TaskByTaskid({taskid:t}).subscribe({next:e=>{if(e.TaskStarted&&(this.#e=new Date(e.TaskStarted)),!e.TaskFinished&&e.ID){this.#_(e.ID);return}this.#o(e)},error:e=>{console.error("Error fetching task:",e),this.restoreResult.set("error"),alert("Failed to fetch task details. Please try again later.")}})}#_(t){this.#s.waitForTaskToComplete(t).subscribe(e=>{this.#o(e)})}#o(t){t.TaskFinished!=null&&this.restoreResult.set(t.Status==="Completed"&&t.ErrorMessage==null?"success":"error")}fixDate(t){return new Date(`${t.slice(0,4)}-${t.slice(4,6)}-${t.slice(6,8)}T${t.slice(9,11)}:${t.slice(11,13)}:${t.slice(13,15)}Z`)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=I({type:n,selectors:[["app-restore-progress"]],decls:12,vars:5,consts:()=>{let t;t=$localize`Notifications`;let e;e=$localize`Logs`;let o;o=$localize`Restore completed`;let l;l=$localize`check-bold`;let E;E=$localize`warning-octagon`;let R;R=$localize` Restore progress: ${"\uFFFD0\uFFFD"}:INTERPOLATION: ${"\uFFFD#3\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let h;h=$localize`Files processed:`;let F;F=$localize`Size processed:`;let L;L=$localize`N/A`;let $;return $=$localize`N/A`,[t,e,o,l,E,R,h,F,L,$,[1,"progress","type-a"],[1,"notifications","type-a"],[1,"notification-list"],[3,"notificationFilterPredicate"],[1,"logs","type-a"],[3,"polling","whenFilter","backupIdFilter"],["title",""],[1,"complete-success"],[1,"complete-failure"],[1,"border-svg"],["cx","50","cy","50","r","45",1,"border-circle"],[1,"success"],[1,"error"],[1,"primary"],[1,"progress-content"],[3,"value"]]},template:function(e,o){if(e&1&&(i(0,"section"),O(1,Y,5,1,"sh-card",10)(2,ie,16,4,"sh-card",10),i(3,"sh-card",11)(4,"h3"),r(5,0),s(),i(6,"div",12),c(7,"app-notifications",13),s()(),i(8,"sh-card",14)(9,"h3"),r(10,1),s(),c(11,"app-logs-live",15),s()()),e&2){let l;a(),p(o.restoreResult()!=""?1:2),a(6),C("notificationFilterPredicate",o.notificationFilterPredicate()),a(4),C("polling",o.restoreResult()=="")("whenFilter",(l=o.lastRestoreStarted())==null?null:l.getTime())("backupIdFilter",o.backupId())}},dependencies:[K,X,z,J,W,Z,j,k],styles:['[_nghost-%COMP%]{display:block;padding:0 1.25rem;margin-top:32px}section[_ngcontent-%COMP%]{display:grid;gap:1.25rem;grid-template-columns:2fr 1fr;grid-template-areas:"progress notifications" "logs logs"}section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-bottom:1rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]{grid-area:progress}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]:has(.complete-check){display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1.25rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] sh-spinner[_ngcontent-%COMP%]{--spinner-size: 1.25rem;--spinner-thickness: .1875rem}section[_ngcontent-%COMP%] .notifications[_ngcontent-%COMP%]{grid-area:notifications}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%]{grid-area:logs}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%] app-logs-live[_ngcontent-%COMP%]{max-height:50rem;overflow:auto}.notification-list[_ngcontent-%COMP%]{max-height:15rem;overflow:auto}.complete-success[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--success-8)}.complete-success[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-success[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--success-8)}.complete-failure[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--error-8)}.complete-failure[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-failure[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--error-8)}.border-svg[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}.border-circle[_ngcontent-%COMP%]{fill:none;stroke-width:.3125rem;stroke-dasharray:282.74;stroke-dashoffset:282.74;animation:_ngcontent-%COMP%_draw-border 1.2s linear forwards}@keyframes _ngcontent-%COMP%_draw-border{to{stroke-dashoffset:0}}@keyframes _ngcontent-%COMP%_reveal-icon{to{opacity:1}}.progress-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.progress-content[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{margin-bottom:.75rem}.progress-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-right:.25rem}'],changeDetection:0})};export{G as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as m}from"./chunk-6Q6SSTBK.js";import{a as r}from"./chunk-ANSV4G2K.js";import{b as B}from"./chunk-
|
|
1
|
+
import{a as m}from"./chunk-6Q6SSTBK.js";import{a as r}from"./chunk-ANSV4G2K.js";import{b as B}from"./chunk-E4NQOMJX.js";import{a as k}from"./chunk-YYD2JU6T.js";import{d as b}from"./chunk-DSYNIXJF.js";import{D as i,F as u,N as c,Qc as d,V as o,_ as s,pa as a,ra as p}from"./chunk-TQTOIWBK.js";var y="backupListOrderBy",v="backupListShowActualTimes",D=[{value:"id",label:$localize`Backup ID`},{value:"name",label:$localize`Backup name`},{value:"lastrun",label:$localize`Last run time`},{value:"nextrun",label:$localize`Next run time`},{value:"schedule",label:$localize`Is scheduled`},{value:"backend",label:$localize`Destination type`},{value:"sourcesize",label:$localize`Source size`},{value:"destinationsize",label:$localize`Destination size`},{value:"duration",label:$localize`Duration`},{value:"-id",label:$localize`Backup ID (descending)`},{value:"-name",label:$localize`Backup name (descending)`},{value:"-lastrun",label:$localize`Last run time (descending)`},{value:"-nextrun",label:$localize`Next run time (descending)`},{value:"-schedule",label:$localize`Is scheduled (descending)`},{value:"-backend",label:$localize`Destination type (descending)`},{value:"-sourcesize",label:$localize`Source size (descending)`},{value:"-destinationsize",label:$localize`Destination size (descending)`},{value:"-duration",label:$localize`Duration (descending)`}],g=class l{#s=s(b);#o=s(k);#e=s(B);#u=null;#t=a([]);#a=a([]);#l=a(!1);#n=a(null);#p=a(null);#c=r(v,"relative");#i=r(y,"id");orderByOptions=a(D);orderBy=this.#i.asReadonly();backups=this.#a.asReadonly();timeType=this.#c.asReadonly();backupsLoading=this.#l.asReadonly();startingBackup=this.#n.asReadonly();deletingBackup=this.#p.asReadonly();draftBackups=this.#t.asReadonly();#r=d(()=>this.#o.hasBackupListSubscribeOption()&&this.#e.getConnectionMethod()==="websocket");#d=p(()=>{let e=this.#e.backupListState();e&&this.#a.set(e)});addDraftBackup(e){let t=m();return this.#t.set([...this.#t(),{id:t,data:e}]),t}setOrderBy(e){this.#i.set(e),this.#e.isConnectionMethodSet()&&(this.#r()?this.#e.subscribe("backuplist",e):this.getBackups(!0))}setTimeType(e){this.#c.set(e)}removeDraftBackupById(e){this.#t.set(this.#t().filter(t=>t.id!==e))}getBackupById(e){return this.#a().find(t=>t.Backup?.ID===e)??null}getBackups(e=!1){if(!this.#e.isConnectionMethodSet())return;if(this.#r()){this.#e.subscribe("backuplist",this.#i());return}let t=this.#u,n=Date.now(),h=t&&n-t<900*1e3;t&&n-t<100||!e&&h&&this.#a().length||(this.#u=n,this.#l.set(!0),this.#s.getApiV1Backups({orderBy:this.#i()}).pipe(i(1),c(f=>this.#a.set(f)),u(()=>this.#l.set(!1))).subscribe())}startBackup(e){this.#n.set(e),this.#s.postApiV1BackupByIdStart({id:e}).pipe(i(1),c(()=>this.getBackups(!0)),u(()=>this.#n.set(null))).subscribe()}deleteBackup(e){return this.#s.deleteApiV1BackupById(e).pipe(i(1))}static \u0275fac=function(t){return new(t||l)};static \u0275prov=o({token:l,factory:l.\u0275fac,providedIn:"root"})};export{g as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as tt}from"./chunk-GRE6GKVP.js";import{k as Ze,n as et}from"./chunk-DJXLNIMV.js";import{a as ce}from"./chunk-VC55KFAX.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-AIAUP7OE.js";import{a as Z}from"./chunk-C6PICAXB.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 f,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 L,g as Le,gb as B,kc as xe,lb as ve,m as Me,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=f(()=>{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 L(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),L(n)}),N("keydown.enter",function(n){I(e);let s=E(3);return n.preventDefault(),L(s.performSearch())}),a()(),r(5,"button",27),N("click",function(){I(e);let n=E(3);return L(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 ft(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 L(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 ht(i,t){if(i&1){let e=D();r(0,"sh-select",17),N("cleared",function(){I(e);let n=E();return L(n.abortLoading())}),r(1,"input",18),re("ngModelChange",function(n){I(e);let s=E();return se(s.selectOption,n)||(s.selectOption=n),L(n)}),a(),ve(2,mt,5,7,"ng-template"),a(),T(3,St,1,0,"sh-progress-bar",13),T(4,ft,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=f(()=>this.#t.backup()?.Backup?.IsTemporary??!0);showFileTree=_(!1);backupSettings=_(null);rootPaths=_([]);initialNodes=_([]);loadingRootPath=_(!1);isRepairing=f(()=>this.#r().length>0);loadedVersions=_({});canSearch=f(()=>this.#n.hasV2ListOperations());searchQuery=_("");isSearching=_(!1);searchResults=_([]);hasSearched=_(!1);isSearchMode=f(()=>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 M={id:t+"",time:l};this.backupSettings.set(M),this.getRootPath(M)});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(M=>M!==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 Le;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 M;M=$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,M,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,ht,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?Me(()=>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 L(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 L(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 Lt(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 Mt(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,Lt,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=f(()=>this.#e.backup()?.Backup?.ID??null);extendedDataType=f(()=>{let t=this.#e.extendedDataType();return t==="o365"?"o365":t==="gsuite"?"gsuite":null});remoteCustomSourceEntry=f(()=>this.#e.backup()?.Backup?.Sources?.filter(t=>t.startsWith("@")&&(t.includes("|office365://")||t.includes("|googleworkspace://")))[0]??null);remoteCustomSourceUrl=f(()=>this.remoteCustomSourceEntry()?.split("|")[1]??null);remoteCustomSourcePrefix=f(()=>this.remoteCustomSourceEntry()?.split("|")[0]??null);customDestinationUrl=f(()=>{let t=this.optionsFormSignal()?.restoreFrom,e=this.extendedDataType()!==null;return t==="same-custom"&&e?this.remoteCustomSourceUrl():t==="other-custom"&&e?this.remoteCustomTargetUrl():null});showCustomRemoteRestoreTree=f(()=>!!(this.optionsFormSignal()?.restoreFrom==="same-custom"&&this.customDestinationUrl()&&this.backupId()||this.optionsFormSignal()?.restoreFrom==="other-custom"&&this.customDestinationUrl()));isCustomRemoteRestore=f(()=>{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 Office 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 Office 365 Tenant ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Different Office 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 M;M=$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 h;h=$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 fe;fe=$localize` Overwrite ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let he;he=$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,M,x,ee,te,h,Ne,fe,he,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,Mt,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-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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Sn}from"./chunk-TVFRVP7K.js";import{a as gn}from"./chunk-QDDVZ4CR.js";import"./chunk-BLSV7CNZ.js";import"./chunk-F2ZC26DC.js";import{c as re,l as pn}from"./chunk-O56QUSSI.js";import{b as dn}from"./chunk-F3JYPWPK.js";import{a as Tn}from"./chunk-736PM4LG.js";import"./chunk-TCXCC5BM.js";import"./chunk-GKGMP6VF.js";import"./chunk-6Q6SSTBK.js";import"./chunk-YCJYEQF7.js";import{a as En}from"./chunk-AXQQEOTT.js";import"./chunk-UTXZPAY6.js";import"./chunk-IMQUTGIK.js";import{a as Cn}from"./chunk-ANSV4G2K.js";import"./chunk-F3ETZKLK.js";import"./chunk-IQL3REGJ.js";import{b as Fn}from"./chunk-E4NQOMJX.js";import"./chunk-YYD2JU6T.js";import"./chunk-6JS7B4FW.js";import{A as tn,B as le,C as on,E as _n,G as an,K as ln,L as rn,S as cn,T as sn,v as ae,z as nn}from"./chunk-VKQQDCUN.js";import{d as un}from"./chunk-DSYNIXJF.js";import{e as _e}from"./chunk-NPFPMA4P.js";import"./chunk-O2SMJYPC.js";import"./chunk-N2AU7VKX.js";import"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import{$b as l,Ab as V,Ac as j,Bb as U,Bc as R,Cb as E,Db as o,Eb as i,F as Q,Fb as C,Fc as D,Gc as b,Hc as x,Jb as N,Jc as oe,Kb as M,Lb as $,Mb as h,Pa as J,Qc as q,Sa as a,Tb as u,Ub as F,Vb as d,Wb as k,Xb as H,Yb as K,Zb as I,_ as L,da as m,ea as O,gb as Qe,ic as W,kc as A,lb as P,mb as Ye,nc as T,pa as G,pc as S,ra as qe,sc as Y,tb as Ze,tc as Z,ub as en,uc as ee,vc as ne,wb as p,wc as te,xb as g,xc as ie,yb as z}from"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";var On=()=>[_e,import("./chunk-KZTFESBJ.js").then(e=>e.NgTemplateOutlet),le,ae,_n,sn,cn,import("./chunk-COI6UMB5.js").then(e=>e.BackupProgressComponent),import("./chunk-XWTB7XRI.js").then(e=>e.DurationFormatPipe),import("./chunk-ZNYN6ES6.js").then(e=>e.BytesPipe),import("./chunk-ACTATISC.js").then(e=>e.RelativeTimePipe)],Nn=()=>["/add-backup"],Mn=()=>["/restore"],mn=e=>({$implicit:e}),In=()=>["/backup/new"],Pn=e=>["/backup",e],Dn=e=>["/restore",e],fn=e=>["/backup",e,"export"],$n=e=>["/backup",e,"delete"],Rn=e=>["/backup",e,"database"],hn=e=>["/backup",e,"commandline"],An=e=>["/backup",e,"log"];function Ln(e,t){e&1&&d(0,11,1)}function xn(e,t){e&1&&d(0,11,2)}function yn(e,t){if(e&1&&d(0,11,3),e&2){let n=l(2);k(n.timeType()),H(0)}}function kn(e,t){if(e&1){let n=h();o(0,"button",64),I("click",function(){let c=m(n).$implicit,s=l(3);return O(s.sortByColumn.set(c.value))}),d(1,15),i()}if(e&2){let n=t.$implicit,_=l(3);A("active",_.orderBy()===n.value),a(),k(n.label),H(1)}}function Hn(e,t){if(e&1&&(o(0,"sh-menu",61)(1,"button",62),u(2,14),C(3,"strong")(4,"sh-icon"),F(),i(),N(5,63),V(6,kn,2,3,"button",65,z),M(),i()),e&2){let n=l(2);a(4),k(n.orderBy()),H(2),a(2),U(n.sortOrderOptions())}}function Gn(e,t){if(e&1){let n=h();o(0,"div",57)(1,"sh-button-group",58),ee("valueChange",function(c){m(n);let s=l();return Z(s.viewMode,c)||(s.viewMode=c),O(c)}),o(2,"button",59),u(3,9),C(4,"sh-icon"),F(),i(),o(5,"button",60),u(6,10),C(7,"sh-icon"),F(),i()(),o(8,"sh-menu",61)(9,"button",62),u(10,11),o(11,"strong"),p(12,Ln,1,0)(13,xn,1,0)(14,yn,1,1),i(),C(15,"sh-icon"),F(),i(),N(16,63),o(17,"button",64),I("click",function(){m(n);let c=l();return O(c.setTimeType("relative"))}),d(18,12),i(),o(19,"button",64),I("click",function(){m(n);let c=l();return O(c.setTimeType("actual"))}),d(20,13),i(),M(),i(),p(21,Hn,8,1,"sh-menu",61),i()}if(e&2){let n=l();a(),Y("value",n.viewMode),a(11),g(n.timeType()=="relative"?12:n.timeType()=="actual"?13:14),a(9),g(n.viewMode()==="list"?21:-1)}}function bn(e,t){if(e&1){let n=h();o(0,"div",70)(1,"div",53)(2,"h3"),T(3),o(4,"sh-chip"),C(5,"img",72),T(6),i()()(),o(7,"div",73)(8,"sh-chip",74),d(9,16),i()(),o(10,"div",57)(11,"button",75),I("click",function(){m(n);let c=l().$implicit,s=l(4);return O(s.openInConsole(c))}),u(12,17),C(13,"sh-icon"),F(),i()(),C(14,"app-backup-progress",76),i()}if(e&2){let n=l().$implicit,_=l(4);a(3),S(" ",n.Backup.Name??_.MISSING_BACKUP_NAME," "),a(2),E("src",_.getBackendIcon(n.Backup.TargetURL),J),a(),S(" ",_.getBackendType(n.Backup.TargetURL)," "),a(8),E("backupId",n.Backup.ID)}}function Bn(e,t){if(e&1&&(o(0,"p")(1,"span"),d(2,23),i(),T(3),D(4,"relativeTime"),i()),e&2){l();let n=ie(5),_=l(6);a(3),S(" ",x(4,1,n,_.timeType()==="actual")," ")}}function vn(e,t){if(e&1&&(T(0),D(1,"durationFormat")),e&2){let n=l(3).$implicit,_=l(4);S(" ",x(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDuration,_.timeType()==="actual")," ")}}function wn(e,t){e&1&&(N(0),T(1,"-"),M())}function Xn(e,t){if(e&1&&(T(0),D(1,"bytes")),e&2){let n=l(3).$implicit;S(" ",b(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.SourceFilesSize)," ")}}function Jn(e,t){e&1&&(N(0),T(1,"-"),M())}function zn(e,t){if(e&1&&(T(0),D(1,"bytes")),e&2){let n=l(3).$implicit;S(" ",b(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.TargetFilesSize)," ")}}function Vn(e,t){e&1&&(N(0),T(1,"-"),M())}function Un(e,t){if(e&1&&(o(0,"p")(1,"span"),d(2,19),i(),T(3),D(4,"relativeTime"),i(),ne(5),p(6,Bn,5,4,"p"),o(7,"p")(8,"span"),d(9,20),i(),p(10,vn,2,4)(11,wn,2,0,"ng-container"),i(),o(12,"p")(13,"span"),d(14,21),i(),p(15,Xn,2,3)(16,Jn,2,0,"ng-container"),i(),o(17,"p")(18,"span"),d(19,22),i(),p(20,zn,2,3)(21,Vn,2,0,"ng-container"),i()),e&2){let n=l(2).$implicit,_=l(4);a(3),S(" ",x(4,5,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupFinished,_.timeType()==="actual")," "),a(2);let c=te(_.scheduledTimes()[n.Backup.ID??""]);a(),g(c?6:-1),a(4),g(n.Backup.Metadata!=null&&n.Backup.Metadata.LastBackupDuration?10:11),a(5),g(n.Backup.Metadata!=null&&n.Backup.Metadata.SourceFilesSize?15:16),a(5),g(n.Backup.Metadata!=null&&n.Backup.Metadata.TargetFilesSize?20:21)}}function Kn(e,t){if(e&1&&C(0,"app-backup-progress",76),e&2){let n=l(2).$implicit;E("backupId",n.Backup.ID)}}function Wn(e,t){e&1&&(o(0,"sh-chip",74),d(1,24),i())}function jn(e,t){e&1&&$(0)}function qn(e,t){if(e&1&&(o(0,"div",71)(1,"div",53)(2,"h3"),T(3),o(4,"sh-chip"),C(5,"img",72),T(6),i()(),p(7,Un,22,9)(8,Kn,1,1,"app-backup-progress",76),i(),o(9,"div",73)(10,"sh-chip",77),d(11,18),i(),p(12,Wn,2,0,"sh-chip",74),i(),o(13,"div",57),P(14,jn,1,0,"ng-container",78),i()()),e&2){let n=l().$implicit,_=l(4),c=W(33);a(3),S(" ",n.Backup.Name??_.MISSING_BACKUP_NAME," "),a(2),E("src",_.getBackendIcon(n.Backup.TargetURL),J),a(),S(" ",_.getBackendType(n.Backup.TargetURL)," "),a(),g(_.runningBackupId()!==n.Backup.ID?7:8);let s=_.getBackupVersionCount(n);a(4),k(s)(s),H(11),a(),g(n.Backup.ExternalID?12:-1),a(2),E("ngTemplateOutlet",c)("ngTemplateOutletContext",R(9,mn,n))}}function Qn(e,t){if(e&1&&p(0,bn,15,4,"div",70)(1,qn,15,11,"div",71),e&2){let n=t.$implicit;g(n.Backup.ExternalID?0:1)}}function Yn(e,t){if(e&1&&V(0,Qn,2,1,null,null,z),e&2){let n=l(3);U(n.backups())}}function Zn(e,t){e&1&&(o(0,"div",69),u(1,25),o(2,"button",79),C(3,"sh-icon"),i(),F(),i()),e&2&&(a(2),E("routerLink",j(1,In)))}function et(e,t){if(e&1&&(o(0,"div",68),p(1,Yn,2,0)(2,Zn,4,2,"div",69),i()),e&2){let n=l(2);A("fallback",n.backups().length===0),a(),g(n.backups().length?1:2)}}function nt(e,t){e&1&&(u(0,26,1),$(1),F())}function tt(e,t){e&1&&(u(0,27,1),$(1),F())}function it(e,t){e&1&&(u(0,28,1),$(1),F())}function ot(e,t){e&1&&(u(0,29,1),$(1),F())}function _t(e,t){e&1&&(u(0,30,1),$(1),F())}function at(e,t){e&1&&(u(0,31,1),$(1),F())}function lt(e,t){e&1&&(u(0,32,1),$(1),F())}function rt(e,t){if(e&1&&(T(0),D(1,"relativeTime")),e&2){let n=l().$implicit,_=l(3);S(" ",x(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupFinished,_.timeType()==="actual")," ")}}function ct(e,t){e&1&&(N(0),T(1,"-"),M())}function st(e,t){if(e&1&&(T(0),D(1,"relativeTime")),e&2){l();let n=ie(11),_=l(3);S(" ",x(1,1,n,_.timeType()==="actual")," ")}}function ut(e,t){e&1&&(N(0),T(1,"-"),M())}function Ft(e,t){if(e&1&&(T(0),D(1,"durationFormat")),e&2){let n=l().$implicit,_=l(3);S(" ",x(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDuration,_.timeType()==="actual")," ")}}function Ct(e,t){e&1&&(N(0),T(1,"-"),M())}function Tt(e,t){if(e&1&&(T(0),D(1,"bytes")),e&2){let n=l().$implicit;S(" ",b(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.SourceFilesSize)," ")}}function dt(e,t){e&1&&(N(0),T(1,"-"),M())}function Et(e,t){if(e&1&&(T(0),D(1,"bytes")),e&2){let n=l().$implicit;S(" ",b(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.TargetFilesSize)," ")}}function pt(e,t){e&1&&(N(0),T(1,"-"),M())}function gt(e,t){e&1&&$(0)}function St(e,t){if(e&1&&(o(0,"tr")(1,"td"),T(2),i(),o(3,"td")(4,"sh-chip",90),C(5,"img",72),T(6),i()(),o(7,"td"),p(8,rt,2,4)(9,ct,2,0,"ng-container"),i(),o(10,"td"),ne(11),p(12,st,2,4)(13,ut,2,0,"ng-container"),i(),o(14,"td"),p(15,Ft,2,4)(16,Ct,2,0,"ng-container"),i(),o(17,"td"),p(18,Tt,2,3)(19,dt,2,0,"ng-container"),i(),o(20,"td"),p(21,Et,2,3)(22,pt,2,0,"ng-container"),i(),o(23,"td")(24,"span"),d(25,35),i()(),o(26,"td"),P(27,gt,1,0,"ng-container",78),i()()),e&2){let n=t.$implicit,_=l(3),c=W(33);a(2),S(" ",n.Backup.Name??_.MISSING_BACKUP_NAME," "),a(3),E("src",_.getBackendIcon(n.Backup.TargetURL),J),a(),S(" ",_.getBackendType(n.Backup.TargetURL)," "),a(2),g(n.Backup.Metadata!=null&&n.Backup.Metadata.LastBackupFinished?8:9),a(3);let s=te(_.scheduledTimes()[n.Backup.ID??""]);a(),g(s?12:13),a(3),g(n.Backup.Metadata!=null&&n.Backup.Metadata.LastBackupDuration?15:16),a(3),g(n.Backup.Metadata!=null&&n.Backup.Metadata.SourceFilesSize?18:19),a(3),g(n.Backup.Metadata!=null&&n.Backup.Metadata.TargetFilesSize?21:22);let f=_.getBackupVersionCount(n);a(4),k(f)(f),H(25),a(2),E("ngTemplateOutlet",c)("ngTemplateOutletContext",R(13,mn,n))}}function mt(e,t){if(e&1){let n=h();o(0,"sh-table",80),ee("sortByColumnChange",function(c){m(n);let s=l(2);return Z(s.sortByColumn,c)||(s.sortByColumn=c),O(c)}),o(1,"tr",81)(2,"th",82),u(3,26),P(4,nt,2,0,"ng-container",83),F(),i(),o(5,"th",84),u(6,27),P(7,tt,2,0,"ng-container",83),F(),i(),o(8,"th",85),u(9,28),P(10,it,2,0,"ng-container",83),F(),i(),o(11,"th",86),u(12,29),P(13,ot,2,0,"ng-container",83),F(),i(),o(14,"th",87),u(15,30),P(16,_t,2,0,"ng-container",83),F(),i(),o(17,"th",88),u(18,31),P(19,at,2,0,"ng-container",83),F(),i(),o(20,"th",89),u(21,32),P(22,lt,2,0,"ng-container",83),F(),i(),o(23,"th"),d(24,33),i(),o(25,"th"),d(26,34),i()(),V(27,St,28,15,"tr",null,z),i()}if(e&2){let n=l(2),_=W(35);E("data",n.backups())("loading",n.backupsLoading()),Y("sortByColumn",n.sortByColumn),a(4),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(5),U(n.backups())}}function Ot(e,t){if(e&1&&p(0,et,3,3,"div",66)(1,mt,29,10,"sh-table",67),e&2){let n=l();g(n.viewMode()==="list"?0:n.viewMode()==="details"?1:-1)}}function Nt(e,t){e&1&&(o(0,"div",91),C(1,"sh-progress-bar",92),o(2,"div",53)(3,"h3"),d(4,36),i()()())}function Mt(e,t){if(e&1){let n=h();o(0,"button",94),I("click",function(){m(n);let c=l(3);return O(c.abort())}),u(1,38),C(2,"sh-icon"),F(),i()}if(e&2){let n=l(3);A("small",n.viewMode()==="details")}}function It(e,t){if(e&1){let n=h();o(0,"button",94),I("click",function(){m(n);let c=l(3);return O(c.stop())}),u(1,39),C(2,"sh-icon"),F(),i()}if(e&2){let n=l(3);A("small",n.viewMode()==="details")}}function Pt(e,t){e&1&&(u(0,37,1),C(1,"sh-icon"),F())}function Dt(e,t){e&1&&(u(0,37,2),C(1,"sh-icon"),F())}function ft(e,t){if(e&1){let n=h();p(0,Mt,3,2,"button",93)(1,It,3,2,"button",93),o(2,"button",94),I("click",function(){m(n);let c=l(2);return O(c.pauseResume())}),u(3,37),p(4,Pt,2,0)(5,Dt,2,0),F(),i()}if(e&2){let n=l(2);g(n.isStopping()?0:1),a(2),A("small",n.viewMode()==="details")("loading",n.isResuming()),a(2),g(n.clientIsRunning()?4:5)}}function $t(e,t){e&1&&d(0,40,1)}function Rt(e,t){e&1&&(o(0,"sh-icon"),T(1,"check"),i())}function ht(e,t){e&1&&(o(0,"sh-icon"),T(1,"dots-three-vertical"),i())}function At(e,t){if(e&1){let n=h();o(0,"button",94),I("click",function(){m(n);let c=l().$implicit,s=l();return O(s.startBackup(c.Backup.ID))}),u(1,40),C(2,"sh-icon"),p(3,$t,1,0),F(),i(),o(4,"button",95)(5,"sh-icon"),T(6,"pencil-simple"),i()(),o(7,"sh-menu")(8,"button",96),p(9,Rt,2,0,"sh-icon")(10,ht,2,0,"sh-icon"),i(),N(11,63),o(12,"h3",97),T(13,"Operations"),i(),o(14,"button",98),u(15,41),C(16,"sh-icon"),F(),i(),o(17,"button",98),u(18,42),C(19,"sh-icon"),F(),i(),o(20,"button",98),u(21,43),C(22,"sh-icon"),F(),i(),C(23,"sh-divider"),o(24,"h3",97),d(25,44),i(),o(26,"button",98),u(27,45),C(28,"sh-icon"),F(),i(),o(29,"button",64),I("click",function(){m(n);let c=l().$implicit,s=l();return O(s.verifyFiles(c.Backup.ID))}),u(30,46),C(31,"sh-icon"),F(),i(),o(32,"button",64),I("click",function(){m(n);let c=l().$implicit,s=l();return O(s.compressBackup(c.Backup.ID))}),u(33,47),C(34,"sh-icon"),F(),i(),o(35,"button",98),u(36,48),C(37,"sh-icon"),F(),i(),C(38,"sh-divider"),o(39,"h3",97),d(40,49),i(),o(41,"button",98),u(42,50),C(43,"sh-icon"),F(),i(),M(),i()}if(e&2){let n=l().$implicit,_=l();A("loading",_.startingBackup()===n.Backup.ID),a(3),g(_.viewMode()==="list"?3:-1),a(),E("routerLink",R(15,Pn,n.Backup.ID)),a(4),A("loading",_.loadingId()===n.Backup.ID)("success",_.successId()===n.Backup.ID),a(),g(_.successId()===n.Backup.ID?9:10),a(5),E("routerLink",R(17,Dn,n.Backup.ID)),a(3),E("routerLink",R(19,fn,n.Backup.ID)),a(3),E("routerLink",R(21,$n,n.Backup.ID)),a(6),E("routerLink",R(23,Rn,n.Backup.ID)),a(9),E("routerLink",R(25,hn,n.Backup.ID)),a(6),E("routerLink",R(27,An,n.Backup.ID))}}function Lt(e,t){if(e&1&&p(0,ft,6,6)(1,At,44,29),e&2){let n=t.$implicit,_=l();g(_.runningBackupId()===n.Backup.ID?0:1)}}function xt(e,t){e&1&&(o(0,"sh-icon",99),T(1,"funnel-simple"),i(),o(2,"sh-icon",100),T(3,"sort-ascending"),i(),o(4,"sh-icon",101),T(5,"sort-descending"),i())}var yt={file:{Display:$localize`Local`,Icon:null}},ce=class e{#t=L(un);#n=L(dn);#e=L(Tn);#o=L(En);#_=L(Fn);#a=L(nn);MISSING_BACKUP_NAME=$localize`Backup name missing`;sortOrderOptions=this.#e.orderByOptions;orderBy=this.#e.orderBy;backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;startingBackup=this.#e.startingBackup;deletingBackup=this.#e.deletingBackup;runningBackupId=this.#n.runningBackupId;timeType=this.#e.timeType;clientIsRunning=this.#n.clientIsRunning;isResuming=this.#n.isResuming;runningTask=q(()=>this.#n.serverState()?.ActiveTask?.Item1);isStopping=q(()=>this.runningTask()==this.#i());scheduledTimes=q(()=>{let t=this.#_.serverState()?.ProposedSchedule??[],n=this.#e.backups(),_={};return n.forEach(c=>{let s=c.Backup?.ID;if(s){var f=t.find(y=>y.Item1==s);f?.Item2?_[s]=f.Item2:c.Schedule?.Time&&(_[s]=c.Schedule.Time)}}),_});#i=G(-1);viewMode=Cn("viewMode","list");sortByColumn=G(this.#e.orderBy());loadingId=G(null);successId=G(null);sortEffect=qe(()=>this.#e.setOrderBy(this.sortByColumn()));ngOnInit(){this.#e.getBackups(!0)}openInConsole(t){let n=t.Backup.ExternalID?.split(":")[1];if(!n){console.error("Backup does not have an external ID");return}this.#o.openConsole("/app/machines/configurations/"+n)}setOrderBy(t){this.#e.setOrderBy(t)}setTimeType(t){this.#e.setTimeType(t)}startBackup(t){this.#n.resumeDialogCheck(()=>this.#e.startBackup(t))}openPauseDialog(){this.#a.open(gn,{maxWidth:"550px",width:"100%"})}pauseResume(){if(this.clientIsRunning()){this.openPauseDialog();return}this.#n.pauseResume().subscribe()}stop(){let t=this.runningTask();t&&(this.#i.set(t),this.#t.postApiV1TaskByTaskidStop({taskid:t}).subscribe())}abort(){let t=this.runningTask();t&&this.#t.postApiV1TaskByTaskidAbort({taskid:t}).subscribe()}getBackendIcon(t){return t?re(t).icon??"database":""}getBackendType(t){if(!t)return"";let n=re(t);if(!n)return"";let _=yt[n.key];if(_?.Display)return _.Display;if(n.key==="s3"){let c="http://null?"+t.split("?")[1],f=new URL(c).searchParams.get("s3-server-name")?.toLowerCase()??"";for(let[y,B]of Object.entries(pn))if(f.endsWith(y))return B}return n.displayName}getBackupVersionCount(t){return parseInt(t?.Backup?.Metadata?.BackupListCount??"",10)||0}verifyFiles(t){this.loadingId.set(t),this.#t.postApiV1BackupByIdVerify({id:t}).pipe(Q(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(t),setTimeout(()=>this.successId.set(null),2e3)}})}compressBackup(t){this.loadingId.set(t),this.#t.postApiV1BackupByIdCompact({id:t}).pipe(Q(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(t),setTimeout(()=>this.successId.set(null),2e3)}})}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=Qe({type:e,selectors:[["app-home"]],decls:36,vars:6,consts:()=>{let t;t=$localize`Backups`;let n;n=$localize`Keep your data safe at your chosen destination.`;let _;_=$localize` Create ${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON:`;let c;c=$localize`Restores`;let s;s=$localize`Recover your files from any backup set.`;let f;f=$localize` Start ${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON:`;let y;y=$localize`My backups`;let B;B=$localize`${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:rows${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON: List `;let se;se=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:list${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Details `;let ue;ue=$localize` Time: ${"\uFFFD#11\uFFFD"}:START_TAG_STRONG:${"\uFFFD*12:1\uFFFD"}:START_BLOCK_IF: Relative ${"\uFFFD/*12:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*13:2\uFFFD"}:START_BLOCK_ELSE_IF: Actual ${"\uFFFD/*13:2\uFFFD"}:CLOSE_BLOCK_ELSE_IF:${"\uFFFD*14:3\uFFFD"}:START_BLOCK_ELSE: ${"\uFFFD0:3\uFFFD"}:INTERPOLATION: ${"\uFFFD/*14:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:clock${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`;let Fe;Fe=$localize`Relative time`;let Ce;Ce=$localize`Actual time`;let Te;Te=$localize` Order by: ${"\uFFFD#3\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:arrows-down-up${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let de;de=$localize` ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let Ee;Ee=$localize`Externally managed`;let pe;pe=$localize` Edit in console ${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:arrow-up-right${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON:`;let v;v=$localize`{VAR_PLURAL, plural, =0 {No version yet} =1 {1 Version} other {{INTERPOLATION} Versions}}`,v=K(v,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let ge;ge=$localize` ${v}:ICU@@6502601490918455200: `;let Se;Se=$localize`Last successful backup:`;let me;me=$localize`Duration:`;let Oe;Oe=$localize`Source:`;let Ne;Ne=$localize`Destination:`;let Me;Me=$localize`Next scheduled run:`;let Ie;Ie=$localize`Externally managed`;let Pe;Pe=$localize` No backups found ${"\uFFFD#2\uFFFD"}:START_TAG_BUTTON: Click to create one now ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_BUTTON:`;let De;De=$localize` Backup ${"\uFFFD*4:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*4:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let fe;fe=$localize` Type ${"\uFFFD*7:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*7:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let $e;$e=$localize` Last backup ${"\uFFFD*10:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*10:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Re;Re=$localize` Next run ${"\uFFFD*13:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*13:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let he;he=$localize` Duration ${"\uFFFD*16:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*16:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Ae;Ae=$localize` Source ${"\uFFFD*19:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*19:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Le;Le=$localize` Destination ${"\uFFFD*22:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*22:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let xe;xe=$localize`Version`;let ye;ye=$localize`Actions`;let w;w=$localize`{VAR_PLURAL, plural, =0 {No versions} =1 {1 Version} other {{INTERPOLATION} Versions}}`,w=K(w,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let ke;ke=$localize` ${w}:ICU@@3521773141017690117: `;let He;He=$localize`Loading backups...`;let X;X=$localize`${"\uFFFD*4:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:pause${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Pause ${"\uFFFD/*4:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*5:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:play${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Resume ${"\uFFFD/*5:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,X=K(X);let Ge;Ge=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:skull${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Abort `;let be;be=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:stop${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Stop `;let Be;Be=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:play-circle${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD*3:1\uFFFD"}:START_BLOCK_IF: Start ${"\uFFFD/*3:1\uFFFD"}:CLOSE_BLOCK_IF:`;let ve;ve=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:clock-counter-clockwise${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: Restore `;let we;we=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:export${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Export `;let Xe;Xe=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON: Delete `;let Je;Je=$localize`Advanced`;let ze;ze=$localize`${"\uFFFD#28\uFFFD"}:START_TAG_SH_ICON:database${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SH_ICON: Database `;let Ve;Ve=$localize`${"\uFFFD#31\uFFFD"}:START_TAG_SH_ICON:check-square-offset${"\uFFFD/#31\uFFFD"}:CLOSE_TAG_SH_ICON: Verify files `;let Ue;Ue=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SH_ICON:file-archive${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SH_ICON: Compress now `;let Ke;Ke=$localize`${"\uFFFD#37\uFFFD"}:START_TAG_SH_ICON:terminal-window${"\uFFFD/#37\uFFFD"}:CLOSE_TAG_SH_ICON: Commandline `;let We;We=$localize`Reporting`;let je;return je=$localize`${"\uFFFD#43\uFFFD"}:START_TAG_SH_ICON:notepad${"\uFFFD/#43\uFFFD"}:CLOSE_TAG_SH_ICON: Log `,[["actions",""],["sortIcons",""],t,n,_,c,s,f,y,B,se,ue,Fe,Ce,Te,de,Ee,pe,ge,Se,me,Oe,Ne,Me,Ie,Pe,De,fe,$e,Re,he,Ae,Le,xe,ye,ke,He,X,Ge,be,Be,ve,we,Xe,Je,ze,Ve,Ue,Ke,We,je,[1,"type-a","actionable",3,"keydown.enter","keydown.space","routerLink"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["type","button","tabindex","-1","shButton",""],["src","assets/images/restore.png","alt","","width","48px"],[1,"content"],[1,"actions"],[1,"small","type-b",3,"valueChange","value"],["value","list"],["value","details"],[1,"table-overview"],["type","button","shButton","",1,"small"],["menu",""],["type","button",3,"click"],["type","button",3,"active"],[1,"backups",3,"fallback"],[1,"type-b",3,"data","loading","sortByColumn"],[1,"backups"],[1,"no-backups"],[1,"backup","externaly-managed"],[1,"backup"],["alt","",1,"provider-icon",3,"src"],[1,"tags"],[1,"simple","primary"],["type","button","shButton","",3,"click"],[3,"backupId"],[1,"simple","success"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["shButton","",1,"primary","raised",3,"routerLink"],[1,"type-b",3,"sortByColumnChange","data","loading","sortByColumn"],["thead",""],["shSort","name"],[4,"ngTemplateOutlet"],["shSort","type"],["shSort","lastrun"],["shSort","nextrun"],["shSort","duration"],["shSort","sourcesize"],["shSort","destinationsize"],[1,"small"],[1,"loading-list"],[1,"indeterminate","primary"],["shButton","",3,"small"],["shButton","",3,"click"],["type","button","shButton","",3,"routerLink"],["type","button","shButton",""],["title",""],["type","button",3,"routerLink"],[1,"filter"],[1,"asc"],[1,"desc"]]},template:function(n,_){n&1&&(C(0,"app-status-bar"),o(1,"section")(2,"header")(3,"sh-card",51),I("keydown.enter",function(s){return s.target.click()})("keydown.space",function(s){return s.target.click()}),C(4,"img",52),o(5,"div",53)(6,"h3"),d(7,2),i(),o(8,"p"),d(9,3),i()(),o(10,"button",54),u(11,4),C(12,"sh-icon"),F(),i()(),o(13,"sh-card",51),I("keydown.enter",function(s){return s.target.click()})("keydown.space",function(s){return s.target.click()}),C(14,"img",55),o(15,"div",53)(16,"h3"),d(17,5),i(),o(18,"p"),d(19,6),i()(),o(20,"button",54),u(21,7),C(22,"sh-icon"),F(),i()()(),o(23,"div",56)(24,"h2"),N(25),d(26,8),M(),p(27,Gn,22,3,"div",57),i(),Ye(28,Ot,2,1)(29,Nt,5,0),Ze(30,28,On,null,29),i()(),P(32,Lt,2,1,"ng-template",null,0,oe)(34,xt,6,0,"ng-template",null,1,oe)),n&2&&(a(3),E("routerLink",j(4,Nn)),a(10),E("routerLink",j(5,Mn)),a(14),g(_.backups().length>0?27:-1),a(3),en(!_.backupsLoading()))},dependencies:[_e,Sn,on,le,ae,an,ln,rn,tn],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem 0}header[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;padding:0 2rem;gap:1rem}@media only screen and (max-width:768px){header[_ngcontent-%COMP%]{grid-template-columns:1fr}}sh-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}sh-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.content[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{padding:0 2rem}@media only screen and (max-width:768px){.content[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:.5rem}}sh-menu[_ngcontent-%COMP%]{color:red}.backups[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem;gap:.5rem}.backups.fallback[_ngcontent-%COMP%]{justify-content:center;align-items:center;padding:4rem;border:1px solid var(--base-4);background:var(--base-2);border-radius:var(--shape-2);width:calc(100% - 4rem);margin:0 auto}.no-backups[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;align-items:center}.backup[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem;gap:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10)}@media only screen and (max-width:768px){.backup[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start}}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;max-width:40%}@media only screen and (max-width:768px){.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{max-width:initial}}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font:var(--paragraph-30);color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--base-12)}.backup[_ngcontent-%COMP%] .tags[_ngcontent-%COMP%]{display:flex;align-items:center;flex-direction:column;gap:.5rem}.provider-icon[_ngcontent-%COMP%]{width:1.25rem;height:1.25rem}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.sortable[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none}.sortable[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{margin-left:.5rem;font-size:1rem;justify-self:flex-end;display:none}.sortable[_ngcontent-%COMP%]:not(.sort-asc):not(.sort-desc) sh-icon.filter[_ngcontent-%COMP%]{display:block}.sortable.sort-asc[_ngcontent-%COMP%] sh-icon.asc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}.sortable.sort-desc[_ngcontent-%COMP%] sh-icon.desc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}.actionable[_ngcontent-%COMP%]{cursor:pointer}.actionable[_ngcontent-%COMP%]:after{transition:inset .1s linear}.actionable[_ngcontent-%COMP%]:hover{--card-shp: 0}"],changeDetection:0})};export{ce as default};
|
|
@@ -0,0 +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 +1 @@
|
|
|
1
|
-
import{a as wt,b as Ut,c as $t,m as bt,q as Lt,r as Rt}from"./chunk-DJXLNIMV.js";import"./chunk-CAQ3XMFP.js";import"./chunk-VC55KFAX.js";import{b as Mt,c as yt,d as Ft}from"./chunk-ZEFSBETQ.js";import"./chunk-6Q6SSTBK.js";import"./chunk-YCJYEQF7.js";import"./chunk-OHYENIPP.js";import"./chunk-UTXZPAY6.js";import"./chunk-IMQUTGIK.js";import"./chunk-BACKG7KA.js";import"./chunk-IQL3REGJ.js";import"./chunk-AIAUP7OE.js";import"./chunk-C6PICAXB.js";import"./chunk-6JS7B4FW.js";import{B as ht,C as It,G as ft,H as Ot,K as Dt,L as Pt,V as xt,W as At,c as ct,e as dt,f as Ct,g as gt,i as ut,j as Tt,r as pt,s as mt,v as St,w as Nt,y as Et}from"./chunk-VKQQDCUN.js";import"./chunk-DSYNIXJF.js";import{b as _t,d as lt}from"./chunk-NPFPMA4P.js";import"./chunk-O2SMJYPC.js";import"./chunk-N2AU7VKX.js";import"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import{$b as s,Ab as M,Ac as rt,Bb as y,Cb as E,Db as a,Eb as r,Fb as h,Jb as v,Kb as G,Mb as N,Qc as $,Sa as l,Tb as f,Ub as O,Vb as S,Yc as st,Zb as C,_ as P,da as c,ea as d,gb as et,gc as nt,ha as tt,hc as it,kc as ot,nc as g,oc as D,pa as I,ra as R,sc as F,tc as w,uc as U,vc as at,wb as T,wc as k,xb as p,xc as x,yb as A}from"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";var vt=["testUrl"],Gt=()=>({maxWidth:"700px",width:"100%"});function kt(o,n){if(o&1){let t=N();a(0,"sh-card",30)(1,"div",32)(2,"h3"),S(3,4),r(),a(4,"button",33),C("click",function(){c(t);let i=s(3);return d(i.closeCustomList())}),g(5," Cancel "),a(6,"sh-icon"),g(7,"x-bold"),r()()(),a(8,"app-destination-list",34),C("setDestination",function(i){c(t);let _=s(3);return d(_.setDestination(i))}),r()()}}function Bt(o,n){if(o&1){let t=N();a(0,"div",40)(1,"sh-toggle",43),U("checkedChange",function(i){c(t);let _=s(2).$implicit;return w(_.save,i)||(_.save=i),d(i)}),a(2,"span",44),S(3,8),r()()()}if(o&2){let t=s(2).$implicit;l(),E("color","primary")("variant","raised"),F("checked",t.save)}}function Vt(o,n){if(o&1){let t=N();a(0,"sh-toggle-card",31),v(1,35),a(2,"app-destination-list-item",36)(3,"button",33),C("click",function(){c(t);let i=s().$index,_=s(2);return d(_.changeDestination(i))}),g(4,"Change"),r(),a(5,"sh-menu",37),C("click",function(i){return i.stopPropagation()}),a(6,"button",38)(7,"sh-icon"),g(8,"dots-three-vertical"),r()(),v(9,39),a(10,"button",33),C("click",function(){c(t);let i=s().$index,_=s(2);return d(_.openTargetUrlDialog(i))}),f(11,5),h(12,"sh-icon"),O(),r(),a(13,"button",33),C("click",function(){c(t);let i=s().$index,_=s(2);return d(_.copyTargetUrl(i))}),f(14,6),h(15,"sh-icon"),O(),r(),a(16,"button",33),C("click",function(){c(t);let i=s().$index,_=s(2);return d(_.removeDestination(i))}),f(17,7),h(18,"sh-icon"),O(),r(),G(),r()(),G(),T(19,Bt,4,3,"div",40),a(20,"app-test-url",41,1),C("targetUrlChange",function(i){c(t);let _=s().$index,m=s(2);return d(m.updateTargetUrl(_,i))})("testSignalChange",function(i){c(t);let _=s().$index,m=s(2);return d(m.updateTestState(_,i))}),r(),a(22,"app-single-destination",42),C("targetUrlChange",function(i){c(t);let _=s().$index,m=s(2);return d(m.updateTargetUrl(_,i))}),r()()}if(o&2){let t=s(),e=t.$implicit,i=t.$index,_=s(2);E("disableToggle",!0)("isActive",!0),l(2),E("targetUrl",e.url)("connectionStringId",e.connectionStringId),l(17),p(e.connectionStringId?-1:19),l(),E("targetUrl",e.url)("testSignal",_.testStates()[i]||null)("backupId",_.backupId())("connectionStringId",e.connectionStringId)("sourcePrefix",null)("suppressErrorDialogs",!1)("askToCreate",!0)("testExpectation",_.isNew()?"destinationEmpty":"any")("moduleType","Backend"),l(2),E("targetUrl",e.url)("useBackupState",!0)}}function Kt(o,n){if(o&1&&T(0,kt,9,0,"sh-card",30)(1,Vt,23,16,"sh-toggle-card",31),o&2){let t=n.$index,e=s(2);p(e.showCustomList()&&e.currentEditingIndex()===t?0:1)}}function Jt(o,n){if(o&1&&M(0,Kt,2,1,null,null,A),o&2){s();let t=x(0);y(t)}}function Xt(o,n){o&1&&(a(0,"div",45),h(1,"sh-progress-bar",46),a(2,"div",47)(3,"h3"),S(4,9),r()()())}function zt(o,n){o&1&&(a(0,"sh-divider"),S(1,12),r())}function Ht(o,n){if(o&1&&(a(0,"p",52),g(1),r()),o&2){let t=s().$implicit;l(),D(t.Description)}}function Wt(o,n){if(o&1&&(a(0,"p",52),g(1),r()),o&2){let t=s().$implicit,e=s(4);l(),D(e.getSimplePath(t.BaseUrl))}}function jt(o,n){if(o&1){let t=N();a(0,"app-destination-list-item",50),C("click",function(){let i=c(t).$implicit,_=s(4);return d(_.selectSavedDestination(i))})("keydown.enter",function(i){return i.target.click()})("keydown.space",function(i){return i.target.click()}),a(1,"h3",51),g(2),r(),T(3,Ht,2,1,"p",52)(4,Wt,2,1,"p",52),r()}if(o&2){let t=n.$implicit;E("targetUrl",t.BaseUrl),l(2),D(t.Name||t.BaseUrl),l(),p(t.Description?3:4)}}function Qt(o,n){if(o&1){let t=N();a(0,"sh-card",48),C("click",function(){c(t);let i=s(3);return d(i.toggleCustomList())})("keydown.enter",function(i){return i.target.click()})("keydown.space",function(i){return i.target.click()}),a(1,"sh-icon"),g(2,"plus-circle"),r(),a(3,"div",47)(4,"h3"),S(5,10),r(),a(6,"p"),S(7,11),r()()(),T(8,zt,2,0,"sh-divider"),M(9,jt,5,3,"app-destination-list-item",49,A)}if(o&2){let t=s(3);l(8),p(t.destinations().length>0?8:-1),l(),y(t.destinations())}}function qt(o,n){if(o&1&&T(0,Xt,5,0,"div",45)(1,Qt,11,1),o&2){let t=s(2);p(t.isLoadingDestinations()?0:1)}}function Yt(o,n){o&1&&(a(0,"sh-divider"),S(1,15),r())}function Zt(o,n){if(o&1&&(a(0,"p",52),g(1),r()),o&2){let t=s().$implicit;l(),D(t.Description)}}function te(o,n){if(o&1&&(a(0,"p",52),g(1),r()),o&2){let t=s().$implicit,e=s(3);l(),D(e.getSimplePath(t.BaseUrl))}}function ee(o,n){if(o&1){let t=N();a(0,"app-destination-list-item",57),C("click",function(){let i=c(t).$implicit,_=s(3);return d(_.selectSavedDestination(i))}),a(1,"h3",51),g(2),r(),T(3,Zt,2,1,"p",52)(4,te,2,1,"p",52),r()}if(o&2){let t=n.$implicit;E("targetUrl",t.BaseUrl),l(2),D(t.Name||t.BaseUrl),l(),p(t.Description?3:4)}}function ne(o,n){if(o&1){let t=N();a(0,"div",53)(1,"button",54),C("click",function(){c(t);let i=s(2);return d(i.closeCustomList())}),a(2,"sh-icon"),g(3,"arrow-left"),r(),g(4," Back "),r()(),a(5,"sh-card",55),C("click",function(){c(t);let i=s(2);return d(i.toggleCustomList())}),a(6,"sh-icon"),g(7,"plus-circle"),r(),a(8,"div",47)(9,"h3"),S(10,13),r(),a(11,"p"),S(12,14),r()()(),T(13,Yt,2,0,"sh-divider"),M(14,ee,5,3,"app-destination-list-item",56,A)}if(o&2){let t=s(2);l(13),p(t.destinations().length>0?13:-1),l(),y(t.destinations())}}function ie(o,n){if(o&1){let t=N();a(0,"div",53)(1,"button",54),C("click",function(){c(t);let i=s(3);return d(i.closeCustomList())}),a(2,"sh-icon"),g(3,"arrow-left"),r()(),a(4,"h3"),S(5,16),r()()}}function oe(o,n){if(o&1){let t=N();T(0,ie,6,0,"div",53),a(1,"app-destination-list",34),C("setDestination",function(i){c(t);let _=s(2);return d(_.setDestination(i))}),r()}if(o&2){let t=s(2),e=x(0);p(t.destinations().length>0||e.length>0?0:-1)}}function ae(o,n){if(o&1&&T(0,qt,2,1)(1,ne,16,1)(2,oe,2,1),o&2){let t=s(),e=x(1);p(!t.showCustomList()&&!e&&!t.isAddingNew()?0:t.isAddingNew()&&!t.showCustomList()?1:2)}}function re(o,n){if(o&1){let t=N();a(0,"div",25)(1,"button",58),C("click",function(){c(t);let i=s();return d(i.startAddingNew())}),a(2,"sh-icon"),g(3,"plus"),r(),g(4," Add another destination "),r()()}}function se(o,n){o&1&&(a(0,"h2"),S(1,19),r())}function _e(o,n){o&1&&(a(0,"h2"),S(1,20),r())}function le(o,n){if(o&1){let t=N();a(0,"sh-dialog",59),U("isOpenChange",function(i){c(t);let _=s();return w(_.targetUrlDialogOpen,i)||(_.targetUrlDialogOpen=i),d(i)}),a(1,"header",60)(2,"div",61),T(3,se,2,0,"h2")(4,_e,2,0,"h2"),a(5,"sh-alert",62),S(6,17),r()()(),a(7,"div",63)(8,"sh-form-field")(9,"textarea",64),U("ngModelChange",function(i){c(t);let _=s();return w(_.targetUrlCtrl,i)||(_.targetUrlCtrl=i),d(i)}),r()()(),a(10,"footer",65)(11,"button",27),C("click",function(){c(t);let i=s();return d(i.closeTargetUrlDialog(!1))}),g(12,"Cancel"),r(),a(13,"button",66),C("click",function(){c(t);let i=s();return d(i.closeTargetUrlDialog(!0))}),f(14,18),h(15,"sh-icon"),O(),r()()()}if(o&2){let t=s(),e=x(1);F("isOpen",t.targetUrlDialogOpen),E("options",rt(4,Gt)),l(3),p(e?4:3),l(6),F("ngModel",t.targetUrlCtrl)}}var b=new pt,Ae=(o={destinations:[]})=>b.group({destinations:b.array(o.destinations)}),Me=({key:o,customGroup:n,dynamicGroup:t,advancedGroup:e})=>b.group({destinationType:b.control(o),custom:n,dynamic:t,advanced:e}),B=class o{#n=P(lt);#i=P(_t);#t=P(Lt);#e=P(wt);injector=P(tt);testUrlComponents=st("testUrl");testStates=I([]);targetUrls=this.#t.targetUrls;targetUrlModel=$(()=>this.targetUrls()[0]?.url??null);targetUrlCtrl=I(null);targetUrlInitial=I(null);currentEditingIndex=I(null);targetUrlDialogOpen=I(!1);showCustomList=I(!1);isConnectionStringSaved=this.#t.isConnectionStringSaved;destinations=this.#e.destinations;isLoadingDestinations=this.#e.resourceDestinations.isLoading;isNew=this.#t.isNew;backupId=this.#t.backupId;selectedDestinationType=$(()=>{let n=this.targetUrlModel();return n?yt(n)??null:null});isLoadingDestinationEffect=R(()=>{let n=this.isLoadingDestinations(),t=this.destinations(),e=this.targetUrls();!n&&t.length==0&&e.length==0&&this.toggleCustomList()});selectedDestinationTypeOption=$(()=>{let n=this.selectedDestinationType();return n?{key:n.customKey??n.key,customKey:n.customKey??null,displayName:n.displayName,description:n.description,icon:n.icon}:null});getConnectionString(n){let t=this.#e.destinations().find(e=>e.ID===n);return console.log("connection",t),t}getSimplePath(n){return n?Mt(n):""}copyTargetUrl(n=0){let t=this.targetUrls()[n]?.url;t&&navigator.clipboard.writeText(t)}openTargetUrlDialog(n=0){let t=this.targetUrls()[n]?.url??null;this.targetUrlCtrl.set(t),this.targetUrlInitial.set(t),this.currentEditingIndex.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),e=this.targetUrlInitial();if(!n||t===e||!t)return;let i=this.currentEditingIndex();if(i!==null){let _=this.targetUrls()[i]?.connectionStringId??null,m=this.targetUrls()[i]?.urlKey??null;this.#t.updateTargetUrl(i,t,_,m)}else this.#t.setTargetUrl(t);this.currentEditingIndex.set(null)}setDestination(n){let t=Ft(n??"");if(!t)return;let e=t.mapper.default?t.mapper.default(this.#t.backupName()??""):`${n}://`;if(this.currentEditingIndex()!==null){this.#t.updateTargetUrl(this.currentEditingIndex(),e,null,null),this.updateTestState(this.currentEditingIndex(),null),this.currentEditingIndex.set(null),this.showCustomList.set(!1);return}this.showCustomList()?(this.#t.addTargetUrl(e,null,null),this.showCustomList.set(!1),this.isAddingNew.set(!1)):(this.#t.addTargetUrl(e,null,null),this.showCustomList.set(!1),this.isAddingNew.set(!1))}targetUrlsEffect=R(()=>{let n=this.targetUrls();this.testStates.update(t=>{if(t.length===n.length)return t;let e=[...t];if(e.length<n.length)for(let i=e.length;i<n.length;i++)e.push(null);else e.length=n.length;return e})});selectSavedDestination(n){n.BaseUrl&&n.BaseUrl&&(this.targetUrls().length===0?this.#t.setTargetUrl(n.BaseUrl,!0,n.ID,null):(this.#t.addTargetUrl(n.BaseUrl,n.ID,null),this.showCustomList.set(!1),this.isAddingNew.set(!1)))}toggleCustomList(){this.currentEditingIndex.set(null),this.showCustomList.set(!0)}isAddingNew=I(!1);startAddingNew(){this.isAddingNew.set(!0),this.destinations().length===0&&this.showCustomList.set(!0)}changeDestination(n){this.currentEditingIndex.set(n),this.showCustomList.set(!0)}closeCustomList(){this.showCustomList.set(!1),this.currentEditingIndex.set(null),this.isAddingNew.set(!1)}removeDestination(n){this.#t.removeTargetUrl(n)}updateTargetUrl(n,t){if(!t)return;let e=this.targetUrls()[n]?.connectionStringId??null,i=this.targetUrls()[n]?.urlKey??null;this.#t.updateTargetUrl(n,t,e,i),this.updateTestState(n,null)}updateTestState(n,t){this.testStates.update(e=>{let i=[...e];return i[n]=t,i})}toggleSave(n){this.#t.toggleSaveConnectionString(n)}goBack(){this.#n.navigate(["general"],{relativeTo:this.#i.parent})}async next(){if(!this.#t.isNew()){this.#o();return}let t=this.testUrlComponents(),e=this.testStates();for(let i=0;i<t.length;i++){let _=t[i],m=this.testStates()[i];if(m&&typeof m!="string"&&m.action==="success")continue;if((await _.testDestination(!1))?.action!=="success")return}this.#o()}#o(){this.#t.shouldAutoSave()&&this.#t.submit(!0),this.#n.navigate(["source-data"],{relativeTo:this.#i.parent})}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=et({type:o,selectors:[["app-destination"]],viewQuery:function(t,e){t&1&&nt(e.testUrlComponents,vt,5),t&2&&it()},decls:19,vars:9,consts:()=>{let n;n=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let t;t=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let e;e=$localize`Change destination type`;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let _;_=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let m;m=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:trash${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Remove `;let L;L=$localize`Save as connection string`;let V;V=$localize`Loading destinations...`;let K;K=$localize`Configure a new destination`;let J;J=$localize`Configure a one-off or new storage location.`;let X;X=$localize`Or select a saved destination`;let z;z=$localize`Configure a new destination`;let H;H=$localize`Configure a one-off or new storage location.`;let W;W=$localize`Or select a saved destination`;let j;j=$localize`Select storage type`;let Q;Q=$localize`Be careful, this will overwrite everything you have in your destination.`;let q;q=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`;let Y;Y=$localize`Set target URL`;let Z;return Z=$localize`Edit target URL`,[["formRef",""],["testUrl",""],n,t,e,i,_,m,L,V,K,J,X,z,H,W,j,Q,q,Y,Z,["autocomplete","off",3,"submit"],[2,"position","absolute","left","-9999px","width","1px","height","1px","overflow","hidden"],["type","text","name","fake_email","tabindex","-1"],["type","password","name","fake_password","tabindex","-1"],[1,"add-destination-container"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[3,"isOpen","options"],[1,"destination-card","type-c","editing"],[1,"destination-card","type-a",3,"disableToggle","isActive"],[1,"editing-header"],["shButton","","type","button",1,"small",3,"click"],[3,"setDestination"],["title",""],[3,"targetUrl","connectionStringId"],[1,"actions",3,"click"],["shButton","","type","button",1,"small","icon-only"],["menu",""],[1,"options-row",2,"margin","0 1rem 1rem 1rem"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal","backupId","connectionStringId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","moduleType"],[3,"targetUrlChange","targetUrl","useBackupState"],[3,"checkedChange","color","variant","checked"],["label",""],[1,"loading-list"],[1,"indeterminate","primary"],[1,"text"],["tabindex","0",1,"type-a","actionable","add-new",3,"click","keydown.enter","keydown.space"],["variant","type-a","tabindex","0",1,"actionable",3,"targetUrl"],["variant","type-a","tabindex","0",1,"actionable",3,"click","keydown.enter","keydown.space","targetUrl"],["displayName",""],["description",""],[1,"custom-list-header"],["shButton","","iconOnly","","type","button",1,"ghost",3,"click"],[1,"type-a","actionable","add-new",3,"click"],["variant","type-a",1,"actionable",3,"targetUrl"],["variant","type-a",1,"actionable",3,"click","targetUrl"],["shButton","","type","button",1,"secondary",3,"click"],[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(t,e){if(t&1&&(at(0)(1),a(2,"form",21,0),C("submit",function(){return e.next()}),a(4,"div",22),h(5,"input",23)(6,"input",24),r(),a(7,"header"),T(8,Jt,2,0),r(),T(9,ae,3,1),T(10,re,5,0,"div",25),a(11,"div",26)(12,"button",27),C("click",function(){return e.goBack()}),f(13,2),h(14,"sh-icon"),O(),r(),a(15,"button",28),f(16,3),h(17,"sh-icon"),O(),r()()(),T(18,le,16,5,"sh-dialog",29)),t&2){let i=k(e.targetUrls());l();let _=k(i.length>0);l(7),p(e.currentEditingIndex()!==null||!e.showCustomList()&&!e.isAddingNew()?8:-1),l(),p((!_||e.showCustomList()||e.isAddingNew())&&e.currentEditingIndex()===null?9:-1),l(),p(_&&!e.showCustomList()&&!e.isAddingNew()?10:-1),l(5),ot("loading",e.isNew()&&e.testStates().length>0&&e.testStates()[0]==="testing"),E("disabled",!_),l(3),p(e.targetUrlDialogOpen()?18:-1)}},dependencies:[Rt,$t,Ut,bt,mt,Tt,ct,dt,Ct,ut,gt,ht,Ot,Dt,St,Et,Nt,It,ft,Pt,xt,At],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 0}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;height:100%;padding:0 0 2.5rem}.current-destination[_ngcontent-%COMP%]{margin:1rem 0 0}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between;padding-bottom:1.5rem}.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}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}.loading-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;align-items:center;padding:4rem}.loading-list[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{text-align:center}.add-new[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1.5rem;padding:1.5rem;background:var(--base-1);color:var(--primary-8);cursor:pointer}.add-new[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:.8}.actionable[_ngcontent-%COMP%]{cursor:pointer}.actionable[_ngcontent-%COMP%]:hover{--card-shp: 0}.custom-list-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;margin-bottom:.5rem}.save-connection-string[_ngcontent-%COMP%]{margin:1rem 0}sh-card.destination-card[_ngcontent-%COMP%]{padding:1.5rem}.destination-card[_ngcontent-%COMP%]{position:relative;overflow:visible}.destination-card[_ngcontent-%COMP%] app-destination-list-item[_ngcontent-%COMP%]{width:100%}.destination-card[_ngcontent-%COMP%] .card-header-content[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%}.destination-card[_ngcontent-%COMP%] .card-header-content[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--title-30);margin:0}.destination-card[_ngcontent-%COMP%] .card-header-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{position:static;transform:none}.destination-card[_ngcontent-%COMP%] .editing-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.destination-card[_ngcontent-%COMP%] .editing-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}.destination-card[_ngcontent-%COMP%] sh-toggle-card[_ngcontent-%COMP%] .header{width:100%}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{Ae as createDestinationForm,Me as createDestinationFormGroup,B as default};
|
|
1
|
+
import{a as wt,b as Ut,c as $t,m as bt,q as Lt,r as Rt}from"./chunk-43WATFQS.js";import"./chunk-CAQ3XMFP.js";import"./chunk-UZ4POLDC.js";import{b as Mt,c as yt,d as Ft}from"./chunk-O56QUSSI.js";import"./chunk-6Q6SSTBK.js";import"./chunk-YCJYEQF7.js";import"./chunk-AXQQEOTT.js";import"./chunk-UTXZPAY6.js";import"./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 ht,C as It,G as ft,H as Ot,K as Dt,L as Pt,V as xt,W as At,c as ct,e as dt,f as Ct,g as gt,i as ut,j as Tt,r as pt,s as mt,v as St,w as Nt,y as Et}from"./chunk-VKQQDCUN.js";import"./chunk-DSYNIXJF.js";import{b as _t,d as lt}from"./chunk-NPFPMA4P.js";import"./chunk-O2SMJYPC.js";import"./chunk-N2AU7VKX.js";import"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import{$b as s,Ab as M,Ac as rt,Bb as y,Cb as E,Db as a,Eb as r,Fb as h,Jb as v,Kb as G,Mb as N,Qc as $,Sa as l,Tb as f,Ub as O,Vb as S,Yc as st,Zb as C,_ as P,da as c,ea as d,gb as et,gc as nt,ha as tt,hc as it,kc as ot,nc as g,oc as D,pa as I,ra as R,sc as F,tc as w,uc as U,vc as at,wb as T,wc as k,xb as p,xc as x,yb as A}from"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";var vt=["testUrl"],Gt=()=>({maxWidth:"700px",width:"100%"});function kt(o,n){if(o&1){let t=N();a(0,"sh-card",30)(1,"div",32)(2,"h3"),S(3,4),r(),a(4,"button",33),C("click",function(){c(t);let i=s(3);return d(i.closeCustomList())}),g(5," Cancel "),a(6,"sh-icon"),g(7,"x-bold"),r()()(),a(8,"app-destination-list",34),C("setDestination",function(i){c(t);let _=s(3);return d(_.setDestination(i))}),r()()}}function Bt(o,n){if(o&1){let t=N();a(0,"div",40)(1,"sh-toggle",43),U("checkedChange",function(i){c(t);let _=s(2).$implicit;return w(_.save,i)||(_.save=i),d(i)}),a(2,"span",44),S(3,8),r()()()}if(o&2){let t=s(2).$implicit;l(),E("color","primary")("variant","raised"),F("checked",t.save)}}function Vt(o,n){if(o&1){let t=N();a(0,"sh-toggle-card",31),v(1,35),a(2,"app-destination-list-item",36)(3,"button",33),C("click",function(){c(t);let i=s().$index,_=s(2);return d(_.changeDestination(i))}),g(4,"Change"),r(),a(5,"sh-menu",37),C("click",function(i){return i.stopPropagation()}),a(6,"button",38)(7,"sh-icon"),g(8,"dots-three-vertical"),r()(),v(9,39),a(10,"button",33),C("click",function(){c(t);let i=s().$index,_=s(2);return d(_.openTargetUrlDialog(i))}),f(11,5),h(12,"sh-icon"),O(),r(),a(13,"button",33),C("click",function(){c(t);let i=s().$index,_=s(2);return d(_.copyTargetUrl(i))}),f(14,6),h(15,"sh-icon"),O(),r(),a(16,"button",33),C("click",function(){c(t);let i=s().$index,_=s(2);return d(_.removeDestination(i))}),f(17,7),h(18,"sh-icon"),O(),r(),G(),r()(),G(),T(19,Bt,4,3,"div",40),a(20,"app-test-url",41,1),C("targetUrlChange",function(i){c(t);let _=s().$index,m=s(2);return d(m.updateTargetUrl(_,i))})("testSignalChange",function(i){c(t);let _=s().$index,m=s(2);return d(m.updateTestState(_,i))}),r(),a(22,"app-single-destination",42),C("targetUrlChange",function(i){c(t);let _=s().$index,m=s(2);return d(m.updateTargetUrl(_,i))}),r()()}if(o&2){let t=s(),e=t.$implicit,i=t.$index,_=s(2);E("disableToggle",!0)("isActive",!0),l(2),E("targetUrl",e.url)("connectionStringId",e.connectionStringId),l(17),p(e.connectionStringId?-1:19),l(),E("targetUrl",e.url)("testSignal",_.testStates()[i]||null)("backupId",_.backupId())("connectionStringId",e.connectionStringId)("sourcePrefix",null)("suppressErrorDialogs",!1)("askToCreate",!0)("testExpectation",_.isNew()?"destinationEmpty":"any")("moduleType","Backend"),l(2),E("targetUrl",e.url)("useBackupState",!0)}}function Kt(o,n){if(o&1&&T(0,kt,9,0,"sh-card",30)(1,Vt,23,16,"sh-toggle-card",31),o&2){let t=n.$index,e=s(2);p(e.showCustomList()&&e.currentEditingIndex()===t?0:1)}}function Jt(o,n){if(o&1&&M(0,Kt,2,1,null,null,A),o&2){s();let t=x(0);y(t)}}function Xt(o,n){o&1&&(a(0,"div",45),h(1,"sh-progress-bar",46),a(2,"div",47)(3,"h3"),S(4,9),r()()())}function zt(o,n){o&1&&(a(0,"sh-divider"),S(1,12),r())}function Ht(o,n){if(o&1&&(a(0,"p",52),g(1),r()),o&2){let t=s().$implicit;l(),D(t.Description)}}function Wt(o,n){if(o&1&&(a(0,"p",52),g(1),r()),o&2){let t=s().$implicit,e=s(4);l(),D(e.getSimplePath(t.BaseUrl))}}function jt(o,n){if(o&1){let t=N();a(0,"app-destination-list-item",50),C("click",function(){let i=c(t).$implicit,_=s(4);return d(_.selectSavedDestination(i))})("keydown.enter",function(i){return i.target.click()})("keydown.space",function(i){return i.target.click()}),a(1,"h3",51),g(2),r(),T(3,Ht,2,1,"p",52)(4,Wt,2,1,"p",52),r()}if(o&2){let t=n.$implicit;E("targetUrl",t.BaseUrl),l(2),D(t.Name||t.BaseUrl),l(),p(t.Description?3:4)}}function Qt(o,n){if(o&1){let t=N();a(0,"sh-card",48),C("click",function(){c(t);let i=s(3);return d(i.toggleCustomList())})("keydown.enter",function(i){return i.target.click()})("keydown.space",function(i){return i.target.click()}),a(1,"sh-icon"),g(2,"plus-circle"),r(),a(3,"div",47)(4,"h3"),S(5,10),r(),a(6,"p"),S(7,11),r()()(),T(8,zt,2,0,"sh-divider"),M(9,jt,5,3,"app-destination-list-item",49,A)}if(o&2){let t=s(3);l(8),p(t.destinations().length>0?8:-1),l(),y(t.destinations())}}function qt(o,n){if(o&1&&T(0,Xt,5,0,"div",45)(1,Qt,11,1),o&2){let t=s(2);p(t.isLoadingDestinations()?0:1)}}function Yt(o,n){o&1&&(a(0,"sh-divider"),S(1,15),r())}function Zt(o,n){if(o&1&&(a(0,"p",52),g(1),r()),o&2){let t=s().$implicit;l(),D(t.Description)}}function te(o,n){if(o&1&&(a(0,"p",52),g(1),r()),o&2){let t=s().$implicit,e=s(3);l(),D(e.getSimplePath(t.BaseUrl))}}function ee(o,n){if(o&1){let t=N();a(0,"app-destination-list-item",57),C("click",function(){let i=c(t).$implicit,_=s(3);return d(_.selectSavedDestination(i))}),a(1,"h3",51),g(2),r(),T(3,Zt,2,1,"p",52)(4,te,2,1,"p",52),r()}if(o&2){let t=n.$implicit;E("targetUrl",t.BaseUrl),l(2),D(t.Name||t.BaseUrl),l(),p(t.Description?3:4)}}function ne(o,n){if(o&1){let t=N();a(0,"div",53)(1,"button",54),C("click",function(){c(t);let i=s(2);return d(i.closeCustomList())}),a(2,"sh-icon"),g(3,"arrow-left"),r(),g(4," Back "),r()(),a(5,"sh-card",55),C("click",function(){c(t);let i=s(2);return d(i.toggleCustomList())}),a(6,"sh-icon"),g(7,"plus-circle"),r(),a(8,"div",47)(9,"h3"),S(10,13),r(),a(11,"p"),S(12,14),r()()(),T(13,Yt,2,0,"sh-divider"),M(14,ee,5,3,"app-destination-list-item",56,A)}if(o&2){let t=s(2);l(13),p(t.destinations().length>0?13:-1),l(),y(t.destinations())}}function ie(o,n){if(o&1){let t=N();a(0,"div",53)(1,"button",54),C("click",function(){c(t);let i=s(3);return d(i.closeCustomList())}),a(2,"sh-icon"),g(3,"arrow-left"),r()(),a(4,"h3"),S(5,16),r()()}}function oe(o,n){if(o&1){let t=N();T(0,ie,6,0,"div",53),a(1,"app-destination-list",34),C("setDestination",function(i){c(t);let _=s(2);return d(_.setDestination(i))}),r()}if(o&2){let t=s(2),e=x(0);p(t.destinations().length>0||e.length>0?0:-1)}}function ae(o,n){if(o&1&&T(0,qt,2,1)(1,ne,16,1)(2,oe,2,1),o&2){let t=s(),e=x(1);p(!t.showCustomList()&&!e&&!t.isAddingNew()?0:t.isAddingNew()&&!t.showCustomList()?1:2)}}function re(o,n){if(o&1){let t=N();a(0,"div",25)(1,"button",58),C("click",function(){c(t);let i=s();return d(i.startAddingNew())}),a(2,"sh-icon"),g(3,"plus"),r(),g(4," Add another destination "),r()()}}function se(o,n){o&1&&(a(0,"h2"),S(1,19),r())}function _e(o,n){o&1&&(a(0,"h2"),S(1,20),r())}function le(o,n){if(o&1){let t=N();a(0,"sh-dialog",59),U("isOpenChange",function(i){c(t);let _=s();return w(_.targetUrlDialogOpen,i)||(_.targetUrlDialogOpen=i),d(i)}),a(1,"header",60)(2,"div",61),T(3,se,2,0,"h2")(4,_e,2,0,"h2"),a(5,"sh-alert",62),S(6,17),r()()(),a(7,"div",63)(8,"sh-form-field")(9,"textarea",64),U("ngModelChange",function(i){c(t);let _=s();return w(_.targetUrlCtrl,i)||(_.targetUrlCtrl=i),d(i)}),r()()(),a(10,"footer",65)(11,"button",27),C("click",function(){c(t);let i=s();return d(i.closeTargetUrlDialog(!1))}),g(12,"Cancel"),r(),a(13,"button",66),C("click",function(){c(t);let i=s();return d(i.closeTargetUrlDialog(!0))}),f(14,18),h(15,"sh-icon"),O(),r()()()}if(o&2){let t=s(),e=x(1);F("isOpen",t.targetUrlDialogOpen),E("options",rt(4,Gt)),l(3),p(e?4:3),l(6),F("ngModel",t.targetUrlCtrl)}}var b=new pt,Ae=(o={destinations:[]})=>b.group({destinations:b.array(o.destinations)}),Me=({key:o,customGroup:n,dynamicGroup:t,advancedGroup:e})=>b.group({destinationType:b.control(o),custom:n,dynamic:t,advanced:e}),B=class o{#n=P(lt);#i=P(_t);#t=P(Lt);#e=P(wt);injector=P(tt);testUrlComponents=st("testUrl");testStates=I([]);targetUrls=this.#t.targetUrls;targetUrlModel=$(()=>this.targetUrls()[0]?.url??null);targetUrlCtrl=I(null);targetUrlInitial=I(null);currentEditingIndex=I(null);targetUrlDialogOpen=I(!1);showCustomList=I(!1);isConnectionStringSaved=this.#t.isConnectionStringSaved;destinations=this.#e.destinations;isLoadingDestinations=this.#e.resourceDestinations.isLoading;isNew=this.#t.isNew;backupId=this.#t.backupId;selectedDestinationType=$(()=>{let n=this.targetUrlModel();return n?yt(n)??null:null});isLoadingDestinationEffect=R(()=>{let n=this.isLoadingDestinations(),t=this.destinations(),e=this.targetUrls();!n&&t.length==0&&e.length==0&&this.toggleCustomList()});selectedDestinationTypeOption=$(()=>{let n=this.selectedDestinationType();return n?{key:n.customKey??n.key,customKey:n.customKey??null,displayName:n.displayName,description:n.description,icon:n.icon}:null});getConnectionString(n){let t=this.#e.destinations().find(e=>e.ID===n);return console.log("connection",t),t}getSimplePath(n){return n?Mt(n):""}copyTargetUrl(n=0){let t=this.targetUrls()[n]?.url;t&&navigator.clipboard.writeText(t)}openTargetUrlDialog(n=0){let t=this.targetUrls()[n]?.url??null;this.targetUrlCtrl.set(t),this.targetUrlInitial.set(t),this.currentEditingIndex.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),e=this.targetUrlInitial();if(!n||t===e||!t)return;let i=this.currentEditingIndex();if(i!==null){let _=this.targetUrls()[i]?.connectionStringId??null,m=this.targetUrls()[i]?.urlKey??null;this.#t.updateTargetUrl(i,t,_,m)}else this.#t.setTargetUrl(t);this.currentEditingIndex.set(null)}setDestination(n){let t=Ft(n??"");if(!t)return;let e=t.mapper.default?t.mapper.default(this.#t.backupName()??""):`${n}://`;if(this.currentEditingIndex()!==null){this.#t.updateTargetUrl(this.currentEditingIndex(),e,null,null),this.updateTestState(this.currentEditingIndex(),null),this.currentEditingIndex.set(null),this.showCustomList.set(!1);return}this.showCustomList()?(this.#t.addTargetUrl(e,null,null),this.showCustomList.set(!1),this.isAddingNew.set(!1)):(this.#t.addTargetUrl(e,null,null),this.showCustomList.set(!1),this.isAddingNew.set(!1))}targetUrlsEffect=R(()=>{let n=this.targetUrls();this.testStates.update(t=>{if(t.length===n.length)return t;let e=[...t];if(e.length<n.length)for(let i=e.length;i<n.length;i++)e.push(null);else e.length=n.length;return e})});selectSavedDestination(n){n.BaseUrl&&n.BaseUrl&&(this.targetUrls().length===0?this.#t.setTargetUrl(n.BaseUrl,!0,n.ID,null):(this.#t.addTargetUrl(n.BaseUrl,n.ID,null),this.showCustomList.set(!1),this.isAddingNew.set(!1)))}toggleCustomList(){this.currentEditingIndex.set(null),this.showCustomList.set(!0)}isAddingNew=I(!1);startAddingNew(){this.isAddingNew.set(!0),this.destinations().length===0&&this.showCustomList.set(!0)}changeDestination(n){this.currentEditingIndex.set(n),this.showCustomList.set(!0)}closeCustomList(){this.showCustomList.set(!1),this.currentEditingIndex.set(null),this.isAddingNew.set(!1)}removeDestination(n){this.#t.removeTargetUrl(n)}updateTargetUrl(n,t){if(!t)return;let e=this.targetUrls()[n]?.connectionStringId??null,i=this.targetUrls()[n]?.urlKey??null;this.#t.updateTargetUrl(n,t,e,i),this.updateTestState(n,null)}updateTestState(n,t){this.testStates.update(e=>{let i=[...e];return i[n]=t,i})}toggleSave(n){this.#t.toggleSaveConnectionString(n)}goBack(){this.#n.navigate(["general"],{relativeTo:this.#i.parent})}async next(){if(!this.#t.isNew()){this.#o();return}let t=this.testUrlComponents(),e=this.testStates();for(let i=0;i<t.length;i++){let _=t[i],m=this.testStates()[i];if(m&&typeof m!="string"&&m.action==="success")continue;if((await _.testDestination(!1))?.action!=="success")return}this.#o()}#o(){this.#t.shouldAutoSave()&&this.#t.submit(!0),this.#n.navigate(["source-data"],{relativeTo:this.#i.parent})}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=et({type:o,selectors:[["app-destination"]],viewQuery:function(t,e){t&1&&nt(e.testUrlComponents,vt,5),t&2&&it()},decls:19,vars:9,consts:()=>{let n;n=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let t;t=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let e;e=$localize`Change destination type`;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let _;_=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let m;m=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:trash${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Remove `;let L;L=$localize`Save as connection string`;let V;V=$localize`Loading destinations...`;let K;K=$localize`Configure a new destination`;let J;J=$localize`Configure a one-off or new storage location.`;let X;X=$localize`Or select a saved destination`;let z;z=$localize`Configure a new destination`;let H;H=$localize`Configure a one-off or new storage location.`;let W;W=$localize`Or select a saved destination`;let j;j=$localize`Select storage type`;let Q;Q=$localize`Be careful, this will overwrite everything you have in your destination.`;let q;q=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`;let Y;Y=$localize`Set target URL`;let Z;return Z=$localize`Edit target URL`,[["formRef",""],["testUrl",""],n,t,e,i,_,m,L,V,K,J,X,z,H,W,j,Q,q,Y,Z,["autocomplete","off",3,"submit"],[2,"position","absolute","left","-9999px","width","1px","height","1px","overflow","hidden"],["type","text","name","fake_email","tabindex","-1"],["type","password","name","fake_password","tabindex","-1"],[1,"add-destination-container"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[3,"isOpen","options"],[1,"destination-card","type-c","editing"],[1,"destination-card","type-a",3,"disableToggle","isActive"],[1,"editing-header"],["shButton","","type","button",1,"small",3,"click"],[3,"setDestination"],["title",""],[3,"targetUrl","connectionStringId"],[1,"actions",3,"click"],["shButton","","type","button",1,"small","icon-only"],["menu",""],[1,"options-row",2,"margin","0 1rem 1rem 1rem"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal","backupId","connectionStringId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","moduleType"],[3,"targetUrlChange","targetUrl","useBackupState"],[3,"checkedChange","color","variant","checked"],["label",""],[1,"loading-list"],[1,"indeterminate","primary"],[1,"text"],["tabindex","0",1,"type-a","actionable","add-new",3,"click","keydown.enter","keydown.space"],["variant","type-a","tabindex","0",1,"actionable",3,"targetUrl"],["variant","type-a","tabindex","0",1,"actionable",3,"click","keydown.enter","keydown.space","targetUrl"],["displayName",""],["description",""],[1,"custom-list-header"],["shButton","","iconOnly","","type","button",1,"ghost",3,"click"],[1,"type-a","actionable","add-new",3,"click"],["variant","type-a",1,"actionable",3,"targetUrl"],["variant","type-a",1,"actionable",3,"click","targetUrl"],["shButton","","type","button",1,"secondary",3,"click"],[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(t,e){if(t&1&&(at(0)(1),a(2,"form",21,0),C("submit",function(){return e.next()}),a(4,"div",22),h(5,"input",23)(6,"input",24),r(),a(7,"header"),T(8,Jt,2,0),r(),T(9,ae,3,1),T(10,re,5,0,"div",25),a(11,"div",26)(12,"button",27),C("click",function(){return e.goBack()}),f(13,2),h(14,"sh-icon"),O(),r(),a(15,"button",28),f(16,3),h(17,"sh-icon"),O(),r()()(),T(18,le,16,5,"sh-dialog",29)),t&2){let i=k(e.targetUrls());l();let _=k(i.length>0);l(7),p(e.currentEditingIndex()!==null||!e.showCustomList()&&!e.isAddingNew()?8:-1),l(),p((!_||e.showCustomList()||e.isAddingNew())&&e.currentEditingIndex()===null?9:-1),l(),p(_&&!e.showCustomList()&&!e.isAddingNew()?10:-1),l(5),ot("loading",e.isNew()&&e.testStates().length>0&&e.testStates()[0]==="testing"),E("disabled",!_),l(3),p(e.targetUrlDialogOpen()?18:-1)}},dependencies:[Rt,$t,Ut,bt,mt,Tt,ct,dt,Ct,ut,gt,ht,Ot,Dt,St,Et,Nt,It,ft,Pt,xt,At],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 0}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;height:100%;padding:0 0 2.5rem}.current-destination[_ngcontent-%COMP%]{margin:1rem 0 0}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between;padding-bottom:1.5rem}.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}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}.loading-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;align-items:center;padding:4rem}.loading-list[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{text-align:center}.add-new[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1.5rem;padding:1.5rem;background:var(--base-1);color:var(--primary-8);cursor:pointer}.add-new[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:.8}.actionable[_ngcontent-%COMP%]{cursor:pointer}.actionable[_ngcontent-%COMP%]:hover{--card-shp: 0}.custom-list-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;margin-bottom:.5rem}.save-connection-string[_ngcontent-%COMP%]{margin:1rem 0}sh-card.destination-card[_ngcontent-%COMP%]{padding:1.5rem}.destination-card[_ngcontent-%COMP%]{position:relative;overflow:visible}.destination-card[_ngcontent-%COMP%] app-destination-list-item[_ngcontent-%COMP%]{width:100%}.destination-card[_ngcontent-%COMP%] .card-header-content[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%}.destination-card[_ngcontent-%COMP%] .card-header-content[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--title-30);margin:0}.destination-card[_ngcontent-%COMP%] .card-header-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{position:static;transform:none}.destination-card[_ngcontent-%COMP%] .editing-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.destination-card[_ngcontent-%COMP%] .editing-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}.destination-card[_ngcontent-%COMP%] sh-toggle-card[_ngcontent-%COMP%] .header{width:100%}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{Ae as createDestinationForm,Me as createDestinationFormGroup,B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-F2ZC26DC.js";import"./chunk-F3JYPWPK.js";import"./chunk-736PM4LG.js";import"./chunk-TCXCC5BM.js";import"./chunk-GKGMP6VF.js";import"./chunk-6Q6SSTBK.js";import"./chunk-YCJYEQF7.js";import"./chunk-IMQUTGIK.js";import"./chunk-ANSV4G2K.js";import"./chunk-E4NQOMJX.js";import"./chunk-YYD2JU6T.js";import"./chunk-6JS7B4FW.js";import"./chunk-VKQQDCUN.js";import"./chunk-DSYNIXJF.js";import"./chunk-NPFPMA4P.js";import"./chunk-O2SMJYPC.js";import"./chunk-N2AU7VKX.js";import"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";export{a as BackupProgressComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as _e}from"./chunk-
|
|
1
|
+
import{a as _e}from"./chunk-TVFRVP7K.js";import"./chunk-QDDVZ4CR.js";import"./chunk-BLSV7CNZ.js";import"./chunk-F2ZC26DC.js";import"./chunk-F3JYPWPK.js";import{a as se}from"./chunk-736PM4LG.js";import"./chunk-TCXCC5BM.js";import"./chunk-GKGMP6VF.js";import"./chunk-6Q6SSTBK.js";import"./chunk-YCJYEQF7.js";import"./chunk-AXQQEOTT.js";import"./chunk-UTXZPAY6.js";import{a as b}from"./chunk-IMQUTGIK.js";import"./chunk-ANSV4G2K.js";import"./chunk-F3ETZKLK.js";import{a as le,b as m}from"./chunk-IQL3REGJ.js";import"./chunk-E4NQOMJX.js";import"./chunk-YYD2JU6T.js";import"./chunk-6JS7B4FW.js";import{B as ae,H as ie,Y as ne,c as Q,e as Y,i as Z,s as x,v as ee,z as te}from"./chunk-VKQQDCUN.js";import{d as oe}from"./chunk-DSYNIXJF.js";import{b as q,e as j}from"./chunk-NPFPMA4P.js";import"./chunk-O2SMJYPC.js";import"./chunk-N2AU7VKX.js";import"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import{C as G,Cb as d,D as g,Db as n,E as L,Eb as i,F as p,Fb as c,Qc as E,Sa as _,Tb as u,Ub as h,Vb as A,Wb as H,Xb as J,Zb as T,_ as F,gb as V,kc as C,mc as K,nc as D,pa as s,q as y,ra as P,sc as X,tc as z,uc as W,wb as w,xb as U}from"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";function re(r,t){r&1&&(n(0,"sh-icon",19),D(1,"spinner"),i())}function ce(r,t){r&1&&(n(0,"sh-icon",20),D(1,"check"),i())}function de(r,t){r&1&&(n(0,"sh-icon",21),D(1,"warning"),i()),r&2&&d("shTooltip","File not found")}function ue(r,t){let a=le(r).pipe(G(t),L());return m(a,{initialValue:r()})}var N=class r{#o=F(q);#s=F(se);#e=F(oe);#a=F(te);#t=s("");backupId=m(this.#o.params.pipe(y(t=>t.id)));activeBackup=E(()=>this.#s.backups().find(t=>t.Backup?.ID===this.backupId()));backupFilePath=s("");lastValidatedPath=s("");isValidatedPath=E(()=>this.lastValidatedPath()===this.backupFilePath());pathHasChanged=E(()=>this.backupFilePath()!==this.#t());isValidatingPath=s(!1);#i=ue(this.backupFilePath,500);#n=s(!1);isWaitingForValidation=E(()=>this.#i()!=this.backupFilePath()||this.isValidatingPath());backupFilePathEffect=P(()=>{let t=this.#i(),a=this.activeBackup(),e=this.#n();t!==""&&(this.isValidatingPath.set(!0),this.#e.postApiV1FilesystemValidate({requestBody:{path:t}}).pipe(g(1),p(()=>this.isValidatingPath.set(!1))).subscribe(()=>this.lastValidatedPath.set(t)))});isRestoring=s(!1);isRepairing=s(!1);isDeleting=s(!1);isSavingDbPath=s(!1);isSavingAndRepairing=s(!1);isMovingDb=s(!1);isCreatingBugReport=s(!1);createdReport=s(!1);activeBackupEffect=P(()=>{let t=this.activeBackup();if(!t)return;let a=t.Backup?.DBPath??"";this.backupFilePath.set(a),this.#t.set(a)});repairDatabase(){this.isRepairing.set(!0),this.#e.postApiV1BackupByIdRepair({id:this.backupId()}).pipe(g(1),p(()=>this.isRepairing.set(!1))).subscribe()}deleteDatabase(t=null){this.isValidatedPath()?this.#a.open(b,{data:{title:$localize`Confirm delete?`,message:$localize`Do you really want to delete the database for ${this.activeBackup()?.Backup?.Name}?`,confirmText:$localize`Delete database`,cancelText:$localize`Cancel`},closed:a=>{a&&this.doDeleteDatabase(t)}}):this.doDeleteDatabase(t)}doDeleteDatabase(t=null){this.isDeleting.set(!0),this.#e.postApiV1BackupByIdDeletedb({id:this.backupId()}).pipe(g(1),p(()=>this.isDeleting.set(!1))).subscribe(()=>{this.lastValidatedPath.set(""),t?.()})}restoreDatabase(){this.isValidatedPath()?this.deleteDatabase(()=>{this.doRepairDatabase()}):this.doRepairDatabase()}doRepairDatabase(){this.isRestoring.set(!0),this.#e.postApiV1BackupByIdRepair({id:this.backupId(),requestBody:{refresh_lock_info:!0}}).pipe(g(1),p(()=>this.isRestoring.set(!1))).subscribe()}resetDatabasePath(){this.backupFilePath.set(this.#t())}saveDatabasePath(t=null){this.isValidatedPath()?this.#a.open(b,{data:{title:$localize`Confirm reassign?`,message:$localize`The target database path already exists and may belong to another backup. Are you sure you want to assign this backup to an existing database?`,confirmText:$localize`Assign existing database`,cancelText:$localize`Cancel`},closed:a=>{a&&this.doSaveDatabasePath(t)}}):this.doSaveDatabasePath(t)}doSaveDatabasePath(t=null){this.isSavingDbPath.set(!0);let a=this.backupFilePath();this.#e.postApiV1BackupByIdUpdatedb({id:this.backupId(),requestBody:{path:a}}).pipe(p(()=>this.isSavingDbPath.set(!1))).subscribe(()=>{this.#t.set(a),t?.()})}saveAndRepairDatabasePath(){this.saveDatabasePath(()=>(this.isSavingAndRepairing.set(!0),this.#e.postApiV1BackupByIdRepair({id:this.backupId()}).pipe(g(1),p(()=>this.isSavingAndRepairing.set(!1))).subscribe()))}moveDatabasePath(){this.isMovingDb.set(!0);let t=this.backupFilePath();this.#e.postApiV1BackupByIdMovedb({id:this.backupId(),requestBody:{path:t}}).pipe(p(()=>this.isMovingDb.set(!1))).subscribe(()=>{this.#n.update(a=>!a),this.#t.set(t)})}createErrorReport(){this.isCreatingBugReport.set(!0),this.#e.postApiV1BackupByIdCreatereport({id:this.backupId()}).pipe(p(()=>this.isCreatingBugReport.set(!1))).subscribe({next:()=>{this.createdReport.set(!0),window.setTimeout(()=>this.createdReport.set(!1),3e3)}})}static \u0275fac=function(a){return new(a||r)};static \u0275cmp=V({type:r,selectors:[["app-database"]],decls:50,vars:21,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let a;a=$localize`Local database for ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let e;e=$localize` Each backup has a local database associated with it, which stores information about the remote backup on the local machine. This makes it faster to perform many operations, and reduces the amount of data that needs to be downloaded for each operation. `;let o;o=$localize`Maintenance`;let S;S=$localize` If the backup and the remote storage is out of sync, Duplicati will require that you perform a repair operation to synchronize the database. If the repair is unsuccessful, you can delete the local database and re-generate. The bug report button can be used to create a copy of the database with path information removed. This should only be used if a developer requests to investigate an issue with your database. `;let f;f=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:wrench${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Repair `;let I;I=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:trash${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON: Delete `;let M;M=$localize`${"\uFFFD#25\uFFFD"}:START_TAG_SH_ICON:clock-counter-clockwise${"\uFFFD/#25\uFFFD"}:CLOSE_TAG_SH_ICON: Recreate (delete and repair) `;let R;R=$localize`${"\uFFFD#28\uFFFD"}:START_TAG_SH_ICON:file-plus${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SH_ICON: Create bug report database `;let B;B=$localize`Placement`;let O;O=$localize`${"\uFFFD#40\uFFFD"}:START_TAG_SH_ICON:backspace${"\uFFFD/#40\uFFFD"}:CLOSE_TAG_SH_ICON: Reset `;let $;$=$localize`${"\uFFFD#43\uFFFD"}:START_TAG_SH_ICON:floppy-disk${"\uFFFD/#43\uFFFD"}:CLOSE_TAG_SH_ICON: Save `;let v;v=$localize`${"\uFFFD#46\uFFFD"}:START_TAG_SH_ICON:wrench${"\uFFFD/#46\uFFFD"}:CLOSE_TAG_SH_ICON: Save & Repair `;let k;return k=$localize`${"\uFFFD#49\uFFFD"}:START_TAG_SH_ICON:flow-arrow${"\uFFFD/#49\uFFFD"}:CLOSE_TAG_SH_ICON: Move existing database `,[t,a,e,o,S,f,I,M,R,B,O,$,v,k,[1,"back"],["type","button","shButton","","routerLink","/",1,"small"],[1,"actions","maintenance"],["shButton","",3,"click","disabled"],["type","text",3,"ngModelChange","ngModel"],["prefix","",1,"primary"],["prefix",""],["prefix","",3,"shTooltip"],[1,"actions","placement"]]},template:function(a,e){if(a&1&&(c(0,"app-status-bar"),n(1,"section")(2,"div",14)(3,"button",15),u(4,0),c(5,"sh-icon"),h(),i()(),n(6,"article")(7,"h1"),A(8,1),i(),n(9,"p"),A(10,2),i()(),n(11,"article")(12,"h2"),A(13,3),i(),n(14,"p"),A(15,4),i(),n(16,"div",16)(17,"button",17),T("click",function(){return e.repairDatabase()}),u(18,5),c(19,"sh-icon"),h(),i(),n(20,"button",17),T("click",function(){return e.deleteDatabase()}),u(21,6),c(22,"sh-icon"),h(),i(),n(23,"button",17),T("click",function(){return e.restoreDatabase()}),u(24,7),c(25,"sh-icon"),h(),i(),n(26,"button",17),T("click",function(){return e.createErrorReport()}),u(27,8),c(28,"sh-icon"),h(),i()()(),n(29,"article")(30,"h2"),A(31,9),i(),n(32,"sh-form-field")(33,"input",18),W("ngModelChange",function(S){return z(e.backupFilePath,S)||(e.backupFilePath=S),S}),i(),w(34,re,2,0,"sh-icon",19)(35,ce,2,0,"sh-icon",20)(36,de,2,1,"sh-icon",21),i(),n(37,"div",22)(38,"button",17),T("click",function(){return e.resetDatabasePath()}),u(39,10),c(40,"sh-icon"),h(),i(),n(41,"button",17),T("click",function(){return e.saveDatabasePath()}),u(42,11),c(43,"sh-icon"),h(),i(),n(44,"button",17),T("click",function(){return e.saveAndRepairDatabasePath()}),u(45,12),c(46,"sh-icon"),h(),i(),n(47,"button",17),T("click",function(){return e.moveDatabasePath()}),u(48,13),c(49,"sh-icon"),h(),i()()()()),a&2){let o;_(8),H((o=e.activeBackup())==null||o.Backup==null?null:o.Backup.Name),J(8),_(9),C("loading",e.isRepairing()),d("disabled",!e.isValidatedPath()||e.pathHasChanged()),_(3),C("loading",e.isDeleting()),d("disabled",!e.isValidatedPath()||e.pathHasChanged()),_(3),C("loading",e.isRestoring()),d("disabled",e.pathHasChanged()),_(3),C("loading",e.isCreatingBugReport()),d("disabled",e.isCreatingBugReport()||!e.isValidatedPath()||e.pathHasChanged()),_(6),K(e.isValidatedPath()?"success":"error"),_(),X("ngModel",e.backupFilePath),_(),U(e.isWaitingForValidation()?34:e.isValidatedPath()?35:36),_(4),d("disabled",!e.pathHasChanged()),_(3),d("disabled",!e.pathHasChanged()||e.isWaitingForValidation()),_(3),d("disabled",!e.pathHasChanged()||e.isWaitingForValidation()),_(3),d("disabled",!e.pathHasChanged()||e.isValidatedPath()||e.isWaitingForValidation())}},dependencies:[x,Q,Y,Z,_e,ae,ie,ee,ne,j],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem}article[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}h1[_ngcontent-%COMP%]{font:var(--title-20)}h2[_ngcontent-%COMP%]{font:var(--title-30)}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g}from"./chunk-
|
|
1
|
+
import{g}from"./chunk-77IXQ4GU.js";import"./chunk-TZ7MW3NZ.js";import{a as G}from"./chunk-TVFRVP7K.js";import"./chunk-QDDVZ4CR.js";import"./chunk-BLSV7CNZ.js";import"./chunk-F2ZC26DC.js";import{q as b}from"./chunk-43WATFQS.js";import"./chunk-CAQ3XMFP.js";import"./chunk-UZ4POLDC.js";import"./chunk-O56QUSSI.js";import"./chunk-F3JYPWPK.js";import"./chunk-736PM4LG.js";import"./chunk-TCXCC5BM.js";import"./chunk-GKGMP6VF.js";import"./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 u}from"./chunk-IQL3REGJ.js";import"./chunk-E4NQOMJX.js";import"./chunk-YYD2JU6T.js";import"./chunk-6JS7B4FW.js";import{R as v}from"./chunk-VKQQDCUN.js";import"./chunk-DSYNIXJF.js";import{a as h,b as y,c as I,d as W,e as $,f as A}from"./chunk-NPFPMA4P.js";import"./chunk-O2SMJYPC.js";import"./chunk-N2AU7VKX.js";import"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import{$b as T,Ac as E,Bc as m,Cb as l,Db as i,Eb as o,Fb as C,Sa as _,Vb as a,_ as p,gb as L,kc as M,pa as P,ra as N,wb as O,xb as S,zc as F}from"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";var w=()=>["/restore-from-files/destination"],k=()=>["/restore-from-files/encryption"],x=()=>["/restore-from-files/select-files"],J=()=>["/restore-from-files/options"],X=t=>["/restore",t,"select-files"],D=t=>["/restore",t,"options"];function z(t,n){t&1&&(i(0,"div",7),a(1,0),o(),i(2,"div",7),a(3,1),o(),i(4,"div",8),a(5,2),o(),i(6,"div",8),a(7,3),o()),t&2&&(l("routerLink",E(4,w)),_(2),l("routerLink",E(5,k)),_(2),l("routerLink",E(6,x)),_(2),l("routerLink",E(7,J)))}function B(t,n){if(t&1&&(i(0,"div",7),a(1,4),o(),i(2,"div",7),a(3,5),o()),t&2){let e=T(2);l("routerLink",m(2,X,e.backupId())),_(2),l("routerLink",m(4,D,e.backupId()))}}function U(t,n){if(t&1&&(i(0,"sh-stepper",6),O(1,z,8,8)(2,B,4,6),o()),t&2){let e=T();_(),S(e.isFileRestore()?1:2)}}var f=class t{#e=p(y);#n=p(W);#t=p(g);#i=u(this.#e.params);#o=u(this.#e.url);#r=u(this.#e.children[0].url);backupId=this.#t.backupId;isFileRestore=this.#t.isFileRestore;isFullWidthPage=P(!1);paramsChanged=N(()=>{let n=this.#r(),e=this.#i()?.id,r=!!this.#o()?.find(s=>s.path==="restore-from-files"),d=!!n?.find(s=>s.path==="select-files"),R=!!n?.find(s=>s.path==="progress");this.isFullWidthPage.set(R||d),this.#t.init(e,r)});ngOnInit(){this.#n.events.subscribe(n=>{if(n instanceof h){let e=n.urlAfterRedirects;this.isFullWidthPage.set(e.includes("progress")||e.includes("select-files"))}})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=L({type:t,selectors:[["app-restore-flow"]],hostVars:2,hostBindings:function(e,r){e&2&&M("full-width",r.isFullWidthPage())},features:[F([g,b])],decls:4,vars:1,consts:()=>{let n;n=$localize` Destination `;let e;e=$localize` Encryption `;let r;r=$localize` Select files `;let d;d=$localize` Options `;let R;R=$localize` Select files `;let s;return s=$localize`Options`,[n,e,r,d,R,s,[1,"primary"],["tabindex","-1","routerLinkActive","active",3,"routerLink"],["tabindex","-1","routerLinkActive","active",1,"inactive",3,"routerLink"]]},template:function(e,r){e&1&&(C(0,"app-status-bar"),O(1,U,3,1,"sh-stepper",6),i(2,"section"),C(3,"router-outlet"),o()),e&2&&(_(),S(r.isFullWidthPage()?-1:1))},dependencies:[v,G,I,$,A],styles:["[_nghost-%COMP%]{display:block}.full-width[_nghost-%COMP%] section[_ngcontent-%COMP%]{max-width:62.5rem}sh-stepper[_ngcontent-%COMP%]{margin:2.5rem 2rem;width:calc(100% - 4rem)}section[_ngcontent-%COMP%]{max-width:31.25rem;margin:0 auto 2.5rem}@media only screen and (max-width:768px){section[_ngcontent-%COMP%]{padding:0 2rem}}.inactive[_ngcontent-%COMP%]{pointer-events:none;opacity:.5}"],changeDetection:0})};export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-TZ7MW3NZ.js";import"./chunk-UZ4POLDC.js";import"./chunk-O56QUSSI.js";import"./chunk-YCJYEQF7.js";import"./chunk-IMQUTGIK.js";import"./chunk-YYD2JU6T.js";import"./chunk-VKQQDCUN.js";import"./chunk-DSYNIXJF.js";import"./chunk-N2AU7VKX.js";import"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";export{a as OptionsListComponent};
|