@duplicati/ngclient 0.0.45 → 0.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/spk.woff2 +0 -0
- package/{chunk-7TRDO7JO.js → chunk-4LNZXSGY.js} +1 -1
- package/{chunk-24YPS3CV.js → chunk-C3UW4NQE.js} +1 -1
- package/{chunk-YZP7MR43.js → chunk-CQKRBELO.js} +1 -1
- package/chunk-DFNGIWBA.js +1 -0
- package/{chunk-55X7NAJI.js → chunk-ECTOKXR2.js} +1 -1
- package/chunk-EFYF3ZYK.js +1 -0
- package/chunk-ER3G3TZW.js +1 -0
- package/chunk-FCTZEL22.js +1 -0
- package/{chunk-2JO4W5FR.js → chunk-K3OQZAY7.js} +1 -1
- package/{chunk-F7AUCVVD.js → chunk-K4T3G5Q5.js} +1 -1
- package/chunk-NDIOU4E2.js +1 -0
- package/{chunk-7FNERKST.js → chunk-PH3BZGB3.js} +1 -1
- package/{chunk-VZ377A5M.js → chunk-Q4N2YSBN.js} +1 -1
- package/{chunk-AQETBV7M.js → chunk-SGDMX5AW.js} +1 -1
- package/{chunk-67RPUUUD.js → chunk-SGEYZII6.js} +1 -1
- package/{chunk-HHNBFONH.js → chunk-V2LDKRBK.js} +1 -1
- package/chunk-VGGIIK26.js +1 -0
- package/{chunk-R5PXH3UQ.js → chunk-ZTJNIIQ7.js} +1 -1
- package/index.html +2 -2
- package/main-JUUTSGFB.js +1 -0
- package/package.json +1 -1
- package/{styles-DLE2HCON.css → styles-QS7LVTVV.css} +1 -1
- package/chunk-2YS2DW25.js +0 -1
- package/chunk-74JHDVI6.js +0 -1
- package/chunk-KWEPVNDD.js +0 -1
- package/chunk-R47UOCMB.js +0 -1
- package/chunk-TEBYIIAM.js +0 -1
- package/main-WZQB5GLN.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Qe}from"./chunk-TEBYIIAM.js";import{a as Ue}from"./chunk-K5R45UNO.js";import{a as Pt,b as Ht}from"./chunk-DNHLTHLR.js";import{a as mt}from"./chunk-OAL3AILX.js";import{b as Q}from"./chunk-5522ZDTF.js";import{a as Re,b as ae,c as Ee,d as se,e as ye,f as _t,g as Ut,h as Pe,i as be,k as ut,l as Ne,m as Ge,n as Bt,o as Ae,p as oe,q as dt,r as Oe}from"./chunk-NN3K5WJK.js";import{a as le,b as Ft,d as Kt,e as zt,g as Ve,i as gt,l as pe,n as Ct,o as Xt,q as ce,r as me,w as Le,x as qe}from"./chunk-IBZEQWFY.js";import{a as We}from"./chunk-UUC5AIWR.js";import{H as De,X as re}from"./chunk-7WQR24NO.js";import{c as Lt}from"./chunk-JQGZUGRK.js";import{ia as ct}from"./chunk-65UFWL3O.js";import{$b as q,Ab as g,Bb as I,Cb as M,Db as v,E as et,Eb as a,Fb as r,Gb as _,Hb as j,Ib as W,Jb as ze,Kb as O,Kc as K,Mc as pt,Qb as h,R as we,Ra as s,Rb as D,Sb as k,Tb as nt,Ub as ot,Vb as Ie,Wb as f,X as $,Xb as p,Za as A,_a as fe,_b as X,ac as z,ea as S,fa as T,fb as ne,fc as Se,gc as Te,hc as he,ic as m,ja as vt,jc as B,kc as V,lb as F,lc as yt,mc as wt,nc as Rt,oc as bt,p as Je,qa as tt,ra as st,rc as Gt,sc as Xe,tc as Vt,uc as it,vb as c,xb as $e,yc as lt}from"./chunk-UYXZTHXX.js";import{a as P,c as Mt}from"./chunk-C6Q5SG76.js";function nn(e,n){if(e&1&&(a(0,"p"),m(1),r()),e&2){let t=p();s(),B(t._data().message)}}var on={title:$localize`Are you sure?`,confirmText:$localize`Confirm`,cancelText:$localize`Cancel`},He=class e{data=st();_data=K(()=>P(P({},on),this.data()));closed=tt();close(n="confirm"){this.closed.emit(n==="confirm")}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=ne({type:e,selectors:[["app-confirm-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:10,vars:4,consts:[["header",""],["content",""],["footer",""],["spk-button","",1,"",3,"click"],["spk-button","",1,"raised","primary",3,"click"]],template:function(t,o){t&1&&(a(0,"header",0)(1,"h3"),m(2),r()(),a(3,"div",1),F(4,nn,2,1,"p"),r(),a(5,"footer",2)(6,"button",3),f("click",function(){return o.close("cancel")}),m(7),r(),a(8,"button",4),f("click",function(){return o.close("confirm")}),m(9),r()()),t&2&&(s(2),B(o._data().title),s(2),g(o._data().message?4:-1),s(3),B(o._data().cancelText),s(2),B(o._data().confirmText))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};var ft=class e{fromString(n){if(!n)return null;let t=n.match(/(\d+)([smhDWMY])/);return t&&{value:parseInt(t[1]),unit:t[2]}}toString(n,t){return`${n}${t}`}static \u0275fac=function(t){return new(t||e)};static \u0275prov=we({token:e,factory:e.\u0275fac,providedIn:"root"})};var xe=class e{#e=$(We);s3Providers=Q(this.getS3Config("Providers"));s3Regions=Q(this.getS3Config("Regions"));s3RegionHosts=Q(this.getS3Config("RegionHosts"));s3StorageClasses=Q(this.getS3Config("StorageClasses"));storjSatellites=Q(this.getStorjConfig("Satellites"));storjAuthenticationMethods=Q(this.getStorjConfig("AuthenticationMethods"));openstackProviders=Q(this.getOpenstackConfig("Providers"));openstackVersions=Q(this.getOpenstackConfig("Versions"));gcsLocations=Q(this.getGcsConfig("Locations"));gcsStorageClasses=Q(this.getGcsConfig("StorageClasses"));getS3Config(n){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-getconfig",requestBody:{"s3-config":n}}).pipe(Je(t=>this.#t(t)))}createS3IamUser(n,t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"CanCreateUser","s3-username":n,"s3-password":t}})}createS3PolicyIAM(n){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"GetPolicyDoc",path:n}})}getStorjConfig(n){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"storj-getconfig",requestBody:{"storj-config":n}}).pipe(Je(t=>this.#t(t)))}getOpenstackConfig(n){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"openstack-getconfig",requestBody:{"openstack-config":n}}).pipe(Je(t=>this.#t(t)))}getGcsConfig(n){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"gcs-getconfig",requestBody:{"gcs-config":n}}).pipe(Je(t=>this.#t(t)))}#t(n){return(n.Result&&typeof n.Result=="object"&&Object.entries(n.Result).map(([t,o])=>({key:t,value:o})))??[]}static \u0275fac=function(t){return new(t||e)};static \u0275prov=we({token:e,factory:e.\u0275fac,providedIn:"root"})};function Be(e){return e==null?"":":"+e.toString()}function _e(e){return e==null?"":e.startsWith("/")?e:"/"+e}function R(e,n){let t={},o={};return n.searchParams.forEach((i,l)=>{Ke.find(u=>u.key===e)?.dynamicFields?.includes(l)?o[l]=decodeURIComponent(i):t[l]=decodeURIComponent(i)}),{advanced:t,dynamic:o}}function b(e,n=!1){let t=e.map(([i,l])=>`${i}=${l?encodeURIComponent(l.toString()):""}`).join("&");return t?(n?"":"?")+t:""}function St(e){let n=e.destinationType,t=Ke.find(o=>o.customKey===n||o.key===n);if(!t)throw new Error("Invalid destination type");return t?.mapper.to(e)??""}function Nt(e){let n=URL.canParse(e),t=e.split("://")[0],o="http://"+e.split("://")[1],i=new URL(o);if(!n)throw new Error("Invalid target path");return Ke.find(l=>l.customKey===t||l.key===t)?.mapper.from(t,i,e)}var E=new oe,Ke=[{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:e=>E.control(e??"")}},mapper:{to:e=>{let n=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${e.custom.path}${n}`},from:(e,n,t)=>{let o=t.indexOf("file:///")===0,i=t.split(o?"///":"//")[1].substring(0,1)+n.hostname.substring(1);return P({destinationType:e,custom:{path:`${o?"/":""}${i}${n.pathname}`}},R(e,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:e=>E.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"The port to connect to",formElement:e=>E.control(e??"",[Ee.required,Ee.max(65535)])},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:e=>E.control(e??"")}},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:e=>{let n=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{port:t,server:o,path:i}=e.custom;return`${e.destinationType}://${o+Be(t)+_e(i)+n}`},from:(e,n,t)=>P({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},R(e,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:e=>E.control(e??"")},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:e=>E.control(e??"")}},dynamicFields:[{name:"s3-server-name",shortDescription:"Server",type:"NonValidatedSelectableString",loadOptions:e=>e.get(xe).s3Providers},"use-ssl","auth-username","auth-password"],advancedFields:[{name:"s3-client",type:"Enumeration",options:["aws","minio"]},{name:"s3-storage-class",type:"NonValidatedSelectableString",loadOptions:e=>e.get(xe).s3StorageClasses}],mapper:{to:e=>{let{bucket:n,path:t}=e.custom,o=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n+_e(t)+o}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.pathname,bucket:n.hostname}},R(e,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:e=>E.control(e??"")}},dynamicFields:[{name:"gcs-location",type:"NonValidatedSelectableString",loadOptions:e=>e.get(xe).gcsLocations},{name:"gcs-storage-class",type:"NonValidatedSelectableString",loadOptions:e=>e.get(xe).gcsStorageClasses},"authid"],mapper:{to:e=>{let n=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${e.custom.path}${n}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,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:e=>E.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,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:e=>E.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:e=>{let n=e.custom.path,t=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,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:e=>E.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,n))}},{key:"od4b",displayName:"OneDrive Business",description:"Store backups in OneDrive Business.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>E.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>E.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>E.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:e=>{let n=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{port:t,server:o,path:i}=e.custom;return`${e.destinationType}://${o+Be(t)+_e(i)+n}`},from:(e,n,t)=>P({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},R(e,n))}},{key:"mssp",displayName:"Microsoft SharePoint",description:"Store backups in Microsoft SharePoint.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>E.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>E.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>E.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:e=>{let n=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{port:t,server:o,path:i}=e.custom;return`${e.destinationType}://${o+Be(t)+_e(i)+n}`},from:(e,n,t)=>P({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},R(e,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:e=>E.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,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:e=>E.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,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:e=>E.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,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:e=>E.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,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:e=>E.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path in the bucket",longDescription:"Path in the bucket",formElement:e=>E.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Application ID"},{name:"auth-password",shortDescription:"Application Key"}],mapper:{to:e=>{let{bucket:n,path:t}=e.custom,o=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n+_e(t)+o}`},from:(e,n,t)=>P({destinationType:e,custom:{bucket:n.hostname,path:n.pathname}},R(e,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:e=>E.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path in the bucket",longDescription:"Path in the bucket",formElement:e=>E.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Access ID"},{name:"auth-password",shortDescription:"Access Secret"}],mapper:{to:e=>{let{bucket:n,path:t}=e.custom,o=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n+_e(t)+o}`},from:(e,n,t)=>P({destinationType:e,custom:{bucket:n.hostname,path:n.pathname}},R(e,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:e=>E.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:e=>{let n=e.custom.path,t=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,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:e=>E.control(e??"",[Ee.email])},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>E.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,n))}},{key:"cloudfiles",displayName:"Rackspace CloudFiles",description:"Store backups in Rackspace CloudFiles.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>E.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>E.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>E.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:e=>{let n=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{port:t,server:o,path:i}=e.custom;return`${e.destinationType}://${o+Be(t)+_e(i)+n}`},from:(e,n,t)=>P({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},R(e,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:e=>{let n=e.dynamic["rclone-remote-repository"],t=e.dynamic["rclone-remote-path"],o=Object.entries(e.dynamic).filter(([l])=>!["rclone-remote-repository","rclone-remote-path"].includes(l)),i=b([...Object.entries(e.advanced),...o]);return`${e.destinationType}://${n}/${t+i}`},from:(e,n,t)=>{let{advanced:o,dynamic:i}=R(e,n);return P({destinationType:e,dynamic:P({"rclone-remote-repository":n.hostname,"rclone-remote-path":n.pathname},i)},o)}}},{key:"openstack",displayName:"OpenStack Object Storage",description:"Store backups in OpenStack Object Storage.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket",longDescription:"Bucket",formElement:e=>E.control(e??"")}},dynamicFields:[{name:"openstack-authuri",shortDescription:"Auth URI",type:"Enumeration",loadOptions:e=>e.get(xe).openstackProviders},{name:"openstack-version",shortDescription:"Version",type:"Enumeration",loadOptions:e=>e.get(xe).openstackVersions},{name:"openstack-domain-name",shortDescription:"Domain name"},{name:"openstack-tenant-name",shortDescription:"Tenant name"},{name:"openstack-region",shortDescription:"Region"}],mapper:{to:e=>{let n=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{bucket:t}=e.custom;return`${e.destinationType}://${t+n}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.pathname,bucket:n.hostname}},R(e,n))}},{key:"webdav",displayName:"WebDAV",description:"Store backups in WebDAV.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>E.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>E.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>E.control(e??"")}},dynamicFields:[{name:"use-ssl",shortDescription:"Use SSL"},{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:e=>{let{port:n,server:t,path:o}=e.custom,i=e.dynamic["use-ssl"],l=b([...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([u])=>u!=="use-ssl")]);return`${e.destinationType}${i?"s":""}://${t+Be(n)+_e(o)+l}`},from:(e,n,t)=>P({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},R(e,n))}},{key:"aftp",displayName:"FTP",description:"Store backups in FTP.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>E.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>E.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>E.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:e=>{let{port:n,server:t,path:o}=e.custom,i=b([...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([l])=>l!=="use-ssl")]);return`${e.destinationType}://${t+Be(n)+_e(o)+i}`},from:(e,n,t)=>P({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},R(e,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:e=>E.control(e??"")}},dynamicFields:["sia-targetpath","sia-password","sia-redundancy"],mapper:{to:e=>{let n=e.custom.server,t=e.dynamic["sia-targetpath"],o=b([...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([i])=>i!=="sia-targetpath")]);return`${e.destinationType}://${n+_e(t)+o}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.pathname}},R(e,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:e=>E.control(e??"")}},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:e=>{let n=e.custom.path,t=b([...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([o])=>o!=="cos-targetpath")]);return`${e.destinationType}://${n+t}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.pathname}},R(e,n))}},{key:"tahoe",displayName:"Tahoe LAFS",description:"Store backups in Tahoe LAFS.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>E.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>E.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>E.control(e??"")},username:{type:"String",name:"username",shortDescription:"Username",longDescription:"Username",formElement:e=>E.control(e??"")},password:{type:"Password",name:"password",shortDescription:"Password",longDescription:"Password",formElement:e=>E.control(e??"")}},dynamicFields:[{name:"use-ssl",shortDescription:"Use SSL"}],mapper:{to:e=>{let{port:n,server:t,path:o,username:i,password:l}=e.custom,u={"auth-username":i,"auth-password":l},N=e.dynamic["use-ssl"],w=b([...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([y])=>y!=="use-ssl"),...Object.entries(u)]);return`${e.destinationType}${N?"s":""}://${t+Be(n)+_e(o)+w}`},from:(e,n,t)=>P({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},R(e,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:e=>`storj://storj.io/config?storj-auth-method=Access%20grant&storj-satellite=us1.storj.io%3A7777&storj-api-key&storj-secret&${b([...Object.entries(e.advanced),...Object.entries(e.dynamic)],!0)}`,from:(e,n,t)=>P({destinationType:e},R(e,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:e=>e.get(xe).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:e=>`storj://storj.io/config?storj-auth-method=API%20key&${b([...Object.entries(e.advanced),...Object.entries(e.dynamic)],!0)}`,from:(e,n,t)=>P({destinationType:e},R(e,n))}}];var jt=/[a-zA-Z0-9_\-\+\.!@#$%^&*?_~()-]/,Tt=class e{generate(n,t=jt){let o;do o=this.generatePassword(n,t);while(this.calculatePasswordStrength(o)<5);return o}generatePassword(n,t=jt){let o=this;return Array.apply(null,{length:n}).map(()=>{let i;for(;;)if(i=String.fromCharCode(o.#e()),t.test(i))return i},this).join("")}calculatePasswordStrength(n){let t=1;return n.length>=8&&t++,n.match(/[a-z]/)&&n.match(/[A-Z]/)&&t++,n.match(/\d+/)&&t++,n.match(/.[!,@,#,$,%,^,&,*,?,_,~,(,),-]/)&&t++,Math.min(t,5)}#e(){if(window.crypto&&window.crypto.getRandomValues){let n=new Uint8Array(1);return window.crypto.getRandomValues(n),n[0]}else if(window.msCrypto&&window.msCrypto.getRandomValues){let n=new Uint8Array(1);return window.msCrypto.getRandomValues(n),n[0]}else return Math.floor(Math.random()*256)}static \u0275fac=function(t){return new(t||e)};static \u0275prov=we({token:e,factory:e.\u0275fac,providedIn:"root"})};var rn=["formRef"];function an(e,n){if(e&1&&(a(0,"spk-option",27),m(1),r()),e&2){let t=n.$implicit;c("value",t.Key),s(),B(t.DisplayName)}}function sn(e,n){if(e&1&&_(0,"spk-progress-bar",38),e&2){let t=p(3);$e("warn",t.calculatePasswordStrength()===1)("tertiary",t.calculatePasswordStrength()===2)("primary",t.calculatePasswordStrength()===4)("success",t.calculatePasswordStrength()===5),c("value",t.calculatePasswordStrength()*(100/5))}}function ln(e,n){e&1&&(a(0,"span",33),k(1,9),r())}function pn(e,n){e&1&&(h(0,7,1),_(1,"spk-icon"),D())}function cn(e,n){e&1&&(h(0,7,2),_(1,"spk-icon"),D())}function mn(e,n){e&1&&(h(0,10,1),_(1,"spk-icon",40),D())}function _n(e,n){e&1&&(h(0,10,2),_(1,"spk-icon"),D())}function un(e,n){if(e&1){let t=O();a(0,"button",39),f("click",function(){S(t);let i=p(3);return T(i.copyPassword())}),h(1,10),F(2,mn,2,0)(3,_n,2,0),D(),r()}if(e&2){let t=p(3);s(2),g(t.copiedPassword()?2:3)}}function dn(e,n){e&1&&(a(0,"spk-alert",37),k(1,11),r())}function Fn(e,n){if(e&1){let t=O();a(0,"div",28)(1,"spk-form-field")(2,"label",29),h(3,6),_(4,"sup"),D(),r(),_(5,"input",30),r(),F(6,sn,1,9,"spk-progress-bar",31),a(7,"spk-form-field"),_(8,"input",32),F(9,ln,2,0,"span",33),r(),a(10,"div",34)(11,"button",35),f("click",function(){S(t);let i=p(2);return T(i.showPassword.set(!i.showPassword()))}),h(12,7),F(13,pn,2,0)(14,cn,2,0),D(),r(),a(15,"button",35),f("click",function(){S(t);let i=p(2);return T(i.generatePassword())}),h(16,8),_(17,"spk-icon"),D(),r(),F(18,un,4,1,"button",36),r(),F(19,dn,2,0,"spk-alert",37),r()}if(e&2){let t=p(2);s(5),c("type",t.showPassword()?"text":"password"),s(),g(t.generalForm.value.password?6:-1),s(2),c("type",t.showPassword()?"text":"password"),s(),g(t.generalForm.value.repeatPassword&&t.generalForm.value.repeatPassword!==t.generalForm.value.password?9:-1),s(4),g(t.showPassword()?13:14),s(5),g(t.showCopyPassword()?18:-1),s(),g(t.generalForm.value.password&&t.generalForm.value.password===t.generalForm.value.repeatPassword?19:-1)}}function gn(e,n){if(e&1&&(a(0,"spk-select",24)(1,"label",25),k(2,5),r(),_(3,"input",26),M(4,an,2,2,"spk-option",27,I),r(),F(6,Fn,20,7,"div",28)),e&2){let t=p();c("displayFn",t.displayFn()),s(4),v(t.encryptionOptions()),s(2),g(t.encryptionFieldSignal()!==""?6:-1)}}function Cn(e,n){if(e&1&&(a(0,"button",22),h(1,12),_(2,"spk-icon"),D(),r()),e&2){let t=p();c("disabled",t.generalForm.invalid)}}function fn(e,n){if(e&1&&(a(0,"spk-tooltip",23)(1,"button",22),h(2,13),_(3,"spk-icon"),D(),r()()),e&2){let t=p();c("disabled",!(t.showCopyPassword()&&!t.copiedPassword())),s(),c("disabled",t.generalForm.invalid||t.showCopyPassword()&&!t.copiedPassword())}}var Ze=new oe,Wt=(e={name:"",description:"",encryption:"",password:"",repeatPassword:""})=>Ze.group({name:Ze.control(e.name,[Ee.required]),description:Ze.control(e.description),encryption:Ze.control(e.encryption,[Ht()]),password:Ze.control(e.password,[Pt(n=>n?.value.encryption!=="",[Ee.required])]),repeatPassword:Ze.control(e.repeatPassword,[Pt(n=>n?.value.encryption!=="",[Ee.required])])}),Ot={Key:"",DisplayName:"None"},At=class e{#e=$(re);#t=$(De);#o=$(Tt);#i=$(ue);#n=$(mt);formRef=fe.required("formRef");generalForm=this.#i.generalForm;generalFormSignal=this.#i.generalFormSignal;encryptionFieldSignal=this.#i.encryptionFieldSignal;encryptionOptions=this.#i.encryptionOptions;isNew=this.#i.isNew;showPassword=A(!1);copiedPassword=A(!1);showCopyPassword=A(!1);encryptionEffect=pt(()=>{this.encryptionFieldSignal()===""&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});calculatePasswordStrength=K(()=>{let t=this.generalFormSignal()?.password??"";return this.#o.calculatePasswordStrength(t)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#i.exit()}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 o=document.createElement("textarea");o.value=n,document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o)}catch(o){console.error("Failed to copy text: ",o)}}}displayFn(){let n=this.#n.systemInfo()?.EncryptionModules??[];return t=>{let o=[Ot,...n].find(i=>i.Key===t);return o?`${o.DisplayName}`:""}}generatePassword(){this.copiedPassword.set(!1);let n=this.#o.generate(16);this.generalForm.controls.password.setValue(n),this.generalForm.controls.repeatPassword.setValue(n),this.showCopyPassword.set(!0)}next(){this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=ne({type:e,selectors:[["app-general"]],viewQuery:function(t,o){t&1&&Se(o.formRef,rn,5),t&2&&Te()},decls:20,vars:3,consts:()=>{let n;n=$localize`Your backup name`;let t;t=$localize`Your backup description`;let o;o=$localize`General backup settings`;let i;i=$localize` Backup name ${"\uFFFD#7\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#7\uFFFD"}:CLOSE_SUPERSCRIPT:`;let l;l=$localize`Backup description`;let u;u=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Exit `;let N;N=$localize`Encryption`;let w;w=$localize`Encryption`;let y;y=$localize`Password`;let Z;Z=$localize`Repeat password`;let J;J=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let L;L=$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:`,L=Ie(L);let ee;ee=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Generate password `;let te;te=$localize`Passwords do not match`;let H;H=$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:`,H=Ie(H);let d;d=$localize` Tip: Be sure to save your password. If you loose it you will lose access to your backups. `;let C;C=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let G;return G=$localize` Continue ${"\uFFFD#3\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],o,i,l,u,w,J,L,ee,te,H,d,C,G,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],["for","backupName"],["type","text","tabindex","1","placeholder",n,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",t,"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"],[3,"displayFn"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",N,"formControlName","encryption"],[3,"value"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",y,"formControlName","password",3,"type"],[1,"raised",3,"warn","tertiary","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",Z,"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(t,o){if(t&1){let i=O();a(0,"form",14,0),f("submit",function(){return S(i),T(o.next())}),a(2,"h3",15),k(3,1),r(),a(4,"spk-form-field")(5,"label",16),h(6,2),_(7,"sup"),D(),r(),_(8,"input",17),r(),a(9,"spk-form-field")(10,"label",18),k(11,3),r(),_(12,"textarea",19),r(),F(13,gn,7,2),a(14,"div",20)(15,"button",21),f("click",function(){return S(i),T(o.exit())}),h(16,4),_(17,"spk-icon"),D(),r(),F(18,Cn,3,1,"button",22)(19,fn,4,2,"spk-tooltip",23),r()()}t&2&&(c("formGroup",o.generalForm),s(13),g(o.isNew()?13:-1),s(5),g(o.encryptionFieldSignal()===""?18:19))},dependencies:[Oe,Pe,ae,se,ye,Ne,Ae,pe,me,Ve,le,ce,Xt,Ft,qe],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}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--warn-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})};var Sn=["formRef"],Tn=(e,n)=>({index:e,formView:n,formGroupName:"advancedOptions",destinationType:null,oauthField:null}),hn=e=>({$implicit:e});function Dn(e,n){if(e&1&&(a(0,"spk-option",17),m(1),r()),e&2){let t=n.$implicit;c("value",t),s(),B(t)}}function En(e,n){if(e&1&&(a(0,"spk-option",17),m(1),r()),e&2){let t=n.$implicit;c("value",t.value),s(),B(t.name)}}function yn(e,n){if(e&1){let t=O();h(0,7,1),a(1,"button",29,2),f("click",function(){let i=S(t).$implicit,l=p();return T(l.addNewOption(i))}),r(),D()}if(e&2){let t=n.$implicit;s(),nt(t.name),ot(0)}}function Pn(e,n){e&1&&ze(0)}function Nn(e,n){if(e&1&&F(0,Pn,1,0,"ng-container",30),e&2){let t=n.$implicit,o=n.$index;p();let i=he(35);c("ngTemplateOutlet",i)("ngTemplateOutletContext",Xe(5,hn,Vt(2,Tn,o,t)))}}function An(e,n){if(e&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function On(e,n){if(e&1&&(a(0,"app-file-tree",33)(1,"label",39),m(2),F(3,An,3,1,"spk-tooltip",40),r(),_(4,"input",41),r()),e&2){let t,o=p().$implicit,i=p();c("startingPath",i.getFormFieldValue(0,o.formGroupName,o.formView.name))("accepts",o.formView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),s(),q("for","destination-",o.formGroupName,"-",o.index,""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),q("id","destination-",o.formGroupName,"-",o.index,""),X("formControlName",o.formView.name)}}function kn(e,n){if(e&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function xn(e,n){if(e&1&&(a(0,"app-file-tree",34)(1,"label",39),m(2),F(3,kn,3,1,"spk-tooltip",40),r(),_(4,"input",41),r()),e&2){let t,o=p().$implicit,i=p();c("startingPath",i.getFormFieldValue(0,o.formGroupName,o.formView.name)),s(),q("for","destination-",o.formGroupName,"-",o.index,""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),q("id","destination-",o.formGroupName,"-",o.index,""),X("formControlName",o.formView.name)}}function $n(e,n){if(e&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function In(e,n){e&1&&(a(0,"spk-icon",42),m(1,"link"),r())}function Mn(e,n){e&1&&(a(0,"spk-icon",42),m(1,"textbox"),r())}function vn(e,n){if(e&1&&(a(0,"spk-form-field")(1,"label",39),m(2),F(3,$n,3,1,"spk-tooltip",40),r(),_(4,"input",41),F(5,In,2,0,"spk-icon",42)(6,Mn,2,0,"spk-icon",42),r()),e&2){let t,o=p().$implicit;s(),q("for","destination-",o.formGroupName,"-",o.index,""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),q("id","destination-",o.formGroupName,"-",o.index,""),X("formControlName",o.formView.name),s(),g(o.formView.type==="Path"?5:6)}}function wn(e,n){if(e&1){let t=O();a(0,"span",46),f("click",function(){S(t);let i=p(2).$implicit,l=p();return T(l.oauthStartTokenCreation(i.formViewType))}),m(1,"AuthID"),r()}}function Rn(e,n){e&1&&(a(0,"spk-icon",42),m(1,"password"),r())}function bn(e,n){if(e&1){let t=O();a(0,"spk-icon",47),f("click",function(){S(t);let i=p(2).$implicit;return T(i.formView.showPassword=!i.formView.showPassword)}),m(1," eye "),r()}}function Gn(e,n){if(e&1){let t=O();a(0,"spk-icon",47),f("click",function(){S(t);let i=p(2).$implicit;return T(i.formView.showPassword=!i.formView.showPassword)}),m(1," eye-slash "),r()}}function Vn(e,n){if(e&1&&(a(0,"spk-form-field")(1,"label",39),m(2),r(),_(3,"input",43),F(4,wn,2,0,"span",44)(5,Rn,2,0,"spk-icon",42)(6,bn,2,0,"spk-icon",45)(7,Gn,2,0,"spk-icon",45),r()),e&2){let t,o=p().$implicit;s(),q("for","destination-",o.formGroupName,"-",o.index,""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),q("id","destination-",o.formGroupName,"-",o.index,""),X("formControlName",o.formView.name),c("type",o.formView.showPassword?"text":"password"),s(),g(o.oauthField===o.formView.name?4:5),s(2),g(o.formView.showPassword?6:7)}}function Ln(e,n){if(e&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function Un(e,n){if(e&1&&(a(0,"spk-option",17),m(1),r()),e&2){let t=n.$implicit;c("value",t),s(),B(t)}}function Bn(e,n){if(e&1&&(a(0,"spk-select")(1,"label",39),m(2),F(3,Ln,3,1,"spk-tooltip",40),r(),_(4,"input",48),M(5,Un,2,2,"spk-option",17,I),r()),e&2){let t,o=p().$implicit;s(),q("for","destination-",o.formGroupName,"-",o.index,""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),q("id","destination-",o.formGroupName,"-",o.index,""),X("formControlName",o.formView.name),s(),v(o.formView.options)}}function Kn(e,n){if(e&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function zn(e,n){if(e&1&&(a(0,"spk-option",17),m(1),r()),e&2){let t=n.$implicit;c("value",t),s(),B(t)}}function Xn(e,n){if(e&1&&(a(0,"div",35)(1,"label",39),m(2),F(3,Kn,3,1,"spk-tooltip",40),r(),a(4,"div",49)(5,"spk-form-field"),_(6,"input",50),a(7,"spk-icon",42),m(8,"resize"),r()(),a(9,"spk-select"),_(10,"label")(11,"input",51),M(12,zn,2,2,"spk-option",17,I),r()()()),e&2){let t,o=p().$implicit,i=p();c("formGroupName",o.formView.name),s(),q("for","destination-",o.formGroupName,"-",o.index,""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(3),q("id","destination-",o.formGroupName,"-",o.index,""),s(6),v(i.sizeOptions())}}function Hn(e,n){if(e&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function jn(e,n){if(e&1&&(a(0,"spk-form-field")(1,"label",39),m(2),F(3,Hn,3,1,"spk-tooltip",40),r(),_(4,"input",52),a(5,"spk-icon",42),m(6,"numpad"),r()()),e&2){let t,o=p().$implicit;s(),q("for","destination-",o.formGroupName,"-",o.index,""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),q("id","destination-",o.formGroupName,"-",o.index,""),X("formControlName",o.formView.name)}}function Wn(e,n){if(e&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function qn(e,n){if(e&1&&(a(0,"spk-toggle",36)(1,"label",39),m(2),F(3,Wn,3,1,"spk-tooltip",40),r(),_(4,"input",53),r()),e&2){let t,o=p().$implicit;s(),q("for","destination-",o.formGroupName,"-",o.index,""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),q("id","destination-",o.formGroupName,"-",o.index,""),X("formControlName",o.formView.name)}}function Qn(e,n){if(e&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function Yn(e,n){e&1&&(a(0,"spk-option",55),m(1,"None"),r()),e&2&&c("value","None")}function Zn(e,n){if(e&1&&(a(0,"spk-option",17),m(1),_(2,"spk-checkbox",56),r()),e&2){let t=p().$implicit;c("value",t),s(),V(" ",t," ")}}function Jn(e,n){if(e&1&&F(0,Yn,2,1,"spk-option",55)(1,Zn,3,2,"spk-option",17),e&2){let t=n.$implicit;g(t==="None"?0:1)}}function eo(e,n){if(e&1&&(a(0,"spk-select",37)(1,"label",39),m(2),F(3,Qn,3,1,"spk-tooltip",40),r(),_(4,"input",54),M(5,Jn,2,1,null,null,I),r()),e&2){let t,o=p().$implicit;c("selectMultiple",!0),s(),q("for","destination-",o.formGroupName,"-",o.index,""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),X("formControlName",o.formView.name),s(),v(o.formView.options)}}function to(e,n){if(e&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function no(e,n){if(e&1&&(a(0,"spk-form-field")(1,"label",39),m(2),F(3,to,3,1,"spk-tooltip",40),r(),_(4,"input",41),r()),e&2){let t,o=p().$implicit;s(),q("for","destination-",o.formGroupName,"-",o.index,""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),q("id","destination-",o.formGroupName,"-",o.index,""),X("formControlName",o.formView.name)}}function oo(e,n){if(e&1){let t=O();a(0,"div",31),j(1,32),F(2,On,5,14,"app-file-tree",33)(3,xn,5,10,"app-file-tree",34)(4,vn,7,10,"spk-form-field")(5,Vn,8,11,"spk-form-field")(6,Bn,7,9,"spk-select")(7,Xn,14,9,"div",35)(8,jn,7,9,"spk-form-field")(9,qn,5,9,"spk-toggle",36)(10,eo,7,7,"spk-select",37)(11,no,5,9,"spk-form-field"),W(),a(12,"button",38),f("click",function(){let i=S(t).$implicit,l=p();return T(l.removeFormView(i.formView,0))}),a(13,"spk-icon"),m(14,"x-circle"),r()()()}if(e&2){let t=n.$implicit;s(),c("formGroupName",t.formGroupName),s(),g(t.formView.type==="FileTree"?2:t.formView.type==="FolderTree"?3:t.formView.type==="String"||t.formView.type==="Path"?4:t.formView.type==="Password"?5:t.formView.type==="Enumeration"?6:t.formView.type==="Size"?7:t.formView.type==="Integer"?8:t.formView.type==="Boolean"?9:t.formView.type==="Flags"?10:t.formView.type==="Timespan"?11:-1)}}var Me=new oe,io=["Bytes","KB","MB","GB","TB","PB"],ro=[{value:"",name:"Keep all backups"},{value:"time",name:"Delete backups that are older than"},{value:"versions",name:"Keep a specific number of backups"},{value:"smart",name:"Smart backup retention"},{value:"custom",name:"Custom backup retention"}],qt=(e={remoteVolumeSize:50,size:"MB",backupRetention:"",advancedOptions:[]})=>Me.group({remoteVolumeSize:Me.group({size:Me.control(e.remoteVolumeSize),unit:Me.control(e.size)}),backupRetention:Me.control(e.backupRetention),advancedOptions:Me.group({})}),kr=(e,n)=>Me.group({name:Me.control(e),value:Me.control(n)}),kt=class e{#e=$(ue);#t=$(re);#o=$(De);formRef=fe.required("formRef");optionsForm=this.#e.optionsForm;selectedOptions=this.#e.selectedOptions;nonSelectedOptions=this.#e.nonSelectedOptions;isSubmitting=this.#e.isSubmitting;sizeOptions=A(io);rentationOptions=A(ro);oauthStartTokenCreation(n){}getFormFieldValue(n,t,o){return this.optionsForm.controls.advancedOptions.controls[o].value}removeFormView(n,t){this.#e.removeOptionFromFormGroup(n)}addNewOption(n){this.#e.addOptionToFormGroup(n)}retentionOptionDisplayFn(){let n=this.rentationOptions();return t=>{let o=n.find(i=>i.value===t);return o?o.name:""}}displayFn(){let n=this.#e.advancedOptions();return t=>{let o=n.find(i=>i.name===t);return o?`${o.name}`:""}}goBack(){this.#t.navigate(["schedule"],{relativeTo:this.#o.parent})}submit(){this.#e.submit()}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=ne({type:e,selectors:[["app-options"]],viewQuery:function(t,o){t&1&&Se(o.formRef,Sn,5),t&2&&Te()},decls:43,vars:5,consts:()=>{let n;n=$localize`Select an option...`;let t;t=$localize`Options`;let o;o=$localize`Remote volume size`;let i;i=$localize` The backups will be split up into multiple files called volumes. Here you can set the maximum size of the individual volume files. ${"\uFFFD#16\uFFFD"}:START_LINK:Read more${"\uFFFD/#16\uFFFD"}:CLOSE_LINK:`;let l;l=$localize`Backup retention`;let u;u=$localize` Advanced options ${"\uFFFD#26\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#27\uFFFD"}:START_TAG_BUTTON: Add advanced option ${"\uFFFD#28\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#27\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#29\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD*31:1\uFFFD"}:START_BLOCK_FOR:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON_1:${"\uFFFD0:1\uFFFD"}:INTERPOLATION:${"[\uFFFD/#27\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/*31:1\uFFFD"}:CLOSE_BLOCK_FOR:${"\uFFFD/#29\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#26\uFFFD"}:CLOSE_TAG_SPK_MENU:`,u=Ie(u);let N;N=$localize`${"\uFFFD#39\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#39\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let w;return w=$localize`${"\uFFFD#42\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#42\uFFFD"}:CLOSE_TAG_SPK_ICON: Submit `,[["formRef",""],["fieldTemplate",""],["option",""],t,o,i,l,u,N,w,[3,"submit","formGroup"],[1,"title-30"],[1,"remote-volume-wrap"],["formGroupName","remoteVolumeSize",1,"row-inputs"],["for","size"],["type","number","id","size","formControlName","size"],["type","text","placeholder",n,"formControlName","unit"],[3,"value"],["href","#",1,"spk-primary"],[3,"displayFn"],["type","text","formControlName","backupRetention"],[3,"disallowToggle"],["title",""],["spk-button","","type","button",1,"outlined","small"],["menu",""],["type","button"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["type","button",3,"click"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"field-row"],[3,"formGroupName"],[3,"startingPath","accepts","showFiles","showHiddenNodes","selectFiles"],[3,"startingPath"],[1,"form-column",3,"formGroupName"],[1,"primary","raised"],[1,"primary",3,"selectMultiple"],["spk-button","","type","button",1,"outlined",3,"click"],[3,"for"],[1,"primary",3,"message"],["type","text",3,"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"],["type","search",3,"id","formControlName"],[1,"form-row"],["type","number","formControlName","size",3,"id"],["type","search","formControlName","unit"],["type","number",3,"id","formControlName"],["type","checkbox",3,"id","formControlName"],["type","text","id","text",3,"formControlName"],["deselect","",3,"value"],[1,"raised","primary"]]},template:function(t,o){if(t&1){let i=O();a(0,"form",10,0),f("submit",function(){return S(i),T(o.submit())}),a(2,"h3",11),k(3,3),r(),a(4,"div",12)(5,"div",13)(6,"spk-form-field")(7,"label",14),k(8,4),r(),_(9,"input",15),r(),a(10,"spk-select"),_(11,"input",16),M(12,Dn,2,2,"spk-option",17,I),r()(),a(14,"p"),h(15,5),_(16,"a",18),D(),r()(),a(17,"spk-select",19)(18,"label",14),k(19,6),r(),_(20,"input",20),M(21,En,2,2,"spk-option",17,I),r(),a(23,"app-toggle-card",21),j(24,22),h(25,7),a(26,"spk-menu")(27,"button",23),_(28,"spk-icon"),r(),j(29,24),M(30,yn,3,1,"button",25,I),W(),r(),D(),W(),M(32,Nn,1,7,"ng-container",null,I),r(),F(34,oo,15,2,"ng-template",null,1,lt),a(36,"div",26)(37,"button",27),f("click",function(){return S(i),T(o.goBack())}),h(38,8),_(39,"spk-icon"),D(),r(),a(40,"button",28),h(41,9),_(42,"spk-icon"),D(),r()()()}t&2&&(c("formGroup",o.optionsForm),s(12),v(o.sizeOptions()),s(5),c("displayFn",o.retentionOptionDisplayFn()),s(4),v(o.rentationOptions()),s(2),c("disallowToggle",!0),s(7),v(o.nonSelectedOptions()),s(2),v(o.selectedOptions()),s(8),$e("loader",o.isSubmitting()))},dependencies:[Oe,Pe,ae,be,Re,se,ye,Ne,Ae,Ge,ct,Ct,me,Ve,le,pe,Le,gt,ce,qe,Qe,Ue],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}.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}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 40px;align-items:flex-end}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var ao=["formRef"];function so(e,n){if(e&1&&(a(0,"spk-option",38),m(1),r()),e&2){let t=n.$implicit;c("value",t.key),s(),B(t.label)}}function lo(e,n){if(e&1){let t=O();a(0,"div",26)(1,"spk-form-field")(2,"label",27),k(3,8),r(),a(4,"input",28,1),f("focus",function(){S(t);let i=he(5);return T(i.showPicker())}),r(),a(6,"spk-icon",29),m(7,"clock"),r()(),a(8,"spk-form-field"),_(9,"label",30),a(10,"input",31,2),f("focus",function(){S(t);let i=he(11);return T(i.showPicker())}),r(),a(12,"spk-icon",29),m(13,"calendar"),r()()(),j(14,32),a(15,"div",33)(16,"spk-form-field")(17,"label",34),k(18,9),r(),_(19,"input",35),r(),a(20,"spk-select",36),_(21,"input",37),M(22,so,2,2,"spk-option",38,I),r()(),a(24,"app-toggle-card",39),j(25,40),k(26,10),W(),a(27,"div",41)(28,"spk-toggle",21),h(29,11),_(30,"input",42),D(),r(),a(31,"spk-toggle",21),h(32,12),_(33,"input",43),D(),r(),a(34,"spk-toggle",21),h(35,13),_(36,"input",44),D(),r(),a(37,"spk-toggle",21),h(38,14),_(39,"input",45),D(),r(),a(40,"spk-toggle",21),h(41,15),_(42,"input",46),D(),r(),a(43,"spk-toggle",21),h(44,16),_(45,"input",47),D(),r(),a(46,"spk-toggle",21),h(47,17),_(48,"input",48),D(),r()()(),W()}if(e&2){let t=p();s(20),c("displayFn",t.displayFn),s(2),v(t.unitOptions),s(2),c("disallowToggle",!0)}}var Y=new oe,Qt=[{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`}],Yt=(e={autoRun:!1,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}}})=>Y.group({autoRun:Y.control(e.autoRun),nextTime:Y.group({time:Y.control(e.nextTime.time),date:Y.control(e.nextTime.date)}),runAgain:Y.group({repeatValue:Y.control(e.runAgain.repeatValue),repeatUnit:Y.control(e.runAgain.repeatUnit),allowedDays:Y.group({mon:Y.control(e.runAgain.allowedDays.mon),tue:Y.control(e.runAgain.allowedDays.tue),wed:Y.control(e.runAgain.allowedDays.wed),thu:Y.control(e.runAgain.allowedDays.thu),fri:Y.control(e.runAgain.allowedDays.fri),sat:Y.control(e.runAgain.allowedDays.sat),sun:Y.control(e.runAgain.allowedDays.sun)})})}),xt=class e{#e=$(ue);#t=$(re);#o=$(De);formRef=fe.required("formRef");scheduleForm=this.#e.scheduleForm;scheduleFormSignal=this.#e.scheduleFormSignal;unitOptions=Qt;displayFn(n){let t=Qt.find(o=>o.key===n);return t?`${t.label}`:""}goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#o.parent})}next(){this.#t.navigate(["options"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=ne({type:e,selectors:[["app-schedule"]],viewQuery:function(t,o){t&1&&Se(o.formRef,ao,5),t&2&&Te()},decls:18,vars:2,consts:()=>{let n;n=$localize`Schedule`;let t;t=$localize` Automatically run backups ${"\uFFFD#7\uFFFD\uFFFD/#7\uFFFD"}:TAG_INPUT:`;let o;o=$localize`If a date was missed, the job will run as soon as possible.`;let i;i=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let l;l=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let u;u=$localize`Next time`;let N;N=$localize`Run again every`;let w;w=$localize`Allowed days`;let y;y=$localize` Monday ${"\uFFFD#30\uFFFD\uFFFD/#30\uFFFD"}:TAG_INPUT:`;let Z;Z=$localize` Tuesday ${"\uFFFD#33\uFFFD\uFFFD/#33\uFFFD"}:TAG_INPUT:`;let J;J=$localize` Wednesday ${"\uFFFD#36\uFFFD\uFFFD/#36\uFFFD"}:TAG_INPUT:`;let L;L=$localize` Thursday ${"\uFFFD#39\uFFFD\uFFFD/#39\uFFFD"}:TAG_INPUT:`;let ee;ee=$localize` Friday ${"\uFFFD#42\uFFFD\uFFFD/#42\uFFFD"}:TAG_INPUT:`;let te;te=$localize` Saturday ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`;let H;return H=$localize` Sunday ${"\uFFFD#48\uFFFD\uFFFD/#48\uFFFD"}:TAG_INPUT:`,[["formRef",""],["timeRef",""],["dateRef",""],n,t,o,i,l,u,N,w,y,Z,J,L,ee,te,H,[3,"submit","formGroup"],[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox","formControlName","autoRun"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["formGroupName","nextTime",1,"row-inputs"],["for","time"],["type","time","id","time","formControlName","time",3,"focus"],["suffix",""],["for","date"],["type","date","id","date","formControlName","date",3,"focus"],["formGroupName","runAgain"],[1,"row-inputs"],["for","repeatValue"],["type","number","id","repeatValue","formControlName","repeatValue"],[3,"displayFn"],["type","text","id","repeatUnit","formControlName","repeatUnit"],[3,"value"],["formGroupName","allowedDays",3,"disallowToggle"],["title",""],[1,"days-wrap"],["type","checkbox","formControlName","mon"],["type","checkbox","formControlName","tue"],["type","checkbox","formControlName","wed"],["type","checkbox","formControlName","thu"],["type","checkbox","formControlName","fri"],["type","checkbox","formControlName","sat"],["type","checkbox","formControlName","sun"]]},template:function(t,o){if(t&1){let i=O();a(0,"form",18,0),f("submit",function(){return S(i),T(o.next())}),a(2,"h3",19),k(3,3),r(),a(4,"div",20)(5,"spk-toggle",21),h(6,4),_(7,"input",22),D(),r(),a(8,"p"),k(9,5),r()(),F(10,lo,49,2),a(11,"div",23)(12,"button",24),f("click",function(){return S(i),T(o.goBack())}),h(13,6),_(14,"spk-icon"),D(),r(),a(15,"button",25),h(16,7),_(17,"spk-icon"),D(),r()()()}if(t&2){let i;c("formGroup",o.scheduleForm),s(10),g((i=o.scheduleFormSignal())!=null&&i.autoRun?10:-1)}},dependencies:[Oe,Pe,ae,be,Re,se,ye,Ne,Ae,Ge,pe,me,ce,Le,le,Ve,Ue],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}.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 po(e,n){if(e&1&&(a(0,"spk-option",2),m(1),r()),e&2){let t=n.$implicit;c("value",t.value),s(),B(t.key)}}function co(e,n){if(e&1&&(a(0,"spk-option",2),m(1),r()),e&2){let t=n.$implicit;c("value",t.value),s(),B(t.key)}}function mo(e,n){if(e&1){let t=O();a(0,"spk-select",0)(1,"input",5),f("ngModelChange",function(i){S(t);let l=p(2);return T(l.updateStateExpression(i))}),r(),M(2,co,2,2,"spk-option",2,I),r()}if(e&2){let t,o=p(2);c("hideClearButton",!0)("displayFn",o.displayFn),s(),c("ngModel",(t=o.pathState())==null?null:t.expression),s(),v(o.fileGroupOptions())}}function _o(e,n){if(e&1){let t=O();a(0,"spk-form-field")(1,"input",5),f("ngModelChange",function(i){S(t);let l=p(2);return T(l.updateStateExpression(i))}),r()()}if(e&2){let t,o=p(2);s(),c("ngModel",(t=o.pathState())==null?null:t.expression)}}function uo(e,n){if(e&1){let t=O();a(0,"spk-select",0)(1,"input",1),f("ngModelChange",function(i){S(t);let l=p();return T(l.updateStateType(i))}),r(),M(2,po,2,2,"spk-option",2,I),r(),F(4,mo,4,3,"spk-select",0)(5,_o,2,1,"spk-form-field"),a(6,"div",3),f("click",function(){S(t);let i=p();return T(i.removeFilter())}),a(7,"spk-icon",4),m(8,"x-circle"),r()()}if(e&2){let t,o,i=p();c("hideClearButton",!0)("displayFn",i.displayFn),s(),c("ngModel",(t=i.pathState())==null?null:t.type),s(),v(i.expressionOptions()),s(2),g(((o=i.pathState())==null?null:o.type)==="-FileGroup"||((o=i.pathState())==null?null:o.type)==="+FileGroup"?4:5)}}var Zt=[{key:"Excludes folders where name contains",value:"-FolderNameIncludes"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileNameIncludes"},{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"}],Fo=[{key:"Applications",value:"Applications"},{key:"CacheFiles",value:"Cache Files"},{key:"TemporaryFiles",value:"Temporary Files"},{key:"OperatingSystem",value:"Operating System"},{key:"SystemFiles",value:"System Files"},{key:"DefaultExcludes",value:"Standard Excludes"}],ht=class e{path=st.required();pathChange=tt();remove=tt();expressionOptions=A(Zt);fileGroupOptions=A(Fo);pathState=A(null);typeState=K(()=>{let n=this.pathState();return n?n.type:null});pathEffect=pt(()=>{let n=this.path(),t=n.slice(1),o=n.startsWith("-")?"-":"+";return t.startsWith("/")&&t.endsWith("/")?this.pathState.set({type:`${o}Folder`,path:t,expression:t}):t.startsWith("*")&&t.endsWith("*/")?this.pathState.set({type:`${o}FolderNameIncludes`,path:t,expression:t.slice(1,-2)}):t.startsWith("[.*")&&t.endsWith("[^\\/]*]")?this.pathState.set({type:`${o}FileNameIncludes`,path:t,expression:t.slice(3,-7)}):t.startsWith("{")&&t.endsWith("}")?this.pathState.set({type:`${o}FileGroup`,path:t,expression:t.slice(1,-1)}):t.startsWith("[")&&t.endsWith("]")?this.pathState.set({type:`${o}Regex`,path:t,expression:t.slice(1,-1)}):t.startsWith("*.")?this.pathState.set({type:`${o}Extension`,path:t,expression:t.slice(2)}):this.pathState.set({type:`${o}Expression`,path:t,expression:t})});updateStateType(n){this.pathState.update(t=>(t.type=n,t.path=this.#t(t),t)),this.#e()}updateStateExpression(n){this.pathState.update(t=>(t.expression=n,t.path=this.#t(t),t)),this.#e()}#e(){setTimeout(()=>this.pathChange.emit(this.pathState().path))}#t(n){let t=n.type.slice(0,1),o=n.type.slice(1);if(o==="Folder"){let i=n.expression.endsWith("/"),l=n.expression.startsWith("/");return i&&l?`${t}${n.expression}`:i?`${t}${n.expression}/`:l?`${t}/${n.expression}`:`${t}/${n.expression}/`}return o==="FolderNameIncludes"?`${t}*${n.expression}*/`:o==="FileNameIncludes"?`${t}[.*${n.expression}[^\\/]*]`:o==="FileGroup"?`${t}{${n.expression}}`:o==="Regex"?`${t}[${n.expression}]`:o==="Extension"?`${t}*.${n.expression}`:`${t}${n.expression}`}removeFilter(){this.remove.emit()}displayFn(n){let t=Zt.find(o=>o.value===n);return t?t.key:""}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=ne({type:e,selectors:[["app-filter"]],inputs:{path:[1,"path"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:1,vars:1,consts:()=>{let n;return n=$localize`Select an option...`,[[3,"hideClearButton","displayFn"],["type","text","placeholder",n,3,"ngModelChange","ngModel"],[3,"value"],[1,"filter-removal",3,"click"],[1,"spk-primary"],["type","text",3,"ngModelChange","ngModel"]]},template:function(t,o){t&1&&F(0,uo,9,4),t&2&&g(o.pathState()?0:-1)},dependencies:[dt,ae,se,Ut,me,ce,le,pe],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] spk-select[_ngcontent-%COMP%]{--miw: initial}[_nghost-%COMP%] .filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var go=["formRef"];function Co(e,n){if(e&1){let t=O();a(0,"app-filter",42),f("pathChange",function(i){let l=S(t).$index,u=p(2);return T(u.patchPathAt(i,l))})("remove",function(){let i=S(t).$index,l=p(2);return T(l.removePathAt(i))}),r()}if(e&2){let t=n.$implicit;c("path",t)}}function fo(e,n){if(e&1&&M(0,Co,1,1,"app-filter",41,I),e&2){let t=p();v(t.pathArray())}}function So(e,n){if(e&1&&(a(0,"spk-option",45),m(1),r()),e&2){let t=n.$implicit;c("value",t),s(),B(t)}}function To(e,n){if(e&1&&(a(0,"div",40)(1,"spk-form-field"),_(2,"input",43),r(),a(3,"spk-select"),_(4,"input",44),M(5,So,2,2,"spk-option",45,I),r()()),e&2){let t=p();s(5),v(t.sizeOptions())}}var ve=new oe,ho=["Bytes","KB","MB","GB","TB","PB"],Jt=(e={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>ve.group({path:ve.control(e.path),excludes:ve.group({hidden:ve.control(e.excludes.hidden),system:ve.control(e.excludes.system),temporary:ve.control(e.excludes.temporary),filesLargerThan:ve.group({size:ve.control(null),unit:ve.control(null)})})}),$t=class e{#e=$(ue);#t=$(re);#o=$(De);formRef=fe.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new _t("");filesLargerThan=K(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);sizeOptions=A(ho);pathSignal=Q(this.sourceDataForm.controls.path.valueChanges);pathArray=K(()=>this.pathSignal()?.split("\0").filter(n=>n.startsWith("-")||n.startsWith("+"))??[]);addFilter(n="-*"){let t=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(`${t}\0${n}`)}patchPathAt(n,t){let i=this.sourceDataForm.controls.path.value.split("\0").filter(u=>!u.startsWith("-")&&!u.startsWith("+")).join("\0"),l=this.pathArray().map((u,N)=>N===t?`${n}`:`${u}`).join("\0");this.sourceDataForm.controls.path.setValue(`${i}\0${l}`)}removePathAt(n){let o=this.sourceDataForm.controls.path.value.split("\0").filter(l=>!l.startsWith("-")&&!l.startsWith("+")).join("\0"),i=this.pathArray().filter((l,u)=>u!==n).join("\0");this.sourceDataForm.controls.path.setValue(`${o}\0${i}`)}getPath(){return this.sourceDataForm.value.path??null}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let n=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(`${n}\0${this.newPathCtrl.value}`),this.newPathCtrl.setValue("")}goBack(){this.#t.navigate(["destination"],{relativeTo:this.#o.parent})}next(){this.#t.navigate(["schedule"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=ne({type:e,selectors:[["app-source-data"]],viewQuery:function(t,o){t&1&&Se(o.formRef,go,5),t&2&&Te()},decls:55,vars:12,consts:()=>{let n;n=$localize`Path`;let t;t=$localize`Add a direct path`;let o;o=$localize`Hidden files`;let i;i=$localize`System files`;let l;l=$localize`Temporary files`;let u;u=$localize`Source Data`;let N;N=$localize`Folder path`;let w;w=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let y;y=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let Z;Z=$localize`Source Data`;let J;J=$localize`Add Path`;let L;L=$localize`Add a path directly from your machine.`;let ee;ee=$localize`Filters`;let te;te=$localize`Customize your filters.`;let H;H=$localize`Add filter`;let d;d=$localize`Exclude`;let C;C=$localize`Choose if there’s any files you want to exclude.`;let G;G=$localize` Hidden files ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`;let x;x=$localize` System files ${"\uFFFD#48\uFFFD\uFFFD/#48\uFFFD"}:TAG_INPUT:`;let ie;ie=$localize` Temporary files ${"\uFFFD#51\uFFFD\uFFFD/#51\uFFFD"}:TAG_INPUT:`;let ge;ge=$localize` Files larger than `;let de;return de=$localize`Select an option...`,[["formRef",""],u,N,w,y,Z,J,L,ee,te,H,d,C,G,x,ie,ge,[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,"row-inputs"],["type","text","placeholder",t,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",o,"formControlName","hidden"],["type","checkbox","placeholder",i,"formControlName","system"],["type","checkbox","placeholder",l,"formControlName","temporary"],[1,"raised","primary",3,"click"],["formGroupName","filesLargerThan",1,"row-inputs"],[3,"path"],[3,"pathChange","remove","path"],["type","number","formControlName","size"],["type","text","formControlName","unit","placeholder",de],[3,"value"]]},template:function(t,o){if(t&1){let i=O();a(0,"form",17,0),f("submit",function(){return S(i),T(o.next())}),a(2,"div",18)(3,"h3",19),k(4,1),r(),a(5,"app-file-tree",20)(6,"label",21),k(7,2),r(),_(8,"input",22),r(),a(9,"div",23)(10,"button",24),f("click",function(){return S(i),T(o.goBack())}),h(11,3),_(12,"spk-icon"),D(),r(),a(13,"button",25),h(14,4),_(15,"spk-icon"),D(),r()()(),a(16,"div",26)(17,"h3",19),k(18,5),r(),a(19,"app-toggle-card",27),j(20,28),k(21,6),W(),a(22,"p",29),k(23,7),r(),a(24,"div",30)(25,"spk-form-field"),_(26,"input",31),r(),a(27,"button",32),f("click",function(){return S(i),T(o.addNewPath())}),a(28,"spk-icon"),m(29,"plus"),r()()()(),a(30,"app-toggle-card",27),j(31,28),k(32,8),W(),a(33,"p",29),k(34,9),r(),a(35,"button",33),f("click",function(){return S(i),T(o.addFilter())}),k(36,10),r(),F(37,fo,2,0),r(),a(38,"app-toggle-card",34),j(39,28),k(40,11),W(),a(41,"p",29),k(42,12),r(),a(43,"spk-toggle",35),h(44,13),_(45,"input",36),D(),r(),a(46,"spk-toggle",35),h(47,14),_(48,"input",37),D(),r(),a(49,"spk-toggle",35),h(50,15),_(51,"input",38),D(),r(),a(52,"spk-toggle",39),f("click",function(){return S(i),T(o.toggleFilesLargerThan())}),k(53,16),r(),F(54,To,7,0,"div",40),r()()()}if(t&2){let i;c("formGroup",o.sourceDataForm),s(5),c("multiSelect",!0)("startingPath",o.getPath())("showFiles",!0),s(14),c("disallowToggle",!0),s(7),c("formControl",o.newPathCtrl),s(4),c("disallowToggle",!0),s(7),g((i=o.pathSignal())!=null&&i.length?37:-1),s(),c("disallowToggle",!0),s(14),$e("active",o.filesLargerThan()),s(2),g(o.filesLargerThan()?54:-1)}},dependencies:[dt,Pe,ae,be,Re,se,ye,Oe,ut,Ne,Ae,Ge,pe,ce,le,Ve,me,Le,Qe,Ue,ht],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}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.5rem}"],changeDetection:0})};var Fe=new oe,ue=class e{#e=$(re);#t=$(mt);#o=$(We);#i=$(ft);generalForm=Wt();sourceDataForm=Jt();scheduleForm=Yt();destinationForm=en();optionsForm=qt();isDraft=A(!1);backupId=A(null);isSubmitting=A(!1);finishedLoading=A(!1);backupDefaults=A(null);isNew=K(()=>this.backupId()==="new");selectedOptions=A([]);selectedAdvancedFormPair=A([]);destinationFormPair=A({oauthField:null,custom:[],dynamic:[],advanced:[]});notSelectedAdvancedFormPair=K(()=>{let n=this.destinationFormPair()?.advanced??[],t=this.selectedAdvancedFormPair()??[];return n.filter(o=>t.findIndex(i=>i.name===o.name)===-1)});selectedHttpOptions=A([]);notSelectedHttpOptions=K(()=>{let n=this.httpOptions(),t=this.selectedHttpOptions()??[];return n.filter(o=>t.findIndex(i=>i.name===o.name)===-1)});sourceDataFormSignal=Q(this.sourceDataForm.valueChanges);destinationFormSignal=Q(this.destinationForm.valueChanges);generalFormSignal=Q(this.generalForm.valueChanges);encryptionFieldSignal=Q(this.generalForm.controls.encryption.valueChanges);scheduleFormSignal=Q(this.scheduleForm.valueChanges);destinationOptions=K(()=>this.#t.backendModules()??[]);httpOptions=K(()=>this.#t.systemInfo()?.GenericModules?.find(n=>n.Key==="http-options")?.Options?.map(this.#n)??[]);advancedOptions=K(()=>this.#t.systemInfo()?.Options?.map(this.#n)??[]);#n(n){return{name:n.Name,type:n.Type,shortDescription:n.ShortDescription??void 0,longDescription:n.LongDescription??void 0,options:n.ValidValues}}encryptionOptions=K(()=>{let n=this.#t.systemInfo()?.EncryptionModules??[];return[Ot,...n]});nonSelectedOptions=K(()=>this.advancedOptions().sort((n,t)=>n?.name&&t?.name?n?.name.localeCompare(t?.name):0).filter(n=>this.selectedOptions()?.findIndex(t=>t.name===n.name)===-1));addAdvancedFormPairByName(n,t,o){let i=this.notSelectedAdvancedFormPair().find(l=>l.name===n);i&&this.addAdvancedFormPair(i,t,o)}addHttpOptionByName(n,t,o){let i=this.notSelectedHttpOptions().find(l=>l.name===n);i&&this.addHttpOption(i,t,o)}addAdvancedFormPair(n,t,o){let i=this.destinationForm.controls.destinations.controls.at(t)?.controls.advanced,l=o??n.defaultValue;this.createFormField(i,n,l),this.selectedAdvancedFormPair.set([...this.selectedAdvancedFormPair(),n])}addHttpOption(n,t,o){let i=this.destinationForm.controls.destinations.controls.at(t)?.controls.advanced,l=o??n.defaultValue;this.createFormField(i,n,l),this.selectedHttpOptions.set([...this.selectedHttpOptions(),n])}removeAdvancedFormPair(n,t){this.destinationForm.controls.destinations.controls.at(t)?.controls.advanced.removeControl(n.name),this.selectedAdvancedFormPair().findIndex(i=>i.name===n.name)!==-1?this.selectedAdvancedFormPair.update(i=>(i=i.filter(l=>l.name!==n.name),i)):this.selectedHttpOptions.update(i=>(i=i.filter(l=>l.name!==n.name),i))}removeHttpOption(n,t){this.destinationForm.controls.destinations.controls.at(t)?.controls.advanced.removeControl(n.name),this.selectedHttpOptions.update(o=>(o=o.filter(i=>i.name!==n.name),o))}submit(){this.isSubmitting.set(!0);let n=this.#l(),t=this.backupId();t==="new"||!t||this.isDraft()?this.#o.postApiV1Backups({requestBody:n}).pipe(et(()=>this.isSubmitting.set(!1))).subscribe({next:o=>{console.log("submitted res",o),this.exit()},error:o=>{console.error("submitted error",o)}}):this.#o.putApiV1BackupById({id:t,requestBody:n}).pipe(et(()=>this.isSubmitting.set(!1))).subscribe({next:o=>{console.log("submitted res",o),this.exit()},error:o=>{console.error("submitted error",o)}})}exit(){this.#c(),this.#e.navigate(["/"])}updateFieldsFromTargetUrl(n){this.#r(),setTimeout(()=>{this.#s(n)})}#r(){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 t=n.Sources??"",o=n.Filters?.map(y=>`${y.Include?"":"-"}${y.Expression}`)??[],i=n.Settings?.find(y=>y.Name==="--exclude-files-attributes")?.Value??"",l=n.Settings?.find(y=>y.Name==="--skip-files-larger-than")??null,u=l?.Value.replace(/[0-9]/g,"")??null,N=l?.Value.replace(/[^0-9]/g,"")??null,w={path:[...t,...o].join("\0"),excludes:{hiddenFiles:i.includes("hidden"),systemFiles:i.includes("system"),tempFiles:i.includes("temporary"),filesLargerThan:u&&N?{size:parseInt(N),unit:u.toUpperCase()}:null}};this.sourceDataForm.patchValue(w)}mapDestinationToForm(n){let t=n.TargetURL?Nt(n.TargetURL):null;t&&this.addDestinationFormGroup(t.destinationType,{custom:t.custom,dynamic:t.dynamic,advanced:t.advanced},!0)}#s(n){let t=Nt(n);t&&this.addDestinationFormGroup(t.destinationType,{custom:t.custom,dynamic:t.dynamic,advanced:t.advanced},!0)}mapGeneralToForm(n){let t=n.Settings?.find(l=>l.Name==="encryption-module"),o=t?.Value&&t.Value.length?t.Value:"",i={name:n.Name??"",description:n.Description??""};o&&o!==""&&(i.encryption=o),this.generalForm.patchValue(i)}mapScheduleToForm(n){if(!n){this.scheduleForm.patchValue({autoRun:!0});return}let t=this.#i.fromString(n.Repeat)??null,i={nextTime:this.#p(n.Time),runAgain:{repeatValue:t?.value??1,repeatUnit:t?.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}}};this.scheduleForm.patchValue(i)}mapOptionsToForms(n){let t=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than"],o=this.advancedOptions();n.Settings?.forEach(i=>{if(i.Name==="encryption-module")return this.generalForm.controls.encryption.setValue(i.Value??"");if(!(i.Name&&t.includes(i.Name))){if(i.Name==="dblock-size"){let l=i.Value?.replace(/[^0-9]/g,""),u=i.Value?.replace(/[0-9]/g,"");return this.optionsForm.controls.remoteVolumeSize.setValue({size:l?parseInt(l):null,unit:u?u.toUpperCase():null})}if(i.Name&&i.Value){let l=o.find(u=>u.name===i.Name);if(!l)return;this.addOptionToFormGroup(l,i.Value)}}})}getCurrentTargetUrl(){return this.#a(this.destinationForm.controls.destinations)}#l(){let n=this.generalForm.value,t=this.optionsForm.value,o=this.scheduleForm.value,i=this.sourceDataForm.value,u=this.destinationForm.value.destinations?.length?this.#a(this.destinationForm.controls.destinations):[],N=null;o.runAgain?.repeatUnit&&o.runAgain?.repeatValue&&(N=this.#i.toString(o.runAgain.repeatValue,o.runAgain.repeatUnit));let w=o.runAgain?.allowedDays?Object.entries(o.runAgain?.allowedDays).filter(([d,C])=>C).map(([d,C])=>d):[],y=i.path?.split("\0")??[],Z=n.encryption===""?{Name:"--no-encryption",Value:"True"}:{Name:"encryption-module",Value:n.encryption??null},J=this.advancedOptions(),L=Object.entries(t.advancedOptions??{}).filter(([d,C])=>d&&C).map(([d,C])=>{let G=J.find(x=>x.name===d);return G?.type==="Size"?{Name:d,Value:`${C.size}${C.unit.toLowerCase()}`}:G?.type==="Integer"?{Name:d,Value:C.toString()}:G?.type==="Boolean"?{Name:d,Value:C.toString()}:{Name:d,Value:C}}),ee=[Z,...L],te=Object.entries(i.excludes??{}).filter(([d,C])=>C&&d!=="filesLargerThan").map(([d])=>d),H=i.excludes?.filesLargerThan;return te.length&&ee.push({Name:"--exclude-files-attributes",Value:te.join(",")}),H&&H.size!==null&&H.unit!==null&&ee.push({Name:"--skip-files-larger-than",Value:`${H.size}${H.unit}`}),{Backup:{Name:n.name,Description:n.description,TargetURL:u[0]??null,Sources:y.filter(d=>!d.startsWith("-")),Settings:ee,Filters:y.filter(d=>d.startsWith("-")).map((d,C)=>({Order:C,Include:!1,Expression:d.slice(1)}))},Schedule:o.autoRun?{Repeat:N,Time:o.nextTime?.date?new Date(`${o.nextTime.date}T${o.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:w}:null}}#a(n){return n.controls.map(t=>St(t.value))}#p(n){if(!n||n?.indexOf("T")===-1)return{time:n??"13:00"};let t=new Date(n),o={time:`${(""+t.getHours()).padStart(2,"0")}:${(""+t.getMinutes()).padStart(2,"0")}`};return n.indexOf("T")!==-1&&(o.date=t.toISOString().split("T")[0]),o}removeOptionFromFormGroup(n){let t=n.name;t&&(this.optionsForm.controls.advancedOptions.removeControl(t),this.selectedOptions.update(o=>(o=o.filter(i=>i.name!==t),o)))}addOptionToFormGroup(n,t){let o=this.optionsForm.controls.advancedOptions;this.createFormField(o,n,t??n.defaultValue),this.selectedOptions.update(i=>(i.push(n),i))}createFormField(n,t,o){if(t.type==="String"||t.type==="FileTree"||t.type==="FolderTree"||t.type==="Password"||t.type==="Enumeration"||t.type==="NonValidatedSelectableString"||t.type==="Path"){n.addControl(t.name,Fe.control(o));return}if(t.type==="Size"){let i=o.replace(/[0-9]/g,""),l=o.replace(/[^0-9]/g,"");n.addControl(t.name,Fe.group({size:Fe.control(l?parseInt(l):50),unit:Fe.control(i?i.toUpperCase():"MB")}));return}if(t.type==="Integer"){n.addControl(t.name,Fe.control(o?parseInt(o):0));return}if(t.type==="Boolean"){n.addControl(t.name,Fe.control(o==="true"));return}if(t.type==="Flags"){n.addControl(t.name,Fe.control(o??""));return}if(t.type==="Timespan"){n.addControl(t.name,Fe.control(o,[Ee.pattern(/([-+]?\d{1,3}[smhDWMY])+/)]));return}}addDestinationFormGroup(n,t,o=!1){let i=Ke.find(d=>d.customKey===n||d.key===n),l=i?.key,u=this.destinationOptions().find(d=>d.Key===l),N=this.httpOptions();if(!u||!u.Options)return;let w=i&&i.oauthField?i.oauthField:null,y=i&&i.customFields?i.customFields:{},Z=i&&i.dynamicFields?i.dynamicFields:[],J=i&&i.advancedFields?i.advancedFields:[],L=i&&i.ignoredAdvancedFields?i.ignoredAdvancedFields:[];this.destinationFormPair.set({oauthField:w,custom:[],dynamic:[],advanced:[]});let ee=Fe.group({}),te=Fe.group({}),H=Fe.group({});y&&Object.entries(y).forEach(([d,C],G)=>{let ge=C,{formElement:x}=ge,ie=Mt(ge,["formElement"]);ee.addControl(d,x(t?.custom[d])),this.destinationFormPair.update(de=>(de.custom.push(P({order:900+G},ie)),de))});for(let d=0;d<u.Options.length;d++){let C=u.Options[d];if(C.Deprecated)continue;let G=Z.find(x=>x===C.Name||x.name===C.Name);if(G){let x=G&&typeof G!="string",ie=x?G?.defaultValue??C.DefaultValue:C.DefaultValue,ge={name:C.Name,type:C.Type,shortDescription:C.ShortDescription??void 0,longDescription:C.LongDescription??void 0,options:C.ValidValues,order:900+d},de=x?P(P({},ge),G):ge,at=t?.dynamic[C.Name]??ie??C.DefaultValue;this.createFormField(te,de,at),this.destinationFormPair.update(je=>(je.dynamic.push(de),je))}else{if(L.find(Ce=>Ce===C.Name))continue;let ie=J.find(Ce=>Ce===C.Name||Ce.name===C.Name),ge=ie&&typeof ie!="string",de=t?.advanced[C.Name],U=de??C.DefaultValue,at={name:C.Name,type:C.Type,shortDescription:C.ShortDescription??void 0,longDescription:C.LongDescription??void 0,options:C.ValidValues,defaultValue:U,order:900+d},je=ge?P(P({},at),ie):at;o&&de&&(this.createFormField(H,je,U),this.selectedAdvancedFormPair.update(Ce=>(Ce.push(je),Ce))),this.destinationFormPair.update(Ce=>(Ce.advanced.push(je),Ce))}}for(let d=0;d<N.length;d++){let C=N[d],G=t?.advanced[C.name],x=G??C.defaultValue;o&&G&&(this.createFormField(H,C,x),this.selectedHttpOptions.update(ie=>(ie.push(C),ie)))}this.destinationFormPair.update(d=>({oauthField:d.oauthField,custom:d.custom.sort((C,G)=>C.order-G.order),dynamic:d.dynamic.sort((C,G)=>C.order-G.order),advanced:d.advanced.sort((C,G)=>C.order-G.order)})),this.destinationForm.controls.destinations.push(tn({key:i?.customKey??n,customGroup:ee,dynamicGroup:te,advancedGroup:H}))}#c(){this.generalForm.reset(),this.destinationForm.controls.destinations.clear(),this.destinationForm.reset(),this.sourceDataForm.reset(),this.scheduleForm.reset(),this.optionsForm.reset()}static \u0275fac=function(t){return new(t||e)};static \u0275prov=we({token:e,factory:e.\u0275fac,providedIn:"root"})};var Do=["formRef"],Eo=(e,n,t,o)=>({index:e,formView:n,formGroupName:"custom",destinationType:t,oauthField:o}),Et=e=>({$implicit:e}),yo=(e,n,t,o)=>({index:e,formView:n,formGroupName:"dynamic",destinationType:t,oauthField:o}),Po=(e,n,t,o)=>({index:e,formView:n,formGroupName:"advanced",destinationType:t,oauthField:o}),No=(e,n,t,o)=>({index:e,formView:n,formGroupName:"advanced",asHttpOptions:!0,destinationType:t,oauthField:o}),Ao=()=>({maxWidth:"700px",width:"100%"});function Oo(e,n){e&1&&(h(0,2,2),_(1,"spk-icon"),D())}function ko(e,n){e&1&&k(0,2,3)}function xo(e,n){if(e&1){let t=O();h(0,2,1),a(1,"button",19),f("click",function(){S(t);let i=p();return T(i.testDestination())}),F(2,Oo,2,0)(3,ko,1,0),r(),D()}if(e&2){let t=p();s(),$e("success",t.successfulTest()),s(),g(t.successfulTest()?2:3)}}function $o(e,n){if(e&1){let t=O();a(0,"p",25),f("click",function(){S(t);let i=p();return T(i.removeDestinationFormGroup(i.destinationCount()-1))}),h(1,5),_(2,"span",26),D(),r()}}function Io(e,n){e&1&&(a(0,"p"),k(1,6),r())}function Mo(e,n){if(e&1){let t=O();a(0,"div",31),f("click",function(){let i=S(t).$implicit,l=p(2);return T(l.addDestinationFormGroup(i.key))}),a(1,"h3"),m(2),r(),a(3,"p"),m(4),r()()}if(e&2){let t=n.$implicit;s(2),B(t.displayName),s(2),B(t.description)}}function vo(e,n){if(e&1){let t=O();a(0,"button",32),f("click",function(){let i=S(t).$implicit,l=p(2);return T(l.addDestinationFormGroup(i.key))}),m(1),r()}if(e&2){let t=n.$implicit;s(),V(" ",t.displayName," ")}}function wo(e,n){if(e&1&&(a(0,"div",27),M(1,Mo,5,2,"div",28,I),r(),a(3,"spk-menu")(4,"button",29),k(5,7),r(),j(6,18),M(7,vo,2,1,"button",30,I),W(),r()),e&2){let t=p();s(),v(t.destinationTypeOptionsFocused()),s(6),v(t.destinationTypeOptionsNotFocused())}}function Ro(e,n){e&1&&ze(0)}function bo(e,n){if(e&1&&F(0,Ro,1,0,"ng-container",37),e&2){let t,o=n.$implicit,i=n.$index;p();let l=he(29),u=p();c("ngTemplateOutlet",l)("ngTemplateOutletContext",Xe(7,Et,it(2,Eo,i,o,(t=u.destinationFormSignal())==null||t.destinations==null||t.destinations[0]==null?null:t.destinations[0].destinationType,u.destinationFormPair().oauthField)))}}function Go(e,n){e&1&&ze(0)}function Vo(e,n){if(e&1&&F(0,Go,1,0,"ng-container",37),e&2){let t,o=n.$implicit,i=n.$index;p();let l=he(29),u=p();c("ngTemplateOutlet",l)("ngTemplateOutletContext",Xe(7,Et,it(2,yo,i,o,(t=u.destinationFormSignal())==null||t.destinations==null||t.destinations[0]==null?null:t.destinations[0].destinationType,u.destinationFormPair().oauthField)))}}function Lo(e,n){if(e&1){let t=O();h(0,8,1),a(1,"button",32),f("click",function(){let i=S(t).$implicit,l=p(2);return T(l.addAdvancedFormPair(i,0))}),r(),D()}if(e&2){let t=n.$implicit;s(),nt(t.name),ot(0)}}function Uo(e,n){e&1&&ze(0)}function Bo(e,n){if(e&1&&F(0,Uo,1,0,"ng-container",37),e&2){let t,o=n.$implicit,i=n.$index;p();let l=he(29),u=p();c("ngTemplateOutlet",l)("ngTemplateOutletContext",Xe(7,Et,it(2,Po,i,o,(t=u.destinationFormSignal())==null||t.destinations==null||t.destinations[0]==null?null:t.destinations[0].destinationType,u.destinationFormPair().oauthField)))}}function Ko(e,n){if(e&1){let t=O();h(0,9,1),a(1,"button",32),f("click",function(){let i=S(t).$implicit,l=p(2);return T(l.addHttpOption(i,0))}),r(),D()}if(e&2){let t=n.$implicit;s(),nt(t.name),ot(0)}}function zo(e,n){e&1&&ze(0)}function Xo(e,n){if(e&1&&F(0,zo,1,0,"ng-container",37),e&2){let t,o=n.$implicit,i=n.$index;p();let l=he(29),u=p();c("ngTemplateOutlet",l)("ngTemplateOutletContext",Xe(7,Et,it(2,No,i,o,(t=u.destinationFormSignal())==null||t.destinations==null||t.destinations[0]==null?null:t.destinations[0].destinationType,u.destinationFormPair().oauthField)))}}function Ho(e,n){if(e&1&&(a(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function jo(e,n){if(e&1&&(a(0,"app-file-tree",40)(1,"label",47),m(2),F(3,Ho,3,1,"spk-tooltip",48),r(),_(4,"input",49),r()),e&2){let t,o=p().$implicit,i=p(2);c("startingPath",i.getFormFieldValue(0,o.formGroupName,o.formView.name))("accepts",o.formView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),s(),z("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),z("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),X("formControlName",o.formView.name)}}function Wo(e,n){if(e&1&&(a(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function qo(e,n){if(e&1&&(a(0,"app-file-tree",41)(1,"label",47),m(2),F(3,Wo,3,1,"spk-tooltip",48),r(),_(4,"input",49),r()),e&2){let t,o=p().$implicit,i=p(2);c("startingPath",i.getFormFieldValue(0,o.formGroupName,o.formView.name)),s(),z("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),z("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),X("formControlName",o.formView.name)}}function Qo(e,n){if(e&1&&(a(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function Yo(e,n){e&1&&(a(0,"spk-icon",51),m(1,"link"),r())}function Zo(e,n){e&1&&(a(0,"spk-icon",51),m(1,"envelope"),r())}function Jo(e,n){e&1&&(a(0,"spk-icon",51),m(1,"textbox"),r())}function ei(e,n){if(e&1&&(a(0,"spk-form-field")(1,"label",47),m(2),F(3,Qo,3,1,"spk-tooltip",48),r(),_(4,"input",50),F(5,Yo,2,0,"spk-icon",51)(6,Zo,2,0,"spk-icon",51)(7,Jo,2,0,"spk-icon",51),r()),e&2){let t,o=p().$implicit;s(),z("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),z("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),X("formControlName",o.formView.name),c("type",o.formView.type==="Email"?"email":"text"),s(),g(o.formView.type==="Path"?5:o.formView.type==="Email"?6:7)}}function ti(e,n){if(e&1){let t=O();a(0,"span",55),f("click",function(){S(t);let i=p(2).$implicit,l=p(2);return T(l.oauthStartTokenCreation(i.destinationType))}),m(1,"AuthID"),r()}}function ni(e,n){e&1&&(a(0,"spk-icon",51),m(1,"password"),r())}function oi(e,n){if(e&1){let t=O();a(0,"spk-icon",56),f("click",function(){S(t);let i=p(2).$implicit;return T(i.formView.showPassword=!i.formView.showPassword)}),m(1," eye "),r()}}function ii(e,n){if(e&1){let t=O();a(0,"spk-icon",56),f("click",function(){S(t);let i=p(2).$implicit;return T(i.formView.showPassword=!i.formView.showPassword)}),m(1," eye-slash "),r()}}function ri(e,n){if(e&1&&(a(0,"spk-form-field")(1,"label",47),m(2),r(),_(3,"input",52),F(4,ti,2,0,"span",53)(5,ni,2,0,"spk-icon",51)(6,oi,2,0,"spk-icon",54)(7,ii,2,0,"spk-icon",54),r()),e&2){let t,o=p().$implicit;s(),z("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),z("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),X("formControlName",o.formView.name),c("type",o.formView.showPassword?"text":"password"),s(),g(o.oauthField===o.formView.name?4:5),s(2),g(o.formView.showPassword?6:7)}}function ai(e,n){if(e&1&&(a(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function si(e,n){if(e&1&&(a(0,"spk-option",57),m(1),r()),e&2){let t=n.$implicit;c("value",t.value),s(),yt(" ",t.key," ",t.value?"("+t.value+")":""," ")}}function li(e,n){if(e&1&&M(0,si,2,3,"spk-option",57,I),e&2){let t=p(2).$implicit,o=p(2);v(t.formView.loadOptions(o.injector)())}}function pi(e,n){if(e&1&&(a(0,"spk-option",57),m(1),r()),e&2){let t=n.$implicit;c("value",t),s(),B(t)}}function ci(e,n){if(e&1&&M(0,pi,2,2,"spk-option",57,I),e&2){let t=p(2).$implicit;v(t.formView.options)}}function mi(e,n){if(e&1&&(a(0,"spk-select",42)(1,"label",47),m(2),F(3,ai,3,1,"spk-tooltip",48),r(),_(4,"input",49),F(5,li,2,0)(6,ci,2,0),r()),e&2){let t,o=p().$implicit;c("hideClearButton",!0),s(),z("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),z("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),X("formControlName",o.formView.name),s(),g(o.formView.loadOptions?5:-1),s(),g(o.formView.options?6:-1)}}function _i(e,n){if(e&1&&(a(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function ui(e,n){if(e&1&&(a(0,"spk-option",57),m(1),r()),e&2){let t=n.$implicit;c("value",t.value),s(),yt(" ",t.key," ",t.value?"("+t.value+")":""," ")}}function di(e,n){if(e&1&&M(0,ui,2,3,"spk-option",57,I),e&2){let t=p(2).$implicit,o=p(2);v(t.formView.loadOptions(o.injector)())}}function Fi(e,n){if(e&1&&(a(0,"spk-option",57),m(1),r()),e&2){let t=n.$implicit;c("value",t),s(),B(t)}}function gi(e,n){if(e&1&&M(0,Fi,2,2,"spk-option",57,I),e&2){let t=p(2).$implicit;v(t.formView.options)}}function Ci(e,n){if(e&1&&(a(0,"spk-select",43)(1,"label",47),m(2),F(3,_i,3,1,"spk-tooltip",48),r(),_(4,"input",58),F(5,di,2,0)(6,gi,2,0),r()),e&2){let t,o=p().$implicit;c("isFreeText",!0),s(),z("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),z("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),X("formControlName",o.formView.name),s(),g(o.formView.loadOptions?5:-1),s(),g(o.formView.options?6:-1)}}function fi(e,n){if(e&1&&(a(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function Si(e,n){if(e&1&&(a(0,"spk-option",57),m(1),r()),e&2){let t=n.$implicit;c("value",t),s(),B(t)}}function Ti(e,n){if(e&1&&(a(0,"div",44)(1,"label",47),m(2),F(3,fi,3,1,"spk-tooltip",48),r(),a(4,"div",59)(5,"spk-form-field"),_(6,"input",60),a(7,"spk-icon",51),m(8,"resize"),r()(),a(9,"spk-select"),_(10,"label")(11,"input",61),M(12,Si,2,2,"spk-option",57,I),r()()()),e&2){let t,o=p().$implicit,i=p(2);c("formGroupName",o.formView.name),s(),z("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(3),z("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),s(6),v(i.sizeOptions())}}function hi(e,n){if(e&1&&(a(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function Di(e,n){if(e&1&&(a(0,"spk-form-field")(1,"label",47),m(2),F(3,hi,3,1,"spk-tooltip",48),r(),_(4,"input",62),a(5,"spk-icon",51),m(6,"numpad"),r()()),e&2){let t,o=p().$implicit;s(),z("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),z("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),X("formControlName",o.formView.name)}}function Ei(e,n){if(e&1&&(a(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function yi(e,n){if(e&1&&(a(0,"spk-toggle",45)(1,"label",47),m(2),F(3,Ei,3,1,"spk-tooltip",48),r(),_(4,"input",63),r()),e&2){let t,o=p().$implicit;s(),z("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),z("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),X("formControlName",o.formView.name)}}function Pi(e,n){if(e&1&&(a(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function Ni(e,n){e&1&&(a(0,"spk-option",65),m(1,"None"),r()),e&2&&c("value","None")}function Ai(e,n){if(e&1&&(a(0,"spk-option",57),m(1),_(2,"spk-checkbox",66),r()),e&2){let t=p().$implicit;c("value",t),s(),V(" ",t," ")}}function Oi(e,n){if(e&1&&F(0,Ni,2,1,"spk-option",65)(1,Ai,3,2,"spk-option",57),e&2){let t=n.$implicit;g(t==="None"?0:1)}}function ki(e,n){if(e&1&&(a(0,"spk-select",46)(1,"label",47),m(2),F(3,Pi,3,1,"spk-tooltip",48),r(),_(4,"input",64),M(5,Oi,2,1,null,null,I),r()),e&2){let t,o=p().$implicit;c("selectMultiple",!0),s(),z("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),X("formControlName",o.formView.name),s(),v(o.formView.options)}}function xi(e,n){if(e&1&&(a(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function $i(e,n){if(e&1&&(a(0,"spk-form-field")(1,"label",47),m(2),F(3,xi,3,1,"spk-tooltip",48),r(),_(4,"input",49),r()),e&2){let t,o=p().$implicit;s(),z("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),z("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),X("formControlName",o.formView.name)}}function Ii(e,n){if(e&1){let t=O();a(0,"button",67),f("click",function(){S(t);let i=p().$implicit,l=p(2);return T(l.removeFormView(i.formView,0))}),a(1,"spk-icon"),m(2,"x-circle"),r()()}}function Mi(e,n){if(e&1&&(a(0,"div",38),j(1,39),F(2,jo,5,16,"app-file-tree",40)(3,qo,5,12,"app-file-tree",41)(4,ei,8,13,"spk-form-field")(5,ri,8,13,"spk-form-field")(6,mi,7,14,"spk-select",42)(7,Ci,7,14,"spk-select",43)(8,Ti,14,11,"div",44)(9,Di,7,11,"spk-form-field")(10,yi,5,11,"spk-toggle",45)(11,ki,7,8,"spk-select",46)(12,$i,5,11,"spk-form-field"),W(),F(13,Ii,3,0,"button",29),r()),e&2){let t=n.$implicit;$e("single-field",t.formGroupName!=="advanced"),s(),c("formGroupName",t.formGroupName),s(),g(t.formView.type==="FileTree"?2:t.formView.type==="FolderTree"?3:t.formView.type==="String"||t.formView.type==="Path"||t.formView.type==="Email"?4:t.formView.type==="Password"?5:t.formView.type==="Enumeration"?6:t.formView.type==="NonValidatedSelectableString"?7:t.formView.type==="Size"?8:t.formView.type==="Integer"?9:t.formView.type==="Boolean"?10:t.formView.type==="Flags"?11:t.formView.type==="Timespan"?12:-1),s(11),g(t.formGroupName==="advanced"?13:-1)}}function vi(e,n){if(e&1&&(j(0,20)(1,33),M(2,bo,1,9,"ng-container",null,I),M(4,Vo,1,9,"ng-container",null,I),a(6,"app-toggle-card",34),j(7,35),h(8,8),a(9,"spk-menu")(10,"button",36),_(11,"spk-icon"),r(),j(12,18),M(13,Lo,2,1,"button",30,I),W(),r(),D(),W(),M(15,Bo,1,9,"ng-container",null,I),r(),a(17,"app-toggle-card",34),j(18,35),h(19,9),a(20,"spk-menu")(21,"button",36),_(22,"spk-icon"),r(),j(23,18),M(24,Ko,2,1,"button",30,I),W(),r(),D(),W(),M(26,Xo,1,9,"ng-container",null,I),r(),F(28,Mi,14,5,"ng-template",null,1,lt),W()()),e&2){let t=p();s(2),v(t.destinationFormPair().custom),s(2),v(t.destinationFormPair().dynamic),s(2),c("disallowToggle",!0),s(4),c("disabled",t.notSelectedAdvancedFormPair().length===0),s(3),v(t.notSelectedAdvancedFormPair()),s(2),v(t.selectedAdvancedFormPair()),s(2),c("disallowToggle",!0),s(4),c("disabled",t.notSelectedHttpOptions().length===0),s(3),v(t.notSelectedHttpOptions()),s(2),v(t.selectedHttpOptions())}}function wi(e,n){if(e&1){let t=O();a(0,"spk-dialog",68),bt("isOpenChange",function(i){S(t);let l=p();return Rt(l.targetUrlDialogOpen,i)||(l.targetUrlDialogOpen=i),T(i)}),a(1,"header",69)(2,"h2"),k(3,10),r(),a(4,"spk-alert",70),k(5,11),r()(),a(6,"div",71)(7,"spk-form-field"),_(8,"textarea",72),r()(),a(9,"footer",73)(10,"button",22),f("click",function(){S(t);let i=p();return T(i.closeTargetUrlDialog(!1))}),m(11,"Cancel"),r(),a(12,"button",74),f("click",function(){S(t);let i=p();return T(i.closeTargetUrlDialog(!0))}),h(13,12),_(14,"spk-icon"),D(),r()()()}if(e&2){let t=p();wt("isOpen",t.targetUrlDialogOpen),c("options",Gt(3,Ao)),s(8),c("formControl",t.targetUrlCtrl)}}var Ri=["Bytes","KB","MB","GB","TB","PB"],Dt=new oe,en=(e={destinations:[]})=>Dt.group({destinations:Dt.array(e.destinations)}),tn=({key:e,customGroup:n,dynamicGroup:t,advancedGroup:o})=>Dt.group({destinationType:Dt.control(e),custom:n,dynamic:t,advanced:o}),It=class e{#e=$(re);#t=$(De);#o=$(Lt);#i=$(We);#n=$(ue);#r=$(zt);injector=$(vt);formRef=fe.required("formRef");destinationForm=this.#n.destinationForm;destinationFormPair=this.#n.destinationFormPair;selectedAdvancedFormPair=this.#n.selectedAdvancedFormPair;notSelectedAdvancedFormPair=this.#n.notSelectedAdvancedFormPair;selectedHttpOptions=this.#n.selectedHttpOptions;notSelectedHttpOptions=this.#n.notSelectedHttpOptions;destinationOptions=this.#n.destinationOptions;destinationFormSignal=this.#n.destinationFormSignal;destinationCount=K(()=>this.destinationFormSignal()?.destinations?.length??0);sizeOptions=A(Ri);successfulTest=A(!1);destinationTypeOptionsInFocus=A(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=A(Ke.map(n=>({key:n.customKey??n.key,customKey:n.customKey??null,displayName:n.displayName,description:n.description})));destinationTypeOptionsFocused=K(()=>{let n=this.destinationTypeOptionsInFocus(),t=this.destinationTypeOptions();return n.map(o=>t.find(i=>i.key===o))});destinationTypeOptionsNotFocused=K(()=>{let n=this.destinationTypeOptionsInFocus();return this.destinationTypeOptions().filter(o=>!n.includes(o.key))});getFormFieldValue(n,t,o){return((this.destinationForm.controls.destinations.controls?.[n]).controls?.[t]).controls[o].value}addDestinationFormGroup(n){this.#n.addDestinationFormGroup(n)}addAdvancedFormPair(n,t){this.#n.addAdvancedFormPair(n,t)}removeFormView(n,t){this.#n.removeAdvancedFormPair(n,t)}addHttpOption(n,t){this.#n.addHttpOption(n,t)}targetUrl=K(()=>this.#n.getCurrentTargetUrl()[0]);targetUrlCtrl=new _t;targetUrlInitial=A(null);targetUrlDialogOpen=A(!1);openTargetUrlDialog(){let t=this.#n.getCurrentTargetUrl()[0];this.targetUrlCtrl.setValue(t),this.targetUrlInitial.set(t),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl.value,o=this.targetUrlInitial();!n||t===o||this.#n.updateFieldsFromTargetUrl(this.targetUrlCtrl.value)}testDestination(n=0){let o=this.#n.getCurrentTargetUrl()[n];o&&this.#i.postApiV1RemoteoperationTest({requestBody:{path:o}}).subscribe({next:()=>{this.successfulTest.set(!0),setTimeout(()=>{this.successfulTest.set(!1)},3e3)},error:i=>{let l=i.error.error.Error;if(l==="missing-folder"&&this.#r.open(He,{data:{title:$localize`Create folder`,message:$localize`The remote destination folder does not exist, do you want to create it?`},closed:u=>{u&&this.#i.postApiV1RemoteoperationCreate({requestBody:{path:o}}).subscribe()}}),l.startsWith("incorrect-cert:")){let u=l.split("incorrect-cert:")[1];this.#r.open(He,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
|
|
1
|
+
import{a as Qe}from"./chunk-VGGIIK26.js";import{a as Ue}from"./chunk-K5R45UNO.js";import{a as Pt,b as Ht}from"./chunk-DNHLTHLR.js";import{a as mt}from"./chunk-OAL3AILX.js";import{b as Q}from"./chunk-5522ZDTF.js";import{a as Re,b as ae,c as Ee,d as se,e as ye,f as _t,g as Ut,h as Pe,i as be,k as ut,l as Ne,m as Ge,n as Bt,o as Ae,p as oe,q as dt,r as Oe}from"./chunk-NN3K5WJK.js";import{a as le,b as Ft,d as Kt,e as zt,g as Ve,i as gt,l as pe,n as Ct,o as Xt,q as ce,r as me,w as Le,x as qe}from"./chunk-IBZEQWFY.js";import{a as We}from"./chunk-UUC5AIWR.js";import{H as De,X as re}from"./chunk-7WQR24NO.js";import{c as Lt}from"./chunk-JQGZUGRK.js";import{ia as ct}from"./chunk-65UFWL3O.js";import{$b as q,Ab as g,Bb as I,Cb as M,Db as v,E as et,Eb as a,Fb as r,Gb as _,Hb as j,Ib as W,Jb as ze,Kb as O,Kc as K,Mc as pt,Qb as h,R as we,Ra as s,Rb as D,Sb as k,Tb as nt,Ub as ot,Vb as Ie,Wb as f,X as $,Xb as p,Za as A,_a as fe,_b as X,ac as z,ea as S,fa as T,fb as ne,fc as Se,gc as Te,hc as he,ic as m,ja as vt,jc as B,kc as V,lb as F,lc as yt,mc as wt,nc as Rt,oc as bt,p as Je,qa as tt,ra as st,rc as Gt,sc as Xe,tc as Vt,uc as it,vb as c,xb as $e,yc as lt}from"./chunk-UYXZTHXX.js";import{a as P,c as Mt}from"./chunk-C6Q5SG76.js";function nn(e,n){if(e&1&&(a(0,"p"),m(1),r()),e&2){let t=p();s(),B(t._data().message)}}var on={title:$localize`Are you sure?`,confirmText:$localize`Confirm`,cancelText:$localize`Cancel`},He=class e{data=st();_data=K(()=>P(P({},on),this.data()));closed=tt();close(n="confirm"){this.closed.emit(n==="confirm")}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=ne({type:e,selectors:[["app-confirm-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:10,vars:4,consts:[["header",""],["content",""],["footer",""],["spk-button","",1,"",3,"click"],["spk-button","",1,"raised","primary",3,"click"]],template:function(t,o){t&1&&(a(0,"header",0)(1,"h3"),m(2),r()(),a(3,"div",1),F(4,nn,2,1,"p"),r(),a(5,"footer",2)(6,"button",3),f("click",function(){return o.close("cancel")}),m(7),r(),a(8,"button",4),f("click",function(){return o.close("confirm")}),m(9),r()()),t&2&&(s(2),B(o._data().title),s(2),g(o._data().message?4:-1),s(3),B(o._data().cancelText),s(2),B(o._data().confirmText))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};var ft=class e{fromString(n){if(!n)return null;let t=n.match(/(\d+)([smhDWMY])/);return t&&{value:parseInt(t[1]),unit:t[2]}}toString(n,t){return`${n}${t}`}static \u0275fac=function(t){return new(t||e)};static \u0275prov=we({token:e,factory:e.\u0275fac,providedIn:"root"})};var xe=class e{#e=$(We);s3Providers=Q(this.getS3Config("Providers"));s3Regions=Q(this.getS3Config("Regions"));s3RegionHosts=Q(this.getS3Config("RegionHosts"));s3StorageClasses=Q(this.getS3Config("StorageClasses"));storjSatellites=Q(this.getStorjConfig("Satellites"));storjAuthenticationMethods=Q(this.getStorjConfig("AuthenticationMethods"));openstackProviders=Q(this.getOpenstackConfig("Providers"));openstackVersions=Q(this.getOpenstackConfig("Versions"));gcsLocations=Q(this.getGcsConfig("Locations"));gcsStorageClasses=Q(this.getGcsConfig("StorageClasses"));getS3Config(n){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-getconfig",requestBody:{"s3-config":n}}).pipe(Je(t=>this.#t(t)))}createS3IamUser(n,t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"CanCreateUser","s3-username":n,"s3-password":t}})}createS3PolicyIAM(n){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"GetPolicyDoc",path:n}})}getStorjConfig(n){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"storj-getconfig",requestBody:{"storj-config":n}}).pipe(Je(t=>this.#t(t)))}getOpenstackConfig(n){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"openstack-getconfig",requestBody:{"openstack-config":n}}).pipe(Je(t=>this.#t(t)))}getGcsConfig(n){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"gcs-getconfig",requestBody:{"gcs-config":n}}).pipe(Je(t=>this.#t(t)))}#t(n){return(n.Result&&typeof n.Result=="object"&&Object.entries(n.Result).map(([t,o])=>({key:t,value:o})))??[]}static \u0275fac=function(t){return new(t||e)};static \u0275prov=we({token:e,factory:e.\u0275fac,providedIn:"root"})};function Be(e){return e==null?"":":"+e.toString()}function _e(e){return e==null?"":e.startsWith("/")?e:"/"+e}function R(e,n){let t={},o={};return n.searchParams.forEach((i,l)=>{Ke.find(u=>u.key===e)?.dynamicFields?.includes(l)?o[l]=decodeURIComponent(i):t[l]=decodeURIComponent(i)}),{advanced:t,dynamic:o}}function b(e,n=!1){let t=e.map(([i,l])=>`${i}=${l?encodeURIComponent(l.toString()):""}`).join("&");return t?(n?"":"?")+t:""}function St(e){let n=e.destinationType,t=Ke.find(o=>o.customKey===n||o.key===n);if(!t)throw new Error("Invalid destination type");return t?.mapper.to(e)??""}function Nt(e){let n=URL.canParse(e),t=e.split("://")[0],o="http://"+e.split("://")[1],i=new URL(o);if(!n)throw new Error("Invalid target path");return Ke.find(l=>l.customKey===t||l.key===t)?.mapper.from(t,i,e)}var E=new oe,Ke=[{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:e=>E.control(e??"")}},mapper:{to:e=>{let n=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${e.custom.path}${n}`},from:(e,n,t)=>{let o=t.indexOf("file:///")===0,i=t.split(o?"///":"//")[1].substring(0,1)+n.hostname.substring(1);return P({destinationType:e,custom:{path:`${o?"/":""}${i}${n.pathname}`}},R(e,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:e=>E.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"The port to connect to",formElement:e=>E.control(e??"",[Ee.required,Ee.max(65535)])},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:e=>E.control(e??"")}},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:e=>{let n=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{port:t,server:o,path:i}=e.custom;return`${e.destinationType}://${o+Be(t)+_e(i)+n}`},from:(e,n,t)=>P({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},R(e,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:e=>E.control(e??"")},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:e=>E.control(e??"")}},dynamicFields:[{name:"s3-server-name",shortDescription:"Server",type:"NonValidatedSelectableString",loadOptions:e=>e.get(xe).s3Providers},"use-ssl","auth-username","auth-password"],advancedFields:[{name:"s3-client",type:"Enumeration",options:["aws","minio"]},{name:"s3-storage-class",type:"NonValidatedSelectableString",loadOptions:e=>e.get(xe).s3StorageClasses}],mapper:{to:e=>{let{bucket:n,path:t}=e.custom,o=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n+_e(t)+o}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.pathname,bucket:n.hostname}},R(e,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:e=>E.control(e??"")}},dynamicFields:[{name:"gcs-location",type:"NonValidatedSelectableString",loadOptions:e=>e.get(xe).gcsLocations},{name:"gcs-storage-class",type:"NonValidatedSelectableString",loadOptions:e=>e.get(xe).gcsStorageClasses},"authid"],mapper:{to:e=>{let n=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${e.custom.path}${n}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,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:e=>E.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,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:e=>E.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:e=>{let n=e.custom.path,t=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,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:e=>E.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,n))}},{key:"od4b",displayName:"OneDrive Business",description:"Store backups in OneDrive Business.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>E.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>E.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>E.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:e=>{let n=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{port:t,server:o,path:i}=e.custom;return`${e.destinationType}://${o+Be(t)+_e(i)+n}`},from:(e,n,t)=>P({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},R(e,n))}},{key:"mssp",displayName:"Microsoft SharePoint",description:"Store backups in Microsoft SharePoint.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>E.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>E.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>E.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:e=>{let n=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{port:t,server:o,path:i}=e.custom;return`${e.destinationType}://${o+Be(t)+_e(i)+n}`},from:(e,n,t)=>P({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},R(e,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:e=>E.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,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:e=>E.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,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:e=>E.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,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:e=>E.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,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:e=>E.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path in the bucket",longDescription:"Path in the bucket",formElement:e=>E.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Application ID"},{name:"auth-password",shortDescription:"Application Key"}],mapper:{to:e=>{let{bucket:n,path:t}=e.custom,o=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n+_e(t)+o}`},from:(e,n,t)=>P({destinationType:e,custom:{bucket:n.hostname,path:n.pathname}},R(e,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:e=>E.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path in the bucket",longDescription:"Path in the bucket",formElement:e=>E.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Access ID"},{name:"auth-password",shortDescription:"Access Secret"}],mapper:{to:e=>{let{bucket:n,path:t}=e.custom,o=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n+_e(t)+o}`},from:(e,n,t)=>P({destinationType:e,custom:{bucket:n.hostname,path:n.pathname}},R(e,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:e=>E.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:e=>{let n=e.custom.path,t=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,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:e=>E.control(e??"",[Ee.email])},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>E.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,n))}},{key:"cloudfiles",displayName:"Rackspace CloudFiles",description:"Store backups in Rackspace CloudFiles.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>E.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>E.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>E.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:e=>{let n=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{port:t,server:o,path:i}=e.custom;return`${e.destinationType}://${o+Be(t)+_e(i)+n}`},from:(e,n,t)=>P({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},R(e,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:e=>{let n=e.dynamic["rclone-remote-repository"],t=e.dynamic["rclone-remote-path"],o=Object.entries(e.dynamic).filter(([l])=>!["rclone-remote-repository","rclone-remote-path"].includes(l)),i=b([...Object.entries(e.advanced),...o]);return`${e.destinationType}://${n}/${t+i}`},from:(e,n,t)=>{let{advanced:o,dynamic:i}=R(e,n);return P({destinationType:e,dynamic:P({"rclone-remote-repository":n.hostname,"rclone-remote-path":n.pathname},i)},o)}}},{key:"openstack",displayName:"OpenStack Object Storage",description:"Store backups in OpenStack Object Storage.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket",longDescription:"Bucket",formElement:e=>E.control(e??"")}},dynamicFields:[{name:"openstack-authuri",shortDescription:"Auth URI",type:"Enumeration",loadOptions:e=>e.get(xe).openstackProviders},{name:"openstack-version",shortDescription:"Version",type:"Enumeration",loadOptions:e=>e.get(xe).openstackVersions},{name:"openstack-domain-name",shortDescription:"Domain name"},{name:"openstack-tenant-name",shortDescription:"Tenant name"},{name:"openstack-region",shortDescription:"Region"}],mapper:{to:e=>{let n=b([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{bucket:t}=e.custom;return`${e.destinationType}://${t+n}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.pathname,bucket:n.hostname}},R(e,n))}},{key:"webdav",displayName:"WebDAV",description:"Store backups in WebDAV.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>E.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>E.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>E.control(e??"")}},dynamicFields:[{name:"use-ssl",shortDescription:"Use SSL"},{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:e=>{let{port:n,server:t,path:o}=e.custom,i=e.dynamic["use-ssl"],l=b([...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([u])=>u!=="use-ssl")]);return`${e.destinationType}${i?"s":""}://${t+Be(n)+_e(o)+l}`},from:(e,n,t)=>P({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},R(e,n))}},{key:"aftp",displayName:"FTP",description:"Store backups in FTP.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>E.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>E.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>E.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:e=>{let{port:n,server:t,path:o}=e.custom,i=b([...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([l])=>l!=="use-ssl")]);return`${e.destinationType}://${t+Be(n)+_e(o)+i}`},from:(e,n,t)=>P({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},R(e,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:e=>E.control(e??"")}},dynamicFields:["sia-targetpath","sia-password","sia-redundancy"],mapper:{to:e=>{let n=e.custom.server,t=e.dynamic["sia-targetpath"],o=b([...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([i])=>i!=="sia-targetpath")]);return`${e.destinationType}://${n+_e(t)+o}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.pathname}},R(e,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:e=>E.control(e??"")}},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:e=>{let n=e.custom.path,t=b([...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([o])=>o!=="cos-targetpath")]);return`${e.destinationType}://${n+t}`},from:(e,n,t)=>P({destinationType:e,custom:{path:n.pathname}},R(e,n))}},{key:"tahoe",displayName:"Tahoe LAFS",description:"Store backups in Tahoe LAFS.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>E.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>E.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>E.control(e??"")},username:{type:"String",name:"username",shortDescription:"Username",longDescription:"Username",formElement:e=>E.control(e??"")},password:{type:"Password",name:"password",shortDescription:"Password",longDescription:"Password",formElement:e=>E.control(e??"")}},dynamicFields:[{name:"use-ssl",shortDescription:"Use SSL"}],mapper:{to:e=>{let{port:n,server:t,path:o,username:i,password:l}=e.custom,u={"auth-username":i,"auth-password":l},N=e.dynamic["use-ssl"],w=b([...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([y])=>y!=="use-ssl"),...Object.entries(u)]);return`${e.destinationType}${N?"s":""}://${t+Be(n)+_e(o)+w}`},from:(e,n,t)=>P({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},R(e,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:e=>`storj://storj.io/config?storj-auth-method=Access%20grant&storj-satellite=us1.storj.io%3A7777&storj-api-key&storj-secret&${b([...Object.entries(e.advanced),...Object.entries(e.dynamic)],!0)}`,from:(e,n,t)=>P({destinationType:e},R(e,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:e=>e.get(xe).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:e=>`storj://storj.io/config?storj-auth-method=API%20key&${b([...Object.entries(e.advanced),...Object.entries(e.dynamic)],!0)}`,from:(e,n,t)=>P({destinationType:e},R(e,n))}}];var jt=/[a-zA-Z0-9_\-\+\.!@#$%^&*?_~()-]/,Tt=class e{generate(n,t=jt){let o;do o=this.generatePassword(n,t);while(this.calculatePasswordStrength(o)<5);return o}generatePassword(n,t=jt){let o=this;return Array.apply(null,{length:n}).map(()=>{let i;for(;;)if(i=String.fromCharCode(o.#e()),t.test(i))return i},this).join("")}calculatePasswordStrength(n){let t=1;return n.length>=8&&t++,n.match(/[a-z]/)&&n.match(/[A-Z]/)&&t++,n.match(/\d+/)&&t++,n.match(/.[!,@,#,$,%,^,&,*,?,_,~,(,),-]/)&&t++,Math.min(t,5)}#e(){if(window.crypto&&window.crypto.getRandomValues){let n=new Uint8Array(1);return window.crypto.getRandomValues(n),n[0]}else if(window.msCrypto&&window.msCrypto.getRandomValues){let n=new Uint8Array(1);return window.msCrypto.getRandomValues(n),n[0]}else return Math.floor(Math.random()*256)}static \u0275fac=function(t){return new(t||e)};static \u0275prov=we({token:e,factory:e.\u0275fac,providedIn:"root"})};var rn=["formRef"];function an(e,n){if(e&1&&(a(0,"spk-option",27),m(1),r()),e&2){let t=n.$implicit;c("value",t.Key),s(),B(t.DisplayName)}}function sn(e,n){if(e&1&&_(0,"spk-progress-bar",38),e&2){let t=p(3);$e("warn",t.calculatePasswordStrength()===1)("tertiary",t.calculatePasswordStrength()===2)("primary",t.calculatePasswordStrength()===4)("success",t.calculatePasswordStrength()===5),c("value",t.calculatePasswordStrength()*(100/5))}}function ln(e,n){e&1&&(a(0,"span",33),k(1,9),r())}function pn(e,n){e&1&&(h(0,7,1),_(1,"spk-icon"),D())}function cn(e,n){e&1&&(h(0,7,2),_(1,"spk-icon"),D())}function mn(e,n){e&1&&(h(0,10,1),_(1,"spk-icon",40),D())}function _n(e,n){e&1&&(h(0,10,2),_(1,"spk-icon"),D())}function un(e,n){if(e&1){let t=O();a(0,"button",39),f("click",function(){S(t);let i=p(3);return T(i.copyPassword())}),h(1,10),F(2,mn,2,0)(3,_n,2,0),D(),r()}if(e&2){let t=p(3);s(2),g(t.copiedPassword()?2:3)}}function dn(e,n){e&1&&(a(0,"spk-alert",37),k(1,11),r())}function Fn(e,n){if(e&1){let t=O();a(0,"div",28)(1,"spk-form-field")(2,"label",29),h(3,6),_(4,"sup"),D(),r(),_(5,"input",30),r(),F(6,sn,1,9,"spk-progress-bar",31),a(7,"spk-form-field"),_(8,"input",32),F(9,ln,2,0,"span",33),r(),a(10,"div",34)(11,"button",35),f("click",function(){S(t);let i=p(2);return T(i.showPassword.set(!i.showPassword()))}),h(12,7),F(13,pn,2,0)(14,cn,2,0),D(),r(),a(15,"button",35),f("click",function(){S(t);let i=p(2);return T(i.generatePassword())}),h(16,8),_(17,"spk-icon"),D(),r(),F(18,un,4,1,"button",36),r(),F(19,dn,2,0,"spk-alert",37),r()}if(e&2){let t=p(2);s(5),c("type",t.showPassword()?"text":"password"),s(),g(t.generalForm.value.password?6:-1),s(2),c("type",t.showPassword()?"text":"password"),s(),g(t.generalForm.value.repeatPassword&&t.generalForm.value.repeatPassword!==t.generalForm.value.password?9:-1),s(4),g(t.showPassword()?13:14),s(5),g(t.showCopyPassword()?18:-1),s(),g(t.generalForm.value.password&&t.generalForm.value.password===t.generalForm.value.repeatPassword?19:-1)}}function gn(e,n){if(e&1&&(a(0,"spk-select",24)(1,"label",25),k(2,5),r(),_(3,"input",26),M(4,an,2,2,"spk-option",27,I),r(),F(6,Fn,20,7,"div",28)),e&2){let t=p();c("displayFn",t.displayFn()),s(4),v(t.encryptionOptions()),s(2),g(t.encryptionFieldSignal()!==""?6:-1)}}function Cn(e,n){if(e&1&&(a(0,"button",22),h(1,12),_(2,"spk-icon"),D(),r()),e&2){let t=p();c("disabled",t.generalForm.invalid)}}function fn(e,n){if(e&1&&(a(0,"spk-tooltip",23)(1,"button",22),h(2,13),_(3,"spk-icon"),D(),r()()),e&2){let t=p();c("disabled",!(t.showCopyPassword()&&!t.copiedPassword())),s(),c("disabled",t.generalForm.invalid||t.showCopyPassword()&&!t.copiedPassword())}}var Ze=new oe,Wt=(e={name:"",description:"",encryption:"",password:"",repeatPassword:""})=>Ze.group({name:Ze.control(e.name,[Ee.required]),description:Ze.control(e.description),encryption:Ze.control(e.encryption,[Ht()]),password:Ze.control(e.password,[Pt(n=>n?.value.encryption!=="",[Ee.required])]),repeatPassword:Ze.control(e.repeatPassword,[Pt(n=>n?.value.encryption!=="",[Ee.required])])}),Ot={Key:"",DisplayName:"None"},At=class e{#e=$(re);#t=$(De);#o=$(Tt);#i=$(ue);#n=$(mt);formRef=fe.required("formRef");generalForm=this.#i.generalForm;generalFormSignal=this.#i.generalFormSignal;encryptionFieldSignal=this.#i.encryptionFieldSignal;encryptionOptions=this.#i.encryptionOptions;isNew=this.#i.isNew;showPassword=A(!1);copiedPassword=A(!1);showCopyPassword=A(!1);encryptionEffect=pt(()=>{this.encryptionFieldSignal()===""&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});calculatePasswordStrength=K(()=>{let t=this.generalFormSignal()?.password??"";return this.#o.calculatePasswordStrength(t)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#i.exit()}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 o=document.createElement("textarea");o.value=n,document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o)}catch(o){console.error("Failed to copy text: ",o)}}}displayFn(){let n=this.#n.systemInfo()?.EncryptionModules??[];return t=>{let o=[Ot,...n].find(i=>i.Key===t);return o?`${o.DisplayName}`:""}}generatePassword(){this.copiedPassword.set(!1);let n=this.#o.generate(16);this.generalForm.controls.password.setValue(n),this.generalForm.controls.repeatPassword.setValue(n),this.showCopyPassword.set(!0)}next(){this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=ne({type:e,selectors:[["app-general"]],viewQuery:function(t,o){t&1&&Se(o.formRef,rn,5),t&2&&Te()},decls:20,vars:3,consts:()=>{let n;n=$localize`Your backup name`;let t;t=$localize`Your backup description`;let o;o=$localize`General backup settings`;let i;i=$localize` Backup name ${"\uFFFD#7\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#7\uFFFD"}:CLOSE_SUPERSCRIPT:`;let l;l=$localize`Backup description`;let u;u=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Exit `;let N;N=$localize`Encryption`;let w;w=$localize`Encryption`;let y;y=$localize`Password`;let Z;Z=$localize`Repeat password`;let J;J=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let L;L=$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:`,L=Ie(L);let ee;ee=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Generate password `;let te;te=$localize`Passwords do not match`;let H;H=$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:`,H=Ie(H);let d;d=$localize` Tip: Be sure to save your password. If you loose it you will lose access to your backups. `;let C;C=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let G;return G=$localize` Continue ${"\uFFFD#3\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],o,i,l,u,w,J,L,ee,te,H,d,C,G,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],["for","backupName"],["type","text","tabindex","1","placeholder",n,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",t,"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"],[3,"displayFn"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",N,"formControlName","encryption"],[3,"value"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",y,"formControlName","password",3,"type"],[1,"raised",3,"warn","tertiary","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",Z,"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(t,o){if(t&1){let i=O();a(0,"form",14,0),f("submit",function(){return S(i),T(o.next())}),a(2,"h3",15),k(3,1),r(),a(4,"spk-form-field")(5,"label",16),h(6,2),_(7,"sup"),D(),r(),_(8,"input",17),r(),a(9,"spk-form-field")(10,"label",18),k(11,3),r(),_(12,"textarea",19),r(),F(13,gn,7,2),a(14,"div",20)(15,"button",21),f("click",function(){return S(i),T(o.exit())}),h(16,4),_(17,"spk-icon"),D(),r(),F(18,Cn,3,1,"button",22)(19,fn,4,2,"spk-tooltip",23),r()()}t&2&&(c("formGroup",o.generalForm),s(13),g(o.isNew()?13:-1),s(5),g(o.encryptionFieldSignal()===""?18:19))},dependencies:[Oe,Pe,ae,se,ye,Ne,Ae,pe,me,Ve,le,ce,Xt,Ft,qe],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}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--warn-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})};var Sn=["formRef"],Tn=(e,n)=>({index:e,formView:n,formGroupName:"advancedOptions",destinationType:null,oauthField:null}),hn=e=>({$implicit:e});function Dn(e,n){if(e&1&&(a(0,"spk-option",17),m(1),r()),e&2){let t=n.$implicit;c("value",t),s(),B(t)}}function En(e,n){if(e&1&&(a(0,"spk-option",17),m(1),r()),e&2){let t=n.$implicit;c("value",t.value),s(),B(t.name)}}function yn(e,n){if(e&1){let t=O();h(0,7,1),a(1,"button",29,2),f("click",function(){let i=S(t).$implicit,l=p();return T(l.addNewOption(i))}),r(),D()}if(e&2){let t=n.$implicit;s(),nt(t.name),ot(0)}}function Pn(e,n){e&1&&ze(0)}function Nn(e,n){if(e&1&&F(0,Pn,1,0,"ng-container",30),e&2){let t=n.$implicit,o=n.$index;p();let i=he(35);c("ngTemplateOutlet",i)("ngTemplateOutletContext",Xe(5,hn,Vt(2,Tn,o,t)))}}function An(e,n){if(e&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function On(e,n){if(e&1&&(a(0,"app-file-tree",33)(1,"label",39),m(2),F(3,An,3,1,"spk-tooltip",40),r(),_(4,"input",41),r()),e&2){let t,o=p().$implicit,i=p();c("startingPath",i.getFormFieldValue(0,o.formGroupName,o.formView.name))("accepts",o.formView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),s(),q("for","destination-",o.formGroupName,"-",o.index,""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),q("id","destination-",o.formGroupName,"-",o.index,""),X("formControlName",o.formView.name)}}function kn(e,n){if(e&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function xn(e,n){if(e&1&&(a(0,"app-file-tree",34)(1,"label",39),m(2),F(3,kn,3,1,"spk-tooltip",40),r(),_(4,"input",41),r()),e&2){let t,o=p().$implicit,i=p();c("startingPath",i.getFormFieldValue(0,o.formGroupName,o.formView.name)),s(),q("for","destination-",o.formGroupName,"-",o.index,""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),q("id","destination-",o.formGroupName,"-",o.index,""),X("formControlName",o.formView.name)}}function $n(e,n){if(e&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function In(e,n){e&1&&(a(0,"spk-icon",42),m(1,"link"),r())}function Mn(e,n){e&1&&(a(0,"spk-icon",42),m(1,"textbox"),r())}function vn(e,n){if(e&1&&(a(0,"spk-form-field")(1,"label",39),m(2),F(3,$n,3,1,"spk-tooltip",40),r(),_(4,"input",41),F(5,In,2,0,"spk-icon",42)(6,Mn,2,0,"spk-icon",42),r()),e&2){let t,o=p().$implicit;s(),q("for","destination-",o.formGroupName,"-",o.index,""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),q("id","destination-",o.formGroupName,"-",o.index,""),X("formControlName",o.formView.name),s(),g(o.formView.type==="Path"?5:6)}}function wn(e,n){if(e&1){let t=O();a(0,"span",46),f("click",function(){S(t);let i=p(2).$implicit,l=p();return T(l.oauthStartTokenCreation(i.formViewType))}),m(1,"AuthID"),r()}}function Rn(e,n){e&1&&(a(0,"spk-icon",42),m(1,"password"),r())}function bn(e,n){if(e&1){let t=O();a(0,"spk-icon",47),f("click",function(){S(t);let i=p(2).$implicit;return T(i.formView.showPassword=!i.formView.showPassword)}),m(1," eye "),r()}}function Gn(e,n){if(e&1){let t=O();a(0,"spk-icon",47),f("click",function(){S(t);let i=p(2).$implicit;return T(i.formView.showPassword=!i.formView.showPassword)}),m(1," eye-slash "),r()}}function Vn(e,n){if(e&1&&(a(0,"spk-form-field")(1,"label",39),m(2),r(),_(3,"input",43),F(4,wn,2,0,"span",44)(5,Rn,2,0,"spk-icon",42)(6,bn,2,0,"spk-icon",45)(7,Gn,2,0,"spk-icon",45),r()),e&2){let t,o=p().$implicit;s(),q("for","destination-",o.formGroupName,"-",o.index,""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),q("id","destination-",o.formGroupName,"-",o.index,""),X("formControlName",o.formView.name),c("type",o.formView.showPassword?"text":"password"),s(),g(o.oauthField===o.formView.name?4:5),s(2),g(o.formView.showPassword?6:7)}}function Ln(e,n){if(e&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function Un(e,n){if(e&1&&(a(0,"spk-option",17),m(1),r()),e&2){let t=n.$implicit;c("value",t),s(),B(t)}}function Bn(e,n){if(e&1&&(a(0,"spk-select")(1,"label",39),m(2),F(3,Ln,3,1,"spk-tooltip",40),r(),_(4,"input",48),M(5,Un,2,2,"spk-option",17,I),r()),e&2){let t,o=p().$implicit;s(),q("for","destination-",o.formGroupName,"-",o.index,""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),q("id","destination-",o.formGroupName,"-",o.index,""),X("formControlName",o.formView.name),s(),v(o.formView.options)}}function Kn(e,n){if(e&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function zn(e,n){if(e&1&&(a(0,"spk-option",17),m(1),r()),e&2){let t=n.$implicit;c("value",t),s(),B(t)}}function Xn(e,n){if(e&1&&(a(0,"div",35)(1,"label",39),m(2),F(3,Kn,3,1,"spk-tooltip",40),r(),a(4,"div",49)(5,"spk-form-field"),_(6,"input",50),a(7,"spk-icon",42),m(8,"resize"),r()(),a(9,"spk-select"),_(10,"label")(11,"input",51),M(12,zn,2,2,"spk-option",17,I),r()()()),e&2){let t,o=p().$implicit,i=p();c("formGroupName",o.formView.name),s(),q("for","destination-",o.formGroupName,"-",o.index,""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(3),q("id","destination-",o.formGroupName,"-",o.index,""),s(6),v(i.sizeOptions())}}function Hn(e,n){if(e&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function jn(e,n){if(e&1&&(a(0,"spk-form-field")(1,"label",39),m(2),F(3,Hn,3,1,"spk-tooltip",40),r(),_(4,"input",52),a(5,"spk-icon",42),m(6,"numpad"),r()()),e&2){let t,o=p().$implicit;s(),q("for","destination-",o.formGroupName,"-",o.index,""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),q("id","destination-",o.formGroupName,"-",o.index,""),X("formControlName",o.formView.name)}}function Wn(e,n){if(e&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function qn(e,n){if(e&1&&(a(0,"spk-toggle",36)(1,"label",39),m(2),F(3,Wn,3,1,"spk-tooltip",40),r(),_(4,"input",53),r()),e&2){let t,o=p().$implicit;s(),q("for","destination-",o.formGroupName,"-",o.index,""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),q("id","destination-",o.formGroupName,"-",o.index,""),X("formControlName",o.formView.name)}}function Qn(e,n){if(e&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function Yn(e,n){e&1&&(a(0,"spk-option",55),m(1,"None"),r()),e&2&&c("value","None")}function Zn(e,n){if(e&1&&(a(0,"spk-option",17),m(1),_(2,"spk-checkbox",56),r()),e&2){let t=p().$implicit;c("value",t),s(),V(" ",t," ")}}function Jn(e,n){if(e&1&&F(0,Yn,2,1,"spk-option",55)(1,Zn,3,2,"spk-option",17),e&2){let t=n.$implicit;g(t==="None"?0:1)}}function eo(e,n){if(e&1&&(a(0,"spk-select",37)(1,"label",39),m(2),F(3,Qn,3,1,"spk-tooltip",40),r(),_(4,"input",54),M(5,Jn,2,1,null,null,I),r()),e&2){let t,o=p().$implicit;c("selectMultiple",!0),s(),q("for","destination-",o.formGroupName,"-",o.index,""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),X("formControlName",o.formView.name),s(),v(o.formView.options)}}function to(e,n){if(e&1&&(a(0,"spk-tooltip",40)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function no(e,n){if(e&1&&(a(0,"spk-form-field")(1,"label",39),m(2),F(3,to,3,1,"spk-tooltip",40),r(),_(4,"input",41),r()),e&2){let t,o=p().$implicit;s(),q("for","destination-",o.formGroupName,"-",o.index,""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),q("id","destination-",o.formGroupName,"-",o.index,""),X("formControlName",o.formView.name)}}function oo(e,n){if(e&1){let t=O();a(0,"div",31),j(1,32),F(2,On,5,14,"app-file-tree",33)(3,xn,5,10,"app-file-tree",34)(4,vn,7,10,"spk-form-field")(5,Vn,8,11,"spk-form-field")(6,Bn,7,9,"spk-select")(7,Xn,14,9,"div",35)(8,jn,7,9,"spk-form-field")(9,qn,5,9,"spk-toggle",36)(10,eo,7,7,"spk-select",37)(11,no,5,9,"spk-form-field"),W(),a(12,"button",38),f("click",function(){let i=S(t).$implicit,l=p();return T(l.removeFormView(i.formView,0))}),a(13,"spk-icon"),m(14,"x-circle"),r()()()}if(e&2){let t=n.$implicit;s(),c("formGroupName",t.formGroupName),s(),g(t.formView.type==="FileTree"?2:t.formView.type==="FolderTree"?3:t.formView.type==="String"||t.formView.type==="Path"?4:t.formView.type==="Password"?5:t.formView.type==="Enumeration"?6:t.formView.type==="Size"?7:t.formView.type==="Integer"?8:t.formView.type==="Boolean"?9:t.formView.type==="Flags"?10:t.formView.type==="Timespan"?11:-1)}}var Me=new oe,io=["Bytes","KB","MB","GB","TB","PB"],ro=[{value:"",name:"Keep all backups"},{value:"time",name:"Delete backups that are older than"},{value:"versions",name:"Keep a specific number of backups"},{value:"smart",name:"Smart backup retention"},{value:"custom",name:"Custom backup retention"}],qt=(e={remoteVolumeSize:50,size:"MB",backupRetention:"",advancedOptions:[]})=>Me.group({remoteVolumeSize:Me.group({size:Me.control(e.remoteVolumeSize),unit:Me.control(e.size)}),backupRetention:Me.control(e.backupRetention),advancedOptions:Me.group({})}),kr=(e,n)=>Me.group({name:Me.control(e),value:Me.control(n)}),kt=class e{#e=$(ue);#t=$(re);#o=$(De);formRef=fe.required("formRef");optionsForm=this.#e.optionsForm;selectedOptions=this.#e.selectedOptions;nonSelectedOptions=this.#e.nonSelectedOptions;isSubmitting=this.#e.isSubmitting;sizeOptions=A(io);rentationOptions=A(ro);oauthStartTokenCreation(n){}getFormFieldValue(n,t,o){return this.optionsForm.controls.advancedOptions.controls[o].value}removeFormView(n,t){this.#e.removeOptionFromFormGroup(n)}addNewOption(n){this.#e.addOptionToFormGroup(n)}retentionOptionDisplayFn(){let n=this.rentationOptions();return t=>{let o=n.find(i=>i.value===t);return o?o.name:""}}displayFn(){let n=this.#e.advancedOptions();return t=>{let o=n.find(i=>i.name===t);return o?`${o.name}`:""}}goBack(){this.#t.navigate(["schedule"],{relativeTo:this.#o.parent})}submit(){this.#e.submit()}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=ne({type:e,selectors:[["app-options"]],viewQuery:function(t,o){t&1&&Se(o.formRef,Sn,5),t&2&&Te()},decls:43,vars:5,consts:()=>{let n;n=$localize`Select an option...`;let t;t=$localize`Options`;let o;o=$localize`Remote volume size`;let i;i=$localize` The backups will be split up into multiple files called volumes. Here you can set the maximum size of the individual volume files. ${"\uFFFD#16\uFFFD"}:START_LINK:Read more${"\uFFFD/#16\uFFFD"}:CLOSE_LINK:`;let l;l=$localize`Backup retention`;let u;u=$localize` Advanced options ${"\uFFFD#26\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#27\uFFFD"}:START_TAG_BUTTON: Add advanced option ${"\uFFFD#28\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#27\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#29\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD*31:1\uFFFD"}:START_BLOCK_FOR:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON_1:${"\uFFFD0:1\uFFFD"}:INTERPOLATION:${"[\uFFFD/#27\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/*31:1\uFFFD"}:CLOSE_BLOCK_FOR:${"\uFFFD/#29\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#26\uFFFD"}:CLOSE_TAG_SPK_MENU:`,u=Ie(u);let N;N=$localize`${"\uFFFD#39\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#39\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let w;return w=$localize`${"\uFFFD#42\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#42\uFFFD"}:CLOSE_TAG_SPK_ICON: Submit `,[["formRef",""],["fieldTemplate",""],["option",""],t,o,i,l,u,N,w,[3,"submit","formGroup"],[1,"title-30"],[1,"remote-volume-wrap"],["formGroupName","remoteVolumeSize",1,"row-inputs"],["for","size"],["type","number","id","size","formControlName","size"],["type","text","placeholder",n,"formControlName","unit"],[3,"value"],["href","#",1,"spk-primary"],[3,"displayFn"],["type","text","formControlName","backupRetention"],[3,"disallowToggle"],["title",""],["spk-button","","type","button",1,"outlined","small"],["menu",""],["type","button"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["type","button",3,"click"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"field-row"],[3,"formGroupName"],[3,"startingPath","accepts","showFiles","showHiddenNodes","selectFiles"],[3,"startingPath"],[1,"form-column",3,"formGroupName"],[1,"primary","raised"],[1,"primary",3,"selectMultiple"],["spk-button","","type","button",1,"outlined",3,"click"],[3,"for"],[1,"primary",3,"message"],["type","text",3,"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"],["type","search",3,"id","formControlName"],[1,"form-row"],["type","number","formControlName","size",3,"id"],["type","search","formControlName","unit"],["type","number",3,"id","formControlName"],["type","checkbox",3,"id","formControlName"],["type","text","id","text",3,"formControlName"],["deselect","",3,"value"],[1,"raised","primary"]]},template:function(t,o){if(t&1){let i=O();a(0,"form",10,0),f("submit",function(){return S(i),T(o.submit())}),a(2,"h3",11),k(3,3),r(),a(4,"div",12)(5,"div",13)(6,"spk-form-field")(7,"label",14),k(8,4),r(),_(9,"input",15),r(),a(10,"spk-select"),_(11,"input",16),M(12,Dn,2,2,"spk-option",17,I),r()(),a(14,"p"),h(15,5),_(16,"a",18),D(),r()(),a(17,"spk-select",19)(18,"label",14),k(19,6),r(),_(20,"input",20),M(21,En,2,2,"spk-option",17,I),r(),a(23,"app-toggle-card",21),j(24,22),h(25,7),a(26,"spk-menu")(27,"button",23),_(28,"spk-icon"),r(),j(29,24),M(30,yn,3,1,"button",25,I),W(),r(),D(),W(),M(32,Nn,1,7,"ng-container",null,I),r(),F(34,oo,15,2,"ng-template",null,1,lt),a(36,"div",26)(37,"button",27),f("click",function(){return S(i),T(o.goBack())}),h(38,8),_(39,"spk-icon"),D(),r(),a(40,"button",28),h(41,9),_(42,"spk-icon"),D(),r()()()}t&2&&(c("formGroup",o.optionsForm),s(12),v(o.sizeOptions()),s(5),c("displayFn",o.retentionOptionDisplayFn()),s(4),v(o.rentationOptions()),s(2),c("disallowToggle",!0),s(7),v(o.nonSelectedOptions()),s(2),v(o.selectedOptions()),s(8),$e("loader",o.isSubmitting()))},dependencies:[Oe,Pe,ae,be,Re,se,ye,Ne,Ae,Ge,ct,Ct,me,Ve,le,pe,Le,gt,ce,qe,Qe,Ue],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}.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}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 40px;align-items:flex-end}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var ao=["formRef"];function so(e,n){if(e&1&&(a(0,"spk-option",38),m(1),r()),e&2){let t=n.$implicit;c("value",t.key),s(),B(t.label)}}function lo(e,n){if(e&1){let t=O();a(0,"div",26)(1,"spk-form-field")(2,"label",27),k(3,8),r(),a(4,"input",28,1),f("focus",function(){S(t);let i=he(5);return T(i.showPicker())}),r(),a(6,"spk-icon",29),m(7,"clock"),r()(),a(8,"spk-form-field"),_(9,"label",30),a(10,"input",31,2),f("focus",function(){S(t);let i=he(11);return T(i.showPicker())}),r(),a(12,"spk-icon",29),m(13,"calendar"),r()()(),j(14,32),a(15,"div",33)(16,"spk-form-field")(17,"label",34),k(18,9),r(),_(19,"input",35),r(),a(20,"spk-select",36),_(21,"input",37),M(22,so,2,2,"spk-option",38,I),r()(),a(24,"app-toggle-card",39),j(25,40),k(26,10),W(),a(27,"div",41)(28,"spk-toggle",21),h(29,11),_(30,"input",42),D(),r(),a(31,"spk-toggle",21),h(32,12),_(33,"input",43),D(),r(),a(34,"spk-toggle",21),h(35,13),_(36,"input",44),D(),r(),a(37,"spk-toggle",21),h(38,14),_(39,"input",45),D(),r(),a(40,"spk-toggle",21),h(41,15),_(42,"input",46),D(),r(),a(43,"spk-toggle",21),h(44,16),_(45,"input",47),D(),r(),a(46,"spk-toggle",21),h(47,17),_(48,"input",48),D(),r()()(),W()}if(e&2){let t=p();s(20),c("displayFn",t.displayFn),s(2),v(t.unitOptions),s(2),c("disallowToggle",!0)}}var Y=new oe,Qt=[{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`}],Yt=(e={autoRun:!1,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}}})=>Y.group({autoRun:Y.control(e.autoRun),nextTime:Y.group({time:Y.control(e.nextTime.time),date:Y.control(e.nextTime.date)}),runAgain:Y.group({repeatValue:Y.control(e.runAgain.repeatValue),repeatUnit:Y.control(e.runAgain.repeatUnit),allowedDays:Y.group({mon:Y.control(e.runAgain.allowedDays.mon),tue:Y.control(e.runAgain.allowedDays.tue),wed:Y.control(e.runAgain.allowedDays.wed),thu:Y.control(e.runAgain.allowedDays.thu),fri:Y.control(e.runAgain.allowedDays.fri),sat:Y.control(e.runAgain.allowedDays.sat),sun:Y.control(e.runAgain.allowedDays.sun)})})}),xt=class e{#e=$(ue);#t=$(re);#o=$(De);formRef=fe.required("formRef");scheduleForm=this.#e.scheduleForm;scheduleFormSignal=this.#e.scheduleFormSignal;unitOptions=Qt;displayFn(n){let t=Qt.find(o=>o.key===n);return t?`${t.label}`:""}goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#o.parent})}next(){this.#t.navigate(["options"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=ne({type:e,selectors:[["app-schedule"]],viewQuery:function(t,o){t&1&&Se(o.formRef,ao,5),t&2&&Te()},decls:18,vars:2,consts:()=>{let n;n=$localize`Schedule`;let t;t=$localize` Automatically run backups ${"\uFFFD#7\uFFFD\uFFFD/#7\uFFFD"}:TAG_INPUT:`;let o;o=$localize`If a date was missed, the job will run as soon as possible.`;let i;i=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let l;l=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let u;u=$localize`Next time`;let N;N=$localize`Run again every`;let w;w=$localize`Allowed days`;let y;y=$localize` Monday ${"\uFFFD#30\uFFFD\uFFFD/#30\uFFFD"}:TAG_INPUT:`;let Z;Z=$localize` Tuesday ${"\uFFFD#33\uFFFD\uFFFD/#33\uFFFD"}:TAG_INPUT:`;let J;J=$localize` Wednesday ${"\uFFFD#36\uFFFD\uFFFD/#36\uFFFD"}:TAG_INPUT:`;let L;L=$localize` Thursday ${"\uFFFD#39\uFFFD\uFFFD/#39\uFFFD"}:TAG_INPUT:`;let ee;ee=$localize` Friday ${"\uFFFD#42\uFFFD\uFFFD/#42\uFFFD"}:TAG_INPUT:`;let te;te=$localize` Saturday ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`;let H;return H=$localize` Sunday ${"\uFFFD#48\uFFFD\uFFFD/#48\uFFFD"}:TAG_INPUT:`,[["formRef",""],["timeRef",""],["dateRef",""],n,t,o,i,l,u,N,w,y,Z,J,L,ee,te,H,[3,"submit","formGroup"],[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox","formControlName","autoRun"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["formGroupName","nextTime",1,"row-inputs"],["for","time"],["type","time","id","time","formControlName","time",3,"focus"],["suffix",""],["for","date"],["type","date","id","date","formControlName","date",3,"focus"],["formGroupName","runAgain"],[1,"row-inputs"],["for","repeatValue"],["type","number","id","repeatValue","formControlName","repeatValue"],[3,"displayFn"],["type","text","id","repeatUnit","formControlName","repeatUnit"],[3,"value"],["formGroupName","allowedDays",3,"disallowToggle"],["title",""],[1,"days-wrap"],["type","checkbox","formControlName","mon"],["type","checkbox","formControlName","tue"],["type","checkbox","formControlName","wed"],["type","checkbox","formControlName","thu"],["type","checkbox","formControlName","fri"],["type","checkbox","formControlName","sat"],["type","checkbox","formControlName","sun"]]},template:function(t,o){if(t&1){let i=O();a(0,"form",18,0),f("submit",function(){return S(i),T(o.next())}),a(2,"h3",19),k(3,3),r(),a(4,"div",20)(5,"spk-toggle",21),h(6,4),_(7,"input",22),D(),r(),a(8,"p"),k(9,5),r()(),F(10,lo,49,2),a(11,"div",23)(12,"button",24),f("click",function(){return S(i),T(o.goBack())}),h(13,6),_(14,"spk-icon"),D(),r(),a(15,"button",25),h(16,7),_(17,"spk-icon"),D(),r()()()}if(t&2){let i;c("formGroup",o.scheduleForm),s(10),g((i=o.scheduleFormSignal())!=null&&i.autoRun?10:-1)}},dependencies:[Oe,Pe,ae,be,Re,se,ye,Ne,Ae,Ge,pe,me,ce,Le,le,Ve,Ue],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}.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 po(e,n){if(e&1&&(a(0,"spk-option",2),m(1),r()),e&2){let t=n.$implicit;c("value",t.value),s(),B(t.key)}}function co(e,n){if(e&1&&(a(0,"spk-option",2),m(1),r()),e&2){let t=n.$implicit;c("value",t.value),s(),B(t.key)}}function mo(e,n){if(e&1){let t=O();a(0,"spk-select",0)(1,"input",5),f("ngModelChange",function(i){S(t);let l=p(2);return T(l.updateStateExpression(i))}),r(),M(2,co,2,2,"spk-option",2,I),r()}if(e&2){let t,o=p(2);c("hideClearButton",!0)("displayFn",o.displayFn),s(),c("ngModel",(t=o.pathState())==null?null:t.expression),s(),v(o.fileGroupOptions())}}function _o(e,n){if(e&1){let t=O();a(0,"spk-form-field")(1,"input",5),f("ngModelChange",function(i){S(t);let l=p(2);return T(l.updateStateExpression(i))}),r()()}if(e&2){let t,o=p(2);s(),c("ngModel",(t=o.pathState())==null?null:t.expression)}}function uo(e,n){if(e&1){let t=O();a(0,"spk-select",0)(1,"input",1),f("ngModelChange",function(i){S(t);let l=p();return T(l.updateStateType(i))}),r(),M(2,po,2,2,"spk-option",2,I),r(),F(4,mo,4,3,"spk-select",0)(5,_o,2,1,"spk-form-field"),a(6,"div",3),f("click",function(){S(t);let i=p();return T(i.removeFilter())}),a(7,"spk-icon",4),m(8,"x-circle"),r()()}if(e&2){let t,o,i=p();c("hideClearButton",!0)("displayFn",i.displayFn),s(),c("ngModel",(t=i.pathState())==null?null:t.type),s(),v(i.expressionOptions()),s(2),g(((o=i.pathState())==null?null:o.type)==="-FileGroup"||((o=i.pathState())==null?null:o.type)==="+FileGroup"?4:5)}}var Zt=[{key:"Excludes folders where name contains",value:"-FolderNameIncludes"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileNameIncludes"},{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"}],Fo=[{key:"Applications",value:"Applications"},{key:"CacheFiles",value:"Cache Files"},{key:"TemporaryFiles",value:"Temporary Files"},{key:"OperatingSystem",value:"Operating System"},{key:"SystemFiles",value:"System Files"},{key:"DefaultExcludes",value:"Standard Excludes"}],ht=class e{path=st.required();pathChange=tt();remove=tt();expressionOptions=A(Zt);fileGroupOptions=A(Fo);pathState=A(null);typeState=K(()=>{let n=this.pathState();return n?n.type:null});pathEffect=pt(()=>{let n=this.path(),t=n.slice(1),o=n.startsWith("-")?"-":"+";return t.startsWith("/")&&t.endsWith("/")?this.pathState.set({type:`${o}Folder`,path:t,expression:t}):t.startsWith("*")&&t.endsWith("*/")?this.pathState.set({type:`${o}FolderNameIncludes`,path:t,expression:t.slice(1,-2)}):t.startsWith("[.*")&&t.endsWith("[^\\/]*]")?this.pathState.set({type:`${o}FileNameIncludes`,path:t,expression:t.slice(3,-7)}):t.startsWith("{")&&t.endsWith("}")?this.pathState.set({type:`${o}FileGroup`,path:t,expression:t.slice(1,-1)}):t.startsWith("[")&&t.endsWith("]")?this.pathState.set({type:`${o}Regex`,path:t,expression:t.slice(1,-1)}):t.startsWith("*.")?this.pathState.set({type:`${o}Extension`,path:t,expression:t.slice(2)}):this.pathState.set({type:`${o}Expression`,path:t,expression:t})});updateStateType(n){this.pathState.update(t=>(t.type=n,t.path=this.#t(t),t)),this.#e()}updateStateExpression(n){this.pathState.update(t=>(t.expression=n,t.path=this.#t(t),t)),this.#e()}#e(){setTimeout(()=>this.pathChange.emit(this.pathState().path))}#t(n){let t=n.type.slice(0,1),o=n.type.slice(1);if(o==="Folder"){let i=n.expression.endsWith("/"),l=n.expression.startsWith("/");return i&&l?`${t}${n.expression}`:i?`${t}${n.expression}/`:l?`${t}/${n.expression}`:`${t}/${n.expression}/`}return o==="FolderNameIncludes"?`${t}*${n.expression}*/`:o==="FileNameIncludes"?`${t}[.*${n.expression}[^\\/]*]`:o==="FileGroup"?`${t}{${n.expression}}`:o==="Regex"?`${t}[${n.expression}]`:o==="Extension"?`${t}*.${n.expression}`:`${t}${n.expression}`}removeFilter(){this.remove.emit()}displayFn(n){let t=Zt.find(o=>o.value===n);return t?t.key:""}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=ne({type:e,selectors:[["app-filter"]],inputs:{path:[1,"path"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:1,vars:1,consts:()=>{let n;return n=$localize`Select an option...`,[[3,"hideClearButton","displayFn"],["type","text","placeholder",n,3,"ngModelChange","ngModel"],[3,"value"],[1,"filter-removal",3,"click"],[1,"spk-primary"],["type","text",3,"ngModelChange","ngModel"]]},template:function(t,o){t&1&&F(0,uo,9,4),t&2&&g(o.pathState()?0:-1)},dependencies:[dt,ae,se,Ut,me,ce,le,pe],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] spk-select[_ngcontent-%COMP%]{--miw: initial}[_nghost-%COMP%] .filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var go=["formRef"];function Co(e,n){if(e&1){let t=O();a(0,"app-filter",42),f("pathChange",function(i){let l=S(t).$index,u=p(2);return T(u.patchPathAt(i,l))})("remove",function(){let i=S(t).$index,l=p(2);return T(l.removePathAt(i))}),r()}if(e&2){let t=n.$implicit;c("path",t)}}function fo(e,n){if(e&1&&M(0,Co,1,1,"app-filter",41,I),e&2){let t=p();v(t.pathArray())}}function So(e,n){if(e&1&&(a(0,"spk-option",45),m(1),r()),e&2){let t=n.$implicit;c("value",t),s(),B(t)}}function To(e,n){if(e&1&&(a(0,"div",40)(1,"spk-form-field"),_(2,"input",43),r(),a(3,"spk-select"),_(4,"input",44),M(5,So,2,2,"spk-option",45,I),r()()),e&2){let t=p();s(5),v(t.sizeOptions())}}var ve=new oe,ho=["Bytes","KB","MB","GB","TB","PB"],Jt=(e={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>ve.group({path:ve.control(e.path),excludes:ve.group({hidden:ve.control(e.excludes.hidden),system:ve.control(e.excludes.system),temporary:ve.control(e.excludes.temporary),filesLargerThan:ve.group({size:ve.control(null),unit:ve.control(null)})})}),$t=class e{#e=$(ue);#t=$(re);#o=$(De);formRef=fe.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new _t("");filesLargerThan=K(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);sizeOptions=A(ho);pathSignal=Q(this.sourceDataForm.controls.path.valueChanges);pathArray=K(()=>this.pathSignal()?.split("\0").filter(n=>n.startsWith("-")||n.startsWith("+"))??[]);addFilter(n="-*"){let t=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(`${t}\0${n}`)}patchPathAt(n,t){let i=this.sourceDataForm.controls.path.value.split("\0").filter(u=>!u.startsWith("-")&&!u.startsWith("+")).join("\0"),l=this.pathArray().map((u,N)=>N===t?`${n}`:`${u}`).join("\0");this.sourceDataForm.controls.path.setValue(`${i}\0${l}`)}removePathAt(n){let o=this.sourceDataForm.controls.path.value.split("\0").filter(l=>!l.startsWith("-")&&!l.startsWith("+")).join("\0"),i=this.pathArray().filter((l,u)=>u!==n).join("\0");this.sourceDataForm.controls.path.setValue(`${o}\0${i}`)}getPath(){return this.sourceDataForm.value.path??null}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let n=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(`${n}\0${this.newPathCtrl.value}`),this.newPathCtrl.setValue("")}goBack(){this.#t.navigate(["destination"],{relativeTo:this.#o.parent})}next(){this.#t.navigate(["schedule"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=ne({type:e,selectors:[["app-source-data"]],viewQuery:function(t,o){t&1&&Se(o.formRef,go,5),t&2&&Te()},decls:55,vars:12,consts:()=>{let n;n=$localize`Path`;let t;t=$localize`Add a direct path`;let o;o=$localize`Hidden files`;let i;i=$localize`System files`;let l;l=$localize`Temporary files`;let u;u=$localize`Source Data`;let N;N=$localize`Folder path`;let w;w=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let y;y=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let Z;Z=$localize`Source Data`;let J;J=$localize`Add Path`;let L;L=$localize`Add a path directly from your machine.`;let ee;ee=$localize`Filters`;let te;te=$localize`Customize your filters.`;let H;H=$localize`Add filter`;let d;d=$localize`Exclude`;let C;C=$localize`Choose if there’s any files you want to exclude.`;let G;G=$localize` Hidden files ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`;let x;x=$localize` System files ${"\uFFFD#48\uFFFD\uFFFD/#48\uFFFD"}:TAG_INPUT:`;let ie;ie=$localize` Temporary files ${"\uFFFD#51\uFFFD\uFFFD/#51\uFFFD"}:TAG_INPUT:`;let ge;ge=$localize` Files larger than `;let de;return de=$localize`Select an option...`,[["formRef",""],u,N,w,y,Z,J,L,ee,te,H,d,C,G,x,ie,ge,[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,"row-inputs"],["type","text","placeholder",t,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",o,"formControlName","hidden"],["type","checkbox","placeholder",i,"formControlName","system"],["type","checkbox","placeholder",l,"formControlName","temporary"],[1,"raised","primary",3,"click"],["formGroupName","filesLargerThan",1,"row-inputs"],[3,"path"],[3,"pathChange","remove","path"],["type","number","formControlName","size"],["type","text","formControlName","unit","placeholder",de],[3,"value"]]},template:function(t,o){if(t&1){let i=O();a(0,"form",17,0),f("submit",function(){return S(i),T(o.next())}),a(2,"div",18)(3,"h3",19),k(4,1),r(),a(5,"app-file-tree",20)(6,"label",21),k(7,2),r(),_(8,"input",22),r(),a(9,"div",23)(10,"button",24),f("click",function(){return S(i),T(o.goBack())}),h(11,3),_(12,"spk-icon"),D(),r(),a(13,"button",25),h(14,4),_(15,"spk-icon"),D(),r()()(),a(16,"div",26)(17,"h3",19),k(18,5),r(),a(19,"app-toggle-card",27),j(20,28),k(21,6),W(),a(22,"p",29),k(23,7),r(),a(24,"div",30)(25,"spk-form-field"),_(26,"input",31),r(),a(27,"button",32),f("click",function(){return S(i),T(o.addNewPath())}),a(28,"spk-icon"),m(29,"plus"),r()()()(),a(30,"app-toggle-card",27),j(31,28),k(32,8),W(),a(33,"p",29),k(34,9),r(),a(35,"button",33),f("click",function(){return S(i),T(o.addFilter())}),k(36,10),r(),F(37,fo,2,0),r(),a(38,"app-toggle-card",34),j(39,28),k(40,11),W(),a(41,"p",29),k(42,12),r(),a(43,"spk-toggle",35),h(44,13),_(45,"input",36),D(),r(),a(46,"spk-toggle",35),h(47,14),_(48,"input",37),D(),r(),a(49,"spk-toggle",35),h(50,15),_(51,"input",38),D(),r(),a(52,"spk-toggle",39),f("click",function(){return S(i),T(o.toggleFilesLargerThan())}),k(53,16),r(),F(54,To,7,0,"div",40),r()()()}if(t&2){let i;c("formGroup",o.sourceDataForm),s(5),c("multiSelect",!0)("startingPath",o.getPath())("showFiles",!0),s(14),c("disallowToggle",!0),s(7),c("formControl",o.newPathCtrl),s(4),c("disallowToggle",!0),s(7),g((i=o.pathSignal())!=null&&i.length?37:-1),s(),c("disallowToggle",!0),s(14),$e("active",o.filesLargerThan()),s(2),g(o.filesLargerThan()?54:-1)}},dependencies:[dt,Pe,ae,be,Re,se,ye,Oe,ut,Ne,Ae,Ge,pe,ce,le,Ve,me,Le,Qe,Ue,ht],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}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.5rem}"],changeDetection:0})};var Fe=new oe,ue=class e{#e=$(re);#t=$(mt);#o=$(We);#i=$(ft);generalForm=Wt();sourceDataForm=Jt();scheduleForm=Yt();destinationForm=en();optionsForm=qt();isDraft=A(!1);backupId=A(null);isSubmitting=A(!1);finishedLoading=A(!1);backupDefaults=A(null);isNew=K(()=>this.backupId()==="new");selectedOptions=A([]);selectedAdvancedFormPair=A([]);destinationFormPair=A({oauthField:null,custom:[],dynamic:[],advanced:[]});notSelectedAdvancedFormPair=K(()=>{let n=this.destinationFormPair()?.advanced??[],t=this.selectedAdvancedFormPair()??[];return n.filter(o=>t.findIndex(i=>i.name===o.name)===-1)});selectedHttpOptions=A([]);notSelectedHttpOptions=K(()=>{let n=this.httpOptions(),t=this.selectedHttpOptions()??[];return n.filter(o=>t.findIndex(i=>i.name===o.name)===-1)});sourceDataFormSignal=Q(this.sourceDataForm.valueChanges);destinationFormSignal=Q(this.destinationForm.valueChanges);generalFormSignal=Q(this.generalForm.valueChanges);encryptionFieldSignal=Q(this.generalForm.controls.encryption.valueChanges);scheduleFormSignal=Q(this.scheduleForm.valueChanges);destinationOptions=K(()=>this.#t.backendModules()??[]);httpOptions=K(()=>this.#t.systemInfo()?.GenericModules?.find(n=>n.Key==="http-options")?.Options?.map(this.#n)??[]);advancedOptions=K(()=>this.#t.systemInfo()?.Options?.map(this.#n)??[]);#n(n){return{name:n.Name,type:n.Type,shortDescription:n.ShortDescription??void 0,longDescription:n.LongDescription??void 0,options:n.ValidValues}}encryptionOptions=K(()=>{let n=this.#t.systemInfo()?.EncryptionModules??[];return[Ot,...n]});nonSelectedOptions=K(()=>this.advancedOptions().sort((n,t)=>n?.name&&t?.name?n?.name.localeCompare(t?.name):0).filter(n=>this.selectedOptions()?.findIndex(t=>t.name===n.name)===-1));addAdvancedFormPairByName(n,t,o){let i=this.notSelectedAdvancedFormPair().find(l=>l.name===n);i&&this.addAdvancedFormPair(i,t,o)}addHttpOptionByName(n,t,o){let i=this.notSelectedHttpOptions().find(l=>l.name===n);i&&this.addHttpOption(i,t,o)}addAdvancedFormPair(n,t,o){let i=this.destinationForm.controls.destinations.controls.at(t)?.controls.advanced,l=o??n.defaultValue;this.createFormField(i,n,l),this.selectedAdvancedFormPair.set([...this.selectedAdvancedFormPair(),n])}addHttpOption(n,t,o){let i=this.destinationForm.controls.destinations.controls.at(t)?.controls.advanced,l=o??n.defaultValue;this.createFormField(i,n,l),this.selectedHttpOptions.set([...this.selectedHttpOptions(),n])}removeAdvancedFormPair(n,t){this.destinationForm.controls.destinations.controls.at(t)?.controls.advanced.removeControl(n.name),this.selectedAdvancedFormPair().findIndex(i=>i.name===n.name)!==-1?this.selectedAdvancedFormPair.update(i=>(i=i.filter(l=>l.name!==n.name),i)):this.selectedHttpOptions.update(i=>(i=i.filter(l=>l.name!==n.name),i))}removeHttpOption(n,t){this.destinationForm.controls.destinations.controls.at(t)?.controls.advanced.removeControl(n.name),this.selectedHttpOptions.update(o=>(o=o.filter(i=>i.name!==n.name),o))}submit(){this.isSubmitting.set(!0);let n=this.#l(),t=this.backupId();t==="new"||!t||this.isDraft()?this.#o.postApiV1Backups({requestBody:n}).pipe(et(()=>this.isSubmitting.set(!1))).subscribe({next:o=>{console.log("submitted res",o),this.exit()},error:o=>{console.error("submitted error",o)}}):this.#o.putApiV1BackupById({id:t,requestBody:n}).pipe(et(()=>this.isSubmitting.set(!1))).subscribe({next:o=>{console.log("submitted res",o),this.exit()},error:o=>{console.error("submitted error",o)}})}exit(){this.#c(),this.#e.navigate(["/"])}updateFieldsFromTargetUrl(n){this.#r(),setTimeout(()=>{this.#s(n)})}#r(){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 t=n.Sources??"",o=n.Filters?.map(y=>`${y.Include?"":"-"}${y.Expression}`)??[],i=n.Settings?.find(y=>y.Name==="--exclude-files-attributes")?.Value??"",l=n.Settings?.find(y=>y.Name==="--skip-files-larger-than")??null,u=l?.Value.replace(/[0-9]/g,"")??null,N=l?.Value.replace(/[^0-9]/g,"")??null,w={path:[...t,...o].join("\0"),excludes:{hiddenFiles:i.includes("hidden"),systemFiles:i.includes("system"),tempFiles:i.includes("temporary"),filesLargerThan:u&&N?{size:parseInt(N),unit:u.toUpperCase()}:null}};this.sourceDataForm.patchValue(w)}mapDestinationToForm(n){let t=n.TargetURL?Nt(n.TargetURL):null;t&&this.addDestinationFormGroup(t.destinationType,{custom:t.custom,dynamic:t.dynamic,advanced:t.advanced},!0)}#s(n){let t=Nt(n);t&&this.addDestinationFormGroup(t.destinationType,{custom:t.custom,dynamic:t.dynamic,advanced:t.advanced},!0)}mapGeneralToForm(n){let t=n.Settings?.find(l=>l.Name==="encryption-module"),o=t?.Value&&t.Value.length?t.Value:"",i={name:n.Name??"",description:n.Description??""};o&&o!==""&&(i.encryption=o),this.generalForm.patchValue(i)}mapScheduleToForm(n){if(!n){this.scheduleForm.patchValue({autoRun:!0});return}let t=this.#i.fromString(n.Repeat)??null,i={nextTime:this.#p(n.Time),runAgain:{repeatValue:t?.value??1,repeatUnit:t?.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}}};this.scheduleForm.patchValue(i)}mapOptionsToForms(n){let t=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than"],o=this.advancedOptions();n.Settings?.forEach(i=>{if(i.Name==="encryption-module")return this.generalForm.controls.encryption.setValue(i.Value??"");if(!(i.Name&&t.includes(i.Name))){if(i.Name==="dblock-size"){let l=i.Value?.replace(/[^0-9]/g,""),u=i.Value?.replace(/[0-9]/g,"");return this.optionsForm.controls.remoteVolumeSize.setValue({size:l?parseInt(l):null,unit:u?u.toUpperCase():null})}if(i.Name&&i.Value){let l=o.find(u=>u.name===i.Name);if(!l)return;this.addOptionToFormGroup(l,i.Value)}}})}getCurrentTargetUrl(){return this.#a(this.destinationForm.controls.destinations)}#l(){let n=this.generalForm.value,t=this.optionsForm.value,o=this.scheduleForm.value,i=this.sourceDataForm.value,u=this.destinationForm.value.destinations?.length?this.#a(this.destinationForm.controls.destinations):[],N=null;o.runAgain?.repeatUnit&&o.runAgain?.repeatValue&&(N=this.#i.toString(o.runAgain.repeatValue,o.runAgain.repeatUnit));let w=o.runAgain?.allowedDays?Object.entries(o.runAgain?.allowedDays).filter(([d,C])=>C).map(([d,C])=>d):[],y=i.path?.split("\0")??[],Z=n.encryption===""?{Name:"--no-encryption",Value:"True"}:{Name:"encryption-module",Value:n.encryption??null},J=this.advancedOptions(),L=Object.entries(t.advancedOptions??{}).filter(([d,C])=>d&&C).map(([d,C])=>{let G=J.find(x=>x.name===d);return G?.type==="Size"?{Name:d,Value:`${C.size}${C.unit.toLowerCase()}`}:G?.type==="Integer"?{Name:d,Value:C.toString()}:G?.type==="Boolean"?{Name:d,Value:C.toString()}:{Name:d,Value:C}}),ee=[Z,...L],te=Object.entries(i.excludes??{}).filter(([d,C])=>C&&d!=="filesLargerThan").map(([d])=>d),H=i.excludes?.filesLargerThan;return te.length&&ee.push({Name:"--exclude-files-attributes",Value:te.join(",")}),H&&H.size!==null&&H.unit!==null&&ee.push({Name:"--skip-files-larger-than",Value:`${H.size}${H.unit}`}),{Backup:{Name:n.name,Description:n.description,TargetURL:u[0]??null,Sources:y.filter(d=>!d.startsWith("-")),Settings:ee,Filters:y.filter(d=>d.startsWith("-")).map((d,C)=>({Order:C,Include:!1,Expression:d.slice(1)}))},Schedule:o.autoRun?{Repeat:N,Time:o.nextTime?.date?new Date(`${o.nextTime.date}T${o.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:w}:null}}#a(n){return n.controls.map(t=>St(t.value))}#p(n){if(!n||n?.indexOf("T")===-1)return{time:n??"13:00"};let t=new Date(n),o={time:`${(""+t.getHours()).padStart(2,"0")}:${(""+t.getMinutes()).padStart(2,"0")}`};return n.indexOf("T")!==-1&&(o.date=t.toISOString().split("T")[0]),o}removeOptionFromFormGroup(n){let t=n.name;t&&(this.optionsForm.controls.advancedOptions.removeControl(t),this.selectedOptions.update(o=>(o=o.filter(i=>i.name!==t),o)))}addOptionToFormGroup(n,t){let o=this.optionsForm.controls.advancedOptions;this.createFormField(o,n,t??n.defaultValue),this.selectedOptions.update(i=>(i.push(n),i))}createFormField(n,t,o){if(t.type==="String"||t.type==="FileTree"||t.type==="FolderTree"||t.type==="Password"||t.type==="Enumeration"||t.type==="NonValidatedSelectableString"||t.type==="Path"){n.addControl(t.name,Fe.control(o));return}if(t.type==="Size"){let i=o.replace(/[0-9]/g,""),l=o.replace(/[^0-9]/g,"");n.addControl(t.name,Fe.group({size:Fe.control(l?parseInt(l):50),unit:Fe.control(i?i.toUpperCase():"MB")}));return}if(t.type==="Integer"){n.addControl(t.name,Fe.control(o?parseInt(o):0));return}if(t.type==="Boolean"){n.addControl(t.name,Fe.control(o==="true"));return}if(t.type==="Flags"){n.addControl(t.name,Fe.control(o??""));return}if(t.type==="Timespan"){n.addControl(t.name,Fe.control(o,[Ee.pattern(/([-+]?\d{1,3}[smhDWMY])+/)]));return}}addDestinationFormGroup(n,t,o=!1){let i=Ke.find(d=>d.customKey===n||d.key===n),l=i?.key,u=this.destinationOptions().find(d=>d.Key===l),N=this.httpOptions();if(!u||!u.Options)return;let w=i&&i.oauthField?i.oauthField:null,y=i&&i.customFields?i.customFields:{},Z=i&&i.dynamicFields?i.dynamicFields:[],J=i&&i.advancedFields?i.advancedFields:[],L=i&&i.ignoredAdvancedFields?i.ignoredAdvancedFields:[];this.destinationFormPair.set({oauthField:w,custom:[],dynamic:[],advanced:[]});let ee=Fe.group({}),te=Fe.group({}),H=Fe.group({});y&&Object.entries(y).forEach(([d,C],G)=>{let ge=C,{formElement:x}=ge,ie=Mt(ge,["formElement"]);ee.addControl(d,x(t?.custom[d])),this.destinationFormPair.update(de=>(de.custom.push(P({order:900+G},ie)),de))});for(let d=0;d<u.Options.length;d++){let C=u.Options[d];if(C.Deprecated)continue;let G=Z.find(x=>x===C.Name||x.name===C.Name);if(G){let x=G&&typeof G!="string",ie=x?G?.defaultValue??C.DefaultValue:C.DefaultValue,ge={name:C.Name,type:C.Type,shortDescription:C.ShortDescription??void 0,longDescription:C.LongDescription??void 0,options:C.ValidValues,order:900+d},de=x?P(P({},ge),G):ge,at=t?.dynamic[C.Name]??ie??C.DefaultValue;this.createFormField(te,de,at),this.destinationFormPair.update(je=>(je.dynamic.push(de),je))}else{if(L.find(Ce=>Ce===C.Name))continue;let ie=J.find(Ce=>Ce===C.Name||Ce.name===C.Name),ge=ie&&typeof ie!="string",de=t?.advanced[C.Name],U=de??C.DefaultValue,at={name:C.Name,type:C.Type,shortDescription:C.ShortDescription??void 0,longDescription:C.LongDescription??void 0,options:C.ValidValues,defaultValue:U,order:900+d},je=ge?P(P({},at),ie):at;o&&de&&(this.createFormField(H,je,U),this.selectedAdvancedFormPair.update(Ce=>(Ce.push(je),Ce))),this.destinationFormPair.update(Ce=>(Ce.advanced.push(je),Ce))}}for(let d=0;d<N.length;d++){let C=N[d],G=t?.advanced[C.name],x=G??C.defaultValue;o&&G&&(this.createFormField(H,C,x),this.selectedHttpOptions.update(ie=>(ie.push(C),ie)))}this.destinationFormPair.update(d=>({oauthField:d.oauthField,custom:d.custom.sort((C,G)=>C.order-G.order),dynamic:d.dynamic.sort((C,G)=>C.order-G.order),advanced:d.advanced.sort((C,G)=>C.order-G.order)})),this.destinationForm.controls.destinations.push(tn({key:i?.customKey??n,customGroup:ee,dynamicGroup:te,advancedGroup:H}))}#c(){this.generalForm.reset(),this.destinationForm.controls.destinations.clear(),this.destinationForm.reset(),this.sourceDataForm.reset(),this.scheduleForm.reset(),this.optionsForm.reset()}static \u0275fac=function(t){return new(t||e)};static \u0275prov=we({token:e,factory:e.\u0275fac,providedIn:"root"})};var Do=["formRef"],Eo=(e,n,t,o)=>({index:e,formView:n,formGroupName:"custom",destinationType:t,oauthField:o}),Et=e=>({$implicit:e}),yo=(e,n,t,o)=>({index:e,formView:n,formGroupName:"dynamic",destinationType:t,oauthField:o}),Po=(e,n,t,o)=>({index:e,formView:n,formGroupName:"advanced",destinationType:t,oauthField:o}),No=(e,n,t,o)=>({index:e,formView:n,formGroupName:"advanced",asHttpOptions:!0,destinationType:t,oauthField:o}),Ao=()=>({maxWidth:"700px",width:"100%"});function Oo(e,n){e&1&&(h(0,2,2),_(1,"spk-icon"),D())}function ko(e,n){e&1&&k(0,2,3)}function xo(e,n){if(e&1){let t=O();h(0,2,1),a(1,"button",19),f("click",function(){S(t);let i=p();return T(i.testDestination())}),F(2,Oo,2,0)(3,ko,1,0),r(),D()}if(e&2){let t=p();s(),$e("success",t.successfulTest()),s(),g(t.successfulTest()?2:3)}}function $o(e,n){if(e&1){let t=O();a(0,"p",25),f("click",function(){S(t);let i=p();return T(i.removeDestinationFormGroup(i.destinationCount()-1))}),h(1,5),_(2,"span",26),D(),r()}}function Io(e,n){e&1&&(a(0,"p"),k(1,6),r())}function Mo(e,n){if(e&1){let t=O();a(0,"div",31),f("click",function(){let i=S(t).$implicit,l=p(2);return T(l.addDestinationFormGroup(i.key))}),a(1,"h3"),m(2),r(),a(3,"p"),m(4),r()()}if(e&2){let t=n.$implicit;s(2),B(t.displayName),s(2),B(t.description)}}function vo(e,n){if(e&1){let t=O();a(0,"button",32),f("click",function(){let i=S(t).$implicit,l=p(2);return T(l.addDestinationFormGroup(i.key))}),m(1),r()}if(e&2){let t=n.$implicit;s(),V(" ",t.displayName," ")}}function wo(e,n){if(e&1&&(a(0,"div",27),M(1,Mo,5,2,"div",28,I),r(),a(3,"spk-menu")(4,"button",29),k(5,7),r(),j(6,18),M(7,vo,2,1,"button",30,I),W(),r()),e&2){let t=p();s(),v(t.destinationTypeOptionsFocused()),s(6),v(t.destinationTypeOptionsNotFocused())}}function Ro(e,n){e&1&&ze(0)}function bo(e,n){if(e&1&&F(0,Ro,1,0,"ng-container",37),e&2){let t,o=n.$implicit,i=n.$index;p();let l=he(29),u=p();c("ngTemplateOutlet",l)("ngTemplateOutletContext",Xe(7,Et,it(2,Eo,i,o,(t=u.destinationFormSignal())==null||t.destinations==null||t.destinations[0]==null?null:t.destinations[0].destinationType,u.destinationFormPair().oauthField)))}}function Go(e,n){e&1&&ze(0)}function Vo(e,n){if(e&1&&F(0,Go,1,0,"ng-container",37),e&2){let t,o=n.$implicit,i=n.$index;p();let l=he(29),u=p();c("ngTemplateOutlet",l)("ngTemplateOutletContext",Xe(7,Et,it(2,yo,i,o,(t=u.destinationFormSignal())==null||t.destinations==null||t.destinations[0]==null?null:t.destinations[0].destinationType,u.destinationFormPair().oauthField)))}}function Lo(e,n){if(e&1){let t=O();h(0,8,1),a(1,"button",32),f("click",function(){let i=S(t).$implicit,l=p(2);return T(l.addAdvancedFormPair(i,0))}),r(),D()}if(e&2){let t=n.$implicit;s(),nt(t.name),ot(0)}}function Uo(e,n){e&1&&ze(0)}function Bo(e,n){if(e&1&&F(0,Uo,1,0,"ng-container",37),e&2){let t,o=n.$implicit,i=n.$index;p();let l=he(29),u=p();c("ngTemplateOutlet",l)("ngTemplateOutletContext",Xe(7,Et,it(2,Po,i,o,(t=u.destinationFormSignal())==null||t.destinations==null||t.destinations[0]==null?null:t.destinations[0].destinationType,u.destinationFormPair().oauthField)))}}function Ko(e,n){if(e&1){let t=O();h(0,9,1),a(1,"button",32),f("click",function(){let i=S(t).$implicit,l=p(2);return T(l.addHttpOption(i,0))}),r(),D()}if(e&2){let t=n.$implicit;s(),nt(t.name),ot(0)}}function zo(e,n){e&1&&ze(0)}function Xo(e,n){if(e&1&&F(0,zo,1,0,"ng-container",37),e&2){let t,o=n.$implicit,i=n.$index;p();let l=he(29),u=p();c("ngTemplateOutlet",l)("ngTemplateOutletContext",Xe(7,Et,it(2,No,i,o,(t=u.destinationFormSignal())==null||t.destinations==null||t.destinations[0]==null?null:t.destinations[0].destinationType,u.destinationFormPair().oauthField)))}}function Ho(e,n){if(e&1&&(a(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function jo(e,n){if(e&1&&(a(0,"app-file-tree",40)(1,"label",47),m(2),F(3,Ho,3,1,"spk-tooltip",48),r(),_(4,"input",49),r()),e&2){let t,o=p().$implicit,i=p(2);c("startingPath",i.getFormFieldValue(0,o.formGroupName,o.formView.name))("accepts",o.formView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),s(),z("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),z("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),X("formControlName",o.formView.name)}}function Wo(e,n){if(e&1&&(a(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function qo(e,n){if(e&1&&(a(0,"app-file-tree",41)(1,"label",47),m(2),F(3,Wo,3,1,"spk-tooltip",48),r(),_(4,"input",49),r()),e&2){let t,o=p().$implicit,i=p(2);c("startingPath",i.getFormFieldValue(0,o.formGroupName,o.formView.name)),s(),z("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),z("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),X("formControlName",o.formView.name)}}function Qo(e,n){if(e&1&&(a(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function Yo(e,n){e&1&&(a(0,"spk-icon",51),m(1,"link"),r())}function Zo(e,n){e&1&&(a(0,"spk-icon",51),m(1,"envelope"),r())}function Jo(e,n){e&1&&(a(0,"spk-icon",51),m(1,"textbox"),r())}function ei(e,n){if(e&1&&(a(0,"spk-form-field")(1,"label",47),m(2),F(3,Qo,3,1,"spk-tooltip",48),r(),_(4,"input",50),F(5,Yo,2,0,"spk-icon",51)(6,Zo,2,0,"spk-icon",51)(7,Jo,2,0,"spk-icon",51),r()),e&2){let t,o=p().$implicit;s(),z("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),z("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),X("formControlName",o.formView.name),c("type",o.formView.type==="Email"?"email":"text"),s(),g(o.formView.type==="Path"?5:o.formView.type==="Email"?6:7)}}function ti(e,n){if(e&1){let t=O();a(0,"span",55),f("click",function(){S(t);let i=p(2).$implicit,l=p(2);return T(l.oauthStartTokenCreation(i.destinationType))}),m(1,"AuthID"),r()}}function ni(e,n){e&1&&(a(0,"spk-icon",51),m(1,"password"),r())}function oi(e,n){if(e&1){let t=O();a(0,"spk-icon",56),f("click",function(){S(t);let i=p(2).$implicit;return T(i.formView.showPassword=!i.formView.showPassword)}),m(1," eye "),r()}}function ii(e,n){if(e&1){let t=O();a(0,"spk-icon",56),f("click",function(){S(t);let i=p(2).$implicit;return T(i.formView.showPassword=!i.formView.showPassword)}),m(1," eye-slash "),r()}}function ri(e,n){if(e&1&&(a(0,"spk-form-field")(1,"label",47),m(2),r(),_(3,"input",52),F(4,ti,2,0,"span",53)(5,ni,2,0,"spk-icon",51)(6,oi,2,0,"spk-icon",54)(7,ii,2,0,"spk-icon",54),r()),e&2){let t,o=p().$implicit;s(),z("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),z("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),X("formControlName",o.formView.name),c("type",o.formView.showPassword?"text":"password"),s(),g(o.oauthField===o.formView.name?4:5),s(2),g(o.formView.showPassword?6:7)}}function ai(e,n){if(e&1&&(a(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function si(e,n){if(e&1&&(a(0,"spk-option",57),m(1),r()),e&2){let t=n.$implicit;c("value",t.value),s(),yt(" ",t.key," ",t.value?"("+t.value+")":""," ")}}function li(e,n){if(e&1&&M(0,si,2,3,"spk-option",57,I),e&2){let t=p(2).$implicit,o=p(2);v(t.formView.loadOptions(o.injector)())}}function pi(e,n){if(e&1&&(a(0,"spk-option",57),m(1),r()),e&2){let t=n.$implicit;c("value",t),s(),B(t)}}function ci(e,n){if(e&1&&M(0,pi,2,2,"spk-option",57,I),e&2){let t=p(2).$implicit;v(t.formView.options)}}function mi(e,n){if(e&1&&(a(0,"spk-select",42)(1,"label",47),m(2),F(3,ai,3,1,"spk-tooltip",48),r(),_(4,"input",49),F(5,li,2,0)(6,ci,2,0),r()),e&2){let t,o=p().$implicit;c("hideClearButton",!0),s(),z("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),z("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),X("formControlName",o.formView.name),s(),g(o.formView.loadOptions?5:-1),s(),g(o.formView.options?6:-1)}}function _i(e,n){if(e&1&&(a(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function ui(e,n){if(e&1&&(a(0,"spk-option",57),m(1),r()),e&2){let t=n.$implicit;c("value",t.value),s(),yt(" ",t.key," ",t.value?"("+t.value+")":""," ")}}function di(e,n){if(e&1&&M(0,ui,2,3,"spk-option",57,I),e&2){let t=p(2).$implicit,o=p(2);v(t.formView.loadOptions(o.injector)())}}function Fi(e,n){if(e&1&&(a(0,"spk-option",57),m(1),r()),e&2){let t=n.$implicit;c("value",t),s(),B(t)}}function gi(e,n){if(e&1&&M(0,Fi,2,2,"spk-option",57,I),e&2){let t=p(2).$implicit;v(t.formView.options)}}function Ci(e,n){if(e&1&&(a(0,"spk-select",43)(1,"label",47),m(2),F(3,_i,3,1,"spk-tooltip",48),r(),_(4,"input",58),F(5,di,2,0)(6,gi,2,0),r()),e&2){let t,o=p().$implicit;c("isFreeText",!0),s(),z("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),z("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),X("formControlName",o.formView.name),s(),g(o.formView.loadOptions?5:-1),s(),g(o.formView.options?6:-1)}}function fi(e,n){if(e&1&&(a(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function Si(e,n){if(e&1&&(a(0,"spk-option",57),m(1),r()),e&2){let t=n.$implicit;c("value",t),s(),B(t)}}function Ti(e,n){if(e&1&&(a(0,"div",44)(1,"label",47),m(2),F(3,fi,3,1,"spk-tooltip",48),r(),a(4,"div",59)(5,"spk-form-field"),_(6,"input",60),a(7,"spk-icon",51),m(8,"resize"),r()(),a(9,"spk-select"),_(10,"label")(11,"input",61),M(12,Si,2,2,"spk-option",57,I),r()()()),e&2){let t,o=p().$implicit,i=p(2);c("formGroupName",o.formView.name),s(),z("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(3),z("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),s(6),v(i.sizeOptions())}}function hi(e,n){if(e&1&&(a(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function Di(e,n){if(e&1&&(a(0,"spk-form-field")(1,"label",47),m(2),F(3,hi,3,1,"spk-tooltip",48),r(),_(4,"input",62),a(5,"spk-icon",51),m(6,"numpad"),r()()),e&2){let t,o=p().$implicit;s(),z("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),z("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),X("formControlName",o.formView.name)}}function Ei(e,n){if(e&1&&(a(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function yi(e,n){if(e&1&&(a(0,"spk-toggle",45)(1,"label",47),m(2),F(3,Ei,3,1,"spk-tooltip",48),r(),_(4,"input",63),r()),e&2){let t,o=p().$implicit;s(),z("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),z("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),X("formControlName",o.formView.name)}}function Pi(e,n){if(e&1&&(a(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function Ni(e,n){e&1&&(a(0,"spk-option",65),m(1,"None"),r()),e&2&&c("value","None")}function Ai(e,n){if(e&1&&(a(0,"spk-option",57),m(1),_(2,"spk-checkbox",66),r()),e&2){let t=p().$implicit;c("value",t),s(),V(" ",t," ")}}function Oi(e,n){if(e&1&&F(0,Ni,2,1,"spk-option",65)(1,Ai,3,2,"spk-option",57),e&2){let t=n.$implicit;g(t==="None"?0:1)}}function ki(e,n){if(e&1&&(a(0,"spk-select",46)(1,"label",47),m(2),F(3,Pi,3,1,"spk-tooltip",48),r(),_(4,"input",64),M(5,Oi,2,1,null,null,I),r()),e&2){let t,o=p().$implicit;c("selectMultiple",!0),s(),z("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),X("formControlName",o.formView.name),s(),v(o.formView.options)}}function xi(e,n){if(e&1&&(a(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),r()()),e&2){let t=p(2).$implicit;c("message",t.formView.longDescription)}}function $i(e,n){if(e&1&&(a(0,"spk-form-field")(1,"label",47),m(2),F(3,xi,3,1,"spk-tooltip",48),r(),_(4,"input",49),r()),e&2){let t,o=p().$implicit;s(),z("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),s(),V(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),s(),g(o.formView.longDescription?3:-1),s(),z("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),X("formControlName",o.formView.name)}}function Ii(e,n){if(e&1){let t=O();a(0,"button",67),f("click",function(){S(t);let i=p().$implicit,l=p(2);return T(l.removeFormView(i.formView,0))}),a(1,"spk-icon"),m(2,"x-circle"),r()()}}function Mi(e,n){if(e&1&&(a(0,"div",38),j(1,39),F(2,jo,5,16,"app-file-tree",40)(3,qo,5,12,"app-file-tree",41)(4,ei,8,13,"spk-form-field")(5,ri,8,13,"spk-form-field")(6,mi,7,14,"spk-select",42)(7,Ci,7,14,"spk-select",43)(8,Ti,14,11,"div",44)(9,Di,7,11,"spk-form-field")(10,yi,5,11,"spk-toggle",45)(11,ki,7,8,"spk-select",46)(12,$i,5,11,"spk-form-field"),W(),F(13,Ii,3,0,"button",29),r()),e&2){let t=n.$implicit;$e("single-field",t.formGroupName!=="advanced"),s(),c("formGroupName",t.formGroupName),s(),g(t.formView.type==="FileTree"?2:t.formView.type==="FolderTree"?3:t.formView.type==="String"||t.formView.type==="Path"||t.formView.type==="Email"?4:t.formView.type==="Password"?5:t.formView.type==="Enumeration"?6:t.formView.type==="NonValidatedSelectableString"?7:t.formView.type==="Size"?8:t.formView.type==="Integer"?9:t.formView.type==="Boolean"?10:t.formView.type==="Flags"?11:t.formView.type==="Timespan"?12:-1),s(11),g(t.formGroupName==="advanced"?13:-1)}}function vi(e,n){if(e&1&&(j(0,20)(1,33),M(2,bo,1,9,"ng-container",null,I),M(4,Vo,1,9,"ng-container",null,I),a(6,"app-toggle-card",34),j(7,35),h(8,8),a(9,"spk-menu")(10,"button",36),_(11,"spk-icon"),r(),j(12,18),M(13,Lo,2,1,"button",30,I),W(),r(),D(),W(),M(15,Bo,1,9,"ng-container",null,I),r(),a(17,"app-toggle-card",34),j(18,35),h(19,9),a(20,"spk-menu")(21,"button",36),_(22,"spk-icon"),r(),j(23,18),M(24,Ko,2,1,"button",30,I),W(),r(),D(),W(),M(26,Xo,1,9,"ng-container",null,I),r(),F(28,Mi,14,5,"ng-template",null,1,lt),W()()),e&2){let t=p();s(2),v(t.destinationFormPair().custom),s(2),v(t.destinationFormPair().dynamic),s(2),c("disallowToggle",!0),s(4),c("disabled",t.notSelectedAdvancedFormPair().length===0),s(3),v(t.notSelectedAdvancedFormPair()),s(2),v(t.selectedAdvancedFormPair()),s(2),c("disallowToggle",!0),s(4),c("disabled",t.notSelectedHttpOptions().length===0),s(3),v(t.notSelectedHttpOptions()),s(2),v(t.selectedHttpOptions())}}function wi(e,n){if(e&1){let t=O();a(0,"spk-dialog",68),bt("isOpenChange",function(i){S(t);let l=p();return Rt(l.targetUrlDialogOpen,i)||(l.targetUrlDialogOpen=i),T(i)}),a(1,"header",69)(2,"h2"),k(3,10),r(),a(4,"spk-alert",70),k(5,11),r()(),a(6,"div",71)(7,"spk-form-field"),_(8,"textarea",72),r()(),a(9,"footer",73)(10,"button",22),f("click",function(){S(t);let i=p();return T(i.closeTargetUrlDialog(!1))}),m(11,"Cancel"),r(),a(12,"button",74),f("click",function(){S(t);let i=p();return T(i.closeTargetUrlDialog(!0))}),h(13,12),_(14,"spk-icon"),D(),r()()()}if(e&2){let t=p();wt("isOpen",t.targetUrlDialogOpen),c("options",Gt(3,Ao)),s(8),c("formControl",t.targetUrlCtrl)}}var Ri=["Bytes","KB","MB","GB","TB","PB"],Dt=new oe,en=(e={destinations:[]})=>Dt.group({destinations:Dt.array(e.destinations)}),tn=({key:e,customGroup:n,dynamicGroup:t,advancedGroup:o})=>Dt.group({destinationType:Dt.control(e),custom:n,dynamic:t,advanced:o}),It=class e{#e=$(re);#t=$(De);#o=$(Lt);#i=$(We);#n=$(ue);#r=$(zt);injector=$(vt);formRef=fe.required("formRef");destinationForm=this.#n.destinationForm;destinationFormPair=this.#n.destinationFormPair;selectedAdvancedFormPair=this.#n.selectedAdvancedFormPair;notSelectedAdvancedFormPair=this.#n.notSelectedAdvancedFormPair;selectedHttpOptions=this.#n.selectedHttpOptions;notSelectedHttpOptions=this.#n.notSelectedHttpOptions;destinationOptions=this.#n.destinationOptions;destinationFormSignal=this.#n.destinationFormSignal;destinationCount=K(()=>this.destinationFormSignal()?.destinations?.length??0);sizeOptions=A(Ri);successfulTest=A(!1);destinationTypeOptionsInFocus=A(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=A(Ke.map(n=>({key:n.customKey??n.key,customKey:n.customKey??null,displayName:n.displayName,description:n.description})));destinationTypeOptionsFocused=K(()=>{let n=this.destinationTypeOptionsInFocus(),t=this.destinationTypeOptions();return n.map(o=>t.find(i=>i.key===o))});destinationTypeOptionsNotFocused=K(()=>{let n=this.destinationTypeOptionsInFocus();return this.destinationTypeOptions().filter(o=>!n.includes(o.key))});getFormFieldValue(n,t,o){return((this.destinationForm.controls.destinations.controls?.[n]).controls?.[t]).controls[o].value}addDestinationFormGroup(n){this.#n.addDestinationFormGroup(n)}addAdvancedFormPair(n,t){this.#n.addAdvancedFormPair(n,t)}removeFormView(n,t){this.#n.removeAdvancedFormPair(n,t)}addHttpOption(n,t){this.#n.addHttpOption(n,t)}targetUrl=K(()=>this.#n.getCurrentTargetUrl()[0]);targetUrlCtrl=new _t;targetUrlInitial=A(null);targetUrlDialogOpen=A(!1);openTargetUrlDialog(){let t=this.#n.getCurrentTargetUrl()[0];this.targetUrlCtrl.setValue(t),this.targetUrlInitial.set(t),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl.value,o=this.targetUrlInitial();!n||t===o||this.#n.updateFieldsFromTargetUrl(this.targetUrlCtrl.value)}testDestination(n=0){let o=this.#n.getCurrentTargetUrl()[n];o&&this.#i.postApiV1RemoteoperationTest({requestBody:{path:o}}).subscribe({next:()=>{this.successfulTest.set(!0),setTimeout(()=>{this.successfulTest.set(!1)},3e3)},error:i=>{let l=i.error.error.Error;if(l==="missing-folder"&&this.#r.open(He,{data:{title:$localize`Create folder`,message:$localize`The remote destination folder does not exist, do you want to create it?`},closed:u=>{u&&this.#i.postApiV1RemoteoperationCreate({requestBody:{path:o}}).subscribe()}}),l.startsWith("incorrect-cert:")){let u=l.split("incorrect-cert:")[1];this.#r.open(He,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
|
|
2
2
|
If this is a self-signed certificate, you can choose to trust this certificate.
|
|
3
3
|
The server reported the certificate hash: ${u}`,confirmText:"Trust the certificate",cancelText:"Cancel"},closed:N=>{N&&this.#n.addHttpOptionByName("accept-specified-ssl-hash",u)}})}if(l.startsWith("incorrect-host-key:")){let u=l.split('incorrect-host-key:"')[1].split('",')[0],N=l.split('accepted-host-key:"')[1].split('",')[0];N?this.#r.open(He,{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
4
|
otherwise you could be the victim of a MAN-IN-THE-MIDDLE attack.
|