@duplicati/ngclient 0.0.111 → 0.0.112
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-HPGYPP74.js → chunk-2JKJCHMV.js} +1 -1
- package/{chunk-SKJ6XSV3.js → chunk-2LP4DYGQ.js} +1 -1
- package/chunk-2N2WJIUS.js +1 -0
- package/{chunk-MHHVE6AV.js → chunk-3AU26GAL.js} +1 -1
- package/{chunk-P5SS3OV3.js → chunk-6JLZLD5D.js} +1 -1
- package/{chunk-65OCE2TY.js → chunk-6OAGVTHV.js} +1 -1
- package/{chunk-TJS6O6KD.js → chunk-7JUYF3HW.js} +1 -1
- package/{chunk-RQSBT3TK.js → chunk-7NFVFBIE.js} +1 -1
- package/{chunk-7S5SYCMV.js → chunk-7ROGJAJZ.js} +1 -1
- package/{chunk-HLHNKLWF.js → chunk-7RTXH4CB.js} +1 -1
- package/{chunk-QKA2VJWD.js → chunk-AX5RFEOL.js} +1 -1
- package/chunk-BVTZNGGE.js +1 -0
- package/{chunk-4RGZG24K.js → chunk-CD3DB23J.js} +1 -1
- package/{chunk-IIB7YCLW.js → chunk-CIGZ6WGG.js} +1 -1
- package/chunk-DDIVZTRS.js +1 -0
- package/chunk-DMDYUREZ.js +8 -0
- package/{chunk-DDM4R5FN.js → chunk-DMZ5CRRQ.js} +1 -1
- package/{chunk-T33TACR6.js → chunk-EP7S6KOG.js} +1 -1
- package/{chunk-CHRKPWRG.js → chunk-F4EEOSGJ.js} +1 -1
- package/{chunk-URU2SLPX.js → chunk-GJROCOAD.js} +1 -1
- package/{chunk-BOBAN442.js → chunk-H632X43F.js} +1 -1
- package/chunk-IDOYGPGZ.js +1 -0
- package/{chunk-YJNKW5ES.js → chunk-IPRTKJDE.js} +1 -1
- package/chunk-J7PTPA7J.js +1 -0
- package/chunk-JP7GZSDH.js +1 -0
- package/{chunk-3M3M4YXP.js → chunk-JPF4Y3PP.js} +1 -1
- package/{chunk-4AECHE4W.js → chunk-JSGFZ2GA.js} +1 -1
- package/{chunk-QP4QZQOW.js → chunk-KHC3VCF4.js} +1 -1
- package/{chunk-2ZVLF3KW.js → chunk-KIUU6RPZ.js} +1 -1
- package/{chunk-NP4VUDPK.js → chunk-KXLXF2JD.js} +1 -1
- package/{chunk-45RYC5NZ.js → chunk-N5ASXZEE.js} +1 -1
- package/{chunk-Z4MV4ZSL.js → chunk-NHQOHNI2.js} +1 -1
- package/{chunk-6OKAWH4X.js → chunk-NQNRR7VE.js} +1 -1
- package/{chunk-WEQQEKIH.js → chunk-OHQK4UOI.js} +1 -1
- package/{chunk-YJSWEW6C.js → chunk-ORDORLQT.js} +1 -1
- package/{chunk-GDHVQU56.js → chunk-OTLEEXAA.js} +1 -1
- package/chunk-OWDXYX4N.js +1 -0
- package/{chunk-2MCIQSK2.js → chunk-PQVEQNEN.js} +1 -1
- package/{chunk-XTWVXTYP.js → chunk-Q6GENX6C.js} +1 -1
- package/{chunk-XJAEXNPS.js → chunk-RRBU7RBN.js} +1 -1
- package/{chunk-WQLN5T4T.js → chunk-RTXTOPSU.js} +1 -1
- package/{chunk-KEAH5JAH.js → chunk-SQQMYNOF.js} +1 -1
- package/{chunk-25ZZFR2F.js → chunk-T5X5KX6A.js} +1 -1
- package/{chunk-LQ5ORNDI.js → chunk-THDYLLMU.js} +1 -1
- package/{chunk-PFE36372.js → chunk-TK4BPZWA.js} +1 -1
- package/{chunk-PN73DZ2H.js → chunk-TMD3MDHS.js} +1 -1
- package/{chunk-ZMDK6XIQ.js → chunk-TSIPKXNX.js} +1 -1
- package/{chunk-JIPJYOH5.js → chunk-VINJGSIH.js} +1 -1
- package/{chunk-CR4OKZPA.js → chunk-VZBHJ6AU.js} +1 -1
- package/chunk-WLIE4IB5.js +1 -0
- package/chunk-XL2NKFYE.js +1 -0
- package/{chunk-2KUDLHPP.js → chunk-YDR42CNA.js} +1 -1
- package/chunk-ZXWA7BUQ.js +1 -0
- package/{chunk-UMP4YQXB.js → chunk-ZYGT7OII.js} +1 -1
- package/index.html +1 -1
- package/{main-S6Q4T2BU.js → main-3OUIM37D.js} +1 -1
- package/package.json +1 -1
- package/chunk-3KSBRC3X.js +0 -1
- package/chunk-AADIFDNE.js +0 -1
- package/chunk-D3I33UIQ.js +0 -1
- package/chunk-JD54W4UA.js +0 -8
- package/chunk-LZUCVLMF.js +0 -1
- package/chunk-QJILVQSS.js +0 -1
- package/chunk-VLIGMNJX.js +0 -1
- package/chunk-W577IVOD.js +0 -1
- package/chunk-X4SAPDOB.js +0 -1
- package/chunk-X5YRWKCW.js +0 -1
- package/chunk-YD7PS7OS.js +0 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{a as qt,b as Yt}from"./chunk-6DH6O5YE.js";import{a as _t}from"./chunk-ORDORLQT.js";import{a as qe}from"./chunk-VN7JM6M3.js";import{a as Xt,b as Mt,c as jt}from"./chunk-KSP3JQHY.js";import{a as j}from"./chunk-HTNYQE2B.js";import{a as Le}from"./chunk-GJROCOAD.js";import{a as J}from"./chunk-7L42EO7J.js";import{b as Ve,c as _e,d as Fe,e as ge,f as Ue,g as ut,h as Be,i as Ke,j as We,m as dt,n as ze,o as mt,p as Ht,q as He,r as Ce,s as Xe,t as je}from"./chunk-T2OUHRUV.js";import{b as Ae,d as pe}from"./chunk-QVIZK4WW.js";import{A as pt,a as ue,b as lt,d as Wt,e as ve,g as be,l as de,o as zt,p as ct,t as me,z as Ge}from"./chunk-WX7L7V6J.js";import{h as Ie}from"./chunk-JSGFZ2GA.js";import{i as Kt}from"./chunk-CKPICCFH.js";import{$b as m,Ab as X,Ac as b,Bb as et,Bc as st,Cb as G,F as Ze,Gb as y,Hb as A,Ib as R,Jb as At,Kb as Pt,Lb as Oe,Mb as P,Nb as p,Qa as l,Qb as ce,S as ye,Sb as Bt,Tb as W,Xa as Me,Y as O,Yb as we,Zb as Re,_b as re,ab as le,ac as xe,bc as Y,cc as Nt,da as F,ea as g,ec as U,f as at,fb as _,fc as B,gc as K,hc as kt,ic as Ot,ja as Vt,jc as $t,lc as tt,mb as Ut,mc as nt,nb as u,oc as it,pb as ke,qa as Et,r as Je,ra as yt,sb as T,sc as ot,tb as te,ua as E,ub as ne,vb as ie,wb as s,xb as a,yb as d,zb as H}from"./chunk-W2F756OF.js";import{a as h,b as Ee,c as Lt}from"./chunk-7CGTOI24.js";var Ft=class t{#n=O(Ie);#t=O(ve);#e=O(Le);testDestination(n,e,i){return this.#e.hasV2TestOperations()?this.testDestinationv2(n,e,i):this.testDestinationv1(n,e,i)}testDestinationv2(n,e,i){return new at(o=>{this.#n.postApiV2DestinationTest({requestBody:{DestinationUrl:n,AutoCreate:!1,Options:null}}).subscribe({next:r=>{if(r.Success){o.next({action:"success",targetUrl:n,testAgain:!1,destinationIndex:e,anyFilesFound:!r.Data?.FolderIsEmpty,containsBackup:r.Data?.FolderContainsBackupFiles??void 0,containsEncryptedBackupFiles:r.Data?.FolderContainsEncryptedBackupFiles??void 0}),o.complete();return}this.handleGenericError(o,n,e,r.Error??"Unknown error")},error:r=>{let c=r?.error?.body;if(c?.Data?.FolderExists===!1||c?.StatusCode==="missing-folder"){i?this.handleMissingFolder(o,n,e):this.handleGenericError(o,n,e,$localize`The remote destination folder does not exist.`);return}if(c?.Data?.HostCertificate){this.handleMissingCertificate(o,n,e,c.Data?.HostCertificate);return}if(c?.Data?.ReportedHostKey){this.handleIncorrectKey(o,n,e,c.Data.ReportedHostKey,c.Data.AcceptedHostKey??null);return}this.handleGenericError(o,n,e,r?.message??"Unknown error")}})})}testDestinationv1(n,e,i){return new at(o=>{this.#n.postApiV1RemoteoperationTest({requestBody:{path:n}}).subscribe({next:r=>{o.next({action:"success",targetUrl:n,testAgain:!1,destinationIndex:e}),o.complete()},error:r=>{this.handleDestinationErrorv1(r.message,n,e,i).subscribe(c=>{o.next(c)})}})})}handleMissingFolder(n,e,i){this.#t.open(J,{data:{title:$localize`Create folder`,message:$localize`The remote destination folder does not exist, do you want to create it?`,confirmText:$localize`Create folder`,cancelText:$localize`Cancel`},closed:o=>{o&&(this.#e.hasV2TestOperations()?this.#n.postApiV2DestinationTest({requestBody:{DestinationUrl:e,AutoCreate:!0,Options:null}}).subscribe({next:r=>{r.Success?this.handleFolderCreated(n,e,i):this.handleFolderCreateFailure(n,e,i,r.Error??$localize`Unknown error`)},error:r=>{this.handleFolderCreateFailure(n,e,i,r.message??$localize`Unknown error`)}}):this.#n.postApiV1RemoteoperationCreate({requestBody:{path:e}}).subscribe({next:()=>{this.handleFolderCreated(n,e,i)},error:r=>{this.handleFolderCreateFailure(n,e,i,r.message??$localize`Unknown error`)}}))}})}handleFolderCreateFailure(n,e,i,o){this.#t.open(J,{data:{title:$localize`Error creating folder`,message:$localize`The remote destination folder could not be created. ${o}`,confirmText:$localize`OK`,cancelText:null},closed:()=>{n.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:i}),n.complete()}})}handleFolderCreated(n,e,i){this.#t.open(J,{data:{title:$localize`Folder created`,message:$localize`The remote destination folder was created successfully.`,confirmText:$localize`OK`,cancelText:null},closed:()=>{n.next({action:"test-again",targetUrl:e,testAgain:!0,destinationIndex:i}),n.complete()}})}reportNoAction(n,e,i){n.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:i}),n.complete()}handleMissingCertificate(n,e,i,o){this.#t.open(J,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
|
|
2
|
+
If this is a self-signed certificate, you can choose to trust this certificate.
|
|
3
|
+
The server reported the certificate hash: ${o}`,confirmText:$localize`Trust the certificate`,cancelText:$localize`Cancel`},closed:r=>{if(!r){this.reportNoAction(n,e,i);return}n.next({action:"trust-cert",targetUrl:e,testAgain:!0,certData:o,destinationIndex:i}),n.complete()}})}handleIncorrectKey(n,e,i,o,r){r?this.#t.open(J,{maxWidth:"500px",data:{title:$localize`The host key has changed`,message:$localize`The host key has changed, please check with the server administrator if this is correct,
|
|
4
|
+
otherwise you could be the victim of a MAN-IN-THE-MIDDLE attack.
|
|
5
|
+
Do you want to REPLACE your CURRENT host key ${r}
|
|
6
|
+
with the REPORTED host key: ${o}?`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:c=>{if(!c){this.reportNoAction(n,e,i);return}n.next({action:"approve-host-key",targetUrl:e,testAgain:!0,reportedHostKey:o,destinationIndex:i}),n.complete()}}):this.#t.open(J,{maxWidth:"500px",data:{title:$localize`Approve host key?`,message:$localize`No certificate was specified, please verify that the reported host key is correct: ${o}`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:c=>{if(!c){this.reportNoAction(n,e,i);return}n.next({action:"approve-host-key",targetUrl:e,testAgain:!0,reportedHostKey:o,destinationIndex:i}),n.complete()}})}handleGenericError(n,e,i,o){this.#t.open(J,{maxWidth:"500px",data:{title:$localize`Test connection failed`,message:o,cancelText:$localize`OK`},closed:r=>{n.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:i}),n.complete()}})}handleDestinationErrorv1(n,e,i,o){return new at(r=>{if(n==="missing-folder"){o?this.handleMissingFolder(r,e,i):this.handleGenericError(r,e,i,$localize`The remote destination folder does not exist.`);return}if(n.startsWith("incorrect-cert:")){let c=n.split("incorrect-cert:")[1];this.handleMissingCertificate(r,e,i,c);return}if(n.startsWith("incorrect-host-key:")){let c=n.split('incorrect-host-key:"')[1].split('",')[0],f=n.split('accepted-host-key:"')[1].split('",')[0];this.handleIncorrectKey(r,e,i,c,f);return}this.handleGenericError(r,e,i,n)})}static \u0275fac=function(e){return new(e||t)};static \u0275prov=ye({token:t,factory:t.\u0275fac,providedIn:"root"})};var gt=class t{fromString(n){if(!n)return null;let e=n.match(/(\d+)([smhDWMY])/);return e&&{value:parseInt(e[1]),unit:e[2]}}toString(n,e){return`${n}${e}`}static \u0275fac=function(e){return new(e||t)};static \u0275prov=ye({token:t,factory:t.\u0275fac,providedIn:"root"})};var he=class t{#n=O(Ie);s3Providers=j(this.getS3Config("Providers"));s3Regions=j(this.getS3Config("Regions"));s3RegionHosts=j(this.getS3Config("RegionHosts"));s3StorageClasses=j(this.getS3Config("StorageClasses"));storjSatellites=j(this.getStorjConfig("Satellites"));storjAuthenticationMethods=j(this.getStorjConfig("AuthenticationMethods"));openstackProviders=j(this.getOpenstackConfig("Providers"));openstackVersions=j(this.getOpenstackConfig("Versions"));gcsLocations=j(this.getGcsConfig("Locations"));gcsStorageClasses=j(this.getGcsConfig("StorageClasses"));getS3Config(n){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"s3-getconfig",requestBody:{"s3-config":n}}).pipe(Je(e=>this.#t(e)))}createS3IamUser(n,e){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"CanCreateUser","s3-username":n,"s3-password":e}})}createS3PolicyIAM(n){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"GetPolicyDoc",path:n}})}getStorjConfig(n){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"storj-getconfig",requestBody:{"storj-config":n}}).pipe(Je(e=>this.#t(e)))}getOpenstackConfig(n){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"openstack-getconfig",requestBody:{"openstack-config":n}}).pipe(Je(e=>this.#t(e)))}getGcsConfig(n){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"gcs-getconfig",requestBody:{"gcs-config":n}}).pipe(Je(e=>this.#t(e)))}#t(n){return(n.Result&&typeof n.Result=="object"&&Object.entries(n.Result).map(([e,i])=>({key:e,value:i})))??[]}static \u0275fac=function(e){return new(e||t)};static \u0275prov=ye({token:t,factory:t.\u0275fac,providedIn:"root"})};function Ne(t){return t==null||t===""?"":":"+t.toString()}function Q(t){return t==null?"":t.startsWith("/")?t:"/"+t}function $(t,n){let e={},i={},o=Se.find(r=>r.key===t);return n.searchParams.forEach((r,c)=>{o?.dynamicFields?.some(N=>N===c||N?.name===c)?i[c]=decodeURIComponent(r):e[c]=decodeURIComponent(r)}),{advanced:e,dynamic:i}}function M(t,n=!1){let e=t.map(([o,r])=>`${o}=${r?encodeURIComponent(r.toString()):""}`).join("&");return e?(n?"":"?")+e:""}function Ct(t){let n=t.destinationType,e=Se.find(i=>i.customKey===n||i.key===n);if(!e)throw new Error("Invalid destination type");return e?.mapper.to(t)??""}function wt(t){let n=URL.canParse(t),e=t.split("://")[0],i=t.split("://")[1],o="http://"+i;if(i.startsWith("%")&&e==="file")return Se.find(r=>r.customKey===e||r.key===e)?.mapper.from(e,new URL("http://localhost"),t);try{let r=new URL(o);return Se.find(c=>c.customKey===e||c.key===e)?.mapper.from(e,r,t)}catch(r){console.error("Error while parsing target path",r)}if(!n)throw new Error("Invalid target path");return null}var C=new Ce,Se=[{key:"file",displayName:"File system",description:"Store backups on your local file system.",customFields:{path:{type:"FolderTree",name:"path",shortDescription:"File path",longDescription:"The path to store the backup",formElement:t=>C.control(t??"")}},mapper:{to:t=>{let n=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${t.custom.path}${n}`},from:(t,n,e)=>{let o=e.startsWith("file:///")?e.split("file:///")[1]:e.split("file://")[1],r=o.startsWith("%"),f=o.slice(1).startsWith(":\\")||r?o:"/"+o;return h({destinationType:t,custom:{path:f}},$(t,n))}}},{key:"ssh",displayName:"SSH",description:"Store backups in SSH.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"The server to connect to",formElement:t=>C.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"The port to connect to",formElement:t=>C.control(t??"",[Fe.required,Fe.max(65535)])},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:t=>C.control(t??"")}},dynamicFields:["auth-username"],advancedFields:[{type:"FileTree",name:"ssh-keyfile",accepts:".key,",shortDescription:"This is a path to a private key file locally on the machine",longDescription:"This is a path to a private key file locally on the machine"}],mapper:{to:t=>{let n=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{port:e,server:i,path:o}=t.custom;return`${t.destinationType}://${i+Ne(e)+Q(o)+n}`},from:(t,n,e)=>h({destinationType:t,custom:{server:n.hostname,port:n.port,path:n.pathname}},$(t,n))}},{key:"s3",displayName:"S3 compatible bucket",description:"Store backups in any S3 compatible bucket.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:t=>C.control(t??"")},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"s3-server-name",shortDescription:"Server",type:"NonValidatedSelectableString",loadOptions:t=>t.get(he).s3Providers},"use-ssl","auth-username","auth-password"],advancedFields:[{name:"s3-client",type:"Enumeration",options:["aws","minio"]},{name:"s3-storage-class",type:"NonValidatedSelectableString",loadOptions:t=>t.get(he).s3StorageClasses}],mapper:{to:t=>{let{bucket:n,path:e}=t.custom,i=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n+Q(e)+i}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.pathname,bucket:n.hostname}},$(t,n))}},{key:"gcs",displayName:"Google Cloud Storage",description:"Store backups in Google Cloud Storage.",oauthField:"authid",customFields:{path:{type:"Path",name:"path",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"gcs-location",type:"NonValidatedSelectableString",loadOptions:t=>t.get(he).gcsLocations},{name:"gcs-storage-class",type:"NonValidatedSelectableString",loadOptions:t=>t.get(he).gcsStorageClasses},"authid"],mapper:{to:t=>{let n=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${t.custom.path}${n}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"googledrive",displayName:"Google Drive",description:"Store backups in Google Drive.",oauthField:"authid",customFields:{path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"authid",type:"Password"}],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"pcloud",displayName:"pCloud",description:"Store backups in pCloud.",oauthField:"authid",customFields:{server:{type:"Enumeration",name:"server",loadOptions:()=>E([{key:"pCloud Global",value:"api.pcloud.com"},{key:"pCloud Europe",value:"eapi.pcloud.com"}]),shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:t=>C.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{server:e,path:i}=t.custom;return`${t.destinationType}://${e+Q(i)+n}`},from:(t,n,e)=>{let i=n.pathname.replace(/^\//,"");return h({destinationType:t,custom:{server:n.hostname,path:i}},$(t,n))}}},{key:"azure",displayName:"Azure Blob Storage",description:"Store backups in Azure Blob Storage.",customFields:{path:{type:"String",name:"path",shortDescription:"Container name",longDescription:"Container name",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"onedrivev2",displayName:"OneDrive",description:"Store backups in OneDrive.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"od4b",displayName:"OneDrive Business",description:"Store backups in OneDrive Business.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:t=>{let n=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{port:e,server:i,path:o}=t.custom;return`${t.destinationType}://${i+Ne(e)+Q(o)+n}`},from:(t,n,e)=>h({destinationType:t,custom:{server:n.hostname,port:n.port,path:n.pathname}},$(t,n))}},{key:"mssp",displayName:"Microsoft SharePoint",description:"Store backups in Microsoft SharePoint.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:t=>{let n=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{port:e,server:i,path:o}=t.custom;return`${t.destinationType}://${i+Ne(e)+Q(o)+n}`},from:(t,n,e)=>h({destinationType:t,custom:{server:n.hostname,port:n.port,path:n.pathname}},$(t,n))}},{key:"sharepoint",displayName:"Microsoft SharePoint v2",description:"Store backups in Microsoft SharePoint.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"dropbox",displayName:"Dropbox",description:"Store backups in Dropbox.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"box",displayName:"Box.com",description:"Store backups in Box.com.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"jottacloud",displayName:"Jottacloud",description:"Store backups in Jottacloud.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"b2",displayName:"B2 Cloud Storage",description:"Store backups in B2 Cloud Storage.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path in the bucket",longDescription:"Path in the bucket",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Application ID"},{name:"auth-password",shortDescription:"Application Key"}],mapper:{to:t=>{let{bucket:n,path:e}=t.custom,i=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n+Q(e)+i}`},from:(t,n,e)=>h({destinationType:t,custom:{bucket:n.hostname,path:decodeURIComponent(n.pathname)}},$(t,n))}},{key:"e2",displayName:"IDrive e2",description:"Store backups in IDrive e2.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path in the bucket",longDescription:"Path in the bucket",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Access ID"},{name:"auth-password",shortDescription:"Access Secret"}],mapper:{to:t=>{let{bucket:n,path:e}=t.custom,i=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n+Q(e)+i}`},from:(t,n,e)=>h({destinationType:t,custom:{bucket:n.hostname,path:n.pathname}},$(t,n))}},{key:"mega",displayName:"Mega.nz",description:"Store backups in Mega.nz.",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"msgroup",displayName:"Microsoft Office 365 Group",description:"Store backups in Microsoft Office 365 Group.",oauthField:"authid",customFields:{groupEmail:{type:"Email",name:"groupEmail",shortDescription:"Group email",longDescription:"Group email",formElement:t=>C.control(t??"",[Fe.email])},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"cloudfiles",displayName:"Rackspace CloudFiles",description:"Store backups in Rackspace CloudFiles.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:t=>{let n=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{port:e,server:i,path:o}=t.custom;return`${t.destinationType}://${i+Ne(e)+Q(o)+n}`},from:(t,n,e)=>h({destinationType:t,custom:{server:n.hostname,port:n.port,path:n.pathname}},$(t,n))}},{key:"rclone",displayName:"Rclone",description:"Store backups in Rclone.",dynamicFields:[{name:"rclone-local-repository",shortDescription:"Local repository",defaultValue:""},{name:"rclone-remote-repository",shortDescription:"Remote repository",defaultValue:""},{name:"rclone-remote-path",shortDescription:"Path on remote repository",defaultValue:""}],mapper:{to:t=>{let n=t.dynamic["rclone-remote-repository"],e=t.dynamic["rclone-remote-path"],i=Object.entries(t.dynamic).filter(([r])=>!["rclone-remote-repository","rclone-remote-path"].includes(r)),o=M([...Object.entries(t.advanced),...i]);return`${t.destinationType}://${n}/${e+o}`},from:(t,n,e)=>{let{advanced:i,dynamic:o}=$(t,n);return h({destinationType:t,dynamic:h({"rclone-remote-repository":n.hostname,"rclone-remote-path":n.pathname},o)},i)}}},{key:"openstack",displayName:"OpenStack Object Storage",description:"Store backups in OpenStack Object Storage.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket",longDescription:"Bucket",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"openstack-authuri",shortDescription:"Auth URI",type:"Enumeration",loadOptions:t=>t.get(he).openstackProviders},{name:"openstack-version",shortDescription:"Version",type:"Enumeration",loadOptions:t=>t.get(he).openstackVersions},{name:"openstack-domain-name",shortDescription:"Domain name"},{name:"openstack-tenant-name",shortDescription:"Tenant name"},{name:"openstack-region",shortDescription:"Region"}],mapper:{to:t=>{let n=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{bucket:e}=t.custom;return`${t.destinationType}://${e+n}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.pathname,bucket:n.hostname}},$(t,n))}},{key:"webdav",displayName:"WebDAV",description:"Store backups in WebDAV.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"use-ssl",shortDescription:"Use SSL"},{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:t=>{let{port:n,server:e,path:i}=t.custom,o=t.dynamic["use-ssl"],r=M([...Object.entries(t.advanced),...Object.entries(t.dynamic).filter(([c])=>c!=="use-ssl")]);return`${t.destinationType}${o?"s":""}://${e+Ne(n)+Q(i)+r}`},from:(t,n,e)=>h({destinationType:t,custom:{server:n.hostname,port:n.port,path:n.pathname}},$(t,n))}},{key:"aftp",displayName:"FTP",description:"Store backups in FTP.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:t=>{let{port:n,server:e,path:i}=t.custom,o=M([...Object.entries(t.advanced),...Object.entries(t.dynamic).filter(([r])=>r!=="use-ssl")]);return`${t.destinationType}://${e+Ne(n)+Q(i)+o}`},from:(t,n,e)=>h({destinationType:t,custom:{server:n.hostname,port:n.port,path:n.pathname}},$(t,n))}},{key:"sia",displayName:"Sia Decentrilized Cloud",description:"Store backups in Sia Decentrilized Cloud.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")}},dynamicFields:["sia-targetpath","sia-password","sia-redundancy"],mapper:{to:t=>{let n=t.custom.server,e=t.dynamic["sia-targetpath"],i=M([...Object.entries(t.advanced),...Object.entries(t.dynamic).filter(([o])=>o!=="sia-targetpath")]);return`${t.destinationType}://${n+Q(e)+i}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.pathname}},$(t,n))}},{key:"cos",displayName:"Tencent COS",description:"Store backups in Tencent COS.",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"cos-bucket",shortDescription:"Bucket",order:1},{name:"cos-region",shortDescription:"Region",order:2},{name:"cos-app-id",shortDescription:"COS App Id",order:3},{name:"cos-secret-id",shortDescription:"COS Secret Id",order:4},{name:"cos-secret-key",shortDescription:"COS Secret Key",order:5}],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic).filter(([i])=>i!=="cos-targetpath")]);return`${t.destinationType}://${n+e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.pathname}},$(t,n))}},{key:"tahoe",displayName:"Tahoe LAFS",description:"Store backups in Tahoe LAFS.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"use-ssl",shortDescription:"Use SSL"}],mapper:{to:t=>{let{port:n,server:e,path:i,username:o,password:r}=t.custom,c={"auth-username":o,"auth-password":r},f=t.dynamic["use-ssl"],N=M([...Object.entries(t.advanced),...Object.entries(t.dynamic).filter(([I])=>I!=="use-ssl"),...Object.entries(c)]);return`${t.destinationType}${f?"s":""}://${e+Ne(n)+Q(i)+N}`},from:(t,n,e)=>h({destinationType:t,custom:{server:n.hostname,port:n.port,path:n.pathname}},$(t,n))}},{key:"cifs",displayName:"CIFS",description:"Store backups in CIFS.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")},share:{type:"String",name:"share",shortDescription:"Share Name",longDescription:"Share Name",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:["transport","auth-username","auth-password","auth-domain"],mapper:{to:t=>{let{share:n,server:e,path:i,username:o,password:r}=t.custom,c={"auth-username":o,"auth-password":r},f=new Map([...Object.entries(c),...Object.entries(t.advanced),...Object.entries(t.dynamic)]),N=M(Array.from(f));return`${t.destinationType}://${e+Q(n)+Q(i)+N}`},from:(t,n,e)=>{let i=n.pathname.split("/")[1],o=n.pathname.split("/").slice(2).join("/");return h({destinationType:t,custom:{server:n.hostname,share:i,path:o}},$(t,n))}}},{key:"filen",displayName:"Filen.io",description:"Store backups in Filen.io.",customFields:{path:{type:"String",name:"path",shortDescription:"Path on Filen",longDescription:"Path on Filen",formElement:t=>C.control(t??"")}},dynamicFields:["auth-username","auth-password"],mapper:{to:t=>{let{path:n,username:e,password:i}=t.custom,o={"auth-username":e,"auth-password":i},r=new Map([...Object.entries(o),...Object.entries(t.advanced),...Object.entries(t.dynamic)]),c=M(Array.from(r));return`${t.destinationType}://${n+c}`},from:(t,n,e)=>{let i=n.hostname??"";return n.pathname&&i!==""&&n.pathname[0]!="/"&&(i+="/"),i+=n.pathname,h({destinationType:t,custom:{path:i}},$(t,n))}}},{key:"filejump",displayName:"Filejump",description:"Store backups in Filejump.",customFields:{path:{type:"String",name:"path",shortDescription:"Path on Filejump",longDescription:"Path on Filejump",formElement:t=>C.control(t??"")}},dynamicFields:[{type:"Password",name:"api-token",shortDescription:"API Token",longDescription:"Filejump API Token",formElement:t=>C.control(t??"")}],mapper:{to:t=>{let{path:n,username:e,password:i,apitoken:o}=t.custom,r=(o||"").trim()===""?{"auth-username":e,"auth-password":i}:{"api-token":o},c=new Map([...Object.entries(r),...Object.entries(t.advanced),...Object.entries(t.dynamic)]),f=M(Array.from(c));return`${t.destinationType}://${n+f}`},from:(t,n,e)=>{let i=n.hostname??"";return n.pathname&&i!==""&&n.pathname[0]!="/"&&(i+="/"),i+=n.pathname,h({destinationType:t,custom:{path:i}},$(t,n))}}},{key:"storj",customKey:"storjAccessGrant",displayName:"Storj Access Grant",description:"Store backups in Storj Access Grant.",dynamicFields:[{name:"storj-shared-access",shortDescription:"Access Grant"},{name:"storj-bucket",shortDescription:"Bucket"},{name:"storj-folder",shortDescription:"Path on server"}],mapper:{to:t=>`storj://storj.io/config?storj-auth-method=Access%20grant&storj-satellite=us1.storj.io%3A7777&storj-api-key&storj-secret&${M([...Object.entries(t.advanced),...Object.entries(t.dynamic)],!0)}`,from:(t,n,e)=>h({destinationType:t},$(t,n))}},{key:"storj",customKey:"storjApiKey",displayName:"Storj API Key",description:"Store backups in Storj API Key.",dynamicFields:[{name:"storj-satellite",shortDescription:"Satellite",type:"Enumeration",loadOptions:t=>t.get(he).storjSatellites},{name:"storj-api-key",shortDescription:"API Key"},{name:"storj-secret",shortDescription:"Secret"},{name:"storj-bucket",shortDescription:"Bucket"},{name:"storj-folder",shortDescription:"Path on server"}],mapper:{to:t=>`storj://storj.io/config?storj-auth-method=API%20key&${M([...Object.entries(t.advanced),...Object.entries(t.dynamic)],!0)}`,from:(t,n,e)=>h({destinationType:t},$(t,n))}}];var on=["formRef"];function rn(t,n){t&1&&(s(0,"spk-alert",17),y(1,5),d(2,"spk-icon",26),A(),a())}function an(t,n){if(t&1&&m(0),t&2){let e=n.$implicit;Y(" ",e.DisplayName," ")}}function sn(t,n){if(t&1&&d(0,"spk-progress-bar",40),t&2){let e=p(3);ke("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),u("value",e.calculatePasswordStrength()*(100/5))}}function ln(t,n){t&1&&(s(0,"span",35),R(1,10),a())}function cn(t,n){t&1&&(y(0,8,1),d(1,"spk-icon"),A())}function pn(t,n){t&1&&(y(0,8,2),d(1,"spk-icon"),A())}function un(t,n){t&1&&(y(0,11,1),d(1,"spk-icon",42),A())}function dn(t,n){t&1&&(y(0,11,2),d(1,"spk-icon"),A())}function mn(t,n){if(t&1){let e=G();s(0,"button",41),P("click",function(){F(e);let o=p(3);return g(o.copyPassword())}),y(1,11),_(2,un,2,0)(3,dn,2,0),A(),a()}if(t&2){let e=p(3);l(2),T(e.copiedPassword()?2:3)}}function _n(t,n){t&1&&(s(0,"spk-alert",39),R(1,12),a())}function Fn(t,n){if(t&1){let e=G();s(0,"div",30)(1,"spk-form-field")(2,"label",31),y(3,7),d(4,"sup"),A(),a(),d(5,"input",32),a(),_(6,sn,1,9,"spk-progress-bar",33),s(7,"spk-form-field"),d(8,"input",34),_(9,ln,2,0,"span",35),a(),s(10,"div",36)(11,"button",37),P("click",function(){F(e);let o=p(2);return g(o.showPassword.set(!o.showPassword()))}),y(12,8),_(13,cn,2,0)(14,pn,2,0),A(),a(),s(15,"button",37),P("click",function(){F(e);let o=p(2);return g(o.generatePassword())}),y(16,9),d(17,"spk-icon"),A(),a(),_(18,mn,4,1,"button",38),a(),_(19,_n,2,0,"spk-alert",39),a()}if(t&2){let e=p(2);l(5),u("type",e.showPassword()?"text":"password"),l(),T(e.generalForm.value.password?6:-1),l(2),u("type",e.showPassword()?"text":"password"),l(),T(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),l(4),T(e.showPassword()?13:14),l(5),T(e.showCopyPassword()?18:-1),l(),T(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function gn(t,n){if(t&1&&(s(0,"spk-select",27)(1,"label",28),R(2,6),a(),d(3,"input",29),_(4,an,1,1,"ng-template"),a(),_(5,Fn,20,7,"div",30)),t&2){let e=p();u("options",e.encryptionOptions())("isClearable",!1),l(5),T(e.encryptionFieldSignal()!==""?5:-1)}}function Cn(t,n){if(t&1&&(s(0,"button",24),y(1,13),d(2,"spk-icon"),A(),a()),t&2){let e=p();u("disabled",e.nameAndDescriptionValid()===!1)}}function hn(t,n){if(t&1&&(s(0,"spk-tooltip",25)(1,"button",24),y(2,14),d(3,"spk-icon"),A(),a()()),t&2){let e=p();u("disabled",!(e.showCopyPassword()&&!e.copiedPassword())),l(),u("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var Ye=new Ce,Qt=(t={name:"",description:"",encryption:"",password:"",repeatPassword:""})=>Ye.group({name:Ye.control(t.name,[Fe.required]),description:Ye.control(t.description),encryption:Ye.control(t.encryption,[jt()]),password:Ye.control(t.password,[Mt(n=>n?.value.encryption!=="",[Fe.required])]),repeatPassword:Ye.control(t.repeatPassword,[Mt(n=>n?.value.encryption!=="",[Fe.required])])}),xt={Key:"",DisplayName:"None"},Rt=class t{#n=O(pe);#t=O(Ae);#e=O(Xt);#i=O(fe);#o=O(Le);formRef=Me.required("formRef");generalForm=this.#i.generalForm;generalFormSignal=this.#i.generalFormSignal;encryptionFieldSignal=this.#i.encryptionFieldSignal;encryptionOptions=this.#i.encryptionOptions;isNew=this.#i.isNew;showPassword=E(!1);copiedPassword=E(!1);showCopyPassword=E(!1);encryptionEffect=st(()=>{this.encryptionFieldSignal()===""&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=b(()=>{let n=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=b(()=>{let e=this.generalFormSignal()?.password??"";return this.#e.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#i.exit(!0)}async copyPassword(){let n=this.generalForm.controls.password.value;await this.#r(n??""),this.copiedPassword.set(!0)}async#r(n){try{await navigator.clipboard.writeText(n)}catch{try{let i=document.createElement("textarea");i.value=n,document.body.appendChild(i),i.select(),document.execCommand("copy"),document.body.removeChild(i)}catch(i){console.error("Failed to copy text: ",i)}}}displayFn(){let n=this.#o.systemInfo()?.EncryptionModules??[];return e=>{let i=[xt,...n].find(o=>o.Key===e);return i?`${i.DisplayName}`:""}}generatePassword(){this.copiedPassword.set(!1);let n=this.#e.generate(16);this.generalForm.controls.password.setValue(n),this.generalForm.controls.repeatPassword.setValue(n),this.showCopyPassword.set(!0)}next(){this.#n.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=le({type:t,selectors:[["app-general"]],viewQuery:function(e,i){e&1&&we(i.formRef,on,5),e&2&&Re()},decls:21,vars:4,consts:()=>{let n;n=$localize`Your backup name`;let e;e=$localize`Your backup description`;let i;i=$localize`General backup settings`;let o;o=$localize` Backup name ${"\uFFFD#8\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#8\uFFFD"}:CLOSE_SUPERSCRIPT:`;let r;r=$localize`Backup description`;let c;c=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SPK_ICON: Exit `;let f;f=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: Encrypted backup `;let N;N=$localize`Encryption`;let I;I=$localize`Encryption`;let z;z=$localize`Password`;let w;w=$localize`Repeat password`;let v;v=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let V;V=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,V=Oe(V);let oe;oe=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Generate password `;let Z;Z=$localize`Passwords do not match`;let S;S=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SPK_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,S=Oe(S);let D;D=$localize` Tip: Be sure to save your password. If you loose it you will lose access to your backups. `;let L;L=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let q;return q=$localize` Continue ${"\uFFFD#3\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],i,o,r,c,f,I,v,V,oe,Z,S,D,L,q,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],[1,"primary"],["for","backupName"],["type","text","tabindex","1","placeholder",n,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","spk-button","",3,"click"],["spk-button","","type","submit",1,"raised","primary",3,"disabled"],["message","Remember to copy the password",1,"primary",3,"disabled"],["icon",""],["value","Key","label","DisplayName",3,"options","isClearable"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",N,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",z,"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"],["spk-button","","type","button",1,"small",3,"click"],["spk-button","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["spk-button","","type","button",1,"small","copy",3,"click"],[1,"spk-success"]]},template:function(e,i){if(e&1){let o=G();s(0,"form",15,0),P("submit",function(){return F(o),g(i.next())}),s(2,"h3",16),R(3,1),a(),_(4,rn,3,0,"spk-alert",17),s(5,"spk-form-field")(6,"label",18),y(7,2),d(8,"sup"),A(),a(),d(9,"input",19),a(),s(10,"spk-form-field")(11,"label",20),R(12,3),a(),d(13,"textarea",21),a(),_(14,gn,6,3),s(15,"div",22)(16,"button",23),P("click",function(){return F(o),g(i.exit())}),y(17,4),d(18,"spk-icon"),A(),a(),_(19,Cn,3,1,"button",24)(20,hn,4,2,"spk-tooltip",25),a()()}if(e&2){let o;u("formGroup",i.generalForm),l(4),T(!i.isNew()&&((o=i.generalFormSignal())==null?null:o.encryption)!==""?4:-1),l(10),T(i.isNew()?14:-1),l(5),T(i.encryptionFieldSignal()===""||!i.isNew()?19:20)}},dependencies:[je,Ke,_e,ge,Ue,ze,He,de,me,be,ue,ct,lt,pt],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-500)}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.copy[_ngcontent-%COMP%] spk-icon.spk-success[_ngcontent-%COMP%]{color:var(--success-500)}"],changeDetection:0})};function fn(t,n){if(t&1){let e=G();s(0,"div",24)(1,"spk-form-field")(2,"label",25),R(3,7),a(),s(4,"input",26,0),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.nextTime().time,o)||(r.scheduleFields.nextTime().time=o),g(o)}),P("focus",function(){F(e);let o=re(5);return g(o.showPicker())}),a(),s(6,"spk-icon",27),m(7,"clock"),a()(),s(8,"spk-form-field"),d(9,"label",28),s(10,"input",29,1),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.nextTime().date,o)||(r.scheduleFields.nextTime().date=o),g(o)}),P("focus",function(){F(e);let o=re(11);return g(o.showPicker())}),a(),s(12,"spk-icon",27),m(13,"calendar"),a()()(),s(14,"div",24)(15,"spk-form-field")(16,"label",30),R(17,8),a(),s(18,"input",31),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().repeatValue,o)||(r.scheduleFields.runAgain().repeatValue=o),g(o)}),a()(),s(19,"spk-select",32)(20,"input",33),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().repeatUnit,o)||(r.scheduleFields.runAgain().repeatUnit=o),g(o)}),a()()(),s(21,"app-toggle-card",34),H(22,35),R(23,9),X(),s(24,"div",36)(25,"spk-toggle",19),y(26,10),s(27,"input",20),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().allowedDays.mon,o)||(r.scheduleFields.runAgain().allowedDays.mon=o),g(o)}),a(),A(),a(),s(28,"spk-toggle",19),y(29,11),s(30,"input",20),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().allowedDays.tue,o)||(r.scheduleFields.runAgain().allowedDays.tue=o),g(o)}),a(),A(),a(),s(31,"spk-toggle",19),y(32,12),s(33,"input",20),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().allowedDays.wed,o)||(r.scheduleFields.runAgain().allowedDays.wed=o),g(o)}),a(),A(),a(),s(34,"spk-toggle",19),y(35,13),s(36,"input",20),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().allowedDays.thu,o)||(r.scheduleFields.runAgain().allowedDays.thu=o),g(o)}),a(),A(),a(),s(37,"spk-toggle",19),y(38,14),s(39,"input",20),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().allowedDays.fri,o)||(r.scheduleFields.runAgain().allowedDays.fri=o),g(o)}),a(),A(),a(),s(40,"spk-toggle",19),y(41,15),s(42,"input",20),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().allowedDays.sat,o)||(r.scheduleFields.runAgain().allowedDays.sat=o),g(o)}),a(),A(),a(),s(43,"spk-toggle",19),y(44,16),s(45,"input",20),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().allowedDays.sun,o)||(r.scheduleFields.runAgain().allowedDays.sun=o),g(o)}),a(),A(),a()()()}if(t&2){let e=p();l(4),U("ngModel",e.scheduleFields.nextTime().time),l(6),U("ngModel",e.scheduleFields.nextTime().date),l(8),U("ngModel",e.scheduleFields.runAgain().repeatValue),l(),u("options",e.unitOptions)("isClearable",!1),l(),U("ngModel",e.scheduleFields.runAgain().repeatUnit),l(),u("disallowToggle",!0),l(6),U("ngModel",e.scheduleFields.runAgain().allowedDays.mon),l(3),U("ngModel",e.scheduleFields.runAgain().allowedDays.tue),l(3),U("ngModel",e.scheduleFields.runAgain().allowedDays.wed),l(3),U("ngModel",e.scheduleFields.runAgain().allowedDays.thu),l(3),U("ngModel",e.scheduleFields.runAgain().allowedDays.fri),l(3),U("ngModel",e.scheduleFields.runAgain().allowedDays.sat),l(3),U("ngModel",e.scheduleFields.runAgain().allowedDays.sun)}}var Sn=[{key:"s",label:$localize`Seconds`},{key:"m",label:$localize`Minutes`},{key:"h",label:$localize`Hours`},{key:"D",label:$localize`Days`},{key:"W",label:$localize`Weeks`},{key:"M",label:$localize`Months`},{key:"Y",label:$localize`Years`}],$e={autoRun:!0,nextTime:{time:"13:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!1,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}},It=class t{#n=O(fe);#t=O(pe);#e=O(Ae);unitOptions=Sn;scheduleFields=this.#n.scheduleFields;goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#e.parent})}next(){this.#t.navigate(["options"],{relativeTo:this.#e.parent})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=le({type:t,selectors:[["app-schedule"]],decls:16,vars:2,consts:()=>{let n;n=$localize`Schedule`;let e;e=$localize` Automatically run backups ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let i;i=$localize`If a date was missed, the job will run as soon as possible.`;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let r;r=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let c;c=$localize`Next time`;let f;f=$localize`Run again every`;let N;N=$localize`Allowed days`;let I;I=$localize` Monday ${"\uFFFD#27\uFFFD\uFFFD/#27\uFFFD"}:TAG_INPUT:`;let z;z=$localize` Tuesday ${"\uFFFD#30\uFFFD\uFFFD/#30\uFFFD"}:TAG_INPUT:`;let w;w=$localize` Wednesday ${"\uFFFD#33\uFFFD\uFFFD/#33\uFFFD"}:TAG_INPUT:`;let v;v=$localize` Thursday ${"\uFFFD#36\uFFFD\uFFFD/#36\uFFFD"}:TAG_INPUT:`;let V;V=$localize` Friday ${"\uFFFD#39\uFFFD\uFFFD/#39\uFFFD"}:TAG_INPUT:`;let oe;oe=$localize` Saturday ${"\uFFFD#42\uFFFD\uFFFD/#42\uFFFD"}:TAG_INPUT:`;let Z;return Z=$localize` Sunday ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],n,e,i,o,r,c,f,N,I,z,w,v,V,oe,Z,[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","",1,"raised","primary",3,"click"],[1,"row-inputs"],["for","time"],["type","time","id","time",3,"ngModelChange","focus","ngModel"],["suffix",""],["for","date"],["type","date","id","date",3,"ngModelChange","focus","ngModel"],["for","repeatValue"],["type","number","id","repeatValue",3,"ngModelChange","ngModel"],["value","key","label","label",3,"options","isClearable"],["type","text","id","repeatUnit",3,"ngModelChange","ngModel"],[3,"disallowToggle"],["title",""],[1,"days-wrap"]]},template:function(e,i){e&1&&(s(0,"h3",17),R(1,2),a(),s(2,"div",18)(3,"spk-toggle",19),y(4,3),s(5,"input",20),K("ngModelChange",function(r){return B(i.scheduleFields.autoRun,r)||(i.scheduleFields.autoRun=r),r}),a(),A(),a(),s(6,"p"),R(7,4),a()(),_(8,fn,46,14),s(9,"div",21)(10,"button",22),P("click",function(){return i.goBack()}),y(11,5),d(12,"spk-icon"),A(),a(),s(13,"button",23),P("click",function(){return i.next()}),y(14,6),d(15,"spk-icon"),A(),a()()),e&2&&(l(5),U("ngModel",i.scheduleFields.autoRun),l(3),T(i.scheduleFields.autoRun()?8:-1))},dependencies:[Xe,_e,We,Ve,ge,Be,de,Ge,ue,be,me,qe],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem 2.5rem 1.5rem;display:flex;flex-direction:column;gap:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};function Tn(t,n){if(t&1&&(H(0,4),m(1),X()),t&2){let e,i=p();l(),xe((e=i.currentExpressionOption())==null?null:e.startsWith)}}function Dn(t,n){if(t&1&&(H(0,5),m(1),X()),t&2){let e,i=p();l(),xe((e=i.currentExpressionOption())==null?null:e.endsWith)}}var En=[{key:"Excludes folders where name contains",value:"-FolderName"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileName"},{key:"Excludes file extension",value:"-Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Excludes file group",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"},{key:"None",value:"-Unknown"}],St=class t{path=yt.required();osType=yt();pathChange=Et();remove=Et();internalPath=E("");pathType=E("-Expression");currentExpressionOption=b(()=>{let n=this.pathType();return this.expressionOptions().find(e=>e.value===n)});expressionOptions=b(()=>{let e=this.osType()==="Windows"?"\\":"/";return En.map(i=>i.value==="-Folder"||i.value==="+Folder"?Ee(h({},i),{startsWith:"",endsWith:""}):i.value==="-FolderName"||i.value==="+FolderName"?Ee(h({},i),{startsWith:"*",endsWith:`*${e}`}):i.value==="-FileName"||i.value==="+FileName"?Ee(h({},i),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):i.value==="-FileGroup"||i.value==="+FileGroup"?Ee(h({},i),{startsWith:"{",endsWith:"}"}):i.value==="-Regex"||i.value==="+Regex"?Ee(h({},i),{startsWith:"[",endsWith:"]"}):i.value==="-Extension"||i.value==="+Extension"?Ee(h({},i),{startsWith:"*.",endsWith:""}):Ee(h({},i),{startsWith:"",endsWith:""}))});pathEffect=st(()=>{let n=this.path(),e=n.slice(1),i=n.startsWith("-")?"-":"+",o=this.osType()==="Windows",r=o?"\\":"/";e.startsWith("%")&&e.endsWith(r)||o&&e.slice(2).startsWith(r)&&e.endsWith(r)||e.startsWith(r)&&e.endsWith(r)?(this.pathType.set(`${i}Folder`),this.internalPath.set(e)):e.startsWith("*")&&e.endsWith(`*${r}`)?(this.pathType.set(`${i}FolderName`),this.internalPath.set(e.slice(1,-2))):e.startsWith("[.*")&&e.endsWith(`[^\\${r}]*]`)?(this.pathType.set(`${i}FileName`),this.internalPath.set(e.slice(3,-7))):e.startsWith("{")&&e.endsWith("}")?(this.pathType.set(`${i}FileGroup`),this.internalPath.set(e.slice(1,-1))):e.startsWith("[")&&e.endsWith("]")?(this.pathType.set(`${i}Regex`),this.internalPath.set(e.slice(1,-1))):e.startsWith("*.")?(this.pathType.set(`${i}Extension`),this.internalPath.set(e.slice(2))):(this.pathType.set(`${i}Expression`),this.internalPath.set(e))});updateFilter(){let n=this.internalPath(),e=this.currentExpressionOption();n!==""&&this.pathChange.emit(`${e?.value.slice(0,1)}${e?.startsWith??""}${n}${e?.endsWith??""}`)}removeFilter(){this.remove.emit()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=le({type:t,selectors:[["app-new-filter"]],inputs:{path:[1,"path"],osType:[1,"osType"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:9,vars:6,consts:()=>{let n;return n=$localize`Select an option...`,[["value","value","label","key",3,"options","isClearable"],["type","text","placeholder",n,3,"ngModelChange","ngModel"],[1,"expression-input"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],["suffix",""],[1,"filter-removal",3,"click"],[1,"spk-primary"]]},template:function(e,i){if(e&1&&(s(0,"spk-select",0)(1,"input",1),K("ngModelChange",function(r){return B(i.pathType,r)||(i.pathType=r),r}),P("ngModelChange",function(){return i.updateFilter()}),a()(),s(2,"spk-form-field",2)(3,"input",3),K("ngModelChange",function(r){return B(i.internalPath,r)||(i.internalPath=r),r}),P("ngModelChange",function(){return i.updateFilter()}),a(),_(4,Tn,2,1,"ng-container",4)(5,Dn,2,1,"ng-container",5),a(),s(6,"div",6),P("click",function(){return i.removeFilter()}),s(7,"spk-icon",7),m(8,"x-circle"),a()()),e&2){let o,r;u("options",i.expressionOptions())("isClearable",!1),l(),U("ngModel",i.pathType),l(2),U("ngModel",i.internalPath),l(),T(!((o=i.currentExpressionOption())==null||o.startsWith==null)&&o.startsWith.length?4:-1),l(),T(!((r=i.currentExpressionOption())==null||r.endsWith==null)&&r.endsWith.length?5:-1)}},dependencies:[Xe,_e,ge,Be,me,de,ue],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}.expression-input[_ngcontent-%COMP%]{--ff-suffix-bg: var(--base-level-20)}.filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var yn=["formRef"],Jt=()=>({standalone:!0});function An(t,n){if(t&1){let e=G();s(0,"spk-form-field",42)(1,"input",43),K("ngModelChange",function(o){F(e);let r=p(2);return B(r.editingPath,o)||(r.editingPath=o),g(o)}),a()(),s(2,"button",44),P("click",function(){F(e);let o=p(2);return g(o.updatePath())}),s(3,"spk-icon"),m(4,"floppy-disk"),a()(),s(5,"button",44),P("click",function(){F(e);let o=p(2);return g(o.cancelEditPath())}),s(6,"spk-icon"),m(7,"x-bold"),a()()}if(t&2){let e=p(2);l(),U("ngModel",e.editingPath),u("ngModelOptions",tt(2,Jt))}}function Pn(t,n){if(t&1){let e=G();s(0,"spk-form-field",42),d(1,"input",45),a(),s(2,"button",44),P("click",function(){F(e);let o=p().$implicit,r=p();return g(r.editPath(o))}),s(3,"spk-icon"),m(4,"pen"),a()(),s(5,"button",44),P("click",function(){F(e);let o=p().$implicit,r=p();return g(r.removePath(o))}),s(6,"spk-icon"),m(7,"trash-simple"),a()()}if(t&2){let e=p().$implicit;Ut("readonly",!0),l(),u("ngModel",e)("ngModelOptions",tt(3,Jt))}}function Nn(t,n){if(t&1&&(s(0,"div",30),_(1,An,8,3)(2,Pn,8,4),a()),t&2){let e=n.$implicit,i=p();l(),T(i.oldPath()===e?1:2)}}function kn(t,n){if(t&1){let e=G();s(0,"app-new-filter",47),P("pathChange",function(o){let r=F(e).$index,c=p(2);return g(c.patchPathAt(o,r))})("remove",function(){let o=F(e).$index,r=p(2);return g(r.removePathAt(o))}),a()}if(t&2){let e,i=n.$implicit,o=p(2);u("path",i)("osType",(e=o.osType())!==null&&e!==void 0?e:"")}}function On(t,n){if(t&1&&ne(0,kn,1,2,"app-new-filter",46,te),t&2){let e=p();ie(e.pathArray())}}function $n(t,n){if(t&1&&(s(0,"div",41)(1,"spk-form-field"),d(2,"input",48),a(),s(3,"spk-select",49),d(4,"input",50),a()()),t&2){let e=p();l(3),u("options",e.sizeOptions())("isClearable",!1)}}var Te=new Ce,Mn=["Bytes","KB","MB","GB","TB","PB"],Zt=(t={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>Te.group({path:Te.control(t.path),excludes:Te.group({hidden:Te.control(t.excludes.hidden),system:Te.control(t.excludes.system),temporary:Te.control(t.excludes.temporary),filesLargerThan:Te.group({size:Te.control(null),unit:Te.control(null)})})}),vt=class t{#n=O(fe);#t=O(pe);#e=O(Ae);formRef=Me.required("formRef");sourceDataForm=this.#n.sourceDataForm;sourceDataFormSignal=this.#n.sourceDataFormSignal;newPathCtrl=new ut("");filesLargerThan=b(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);sizeOptions=E(Mn);osType=this.#n.osType;pathSignal=j(this.sourceDataForm.controls.path.valueChanges);pathArray=b(()=>this.pathSignal()?.split("\0").filter(n=>n.startsWith("-")||n.startsWith("+")||n==="___none___")??[]);nonFilterPaths=b(()=>this.pathSignal()?.split("\0").filter(n=>!n.startsWith("-")&&!n.startsWith("+")&&n!==""));oldPath=E(null);editingPath=E(null);addingNewPath=E(!1);editPath(n){this.oldPath.set(n),this.editingPath.set(n)}updatePath(){let n=this.oldPath(),e=this.editingPath();if(!n||!e||e===n){this.oldPath.set(null),this.editingPath.set(null);return}let i=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(i?.replace(n,e)??""),this.oldPath.set(null),this.editingPath.set(null)}cancelEditPath(){this.oldPath.set(null),this.editingPath.set(null)}removePath(n){let e=this.sourceDataForm.controls.path.value??"",i=e.indexOf(n);if(i===-1)return;let o=i===0?n:"\0"+n,r=e.replace(o,"");this.sourceDataForm.controls.path.setValue(r)}addFilter(n="-*"){let e=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(`${e}\0${n}`)}patchPathAt(n,e){let o=this.sourceDataForm.controls.path.value.split("\0").filter(c=>!c.startsWith("-")&&!c.startsWith("+")).join("\0"),r=this.pathArray().map((c,f)=>f===e?`${n}`:`${c}`).join("\0");this.sourceDataForm.controls.path.setValue(`${o}\0${r}`)}removePathAt(n){let i=this.sourceDataForm.controls.path.value.split("\0").filter(r=>!r.startsWith("-")&&!r.startsWith("+")).join("\0"),o=this.pathArray().filter((r,c)=>c!==n).join("\0");this.sourceDataForm.controls.path.setValue(`${i}\0${o}`)}getPath(){return this.sourceDataForm.value.path??null}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let n=this.sourceDataForm.controls.path.value,e=this.newPathCtrl.value;this.sourceDataForm.controls.path.setValue(`${n}\0${e}`),this.newPathCtrl.setValue("")}goBack(){this.#t.navigate(["destination"],{relativeTo:this.#e.parent})}next(){this.#t.navigate(["schedule"],{relativeTo:this.#e.parent})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=le({type:t,selectors:[["app-source-data"]],viewQuery:function(e,i){e&1&&we(i.formRef,yn,5),e&2&&Re()},decls:56,vars:12,consts:()=>{let n;n=$localize`Path`;let e;e=$localize`Add a direct path`;let i;i=$localize`Hidden files`;let o;o=$localize`System files`;let r;r=$localize`Temporary files`;let c;c=$localize`Source Data`;let f;f=$localize`Folder path`;let N;N=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let I;I=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let z;z=$localize`Paths`;let w;w=$localize`Add a path directly from your machine.`;let v;v=$localize`Filters`;let V;V=$localize`Customize your filters.`;let oe;oe=$localize`Add filter`;let Z;Z=$localize`Exclude`;let S;S=$localize`Choose if there’s any files you want to exclude.`;let D;D=$localize` Hidden files ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let L;L=$localize` System files ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`;let q;q=$localize` Temporary files ${"\uFFFD#52\uFFFD\uFFFD/#52\uFFFD"}:TAG_INPUT:`;let k;k=$localize` Files larger than `;let ae;ae=$localize`Edit path`;let se;return se=$localize`Select an option...`,[["formRef",""],c,f,N,I,z,w,v,V,oe,Z,S,D,L,q,k,[3,"submit","formGroup"],[1,"left"],[1,"title-30"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",n,"formControlName","path"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],["description",""],[1,"paths"],[1,"path"],[1,"row-inputs"],["type","text","placeholder",e,3,"formControl"],["spk-button","","type","button",1,"raised","primary",3,"click"],["type","button","spk-button","","action","",3,"click"],["formGroupName","excludes",3,"disallowToggle"],[1,"raised","primary"],["type","checkbox","placeholder",i,"formControlName","hidden"],["type","checkbox","placeholder",o,"formControlName","system"],["type","checkbox","placeholder",r,"formControlName","temporary"],[1,"raised","primary",3,"click"],["formGroupName","filesLargerThan",1,"row-inputs"],[1,"small"],["type","text","placeholder",ae,3,"ngModelChange","ngModel","ngModelOptions"],["spk-button","","type","button",1,"small",3,"click"],["type","text",3,"ngModel","ngModelOptions"],[3,"path","osType"],[3,"pathChange","remove","path","osType"],["type","number","formControlName","size"],[3,"options","isClearable"],["type","text","formControlName","unit","placeholder",se]]},template:function(e,i){if(e&1){let o=G();s(0,"form",16,0),P("submit",function(){return F(o),g(i.next())}),s(2,"div",17)(3,"h3",18),R(4,1),a(),s(5,"app-file-tree",19)(6,"label",20),R(7,2),a(),d(8,"input",21),a(),s(9,"div",22)(10,"button",23),P("click",function(){return F(o),g(i.goBack())}),y(11,3),d(12,"spk-icon"),A(),a(),s(13,"button",24),y(14,4),d(15,"spk-icon"),A(),a()()(),s(16,"div",25)(17,"app-toggle-card",26),H(18,27),R(19,5),X(),s(20,"p",28),R(21,6),a(),s(22,"div",29),ne(23,Nn,3,1,"div",30,te),s(25,"div",31)(26,"spk-form-field"),d(27,"input",32),a(),s(28,"button",33),P("click",function(){return F(o),g(i.addNewPath())}),s(29,"spk-icon"),m(30,"plus"),a()()()()(),s(31,"app-toggle-card",26),H(32,27),R(33,7),X(),s(34,"p",28),R(35,8),a(),s(36,"button",34),P("click",function(){return F(o),g(i.addFilter())}),R(37,9),a(),_(38,On,2,0),a(),s(39,"app-toggle-card",35),H(40,27),R(41,10),X(),s(42,"p",28),R(43,11),a(),s(44,"spk-toggle",36),y(45,12),d(46,"input",37),A(),a(),s(47,"spk-toggle",36),y(48,13),d(49,"input",38),A(),a(),s(50,"spk-toggle",36),y(51,14),d(52,"input",39),A(),a(),s(53,"spk-toggle",40),P("click",function(){return F(o),g(i.toggleFilesLargerThan())}),R(54,15),a(),_(55,$n,5,2,"div",41),a()()()}if(e&2){let o;u("formGroup",i.sourceDataForm),l(5),u("multiSelect",!0)("startingPath",i.getPath())("showFiles",!0),l(12),u("disallowToggle",!0),l(6),ie(i.nonFilterPaths()),l(4),u("formControl",i.newPathCtrl),l(4),u("disallowToggle",!0),l(7),T((o=i.pathSignal())!=null&&o.length?38:-1),l(),u("disallowToggle",!0),l(14),ke("active",i.filesLargerThan()),l(2),T(i.filesLargerThan()?55:-1)}},dependencies:[Xe,Ke,_e,We,Ve,ge,Ue,Be,je,dt,ze,He,mt,de,ue,be,Ge,me,St,_t,qe],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-level-40)}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}spk-divider[_ngcontent-%COMP%]{margin:.75rem 0}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.25rem}.paths[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.path[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr min-content min-content;gap:.25rem}"],changeDetection:0})};var en="1W:1D,4W:1W,12M:1M",De=new Ce,fe=class t{#n=O(pe);#t=O(Le);#e=O(ve);#i=O(Ie);#o=O(gt);generalForm=Qt();sourceDataForm=Zt();scheduleFields={autoRun:E($e.autoRun),nextTime:E($e.nextTime),runAgain:E($e.runAgain)};destinationForm=tn();settings=E([]);optionsFields={remoteVolumeSize:E("50MB"),backupRetention:E("all"),backupRetentionTime:E(""),backupRetentionVersions:E(0),backupRetentionCustom:E("")};isDraft=E(!1);backupId=E(null);backupName=b(()=>this.generalFormSignal()?.name??"");isSubmitting=E(!1);finishedLoading=E(!1);backupDefaults=E(null);isNew=b(()=>this.backupId()==="new");osType=b(()=>this.#t.systemInfo()?.OSType);selectedOptions=E([]);selectedAdvancedFormPair=E([]);destinationFormPair=E({oauthField:null,custom:[],dynamic:[],advanced:[]});notSelectedAdvancedFormPair=b(()=>{let n=this.destinationFormPair()?.advanced??[],e=this.selectedAdvancedFormPair()??[];return n.filter(i=>e.findIndex(o=>o.name===i.name)===-1)});selectedHttpOptions=E([]);notSelectedHttpOptions=b(()=>{let n=this.httpOptions(),e=this.selectedHttpOptions()??[];return n.filter(i=>e.findIndex(o=>o.name===i.name)===-1)});sourceDataFormSignal=j(this.sourceDataForm.valueChanges);destinationFormSignal=j(this.destinationForm.valueChanges);generalFormSignal=j(this.generalForm.valueChanges);encryptionFieldSignal=j(this.generalForm.controls.encryption.valueChanges);destinationOptions=b(()=>this.#t.backendModules()??[]);httpOptions=b(()=>this.#t.systemInfo()?.GenericModules?.find(n=>n.Key==="http-options")?.Options?.map(this.#r)??[]);advancedOptions=b(()=>this.#t.systemInfo()?.Options?.map(this.#r)??[]);#r(n){return{name:n.Name,type:n.Type,shortDescription:n.ShortDescription??void 0,longDescription:n.LongDescription??void 0,options:n.ValidValues}}encryptionOptions=b(()=>{let n=this.#t.systemInfo()?.EncryptionModules??[];return[xt,...n]});nonSelectedOptions=b(()=>this.advancedOptions().sort((n,e)=>n?.name&&e?.name?n?.name.localeCompare(e?.name):0).filter(n=>this.selectedOptions()?.findIndex(e=>e.name===n.name)===-1));addOrUpdateAdvancedFormPairByName(n,e,i){let o=this.selectedAdvancedFormPair().find(r=>r.name===n);if(o)this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced.controls[o.name].setValue(i);else{let r=this.notSelectedAdvancedFormPair().find(c=>c.name===n);if(!r)return;this.addAdvancedFormPair(r,e,i)}}addAdvancedFormPairByName(n,e,i){let o=this.notSelectedAdvancedFormPair().find(r=>r.name===n);o&&this.addAdvancedFormPair(o,e,i)}addHttpOptionByName(n,e,i){let o=this.notSelectedHttpOptions().find(r=>r.name===n);o&&this.addHttpOption(o,e,i)}addAdvancedFormPair(n,e,i){let o=this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced,r=i??n.defaultValue;this.createFormField(o,n,r),this.selectedAdvancedFormPair.set([...this.selectedAdvancedFormPair(),n])}addHttpOption(n,e,i){let o=this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced,r=i??n.defaultValue;this.createFormField(o,n,r),this.selectedHttpOptions.set([...this.selectedHttpOptions(),n])}removeAdvancedFormPair(n,e){this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced.removeControl(n.name),this.selectedAdvancedFormPair().findIndex(o=>o.name===n.name)!==-1?this.selectedAdvancedFormPair.update(o=>(o=o.filter(r=>r.name!==n.name),o)):this.selectedHttpOptions.update(o=>(o=o.filter(r=>r.name!==n.name),o))}removeHttpOption(n,e){this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced.removeControl(n.name),this.selectedHttpOptions.update(i=>(i=i.filter(o=>o.name!==n.name),i))}submit(){this.isSubmitting.set(!0);let n=this.#l(),e=this.backupId();e==="new"||!e||this.isDraft()?this.#i.postApiV1Backups({requestBody:n}).pipe(Ze(()=>this.isSubmitting.set(!1))).subscribe({next:i=>{this.exit(!1)},error:i=>{}}):this.#i.putApiV1BackupById({id:e,requestBody:n}).pipe(Ze(()=>this.isSubmitting.set(!1))).subscribe({next:i=>{this.exit(!1)},error:i=>{}})}exit(n){if(!n){this.#p(),this.#n.navigate(["/"]);return}this.#e.open(J,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#p(),this.#n.navigate(["/"]))}})}updateFieldsFromTargetUrl(n){this.#s(),setTimeout(()=>{this.#a(n)})}#s(){this.destinationFormPair.set({oauthField:null,custom:[],dynamic:[],advanced:[]}),this.selectedAdvancedFormPair.set([]),this.selectedHttpOptions.set([]),this.destinationForm.controls.destinations.clear(),this.destinationForm.reset()}mapSourceDataToForm(n){let e=n.Sources??"",i=n.Filters?.map(f=>`${f.Include?"":"-"}${f.Expression}`)??[],o=n.Settings?.find(f=>f.Name==="--exclude-files-attributes")?.Value??"",r=n.Settings?.find(f=>f.Name==="--skip-files-larger-than")??null,c={path:[...e,...i].join("\0"),excludes:{hiddenFiles:o.includes("hidden"),systemFiles:o.includes("system"),tempFiles:o.includes("temporary"),filesLargerThan:r?.Value?.toUpperCase()??null}};this.sourceDataForm.patchValue(c)}mapDestinationToForm(n){let e=n.TargetURL?wt(n.TargetURL):null;e&&this.addDestinationFormGroup(e.destinationType,{custom:e.custom,dynamic:e.dynamic,advanced:e.advanced},!0)}#a(n){let e=wt(n);e&&this.addDestinationFormGroup(e.destinationType,{custom:e.custom,dynamic:e.dynamic,advanced:e.advanced},!0)}mapGeneralToForm(n){let e=n.Settings?.find(c=>c.Name==="encryption-module"),i=n.Settings?.find(c=>c.Name==="passphrase")?.Value??"",o=e?.Value&&e.Value.length?e.Value:"",r={name:n.Name??"",description:n.Description??""};o&&o!==""&&(r.encryption=o),i&&i!==""&&(r.password=i,r.repeatPassword=i),this.generalForm.patchValue(r)}mapScheduleToForm(n){if(!n){this.scheduleFields.autoRun.set(!1);return}let e=this.#o.fromString(n.Repeat)??null,i=this.#u(n.Time);this.scheduleFields.autoRun.set(!0),this.scheduleFields.nextTime.update(o=>h(h({},o),i)),this.scheduleFields.runAgain.set({repeatValue:e?.value??1,repeatUnit:e?.unit??"D",allowedDays:{mon:n.AllowedDays?.includes("mon")??!1,tue:n.AllowedDays?.includes("tue")??!1,wed:n.AllowedDays?.includes("wed")??!1,thu:n.AllowedDays?.includes("thu")??!1,fri:n.AllowedDays?.includes("fri")??!1,sat:n.AllowedDays?.includes("sat")??!1,sun:n.AllowedDays?.includes("sun")??!1}})}mapOptionsToForms(n){let e=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","passphrase","keep-time","keep-versions","retention-policy"],i=n.Settings?.filter(c=>!e.includes(c.Name)),o=n.Settings?.filter(c=>e.includes(c.Name));this.settings.set(i??[]),i?.forEach(c=>{if(c.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(c.Value??"")});var r="all";o?.forEach(c=>{if(c.Name==="dblock-size"&&this.optionsFields.remoteVolumeSize.set(c.Value??"50MB"),c.Name==="keep-time"&&(c.Value??"")!=="")return r="time",this.optionsFields.backupRetentionTime.set(c.Value??"");if(c.Name==="keep-versions"&&(c.Value??"")!=="")return r="versions",this.optionsFields.backupRetentionVersions.set(c.Value?parseInt(c.Value):null);if(c.Name==="retention-policy"&&(c.Value??"")!=="")if(c.Value===en)r="smart";else return r="custom",this.optionsFields.backupRetentionCustom.set(c.Value??"")}),this.optionsFields.backupRetention.set(r)}getCurrentTargetUrl(){return this.#c(this.destinationForm.controls.destinations)}getScheduleFormValue(){return{autoRun:this.scheduleFields.autoRun(),nextTime:this.scheduleFields.nextTime(),runAgain:this.scheduleFields.runAgain()}}#l(){let n=this.generalForm.value,e=this.getScheduleFormValue(),i=this.sourceDataForm.value,r=this.destinationForm.value.destinations?.length?this.#c(this.destinationForm.controls.destinations):[],c=null;e.runAgain?.repeatUnit&&e.runAgain?.repeatValue&&(c=this.#o.toString(e.runAgain.repeatValue,e.runAgain.repeatUnit));let f=e.runAgain?.allowedDays?Object.entries(e.runAgain?.allowedDays).filter(([v,V])=>V).map(([v,V])=>v):[],N=i.path?.split("\0")??[],I=this.mapFormsToSettings(),z=Object.entries(i.excludes??{}).filter(([v,V])=>V&&v!=="filesLargerThan").map(([v])=>v),w=i.excludes?.filesLargerThan;return z.length&&I.push({Name:"--exclude-files-attributes",Value:z.join(",")}),w&&w.size!==null&&w.unit!==null&&I.push({Name:"--skip-files-larger-than",Value:`${w.size}${w.unit}`}),{Backup:{Name:n.name,Description:n.description,TargetURL:r[0]??null,Sources:N.filter(v=>!v.startsWith("-")),Settings:I,Filters:N.filter(v=>v.startsWith("-")).map((v,V)=>({Order:V,Include:!1,Expression:v.slice(1)}))},Schedule:e.autoRun?{Repeat:c,Time:e.nextTime?.date?new Date(`${e.nextTime.date}T${e.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:f}:null}}mapFormsToSettings(n=[]){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"],o=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&(o=[{Name:"encryption-module",Value:e.encryption??null},{Name:"passphrase",Value:e.password??null}]);let r=[{Name:"dblock-size",Value:this.optionsFields.remoteVolumeSize()}];switch(this.optionsFields.backupRetention()){case"time":r.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":r.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":r.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":r.push({Name:"retention-policy",Value:en});break}let c=[...n,...i],f=this.settings().filter(N=>!c.includes(N.Name)).map(N=>{let I=N.Value;return typeof N.Value=="number"&&(I=N.Value.toString()),typeof N.Value=="boolean"&&(I=N.Value?"True":"False"),{Name:N.Name,Value:I}});return[...o,...r,...f]}#c(n){return n.controls.map(e=>Ct(e.value))}#u(n){if(!n||n?.indexOf("T")===-1)return{time:n??"13:00"};let e=new Date(n);return{time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`,date:e.toISOString().split("T")[0]}}createFormField(n,e,i){if(e.type==="String"||e.type==="FileTree"||e.type==="FolderTree"||e.type==="Password"||e.type==="Enumeration"||e.type==="NonValidatedSelectableString"||e.type==="Path"){n.addControl(e.name,De.control(i));return}if(e.type==="Size"){n.addControl(e.name,De.control(i));return}if(e.type==="Integer"){n.addControl(e.name,De.control(i?parseInt(i):0));return}if(e.type==="Boolean"){n.addControl(e.name,De.control(i==="true"||i==="True"));return}if(e.type==="Flags"){n.addControl(e.name,De.control(i??""));return}if(e.type==="Timespan"||e.type==="DateTime"){n.addControl(e.name,De.control(i,[Fe.pattern(/([-+]?\d{1,3}[smhDWMY])+/)]));return}}addDestinationFormGroup(n,e,i=!1){let o=Se.find(S=>S.customKey===n||S.key===n),r=o?.key,c=this.destinationOptions().find(S=>S.Key===r),f=this.httpOptions();if(!c||!c.Options)return;let N=o&&o.oauthField?o.oauthField:null,I=o&&o.customFields?o.customFields:{},z=o&&o.dynamicFields?o.dynamicFields:[],w=o&&o.advancedFields?o.advancedFields:[],v=o&&o.ignoredAdvancedFields?o.ignoredAdvancedFields:[];this.destinationFormPair.set({oauthField:N,custom:[],dynamic:[],advanced:[]});let V=De.group({}),oe=De.group({}),Z=De.group({});I&&Object.entries(I).forEach(([S,D],L)=>{let ae=D,{formElement:q}=ae,k=Lt(ae,["formElement"]);V.addControl(S,q(e?.custom[S])),this.destinationFormPair.update(se=>(se.custom.push(h({order:900+L},k)),se))});for(let S=0;S<c.Options.length;S++){let D=c.Options[S];if(D.Deprecated)continue;let L=z.find(q=>q===D.Name||D.Aliases?.includes(q.name)||q.name===D.Name);if(L){let q=D.Aliases?.indexOf(L.name)??-1,k=D.Aliases&&q>-1?D.Aliases[q]:D.Name,ae=L&&typeof L!="string",se=ae?L?.defaultValue??D.DefaultValue:D.DefaultValue,x={name:k,type:D.Type,shortDescription:D.ShortDescription??void 0,longDescription:D.LongDescription??void 0,options:D.ValidValues,order:900+S},Qe=ae?h(h({},x),L):x,ee=e?.dynamic[k]??se??D.DefaultValue;this.createFormField(oe,Qe,ee),this.destinationFormPair.update(Gt=>(Gt.dynamic.push(Qe),Gt))}else{if(v.find(ee=>ee===D.Name))continue;let k=w.find(ee=>ee===D.Name||ee.name===D.Name),ae=k&&typeof k!="string",se=e?.advanced[D.Name],x=se??D.DefaultValue,Qe={name:D.Name,type:D.Type,shortDescription:D.ShortDescription??void 0,longDescription:D.LongDescription??void 0,options:D.ValidValues,defaultValue:x,order:900+S},rt=ae?h(h({},Qe),k):Qe;i&&se&&(this.createFormField(Z,rt,x),this.selectedAdvancedFormPair.update(ee=>(ee.push(rt),ee))),this.destinationFormPair.update(ee=>(ee.advanced.push(rt),ee))}}for(let S=0;S<f.length;S++){let D=f[S],L=e?.advanced[D.name],q=L??D.defaultValue;i&&L&&(this.createFormField(Z,D,q),this.selectedHttpOptions.update(k=>(k.push(D),k)))}this.destinationFormPair.update(S=>({oauthField:S.oauthField,custom:S.custom.sort((D,L)=>D.order-L.order),dynamic:S.dynamic.sort((D,L)=>D.order-L.order),advanced:S.advanced.sort((D,L)=>D.order-L.order)})),this.destinationForm.controls.destinations.push(nn({key:o?.customKey??n,customGroup:V,dynamicGroup:oe,advancedGroup:Z}))}#p(){this.generalForm.reset(),this.destinationForm.controls.destinations.clear(),this.destinationForm.reset(),this.sourceDataForm.reset(),this.scheduleFields.autoRun.set($e.autoRun),this.scheduleFields.nextTime.set($e.nextTime),this.scheduleFields.runAgain.set($e.runAgain),this.optionsFields.remoteVolumeSize.set("50MB"),this.optionsFields.backupRetention.set("all"),this.settings.set([])}static \u0275fac=function(e){return new(e||t)};static \u0275prov=ye({token:t,factory:t.\u0275fac,providedIn:"root"})};var wn=["formRef"],Rn=(t,n,e,i)=>({index:t,formView:n,formGroupName:"custom",destinationType:e,oauthField:i}),Dt=t=>({$implicit:t}),xn=(t,n,e,i)=>({index:t,formView:n,formGroupName:"dynamic",destinationType:e,oauthField:i}),In=(t,n,e,i)=>({index:t,formView:n,formGroupName:"advanced",destinationType:e,oauthField:i}),vn=(t,n,e,i)=>({index:t,formView:n,formGroupName:"advanced",asHttpOptions:!0,destinationType:e,oauthField:i}),bn=()=>({maxWidth:"700px",width:"100%"});function Gn(t,n){t&1&&(y(0,5,2),d(1,"spk-icon"),A())}function Ln(t,n){t&1&&R(0,5,3)}function Vn(t,n){if(t&1){let e=G();y(0,5,1),s(1,"button",21),P("click",function(){F(e);let o=p();return g(o.testDestination())}),_(2,Gn,2,0)(3,Ln,1,0),a(),A()}if(t&2){let e=p();l(),ke("loader",e.testLoading())("success",e.successfulTest()),l(),T(e.successfulTest()?2:3)}}function Un(t,n){if(t&1){let e=G();s(0,"p",27),P("click",function(){F(e);let o=p();return g(o.removeDestinationFormGroup(o.destinationCount()-1))}),y(1,8),d(2,"span",28),A(),a()}}function Bn(t,n){if(t&1){let e=G();s(0,"div",34),P("click",function(){let o=F(e).$implicit,r=p(2);return g(r.addDestinationFormGroup(o.key))}),s(1,"h3"),m(2),a(),s(3,"p"),m(4),a()()}if(t&2){let e=n.$implicit;l(2),xe(e.displayName),l(2),xe(e.description)}}function Kn(t,n){if(t&1){let e=G();s(0,"button",35,1),P("click",function(){let o=F(e).$implicit,r=p(2);return g(r.addDestinationFormGroup(o.key))}),m(2),a()}if(t&2){let e=n.$implicit;l(2),Y(" ",e.displayName," ")}}function Wn(t,n){if(t&1&&(s(0,"div",29),ne(1,Bn,5,2,"div",30,te),a(),s(3,"spk-menu",31)(4,"button",32),R(5,9),a(),H(6,20),ne(7,Kn,3,1,"button",33,te),X(),a()),t&2){let e=p();l(),ie(e.destinationTypeOptionsFocused()),l(2),u("searchable",!0),l(4),ie(e.destinationTypeOptionsNotFocused())}}function zn(t,n){t&1&&et(0)}function Hn(t,n){if(t&1&&_(0,zn,1,0,"ng-container",40),t&2){let e,i=n.$implicit,o=n.$index;p();let r=re(29),c=p();u("ngTemplateOutlet",r)("ngTemplateOutletContext",nt(7,Dt,it(2,Rn,o,i,(e=c.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,c.destinationFormPair().oauthField)))}}function Xn(t,n){t&1&&et(0)}function jn(t,n){if(t&1&&_(0,Xn,1,0,"ng-container",40),t&2){let e,i=n.$implicit,o=n.$index;p();let r=re(29),c=p();u("ngTemplateOutlet",r)("ngTemplateOutletContext",nt(7,Dt,it(2,xn,o,i,(e=c.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,c.destinationFormPair().oauthField)))}}function qn(t,n){if(t&1){let e=G();y(0,10,1),s(1,"button",35,1),P("click",function(){let o=F(e).$implicit,r=p(2);return g(r.addAdvancedFormPair(o,0))}),a(),A()}if(t&2){let e=n.$implicit;l(),At(e.name),Pt(0)}}function Yn(t,n){t&1&&et(0)}function Qn(t,n){if(t&1&&_(0,Yn,1,0,"ng-container",40),t&2){let e,i=n.$implicit,o=n.$index;p();let r=re(29),c=p();u("ngTemplateOutlet",r)("ngTemplateOutletContext",nt(7,Dt,it(2,In,o,i,(e=c.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,c.destinationFormPair().oauthField)))}}function Jn(t,n){if(t&1){let e=G();y(0,11,1),s(1,"button",35,1),P("click",function(){let o=F(e).$implicit,r=p(2);return g(r.addHttpOption(o,0))}),a(),A()}if(t&2){let e=n.$implicit;l(),At(e.name),Pt(0)}}function Zn(t,n){t&1&&et(0)}function ei(t,n){if(t&1&&_(0,Zn,1,0,"ng-container",40),t&2){let e,i=n.$implicit,o=n.$index;p();let r=re(29),c=p();u("ngTemplateOutlet",r)("ngTemplateOutletContext",nt(7,Dt,it(2,vn,o,i,(e=c.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,c.destinationFormPair().oauthField)))}}function ti(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(2).$implicit;u("message",e.formView.longDescription)}}function ni(t,n){if(t&1&&(s(0,"app-file-tree",43)(1,"label",47),m(2),_(3,ti,3,1,"spk-tooltip",48),a(),d(4,"input",49),a()),t&2){let e,i=p().$implicit,o=p(2);u("startingPath",o.getFormFieldValue(0,i.formGroupName,i.formView.name))("accepts",i.formView.accepts)("showFiles",!0)("hideShortcuts",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),W("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),l(),Y(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),l(),T(i.formView.longDescription?3:-1),l(),W("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),ce("formControlName",i.formView.name)}}function ii(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(2).$implicit;u("message",e.formView.longDescription)}}function oi(t,n){if(t&1&&(s(0,"app-file-tree",44)(1,"label",47),m(2),_(3,ii,3,1,"spk-tooltip",48),a(),d(4,"input",49),a()),t&2){let e,i=p().$implicit,o=p(2);u("hideShortcuts",!0)("startingPath",o.getFormFieldValue(0,i.formGroupName,i.formView.name)),l(),W("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),l(),Y(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),l(),T(i.formView.longDescription?3:-1),l(),W("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),ce("formControlName",i.formView.name)}}function ri(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(2).$implicit;u("message",e.formView.longDescription)}}function ai(t,n){t&1&&(s(0,"spk-icon",51),m(1,"link"),a())}function si(t,n){t&1&&(s(0,"spk-icon",51),m(1,"envelope"),a())}function li(t,n){t&1&&(s(0,"spk-icon",51),m(1,"textbox"),a())}function ci(t,n){if(t&1&&(s(0,"spk-form-field")(1,"label",47),m(2),_(3,ri,3,1,"spk-tooltip",48),a(),d(4,"input",50),_(5,ai,2,0,"spk-icon",51)(6,si,2,0,"spk-icon",51)(7,li,2,0,"spk-icon",51),a()),t&2){let e,i=p().$implicit;l(),W("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),l(),Y(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),l(),T(i.formView.longDescription?3:-1),l(),W("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),ce("formControlName",i.formView.name),u("type",i.formView.type==="Email"?"email":"text"),l(),T(i.formView.type==="Path"?5:i.formView.type==="Email"?6:7)}}function pi(t,n){if(t&1){let e=G();s(0,"span",55),P("click",function(){F(e);let o=p(2).$implicit,r=p(2);return g(r.oauthStartTokenCreation(o.destinationType,o))}),m(1," AuthID "),a()}}function ui(t,n){t&1&&(s(0,"spk-icon",51),m(1,"password"),a())}function di(t,n){if(t&1){let e=G();s(0,"spk-icon",56),P("click",function(){F(e);let o=p(2).$implicit;return g(o.formView.showPassword=!o.formView.showPassword)}),m(1," eye "),a()}}function mi(t,n){if(t&1){let e=G();s(0,"spk-icon",56),P("click",function(){F(e);let o=p(2).$implicit;return g(o.formView.showPassword=!o.formView.showPassword)}),m(1," eye-slash "),a()}}function _i(t,n){if(t&1&&(s(0,"spk-form-field")(1,"label",47),m(2),a(),d(3,"input",52),_(4,pi,2,0,"span",53)(5,ui,2,0,"spk-icon",51)(6,di,2,0,"spk-icon",54)(7,mi,2,0,"spk-icon",54),a()),t&2){let e,i=p().$implicit;l(),W("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),l(),Y(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),l(),W("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),ce("formControlName",i.formView.name),u("type",i.formView.showPassword?"text":"password"),l(),T(i.oauthField===i.formView.name?4:5),l(2),T(i.formView.showPassword?6:7)}}function Fi(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(3).$implicit;u("message",e.formView.longDescription)}}function gi(t,n){if(t&1&&m(0),t&2){let e=p().$implicit;Nt(" ",e==null?null:e.key," (",e==null?null:e.value,") ")}}function Ci(t,n){if(t&1&&m(0),t&2){let e=p().$implicit;Y(" ",e," ")}}function hi(t,n){if(t&1&&_(0,gi,1,2)(1,Ci,1,1),t&2){let e=p(3).$implicit;T(e.formView.loadOptions?0:1)}}function fi(t,n){if(t&1&&(s(0,"spk-select",57)(1,"label",47),m(2),_(3,Fi,3,1,"spk-tooltip",48),a(),d(4,"input",49),a(),_(5,hi,2,1,"ng-template",null,3,ot)),t&2){let e,i=re(6);p();let o=$t(0),r=p().$implicit;u("options",o)("isClearable",!1)("optionTemplate",i),l(),W("for","destination-",r.formGroupName,"-",r.index,"-",r.asHttpOptions?"http":"other",""),l(),Y(" ",(e=r.formView.shortDescription)!==null&&e!==void 0?e:r.formView.name," "),l(),T(r.formView.longDescription?3:-1),l(),W("id","destination-",r.formGroupName,"-",r.index,"-",r.asHttpOptions?"http":"other",""),ce("formControlName",r.formView.name)}}function Si(t,n){if(t&1&&(kt(0),_(1,fi,7,14)),t&2){let e=p().$implicit,i=Ot(e.formView.loadOptions?e.formView.loadOptions(p(2).injector)():e.formView.options);l(),T(i?1:-1)}}function Ti(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(3).$implicit;u("message",e.formView.longDescription)}}function Di(t,n){if(t&1&&m(0),t&2){let e=n.$implicit;Nt(" ",e.key," ",e.value?"("+e.value+")":""," ")}}function Ei(t,n){if(t&1&&(s(0,"spk-select",59)(1,"label",47),m(2),_(3,Ti,3,1,"spk-tooltip",48),a(),d(4,"input",49),a(),_(5,Di,1,2,"ng-template",null,4,ot)),t&2){let e,i=re(6);p();let o=$t(0),r=p().$implicit;u("options",o)("asFreeText",!0)("inlineSearch",!0)("optionTemplate",i),l(),W("for","destination-",r.formGroupName,"-",r.index,"-",r.asHttpOptions?"http":"other",""),l(),Y(" ",(e=r.formView.shortDescription)!==null&&e!==void 0?e:r.formView.name," "),l(),T(r.formView.longDescription?3:-1),l(),W("id","destination-",r.formGroupName,"-",r.index,"-",r.asHttpOptions?"http":"other",""),ce("formControlName",r.formView.name)}}function yi(t,n){t&1&&d(0,"spk-progress-bar",58)}function Ai(t,n){if(t&1&&(kt(0),_(1,Ei,7,15)(2,yi,1,0,"spk-progress-bar",58)),t&2){let e=p().$implicit,i=Ot(e.formView.loadOptions?e.formView.loadOptions(p(2).injector)():e.formView.options);l(),T(i?1:2)}}function Pi(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(2).$implicit;u("message",e.formView.longDescription)}}function Ni(t,n){if(t&1&&(s(0,"app-size",45)(1,"label",47),m(2),_(3,Pi,3,1,"spk-tooltip",48),a()()),t&2){let e,i=p().$implicit;u("inputType",i.Name)("formControlName",i.formView.name)("customId",`destination-{{ item.formGroupName }}-{{ item.index }}-{{
|
|
7
|
+
item.asHttpOptions ? 'http' : 'other'
|
|
8
|
+
}}`),l(),W("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),l(),Y(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),l(),T(i.formView.longDescription?3:-1)}}function ki(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(2).$implicit;u("message",e.formView.longDescription)}}function Oi(t,n){if(t&1&&(s(0,"spk-form-field")(1,"label",47),m(2),_(3,ki,3,1,"spk-tooltip",48),a(),d(4,"input",60),s(5,"spk-icon",51),m(6,"numpad"),a()()),t&2){let e,i=p().$implicit;l(),W("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),l(),Y(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),l(),T(i.formView.longDescription?3:-1),l(),W("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),ce("formControlName",i.formView.name)}}function $i(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(2).$implicit;u("message",e.formView.longDescription)}}function Mi(t,n){if(t&1&&(s(0,"spk-toggle",46)(1,"label",47),m(2),_(3,$i,3,1,"spk-tooltip",48),a(),d(4,"input",61),a()),t&2){let e,i=p().$implicit;l(),W("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),l(),Y(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),l(),T(i.formView.longDescription?3:-1),l(),W("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),ce("formControlName",i.formView.name)}}function wi(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(2).$implicit;u("message",e.formView.longDescription)}}function Ri(t,n){if(t&1&&m(0),t&2){let e=n.$implicit;Y(" ",e," ")}}function xi(t,n){if(t&1&&(s(0,"spk-select",62)(1,"label",47),m(2),_(3,wi,3,1,"spk-tooltip",48),a(),d(4,"input",63),a(),_(5,Ri,1,1,"ng-template",null,4,ot)),t&2){let e,i=re(6),o=p().$implicit;u("options",o.formView.options)("selectMultiple",!0)("optionTemplate",i),l(),Bt("for","destination-",o.formGroupName,"-",o.index,""),l(),Y(" ",(e=o.formView.shortDescription)!==null&&e!==void 0?e:o.formView.name," "),l(),T(o.formView.longDescription?3:-1),l(),ce("formControlName",o.formView.name)}}function Ii(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(2).$implicit;u("message",e.formView.longDescription)}}function vi(t,n){if(t&1&&(s(0,"app-timespan",45)(1,"label",47),m(2),_(3,Ii,3,1,"spk-tooltip",48),a()()),t&2){let e,i=p().$implicit;u("inputType",i.formView.name)("formControlName",i.formView.name)("customId","destination-"+i.formGroupName+"-"+i.index+"-"+(i.asHttpOptions?"http":"other")),l(),W("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),l(),Y(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),l(),T(i.formView.longDescription?3:-1)}}function bi(t,n){if(t&1){let e=G();s(0,"button",64),P("click",function(){F(e);let o=p().$implicit,r=p(2);return g(r.removeFormView(o.formView,0))}),s(1,"spk-icon"),m(2,"x-circle"),a()()}}function Gi(t,n){if(t&1&&(s(0,"div",41),H(1,42),_(2,ni,5,17,"app-file-tree",43)(3,oi,5,13,"app-file-tree",44)(4,ci,8,13,"spk-form-field")(5,_i,8,13,"spk-form-field")(6,Si,2,2)(7,Ai,3,2)(8,Ni,4,9,"app-size",45)(9,Oi,7,11,"spk-form-field")(10,Mi,5,11,"spk-toggle",46)(11,xi,7,9)(12,vi,4,9,"app-timespan",45),X(),_(13,bi,3,0,"button",32),a()),t&2){let e=n.$implicit;ke("single-field",e.formGroupName!=="advanced"),l(),u("formGroupName",e.formGroupName),l(),T(e.formView.type==="FileTree"?2:e.formView.type==="FolderTree"?3:e.formView.type==="String"||e.formView.type==="Path"||e.formView.type==="Email"?4:e.formView.type==="Password"?5:e.formView.type==="Enumeration"?6:e.formView.type==="NonValidatedSelectableString"?7:e.formView.type==="Size"?8:e.formView.type==="Integer"?9:e.formView.type==="Boolean"?10:e.formView.type==="Flags"?11:e.formView.type==="Timespan"||e.formView.type==="DateTime"?12:-1),l(11),T(e.formGroupName==="advanced"?13:-1)}}function Li(t,n){if(t&1&&(H(0,22)(1,36),ne(2,Hn,1,9,"ng-container",null,te),ne(4,jn,1,9,"ng-container",null,te),s(6,"app-toggle-card",37),H(7,38),y(8,10),s(9,"spk-menu",31)(10,"button",39),d(11,"spk-icon"),a(),H(12,20),ne(13,qn,3,1,"button",33,te),X(),a(),A(),X(),ne(15,Qn,1,9,"ng-container",null,te),a(),s(17,"app-toggle-card",37),H(18,38),y(19,11),s(20,"spk-menu",31)(21,"button",39),d(22,"spk-icon"),a(),H(23,20),ne(24,Jn,3,1,"button",33,te),X(),a(),A(),X(),ne(26,ei,1,9,"ng-container",null,te),a(),_(28,Gi,14,5,"ng-template",null,2,ot),X()()),t&2){let e=p();l(2),ie(e.destinationFormPair().custom),l(2),ie(e.destinationFormPair().dynamic),l(2),u("disallowToggle",!0),l(3),u("searchable",!0),l(),u("disabled",e.notSelectedAdvancedFormPair().length===0),l(3),ie(e.notSelectedAdvancedFormPair()),l(2),ie(e.selectedAdvancedFormPair()),l(2),u("disallowToggle",!0),l(3),u("searchable",!0),l(),u("disabled",e.notSelectedHttpOptions().length===0),l(3),ie(e.notSelectedHttpOptions()),l(2),ie(e.selectedHttpOptions())}}function Vi(t,n){if(t&1){let e=G();s(0,"spk-dialog",65),K("isOpenChange",function(o){F(e);let r=p();return B(r.targetUrlDialogOpen,o)||(r.targetUrlDialogOpen=o),g(o)}),s(1,"header",66)(2,"h2"),R(3,12),a(),s(4,"spk-alert",67),R(5,13),a()(),s(6,"div",68)(7,"spk-form-field"),d(8,"textarea",69),a()(),s(9,"footer",70)(10,"button",24),P("click",function(){F(e);let o=p();return g(o.closeTargetUrlDialog(!1))}),m(11,"Cancel"),a(),s(12,"button",71),P("click",function(){F(e);let o=p();return g(o.closeTargetUrlDialog(!0))}),y(13,14),d(14,"spk-icon"),A(),a()()()}if(t&2){let e=p();U("isOpen",e.targetUrlDialogOpen),u("options",tt(3,bn)),l(8),u("formControl",e.targetUrlCtrl)}}var Tt=new Ce,tn=(t={destinations:[]})=>Tt.group({destinations:Tt.array(t.destinations)}),nn=({key:t,customGroup:n,dynamicGroup:e,advancedGroup:i})=>Tt.group({destinationType:Tt.control(t),custom:n,dynamic:e,advanced:i}),bt=class t{#n=O(pe);#t=O(Ae);#e=O(fe);#i=O(ve);#o=O(Ft);injector=O(Vt);formRef=Me.required("formRef");destinationForm=this.#e.destinationForm;destinationFormPair=this.#e.destinationFormPair;selectedAdvancedFormPair=this.#e.selectedAdvancedFormPair;notSelectedAdvancedFormPair=this.#e.notSelectedAdvancedFormPair;selectedHttpOptions=this.#e.selectedHttpOptions;notSelectedHttpOptions=this.#e.notSelectedHttpOptions;destinationOptions=this.#e.destinationOptions;destinationFormSignal=this.#e.destinationFormSignal;destinationCount=b(()=>this.destinationFormSignal()?.destinations?.length??0);successfulTest=E(!1);testLoading=E(!1);destinationTypeOptionsInFocus=E(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=E(Se.map(n=>({key:n.customKey??n.key,customKey:n.customKey??null,displayName:n.displayName,description:n.description})));destinationTypeOptionsFocused=b(()=>{let n=this.destinationTypeOptionsInFocus(),e=this.destinationTypeOptions();return n.map(i=>e.find(o=>o.key===i))});destinationTypeOptionsNotFocused=b(()=>{let n=this.destinationTypeOptionsInFocus();return this.destinationTypeOptions().filter(i=>!n.includes(i.key))});getFormFieldValue(n,e,i){return((this.destinationForm.controls.destinations.controls?.[n]).controls?.[e]).controls[i].value}getFormControl(n,e,i){return((this.destinationForm.controls.destinations.controls?.[n]).controls?.[e]).controls[i]}addDestinationFormGroup(n){this.#e.addDestinationFormGroup(n)}addAdvancedFormPair(n,e){this.#e.addAdvancedFormPair(n,e)}removeFormView(n,e){this.#e.removeAdvancedFormPair(n,e)}addHttpOption(n,e){this.#e.addHttpOption(n,e)}targetUrl=b(()=>this.#e.getCurrentTargetUrl()[0]);targetUrlCtrl=new ut;targetUrlInitial=E(null);targetUrlDialogOpen=E(!1);openTargetUrlDialog(){let e=this.#e.getCurrentTargetUrl()[0];this.targetUrlCtrl.setValue(e),this.targetUrlInitial.set(e),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl.value,i=this.targetUrlInitial();!n||e===i||this.#e.updateFieldsFromTargetUrl(this.targetUrlCtrl.value)}testDestination(n=0){let i=this.#e.getCurrentTargetUrl()[n];i&&(this.testLoading.set(!0),this.#o.testDestination(i,n,!0).pipe(Ze(()=>this.testLoading.set(!1))).subscribe({next:o=>{if(o.action==="success"){this.#e.isNew()&&(o.containsBackup===!0?this.#i.open(J,{data:{title:$localize`Folder contains backup`,message:$localize`The remote destination already contains a backup. You must use a different folder for each backup.`,confirmText:$localize`OK`,cancelText:void 0}}):o.anyFilesFound===!0&&this.#i.open(J,{data:{title:$localize`Folder is not empty`,message:$localize`The remote destination is not empty. It is recommended to use an empty folder for the backup.`,confirmText:$localize`OK`,cancelText:void 0}})),this.successfulTest.set(!0),setTimeout(()=>{this.successfulTest.set(!1)},3e3);return}if(o.action==="generic-error"){this.successfulTest.set(!1);return}o.action==="trust-cert"&&this.#e.addHttpOptionByName("accept-specified-ssl-hash",o.destinationIndex,o.certData),o.action==="approve-host-key"&&this.#e.addOrUpdateAdvancedFormPairByName("ssh-fingerprint",o.destinationIndex,o.reportedHostKey),o.testAgain&&this.testDestination(o.destinationIndex)}}))}mapToTargetUrl(n){return Ct(n.value)}removeDestinationFormGroup(n){this.destinationForm.controls.destinations.removeAt(n)}displayFn(n){let e=this.destinationOptions().find(i=>i.Key===n);return e?`${e.DisplayName}`:""}goBack(){this.#n.navigate(["general"],{relativeTo:this.#t.parent})}next(){this.#n.navigate(["source-data"],{relativeTo:this.#t.parent})}#r=E("https://duplicati-oauth-handler.appspot.com/").asReadonly();#s=E(Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2)).asReadonly();#a=E(!1);#l=E(null);keyCreation(){}oauthStartTokenCreation(n,e){let i=this.getFormControl(e.index,e.formGroupName,e.formView.name);this.#a.set(!0);let o=this.#s(),r=450,c=600,f=this.#r()+"?type="+n+"&token="+o,N=screen.width/2-r/2,I=screen.height/2-c/2,z=window.open(f,"_blank","height="+c+",width="+r+",menubar=0,status=0,titlebar=0,toolbar=0,left="+N+",top="+I);return window.addEventListener("message",w=>{let v=w.data.startsWith("authid:"),V=v?w.data.replace("authid:",""):null;console.log("event",w),v&&(i.setValue(V),this.#a.set(!1),z?.close())}),!1}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=le({type:t,selectors:[["app-destination"]],viewQuery:function(e,i){e&1&&we(i.formRef,wn,5),e&2&&Re()},decls:24,vars:6,consts:()=>{let n;n=$localize` Backup destination ${"\uFFFD#5\uFFFD"}:START_TAG_DIV:${"\uFFFD*6:1\uFFFD"}:START_BLOCK_IF_1:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON:${"\uFFFD*2:2\uFFFD"}:START_BLOCK_IF: Connected ${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/*2:2\uFFFD|\uFFFD/*6:1\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*3:3\uFFFD"}:START_BLOCK_ELSE: Test destination ${"\uFFFD/*3:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*2:2\uFFFD|\uFFFD/*6:1\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD#7\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:dots-three-vertical${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#10\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD#11\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:link${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SPK_MENU:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_DIV:`,n=Oe(n);let e;e=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let i;i=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let o;o=$localize` Want to select another destination? ${"\uFFFD#2\uFFFD"}:START_TAG_SPAN:Click here${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPAN:`;let r;r=$localize`Other destinations`;let c;c=$localize` Advanced options ${"\uFFFD#9\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#10\uFFFD"}:START_TAG_BUTTON: Add advanced option ${"\uFFFD#11\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#10\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#12\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD*14:1\uFFFD"}:START_BLOCK_FOR:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON_1: ${"\uFFFD0:1\uFFFD"}:INTERPOLATION: ${"[\uFFFD/#10\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/*14:1\uFFFD"}:CLOSE_BLOCK_FOR:${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_MENU:`,c=Oe(c);let f;f=$localize` Http options ${"\uFFFD#20\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#21\uFFFD"}:START_TAG_BUTTON: Add http option ${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#21\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#23\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD*25:1\uFFFD"}:START_BLOCK_FOR:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON_1: ${"\uFFFD0:1\uFFFD"}:INTERPOLATION: ${"[\uFFFD/#21\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/*25:1\uFFFD"}:CLOSE_BLOCK_FOR:${"\uFFFD/#23\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#20\uFFFD"}:CLOSE_TAG_SPK_MENU:`,f=Oe(f);let N;N=$localize`Edit target URL`;let I;I=$localize` Be careful, this will overwrite everything you have in your destination. `;let z;return z=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SPK_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],["option",""],["fieldTemplate",""],["enumOptionTemplate",""],["optionTemplate",""],n,e,i,o,r,c,f,N,I,z,[3,"submit","formGroup"],[1,"title-30"],[1,"actions"],["spk-button","","type","button",1,"small",3,"loader","success"],["spk-button","","type","button",1,"small"],["menu",""],["spk-button","","type","button",1,"small",3,"click"],["formArrayName","destinations"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[3,"isOpen","options"],[3,"click"],[1,"spk-primary"],[1,"most-common-destinations"],[1,"tile"],[3,"searchable"],["spk-button","","type","button",1,"outlined"],["type","button"],[1,"tile",3,"click"],["type","button",3,"click"],["formGroupName","0"],[3,"disallowToggle"],["title",""],["spk-button","","type","button",1,"outlined","small",3,"disabled"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"field-row"],[3,"formGroupName"],[3,"startingPath","accepts","showFiles","hideShortcuts","showHiddenNodes","selectFiles"],[3,"hideShortcuts","startingPath"],[3,"inputType","formControlName","customId"],[1,"primary","raised"],[3,"for"],[1,"primary",3,"message"],["type","text",3,"id","formControlName"],[3,"type","id","formControlName"],["prefix",""],["autocomplete","off",3,"type","id","formControlName"],["prefix","",1,"link"],["suffix","",1,"clickable"],["prefix","",1,"link",3,"click"],["suffix","",1,"clickable",3,"click"],[3,"options","isClearable","optionTemplate"],[1,"indeterminate","primary"],["label","key","value","value",3,"options","asFreeText","inlineSearch","optionTemplate"],["type","number",3,"id","formControlName"],["type","checkbox",3,"id","formControlName"],[1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["type","text","id","text",3,"formControlName"],["spk-button","","type","button",1,"outlined",3,"click"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"warning"],["content",""],["id","targetUrl","autocomplete","off",3,"formControl"],["footer",""],["spk-button","","type","submit",1,"raised","primary",3,"click"]]},template:function(e,i){if(e&1){let o=G();s(0,"form",15,0),P("submit",function(){return F(o),g(i.next())}),s(2,"header")(3,"h3",16),y(4,5),s(5,"div",17),_(6,Vn,4,5,"button",18),s(7,"spk-menu")(8,"button",19),d(9,"spk-icon"),a(),H(10,20),s(11,"button",21),P("click",function(){return F(o),g(i.openTargetUrlDialog())}),d(12,"spk-icon"),a(),X(),a()(),A(),a(),_(13,Un,3,0,"p"),a(),_(14,Wn,9,1)(15,Li,30,6,"ng-container",22),s(16,"div",23)(17,"button",24),P("click",function(){return F(o),g(i.goBack())}),y(18,6),d(19,"spk-icon"),A(),a(),s(20,"button",25),y(21,7),d(22,"spk-icon"),A(),a()()(),_(23,Vi,15,4,"spk-dialog",26)}if(e&2){let o;u("formGroup",i.destinationForm),l(6),T(i.destinationCount()>0?6:-1),l(7),T(i.destinationCount()>0?13:-1),l(),T(i.destinationCount()===0?14:-1),l(),T(!((o=i.destinationFormSignal())==null||o.destinations==null)&&o.destinations.length?15:-1),l(8),T(i.targetUrlDialogOpen()?23:-1)}},dependencies:[je,Ke,_e,We,Ve,ge,Ue,dt,ze,He,mt,Ht,Kt,de,zt,ue,Ge,pt,Wt,lt,me,ct,Yt,qe,_t,qt],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] spk-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;padding-bottom:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.form-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.form-column[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.form-column[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 1fr;gap:.5rem;align-items:flex-end}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-500)}.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-level-40);border-radius:var(--shape-3);box-shadow:var(--shadow-1);background-color:var(--base-level-20);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-500)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}spk-select[_ngcontent-%COMP%]{--miw: p2r(120)}"],changeDetection:0})};export{Ft as a,Ct as b,Se as c,tn as d,nn as e,bt as f,Qt as g,xt as h,Rt as i,$e as j,It as k,Zt as l,vt as m,fe as n};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as V}from"./chunk-
|
|
1
|
+
import{a as V}from"./chunk-CD3DB23J.js";import{a as A,n as R,w as F}from"./chunk-WX7L7V6J.js";import{j as N}from"./chunk-CKPICCFH.js";import{$b as s,Bc as x,Cb as w,Ib as m,Mb as y,Nb as r,Qa as l,Y as O,ab as h,ac as L,bc as d,da as b,ea as I,fb as u,nb as T,ob as P,pb as C,pc as G,ra as p,rc as $,sb as g,tb as S,ua as M,ub as v,vb as f,wb as o,xb as i,yb as k}from"./chunk-W2F756OF.js";function B(n,t){n&1&&(o(0,"div",4),m(1,0),i())}function D(n,t){if(n&1&&(o(0,"li"),s(1),i()),n&2){let e=t.$implicit;l(),L(e)}}function U(n,t){if(n&1&&(o(0,"code")(1,"ol",15),v(2,D,2,1,"li",null,S),i()()),n&2){let e=r(2).$implicit,a=r(2);l(2),f(a.breakIntoLines(e.Exception))}}function X(n,t){if(n&1&&(o(0,"li"),s(1),i()),n&2){let e=t.$implicit;l(),L(e)}}function z(n,t){if(n&1&&(o(0,"code")(1,"ol",15),v(2,X,2,1,"li",null,S),i()()),n&2){let e=r(2).$implicit,a=r(2);l(2),f(a.breakIntoLines(e.Message))}}function W(n,t){if(n&1&&(o(0,"tr")(1,"td",12)(2,"spk-list",13)(3,"div",14),s(4),i(),o(5,"div",14),s(6),i(),o(7,"div",14),s(8),i(),o(9,"div",14),s(10),i(),o(11,"div",14),s(12),i()(),u(13,U,4,0,"code")(14,z,4,0,"code"),i()()),n&2){let e=r().$implicit;l(4),d("ID: ",e.ID,""),l(2),d("Type: ",e.Type,""),l(2),d("Tag: ",e.Tag,""),l(2),d("TaskID: ",e.TaskID,""),l(2),d("MessageID: ",e.MessageID,""),l(),g(e.Exception?13:-1),l(),g(e.Message?14:-1)}}function j(n,t){if(n&1){let e=w();o(0,"tr",10),y("click",function(){let _=b(e).$index,c=r(2);return I(c.toggleRow(_))}),o(1,"td"),s(2),G(3,"date"),i(),o(4,"td"),s(5),i(),o(6,"td",8)(7,"button",11)(8,"spk-icon"),s(9,"caret-down"),i()()()(),u(10,W,15,7,"tr")}if(n&2){let e=t.$implicit,a=t.$index,_=r(2);l(2),L($(3,5,e.When,"MMM dd. hh:mm")),l(3),L(_.subStringMessage(e.Message)),l(2),C("rotated-icon",a===_.openRowIndex()),l(3),g(a===_.openRowIndex()?10:-1)}}function H(n,t){if(n&1&&(o(0,"spk-table",6)(1,"tr",7)(2,"th"),m(3,1),i(),o(4,"th"),m(5,2),i(),k(6,"th",8),i(),v(7,j,11,8,null,null,S),o(9,"div",9),m(10,3),i()()),n&2){let e=r();P("grid-template-columns","auto 1fr auto"),C("type-b",e.asSimpleList()),T("data",e.logs())("loading",e.logsLoading()),l(7),f(e.logs())}}var E=class n{#e=O(V);whenFilter=p();backupIdFilter=p();asSimpleList=p();polling=p();logLevel=this.#e.logLevel;logLevelByLabel=this.#e.logLevelByLabel;logs=this.#e.logs;logsLoading=this.#e.logsLoading;pollingEffect=x(()=>{let t=this.polling()??!1;this.#e.isPolling.set(t)});openRowIndex=M(null);whenEffect=x(()=>{let t=this.whenFilter()??null;this.#e.setWhenFilter(t),this.#e.logLevel.set(t?"Verbose":"Disabled")});backupIdEffect=x(()=>{let t=this.backupIdFilter()??null;this.#e.setBackupIdFilter(t),this.#e.logLevel.set(t?"Verbose":"Disabled")});toggleRow(t){this.openRowIndex.set(t===this.openRowIndex()?null:t)}breakIntoLines(t){return t?t.split(`
|
|
2
2
|
`):[]}subStringMessage(t){return t?t.substring(0,80)+"...":""}ngOnDestroy(){this.#e.destroy()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=h({type:n,selectors:[["app-logs-live"]],hostVars:2,hostBindings:function(e,a){e&2&&C("simple-list",a.asSimpleList())},inputs:{whenFilter:[1,"whenFilter"],backupIdFilter:[1,"backupIdFilter"],asSimpleList:[1,"asSimpleList"],polling:[1,"polling"]},decls:2,vars:1,consts:()=>{let t;t=$localize`Live logs are disabled`;let e;e=$localize`When`;let a;a=$localize`Message`;let _;return _=$localize`No data available`,[t,e,a,_,[1,"live-view-disabled"],[3,"type-b","data","loading","grid-template-columns"],[3,"data","loading"],["table-header",""],[1,"sticky-end"],["table-no-rows",""],[3,"click"],["spk-button","","type","button",1,"outlined","small"],[1,"expanded-cell"],[1,"primary"],["item",""],[1,"line-numbers-ol"]]},template:function(e,a){e&1&&u(0,B,2,0,"div",4)(1,H,11,6,"spk-table",5),e&2&&g(a.logLevel()==="Disabled"?0:1)},dependencies:[F,A,R,N],styles:["[_nghost-%COMP%]{display:block}.simple-list[_nghost-%COMP%] spk-table[_ngcontent-%COMP%]{--table-td-bg: var(--base-level-20);height:100%}.live-view-disabled[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;min-height:18.75rem;width:100%;background-color:var(--base-level-20);border:1px solid var(--base-level-30);border-radius:var(--shape-2);font:var(--paragraph-20)}.expanded-cell[_ngcontent-%COMP%]{height:auto;grid-column:1/-1;white-space:pre-wrap;display:flex;flex-direction:column}h3[_ngcontent-%COMP%]{font:var(--title-30);margin:0 0 1.25rem}spk-table[_ngcontent-%COMP%]{--table-columns: auto auto 1fr auto}spk-table[_ngcontent-%COMP%] td.id[_ngcontent-%COMP%]{justify-content:center}spk-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:has(code){padding:1rem .75rem;overflow:hidden}spk-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:has(code) code[_ngcontent-%COMP%]{background-color:var(--grey-800);color:var(--grey-100);padding:2.5rem 2.5rem 2.5rem 1.5rem;border-radius:var(--shape-3);overflow:auto;white-space:pre;max-width:100%}"],changeDetection:0})};export{E as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as P,e as v,f as L,i as w,n as V,q as x,r as X,t as U}from"./chunk-T2OUHRUV.js";import{d as A,e as I}from"./chunk-QVIZK4WW.js";import"./chunk-WMTA6PZM.js";import{B as G,a as b,c as h,g as $,l as B}from"./chunk-WX7L7V6J.js";import{h as y}from"./chunk-
|
|
1
|
+
import{c as P,e as v,f as L,i as w,n as V,q as x,r as X,t as U}from"./chunk-T2OUHRUV.js";import{d as A,e as I}from"./chunk-QVIZK4WW.js";import"./chunk-WMTA6PZM.js";import{B as G,a as b,c as h,g as $,l as B}from"./chunk-WX7L7V6J.js";import{h as y}from"./chunk-JSGFZ2GA.js";import"./chunk-CKPICCFH.js";import{$b as N,F as g,Gb as C,Hb as O,Ib as f,Lb as k,Mb as m,N as T,Qa as F,Y as u,ab as R,fb as S,lc as M,nb as c,pb as D,sb as E,ua as p,wb as i,xb as r,yb as _}from"./chunk-W2F756OF.js";import"./chunk-7CGTOI24.js";var j=()=>["/"];function z(l,e){l&1&&(i(0,"spk-form-field")(1,"label",11),f(2,2),r(),_(3,"input",12),r())}var a=new X,d=class l{#t=u(h);#e=u(y);#o=u(A);isRestoring=p(!1);isSecureFile=p(!1);importForm=a.group({config:a.control(""),cmdline:a.control(!1),importMetadata:a.control(!1),direct:a.control(!1),passphrase:a.control("")});selectedFile=p(null);onFileDropped(e){let t=e.target?.files?.item(0);if(t){let n=new FileReader;this.isSecureFile.set(t.type!=="application/json"),n.onload=this.#n.bind(this),n.readAsArrayBuffer(t)}}#n(e){let o=e.target?.result;this.importForm.patchValue({config:this.#r(o)})}#r(e){let o=new Uint8Array(e),t=o.byteLength,n="";for(let s=0;s<t;s++)n+=String.fromCharCode(o[s]);return btoa(n)}submit(){this.isRestoring.set(!0),this.#e.postApiV1BackupsImport({requestBody:this.importForm.value}).pipe(T(e=>{let t={Backup:e.data.Backup};return this.#e.postApiV1Backups({requestBody:t,temporary:!0})}),g(()=>this.isRestoring.set(!1))).subscribe({next:e=>{this.#o.navigate(["/restore-draft",e.ID])},error:e=>{this.#t.error(e.message)}})}static \u0275fac=function(o){return new(o||l)};static \u0275cmp=R({type:l,selectors:[["app-restore-from-config"]],decls:16,vars:7,consts:()=>{let e;e=$localize` Restore from config ${"\uFFFD#3\uFFFD"}:START_TAG_DIV:${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"[\uFFFD#5\uFFFD|\uFFFD#7\uFFFD]"}:START_TAG_SPK_ICON:arrow-left${"[\uFFFD/#5\uFFFD|\uFFFD/#7\uFFFD]"}:CLOSE_TAG_SPK_ICON: Back ${"[\uFFFD/#4\uFFFD|\uFFFD/#6\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#6\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#5\uFFFD|\uFFFD#7\uFFFD]"}:START_TAG_SPK_ICON:download-simple${"[\uFFFD/#5\uFFFD|\uFFFD/#7\uFFFD]"}:CLOSE_TAG_SPK_ICON: Restore ${"[\uFFFD/#4\uFFFD|\uFFFD/#6\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_DIV:`,e=k(e);let o;o=$localize`Select a configuration file`;let t;return t=$localize`Passphrase`,[e,o,t,[1,"actions"],["spk-button","","type","button",1,"outlined",3,"routerLink"],["spk-button","","type","submit",1,"raised","primary",3,"click","disabled"],["autocomplete","off",3,"formGroup"],["spkDragDrop","",3,"fileDropped"],["for","file"],["type","file","accept",".json,.aes",3,"change"],["suffix",""],["for","passphrase"],["type","password","formControlName","passphrase"]]},template:function(o,t){o&1&&(i(0,"header")(1,"h3"),C(2,0),i(3,"div",3)(4,"button",4),_(5,"spk-icon"),r(),i(6,"button",5),m("click",function(){return t.submit()}),_(7,"spk-icon"),r()(),O(),r()(),i(8,"form",6)(9,"spk-form-field",7),m("fileDropped",function(s){return t.onFileDropped(s)}),i(10,"label",8),f(11,1),r(),i(12,"input",9),m("change",function(s){return t.onFileDropped(s)}),r(),i(13,"spk-icon",10),N(14,"upload"),r()(),S(15,z,4,0,"spk-form-field"),r()),o&2&&(F(4),c("routerLink",M(6,j)),F(2),D("loader",t.isRestoring()),c("disabled",t.isRestoring()),F(2),c("formGroup",t.importForm),F(7),E(t.isSecureFile()?15:-1))},dependencies:[U,w,P,v,L,V,x,I,G,B,b,$],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:3rem}h3[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;justify-content:space-between}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;max-width:31.25rem}"],changeDetection:0})};export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as L}from"./chunk-I3C2AEHI.js";import{d as A}from"./chunk-QVIZK4WW.js";import{a as k,c as I,h as w}from"./chunk-
|
|
1
|
+
import{a as L}from"./chunk-I3C2AEHI.js";import{d as A}from"./chunk-QVIZK4WW.js";import{a as k,c as I,h as w}from"./chunk-JSGFZ2GA.js";import{B as m,E as o,F as y,P as l,S as a,Y as i,f as h,k as u,n as g,r as d,ua as n}from"./chunk-W2F756OF.js";var c=class s{#r=i(L);#i=n(null);#t=window.self!==window.top;#s=n(this.#t);relayIsEnabled=this.#s.asReadonly();config=this.#i.asReadonly();configLoaded=this.#t?new u:null;isLoading=n(this.#t);parentIframeListner=null;parentOrigin="*";fetchConfig(){this.#n(),this.#t&&(this.#s.set(!0),this.parentIframeListner=new AbortController,this.#e("connected"),window.addEventListener("message",e=>{if(e.data.startsWith("access:")){let t=e.data.replace("access:",""),r=JSON.parse(t);if(!r?.accessToken||!r?.clientId){this.#e("error:invalid-config"),this.#s.set(!1);return}if(typeof r.clientId!="string"){this.#e("error:invalid-config"),this.#s.set(!1);return}if(typeof r.accessToken!="string"){this.#e("error:invalid-config"),this.#s.set(!1);return}let R=this.#r.getItem("locale")??"en-US",p=r.locale??"en-US";R!==p&&(this.#r.setItem("locale",p),window.location.reload()),this.#i.set(r),this.configLoaded?.next(!0),this.isLoading.set(!1),this.#e("handshake-complete")}},{signal:this.parentIframeListner.signal}))}#e(e){window.parent.postMessage(e,"*")}#n(){this.parentIframeListner&&(this.parentIframeListner.abort(),this.parentIframeListner=null)}setConfig(e){this.#i.set(e)}clearConfig(){this.#i.set(null)}static \u0275fac=function(t){return new(t||s)};static \u0275prov=a({token:s,factory:s.\u0275fac,providedIn:"root"})};var f="PROXY_AUTHED_FAKE_TOKEN",b=class s{#r=i(A);#i=i(I);#t=i(w);#s=i(c);#e=n(null);#n=n(!1);token=this.#e.asReadonly();isLoggingOut=this.#n.asReadonly();login(e){return this.#t.postApiV1AuthLogin({requestBody:{Password:e,RememberMe:!0}}).pipe(o(1),l(t=>t.AccessToken&&this.#e.set(t.AccessToken)))}refreshToken(){return this.#s.relayIsEnabled()?(this.#e.set(f),new h(e=>{e.next({AccessToken:f}),e.complete()})):this.#t.postApiV1AuthRefresh().pipe(o(1),l(e=>e.AccessToken&&this.#e.set(e.AccessToken)))}checkProxyAuthed(){let e=new k({"custom-proxy-check":"true"});return this.#i.get("/api/v1/systeminfo",{headers:e}).pipe(d(()=>(this.#e.set(f),!0)),m(()=>g(!1)))}logout(){this.#n.set(!0),this.#t.postApiV1AuthRefreshLogout().pipe(o(1),y(()=>{this.#n.set(!1),this.#e.set(null),this.#r.navigate(["/login"])})).subscribe()}static \u0275fac=function(t){return new(t||s)};static \u0275prov=a({token:s,factory:s.\u0275fac,providedIn:"root"})};export{c as a,f as b,b as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as u}from"./chunk-
|
|
1
|
+
import{h as u}from"./chunk-JSGFZ2GA.js";import{Ac as i,F as a,P as p,S as l,Y as m,ua as n}from"./chunk-W2F756OF.js";var d=class r{#s=m(u);isLoaded=n(!1);systemInfo=n(null);filterGroups=n(null);backendModules=i(()=>this.systemInfo()?.BackendModules??[]);allOptionsGrouped=i(()=>{let e={displayName:"Default",options:this.systemInfo()?.Options?.map(this.#e)??[]},s=this.systemInfo()?.GenericModules?.map(t=>({displayName:t.DisplayName??t.Key,options:t.Options?.map(this.#e)??[]}))??[],o=this.systemInfo()?.CompressionModules?.map(t=>({displayName:t.DisplayName??t.Key,options:t.Options?.map(this.#e)??[]}))??[];return[e,...s,...o]});allOptions=i(()=>this.allOptionsGrouped().reduce((e,s)=>[...e,...s.options],[]));hasV2ListOperations=i(()=>{let e=this.systemInfo()?.APIExtensions??[];return e.includes("v2:backup:list-filesets")&&e.includes("v2:backup:list-folder")});hasV2TestOperations=i(()=>(this.systemInfo()?.APIExtensions??[]).includes("v2:destination:test"));preload(e=!1){let s=this.#s.getApiV1Systeminfo().pipe(p(o=>{this.systemInfo.set(o)}),a(()=>this.isLoaded.set(!0)));if(e)return s;s.subscribe()}preloadFilterGroups(e=!1){let s=this.#s.getApiV1SysteminfoFiltergroups().pipe(p(o=>{this.filterGroups.set(o)}),a(()=>this.isLoaded.set(!0)));if(e)return s;s.subscribe()}#e(e){return{name:e.Name,type:e.Type,shortDescription:e.ShortDescription??void 0,longDescription:e.LongDescription??void 0,options:e.ValidValues}}static \u0275fac=function(s){return new(s||r)};static \u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"})};export{d as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as z}from"./chunk-
|
|
1
|
+
import{a as z}from"./chunk-CD3DB23J.js";import{a as x,c as w,d as B,e as U,f as X}from"./chunk-QVIZK4WW.js";import"./chunk-WMTA6PZM.js";import{a as K,f as V,o as h}from"./chunk-WX7L7V6J.js";import"./chunk-JSGFZ2GA.js";import"./chunk-CKPICCFH.js";import{Ab as f,Cb as R,Gb as l,Hb as s,Ib as b,Jb as y,Kb as v,Mb as u,Nb as c,Qa as p,Y as T,ab as D,da as a,ea as S,fb as P,nb as N,sb as G,ua as $,wb as i,xb as t,yb as _,zb as M}from"./chunk-W2F756OF.js";import"./chunk-7CGTOI24.js";function W(g,F){if(g&1){let n=R();i(0,"spk-menu",15)(1,"button",16),b(2,2),t(),M(3,17),i(4,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Disabled"))}),l(5,3),_(6,"spk-icon"),s(),t(),i(7,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Verbose"))}),l(8,4),_(9,"spk-icon"),s(),t(),i(10,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("ExplicitOnly"))}),l(11,5),_(12,"spk-icon"),s(),t(),i(13,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Profiling"))}),l(14,6),_(15,"spk-icon"),s(),t(),i(16,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Retry"))}),l(17,7),_(18,"spk-icon"),s(),t(),i(19,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Information"))}),l(20,8),_(21,"spk-icon"),s(),t(),i(22,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("DryRun"))}),l(23,9),_(24,"spk-icon"),s(),t(),i(25,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Warning"))}),l(26,10),_(27,"spk-icon"),s(),t(),i(28,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Error"))}),l(29,11),_(30,"spk-icon"),s(),t(),f(),t()}if(g&2){let n=c();N("openIndicator",!0),p(2),y(n.logLevelByLabel()),v(2)}}var O=class g{#n=T(B);#e=T(z);logLevel=this.#e.logLevel;logLevelByLabel=this.#e.logLevelByLabel;currentUrl=$(this.#n.url);constructor(){this.#n.events.subscribe(F=>{F instanceof x&&this.currentUrl.set(F.urlAfterRedirects)})}updateLogLevel(F){this.#e.isPolling.set(!0),this.#e.updateLogLevel(F)}static \u0275fac=function(n){return new(n||g)};static \u0275cmp=D({type:g,selectors:[["app-logs"]],decls:10,vars:1,consts:()=>{let F;F=$localize`${"\uFFFD#4\uFFFD"}:START_TAG_SPK_ICON:archive${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SPK_ICON: Stored `;let n;n=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SPK_ICON:play${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SPK_ICON: Live `;let o;o=$localize`Log level: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SPK_ICON:bell-simple-slash${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SPK_ICON: Disabled `;let C;C=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:megaphone-simple${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON: Verbose `;let L;L=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:flow-arrow${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Explicit only `;let d;d=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:speedometer${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Profiling `;let k;k=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SPK_ICON:arrow-arc-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SPK_ICON: Retry `;let I;I=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SPK_ICON:info${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SPK_ICON: Information `;let E;E=$localize`${"\uFFFD#24\uFFFD"}:START_TAG_SPK_ICON:person-simple-run${"\uFFFD/#24\uFFFD"}:CLOSE_TAG_SPK_ICON: Dry run `;let A;A=$localize`${"\uFFFD#27\uFFFD"}:START_TAG_SPK_ICON:warning${"\uFFFD/#27\uFFFD"}:CLOSE_TAG_SPK_ICON: Warning `;let m;return m=$localize`${"\uFFFD#30\uFFFD"}:START_TAG_SPK_ICON:warning-octagon${"\uFFFD/#30\uFFFD"}:CLOSE_TAG_SPK_ICON: Error `,[F,n,o,e,C,L,d,k,I,E,A,m,[1,"filters"],["type","button","routerLink","/about/logs/stored","routerLinkActive","active"],["type","button","routerLink","/about/logs/live","routerLinkActive","active"],[3,"openIndicator"],["spk-button","","type","button"],["menu",""],["spk-button","","type","button",1,"small",3,"click"]]},template:function(n,o){n&1&&(i(0,"div",12)(1,"spk-button-group")(2,"button",13),l(3,0),_(4,"spk-icon"),s(),t(),i(5,"button",14),l(6,1),_(7,"spk-icon"),s(),t()(),P(8,W,31,2,"spk-menu",15),t(),_(9,"router-outlet")),n&2&&(p(8),G(o.currentUrl().startsWith("/about/logs/live")?8:-1))},dependencies:[V,K,h,w,X,U],styles:["[_nghost-%COMP%]{display:block}.filters[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;margin-bottom:1.25rem}"],changeDetection:0})};export{O as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Q}from"./chunk-ORDORLQT.js";import{a as Ge}from"./chunk-VN7JM6M3.js";import{a as oe}from"./chunk-HTNYQE2B.js";import{a as J}from"./chunk-GJROCOAD.js";import{a as te}from"./chunk-7L42EO7J.js";import{b as De,c as y,e as L,f as $,h as Ae,i as b,k as ve,n as D,q as A,r as v,s as we,t as w}from"./chunk-T2OUHRUV.js";import{b as R,d as N}from"./chunk-QVIZK4WW.js";import{a as k,e as ke,g as M,l as Me,p as ye,q as Le,t as $e,z as be}from"./chunk-WX7L7V6J.js";import{h as I}from"./chunk-JSGFZ2GA.js";import{j as H}from"./chunk-CKPICCFH.js";import{$b as j,Ab as U,B as Fe,Bc as q,Cb as B,E as ee,F as T,Gb as u,Hb as F,Ib as E,J as me,Jb as Te,Kb as Ee,Mb as O,N as Se,Nb as x,O as X,Qa as m,S as de,Y as p,ab as h,cc as Oe,da as f,ea as C,ec as fe,fb as z,fc as Ce,gc as Re,i as _e,kc as Ne,lc as Pe,nb as S,o as ce,pb as ge,pc as he,rc as Ie,sb as Y,ua as _,wb as r,x as Z,xb as l,y as ue,yb as c,zb as K}from"./chunk-W2F756OF.js";var Be=new v,We=()=>Be.group({passphrase:Be.control("")}),ie=class a{#t=p(I);#e=p(P);#o=p(N);#n=p(R);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=_(!1);next(){let i=this.#e.destinationTargetUrl();if(!i)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,t=[{Name:"--no-encryption",Value:"true"}];e&&(t=[{Name:"--passphrase",Value:e}]),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:i,Settings:t}},temporary:!0}).pipe(T(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:o=>{let n=o.ID;this.#o.navigate([`/restore-draft/${n}`])},error:o=>{console.error(o)}})}back(){this.#e.isFileRestore()?this.#o.navigate(["encryption"],{relativeTo:this.#n.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=h({type:a,selectors:[["app-restore-encryption"]],decls:12,vars:1,consts:()=>{let i;i=$localize`Enter backup passphrase if defined.`;let e;e=$localize`Password`;let t;t=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SPK_ICON: Back `;let o;return o=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `,[e,t,o,[3,"submit","formGroup"],["for","password"],["type","password","id","password","placeholder",i,"formControlName","passphrase"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"]]},template:function(e,t){e&1&&(r(0,"form",3),O("submit",function(){return t.next()}),r(1,"spk-form-field")(2,"label",4),E(3,0),l(),c(4,"input",5),l(),r(5,"div",6)(6,"button",7),O("click",function(){return t.back()}),u(7,1),c(8,"spk-icon"),F(),l(),r(9,"button",8),u(10,2),c(11,"spk-icon"),F(),l()()()),e&2&&S("formGroup",t.encryptionForm)},dependencies:[w,b,y,L,$,D,A,Me,k,M],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 Ye=()=>({standalone:!0});function Ke(a,i){a&1&&c(0,"spk-progress-bar",7)}function Ue(a,i){if(a&1&&(r(0,"div",14),j(1),he(2,"date"),l()),a&2){let e=i.$implicit;m(),Oe("",e.Version,": ",Ie(2,2,e.Time,"medium"),"")}}function je(a,i){a&1&&c(0,"spk-progress-bar",7)}function qe(a,i){if(a&1&&(r(0,"app-file-tree",13)(1,"label",15),E(2,4),l(),c(3,"input",16),l()),a&2){let e=x(2);S("rootPaths",e.rootPaths())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function He(a,i){if(a&1){let e=B();r(0,"spk-select",11),O("cleared",function(){f(e);let o=x();return C(o.abortLoading())}),r(1,"input",12),Re("ngModelChange",function(o){f(e);let n=x();return Ce(n.selectOption,o)||(n.selectOption=o),C(o)}),l(),z(2,Ue,3,5,"ng-template"),l(),z(3,je,1,0,"spk-progress-bar",7)(4,qe,4,4,"app-file-tree",13)}if(a&2){let e=x();S("options",e.versionOptions())("isClearable",!1),m(),fe("ngModel",e.selectOption),S("ngModelOptions",Pe(6,Ye)),m(2),Y(e.isDraft()||e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),m(),Y(e.showFileTree()?4:-1)}}var se=new v,Xe=()=>se.group({filesToRestore:se.control(""),passphrase:se.control(null)}),re=class a{#t=p(I);#e=p(P);#o=p(J);#n=p(N);#i=p(R);#s=p(H);#r=null;#a=null;selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;selectOption=this.#e.selectOption;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;isDraft=this.#e.isDraft;isFileRestore=this.#e.isFileRestore;showFileTree=_(!1);backupSettings=_(null);rootPaths=_([]);loadingRootPath=_(!1);isRepairing=_(!1);loadingEffect=q(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let t=e[0].Version;this.selectOption.set(t.toString())}});backupSettingsEffect=q(()=>{let i=this.backupId(),e=this.isRepairing(),t=this.selectOption();if(!t||!i)return;let n=this.versionOptions()?.find(d=>d.Version===parseInt(t))?.Time??null;if(!n||e)return;let s={id:i+"",time:n};this.backupSettings.set(s),this.getRootPath(s)});repairEffect=q(()=>{let i=this.selectOption(),e=this.versionOptions();if(i){let t=e.find(s=>s.Version===parseInt(i));if(t===void 0)return;let o=this.backupId(),n=`${o}+${t.Time}`;if(this.#a===n)return;this.#a=n,this.isRepairing.set(!0),this.#t.postApiV1BackupByIdRepairupdate({id:o,requestBody:{only_paths:!0,time:t.Time}}).pipe(X(this.abortLoading$),T(()=>{this.#a=null})).subscribe(s=>{let d=s.ID;var G=window.setInterval(()=>{this.#t.getApiV1TaskByTaskid({taskid:d}).subscribe(W=>{W.Status==="Completed"&&(clearInterval(G),this.isRepairing.set(!1))})},1e3)})}});getRootPath(i){let e={id:i.id+"",time:i.time,prefixOnly:!0,folderContents:!1},t=i.id+"";this.isRepairing()||this.#r===t||(this.#r=t,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#o.hasV2ListOperations()?this.#t.postApiV2BackupListFolder({requestBody:{BackupId:i.id,Time:i.time,Paths:null,PageSize:0,Page:0}}).pipe(X(this.abortLoading$),T(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#r=null})).subscribe({next:o=>{let n=(o.Data??[]).map(s=>s.Path??"");n.length>0?this.rootPaths.set(n):this.rootPaths.set(["/"])}}):this.#t.getApiV1BackupByIdFiles(e).pipe(X(this.abortLoading$),T(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:o=>{let n=o.Files.map(s=>s.Path??"");n.length>0?this.rootPaths.set(n):this.rootPaths.set(["/"])}}))}abortLoading$=new _e;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let i=this.versionOptions();return e=>{if(!e)return"";let t=i?.find(o=>typeof o.Version=="number"&&o.Version.toString()===e);return t?`${t.Version}: ${this.#s.transform(t.Time,"medium")}`:""}}next(){this.#n.navigate(["options"],{relativeTo:this.#i.parent})}back(){this.#e.isFileRestore()?this.#n.navigate(["encryption"],{relativeTo:this.#i.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=h({type:a,selectors:[["app-select-files"]],features:[Ne([H])],decls:13,vars:3,consts:()=>{let i;i=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let t;t=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let o;o=$localize`Select an option...`;let n;return n=$localize`Path`,[["formRef",""],i,e,t,n,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",o,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","backupSettings","multiSelect","showFiles"],[1,"custom-option"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,t){if(e&1){let o=B();r(0,"form",5,0),O("submit",function(){return f(o),C(t.next())}),r(2,"h3",6),E(3,1),l(),z(4,Ke,1,0,"spk-progress-bar",7)(5,He,5,7),r(6,"div",8)(7,"button",9),O("click",function(){return f(o),C(t.back())}),u(8,2),c(9,"spk-icon"),F(),l(),r(10,"button",10),u(11,3),c(12,"spk-icon"),F(),l()()()}e&2&&(S("formGroup",t.selectFilesForm),m(4),Y(t.versionOptionsLoading()?4:5),m(5),Te(t.isFileRestore()?"Back":"Exit"),Ee(8))},dependencies:[we,b,y,L,$,Ae,w,D,A,H,Q,M,k,$e,ye],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 P=class a{#t=p(N);#e=p(R);#o=p(J);#n=p(ke);#i=p(I);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);selectFilesForm=Xe();optionsForm=ze();encryptionForm=We();optionsFormSignal=oe(this.optionsForm.valueChanges);selectFilesFormSignal=oe(this.selectFilesForm.valueChanges);selectOption=_(null);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isDraft=_(!1);isFileRestore=_(!1);isFullWidthPage=_(!1);init(i,e=!1,t=!1){this.backupId.set(i),this.isFileRestore.set(e),this.isDraft.set(t),e&&this.#t.navigate(["/restore-from-files/destination"]),e||this.getBackup(!0)}updateTargetUrl(i){this.destinationTargetUrl.set(i)}submit(){this.isSubmitting.set(!0);let i=this.backupId(),e=this.optionsForm.value,t=this.selectFilesForm.value,o=this.selectOption(),n=this.versionOptions()?.find(s=>s.Version===(o&&parseInt(o)));this.#i.postApiV1BackupByIdRestore({id:i??"",requestBody:{paths:t.filesToRestore?.split("\0").map(s=>`${s}*`)??[],passphrase:t.passphrase??null,time:n?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!0}}).pipe(T(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.#t.navigate(["./progress"],{relativeTo:this.#e})},error:s=>{console.error("restore error",s)}})}exit(){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:i=>{i&&(this.#s(),this.#t.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(i,e=2){return this.#i.postApiV2BackupListFilesets({requestBody:{BackupId:i}}).pipe(Fe(t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder";return o||n||s||e===0?ce(()=>t):ue(1e3).pipe(Se(()=>this.loadFilesetsWithRetryv2(i,e-1)))}))}getBackup(i=!1){let e=this.backupId();this.versionOptionsLoading.set(!0),this.#o.hasV2ListOperations()?Z([this.#i.getApiV1BackupById({id:e}),this.loadFilesetsWithRetryv2(e)]).pipe(ee(1),T(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{if(o.Error)throw new Error(o.Error);this.versionOptions.set((o.Data??[]).map(n=>({Version:n.Version??-1,IsFullBackup:n.IsFullBackup??void 0,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(t)},error:t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder",d=$localize`An error occurred while loading the backup filesets: ${t.message}`;o&&(d=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),n&&(d=$localize`The backup storage folder was not found.`),s&&(d=$localize`The backup storage folder does not contain any filesets.`),this.#n.open(te,{data:{title:$localize`Failed to load backup filesets`,message:d,confirmText:$localize`OK`,cancelText:void 0},closed:G=>{this.#t.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):Z([this.#i.getApiV1BackupById({id:e}),this.#i.getApiV1BackupByIdFilesets({id:e}).pipe(me(3))]).pipe(ee(1),T(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{this.versionOptions.set(o.map(n=>({Version:n.Version??-1,IsFullBackup:(n.IsFullBackup??1)==1,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(t)}})}#s(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||a)};static \u0275prov=de({token:a,factory:a.\u0275fac,providedIn:"root"})};var V=new v,ze=()=>V.group({restoreFrom:V.control("orignal"),restoreFromPath:V.control(""),handleExisting:V.control("overwrite"),permissions:V.control(!1)}),ae=class a{#t=p(P);#e=p(N);#o=p(R);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;isSubmitting=this.#t.isSubmitting;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#o.parent})}submit(){this.#t.submit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=h({type:a,selectors:[["app-advanced-options-settings"]],decls:39,vars:6,consts:()=>{let i;i=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let t;t=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let o;o=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let n;n=$localize`How do you want to handle existing files?`;let s;s=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let d;d=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let G;G=$localize`Permissions`;let W;W=$localize` Restore read/write permissions ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let le;le=$localize`${"\uFFFD#35\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#35\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let pe;return pe=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SPK_ICON: Submit `,[["formRef",""],i,e,t,o,n,s,d,G,W,le,pe,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"raised","primary"],["type","radio","name","restoreFrom","value","orignal","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","permissions"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"]]},template:function(e,t){if(e&1){let o=B();r(0,"form",12,0),O("submit",function(){return f(o),C(t.submit())}),r(2,"h3",13),E(3,1),l(),r(4,"app-toggle-card",14),K(5,15),E(6,2),U(),r(7,"spk-radio",16),u(8,3),c(9,"input",17),F(),l(),r(10,"spk-radio",16),u(11,4),c(12,"input",18),F(),l(),r(13,"app-file-tree",19)(14,"label",20),j(15,"Path"),l(),c(16,"input",21),l()(),r(17,"app-toggle-card",14),K(18,15),E(19,5),U(),r(20,"spk-radio",16),u(21,6),c(22,"input",22),F(),l(),r(23,"spk-radio",16),u(24,7),c(25,"input",23),F(),l()(),r(26,"app-toggle-card"),K(27,15),E(28,8),U(),r(29,"spk-toggle",24),u(30,9),c(31,"input",25),F(),l()(),r(32,"div",26)(33,"button",27),O("click",function(){return f(o),C(t.goBack())}),u(34,10),c(35,"spk-icon"),F(),l(),r(36,"button",28),u(37,11),c(38,"spk-icon"),F(),l()()()}if(e&2){let o;S("formGroup",t.optionsForm),m(4),S("disallowToggle",!0),m(9),S("disabled",((o=t.optionsFormSignal())==null?null:o.restoreFrom)!=="pickLocation"),m(4),S("disallowToggle",!0),m(19),ge("loader",t.isSubmitting())}},dependencies:[w,b,y,De,ve,L,$,D,A,Ge,Q,be,Le,M,k],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{ze as a,ae as b,We as c,ie as d,Xe as e,re as f,P as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Q}from"./chunk-ULHQZGHN.js";import{c as F,d as G,e as T,f as A,i as R,n as D,q,r as V,t as $}from"./chunk-T2OUHRUV.js";import{c as x}from"./chunk-
|
|
1
|
+
import{a as Q}from"./chunk-ULHQZGHN.js";import{c as F,d as G,e as T,f as A,i as R,n as D,q,r as V,t as $}from"./chunk-T2OUHRUV.js";import{c as x}from"./chunk-F4EEOSGJ.js";import"./chunk-I3C2AEHI.js";import{d as N}from"./chunk-QVIZK4WW.js";import"./chunk-WMTA6PZM.js";import{a as I,b as k,g as O,l as P}from"./chunk-WX7L7V6J.js";import"./chunk-JSGFZ2GA.js";import"./chunk-CKPICCFH.js";import{$b as r,Bc as M,Cb as S,F as c,Mb as v,Qa as m,Xa as h,Y as l,Yb as b,Zb as E,ab as _,da as g,ea as f,fb as w,nb as C,pb as y,sb as L,ua as p,wb as o,xb as i,yb as a}from"./chunk-W2F756OF.js";import"./chunk-7CGTOI24.js";var z=["passwordInput"];function B(s,e){s&1&&(o(0,"spk-alert",2),r(1," Remember to enter a password, if you can't remember the password open the duplicati client on the machine in question and make sure you open it through the tray icon then go into settings to change the password. "),i())}var u=new V,d=class s{#e=l(N);#t=l(x);failedLogin=p(!1);isLoading=p(!1);loginForm=u.group({user:u.control(""),pass:u.control("",G.required)});passwordInput=h("passwordInput");passwordEffect=M(()=>{this.failedLogin()&&queueMicrotask(()=>this.passwordInput()?.nativeElement?.focus())});ngOnInit(){queueMicrotask(()=>this.passwordInput()?.nativeElement?.focus())}submit(){let e=this.loginForm.value.pass;this.loginForm.value.user||e&&(this.isLoading.set(!0),this.#t.login(e).pipe(c(()=>{this.isLoading.set(!1),this.failedLogin.set(!0)})).subscribe({next:()=>this.#e.navigate(["/"])}))}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=_({type:s,selectors:[["app-login"]],viewQuery:function(t,n){t&1&&b(n.passwordInput,z,5),t&2&&E()},decls:18,vars:4,consts:()=>{let e;return e=$localize`Enter your password`,[["passwordInput",""],[3,"submit","formGroup"],["type","warning"],[1,"logo-login"],[1,"login-row"],["type","text","hidden","","autocomplete","off","name","username","formControlName","user"],["for","password"],["href","https://docs.duplicati.com/detailed-descriptions/duplicati-access-password","target","_blank","rel","noopener noreferrer"],["type","password","name","password","autocomplete","current-password","placeholder",e,"tabindex","1","formControlName","pass"],["spk-button","","type","submit",1,"raised","primary"]]},template:function(t,n){if(t&1){let j=S();o(0,"form",1),v("submit",function(){return g(j),f(n.submit())}),w(1,B,2,0,"spk-alert",2),o(2,"div",3),a(3,"app-logo"),i(),o(4,"div",4),a(5,"input",5),o(6,"spk-form-field")(7,"label",6),r(8," Password "),o(9,"a",7)(10,"spk-icon"),r(11,"question"),i()()(),a(12,"input",8,0),i(),o(14,"button",9),r(15," Login "),o(16,"spk-icon"),r(17,"arrow-right"),i()()()()}t&2&&(C("formGroup",n.loginForm),m(),L(n.failedLogin()?1:-1),m(13),y("loader",n.isLoading()))},dependencies:[$,R,F,T,A,D,q,Q,P,I,O,k],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{width:100vw;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1.5rem}spk-alert[_ngcontent-%COMP%]{max-width:20rem;margin:0 auto}h3[_ngcontent-%COMP%]{font:var(--title-30)}.login-row[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.logo-login[_ngcontent-%COMP%]{top:0;left:0;padding:1.25rem;position:fixed}"],changeDetection:0})};export{d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as a,d as b}from"./chunk-IDOYGPGZ.js";import"./chunk-ORDORLQT.js";import"./chunk-VN7JM6M3.js";import"./chunk-HTNYQE2B.js";import"./chunk-GJROCOAD.js";import"./chunk-7L42EO7J.js";import"./chunk-T2OUHRUV.js";import"./chunk-QVIZK4WW.js";import"./chunk-WMTA6PZM.js";import"./chunk-WX7L7V6J.js";import"./chunk-JSGFZ2GA.js";import"./chunk-CKPICCFH.js";import"./chunk-W2F756OF.js";import"./chunk-7CGTOI24.js";export{a as createEncryptionForm,b as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-7CGTOI24.js";var o=[{path:"",loadComponent:()=>import("./chunk-H632X43F.js"),children:[{path:"",redirectTo:"stored",pathMatch:"full"},{path:"stored",loadComponent:()=>import("./chunk-ZYGT7OII.js")},{path:"live",loadComponent:()=>import("./chunk-DDIVZTRS.js")}]}],t=o;export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ke,c as Re,d as B}from"./chunk-KSP3JQHY.js";import{a as Oe}from"./chunk-HTNYQE2B.js";import{a as ue}from"./chunk-GDHVQU56.js";import"./chunk-RHW5QVAY.js";import{b as de,c as Pe,d as S,e as Te,f as Ce,i as me,n as Ee,q as Se,r as ge,t as fe}from"./chunk-T2OUHRUV.js";import"./chunk-I3C2AEHI.js";import{b as oe,d as te,e as ne}from"./chunk-QVIZK4WW.js";import"./chunk-WMTA6PZM.js";import{A as Fe,a as re,b as se,f as ae,g as le,l as pe,p as _e,z as ce}from"./chunk-WX7L7V6J.js";import{c as ee,h as ie}from"./chunk-4AECHE4W.js";import"./chunk-CKPICCFH.js";import{$b as A,Ac as N,Bc as Z,Cb as M,F as I,Gb as _,Hb as c,Ib as m,Jb as y,Kb as h,Lb as X,Mb as E,N as H,Nb as u,Qa as s,Y as T,ab as Q,ac as J,cc as W,da as x,ea as D,fb as d,lc as Y,nb as P,pb as f,sb as F,ua as C,wb as a,xb as r,yb as p}from"./chunk-W2F756OF.js";import"./chunk-7CGTOI24.js";var we=()=>["/"];function $e(t,o){t&1&&(a(0,"spk-toggle",24),_(1,5),p(2,"input",27),c(),r())}function xe(t,o){t&1&&(a(0,"span",30),m(1,9),r())}function De(t,o){if(t&1&&(a(0,"span",30),m(1,10),r()),t&2){let e=u(2);s(),y(e.exportForm.controls.password.errors==null?null:e.exportForm.controls.password.errors.minlength.requiredLength),h(1)}}function Ae(t,o){if(t&1&&p(0,"spk-progress-bar",37),t&2){let e=u(2);f("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),P("value",e.calculatePasswordStrength()*(100/5))}}function Ne(t,o){t&1&&(a(0,"span",30),m(1,11),r())}function Ie(t,o){t&1&&(a(0,"span",30),m(1,12),r())}function Me(t,o){if(t&1&&(a(0,"span",30),m(1,13),r()),t&2){let e=u(2);s(),y(e.exportForm.controls.repeatPassword.errors==null?null:e.exportForm.controls.repeatPassword.errors.minlength.requiredLength),h(1)}}function ye(t,o){t&1&&(_(0,7,1),p(1,"spk-icon"),c())}function he(t,o){t&1&&(_(0,7,2),p(1,"spk-icon"),c())}function Xe(t,o){t&1&&(_(0,14,1),p(1,"spk-icon",39),c())}function Be(t,o){t&1&&(_(0,14,2),p(1,"spk-icon"),c())}function Le(t,o){if(t&1){let e=M();a(0,"button",38),E("click",function(){x(e);let i=u(2);return D(i.copyPassword())}),_(1,14),d(2,Xe,2,0)(3,Be,2,0),c(),r()}if(t&2){let e=u(2);s(2),F(e.copiedPassword()?2:3)}}function be(t,o){t&1&&(a(0,"spk-alert",36),m(1,15),r())}function ve(t,o){if(t&1){let e=M();a(0,"div",25)(1,"spk-form-field")(2,"label",28),_(3,6),p(4,"sup"),c(),r(),p(5,"input",29),d(6,xe,2,0,"span",30)(7,De,2,1,"span",30),r(),d(8,Ae,1,9,"spk-progress-bar",31),a(9,"spk-form-field"),p(10,"input",32),d(11,Ne,2,0,"span",30)(12,Ie,2,0,"span",30)(13,Me,2,1,"span",30),r(),a(14,"div",33)(15,"button",34),E("click",function(){x(e);let i=u();return D(i.showPassword.set(!i.showPassword()))}),_(16,7),d(17,ye,2,0)(18,he,2,0),c(),r(),a(19,"button",34),E("click",function(){x(e);let i=u();return D(i.generatePassword())}),_(20,8),p(21,"spk-icon"),c(),r(),d(22,Le,4,1,"button",35),r(),d(23,be,2,0,"spk-alert",36),r()}if(t&2){let e=u();s(5),P("type",e.showPassword()?"text":"password"),s(),F(e.exportForm.controls.password.errors!=null&&e.exportForm.controls.password.errors.required?6:e.exportForm.controls.password.errors!=null&&e.exportForm.controls.password.errors.minlength?7:-1),s(2),F(e.exportForm.value.password?8:-1),s(2),P("type",e.showPassword()?"text":"password"),s(),F(e.exportForm.value.repeatPassword&&e.exportForm.value.repeatPassword!==e.exportForm.value.password?11:e.exportForm.controls.repeatPassword.errors!=null&&e.exportForm.controls.repeatPassword.errors.required?12:e.exportForm.controls.repeatPassword.errors!=null&&e.exportForm.controls.repeatPassword.errors.minlength?13:-1),s(6),F(e.showPassword()?17:18),s(5),F(e.showCopyPassword()?22:-1),s(),F(e.exportForm.value.password&&e.exportForm.value.password===e.exportForm.value.repeatPassword?23:-1)}}function Ge(t,o){if(t&1&&(a(0,"div",26)(1,"code"),A(2),r()()),t&2){let e=u();s(2),J(e.exportedCmd())}}var O=new ge,L=class t{#o=T(ke);#t=T(ie);#e=T(oe);#n=T(te);#i=T(ee);#r=T(ue);isExporting=C(!1);exportType=C("file");exportedCmd=C(null);exportForm=O.group({exportPasswords:O.control(!0),encryption:O.control(!1,[S.required,Re()]),password:O.control("",[B("encryption",!0,[S.required,S.minLength(3)])]),repeatPassword:O.control("",[B("encryption",!0,[S.required,S.minLength(3)])])});exportFormSignal=Oe(this.exportForm.valueChanges);encryptionFieldSignal=N(()=>this.exportFormSignal()?.encryption??!1);activeBackup=N(()=>this.#r.backups().find(o=>o.Backup?.ID===this.#e.snapshot.params.id));showPassword=C(!1);copiedPassword=C(!1);showCopyPassword=C(!1);calculatePasswordStrength=N(()=>{let e=this.exportFormSignal()?.password??"";return this.#o.calculatePasswordStrength(e)});showPasswordEffect=Z(()=>{this.showPassword()&&this.exportForm.updateValueAndValidity()});submit(){this.isExporting.set(!0),this.exportType()==="file"?this.#t.postApiV1AuthIssuetokenByOperation({operation:"export"}).pipe(H(o=>{let e=i=>{let g=Object.entries(i);return g?"?"+g.map(([k,R])=>`${k}=${R}`).join("&"):""},n=this.exportFormSignal()?.password?.length?this.exportFormSignal()?.password:void 0;return this.#i.get(`/api/v1/backup/${this.#e.snapshot.params.id}/export${e({"export-passwords":this.exportFormSignal()?.exportPasswords??void 0,passphrase:n,token:o.Token})}`,{responseType:"blob"})}),I(()=>this.isExporting.set(!1))).subscribe({next:o=>{let n=this.activeBackup()?.Backup?.Name??"Backup",i=this.exportFormSignal()?.encryption?"aes":"json";this.downloadFile(o,`${n}-duplicati-config.${i}`),this.#n.navigate(["/"])},error:o=>{}}):this.#t.getApiV1BackupByIdExportCmdline({id:this.#e.snapshot.params.id,exportPasswords:this.exportFormSignal()?.exportPasswords??void 0,passphrase:this.exportFormSignal()?.password??void 0}).pipe(I(()=>this.isExporting.set(!1))).subscribe({next:o=>{this.exportedCmd.set(o.Command??null)},error:o=>{}})}downloadFile(o,e){let n=window.URL.createObjectURL(o),i=document.createElement("a");i.href=n,i.download=e,i.click(),window.URL.revokeObjectURL(n)}async copyPassword(){let o=this.exportForm.controls.password.value;await this.#s(o??""),this.copiedPassword.set(!0)}async#s(o){try{await navigator.clipboard.writeText(o)}catch{try{let n=document.createElement("textarea");n.value=o,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}catch(n){console.error("Failed to copy text: ",n)}}}generatePassword(){this.copiedPassword.set(!1);let o=this.#o.generate(16);this.exportForm.controls.password.setValue(o),this.exportForm.controls.repeatPassword.setValue(o),this.showCopyPassword.set(!0)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=Q({type:t,selectors:[["app-export"]],decls:27,vars:16,consts:()=>{let o;o=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SPK_ICON: Back `;let e;e=$localize`${"\uFFFD#10\uFFFD"}:START_TAG_SPK_ICON:export${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_SPK_ICON: Export `;let n;n=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:terminal-window${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: As command line `;let i;i=$localize`${"\uFFFD#20\uFFFD"}:START_TAG_SPK_ICON:file${"\uFFFD/#20\uFFFD"}:CLOSE_TAG_SPK_ICON: To file `;let g;g=$localize` Export passwords ${"\uFFFD#23\uFFFD\uFFFD/#23\uFFFD"}:TAG_INPUT:`;let k;k=$localize` Encrypt file ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let R;R=$localize`Password`;let b;b=$localize`Repeat password`;let v;v=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let w;w=$localize`${"\uFFFD*17:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: hide ${"\uFFFD/*17:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*18:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: show ${"\uFFFD/*18:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,w=X(w);let G;G=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SPK_ICON:password${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SPK_ICON: Generate password `;let K;K=$localize`Passwords are required`;let U;U=$localize` Passwords must be at least ${"\uFFFD0\uFFFD"}:INTERPOLATION: characters long `;let z;z=$localize`Passwords do not match`;let V;V=$localize`Passwords are required`;let q;q=$localize` Passwords must be at least ${"\uFFFD0\uFFFD"}:INTERPOLATION: characters long `;let $;$=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SPK_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,$=X($);let j;return j=$localize` Tip: Be sure to save your password. If you loose it you will lose access to your backups. `,[o,e,n,i,g,k,v,w,G,K,U,z,V,q,$,j,[1,"actions"],["spk-button","",1,"outlined",3,"routerLink"],["message","Remember to copy the password",1,"primary",3,"disabled"],["spk-button","",1,"raised","primary",3,"click","disabled"],["autocomplete","off",3,"formGroup"],["type","button",3,"click"],[1,"raised","primary"],["type","checkbox","formControlName","exportPasswords"],[1,"primary","raised"],[1,"passwords"],[1,"cmd-output"],["type","checkbox","formControlName","encryption"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",R,"formControlName","password",3,"type"],["error",""],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",b,"formControlName","repeatPassword",3,"type"],[1,"password-actions"],["spk-button","","type","button",1,"small",3,"click"],["spk-button","","type","button",1,"small","copy"],[1,"primary"],[1,"raised",3,"value"],["spk-button","","type","button",1,"small","copy",3,"click"],[1,"spk-success"]]},template:function(e,n){if(e&1&&(a(0,"header")(1,"h3"),A(2," Export backup configuration "),a(3,"div",16)(4,"button",17),_(5,0),p(6,"spk-icon"),c(),r(),a(7,"spk-tooltip",18)(8,"button",19),E("click",function(){return n.submit()}),_(9,1),p(10,"spk-icon"),c(),r()()()(),a(11,"p"),A(12),r()(),a(13,"form",20)(14,"spk-button-group")(15,"button",21),E("click",function(){return n.exportType.set("cmd")}),_(16,2),p(17,"spk-icon"),c(),r(),a(18,"button",21),E("click",function(){return n.exportType.set("file")}),_(19,3),p(20,"spk-icon"),c(),r()(),a(21,"spk-toggle",22),_(22,4),p(23,"input",23),c(),r(),d(24,$e,3,0,"spk-toggle",24)(25,ve,24,8,"div",25)(26,Ge,3,1,"div",26),r()),e&2){let i;s(4),P("routerLink",Y(15,we)),s(3),f("loading",n.isExporting()),P("disabled",!(n.showCopyPassword()&&!n.copiedPassword())),s(),P("disabled",n.exportForm.invalid||n.showCopyPassword()&&!n.copiedPassword()),s(4),W("#",(i=n.activeBackup())==null||i.Backup==null?null:i.Backup.ID,": ",(i=n.activeBackup())==null||i.Backup==null?null:i.Backup.Name,""),s(),P("formGroup",n.exportForm),s(2),f("active",n.exportType()==="cmd"),s(3),f("active",n.exportType()==="file"),s(6),F(n.exportType()==="file"?24:-1),s(),F(n.encryptionFieldSignal()?25:-1),s(),F(n.exportedCmd()?26:-1)}},dependencies:[fe,me,Pe,de,Te,Ce,Ee,Se,ne,ae,ce,re,pe,le,se,_e,Fe],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:3rem}h3[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;justify-content:space-between}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;max-width:31.25rem}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.copy[_ngcontent-%COMP%] spk-icon.spk-success[_ngcontent-%COMP%]{color:var(--success-500)}.hide[_ngcontent-%COMP%]{display:none}"],changeDetection:0})};export{L as default};
|
|
1
|
+
import{a as ke,c as Re,d as B}from"./chunk-KSP3JQHY.js";import{a as Oe}from"./chunk-HTNYQE2B.js";import{a as ue}from"./chunk-OTLEEXAA.js";import"./chunk-RHW5QVAY.js";import{b as de,c as Pe,d as S,e as Te,f as Ce,i as me,n as Ee,q as Se,r as ge,t as fe}from"./chunk-T2OUHRUV.js";import"./chunk-I3C2AEHI.js";import{b as oe,d as te,e as ne}from"./chunk-QVIZK4WW.js";import"./chunk-WMTA6PZM.js";import{A as Fe,a as re,b as se,f as ae,g as le,l as pe,p as _e,z as ce}from"./chunk-WX7L7V6J.js";import{c as ee,h as ie}from"./chunk-JSGFZ2GA.js";import"./chunk-CKPICCFH.js";import{$b as A,Ac as N,Bc as Z,Cb as M,F as I,Gb as _,Hb as c,Ib as m,Jb as y,Kb as h,Lb as X,Mb as E,N as H,Nb as u,Qa as s,Y as T,ab as Q,ac as J,cc as W,da as x,ea as D,fb as d,lc as Y,nb as P,pb as f,sb as F,ua as C,wb as a,xb as r,yb as p}from"./chunk-W2F756OF.js";import"./chunk-7CGTOI24.js";var we=()=>["/"];function $e(t,o){t&1&&(a(0,"spk-toggle",24),_(1,5),p(2,"input",27),c(),r())}function xe(t,o){t&1&&(a(0,"span",30),m(1,9),r())}function De(t,o){if(t&1&&(a(0,"span",30),m(1,10),r()),t&2){let e=u(2);s(),y(e.exportForm.controls.password.errors==null?null:e.exportForm.controls.password.errors.minlength.requiredLength),h(1)}}function Ae(t,o){if(t&1&&p(0,"spk-progress-bar",37),t&2){let e=u(2);f("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),P("value",e.calculatePasswordStrength()*(100/5))}}function Ne(t,o){t&1&&(a(0,"span",30),m(1,11),r())}function Ie(t,o){t&1&&(a(0,"span",30),m(1,12),r())}function Me(t,o){if(t&1&&(a(0,"span",30),m(1,13),r()),t&2){let e=u(2);s(),y(e.exportForm.controls.repeatPassword.errors==null?null:e.exportForm.controls.repeatPassword.errors.minlength.requiredLength),h(1)}}function ye(t,o){t&1&&(_(0,7,1),p(1,"spk-icon"),c())}function he(t,o){t&1&&(_(0,7,2),p(1,"spk-icon"),c())}function Xe(t,o){t&1&&(_(0,14,1),p(1,"spk-icon",39),c())}function Be(t,o){t&1&&(_(0,14,2),p(1,"spk-icon"),c())}function Le(t,o){if(t&1){let e=M();a(0,"button",38),E("click",function(){x(e);let i=u(2);return D(i.copyPassword())}),_(1,14),d(2,Xe,2,0)(3,Be,2,0),c(),r()}if(t&2){let e=u(2);s(2),F(e.copiedPassword()?2:3)}}function be(t,o){t&1&&(a(0,"spk-alert",36),m(1,15),r())}function ve(t,o){if(t&1){let e=M();a(0,"div",25)(1,"spk-form-field")(2,"label",28),_(3,6),p(4,"sup"),c(),r(),p(5,"input",29),d(6,xe,2,0,"span",30)(7,De,2,1,"span",30),r(),d(8,Ae,1,9,"spk-progress-bar",31),a(9,"spk-form-field"),p(10,"input",32),d(11,Ne,2,0,"span",30)(12,Ie,2,0,"span",30)(13,Me,2,1,"span",30),r(),a(14,"div",33)(15,"button",34),E("click",function(){x(e);let i=u();return D(i.showPassword.set(!i.showPassword()))}),_(16,7),d(17,ye,2,0)(18,he,2,0),c(),r(),a(19,"button",34),E("click",function(){x(e);let i=u();return D(i.generatePassword())}),_(20,8),p(21,"spk-icon"),c(),r(),d(22,Le,4,1,"button",35),r(),d(23,be,2,0,"spk-alert",36),r()}if(t&2){let e=u();s(5),P("type",e.showPassword()?"text":"password"),s(),F(e.exportForm.controls.password.errors!=null&&e.exportForm.controls.password.errors.required?6:e.exportForm.controls.password.errors!=null&&e.exportForm.controls.password.errors.minlength?7:-1),s(2),F(e.exportForm.value.password?8:-1),s(2),P("type",e.showPassword()?"text":"password"),s(),F(e.exportForm.value.repeatPassword&&e.exportForm.value.repeatPassword!==e.exportForm.value.password?11:e.exportForm.controls.repeatPassword.errors!=null&&e.exportForm.controls.repeatPassword.errors.required?12:e.exportForm.controls.repeatPassword.errors!=null&&e.exportForm.controls.repeatPassword.errors.minlength?13:-1),s(6),F(e.showPassword()?17:18),s(5),F(e.showCopyPassword()?22:-1),s(),F(e.exportForm.value.password&&e.exportForm.value.password===e.exportForm.value.repeatPassword?23:-1)}}function Ge(t,o){if(t&1&&(a(0,"div",26)(1,"code"),A(2),r()()),t&2){let e=u();s(2),J(e.exportedCmd())}}var O=new ge,L=class t{#o=T(ke);#t=T(ie);#e=T(oe);#n=T(te);#i=T(ee);#r=T(ue);isExporting=C(!1);exportType=C("file");exportedCmd=C(null);exportForm=O.group({exportPasswords:O.control(!0),encryption:O.control(!1,[S.required,Re()]),password:O.control("",[B("encryption",!0,[S.required,S.minLength(3)])]),repeatPassword:O.control("",[B("encryption",!0,[S.required,S.minLength(3)])])});exportFormSignal=Oe(this.exportForm.valueChanges);encryptionFieldSignal=N(()=>this.exportFormSignal()?.encryption??!1);activeBackup=N(()=>this.#r.backups().find(o=>o.Backup?.ID===this.#e.snapshot.params.id));showPassword=C(!1);copiedPassword=C(!1);showCopyPassword=C(!1);calculatePasswordStrength=N(()=>{let e=this.exportFormSignal()?.password??"";return this.#o.calculatePasswordStrength(e)});showPasswordEffect=Z(()=>{this.showPassword()&&this.exportForm.updateValueAndValidity()});submit(){this.isExporting.set(!0),this.exportType()==="file"?this.#t.postApiV1AuthIssuetokenByOperation({operation:"export"}).pipe(H(o=>{let e=i=>{let g=Object.entries(i);return g?"?"+g.map(([k,R])=>`${k}=${R}`).join("&"):""},n=this.exportFormSignal()?.password?.length?this.exportFormSignal()?.password:void 0;return this.#i.get(`/api/v1/backup/${this.#e.snapshot.params.id}/export${e({"export-passwords":this.exportFormSignal()?.exportPasswords??void 0,passphrase:n,token:o.Token})}`,{responseType:"blob"})}),I(()=>this.isExporting.set(!1))).subscribe({next:o=>{let n=this.activeBackup()?.Backup?.Name??"Backup",i=this.exportFormSignal()?.encryption?"aes":"json";this.downloadFile(o,`${n}-duplicati-config.${i}`),this.#n.navigate(["/"])},error:o=>{}}):this.#t.getApiV1BackupByIdExportCmdline({id:this.#e.snapshot.params.id,exportPasswords:this.exportFormSignal()?.exportPasswords??void 0,passphrase:this.exportFormSignal()?.password??void 0}).pipe(I(()=>this.isExporting.set(!1))).subscribe({next:o=>{this.exportedCmd.set(o.Command??null)},error:o=>{}})}downloadFile(o,e){let n=window.URL.createObjectURL(o),i=document.createElement("a");i.href=n,i.download=e,i.click(),window.URL.revokeObjectURL(n)}async copyPassword(){let o=this.exportForm.controls.password.value;await this.#s(o??""),this.copiedPassword.set(!0)}async#s(o){try{await navigator.clipboard.writeText(o)}catch{try{let n=document.createElement("textarea");n.value=o,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}catch(n){console.error("Failed to copy text: ",n)}}}generatePassword(){this.copiedPassword.set(!1);let o=this.#o.generate(16);this.exportForm.controls.password.setValue(o),this.exportForm.controls.repeatPassword.setValue(o),this.showCopyPassword.set(!0)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=Q({type:t,selectors:[["app-export"]],decls:27,vars:16,consts:()=>{let o;o=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SPK_ICON: Back `;let e;e=$localize`${"\uFFFD#10\uFFFD"}:START_TAG_SPK_ICON:export${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_SPK_ICON: Export `;let n;n=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:terminal-window${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: As command line `;let i;i=$localize`${"\uFFFD#20\uFFFD"}:START_TAG_SPK_ICON:file${"\uFFFD/#20\uFFFD"}:CLOSE_TAG_SPK_ICON: To file `;let g;g=$localize` Export passwords ${"\uFFFD#23\uFFFD\uFFFD/#23\uFFFD"}:TAG_INPUT:`;let k;k=$localize` Encrypt file ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let R;R=$localize`Password`;let b;b=$localize`Repeat password`;let v;v=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let w;w=$localize`${"\uFFFD*17:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: hide ${"\uFFFD/*17:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*18:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: show ${"\uFFFD/*18:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,w=X(w);let G;G=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SPK_ICON:password${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SPK_ICON: Generate password `;let K;K=$localize`Passwords are required`;let U;U=$localize` Passwords must be at least ${"\uFFFD0\uFFFD"}:INTERPOLATION: characters long `;let z;z=$localize`Passwords do not match`;let V;V=$localize`Passwords are required`;let q;q=$localize` Passwords must be at least ${"\uFFFD0\uFFFD"}:INTERPOLATION: characters long `;let $;$=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SPK_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,$=X($);let j;return j=$localize` Tip: Be sure to save your password. If you loose it you will lose access to your backups. `,[o,e,n,i,g,k,v,w,G,K,U,z,V,q,$,j,[1,"actions"],["spk-button","",1,"outlined",3,"routerLink"],["message","Remember to copy the password",1,"primary",3,"disabled"],["spk-button","",1,"raised","primary",3,"click","disabled"],["autocomplete","off",3,"formGroup"],["type","button",3,"click"],[1,"raised","primary"],["type","checkbox","formControlName","exportPasswords"],[1,"primary","raised"],[1,"passwords"],[1,"cmd-output"],["type","checkbox","formControlName","encryption"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",R,"formControlName","password",3,"type"],["error",""],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",b,"formControlName","repeatPassword",3,"type"],[1,"password-actions"],["spk-button","","type","button",1,"small",3,"click"],["spk-button","","type","button",1,"small","copy"],[1,"primary"],[1,"raised",3,"value"],["spk-button","","type","button",1,"small","copy",3,"click"],[1,"spk-success"]]},template:function(e,n){if(e&1&&(a(0,"header")(1,"h3"),A(2," Export backup configuration "),a(3,"div",16)(4,"button",17),_(5,0),p(6,"spk-icon"),c(),r(),a(7,"spk-tooltip",18)(8,"button",19),E("click",function(){return n.submit()}),_(9,1),p(10,"spk-icon"),c(),r()()()(),a(11,"p"),A(12),r()(),a(13,"form",20)(14,"spk-button-group")(15,"button",21),E("click",function(){return n.exportType.set("cmd")}),_(16,2),p(17,"spk-icon"),c(),r(),a(18,"button",21),E("click",function(){return n.exportType.set("file")}),_(19,3),p(20,"spk-icon"),c(),r()(),a(21,"spk-toggle",22),_(22,4),p(23,"input",23),c(),r(),d(24,$e,3,0,"spk-toggle",24)(25,ve,24,8,"div",25)(26,Ge,3,1,"div",26),r()),e&2){let i;s(4),P("routerLink",Y(15,we)),s(3),f("loading",n.isExporting()),P("disabled",!(n.showCopyPassword()&&!n.copiedPassword())),s(),P("disabled",n.exportForm.invalid||n.showCopyPassword()&&!n.copiedPassword()),s(4),W("#",(i=n.activeBackup())==null||i.Backup==null?null:i.Backup.ID,": ",(i=n.activeBackup())==null||i.Backup==null?null:i.Backup.Name,""),s(),P("formGroup",n.exportForm),s(2),f("active",n.exportType()==="cmd"),s(3),f("active",n.exportType()==="file"),s(6),F(n.exportType()==="file"?24:-1),s(),F(n.encryptionFieldSignal()?25:-1),s(),F(n.exportedCmd()?26:-1)}},dependencies:[fe,me,Pe,de,Te,Ce,Ee,Se,ne,ae,ce,re,pe,le,se,_e,Fe],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:3rem}h3[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;justify-content:space-between}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;max-width:31.25rem}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.copy[_ngcontent-%COMP%] spk-icon.spk-success[_ngcontent-%COMP%]{color:var(--success-500)}.hide[_ngcontent-%COMP%]{display:none}"],changeDetection:0})};export{L as default};
|