@duplicati/ngclient 0.0.176 → 0.0.178
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chunk-27UON6YV.js +2 -0
- package/{chunk-YDYZVJL7.js → chunk-5HQJVUNE.js} +1 -1
- package/{chunk-HIGBOVIL.js → chunk-5MXXIFJM.js} +1 -1
- package/chunk-5UXRNNTT.js +1 -0
- package/{chunk-AARZFLQF.js → chunk-6O5DBV6Y.js} +1 -1
- package/{chunk-IEJFUREF.js → chunk-7IQ5FSGI.js} +1 -1
- package/chunk-AJMSZFGR.js +1 -0
- package/{chunk-572ZKCWP.js → chunk-EBKB4YCL.js} +1 -1
- package/chunk-F3RWB4I6.js +1 -0
- package/chunk-G4FG3YUE.js +1 -0
- package/{chunk-QZHZ63E4.js → chunk-H6UYYWCU.js} +1 -1
- package/chunk-J5LEAYPL.js +1 -0
- package/{chunk-OYAOXZG6.js → chunk-JTQDY6AH.js} +1 -1
- package/chunk-JTZ2JEV4.js +1 -0
- package/{chunk-PD4KFJ3B.js → chunk-KR56GPXG.js} +1 -1
- package/{chunk-CQHV3YBT.js → chunk-M7SLT3MF.js} +1 -1
- package/{chunk-QUNTZXIA.js → chunk-N4ADMNNU.js} +1 -1
- package/{chunk-UAHCA2OX.js → chunk-NEQW3H7F.js} +1 -1
- package/chunk-OC3JR7EH.js +2 -0
- package/{chunk-ZY7F7R4C.js → chunk-PCLJOXMF.js} +1 -1
- package/{chunk-72QKZIRA.js → chunk-PJLZ7V22.js} +1 -1
- package/{chunk-MDPEVWF6.js → chunk-PNECF7JS.js} +1 -1
- package/{chunk-OZYS4BIC.js → chunk-PUOOECEB.js} +1 -1
- package/chunk-PW55LN2T.js +1 -0
- package/{chunk-MMOME6E7.js → chunk-QZJ7QZZ4.js} +1 -1
- package/{chunk-UVLPXF5A.js → chunk-R6XDJFPE.js} +1 -1
- package/chunk-TXPM764C.js +1 -0
- package/{chunk-SNHYMIA2.js → chunk-U4T4BSPF.js} +1 -1
- package/chunk-WHLIHNEE.js +1 -0
- package/{chunk-AVM5IYXU.js → chunk-WNOXOC4X.js} +1 -1
- package/{chunk-W3MVYBQK.js → chunk-WS7QWRRY.js} +1 -1
- package/chunk-WWIKIIGV.js +7 -0
- package/chunk-WWIXPGSZ.js +1 -0
- package/chunk-XRXXVFJ4.js +1 -0
- package/{chunk-QBRRL3NE.js → chunk-XZZDJCRM.js} +1 -1
- package/chunk-YQSTMC2K.js +1 -0
- package/index.html +1 -1
- package/{main-D327D2YQ.js → main-OOXK65IC.js} +1 -1
- package/package.json +1 -1
- package/chunk-2AXRVJXN.js +0 -1
- package/chunk-4LHT2BIC.js +0 -1
- package/chunk-7Z3BXDXF.js +0 -1
- package/chunk-A5BWJRDE.js +0 -1
- package/chunk-JQI6VBST.js +0 -1
- package/chunk-KK7TLGME.js +0 -2
- package/chunk-MFGT2RTI.js +0 -1
- package/chunk-NNEWZCWG.js +0 -1
- package/chunk-NXRFZLMT.js +0 -2
- package/chunk-NZE46NN5.js +0 -1
- package/chunk-P7PYTH77.js +0 -7
- package/chunk-RHSRAHP5.js +0 -1
- package/chunk-TZ6RGGOS.js +0 -1
- package/chunk-WLZPN7LT.js +0 -1
- package/chunk-ZHZO6RKF.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as b,r as L}from"./chunk-RYXU2QDS.js";import{b as N}from"./chunk-BKANUILG.js";import{E,Mc as U,R as A,W as w,la as k,p as S}from"./chunk-XYHHESIX.js";import{a as s,b as D}from"./chunk-7CGTOI24.js";var h=class{constructor(t){this.loader=t}_data=k(void 0);_isLoading=!1;_loaded=!1;load(){return!this._loaded&&!this._isLoading&&(this._isLoading=!0,this.loader().pipe(E(()=>this._isLoading=!1)).subscribe(t=>{this._data.set(t),this._loaded=!0})),this._data.asReadonly()}value(){return this._data.asReadonly()}isLoading(){return this._isLoading}isLoaded(){return this._loaded}reset(){this._data.set(void 0),this._loaded=!1}};var g=class e{#e=w(N);#o=new h(()=>this.getS3Config("Providers"));#n=new h(()=>this.getS3Config("Regions"));#r=new h(()=>this.getS3Config("RegionHosts"));#i=new h(()=>this.getS3Config("StorageClasses"));#s=U(()=>{let t=this.#o.value()(),o=this.#r.value()(),r=[...t??[],...o?.map(n=>({key:`Amazon ${n.key}`,value:n.value}))??[]];return Array.from(new Map(r.map(n=>[n.value,n])).values())});#a=new h(()=>this.getStorjConfig("Satellites"));#l=new h(()=>this.getStorjConfig("AuthenticationMethods"));#c=new h(()=>this.getOpenstackConfig("Providers"));#p=new h(()=>this.getOpenstackConfig("Versions"));#u=new h(()=>this.getGcsConfig("Locations"));#m=new h(()=>this.getGcsConfig("StorageClasses"));getS3AllProviders(){return this.#o.load(),this.#r.load(),this.#s}getS3Providers(){return this.#o.load()}getS3Regions(){return this.#n.load()}getS3RegionHosts(){return this.#r.load()}getS3StorageClasses(){return this.#i.load()}getStorjSatellites(){return this.#a.load()}getStorjAuthenticationMethods(){return this.#l.load()}getOpenstackProviders(){return this.#c.load()}getOpenstackVersions(){return this.#p.load()}getGcsLocations(){return this.#u.load()}getGcsStorageClasses(){return this.#m.load()}getS3Config(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-getconfig",requestBody:{"s3-config":t}}).pipe(S(o=>this.#t(o)))}createS3IamUser(t,o){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"CanCreateUser","s3-username":t,"s3-password":o}})}createS3PolicyIAM(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"GetPolicyDoc",path:t}})}getStorjConfig(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"storj-getconfig",requestBody:{"storj-config":t}}).pipe(S(o=>this.#t(o)))}getOpenstackConfig(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"openstack-getconfig",requestBody:{"openstack-config":t}}).pipe(S(o=>this.#t(o)))}getGcsConfig(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"gcs-getconfig",requestBody:{"gcs-config":t}}).pipe(S(o=>this.#t(o)))}#t(t){return(t.Result&&typeof t.Result=="object"&&Object.entries(t.Result).map(([o,r])=>({key:o,value:r})))??[]}static \u0275fac=function(o){return new(o||e)};static \u0275prov=A({token:e,factory:e.\u0275fac,providedIn:"root"})};var i=new L,p={type:"error",message:$localize`Using a leading slash is most likely wrong, and will result in objects being created with a leading slash in the name.`},G={description:$localize`Unknown destination type`,icon:"assets/dest-icons/file-system.png",isDefaultEntry:!0,customFields:{path:{type:"String",name:"path",doubleSlash:p,shortDescription:$localize`Path`,formElement:e=>i.control(e??"")}},mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>{let n=o.startsWith(`${e}:///`)?o.split(`${e}:///`)[1]:o.split(`${e}://`)[1];return s({destinationType:e,custom:{path:n.split("?")[0]}},l(e,t))}}},C=[{key:"file",displayName:$localize`File system`,description:$localize`Store backups on your local file system.`,icon:"assets/dest-icons/file-system.png",searchTerms:"local disk harddrive localdisk filesystem unc server share drive",sortOrder:100,customFields:{path:{type:"FolderTree",name:"path",doubleSlash:p,shortDescription:$localize`File path`,longDescription:$localize`The path to store the backup`,formElement:e=>i.control(e??""),isMandatory:!0}},mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>{let r=o.startsWith("file:///"),n=decodeURIComponent(r?o.split("file:///")[1]:o.split("file://")[1]),u=n.slice(1).startsWith(":\\")||n.slice(1).startsWith(":/")||n.startsWith("\\\\")?n:"/"+n;return s({destinationType:e,custom:{path:u.split("?")[0]}},l(e,t))}}},{key:"ssh",displayName:$localize`SSH`,description:$localize`Store backups with SSH.`,icon:"assets/dest-icons/ssh.png",searchTerms:"sftp scp secure shell",sortOrder:80,customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`The server to connect to`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`The port to connect to`,formElement:e=>i.control(e??"",[b.required,b.max(65535)])},path:{type:"Path",name:"path",shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,doubleSlash:{type:"warning",message:$localize`Using a leading slash makes the path absolute, pointing to the root of the filesystem.`},formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",isMandatory:!0}],advancedFields:[{type:"FileTree",name:"ssh-keyfile",accepts:".key,",shortDescription:$localize`This is a path to a private key file locally on the machine`,longDescription:$localize`This is a path to a private key file locally on the machine`},{type:"FreeText",name:"ssh-key",shortDescription:$localize`SSH private key`,longDescription:$localize`An SSH private key. Supported formats are OpenSSL, OpenSSH, PuTTY, and PEM.`}],mapper:{to:e=>{let{server:t,port:o,path:r}=e.custom;return c(e,t,o,r)},from:(e,t,o)=>{let{server:r,port:n,path:a}=m(t);return s({destinationType:e,custom:{server:r,port:n,path:a}},l(e,t))}}},{key:"s3",displayName:$localize`S3 Compatible`,description:$localize`Store backups in any S3 compatible bucket.`,icon:"assets/dest-icons/s3compat.png",searchTerms:"amazon aws spaces cloud mycloudyplace impossible scaleway hosteurope dunkel dreamhost dincloud poli systems ibm cos storadera wasabi infomaniak infomaniak \u3055\u304F\u3089\u306E\u30AF\u30E9\u30A6\u30C9 seagate lyve digitalocean backblaze b2 cloudian minio linode bunnycdn microsoft azure google storage ibm oracle cloudflare alibaba huawei tencent baidu jd ucloud qiniu aliyun tcloud tencent ",sortOrder:90,customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"s3-server-name",order:1,shortDescription:$localize`Server`,longDescription:$localize`The hostname of the S3 compatible server to connect to`,type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getS3AllProviders(),isMandatory:!0,formElement:e=>i.control(e??"")},{name:"use-ssl",order:2},{name:"auth-username",isMandatory:!0},{name:"auth-password",isMandatory:!0}],advancedFields:[{name:"s3-client",type:"Enumeration",loadOptions:()=>k([{key:"AWS Library",value:"aws"},{key:"MinIO Library",value:"minio"}])},{name:"s3-storage-class",type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getS3StorageClasses()},{name:"s3-location-constraint",type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getS3Regions()}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{bucket:r,path:n}=m(t);return s({destinationType:e,custom:{path:n,bucket:r}},l(e,t))}}},{key:"gcs",displayName:$localize`Google Cloud Storage`,description:$localize`Store backups in Google Cloud Storage.`,icon:"assets/dest-icons/google-cloud.png",oauthField:"authid",searchTerms:"gcp googlecloud",sortOrder:70,customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0,longDescription:$localize`An OAuth token with access to the Google Cloud Storage. Not required if service account JSON is provided.`}],advancedFields:[{name:"gcs-location",type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getGcsLocations()},{name:"gcs-storage-class",type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getGcsStorageClasses()},{name:"gcs-service-account-file",type:"FileTree",accepts:".json,",shortDescription:$localize`Service account JSON file`,longDescription:$localize`Pick the path to a file with service account JSON.`},{name:"gcs-service-account-json",type:"FreeText",shortDescription:$localize`Service account JSON`,longDescription:$localize`Paste the service account JSON here.`}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{bucket:r,path:n}=m(t);return s({destinationType:e,custom:{path:n,bucket:r}},l(e,t))}}},{key:"googledrive",displayName:$localize`Google Drive`,description:$localize`Store backups in Google Drive.`,icon:"assets/dest-icons/google-drive.png",oauthField:"authid",searchTerms:"gdrive",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",type:"Password",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},l(e,t))}},{key:"pcloud",displayName:$localize`pCloud`,description:$localize`Store backups in pCloud.`,icon:"assets/dest-icons/pcloud.png",oauthField:"authid",customFields:{server:{type:"Enumeration",name:"server",loadOptions:()=>k([{key:"pCloud Global",value:"api.pcloud.com"},{key:"pCloud Europe",value:"eapi.pcloud.com"}]),shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",type:"Password",oauthVersion:2,isMandatory:!0}],mapper:{to:e=>{let{server:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return s({destinationType:e,custom:{server:r,path:n}},l(e,t))}}},{key:"azure",displayName:$localize`Azure Blob Storage`,description:$localize`Store backups in Azure Blob Storage.`,icon:"assets/dest-icons/azure.png",searchTerms:"microsoft ms",sortOrder:60,customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Container name`,longDescription:$localize`Container name`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Account name`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Access key`,isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},l(e,t))}},{key:"onedrivev2",displayName:$localize`OneDrive`,description:$localize`Store backups in OneDrive.`,icon:"assets/dest-icons/one-drive.png",oauthField:"authid",searchTerms:"micorsoft ms",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},l(e,t))}},{key:"od4b",displayName:$localize`OneDrive Business`,description:$localize`Store backups in OneDrive Business.`,icon:"assets/dest-icons/one-drive.png",searchTerms:"microsoft ms",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Account name`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Access key`,isMandatory:!0}],mapper:{to:e=>{let{port:t,server:o,path:r}=e.custom;return c(e,o,t,r)},from:(e,t,o)=>{let{server:r,port:n,path:a}=m(t);return s({destinationType:e,custom:{server:r,port:n,path:a}},l(e,t))}}},{key:"mssp",displayName:$localize`Microsoft SharePoint`,description:$localize`Store backups in Microsoft SharePoint.`,icon:"assets/dest-icons/sharepoint.png",searchTerms:"microsoft ms",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"String",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Account name`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Access key`,isMandatory:!0}],mapper:{to:e=>{let{port:t,server:o,path:r}=e.custom;return c(e,o,t,r)},from:(e,t,o)=>{let{server:r,port:n,path:a}=m(t);return s({destinationType:e,custom:{server:r,port:n,path:a}},l(e,t))}}},{key:"sharepoint",displayName:$localize`Microsoft SharePoint v2`,description:$localize`Store backups in Microsoft SharePoint.`,icon:"assets/dest-icons/sharepoint.png",oauthField:"authid",searchTerms:"microsoft ms",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"site-id",isMandatory:!0},{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},l(e,t))}},{key:"dropbox",displayName:$localize`Dropbox`,description:$localize`Store backups in Dropbox.`,icon:"assets/dest-icons/dropbox.png",oauthField:"authid",searchTerms:"dbx",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},l(e,t))}},{key:"box",displayName:$localize`Box.com`,description:$localize`Store backups in Box.com.`,icon:"assets/dest-icons/box-com.png",oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},l(e,t))}},{key:"jottacloud",displayName:$localize`Jottacloud`,description:$localize`Store backups in Jottacloud.`,icon:"assets/dest-icons/jottacloud.png",oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},l(e,t))}},{key:"b2",displayName:$localize`B2 Cloud Storage`,description:$localize`Store backups in B2 Cloud Storage.`,icon:"assets/dest-icons/backblaze.png",searchTerms:"backblaze",customFields:{bucket:{type:"BucketnameB2",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path in the bucket`,longDescription:$localize`Path in the bucket`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Application ID`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Application Key`,isMandatory:!0}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{bucket:r,path:n}=m(t);return s({destinationType:e,custom:{path:n,bucket:r}},l(e,t))}}},{key:"e2",displayName:$localize`IDrive e2`,description:$localize`Store backups in IDrive e2.`,icon:"assets/dest-icons/idrive-e2.png",customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"String",name:"path",doubleSlash:p,shortDescription:$localize`Path in the bucket`,longDescription:$localize`Path in the bucket`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Access ID`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Access Secret`,isMandatory:!0}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{bucket:r,path:n}=m(t);return s({destinationType:e,custom:{bucket:r,path:n}},l(e,t))}}},{key:"mega",displayName:$localize`Mega.nz`,description:$localize`Store backups in Mega.nz.`,icon:"assets/dest-icons/mega-nz.png",sortOrder:-1,customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Username`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:!0}],mapper:{to:e=>{let t=e.custom.path;return c(e,null,null,t)},from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},l(e,t))}},{key:"msgroup",displayName:$localize`Microsoft Office 365 Group`,description:$localize`Store backups in Microsoft Office 365 Group.`,icon:"assets/dest-icons/office-365.png",oauthField:"authid",searchTerms:"ms",customFields:{groupEmail:{type:"Email",name:"groupEmail",shortDescription:$localize`Group email`,longDescription:$localize`Group email`,formElement:e=>i.control(e??"",[b.email]),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},l(e,t))}},{key:"cloudfiles",displayName:$localize`Rackspace CloudFiles`,description:$localize`Store backups in Rackspace CloudFiles.`,icon:"assets/dest-icons/rackspace.png",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Username`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:!0}],mapper:{to:e=>{let{port:t,server:o,path:r}=e.custom;return c(e,o,t,r)},from:(e,t,o)=>{let{server:r,port:n,path:a}=m(t);return s({destinationType:e,custom:{server:r,port:n,path:a}},l(e,t))}}},{key:"rclone",displayName:$localize`Rclone`,description:$localize`Store backups in Rclone.`,icon:"assets/dest-icons/rclone.png",searchTerms:"rcl",dynamicFields:[{name:"rclone-local-repository",shortDescription:$localize`Local repository`,defaultValue:""},{name:"rclone-remote-repository",shortDescription:$localize`Remote repository`,defaultValue:""},{name:"rclone-remote-path",type:"Path",shortDescription:$localize`Path on remote repository`,defaultValue:""}],mapper:{to:e=>{let t=e.dynamic["rclone-remote-repository"],o=e.dynamic["rclone-remote-path"],r=Object.entries(e.dynamic).filter(([n])=>!["rclone-remote-repository","rclone-remote-path"].includes(n));return F(e.destinationType??"rclone",t,null,o,[...Object.entries(e.advanced??{}),...r])},from:(e,t,o)=>{let{advanced:r,dynamic:n}=l(e,t),{bucket:a,path:u}=m(t);return s({destinationType:e,dynamic:s({"rclone-remote-repository":a,"rclone-remote-path":u},n)},r)}}},{key:"openstack",displayName:$localize`OpenStack Object Storage`,description:$localize`Store backups in OpenStack Object Storage.`,icon:"assets/dest-icons/open-stack.png",searchTerms:"swift",customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket`,longDescription:$localize`Bucket`,formElement:e=>i.control(e??""),isMandatory:!0}},dynamicFields:[{name:"openstack-authuri",shortDescription:$localize`Auth URI`,type:"Enumeration",loadOptions:e=>e.get(g).getOpenstackProviders(),isMandatory:!0},{name:"openstack-version",shortDescription:$localize`Version`,type:"Enumeration",loadOptions:e=>e.get(g).getOpenstackVersions()},{name:"openstack-domain-name",type:"Hostname",shortDescription:$localize`Domain name`},{name:"openstack-tenant-name",shortDescription:$localize`Tenant name`},{name:"openstack-region",shortDescription:$localize`Region`}],mapper:{to:e=>{let{bucket:t}=e.custom;return c(e,t,null,null)},from:(e,t,o)=>{let{bucket:r,path:n}=m(t);return s({destinationType:e,custom:{path:n,bucket:r}},l(e,t))}}},{key:"webdav",displayName:$localize`WebDAV`,description:$localize`Store backups in WebDAV.`,icon:"assets/dest-icons/webdav.png",searchTerms:"web dav",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"use-ssl",shortDescription:$localize`Use SSL`},{name:"auth-username",shortDescription:$localize`Username`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:!0}],mapper:{to:e=>{let{server:t,port:o,path:r}=e.custom;return c(e,t,o,r)},from:(e,t,o)=>{let{server:r,port:n,path:a}=m(t);return s({destinationType:e,custom:{server:r,port:n,path:a}},l(e,t))}}},{key:"aftp",displayName:$localize`Alternative FTP`,description:$localize`Store backups in FTP.`,icon:"assets/dest-icons/ftp.png",searchTerms:"alt file transfer protocol ftps",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,doubleSlash:{type:"warning",message:$localize`Using a leading slash makes the path absolute, pointing to the root of the filesystem.`},formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Username`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:!0}],mapper:{to:e=>{let{server:t,port:o,path:r}=e.custom;return c(e,t,o,r)},from:(e,t,o)=>{let{server:r,port:n,path:a}=m(t);return s({destinationType:e,custom:{server:r,port:n,path:a}},l(e,t))}}},{key:"ftp",displayName:$localize`FTP`,description:$localize`Store backups in FTP.`,icon:"assets/dest-icons/ftp.png",searchTerms:"file transfer protocol ftps",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,doubleSlash:{type:"warning",message:$localize`Using a leading slash makes the path absolute, pointing to the root of the filesystem.`},formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Username`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:!0}],mapper:{to:e=>{let{port:t,server:o,path:r}=e.custom;return c(e,o,t,r)},from:(e,t,o)=>{let{server:r,port:n,path:a}=m(t);return s({destinationType:e,custom:{server:r,port:n,path:a}},l(e,t))}}},{key:"sia",displayName:$localize`Sia Decentrilized Cloud`,description:$localize`Store backups in Sia Decentrilized Cloud.`,icon:"assets/dest-icons/sia-cloud.png",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0}},dynamicFields:["sia-targetpath","sia-password","sia-redundancy"],mapper:{to:e=>{let t=e.custom.server,o=e.dynamic["sia-targetpath"],r=[...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([n])=>n!=="sia-targetpath")];return F(e.destinationType??"sia",t,null,o,r)},from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},l(e,t))}},{key:"cos",displayName:$localize`Tencent COS`,description:$localize`Store backups in Tencent COS.`,icon:"assets/dest-icons/tencent-cloud.png",customFields:{bucket:{name:"bucket",type:"Bucketname",shortDescription:$localize`Bucket`,isMandatory:!0,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"cos-region",shortDescription:$localize`Region`},{name:"cos-app-id",shortDescription:$localize`COS App Id`,isMandatory:!0},{name:"cos-secret-id",shortDescription:$localize`COS Secret Id`,isMandatory:!0},{name:"cos-secret-key",shortDescription:$localize`COS Secret Key`,isMandatory:!0}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom,r=D(s({},e),{advanced:D(s({},e.advanced),{"cos-bucket":t})});return c(r,null,null,o)},from:(e,t,o)=>{let r=l(e,t),n=r.advanced["cos-bucket"];return delete r.advanced["cos-bucket"],s({destinationType:e,custom:{path:d(t),bucket:n}},r)}}},{key:"tahoe",displayName:$localize`Tahoe LAFS`,description:$localize`Store backups in Tahoe LAFS.`,icon:"assets/dest-icons/tahoelafs.png",searchTerms:"least authority file system",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"use-ssl",shortDescription:$localize`Use SSL`}],mapper:{to:e=>{let{server:t,port:o,path:r}=e.custom;return c(e,t,o,r)},from:(e,t,o)=>{let{server:r,port:n,path:a}=m(t);return s({destinationType:e,custom:{server:r,port:n,path:a}},l(e,t))}}},{key:"smb",displayName:$localize`Windows Share (SMB)`,description:$localize`Store backups on SMB storage.`,icon:"assets/dest-icons/smb.png",searchTerms:"cifs samba",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},share:{type:"Hostname",name:"share",shortDescription:$localize`Share Name`,longDescription:$localize`Share Name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:["transport",{name:"auth-username",isMandatory:!0},{name:"auth-password",isMandatory:!0},"auth-domain"],mapper:{to:e=>{let{share:t,server:o,path:r}=e.custom;return c(e,o,null,V(t,r))},from:(e,t,o)=>{let{server:r,path:n}=m(t),a=n.split("/")[0],u=n.split("/").slice(1).join("/");return s({destinationType:e,custom:{server:r,share:a,path:u}},l(e,t))}}},{key:"cifs",displayName:$localize`CIFS (deprecated)`,description:$localize`Same as SMB backend, but with a different name. Use SMB instead.`,icon:"assets/dest-icons/smb.png",sortOrder:-1,mapper:G.mapper},{key:"filen",displayName:$localize`Filen.io`,description:$localize`Store backups in Filen.io.`,icon:"assets/dest-icons/filen.png",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on Filen`,longDescription:$localize`Path on Filen`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",isMandatory:!0},{name:"auth-password",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},l(e,t))}},{key:"filejump",displayName:$localize`Filejump`,description:$localize`Store backups in Filejump.`,icon:"assets/dest-icons/file-jump.png",sortOrder:-1,customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on Filejump`,longDescription:$localize`Path on Filejump`,formElement:e=>i.control(e??"")}},dynamicFields:[{type:"Password",name:"api-token",shortDescription:$localize`API Token`,longDescription:$localize`Filejump API Token`,formElement:e=>i.control(e??""),isMandatory:!0}],mapper:{to:e=>{let{path:t}=e.custom;return c(e,null,null,t)},from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},l(e,t))}},{key:"storj",customKey:"storjAccessGrant",displayName:$localize`Storj Access Grant`,description:$localize`Store backups in Storj Access Grant.`,icon:"assets/dest-icons/storj.png",dynamicFields:[{name:"storj-shared-access",shortDescription:$localize`Access Grant`,isMandatory:!0},{name:"storj-bucket",type:"Bucketname",shortDescription:$localize`Bucket`,isMandatory:!0},{name:"storj-folder",type:"Path",shortDescription:$localize`Path on server`,doubleSlash:p},{name:"storj-satellite",shortDescription:$localize`Satellite`,type:"Enumeration",loadOptions:e=>e.get(g).getStorjSatellites(),isMandatory:!0}],mapper:{to:e=>{let t={"storj-auth-method":"Acccess grant"};return`storj://storj.io/config${v([...Object.entries(e.advanced),...Object.entries(e.dynamic),...Object.entries(t)])}`},from:(e,t,o)=>{let r=l(e,t);return delete r.advanced["storj-auth-method"],s({destinationType:e},r)}}},{key:"storj",customKey:"storjApiKey",displayName:$localize`Storj API Key`,description:$localize`Store backups in Storj API Key.`,icon:"assets/dest-icons/storj.png",dynamicFields:[{name:"storj-satellite",shortDescription:$localize`Satellite`,type:"Enumeration",loadOptions:e=>e.get(g).getStorjSatellites(),isMandatory:!0},{name:"storj-api-key",shortDescription:$localize`API Key`,isMandatory:!0},{name:"storj-secret",shortDescription:$localize`Secret`,isMandatory:!0},{name:"storj-bucket",type:"Bucketname",shortDescription:$localize`Bucket`,isMandatory:!0},{name:"storj-folder",type:"Path",shortDescription:$localize`Path on server`,doubleSlash:p}],mapper:{to:e=>{let t={"storj-auth-method":"API key"};return`storj://storj.io/config${v([...Object.entries(e.advanced),...Object.entries(e.dynamic),...Object.entries(t)])}`},from:(e,t,o)=>{let r=l(e,t);return delete r.advanced["storj-auth-method"],s({destinationType:e},r)}}},{key:"aliyunoss",displayName:$localize`Aliyun OSS`,description:$localize`Store backups in Aliyun OSS`,icon:"assets/dest-icons/aliyun.png",customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path in bucket`,longDescription:$localize`Path in bucket`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"oss-endpoint",isMandatory:!0},{name:"oss-access-key-id",isMandatory:!0},{name:"oss-access-key-secret",isMandatory:!0}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom,r=D(s({},e),{advanced:D(s({},e.advanced),{"oss-bucket-name":t})});return c(r,null,null,o)},from:(e,t,o)=>{let r=l(e,t),n=r.advanced["oss-bucket-name"];return delete r.advanced["oss-bucket-name"],s({destinationType:e,custom:{path:d(t),bucket:n}},r)}}}],pe={".amazonaws.com":"Amazon S3",".mycloudyplace.com":"MyCloudyPlace S3",".impossibleapi.net":"Impossible Cloud S3",".scw.cloud":"Scaleway S3",".hosteurope.de":"Hosteurope S3",".dunkel.de":"Dunkel S3",".dreamhost.com":"DreamHost S3",".dincloud.com":"dinCloud S3",".polisystems.ch":"Poli Systems S3",".softlayer.net":"IBM COS (S3)",".storadera.com":"Storadera S3",".wasabisys.com":"Wasabi S3",".infomaniak.com":"Infomaniak S3",".infomaniak.cloud":"Infomaniak S3",".sakurastorage.jp":"\u3055\u304F\u3089\u306E\u30AF\u30E9\u30A6\u30C9 S3",".lyvecloud.seagate.com":"Seagate Lyve S3",".digitaloceanspaces.com":"DigitalOcean S3",".backblazeb2.com":"Backblaze B2 S3",".cloudian.com":"Cloudian S3",".min.io":"MinIO S3",".linodeobjects.com":"Linode S3",".bunnycdn.com":"BunnyCDN S3",".azure.com":"Microsoft Azure S3",".googleapis.com":"Google Cloud Storage S3",".ibm.com":"IBM Cloud S3",".oracle.com":"Oracle Cloud S3",".cloudflare.com":"Cloudflare S3",".alibaba.com":"Alibaba Cloud S3",".huawei.com":"Huawei Cloud S3",".tencent.com":"Tencent Cloud S3",".baidu.com":"Baidu Cloud S3",".jd.com":"JD Cloud S3",".ucloud.cn":"UCloud S3",".qiniu.com":"Qiniu Cloud S3",".aliyuncs.com":"Aliyun S3",".tcloud.com":"TCloud S3",".tencentcloudapi.com":"Tencent Cloud S3"};var z=class{host;hostname;exactHostname;pathname;port;protocol;search;username;password;searchParams;originalUrl;constructor(t){let o=new URL(t);this.originalUrl=t,this.host=o.host,this.hostname=o.hostname,this.exactHostname=this.extractExactHostname(t),this.pathname=o.pathname,this.port=o.port,this.protocol=o.protocol,this.search=o.search,this.username=o.username,this.password=o.password,this.searchParams=o.searchParams}extractExactHostname(t){let o=t.match(/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\/(?:[^@\/?#]*@)?([^:\/?#]+)/);return o?o[1]:""}};function c(e,t,o,r){return F(e.destinationType??"file",t,o,r,[...Object.entries(e.advanced),...Object.entries(e.dynamic)])}function F(e,t,o,r,n){let a=v(n),u=encodeURIComponent(x(t)),$=u==""?"":u+T(o),y=r??"",M=y.slice(1).startsWith(":\\")&&e=="file"?"file:///":`${e}://`,f=V($,j(y));return`${M}${f}${a}`}function B(e){return e==null||e===""?"":e.startsWith("/")?e.substring(1):e}function V(...e){if(e.length===0)return"";if(e.length===1)return e[0]??"";let t="";for(let o of e)o==null||o===""||(t+=t.endsWith("/")||t==""?o:"/"+o);return t}function j(e){return e.split("/").map(encodeURIComponent).join("/")}function d(e){if(e==null||e==="")return"";if(typeof e=="string")try{e=new z(e)}catch{return""}return decodeURIComponent(e.exactHostname??"")+decodeURIComponent(e.pathname=="/"?"":e.pathname??"")}function x(e){return e==null||e===""?"":e.endsWith("/")?e.substring(0,e.length-1):e}function T(e){return e==null||e===""?"":":"+e.toString()}function P(e){return C.find(o=>o.key===e||o.customKey===e)??C.find(o=>`${o.key}s`===e)??null??s({key:e,displayName:e},G)}function m(e){return{bucket:decodeURIComponent(e.exactHostname),server:decodeURIComponent(e.hostname),port:e.port,path:B(decodeURIComponent(e.pathname))}}function l(e,t){let o={},r={},n=P(e);return t.searchParams.forEach((a,u)=>{n?.dynamicFields?.some(y=>y===u||y?.name===u)?r[u]=decodeURIComponent(a):o[u]=decodeURIComponent(a)}),{advanced:o,dynamic:r}}function v(e,t=!1){let o=e.map(([n,a])=>`${n}=${a?encodeURIComponent(a.toString()):""}`).join("&");return o?(t?"":"?")+o:""}function he(e){let t=e.destinationType??"";return P(t)?.mapper.to(e)??""}function ge(e){let t=e.split("://")[0],o=e.split("://")[1],r=t==="file"?"http://dummy":o==""||o.startsWith("?")?`${t}://`:"http://"+o;if(!o)return null;if(o.startsWith("%")&&t==="file")return P(t).mapper.from(t,new z("http://localhost"),e);let n=P(t),a="";`${n.key}s`===t&&(a+=r.indexOf("?")===-1?"?":"&",a+="use-ssl=true",e=n.key+e.substring(t.length)),t==="file"&&o.indexOf("?")!==-1&&(a+=a.indexOf("?")===-1?"?":"&",a+=o.split("?")[1]??"");try{let u=new z(r+a);if(u.host==="undefined")return null;let $=o.split("?")[0].split("/")[0],y=!isNaN(Number(u.host.replaceAll(".",""))),O=$.split("."),M=O.length===4&&O.every(f=>f.length&&f.length<=3&&!isNaN(Number(f))&&parseInt(f)<=255);return y&&!M?null:n.mapper.from(n.key,u,e)}catch(u){return console.error("Error while parsing target path",e,r+a,u),null}}function I(e){return typeof e!="string"||!e.trim()?[]:e.split(`
|
|
2
|
+
`).map(t=>t.trim()).filter(t=>t).map(t=>{let[o,...r]=t.split("="),n=r.join("=").trim();return o.trim()?[o.trim(),n]:null}).filter(t=>t!==null)}function ye(e){return I(e).map(([t,o])=>({Name:t,Value:o}))}function fe(e){return Object.fromEntries(I(e))}export{P as a,he as b,ge as c,ye as d,fe as e,pe as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Ue}from"./chunk-PD4KFJ3B.js";import{a as Ye}from"./chunk-GMNCWLGX.js";import{d as se}from"./chunk-B5LH4P4E.js";import{a as Xe}from"./chunk-SS7TCWY5.js";import{a as Je}from"./chunk-U63HBLGG.js";import{a as L}from"./chunk-WILUKPQ3.js";import{a as U}from"./chunk-NEV6JB5M.js";import{b as _e}from"./chunk-FBWFZMGL.js";import{B as X,H as we,L as Be,M as xe,P as Ve,V as We,W as ze,b as ve,c as G,e as k,f as w,i as Ae,j as B,l as Ge,p as x,q as V,r as W,s as ke,t as z,u as J,z as ne}from"./chunk-RYXU2QDS.js";import{b as Y}from"./chunk-BKANUILG.js";import{b as h,d as R}from"./chunk-GO4NSDR6.js";import{la as oe}from"./chunk-RMOTUTEQ.js";import{$ as N,Ab as l,Bb as c,C as j,Cc as ae,Dc as $e,E as O,Ec as De,Fb as D,Gb as v,H as Ce,Ib as q,K as Ne,L as Z,Mc as le,Pa as d,Pb as S,Qb as g,R as fe,Rb as E,Sb as Re,Tb as Pe,Vb as C,W as _,Xb as A,aa as f,cb as y,g as Ee,gc as Ie,hb as he,jc as K,la as p,lc as Le,m as me,mc as Me,na as M,oc as ee,pc as te,qc as ie,sb as b,tb as $,v as re,w as Fe,wc as ye,xc as be,yb as T,z as Oe,zb as r}from"./chunk-XYHHESIX.js";var He=new W,Ke=()=>He.group({passphrase:He.control("")}),pe=class a{#t=_(Y);#e=_(P);#n=_(R);#o=_(h);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=p(!1);settings=p([]);next(){let i=this.#e.destinationTargetUrl();if(!i)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,t=[];e?t.push({Name:"--passphrase",Value:e}):t.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(o=>{let n=o.Name?.trim();n&&n!=="--"&&(n.startsWith("--")||(n=`--${n}`),t.push({Name:n,Value:o.Value??""}))}),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:i,Settings:t}},temporary:!0}).pipe(O(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:o=>{let n=o.ID;this.#n.navigate([`/restore-draft/${n}`])},error:o=>{console.error(o)}})}back(){this.#e.isFileRestore()?this.#n.navigate(["destination"],{relativeTo:this.#o.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=y({type:a,selectors:[["app-restore-encryption"]],decls:16,vars:3,consts:()=>{let i;i=$localize`Enter backup passphrase if defined.`;let e;e=$localize`Password`;let t;t=$localize`Advanced options`;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let n;return n=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `,[e,t,o,n,[3,"submit","formGroup"],["for","password"],["type","password","id","password","placeholder",i,"formControlName","passphrase"],["title",""],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){e&1&&(r(0,"form",4),C("submit",function(){return t.next()}),r(1,"sh-form-field")(2,"label",5),E(3,0),l(),c(4,"input",6),l(),r(5,"sh-toggle-card"),D(6,7),E(7,1),v(),r(8,"app-options-list",8),ie("optionsChange",function(n){return te(t.settings,n)||(t.settings=n),n}),l()(),r(9,"div",9)(10,"button",10),C("click",function(){return t.back()}),S(11,2),c(12,"sh-icon"),g(),l(),r(13,"button",11),S(14,3),c(15,"sh-icon"),g(),l()()()),e&2&&(T("formGroup",t.encryptionForm),d(8),ee("options",t.settings),T("hasFreeTextSettings",!0))},dependencies:[z,B,G,k,w,V,x,we,J,X,We,Ue],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var et=()=>({standalone:!0});function tt(a,i){a&1&&c(0,"sh-progress-bar",8)}function it(a,i){if(a&1&&(K(0),ae(1,"bytes")),a&2){let e=A().$implicit;Le(" (",$e(1,1,e.FileSizes),") ")}}function ot(a,i){a&1&&(r(0,"span",16),E(1,4),l())}function nt(a,i){if(a&1&&(r(0,"div",15),K(1),ae(2,"date"),b(3,it,2,3),b(4,ot,2,0,"span",16),l()),a&2){let e=i.$implicit;d(),Me(" ",e.Version,": ",De(2,4,e.Time,"medium")," "),d(2),$(e.FileSizes?3:-1),d(),$(e.IsFullBackup===!1?4:-1)}}function st(a,i){a&1&&c(0,"sh-progress-bar",8)}function rt(a,i){if(a&1&&(r(0,"app-file-tree",14)(1,"label",17),E(2,5),l(),c(3,"input",18),l()),a&2){let e=A(2);T("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function at(a,i){if(a&1){let e=q();r(0,"sh-select",12),C("cleared",function(){N(e);let o=A();return f(o.abortLoading())}),r(1,"input",13),ie("ngModelChange",function(o){N(e);let n=A();return te(n.selectOption,o)||(n.selectOption=o),f(o)}),l(),he(2,nt,5,7,"ng-template"),l(),b(3,st,1,0,"sh-progress-bar",8),b(4,rt,4,5,"app-file-tree",14)}if(a&2){let e=A();T("options",e.versionOptions())("isClearable",!1),d(),ee("ngModel",e.selectOption),T("ngModelOptions",be(6,et)),d(2),$(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),d(),$(e.showFileTree()?4:-1)}}var ue=new W,Qe=()=>ue.group({filesToRestore:ue.control(""),passphrase:ue.control(null)}),de=class a{#t=_(Y);#e=_(P);#n=_(Xe);#o=_(U);#i=_(R);#s=_(h);#l=_(oe);#a=null;#_=null;#r=p([]);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;selectOption=this.#e.selectOption;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;isFileRestore=this.#e.isFileRestore;needsDatabaseRepair=le(()=>this.#e.backup()?.Backup?.IsTemporary??!0);showFileTree=p(!1);backupSettings=p(null);rootPaths=p([]);initialNodes=p([]);loadingRootPath=p(!1);isRepairing=le(()=>this.#r().length>0);loadedVersions=p({});loadingEffect=M(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let t=e[0].Version;this.selectOption.set(t.toString())}});backupSettingsEffect=M(()=>{let i=this.backupId(),e=this.selectOption(),t=this.isRepairing(),o=this.loadedVersions();if(!e||!i)return;let s=this.versionOptions()?.find(Q=>Q.Version===parseInt(e))?.Time??null;if(!s)return;let u=`${i}+${s}`,F=o[u];if(this.needsDatabaseRepair()&&(!F||t))return;let I={id:i+"",time:s};this.backupSettings.set(I),this.getRootPath(I)});repairEffect=M(()=>{if(!this.needsDatabaseRepair())return;let i=this.selectOption(),e=this.versionOptions();if(i){let t=e.find(s=>s.Version===parseInt(i));if(t===void 0)return;let o=this.backupId(),n=`${o}+${t.Time}`;if(this.#_===n||(this.#_=n,this.#r().includes(n)))return;this.#r.update(s=>[...s,n]),this.#t.postApiV1BackupByIdRepairupdate({id:o,requestBody:{only_paths:!0,time:t.Time}}).pipe(Z(this.abortLoading$),O(()=>{this.#_=null})).subscribe(s=>{let u=s.ID;this.#n.waitForTaskToComplete(u).pipe(j(1)).subscribe(()=>{this.#r.update(F=>F.filter(I=>I!==n)),this.loadedVersions.update(F=>(F[n]=!0,F))})})}});getRootPath(i){let e={id:i.id+"",time:i.time,prefixOnly:!0,folderContents:!1},t=i.id+"";this.isRepairing()||this.#a===t||(this.#a=t,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#o.hasV2ListOperations()?this.#t.postApiV2BackupListFolder({requestBody:{BackupId:i.id,Time:i.time,Paths:null,PageSize:0,Page:0}}).pipe(Z(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#a=null})).subscribe({next:o=>{let n=(o.Data??[]).map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#t.getApiV1BackupByIdFiles(e).pipe(Z(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:o=>{let n=o.Files.map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new Ee;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let i=this.versionOptions();return e=>{if(!e)return"";let t=i?.find(o=>typeof o.Version=="number"&&o.Version.toString()===e);return t?`${t.Version}: ${this.#l.transform(t.Time,"medium")}`:""}}next(){this.#i.navigate(["options"],{relativeTo:this.#s.parent})}back(){this.#e.isFileRestore()?this.#i.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=y({type:a,selectors:[["app-select-files"]],features:[ye([oe])],decls:13,vars:3,consts:()=>{let i;i=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let t;t=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let o;o=$localize`Select an option...`;let n;n=$localize`(partial)`;let s;return s=$localize`Path`,[["formRef",""],i,e,t,n,s,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",o,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","initialNodes","backupSettings","multiSelect","showFiles"],[1,"custom-option"],[1,"partial"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,t){if(e&1){let o=q();r(0,"form",6,0),C("submit",function(){return N(o),f(t.next())}),r(2,"h3",7),E(3,1),l(),b(4,tt,1,0,"sh-progress-bar",8)(5,at,5,7),r(6,"div",9)(7,"button",10),C("click",function(){return N(o),f(t.back())}),S(8,2),c(9,"sh-icon"),g(),l(),r(10,"button",11),S(11,3),c(12,"sh-icon"),g(),l()()()}e&2&&(T("formGroup",t.selectFilesForm),d(4),$(t.versionOptionsLoading()?4:5),d(5),Re(t.isFileRestore()?"Back":"Exit"),Pe(8))},dependencies:[ke,B,G,k,w,Ae,z,V,x,se,X,J,Ve,Be,oe,Je],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}"],changeDetection:0})};var P=class a{#t=_(R);#e=_(h);#n=_(U);#o=_(ne);#i=_(Y);backupId=p(null);backup=p(null);destinationTargetUrl=p(null);selectFilesForm=Qe();optionsForm=Ze();encryptionForm=Ke();optionsFormSignal=_e(this.optionsForm.valueChanges);selectFilesFormSignal=_e(this.selectFilesForm.valueChanges);selectOption=p(null);versionOptionsLoading=p(!1);versionOptions=p([]);isSubmitting=p(!1);isFileRestore=p(!1);isFullWidthPage=p(!1);#s=p("");#l=p(null);#a=null;testSignal=this.#s.asReadonly();testErrorMessage=this.#l.asReadonly();#_=M(()=>{let i=this.destinationTargetUrl(),e=this.#s(),t=this.#a;this.#a=i,!(e==="testing"||t===null||t===i)&&(this.#s.set(""),this.#l.set(null))});init(i,e=!1){this.backupId.set(i),this.isFileRestore.set(e),e&&this.#t.navigate(["/restore-from-files/destination"]),e||this.getBackup()}setTestState(i,e){this.#s.set(i),this.#l.set(e??null)}updateTargetUrl(i){this.destinationTargetUrl.set(i)}submit(){this.isSubmitting.set(!0);let i=this.backupId();this.backup()?.Backup?.IsTemporary??!1?this.#i.postApiV1BackupByIdCopytotemp({id:this.backupId()??""}).subscribe({next:t=>{this.#r(t.ID??"")},error:t=>this.showErrorDialog($localize`An error occurred while copying the backup to a temporary location: ${t.message}`)}):this.#r(i??"")}showErrorDialog(i){this.#o.open(L,{data:{title:$localize`Error occured`,message:i,confirmText:$localize`OK`,cancelText:void 0},closed:e=>{}})}#r(i){let e=this.optionsForm.value,t=this.selectFilesForm.value,o=this.selectOption(),n=this.versionOptions()?.find(s=>s.Version===(o&&parseInt(o)));this.#i.postApiV1BackupByIdRestore({id:i??"",requestBody:{paths:t.filesToRestore?.split("\0").map(s=>s.endsWith("/")||s.endsWith("\\")?`${s}*`:s)??[],passphrase:t.passphrase??null,time:n?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata}}).pipe(O(()=>this.isSubmitting.set(!1))).subscribe({next:s=>{this.#t.navigate([`./${s.ID}`,"progress"],{relativeTo:this.#e})},error:s=>{console.error("restore error",s)}})}exit(){this.#o.open(L,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:i=>{i&&(this.#p(),this.#t.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(i,e=2){return this.#i.postApiV2BackupListFilesets({requestBody:{BackupId:i}}).pipe(Oe(t=>{let o=t?.error?.body?.StatusCode??t?.error?.requestBody?.StatusCode;return o==="EncryptedStorageNoPassphrase"||o==="FolderMissing"||o==="EmptyRemoteFolder"||e===0?me(()=>t):Fe(1e3).pipe(Ne(()=>this.loadFilesetsWithRetryv2(i,e-1)))}))}getBackup(){let i=this.backupId();this.versionOptionsLoading.set(!0),this.#n.hasV2ListOperations()?re([this.#i.getApiV1BackupById({id:i}),this.loadFilesetsWithRetryv2(i)]).pipe(j(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,t])=>{if(t.Error)throw new Error(t.Error);if(!(e.Backup?.IsTemporary??!0)&&e?.Backup?.DBPathExists===!1){this.#o.open(L,{data:{title:$localize`Missing Local Database`,message:$localize`The local database for this backup is missing. Please repair or recreate the local database before restoring.`,confirmText:$localize`OK`,cancelText:void 0},closed:n=>{this.#t.navigate(["/backup",i,"database"])}});return}this.versionOptions.set((t.Data??[]).map(n=>({Version:n.Version??-1,IsFullBackup:n.IsFullBackup??void 0,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(e)},error:e=>{let t=e?.error?.body?.StatusCode??e?.error?.requestBody?.StatusCode,o=t==="EncryptedStorageNoPassphrase",n=t==="FolderMissing",s=t==="EmptyRemoteFolder",u=$localize`An error occurred while loading the backup filesets: ${e.message}`;o&&(u=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),n&&(u=$localize`The backup storage folder was not found.`),s&&(u=$localize`The backup storage folder does not contain any filesets.`),this.#o.open(L,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:F=>{this.#t.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):re([this.#i.getApiV1BackupById({id:i}),this.#i.getApiV1BackupByIdFilesets({id:i}).pipe(Ce(3))]).pipe(j(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,t])=>{this.versionOptions.set(t.map(o=>({Version:o.Version??-1,IsFullBackup:(o.IsFullBackup??1)==1,Time:o.Time??"<missing>",FileCount:o.FileCount??void 0,FileSizes:o.FileSizes??void 0}))),this.backup.set(e)}})}#p(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||a)};static \u0275prov=fe({token:a,factory:a.\u0275fac,providedIn:"root"})};var H=new W,Ze=()=>H.group({restoreFrom:H.control("original"),restoreFromPath:H.control(""),handleExisting:H.control("saveTimestamp"),permissions:H.control(!1),includeMetadata:H.control(!0)}),Se=class a{#t=_(P);#e=_(R);#n=_(h);#o=_(U);#i=_(ne);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;isSubmitting=this.#t.isSubmitting;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#n.parent})}submit(){let i=this.#t.selectFilesFormSignal()?.filesToRestore??[];if(i.length>0&&this.optionsFormSignal()?.restoreFrom=="original"&&(i[0].includes("/")?"/":"\\")!==this.#o.systemInfo()?.DirectorySeparator){this.#i.open(L,{data:{title:$localize`Confirm target folder`,message:$localize`This backup was created on another operating system. Restoring files without specifying a destination folder can cause files to be restored in unexpected places. Are you sure you want to continue without choosing a destination folder?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:t=>{t&&this.#t.submit()}});return}this.#t.submit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=y({type:a,selectors:[["app-advanced-options-settings"]],decls:42,vars:7,consts:()=>{let i;i=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let t;t=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let o;o=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let n;n=$localize`How do you want to handle existing files?`;let s;s=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let F;F=$localize`Metadata settings`;let I;I=$localize` Restore file metadata ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let Q;Q=$localize` Restore read/write permissions ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let ge;ge=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let Te;return Te=$localize`${"\uFFFD#41\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#41\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `,[["formRef",""],i,e,t,o,n,s,u,F,I,Q,ge,Te,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"raised","primary"],["type","radio","name","restoreFrom","value","original","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled","enableCreateFolder"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","includeMetadata"],["type","checkbox","formControlName","permissions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){if(e&1){let o=q();r(0,"form",13,0),C("submit",function(){return N(o),f(t.submit())}),r(2,"h3",14),E(3,1),l(),r(4,"app-toggle-card",15),D(5,16),E(6,2),v(),r(7,"sh-radio",17),S(8,3),c(9,"input",18),g(),l(),r(10,"sh-radio",17),S(11,4),c(12,"input",19),g(),l(),r(13,"app-file-tree",20)(14,"label",21),K(15,"Path"),l(),c(16,"input",22),l()(),r(17,"app-toggle-card",15),D(18,16),E(19,5),v(),r(20,"sh-radio",17),S(21,6),c(22,"input",23),g(),l(),r(23,"sh-radio",17),S(24,7),c(25,"input",24),g(),l()(),r(26,"app-toggle-card"),D(27,16),E(28,8),v(),r(29,"sh-toggle",25),S(30,9),c(31,"input",26),g(),l(),r(32,"sh-toggle",25),S(33,10),c(34,"input",27),g(),l()(),r(35,"div",28)(36,"button",29),C("click",function(){return N(o),f(t.goBack())}),S(37,11),c(38,"sh-icon"),g(),l(),r(39,"button",30),S(40,12),c(41,"sh-icon"),g(),l()()()}if(e&2){let o;T("formGroup",t.optionsForm),d(4),T("disallowToggle",!0),d(9),T("disabled",((o=t.optionsFormSignal())==null?null:o.restoreFrom)!=="pickLocation")("enableCreateFolder",!0),d(4),T("disallowToggle",!0),d(22),Ie("loader",t.isSubmitting())}},dependencies:[z,B,G,ve,Ge,k,w,V,x,Ye,se,ze,xe,X,J],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{Ze as a,Se as b,Ke as c,pe as d,Qe as e,de as f,P as g};
|
|
1
|
+
import{a as Ue}from"./chunk-KR56GPXG.js";import{a as Ye}from"./chunk-GMNCWLGX.js";import{d as se}from"./chunk-B5LH4P4E.js";import{a as Xe}from"./chunk-SS7TCWY5.js";import{a as Je}from"./chunk-U63HBLGG.js";import{a as L}from"./chunk-WILUKPQ3.js";import{a as U}from"./chunk-NEV6JB5M.js";import{b as _e}from"./chunk-FBWFZMGL.js";import{B as X,H as we,L as Be,M as xe,P as Ve,V as We,W as ze,b as ve,c as G,e as k,f as w,i as Ae,j as B,l as Ge,p as x,q as V,r as W,s as ke,t as z,u as J,z as ne}from"./chunk-RYXU2QDS.js";import{b as Y}from"./chunk-BKANUILG.js";import{b as h,d as R}from"./chunk-GO4NSDR6.js";import{la as oe}from"./chunk-RMOTUTEQ.js";import{$ as N,Ab as l,Bb as c,C as j,Cc as ae,Dc as $e,E as O,Ec as De,Fb as D,Gb as v,H as Ce,Ib as q,K as Ne,L as Z,Mc as le,Pa as d,Pb as S,Qb as g,R as fe,Rb as E,Sb as Re,Tb as Pe,Vb as C,W as _,Xb as A,aa as f,cb as y,g as Ee,gc as Ie,hb as he,jc as K,la as p,lc as Le,m as me,mc as Me,na as M,oc as ee,pc as te,qc as ie,sb as b,tb as $,v as re,w as Fe,wc as ye,xc as be,yb as T,z as Oe,zb as r}from"./chunk-XYHHESIX.js";var He=new W,Ke=()=>He.group({passphrase:He.control("")}),pe=class a{#t=_(Y);#e=_(P);#n=_(R);#o=_(h);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=p(!1);settings=p([]);next(){let i=this.#e.destinationTargetUrl();if(!i)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,t=[];e?t.push({Name:"--passphrase",Value:e}):t.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(o=>{let n=o.Name?.trim();n&&n!=="--"&&(n.startsWith("--")||(n=`--${n}`),t.push({Name:n,Value:o.Value??""}))}),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:i,Settings:t}},temporary:!0}).pipe(O(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:o=>{let n=o.ID;this.#n.navigate([`/restore-draft/${n}`])},error:o=>{console.error(o)}})}back(){this.#e.isFileRestore()?this.#n.navigate(["destination"],{relativeTo:this.#o.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=y({type:a,selectors:[["app-restore-encryption"]],decls:16,vars:3,consts:()=>{let i;i=$localize`Enter backup passphrase if defined.`;let e;e=$localize`Password`;let t;t=$localize`Advanced options`;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let n;return n=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `,[e,t,o,n,[3,"submit","formGroup"],["for","password"],["type","password","id","password","placeholder",i,"formControlName","passphrase"],["title",""],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){e&1&&(r(0,"form",4),C("submit",function(){return t.next()}),r(1,"sh-form-field")(2,"label",5),E(3,0),l(),c(4,"input",6),l(),r(5,"sh-toggle-card"),D(6,7),E(7,1),v(),r(8,"app-options-list",8),ie("optionsChange",function(n){return te(t.settings,n)||(t.settings=n),n}),l()(),r(9,"div",9)(10,"button",10),C("click",function(){return t.back()}),S(11,2),c(12,"sh-icon"),g(),l(),r(13,"button",11),S(14,3),c(15,"sh-icon"),g(),l()()()),e&2&&(T("formGroup",t.encryptionForm),d(8),ee("options",t.settings),T("hasFreeTextSettings",!0))},dependencies:[z,B,G,k,w,V,x,we,J,X,We,Ue],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var et=()=>({standalone:!0});function tt(a,i){a&1&&c(0,"sh-progress-bar",8)}function it(a,i){if(a&1&&(K(0),ae(1,"bytes")),a&2){let e=A().$implicit;Le(" (",$e(1,1,e.FileSizes),") ")}}function ot(a,i){a&1&&(r(0,"span",16),E(1,4),l())}function nt(a,i){if(a&1&&(r(0,"div",15),K(1),ae(2,"date"),b(3,it,2,3),b(4,ot,2,0,"span",16),l()),a&2){let e=i.$implicit;d(),Me(" ",e.Version,": ",De(2,4,e.Time,"medium")," "),d(2),$(e.FileSizes?3:-1),d(),$(e.IsFullBackup===!1?4:-1)}}function st(a,i){a&1&&c(0,"sh-progress-bar",8)}function rt(a,i){if(a&1&&(r(0,"app-file-tree",14)(1,"label",17),E(2,5),l(),c(3,"input",18),l()),a&2){let e=A(2);T("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function at(a,i){if(a&1){let e=q();r(0,"sh-select",12),C("cleared",function(){N(e);let o=A();return f(o.abortLoading())}),r(1,"input",13),ie("ngModelChange",function(o){N(e);let n=A();return te(n.selectOption,o)||(n.selectOption=o),f(o)}),l(),he(2,nt,5,7,"ng-template"),l(),b(3,st,1,0,"sh-progress-bar",8),b(4,rt,4,5,"app-file-tree",14)}if(a&2){let e=A();T("options",e.versionOptions())("isClearable",!1),d(),ee("ngModel",e.selectOption),T("ngModelOptions",be(6,et)),d(2),$(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),d(),$(e.showFileTree()?4:-1)}}var ue=new W,Qe=()=>ue.group({filesToRestore:ue.control(""),passphrase:ue.control(null)}),de=class a{#t=_(Y);#e=_(P);#n=_(Xe);#o=_(U);#i=_(R);#s=_(h);#l=_(oe);#a=null;#_=null;#r=p([]);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;selectOption=this.#e.selectOption;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;isFileRestore=this.#e.isFileRestore;needsDatabaseRepair=le(()=>this.#e.backup()?.Backup?.IsTemporary??!0);showFileTree=p(!1);backupSettings=p(null);rootPaths=p([]);initialNodes=p([]);loadingRootPath=p(!1);isRepairing=le(()=>this.#r().length>0);loadedVersions=p({});loadingEffect=M(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let t=e[0].Version;this.selectOption.set(t.toString())}});backupSettingsEffect=M(()=>{let i=this.backupId(),e=this.selectOption(),t=this.isRepairing(),o=this.loadedVersions();if(!e||!i)return;let s=this.versionOptions()?.find(Q=>Q.Version===parseInt(e))?.Time??null;if(!s)return;let u=`${i}+${s}`,F=o[u];if(this.needsDatabaseRepair()&&(!F||t))return;let I={id:i+"",time:s};this.backupSettings.set(I),this.getRootPath(I)});repairEffect=M(()=>{if(!this.needsDatabaseRepair())return;let i=this.selectOption(),e=this.versionOptions();if(i){let t=e.find(s=>s.Version===parseInt(i));if(t===void 0)return;let o=this.backupId(),n=`${o}+${t.Time}`;if(this.#_===n||(this.#_=n,this.#r().includes(n)))return;this.#r.update(s=>[...s,n]),this.#t.postApiV1BackupByIdRepairupdate({id:o,requestBody:{only_paths:!0,time:t.Time}}).pipe(Z(this.abortLoading$),O(()=>{this.#_=null})).subscribe(s=>{let u=s.ID;this.#n.waitForTaskToComplete(u).pipe(j(1)).subscribe(()=>{this.#r.update(F=>F.filter(I=>I!==n)),this.loadedVersions.update(F=>(F[n]=!0,F))})})}});getRootPath(i){let e={id:i.id+"",time:i.time,prefixOnly:!0,folderContents:!1},t=i.id+"";this.isRepairing()||this.#a===t||(this.#a=t,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#o.hasV2ListOperations()?this.#t.postApiV2BackupListFolder({requestBody:{BackupId:i.id,Time:i.time,Paths:null,PageSize:0,Page:0}}).pipe(Z(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#a=null})).subscribe({next:o=>{let n=(o.Data??[]).map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#t.getApiV1BackupByIdFiles(e).pipe(Z(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:o=>{let n=o.Files.map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new Ee;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let i=this.versionOptions();return e=>{if(!e)return"";let t=i?.find(o=>typeof o.Version=="number"&&o.Version.toString()===e);return t?`${t.Version}: ${this.#l.transform(t.Time,"medium")}`:""}}next(){this.#i.navigate(["options"],{relativeTo:this.#s.parent})}back(){this.#e.isFileRestore()?this.#i.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=y({type:a,selectors:[["app-select-files"]],features:[ye([oe])],decls:13,vars:3,consts:()=>{let i;i=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let t;t=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let o;o=$localize`Select an option...`;let n;n=$localize`(partial)`;let s;return s=$localize`Path`,[["formRef",""],i,e,t,n,s,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",o,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","initialNodes","backupSettings","multiSelect","showFiles"],[1,"custom-option"],[1,"partial"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,t){if(e&1){let o=q();r(0,"form",6,0),C("submit",function(){return N(o),f(t.next())}),r(2,"h3",7),E(3,1),l(),b(4,tt,1,0,"sh-progress-bar",8)(5,at,5,7),r(6,"div",9)(7,"button",10),C("click",function(){return N(o),f(t.back())}),S(8,2),c(9,"sh-icon"),g(),l(),r(10,"button",11),S(11,3),c(12,"sh-icon"),g(),l()()()}e&2&&(T("formGroup",t.selectFilesForm),d(4),$(t.versionOptionsLoading()?4:5),d(5),Re(t.isFileRestore()?"Back":"Exit"),Pe(8))},dependencies:[ke,B,G,k,w,Ae,z,V,x,se,X,J,Ve,Be,oe,Je],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}"],changeDetection:0})};var P=class a{#t=_(R);#e=_(h);#n=_(U);#o=_(ne);#i=_(Y);backupId=p(null);backup=p(null);destinationTargetUrl=p(null);selectFilesForm=Qe();optionsForm=Ze();encryptionForm=Ke();optionsFormSignal=_e(this.optionsForm.valueChanges);selectFilesFormSignal=_e(this.selectFilesForm.valueChanges);selectOption=p(null);versionOptionsLoading=p(!1);versionOptions=p([]);isSubmitting=p(!1);isFileRestore=p(!1);isFullWidthPage=p(!1);#s=p("");#l=p(null);#a=null;testSignal=this.#s.asReadonly();testErrorMessage=this.#l.asReadonly();#_=M(()=>{let i=this.destinationTargetUrl(),e=this.#s(),t=this.#a;this.#a=i,!(e==="testing"||t===null||t===i)&&(this.#s.set(""),this.#l.set(null))});init(i,e=!1){this.backupId.set(i),this.isFileRestore.set(e),e&&this.#t.navigate(["/restore-from-files/destination"]),e||this.getBackup()}setTestState(i,e){this.#s.set(i),this.#l.set(e??null)}updateTargetUrl(i){this.destinationTargetUrl.set(i)}submit(){this.isSubmitting.set(!0);let i=this.backupId();this.backup()?.Backup?.IsTemporary??!1?this.#i.postApiV1BackupByIdCopytotemp({id:this.backupId()??""}).subscribe({next:t=>{this.#r(t.ID??"")},error:t=>this.showErrorDialog($localize`An error occurred while copying the backup to a temporary location: ${t.message}`)}):this.#r(i??"")}showErrorDialog(i){this.#o.open(L,{data:{title:$localize`Error occured`,message:i,confirmText:$localize`OK`,cancelText:void 0},closed:e=>{}})}#r(i){let e=this.optionsForm.value,t=this.selectFilesForm.value,o=this.selectOption(),n=this.versionOptions()?.find(s=>s.Version===(o&&parseInt(o)));this.#i.postApiV1BackupByIdRestore({id:i??"",requestBody:{paths:t.filesToRestore?.split("\0").map(s=>s.endsWith("/")||s.endsWith("\\")?`${s}*`:s)??[],passphrase:t.passphrase??null,time:n?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata}}).pipe(O(()=>this.isSubmitting.set(!1))).subscribe({next:s=>{this.#t.navigate([`./${s.ID}`,"progress"],{relativeTo:this.#e})},error:s=>{console.error("restore error",s)}})}exit(){this.#o.open(L,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:i=>{i&&(this.#p(),this.#t.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(i,e=2){return this.#i.postApiV2BackupListFilesets({requestBody:{BackupId:i}}).pipe(Oe(t=>{let o=t?.error?.body?.StatusCode??t?.error?.requestBody?.StatusCode;return o==="EncryptedStorageNoPassphrase"||o==="FolderMissing"||o==="EmptyRemoteFolder"||e===0?me(()=>t):Fe(1e3).pipe(Ne(()=>this.loadFilesetsWithRetryv2(i,e-1)))}))}getBackup(){let i=this.backupId();this.versionOptionsLoading.set(!0),this.#n.hasV2ListOperations()?re([this.#i.getApiV1BackupById({id:i}),this.loadFilesetsWithRetryv2(i)]).pipe(j(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,t])=>{if(t.Error)throw new Error(t.Error);if(!(e.Backup?.IsTemporary??!0)&&e?.Backup?.DBPathExists===!1){this.#o.open(L,{data:{title:$localize`Missing Local Database`,message:$localize`The local database for this backup is missing. Please repair or recreate the local database before restoring.`,confirmText:$localize`OK`,cancelText:void 0},closed:n=>{this.#t.navigate(["/backup",i,"database"])}});return}this.versionOptions.set((t.Data??[]).map(n=>({Version:n.Version??-1,IsFullBackup:n.IsFullBackup??void 0,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(e)},error:e=>{let t=e?.error?.body?.StatusCode??e?.error?.requestBody?.StatusCode,o=t==="EncryptedStorageNoPassphrase",n=t==="FolderMissing",s=t==="EmptyRemoteFolder",u=$localize`An error occurred while loading the backup filesets: ${e.message}`;o&&(u=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),n&&(u=$localize`The backup storage folder was not found.`),s&&(u=$localize`The backup storage folder does not contain any filesets.`),this.#o.open(L,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:F=>{this.#t.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):re([this.#i.getApiV1BackupById({id:i}),this.#i.getApiV1BackupByIdFilesets({id:i}).pipe(Ce(3))]).pipe(j(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,t])=>{this.versionOptions.set(t.map(o=>({Version:o.Version??-1,IsFullBackup:(o.IsFullBackup??1)==1,Time:o.Time??"<missing>",FileCount:o.FileCount??void 0,FileSizes:o.FileSizes??void 0}))),this.backup.set(e)}})}#p(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||a)};static \u0275prov=fe({token:a,factory:a.\u0275fac,providedIn:"root"})};var H=new W,Ze=()=>H.group({restoreFrom:H.control("original"),restoreFromPath:H.control(""),handleExisting:H.control("saveTimestamp"),permissions:H.control(!1),includeMetadata:H.control(!0)}),Se=class a{#t=_(P);#e=_(R);#n=_(h);#o=_(U);#i=_(ne);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;isSubmitting=this.#t.isSubmitting;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#n.parent})}submit(){let i=this.#t.selectFilesFormSignal()?.filesToRestore??[];if(i.length>0&&this.optionsFormSignal()?.restoreFrom=="original"&&(i[0].includes("/")?"/":"\\")!==this.#o.systemInfo()?.DirectorySeparator){this.#i.open(L,{data:{title:$localize`Confirm target folder`,message:$localize`This backup was created on another operating system. Restoring files without specifying a destination folder can cause files to be restored in unexpected places. Are you sure you want to continue without choosing a destination folder?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:t=>{t&&this.#t.submit()}});return}this.#t.submit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=y({type:a,selectors:[["app-advanced-options-settings"]],decls:42,vars:7,consts:()=>{let i;i=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let t;t=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let o;o=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let n;n=$localize`How do you want to handle existing files?`;let s;s=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let F;F=$localize`Metadata settings`;let I;I=$localize` Restore file metadata ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let Q;Q=$localize` Restore read/write permissions ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let ge;ge=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let Te;return Te=$localize`${"\uFFFD#41\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#41\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `,[["formRef",""],i,e,t,o,n,s,u,F,I,Q,ge,Te,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"raised","primary"],["type","radio","name","restoreFrom","value","original","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled","enableCreateFolder"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","includeMetadata"],["type","checkbox","formControlName","permissions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){if(e&1){let o=q();r(0,"form",13,0),C("submit",function(){return N(o),f(t.submit())}),r(2,"h3",14),E(3,1),l(),r(4,"app-toggle-card",15),D(5,16),E(6,2),v(),r(7,"sh-radio",17),S(8,3),c(9,"input",18),g(),l(),r(10,"sh-radio",17),S(11,4),c(12,"input",19),g(),l(),r(13,"app-file-tree",20)(14,"label",21),K(15,"Path"),l(),c(16,"input",22),l()(),r(17,"app-toggle-card",15),D(18,16),E(19,5),v(),r(20,"sh-radio",17),S(21,6),c(22,"input",23),g(),l(),r(23,"sh-radio",17),S(24,7),c(25,"input",24),g(),l()(),r(26,"app-toggle-card"),D(27,16),E(28,8),v(),r(29,"sh-toggle",25),S(30,9),c(31,"input",26),g(),l(),r(32,"sh-toggle",25),S(33,10),c(34,"input",27),g(),l()(),r(35,"div",28)(36,"button",29),C("click",function(){return N(o),f(t.goBack())}),S(37,11),c(38,"sh-icon"),g(),l(),r(39,"button",30),S(40,12),c(41,"sh-icon"),g(),l()()()}if(e&2){let o;T("formGroup",t.optionsForm),d(4),T("disallowToggle",!0),d(9),T("disabled",((o=t.optionsFormSignal())==null?null:o.restoreFrom)!=="pickLocation")("enableCreateFolder",!0),d(4),T("disallowToggle",!0),d(22),Ie("loader",t.isSubmitting())}},dependencies:[z,B,G,ve,Ge,k,w,V,x,Ye,se,ze,xe,X,J],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{Ze as a,Se as b,Ke as c,pe as d,Qe as e,de as f,P as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as C}from"./chunk-
|
|
1
|
+
import{g as C}from"./chunk-5HQJVUNE.js";import"./chunk-KR56GPXG.js";import"./chunk-T5LLH46J.js";import"./chunk-27UON6YV.js";import{a as k}from"./chunk-XRXXVFJ4.js";import{j as w}from"./chunk-7IQ5FSGI.js";import"./chunk-GMNCWLGX.js";import"./chunk-B5LH4P4E.js";import"./chunk-TJYZBTTS.js";import"./chunk-6CYY2QG6.js";import"./chunk-AJXTVI3H.js";import"./chunk-LF24JF3M.js";import"./chunk-AO4ZIHUL.js";import"./chunk-SS7TCWY5.js";import"./chunk-6Q6SSTBK.js";import"./chunk-U63HBLGG.js";import"./chunk-4IUPBI2K.js";import"./chunk-AGPZBYW6.js";import"./chunk-WILUKPQ3.js";import"./chunk-NEV6JB5M.js";import"./chunk-CGKL2MHM.js";import"./chunk-QWNOPLJC.js";import"./chunk-5UXRNNTT.js";import{b as u}from"./chunk-FBWFZMGL.js";import{M as W,R as y}from"./chunk-RYXU2QDS.js";import"./chunk-BKANUILG.js";import{a as A,b as $,c as M,d as I,e as G,f as v}from"./chunk-GO4NSDR6.js";import"./chunk-56FBKSBN.js";import"./chunk-FIBRO5I3.js";import"./chunk-RMOTUTEQ.js";import"./chunk-QF5K4MHH.js";import{Ab as n,Bb as s,Pa as r,Pb as F,Qb as l,W as c,Xb as O,cb as D,gc as L,la as f,na as P,sb as E,tb as g,wc as N,xc as R,yb as _,yc as p,zb as o}from"./chunk-XYHHESIX.js";import"./chunk-7CGTOI24.js";var b=()=>["/restore-from-files/destination"],x=()=>["/restore-from-files/encryption"],H=()=>["/restore-from-files/select-files"],J=()=>["/restore-from-files/options"],X=t=>["/restore",t,"select-files"],z=t=>["/restore",t,"options"];function B(t,i){t&1&&(o(0,"div",7),F(1,0),s(2,"sh-radio"),l(),n(),o(3,"div",7),F(4,1),s(5,"sh-radio"),l(),n(),o(6,"div",8),F(7,2),s(8,"sh-radio"),l(),n(),o(9,"div",8),F(10,3),s(11,"sh-radio"),l(),n()),t&2&&(_("routerLink",R(4,b)),r(3),_("routerLink",R(5,x)),r(3),_("routerLink",R(6,H)),r(3),_("routerLink",R(7,J)))}function U(t,i){if(t&1&&(o(0,"div",7),F(1,4),s(2,"sh-radio"),l(),n(),o(3,"div",7),F(4,5),s(5,"sh-radio"),l(),n()),t&2){let e=O(2);_("routerLink",p(2,X,e.backupId())),r(3),_("routerLink",p(4,z,e.backupId()))}}function j(t,i){if(t&1&&(o(0,"sh-stepper",6),E(1,B,12,8)(2,U,6,6),n()),t&2){let e=O();r(),g(e.isFileRestore()?1:2)}}var h=class t{#e=c($);#i=c(I);#t=c(C);#o=u(this.#e.params);#n=u(this.#e.url);#s=u(this.#e.children[0].url);backupId=this.#t.backupId;isFileRestore=this.#t.isFileRestore;isProgressPage=f(!1);paramsChanged=P(()=>{let i=this.#s(),e=this.#o()?.id,a=!!this.#n()?.find(S=>S.path==="restore-from-files"),T=!!i?.find(S=>S.path==="progress");this.isProgressPage.set(T),this.#t.init(e,a)});ngOnInit(){this.#i.events.subscribe(i=>{if(i instanceof A){let e=i.urlAfterRedirects;this.isProgressPage.set(e.includes("progress"))}})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=D({type:t,selectors:[["app-restore-flow"]],hostVars:2,hostBindings:function(e,a){e&2&&L("full-width",a.isProgressPage())},features:[N([C,w])],decls:4,vars:1,consts:()=>{let i;i=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_RADIO: Destination `;let e;e=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_RADIO: Encryption `;let a;a=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SH_RADIO: Select files `;let T;T=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `;let S;S=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_RADIO: Select files `;let m;return m=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `,[i,e,a,T,S,m,[1,"primary"],["step","","routerLinkActive","active",3,"routerLink"],["step","","routerLinkActive","active",1,"inactive",3,"routerLink"]]},template:function(e,a){e&1&&(s(0,"app-status-bar"),E(1,j,3,1,"sh-stepper",6),o(2,"section"),s(3,"router-outlet"),n()),e&2&&(r(),g(a.isProgressPage()?-1:1))},dependencies:[y,W,k,M,G,v],styles:["[_nghost-%COMP%]{display:block}.full-width[_nghost-%COMP%] section[_ngcontent-%COMP%]{max-width:62.5rem}sh-stepper[_ngcontent-%COMP%]{max-width:31.25rem;margin:2.5rem auto}section[_ngcontent-%COMP%]{max-width:31.25rem;margin:0 auto 2.5rem}.inactive[_ngcontent-%COMP%]{pointer-events:none;opacity:.5}"],changeDetection:0})};export{h as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as v}from"./chunk-FBWFZMGL.js";import{b as p}from"./chunk-BKANUILG.js";import{M as S,Mc as s,R as a,W as c,la as u}from"./chunk-XYHHESIX.js";import{a as o,b as g}from"./chunk-7CGTOI24.js";var d="shown-welcome-page-v1",n="hide-console-connection-status",l=class t{#e=c(p);#r=v(this.#e.getApiV1Serversettings());#t=u(void 0);serverSettings=s(()=>this.#t()||this.#r());isConsoleConnectionStatusHidden=s(()=>{let e=this.serverSettings();return e?e[n]==="True":!1});refreshServerSettings(){this.#e.getApiV1Serversettings().subscribe({next:e=>{this.#t.set(e)}})}patchServerSettings(e){return this.#e.patchApiV1Serversettings({requestBody:e})}patchServerSetting(e,r){let i={};return i[e]=r,this.patchServerSettings(i)}setShownWelcomePage(){return this.patchServerSetting(d,"true")}setHideConsoleConnectionStatus(e){return this.patchServerSetting(n,e?"True":"False").pipe(S(()=>this.#t.set(g(o({},this.serverSettings()),{[n]:e?"True":"False"}))))}static \u0275fac=function(r){return new(r||t)};static \u0275prov=a({token:t,factory:t.\u0275fac,providedIn:"root"})};export{l as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as q}from"./chunk-4IUPBI2K.js";import{a as H}from"./chunk-AGPZBYW6.js";import"./chunk-WILUKPQ3.js";import"./chunk-NEV6JB5M.js";import{a as Q}from"./chunk-
|
|
1
|
+
import{a as q}from"./chunk-4IUPBI2K.js";import{a as H}from"./chunk-AGPZBYW6.js";import"./chunk-WILUKPQ3.js";import"./chunk-NEV6JB5M.js";import{a as Q}from"./chunk-5UXRNNTT.js";import"./chunk-FBWFZMGL.js";import{B as X,C as z,H as K,L as j,c as B,e as U,i as G,s as W,u as V,w as J}from"./chunk-RYXU2QDS.js";import"./chunk-BKANUILG.js";import{d as A,e as I}from"./chunk-GO4NSDR6.js";import"./chunk-56FBKSBN.js";import"./chunk-FIBRO5I3.js";import"./chunk-RMOTUTEQ.js";import"./chunk-QF5K4MHH.js";import{$ as m,Ab as l,Bb as T,Bc as $,Ib as f,Mc as O,Pa as a,Pb as S,Qb as P,Rb as p,Rc as v,Ub as D,Vb as h,W as E,Xb as s,aa as F,cb as b,ic as x,jc as d,la as N,na as M,oc as w,pc as L,qc as k,sb as c,tb as _,yb as y,zb as r}from"./chunk-XYHHESIX.js";import"./chunk-7CGTOI24.js";var Y=(t,n,e,i,o)=>({"loading-state":t,"ready-to-add-link":n,"is-connected":e,"failed-to-connect":i,"is-registered":o});function Z(t,n){t&1&&p(0,0,1)}function ee(t,n){t&1&&p(0,0,2)}function te(t,n){if(t&1){let e=f();r(0,"button",10),h("click",function(){m(e);let o=s(2);return F(o.cancel())}),d(1,"Cancel registration"),l()}}function ne(t,n){if(t&1&&(r(0,"div",7)(1,"p"),S(2,0),c(3,Z,1,0)(4,ee,1,0),P(),l(),T(5,"sh-progress-bar",8),c(6,te,2,0,"button",9),l()),t&2){let e=s();a(3),_(e.state()==="unknown"?3:4),a(3),_((e.registeringCounter()??0)>=5&&e.state()==="registering"?6:-1)}}function ie(t,n){if(t&1){let e=f();r(0,"sh-form-field")(1,"label",11),p(2,1),l(),r(3,"input",12),k("ngModelChange",function(o){m(e);let C=s();return L(C.customRegisterUrl,o)||(C.customRegisterUrl=o),F(o)}),l()(),r(4,"div",13)(5,"button",14),d(6,"Go back"),l(),r(7,"button",15),h("click",function(){m(e);let o=s();return F(o.registerViaCustomUrl())}),p(8,2),l()()}if(t&2){let e=s();a(3),w("ngModel",e.customRegisterUrl),a(4),y("disabled",!e.customRegisterUrlValid())}}function oe(t,n){if(t&1){let e=f();r(0,"p"),p(1,3),l(),T(2,"sh-progress-bar",8),r(3,"button",10),h("click",function(){m(e);let o=s(2);return F(o.retryWhenFaulted())}),d(4,"Cancel"),l()}}function re(t,n){if(t&1){let e=f();r(0,"p"),p(1,4),l(),r(2,"button",10),h("click",function(){m(e);let o=s(2);return F(o.retryWhenFaulted())}),d(3,"Retry"),l()}}function le(t,n){if(t&1&&c(0,oe,5,0)(1,re,4,0),t&2){let e=s();_(e.claimUrl()!==null?0:1)}}function ae(t,n){t&1&&(S(0,5,1),T(1,"p"),P())}function se(t,n){t&1&&(S(0,5,2),T(1,"p"),P())}function ce(t,n){if(t&1){let e=f();r(0,"sh-alert",16),S(1,5),c(2,ae,2,0,"p")(3,se,2,0,"p"),P(),l(),r(4,"button",10),h("click",function(){m(e);let o=s();return F(o.retryWhenFaulted())}),d(5," Retry "),r(6,"sh-icon"),d(7,"arrow-arc-left"),l()()}if(t&2){let e=s();a(2),_(e.typeParam()==="link"?2:3)}}function _e(t,n){t&1&&(r(0,"h3"),d(1,"Successfully connected"),l(),r(2,"p"),d(3,"We're going to redirect you to the home page"),l())}var R=class t{#t=E(A);#i=E(H);#e=E(q);#n=E(Q);isOldOpen=N(!1);typeParam=v.required();state=this.#e.state;claimUrl=this.#e.claimUrl;registerUrl=this.#e.registerUrl;customRegisterUrl=this.#e.customRegisterUrl;additionalReportingUrl=O(()=>{let n=this.#n.serverSettings();return this.#e.state()==="inactive"?"":n&&n["additional-report-url"]||""});copiedReportingUrl=N(!1);customRegisterUrlValid=O(()=>{let n=this.customRegisterUrl(),e=/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/;return!(n.length===0||!e.test(n))});registeringCounter=N(null);didTry=!1;triedFinishConnection=!1;stateEffect=M(()=>{let n=this.#e.registerUrl(),e=this.state(),i=this.typeParam(),o=this.registeringCounter();e==="inactive"&&i==="logon"&&n!==""&&(this.didTry||(this.#e.beginRemoteRegistration(),this.didTry=!0)),e==="registered"&&this.claimUrl()!==null&&(this.triedFinishConnection||(this.triedFinishConnection=!0,this.#o())),e==="registering"?(o===null&&this.registeringCounter.set(0),setTimeout(()=>{this.registeringCounter.set((o??0)+1)},1e3)):this.registeringCounter.set(null),(e==="connected"||e==="disabled"||e==="connecting")&&this.#n.setShownWelcomePage().subscribe(()=>{this.#t.navigate([""])})});ngOnInit(){this.#e.refreshRemoteControlStatus()}#o(){let n=this.#e.claimUrl();this.#i.open(`${n}?closeAfterConnection=true`,"_blank")}registerViaCustomUrl(){this.#e.beginRemoteRegistration(!0)}retryWhenFaulted(){this.#e.cancelRemoteRegistration(),this.customRegisterUrl.set(""),this.didTry=!1,this.triedFinishConnection=!1,this.typeParam()==="logon"&&this.#t.navigate(["/welcome/select"])}cancel(){this.#e.cancelRemoteRegistration()}register(){this.#e.beginRemoteRegistration()}disable(){this.#e.disableRemoteControl()}enable(){this.#e.enableRemoteControl()}delete(){this.#e.deleteRemoteControl()}copyReportingUrl(){let n=this.additionalReportingUrl();n&&(this.copiedReportingUrl.set(!0),setTimeout(()=>this.copiedReportingUrl.set(!1),2e3),navigator.clipboard.writeText(n))}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=b({type:t,selectors:[["app-connect"]],inputs:{typeParam:[1,"typeParam"]},decls:6,vars:13,consts:()=>{let n;n=$localize`${"\uFFFD*3:1\uFFFD"}:START_BLOCK_IF: Loading... ${"\uFFFD/*3:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*4:2\uFFFD"}:START_BLOCK_ELSE: Connecting to console ${"\uFFFD/*4:2\uFFFD"}:CLOSE_BLOCK_ELSE:`;let e;e=$localize`Paste registration URL here`;let i;i=$localize` Connect machine to console `;let o;o=$localize`We're now connecting you to the console`;let C;C=$localize`Something failed during registration we're missing claimUrl, please try again`;let u;return u=$localize` Failed to register ${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_PARAGRAPH: Check if the connection link are correct, alternatively it could be your internet connection or the service might be down ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_PARAGRAPH:${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_PARAGRAPH: There might be a problem with your internet connection or the service might be down, please try again later ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_PARAGRAPH:${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,u=D(u),[n,e,i,o,C,u,[1,"main-card","type-b"],[1,"loader-content"],[1,"primary","indeterminate"],["shButton",""],["shButton","",3,"click"],["for","remoteControlRegisterUrl"],["type","text","id","remoteControlRegisterUrl","name","remoteControlRegisterUrl",3,"ngModelChange","ngModel"],[1,"nav-buttons"],["type","button","shButton","","routerLink","/welcome",1,"raised"],["type","button","shButton","",1,"raised","primary",3,"click","disabled"],[1,"error"]]},template:function(e,i){if(e&1&&(r(0,"sh-card",6),c(1,ne,7,2,"div",7),c(2,ie,9,2),c(3,le,2,1),c(4,ce,8,1),c(5,_e,4,0),l()),e&2){let o=i.state()==="unknown"||i.typeParam()!=="link"&&i.state()==="inactive"||i.state()==="registering",C=i.typeParam()==="link"&&i.state()==="inactive",u=i.state()==="connected"||i.state()==="disabled"||i.state()==="connecting",g=i.state()==="registeringfaulted";x($(7,Y,o,C,u,g,i.state()==="registered")),a(),_(o?1:-1),a(),_(C?2:-1),a(),_(i.state()==="registered"?3:-1),a(),_(g?4:-1),a(),_(u?5:-1)}},dependencies:[I,W,B,U,G,K,X,j,z,J,V],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;min-height:100%;width:100%;flex:1 0;overflow:hidden;padding:2rem}@media only screen and (max-width:768px){[_nghost-%COMP%]{padding:1rem}}.main-card[_ngcontent-%COMP%]{width:100%;height:100%;max-width:31.25rem;max-height:min-content;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:1rem;padding:2rem}.main-card.failed-to-connect[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}.main-card.failed-to-connect[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:100%}.main-card.is-registered[_ngcontent-%COMP%], .main-card.is-connected[_ngcontent-%COMP%]{align-items:center}.loader-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.5rem;width:100%}.loader-content[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{--pb-b: var(--base-3);border:1px solid var(--pb-b)}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{flex:1 0}.reporting-url[_ngcontent-%COMP%]{cursor:pointer;-webkit-user-select:none;user-select:none;margin-top:.25rem}.state[_ngcontent-%COMP%]{position:fixed;top:1rem;right:1rem;margin:0;color:var(--base-7);font-size:.75rem}.old[_ngcontent-%COMP%]{display:flex;flex-direction:column;position:relative;gap:.5rem;padding:1rem;border:1px solid var(--base-4);background:var(--base-1);position:fixed;top:0;right:0;bottom:0;width:35rem;transform:translate(100%)}.old.open[_ngcontent-%COMP%]{transform:translate(0)}.old[_ngcontent-%COMP%] .toggle[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:.5rem;cursor:pointer;position:absolute;background-color:var(--base-1);border:1px solid var(--base-4);border-width:.0625rem 0 .0625rem .0625rem;width:2rem;height:2.5rem;border-radius:var(--shape-2) 0 0 var(--shape-2);top:3.75rem;left:-2rem;-webkit-user-select:none;user-select:none}.old[_ngcontent-%COMP%] .toggle[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1rem}.nav-buttons[_ngcontent-%COMP%]{display:flex;gap:.5rem;flex-direction:row}"],changeDetection:0})};export{R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as St}from"./chunk-GMNCWLGX.js";import{b as Oe,c as gt,d as Et}from"./chunk-B5LH4P4E.js";import{a as pt,b as Ve,c as Ct}from"./chunk-TJYZBTTS.js";import{a as dt}from"./chunk-WILUKPQ3.js";import{a as Re}from"./chunk-NEV6JB5M.js";import{a as ct}from"./chunk-7Z3BXDXF.js";import{b as le}from"./chunk-FBWFZMGL.js";import{B as ae,F as st,H as Q,L as lt,P as se,V as rt,W as Me,Y as _t,b as Fe,c as j,d as he,e as q,f as Ne,h as et,i as ie,j as fe,k as tt,n as nt,o as it,p as Pe,q as Ae,r as De,s as oe,t as ye,u as Y,w as ot,z as at}from"./chunk-RYXU2QDS.js";import{b as ut}from"./chunk-BKANUILG.js";import{b as ne,d as z}from"./chunk-GO4NSDR6.js";import{$ as g,Ab as l,Bb as T,E as $e,Fb as b,Gb as v,Ib as $,Mc as L,Pa as r,Pb as S,Qb as m,Qc as ke,R as Ce,Rb as f,Rc as Be,Sc as Te,Ub as be,Vb as h,W as y,Xb as u,aa as E,cb as H,cc as ge,dc as Ee,gc as Se,hb as qe,jc as G,kb as Ye,kc as ve,la as p,lc as Ze,na as te,oc as R,pc as O,qc as w,rb as Qe,sb as A,tb as D,ub as Ge,wb as Ue,xb as xe,xc as me,yb as F,zb as s}from"./chunk-XYHHESIX.js";import{a as J,b as X}from"./chunk-7CGTOI24.js";var we=class o{fromString(t){if(!t)return null;let e=t.match(/(\d+)([smhDWMY])/);return e&&{value:parseInt(e[1]),unit:e[2]}}toString(t,e){return`${t}${e}`}static \u0275fac=function(e){return new(e||o)};static \u0275prov=Ce({token:o,factory:o.\u0275fac,providedIn:"root"})};function ce(o){if(Ye(o))return o();if(Array.isArray(o))return o.map(t=>ce(t));if(typeof o=="object"&&o!==null){let t={};for(let e in o)o.hasOwnProperty(e)&&(t[e]=ce(o[e]));return t}return o}function Nt(o,t){if(o&1){let e=$();s(0,"div",26)(1,"sh-form-field")(2,"label",27),f(3,7),l(),s(4,"input",28,0),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.nextTime.time,i)||(a.scheduleFields.nextTime.time=i),E(i)}),l(),s(6,"sh-icon",29),G(7,"clock"),l()(),s(8,"sh-datepicker-input",30)(9,"label",31),G(10,"\xA0"),l(),s(11,"input",32,1),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.nextTime.date,i)||(a.scheduleFields.nextTime.date=i),E(i)}),l(),s(13,"sh-icon",29),G(14,"calendar"),l()()(),s(15,"div",26)(16,"sh-form-field")(17,"label",33),f(18,8),l(),s(19,"input",34),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.repeatValue,i)||(a.scheduleFields.runAgain.repeatValue=i),E(i)}),l()(),s(20,"sh-select",35)(21,"input",36),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.repeatUnit,i)||(a.scheduleFields.runAgain.repeatUnit=i),E(i)}),l()()(),s(22,"sh-toggle-card",37),b(23,38),f(24,9),v(),s(25,"div",39)(26,"sh-toggle",24),S(27,10),s(28,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.mon,i)||(a.scheduleFields.runAgain.allowedDays.mon=i),E(i)}),l(),m(),l(),s(29,"sh-toggle",24),S(30,11),s(31,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.tue,i)||(a.scheduleFields.runAgain.allowedDays.tue=i),E(i)}),l(),m(),l(),s(32,"sh-toggle",24),S(33,12),s(34,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.wed,i)||(a.scheduleFields.runAgain.allowedDays.wed=i),E(i)}),l(),m(),l(),s(35,"sh-toggle",24),S(36,13),s(37,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.thu,i)||(a.scheduleFields.runAgain.allowedDays.thu=i),E(i)}),l(),m(),l(),s(38,"sh-toggle",24),S(39,14),s(40,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.fri,i)||(a.scheduleFields.runAgain.allowedDays.fri=i),E(i)}),l(),m(),l(),s(41,"sh-toggle",24),S(42,15),s(43,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.sat,i)||(a.scheduleFields.runAgain.allowedDays.sat=i),E(i)}),l(),m(),l(),s(44,"sh-toggle",24),S(45,16),s(46,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.sun,i)||(a.scheduleFields.runAgain.allowedDays.sun=i),E(i)}),l(),m(),l()()()}if(o&2){let e=u(2);r(4),R("ngModel",e.scheduleFields.nextTime.time),r(7),R("ngModel",e.scheduleFields.nextTime.date),r(8),R("ngModel",e.scheduleFields.runAgain.repeatValue),r(),F("options",e.unitOptions)("isClearable",!1),r(),R("ngModel",e.scheduleFields.runAgain.repeatUnit),r(),F("disallowToggle",!0),r(6),R("ngModel",e.scheduleFields.runAgain.allowedDays.mon),r(3),R("ngModel",e.scheduleFields.runAgain.allowedDays.tue),r(3),R("ngModel",e.scheduleFields.runAgain.allowedDays.wed),r(3),R("ngModel",e.scheduleFields.runAgain.allowedDays.thu),r(3),R("ngModel",e.scheduleFields.runAgain.allowedDays.fri),r(3),R("ngModel",e.scheduleFields.runAgain.allowedDays.sat),r(3),R("ngModel",e.scheduleFields.runAgain.allowedDays.sun)}}function ft(o,t){if(o&1){let e=$();s(0,"div",23)(1,"sh-toggle",24),S(2,5),s(3,"input",25),w("ngModelChange",function(i){g(e);let a=u();return O(a.scheduleFields.autoRun,i)||(a.scheduleFields.autoRun=i),E(i)}),l(),m(),l(),s(4,"p"),f(5,6),l()(),A(6,Nt,47,14)}if(o&2){let e=u();r(3),R("ngModel",e.scheduleFields.autoRun),r(3),D(e.scheduleFields.autoRun()?6:-1)}}var Pt=[{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`}],Ie=[{key:$localize`Daily 13:00`,value:"daily",data:{autoRun:!0,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!0,sun:!0}}}},{key:$localize`Weekdays 13:00`,value:"weekdays",data:{autoRun:!0,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!1,sun:!1}}}},{key:$localize`Weekly monday 13:00`,value:"weekly",data:{autoRun:!0,nextTime:{time:"13:00:00",date:At().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"W",allowedDays:{mon:!0,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}}},{key:$localize`Don't run automatically`,value:"disabled",data:{autoRun:!1,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!0,sun:!0}}}},{key:$localize`Custom`,value:"custom",data:{autoRun:!0,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!0,sun:!0}}}}];function mt(o){if(!o.autoRun)return null;let t=[o.runAgain.allowedDays.mon?"Monday":null,o.runAgain.allowedDays.tue?"Tuesday":null,o.runAgain.allowedDays.wed?"Wednesday":null,o.runAgain.allowedDays.thu?"Thursday":null,o.runAgain.allowedDays.fri?"Friday":null,o.runAgain.allowedDays.sat?"Saturday":null,o.runAgain.allowedDays.sun?"Sunday":null].filter(c=>c!==null),e=o.nextTime.time.split(":"),n=new Date(o.nextTime.date);n.setHours(parseInt(e[0])),n.setMinutes(parseInt(e[1]));let i=o.runAgain.repeatValue,a=o.runAgain.repeatUnit;return{Time:n.toISOString(),Repeat:`${i}${a}`,AllowedDays:t}}function At(){let o=new Date,t=o.getDay(),e=t===1?7:(8-t)%7;return o.setDate(o.getDate()+e),o.setHours(12,0,0,0),o}var Xe=()=>({autoRun:p(!0),nextTime:{time:p("13:00"),date:p(new Date().toISOString().split("T")[0])},runAgain:{repeatValue:p(1),repeatUnit:p("D"),allowedDays:{mon:p(!0),tue:p(!0),wed:p(!0),thu:p(!0),fri:p(!0),sat:p(!0),sun:p(!0)}}}),Ke=class o{#e=y(Z);#t=y(z);#i=y(ne);unitOptions=Pt;scheduleFields=this.#e.scheduleFields;scheduleType=this.#e.scheduleType;scheduleOptions=Ie;updateScheduleType(t){let e=Ie.find(n=>n.value===t);if(e&&e?.value!=="custom"){this.scheduleType.set(e.value);let n=e.data;this.scheduleFields.autoRun.set(n.autoRun??!1),this.scheduleFields.nextTime.time.set(n.nextTime?.time??"13:00"),this.scheduleFields.nextTime.date.set(n.nextTime?.date??new Date().toISOString().split("T")[0]),this.scheduleFields.runAgain.repeatValue.set(n.runAgain?.repeatValue??1),this.scheduleFields.runAgain.repeatUnit.set(n.runAgain?.repeatUnit??"D"),this.scheduleFields.runAgain.allowedDays.mon.set(n.runAgain?.allowedDays?.mon??!0),this.scheduleFields.runAgain.allowedDays.tue.set(n.runAgain?.allowedDays?.tue??!0),this.scheduleFields.runAgain.allowedDays.wed.set(n.runAgain?.allowedDays?.wed??!0),this.scheduleFields.runAgain.allowedDays.thu.set(n.runAgain?.allowedDays?.thu??!0),this.scheduleFields.runAgain.allowedDays.fri.set(n.runAgain?.allowedDays?.fri??!0),this.scheduleFields.runAgain.allowedDays.sat.set(n.runAgain?.allowedDays?.sat??!0),this.scheduleFields.runAgain.allowedDays.sun.set(n.runAgain?.allowedDays?.sun??!0)}else this.scheduleType.set("custom")}goBack(){this.#t.navigate(["source"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["options"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=H({type:o,selectors:[["app-schedule"]],decls:12,vars:4,consts:()=>{let t;t=$localize`Select an option...`;let e;e=$localize`Schedule`;let n;n=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let i;i=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let a;a=$localize` Automatically run backups ${"\uFFFD#3\uFFFD\uFFFD/#3\uFFFD"}:TAG_INPUT:`;let c;c=$localize`If a date was missed, the job will run as soon as possible.`;let C;C=$localize`Next time`;let _;_=$localize`Run again every`;let d;d=$localize`Allowed days`;let I;I=$localize` Monday ${"\uFFFD#28\uFFFD\uFFFD/#28\uFFFD"}:TAG_INPUT:`;let U;U=$localize` Tuesday ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let B;B=$localize` Wednesday ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let V;V=$localize` Thursday ${"\uFFFD#37\uFFFD\uFFFD/#37\uFFFD"}:TAG_INPUT:`;let x;x=$localize` Friday ${"\uFFFD#40\uFFFD\uFFFD/#40\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Saturday ${"\uFFFD#43\uFFFD\uFFFD/#43\uFFFD"}:TAG_INPUT:`;let W;return W=$localize` Sunday ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],e,n,i,a,c,C,_,d,I,U,B,V,x,K,W,[1,"title-30"],["label","key","value","value",3,"isClearable","options"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"row-inputs"],["for","time"],["type","time","id","time",3,"ngModelChange","ngModel"],["suffix",""],[1,"primary","sharp"],["for","date"],["type","date","id","date",3,"ngModelChange","ngModel"],["for","repeatValue"],["type","number","id","repeatValue",3,"ngModelChange","ngModel"],["value","key","label","label",3,"options","isClearable"],["type","text","id","repeatUnit",3,"ngModelChange","ngModel"],[3,"disallowToggle"],["title",""],[1,"days-wrap"]]},template:function(e,n){e&1&&(s(0,"h3",17),f(1,2),l(),s(2,"sh-select",18)(3,"input",19),h("ngModelChange",function(a){return n.updateScheduleType(a)}),l()(),A(4,ft,7,2),s(5,"div",20)(6,"button",21),h("click",function(){return n.goBack()}),S(7,3),T(8,"sh-icon"),m(),l(),s(9,"button",22),h("click",function(){return n.next()}),S(10,4),T(11,"sh-icon"),m(),l()()),e&2&&(r(2),F("isClearable",!1)("options",n.scheduleOptions),r(),F("ngModel",n.scheduleType()),r(),D(n.scheduleType()==="custom"?4:-1))},dependencies:[oe,j,tt,Fe,q,ie,Q,Me,Y,ae,se,rt,st],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 1.5rem;display:flex;flex-direction:column;gap:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};function Dt(o,t){if(o&1){let e=$();s(0,"sh-select",2)(1,"input",6),w("ngModelChange",function(i){g(e);let a=u();return O(a.internalPath,i)||(a.internalPath=i),E(i)}),h("ngModelChange",function(){g(e);let i=u();return E(i.updateFilter())}),l()()}if(o&2){let e=u();F("options",e.fileGroupOptions())("isClearable",!1)("selectMultiple",!0),r(),R("ngModel",e.internalPath)}}function yt(o,t){if(o&1&&(b(0,7),G(1),v()),o&2){let e,n=u(2);r(),ve((e=n.currentExpressionOption())==null?null:e.startsWith)}}function Mt(o,t){if(o&1&&(b(0,8),G(1),v()),o&2){let e,n=u(2);r(),ve((e=n.currentExpressionOption())==null?null:e.endsWith)}}function Rt(o,t){if(o&1){let e=$();s(0,"sh-form-field",3)(1,"input",6),w("ngModelChange",function(i){g(e);let a=u();return O(a.internalPath,i)||(a.internalPath=i),E(i)}),h("ngModelChange",function(){g(e);let i=u();return E(i.updateFilter())}),l(),A(2,yt,2,1,"ng-container",7),A(3,Mt,2,1,"ng-container",8),l()}if(o&2){let e,n,i=u();r(),R("ngModel",i.internalPath),r(),D(!((e=i.currentExpressionOption())==null||e.startsWith==null)&&e.startsWith.length?2:-1),r(),D(!((n=i.currentExpressionOption())==null||n.endsWith==null)&&n.endsWith.length?3:-1)}}var Ot=[{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"}],wt=[{key:"Excludes folders where name contains",value:"-FolderName"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileName"},{key:"Excludes file extension",value:"-Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Exclude file groups",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"},{key:"None",value:"-Unknown"}],Le=class o{path=Be.required();osType=Be();pathChange=ke();remove=ke();internalPath=p("");pathType=p("-Expression");currentExpressionOption=L(()=>{let t=this.pathType();return this.expressionOptions().find(e=>e.value===t)});fileGroupOptions=p(Ot);expressionOptions=L(()=>{let e=this.osType()==="Windows"?"\\":"/";return wt.map(n=>n.value==="-Folder"||n.value==="+Folder"?X(J({},n),{startsWith:"",endsWith:""}):n.value==="-FolderName"||n.value==="+FolderName"?X(J({},n),{startsWith:"*",endsWith:`*${e}`}):n.value==="-FileName"||n.value==="+FileName"?X(J({},n),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):n.value==="-FileGroup"||n.value==="+FileGroup"?X(J({},n),{startsWith:"{",endsWith:"}"}):n.value==="-Regex"||n.value==="+Regex"?X(J({},n),{startsWith:"[",endsWith:"]"}):n.value==="-Extension"||n.value==="+Extension"?X(J({},n),{startsWith:"*.",endsWith:""}):X(J({},n),{startsWith:"",endsWith:""}))});pathEffect=te(()=>{let t=this.path(),e=t.slice(1),n=t.startsWith("-")?"-":"+",i=this.osType()==="Windows",a=i?"\\":"/";e.startsWith("%")&&e.endsWith(a)||i&&e.slice(2).startsWith(a)&&e.endsWith(a)||e.startsWith(a)&&e.endsWith(a)?(this.pathType.set(`${n}Folder`),this.internalPath.set(e)):e.startsWith("*")&&e.endsWith(`*${a}`)?(this.pathType.set(`${n}FolderName`),this.internalPath.set(e.slice(1,-2))):e.startsWith("[.*")&&e.endsWith(`[^\\${a}]*]`)?(this.pathType.set(`${n}FileName`),this.internalPath.set(e.slice(3,-7))):e.startsWith("{")&&e.endsWith("}")?(this.pathType.set(`${n}FileGroup`),this.internalPath.set(e.slice(1,-1))):e.startsWith("[")&&e.endsWith("]")?(this.pathType.set(`${n}Regex`),this.internalPath.set(e.slice(1,-1))):e.startsWith("*.")?(this.pathType.set(`${n}Extension`),this.internalPath.set(e.slice(2))):(this.pathType.set(`${n}Expression`),this.internalPath.set(e))});updateFilter(){let t=this.internalPath(),e=this.currentExpressionOption();t!==""&&this.pathChange.emit(`${e?.value.slice(0,1)}${e?.startsWith??""}${t}${e?.endsWith??""}`)}removeFilter(){this.remove.emit()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=H({type:o,selectors:[["app-new-filter"]],inputs:{path:[1,"path"],osType:[1,"osType"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:7,vars:4,consts:()=>{let t;return t=$localize`Select an option...`,[["value","value","label","key",3,"options","isClearable"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],["value","key","label","value",1,"expression-input",3,"options","isClearable","selectMultiple"],[1,"expression-input"],[1,"filter-removal",3,"click"],[1,"sh-primary"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],["suffix",""]]},template:function(e,n){if(e&1&&(s(0,"sh-select",0)(1,"input",1),w("ngModelChange",function(a){return O(n.pathType,a)||(n.pathType=a),a}),h("ngModelChange",function(){return n.updateFilter()}),l()(),A(2,Dt,2,4,"sh-select",2)(3,Rt,4,3,"sh-form-field",3),s(4,"div",4),h("click",function(){return n.removeFilter()}),s(5,"sh-icon",5),G(6,"x-circle"),l()()),e&2){let i;F("options",n.expressionOptions())("isClearable",!1),r(),R("ngModel",n.pathType),r(),D(((i=n.currentExpressionOption())==null?null:i.value)=="-FileGroup"||((i=n.currentExpressionOption())==null?null:i.value)=="+FileGroup"?2:3)}},dependencies:[oe,j,q,ie,se,Q,Y],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}.expression-input[_ngcontent-%COMP%]{--ff-suffix-bg: var(--base-2)}.filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var It=["formRef"],ze=()=>({standalone:!0});function Lt(o,t){if(o&1){let e=$();s(0,"sh-form-field",41)(1,"input",42),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.editingPath,i)||(a.editingPath=i),E(i)}),l()(),s(2,"button",43),h("click",function(){g(e);let i=u(2);return E(i.updatePath())}),s(3,"sh-icon"),G(4,"floppy-disk"),l()(),s(5,"button",43),h("click",function(){g(e);let i=u(2);return E(i.cancelEditPath())}),s(6,"sh-icon"),G(7,"x-bold"),l()()}if(o&2){let e=u(2);r(),R("ngModel",e.editingPath),F("ngModelOptions",me(2,ze))}}function $t(o,t){if(o&1){let e=$();s(0,"sh-form-field",41),T(1,"input",44),l(),s(2,"button",43),h("click",function(){g(e);let i=u().$implicit,a=u();return E(a.editPath(i))}),s(3,"sh-icon"),G(4,"pen"),l()(),s(5,"button",43),h("click",function(){g(e);let i=u().$implicit,a=u();return E(a.removePath(i))}),s(6,"sh-icon"),G(7,"trash-simple"),l()()}if(o&2){let e=u().$implicit;Qe("readonly",!0),r(),F("ngModel",e)("ngModelOptions",me(3,ze))}}function Gt(o,t){if(o&1&&(s(0,"div",30),A(1,Lt,8,3)(2,$t,8,4),l()),o&2){let e=t.$implicit,n=u();r(),D(n.oldPath()===e?1:2)}}function Ut(o,t){if(o&1){let e=$();s(0,"app-new-filter",46),h("pathChange",function(i){let a=g(e).$index,c=u(2);return E(c.patchPathAt(i,a))})("remove",function(){let i=g(e).$index,a=u(2);return E(a.removePathAt(i))}),l()}if(o&2){let e=t.$implicit,n=u(2);F("path",e)("osType",n.osType()??"")}}function xt(o,t){if(o&1&&Ue(0,Ut,1,2,"app-new-filter",45,Ge),o&2){let e=u();xe(e.pathArray())}}function bt(o,t){if(o&1){let e=$();s(0,"div",31)(1,"app-size",47),h("ngModelChange",function(i){g(e);let a=u();return E(a.updateFilesLargerThan(i))}),l()()}if(o&2){let e=u();r(),F("ngModel",e.filesLargerThan())("ngModelOptions",me(2,ze))}}var k=new De,Tt=(o={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>k.group({path:k.control(o.path),excludes:k.group({hidden:k.control(o.excludes.hidden),system:k.control(o.excludes.system),temporary:k.control(o.excludes.temporary),filesLargerThan:k.group({size:k.control(null),unit:k.control(null)})})}),He=class o{#e=y(Z);#t=y(z);#i=y(ne);formRef=Te.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new et("");filesLargerThan=L(()=>{let t=this.sourceDataFormSignal()?.excludes?.filesLargerThan??{};return t.size!==null&&t.unit!==null?`${t.size}${t.unit}`:null});osType=this.#e.osType;pathSignal=le(this.sourceDataForm.controls.path.valueChanges);pathArray=L(()=>this.pathSignal()?.split("\0").filter(t=>t.startsWith("-")||t.startsWith("+")||t==="___none___")??[]);nonFilterPaths=L(()=>this.pathSignal()?.split("\0").filter(t=>!t.startsWith("-")&&!t.startsWith("+")&&t!==""));oldPath=p(null);editingPath=p(null);addingNewPath=p(!1);editPath(t){this.oldPath.set(t),this.editingPath.set(t)}updateFilesLargerThan(t){let{size:e,unit:n}=Oe(t);this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:e,unit:n})}updatePath(){let t=this.oldPath(),e=this.editingPath();if(!t||!e||e===t){this.oldPath.set(null),this.editingPath.set(null);return}let n=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(n?.replace(t,e)??""),this.oldPath.set(null),this.editingPath.set(null)}cancelEditPath(){this.oldPath.set(null),this.editingPath.set(null)}removePath(t){let n=(this.sourceDataForm.controls.path.value??"").split("\0"),i=n.indexOf(t);if(i===-1)return;n.splice(i,1);let a=n.filter(c=>c&&c!=="").join("\0");this.sourceDataForm.controls.path.setValue(a)}addFilter(t="-*"){let n=[this.sourceDataForm.controls.path.value,t].filter(i=>i&&i!=="").join("\0");this.sourceDataForm.controls.path.setValue(n)}patchPathAt(t,e){let i=this.sourceDataForm.controls.path.value.split("\0").filter(C=>!C.startsWith("-")&&!C.startsWith("+")).join("\0"),a=this.pathArray().map((C,_)=>_===e?`${t}`:`${C}`).join("\0"),c=[i,a].filter(C=>C&&C!=="").join("\0");this.sourceDataForm.controls.path.setValue(c)}removePathAt(t){let n=this.sourceDataForm.controls.path.value.split("\0").filter(c=>!c.startsWith("-")&&!c.startsWith("+")).join("\0"),i=this.pathArray().filter((c,C)=>C!==t).join("\0"),a=[n,i].filter(c=>c&&c!=="").join("\0");this.sourceDataForm.controls.path.setValue(a)}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 t=this.sourceDataForm.controls.path.value,e=this.newPathCtrl.value,n=t?.split("\0")||[];e&&!n.includes(e)&&n.push(e);let i=n.filter(a=>a&&a!=="").join("\0");this.sourceDataForm.controls.path.setValue(i),this.newPathCtrl.setValue("")}goBack(){this.#t.navigate(["destination"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=H({type:o,selectors:[["app-source-data"]],viewQuery:function(e,n){e&1&&ge(n.formRef,It,5),e&2&&Ee()},decls:56,vars:12,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Add a direct path`;let n;n=$localize`Hidden files`;let i;i=$localize`System files`;let a;a=$localize`Temporary files`;let c;c=$localize`Source Data`;let C;C=$localize`Folder path`;let _;_=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let d;d=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let I;I=$localize`Paths`;let U;U=$localize`Add a path directly from your machine.`;let B;B=$localize`Filters`;let V;V=$localize`Customize your filters.`;let x;x=$localize`Add filter`;let K;K=$localize`Exclude`;let W;W=$localize`Choose if there’s any files you want to exclude.`;let N;N=$localize` Files with the Hidden attribute ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let re;re=$localize` Files with the System attribute ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`;let _e;_e=$localize` Files with the Temporary attribute ${"\uFFFD#52\uFFFD\uFFFD/#52\uFFFD"}:TAG_INPUT:`;let ue;ue=$localize` Files larger than `;let P;return P=$localize`Edit path`,[["formRef",""],c,C,_,d,I,U,B,V,x,K,W,N,re,_e,ue,[3,"submit","formGroup"],[1,"left"],[1,"title-30"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",t,"formControlName","path"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],["description",""],[1,"paths"],[1,"path"],[1,"row-inputs"],["type","text","placeholder",e,3,"formControl"],["shButton","","type","button",1,"raised","primary",3,"click"],["type","button","shButton","","action","",3,"click"],["formGroupName","excludes",3,"disallowToggle"],[1,"raised","primary"],["type","checkbox","placeholder",n,"formControlName","hidden"],["type","checkbox","placeholder",i,"formControlName","system"],["type","checkbox","placeholder",a,"formControlName","temporary"],[1,"raised","primary",3,"click"],[1,"small"],["type","text","placeholder",P,3,"ngModelChange","ngModel","ngModelOptions"],["shButton","","type","button",1,"small",3,"click"],["type","text",3,"ngModel","ngModelOptions"],[3,"path","osType"],[3,"pathChange","remove","path","osType"],[3,"ngModelChange","ngModel","ngModelOptions"]]},template:function(e,n){if(e&1){let i=$();s(0,"form",16,0),h("submit",function(){return g(i),E(n.next())}),s(2,"div",17)(3,"h3",18),f(4,1),l(),s(5,"app-file-tree",19)(6,"label",20),f(7,2),l(),T(8,"input",21),l(),s(9,"div",22)(10,"button",23),h("click",function(){return g(i),E(n.goBack())}),S(11,3),T(12,"sh-icon"),m(),l(),s(13,"button",24),S(14,4),T(15,"sh-icon"),m(),l()()(),s(16,"div",25)(17,"app-toggle-card",26),b(18,27),f(19,5),v(),s(20,"p",28),f(21,6),l(),s(22,"div",29),Ue(23,Gt,3,1,"div",30,Ge),s(25,"div",31)(26,"sh-form-field"),T(27,"input",32),l(),s(28,"button",33),h("click",function(){return g(i),E(n.addNewPath())}),s(29,"sh-icon"),G(30,"plus"),l()()()()(),s(31,"app-toggle-card",26),b(32,27),f(33,7),v(),s(34,"p",28),f(35,8),l(),s(36,"button",34),h("click",function(){return g(i),E(n.addFilter())}),f(37,9),l(),A(38,xt,2,0),l(),s(39,"app-toggle-card",35),b(40,27),f(41,10),v(),s(42,"p",28),f(43,11),l(),s(44,"sh-toggle",36),S(45,12),T(46,"input",37),m(),l(),s(47,"sh-toggle",36),S(48,13),T(49,"input",38),m(),l(),s(50,"sh-toggle",36),S(51,14),T(52,"input",39),m(),l(),s(53,"sh-toggle",40),h("click",function(){return g(i),E(n.toggleFilesLargerThan())}),f(54,15),l(),A(55,bt,2,3,"div",31),l()()()}if(e&2){let i;F("formGroup",n.sourceDataForm),r(5),F("multiSelect",!0)("startingPath",n.getPath())("showFiles",!0),r(12),F("disallowToggle",!0),r(6),xe(n.nonFilterPaths()),r(4),F("formControl",n.newPathCtrl),r(4),F("disallowToggle",!0),r(7),D((i=n.pathSignal())!=null&&i.length?38:-1),r(),F("disallowToggle",!0),r(14),Se("active",n.filesLargerThan()),r(2),D(n.filesLargerThan()?55:-1)}},dependencies:[oe,fe,j,Fe,q,Ne,ie,ye,nt,Ae,Pe,it,Q,Y,ae,Me,Le,Et,St,gt],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-4)}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}sh-divider[_ngcontent-%COMP%]{margin:.75rem 0}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.25rem}.paths[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;overflow:auto}.path[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr min-content min-content;gap:.25rem}"],changeDetection:0})};var Ft="1W:1D,4W:1W,12M:1M",Z=class o{#e=y(z);#t=y(Re);#i=y(at);#n=y(ut);#r=y(ct);#a=y(we);generalForm=ht();sourceDataForm=Tt();scheduleFields=Xe();scheduleType=p("daily");settings=p([]);optionsFields={remoteVolumeSize:p("50MB"),backupRetention:p("all"),backupRetentionTime:p(""),backupRetentionVersions:p(0),backupRetentionCustom:p("")};targetUrlModel=p(null);backupMetadata=p(null);isDraft=p(!1);backupId=p(null);backupName=L(()=>this.generalFormSignal()?.name??"");isSubmitting=p(!1);finishedLoading=p(!1);backupDefaults=p(null);applicationOptions=p(null);isNew=L(()=>this.backupId()==="new");osType=L(()=>this.#t.systemInfo()?.OSType);selectedOptions=p([]);sourceDataFormSignal=le(this.sourceDataForm.valueChanges);generalFormSignal=le(this.generalForm.valueChanges);encryptionFieldSignal=le(this.generalForm.controls.encryption.valueChanges);advancedOptions=L(()=>this.#t.systemInfo()?.Options?.map(this.#u)??[]);#o=p("");#s=p(null);#l=null;testSignal=this.#o.asReadonly();testErrorMessage=this.#s.asReadonly();#p=te(()=>{let t=this.targetUrlModel(),e=this.#o(),n=this.#l;this.#l=t,!(e==="testing"||n===null||n===t)&&(this.#o.set(""),this.#s.set(null))});setTestState(t,e){this.#o.set(t),this.#s.set(e??null)}#u(t){return{name:t.Name,type:t.Type,shortDescription:t.ShortDescription??void 0,longDescription:t.LongDescription??void 0,options:t.ValidValues}}encryptionOptions=L(()=>{let t=this.#t.systemInfo()?.EncryptionModules??[];return[pe,...t]});nonSelectedOptions=L(()=>this.advancedOptions().sort((t,e)=>t?.name&&e?.name?t?.name.localeCompare(e?.name):0).filter(t=>this.selectedOptions()?.findIndex(e=>e.name===t.name)===-1));submit(t=!1){this.isSubmitting.set(!0);let e=this.#d(),n=this.backupId();this.isDraft()&&e.Backup&&(e.Backup.Metadata=this.backupMetadata()),n==="new"||!n||this.isDraft()?this.#n.postApiV1Backups({requestBody:e}).pipe($e(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}}):this.#n.putApiV1BackupById({id:n,requestBody:e}).pipe($e(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}})}exit(t){if(!t){this.#_(),this.#e.navigate(["/"]);return}this.#i.open(dt,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#_(),this.#e.navigate(["/"]))}})}mapSourceDataToForm(t){let e=t.Sources??"",n=t.Filters?.map(C=>`${C.Include?"":"-"}${C.Expression}`)??[],i=t.Settings?.find(C=>C.Name==="--exclude-files-attributes")?.Value?.toLowerCase()?.split(",")??[],a=t.Settings?.find(C=>C.Name==="--skip-files-larger-than")?.Value?.toUpperCase()??null,c={path:[...e,...n].join("\0"),excludes:{hidden:i.includes("hidden"),system:i.includes("system"),temporary:i.includes("temporary"),filesLargerThan:a===null?void 0:Oe(a)}};this.sourceDataForm.patchValue(c)}mapDestinationToForm(t){this.targetUrlModel.set(t.TargetURL??"")}mapGeneralToForm(t){let e=t.Name??"",n=t.Description??"",i=t.Settings?.find(d=>d.Name==="encryption-module"),a=t.Settings?.find(d=>d.Name==="passphrase")?.Value??"",c=i?.Value&&i.Value.length?i.Value:"",C=t.Settings?.find(d=>d.Name==="compression-module")?.Value??"",_={name:t.Name??"",description:t.Description??""};e&&e!==""&&(_.name=e),n&&n!==""&&(_.description=n),c&&c!==""&&(_.encryption=c),a&&a!==""&&(_.password=a,_.repeatPassword=a),C&&C!==""&&(_.compression=C),this.generalForm.patchValue(_)}mapScheduleToForm(t){if(!t){this.scheduleType.set("disabled"),this.scheduleFields.autoRun.set(!1);return}let e=this.#a.fromString(t.Repeat)??null,n=this.#c(t.Time);this.scheduleFields.autoRun.set(!0),n.date&&this.scheduleFields.nextTime.date.set(n.date),this.scheduleFields.nextTime.time.set(n.time),this.scheduleFields.runAgain.repeatUnit.set(e?.unit??"D"),this.scheduleFields.runAgain.repeatValue.set(e?.value??1),this.scheduleFields.runAgain.allowedDays.mon.set(t.AllowedDays?.includes("mon")??!1),this.scheduleFields.runAgain.allowedDays.tue.set(t.AllowedDays?.includes("tue")??!1),this.scheduleFields.runAgain.allowedDays.wed.set(t.AllowedDays?.includes("wed")??!1),this.scheduleFields.runAgain.allowedDays.thu.set(t.AllowedDays?.includes("thu")??!1),this.scheduleFields.runAgain.allowedDays.fri.set(t.AllowedDays?.includes("fri")??!1),this.scheduleFields.runAgain.allowedDays.sat.set(t.AllowedDays?.includes("sat")??!1),this.scheduleFields.runAgain.allowedDays.sun.set(t.AllowedDays?.includes("sun")??!1);let i=ce(this.scheduleFields),a=Ie.find(c=>JSON.stringify(c.data)===JSON.stringify(i));a?this.scheduleType.set(a.value):this.scheduleType.set("custom")}mapOptionsToForms(t,e=!1){let n=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","passphrase","keep-time","keep-versions","retention-policy"],i=(t.Settings??[]).map(_=>_);if(e){let _=this.#r.serverSettings()??{};Object.keys(_).filter(d=>d.startsWith("--")).forEach(d=>{i.find(U=>U.Name===d)||i.push({Name:d,Value:_[d],Filter:null})})}let a=i.filter(_=>!n.includes(_.Name)),c=i.filter(_=>n.includes(_.Name));this.settings.set(a??[]),a?.forEach(_=>{if(_.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(_.Value??"")});var C="all";c?.forEach(_=>{if(_.Name==="dblock-size"&&this.optionsFields.remoteVolumeSize.set(_.Value??"50MB"),_.Name==="keep-time"&&(_.Value??"")!=="")return C="time",this.optionsFields.backupRetentionTime.set(_.Value??"");if(_.Name==="keep-versions"&&(_.Value??"")!=="")return C="versions",this.optionsFields.backupRetentionVersions.set(_.Value?parseInt(_.Value):null);if(_.Name==="retention-policy"&&(_.Value??"")!=="")if(_.Value===Ft)C="smart";else return C="custom",this.optionsFields.backupRetentionCustom.set(_.Value??"")}),this.optionsFields.backupRetention.set(C)}storeMetadata(t,e){this.backupMetadata.set(e?t.Metadata??null:null)}getScheduleFormValue(){let t=ce(this.scheduleFields);return mt(t)}#d(){let t=this.generalForm.value,e=this.getScheduleFormValue(),n=this.sourceDataForm.value,i=this.targetUrlModel(),a=n.path?.split("\0")??[],c=this.mapFormsToSettings(),C=Object.entries(n.excludes??{}).filter(([d,I])=>I&&d!=="filesLargerThan").map(([d])=>d),_=n.excludes?.filesLargerThan;return C.length&&c.push({Name:"--exclude-files-attributes",Value:C.join(",")}),_&&_.size!==null&&_.unit!==null&&c.push({Name:"--skip-files-larger-than",Value:`${_.size}${_.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:i??null,Sources:a.filter(d=>!(d.startsWith("-")||d.startsWith("+"))),Settings:c,Filters:a.filter(d=>d.startsWith("-")||d.startsWith("+")).map((d,I)=>({Order:I,Include:d.startsWith("+"),Expression:d.slice(1)}))},Schedule:e}}mapFormsToSettings(t=[]){let e=this.generalForm.value,n=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","encryption-module","passphrase","keep-time","keep-versions","retention-policy","dblock-size","compression-module"],i=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&e.encryption!==pe.Key&&(i=[{Name:"encryption-module",Value:e.encryption??null},{Name:"passphrase",Value:e.password??null}]);let a=[{Name:"compression-module",Value:e.compression}];e.compression===""&&(a=[]);let c=[{Name:"dblock-size",Value:this.optionsFields.remoteVolumeSize()}];switch(this.optionsFields.backupRetention()){case"time":c.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":c.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":c.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":c.push({Name:"retention-policy",Value:Ft});break}let C=[...t,...n],_=this.settings().filter(d=>!C.includes(d.Name)).map(d=>{let I=d.Value;return typeof d.Value=="number"&&(I=d.Value.toString()),typeof d.Value=="boolean"&&(I=d.Value?"True":"False"),{Name:d.Name?.startsWith("--")?d.Name:`--${d.Name}`,Value:I}});return[...i,...a,...c,..._]}#c(t){if(!t||t?.indexOf("T")===-1)return{time:t??"13:00"};let e=new Date(t);return{time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`,date:e.toISOString().split("T")[0]}}setTargetUrl(t,e=!1){e&&(this.#l=null),this.targetUrlModel.set(t)}#_(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleFields=Xe(),this.optionsFields.remoteVolumeSize.set("50MB"),this.optionsFields.backupRetention.set("all"),this.settings.set([]),this.targetUrlModel.set(null)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=Ce({token:o,factory:o.\u0275fac,providedIn:"root"})};var vt=["formRef"];function kt(o,t){o&1&&(s(0,"sh-alert",17),S(1,5),T(2,"sh-icon",26),m(),l())}function Bt(o,t){if(o&1&&G(0),o&2){let e=t.$implicit;Ze(" ",e.DisplayName," ")}}function Vt(o,t){if(o&1&&T(0,"sh-progress-bar",40),o&2){let e=u(3);Se("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),F("value",e.calculatePasswordStrength()*(100/5))}}function Kt(o,t){o&1&&(s(0,"span",35),f(1,10),l())}function Wt(o,t){o&1&&(S(0,8,1),T(1,"sh-icon"),m())}function Jt(o,t){o&1&&(S(0,8,2),T(1,"sh-icon"),m())}function Xt(o,t){o&1&&(S(0,11,1),T(1,"sh-icon",42),m())}function Ht(o,t){o&1&&(S(0,11,2),T(1,"sh-icon"),m())}function zt(o,t){if(o&1){let e=$();s(0,"button",41),h("click",function(){g(e);let i=u(3);return E(i.copyPassword())}),S(1,11),A(2,Xt,2,0)(3,Ht,2,0),m(),l()}if(o&2){let e=u(3);r(2),D(e.copiedPassword()?2:3)}}function jt(o,t){o&1&&(s(0,"sh-alert",39),f(1,12),l())}function qt(o,t){if(o&1){let e=$();s(0,"div",30)(1,"sh-form-field")(2,"label",31),S(3,7),T(4,"sup"),m(),l(),T(5,"input",32),l(),A(6,Vt,1,9,"sh-progress-bar",33),s(7,"sh-form-field"),T(8,"input",34),A(9,Kt,2,0,"span",35),l(),s(10,"div",36)(11,"button",37),h("click",function(){g(e);let i=u(2);return E(i.showPassword.set(!i.showPassword()))}),S(12,8),A(13,Wt,2,0)(14,Jt,2,0),m(),l(),s(15,"button",37),h("click",function(){g(e);let i=u(2);return E(i.generatePassword())}),S(16,9),T(17,"sh-icon"),m(),l(),A(18,zt,4,1,"button",38),l(),A(19,jt,2,0,"sh-alert",39),l()}if(o&2){let e=u(2);r(5),F("type",e.showPassword()?"text":"password"),r(),D(e.generalForm.value.password?6:-1),r(2),F("type",e.showPassword()?"text":"password"),r(),D(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),r(4),D(e.showPassword()?13:14),r(5),D(e.showCopyPassword()?18:-1),r(),D(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function Yt(o,t){if(o&1&&(s(0,"sh-select",27)(1,"label",28),f(2,6),l(),T(3,"input",29),qe(4,Bt,1,1,"ng-template"),l(),A(5,qt,20,7,"div",30)),o&2){let e=u();F("options",e.encryptionOptions())("isClearable",!1),r(5),D(e.encryptionFieldSignal()!==e.noneOptionKey?5:-1)}}function Qt(o,t){if(o&1&&(s(0,"button",24),S(1,13),T(2,"sh-icon"),m(),l()),o&2){let e=u();F("disabled",e.nameAndDescriptionValid()===!1)}}function Zt(o,t){if(o&1&&(s(0,"button",25),S(1,14),T(2,"sh-icon"),m(),l()),o&2){let e=u();F("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var ee=new De,ht=(o={name:"",description:"",encryption:"",password:"",repeatPassword:"",compression:""})=>ee.group({name:ee.control(o.name,[he.required]),description:ee.control(o.description),encryption:ee.control(o.encryption,[Ct()]),password:ee.control(o.password,[Ve(t=>t?.value.encryption!=="",[he.required])]),repeatPassword:ee.control(o.repeatPassword,[Ve(t=>t?.value.encryption!=="",[he.required])]),compression:ee.control(o.compression)}),pe={Key:"-",DisplayName:"None"},je=class o{#e=y(z);#t=y(ne);#i=y(pt);#n=y(Z);#r=y(Re);formRef=Te.required("formRef");generalForm=this.#n.generalForm;generalFormSignal=this.#n.generalFormSignal;encryptionFieldSignal=this.#n.encryptionFieldSignal;encryptionOptions=this.#n.encryptionOptions;isNew=this.#n.isNew;showPassword=p(!1);copiedPassword=p(!1);showCopyPassword=p(!1);noneOptionKey=pe.Key;encryptionEffect=te(()=>{this.encryptionFieldSignal()===pe.Key&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=L(()=>{let t=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=L(()=>{let e=this.generalFormSignal()?.password??"";return this.#i.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#n.exit(!0)}async copyPassword(){let t=this.generalForm.controls.password.value;await this.#a(t??""),this.copiedPassword.set(!0)}async#a(t){try{await navigator.clipboard.writeText(t)}catch{try{let n=document.createElement("textarea");n.value=t,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}catch(n){console.error("Failed to copy text: ",n)}}}generatePassword(){this.copiedPassword.set(!1);let t=this.#i.generate(16);this.generalForm.controls.password.setValue(t),this.generalForm.controls.repeatPassword.setValue(t),this.showCopyPassword.set(!0)}next(){this.#n.isNew()||this.#n.submit(!0),this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=H({type:o,selectors:[["app-general"]],viewQuery:function(e,n){e&1&&ge(n.formRef,vt,5),e&2&&Ee()},decls:21,vars:4,consts:()=>{let t;t=$localize`Your backup name`;let e;e=$localize`Your backup description`;let n;n=$localize`Remember to copy the password`;let i;i=$localize`General backup settings`;let a;a=$localize` Backup name ${"\uFFFD#8\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#8\uFFFD"}:CLOSE_SUPERSCRIPT:`;let c;c=$localize`Backup description`;let C;C=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Exit `;let _;_=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Encrypted backup `;let d;d=$localize`Encryption`;let I;I=$localize`Encryption`;let U;U=$localize`Password`;let B;B=$localize`Repeat password`;let V;V=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let x;x=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,x=be(x);let K;K=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let W;W=$localize`Passwords do not match`;let N;N=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,N=be(N);let re;re=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let _e;_e=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let ue;return ue=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],i,a,c,C,_,I,V,x,K,W,N,re,_e,ue,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],[1,"primary"],["for","backupName"],["type","text","tabindex","1","placeholder",t,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","shButton","",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],["shButton","","type","submit","shTooltip",n,1,"raised","primary",3,"disabled"],["icon",""],["value","Key","label","DisplayName",3,"options","isClearable"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",d,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",U,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",B,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["shButton","","type","button",1,"small","copy",3,"click"],[1,"sh-success"]]},template:function(e,n){if(e&1){let i=$();s(0,"form",15,0),h("submit",function(){return g(i),E(n.next())}),s(2,"h3",16),f(3,1),l(),A(4,kt,3,0,"sh-alert",17),s(5,"sh-form-field")(6,"label",18),S(7,2),T(8,"sup"),m(),l(),T(9,"input",19),l(),s(10,"sh-form-field")(11,"label",20),f(12,3),l(),T(13,"textarea",21),l(),A(14,Yt,6,3),s(15,"div",22)(16,"button",23),h("click",function(){return g(i),E(n.exit())}),S(17,4),T(18,"sh-icon"),m(),l(),A(19,Qt,3,1,"button",24)(20,Zt,3,1,"button",25),l()()}if(e&2){let i;F("formGroup",n.generalForm),r(4),D(!n.isNew()&&((i=n.generalFormSignal())==null?null:i.encryption)!==""?4:-1),r(10),D(n.isNew()?14:-1),r(5),D(n.encryptionFieldSignal()===n.noneOptionKey||!n.isNew()?19:20)}},dependencies:[ye,fe,j,q,Ne,Ae,Pe,Q,se,ae,Y,lt,ot,_t],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--error-8)}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.copy[_ngcontent-%COMP%] sh-icon.sh-success[_ngcontent-%COMP%]{color:var(--success-8)}"],changeDetection:0})};export{ht as a,pe as b,je as c,Ie as d,mt as e,Xe as f,Ke as g,Tt as h,He as i,Z as j};
|
|
1
|
+
import{a as St}from"./chunk-GMNCWLGX.js";import{b as Oe,c as gt,d as Et}from"./chunk-B5LH4P4E.js";import{a as pt,b as Ve,c as Ct}from"./chunk-TJYZBTTS.js";import{a as dt}from"./chunk-WILUKPQ3.js";import{a as Re}from"./chunk-NEV6JB5M.js";import{a as ct}from"./chunk-5UXRNNTT.js";import{b as le}from"./chunk-FBWFZMGL.js";import{B as ae,F as st,H as Q,L as lt,P as se,V as rt,W as Me,Y as _t,b as Fe,c as j,d as he,e as q,f as Ne,h as et,i as ie,j as fe,k as tt,n as nt,o as it,p as Pe,q as Ae,r as De,s as oe,t as ye,u as Y,w as ot,z as at}from"./chunk-RYXU2QDS.js";import{b as ut}from"./chunk-BKANUILG.js";import{b as ne,d as z}from"./chunk-GO4NSDR6.js";import{$ as g,Ab as l,Bb as T,E as $e,Fb as b,Gb as v,Ib as $,Mc as L,Pa as r,Pb as S,Qb as m,Qc as ke,R as Ce,Rb as f,Rc as Be,Sc as Te,Ub as be,Vb as h,W as y,Xb as u,aa as E,cb as H,cc as ge,dc as Ee,gc as Se,hb as qe,jc as G,kb as Ye,kc as ve,la as p,lc as Ze,na as te,oc as R,pc as O,qc as w,rb as Qe,sb as A,tb as D,ub as Ge,wb as Ue,xb as xe,xc as me,yb as F,zb as s}from"./chunk-XYHHESIX.js";import{a as J,b as X}from"./chunk-7CGTOI24.js";var we=class o{fromString(t){if(!t)return null;let e=t.match(/(\d+)([smhDWMY])/);return e&&{value:parseInt(e[1]),unit:e[2]}}toString(t,e){return`${t}${e}`}static \u0275fac=function(e){return new(e||o)};static \u0275prov=Ce({token:o,factory:o.\u0275fac,providedIn:"root"})};function ce(o){if(Ye(o))return o();if(Array.isArray(o))return o.map(t=>ce(t));if(typeof o=="object"&&o!==null){let t={};for(let e in o)o.hasOwnProperty(e)&&(t[e]=ce(o[e]));return t}return o}function Nt(o,t){if(o&1){let e=$();s(0,"div",26)(1,"sh-form-field")(2,"label",27),f(3,7),l(),s(4,"input",28,0),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.nextTime.time,i)||(a.scheduleFields.nextTime.time=i),E(i)}),l(),s(6,"sh-icon",29),G(7,"clock"),l()(),s(8,"sh-datepicker-input",30)(9,"label",31),G(10,"\xA0"),l(),s(11,"input",32,1),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.nextTime.date,i)||(a.scheduleFields.nextTime.date=i),E(i)}),l(),s(13,"sh-icon",29),G(14,"calendar"),l()()(),s(15,"div",26)(16,"sh-form-field")(17,"label",33),f(18,8),l(),s(19,"input",34),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.repeatValue,i)||(a.scheduleFields.runAgain.repeatValue=i),E(i)}),l()(),s(20,"sh-select",35)(21,"input",36),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.repeatUnit,i)||(a.scheduleFields.runAgain.repeatUnit=i),E(i)}),l()()(),s(22,"sh-toggle-card",37),b(23,38),f(24,9),v(),s(25,"div",39)(26,"sh-toggle",24),S(27,10),s(28,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.mon,i)||(a.scheduleFields.runAgain.allowedDays.mon=i),E(i)}),l(),m(),l(),s(29,"sh-toggle",24),S(30,11),s(31,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.tue,i)||(a.scheduleFields.runAgain.allowedDays.tue=i),E(i)}),l(),m(),l(),s(32,"sh-toggle",24),S(33,12),s(34,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.wed,i)||(a.scheduleFields.runAgain.allowedDays.wed=i),E(i)}),l(),m(),l(),s(35,"sh-toggle",24),S(36,13),s(37,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.thu,i)||(a.scheduleFields.runAgain.allowedDays.thu=i),E(i)}),l(),m(),l(),s(38,"sh-toggle",24),S(39,14),s(40,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.fri,i)||(a.scheduleFields.runAgain.allowedDays.fri=i),E(i)}),l(),m(),l(),s(41,"sh-toggle",24),S(42,15),s(43,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.sat,i)||(a.scheduleFields.runAgain.allowedDays.sat=i),E(i)}),l(),m(),l(),s(44,"sh-toggle",24),S(45,16),s(46,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.sun,i)||(a.scheduleFields.runAgain.allowedDays.sun=i),E(i)}),l(),m(),l()()()}if(o&2){let e=u(2);r(4),R("ngModel",e.scheduleFields.nextTime.time),r(7),R("ngModel",e.scheduleFields.nextTime.date),r(8),R("ngModel",e.scheduleFields.runAgain.repeatValue),r(),F("options",e.unitOptions)("isClearable",!1),r(),R("ngModel",e.scheduleFields.runAgain.repeatUnit),r(),F("disallowToggle",!0),r(6),R("ngModel",e.scheduleFields.runAgain.allowedDays.mon),r(3),R("ngModel",e.scheduleFields.runAgain.allowedDays.tue),r(3),R("ngModel",e.scheduleFields.runAgain.allowedDays.wed),r(3),R("ngModel",e.scheduleFields.runAgain.allowedDays.thu),r(3),R("ngModel",e.scheduleFields.runAgain.allowedDays.fri),r(3),R("ngModel",e.scheduleFields.runAgain.allowedDays.sat),r(3),R("ngModel",e.scheduleFields.runAgain.allowedDays.sun)}}function ft(o,t){if(o&1){let e=$();s(0,"div",23)(1,"sh-toggle",24),S(2,5),s(3,"input",25),w("ngModelChange",function(i){g(e);let a=u();return O(a.scheduleFields.autoRun,i)||(a.scheduleFields.autoRun=i),E(i)}),l(),m(),l(),s(4,"p"),f(5,6),l()(),A(6,Nt,47,14)}if(o&2){let e=u();r(3),R("ngModel",e.scheduleFields.autoRun),r(3),D(e.scheduleFields.autoRun()?6:-1)}}var Pt=[{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`}],Ie=[{key:$localize`Daily 13:00`,value:"daily",data:{autoRun:!0,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!0,sun:!0}}}},{key:$localize`Weekdays 13:00`,value:"weekdays",data:{autoRun:!0,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!1,sun:!1}}}},{key:$localize`Weekly monday 13:00`,value:"weekly",data:{autoRun:!0,nextTime:{time:"13:00:00",date:At().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"W",allowedDays:{mon:!0,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}}},{key:$localize`Don't run automatically`,value:"disabled",data:{autoRun:!1,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!0,sun:!0}}}},{key:$localize`Custom`,value:"custom",data:{autoRun:!0,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!0,sun:!0}}}}];function mt(o){if(!o.autoRun)return null;let t=[o.runAgain.allowedDays.mon?"Monday":null,o.runAgain.allowedDays.tue?"Tuesday":null,o.runAgain.allowedDays.wed?"Wednesday":null,o.runAgain.allowedDays.thu?"Thursday":null,o.runAgain.allowedDays.fri?"Friday":null,o.runAgain.allowedDays.sat?"Saturday":null,o.runAgain.allowedDays.sun?"Sunday":null].filter(c=>c!==null),e=o.nextTime.time.split(":"),n=new Date(o.nextTime.date);n.setHours(parseInt(e[0])),n.setMinutes(parseInt(e[1]));let i=o.runAgain.repeatValue,a=o.runAgain.repeatUnit;return{Time:n.toISOString(),Repeat:`${i}${a}`,AllowedDays:t}}function At(){let o=new Date,t=o.getDay(),e=t===1?7:(8-t)%7;return o.setDate(o.getDate()+e),o.setHours(12,0,0,0),o}var Xe=()=>({autoRun:p(!0),nextTime:{time:p("13:00"),date:p(new Date().toISOString().split("T")[0])},runAgain:{repeatValue:p(1),repeatUnit:p("D"),allowedDays:{mon:p(!0),tue:p(!0),wed:p(!0),thu:p(!0),fri:p(!0),sat:p(!0),sun:p(!0)}}}),Ke=class o{#e=y(Z);#t=y(z);#i=y(ne);unitOptions=Pt;scheduleFields=this.#e.scheduleFields;scheduleType=this.#e.scheduleType;scheduleOptions=Ie;updateScheduleType(t){let e=Ie.find(n=>n.value===t);if(e&&e?.value!=="custom"){this.scheduleType.set(e.value);let n=e.data;this.scheduleFields.autoRun.set(n.autoRun??!1),this.scheduleFields.nextTime.time.set(n.nextTime?.time??"13:00"),this.scheduleFields.nextTime.date.set(n.nextTime?.date??new Date().toISOString().split("T")[0]),this.scheduleFields.runAgain.repeatValue.set(n.runAgain?.repeatValue??1),this.scheduleFields.runAgain.repeatUnit.set(n.runAgain?.repeatUnit??"D"),this.scheduleFields.runAgain.allowedDays.mon.set(n.runAgain?.allowedDays?.mon??!0),this.scheduleFields.runAgain.allowedDays.tue.set(n.runAgain?.allowedDays?.tue??!0),this.scheduleFields.runAgain.allowedDays.wed.set(n.runAgain?.allowedDays?.wed??!0),this.scheduleFields.runAgain.allowedDays.thu.set(n.runAgain?.allowedDays?.thu??!0),this.scheduleFields.runAgain.allowedDays.fri.set(n.runAgain?.allowedDays?.fri??!0),this.scheduleFields.runAgain.allowedDays.sat.set(n.runAgain?.allowedDays?.sat??!0),this.scheduleFields.runAgain.allowedDays.sun.set(n.runAgain?.allowedDays?.sun??!0)}else this.scheduleType.set("custom")}goBack(){this.#t.navigate(["source"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["options"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=H({type:o,selectors:[["app-schedule"]],decls:12,vars:4,consts:()=>{let t;t=$localize`Select an option...`;let e;e=$localize`Schedule`;let n;n=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let i;i=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let a;a=$localize` Automatically run backups ${"\uFFFD#3\uFFFD\uFFFD/#3\uFFFD"}:TAG_INPUT:`;let c;c=$localize`If a date was missed, the job will run as soon as possible.`;let C;C=$localize`Next time`;let _;_=$localize`Run again every`;let d;d=$localize`Allowed days`;let I;I=$localize` Monday ${"\uFFFD#28\uFFFD\uFFFD/#28\uFFFD"}:TAG_INPUT:`;let U;U=$localize` Tuesday ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let B;B=$localize` Wednesday ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let V;V=$localize` Thursday ${"\uFFFD#37\uFFFD\uFFFD/#37\uFFFD"}:TAG_INPUT:`;let x;x=$localize` Friday ${"\uFFFD#40\uFFFD\uFFFD/#40\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Saturday ${"\uFFFD#43\uFFFD\uFFFD/#43\uFFFD"}:TAG_INPUT:`;let W;return W=$localize` Sunday ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],e,n,i,a,c,C,_,d,I,U,B,V,x,K,W,[1,"title-30"],["label","key","value","value",3,"isClearable","options"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"row-inputs"],["for","time"],["type","time","id","time",3,"ngModelChange","ngModel"],["suffix",""],[1,"primary","sharp"],["for","date"],["type","date","id","date",3,"ngModelChange","ngModel"],["for","repeatValue"],["type","number","id","repeatValue",3,"ngModelChange","ngModel"],["value","key","label","label",3,"options","isClearable"],["type","text","id","repeatUnit",3,"ngModelChange","ngModel"],[3,"disallowToggle"],["title",""],[1,"days-wrap"]]},template:function(e,n){e&1&&(s(0,"h3",17),f(1,2),l(),s(2,"sh-select",18)(3,"input",19),h("ngModelChange",function(a){return n.updateScheduleType(a)}),l()(),A(4,ft,7,2),s(5,"div",20)(6,"button",21),h("click",function(){return n.goBack()}),S(7,3),T(8,"sh-icon"),m(),l(),s(9,"button",22),h("click",function(){return n.next()}),S(10,4),T(11,"sh-icon"),m(),l()()),e&2&&(r(2),F("isClearable",!1)("options",n.scheduleOptions),r(),F("ngModel",n.scheduleType()),r(),D(n.scheduleType()==="custom"?4:-1))},dependencies:[oe,j,tt,Fe,q,ie,Q,Me,Y,ae,se,rt,st],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 1.5rem;display:flex;flex-direction:column;gap:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};function Dt(o,t){if(o&1){let e=$();s(0,"sh-select",2)(1,"input",6),w("ngModelChange",function(i){g(e);let a=u();return O(a.internalPath,i)||(a.internalPath=i),E(i)}),h("ngModelChange",function(){g(e);let i=u();return E(i.updateFilter())}),l()()}if(o&2){let e=u();F("options",e.fileGroupOptions())("isClearable",!1)("selectMultiple",!0),r(),R("ngModel",e.internalPath)}}function yt(o,t){if(o&1&&(b(0,7),G(1),v()),o&2){let e,n=u(2);r(),ve((e=n.currentExpressionOption())==null?null:e.startsWith)}}function Mt(o,t){if(o&1&&(b(0,8),G(1),v()),o&2){let e,n=u(2);r(),ve((e=n.currentExpressionOption())==null?null:e.endsWith)}}function Rt(o,t){if(o&1){let e=$();s(0,"sh-form-field",3)(1,"input",6),w("ngModelChange",function(i){g(e);let a=u();return O(a.internalPath,i)||(a.internalPath=i),E(i)}),h("ngModelChange",function(){g(e);let i=u();return E(i.updateFilter())}),l(),A(2,yt,2,1,"ng-container",7),A(3,Mt,2,1,"ng-container",8),l()}if(o&2){let e,n,i=u();r(),R("ngModel",i.internalPath),r(),D(!((e=i.currentExpressionOption())==null||e.startsWith==null)&&e.startsWith.length?2:-1),r(),D(!((n=i.currentExpressionOption())==null||n.endsWith==null)&&n.endsWith.length?3:-1)}}var Ot=[{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"}],wt=[{key:"Excludes folders where name contains",value:"-FolderName"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileName"},{key:"Excludes file extension",value:"-Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Exclude file groups",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"},{key:"None",value:"-Unknown"}],Le=class o{path=Be.required();osType=Be();pathChange=ke();remove=ke();internalPath=p("");pathType=p("-Expression");currentExpressionOption=L(()=>{let t=this.pathType();return this.expressionOptions().find(e=>e.value===t)});fileGroupOptions=p(Ot);expressionOptions=L(()=>{let e=this.osType()==="Windows"?"\\":"/";return wt.map(n=>n.value==="-Folder"||n.value==="+Folder"?X(J({},n),{startsWith:"",endsWith:""}):n.value==="-FolderName"||n.value==="+FolderName"?X(J({},n),{startsWith:"*",endsWith:`*${e}`}):n.value==="-FileName"||n.value==="+FileName"?X(J({},n),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):n.value==="-FileGroup"||n.value==="+FileGroup"?X(J({},n),{startsWith:"{",endsWith:"}"}):n.value==="-Regex"||n.value==="+Regex"?X(J({},n),{startsWith:"[",endsWith:"]"}):n.value==="-Extension"||n.value==="+Extension"?X(J({},n),{startsWith:"*.",endsWith:""}):X(J({},n),{startsWith:"",endsWith:""}))});pathEffect=te(()=>{let t=this.path(),e=t.slice(1),n=t.startsWith("-")?"-":"+",i=this.osType()==="Windows",a=i?"\\":"/";e.startsWith("%")&&e.endsWith(a)||i&&e.slice(2).startsWith(a)&&e.endsWith(a)||e.startsWith(a)&&e.endsWith(a)?(this.pathType.set(`${n}Folder`),this.internalPath.set(e)):e.startsWith("*")&&e.endsWith(`*${a}`)?(this.pathType.set(`${n}FolderName`),this.internalPath.set(e.slice(1,-2))):e.startsWith("[.*")&&e.endsWith(`[^\\${a}]*]`)?(this.pathType.set(`${n}FileName`),this.internalPath.set(e.slice(3,-7))):e.startsWith("{")&&e.endsWith("}")?(this.pathType.set(`${n}FileGroup`),this.internalPath.set(e.slice(1,-1))):e.startsWith("[")&&e.endsWith("]")?(this.pathType.set(`${n}Regex`),this.internalPath.set(e.slice(1,-1))):e.startsWith("*.")?(this.pathType.set(`${n}Extension`),this.internalPath.set(e.slice(2))):(this.pathType.set(`${n}Expression`),this.internalPath.set(e))});updateFilter(){let t=this.internalPath(),e=this.currentExpressionOption();t!==""&&this.pathChange.emit(`${e?.value.slice(0,1)}${e?.startsWith??""}${t}${e?.endsWith??""}`)}removeFilter(){this.remove.emit()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=H({type:o,selectors:[["app-new-filter"]],inputs:{path:[1,"path"],osType:[1,"osType"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:7,vars:4,consts:()=>{let t;return t=$localize`Select an option...`,[["value","value","label","key",3,"options","isClearable"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],["value","key","label","value",1,"expression-input",3,"options","isClearable","selectMultiple"],[1,"expression-input"],[1,"filter-removal",3,"click"],[1,"sh-primary"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],["suffix",""]]},template:function(e,n){if(e&1&&(s(0,"sh-select",0)(1,"input",1),w("ngModelChange",function(a){return O(n.pathType,a)||(n.pathType=a),a}),h("ngModelChange",function(){return n.updateFilter()}),l()(),A(2,Dt,2,4,"sh-select",2)(3,Rt,4,3,"sh-form-field",3),s(4,"div",4),h("click",function(){return n.removeFilter()}),s(5,"sh-icon",5),G(6,"x-circle"),l()()),e&2){let i;F("options",n.expressionOptions())("isClearable",!1),r(),R("ngModel",n.pathType),r(),D(((i=n.currentExpressionOption())==null?null:i.value)=="-FileGroup"||((i=n.currentExpressionOption())==null?null:i.value)=="+FileGroup"?2:3)}},dependencies:[oe,j,q,ie,se,Q,Y],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}.expression-input[_ngcontent-%COMP%]{--ff-suffix-bg: var(--base-2)}.filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var It=["formRef"],ze=()=>({standalone:!0});function Lt(o,t){if(o&1){let e=$();s(0,"sh-form-field",41)(1,"input",42),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.editingPath,i)||(a.editingPath=i),E(i)}),l()(),s(2,"button",43),h("click",function(){g(e);let i=u(2);return E(i.updatePath())}),s(3,"sh-icon"),G(4,"floppy-disk"),l()(),s(5,"button",43),h("click",function(){g(e);let i=u(2);return E(i.cancelEditPath())}),s(6,"sh-icon"),G(7,"x-bold"),l()()}if(o&2){let e=u(2);r(),R("ngModel",e.editingPath),F("ngModelOptions",me(2,ze))}}function $t(o,t){if(o&1){let e=$();s(0,"sh-form-field",41),T(1,"input",44),l(),s(2,"button",43),h("click",function(){g(e);let i=u().$implicit,a=u();return E(a.editPath(i))}),s(3,"sh-icon"),G(4,"pen"),l()(),s(5,"button",43),h("click",function(){g(e);let i=u().$implicit,a=u();return E(a.removePath(i))}),s(6,"sh-icon"),G(7,"trash-simple"),l()()}if(o&2){let e=u().$implicit;Qe("readonly",!0),r(),F("ngModel",e)("ngModelOptions",me(3,ze))}}function Gt(o,t){if(o&1&&(s(0,"div",30),A(1,Lt,8,3)(2,$t,8,4),l()),o&2){let e=t.$implicit,n=u();r(),D(n.oldPath()===e?1:2)}}function Ut(o,t){if(o&1){let e=$();s(0,"app-new-filter",46),h("pathChange",function(i){let a=g(e).$index,c=u(2);return E(c.patchPathAt(i,a))})("remove",function(){let i=g(e).$index,a=u(2);return E(a.removePathAt(i))}),l()}if(o&2){let e=t.$implicit,n=u(2);F("path",e)("osType",n.osType()??"")}}function xt(o,t){if(o&1&&Ue(0,Ut,1,2,"app-new-filter",45,Ge),o&2){let e=u();xe(e.pathArray())}}function bt(o,t){if(o&1){let e=$();s(0,"div",31)(1,"app-size",47),h("ngModelChange",function(i){g(e);let a=u();return E(a.updateFilesLargerThan(i))}),l()()}if(o&2){let e=u();r(),F("ngModel",e.filesLargerThan())("ngModelOptions",me(2,ze))}}var k=new De,Tt=(o={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>k.group({path:k.control(o.path),excludes:k.group({hidden:k.control(o.excludes.hidden),system:k.control(o.excludes.system),temporary:k.control(o.excludes.temporary),filesLargerThan:k.group({size:k.control(null),unit:k.control(null)})})}),He=class o{#e=y(Z);#t=y(z);#i=y(ne);formRef=Te.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new et("");filesLargerThan=L(()=>{let t=this.sourceDataFormSignal()?.excludes?.filesLargerThan??{};return t.size!==null&&t.unit!==null?`${t.size}${t.unit}`:null});osType=this.#e.osType;pathSignal=le(this.sourceDataForm.controls.path.valueChanges);pathArray=L(()=>this.pathSignal()?.split("\0").filter(t=>t.startsWith("-")||t.startsWith("+")||t==="___none___")??[]);nonFilterPaths=L(()=>this.pathSignal()?.split("\0").filter(t=>!t.startsWith("-")&&!t.startsWith("+")&&t!==""));oldPath=p(null);editingPath=p(null);addingNewPath=p(!1);editPath(t){this.oldPath.set(t),this.editingPath.set(t)}updateFilesLargerThan(t){let{size:e,unit:n}=Oe(t);this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:e,unit:n})}updatePath(){let t=this.oldPath(),e=this.editingPath();if(!t||!e||e===t){this.oldPath.set(null),this.editingPath.set(null);return}let n=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(n?.replace(t,e)??""),this.oldPath.set(null),this.editingPath.set(null)}cancelEditPath(){this.oldPath.set(null),this.editingPath.set(null)}removePath(t){let n=(this.sourceDataForm.controls.path.value??"").split("\0"),i=n.indexOf(t);if(i===-1)return;n.splice(i,1);let a=n.filter(c=>c&&c!=="").join("\0");this.sourceDataForm.controls.path.setValue(a)}addFilter(t="-*"){let n=[this.sourceDataForm.controls.path.value,t].filter(i=>i&&i!=="").join("\0");this.sourceDataForm.controls.path.setValue(n)}patchPathAt(t,e){let i=this.sourceDataForm.controls.path.value.split("\0").filter(C=>!C.startsWith("-")&&!C.startsWith("+")).join("\0"),a=this.pathArray().map((C,_)=>_===e?`${t}`:`${C}`).join("\0"),c=[i,a].filter(C=>C&&C!=="").join("\0");this.sourceDataForm.controls.path.setValue(c)}removePathAt(t){let n=this.sourceDataForm.controls.path.value.split("\0").filter(c=>!c.startsWith("-")&&!c.startsWith("+")).join("\0"),i=this.pathArray().filter((c,C)=>C!==t).join("\0"),a=[n,i].filter(c=>c&&c!=="").join("\0");this.sourceDataForm.controls.path.setValue(a)}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 t=this.sourceDataForm.controls.path.value,e=this.newPathCtrl.value,n=t?.split("\0")||[];e&&!n.includes(e)&&n.push(e);let i=n.filter(a=>a&&a!=="").join("\0");this.sourceDataForm.controls.path.setValue(i),this.newPathCtrl.setValue("")}goBack(){this.#t.navigate(["destination"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=H({type:o,selectors:[["app-source-data"]],viewQuery:function(e,n){e&1&&ge(n.formRef,It,5),e&2&&Ee()},decls:56,vars:12,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Add a direct path`;let n;n=$localize`Hidden files`;let i;i=$localize`System files`;let a;a=$localize`Temporary files`;let c;c=$localize`Source Data`;let C;C=$localize`Folder path`;let _;_=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let d;d=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let I;I=$localize`Paths`;let U;U=$localize`Add a path directly from your machine.`;let B;B=$localize`Filters`;let V;V=$localize`Customize your filters.`;let x;x=$localize`Add filter`;let K;K=$localize`Exclude`;let W;W=$localize`Choose if there’s any files you want to exclude.`;let N;N=$localize` Files with the Hidden attribute ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let re;re=$localize` Files with the System attribute ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`;let _e;_e=$localize` Files with the Temporary attribute ${"\uFFFD#52\uFFFD\uFFFD/#52\uFFFD"}:TAG_INPUT:`;let ue;ue=$localize` Files larger than `;let P;return P=$localize`Edit path`,[["formRef",""],c,C,_,d,I,U,B,V,x,K,W,N,re,_e,ue,[3,"submit","formGroup"],[1,"left"],[1,"title-30"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",t,"formControlName","path"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],["description",""],[1,"paths"],[1,"path"],[1,"row-inputs"],["type","text","placeholder",e,3,"formControl"],["shButton","","type","button",1,"raised","primary",3,"click"],["type","button","shButton","","action","",3,"click"],["formGroupName","excludes",3,"disallowToggle"],[1,"raised","primary"],["type","checkbox","placeholder",n,"formControlName","hidden"],["type","checkbox","placeholder",i,"formControlName","system"],["type","checkbox","placeholder",a,"formControlName","temporary"],[1,"raised","primary",3,"click"],[1,"small"],["type","text","placeholder",P,3,"ngModelChange","ngModel","ngModelOptions"],["shButton","","type","button",1,"small",3,"click"],["type","text",3,"ngModel","ngModelOptions"],[3,"path","osType"],[3,"pathChange","remove","path","osType"],[3,"ngModelChange","ngModel","ngModelOptions"]]},template:function(e,n){if(e&1){let i=$();s(0,"form",16,0),h("submit",function(){return g(i),E(n.next())}),s(2,"div",17)(3,"h3",18),f(4,1),l(),s(5,"app-file-tree",19)(6,"label",20),f(7,2),l(),T(8,"input",21),l(),s(9,"div",22)(10,"button",23),h("click",function(){return g(i),E(n.goBack())}),S(11,3),T(12,"sh-icon"),m(),l(),s(13,"button",24),S(14,4),T(15,"sh-icon"),m(),l()()(),s(16,"div",25)(17,"app-toggle-card",26),b(18,27),f(19,5),v(),s(20,"p",28),f(21,6),l(),s(22,"div",29),Ue(23,Gt,3,1,"div",30,Ge),s(25,"div",31)(26,"sh-form-field"),T(27,"input",32),l(),s(28,"button",33),h("click",function(){return g(i),E(n.addNewPath())}),s(29,"sh-icon"),G(30,"plus"),l()()()()(),s(31,"app-toggle-card",26),b(32,27),f(33,7),v(),s(34,"p",28),f(35,8),l(),s(36,"button",34),h("click",function(){return g(i),E(n.addFilter())}),f(37,9),l(),A(38,xt,2,0),l(),s(39,"app-toggle-card",35),b(40,27),f(41,10),v(),s(42,"p",28),f(43,11),l(),s(44,"sh-toggle",36),S(45,12),T(46,"input",37),m(),l(),s(47,"sh-toggle",36),S(48,13),T(49,"input",38),m(),l(),s(50,"sh-toggle",36),S(51,14),T(52,"input",39),m(),l(),s(53,"sh-toggle",40),h("click",function(){return g(i),E(n.toggleFilesLargerThan())}),f(54,15),l(),A(55,bt,2,3,"div",31),l()()()}if(e&2){let i;F("formGroup",n.sourceDataForm),r(5),F("multiSelect",!0)("startingPath",n.getPath())("showFiles",!0),r(12),F("disallowToggle",!0),r(6),xe(n.nonFilterPaths()),r(4),F("formControl",n.newPathCtrl),r(4),F("disallowToggle",!0),r(7),D((i=n.pathSignal())!=null&&i.length?38:-1),r(),F("disallowToggle",!0),r(14),Se("active",n.filesLargerThan()),r(2),D(n.filesLargerThan()?55:-1)}},dependencies:[oe,fe,j,Fe,q,Ne,ie,ye,nt,Ae,Pe,it,Q,Y,ae,Me,Le,Et,St,gt],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-4)}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}sh-divider[_ngcontent-%COMP%]{margin:.75rem 0}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.25rem}.paths[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;overflow:auto}.path[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr min-content min-content;gap:.25rem}"],changeDetection:0})};var Ft="1W:1D,4W:1W,12M:1M",Z=class o{#e=y(z);#t=y(Re);#i=y(at);#n=y(ut);#r=y(ct);#a=y(we);generalForm=ht();sourceDataForm=Tt();scheduleFields=Xe();scheduleType=p("daily");settings=p([]);optionsFields={remoteVolumeSize:p("50MB"),backupRetention:p("all"),backupRetentionTime:p(""),backupRetentionVersions:p(0),backupRetentionCustom:p("")};targetUrlModel=p(null);backupMetadata=p(null);isDraft=p(!1);backupId=p(null);backupName=L(()=>this.generalFormSignal()?.name??"");isSubmitting=p(!1);finishedLoading=p(!1);backupDefaults=p(null);applicationOptions=p(null);isNew=L(()=>this.backupId()==="new");osType=L(()=>this.#t.systemInfo()?.OSType);selectedOptions=p([]);sourceDataFormSignal=le(this.sourceDataForm.valueChanges);generalFormSignal=le(this.generalForm.valueChanges);encryptionFieldSignal=le(this.generalForm.controls.encryption.valueChanges);advancedOptions=L(()=>this.#t.systemInfo()?.Options?.map(this.#u)??[]);#o=p("");#s=p(null);#l=null;testSignal=this.#o.asReadonly();testErrorMessage=this.#s.asReadonly();#p=te(()=>{let t=this.targetUrlModel(),e=this.#o(),n=this.#l;this.#l=t,!(e==="testing"||n===null||n===t)&&(this.#o.set(""),this.#s.set(null))});setTestState(t,e){this.#o.set(t),this.#s.set(e??null)}#u(t){return{name:t.Name,type:t.Type,shortDescription:t.ShortDescription??void 0,longDescription:t.LongDescription??void 0,options:t.ValidValues}}encryptionOptions=L(()=>{let t=this.#t.systemInfo()?.EncryptionModules??[];return[pe,...t]});nonSelectedOptions=L(()=>this.advancedOptions().sort((t,e)=>t?.name&&e?.name?t?.name.localeCompare(e?.name):0).filter(t=>this.selectedOptions()?.findIndex(e=>e.name===t.name)===-1));submit(t=!1){this.isSubmitting.set(!0);let e=this.#d(),n=this.backupId();this.isDraft()&&e.Backup&&(e.Backup.Metadata=this.backupMetadata()),n==="new"||!n||this.isDraft()?this.#n.postApiV1Backups({requestBody:e}).pipe($e(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}}):this.#n.putApiV1BackupById({id:n,requestBody:e}).pipe($e(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}})}exit(t){if(!t){this.#_(),this.#e.navigate(["/"]);return}this.#i.open(dt,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#_(),this.#e.navigate(["/"]))}})}mapSourceDataToForm(t){let e=t.Sources??"",n=t.Filters?.map(C=>`${C.Include?"":"-"}${C.Expression}`)??[],i=t.Settings?.find(C=>C.Name==="--exclude-files-attributes")?.Value?.toLowerCase()?.split(",")??[],a=t.Settings?.find(C=>C.Name==="--skip-files-larger-than")?.Value?.toUpperCase()??null,c={path:[...e,...n].join("\0"),excludes:{hidden:i.includes("hidden"),system:i.includes("system"),temporary:i.includes("temporary"),filesLargerThan:a===null?void 0:Oe(a)}};this.sourceDataForm.patchValue(c)}mapDestinationToForm(t){this.targetUrlModel.set(t.TargetURL??"")}mapGeneralToForm(t){let e=t.Name??"",n=t.Description??"",i=t.Settings?.find(d=>d.Name==="encryption-module"),a=t.Settings?.find(d=>d.Name==="passphrase")?.Value??"",c=i?.Value&&i.Value.length?i.Value:"",C=t.Settings?.find(d=>d.Name==="compression-module")?.Value??"",_={name:t.Name??"",description:t.Description??""};e&&e!==""&&(_.name=e),n&&n!==""&&(_.description=n),c&&c!==""&&(_.encryption=c),a&&a!==""&&(_.password=a,_.repeatPassword=a),C&&C!==""&&(_.compression=C),this.generalForm.patchValue(_)}mapScheduleToForm(t){if(!t){this.scheduleType.set("disabled"),this.scheduleFields.autoRun.set(!1);return}let e=this.#a.fromString(t.Repeat)??null,n=this.#c(t.Time);this.scheduleFields.autoRun.set(!0),n.date&&this.scheduleFields.nextTime.date.set(n.date),this.scheduleFields.nextTime.time.set(n.time),this.scheduleFields.runAgain.repeatUnit.set(e?.unit??"D"),this.scheduleFields.runAgain.repeatValue.set(e?.value??1),this.scheduleFields.runAgain.allowedDays.mon.set(t.AllowedDays?.includes("mon")??!1),this.scheduleFields.runAgain.allowedDays.tue.set(t.AllowedDays?.includes("tue")??!1),this.scheduleFields.runAgain.allowedDays.wed.set(t.AllowedDays?.includes("wed")??!1),this.scheduleFields.runAgain.allowedDays.thu.set(t.AllowedDays?.includes("thu")??!1),this.scheduleFields.runAgain.allowedDays.fri.set(t.AllowedDays?.includes("fri")??!1),this.scheduleFields.runAgain.allowedDays.sat.set(t.AllowedDays?.includes("sat")??!1),this.scheduleFields.runAgain.allowedDays.sun.set(t.AllowedDays?.includes("sun")??!1);let i=ce(this.scheduleFields),a=Ie.find(c=>JSON.stringify(c.data)===JSON.stringify(i));a?this.scheduleType.set(a.value):this.scheduleType.set("custom")}mapOptionsToForms(t,e=!1){let n=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","passphrase","keep-time","keep-versions","retention-policy"],i=(t.Settings??[]).map(_=>_);if(e){let _=this.#r.serverSettings()??{};Object.keys(_).filter(d=>d.startsWith("--")).forEach(d=>{i.find(U=>U.Name===d)||i.push({Name:d,Value:_[d],Filter:null})})}let a=i.filter(_=>!n.includes(_.Name)),c=i.filter(_=>n.includes(_.Name));this.settings.set(a??[]),a?.forEach(_=>{if(_.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(_.Value??"")});var C="all";c?.forEach(_=>{if(_.Name==="dblock-size"&&this.optionsFields.remoteVolumeSize.set(_.Value??"50MB"),_.Name==="keep-time"&&(_.Value??"")!=="")return C="time",this.optionsFields.backupRetentionTime.set(_.Value??"");if(_.Name==="keep-versions"&&(_.Value??"")!=="")return C="versions",this.optionsFields.backupRetentionVersions.set(_.Value?parseInt(_.Value):null);if(_.Name==="retention-policy"&&(_.Value??"")!=="")if(_.Value===Ft)C="smart";else return C="custom",this.optionsFields.backupRetentionCustom.set(_.Value??"")}),this.optionsFields.backupRetention.set(C)}storeMetadata(t,e){this.backupMetadata.set(e?t.Metadata??null:null)}getScheduleFormValue(){let t=ce(this.scheduleFields);return mt(t)}#d(){let t=this.generalForm.value,e=this.getScheduleFormValue(),n=this.sourceDataForm.value,i=this.targetUrlModel(),a=n.path?.split("\0")??[],c=this.mapFormsToSettings(),C=Object.entries(n.excludes??{}).filter(([d,I])=>I&&d!=="filesLargerThan").map(([d])=>d),_=n.excludes?.filesLargerThan;return C.length&&c.push({Name:"--exclude-files-attributes",Value:C.join(",")}),_&&_.size!==null&&_.unit!==null&&c.push({Name:"--skip-files-larger-than",Value:`${_.size}${_.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:i??null,Sources:a.filter(d=>!(d.startsWith("-")||d.startsWith("+"))),Settings:c,Filters:a.filter(d=>d.startsWith("-")||d.startsWith("+")).map((d,I)=>({Order:I,Include:d.startsWith("+"),Expression:d.slice(1)}))},Schedule:e}}mapFormsToSettings(t=[]){let e=this.generalForm.value,n=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","encryption-module","passphrase","keep-time","keep-versions","retention-policy","dblock-size","compression-module"],i=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&e.encryption!==pe.Key&&(i=[{Name:"encryption-module",Value:e.encryption??null},{Name:"passphrase",Value:e.password??null}]);let a=[{Name:"compression-module",Value:e.compression}];e.compression===""&&(a=[]);let c=[{Name:"dblock-size",Value:this.optionsFields.remoteVolumeSize()}];switch(this.optionsFields.backupRetention()){case"time":c.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":c.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":c.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":c.push({Name:"retention-policy",Value:Ft});break}let C=[...t,...n],_=this.settings().filter(d=>!C.includes(d.Name)).map(d=>{let I=d.Value;return typeof d.Value=="number"&&(I=d.Value.toString()),typeof d.Value=="boolean"&&(I=d.Value?"True":"False"),{Name:d.Name?.startsWith("--")?d.Name:`--${d.Name}`,Value:I}});return[...i,...a,...c,..._]}#c(t){if(!t||t?.indexOf("T")===-1)return{time:t??"13:00"};let e=new Date(t);return{time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`,date:e.toISOString().split("T")[0]}}setTargetUrl(t,e=!1){e&&(this.#l=null),this.targetUrlModel.set(t)}#_(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleFields=Xe(),this.optionsFields.remoteVolumeSize.set("50MB"),this.optionsFields.backupRetention.set("all"),this.settings.set([]),this.targetUrlModel.set(null)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=Ce({token:o,factory:o.\u0275fac,providedIn:"root"})};var vt=["formRef"];function kt(o,t){o&1&&(s(0,"sh-alert",17),S(1,5),T(2,"sh-icon",26),m(),l())}function Bt(o,t){if(o&1&&G(0),o&2){let e=t.$implicit;Ze(" ",e.DisplayName," ")}}function Vt(o,t){if(o&1&&T(0,"sh-progress-bar",40),o&2){let e=u(3);Se("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),F("value",e.calculatePasswordStrength()*(100/5))}}function Kt(o,t){o&1&&(s(0,"span",35),f(1,10),l())}function Wt(o,t){o&1&&(S(0,8,1),T(1,"sh-icon"),m())}function Jt(o,t){o&1&&(S(0,8,2),T(1,"sh-icon"),m())}function Xt(o,t){o&1&&(S(0,11,1),T(1,"sh-icon",42),m())}function Ht(o,t){o&1&&(S(0,11,2),T(1,"sh-icon"),m())}function zt(o,t){if(o&1){let e=$();s(0,"button",41),h("click",function(){g(e);let i=u(3);return E(i.copyPassword())}),S(1,11),A(2,Xt,2,0)(3,Ht,2,0),m(),l()}if(o&2){let e=u(3);r(2),D(e.copiedPassword()?2:3)}}function jt(o,t){o&1&&(s(0,"sh-alert",39),f(1,12),l())}function qt(o,t){if(o&1){let e=$();s(0,"div",30)(1,"sh-form-field")(2,"label",31),S(3,7),T(4,"sup"),m(),l(),T(5,"input",32),l(),A(6,Vt,1,9,"sh-progress-bar",33),s(7,"sh-form-field"),T(8,"input",34),A(9,Kt,2,0,"span",35),l(),s(10,"div",36)(11,"button",37),h("click",function(){g(e);let i=u(2);return E(i.showPassword.set(!i.showPassword()))}),S(12,8),A(13,Wt,2,0)(14,Jt,2,0),m(),l(),s(15,"button",37),h("click",function(){g(e);let i=u(2);return E(i.generatePassword())}),S(16,9),T(17,"sh-icon"),m(),l(),A(18,zt,4,1,"button",38),l(),A(19,jt,2,0,"sh-alert",39),l()}if(o&2){let e=u(2);r(5),F("type",e.showPassword()?"text":"password"),r(),D(e.generalForm.value.password?6:-1),r(2),F("type",e.showPassword()?"text":"password"),r(),D(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),r(4),D(e.showPassword()?13:14),r(5),D(e.showCopyPassword()?18:-1),r(),D(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function Yt(o,t){if(o&1&&(s(0,"sh-select",27)(1,"label",28),f(2,6),l(),T(3,"input",29),qe(4,Bt,1,1,"ng-template"),l(),A(5,qt,20,7,"div",30)),o&2){let e=u();F("options",e.encryptionOptions())("isClearable",!1),r(5),D(e.encryptionFieldSignal()!==e.noneOptionKey?5:-1)}}function Qt(o,t){if(o&1&&(s(0,"button",24),S(1,13),T(2,"sh-icon"),m(),l()),o&2){let e=u();F("disabled",e.nameAndDescriptionValid()===!1)}}function Zt(o,t){if(o&1&&(s(0,"button",25),S(1,14),T(2,"sh-icon"),m(),l()),o&2){let e=u();F("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var ee=new De,ht=(o={name:"",description:"",encryption:"",password:"",repeatPassword:"",compression:""})=>ee.group({name:ee.control(o.name,[he.required]),description:ee.control(o.description),encryption:ee.control(o.encryption,[Ct()]),password:ee.control(o.password,[Ve(t=>t?.value.encryption!=="",[he.required])]),repeatPassword:ee.control(o.repeatPassword,[Ve(t=>t?.value.encryption!=="",[he.required])]),compression:ee.control(o.compression)}),pe={Key:"-",DisplayName:"None"},je=class o{#e=y(z);#t=y(ne);#i=y(pt);#n=y(Z);#r=y(Re);formRef=Te.required("formRef");generalForm=this.#n.generalForm;generalFormSignal=this.#n.generalFormSignal;encryptionFieldSignal=this.#n.encryptionFieldSignal;encryptionOptions=this.#n.encryptionOptions;isNew=this.#n.isNew;showPassword=p(!1);copiedPassword=p(!1);showCopyPassword=p(!1);noneOptionKey=pe.Key;encryptionEffect=te(()=>{this.encryptionFieldSignal()===pe.Key&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=L(()=>{let t=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=L(()=>{let e=this.generalFormSignal()?.password??"";return this.#i.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#n.exit(!0)}async copyPassword(){let t=this.generalForm.controls.password.value;await this.#a(t??""),this.copiedPassword.set(!0)}async#a(t){try{await navigator.clipboard.writeText(t)}catch{try{let n=document.createElement("textarea");n.value=t,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}catch(n){console.error("Failed to copy text: ",n)}}}generatePassword(){this.copiedPassword.set(!1);let t=this.#i.generate(16);this.generalForm.controls.password.setValue(t),this.generalForm.controls.repeatPassword.setValue(t),this.showCopyPassword.set(!0)}next(){this.#n.isNew()||this.#n.submit(!0),this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=H({type:o,selectors:[["app-general"]],viewQuery:function(e,n){e&1&&ge(n.formRef,vt,5),e&2&&Ee()},decls:21,vars:4,consts:()=>{let t;t=$localize`Your backup name`;let e;e=$localize`Your backup description`;let n;n=$localize`Remember to copy the password`;let i;i=$localize`General backup settings`;let a;a=$localize` Backup name ${"\uFFFD#8\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#8\uFFFD"}:CLOSE_SUPERSCRIPT:`;let c;c=$localize`Backup description`;let C;C=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Exit `;let _;_=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Encrypted backup `;let d;d=$localize`Encryption`;let I;I=$localize`Encryption`;let U;U=$localize`Password`;let B;B=$localize`Repeat password`;let V;V=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let x;x=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,x=be(x);let K;K=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let W;W=$localize`Passwords do not match`;let N;N=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,N=be(N);let re;re=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let _e;_e=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let ue;return ue=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],i,a,c,C,_,I,V,x,K,W,N,re,_e,ue,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],[1,"primary"],["for","backupName"],["type","text","tabindex","1","placeholder",t,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","shButton","",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],["shButton","","type","submit","shTooltip",n,1,"raised","primary",3,"disabled"],["icon",""],["value","Key","label","DisplayName",3,"options","isClearable"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",d,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",U,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",B,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["shButton","","type","button",1,"small","copy",3,"click"],[1,"sh-success"]]},template:function(e,n){if(e&1){let i=$();s(0,"form",15,0),h("submit",function(){return g(i),E(n.next())}),s(2,"h3",16),f(3,1),l(),A(4,kt,3,0,"sh-alert",17),s(5,"sh-form-field")(6,"label",18),S(7,2),T(8,"sup"),m(),l(),T(9,"input",19),l(),s(10,"sh-form-field")(11,"label",20),f(12,3),l(),T(13,"textarea",21),l(),A(14,Yt,6,3),s(15,"div",22)(16,"button",23),h("click",function(){return g(i),E(n.exit())}),S(17,4),T(18,"sh-icon"),m(),l(),A(19,Qt,3,1,"button",24)(20,Zt,3,1,"button",25),l()()}if(e&2){let i;F("formGroup",n.generalForm),r(4),D(!n.isNew()&&((i=n.generalFormSignal())==null?null:i.encryption)!==""?4:-1),r(10),D(n.isNew()?14:-1),r(5),D(n.encryptionFieldSignal()===n.noneOptionKey||!n.isNew()?19:20)}},dependencies:[ye,fe,j,q,Ne,Ae,Pe,Q,se,ae,Y,lt,ot,_t],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--error-8)}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.copy[_ngcontent-%COMP%] sh-icon.sh-success[_ngcontent-%COMP%]{color:var(--success-8)}"],changeDetection:0})};export{ht as a,pe as b,je as c,Ie as d,mt as e,Xe as f,Ke as g,Tt as h,He as i,Z as j};
|