@duplicati/ngclient 0.0.213 → 0.0.214
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/{chunk-YHVGLFWL.js → chunk-22YUDKKU.js} +1 -1
- package/{chunk-KMGGFCBZ.js → chunk-2E5PWPGZ.js} +1 -1
- package/{chunk-JLSU6WKG.js → chunk-522J6R6I.js} +1 -1
- package/{chunk-C5OIC3DB.js → chunk-7ED2GUWQ.js} +1 -1
- package/{chunk-3IZWJV72.js → chunk-7PYUNUEY.js} +1 -1
- package/{chunk-CFJXIOSV.js → chunk-7WOSHJ7G.js} +1 -1
- package/{chunk-IWDA6CMP.js → chunk-7YSKL3IG.js} +1 -1
- package/{chunk-Z7CZCI7E.js → chunk-AJZA5YWT.js} +1 -1
- package/{chunk-UE37PPYX.js → chunk-B3T2NEGO.js} +1 -1
- package/{chunk-SGLY2D7Y.js → chunk-B7CQXYTS.js} +1 -1
- package/{chunk-ZJOUYWI2.js → chunk-BP66ERTI.js} +1 -1
- package/chunk-C2NKW2QW.js +1 -0
- package/{chunk-LQKECNBH.js → chunk-GCYBVLSX.js} +1 -1
- package/{chunk-BLPTBPXV.js → chunk-HO6FQWDR.js} +1 -1
- package/{chunk-5REJ6F23.js → chunk-HYYZB4AS.js} +1 -1
- package/chunk-IJHPC43D.js +1 -0
- package/{chunk-TPHRU6NP.js → chunk-U3A754M6.js} +1 -1
- package/{chunk-DFVPFPMV.js → chunk-Y3YNTMT5.js} +1 -1
- package/index.html +1 -1
- package/{main-ZP6YWLCN.js → main-7HIGYDD6.js} +1 -1
- package/package.json +1 -1
- package/chunk-J5VU6VA4.js +0 -1
- package/chunk-TGZAL6DJ.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as St}from"./chunk-ZK3S23CJ.js";import"./chunk-GO22QPW4.js";import"./chunk-FMDSOHVR.js";import"./chunk-NBKLLQQO.js";import{a as Ct,b as pt,c as mt,l as R,q as Tt}from"./chunk-DFVPFPMV.js";import"./chunk-5L2OOKRZ.js";import"./chunk-OO32MPRQ.js";import{b as dt,c as ut,d as gt}from"./chunk-OBF6ZSYT.js";import"./chunk-I625OICV.js";import{a as ct}from"./chunk-XCVBN7EK.js";import"./chunk-ADB5QRUO.js";import"./chunk-22PELS6R.js";import"./chunk-6Q6SSTBK.js";import"./chunk-MRSBKQQM.js";import"./chunk-7FDLOZXV.js";import"./chunk-EQNDYV43.js";import{a as k}from"./chunk-35APLYI4.js";import"./chunk-LU7TIW3P.js";import"./chunk-YMUS7QSB.js";import"./chunk-ZXQSQRKN.js";import"./chunk-XZNYCTQB.js";import"./chunk-R6TFME5I.js";import"./chunk-AZRNX5LU.js";import{B as st,C as at,G as lt,H as rt,L as _t,c as Z,e as tt,i as et,s as nt,v as it,z as ot}from"./chunk-NCXKMSRH.js";import"./chunk-QAQMMCTH.js";import"./chunk-KHZ5AXGT.js";import"./chunk-L2QOWZDR.js";import"./chunk-BRL4YYWO.js";import"./chunk-BDQJFOCO.js";import"./chunk-FSHBOASN.js";import{$b as r,Ab as J,Bb as X,Cb as E,Db as a,Eb as _,Fb as x,Mb as T,Rc as $,Sa as c,Tb as B,Ub as P,Vb as d,Wb as K,Xb as W,Yb as j,Yc as Y,Zb as m,_ as O,da as u,ea as g,gb as V,gc as Q,hc as q,kc as H,nc as D,oc as A,pa as f,ra as G,sc as M,tc as N,uc as y,wb as C,xb as p,yb as z}from"./chunk-UH2E7MMT.js";import"./chunk-7CGTOI24.js";function Dt(i,e){i&1&&(a(0,"div",13),x(1,"sh-progress-bar",14),a(2,"div",15)(3,"h3"),d(4,2),_()()())}function ft(i,e){i&1&&(a(0,"sh-divider"),d(1,5),_())}function Et(i,e){if(i&1&&(a(0,"p",20),D(1),_()),i&2){let t=r().$implicit;c(),A(t.Description)}}function Ft(i,e){if(i&1&&(a(0,"p",20),D(1),_()),i&2){let t=r().$implicit,o=r(3);c(),A(o.getSimplePath(t.BaseUrl))}}function It(i,e){if(i&1){let t=T();a(0,"button",25),m("click",function(n){u(t);let s=r().$implicit,l=r(3);return g(l.updateBackupsSync(s,n))}),D(1," Update backups "),_()}if(i&2){let t=r(4);E("disabled",t.isSaving())}}function Nt(i,e){if(i&1){let t=T();a(0,"app-destination-list-item",18),m("click",function(){let n=u(t).$implicit,s=r(3);return g(s.selectDestination(n))}),a(1,"h3",19),D(2),_(),C(3,Et,2,1,"p",20)(4,Ft,2,1,"p",20),a(5,"div",21),C(6,It,2,1,"button",22),a(7,"button",23),m("click",function(n){let s=u(t).$implicit,l=r(3);return g(l.deleteDestination(s.ID,n))}),a(8,"sh-icon"),D(9,"trash"),_()(),a(10,"button",24),B(11,6),x(12,"sh-icon"),P(),_()()()}if(i&2){let t=e.$implicit,o=r(3);E("targetUrl",t.BaseUrl),c(2),A(t.Name||t.BaseUrl),c(),p(t.Description?3:4),c(3),p(o.isOutOfSync(t)?6:-1)}}function ht(i,e){if(i&1){let t=T();a(0,"sh-card",16),m("click",function(){u(t);let n=r(2);return g(n.selectDestination("new"))})("keydown.enter",function(n){return n.target.click()})("keydown.space",function(n){return n.target.click()}),a(1,"sh-icon"),D(2,"plus-circle"),_(),a(3,"div",15)(4,"h3"),d(5,3),_(),a(6,"p"),d(7,4),_()()(),C(8,ft,2,0,"sh-divider"),J(9,Nt,13,4,"app-destination-list-item",17,z)}if(i&2){let t=r(2);c(8),p(t.destinations().length>0?8:-1),c(),X(t.destinations())}}function Ot(i,e){if(i&1&&(a(0,"h2"),d(1,1),_(),C(2,Dt,5,0,"div",13)(3,ht,11,1)),i&2){let t=r();c(2),p(t.isLoading()?2:3)}}function xt(i,e){i&1&&d(0,10,1)}function Bt(i,e){i&1&&d(0,10,2)}function Pt(i,e){i&1&&d(0,10,3)}function At(i,e){if(i&1){let t=T();a(0,"button",37),m("click",function(){u(t);let n=r(2);return g(n.testDestination())}),B(1,10),C(2,xt,1,0)(3,Bt,1,0)(4,Pt,1,0),P(),_()}if(i&2){let t,o=r(2);E("disabled",o.testSignal()=="testing"),c(2),p(o.testSignal()=="testing"?2:((t=o.testResponse())==null?null:t.action)==="success"?3:4)}}function Mt(i,e){if(i&1){let t=T();a(0,"div",32)(1,"sh-form-field")(2,"label"),d(3,11),_(),a(4,"input",38),y("ngModelChange",function(n){u(t);let s=r(2);return N(s.editName,n)||(s.editName=n),g(n)}),_()()()}if(i&2){let t=r(2);c(4),M("ngModel",t.editName)}}function yt(i,e){if(i&1){let t=T();a(0,"app-test-url",39,0),y("targetUrlChange",function(n){u(t);let s=r(2);return N(s.editBaseUrl,n)||(s.editBaseUrl=n),g(n)})("testSignalChange",function(n){u(t);let s=r(2);return N(s.testSignal,n)||(s.testSignal=n),g(n)}),_()}if(i&2){let t=r(2);M("targetUrl",t.editBaseUrl)("testSignal",t.testSignal),E("connectionStringId",t.selectedDestinationId())("backupId",null)("sourcePrefix",null)("suppressErrorDialogs",!0)("askToCreate",!0)("testExpectation","any")("moduleType","Backend")}}function $t(i,e){if(i&1){let t=T();a(0,"app-destination-list-item",40)(1,"button",41),m("click",function(){u(t);let n=r(2);return g(n.removeDestination())}),d(2,12),_()(),a(3,"app-single-destination",42),y("targetUrlChange",function(n){u(t);let s=r(2);return N(s.editBaseUrl,n)||(s.editBaseUrl=n),g(n)}),_()}if(i&2){let t=r(2);E("targetUrl",t.editBaseUrl()),c(3),M("targetUrl",t.editBaseUrl)}}function kt(i,e){if(i&1){let t=T();a(0,"app-destination-list",43),m("setDestination",function(n){u(t);let s=r(2);return g(s.setDestination(n))}),_()}}function Rt(i,e){i&1&&d(0,9,1)}function Lt(i,e){i&1&&d(0,9,2)}function bt(i,e){i&1&&d(0,9,3)}function wt(i,e){i&1&&d(0,9,4)}function vt(i,e){if(i&1){let t=T();a(0,"header",26)(1,"button",23),m("click",function(){u(t);let n=r();return g(n.cancelEdit())}),a(2,"sh-icon"),D(3,"arrow-left"),_()()(),a(4,"div",27)(5,"sh-card",28)(6,"header",29)(7,"h3"),d(8,7),_(),a(9,"div",30),C(10,At,5,2,"button",31),_()(),C(11,Mt,5,1,"div",32),C(12,yt,2,9,"app-test-url",33),C(13,$t,4,2)(14,kt,1,0,"app-destination-list"),_(),a(15,"div",34)(16,"button",35),m("click",function(){u(t);let n=r();return g(n.cancelEdit())}),d(17,8),_(),a(18,"button",36),m("click",function(){let n;u(t);let s=r();return g(((n=s.testResponse())==null?null:n.action)==="success"||((n=s.testResponse())==null?null:n.action)==="missing-folder"||!s.isUrlChanged()?s.save():s.testDestination())}),B(19,9),C(20,Rt,1,0)(21,Lt,1,0)(22,bt,1,0)(23,wt,1,0),P(),_()()()}if(i&2){let t,o,n,s,l=r();c(8),K(l.selectedDestination()==="new"?"New Destination":"Edit Destination"),W(8),c(2),p(l.editBaseUrl()?10:-1),c(),p(l.selectedDestination()!=="new"?11:-1),c(),p(l.editBaseUrl()?12:-1),c(),p(l.editBaseUrl()?13:14),c(5),H("primary",((t=l.testResponse())==null?null:t.action)==="success"||!l.isUrlChanged())("warn",l.isUrlChanged()&&l.testSignal()===null||l.testSignal()==="testing"||((o=l.testResponse())==null?null:o.action)==="missing-folder")("error",l.testResponse()&&((n=l.testResponse())==null?null:n.action)!=="success"&&((n=l.testResponse())==null?null:n.action)!=="missing-folder"),E("disabled",!l.editBaseUrl()||l.isSaving()||l.testSignal()==="testing"),c(2),p(l.isSaving()?20:l.testSignal()==="testing"?21:((s=l.testResponse())==null?null:s.action)==="success"||((s=l.testResponse())==null?null:s.action)==="missing-folder"||!l.isUrlChanged()?22:23)}}var L=class i{#t=O(Ct);#e=O(ct);#n=O(ot);getSimplePath=dt;backups=this.#e.backups;constructor(){this.#e.getBackups()}isSaving=this.#t.isSaving;destinations=this.#t.destinations;isLoading=this.#t.resourceDestinations.isLoading;testUrl=Y(R);selectedDestination=f(null);selectedDestinationId=$(()=>this.selectedDestination()!=="new"?this.selectedDestination().ID:null);editName=f(null);editDescription=f(null);editBaseUrl=f(null);initialBaseUrl=f(null);isUrlChanged=$(()=>{let e=this.editBaseUrl(),t=this.initialBaseUrl();return this.selectedDestination()==="new"?!0:e!==t});testSignal=f(null);testResponse=$(()=>{let e=this.testSignal();return e&&typeof e!="string"?e:null});getOutOfSyncBackupIds(e){if(!e.Backups)return[];let t=new Map(this.backups().map(o=>[o.Backup?.ID,o.Backup]));return e.Backups.filter(o=>{let n=t.get(o.ID);return n&&n.TargetURL!==e.BaseUrl}).map(o=>o.ID).filter(o=>!!o)}isOutOfSync(e){return this.getOutOfSyncBackupIds(e).length>0}#i=G(()=>{this.editBaseUrl(),this.testSignal.set(null)});selectDestination(e){this.selectedDestination.set(e),this.testSignal.set(null),e==="new"?(this.editName.set(null),this.editDescription.set(null),this.editBaseUrl.set(null),this.initialBaseUrl.set(null)):(this.editName.set(e.Name),this.editDescription.set(e.Description),this.editBaseUrl.set(e.BaseUrl),this.initialBaseUrl.set(e.BaseUrl),this.#t.getById(e.ID).subscribe(t=>{t.Data&&(this.editName.set(t.Data.Name),this.editDescription.set(t.Data.Description),this.editBaseUrl.set(t.Data.BaseUrl??null),this.initialBaseUrl.set(t.Data.BaseUrl??null))}))}cancelEdit(){this.selectedDestination.set(null)}setDestination(e){let t=gt(e??"");if(t){if(t.mapper.default){let o=t.mapper.default("");this.editBaseUrl.set(o);return}this.editBaseUrl.set(`${e}://`)}}removeDestination(){this.editBaseUrl.set(null)}async testDestination(){(await this.testUrl()?.testDestination(!1))?.action==="missing-folder"&&this.promptCreateFolder()}promptCreateFolder(){this.#n.open(k,{data:{title:$localize`Folder missing`,message:$localize`The specified folder does not exist. Would you like to create it now?`,confirmText:$localize`Create Folder`,cancelText:$localize`Dismiss`},closed:e=>{e&&this.testUrl()?.createFolder()}})}save(){let e=this.selectedDestination();e&&this.performSave(e)}performSave(e){let t=this.editName(),o=this.editDescription(),n=this.editBaseUrl();if(e==="new"){let I=ut(n??"")?.displayName??"Destination",h=this.destinations().filter(F=>F.Name?.startsWith(I)).length;t=`${I} #${h+1}`,o=null}let s={Name:t,Description:o,BaseUrl:n};this.#t.save(e,s).subscribe(()=>{this.selectedDestination.set(null),this.#t.reload(),this.#e.getBackups(!0)})}updateBackupsSync(e,t){t.stopPropagation();let o=this.getOutOfSyncBackupIds(e);this.#n.open(k,{data:{title:$localize`Update backups`,message:$localize`Are you sure you want to update ${o.length} backup(s) to use the current connection string?`,confirmText:$localize`Update`,cancelText:$localize`Cancel`},closed:n=>{n&&this.#t.updateBackups(e.ID,o).subscribe(()=>{this.#t.reload(),this.#e.getBackups(!0)})}})}deleteDestination(e,t){t.stopPropagation(),this.#n.open(k,{data:{title:$localize`Delete destination`,message:$localize`Are you sure you want to delete this destination?`,confirmText:$localize`Delete`,confirmVariant:"error",cancelText:$localize`Cancel`},closed:o=>{o&&this.#t.delete(e).subscribe(()=>{this.#t.reload()})}})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=V({type:i,selectors:[["app-destinations"]],viewQuery:function(t,o){t&1&&Q(o.testUrl,R,5),t&2&&q()},decls:4,vars:1,consts:()=>{let e;e=$localize`Destinations`;let t;t=$localize`Loading destinations...`;let o;o=$localize`Add new destination`;let n;n=$localize`Configure a new storage location.`;let s;s=$localize`Or manage your saved destinations`;let l;l=$localize` Manage ${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON:`;let I;I=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let h;h=$localize`Cancel`;let F;F=$localize`${"\uFFFD*20:1\uFFFD"}:START_BLOCK_IF: Saving... ${"\uFFFD/*20:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*21:2\uFFFD"}:START_BLOCK_ELSE_IF: Testing... ${"[\uFFFD/*21:2\uFFFD|\uFFFD/*22:3\uFFFD]"}:CLOSE_BLOCK_ELSE_IF:${"\uFFFD*22:3\uFFFD"}:START_BLOCK_ELSE_IF_1: Save Destination ${"[\uFFFD/*21:2\uFFFD|\uFFFD/*22:3\uFFFD]"}:CLOSE_BLOCK_ELSE_IF:${"\uFFFD*23:4\uFFFD"}:START_BLOCK_ELSE: Test & Save ${"\uFFFD/*23:4\uFFFD"}:CLOSE_BLOCK_ELSE:`,F=j(F);let b;b=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF: Testing... ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE_IF: Retry test ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE_IF:${"\uFFFD*4:3\uFFFD"}:START_BLOCK_ELSE: Test destination ${"\uFFFD/*4:3\uFFFD"}:CLOSE_BLOCK_ELSE:`;let w;w=$localize`Name`;let v;v=$localize`Name`;let U;return U=$localize`Change`,[["testUrl",""],e,t,o,n,s,l,I,h,F,b,v,U,[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",1,"actionable",3,"targetUrl"],["variant","type-a",1,"actionable",3,"click","targetUrl"],["displayName",""],["description",""],[1,"manage-actions"],["shButton","","type","button",1,"small","raised","primary",3,"disabled"],["shButton","","iconOnly","","variant","ghost","type","button",3,"click"],["shButton","","type","button",1,"manage-btn"],["shButton","","type","button",1,"small","raised","primary",3,"click","disabled"],[1,"edit-header"],[1,"edit-form"],[1,"config-section","type-c"],[1,"dest-config-header"],[1,"actions"],["shButton","","type","button","variant","ghost",1,"small",3,"disabled"],[1,"form-row"],[3,"targetUrl","testSignal","connectionStringId","backupId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","moduleType"],[1,"form-footer"],["shButton","","type","button",3,"click"],["shButton","","type","button",1,"raised",3,"click","disabled"],["shButton","","type","button","variant","ghost",1,"small",3,"click","disabled"],["placeholder",w,3,"ngModelChange","ngModel"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal","connectionStringId","backupId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","moduleType"],[1,"selected-backend",3,"targetUrl"],["shButton","","type","button","variant","ghost",3,"click"],[3,"targetUrlChange","targetUrl"],[3,"setDestination"]]},template:function(t,o){t&1&&(x(0,"app-status-bar"),a(1,"section"),C(2,Ot,4,1)(3,vt,24,13),_()),t&2&&(c(2),p(o.selectedDestination()===null?2:3))},dependencies:[pt,mt,Tt,St,_t,st,it,at,rt,lt,R,nt,Z,tt,et],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{max-width:43.75rem;margin:0 auto;padding:2rem 1rem;display:flex;flex-direction:column;gap:1rem}h2[_ngcontent-%COMP%]{font:var(--title-30);text-align:center;padding:2rem}h3[_ngcontent-%COMP%]{font:var(--paragraph-10)}.actionable[_ngcontent-%COMP%]{cursor:pointer}.actionable[_ngcontent-%COMP%]:after{transition:inset .1s linear}.actionable[_ngcontent-%COMP%]:hover{--card-shp: 0}.custom-info[_ngcontent-%COMP%]{flex:1}.custom-info[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font:var(--body-10);color:var(--base-7);margin:.25rem 0 0}.manage-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}@media(max-width:600px){.manage-actions[_ngcontent-%COMP%] .manage-btn[_ngcontent-%COMP%]{display:none}}.add-new[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1.5rem;padding:1.5rem;background:var(--base-1);color:var(--primary-8)}.add-new[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:.8}.edit-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;margin-bottom:.5rem}.edit-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.edit-form[_ngcontent-%COMP%] .form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr;gap:1rem;margin-bottom:1.5rem}@media(max-width:600px){.edit-form[_ngcontent-%COMP%] .form-row[_ngcontent-%COMP%]{grid-template-columns:1fr}}.edit-form[_ngcontent-%COMP%] .config-section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:1.5rem}.edit-form[_ngcontent-%COMP%] .config-section[_ngcontent-%COMP%] .dest-config-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.edit-form[_ngcontent-%COMP%] .form-footer[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:1rem;margin-top:1rem;padding-top:1.5rem;border-top:1px solid var(--base-3)}.selected-backend[_ngcontent-%COMP%]{margin-bottom:.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}"],changeDetection:0})};export{L as default};
|
|
1
|
+
import{a as St}from"./chunk-ZK3S23CJ.js";import"./chunk-GO22QPW4.js";import"./chunk-FMDSOHVR.js";import"./chunk-NBKLLQQO.js";import{a as Ct,b as pt,c as mt,l as R,q as Tt}from"./chunk-Y3YNTMT5.js";import"./chunk-5L2OOKRZ.js";import"./chunk-OO32MPRQ.js";import{b as dt,c as ut,d as gt}from"./chunk-OBF6ZSYT.js";import"./chunk-I625OICV.js";import{a as ct}from"./chunk-XCVBN7EK.js";import"./chunk-ADB5QRUO.js";import"./chunk-22PELS6R.js";import"./chunk-6Q6SSTBK.js";import"./chunk-MRSBKQQM.js";import"./chunk-7FDLOZXV.js";import"./chunk-EQNDYV43.js";import{a as k}from"./chunk-35APLYI4.js";import"./chunk-LU7TIW3P.js";import"./chunk-YMUS7QSB.js";import"./chunk-ZXQSQRKN.js";import"./chunk-XZNYCTQB.js";import"./chunk-R6TFME5I.js";import"./chunk-AZRNX5LU.js";import{B as st,C as at,G as lt,H as rt,L as _t,c as Z,e as tt,i as et,s as nt,v as it,z as ot}from"./chunk-NCXKMSRH.js";import"./chunk-QAQMMCTH.js";import"./chunk-KHZ5AXGT.js";import"./chunk-L2QOWZDR.js";import"./chunk-BRL4YYWO.js";import"./chunk-BDQJFOCO.js";import"./chunk-FSHBOASN.js";import{$b as r,Ab as J,Bb as X,Cb as E,Db as a,Eb as _,Fb as x,Mb as T,Rc as $,Sa as c,Tb as B,Ub as P,Vb as d,Wb as K,Xb as W,Yb as j,Yc as Y,Zb as m,_ as O,da as u,ea as g,gb as V,gc as Q,hc as q,kc as H,nc as D,oc as A,pa as f,ra as G,sc as M,tc as N,uc as y,wb as C,xb as p,yb as z}from"./chunk-UH2E7MMT.js";import"./chunk-7CGTOI24.js";function Dt(i,e){i&1&&(a(0,"div",13),x(1,"sh-progress-bar",14),a(2,"div",15)(3,"h3"),d(4,2),_()()())}function ft(i,e){i&1&&(a(0,"sh-divider"),d(1,5),_())}function Et(i,e){if(i&1&&(a(0,"p",20),D(1),_()),i&2){let t=r().$implicit;c(),A(t.Description)}}function Ft(i,e){if(i&1&&(a(0,"p",20),D(1),_()),i&2){let t=r().$implicit,o=r(3);c(),A(o.getSimplePath(t.BaseUrl))}}function It(i,e){if(i&1){let t=T();a(0,"button",25),m("click",function(n){u(t);let s=r().$implicit,l=r(3);return g(l.updateBackupsSync(s,n))}),D(1," Update backups "),_()}if(i&2){let t=r(4);E("disabled",t.isSaving())}}function Nt(i,e){if(i&1){let t=T();a(0,"app-destination-list-item",18),m("click",function(){let n=u(t).$implicit,s=r(3);return g(s.selectDestination(n))}),a(1,"h3",19),D(2),_(),C(3,Et,2,1,"p",20)(4,Ft,2,1,"p",20),a(5,"div",21),C(6,It,2,1,"button",22),a(7,"button",23),m("click",function(n){let s=u(t).$implicit,l=r(3);return g(l.deleteDestination(s.ID,n))}),a(8,"sh-icon"),D(9,"trash"),_()(),a(10,"button",24),B(11,6),x(12,"sh-icon"),P(),_()()()}if(i&2){let t=e.$implicit,o=r(3);E("targetUrl",t.BaseUrl),c(2),A(t.Name||t.BaseUrl),c(),p(t.Description?3:4),c(3),p(o.isOutOfSync(t)?6:-1)}}function ht(i,e){if(i&1){let t=T();a(0,"sh-card",16),m("click",function(){u(t);let n=r(2);return g(n.selectDestination("new"))})("keydown.enter",function(n){return n.target.click()})("keydown.space",function(n){return n.target.click()}),a(1,"sh-icon"),D(2,"plus-circle"),_(),a(3,"div",15)(4,"h3"),d(5,3),_(),a(6,"p"),d(7,4),_()()(),C(8,ft,2,0,"sh-divider"),J(9,Nt,13,4,"app-destination-list-item",17,z)}if(i&2){let t=r(2);c(8),p(t.destinations().length>0?8:-1),c(),X(t.destinations())}}function Ot(i,e){if(i&1&&(a(0,"h2"),d(1,1),_(),C(2,Dt,5,0,"div",13)(3,ht,11,1)),i&2){let t=r();c(2),p(t.isLoading()?2:3)}}function xt(i,e){i&1&&d(0,10,1)}function Bt(i,e){i&1&&d(0,10,2)}function Pt(i,e){i&1&&d(0,10,3)}function At(i,e){if(i&1){let t=T();a(0,"button",37),m("click",function(){u(t);let n=r(2);return g(n.testDestination())}),B(1,10),C(2,xt,1,0)(3,Bt,1,0)(4,Pt,1,0),P(),_()}if(i&2){let t,o=r(2);E("disabled",o.testSignal()=="testing"),c(2),p(o.testSignal()=="testing"?2:((t=o.testResponse())==null?null:t.action)==="success"?3:4)}}function Mt(i,e){if(i&1){let t=T();a(0,"div",32)(1,"sh-form-field")(2,"label"),d(3,11),_(),a(4,"input",38),y("ngModelChange",function(n){u(t);let s=r(2);return N(s.editName,n)||(s.editName=n),g(n)}),_()()()}if(i&2){let t=r(2);c(4),M("ngModel",t.editName)}}function yt(i,e){if(i&1){let t=T();a(0,"app-test-url",39,0),y("targetUrlChange",function(n){u(t);let s=r(2);return N(s.editBaseUrl,n)||(s.editBaseUrl=n),g(n)})("testSignalChange",function(n){u(t);let s=r(2);return N(s.testSignal,n)||(s.testSignal=n),g(n)}),_()}if(i&2){let t=r(2);M("targetUrl",t.editBaseUrl)("testSignal",t.testSignal),E("connectionStringId",t.selectedDestinationId())("backupId",null)("sourcePrefix",null)("suppressErrorDialogs",!0)("askToCreate",!0)("testExpectation","any")("moduleType","Backend")}}function $t(i,e){if(i&1){let t=T();a(0,"app-destination-list-item",40)(1,"button",41),m("click",function(){u(t);let n=r(2);return g(n.removeDestination())}),d(2,12),_()(),a(3,"app-single-destination",42),y("targetUrlChange",function(n){u(t);let s=r(2);return N(s.editBaseUrl,n)||(s.editBaseUrl=n),g(n)}),_()}if(i&2){let t=r(2);E("targetUrl",t.editBaseUrl()),c(3),M("targetUrl",t.editBaseUrl)}}function kt(i,e){if(i&1){let t=T();a(0,"app-destination-list",43),m("setDestination",function(n){u(t);let s=r(2);return g(s.setDestination(n))}),_()}}function Rt(i,e){i&1&&d(0,9,1)}function Lt(i,e){i&1&&d(0,9,2)}function bt(i,e){i&1&&d(0,9,3)}function wt(i,e){i&1&&d(0,9,4)}function vt(i,e){if(i&1){let t=T();a(0,"header",26)(1,"button",23),m("click",function(){u(t);let n=r();return g(n.cancelEdit())}),a(2,"sh-icon"),D(3,"arrow-left"),_()()(),a(4,"div",27)(5,"sh-card",28)(6,"header",29)(7,"h3"),d(8,7),_(),a(9,"div",30),C(10,At,5,2,"button",31),_()(),C(11,Mt,5,1,"div",32),C(12,yt,2,9,"app-test-url",33),C(13,$t,4,2)(14,kt,1,0,"app-destination-list"),_(),a(15,"div",34)(16,"button",35),m("click",function(){u(t);let n=r();return g(n.cancelEdit())}),d(17,8),_(),a(18,"button",36),m("click",function(){let n;u(t);let s=r();return g(((n=s.testResponse())==null?null:n.action)==="success"||((n=s.testResponse())==null?null:n.action)==="missing-folder"||!s.isUrlChanged()?s.save():s.testDestination())}),B(19,9),C(20,Rt,1,0)(21,Lt,1,0)(22,bt,1,0)(23,wt,1,0),P(),_()()()}if(i&2){let t,o,n,s,l=r();c(8),K(l.selectedDestination()==="new"?"New Destination":"Edit Destination"),W(8),c(2),p(l.editBaseUrl()?10:-1),c(),p(l.selectedDestination()!=="new"?11:-1),c(),p(l.editBaseUrl()?12:-1),c(),p(l.editBaseUrl()?13:14),c(5),H("primary",((t=l.testResponse())==null?null:t.action)==="success"||!l.isUrlChanged())("warn",l.isUrlChanged()&&l.testSignal()===null||l.testSignal()==="testing"||((o=l.testResponse())==null?null:o.action)==="missing-folder")("error",l.testResponse()&&((n=l.testResponse())==null?null:n.action)!=="success"&&((n=l.testResponse())==null?null:n.action)!=="missing-folder"),E("disabled",!l.editBaseUrl()||l.isSaving()||l.testSignal()==="testing"),c(2),p(l.isSaving()?20:l.testSignal()==="testing"?21:((s=l.testResponse())==null?null:s.action)==="success"||((s=l.testResponse())==null?null:s.action)==="missing-folder"||!l.isUrlChanged()?22:23)}}var L=class i{#t=O(Ct);#e=O(ct);#n=O(ot);getSimplePath=dt;backups=this.#e.backups;constructor(){this.#e.getBackups()}isSaving=this.#t.isSaving;destinations=this.#t.destinations;isLoading=this.#t.resourceDestinations.isLoading;testUrl=Y(R);selectedDestination=f(null);selectedDestinationId=$(()=>this.selectedDestination()!=="new"?this.selectedDestination().ID:null);editName=f(null);editDescription=f(null);editBaseUrl=f(null);initialBaseUrl=f(null);isUrlChanged=$(()=>{let e=this.editBaseUrl(),t=this.initialBaseUrl();return this.selectedDestination()==="new"?!0:e!==t});testSignal=f(null);testResponse=$(()=>{let e=this.testSignal();return e&&typeof e!="string"?e:null});getOutOfSyncBackupIds(e){if(!e.Backups)return[];let t=new Map(this.backups().map(o=>[o.Backup?.ID,o.Backup]));return e.Backups.filter(o=>{let n=t.get(o.ID);return n&&n.TargetURL!==e.BaseUrl}).map(o=>o.ID).filter(o=>!!o)}isOutOfSync(e){return this.getOutOfSyncBackupIds(e).length>0}#i=G(()=>{this.editBaseUrl(),this.testSignal.set(null)});selectDestination(e){this.selectedDestination.set(e),this.testSignal.set(null),e==="new"?(this.editName.set(null),this.editDescription.set(null),this.editBaseUrl.set(null),this.initialBaseUrl.set(null)):(this.editName.set(e.Name),this.editDescription.set(e.Description),this.editBaseUrl.set(e.BaseUrl),this.initialBaseUrl.set(e.BaseUrl),this.#t.getById(e.ID).subscribe(t=>{t.Data&&(this.editName.set(t.Data.Name),this.editDescription.set(t.Data.Description),this.editBaseUrl.set(t.Data.BaseUrl??null),this.initialBaseUrl.set(t.Data.BaseUrl??null))}))}cancelEdit(){this.selectedDestination.set(null)}setDestination(e){let t=gt(e??"");if(t){if(t.mapper.default){let o=t.mapper.default("");this.editBaseUrl.set(o);return}this.editBaseUrl.set(`${e}://`)}}removeDestination(){this.editBaseUrl.set(null)}async testDestination(){(await this.testUrl()?.testDestination(!1))?.action==="missing-folder"&&this.promptCreateFolder()}promptCreateFolder(){this.#n.open(k,{data:{title:$localize`Folder missing`,message:$localize`The specified folder does not exist. Would you like to create it now?`,confirmText:$localize`Create Folder`,cancelText:$localize`Dismiss`},closed:e=>{e&&this.testUrl()?.createFolder()}})}save(){let e=this.selectedDestination();e&&this.performSave(e)}performSave(e){let t=this.editName(),o=this.editDescription(),n=this.editBaseUrl();if(e==="new"){let I=ut(n??"")?.displayName??"Destination",h=this.destinations().filter(F=>F.Name?.startsWith(I)).length;t=`${I} #${h+1}`,o=null}let s={Name:t,Description:o,BaseUrl:n};this.#t.save(e,s).subscribe(()=>{this.selectedDestination.set(null),this.#t.reload(),this.#e.getBackups(!0)})}updateBackupsSync(e,t){t.stopPropagation();let o=this.getOutOfSyncBackupIds(e);this.#n.open(k,{data:{title:$localize`Update backups`,message:$localize`Are you sure you want to update ${o.length} backup(s) to use the current connection string?`,confirmText:$localize`Update`,cancelText:$localize`Cancel`},closed:n=>{n&&this.#t.updateBackups(e.ID,o).subscribe(()=>{this.#t.reload(),this.#e.getBackups(!0)})}})}deleteDestination(e,t){t.stopPropagation(),this.#n.open(k,{data:{title:$localize`Delete destination`,message:$localize`Are you sure you want to delete this destination?`,confirmText:$localize`Delete`,confirmVariant:"error",cancelText:$localize`Cancel`},closed:o=>{o&&this.#t.delete(e).subscribe(()=>{this.#t.reload()})}})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=V({type:i,selectors:[["app-destinations"]],viewQuery:function(t,o){t&1&&Q(o.testUrl,R,5),t&2&&q()},decls:4,vars:1,consts:()=>{let e;e=$localize`Destinations`;let t;t=$localize`Loading destinations...`;let o;o=$localize`Add new destination`;let n;n=$localize`Configure a new storage location.`;let s;s=$localize`Or manage your saved destinations`;let l;l=$localize` Manage ${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON:`;let I;I=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let h;h=$localize`Cancel`;let F;F=$localize`${"\uFFFD*20:1\uFFFD"}:START_BLOCK_IF: Saving... ${"\uFFFD/*20:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*21:2\uFFFD"}:START_BLOCK_ELSE_IF: Testing... ${"[\uFFFD/*21:2\uFFFD|\uFFFD/*22:3\uFFFD]"}:CLOSE_BLOCK_ELSE_IF:${"\uFFFD*22:3\uFFFD"}:START_BLOCK_ELSE_IF_1: Save Destination ${"[\uFFFD/*21:2\uFFFD|\uFFFD/*22:3\uFFFD]"}:CLOSE_BLOCK_ELSE_IF:${"\uFFFD*23:4\uFFFD"}:START_BLOCK_ELSE: Test & Save ${"\uFFFD/*23:4\uFFFD"}:CLOSE_BLOCK_ELSE:`,F=j(F);let b;b=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF: Testing... ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE_IF: Retry test ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE_IF:${"\uFFFD*4:3\uFFFD"}:START_BLOCK_ELSE: Test destination ${"\uFFFD/*4:3\uFFFD"}:CLOSE_BLOCK_ELSE:`;let w;w=$localize`Name`;let v;v=$localize`Name`;let U;return U=$localize`Change`,[["testUrl",""],e,t,o,n,s,l,I,h,F,b,v,U,[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",1,"actionable",3,"targetUrl"],["variant","type-a",1,"actionable",3,"click","targetUrl"],["displayName",""],["description",""],[1,"manage-actions"],["shButton","","type","button",1,"small","raised","primary",3,"disabled"],["shButton","","iconOnly","","variant","ghost","type","button",3,"click"],["shButton","","type","button",1,"manage-btn"],["shButton","","type","button",1,"small","raised","primary",3,"click","disabled"],[1,"edit-header"],[1,"edit-form"],[1,"config-section","type-c"],[1,"dest-config-header"],[1,"actions"],["shButton","","type","button","variant","ghost",1,"small",3,"disabled"],[1,"form-row"],[3,"targetUrl","testSignal","connectionStringId","backupId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","moduleType"],[1,"form-footer"],["shButton","","type","button",3,"click"],["shButton","","type","button",1,"raised",3,"click","disabled"],["shButton","","type","button","variant","ghost",1,"small",3,"click","disabled"],["placeholder",w,3,"ngModelChange","ngModel"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal","connectionStringId","backupId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","moduleType"],[1,"selected-backend",3,"targetUrl"],["shButton","","type","button","variant","ghost",3,"click"],[3,"targetUrlChange","targetUrl"],[3,"setDestination"]]},template:function(t,o){t&1&&(x(0,"app-status-bar"),a(1,"section"),C(2,Ot,4,1)(3,vt,24,13),_()),t&2&&(c(2),p(o.selectedDestination()===null?2:3))},dependencies:[pt,mt,Tt,St,_t,st,it,at,rt,lt,R,nt,Z,tt,et],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{max-width:43.75rem;margin:0 auto;padding:2rem 1rem;display:flex;flex-direction:column;gap:1rem}h2[_ngcontent-%COMP%]{font:var(--title-30);text-align:center;padding:2rem}h3[_ngcontent-%COMP%]{font:var(--paragraph-10)}.actionable[_ngcontent-%COMP%]{cursor:pointer}.actionable[_ngcontent-%COMP%]:after{transition:inset .1s linear}.actionable[_ngcontent-%COMP%]:hover{--card-shp: 0}.custom-info[_ngcontent-%COMP%]{flex:1}.custom-info[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font:var(--body-10);color:var(--base-7);margin:.25rem 0 0}.manage-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}@media(max-width:600px){.manage-actions[_ngcontent-%COMP%] .manage-btn[_ngcontent-%COMP%]{display:none}}.add-new[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1.5rem;padding:1.5rem;background:var(--base-1);color:var(--primary-8)}.add-new[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:.8}.edit-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;margin-bottom:.5rem}.edit-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.edit-form[_ngcontent-%COMP%] .form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr;gap:1rem;margin-bottom:1.5rem}@media(max-width:600px){.edit-form[_ngcontent-%COMP%] .form-row[_ngcontent-%COMP%]{grid-template-columns:1fr}}.edit-form[_ngcontent-%COMP%] .config-section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:1.5rem}.edit-form[_ngcontent-%COMP%] .config-section[_ngcontent-%COMP%] .dest-config-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.edit-form[_ngcontent-%COMP%] .form-footer[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:1rem;margin-top:1rem;padding-top:1.5rem;border-top:1px solid var(--base-3)}.selected-backend[_ngcontent-%COMP%]{margin-bottom:.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}"],changeDetection:0})};export{L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as yt,b as Ut,c as $t,l as Lt,p as Rt,q as vt}from"./chunk-DFVPFPMV.js";import"./chunk-5L2OOKRZ.js";import"./chunk-OO32MPRQ.js";import{b as Mt,c as Ft,d as wt}from"./chunk-OBF6ZSYT.js";import"./chunk-6Q6SSTBK.js";import"./chunk-7FDLOZXV.js";import"./chunk-EQNDYV43.js";import"./chunk-35APLYI4.js";import"./chunk-YMUS7QSB.js";import"./chunk-ZXQSQRKN.js";import"./chunk-XZNYCTQB.js";import"./chunk-R6TFME5I.js";import"./chunk-AZRNX5LU.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-NCXKMSRH.js";import"./chunk-QAQMMCTH.js";import{b as _t,d as lt}from"./chunk-KHZ5AXGT.js";import"./chunk-L2QOWZDR.js";import"./chunk-BRL4YYWO.js";import"./chunk-BDQJFOCO.js";import"./chunk-FSHBOASN.js";import{$b as s,Ab as M,Bb as F,Bc as rt,Cb as E,Db as a,Eb as r,Fb as h,Jb as b,Kb as G,Mb as N,Rc as $,Sa as l,Tb as f,Ub as O,Vb as S,Zb as C,Zc as st,_ 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 v,sc as w,tc as y,uc as U,vc as at,wb as T,wc as k,xb as p,xc as x,yb as A}from"./chunk-UH2E7MMT.js";import"./chunk-7CGTOI24.js";var bt=["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 y(_.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"),w("checked",t.save)}}function Vt(o,n){if(o&1){let t=N();a(0,"sh-toggle-card",31),b(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()(),b(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);F(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(),F(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(),F(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 y(_.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 y(_.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);w("isOpen",t.targetUrlDialogOpen),E("options",rt(4,Gt)),l(3),p(e?4:3),l(6),w("ngModel",t.targetUrlCtrl)}}var L=new pt,Ae=(o={destinations:[]})=>L.group({destinations:L.array(o.destinations)}),Me=({key:o,customGroup:n,dynamicGroup:t,advancedGroup:e})=>L.group({destinationType:L.control(o),custom:n,dynamic:t,advanced:e}),B=class o{#n=P(lt);#i=P(_t);#t=P(Rt);#e=P(yt);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?Ft(n)??null:null});isLoadingDestinationEffect=v(()=>{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=wt(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=v(()=>{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,bt,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 R;R=$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,R,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","","variant","ghost","type","button",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:[vt,$t,Ut,Lt,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 yt,b as Ut,c as $t,l as Lt,p as Rt,q as vt}from"./chunk-Y3YNTMT5.js";import"./chunk-5L2OOKRZ.js";import"./chunk-OO32MPRQ.js";import{b as Mt,c as Ft,d as wt}from"./chunk-OBF6ZSYT.js";import"./chunk-6Q6SSTBK.js";import"./chunk-7FDLOZXV.js";import"./chunk-EQNDYV43.js";import"./chunk-35APLYI4.js";import"./chunk-YMUS7QSB.js";import"./chunk-ZXQSQRKN.js";import"./chunk-XZNYCTQB.js";import"./chunk-R6TFME5I.js";import"./chunk-AZRNX5LU.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-NCXKMSRH.js";import"./chunk-QAQMMCTH.js";import{b as _t,d as lt}from"./chunk-KHZ5AXGT.js";import"./chunk-L2QOWZDR.js";import"./chunk-BRL4YYWO.js";import"./chunk-BDQJFOCO.js";import"./chunk-FSHBOASN.js";import{$b as s,Ab as M,Bb as F,Bc as rt,Cb as E,Db as a,Eb as r,Fb as h,Jb as b,Kb as G,Mb as N,Rc as $,Sa as l,Tb as f,Ub as O,Vb as S,Zb as C,Zc as st,_ 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 v,sc as w,tc as y,uc as U,vc as at,wb as T,wc as k,xb as p,xc as x,yb as A}from"./chunk-UH2E7MMT.js";import"./chunk-7CGTOI24.js";var bt=["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 y(_.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"),w("checked",t.save)}}function Vt(o,n){if(o&1){let t=N();a(0,"sh-toggle-card",31),b(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()(),b(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);F(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(),F(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(),F(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 y(_.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 y(_.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);w("isOpen",t.targetUrlDialogOpen),E("options",rt(4,Gt)),l(3),p(e?4:3),l(6),w("ngModel",t.targetUrlCtrl)}}var L=new pt,Ae=(o={destinations:[]})=>L.group({destinations:L.array(o.destinations)}),Me=({key:o,customGroup:n,dynamicGroup:t,advancedGroup:e})=>L.group({destinationType:L.control(o),custom:n,dynamic:t,advanced:e}),B=class o{#n=P(lt);#i=P(_t);#t=P(Rt);#e=P(yt);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?Ft(n)??null:null});isLoadingDestinationEffect=v(()=>{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=wt(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=v(()=>{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,bt,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 R;R=$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,R,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","","variant","ghost","type","button",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:[vt,$t,Ut,Lt,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{g as a,h as b,i as c,j as d}from"./chunk-
|
|
1
|
+
import{g as a,h as b,i as c,j as d}from"./chunk-Y3YNTMT5.js";import"./chunk-5L2OOKRZ.js";import"./chunk-OO32MPRQ.js";import"./chunk-OBF6ZSYT.js";import"./chunk-6Q6SSTBK.js";import"./chunk-7FDLOZXV.js";import"./chunk-EQNDYV43.js";import"./chunk-35APLYI4.js";import"./chunk-YMUS7QSB.js";import"./chunk-ZXQSQRKN.js";import"./chunk-XZNYCTQB.js";import"./chunk-R6TFME5I.js";import"./chunk-AZRNX5LU.js";import"./chunk-NCXKMSRH.js";import"./chunk-QAQMMCTH.js";import"./chunk-KHZ5AXGT.js";import"./chunk-L2QOWZDR.js";import"./chunk-BRL4YYWO.js";import"./chunk-BDQJFOCO.js";import"./chunk-FSHBOASN.js";import"./chunk-UH2E7MMT.js";import"./chunk-7CGTOI24.js";export{a as SCHEDULE_DEFAULT_OPTIONS,c as SCHEDULE_FIELD_DEFAULTS,d as default,b as scheduleOptionToSchedule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as a,e as b,f as c}from"./chunk-
|
|
1
|
+
import{d as a,e as b,f as c}from"./chunk-Y3YNTMT5.js";import"./chunk-5L2OOKRZ.js";import"./chunk-OO32MPRQ.js";import"./chunk-OBF6ZSYT.js";import"./chunk-6Q6SSTBK.js";import"./chunk-7FDLOZXV.js";import"./chunk-EQNDYV43.js";import"./chunk-35APLYI4.js";import"./chunk-YMUS7QSB.js";import"./chunk-ZXQSQRKN.js";import"./chunk-XZNYCTQB.js";import"./chunk-R6TFME5I.js";import"./chunk-AZRNX5LU.js";import"./chunk-NCXKMSRH.js";import"./chunk-QAQMMCTH.js";import"./chunk-KHZ5AXGT.js";import"./chunk-L2QOWZDR.js";import"./chunk-BRL4YYWO.js";import"./chunk-BDQJFOCO.js";import"./chunk-FSHBOASN.js";import"./chunk-UH2E7MMT.js";import"./chunk-7CGTOI24.js";export{b as NONE_OPTION,a as createGeneralForm,c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as pe}from"./chunk-BLPTBPXV.js";import"./chunk-TZEOQBIX.js";import{b as de,c as Se,l as ue,p as Ee,q as Ce}from"./chunk-DFVPFPMV.js";import"./chunk-5L2OOKRZ.js";import"./chunk-OO32MPRQ.js";import{c as Te,d as ge}from"./chunk-OBF6ZSYT.js";import"./chunk-6Q6SSTBK.js";import"./chunk-MRSBKQQM.js";import"./chunk-7FDLOZXV.js";import"./chunk-EQNDYV43.js";import{a as M}from"./chunk-35APLYI4.js";import"./chunk-YMUS7QSB.js";import"./chunk-ZXQSQRKN.js";import"./chunk-XZNYCTQB.js";import"./chunk-R6TFME5I.js";import"./chunk-AZRNX5LU.js";import{B as le,H as _e,K as ce,c as Q,e as Y,f as Z,g as ee,i as te,j as ne,s as ie,v as oe,w as re,y as ae,z as se}from"./chunk-NCXKMSRH.js";import"./chunk-QAQMMCTH.js";import{b as j,d as q}from"./chunk-KHZ5AXGT.js";import"./chunk-L2QOWZDR.js";import"./chunk-BRL4YYWO.js";import"./chunk-BDQJFOCO.js";import"./chunk-FSHBOASN.js";import{$b as l,Ac as H,Bc as K,Cb as D,Db as r,Eb as a,Fb as O,Jb as V,Kb as W,Mb as u,Rc as $,Sa as T,Tb as E,Ub as C,Vb as I,Yb as z,Yc as w,Zb as d,_ as m,da as _,ea as c,gb as B,gc as J,ha as v,hc as X,nc as P,pa as N,sc as f,tc as R,uc as h,vc as A,wb as p,wc as y,xb as F,xc as L}from"./chunk-UH2E7MMT.js";import"./chunk-7CGTOI24.js";var Fe=["formRef"],Oe=["testUrl"],me=()=>({maxWidth:"700px",width:"100%"});function Re(o,i){if(o&1){let e=u();r(0,"button",24),d("click",function(){_(e);let t=l();return c(t.openTargetUrlDialog())}),E(1,5),O(2,"sh-icon"),C(),a()}}function Ne(o,i){if(o&1){let e=u();r(0,"button",24),d("click",function(){_(e);let t=l(2);return c(t.copyTargetUrl())}),E(1,7),O(2,"sh-icon"),C(),a()}}function De(o,i){if(o&1){let e=u();r(0,"sh-menu")(1,"button",15)(2,"sh-icon"),P(3,"dots-three-vertical"),a()(),V(4,25),r(5,"button",24),d("click",function(){_(e);let t=l();return c(t.openTargetUrlDialog())}),E(6,6),O(7,"sh-icon"),C(),a(),p(8,Ne,3,0,"button",15),W(),a()}if(o&2){l();let e=L(0);T(8),F(e?8:-1)}}function Ie(o,i){if(o&1){let e=u();r(0,"app-destination-list-item",17)(1,"button",20),d("click",function(){_(e);let t=l();return c(t.removeDestination())}),I(2,8),a()()}if(o&2){l();let e=L(12);D("destination",e)}}function fe(o,i){if(o&1){let e=u();r(0,"app-destination-list",26),d("setDestination",function(t){_(e);let s=l();return c(s.setDestination(t))}),a()}}function he(o,i){if(o&1){let e=u();r(0,"app-single-destination",27),h("targetUrlChange",function(t){_(e);let s=l();return R(s.targetUrlModel,t)||(s.targetUrlModel=t),c(t)}),a()}if(o&2){let e=l();f("targetUrl",e.targetUrlModel)}}function Me(o,i){o&1&&(E(0,4,1),O(1,"sh-icon",22),C())}function Pe(o,i){o&1&&(E(0,4,2),O(1,"sh-icon"),C())}function Ae(o,i){if(o&1){let e=u();r(0,"sh-dialog",28),h("isOpenChange",function(t){_(e);let s=l();return R(s.targetUrlDialogOpen,t)||(s.targetUrlDialogOpen=t),c(t)}),r(1,"header",29)(2,"div",30)(3,"h2"),I(4,9),a(),r(5,"sh-alert",31),I(6,10),a()()(),r(7,"div",32)(8,"sh-form-field")(9,"textarea",33),h("ngModelChange",function(t){_(e);let s=l();return R(s.targetUrlCtrl,t)||(s.targetUrlCtrl=t),c(t)}),a()()(),r(10,"footer",34)(11,"button",20),d("click",function(){_(e);let t=l();return c(t.closeTargetUrlDialog(!1))}),P(12,"Cancel"),a(),r(13,"button",35),d("click",function(){_(e);let t=l();return c(t.closeTargetUrlDialog(!0))}),E(14,11),O(15,"sh-icon"),C(),a()()()}if(o&2){let e=l();f("isOpen",e.targetUrlDialogOpen),D("options",K(3,me)),T(9),f("ngModel",e.targetUrlCtrl)}}var x=class o{#i=m(q);#o=m(j);#n=m(se);injector=m(v);#e=m(pe);formRef=w.required("formRef");testUrlComponent=w.required("testUrl");testSignal=this.#e.destinationTestSignal;targetUrlModel=this.#e.destinationTargetUrl;targetUrlCtrl=N(null);targetUrlInitial=N(null);targetUrlDialogOpen=N(!1);toggleNewDestination=N(!0);selectedDestinationType=$(()=>{let i=this.#e.destinationTargetUrl();return i?Te(i):null});selectedDestinationTypeOption=$(()=>{let i=this.selectedDestinationType();return i?{key:i.customKey??i.key,customKey:i.customKey??null,displayName:i.displayName,description:i.description,icon:i.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.#e.destinationTargetUrl()??"")}openTargetUrlDialog(){let i=this.#e.destinationTargetUrl();this.targetUrlCtrl.set(i),this.targetUrlInitial.set(i),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(i=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl(),n=this.targetUrlInitial();!i||e===n||!e||this.#e.updateTargetUrl(e)}setDestination(i){let e=ge(i??"");if(e){if(e.mapper.default){let n=e.mapper.default("");this.#e.updateTargetUrl(n);return}this.#e.updateTargetUrl(`${i}://`)}}removeDestination(){this.#e.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let i=this.testSignal();if(i===null){this.#n.open(M,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:n=>{n?this.testUrlComponent()?.testDestination(!1)?.then(t=>{t.action==="success"&&t.containsBackup?this.#t():this.#n.open(M,{data:{title:$localize`Test did not succeed`,message:t.errorMessage??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#t()}});return}let e=typeof i=="string"?null:i;if(e?.action!=="success"||!e.containsBackup){this.#n.open(M,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Edit destination`,cancelText:$localize`Yes, continue`},closed:n=>{n||this.#t()}});return}this.#t()}#t(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=B({type:o,selectors:[["app-restore-destination"]],viewQuery:function(e,n){e&1&&J(n.formRef,Fe,5)(n.testUrlComponent,Oe,5),e&2&&X(2)},features:[H([Ee])],decls:25,vars:17,consts:()=>{let i;i=$localize`Backup destination`;let e;e=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let n;n=$localize`${"\uFFFD*22:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*22:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*23:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*23:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,n=z(n);let t;t=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Set target URL `;let s;s=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let g;g=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let U;U=$localize`Change`;let b;b=$localize`Edit target URL`;let G;G=$localize`Be careful, this will overwrite everything you have in your destination.`;let k;return k=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],["testUrl",""],i,e,n,t,s,g,U,b,G,k,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal","backupId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","moduleType"],[1,"current-destination",3,"destination"],[3,"targetUrl"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click"],["menu",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"target-dialog-header"],[1,"warn"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(e,n){if(e&1){let t=u();A(0),r(1,"form",12,0),d("submit",function(){return n.next()}),r(3,"header")(4,"h3",13)(5,"span"),I(6,2),a(),r(7,"div",14),p(8,Re,3,0,"button",15)(9,De,9,1,"sh-menu"),a()(),r(10,"app-test-url",16,1),h("targetUrlChange",function(g){return _(t),R(n.targetUrlModel,g)||(n.targetUrlModel=g),c(g)})("testSignalChange",function(g){return _(t),R(n.testSignal,g)||(n.testSignal=g),c(g)}),a(),A(12),p(13,Ie,3,1,"app-destination-list-item",17),a(),p(14,fe,1,0,"app-destination-list"),p(15,he,1,1,"app-single-destination",18),r(16,"div",19)(17,"button",20),d("click",function(){return n.goBack()}),E(18,3),O(19,"sh-icon"),C(),a(),r(20,"button",21),E(21,4),p(22,Me,2,0,"sh-icon",22)(23,Pe,2,0,"sh-icon"),C(),a()()(),p(24,Ae,16,4,"sh-dialog",23)}if(e&2){let t=y(!!n.targetUrlModel());T(8),F(t?9:8),T(2),f("targetUrl",n.targetUrlModel)("testSignal",n.testSignal),D("backupId",null)("sourcePrefix",null)("suppressErrorDialogs",!1)("askToCreate",!1)("testExpectation","containsBackup")("moduleType","Backend"),T(2);let s=y(n.selectedDestinationTypeOption());T(),F(s?13:-1),T(),F(t?-1:14),T(),F(t?15:-1),T(5),D("disabled",n.testSignal()=="testing"||!t),T(2),F(n.testSignal()=="testing"?22:23),T(2),F(n.targetUrlDialogOpen()?24:-1)}},dependencies:[Ce,Se,de,ie,ne,Q,Y,Z,te,ee,le,_e,ce,oe,ae,re,ue],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}"],changeDetection:0})};export{x as default};
|
|
1
|
+
import{g as pe}from"./chunk-HO6FQWDR.js";import"./chunk-TZEOQBIX.js";import{b as de,c as Se,l as ue,p as Ee,q as Ce}from"./chunk-Y3YNTMT5.js";import"./chunk-5L2OOKRZ.js";import"./chunk-OO32MPRQ.js";import{c as Te,d as ge}from"./chunk-OBF6ZSYT.js";import"./chunk-6Q6SSTBK.js";import"./chunk-MRSBKQQM.js";import"./chunk-7FDLOZXV.js";import"./chunk-EQNDYV43.js";import{a as M}from"./chunk-35APLYI4.js";import"./chunk-YMUS7QSB.js";import"./chunk-ZXQSQRKN.js";import"./chunk-XZNYCTQB.js";import"./chunk-R6TFME5I.js";import"./chunk-AZRNX5LU.js";import{B as le,H as _e,K as ce,c as Q,e as Y,f as Z,g as ee,i as te,j as ne,s as ie,v as oe,w as re,y as ae,z as se}from"./chunk-NCXKMSRH.js";import"./chunk-QAQMMCTH.js";import{b as j,d as q}from"./chunk-KHZ5AXGT.js";import"./chunk-L2QOWZDR.js";import"./chunk-BRL4YYWO.js";import"./chunk-BDQJFOCO.js";import"./chunk-FSHBOASN.js";import{$b as l,Ac as H,Bc as K,Cb as D,Db as r,Eb as a,Fb as O,Jb as V,Kb as W,Mb as u,Rc as $,Sa as T,Tb as E,Ub as C,Vb as I,Yb as z,Yc as w,Zb as d,_ as m,da as _,ea as c,gb as B,gc as J,ha as v,hc as X,nc as P,pa as N,sc as f,tc as R,uc as h,vc as A,wb as p,wc as y,xb as F,xc as L}from"./chunk-UH2E7MMT.js";import"./chunk-7CGTOI24.js";var Fe=["formRef"],Oe=["testUrl"],me=()=>({maxWidth:"700px",width:"100%"});function Re(o,i){if(o&1){let e=u();r(0,"button",24),d("click",function(){_(e);let t=l();return c(t.openTargetUrlDialog())}),E(1,5),O(2,"sh-icon"),C(),a()}}function Ne(o,i){if(o&1){let e=u();r(0,"button",24),d("click",function(){_(e);let t=l(2);return c(t.copyTargetUrl())}),E(1,7),O(2,"sh-icon"),C(),a()}}function De(o,i){if(o&1){let e=u();r(0,"sh-menu")(1,"button",15)(2,"sh-icon"),P(3,"dots-three-vertical"),a()(),V(4,25),r(5,"button",24),d("click",function(){_(e);let t=l();return c(t.openTargetUrlDialog())}),E(6,6),O(7,"sh-icon"),C(),a(),p(8,Ne,3,0,"button",15),W(),a()}if(o&2){l();let e=L(0);T(8),F(e?8:-1)}}function Ie(o,i){if(o&1){let e=u();r(0,"app-destination-list-item",17)(1,"button",20),d("click",function(){_(e);let t=l();return c(t.removeDestination())}),I(2,8),a()()}if(o&2){l();let e=L(12);D("destination",e)}}function fe(o,i){if(o&1){let e=u();r(0,"app-destination-list",26),d("setDestination",function(t){_(e);let s=l();return c(s.setDestination(t))}),a()}}function he(o,i){if(o&1){let e=u();r(0,"app-single-destination",27),h("targetUrlChange",function(t){_(e);let s=l();return R(s.targetUrlModel,t)||(s.targetUrlModel=t),c(t)}),a()}if(o&2){let e=l();f("targetUrl",e.targetUrlModel)}}function Me(o,i){o&1&&(E(0,4,1),O(1,"sh-icon",22),C())}function Pe(o,i){o&1&&(E(0,4,2),O(1,"sh-icon"),C())}function Ae(o,i){if(o&1){let e=u();r(0,"sh-dialog",28),h("isOpenChange",function(t){_(e);let s=l();return R(s.targetUrlDialogOpen,t)||(s.targetUrlDialogOpen=t),c(t)}),r(1,"header",29)(2,"div",30)(3,"h2"),I(4,9),a(),r(5,"sh-alert",31),I(6,10),a()()(),r(7,"div",32)(8,"sh-form-field")(9,"textarea",33),h("ngModelChange",function(t){_(e);let s=l();return R(s.targetUrlCtrl,t)||(s.targetUrlCtrl=t),c(t)}),a()()(),r(10,"footer",34)(11,"button",20),d("click",function(){_(e);let t=l();return c(t.closeTargetUrlDialog(!1))}),P(12,"Cancel"),a(),r(13,"button",35),d("click",function(){_(e);let t=l();return c(t.closeTargetUrlDialog(!0))}),E(14,11),O(15,"sh-icon"),C(),a()()()}if(o&2){let e=l();f("isOpen",e.targetUrlDialogOpen),D("options",K(3,me)),T(9),f("ngModel",e.targetUrlCtrl)}}var x=class o{#i=m(q);#o=m(j);#n=m(se);injector=m(v);#e=m(pe);formRef=w.required("formRef");testUrlComponent=w.required("testUrl");testSignal=this.#e.destinationTestSignal;targetUrlModel=this.#e.destinationTargetUrl;targetUrlCtrl=N(null);targetUrlInitial=N(null);targetUrlDialogOpen=N(!1);toggleNewDestination=N(!0);selectedDestinationType=$(()=>{let i=this.#e.destinationTargetUrl();return i?Te(i):null});selectedDestinationTypeOption=$(()=>{let i=this.selectedDestinationType();return i?{key:i.customKey??i.key,customKey:i.customKey??null,displayName:i.displayName,description:i.description,icon:i.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.#e.destinationTargetUrl()??"")}openTargetUrlDialog(){let i=this.#e.destinationTargetUrl();this.targetUrlCtrl.set(i),this.targetUrlInitial.set(i),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(i=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl(),n=this.targetUrlInitial();!i||e===n||!e||this.#e.updateTargetUrl(e)}setDestination(i){let e=ge(i??"");if(e){if(e.mapper.default){let n=e.mapper.default("");this.#e.updateTargetUrl(n);return}this.#e.updateTargetUrl(`${i}://`)}}removeDestination(){this.#e.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let i=this.testSignal();if(i===null){this.#n.open(M,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:n=>{n?this.testUrlComponent()?.testDestination(!1)?.then(t=>{t.action==="success"&&t.containsBackup?this.#t():this.#n.open(M,{data:{title:$localize`Test did not succeed`,message:t.errorMessage??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#t()}});return}let e=typeof i=="string"?null:i;if(e?.action!=="success"||!e.containsBackup){this.#n.open(M,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Edit destination`,cancelText:$localize`Yes, continue`},closed:n=>{n||this.#t()}});return}this.#t()}#t(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=B({type:o,selectors:[["app-restore-destination"]],viewQuery:function(e,n){e&1&&J(n.formRef,Fe,5)(n.testUrlComponent,Oe,5),e&2&&X(2)},features:[H([Ee])],decls:25,vars:17,consts:()=>{let i;i=$localize`Backup destination`;let e;e=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let n;n=$localize`${"\uFFFD*22:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*22:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*23:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*23:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,n=z(n);let t;t=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Set target URL `;let s;s=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let g;g=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let U;U=$localize`Change`;let b;b=$localize`Edit target URL`;let G;G=$localize`Be careful, this will overwrite everything you have in your destination.`;let k;return k=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],["testUrl",""],i,e,n,t,s,g,U,b,G,k,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal","backupId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","moduleType"],[1,"current-destination",3,"destination"],[3,"targetUrl"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click"],["menu",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"target-dialog-header"],[1,"warn"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(e,n){if(e&1){let t=u();A(0),r(1,"form",12,0),d("submit",function(){return n.next()}),r(3,"header")(4,"h3",13)(5,"span"),I(6,2),a(),r(7,"div",14),p(8,Re,3,0,"button",15)(9,De,9,1,"sh-menu"),a()(),r(10,"app-test-url",16,1),h("targetUrlChange",function(g){return _(t),R(n.targetUrlModel,g)||(n.targetUrlModel=g),c(g)})("testSignalChange",function(g){return _(t),R(n.testSignal,g)||(n.testSignal=g),c(g)}),a(),A(12),p(13,Ie,3,1,"app-destination-list-item",17),a(),p(14,fe,1,0,"app-destination-list"),p(15,he,1,1,"app-single-destination",18),r(16,"div",19)(17,"button",20),d("click",function(){return n.goBack()}),E(18,3),O(19,"sh-icon"),C(),a(),r(20,"button",21),E(21,4),p(22,Me,2,0,"sh-icon",22)(23,Pe,2,0,"sh-icon"),C(),a()()(),p(24,Ae,16,4,"sh-dialog",23)}if(e&2){let t=y(!!n.targetUrlModel());T(8),F(t?9:8),T(2),f("targetUrl",n.targetUrlModel)("testSignal",n.testSignal),D("backupId",null)("sourcePrefix",null)("suppressErrorDialogs",!1)("askToCreate",!1)("testExpectation","containsBackup")("moduleType","Backend"),T(2);let s=y(n.selectedDestinationTypeOption());T(),F(s?13:-1),T(),F(t?-1:14),T(),F(t?15:-1),T(5),D("disabled",n.testSignal()=="testing"||!t),T(2),F(n.testSignal()=="testing"?22:23),T(2),F(n.targetUrlDialogOpen()?24:-1)}},dependencies:[Ce,Se,de,ie,ne,Q,Y,Z,te,ee,le,_e,ce,oe,ae,re,ue],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}"],changeDetection:0})};export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g}from"./chunk-
|
|
1
|
+
import{g}from"./chunk-HO6FQWDR.js";import"./chunk-TZEOQBIX.js";import{a as W}from"./chunk-ZK3S23CJ.js";import"./chunk-GO22QPW4.js";import"./chunk-FMDSOHVR.js";import"./chunk-NBKLLQQO.js";import{p as w}from"./chunk-Y3YNTMT5.js";import"./chunk-5L2OOKRZ.js";import"./chunk-OO32MPRQ.js";import"./chunk-OBF6ZSYT.js";import"./chunk-I625OICV.js";import"./chunk-XCVBN7EK.js";import"./chunk-ADB5QRUO.js";import"./chunk-22PELS6R.js";import"./chunk-6Q6SSTBK.js";import"./chunk-MRSBKQQM.js";import"./chunk-7FDLOZXV.js";import"./chunk-EQNDYV43.js";import"./chunk-35APLYI4.js";import"./chunk-LU7TIW3P.js";import"./chunk-YMUS7QSB.js";import{b as p}from"./chunk-ZXQSQRKN.js";import"./chunk-XZNYCTQB.js";import"./chunk-R6TFME5I.js";import"./chunk-AZRNX5LU.js";import{R as G}from"./chunk-NCXKMSRH.js";import"./chunk-QAQMMCTH.js";import{a as h,b as I,c as $,d as A,e as v,f as y}from"./chunk-KHZ5AXGT.js";import"./chunk-L2QOWZDR.js";import"./chunk-BRL4YYWO.js";import"./chunk-BDQJFOCO.js";import"./chunk-FSHBOASN.js";import{$b as T,Ac as F,Bc as E,Cb as _,Cc as u,Db as i,Eb as o,Fb as C,Sa as s,Vb as l,_ as d,gb as L,kc as M,pa as P,ra as N,wb as O,xb as S}from"./chunk-UH2E7MMT.js";import"./chunk-7CGTOI24.js";var k=()=>["/restore-from-files/destination"],x=()=>["/restore-from-files/encryption"],b=()=>["/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),l(1,0),o(),i(2,"div",7),l(3,1),o(),i(4,"div",8),l(5,2),o(),i(6,"div",8),l(7,3),o()),t&2&&(_("routerLink",E(4,k)),s(2),_("routerLink",E(5,x)),s(2),_("routerLink",E(6,b)),s(2),_("routerLink",E(7,J)))}function B(t,n){if(t&1&&(i(0,"div",7),l(1,4),o(),i(2,"div",7),l(3,5),o()),t&2){let e=T(2);_("routerLink",u(2,X,e.backupId())),s(2),_("routerLink",u(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(),S(e.isFileRestore()?1:2)}}var m=class t{#e=d(I);#n=d(A);#t=d(g);#i=p(this.#e.params);#o=p(this.#e.url);#r=p(this.#e.children[0].url);backupId=this.#t.backupId;isFileRestore=this.#t.isFileRestore;isProgressPage=P(!1);paramsChanged=N(()=>{let n=this.#r(),e=this.#i()?.id,r=!!this.#o()?.find(a=>a.path==="restore-from-files"),R=!!n?.find(a=>a.path==="progress");this.isProgressPage.set(R),this.#t.init(e,r)});ngOnInit(){this.#n.events.subscribe(n=>{if(n instanceof h){let e=n.urlAfterRedirects;this.isProgressPage.set(e.includes("progress"))}})}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.isProgressPage())},features:[F([g,w])],decls:4,vars:1,consts:()=>{let n;n=$localize` Destination `;let e;e=$localize` Encryption `;let r;r=$localize` Select files `;let R;R=$localize` Options `;let a;a=$localize` Select files `;let f;return f=$localize`Options`,[n,e,r,R,a,f,[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(),S(r.isProgressPage()?-1:1))},dependencies:[G,W,$,v,y],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{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,d as b}from"./chunk-
|
|
1
|
+
import{c as a,d as b}from"./chunk-HO6FQWDR.js";import"./chunk-TZEOQBIX.js";import"./chunk-Y3YNTMT5.js";import"./chunk-5L2OOKRZ.js";import"./chunk-OO32MPRQ.js";import"./chunk-OBF6ZSYT.js";import"./chunk-6Q6SSTBK.js";import"./chunk-MRSBKQQM.js";import"./chunk-7FDLOZXV.js";import"./chunk-EQNDYV43.js";import"./chunk-35APLYI4.js";import"./chunk-YMUS7QSB.js";import"./chunk-ZXQSQRKN.js";import"./chunk-XZNYCTQB.js";import"./chunk-R6TFME5I.js";import"./chunk-AZRNX5LU.js";import"./chunk-NCXKMSRH.js";import"./chunk-QAQMMCTH.js";import"./chunk-KHZ5AXGT.js";import"./chunk-L2QOWZDR.js";import"./chunk-BRL4YYWO.js";import"./chunk-BDQJFOCO.js";import"./chunk-FSHBOASN.js";import"./chunk-UH2E7MMT.js";import"./chunk-7CGTOI24.js";export{a as createEncryptionForm,b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as G}from"./chunk-ZK3S23CJ.js";import"./chunk-GO22QPW4.js";import"./chunk-FMDSOHVR.js";import"./chunk-NBKLLQQO.js";import{p as S}from"./chunk-
|
|
1
|
+
import{a as G}from"./chunk-ZK3S23CJ.js";import"./chunk-GO22QPW4.js";import"./chunk-FMDSOHVR.js";import"./chunk-NBKLLQQO.js";import{p as S}from"./chunk-Y3YNTMT5.js";import"./chunk-5L2OOKRZ.js";import"./chunk-OO32MPRQ.js";import"./chunk-OBF6ZSYT.js";import"./chunk-I625OICV.js";import{a as v}from"./chunk-XCVBN7EK.js";import"./chunk-ADB5QRUO.js";import"./chunk-22PELS6R.js";import"./chunk-6Q6SSTBK.js";import"./chunk-MRSBKQQM.js";import"./chunk-7FDLOZXV.js";import"./chunk-EQNDYV43.js";import"./chunk-35APLYI4.js";import"./chunk-LU7TIW3P.js";import"./chunk-YMUS7QSB.js";import{b as g}from"./chunk-ZXQSQRKN.js";import"./chunk-XZNYCTQB.js";import"./chunk-R6TFME5I.js";import"./chunk-AZRNX5LU.js";import{L,R as I}from"./chunk-NCXKMSRH.js";import{d as D}from"./chunk-QAQMMCTH.js";import{b as A,c as M,e as O,f as R}from"./chunk-KHZ5AXGT.js";import"./chunk-L2QOWZDR.js";import"./chunk-BRL4YYWO.js";import"./chunk-BDQJFOCO.js";import"./chunk-FSHBOASN.js";import{$b as N,Ac as B,Cb as p,D as k,Db as r,Dc as u,Eb as s,Fb as C,Sa as a,Vb as c,_,gb as T,nc as E,pc as b,ra as h,wb as m,xb as f}from"./chunk-UH2E7MMT.js";import"./chunk-7CGTOI24.js";var $=(n,e)=>[n,e,"general"],y=(n,e)=>[n,e,"destination"],U=(n,e)=>[n,e,"source-data"],K=(n,e)=>[n,e,"schedule"],F=(n,e)=>[n,e,"options"];function w(n,e){if(n&1&&(r(0,"p"),E(1),s()),n&2){let t=N();a(),b("Editing: ",t.backupName())}}function J(n,e){n&1&&C(0,"sh-progress-bar",7)}function X(n,e){n&1&&(r(0,"section"),C(1,"router-outlet"),s())}var P=class n{#t=_(A);#e=_(S);#n=_(v);#i=_(D);isDraft=this.#e.isDraft;isNew=this.#e.isNew;backupId=this.#e.backupId;backupName=this.#e.backupName;finishedLoading=this.#e.finishedLoading;#o=g(this.#t.params);#a=g(this.#t.url);paramsChanged=h(()=>{let e=this.#o()?.id,t=!!this.#a()?.find(i=>i.path==="backup-draft");this.#e.backupId.set(e),e!=="new"?this.getBackup(e,t):this.getDefaults()});getDefaults(){this.#i.getApiV1Backupdefaults().pipe(k(1)).subscribe({next:e=>{let t=e.Backup;t.Settings=[...t.Settings],this.#e.mapGeneralToForm(t),this.#e.mapDestinationToForm(t),this.#e.mapSourceDataToForm(t),this.#e.mapScheduleToForm(e.Schedule),this.#e.mapOptionsToForms(t),this.#e.applicationOptions.set(e.ApplicationOptions),this.#e.backupDefaults.set(e),this.#e.finishedLoading.set(!0)}})}getBackup(e,t=!1){let i=o=>{this.#e.mapScheduleToForm(o.Schedule??null),o.Backup&&(this.#e.mapGeneralToForm(o.Backup),this.#e.mapDestinationToForm(o.Backup),this.#e.mapSourceDataToForm(o.Backup),this.#e.mapOptionsToForms(o.Backup),this.#e.storeMetadata(o.Backup,t)),this.#e.finishedLoading.set(!0)};if(t){this.isDraft.set(t);let o=this.#n.draftBackups().find(d=>d.id===e);if(!o){alert("Backup not found");return}i(o.data)}else this.#i.getApiV1BackupById({id:e}).subscribe({next:i})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=T({type:n,selectors:[["app-backup"]],features:[B([S])],decls:16,vars:22,consts:()=>{let e;e=$localize` General `;let t;t=$localize` Destination `;let i;i=$localize` Source Data `;let o;o=$localize` Schedule `;let d;return d=$localize` Options `,[e,t,i,o,d,[1,"primary"],["tabindex","-1","routerLinkActive","active",3,"routerLink"],[1,"indeterminate","primary"]]},template:function(t,i){t&1&&(C(0,"app-status-bar"),r(1,"header"),m(2,w,2,1,"p"),r(3,"sh-stepper",5)(4,"div",6),c(5,0),s(),r(6,"div",6),c(7,1),s(),r(8,"div",6),c(9,2),s(),r(10,"div",6),c(11,3),s(),r(12,"div",6),c(13,4),s()()(),m(14,J,1,0,"sh-progress-bar",7)(15,X,2,0,"section")),t&2&&(a(2),f(i.isNew()?-1:2),a(2),p("routerLink",u(7,$,i.isDraft()?"/backup-draft":"/backup",i.backupId())),a(2),p("routerLink",u(10,y,i.isDraft()?"/backup-draft":"/backup",i.backupId())),a(2),p("routerLink",u(13,U,i.isDraft()?"/backup-draft":"/backup",i.backupId())),a(2),p("routerLink",u(16,K,i.isDraft()?"/backup-draft":"/backup",i.backupId())),a(2),p("routerLink",u(19,F,i.isDraft()?"/backup-draft":"/backup",i.backupId())),a(2),f(i.finishedLoading()?15:14))},dependencies:[M,O,R,G,I,L],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}header[_ngcontent-%COMP%]{padding:1rem 1.5rem;border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:.5rem}header[_ngcontent-%COMP%] sh-stepper[_ngcontent-%COMP%]{width:100%}section[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;flex:1 0;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:auto}"],changeDetection:0})};export{P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as a,f as b}from"./chunk-
|
|
1
|
+
import{e as a,f as b}from"./chunk-HO6FQWDR.js";import"./chunk-TZEOQBIX.js";import"./chunk-Y3YNTMT5.js";import"./chunk-5L2OOKRZ.js";import"./chunk-OO32MPRQ.js";import"./chunk-OBF6ZSYT.js";import"./chunk-6Q6SSTBK.js";import"./chunk-MRSBKQQM.js";import"./chunk-7FDLOZXV.js";import"./chunk-EQNDYV43.js";import"./chunk-35APLYI4.js";import"./chunk-YMUS7QSB.js";import"./chunk-ZXQSQRKN.js";import"./chunk-XZNYCTQB.js";import"./chunk-R6TFME5I.js";import"./chunk-AZRNX5LU.js";import"./chunk-NCXKMSRH.js";import"./chunk-QAQMMCTH.js";import"./chunk-KHZ5AXGT.js";import"./chunk-L2QOWZDR.js";import"./chunk-BRL4YYWO.js";import"./chunk-BDQJFOCO.js";import"./chunk-FSHBOASN.js";import"./chunk-UH2E7MMT.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-HO6FQWDR.js";import{a as K}from"./chunk-M5RTYP7N.js";import"./chunk-HHDCI6IF.js";import"./chunk-TZEOQBIX.js";import{b as Z}from"./chunk-U34FLIYL.js";import"./chunk-Y3YNTMT5.js";import"./chunk-5L2OOKRZ.js";import"./chunk-OO32MPRQ.js";import"./chunk-OBF6ZSYT.js";import"./chunk-J5TWEZOP.js";import{b as V}from"./chunk-I625OICV.js";import"./chunk-XCVBN7EK.js";import"./chunk-6Q6SSTBK.js";import{a as j}from"./chunk-MRSBKQQM.js";import"./chunk-7FDLOZXV.js";import"./chunk-EQNDYV43.js";import"./chunk-35APLYI4.js";import"./chunk-LU7TIW3P.js";import"./chunk-YMUS7QSB.js";import"./chunk-ZXQSQRKN.js";import{b as H}from"./chunk-XZNYCTQB.js";import"./chunk-R6TFME5I.js";import"./chunk-AZRNX5LU.js";import{C as W,L as X,O as z,v as J}from"./chunk-NCXKMSRH.js";import{d as B}from"./chunk-QAQMMCTH.js";import{b as w}from"./chunk-KHZ5AXGT.js";import"./chunk-L2QOWZDR.js";import"./chunk-BRL4YYWO.js";import{ma as k}from"./chunk-BDQJFOCO.js";import"./chunk-FSHBOASN.js";import{$b as g,Cb as C,Db as i,Eb as s,Fb as c,Gc as T,Hc as d,Jb as P,Kb as m,Rc as b,Sa as a,Tb as y,Ub as D,Vb as r,Wb as v,Xb as x,_ as S,fa as u,ga as f,gb as A,nc as M,pa as I,qc as N,wb as O,xb as p}from"./chunk-UH2E7MMT.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"),y(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),v((e=R.statusData())==null?null:e.statusText),x(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=I("");#e=null;lastRestoreStarted=b(()=>{if(this.#e)return this.#e;let t=this.#t.statusData()?.backup?.Backup?.Metadata?.LastRestoreStarted??null;if(!t)return null;let e=this.fixDate(t);return this.#e=e,e});notificationFilterPredicate=()=>{let t=this.lastRestoreStarted();return{predicate:e=>(e.BackupID===this.#n.backupId()&&t&&t.getTime()<=new Date(e.Timestamp).getTime())??!1}};ngOnInit(){let t=this.#r.snapshot.params.taskid?.toString()??"";this.#i.getApiV1TaskByTaskid({taskid:t}).subscribe({next:e=>{if(e.TaskStarted&&(this.#e=new Date(e.TaskStarted)),!e.TaskFinished&&e.ID){this.#_(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=A({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{n as a,o as b}from"./chunk-
|
|
1
|
+
import{n as a,o as b}from"./chunk-Y3YNTMT5.js";import"./chunk-5L2OOKRZ.js";import"./chunk-OO32MPRQ.js";import"./chunk-OBF6ZSYT.js";import"./chunk-6Q6SSTBK.js";import"./chunk-7FDLOZXV.js";import"./chunk-EQNDYV43.js";import"./chunk-35APLYI4.js";import"./chunk-YMUS7QSB.js";import"./chunk-ZXQSQRKN.js";import"./chunk-XZNYCTQB.js";import"./chunk-R6TFME5I.js";import"./chunk-AZRNX5LU.js";import"./chunk-NCXKMSRH.js";import"./chunk-QAQMMCTH.js";import"./chunk-KHZ5AXGT.js";import"./chunk-L2QOWZDR.js";import"./chunk-BRL4YYWO.js";import"./chunk-BDQJFOCO.js";import"./chunk-FSHBOASN.js";import"./chunk-UH2E7MMT.js";import"./chunk-7CGTOI24.js";export{a as createSourceDataForm,b as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-7ED2GUWQ.js")},{path:"destination",loadComponent:()=>import("./chunk-2E5PWPGZ.js")},{path:"source-data",loadComponent:()=>import("./chunk-BP66ERTI.js")},{path:"schedule",loadComponent:()=>import("./chunk-522J6R6I.js")},{path:"options",loadComponent:()=>import("./chunk-U3A754M6.js")}];export{o as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as Ee}from"./chunk-TZEOQBIX.js";import{a as Ne}from"./chunk-ZK3S23CJ.js";import"./chunk-GO22QPW4.js";import"./chunk-FMDSOHVR.js";import"./chunk-NBKLLQQO.js";import{k as Te,p as A}from"./chunk-
|
|
1
|
+
import{a as Ee}from"./chunk-TZEOQBIX.js";import{a as Ne}from"./chunk-ZK3S23CJ.js";import"./chunk-GO22QPW4.js";import"./chunk-FMDSOHVR.js";import"./chunk-NBKLLQQO.js";import{k as Te,p as A}from"./chunk-Y3YNTMT5.js";import"./chunk-5L2OOKRZ.js";import"./chunk-OO32MPRQ.js";import"./chunk-OBF6ZSYT.js";import{b as he}from"./chunk-I625OICV.js";import"./chunk-XCVBN7EK.js";import"./chunk-ADB5QRUO.js";import"./chunk-22PELS6R.js";import"./chunk-6Q6SSTBK.js";import"./chunk-MRSBKQQM.js";import"./chunk-7FDLOZXV.js";import"./chunk-EQNDYV43.js";import"./chunk-35APLYI4.js";import"./chunk-LU7TIW3P.js";import"./chunk-YMUS7QSB.js";import{b as D}from"./chunk-ZXQSQRKN.js";import"./chunk-XZNYCTQB.js";import"./chunk-R6TFME5I.js";import"./chunk-AZRNX5LU.js";import{B as ue,G as de,H as _e,L as pe,P as Ce,Y as ge,c as Z,e as ee,f as te,j as ne,n as oe,o as ie,p as ae,q as se,r as re,s as le,t as ce,v as me}from"./chunk-NCXKMSRH.js";import{b as Fe,d as Se}from"./chunk-QAQMMCTH.js";import{b as W,d as Q,e as Y}from"./chunk-KHZ5AXGT.js";import"./chunk-L2QOWZDR.js";import"./chunk-BRL4YYWO.js";import"./chunk-BDQJFOCO.js";import"./chunk-FSHBOASN.js";import{$b as N,Ab as y,Ac as z,Bb as U,Bc as j,Cb as F,Db as l,Eb as o,Fb as a,Jb as I,Kb as M,Mb as v,Sa as u,Tb as p,Ub as C,V as b,Vb as O,Wb as x,Xb as w,Zb as K,_,da as E,ea as f,gb as R,kc as J,pa as L,ra as $,sc as X,tc as q,uc as V,wb as k,xb as G,yb as B,zc as H}from"./chunk-UH2E7MMT.js";import"./chunk-7CGTOI24.js";var T=class s{#e=new Map;saveState(t){let e=crypto.randomUUID();return this.#e.set(e,t),e}getState(t){return this.#e.get(t)}static \u0275fac=function(e){return new(e||s)};static \u0275prov=b({token:s,factory:s.\u0275fac,providedIn:"root"})};var Ie=()=>["backup"];function Me(s,t){s&1&&a(0,"sh-progress-bar",11)}function Oe(s,t){if(s&1&&(l(0,"sh-form-field"),a(1,"input",35),o()),s&2){let e=t.$implicit,n=t.$index;u(),F("id",H("filter-",n))("formControl",e)}}function De(s,t){if(s&1){let e=v();l(0,"form",12)(1,"sh-select",13)(2,"label",14),p(3,1),a(4,"sh-icon",15),C(),o(),a(5,"input",16),o(),l(6,"sh-form-field")(7,"label",17),p(8,2),a(9,"sh-icon",18),C(),o(),a(10,"textarea",19),o(),l(11,"sh-form-field")(12,"label",20),p(13,3),a(14,"sh-icon",21),C(),o(),a(15,"textarea",22),o()(),l(16,"sh-divider"),O(17,4),o(),l(18,"form",12)(19,"sh-form-field")(20,"label",23),p(21,5),a(22,"sh-icon",24),C(),o(),a(23,"input",25),o(),l(24,"sh-form-field")(25,"label",26),p(26,6),a(27,"sh-icon",27),C(),o(),a(28,"input",28),o(),l(29,"app-toggle-card",29),I(30,30),O(31,7),M(),I(32,31),y(33,Oe,2,3,"sh-form-field",null,B),M(),o()(),l(35,"app-options-list",32),V("optionsChange",function(r){E(e);let m=N();return q(m.settings,r)||(m.settings=r),f(r)}),o(),l(36,"div",33)(37,"button",34),K("click",function(){E(e);let r=N();return f(r.submit())}),p(38,8),a(39,"sh-icon"),C(),o()()}if(s&2){let e=N();F("formGroup",e.baseCmdForm),u(),F("options",e.commandOptions()??j(10,Ie))("inlineSearch",!0),u(17),F("formGroup",e.standardFields),u(11),F("disableToggle",!0),u(4),U(e.standardFields.controls.filters.controls),u(2),X("options",e.settings),F("hasFreeTextSettings",!0),u(2),J("loading",e.isSubmitting()),u(2),x(e.baseCmdForm.value.command),w(38)}}var c=new re,P=class s{#e=_(A);#n=_(Se);#o=_(Q);#t=_(W);#a=_(Fe);#s=_(he);#i=_(T);#r=D(this.#t.params);commandOptions=D(this.#a.getApiV1Commandline());isSubmitting=L(!1);optionsFields=this.#e.optionsFields;standardFields=c.group({"backup-id":c.control(""),"backup-name":c.control(""),dbpath:c.control(""),filters:c.array([])});baseCmdForm=c.group({command:c.control("backup"),targetUrl:c.control(""),arguments:c.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;settings=this.#e.settings;#c=$(()=>{let t=this.#r()?.id;this.#e.backupId.set(t),this.getBackup(t)});getBackup(t){this.#n.getApiV1BackupById({id:t}).subscribe({next:e=>{this.#e.mapScheduleToForm(e.Schedule??null),e.Backup&&(this.#e.mapGeneralToForm(e.Backup),this.mapStandardFieldsToForm(e.Backup),this.mapBaseCmdToForm(e.Backup),this.#e.mapOptionsToForms(e.Backup,!0)),this.applyStateFromUrl(),this.#e.finishedLoading.set(!0)}})}mapStandardFieldsToForm(t){this.standardFields.patchValue({dbpath:t.DBPath,"backup-id":t.ID,"backup-name":t.Name}),t.Filters&&t.Filters.length&&t.Filters.map(e=>{this.standardFields.controls.filters.push(c.control(`${e.Include?"":"-"}${e.Expression}`))})}submit(){this.#s.resumeDialogCheck(()=>this.#l())}#l(){this.isSubmitting.set(!0);let t=this.updateUrl(),e=this.baseCmdForm.value,n=e.targetUrl??"",r=(e.arguments??"").split(`
|
|
2
2
|
`)??[],m=[n,...r].filter(i=>i.length>0),g=this.standardFields.value,S=g.filters??[],h=[e.command,...m,`--backup-name=${g["backup-name"]}`,`--dbpath=${g.dbpath}`,`--backup-id=${g["backup-id"]}`,...S.filter(i=>i).map(i=>i.startsWith("-")?`--exclude=${i?.slice(1)}`:`--include=${i}`),...this.#e.mapFormsToSettings(["backup-id","backup-name","dbpath"]).map(i=>`${i.Name.startsWith("--")?"":"--"}${i.Name}=${i.Value}`),"--disable-module=console-password-input"];this.#n.postApiV1Commandline({requestBody:h}).subscribe({next:i=>{i.Status==="OK"&&this.#o.navigate(["backup",this.backupId(),"commandline",i.ID],{queryParams:{state:t}})},error:()=>{this.isSubmitting.set(!1)}})}mapBaseCmdToForm(t){let e=t.TargetURL??null;e&&this.baseCmdForm.patchValue({targetUrl:e??"",arguments:t.Sources?.join(`
|
|
3
3
|
`)??""})}updateUrl(){let t=this.baseCmdForm.value,e=this.standardFields.value,n=e.filters??[],r=this.settings(),m=this.#i.saveState({command:t.command,targetUrl:t.targetUrl,arguments:t.arguments,backupId:e["backup-id"],backupName:e["backup-name"],dbpath:e.dbpath,filters:n,options:r});return this.#o.navigate([],{relativeTo:this.#t,queryParams:{state:m},replaceUrl:!0}),m}applyStateFromUrl(){let e=this.#t.snapshot.queryParams.state;if(!e)return;let n=this.#i.getState(e);n&&(this.baseCmdForm.patchValue({command:n.command,targetUrl:n.targetUrl,arguments:n.arguments}),this.standardFields.patchValue({"backup-id":n.backupId,"backup-name":n.backupName,dbpath:n.dbpath}),n.filters&&(this.standardFields.controls.filters.clear(),n.filters.forEach(r=>{this.standardFields.controls.filters.push(c.control(r))})),n.options&&n.options.length>0&&this.settings.set(n.options))}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=R({type:s,selectors:[["app-commandline"]],features:[z([A])],decls:8,vars:1,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let e;e=$localize` Command ${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let n;n=$localize` TargetUrl ${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON:`;let r;r=$localize` Commandline Arguments ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`;let m;m=$localize`Advanced options`;let g;g=$localize` Backup ID ${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON:`;let S;S=$localize` Backup Name ${"\uFFFD#27\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#27\uFFFD"}:CLOSE_TAG_SH_ICON:`;let h;h=$localize`Filters`;let i;return i=$localize`${"\uFFFD#39\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#39\uFFFD"}:CLOSE_TAG_SH_ICON: Run "${"\uFFFD0\uFFFD"}:INTERPOLATION:" command now `,[t,e,n,r,m,g,S,h,i,[1,"back"],["type","button","shButton","","routerLink","/",1,"small"],[1,"indeterminate","primary"],[3,"formGroup"],["placeholder","Select a command...",3,"options","inlineSearch"],["for","command"],["shTooltip","Choose the command to execute"],["type","text","id","command","formControlName","command"],["for","targetUrl"],["shTooltip","Enter the URL of the backup target"],["id","targetUrl","autocomplete","off","formControlName","targetUrl"],["for","arguments"],["shTooltip","Enter one argument per line without quotes (e.g., *.txt)"],["id","arguments","autocomplete","off","rows","5","formControlName","arguments","placeholder","Enter one argument per line without quotes (e.g., *.txt)",1,"arguments"],["for","backup-id"],["shTooltip","The ID of the backup configuration this run belongs to (can be empty)"],["id","backup-id","formControlName","backup-id"],["for","backup-name"],["shTooltip","The optional name of the backup"],["id","backup-name","formControlName","backup-name"],[3,"disableToggle"],["title",""],["content","","formGroupName","filters"],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","",1,"raised","primary",3,"click"],[3,"id","formControl"]]},template:function(e,n){e&1&&(a(0,"app-status-bar"),l(1,"section")(2,"div",9)(3,"button",10),p(4,0),a(5,"sh-icon"),C(),o()(),k(6,Me,1,0,"sh-progress-bar",11)(7,De,40,11),o()),e&2&&(u(6),G(n.finishedLoading()?7:6))},dependencies:[le,ne,Z,ee,te,Ne,Ee,Te,ce,oe,se,ae,ie,Y,_e,ue,de,Ce,pe,me,ge],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;max-width:40rem;padding:2.5rem;gap:1.25rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.arguments[_ngcontent-%COMP%]{min-height:6rem;white-space:pre}"],changeDetection:0})};export{P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as tt}from"./chunk-TZEOQBIX.js";import{k as Ze,m as et}from"./chunk-DFVPFPMV.js";import{a as re}from"./chunk-OO32MPRQ.js";import{a as Ke}from"./chunk-MRSBKQQM.js";import{a as M}from"./chunk-35APLYI4.js";import{b as _e}from"./chunk-ZXQSQRKN.js";import{b as Qe}from"./chunk-XZNYCTQB.js";import{a as K}from"./chunk-R6TFME5I.js";import{B as j,H as Xe,L as Ue,M as Ye,P as He,V as je,W as qe,b as Be,c as W,e as B,f as V,i as Ve,j as z,l as ze,p as J,q as X,r as U,s as Je,t as Y,v as H,z as se}from"./chunk-NCXKMSRH.js";import{d as q}from"./chunk-QAQMMCTH.js";import{b as P,d as I}from"./chunk-KHZ5AXGT.js";import{ha as ne}from"./chunk-BDQJFOCO.js";import{$b as C,A as Ie,Ac as xe,Bc as ke,Cb as S,D as Q,Db as r,Eb as a,F as h,Fb as c,Gc as le,Hc as we,I as Me,Ic as We,Jb as b,Kb as A,L as De,M as ee,Mb as w,Rc as N,Sa as d,Tb as m,Ub as T,V as Le,Vb as O,Wb as $e,Xb as be,Zb as f,_ as p,da as y,ea as $,g as Re,gb as k,kc as Ae,lb as ye,m as he,nc as v,pa as u,pc as ve,qc as Ge,ra as x,sc as te,tc as oe,uc as ie,w as ae,wb as g,x as Pe,xb as E}from"./chunk-UH2E7MMT.js";function lt(n,t){n&1&&(r(0,"p"),O(1,3),a())}function _t(n,t){n&1&&(r(0,"sh-form-field")(1,"label",11),O(2,4),a(),c(3,"input",12),a())}var ot=new U,st=()=>ot.group({passphrase:ot.control("")}),ue=class n{#e=p(q);#t=p(D);#n=p(I);#i=p(P);encryptionForm=this.#t.encryptionForm;creatingTemporaryBackup=u(!1);settings=u([]);hasEncryptedBackup=N(()=>{let t=this.#t.destinationTestSignal();return t==="testing"||typeof t=="string"?!0:t?.containsEncryptedBackupFiles??!0});showEncryptionField=u(!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(i=>{let s=i.Name?.trim();s&&s!=="--"&&(s.startsWith("--")||(s=`--${s}`),o.push({Name:s,Value:i.Value??""}))}),this.#e.postApiV1Backups({requestBody:{Backup:{TargetURL:t,Settings:o}},temporary:!0}).pipe(h(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:i=>{let s=i.ID;this.#n.navigate([`/restore-draft/${s}`])},error:i=>{console.error(i)}})}back(){this.#t.isFileRestore()?this.#n.navigate(["destination"],{relativeTo:this.#i.parent}):this.#t.exit()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=k({type:n,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 i;i=$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,i,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),f("submit",function(){return o.next()}),g(1,lt,2,0,"p"),g(2,_t,4,0,"sh-form-field"),r(3,"sh-toggle-card"),b(4,6),O(5,0),A(),r(6,"app-options-list",7),ie("optionsChange",function(s){return oe(o.settings,s)||(o.settings=s),s}),a()(),r(7,"div",8)(8,"button",9),f("click",function(){return o.back()}),m(9,1),c(10,"sh-icon"),T(),a(),r(11,"button",10),m(12,2),c(13,"sh-icon"),T(),a()()()),e&2&&(S("formGroup",o.encryptionForm),d(),E(o.hasEncryptedBackup()?-1:1),d(),E(o.hasEncryptedBackup()||o.showEncryptionField()?2:-1),d(4),te("options",o.settings),S("hasFreeTextSettings",!0))},dependencies:[Y,z,W,B,V,X,J,Xe,H,j,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 ut=()=>({standalone:!0});function ct(n,t){n&1&&c(0,"sh-progress-bar",8)}function pt(n,t){if(n&1&&(v(0),le(1,"bytes")),n&2){let e=C().$implicit;ve(" (",we(1,1,e.FileSizes),") ")}}function dt(n,t){n&1&&(r(0,"span",16),O(1,4),a())}function mt(n,t){if(n&1&&(r(0,"div",15),v(1),le(2,"date"),g(3,pt,2,3),g(4,dt,2,0,"span",16),a()),n&2){let e=t.$implicit;d(),Ge(" ",e.Version,": ",We(2,4,e.Time,"medium")," "),d(2),E(e.FileSizes?3:-1),d(),E(e.IsFullBackup===!1?4:-1)}}function Tt(n,t){n&1&&c(0,"sh-progress-bar",8)}function Ft(n,t){if(n&1){let e=w();r(0,"app-file-tree",17),f("hasExtendedData",function(i){y(e);let s=C(2);return $(s.extendedDataType.set(i))}),r(1,"label",18),O(2,5),a(),c(3,"input",19),a()}if(n&2){let e=C(2);S("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)("loadExtendedData",!0)}}function St(n,t){if(n&1){let e=w();r(0,"sh-select",12),f("cleared",function(){y(e);let i=C();return $(i.abortLoading())}),r(1,"input",13),ie("ngModelChange",function(i){y(e);let s=C();return oe(s.selectOption,i)||(s.selectOption=i),$(i)}),a(),ye(2,mt,5,7,"ng-template"),a(),g(3,Tt,1,0,"sh-progress-bar",8),g(4,Ft,4,6,"app-file-tree",14)}if(n&2){let e=C();S("options",e.versionOptions())("isClearable",!1),d(),te("ngModel",e.selectOption),S("ngModelOptions",ke(6,ut)),d(2),E(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),d(),E(e.showFileTree()?4:-1)}}var pe=new U,rt=()=>pe.group({filesToRestore:pe.control(""),passphrase:pe.control(null)}),de=class n{#e=p(q);#t=p(D);#n=p(Qe);#i=p(K);#o=p(I);#s=p(P);#a=p(ne);#l=null;#_=null;#r=u([]);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=N(()=>this.#t.backup()?.Backup?.IsTemporary??!0);showFileTree=u(!1);backupSettings=u(null);rootPaths=u([]);initialNodes=u([]);loadingRootPath=u(!1);isRepairing=N(()=>this.#r().length>0);loadedVersions=u({});loadingEffect=x(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let o=e[0].Version;this.selectOption.set(o.toString())}});backupSettingsEffect=x(()=>{let t=this.backupId(),e=this.selectOption(),o=this.isRepairing(),i=this.loadedVersions();if(!e||!t)return;let l=this.versionOptions()?.find(Z=>Z.Version===parseInt(e))?.Time??null;if(!l)return;let _=`${t}+${l}`,R=i[_];if(this.needsDatabaseRepair()&&(!R||o))return;let L={id:t+"",time:l};this.backupSettings.set(L),this.getRootPath(L)});repairEffect=x(()=>{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 i=this.backupId(),s=`${i}+${o.Time}`;if(this.#_===s||(this.#_=s,this.#r().includes(s)))return;this.#r.update(l=>[...l,s]),this.#e.postApiV1BackupByIdRepairupdate({id:i,requestBody:{only_paths:!0,time:o.Time}}).pipe(ee(this.abortLoading$),h(()=>{this.#_=null})).subscribe(l=>{let _=l.ID;this.#n.waitForTaskToComplete(_).pipe(Q(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.#i.hasV2ListOperations()?this.#e.postApiV2BackupListFolder({requestBody:{BackupId:t.id,Time:t.time,Paths:null,PageSize:0,Page:0,ReturnExtended:!0}}).pipe(ee(this.abortLoading$),h(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#l=null})).subscribe({next:i=>{let s=(i.Data??[]).find(_=>_.Metadata&&_.Metadata.ExtType&&_.Metadata.ExtType.length>0);s&&this.extendedDataType.set(s.Metadata.ExtType);let l=(i.Data??[]).map(_=>_.Path??"");l.length>0?(this.initialNodes.set([]),this.rootPaths.set(l)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#e.getApiV1BackupByIdFiles(e).pipe(ee(this.abortLoading$),h(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:i=>{let s=i.Files.map(l=>l.Path??"");s.length>0?(this.initialNodes.set([]),this.rootPaths.set(s)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new Re;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(i=>typeof i.Version=="number"&&i.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()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=k({type:n,selectors:[["app-select-files"]],features:[xe([ne])],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 i;i=$localize`Select an option...`;let s;s=$localize`(partial)`;let l;return l=$localize`Path`,[["formRef",""],t,e,o,s,l,[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",i,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","initialNodes","backupSettings","multiSelect","showFiles","loadExtendedData"],[1,"custom-option"],[1,"partial"],[3,"hasExtendedData","rootPaths","initialNodes","backupSettings","multiSelect","showFiles","loadExtendedData"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,o){e&1&&(r(0,"form",6,0),f("submit",function(){return o.next()}),r(2,"h3",7),O(3,1),a(),g(4,ct,1,0,"sh-progress-bar",8)(5,St,5,7),r(6,"div",9)(7,"button",10),f("click",function(){return o.back()}),m(8,2),c(9,"sh-icon"),T(),a(),r(10,"button",11),m(11,3),c(12,"sh-icon"),T(),a()()()),e&2&&(S("formGroup",o.selectFilesForm),d(4),E(o.versionOptionsLoading()?4:5),d(5),$e(o.isFileRestore()?"Back":"Exit"),be(8))},dependencies:[Je,z,W,B,V,Ve,Y,X,J,re,j,H,He,Ue,ne,Ke],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}"],changeDetection:0})};var D=class n{#e=p(I);#t=p(P);#n=p(K);#i=p(se);#o=p(q);backupId=u(null);backup=u(null);destinationTargetUrl=u(null);destinationTestSignal=u(null);selectFilesForm=rt();optionsForm=at();encryptionForm=st();optionsFormSignal=_e(this.optionsForm.valueChanges);selectFilesFormSignal=_e(this.selectFilesForm.valueChanges);selectOption=u(null);versionOptionsLoading=u(!1);versionOptions=u([]);isSubmitting=u(!1);isFileRestore=u(!1);isFullWidthPage=u(!1);extendedDataType=u(null);alternateRestorePath=u(null);alternateRestorePathSourcePrefix=u(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.#i.open(M,{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,i=this.selectOption(),s=this.versionOptions()?.find(l=>l.Version===(i&&parseInt(i)));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(h(()=>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.#i.open(M,{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(Ie(o=>{let i=o?.error?.body?.StatusCode??o?.error?.requestBody?.StatusCode;return i==="EncryptedStorageNoPassphrase"||i==="FolderMissing"||i==="EmptyRemoteFolder"||e===0?he(()=>o):Pe(1e3).pipe(De(()=>this.loadFilesetsWithRetryv2(t,e-1)))}))}getBackup(){let t=this.backupId();this.versionOptionsLoading.set(!0),this.#n.hasV2ListOperations()?ae([this.#o.getApiV1BackupById({id:t}),this.loadFilesetsWithRetryv2(t)]).pipe(Q(1),h(()=>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.#i.open(M,{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,i=o==="EncryptedStorageNoPassphrase",s=o==="FolderMissing",l=o==="EmptyRemoteFolder",_=$localize`An error occurred while loading the backup filesets: ${e.message}`;i&&(_=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),s&&(_=$localize`The backup storage folder was not found.`),l&&(_=$localize`The backup storage folder does not contain any filesets.`),this.#i.open(M,{data:{title:$localize`Failed to load backup filesets`,message:_,confirmText:$localize`OK`,cancelText:void 0},closed:R=>{this.#e.navigate([i?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):ae([this.#o.getApiV1BackupById({id:t}),this.#o.getApiV1BackupByIdFilesets({id:t}).pipe(Me(3))]).pipe(Q(1),h(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,o])=>{this.versionOptions.set(o.map(i=>({Version:i.Version??-1,IsFullBackup:(i.IsFullBackup??1)==1,Time:i.Time??"<missing>",FileCount:i.FileCount??void 0,FileSizes:i.FileSizes??void 0}))),this.backup.set(e)}})}#a(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||n)};static \u0275prov=Le({token:n,factory:n.\u0275fac,providedIn:"root"})};function gt(n,t){if(n&1){let e=w();r(0,"sh-radio",27),m(1,6),c(2,"input",31),T(),a(),r(3,"sh-radio",27),m(4,7),r(5,"input",32),f("click",function(){y(e);let i=C(2);return $(i.chooseCustomRemoteDestination())}),a(),T(),a()}}function Et(n,t){if(n&1){let e=w();r(0,"sh-radio",27),m(1,8),c(2,"input",31),T(),a(),r(3,"sh-radio",27),m(4,9),r(5,"input",32),f("click",function(){y(e);let i=C(2);return $(i.chooseCustomRemoteDestination())}),a(),T(),a()}}function Ot(n,t){if(n&1&&(r(0,"app-file-tree",29)(1,"label",33),v(2,"Path"),a(),c(3,"input",34),a()),n&2){let e,o=C(2);S("disabled",((e=o.optionsFormSignal())==null?null:e.restoreFrom)!=="pickLocation")("enableCreateFolder",!0)}}function Ct(n,t){if(n&1&&(r(0,"app-file-tree",30)(1,"label",33),v(2,"Path"),a(),c(3,"input",34),a()),n&2){let e=C(2);S("customRemoteMode",e.extendedDataType())("backupId",e.backupId())("sourcePrefix",e.remoteCustomSourcePrefix())("destinationUrl",e.customDestinationUrl())}}function Nt(n,t){if(n&1&&(g(0,gt,6,0)(1,Et,6,0),r(2,"sh-radio",27),m(3,5),c(4,"input",28),T(),a(),g(5,Ot,4,2,"app-file-tree",29),g(6,Ct,4,4,"app-file-tree",30)),n&2){let e,o=C();E(o.extendedDataType()==="o365"?0:o.extendedDataType()==="gsuite"?1:-1),d(5),E(((e=o.optionsFormSignal())==null?null:e.restoreFrom)==="pickLocation"?5:-1),d(),E(o.showCustomRemoteRestoreTree()?6:-1)}}function ft(n,t){if(n&1&&(r(0,"sh-radio",27),m(1,10),c(2,"input",35),T(),a(),r(3,"sh-radio",27),m(4,11),c(5,"input",28),T(),a(),r(6,"app-file-tree",29)(7,"label",33),v(8,"Path"),a(),c(9,"input",34),a()),n&2){let e,o=C();d(6),S("disabled",((e=o.optionsFormSignal())==null?null:e.restoreFrom)!=="pickLocation")("enableCreateFolder",!0)}}function Rt(n,t){n&1&&(r(0,"app-toggle-card",22),b(1,23),O(2,12),A(),r(3,"sh-toggle",27),m(4,13),c(5,"input",36),T(),a()()),n&2&&S("disableToggle",!0)}function ht(n,t){n&1&&(r(0,"app-toggle-card",22),b(1,23),O(2,14),A(),r(3,"sh-radio",27),m(4,15),c(5,"input",37),T(),a(),r(6,"sh-radio",27),m(7,16),c(8,"input",38),T(),a()(),r(9,"app-toggle-card"),b(10,23),O(11,17),A(),r(12,"sh-toggle",39),m(13,18),c(14,"input",40),T(),a(),r(15,"sh-toggle",39),m(16,19),c(17,"input",41),T(),a()()),n&2&&S("disableToggle",!0)}var G=new U,at=()=>G.group({restoreFrom:G.control("original"),restoreFromPath:G.control(""),handleExisting:G.control("saveTimestamp"),permissions:G.control(!1),includeMetadata:G.control(!0),customRemoteIgnoreExisting:G.control(!1)}),me=class n{#e=p(D);#t=p(I);#n=p(P);#i=p(K);#o=p(se);optionsForm=this.#e.optionsForm;optionsFormSignal=this.#e.optionsFormSignal;isSubmitting=this.#e.isSubmitting;extendedData=this.#e.extendedDataType;remoteCustomTargetUrl=u(null);backupId=N(()=>this.#e.backup()?.Backup?.ID??null);extendedDataType=N(()=>{let t=this.#e.extendedDataType();return t==="o365"?"o365":t==="gsuite"?"gsuite":null});remoteCustomSourceEntry=N(()=>this.#e.backup()?.Backup?.Sources?.filter(t=>t.startsWith("@")&&(t.includes("|office365://")||t.includes("|googleworkspace://")))[0]??null);remoteCustomSourceUrl=N(()=>this.remoteCustomSourceEntry()?.split("|")[1]??null);remoteCustomSourcePrefix=N(()=>this.remoteCustomSourceEntry()?.split("|")[0]??null);customDestinationUrl=N(()=>{let t=this.optionsFormSignal()?.restoreFrom,e=this.extendedDataType()!==null;return t==="same-custom"&&e?this.remoteCustomSourceUrl():t==="other-custom"&&e?this.remoteCustomTargetUrl():null});showCustomRemoteRestoreTree=N(()=>!!(this.optionsFormSignal()?.restoreFrom==="same-custom"&&this.customDestinationUrl()&&this.backupId()||this.optionsFormSignal()?.restoreFrom==="other-custom"&&this.customDestinationUrl()));isCustomRemoteRestore=N(()=>{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=x(()=>{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.#n.parent})}submit(){let t=this.#e.selectFilesFormSignal()?.filesToRestore??[];if(t.length>0&&this.optionsFormSignal()?.restoreFrom=="original"&&(t[0].includes("/")?"/":"\\")!==this.#i.systemInfo()?.DirectorySeparator){this.#o.open(M,{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:i=>{i&&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(M,{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 i=this.optionsFormSignal()?.customRemoteIgnoreExisting,s=this.customDestinationUrl()?.substring(this.customDestinationUrl().indexOf("?")),l=this.extendedDataType()==="gsuite"?`@googleworkspace://${encodeURIComponent(o)}${s}&google-ignore-existing=${i?"true":"false"}`:`@office365://${encodeURIComponent(o)}${s}&office365-ignore-existing=${i?"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||n)};static \u0275cmp=k({type:n,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 i;i=$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 _;_=$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 L;L=$localize` Different Google Workspace Account ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let Z;Z=$localize` Original location ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let Te;Te=$localize` Pick location ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let Fe;Fe=$localize`Restore settings`;let Se;Se=$localize` Ignore existing resources in the destination ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let ge;ge=$localize`How do you want to handle existing files?`;let Ee;Ee=$localize` Overwrite ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let Oe;Oe=$localize` Save different versions with timestamp in file name ${"\uFFFD#8\uFFFD\uFFFD/#8\uFFFD"}:TAG_INPUT:`;let Ce;Ce=$localize`Metadata settings`;let Ne;Ne=$localize` Restore file metadata ${"\uFFFD#14\uFFFD\uFFFD/#14\uFFFD"}:TAG_INPUT:`;let fe;return fe=$localize` Restore read/write permissions ${"\uFFFD#17\uFFFD\uFFFD/#17\uFFFD"}:TAG_INPUT:`,[["formRef",""],t,e,o,i,s,l,_,R,L,Z,Te,Fe,Se,ge,Ee,Oe,Ce,Ne,fe,[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),f("submit",function(){return o.submit()}),r(2,"h3",21),O(3,1),a(),r(4,"app-toggle-card",22),b(5,23),O(6,2),A(),g(7,Nt,7,3)(8,ft,10,2),a(),g(9,Rt,6,1,"app-toggle-card",22)(10,ht,18,1),r(11,"div",24)(12,"button",25),f("click",function(){return o.goBack()}),m(13,3),c(14,"sh-icon"),T(),a(),r(15,"button",26),m(16,4),c(17,"sh-icon"),T(),a()()()),e&2&&(S("formGroup",o.optionsForm),d(4),S("disableToggle",!0),d(3),E(o.extendedDataType()!==null?7:8),d(2),E(o.isCustomRemoteRestore()?9:10),d(6),Ae("loading",o.isSubmitting()))},dependencies:[Y,z,W,Be,ze,B,V,X,J,Ze,re,qe,Ye,j,H],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{at as a,me as b,st as c,ue as d,rt as e,de as f,D as g};
|
|
1
|
+
import{a as tt}from"./chunk-TZEOQBIX.js";import{k as Ze,m as et}from"./chunk-Y3YNTMT5.js";import{a as re}from"./chunk-OO32MPRQ.js";import{a as Ke}from"./chunk-MRSBKQQM.js";import{a as M}from"./chunk-35APLYI4.js";import{b as _e}from"./chunk-ZXQSQRKN.js";import{b as Qe}from"./chunk-XZNYCTQB.js";import{a as K}from"./chunk-R6TFME5I.js";import{B as j,H as Xe,L as Ue,M as Ye,P as He,V as je,W as qe,b as Be,c as W,e as B,f as V,i as Ve,j as z,l as ze,p as J,q as X,r as U,s as Je,t as Y,v as H,z as se}from"./chunk-NCXKMSRH.js";import{d as q}from"./chunk-QAQMMCTH.js";import{b as P,d as I}from"./chunk-KHZ5AXGT.js";import{ha as ne}from"./chunk-BDQJFOCO.js";import{$b as C,A as Ie,Ac as xe,Bc as ke,Cb as S,D as Q,Db as r,Eb as a,F as h,Fb as c,Gc as le,Hc as we,I as Me,Ic as We,Jb as b,Kb as A,L as De,M as ee,Mb as w,Rc as N,Sa as d,Tb as m,Ub as T,V as Le,Vb as O,Wb as $e,Xb as be,Zb as f,_ as p,da as y,ea as $,g as Re,gb as k,kc as Ae,lb as ye,m as he,nc as v,pa as u,pc as ve,qc as Ge,ra as x,sc as te,tc as oe,uc as ie,w as ae,wb as g,x as Pe,xb as E}from"./chunk-UH2E7MMT.js";function lt(n,t){n&1&&(r(0,"p"),O(1,3),a())}function _t(n,t){n&1&&(r(0,"sh-form-field")(1,"label",11),O(2,4),a(),c(3,"input",12),a())}var ot=new U,st=()=>ot.group({passphrase:ot.control("")}),ue=class n{#e=p(q);#t=p(D);#n=p(I);#i=p(P);encryptionForm=this.#t.encryptionForm;creatingTemporaryBackup=u(!1);settings=u([]);hasEncryptedBackup=N(()=>{let t=this.#t.destinationTestSignal();return t==="testing"||typeof t=="string"?!0:t?.containsEncryptedBackupFiles??!0});showEncryptionField=u(!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(i=>{let s=i.Name?.trim();s&&s!=="--"&&(s.startsWith("--")||(s=`--${s}`),o.push({Name:s,Value:i.Value??""}))}),this.#e.postApiV1Backups({requestBody:{Backup:{TargetURL:t,Settings:o}},temporary:!0}).pipe(h(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:i=>{let s=i.ID;this.#n.navigate([`/restore-draft/${s}`])},error:i=>{console.error(i)}})}back(){this.#t.isFileRestore()?this.#n.navigate(["destination"],{relativeTo:this.#i.parent}):this.#t.exit()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=k({type:n,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 i;i=$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,i,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),f("submit",function(){return o.next()}),g(1,lt,2,0,"p"),g(2,_t,4,0,"sh-form-field"),r(3,"sh-toggle-card"),b(4,6),O(5,0),A(),r(6,"app-options-list",7),ie("optionsChange",function(s){return oe(o.settings,s)||(o.settings=s),s}),a()(),r(7,"div",8)(8,"button",9),f("click",function(){return o.back()}),m(9,1),c(10,"sh-icon"),T(),a(),r(11,"button",10),m(12,2),c(13,"sh-icon"),T(),a()()()),e&2&&(S("formGroup",o.encryptionForm),d(),E(o.hasEncryptedBackup()?-1:1),d(),E(o.hasEncryptedBackup()||o.showEncryptionField()?2:-1),d(4),te("options",o.settings),S("hasFreeTextSettings",!0))},dependencies:[Y,z,W,B,V,X,J,Xe,H,j,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 ut=()=>({standalone:!0});function ct(n,t){n&1&&c(0,"sh-progress-bar",8)}function pt(n,t){if(n&1&&(v(0),le(1,"bytes")),n&2){let e=C().$implicit;ve(" (",we(1,1,e.FileSizes),") ")}}function dt(n,t){n&1&&(r(0,"span",16),O(1,4),a())}function mt(n,t){if(n&1&&(r(0,"div",15),v(1),le(2,"date"),g(3,pt,2,3),g(4,dt,2,0,"span",16),a()),n&2){let e=t.$implicit;d(),Ge(" ",e.Version,": ",We(2,4,e.Time,"medium")," "),d(2),E(e.FileSizes?3:-1),d(),E(e.IsFullBackup===!1?4:-1)}}function Tt(n,t){n&1&&c(0,"sh-progress-bar",8)}function Ft(n,t){if(n&1){let e=w();r(0,"app-file-tree",17),f("hasExtendedData",function(i){y(e);let s=C(2);return $(s.extendedDataType.set(i))}),r(1,"label",18),O(2,5),a(),c(3,"input",19),a()}if(n&2){let e=C(2);S("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)("loadExtendedData",!0)}}function St(n,t){if(n&1){let e=w();r(0,"sh-select",12),f("cleared",function(){y(e);let i=C();return $(i.abortLoading())}),r(1,"input",13),ie("ngModelChange",function(i){y(e);let s=C();return oe(s.selectOption,i)||(s.selectOption=i),$(i)}),a(),ye(2,mt,5,7,"ng-template"),a(),g(3,Tt,1,0,"sh-progress-bar",8),g(4,Ft,4,6,"app-file-tree",14)}if(n&2){let e=C();S("options",e.versionOptions())("isClearable",!1),d(),te("ngModel",e.selectOption),S("ngModelOptions",ke(6,ut)),d(2),E(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),d(),E(e.showFileTree()?4:-1)}}var pe=new U,rt=()=>pe.group({filesToRestore:pe.control(""),passphrase:pe.control(null)}),de=class n{#e=p(q);#t=p(D);#n=p(Qe);#i=p(K);#o=p(I);#s=p(P);#a=p(ne);#l=null;#_=null;#r=u([]);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=N(()=>this.#t.backup()?.Backup?.IsTemporary??!0);showFileTree=u(!1);backupSettings=u(null);rootPaths=u([]);initialNodes=u([]);loadingRootPath=u(!1);isRepairing=N(()=>this.#r().length>0);loadedVersions=u({});loadingEffect=x(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let o=e[0].Version;this.selectOption.set(o.toString())}});backupSettingsEffect=x(()=>{let t=this.backupId(),e=this.selectOption(),o=this.isRepairing(),i=this.loadedVersions();if(!e||!t)return;let l=this.versionOptions()?.find(Z=>Z.Version===parseInt(e))?.Time??null;if(!l)return;let _=`${t}+${l}`,R=i[_];if(this.needsDatabaseRepair()&&(!R||o))return;let L={id:t+"",time:l};this.backupSettings.set(L),this.getRootPath(L)});repairEffect=x(()=>{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 i=this.backupId(),s=`${i}+${o.Time}`;if(this.#_===s||(this.#_=s,this.#r().includes(s)))return;this.#r.update(l=>[...l,s]),this.#e.postApiV1BackupByIdRepairupdate({id:i,requestBody:{only_paths:!0,time:o.Time}}).pipe(ee(this.abortLoading$),h(()=>{this.#_=null})).subscribe(l=>{let _=l.ID;this.#n.waitForTaskToComplete(_).pipe(Q(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.#i.hasV2ListOperations()?this.#e.postApiV2BackupListFolder({requestBody:{BackupId:t.id,Time:t.time,Paths:null,PageSize:0,Page:0,ReturnExtended:!0}}).pipe(ee(this.abortLoading$),h(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#l=null})).subscribe({next:i=>{let s=(i.Data??[]).find(_=>_.Metadata&&_.Metadata.ExtType&&_.Metadata.ExtType.length>0);s&&this.extendedDataType.set(s.Metadata.ExtType);let l=(i.Data??[]).map(_=>_.Path??"");l.length>0?(this.initialNodes.set([]),this.rootPaths.set(l)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#e.getApiV1BackupByIdFiles(e).pipe(ee(this.abortLoading$),h(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:i=>{let s=i.Files.map(l=>l.Path??"");s.length>0?(this.initialNodes.set([]),this.rootPaths.set(s)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new Re;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(i=>typeof i.Version=="number"&&i.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()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=k({type:n,selectors:[["app-select-files"]],features:[xe([ne])],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 i;i=$localize`Select an option...`;let s;s=$localize`(partial)`;let l;return l=$localize`Path`,[["formRef",""],t,e,o,s,l,[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",i,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","initialNodes","backupSettings","multiSelect","showFiles","loadExtendedData"],[1,"custom-option"],[1,"partial"],[3,"hasExtendedData","rootPaths","initialNodes","backupSettings","multiSelect","showFiles","loadExtendedData"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,o){e&1&&(r(0,"form",6,0),f("submit",function(){return o.next()}),r(2,"h3",7),O(3,1),a(),g(4,ct,1,0,"sh-progress-bar",8)(5,St,5,7),r(6,"div",9)(7,"button",10),f("click",function(){return o.back()}),m(8,2),c(9,"sh-icon"),T(),a(),r(10,"button",11),m(11,3),c(12,"sh-icon"),T(),a()()()),e&2&&(S("formGroup",o.selectFilesForm),d(4),E(o.versionOptionsLoading()?4:5),d(5),$e(o.isFileRestore()?"Back":"Exit"),be(8))},dependencies:[Je,z,W,B,V,Ve,Y,X,J,re,j,H,He,Ue,ne,Ke],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}"],changeDetection:0})};var D=class n{#e=p(I);#t=p(P);#n=p(K);#i=p(se);#o=p(q);backupId=u(null);backup=u(null);destinationTargetUrl=u(null);destinationTestSignal=u(null);selectFilesForm=rt();optionsForm=at();encryptionForm=st();optionsFormSignal=_e(this.optionsForm.valueChanges);selectFilesFormSignal=_e(this.selectFilesForm.valueChanges);selectOption=u(null);versionOptionsLoading=u(!1);versionOptions=u([]);isSubmitting=u(!1);isFileRestore=u(!1);isFullWidthPage=u(!1);extendedDataType=u(null);alternateRestorePath=u(null);alternateRestorePathSourcePrefix=u(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.#i.open(M,{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,i=this.selectOption(),s=this.versionOptions()?.find(l=>l.Version===(i&&parseInt(i)));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(h(()=>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.#i.open(M,{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(Ie(o=>{let i=o?.error?.body?.StatusCode??o?.error?.requestBody?.StatusCode;return i==="EncryptedStorageNoPassphrase"||i==="FolderMissing"||i==="EmptyRemoteFolder"||e===0?he(()=>o):Pe(1e3).pipe(De(()=>this.loadFilesetsWithRetryv2(t,e-1)))}))}getBackup(){let t=this.backupId();this.versionOptionsLoading.set(!0),this.#n.hasV2ListOperations()?ae([this.#o.getApiV1BackupById({id:t}),this.loadFilesetsWithRetryv2(t)]).pipe(Q(1),h(()=>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.#i.open(M,{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,i=o==="EncryptedStorageNoPassphrase",s=o==="FolderMissing",l=o==="EmptyRemoteFolder",_=$localize`An error occurred while loading the backup filesets: ${e.message}`;i&&(_=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),s&&(_=$localize`The backup storage folder was not found.`),l&&(_=$localize`The backup storage folder does not contain any filesets.`),this.#i.open(M,{data:{title:$localize`Failed to load backup filesets`,message:_,confirmText:$localize`OK`,cancelText:void 0},closed:R=>{this.#e.navigate([i?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):ae([this.#o.getApiV1BackupById({id:t}),this.#o.getApiV1BackupByIdFilesets({id:t}).pipe(Me(3))]).pipe(Q(1),h(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,o])=>{this.versionOptions.set(o.map(i=>({Version:i.Version??-1,IsFullBackup:(i.IsFullBackup??1)==1,Time:i.Time??"<missing>",FileCount:i.FileCount??void 0,FileSizes:i.FileSizes??void 0}))),this.backup.set(e)}})}#a(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||n)};static \u0275prov=Le({token:n,factory:n.\u0275fac,providedIn:"root"})};function gt(n,t){if(n&1){let e=w();r(0,"sh-radio",27),m(1,6),c(2,"input",31),T(),a(),r(3,"sh-radio",27),m(4,7),r(5,"input",32),f("click",function(){y(e);let i=C(2);return $(i.chooseCustomRemoteDestination())}),a(),T(),a()}}function Et(n,t){if(n&1){let e=w();r(0,"sh-radio",27),m(1,8),c(2,"input",31),T(),a(),r(3,"sh-radio",27),m(4,9),r(5,"input",32),f("click",function(){y(e);let i=C(2);return $(i.chooseCustomRemoteDestination())}),a(),T(),a()}}function Ot(n,t){if(n&1&&(r(0,"app-file-tree",29)(1,"label",33),v(2,"Path"),a(),c(3,"input",34),a()),n&2){let e,o=C(2);S("disabled",((e=o.optionsFormSignal())==null?null:e.restoreFrom)!=="pickLocation")("enableCreateFolder",!0)}}function Ct(n,t){if(n&1&&(r(0,"app-file-tree",30)(1,"label",33),v(2,"Path"),a(),c(3,"input",34),a()),n&2){let e=C(2);S("customRemoteMode",e.extendedDataType())("backupId",e.backupId())("sourcePrefix",e.remoteCustomSourcePrefix())("destinationUrl",e.customDestinationUrl())}}function Nt(n,t){if(n&1&&(g(0,gt,6,0)(1,Et,6,0),r(2,"sh-radio",27),m(3,5),c(4,"input",28),T(),a(),g(5,Ot,4,2,"app-file-tree",29),g(6,Ct,4,4,"app-file-tree",30)),n&2){let e,o=C();E(o.extendedDataType()==="o365"?0:o.extendedDataType()==="gsuite"?1:-1),d(5),E(((e=o.optionsFormSignal())==null?null:e.restoreFrom)==="pickLocation"?5:-1),d(),E(o.showCustomRemoteRestoreTree()?6:-1)}}function ft(n,t){if(n&1&&(r(0,"sh-radio",27),m(1,10),c(2,"input",35),T(),a(),r(3,"sh-radio",27),m(4,11),c(5,"input",28),T(),a(),r(6,"app-file-tree",29)(7,"label",33),v(8,"Path"),a(),c(9,"input",34),a()),n&2){let e,o=C();d(6),S("disabled",((e=o.optionsFormSignal())==null?null:e.restoreFrom)!=="pickLocation")("enableCreateFolder",!0)}}function Rt(n,t){n&1&&(r(0,"app-toggle-card",22),b(1,23),O(2,12),A(),r(3,"sh-toggle",27),m(4,13),c(5,"input",36),T(),a()()),n&2&&S("disableToggle",!0)}function ht(n,t){n&1&&(r(0,"app-toggle-card",22),b(1,23),O(2,14),A(),r(3,"sh-radio",27),m(4,15),c(5,"input",37),T(),a(),r(6,"sh-radio",27),m(7,16),c(8,"input",38),T(),a()(),r(9,"app-toggle-card"),b(10,23),O(11,17),A(),r(12,"sh-toggle",39),m(13,18),c(14,"input",40),T(),a(),r(15,"sh-toggle",39),m(16,19),c(17,"input",41),T(),a()()),n&2&&S("disableToggle",!0)}var G=new U,at=()=>G.group({restoreFrom:G.control("original"),restoreFromPath:G.control(""),handleExisting:G.control("saveTimestamp"),permissions:G.control(!1),includeMetadata:G.control(!0),customRemoteIgnoreExisting:G.control(!1)}),me=class n{#e=p(D);#t=p(I);#n=p(P);#i=p(K);#o=p(se);optionsForm=this.#e.optionsForm;optionsFormSignal=this.#e.optionsFormSignal;isSubmitting=this.#e.isSubmitting;extendedData=this.#e.extendedDataType;remoteCustomTargetUrl=u(null);backupId=N(()=>this.#e.backup()?.Backup?.ID??null);extendedDataType=N(()=>{let t=this.#e.extendedDataType();return t==="o365"?"o365":t==="gsuite"?"gsuite":null});remoteCustomSourceEntry=N(()=>this.#e.backup()?.Backup?.Sources?.filter(t=>t.startsWith("@")&&(t.includes("|office365://")||t.includes("|googleworkspace://")))[0]??null);remoteCustomSourceUrl=N(()=>this.remoteCustomSourceEntry()?.split("|")[1]??null);remoteCustomSourcePrefix=N(()=>this.remoteCustomSourceEntry()?.split("|")[0]??null);customDestinationUrl=N(()=>{let t=this.optionsFormSignal()?.restoreFrom,e=this.extendedDataType()!==null;return t==="same-custom"&&e?this.remoteCustomSourceUrl():t==="other-custom"&&e?this.remoteCustomTargetUrl():null});showCustomRemoteRestoreTree=N(()=>!!(this.optionsFormSignal()?.restoreFrom==="same-custom"&&this.customDestinationUrl()&&this.backupId()||this.optionsFormSignal()?.restoreFrom==="other-custom"&&this.customDestinationUrl()));isCustomRemoteRestore=N(()=>{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=x(()=>{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.#n.parent})}submit(){let t=this.#e.selectFilesFormSignal()?.filesToRestore??[];if(t.length>0&&this.optionsFormSignal()?.restoreFrom=="original"&&(t[0].includes("/")?"/":"\\")!==this.#i.systemInfo()?.DirectorySeparator){this.#o.open(M,{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:i=>{i&&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(M,{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 i=this.optionsFormSignal()?.customRemoteIgnoreExisting,s=this.customDestinationUrl()?.substring(this.customDestinationUrl().indexOf("?")),l=this.extendedDataType()==="gsuite"?`@googleworkspace://${encodeURIComponent(o)}${s}&google-ignore-existing=${i?"true":"false"}`:`@office365://${encodeURIComponent(o)}${s}&office365-ignore-existing=${i?"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||n)};static \u0275cmp=k({type:n,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 i;i=$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 _;_=$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 L;L=$localize` Different Google Workspace Account ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let Z;Z=$localize` Original location ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let Te;Te=$localize` Pick location ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let Fe;Fe=$localize`Restore settings`;let Se;Se=$localize` Ignore existing resources in the destination ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let ge;ge=$localize`How do you want to handle existing files?`;let Ee;Ee=$localize` Overwrite ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let Oe;Oe=$localize` Save different versions with timestamp in file name ${"\uFFFD#8\uFFFD\uFFFD/#8\uFFFD"}:TAG_INPUT:`;let Ce;Ce=$localize`Metadata settings`;let Ne;Ne=$localize` Restore file metadata ${"\uFFFD#14\uFFFD\uFFFD/#14\uFFFD"}:TAG_INPUT:`;let fe;return fe=$localize` Restore read/write permissions ${"\uFFFD#17\uFFFD\uFFFD/#17\uFFFD"}:TAG_INPUT:`,[["formRef",""],t,e,o,i,s,l,_,R,L,Z,Te,Fe,Se,ge,Ee,Oe,Ce,Ne,fe,[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),f("submit",function(){return o.submit()}),r(2,"h3",21),O(3,1),a(),r(4,"app-toggle-card",22),b(5,23),O(6,2),A(),g(7,Nt,7,3)(8,ft,10,2),a(),g(9,Rt,6,1,"app-toggle-card",22)(10,ht,18,1),r(11,"div",24)(12,"button",25),f("click",function(){return o.goBack()}),m(13,3),c(14,"sh-icon"),T(),a(),r(15,"button",26),m(16,4),c(17,"sh-icon"),T(),a()()()),e&2&&(S("formGroup",o.optionsForm),d(4),S("disableToggle",!0),d(3),E(o.extendedDataType()!==null?7:8),d(2),E(o.isCustomRemoteRestore()?9:10),d(6),Ae("loading",o.isSubmitting()))},dependencies:[Y,z,W,Be,ze,B,V,X,J,Ze,re,qe,Ye,j,H],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{at as a,me as b,st as c,ue as d,rt as e,de as f,D as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
1
|
+
import{a,b}from"./chunk-HO6FQWDR.js";import"./chunk-TZEOQBIX.js";import"./chunk-Y3YNTMT5.js";import"./chunk-5L2OOKRZ.js";import"./chunk-OO32MPRQ.js";import"./chunk-OBF6ZSYT.js";import"./chunk-6Q6SSTBK.js";import"./chunk-MRSBKQQM.js";import"./chunk-7FDLOZXV.js";import"./chunk-EQNDYV43.js";import"./chunk-35APLYI4.js";import"./chunk-YMUS7QSB.js";import"./chunk-ZXQSQRKN.js";import"./chunk-XZNYCTQB.js";import"./chunk-R6TFME5I.js";import"./chunk-AZRNX5LU.js";import"./chunk-NCXKMSRH.js";import"./chunk-QAQMMCTH.js";import"./chunk-KHZ5AXGT.js";import"./chunk-L2QOWZDR.js";import"./chunk-BRL4YYWO.js";import"./chunk-BDQJFOCO.js";import"./chunk-FSHBOASN.js";import"./chunk-UH2E7MMT.js";import"./chunk-7CGTOI24.js";export{a as createRestoreOptionsForm,b as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-7PYUNUEY.js")},{path:"encryption",loadComponent:()=>import("./chunk-7YSKL3IG.js")},{path:"select-files",loadComponent:()=>import("./chunk-B3T2NEGO.js")},{path:"options",loadComponent:()=>import("./chunk-HYYZB4AS.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-B7CQXYTS.js")}],t=o;export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ne}from"./chunk-TZEOQBIX.js";import{p as ee}from"./chunk-
|
|
1
|
+
import{a as ne}from"./chunk-TZEOQBIX.js";import{p as ee}from"./chunk-Y3YNTMT5.js";import"./chunk-5L2OOKRZ.js";import{d as Z}from"./chunk-OO32MPRQ.js";import"./chunk-OBF6ZSYT.js";import"./chunk-6Q6SSTBK.js";import"./chunk-7FDLOZXV.js";import"./chunk-EQNDYV43.js";import"./chunk-35APLYI4.js";import"./chunk-YMUS7QSB.js";import"./chunk-ZXQSQRKN.js";import"./chunk-XZNYCTQB.js";import"./chunk-R6TFME5I.js";import"./chunk-AZRNX5LU.js";import{B as j,H as Q,P as q,c as X,e as W,i as z,k as V,s as H,v as Y}from"./chunk-NCXKMSRH.js";import"./chunk-QAQMMCTH.js";import{b as U,d as J}from"./chunk-KHZ5AXGT.js";import"./chunk-L2QOWZDR.js";import"./chunk-BRL4YYWO.js";import"./chunk-BDQJFOCO.js";import"./chunk-FSHBOASN.js";import{$b as c,Bc as D,Cb as m,Db as i,Eb as a,Fb as P,Mb as g,Sa as p,Tb as N,Ub as E,Vb as l,Yc as K,Zb as f,_ as C,da as O,ea as S,gb as $,gc as v,hc as B,kc as x,pa as w,sc as d,tc as T,uc as u,wb as L,xb as G}from"./chunk-UH2E7MMT.js";import"./chunk-7CGTOI24.js";var te=["formRef"],ie=()=>["--skip-files-larger-than","encryption-module","no-encryption","--no-encryption","compression-module","--exclude-files-attributes","keep-time","keep-versions","retention-policy"];function oe(s,r){s&1&&(i(0,"p"),l(1,4),a())}function ae(s,r){if(s&1){let n=g();i(0,"p"),l(1,5),a(),i(2,"app-timespan",21),u("ngModelChange",function(o){O(n);let t=c();return T(t.optionsFields.backupRetentionTime,o)||(t.optionsFields.backupRetentionTime=o),S(o)}),i(3,"label",22),l(4,6),a()()}if(s&2){let n=c();p(2),m("customId","backupRetentionTime"),d("ngModel",n.optionsFields.backupRetentionTime)}}function se(s,r){if(s&1){let n=g();i(0,"p"),l(1,7),a(),i(2,"sh-form-field")(3,"label",23),l(4,8),a(),i(5,"input",24),u("ngModelChange",function(o){O(n);let t=c();return T(t.optionsFields.backupRetentionVersions,o)||(t.optionsFields.backupRetentionVersions=o),S(o)}),a()()}if(s&2){let n=c();p(5),d("ngModel",n.optionsFields.backupRetentionVersions)}}function _e(s,r){s&1&&(i(0,"p"),l(1,9),a())}function le(s,r){if(s&1){let n=g();i(0,"p"),l(1,10),a(),i(2,"sh-form-field")(3,"p"),l(4,11),a(),i(5,"label",25),l(6,12),a(),i(7,"input",26),u("ngModelChange",function(o){O(n);let t=c();return T(t.optionsFields.backupRetentionCustom,o)||(t.optionsFields.backupRetentionCustom=o),S(o)}),a()()}if(s&2){let n=c();p(7),d("ngModel",n.optionsFields.backupRetentionCustom)}}var re=[{value:"all",name:$localize`Keep all backups`},{value:"time",name:$localize`Delete backups that are older than`},{value:"versions",name:$localize`Keep a specific number of backups`},{value:"smart",name:$localize`Smart backup retention`},{value:"custom",name:$localize`Custom backup retention`}],h=class s{#e=C(ee);#n=C(J);#t=C(U);formRef=K.required("formRef");isSubmitting=this.#e.isSubmitting;settings=this.#e.settings;optionsFields=this.#e.optionsFields;applicationOptions=this.#e.applicationOptions;retentionOptions=w(re);goBack(){this.#n.navigate(["schedule"],{relativeTo:this.#t.parent})}submit(){switch(this.#e.validateBeforeSubmit()){case"general":this.#n.navigate(["general"],{relativeTo:this.#t.parent});return;case"destination":this.#n.navigate(["destination"],{relativeTo:this.#t.parent});return;case"source":this.#n.navigate(["source-data"],{relativeTo:this.#t.parent});return}this.#e.submit()}static \u0275fac=function(n){return new(n||s)};static \u0275cmp=$({type:s,selectors:[["app-advanced-options-settings"]],viewQuery:function(n,e){n&1&&v(e.formRef,te,5),n&2&&B()},decls:20,vars:12,consts:()=>{let r;r=$localize`Options`;let n;n=$localize`Backup retention`;let e;e=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `;let t;t=$localize`Nothing will be deleted. The backup size will grow with each change.`;let M;M=$localize`If at least one newer backup is found, all backups older than this date are deleted.`;let I;I=$localize`Time to keep versions`;let R;R=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let b;b=$localize`Number of versions`;let A;A=$localize` Over time backups will be deleted automatically. There will remain one backup for each of the last 7 days, each of the last 4 weeks, each of the last 12 months. There will always be at least one remaining backup. `;let y;y=$localize` Enter a retention strategy manually. Placeholders are D/W/Y for days/weeks/years and U for unlimited. The syntax is: 7D:1D,4W:1W,36M:1M. This example keeps one backup for each of the next 7 days, one for each of the next 4 weeks, and one for each of the next 36 months. This can also be written as 1W:1D,1M:1W,3Y:1M. `;let k;k=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let F;return F=$localize`Retention expression`,[r,n,e,o,t,M,I,R,b,A,y,k,F,[1,"title-30"],["value","value","label","name",3,"options","inlineSearch","isClearable"],["for","size"],["type","text",3,"ngModelChange","ngModel"],[3,"optionsChange","options","applicationOptions","hasFreeTextSettings","hiddenOptions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],[3,"ngModelChange","customId","ngModel"],["for","backupRetentionTime"],["for","backupRetentionVersions"],["type","number","id","backupRetentionVersions",3,"ngModelChange","ngModel"],["for","backupRetentionCustom"],["type","text","id","backupRetentionCustom",3,"ngModelChange","ngModel"]]},template:function(n,e){n&1&&(i(0,"section")(1,"h3",13),l(2,0),a(),i(3,"sh-select",14)(4,"label",15),l(5,1),a(),i(6,"input",16),u("ngModelChange",function(t){return T(e.optionsFields.backupRetention,t)||(e.optionsFields.backupRetention=t),t}),a()(),L(7,oe,2,0,"p")(8,ae,5,2)(9,se,6,1)(10,_e,2,0,"p")(11,le,8,1),i(12,"app-options-list",17),u("optionsChange",function(t){return T(e.settings,t)||(e.settings=t),t}),a(),i(13,"div",18)(14,"button",19),f("click",function(){return e.goBack()}),N(15,2),P(16,"sh-icon"),E(),a(),i(17,"button",20),f("click",function(){return e.submit()}),N(18,3),P(19,"sh-icon"),E(),a()()()),n&2&&(p(3),m("options",e.retentionOptions())("inlineSearch",!0)("isClearable",!1),p(3),d("ngModel",e.optionsFields.backupRetention),p(),G(e.optionsFields.backupRetention()==="all"?7:e.optionsFields.backupRetention()==="time"?8:e.optionsFields.backupRetention()==="versions"?9:e.optionsFields.backupRetention()==="smart"?10:e.optionsFields.backupRetention()==="custom"?11:-1),p(5),d("options",e.settings),m("applicationOptions",e.applicationOptions())("hasFreeTextSettings",!0)("hiddenOptions",D(11,ie)),p(5),x("loading",e.isSubmitting()))},dependencies:[H,X,V,W,z,ne,Z,j,Y,q,Q],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:37.5rem;padding:2.5rem}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.remote-volume-wrap[_ngcontent-%COMP%] p.warning[_ngcontent-%COMP%]{color:#7d7d00}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 2.5rem;align-items:flex-end}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}"],changeDetection:0})};export{h as default};
|
|
@@ -8,4 +8,4 @@ with the REPORTED host key: ${o}?`,T=e;try{let w=new URL(e);w.searchParams.set("
|
|
|
8
8
|
`)??"";this.bulkPaths.set(t),this.bulkPathEditMode.set(!0)}}savePathBulkEdit(){let t=this.bulkPaths().split(`
|
|
9
9
|
`).filter(a=>a.trim()!=="")??[],e=this.pathArray(),i=[...t,...e],o=[...new Set(i)].join("\0");this.sourceDataForm.controls.path.setValue(o)}toggleBulkFilterEdit(){if(this.bulkFilterEditMode())this.bulkFilterEditMode.set(!1);else{let t=this.pathArray().filter(e=>e!=="___none___"&&(e.startsWith("-")||e.startsWith("+"))).join(`
|
|
10
10
|
`);this.bulkFilters.set(t),this.bulkFilterEditMode.set(!0)}}saveBulkFilterEdit(){let t=this.bulkFilters().split(`
|
|
11
|
-
`).filter(a=>a.trim()!==""&&(a.startsWith("-")||a.startsWith("+")))??[],i=[...this.nonFilterPaths()??[],...t],o=[...new Set(i)].join("\0");this.sourceDataForm.controls.path.setValue(o)}editPath(t){if(t&&t.startsWith("@")){let e=t.split("|");if(e.length!==2)return;e[1].startsWith("diskimage://")?this.editLocalDiskSource(t,e[0],e[1].substring(12)):this.editTargetUrlPath(t,e[0],e[1]);return}this.oldPath.set(t),this.editingPath.set(t)}editLocalDiskSource(t,e,i){this.#t.open(_t,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{initialPath:i}}).closed.subscribe(a=>{if(!a)return;let c=`${e}|diskimage://${a}`,d=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(d?.replace(t,c)??"")})}editTargetUrlPath(t,e,i){this.#t.open(ct,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{targetUrlModel:i,moduleType:"SourceProvider",askToCreate:!1,expectedResult:"destinationNotEmpty",suppressErrorDialogs:!0,backupId:this.#e.backupId(),sourcePrefix:e}}).closed.subscribe(a=>{if(!a)return;let c=`${e}|${a}`,d=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(d?.replace(t,c)??"")})}updateFilesLargerThan(t){let{size:e,unit:i}=kt(t);this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:e,unit:i})}updatePath(){let t=this.oldPath(),e=this.editingPath();if(!t||!e||e===t){this.oldPath.set(null),this.editingPath.set(null);return}let i=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(i?.replace(t,e)??""),this.oldPath.set(null),this.editingPath.set(null)}cancelEditPath(){this.oldPath.set(null),this.editingPath.set(null)}removePath(t){let i=(this.sourceDataForm.controls.path.value??"").split("\0"),o=i.indexOf(t);if(o===-1)return;i.splice(o,1);let a=i.filter(c=>c&&c!=="").join("\0");this.sourceDataForm.controls.path.setValue(a)}addPath(t){let i=[this.sourceDataForm.controls.path.value,t].filter(o=>o&&o!=="").join("\0");this.sourceDataForm.controls.path.setValue(i)}addFilter(t="-*"){let i=[this.sourceDataForm.controls.path.value,t].filter(o=>o&&o!=="").join("\0");this.sourceDataForm.controls.path.setValue(i)}patchPathAt(t,e){let o=this.sourceDataForm.controls.path.value.split("\0").filter(d=>!d.startsWith("-")&&!d.startsWith("+")).join("\0"),a=this.pathArray().map((d,m)=>m===e?`${t}`:`${d}`).join("\0"),c=[o,a].filter(d=>d&&d!=="").join("\0");this.sourceDataForm.controls.path.setValue(c)}removePathAt(t){let i=this.sourceDataForm.controls.path.value.split("\0").filter(c=>!c.startsWith("-")&&!c.startsWith("+")).join("\0"),o=this.pathArray().filter((c,d)=>d!==t).join("\0"),a=[i,o].filter(c=>c&&c!=="").join("\0");this.sourceDataForm.controls.path.setValue(a)}getPath(){return this.sourceDataForm.value.path??null}getBackendIcon(t){if(!t)return"";let e=t.split("|")[1];return e.startsWith("diskimage:")?"assets/dest-icons/external-harddrive.png":ye(e).icon??"database"}getRemotePathDisplayName(t){if(!t)return"";let e=t.split("|")[1];if(e.startsWith("diskimage:"))return $localize`Local disk`;let i=ye(e);return i?i.displayName:"Unknown"}toggleFilesLargerThan(t){t?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let t=this.sourceDataForm.controls.path.value,e=this.newPathCtrl.value,i=t?.split("\0")||[];e&&!i.includes(e)&&i.push(e);let o=i.filter(a=>a&&a!=="").join("\0");this.sourceDataForm.controls.path.setValue(o),this.newPathCtrl.setValue("")}goBack(){this.#n.navigate(["destination"],{relativeTo:this.#i.parent})}next(){this.#e.shouldAutoSave()&&this.#e.submit(!0),this.#n.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=z({type:n,selectors:[["app-source-data"]],viewQuery:function(e,i){e&1&&ze(i.formRef,Ka,5),e&2&&We()},decls:85,vars:19,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Hidden files`;let i;i=$localize`System files`;let o;o=$localize`Temporary files`;let a;a=$localize`Source Data`;let c;c=$localize`Folder path`;let d;d=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let m;m=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let T;T=$localize`Options`;let I;I=$localize`Paths`;let P;P=$localize`${"\uFFFD#40\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#40\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD*41:1\uFFFD"}:START_BLOCK_IF: Edit contents as list ${"\uFFFD/*41:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*42:2\uFFFD"}:START_BLOCK_ELSE: Edit contents as text ${"\uFFFD/*42:2\uFFFD"}:CLOSE_BLOCK_ELSE:`;let w;w=$localize`Filters`;let $;$=$localize`${"\uFFFD#61\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#61\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD*62:1\uFFFD"}:START_BLOCK_IF: Edit contents as list ${"\uFFFD/*62:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*63:2\uFFFD"}:START_BLOCK_ELSE: Edit contents as text ${"\uFFFD/*63:2\uFFFD"}:CLOSE_BLOCK_ELSE:`;let N;N=$localize`Exclude`;let K;K=$localize`Choose if there’s any files you want to exclude.`;let J;J=$localize` Files with the Hidden attribute ${"\uFFFD#75\uFFFD\uFFFD/#75\uFFFD"}:TAG_INPUT:`;let L;L=$localize` Files with the System attribute ${"\uFFFD#78\uFFFD\uFFFD/#78\uFFFD"}:TAG_INPUT:`;let H;H=$localize` Files with the Temporary attribute ${"\uFFFD#81\uFFFD\uFFFD/#81\uFFFD"}:TAG_INPUT:`;let me;me=$localize` Files larger than `;let Ce;Ce=$localize`${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:cloud-arrow-down${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON: Add remote path `;let G;G=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:hard-drive${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Add local disk `;let fe;fe=$localize`Manually add a path.`;let De;De=$localize`Edit paths as text, one per line.`;let nt;nt=$localize`Add a direct path`;let it;it=$localize`Edit path`;let ot;ot=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Add filter `;let at;at=$localize`Customize your filters.`;let V;return V=$localize`Edit filters as text, one per line.`,[["formRef",""],a,c,d,m,T,I,P,w,$,N,K,J,L,H,me,Ce,G,fe,De,ot,at,V,[3,"submit","formGroup"],[1,"left"],[1,"header-row"],[1,"title-30"],["shButton","","type","button",1,"small","ghost","mobile-menu-toggle",3,"click"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",t,"formControlName","path"],[1,"form-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","submit",1,"raised","primary","small"],[1,"right"],[1,"mobile-header"],["shButton","","type","button",1,"small","ghost",3,"click"],[3,"disableToggle"],["title",""],[1,"spacer"],["shButton","","type","button",1,"small"],["menu",""],["description",""],[1,"paths"],["type","button","shButton","",1,"small"],[1,"filters"],["formGroupName","excludes",3,"disableToggle"],[1,"raised","primary"],["type","checkbox","placeholder",e,"formControlName","hidden"],["type","checkbox","placeholder",i,"formControlName","system"],["type","checkbox","placeholder",o,"formControlName","temporary"],[1,"raised","primary",3,"checkedChange","checked"],[1,"row-inputs"],["shButton","","type","button",1,"small","rowbutton"],["shButton","","type","button",1,"small","rowbutton",3,"click"],["wrap","off","rows","10",1,"bulk-textarea",3,"ngModelChange","ngModel","ngModelOptions"],[1,"path"],["type","text","placeholder",nt,3,"formControl"],["shButton","","type","button",1,"raised","primary",3,"click"],[1,"small"],["type","text","placeholder",it,3,"ngModelChange","ngModel","ngModelOptions"],["alt","",1,"provider-icon",3,"src"],["type","text",3,"ngModel","ngModelOptions"],["type","button","shButton","",1,"small",3,"click"],[3,"path","osType"],[3,"pathChange","remove","path","osType"],[3,"ngModelChange","ngModel","ngModelOptions"]]},template:function(e,i){e&1&&(l(0,"form",23,0),E("submit",function(){return i.next()}),l(2,"div",24)(3,"div",25)(4,"h3",26),A(5,1),r(),l(6,"button",27),E("click",function(){return i.mobileMenuOpen.set(!0)}),l(7,"sh-icon"),p(8,"sliders"),r()()(),l(9,"app-file-tree",28)(10,"label",29),A(11,2),r(),O(12,"input",30),r(),l(13,"div",31)(14,"button",32),E("click",function(){return i.goBack()}),y(15,3),O(16,"sh-icon"),M(),r(),l(17,"button",33),y(18,4),O(19,"sh-icon"),M(),r()()(),l(20,"div",34)(21,"div",35)(22,"span",26),A(23,5),r(),l(24,"button",36),E("click",function(){return i.mobileMenuOpen.set(!1)}),l(25,"sh-icon"),p(26,"x-bold"),r()()(),l(27,"app-toggle-card",37),ge(28,38),l(29,"span"),A(30,6),r(),O(31,"div",39),C(32,Xa,4,1),l(33,"sh-menu")(34,"button",40)(35,"sh-icon"),p(36,"dots-three-vertical"),r()(),ge(37,41),l(38,"button",32),E("click",function(){return i.togglePathBulkEdit()}),y(39,7),O(40,"sh-icon"),C(41,za,1,0)(42,Wa,1,0),M(),r(),ue(),r(),ue(),C(43,Ha,2,0,"p",42)(44,ja,2,0,"p",42),l(45,"div",43),C(46,qa,2,3,"sh-form-field")(47,nl,8,1),r()(),l(48,"app-toggle-card",37),ge(49,38),l(50,"span"),A(51,8),r(),O(52,"div",39),C(53,il,3,0,"button",44),l(54,"sh-menu")(55,"button",40)(56,"sh-icon"),p(57,"dots-three-vertical"),r()(),ge(58,41),l(59,"button",32),E("click",function(){return i.toggleBulkFilterEdit()}),y(60,9),O(61,"sh-icon"),C(62,ol,1,0)(63,al,1,0),M(),r(),ue(),r(),ue(),C(64,ll,2,0,"p",42)(65,rl,2,0,"p",42),C(66,sl,2,3,"sh-form-field")(67,dl,2,1,"div",45),r(),l(68,"app-toggle-card",46),ge(69,38),A(70,10),ue(),l(71,"p",42),A(72,11),r(),l(73,"sh-toggle",47),y(74,12),O(75,"input",48),M(),r(),l(76,"sh-toggle",47),y(77,13),O(78,"input",49),M(),r(),l(79,"sh-toggle",47),y(80,14),O(81,"input",50),M(),r(),l(82,"sh-toggle",51),E("checkedChange",function(a){return i.toggleFilesLargerThan(a)}),A(83,15),r(),C(84,ul,2,3,"div",52),r()()()),e&2&&(u("formGroup",i.sourceDataForm),_(9),u("multiSelect",!0)("startingPath",i.getPath())("showFiles",!0),_(11),Fe("open",i.mobileMenuOpen()),_(7),u("disableToggle",!0),_(5),g(i.bulkPathEditMode()?-1:32),_(9),g(i.bulkPathEditMode()?41:42),_(2),g(i.bulkPathEditMode()?44:43),_(3),g(i.bulkPathEditMode()?46:47),_(2),u("disableToggle",!0),_(5),g(i.bulkFilterEditMode()?-1:53),_(9),g(i.bulkFilterEditMode()?62:63),_(2),g(i.bulkFilterEditMode()?65:64),_(2),g(i.bulkFilterEditMode()?66:67),_(2),u("disableToggle",!0),_(14),u("checked",i.filesLargerThan()!==null),_(2),g(i.filesLargerThan()?84:-1))},dependencies:[de,Dt,oe,ht,ae,Nt,ce,qe,Tn,Pt,It,Sn,Te,Z,ee,Ye,Rt,Jt,Qe,st,Vt,Mt],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}@media only screen and (max-width:768px){form[_ngcontent-%COMP%]{display:block;position:relative}}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.header-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.mobile-header[_ngcontent-%COMP%]{display:none}@media only screen and (max-width:768px){.mobile-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem}}.mobile-menu-toggle[_ngcontent-%COMP%]{display:none}@media only screen and (max-width:768px){.mobile-menu-toggle[_ngcontent-%COMP%]{display:inline-flex}}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-4)}@media only screen and (max-width:768px){.left[_ngcontent-%COMP%]{border-right:none;padding:1.5rem 1.5rem 4.5rem;height:100%;width:100%}}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}@media only screen and (max-width:768px){.right[_ngcontent-%COMP%]{position:absolute;inset:0;z-index:10;background:var(--base-1);padding:1.5rem;transform:translate(100%);transition:transform .3s cubic-bezier(.4,0,.2,1)}.right.open[_ngcontent-%COMP%]{transform:translate(0)}}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}sh-divider[_ngcontent-%COMP%]{margin:.75rem 0}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.25rem}.path[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content min-content;gap:.25rem;align-items:center}.path[_ngcontent-%COMP%] sh-chip[_ngcontent-%COMP%]{width:100%}.path[_ngcontent-%COMP%] .provider-icon[_ngcontent-%COMP%]{width:1rem;height:1rem;margin-right:.5rem}.bulk-textarea[_ngcontent-%COMP%]{width:100%;font-family:monospace;min-height:12.5rem}sh-menu[_ngcontent-%COMP%]{margin-left:.25rem}.paths[_ngcontent-%COMP%], .filters[_ngcontent-%COMP%]{max-height:200px;overflow-y:auto;display:flex;flex-direction:column;gap:.5rem}.rowbutton[_ngcontent-%COMP%]{margin-left:.25rem}"],changeDetection:0})};var Un="1W:1D,4W:1W,12M:1M",nn=!1,Me=class n{#e=x(we);#t=x(Se);#n=x($e);#i=x(Gt);#o=x(vt);#r=x(Bt);#a=x(Ze);generalForm=kn();sourceDataForm=bn();scheduleFields=Zt();scheduleType=F("daily");settings=F([]);optionsFields={backupRetention:F("all"),backupRetentionTime:F(""),backupRetentionVersions:F(0),backupRetentionCustom:F("")};targetUrls=F([]);targetUrlModel=R(()=>this.targetUrls()[0]?.url??null);connectionStringId=R(()=>this.targetUrls()[0]?.connectionStringId??null);targetUrlTestSignal=F(null);backupMetadata=F(null);isDraft=F(!1);backupId=F(null);backupName=R(()=>this.generalFormSignal()?.name??"");isSubmitting=F(!1);finishedLoading=F(!1);backupDefaults=F(null);applicationOptions=F(null);isNew=R(()=>this.backupId()==="new");shouldAutoSave=R(()=>!this.isDraft()&&!this.isNew());osType=R(()=>this.#t.systemInfo()?.OSType);isConnectionStringSaved=R(()=>{let t=this.targetUrlModel();return t?this.#a.destinations().some(e=>e.BaseUrl===t):!1});selectedOptions=F([]);sourceDataFormSignal=ve(this.sourceDataForm.valueChanges);generalFormSignal=ve(this.generalForm.valueChanges);encryptionFieldSignal=ve(this.generalForm.controls.encryption.valueChanges);advancedOptions=R(()=>this.#t.systemInfo()?.Options?.map(this.#u)??[]);#l=F(null);#s=null;testSignal=this.#l.asReadonly();#_=Q(()=>{let t=this.targetUrlModel(),e=this.#l(),i=this.#s;this.#s=t,!(e==="testing"||i===null||i===t)&&this.#l.set(null)});#C=Q(()=>{let t=this.targetUrlModel(),e=this.connectionStringId();if(e){let i=this.#a.destinations();if(i.length===0)return;let o=i.find(a=>a.ID===e);!o||o.BaseUrl}});setTestState(t){this.#l.set(t)}#u(t){return{name:t.Name,type:t.Type,shortDescription:t.ShortDescription??void 0,longDescription:t.LongDescription??void 0,options:t.ValidValues}}encryptionOptions=R(()=>{let t=this.#t.systemInfo()?.EncryptionModules??[];return[dt,...t]});nonSelectedOptions=R(()=>this.advancedOptions().sort((t,e)=>t?.name&&e?.name?t?.name.localeCompare(e?.name):0).filter(t=>this.selectedOptions()?.findIndex(e=>e.name===t.name)===-1));submit(t=!1){this.isSubmitting.set(!0),this.#p().pipe(mt(e=>{let i=this.#c(),o=this.backupId(),a=i;if(a.Backup){e.length>0&&e[0]!==null?i.Backup.ConnectionStringID=e[0]:e.length>0&&e[0]===null&&(i.Backup.ConnectionStringID=void 0);let d=this.targetUrls().slice(1).map((m,T)=>{let I=e[T+1];return{TargetUrl:m.url,ConnectionStringID:I??void 0,UrlKey:m.urlKey}});d.length>0&&(a.Backup.AdditionalTargetURLs=d)}return this.isDraft()&&i.Backup&&(i.Backup.Metadata=this.backupMetadata()),o==="new"||!o||this.isDraft()?this.#i.postApiV1Backups({requestBody:i}):this.#i.putApiV1BackupById({id:o,requestBody:i})}),be(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}})}validateBeforeSubmit(){this.generalForm.markAllAsTouched(),this.sourceDataForm.markAllAsTouched();let t=this.#c(),e=(t.Backup.Name??"").trim()!=="",o=(this.generalForm.controls.encryption.value!==""&&this.generalForm.controls.encryption.value!=="-")===!1||this.generalForm.controls.password.value===this.generalForm.controls.repeatPassword.value&&this.generalForm.controls.password.value!=="";if(!e||!o)return this.#n.open(te,{data:{title:$localize`Validation Error`,message:this.isNew()?$localize`Please fix the errors indicated before creating the backup.`:$localize`Please fix the errors indicated before saving.`,confirmText:$localize`OK`}}),"general";let a=this.targetUrls();if(!(a.length>0&&a.some(m=>m.url.trim()!=="")))return this.#n.open(te,{data:{title:$localize`Destination required`,message:this.isNew()?$localize`You must setup a destination before creating the backup.`:$localize`Please setup a destination before saving.`,confirmText:$localize`OK`}}),"destination";var d=(t.Backup.Sources??[]).filter(m=>m.trim()!=="").length>0;return!d||!this.sourceDataForm.valid?(this.#n.open(te,{data:{title:$localize`Source data required`,message:this.isNew()?$localize`You must setup source data before creating the backup.`:$localize`Please add at least one source path before saving.`,confirmText:$localize`OK`}}),"source"):""}exit(t){if(!t){this.#d(),this.#e.navigate(["/"]);return}this.#n.open(te,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#d(),this.#e.navigate(["/"]))}})}mapSourceDataToForm(t){let e=t.Sources??"",i=t.Filters?.map(d=>`${d.Include?"+":"-"}${d.Expression}`)??[],o=t.Settings?.find(d=>d.Name==="--exclude-files-attributes")?.Value?.toLowerCase()?.split(",")??[],a=t.Settings?.find(d=>d.Name==="--skip-files-larger-than")?.Value?.toUpperCase()??null,c={path:[...e,...i].join("\0"),excludes:{hidden:o.includes("hidden"),system:o.includes("system"),temporary:o.includes("temporary"),filesLargerThan:a===null?void 0:kt(a)}};this.sourceDataForm.patchValue(c)}mapDestinationToForm(t){let e=t,i=t.TargetURL??"",o=(t.ConnectionStringID===-1?null:t.ConnectionStringID)??null,a=i?[{url:i,connectionStringId:o,urlKey:null,save:!!o}]:[],c=e.AdditionalTargetURLs?.map(d=>({url:d.TargetUrl,urlKey:d.UrlKey,connectionStringId:d.ConnectionStringID??null,save:!!d.ConnectionStringID}))??[];this.targetUrls.set([...a,...c])}mapGeneralToForm(t){let e=t.Name??"",i=t.Description??"",o=t.Settings?.find(T=>T.Name==="encryption-module"),a=t.Settings?.find(T=>T.Name==="passphrase")?.Value??"",c=o?.Value&&o.Value.length?o.Value:"",d=t.Settings?.find(T=>T.Name==="compression-module")?.Value??"",m={name:t.Name??"",description:t.Description??""};e&&e!==""&&(m.name=e),i&&i!==""&&(m.description=i),c&&c!==""&&(m.encryption=c),a&&a!==""&&(m.password=a,m.repeatPassword=a),d&&d!==""&&(m.compression=d),this.generalForm.patchValue(m)}mapScheduleToForm(t){if(!t){this.scheduleType.set("disabled"),this.scheduleFields.autoRun.set(!1);return}let e=this.#r.fromString(t.Repeat)??null,i=this.#m(t.Time);this.scheduleFields.autoRun.set(!0),i.date&&this.scheduleFields.nextTime.date.set(i.date),this.scheduleFields.nextTime.time.set(i.time),this.scheduleFields.runAgain.repeatUnit.set(e?.unit??"D"),this.scheduleFields.runAgain.repeatValue.set(e?.value??1),this.scheduleFields.runAgain.allowedDays.mon.set(t.AllowedDays?.includes("mon")??!1),this.scheduleFields.runAgain.allowedDays.tue.set(t.AllowedDays?.includes("tue")??!1),this.scheduleFields.runAgain.allowedDays.wed.set(t.AllowedDays?.includes("wed")??!1),this.scheduleFields.runAgain.allowedDays.thu.set(t.AllowedDays?.includes("thu")??!1),this.scheduleFields.runAgain.allowedDays.fri.set(t.AllowedDays?.includes("fri")??!1),this.scheduleFields.runAgain.allowedDays.sat.set(t.AllowedDays?.includes("sat")??!1),this.scheduleFields.runAgain.allowedDays.sun.set(t.AllowedDays?.includes("sun")??!1);let o=rt(this.scheduleFields),a=Kt.find(c=>JSON.stringify(c.data)===JSON.stringify(o));a?this.scheduleType.set(a.value):this.scheduleType.set("custom")}mapOptionsToForms(t,e=!1){let i=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","passphrase","keep-time","keep-versions","retention-policy"],o=(t.Settings??[]).map(m=>m);if(e){let m=this.#o.serverSettings()??{};Object.keys(m).filter(T=>T.startsWith("--")).forEach(T=>{o.find(P=>P.Name===T)||o.push({Name:T,Value:m[T],Filter:null})})}let a=o.filter(m=>!i.includes(m.Name)),c=o.filter(m=>i.includes(m.Name));this.settings.set(a??[]),a?.forEach(m=>{if(m.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(m.Value??"")});var d="all";c?.forEach(m=>{if(m.Name==="keep-time"&&(m.Value??"")!=="")return d="time",this.optionsFields.backupRetentionTime.set(m.Value??"");if(m.Name==="keep-versions"&&(m.Value??"")!=="")return d="versions",this.optionsFields.backupRetentionVersions.set(m.Value?parseInt(m.Value):null);if(m.Name==="retention-policy"&&(m.Value??"")!=="")if(m.Value===Un)d="smart";else return d="custom",this.optionsFields.backupRetentionCustom.set(m.Value??"")}),this.optionsFields.backupRetention.set(d)}storeMetadata(t,e){this.backupMetadata.set(e?t.Metadata??null:null)}getScheduleFormValue(){let t=rt(this.scheduleFields);return Gn(t)}#c(){let t=this.generalForm.value,e=this.getScheduleFormValue(),i=this.sourceDataForm.value,a=this.targetUrls()[0],c=a?.url??null,d=i.path?.split("\0")??[],m=this.mapFormsToSettings(),T=Object.entries(i.excludes??{}).filter(([P,w])=>w&&P!=="filesLargerThan").map(([P])=>P),I=i.excludes?.filesLargerThan;return T.length&&m.push({Name:"--exclude-files-attributes",Value:T.join(",")}),I&&I.size!==null&&I.unit!==null&&m.push({Name:"--skip-files-larger-than",Value:`${I.size}${I.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:c??null,ConnectionStringID:a?.connectionStringId??null,Sources:d.filter(P=>!(P.startsWith("-")||P.startsWith("+"))),Settings:m,Filters:d.filter(P=>P.startsWith("-")||P.startsWith("+")).map((P,w)=>({Order:w,Include:P.startsWith("+"),Expression:P.slice(1)}))},Schedule:e}}mapFormsToSettings(t=[]){let e=this.generalForm.value,i=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","encryption-module","passphrase","keep-time","keep-versions","retention-policy","dblock-size","compression-module"],o=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&e.encryption!==dt.Key&&(o=[{Name:"encryption-module",Value:e.encryption??null},{Name:"passphrase",Value:e.password??null}]);let a=[{Name:"compression-module",Value:e.compression}];e.compression===""&&(a=[]);let c=[];switch(this.optionsFields.backupRetention()){case"time":c.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":c.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":c.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":c.push({Name:"retention-policy",Value:Un});break}let d=[...t,...i],m=this.settings().filter(T=>!d.includes(T.Name)).map(T=>{let I=T.Value;return typeof T.Value=="number"&&(I=T.Value.toString()),typeof T.Value=="boolean"&&(I=T.Value?"True":"False"),{Name:T.Name?.startsWith("--")?T.Name:`--${T.Name}`,Value:I}});return[...o,...a,...c,...m]}#p(){let t=this.targetUrls();if(t.length===0)return Je([]);let e=t.map(i=>{if(i.connectionStringId)return Je(i.connectionStringId);if(!i.save)return Je(null);let o=i.url,c=ye(o)?.displayName??"Destination",m=this.#a.destinations().filter(P=>P.Name?.startsWith(c)).length,I={Name:`${c} ${new Date().toISOString()}`,Description:null,BaseUrl:o};return this.#a.save("new",I).pipe(pt(P=>P.Data?.ID??null))});return ln(e).pipe(Ct(i=>{let o=this.targetUrls();i.forEach((a,c)=>{if(a&&c<o.length&&(this.#a.reload(),o[c].connectionStringId!==a)){let d=o[c].urlKey;this.updateTargetUrl(c,o[c].url,a,d)}})}))}#m(t){if(!t||t?.indexOf("T")===-1)return{time:t??"13:00"};let e=new Date(t);return{time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`,date:e.toISOString().split("T")[0]}}setTargetUrl(t,e=!1,i=null,o=null){if(e&&(this.#s=null),t===null){this.targetUrls.set([]);return}this.targetUrls.update(a=>{let c=[...a];return c.length===0?c.push({url:t,urlKey:o,connectionStringId:i,save:i?!0:nn}):c[0]={url:t,urlKey:o,connectionStringId:i,save:i?!0:nn},c})}addTargetUrl(t,e,i){this.targetUrls.update(o=>[...o,{url:t,connectionStringId:e,urlKey:i,save:e?!0:nn}])}updateTargetUrl(t,e,i,o){this.targetUrls.update(a=>{if(t<0||t>=a.length)return a;let c=[...a],d=c[t].save;return c[t]={url:e,connectionStringId:i,urlKey:o,save:i?!0:d},c})}toggleSaveConnectionString(t){this.targetUrls.update(e=>{if(t<0||t>=e.length)return e;let i=[...e];return i[t]=se(j({},i[t]),{save:!i[t].save}),i})}removeTargetUrl(t){this.targetUrls.update(e=>e.filter((i,o)=>o!==t))}#d(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleFields=Zt(),this.optionsFields.backupRetention.set("all"),this.settings.set([]),this.targetUrls.set([])}static \u0275fac=function(e){return new(e||n)};static \u0275prov=Ae({token:n,factory:n.\u0275fac,providedIn:"root"})};var pl=["formRef"];function ml(n,t){n&1&&(l(0,"sh-alert",17),y(1,5),O(2,"sh-icon",26),M(),r())}function Cl(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;B(" ",e.DisplayName," ")}}function gl(n,t){if(n&1&&O(0,"sh-progress-bar",40),n&2){let e=s(3);Fe("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),u("value",e.calculatePasswordStrength()*(100/5))}}function Tl(n,t){n&1&&(l(0,"span",35),A(1,10),r())}function Sl(n,t){n&1&&(y(0,8,1),O(1,"sh-icon"),M())}function El(n,t){n&1&&(y(0,8,2),O(1,"sh-icon"),M())}function fl(n,t){n&1&&(y(0,11,1),O(1,"sh-icon",42),M())}function hl(n,t){n&1&&(y(0,11,2),O(1,"sh-icon"),M())}function Fl(n,t){if(n&1){let e=D();l(0,"button",41),E("click",function(){f(e);let o=s(3);return h(o.copyPassword())}),y(1,11),C(2,fl,2,0)(3,hl,2,0),M(),r()}if(n&2){let e=s(3);_(2),g(e.copiedPassword()?2:3)}}function Nl(n,t){n&1&&(l(0,"sh-alert",39),A(1,12),r())}function Dl(n,t){if(n&1){let e=D();l(0,"div",30)(1,"sh-form-field")(2,"label",31),y(3,7),O(4,"sup"),M(),r(),O(5,"input",32),r(),C(6,gl,1,9,"sh-progress-bar",33),l(7,"sh-form-field"),O(8,"input",34),C(9,Tl,2,0,"span",35),r(),l(10,"div",36)(11,"button",37),E("click",function(){f(e);let o=s(2);return h(o.showPassword.set(!o.showPassword()))}),y(12,8),C(13,Sl,2,0)(14,El,2,0),M(),r(),l(15,"button",37),E("click",function(){f(e);let o=s(2);return h(o.generatePassword())}),y(16,9),O(17,"sh-icon"),M(),r(),C(18,Fl,4,1,"button",38),r(),C(19,Nl,2,0,"sh-alert",39),r()}if(n&2){let e=s(2);_(5),u("type",e.showPassword()?"text":"password"),_(),g(e.generalForm.value.password?6:-1),_(2),u("type",e.showPassword()?"text":"password"),_(),g(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),_(4),g(e.showPassword()?13:14),_(5),g(e.showCopyPassword()?18:-1),_(),g(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function Al(n,t){if(n&1&&(l(0,"sh-select",27)(1,"label",28),A(2,6),r(),O(3,"input",29),W(4,Cl,1,1,"ng-template"),r(),C(5,Dl,20,7,"div",30)),n&2){let e=s();u("options",e.encryptionOptions())("isClearable",!1),_(5),g(e.encryptionFieldSignal()!==e.noneOptionKey?5:-1)}}function Il(n,t){if(n&1&&(l(0,"button",24),y(1,13),O(2,"sh-icon"),M(),r()),n&2){let e=s();u("disabled",e.nameAndDescriptionValid()===!1)}}function Pl(n,t){if(n&1&&(l(0,"button",25),y(1,14),O(2,"sh-icon"),M(),r()),n&2){let e=s();u("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var Ke=new Ot,kn=(n={name:"",description:"",encryption:"",password:"",repeatPassword:"",compression:""})=>Ke.group({name:Ke.control(n.name,[Ft.required]),description:Ke.control(n.description),encryption:Ke.control(n.encryption,[wn()]),password:Ke.control(n.password,[Yt(t=>t?.value.encryption!=="-",[Ft.required])]),repeatPassword:Ke.control(n.repeatPassword,[Yt(t=>t?.value.encryption!=="-",[Ft.required])]),compression:Ke.control(n.compression)}),dt={Key:"-",DisplayName:"None"},on=class n{#e=x(we);#t=x(je);#n=x(Ln);#i=x(Me);#o=x(Se);formRef=He.required("formRef");generalForm=this.#i.generalForm;generalFormSignal=this.#i.generalFormSignal;encryptionFieldSignal=this.#i.encryptionFieldSignal;encryptionOptions=this.#i.encryptionOptions;isNew=this.#i.isNew;showPassword=F(!1);copiedPassword=F(!1);showCopyPassword=F(!1);noneOptionKey=dt.Key;encryptionEffect=Q(()=>{this.encryptionFieldSignal()===dt.Key&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=R(()=>{let t=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=R(()=>{let e=this.generalFormSignal()?.password??"";return this.#n.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#i.exit(!0)}async copyPassword(){let t=this.generalForm.controls.password.value;await this.#r(t??""),this.copiedPassword.set(!0)}async#r(t){try{await navigator.clipboard.writeText(t)}catch{try{let i=document.createElement("textarea");i.value=t,document.body.appendChild(i),i.select(),document.execCommand("copy"),document.body.removeChild(i)}catch(i){console.error("Failed to copy text: ",i)}}}generatePassword(){this.copiedPassword.set(!1);let t=this.#n.generate(16);this.generalForm.controls.password.setValue(t),this.generalForm.controls.repeatPassword.setValue(t),this.showCopyPassword.set(!0)}next(){this.#i.shouldAutoSave()&&this.#i.submit(!0),this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=z({type:n,selectors:[["app-general"]],viewQuery:function(e,i){e&1&&ze(i.formRef,pl,5),e&2&&We()},decls:21,vars:4,consts:()=>{let t;t=$localize`Your backup name`;let e;e=$localize`Your backup description`;let i;i=$localize`Remember to copy the password`;let o;o=$localize`General backup settings`;let a;a=$localize` Backup name ${"\uFFFD#8\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#8\uFFFD"}:CLOSE_SUPERSCRIPT:`;let c;c=$localize`Backup description`;let d;d=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Exit `;let m;m=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Encrypted backup `;let T;T=$localize`Encryption`;let I;I=$localize`Encryption`;let P;P=$localize`Password`;let w;w=$localize`Repeat password`;let $;$=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let N;N=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,N=Ue(N);let K;K=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let J;J=$localize`Passwords do not match`;let L;L=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,L=Ue(L);let H;H=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let me;me=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let Ce;return Ce=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],o,a,c,d,m,I,$,N,K,J,L,H,me,Ce,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],[1,"primary"],["for","backupName"],["type","text","tabindex","1","placeholder",t,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","shButton","",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],["shButton","","type","submit","shTooltip",i,1,"raised","primary",3,"disabled"],["icon",""],["value","Key","label","DisplayName",3,"options","isClearable"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",T,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",P,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",w,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["shButton","","type","button",1,"small","copy",3,"click"],[1,"sh-success"]]},template:function(e,i){if(e&1&&(l(0,"form",15,0),E("submit",function(){return i.next()}),l(2,"h3",16),A(3,1),r(),C(4,ml,3,0,"sh-alert",17),l(5,"sh-form-field")(6,"label",18),y(7,2),O(8,"sup"),M(),r(),O(9,"input",19),r(),l(10,"sh-form-field")(11,"label",20),A(12,3),r(),O(13,"textarea",21),r(),C(14,Al,6,3),l(15,"div",22)(16,"button",23),E("click",function(){return i.exit()}),y(17,4),O(18,"sh-icon"),M(),r(),C(19,Il,3,1,"button",24)(20,Pl,3,1,"button",25),r()()),e&2){let o;u("formGroup",i.generalForm),_(4),g(!i.isNew()&&((o=i.generalFormSignal())==null?null:o.encryption)!==""?4:-1),_(10),g(i.isNew()?14:-1),_(5),g(i.encryptionFieldSignal()===i.noneOptionKey||!i.isNew()?19:20)}},dependencies:[qe,Dt,oe,ae,Nt,Pt,It,Te,Ge,ee,Z,xt,yt,$t],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--error-8)}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.copy[_ngcontent-%COMP%] sh-icon.sh-success[_ngcontent-%COMP%]{color:var(--success-8)}"],changeDetection:0})};export{Ze as a,et as b,Xt as c,kn as d,dt as e,on as f,Kt as g,Gn as h,Zt as i,Qt as j,st as k,jt as l,ct as m,bn as n,en as o,Me as p,Wt as q};
|
|
11
|
+
`).filter(a=>a.trim()!==""&&(a.startsWith("-")||a.startsWith("+")))??[],i=[...this.nonFilterPaths()??[],...t],o=[...new Set(i)].join("\0");this.sourceDataForm.controls.path.setValue(o)}editPath(t){if(t&&t.startsWith("@")){let e=t.split("|");if(e.length!==2)return;e[1].startsWith("diskimage://")?this.editLocalDiskSource(t,e[0],e[1].substring(12)):this.editTargetUrlPath(t,e[0],e[1]);return}this.oldPath.set(t),this.editingPath.set(t)}editLocalDiskSource(t,e,i){this.#t.open(_t,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{initialPath:i}}).closed.subscribe(a=>{if(!a)return;let c=`${e}|diskimage://${a}`,d=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(d?.replace(t,c)??"")})}editTargetUrlPath(t,e,i){this.#t.open(ct,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{targetUrlModel:i,moduleType:"SourceProvider",askToCreate:!1,expectedResult:"destinationNotEmpty",suppressErrorDialogs:!0,backupId:this.#e.backupId(),sourcePrefix:e}}).closed.subscribe(a=>{if(!a)return;let c=`${e}|${a}`,d=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(d?.replace(t,c)??"")})}updateFilesLargerThan(t){let{size:e,unit:i}=kt(t);this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:e,unit:i})}updatePath(){let t=this.oldPath(),e=this.editingPath();if(!t||!e||e===t){this.oldPath.set(null),this.editingPath.set(null);return}let i=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(i?.replace(t,e)??""),this.oldPath.set(null),this.editingPath.set(null)}cancelEditPath(){this.oldPath.set(null),this.editingPath.set(null)}removePath(t){let i=(this.sourceDataForm.controls.path.value??"").split("\0"),o=i.indexOf(t);if(o===-1)return;i.splice(o,1);let a=i.filter(c=>c&&c!=="").join("\0");this.sourceDataForm.controls.path.setValue(a)}addPath(t){let i=[this.sourceDataForm.controls.path.value,t].filter(o=>o&&o!=="").join("\0");this.sourceDataForm.controls.path.setValue(i)}addFilter(t="-*"){let i=[this.sourceDataForm.controls.path.value,t].filter(o=>o&&o!=="").join("\0");this.sourceDataForm.controls.path.setValue(i)}patchPathAt(t,e){let o=this.sourceDataForm.controls.path.value.split("\0").filter(d=>!d.startsWith("-")&&!d.startsWith("+")).join("\0"),a=this.pathArray().map((d,m)=>m===e?`${t}`:`${d}`).join("\0"),c=[o,a].filter(d=>d&&d!=="").join("\0");this.sourceDataForm.controls.path.setValue(c)}removePathAt(t){let i=this.sourceDataForm.controls.path.value.split("\0").filter(c=>!c.startsWith("-")&&!c.startsWith("+")).join("\0"),o=this.pathArray().filter((c,d)=>d!==t).join("\0"),a=[i,o].filter(c=>c&&c!=="").join("\0");this.sourceDataForm.controls.path.setValue(a)}getPath(){return this.sourceDataForm.value.path??null}getBackendIcon(t){if(!t)return"";let e=t.split("|")[1];return e.startsWith("diskimage:")?"assets/dest-icons/external-harddrive.png":ye(e).icon??"database"}getRemotePathDisplayName(t){if(!t)return"";let e=t.split("|")[1];if(e.startsWith("diskimage:"))return $localize`Local disk`;let i=ye(e);return i?i.displayName:"Unknown"}toggleFilesLargerThan(t){t?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let t=this.sourceDataForm.controls.path.value,e=this.newPathCtrl.value,i=t?.split("\0")||[];e&&!i.includes(e)&&i.push(e);let o=i.filter(a=>a&&a!=="").join("\0");this.sourceDataForm.controls.path.setValue(o),this.newPathCtrl.setValue("")}goBack(){this.#n.navigate(["destination"],{relativeTo:this.#i.parent})}next(){this.#e.shouldAutoSave()&&this.#e.submit(!0),this.#n.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=z({type:n,selectors:[["app-source-data"]],viewQuery:function(e,i){e&1&&ze(i.formRef,Ka,5),e&2&&We()},decls:85,vars:19,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Hidden files`;let i;i=$localize`System files`;let o;o=$localize`Temporary files`;let a;a=$localize`Source Data`;let c;c=$localize`Folder path`;let d;d=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let m;m=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let T;T=$localize`Options`;let I;I=$localize`Paths`;let P;P=$localize`${"\uFFFD#40\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#40\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD*41:1\uFFFD"}:START_BLOCK_IF: Edit contents as list ${"\uFFFD/*41:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*42:2\uFFFD"}:START_BLOCK_ELSE: Edit contents as text ${"\uFFFD/*42:2\uFFFD"}:CLOSE_BLOCK_ELSE:`;let w;w=$localize`Filters`;let $;$=$localize`${"\uFFFD#61\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#61\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD*62:1\uFFFD"}:START_BLOCK_IF: Edit contents as list ${"\uFFFD/*62:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*63:2\uFFFD"}:START_BLOCK_ELSE: Edit contents as text ${"\uFFFD/*63:2\uFFFD"}:CLOSE_BLOCK_ELSE:`;let N;N=$localize`Exclude`;let K;K=$localize`Choose if there’s any files you want to exclude.`;let J;J=$localize` Files with the Hidden attribute ${"\uFFFD#75\uFFFD\uFFFD/#75\uFFFD"}:TAG_INPUT:`;let L;L=$localize` Files with the System attribute ${"\uFFFD#78\uFFFD\uFFFD/#78\uFFFD"}:TAG_INPUT:`;let H;H=$localize` Files with the Temporary attribute ${"\uFFFD#81\uFFFD\uFFFD/#81\uFFFD"}:TAG_INPUT:`;let me;me=$localize` Files larger than `;let Ce;Ce=$localize`${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:cloud-arrow-down${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON: Add remote path `;let G;G=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:hard-drive${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Add local disk `;let fe;fe=$localize`Manually add a path.`;let De;De=$localize`Edit paths as text, one per line.`;let nt;nt=$localize`Add a direct path`;let it;it=$localize`Edit path`;let ot;ot=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Add filter `;let at;at=$localize`Customize your filters.`;let V;return V=$localize`Edit filters as text, one per line.`,[["formRef",""],a,c,d,m,T,I,P,w,$,N,K,J,L,H,me,Ce,G,fe,De,ot,at,V,[3,"submit","formGroup"],[1,"left"],[1,"header-row"],[1,"title-30"],["shButton","","type","button",1,"small","ghost","mobile-menu-toggle",3,"click"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",t,"formControlName","path"],[1,"form-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","submit",1,"raised","primary","small"],[1,"right"],[1,"mobile-header"],["shButton","","type","button",1,"small","ghost",3,"click"],[3,"disableToggle"],["title",""],[1,"spacer"],["shButton","","type","button",1,"small"],["menu",""],["description",""],[1,"paths"],["type","button","shButton","",1,"small"],[1,"filters"],["formGroupName","excludes",3,"disableToggle"],[1,"raised","primary"],["type","checkbox","placeholder",e,"formControlName","hidden"],["type","checkbox","placeholder",i,"formControlName","system"],["type","checkbox","placeholder",o,"formControlName","temporary"],[1,"raised","primary",3,"checkedChange","checked"],[1,"row-inputs"],["shButton","","type","button",1,"small","rowbutton"],["shButton","","type","button",1,"small","rowbutton",3,"click"],["wrap","off","rows","10",1,"bulk-textarea",3,"ngModelChange","ngModel","ngModelOptions"],[1,"path"],["type","text","placeholder",nt,3,"formControl"],["shButton","","type","button",1,"raised","primary",3,"click"],[1,"small"],["type","text","placeholder",it,3,"ngModelChange","ngModel","ngModelOptions"],["alt","",1,"provider-icon",3,"src"],["type","text",3,"ngModel","ngModelOptions"],["type","button","shButton","",1,"small",3,"click"],[3,"path","osType"],[3,"pathChange","remove","path","osType"],[3,"ngModelChange","ngModel","ngModelOptions"]]},template:function(e,i){e&1&&(l(0,"form",23,0),E("submit",function(){return i.next()}),l(2,"div",24)(3,"div",25)(4,"h3",26),A(5,1),r(),l(6,"button",27),E("click",function(){return i.mobileMenuOpen.set(!0)}),l(7,"sh-icon"),p(8,"sliders"),r()()(),l(9,"app-file-tree",28)(10,"label",29),A(11,2),r(),O(12,"input",30),r(),l(13,"div",31)(14,"button",32),E("click",function(){return i.goBack()}),y(15,3),O(16,"sh-icon"),M(),r(),l(17,"button",33),y(18,4),O(19,"sh-icon"),M(),r()()(),l(20,"div",34)(21,"div",35)(22,"span",26),A(23,5),r(),l(24,"button",36),E("click",function(){return i.mobileMenuOpen.set(!1)}),l(25,"sh-icon"),p(26,"x-bold"),r()()(),l(27,"app-toggle-card",37),ge(28,38),l(29,"span"),A(30,6),r(),O(31,"div",39),C(32,Xa,4,1),l(33,"sh-menu")(34,"button",40)(35,"sh-icon"),p(36,"dots-three-vertical"),r()(),ge(37,41),l(38,"button",32),E("click",function(){return i.togglePathBulkEdit()}),y(39,7),O(40,"sh-icon"),C(41,za,1,0)(42,Wa,1,0),M(),r(),ue(),r(),ue(),C(43,Ha,2,0,"p",42)(44,ja,2,0,"p",42),l(45,"div",43),C(46,qa,2,3,"sh-form-field")(47,nl,8,1),r()(),l(48,"app-toggle-card",37),ge(49,38),l(50,"span"),A(51,8),r(),O(52,"div",39),C(53,il,3,0,"button",44),l(54,"sh-menu")(55,"button",40)(56,"sh-icon"),p(57,"dots-three-vertical"),r()(),ge(58,41),l(59,"button",32),E("click",function(){return i.toggleBulkFilterEdit()}),y(60,9),O(61,"sh-icon"),C(62,ol,1,0)(63,al,1,0),M(),r(),ue(),r(),ue(),C(64,ll,2,0,"p",42)(65,rl,2,0,"p",42),C(66,sl,2,3,"sh-form-field")(67,dl,2,1,"div",45),r(),l(68,"app-toggle-card",46),ge(69,38),A(70,10),ue(),l(71,"p",42),A(72,11),r(),l(73,"sh-toggle",47),y(74,12),O(75,"input",48),M(),r(),l(76,"sh-toggle",47),y(77,13),O(78,"input",49),M(),r(),l(79,"sh-toggle",47),y(80,14),O(81,"input",50),M(),r(),l(82,"sh-toggle",51),E("checkedChange",function(a){return i.toggleFilesLargerThan(a)}),A(83,15),r(),C(84,ul,2,3,"div",52),r()()()),e&2&&(u("formGroup",i.sourceDataForm),_(9),u("multiSelect",!0)("startingPath",i.getPath())("showFiles",!0),_(11),Fe("open",i.mobileMenuOpen()),_(7),u("disableToggle",!0),_(5),g(i.bulkPathEditMode()?-1:32),_(9),g(i.bulkPathEditMode()?41:42),_(2),g(i.bulkPathEditMode()?44:43),_(3),g(i.bulkPathEditMode()?46:47),_(2),u("disableToggle",!0),_(5),g(i.bulkFilterEditMode()?-1:53),_(9),g(i.bulkFilterEditMode()?62:63),_(2),g(i.bulkFilterEditMode()?65:64),_(2),g(i.bulkFilterEditMode()?66:67),_(2),u("disableToggle",!0),_(14),u("checked",i.filesLargerThan()!==null),_(2),g(i.filesLargerThan()?84:-1))},dependencies:[de,Dt,oe,ht,ae,Nt,ce,qe,Tn,Pt,It,Sn,Te,Z,ee,Ye,Rt,Jt,Qe,st,Vt,Mt],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}@media only screen and (max-width:768px){form[_ngcontent-%COMP%]{display:block;position:relative}}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.header-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.mobile-header[_ngcontent-%COMP%]{display:none}@media only screen and (max-width:768px){.mobile-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem}}.mobile-menu-toggle[_ngcontent-%COMP%]{display:none}@media only screen and (max-width:768px){.mobile-menu-toggle[_ngcontent-%COMP%]{display:inline-flex}}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-4)}@media only screen and (max-width:768px){.left[_ngcontent-%COMP%]{border-right:none;padding:1.5rem 1.5rem 4.5rem;height:100%;width:100%}}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}@media only screen and (max-width:768px){.right[_ngcontent-%COMP%]{position:absolute;inset:0;z-index:10;background:var(--base-1);padding:1.5rem;transform:translate(100%);transition:transform .3s cubic-bezier(.4,0,.2,1)}.right.open[_ngcontent-%COMP%]{transform:translate(0)}}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}sh-divider[_ngcontent-%COMP%]{margin:.75rem 0}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.25rem}.path[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content min-content;gap:.25rem;align-items:center}.path[_ngcontent-%COMP%] sh-chip[_ngcontent-%COMP%]{width:100%}.path[_ngcontent-%COMP%] .provider-icon[_ngcontent-%COMP%]{width:1rem;height:1rem;margin-right:.5rem}.bulk-textarea[_ngcontent-%COMP%]{width:100%;font-family:monospace;min-height:12.5rem}sh-menu[_ngcontent-%COMP%]{margin-left:.25rem}.paths[_ngcontent-%COMP%], .filters[_ngcontent-%COMP%]{max-height:200px;overflow-y:auto;display:flex;flex-direction:column;gap:.5rem}.rowbutton[_ngcontent-%COMP%]{margin-left:.25rem}"],changeDetection:0})};var Un="1W:1D,4W:1W,12M:1M",nn=!1,Me=class n{#e=x(we);#t=x(Se);#n=x($e);#i=x(Gt);#o=x(vt);#r=x(Bt);#a=x(Ze);generalForm=kn();sourceDataForm=bn();scheduleFields=Zt();scheduleType=F("daily");settings=F([]);optionsFields={backupRetention:F("all"),backupRetentionTime:F(""),backupRetentionVersions:F(0),backupRetentionCustom:F("")};targetUrls=F([]);targetUrlModel=R(()=>this.targetUrls()[0]?.url??null);connectionStringId=R(()=>this.targetUrls()[0]?.connectionStringId??null);targetUrlTestSignal=F(null);backupMetadata=F(null);isDraft=F(!1);backupId=F(null);backupName=R(()=>this.generalFormSignal()?.name??"");isSubmitting=F(!1);finishedLoading=F(!1);backupDefaults=F(null);applicationOptions=F(null);isNew=R(()=>this.backupId()==="new");shouldAutoSave=R(()=>!this.isDraft()&&!this.isNew());osType=R(()=>this.#t.systemInfo()?.OSType);isConnectionStringSaved=R(()=>{let t=this.targetUrlModel();return t?this.#a.destinations().some(e=>e.BaseUrl===t):!1});selectedOptions=F([]);sourceDataFormSignal=ve(this.sourceDataForm.valueChanges);generalFormSignal=ve(this.generalForm.valueChanges);encryptionFieldSignal=ve(this.generalForm.controls.encryption.valueChanges);advancedOptions=R(()=>this.#t.systemInfo()?.Options?.map(this.#u)??[]);#l=F(null);#s=null;testSignal=this.#l.asReadonly();#_=Q(()=>{let t=this.targetUrlModel(),e=this.#l(),i=this.#s;this.#s=t,!(e==="testing"||i===null||i===t)&&this.#l.set(null)});#C=Q(()=>{let t=this.targetUrlModel(),e=this.connectionStringId();if(e){let i=this.#a.destinations();if(i.length===0)return;let o=i.find(a=>a.ID===e);!o||o.BaseUrl}});setTestState(t){this.#l.set(t)}#u(t){return{name:t.Name,type:t.Type,shortDescription:t.ShortDescription??void 0,longDescription:t.LongDescription??void 0,options:t.ValidValues}}encryptionOptions=R(()=>{let t=this.#t.systemInfo()?.EncryptionModules??[];return[dt,...t]});nonSelectedOptions=R(()=>this.advancedOptions().sort((t,e)=>t?.name&&e?.name?t?.name.localeCompare(e?.name):0).filter(t=>this.selectedOptions()?.findIndex(e=>e.name===t.name)===-1));submit(t=!1){this.isSubmitting.set(!0),this.#p().pipe(mt(e=>{let i=this.#c(),o=this.backupId(),a=i;if(a.Backup){e.length>0&&e[0]!==null?i.Backup.ConnectionStringID=e[0]:e.length>0&&e[0]===null&&(i.Backup.ConnectionStringID=void 0);let d=this.targetUrls().slice(1).map((m,T)=>{let I=e[T+1];return{TargetUrl:m.url,ConnectionStringID:I??void 0,UrlKey:m.urlKey}});d.length>0&&(a.Backup.AdditionalTargetURLs=d)}return this.isDraft()&&i.Backup&&(i.Backup.Metadata=this.backupMetadata()),o==="new"||!o||this.isDraft()?this.#i.postApiV1Backups({requestBody:i}):this.#i.putApiV1BackupById({id:o,requestBody:i})}),be(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}})}validateBeforeSubmit(){this.generalForm.markAllAsTouched(),this.sourceDataForm.markAllAsTouched();let t=this.#c(),e=(t.Backup.Name??"").trim()!=="",o=(this.generalForm.controls.encryption.value!==""&&this.generalForm.controls.encryption.value!=="-")===!1||this.generalForm.controls.password.value===this.generalForm.controls.repeatPassword.value&&this.generalForm.controls.password.value!=="";if(!e||!o)return this.#n.open(te,{data:{title:$localize`Validation Error`,message:this.isNew()?$localize`Please fix the errors indicated before creating the backup.`:$localize`Please fix the errors indicated before saving.`,confirmText:$localize`OK`}}),"general";let a=this.targetUrls();if(!(a.length>0&&a.some(m=>m.url.trim()!=="")))return this.#n.open(te,{data:{title:$localize`Destination required`,message:this.isNew()?$localize`You must setup a destination before creating the backup.`:$localize`Please setup a destination before saving.`,confirmText:$localize`OK`}}),"destination";var d=(t.Backup.Sources??[]).filter(m=>m.trim()!=="").length>0;return!d||!this.sourceDataForm.valid?(this.#n.open(te,{data:{title:$localize`Source data required`,message:this.isNew()?$localize`You must setup source data before creating the backup.`:$localize`Please add at least one source path before saving.`,confirmText:$localize`OK`}}),"source"):""}exit(t){if(!t){this.#d(),this.#e.navigate(["/"]);return}this.#n.open(te,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#d(),this.#e.navigate(["/"]))}})}mapSourceDataToForm(t){let e=t.Sources??"",i=t.Filters?.map(d=>`${d.Include?"+":"-"}${d.Expression}`)??[],o=t.Settings?.find(d=>d.Name==="--exclude-files-attributes")?.Value?.toLowerCase()?.split(",")??[],a=t.Settings?.find(d=>d.Name==="--skip-files-larger-than")?.Value?.toUpperCase()??null,c={path:[...e,...i].join("\0"),excludes:{hidden:o.includes("hidden"),system:o.includes("system"),temporary:o.includes("temporary"),filesLargerThan:a===null?void 0:kt(a)}};this.sourceDataForm.patchValue(c)}mapDestinationToForm(t){let e=t,i=t.TargetURL??"",o=(t.ConnectionStringID===-1?null:t.ConnectionStringID)??null,a=i?[{url:i,connectionStringId:o,urlKey:null,save:!!o}]:[],c=e.AdditionalTargetURLs?.map(d=>({url:d.TargetUrl,urlKey:d.UrlKey,connectionStringId:d.ConnectionStringID??null,save:!!d.ConnectionStringID}))??[];this.targetUrls.set([...a,...c])}mapGeneralToForm(t){let e=t.Name??"",i=t.Description??"",o=t.Settings?.find(T=>T.Name==="encryption-module"),a=t.Settings?.find(T=>T.Name==="passphrase")?.Value??"",c=o?.Value&&o.Value.length?o.Value:"",d=t.Settings?.find(T=>T.Name==="compression-module")?.Value??"",m={name:t.Name??"",description:t.Description??""};e&&e!==""&&(m.name=e),i&&i!==""&&(m.description=i),c&&c!==""&&(m.encryption=c),a&&a!==""&&(m.password=a,m.repeatPassword=a),d&&d!==""&&(m.compression=d),this.generalForm.patchValue(m)}mapScheduleToForm(t){if(!t){this.scheduleType.set("disabled"),this.scheduleFields.autoRun.set(!1);return}let e=this.#r.fromString(t.Repeat)??null,i=this.#m(t.Time);this.scheduleFields.autoRun.set(!0),i.date&&this.scheduleFields.nextTime.date.set(i.date),this.scheduleFields.nextTime.time.set(i.time),this.scheduleFields.runAgain.repeatUnit.set(e?.unit??"D"),this.scheduleFields.runAgain.repeatValue.set(e?.value??1),this.scheduleFields.runAgain.allowedDays.mon.set(t.AllowedDays?.includes("mon")??!1),this.scheduleFields.runAgain.allowedDays.tue.set(t.AllowedDays?.includes("tue")??!1),this.scheduleFields.runAgain.allowedDays.wed.set(t.AllowedDays?.includes("wed")??!1),this.scheduleFields.runAgain.allowedDays.thu.set(t.AllowedDays?.includes("thu")??!1),this.scheduleFields.runAgain.allowedDays.fri.set(t.AllowedDays?.includes("fri")??!1),this.scheduleFields.runAgain.allowedDays.sat.set(t.AllowedDays?.includes("sat")??!1),this.scheduleFields.runAgain.allowedDays.sun.set(t.AllowedDays?.includes("sun")??!1);let o=rt(this.scheduleFields),a=Kt.find(c=>JSON.stringify(c.data)===JSON.stringify(o));a?this.scheduleType.set(a.value):this.scheduleType.set("custom")}mapOptionsToForms(t,e=!1){let i=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","passphrase","keep-time","keep-versions","retention-policy"],o=(t.Settings??[]).map(m=>m);if(e){let m=this.#o.serverSettings()??{};Object.keys(m).filter(T=>T.startsWith("--")).forEach(T=>{o.find(P=>P.Name===T)||o.push({Name:T,Value:m[T],Filter:null})})}let a=o.filter(m=>!i.includes(m.Name)),c=o.filter(m=>i.includes(m.Name));this.settings.set(a??[]),a?.forEach(m=>{if(m.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(m.Value??"")});var d="all";c?.forEach(m=>{if(m.Name==="keep-time"&&(m.Value??"")!=="")return d="time",this.optionsFields.backupRetentionTime.set(m.Value??"");if(m.Name==="keep-versions"&&(m.Value??"")!=="")return d="versions",this.optionsFields.backupRetentionVersions.set(m.Value?parseInt(m.Value):null);if(m.Name==="retention-policy"&&(m.Value??"")!=="")if(m.Value===Un)d="smart";else return d="custom",this.optionsFields.backupRetentionCustom.set(m.Value??"")}),this.optionsFields.backupRetention.set(d)}storeMetadata(t,e){this.backupMetadata.set(e?t.Metadata??null:null)}getScheduleFormValue(){let t=rt(this.scheduleFields);return Gn(t)}#c(){let t=this.generalForm.value,e=this.getScheduleFormValue(),i=this.sourceDataForm.value,a=this.targetUrls()[0],c=a?.url??null,d=i.path?.split("\0")??[],m=this.mapFormsToSettings(),T=Object.entries(i.excludes??{}).filter(([P,w])=>w&&P!=="filesLargerThan").map(([P])=>P),I=i.excludes?.filesLargerThan;return T.length&&m.push({Name:"--exclude-files-attributes",Value:T.join(",")}),I&&I.size!==null&&I.unit!==null&&m.push({Name:"--skip-files-larger-than",Value:`${I.size}${I.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:c??null,ConnectionStringID:a?.connectionStringId??null,Sources:d.filter(P=>!(P.startsWith("-")||P.startsWith("+"))),Settings:m,Filters:d.filter(P=>P.startsWith("-")||P.startsWith("+")).map((P,w)=>({Order:w,Include:P.startsWith("+"),Expression:P.slice(1)}))},Schedule:e}}mapFormsToSettings(t=[]){let e=this.generalForm.value,i=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","encryption-module","passphrase","keep-time","keep-versions","retention-policy","compression-module"],o=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&e.encryption!==dt.Key&&(o=[{Name:"encryption-module",Value:e.encryption??null},{Name:"passphrase",Value:e.password??null}]);let a=[{Name:"compression-module",Value:e.compression}];e.compression===""&&(a=[]);let c=[];switch(this.optionsFields.backupRetention()){case"time":c.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":c.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":c.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":c.push({Name:"retention-policy",Value:Un});break}let d=[...t,...i],m=this.settings().filter(T=>!d.includes(T.Name)).map(T=>{let I=T.Value;return typeof T.Value=="number"&&(I=T.Value.toString()),typeof T.Value=="boolean"&&(I=T.Value?"True":"False"),{Name:T.Name?.startsWith("--")?T.Name:`--${T.Name}`,Value:I}});return[...o,...a,...c,...m]}#p(){let t=this.targetUrls();if(t.length===0)return Je([]);let e=t.map(i=>{if(i.connectionStringId)return Je(i.connectionStringId);if(!i.save)return Je(null);let o=i.url,c=ye(o)?.displayName??"Destination",m=this.#a.destinations().filter(P=>P.Name?.startsWith(c)).length,I={Name:`${c} ${new Date().toISOString()}`,Description:null,BaseUrl:o};return this.#a.save("new",I).pipe(pt(P=>P.Data?.ID??null))});return ln(e).pipe(Ct(i=>{let o=this.targetUrls();i.forEach((a,c)=>{if(a&&c<o.length&&(this.#a.reload(),o[c].connectionStringId!==a)){let d=o[c].urlKey;this.updateTargetUrl(c,o[c].url,a,d)}})}))}#m(t){if(!t||t?.indexOf("T")===-1)return{time:t??"13:00"};let e=new Date(t);return{time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`,date:e.toISOString().split("T")[0]}}setTargetUrl(t,e=!1,i=null,o=null){if(e&&(this.#s=null),t===null){this.targetUrls.set([]);return}this.targetUrls.update(a=>{let c=[...a];return c.length===0?c.push({url:t,urlKey:o,connectionStringId:i,save:i?!0:nn}):c[0]={url:t,urlKey:o,connectionStringId:i,save:i?!0:nn},c})}addTargetUrl(t,e,i){this.targetUrls.update(o=>[...o,{url:t,connectionStringId:e,urlKey:i,save:e?!0:nn}])}updateTargetUrl(t,e,i,o){this.targetUrls.update(a=>{if(t<0||t>=a.length)return a;let c=[...a],d=c[t].save;return c[t]={url:e,connectionStringId:i,urlKey:o,save:i?!0:d},c})}toggleSaveConnectionString(t){this.targetUrls.update(e=>{if(t<0||t>=e.length)return e;let i=[...e];return i[t]=se(j({},i[t]),{save:!i[t].save}),i})}removeTargetUrl(t){this.targetUrls.update(e=>e.filter((i,o)=>o!==t))}#d(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleFields=Zt(),this.optionsFields.backupRetention.set("all"),this.settings.set([]),this.targetUrls.set([])}static \u0275fac=function(e){return new(e||n)};static \u0275prov=Ae({token:n,factory:n.\u0275fac,providedIn:"root"})};var pl=["formRef"];function ml(n,t){n&1&&(l(0,"sh-alert",17),y(1,5),O(2,"sh-icon",26),M(),r())}function Cl(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;B(" ",e.DisplayName," ")}}function gl(n,t){if(n&1&&O(0,"sh-progress-bar",40),n&2){let e=s(3);Fe("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),u("value",e.calculatePasswordStrength()*(100/5))}}function Tl(n,t){n&1&&(l(0,"span",35),A(1,10),r())}function Sl(n,t){n&1&&(y(0,8,1),O(1,"sh-icon"),M())}function El(n,t){n&1&&(y(0,8,2),O(1,"sh-icon"),M())}function fl(n,t){n&1&&(y(0,11,1),O(1,"sh-icon",42),M())}function hl(n,t){n&1&&(y(0,11,2),O(1,"sh-icon"),M())}function Fl(n,t){if(n&1){let e=D();l(0,"button",41),E("click",function(){f(e);let o=s(3);return h(o.copyPassword())}),y(1,11),C(2,fl,2,0)(3,hl,2,0),M(),r()}if(n&2){let e=s(3);_(2),g(e.copiedPassword()?2:3)}}function Nl(n,t){n&1&&(l(0,"sh-alert",39),A(1,12),r())}function Dl(n,t){if(n&1){let e=D();l(0,"div",30)(1,"sh-form-field")(2,"label",31),y(3,7),O(4,"sup"),M(),r(),O(5,"input",32),r(),C(6,gl,1,9,"sh-progress-bar",33),l(7,"sh-form-field"),O(8,"input",34),C(9,Tl,2,0,"span",35),r(),l(10,"div",36)(11,"button",37),E("click",function(){f(e);let o=s(2);return h(o.showPassword.set(!o.showPassword()))}),y(12,8),C(13,Sl,2,0)(14,El,2,0),M(),r(),l(15,"button",37),E("click",function(){f(e);let o=s(2);return h(o.generatePassword())}),y(16,9),O(17,"sh-icon"),M(),r(),C(18,Fl,4,1,"button",38),r(),C(19,Nl,2,0,"sh-alert",39),r()}if(n&2){let e=s(2);_(5),u("type",e.showPassword()?"text":"password"),_(),g(e.generalForm.value.password?6:-1),_(2),u("type",e.showPassword()?"text":"password"),_(),g(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),_(4),g(e.showPassword()?13:14),_(5),g(e.showCopyPassword()?18:-1),_(),g(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function Al(n,t){if(n&1&&(l(0,"sh-select",27)(1,"label",28),A(2,6),r(),O(3,"input",29),W(4,Cl,1,1,"ng-template"),r(),C(5,Dl,20,7,"div",30)),n&2){let e=s();u("options",e.encryptionOptions())("isClearable",!1),_(5),g(e.encryptionFieldSignal()!==e.noneOptionKey?5:-1)}}function Il(n,t){if(n&1&&(l(0,"button",24),y(1,13),O(2,"sh-icon"),M(),r()),n&2){let e=s();u("disabled",e.nameAndDescriptionValid()===!1)}}function Pl(n,t){if(n&1&&(l(0,"button",25),y(1,14),O(2,"sh-icon"),M(),r()),n&2){let e=s();u("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var Ke=new Ot,kn=(n={name:"",description:"",encryption:"",password:"",repeatPassword:"",compression:""})=>Ke.group({name:Ke.control(n.name,[Ft.required]),description:Ke.control(n.description),encryption:Ke.control(n.encryption,[wn()]),password:Ke.control(n.password,[Yt(t=>t?.value.encryption!=="-",[Ft.required])]),repeatPassword:Ke.control(n.repeatPassword,[Yt(t=>t?.value.encryption!=="-",[Ft.required])]),compression:Ke.control(n.compression)}),dt={Key:"-",DisplayName:"None"},on=class n{#e=x(we);#t=x(je);#n=x(Ln);#i=x(Me);#o=x(Se);formRef=He.required("formRef");generalForm=this.#i.generalForm;generalFormSignal=this.#i.generalFormSignal;encryptionFieldSignal=this.#i.encryptionFieldSignal;encryptionOptions=this.#i.encryptionOptions;isNew=this.#i.isNew;showPassword=F(!1);copiedPassword=F(!1);showCopyPassword=F(!1);noneOptionKey=dt.Key;encryptionEffect=Q(()=>{this.encryptionFieldSignal()===dt.Key&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=R(()=>{let t=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=R(()=>{let e=this.generalFormSignal()?.password??"";return this.#n.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#i.exit(!0)}async copyPassword(){let t=this.generalForm.controls.password.value;await this.#r(t??""),this.copiedPassword.set(!0)}async#r(t){try{await navigator.clipboard.writeText(t)}catch{try{let i=document.createElement("textarea");i.value=t,document.body.appendChild(i),i.select(),document.execCommand("copy"),document.body.removeChild(i)}catch(i){console.error("Failed to copy text: ",i)}}}generatePassword(){this.copiedPassword.set(!1);let t=this.#n.generate(16);this.generalForm.controls.password.setValue(t),this.generalForm.controls.repeatPassword.setValue(t),this.showCopyPassword.set(!0)}next(){this.#i.shouldAutoSave()&&this.#i.submit(!0),this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=z({type:n,selectors:[["app-general"]],viewQuery:function(e,i){e&1&&ze(i.formRef,pl,5),e&2&&We()},decls:21,vars:4,consts:()=>{let t;t=$localize`Your backup name`;let e;e=$localize`Your backup description`;let i;i=$localize`Remember to copy the password`;let o;o=$localize`General backup settings`;let a;a=$localize` Backup name ${"\uFFFD#8\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#8\uFFFD"}:CLOSE_SUPERSCRIPT:`;let c;c=$localize`Backup description`;let d;d=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Exit `;let m;m=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Encrypted backup `;let T;T=$localize`Encryption`;let I;I=$localize`Encryption`;let P;P=$localize`Password`;let w;w=$localize`Repeat password`;let $;$=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let N;N=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,N=Ue(N);let K;K=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let J;J=$localize`Passwords do not match`;let L;L=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,L=Ue(L);let H;H=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let me;me=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let Ce;return Ce=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],o,a,c,d,m,I,$,N,K,J,L,H,me,Ce,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],[1,"primary"],["for","backupName"],["type","text","tabindex","1","placeholder",t,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","shButton","",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],["shButton","","type","submit","shTooltip",i,1,"raised","primary",3,"disabled"],["icon",""],["value","Key","label","DisplayName",3,"options","isClearable"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",T,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",P,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",w,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["shButton","","type","button",1,"small","copy",3,"click"],[1,"sh-success"]]},template:function(e,i){if(e&1&&(l(0,"form",15,0),E("submit",function(){return i.next()}),l(2,"h3",16),A(3,1),r(),C(4,ml,3,0,"sh-alert",17),l(5,"sh-form-field")(6,"label",18),y(7,2),O(8,"sup"),M(),r(),O(9,"input",19),r(),l(10,"sh-form-field")(11,"label",20),A(12,3),r(),O(13,"textarea",21),r(),C(14,Al,6,3),l(15,"div",22)(16,"button",23),E("click",function(){return i.exit()}),y(17,4),O(18,"sh-icon"),M(),r(),C(19,Il,3,1,"button",24)(20,Pl,3,1,"button",25),r()()),e&2){let o;u("formGroup",i.generalForm),_(4),g(!i.isNew()&&((o=i.generalFormSignal())==null?null:o.encryption)!==""?4:-1),_(10),g(i.isNew()?14:-1),_(5),g(i.encryptionFieldSignal()===i.noneOptionKey||!i.isNew()?19:20)}},dependencies:[qe,Dt,oe,ae,Nt,Pt,It,Te,Ge,ee,Z,xt,yt,$t],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--error-8)}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.copy[_ngcontent-%COMP%] sh-icon.sh-success[_ngcontent-%COMP%]{color:var(--success-8)}"],changeDetection:0})};export{Ze as a,et as b,Xt as c,kn as d,dt as e,on as f,Kt as g,Gn as h,Zt as i,Qt as j,st as k,jt as l,ct as m,bn as n,en as o,Me as p,Wt as q};
|
package/index.html
CHANGED
|
@@ -124,5 +124,5 @@
|
|
|
124
124
|
<body>
|
|
125
125
|
<app-root></app-root>
|
|
126
126
|
<div class="loading">Connecting ...</div>
|
|
127
|
-
<link rel="modulepreload" href="chunk-3XCT4PYH.js"><link rel="modulepreload" href="chunk-J5TWEZOP.js"><link rel="modulepreload" href="chunk-KHFOQETZ.js"><link rel="modulepreload" href="chunk-I625OICV.js"><link rel="modulepreload" href="chunk-XCVBN7EK.js"><link rel="modulepreload" href="chunk-ADB5QRUO.js"><link rel="modulepreload" href="chunk-22PELS6R.js"><link rel="modulepreload" href="chunk-6Q6SSTBK.js"><link rel="modulepreload" href="chunk-MRSBKQQM.js"><link rel="modulepreload" href="chunk-35APLYI4.js"><script src="polyfills-7RKI4BGK.js" type="module"></script><script src="main-
|
|
127
|
+
<link rel="modulepreload" href="chunk-3XCT4PYH.js"><link rel="modulepreload" href="chunk-J5TWEZOP.js"><link rel="modulepreload" href="chunk-KHFOQETZ.js"><link rel="modulepreload" href="chunk-I625OICV.js"><link rel="modulepreload" href="chunk-XCVBN7EK.js"><link rel="modulepreload" href="chunk-ADB5QRUO.js"><link rel="modulepreload" href="chunk-22PELS6R.js"><link rel="modulepreload" href="chunk-6Q6SSTBK.js"><link rel="modulepreload" href="chunk-MRSBKQQM.js"><link rel="modulepreload" href="chunk-35APLYI4.js"><script src="polyfills-7RKI4BGK.js" type="module"></script><script src="main-7HIGYDD6.js" type="module"></script></body>
|
|
128
128
|
</html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as Ie,c as ke}from"./chunk-3XCT4PYH.js";import{a as we}from"./chunk-J5TWEZOP.js";import{a as Ee}from"./chunk-KHFOQETZ.js";import{b as I}from"./chunk-I625OICV.js";import"./chunk-XCVBN7EK.js";import{a as Me}from"./chunk-ADB5QRUO.js";import{b as Te}from"./chunk-22PELS6R.js";import{a as V}from"./chunk-6Q6SSTBK.js";import{a as Se}from"./chunk-MRSBKQQM.js";import"./chunk-35APLYI4.js";import"./chunk-LU7TIW3P.js";import"./chunk-XZNYCTQB.js";import{a as H}from"./chunk-R6TFME5I.js";import{a as h,b as ye,c as v,d as Re,e as E}from"./chunk-AZRNX5LU.js";import{u as be,x as Ce}from"./chunk-NCXKMSRH.js";import{a as ge,e as ve}from"./chunk-QAQMMCTH.js";import{c as le,d as me,g as de,h as ue,i as he,j as fe}from"./chunk-KHZ5AXGT.js";import{a as ne}from"./chunk-L2QOWZDR.js";import{a as re,b as se,c as ie,e as ae,f as pe,g as ce}from"./chunk-BRL4YYWO.js";import{ha as te,ma as oe}from"./chunk-BDQJFOCO.js";import"./chunk-FSHBOASN.js";import{A as B,F as J,Fb as Y,L as T,Mc as Z,N as K,Nc as ee,V as C,Y as _,_ as s,f as F,g as W,gb as Q,ha as q,ia as z,l as $,m as G,pa as d,q as w,ra as X,z as P}from"./chunk-UH2E7MMT.js";import"./chunk-7CGTOI24.js";var k=class e{#e=s(h);#d=s(v);ngOnInit(){ye(),this.#d.fetchConfig(),this.#e.clearAllNotCurrentVersion()}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=Q({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(t,n){t&1&&Y(0,"router-outlet")},dependencies:[le],encapsulation:2})};var Ae={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var f=new _("ENVIRONMENT");var A=class e{#e=s(ve);isLoaded=d(!1);webmodules=d(null);preload(o=!1){let t=this.#e.getApiV1Webmodules().pipe(K(n=>this.webmodules.set(n)),J(()=>this.isLoaded.set(!0)));if(o)return t;t.subscribe()}static \u0275fac=function(t){return new(t||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ue=()=>{let e=s(E);return e.token()?!0:e.checkProxyAuthed().pipe(T(o=>o?$(!0):e.refreshToken().pipe(w(()=>!0))))},je=()=>{let e=s(v),o=s(I),t=s(q),n=e.relayIsEnabled()?"longpoll":"websocket",i=[t.get(H).preload(!0),t.get(H).preloadFilterGroups(!0),t.get(A).preload(!0)];return e.configLoaded===null?P(i).pipe(w(()=>n)):e.configLoaded?.pipe(T(()=>P(i)))},Fe=()=>!0,Ne={path:"connect/:typeParam",loadComponent:()=>import("./chunk-PBYZZEYM.js")},We=()=>{let e=s(h);return!e.getItem("locale")&&navigator.language&&e.setItem("locale",navigator.language),!0},Oe=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-S3FBC24H.js")},{path:"logout",loadComponent:()=>import("./chunk-OZEGNE5W.js")},{path:"",canActivate:[Ue],children:[{path:"",canActivate:[je,Fe,We],children:[{path:"welcome",loadComponent:()=>import("./chunk-GE3DHZ5E.js"),children:[{path:"",redirectTo:"select",pathMatch:"full"},{path:"select",loadComponent:()=>import("./chunk-5FQ5SDPZ.js")},Ne]},{path:"",loadComponent:()=>import("./chunk-EGTYGTQI.js"),children:[{path:"",loadComponent:()=>import("./chunk-CW43F6WE.js")},Ne,{path:"destinations",loadComponent:()=>import("./chunk-YHVGLFWL.js")},{path:"add-backup",loadComponent:()=>import("./chunk-CQYKOCGO.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-3PUCEFO5.js")},{path:"backup/import",loadComponent:()=>import("./chunk-WALKMFYR.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-Z7CZCI7E.js"),loadChildren:()=>import("./chunk-J5VU6VA4.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-Z7CZCI7E.js"),loadChildren:()=>import("./chunk-J5VU6VA4.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-VCIINZCU.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-JMLM4A3C.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-LQKECNBH.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-WIE7KXIC.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-QRLREAIK.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-T2X5J6MQ.js")},{path:"from-config",loadComponent:()=>import("./chunk-AMSFSVKQ.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-CFJXIOSV.js"),loadChildren:()=>import("./chunk-TGZAL6DJ.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-CFJXIOSV.js"),loadChildren:()=>import("./chunk-TGZAL6DJ.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-CFJXIOSV.js"),loadChildren:()=>import("./chunk-TGZAL6DJ.js")},{path:"status",loadComponent:()=>import("./chunk-R5OX4JTJ.js")},{path:"settings",loadComponent:()=>import("./chunk-V7UJAXBT.js")},{path:"about",loadComponent:()=>import("./chunk-XAYG4QT7.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-VDHWNNO7.js")},{path:"changelog",loadComponent:()=>import("./chunk-APAWDC4O.js")},{path:"libraries",loadComponent:()=>import("./chunk-DTIGWCAE.js")},{path:"system-info",loadComponent:()=>import("./chunk-2NLWVJNK.js")},{path:"server-settings",loadComponent:()=>import("./chunk-VI7MBIGT.js")},{path:"logs",loadChildren:()=>import("./chunk-EU6N52DH.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-J6WVOYQ6.js")}]}]}]}]}]}];var xe=(e,o)=>{let t=s(E),n=s(me),i=s(h),p=s(f),m=i.getItem("locale"),a=s(Ce),g=Ie(m),r=ge.BASE||"",c=e.url===`${r}/api/v1/auth/login`,u=e.url===`${r}/api/v1/auth/logout`,S=e.url===`${r}/api/v1/auth/refresh`,y=e.url===`${r}/api/v1/progressstate`,x=e.url===`${r}/api/v1/remoteoperation/test`,M=e.url===`${r}/api/v1/filesystem/validate`,De=e.url.startsWith(`${r}/api/v2/`),L=t.token(),U=e,j=e.headers.has("custom-proxy-check")||L===Re;if(L&&e.url.startsWith(r+p.baseUrl)&&!j){let l=e.headers.set("Authorization",`Bearer ${L}`);m&&m!=="en-US"&&(l=l.set("X-Ui-Language",g)),U=e.clone({headers:l})}return o(U).pipe(w(l=>{if(l.type===4&&l.status===200&&De){let b=l.body;if(b?.Success===!1)throw{status:200,message:b?.Error??"Unknown error",error:{Error:b?.Error??"Unknown error"},requestBody:b}}return l}),B(l=>{let b=l.error?.Error||`Error Code: ${l.status}, Message: ${l.message}`;if(!j){let R=!0;if((y&&l.status===404||x||M)&&(R=!1),S&&l.status===401&&(R=!1,t.logout(),n.navigate(["/logout"])),!c&&!S&&!u&&l.status===401)return R=!1,t.refreshToken().pipe(T(()=>o(e.clone({headers:e.headers.set("Authorization",`Bearer ${t.token()}`)}))));R&&a.error(b)}return G(()=>({error:l,message:b}))}))};var N=class e{#e=s(z);showError(o){let t=this.#e.querySelector("body > .loading");if(!t)return;t.classList.add("has-error"),t.innerHTML="";let n=this.#e.createElement("div");n.classList.add("loading-title"),n.textContent="Unable to connect";let i=this.#e.createElement("div");i.classList.add("loading-error"),i.textContent=o||"Unknown error";let p=this.#e.createElement("button");p.type="button",p.classList.add("retry-button"),p.textContent="Retry",p.addEventListener("click",()=>{this.#e.defaultView?.location.reload()}),t.append(n,i,p)}static \u0275fac=function(t){return new(t||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};var $e="1.0.0",Le=`portal-proxy-client-${V()}`,Ge=1,O=class e{#e=1e3;#d=s(f);#u=s(N);#o=d("disconnected");#h=d(this.#e);#a=d(!1);#n=d(!1);#p=d(null);#c=d(null);#s=!1;isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#o.asReadonly();#l=[];#r={};#t=null;#f=new TextDecoder("utf-8");#m=null;#y=X(()=>{let o=this.#a(),t=this.#h(),n=this.#p(),i=this.#c();if(!n||!i||!o||!t||t<this.#e){this.#m&&window.clearInterval(this.#m);return}this.#m=window.setInterval(()=>{this.connectToMachineServer(n,i)},t)});#i(o){this.#s||(this.#s=!0,this.#u.showError(o||"Unable to connect to the server."))}#g(){this.#s||(this.#s=!0)}utf8Atob(o){let t=Uint8Array.from(atob(o),i=>i.charCodeAt(0)),n=this.#f.decode(t);return n?JSON.parse(n):null}connectToMachineServer(o,t,n){let i=n?.reconnect??!1,p=this.wsState();(p==="disconnected"||p==="error"||i)&&(this.#t?.close(),this.#t=null),!this.#t&&(this.#s=!1,this.#t=new WebSocket(t),this.#o.set("connecting"),this.#t.onopen=()=>{this.#o.set("connect"),this.#n.set(!0),this.#a.set(!1),this.#p.set(null),this.#c.set(null)},this.#t.onclose=()=>{this.#o.set("disconnected"),this.#n.set(!1),this.#p.set(o),this.#c.set(t),this.#a.set(!0)},this.#t.onerror=()=>{this.#o.set("error")},this.#t.onmessage=m=>{let a=JSON.parse(m.data);if(this.wsState()==="connect"){if(a.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${a.type}'`);return}let r={token:o,publicKey:"",clientVersion:$e,protocolVersion:Ge},c=this.createResponse(a,"authportal",r);this.#o.set("welcome"),this.#t?.send(c)}else if(this.wsState()==="welcome"){if(a.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${a.type}'`);return}var g=JSON.parse(a.payload??"");if(g.accepted===!1){this.#i("Authentication failed"),this.disconnectFromMachineServer("Authentication failed");return}for(this.#o.set("authenticated"),this.#n.set(!0);this.#l.length>0;){let r=this.#l.pop();r&&this.#r[r.messageId]&&this.activateCommand(r)}}else if(this.wsState()==="authenticated"){if(a.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${a.type}'`);return}let r=this.#r[a.messageId];if(r){if(a.errorMessage)this.#i(a.errorMessage),r.reject(a.errorMessage);else{let c=JSON.parse(a.payload??"");c.statusCode>=400?this.#i(c.body||`Initial request failed with status code ${c.statusCode}`):this.#g(),c.body=c?.body==null?null:this.utf8Atob(c.body),r.resolve(c)}delete this.#r[a.messageId],window.clearTimeout(r.timer)}}})}disconnectFromMachineServer(o=null){o&&console.error(o),this.#t?.close(),this.#t=null,this.#o.set("disconnected"),this.#n.set(!1)}createResponse(o,t,n){let i={from:Le,to:o.from,type:t,messageId:o.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(o,t,n,i,p,m,a,g=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(o,n),new Promise((r,c)=>{let u=V(),y={from:Le,to:t,type:"command",messageId:u,payload:JSON.stringify({method:i,path:p,body:m,headers:a})},x={resolve:r,reject:c,timer:window.setTimeout(()=>{let M=this.#r[u];M&&(delete this.#r[u],this.#i("The request timed out before receiving a response."),M.reject("Timeout"))},g)};this.#r[u]=x,this.#n()?this.activateCommand(y):this.#l.push(y)})}activateCommand(o){this.#t?.send(JSON.stringify(o))}static \u0275fac=function(t){return new(t||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};function Be(e){if(typeof e!="string")return null;let t=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...t))}function Pe(e,o,t){let n=e.relayconfigState.config();if(n===null)return t(o);let i=Be(o.body),p={};o.headers.keys().forEach(r=>{p[r]=o.headers.get(r)??""});let m=o.headers.get("timeout"),a=m!==null?parseInt(m):e.defaultTimeout;o.url.startsWith("/api/v1/serverstate")&&o.url.includes("longpoll=true")&&(a=1e3*99);let g=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,n.machineServerUrl,o.method,o.url,i,p,a);return new F(r=>{g.then(c=>{let u=new re;p!=null&&Object.keys(p).forEach(y=>{u.set(y,p[y])});let S=new se({body:c.body,status:c.statusCode,statusText:"OK",headers:u});r.next(S),r.complete()}).catch(c=>{r.error(new ie({error:c??"Unknown error",status:0,statusText:c??"Unknown error"}))})})}var He=(e,o)=>{let t={relayconfigState:s(v),defaultTimeout:s(f).defaultTimeout,relayWebsocket:s(O)},n=t.relayconfigState.config();if(t.relayconfigState.configLoaded!==null&&n===null){let i=new W;return t.relayconfigState.configLoaded.subscribe(p=>{p&&Pe(t,e,o).subscribe(i)}),i}return Pe(t,e,o)};var Ve={providers:[Z(),ue(Oe,fe(),he(de)),ae(ce(),pe([He,xe])),h,{provide:f,useValue:Ae},{provide:ee,useValue:ke()},{provide:be,useValue:{alertVariant:"simple"}},we,I,Te,oe,Se,te,Me,Ee]};ne(k,Ve);
|
|
1
|
+
import{b as Ie,c as ke}from"./chunk-3XCT4PYH.js";import{a as we}from"./chunk-J5TWEZOP.js";import{a as Ee}from"./chunk-KHFOQETZ.js";import{b as I}from"./chunk-I625OICV.js";import"./chunk-XCVBN7EK.js";import{a as Me}from"./chunk-ADB5QRUO.js";import{b as Te}from"./chunk-22PELS6R.js";import{a as V}from"./chunk-6Q6SSTBK.js";import{a as Se}from"./chunk-MRSBKQQM.js";import"./chunk-35APLYI4.js";import"./chunk-LU7TIW3P.js";import"./chunk-XZNYCTQB.js";import{a as H}from"./chunk-R6TFME5I.js";import{a as h,b as ye,c as v,d as Re,e as E}from"./chunk-AZRNX5LU.js";import{u as be,x as Ce}from"./chunk-NCXKMSRH.js";import{a as ge,e as ve}from"./chunk-QAQMMCTH.js";import{c as le,d as me,g as de,h as ue,i as he,j as fe}from"./chunk-KHZ5AXGT.js";import{a as ne}from"./chunk-L2QOWZDR.js";import{a as re,b as se,c as ie,e as ae,f as pe,g as ce}from"./chunk-BRL4YYWO.js";import{ha as te,ma as oe}from"./chunk-BDQJFOCO.js";import"./chunk-FSHBOASN.js";import{A as B,F as J,Fb as Y,L as T,Mc as Z,N as K,Nc as ee,V as C,Y as _,_ as s,f as F,g as W,gb as Q,ha as q,ia as z,l as $,m as G,pa as d,q as w,ra as X,z as P}from"./chunk-UH2E7MMT.js";import"./chunk-7CGTOI24.js";var k=class e{#e=s(h);#d=s(v);ngOnInit(){ye(),this.#d.fetchConfig(),this.#e.clearAllNotCurrentVersion()}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=Q({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(t,n){t&1&&Y(0,"router-outlet")},dependencies:[le],encapsulation:2})};var Ae={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var f=new _("ENVIRONMENT");var A=class e{#e=s(ve);isLoaded=d(!1);webmodules=d(null);preload(o=!1){let t=this.#e.getApiV1Webmodules().pipe(K(n=>this.webmodules.set(n)),J(()=>this.isLoaded.set(!0)));if(o)return t;t.subscribe()}static \u0275fac=function(t){return new(t||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ue=()=>{let e=s(E);return e.token()?!0:e.checkProxyAuthed().pipe(T(o=>o?$(!0):e.refreshToken().pipe(w(()=>!0))))},je=()=>{let e=s(v),o=s(I),t=s(q),n=e.relayIsEnabled()?"longpoll":"websocket",i=[t.get(H).preload(!0),t.get(H).preloadFilterGroups(!0),t.get(A).preload(!0)];return e.configLoaded===null?P(i).pipe(w(()=>n)):e.configLoaded?.pipe(T(()=>P(i)))},Fe=()=>!0,Ne={path:"connect/:typeParam",loadComponent:()=>import("./chunk-PBYZZEYM.js")},We=()=>{let e=s(h);return!e.getItem("locale")&&navigator.language&&e.setItem("locale",navigator.language),!0},Oe=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-S3FBC24H.js")},{path:"logout",loadComponent:()=>import("./chunk-OZEGNE5W.js")},{path:"",canActivate:[Ue],children:[{path:"",canActivate:[je,Fe,We],children:[{path:"welcome",loadComponent:()=>import("./chunk-GE3DHZ5E.js"),children:[{path:"",redirectTo:"select",pathMatch:"full"},{path:"select",loadComponent:()=>import("./chunk-5FQ5SDPZ.js")},Ne]},{path:"",loadComponent:()=>import("./chunk-EGTYGTQI.js"),children:[{path:"",loadComponent:()=>import("./chunk-CW43F6WE.js")},Ne,{path:"destinations",loadComponent:()=>import("./chunk-22YUDKKU.js")},{path:"add-backup",loadComponent:()=>import("./chunk-CQYKOCGO.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-3PUCEFO5.js")},{path:"backup/import",loadComponent:()=>import("./chunk-WALKMFYR.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-AJZA5YWT.js"),loadChildren:()=>import("./chunk-C2NKW2QW.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-AJZA5YWT.js"),loadChildren:()=>import("./chunk-C2NKW2QW.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-VCIINZCU.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-JMLM4A3C.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-GCYBVLSX.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-WIE7KXIC.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-QRLREAIK.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-T2X5J6MQ.js")},{path:"from-config",loadComponent:()=>import("./chunk-AMSFSVKQ.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-7WOSHJ7G.js"),loadChildren:()=>import("./chunk-IJHPC43D.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-7WOSHJ7G.js"),loadChildren:()=>import("./chunk-IJHPC43D.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-7WOSHJ7G.js"),loadChildren:()=>import("./chunk-IJHPC43D.js")},{path:"status",loadComponent:()=>import("./chunk-R5OX4JTJ.js")},{path:"settings",loadComponent:()=>import("./chunk-V7UJAXBT.js")},{path:"about",loadComponent:()=>import("./chunk-XAYG4QT7.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-VDHWNNO7.js")},{path:"changelog",loadComponent:()=>import("./chunk-APAWDC4O.js")},{path:"libraries",loadComponent:()=>import("./chunk-DTIGWCAE.js")},{path:"system-info",loadComponent:()=>import("./chunk-2NLWVJNK.js")},{path:"server-settings",loadComponent:()=>import("./chunk-VI7MBIGT.js")},{path:"logs",loadChildren:()=>import("./chunk-EU6N52DH.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-J6WVOYQ6.js")}]}]}]}]}]}];var xe=(e,o)=>{let t=s(E),n=s(me),i=s(h),p=s(f),m=i.getItem("locale"),a=s(Ce),g=Ie(m),r=ge.BASE||"",c=e.url===`${r}/api/v1/auth/login`,u=e.url===`${r}/api/v1/auth/logout`,S=e.url===`${r}/api/v1/auth/refresh`,y=e.url===`${r}/api/v1/progressstate`,x=e.url===`${r}/api/v1/remoteoperation/test`,M=e.url===`${r}/api/v1/filesystem/validate`,De=e.url.startsWith(`${r}/api/v2/`),L=t.token(),U=e,j=e.headers.has("custom-proxy-check")||L===Re;if(L&&e.url.startsWith(r+p.baseUrl)&&!j){let l=e.headers.set("Authorization",`Bearer ${L}`);m&&m!=="en-US"&&(l=l.set("X-Ui-Language",g)),U=e.clone({headers:l})}return o(U).pipe(w(l=>{if(l.type===4&&l.status===200&&De){let b=l.body;if(b?.Success===!1)throw{status:200,message:b?.Error??"Unknown error",error:{Error:b?.Error??"Unknown error"},requestBody:b}}return l}),B(l=>{let b=l.error?.Error||`Error Code: ${l.status}, Message: ${l.message}`;if(!j){let R=!0;if((y&&l.status===404||x||M)&&(R=!1),S&&l.status===401&&(R=!1,t.logout(),n.navigate(["/logout"])),!c&&!S&&!u&&l.status===401)return R=!1,t.refreshToken().pipe(T(()=>o(e.clone({headers:e.headers.set("Authorization",`Bearer ${t.token()}`)}))));R&&a.error(b)}return G(()=>({error:l,message:b}))}))};var N=class e{#e=s(z);showError(o){let t=this.#e.querySelector("body > .loading");if(!t)return;t.classList.add("has-error"),t.innerHTML="";let n=this.#e.createElement("div");n.classList.add("loading-title"),n.textContent="Unable to connect";let i=this.#e.createElement("div");i.classList.add("loading-error"),i.textContent=o||"Unknown error";let p=this.#e.createElement("button");p.type="button",p.classList.add("retry-button"),p.textContent="Retry",p.addEventListener("click",()=>{this.#e.defaultView?.location.reload()}),t.append(n,i,p)}static \u0275fac=function(t){return new(t||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};var $e="1.0.0",Le=`portal-proxy-client-${V()}`,Ge=1,O=class e{#e=1e3;#d=s(f);#u=s(N);#o=d("disconnected");#h=d(this.#e);#a=d(!1);#n=d(!1);#p=d(null);#c=d(null);#s=!1;isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#o.asReadonly();#l=[];#r={};#t=null;#f=new TextDecoder("utf-8");#m=null;#y=X(()=>{let o=this.#a(),t=this.#h(),n=this.#p(),i=this.#c();if(!n||!i||!o||!t||t<this.#e){this.#m&&window.clearInterval(this.#m);return}this.#m=window.setInterval(()=>{this.connectToMachineServer(n,i)},t)});#i(o){this.#s||(this.#s=!0,this.#u.showError(o||"Unable to connect to the server."))}#g(){this.#s||(this.#s=!0)}utf8Atob(o){let t=Uint8Array.from(atob(o),i=>i.charCodeAt(0)),n=this.#f.decode(t);return n?JSON.parse(n):null}connectToMachineServer(o,t,n){let i=n?.reconnect??!1,p=this.wsState();(p==="disconnected"||p==="error"||i)&&(this.#t?.close(),this.#t=null),!this.#t&&(this.#s=!1,this.#t=new WebSocket(t),this.#o.set("connecting"),this.#t.onopen=()=>{this.#o.set("connect"),this.#n.set(!0),this.#a.set(!1),this.#p.set(null),this.#c.set(null)},this.#t.onclose=()=>{this.#o.set("disconnected"),this.#n.set(!1),this.#p.set(o),this.#c.set(t),this.#a.set(!0)},this.#t.onerror=()=>{this.#o.set("error")},this.#t.onmessage=m=>{let a=JSON.parse(m.data);if(this.wsState()==="connect"){if(a.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${a.type}'`);return}let r={token:o,publicKey:"",clientVersion:$e,protocolVersion:Ge},c=this.createResponse(a,"authportal",r);this.#o.set("welcome"),this.#t?.send(c)}else if(this.wsState()==="welcome"){if(a.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${a.type}'`);return}var g=JSON.parse(a.payload??"");if(g.accepted===!1){this.#i("Authentication failed"),this.disconnectFromMachineServer("Authentication failed");return}for(this.#o.set("authenticated"),this.#n.set(!0);this.#l.length>0;){let r=this.#l.pop();r&&this.#r[r.messageId]&&this.activateCommand(r)}}else if(this.wsState()==="authenticated"){if(a.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${a.type}'`);return}let r=this.#r[a.messageId];if(r){if(a.errorMessage)this.#i(a.errorMessage),r.reject(a.errorMessage);else{let c=JSON.parse(a.payload??"");c.statusCode>=400?this.#i(c.body||`Initial request failed with status code ${c.statusCode}`):this.#g(),c.body=c?.body==null?null:this.utf8Atob(c.body),r.resolve(c)}delete this.#r[a.messageId],window.clearTimeout(r.timer)}}})}disconnectFromMachineServer(o=null){o&&console.error(o),this.#t?.close(),this.#t=null,this.#o.set("disconnected"),this.#n.set(!1)}createResponse(o,t,n){let i={from:Le,to:o.from,type:t,messageId:o.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(o,t,n,i,p,m,a,g=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(o,n),new Promise((r,c)=>{let u=V(),y={from:Le,to:t,type:"command",messageId:u,payload:JSON.stringify({method:i,path:p,body:m,headers:a})},x={resolve:r,reject:c,timer:window.setTimeout(()=>{let M=this.#r[u];M&&(delete this.#r[u],this.#i("The request timed out before receiving a response."),M.reject("Timeout"))},g)};this.#r[u]=x,this.#n()?this.activateCommand(y):this.#l.push(y)})}activateCommand(o){this.#t?.send(JSON.stringify(o))}static \u0275fac=function(t){return new(t||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};function Be(e){if(typeof e!="string")return null;let t=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...t))}function Pe(e,o,t){let n=e.relayconfigState.config();if(n===null)return t(o);let i=Be(o.body),p={};o.headers.keys().forEach(r=>{p[r]=o.headers.get(r)??""});let m=o.headers.get("timeout"),a=m!==null?parseInt(m):e.defaultTimeout;o.url.startsWith("/api/v1/serverstate")&&o.url.includes("longpoll=true")&&(a=1e3*99);let g=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,n.machineServerUrl,o.method,o.url,i,p,a);return new F(r=>{g.then(c=>{let u=new re;p!=null&&Object.keys(p).forEach(y=>{u.set(y,p[y])});let S=new se({body:c.body,status:c.statusCode,statusText:"OK",headers:u});r.next(S),r.complete()}).catch(c=>{r.error(new ie({error:c??"Unknown error",status:0,statusText:c??"Unknown error"}))})})}var He=(e,o)=>{let t={relayconfigState:s(v),defaultTimeout:s(f).defaultTimeout,relayWebsocket:s(O)},n=t.relayconfigState.config();if(t.relayconfigState.configLoaded!==null&&n===null){let i=new W;return t.relayconfigState.configLoaded.subscribe(p=>{p&&Pe(t,e,o).subscribe(i)}),i}return Pe(t,e,o)};var Ve={providers:[Z(),ue(Oe,fe(),he(de)),ae(ce(),pe([He,xe])),h,{provide:f,useValue:Ae},{provide:ee,useValue:ke()},{provide:be,useValue:{alertVariant:"simple"}},we,I,Te,oe,Se,te,Me,Ee]};ne(k,Ve);
|
package/package.json
CHANGED
package/chunk-J5VU6VA4.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-C5OIC3DB.js")},{path:"destination",loadComponent:()=>import("./chunk-KMGGFCBZ.js")},{path:"source-data",loadComponent:()=>import("./chunk-ZJOUYWI2.js")},{path:"schedule",loadComponent:()=>import("./chunk-JLSU6WKG.js")},{path:"options",loadComponent:()=>import("./chunk-TPHRU6NP.js")}];export{o as default};
|
package/chunk-TGZAL6DJ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-3IZWJV72.js")},{path:"encryption",loadComponent:()=>import("./chunk-IWDA6CMP.js")},{path:"select-files",loadComponent:()=>import("./chunk-UE37PPYX.js")},{path:"options",loadComponent:()=>import("./chunk-5REJ6F23.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-SGLY2D7Y.js")}],t=o;export{t as default};
|