@duplicati/ngclient 0.0.138 → 0.0.140

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.
@@ -1 +1 @@
1
- import{d as a,e as b}from"./chunk-HRSZZWTB.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-B26UYXA3.js";import"./chunk-LDIZ5E5Z.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-NSIELNIY.js";import"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";export{a as SCHEDULE_FIELD_DEFAULTS,b as default};
1
+ import{d as a,e as b}from"./chunk-ZAFFTZSE.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-B26UYXA3.js";import"./chunk-LDIZ5E5Z.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-NSIELNIY.js";import"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";export{a as SCHEDULE_FIELD_DEFAULTS,b as default};
@@ -1 +1 @@
1
- import{a}from"./chunk-VPTK3JCV.js";import"./chunk-32366MQR.js";import"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";export{a as default};
1
+ import{a}from"./chunk-Q6W2U6VI.js";import"./chunk-32366MQR.js";import"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";export{a as default};
@@ -1 +1 @@
1
- import{f as a,g as b}from"./chunk-HRSZZWTB.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-B26UYXA3.js";import"./chunk-LDIZ5E5Z.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-NSIELNIY.js";import"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";export{a as createSourceDataForm,b as default};
1
+ import{f as a,g as b}from"./chunk-ZAFFTZSE.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-B26UYXA3.js";import"./chunk-LDIZ5E5Z.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-NSIELNIY.js";import"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";export{a as createSourceDataForm,b as default};
@@ -1 +1 @@
1
- import{a,b,c}from"./chunk-HRSZZWTB.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-B26UYXA3.js";import"./chunk-LDIZ5E5Z.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-NSIELNIY.js";import"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";export{b as NONE_OPTION,a as createGeneralForm,c as default};
1
+ import{a,b,c}from"./chunk-ZAFFTZSE.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-B26UYXA3.js";import"./chunk-LDIZ5E5Z.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-NSIELNIY.js";import"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";export{b as NONE_OPTION,a as createGeneralForm,c as default};
@@ -0,0 +1 @@
1
+ import{d as k,r as L}from"./chunk-NSIELNIY.js";import{h as U}from"./chunk-DNJOKPEL.js";import{H as C,Hc as A,U as E,Z as R,na as z,r as S}from"./chunk-BTMXQPBB.js";import{a,b as D}from"./chunk-EUDKD2JW.js";var h=class{constructor(t){this.loader=t}_data=z(void 0);_isLoading=!1;_loaded=!1;load(){return!this._loaded&&!this._isLoading&&(this._isLoading=!0,this.loader().pipe(C(()=>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=R(U);#o=new h(()=>this.getS3Config("Providers"));#n=new h(()=>this.getS3Config("Regions"));#r=new h(()=>this.getS3Config("RegionHosts"));#i=new h(()=>this.getS3Config("StorageClasses"));#a=A(()=>{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())});#s=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.#a}getS3Providers(){return this.#o.load()}getS3Regions(){return this.#n.load()}getS3RegionHosts(){return this.#r.load()}getS3StorageClasses(){return this.#i.load()}getStorjSatellites(){return this.#s.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=E({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.`},w={description:$localize`Unknown destination type`,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 a({destinationType:e,custom:{path:n.split("?")[0]}},s(e,t))}}},V=[{key:"file",displayName:$localize`File system`,description:$localize`Store backups on your local file system.`,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:"/"+n;return a({destinationType:e,custom:{path:u.split("?")[0]}},s(e,t))}}},{key:"ssh",displayName:$localize`SSH`,description:$localize`Store backups with SSH.`,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??"",[k.required,k.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:l}=m(t);return a({destinationType:e,custom:{server:r,port:n,path:l}},s(e,t))}}},{key:"s3",displayName:$localize`S3 Compatible`,description:$localize`Store backups in any S3 compatible bucket.`,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:()=>z([{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{server:r,path:n}=m(t);return a({destinationType:e,custom:{path:n,bucket:r}},s(e,t))}}},{key:"gcs",displayName:$localize`Google Cloud Storage`,description:$localize`Store backups in Google Cloud Storage.`,oauthField:"authid",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}],advancedFields:[{name:"gcs-location",type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getGcsLocations()},{name:"gcs-storage-class",type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getGcsStorageClasses()}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return a({destinationType:e,custom:{path:n,bucket:r}},s(e,t))}}},{key:"googledrive",displayName:$localize`Google Drive`,description:$localize`Store backups in Google Drive.`,oauthField:"authid",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)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"pcloud",displayName:$localize`pCloud`,description:$localize`Store backups in pCloud.`,oauthField:"authid",customFields:{server:{type:"Enumeration",name:"server",loadOptions:()=>z([{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 a({destinationType:e,custom:{server:r,path:n}},s(e,t))}}},{key:"azure",displayName:$localize`Azure Blob Storage`,description:$localize`Store backups in Azure Blob Storage.`,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)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"onedrivev2",displayName:$localize`OneDrive`,description:$localize`Store backups in OneDrive.`,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)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"od4b",displayName:$localize`OneDrive Business`,description:$localize`Store backups in OneDrive Business.`,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:l}=m(t);return a({destinationType:e,custom:{server:r,port:n,path:l}},s(e,t))}}},{key:"mssp",displayName:$localize`Microsoft SharePoint`,description:$localize`Store backups in Microsoft SharePoint.`,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:l}=m(t);return a({destinationType:e,custom:{server:r,port:n,path:l}},s(e,t))}}},{key:"sharepoint",displayName:$localize`Microsoft SharePoint v2`,description:$localize`Store backups in Microsoft SharePoint.`,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:"site-id",isMandatory:!0},{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"dropbox",displayName:$localize`Dropbox`,description:$localize`Store backups in Dropbox.`,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)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"box",displayName:$localize`Box.com`,description:$localize`Store backups in Box.com.`,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)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"jottacloud",displayName:$localize`Jottacloud`,description:$localize`Store backups in Jottacloud.`,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)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"b2",displayName:$localize`B2 Cloud Storage`,description:$localize`Store backups in B2 Cloud Storage.`,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`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{server:r,path:n}=m(t);return a({destinationType:e,custom:{path:n,bucket:r}},s(e,t))}}},{key:"e2",displayName:$localize`IDrive e2`,description:$localize`Store backups in IDrive e2.`,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{server:r,path:n}=m(t);return a({destinationType:e,custom:{bucket:r,path:n}},s(e,t))}}},{key:"mega",displayName:$localize`Mega.nz`,description:$localize`Store backups in Mega.nz.`,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)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"msgroup",displayName:$localize`Microsoft Office 365 Group`,description:$localize`Store backups in Microsoft Office 365 Group.`,oauthField:"authid",customFields:{groupEmail:{type:"Email",name:"groupEmail",shortDescription:$localize`Group email`,longDescription:$localize`Group email`,formElement:e=>i.control(e??"",[k.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)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"cloudfiles",displayName:$localize`Rackspace CloudFiles`,description:$localize`Store backups in Rackspace CloudFiles.`,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:l}=m(t);return a({destinationType:e,custom:{server:r,port:n,path:l}},s(e,t))}}},{key:"rclone",displayName:$localize`Rclone`,description:$localize`Store backups in Rclone.`,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 v(e.destinationType??"rclone",t,null,o,[...Object.entries(e.advanced),...r])},from:(e,t,o)=>{let{advanced:r,dynamic:n}=s(e,t),{server:l,path:u}=m(t);return a({destinationType:e,dynamic:a({"rclone-remote-repository":l,"rclone-remote-path":u},n)},r)}}},{key:"openstack",displayName:$localize`OpenStack Object Storage`,description:$localize`Store backups in OpenStack Object Storage.`,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{server:r,path:n}=m(t);return a({destinationType:e,custom:{path:n,bucket:r}},s(e,t))}}},{key:"webdav",displayName:$localize`WebDAV`,description:$localize`Store backups in WebDAV.`,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:l}=m(t);return a({destinationType:e,custom:{server:r,port:n,path:l}},s(e,t))}}},{key:"aftp",displayName:$localize`Alternative FTP`,description:$localize`Store backups in FTP.`,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:l}=m(t);return a({destinationType:e,custom:{server:r,port:n,path:l}},s(e,t))}}},{key:"ftp",displayName:$localize`FTP`,description:$localize`Store backups in FTP.`,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:l}=m(t);return a({destinationType:e,custom:{server:r,port:n,path:l}},s(e,t))}}},{key:"sia",displayName:$localize`Sia Decentrilized Cloud`,description:$localize`Store backups in Sia Decentrilized Cloud.`,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 v(e.destinationType??"sia",t,null,o,r)},from:(e,t,o)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"cos",displayName:$localize`Tencent COS`,description:$localize`Store backups in Tencent COS.`,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(a({},e),{advanced:D(a({},e.advanced),{"cos-bucket":t})});return c(r,null,null,o)},from:(e,t,o)=>{let r=s(e,t),n=r.advanced["cos-bucket"];return delete r.advanced["cos-bucket"],a({destinationType:e,custom:{path:d(t),bucket:n}},r)}}},{key:"tahoe",displayName:$localize`Tahoe LAFS`,description:$localize`Store backups in Tahoe LAFS.`,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:l}=m(t);return a({destinationType:e,custom:{server:r,port:n,path:l}},s(e,t))}}},{key:"smb",displayName:$localize`Windows Share (SMB)`,description:$localize`Store backups on SMB storage.`,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,M(t,r))},from:(e,t,o)=>{let{server:r,path:n}=m(t),l=n.split("/")[0],u=n.split("/").slice(1).join("/");return a({destinationType:e,custom:{server:r,share:l,path:u}},s(e,t))}}},{key:"filen",displayName:$localize`Filen.io`,description:$localize`Store backups in Filen.io.`,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)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"filejump",displayName:$localize`Filejump`,description:$localize`Store backups in Filejump.`,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 console.log(t),c(e,null,null,t)},from:(e,t,o)=>(console.log(t),a({destinationType:e,custom:{path:d(t)}},s(e,t)))}},{key:"storj",customKey:"storjAccessGrant",displayName:$localize`Storj Access Grant`,description:$localize`Store backups in Storj Access Grant.`,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${b([...Object.entries(e.advanced),...Object.entries(e.dynamic),...Object.entries(t)])}`},from:(e,t,o)=>{let r=s(e,t);return delete r.advanced["storj-auth-method"],a({destinationType:e},r)}}},{key:"storj",customKey:"storjApiKey",displayName:$localize`Storj API Key`,description:$localize`Store backups in Storj API Key.`,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${b([...Object.entries(e.advanced),...Object.entries(e.dynamic),...Object.entries(t)])}`},from:(e,t,o)=>{let r=s(e,t);return delete r.advanced["storj-auth-method"],a({destinationType:e},r)}}},{key:"aliyunoss",displayName:$localize`Aliyun OSS`,description:$localize`Store backups in Aliyun OSS`,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(a({},e),{advanced:D(a({},e.advanced),{"oss-bucket-name":t})});return c(r,null,null,o)},from:(e,t,o)=>{let r=s(e,t),n=r.advanced["oss-bucket-name"];return delete r.advanced["oss-bucket-name"],a({destinationType:e,custom:{path:d(t),bucket:n}},r)}}}],le={".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"};function c(e,t,o,r){return v(e.destinationType??"file",t,o,r,[...Object.entries(e.advanced),...Object.entries(e.dynamic)])}function v(e,t,o,r,n){let l=b(n),u=encodeURIComponent(B(t)),y=u==""?"":u+j(o),f=r??"",$=f.slice(1).startsWith(":\\")&&e=="file"?"file:///":`${e}://`,O=M(y,N(f));return`${$}${O}${l}`}function I(e){return e==null||e===""?"":e.startsWith("/")?e.substring(1):e}function M(...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 N(e){return e.split("/").map(encodeURIComponent).join("/")}function d(e){if(e==null||e==="")return"";if(typeof e=="string")try{e=new URL(e)}catch{return""}return decodeURIComponent(e.hostname??"")+decodeURIComponent(e.pathname=="/"?"":e.pathname??"")}function B(e){return e==null||e===""?"":e.endsWith("/")?e.substring(0,e.length-1):e}function j(e){return e==null||e===""?"":":"+e.toString()}function P(e){return V.find(o=>o.key===e||o.customKey===e)??V.find(o=>`${o.key}s`===e)??null??a({key:e,displayName:e},w)}function m(e){return{server:decodeURIComponent(e.hostname),port:e.port,path:I(decodeURIComponent(e.pathname))}}function s(e,t){let o={},r={},n=P(e);return t.searchParams.forEach((l,u)=>{n?.dynamicFields?.some(f=>f===u||f?.name===u)?r[u]=decodeURIComponent(l):o[u]=decodeURIComponent(l)}),{advanced:o,dynamic:r}}function b(e,t=!1){let o=e.map(([n,l])=>`${n}=${l?encodeURIComponent(l.toString()):""}`).join("&");return o?(t?"":"?")+o:""}function me(e){let t=e.destinationType??"";return P(t)?.mapper.to(e)??""}function de(e){let t=URL.canParse(e),o=e.split("://")[0],r=e.split("://")[1],n=o==="file"?"http://dummy":"http://"+r;if(!r)return null;if(r.startsWith("%")&&o==="file")return P(o).mapper.from(o,new URL("http://localhost"),e);let l=P(o),u="";`${l.key}s`===o&&(u+=n.indexOf("?")===-1?"?":"&",u+="use-ssl=true",e=l.key+e.substring(o.length));try{let y=new URL(n+u);if(y.host==="undefined")return null;let f=r.split("?")[0].split("/")[0],G=!isNaN(Number(y.host.replaceAll(".",""))),$=f.split("."),O=$.length===4&&$.every(F=>F.length&&F.length<=3&&!isNaN(Number(F))&&parseInt(F)<=255);return G&&!O?null:l.mapper.from(l.key,y,e)}catch(y){return console.error("Error while parsing target path",y),null}}export{P as a,me as b,de as c,le as d};
@@ -1 +1 @@
1
- import{a as v}from"./chunk-XIOHRQ3X.js";import{h as T}from"./chunk-HRSZZWTB.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-B26UYXA3.js";import{b as m}from"./chunk-LDIZ5E5Z.js";import"./chunk-WZRDKVOR.js";import{a as L}from"./chunk-ULLALJQ2.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import"./chunk-NSIELNIY.js";import"./chunk-7QJG4IIT.js";import"./chunk-3ZVSHKLD.js";import{b as E,c as B,e as b,f as M}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{p as $,q as N,v as I}from"./chunk-Y5IRBMLB.js";import{h as K}from"./chunk-DNJOKPEL.js";import"./chunk-UZK7ABRM.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-B6OIHB5W.js";import{Ab as r,F as C,Ic as O,Kb as d,Lb as c,Qa as n,Rb as R,Z as l,ab as D,ec as A,gc as P,rc as h,sb as k,tb as g,uc as _,xb as u,yb as p,zb as s}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";var G=(a,e)=>[a,e,"general"],y=(a,e)=>[a,e,"destination"],U=(a,e)=>[a,e,"source-data"],w=(a,e)=>[a,e,"schedule"],X=(a,e)=>[a,e,"options"];function x(a,e){if(a&1&&(p(0,"p"),A(1),s()),a&2){let t=R();n(),P("Editing: ",t.backupName())}}function z(a,e){a&1&&r(0,"spk-progress-bar",6)}function j(a,e){a&1&&(p(0,"section"),r(1,"router-outlet"),s())}var f=class a{#t=l(E);#e=l(T);#a=l(L);#i=l(K);isDraft=this.#e.isDraft;isNew=this.#e.isNew;backupId=this.#e.backupId;backupName=this.#e.backupName;finishedLoading=this.#e.finishedLoading;#o=m(this.#t.params);#n=m(this.#t.url);paramsChanged=O(()=>{let e=this.#o()?.id,t=!!this.#n()?.find(i=>i.path==="backup-draft");this.#e.backupId.set(e),e!=="new"?this.getBackup(e,t):this.getDefaults()});getDefaults(){this.#i.getApiV1Backupdefaults().pipe(C(1)).subscribe({next:e=>{let t=e.Backup;t.Settings=[...t.Settings],this.#e.mapGeneralToForm(t),this.#e.mapDestinationToForm(t),this.#e.mapSourceDataToForm(t),this.#e.mapScheduleToForm(e.Schedule),this.#e.mapOptionsToForms(t),this.#e.applicationOptions.set(e.ApplicationOptions),this.#e.backupDefaults.set(e),this.#e.finishedLoading.set(!0)}})}getBackup(e,t=!1){let i=o=>{this.#e.mapScheduleToForm(o.Schedule??null),o.Backup&&(this.#e.mapGeneralToForm(o.Backup),this.#e.mapDestinationToForm(o.Backup),this.#e.mapSourceDataToForm(o.Backup),this.#e.mapOptionsToForms(o.Backup),this.#e.storeMetadata(o.Backup,t)),this.#e.finishedLoading.set(!0)};if(t){this.isDraft.set(t);let o=this.#a.draftBackups().find(F=>F.id===e);if(!o){alert("Backup not found");return}i(o.data)}else this.#i.getApiV1BackupById({id:e}).subscribe({next:i})}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=D({type:a,selectors:[["app-backup"]],features:[h([T])],decls:21,vars:22,consts:()=>{let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SPK_RADIO: General `;let t;t=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_RADIO: Destination `;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_RADIO: Source Data `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_RADIO: Schedule `;let F;return F=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SPK_RADIO: Options `,[e,t,i,o,F,["step","","routerLinkActive","active",3,"routerLink"],[1,"indeterminate","primary"]]},template:function(t,i){t&1&&(r(0,"app-status-bar"),p(1,"header"),k(2,x,2,1,"p"),p(3,"spk-stepper")(4,"div",5),d(5,0),r(6,"spk-radio"),c(),s(),p(7,"div",5),d(8,1),r(9,"spk-radio"),c(),s(),p(10,"div",5),d(11,2),r(12,"spk-radio"),c(),s(),p(13,"div",5),d(14,3),r(15,"spk-radio"),c(),s(),p(16,"div",5),d(17,4),r(18,"spk-radio"),c(),s()()(),k(19,z,1,0,"spk-progress-bar",6)(20,j,2,0,"section")),t&2&&(n(2),g(i.isNew()?-1:2),n(2),u("routerLink",_(7,G,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),u("routerLink",_(10,y,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),u("routerLink",_(13,U,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),u("routerLink",_(16,w,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),u("routerLink",_(19,X,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),g(i.finishedLoading()?20:19))},dependencies:[B,b,M,v,N,I,$],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}header[_ngcontent-%COMP%]{padding:1rem 1.5rem;border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:.5rem}header[_ngcontent-%COMP%] spk-stepper[_ngcontent-%COMP%]{width:100%}section[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;flex:1 0;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:auto}"],changeDetection:0})};export{f as default};
1
+ import{a as v}from"./chunk-XIOHRQ3X.js";import{h as T}from"./chunk-ZAFFTZSE.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-B26UYXA3.js";import{b as m}from"./chunk-LDIZ5E5Z.js";import"./chunk-WZRDKVOR.js";import{a as L}from"./chunk-ULLALJQ2.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import"./chunk-NSIELNIY.js";import"./chunk-7QJG4IIT.js";import"./chunk-3ZVSHKLD.js";import{b as E,c as B,e as b,f as M}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{p as $,q as N,v as I}from"./chunk-Y5IRBMLB.js";import{h as K}from"./chunk-DNJOKPEL.js";import"./chunk-UZK7ABRM.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-B6OIHB5W.js";import{Ab as r,F as C,Ic as O,Kb as d,Lb as c,Qa as n,Rb as R,Z as l,ab as D,ec as A,gc as P,rc as h,sb as k,tb as g,uc as _,xb as u,yb as p,zb as s}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";var G=(a,e)=>[a,e,"general"],y=(a,e)=>[a,e,"destination"],U=(a,e)=>[a,e,"source-data"],w=(a,e)=>[a,e,"schedule"],X=(a,e)=>[a,e,"options"];function x(a,e){if(a&1&&(p(0,"p"),A(1),s()),a&2){let t=R();n(),P("Editing: ",t.backupName())}}function z(a,e){a&1&&r(0,"spk-progress-bar",6)}function j(a,e){a&1&&(p(0,"section"),r(1,"router-outlet"),s())}var f=class a{#t=l(E);#e=l(T);#a=l(L);#i=l(K);isDraft=this.#e.isDraft;isNew=this.#e.isNew;backupId=this.#e.backupId;backupName=this.#e.backupName;finishedLoading=this.#e.finishedLoading;#o=m(this.#t.params);#n=m(this.#t.url);paramsChanged=O(()=>{let e=this.#o()?.id,t=!!this.#n()?.find(i=>i.path==="backup-draft");this.#e.backupId.set(e),e!=="new"?this.getBackup(e,t):this.getDefaults()});getDefaults(){this.#i.getApiV1Backupdefaults().pipe(C(1)).subscribe({next:e=>{let t=e.Backup;t.Settings=[...t.Settings],this.#e.mapGeneralToForm(t),this.#e.mapDestinationToForm(t),this.#e.mapSourceDataToForm(t),this.#e.mapScheduleToForm(e.Schedule),this.#e.mapOptionsToForms(t),this.#e.applicationOptions.set(e.ApplicationOptions),this.#e.backupDefaults.set(e),this.#e.finishedLoading.set(!0)}})}getBackup(e,t=!1){let i=o=>{this.#e.mapScheduleToForm(o.Schedule??null),o.Backup&&(this.#e.mapGeneralToForm(o.Backup),this.#e.mapDestinationToForm(o.Backup),this.#e.mapSourceDataToForm(o.Backup),this.#e.mapOptionsToForms(o.Backup),this.#e.storeMetadata(o.Backup,t)),this.#e.finishedLoading.set(!0)};if(t){this.isDraft.set(t);let o=this.#a.draftBackups().find(F=>F.id===e);if(!o){alert("Backup not found");return}i(o.data)}else this.#i.getApiV1BackupById({id:e}).subscribe({next:i})}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=D({type:a,selectors:[["app-backup"]],features:[h([T])],decls:21,vars:22,consts:()=>{let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SPK_RADIO: General `;let t;t=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_RADIO: Destination `;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_RADIO: Source Data `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_RADIO: Schedule `;let F;return F=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SPK_RADIO: Options `,[e,t,i,o,F,["step","","routerLinkActive","active",3,"routerLink"],[1,"indeterminate","primary"]]},template:function(t,i){t&1&&(r(0,"app-status-bar"),p(1,"header"),k(2,x,2,1,"p"),p(3,"spk-stepper")(4,"div",5),d(5,0),r(6,"spk-radio"),c(),s(),p(7,"div",5),d(8,1),r(9,"spk-radio"),c(),s(),p(10,"div",5),d(11,2),r(12,"spk-radio"),c(),s(),p(13,"div",5),d(14,3),r(15,"spk-radio"),c(),s(),p(16,"div",5),d(17,4),r(18,"spk-radio"),c(),s()()(),k(19,z,1,0,"spk-progress-bar",6)(20,j,2,0,"section")),t&2&&(n(2),g(i.isNew()?-1:2),n(2),u("routerLink",_(7,G,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),u("routerLink",_(10,y,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),u("routerLink",_(13,U,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),u("routerLink",_(16,w,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),u("routerLink",_(19,X,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),g(i.finishedLoading()?20:19))},dependencies:[B,b,M,v,N,I,$],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}header[_ngcontent-%COMP%]{padding:1rem 1.5rem;border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:.5rem}header[_ngcontent-%COMP%] spk-stepper[_ngcontent-%COMP%]{width:100%}section[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;flex:1 0;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:auto}"],changeDetection:0})};export{f as default};
@@ -0,0 +1,8 @@
1
+ import{a as it}from"./chunk-X7SFNRJF.js";import{a as tt,b as nt}from"./chunk-2G6TVFPZ.js";import{a as X,b as Ze,c as Je}from"./chunk-AH5TLYN4.js";import{h as et}from"./chunk-ZAFFTZSE.js";import{a as Ye}from"./chunk-WZNH4JPF.js";import{a as G}from"./chunk-2BX65XJQ.js";import{a as z}from"./chunk-6JQM2X3B.js";import{a as qe,c as ue,e as Ce,i as fe,k as We,s as ge,t as Qe}from"./chunk-NSIELNIY.js";import{A as Ue,C as He,a as pe,e as Ge,g as me,l as Re,o as Be,p as Ke,t as ze,z as Xe}from"./chunk-Y5IRBMLB.js";import{h as je}from"./chunk-DNJOKPEL.js";import{ea as be}from"./chunk-CWLTHXVS.js";import{$b as B,Ab as K,Ac as J,Bb as re,Cb as W,Db as le,Eb as N,Hc as P,Ic as Y,Kb as Q,Lb as Z,Mb as De,Nc as ee,Qa as l,Qb as E,Qc as $e,Rb as s,Sb as we,Tb as Ae,U as oe,Vb as Fe,Wb as Oe,Xb as ke,Z as k,ab as ae,bc as se,da as T,ea as S,ec as p,f as ie,fb as b,gc as F,ha as ye,hc as _e,jc as Ve,kc as Me,lc as ve,mc as v,na as $,nc as A,oc as c,rc as Pe,sb as f,sc as Le,tb as g,tc as de,ub as H,vb as j,vc as ce,wb as q,xb as m,yb as _,zb as d}from"./chunk-BTMXQPBB.js";import{a as O,b as ne}from"./chunk-EUDKD2JW.js";var ot=class n{#t=k(je);#e=k(Ge);#n=k(z);testDestination(t,e,o,i){return this.#n.hasV2TestOperations()?this.testDestinationv2(t,e,o,i):this.testDestinationv1(t,e,o,i)}testDestinationv2(t,e,o,i){return new ie(a=>{this.#t.postApiV2DestinationTest({requestBody:{DestinationUrl:t,AutoCreate:!1,Options:null}}).subscribe({next:r=>{if(r.Success){this.emitSuccessV2(a,t,e,r);return}this.handleGenericError(a,t,e,r.Error??"Unknown error",i)},error:r=>{let u=r?.error?.body;if(u?.Data?.FolderExists===!1||u?.StatusCode==="missing-folder"){o?this.handleMissingFolder(a,t,e):this.handleGenericError(a,t,e,$localize`The remote destination folder does not exist.`,i);return}if(u?.Data?.HostCertificate){this.handleMissingCertificate(a,t,e,u.Data?.HostCertificate);return}if(u?.Data?.ReportedHostKey){this.handleIncorrectKey(a,t,e,u.Data.ReportedHostKey,u.Data.AcceptedHostKey??null);return}this.handleGenericError(a,t,e,r?.message??"Unknown error",i)}})})}testDestinationv1(t,e,o,i){return new ie(a=>{this.#t.postApiV1RemoteoperationTest({requestBody:{path:t}}).subscribe({next:r=>{a.next({action:"success",targetUrl:t,testAgain:!1,destinationIndex:e}),a.complete()},error:r=>{this.handleDestinationErrorv1(r.message,t,e,o,i).subscribe(u=>{a.next(u)})}})})}handleMissingFolder(t,e,o){this.#e.open(G,{data:{title:$localize`Create folder`,message:$localize`The remote destination folder does not exist, do you want to create it?`,confirmText:$localize`Create folder`,cancelText:$localize`Cancel`},closed:i=>{if(!i){this.reportNoAction(t,e,o,$localize`The remote folder does not exist.`);return}this.#n.hasV2TestOperations()?this.#t.postApiV2DestinationTest({requestBody:{DestinationUrl:e,AutoCreate:!0,Options:null}}).subscribe({next:a=>{if(a.Success){this.emitSuccessV2(t,e,o,a);return}else this.handleFolderCreateFailure(t,e,o,a.Error??$localize`Unknown error`)},error:a=>{this.handleFolderCreateFailure(t,e,o,a.message??$localize`Unknown error`)}}):this.#t.postApiV1RemoteoperationCreate({requestBody:{path:e}}).subscribe({next:()=>{this.handleFolderCreated(t,e,o)},error:a=>{this.handleFolderCreateFailure(t,e,o,a.message??$localize`Unknown error`)}})}})}handleFolderCreateFailure(t,e,o,i){this.#e.open(G,{data:{title:$localize`Error creating folder`,message:$localize`The remote destination folder could not be created. ${i}`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:o}),t.complete()}})}emitSuccessV2(t,e,o,i){t.next({action:"success",targetUrl:e,testAgain:!1,destinationIndex:o,anyFilesFound:!i.Data?.FolderIsEmpty,containsBackup:i.Data?.FolderContainsBackupFiles??void 0,containsEncryptedBackupFiles:i.Data?.FolderContainsEncryptedBackupFiles??void 0}),t.complete()}handleFolderCreated(t,e,o){this.#e.open(G,{data:{title:$localize`Folder created`,message:$localize`The remote destination folder was created successfully.`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"test-again",targetUrl:e,testAgain:!0,destinationIndex:o}),t.complete()}})}reportNoAction(t,e,o,i){t.next({action:"generic-error",targetUrl:e,errorMessage:i,testAgain:!1,destinationIndex:o}),t.complete()}handleMissingCertificate(t,e,o,i){this.#e.open(G,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
2
+ If this is a self-signed certificate, you can choose to trust this certificate.
3
+ The server reported the certificate hash: ${i}`,confirmText:$localize`Trust the certificate`,cancelText:$localize`Cancel`},closed:a=>{if(!a){this.reportNoAction(t,e,o,$localize`The server certificate is not trusted.`);return}t.next({action:"trust-cert",targetUrl:e,testAgain:!0,certData:i,destinationIndex:o}),t.complete()}})}handleIncorrectKey(t,e,o,i,a){a?this.#e.open(G,{maxWidth:"500px",data:{title:$localize`The host key has changed`,message:$localize`The host key has changed, please check with the server administrator if this is correct,
4
+ otherwise you could be the victim of a MAN-IN-THE-MIDDLE attack.
5
+ Do you want to REPLACE your CURRENT host key ${a}
6
+ with the REPORTED host key: ${i}?`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:r=>{if(!r){this.reportNoAction(t,e,o,$localize`The host key was not approved.`);return}t.next({action:"approve-host-key",targetUrl:e,testAgain:!0,reportedHostKey:i,destinationIndex:o}),t.complete()}}):this.#e.open(G,{maxWidth:"500px",data:{title:$localize`Approve host key?`,message:$localize`No certificate was specified, please verify that the reported host key is correct: ${i}`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:r=>{if(!r){this.reportNoAction(t,e,o,$localize`The host key was not approved.`);return}t.next({action:"approve-host-key",targetUrl:e,testAgain:!0,reportedHostKey:i,destinationIndex:o}),t.complete()}})}handleGenericError(t,e,o,i,a){function r(){t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:o,errorMessage:i}),t.complete()}if(a){r();return}this.#e.open(G,{maxWidth:"500px",data:{title:$localize`Test connection failed`,message:i,cancelText:$localize`OK`},closed:u=>r()})}handleDestinationErrorv1(t,e,o,i,a){return new ie(r=>{if(t==="missing-folder"){i?this.handleMissingFolder(r,e,o):this.handleGenericError(r,e,o,$localize`The remote destination folder does not exist.`,a);return}if(t.startsWith("incorrect-cert:")){let u=t.split("incorrect-cert:")[1];this.handleMissingCertificate(r,e,o,u);return}if(t.startsWith("incorrect-host-key:")){let u=t.split('incorrect-host-key:"')[1].split('",')[0],h=t.split('accepted-host-key:"')[1].split('",')[0];this.handleIncorrectKey(r,e,o,u,h);return}this.handleGenericError(r,e,o,t,a)})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=oe({token:n,factory:n.\u0275fac,providedIn:"root"})};var Te=class n{#t=k(z);supportedDestinationTypes=P(()=>this.#t.backendModules().map(t=>{if(!t?.Key)return null;let e=X(t.Key);return e.isDefaultEntry===!0?ne(O({},e),{displayName:t.DisplayName||e.displayName||t.Key,description:t.Description||e.description||""}):e}).filter(t=>t!==null));destinationTypeOptions=P(()=>this.supportedDestinationTypes().map(t=>({key:t.customKey??t.key,customKey:t.customKey??null,displayName:t.displayName,description:t.description})));backendModules=P(()=>this.#t.backendModules()??[]);static \u0275fac=function(e){return new(e||n)};static \u0275prov=oe({token:n,factory:n.\u0275fac,providedIn:"root"})};var st=["fileInput"],_t=[[["label"]]],dt=["label"],Se=class n{customId=ee();content=$("");readonly=$(!1);placeholder=ee("Drop a file here or use the browse button");fileInputRef;onFileSelected(t){let e=t.target;e.files&&e.files.length>0&&this.readFile(e.files[0])}onFileDrop(t){t.preventDefault(),t.dataTransfer?.files&&t.dataTransfer.files.length>0&&this.readFile(t.dataTransfer.files[0])}onDragOver(t){t.preventDefault()}readFile(t){let e=new FileReader;e.onload=()=>{this.content.set(e.result)},e.readAsText(t)}triggerBrowse(){return this.fileInputRef.nativeElement.click(),!1}onChange=()=>{};onTouched=()=>{};onChangeEffect=Y(()=>{this.onChange(this.content())});writeValue(t){this.content.set(t)}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.readonly.set(t)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=ae({type:n,selectors:[["app-file-drop-textarea"]],viewQuery:function(e,o){if(e&1&&Fe(st,5),e&2){let i;Oe(i=ke())&&(o.fileInputRef=i.first)}},inputs:{customId:[1,"customId"],placeholder:[1,"placeholder"]},features:[Pe([{provide:qe,useExisting:n,multi:!0}])],ngContentSelectors:dt,decls:9,vars:3,consts:()=>{let t;return t=$localize`${"\uFFFD#4\uFFFD"}:START_TAG_SPK_ICON:upload${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["fileInput",""],t,[1,"browse-btn"],["spk-button","","type","button",1,"small","outlined",3,"click"],[1,"textarea-container","textarea-wrap",3,"drop","dragover"],["rows","10",3,"ngModelChange","placeholder","ngModel","disabled"],["type","file",1,"hidden",3,"change"]]},template:function(e,o){if(e&1){let i=N();we(_t),Ae(0,0,["ngProjectAs","label",5,["label"]]),_(1,"div",2)(2,"button",3),E("click",function(){return T(i),S(o.triggerBrowse())}),Q(3,1),K(4,"spk-icon"),Z(),d()(),_(5,"div",4),E("drop",function(r){return T(i),S(o.onFileDrop(r))})("dragover",function(r){return T(i),S(o.onDragOver(r))}),_(6,"textarea",5),ve("ngModelChange",function(r){return T(i),Me(o.content,r)||(o.content=r),S(r)}),d()(),_(7,"input",6,0),E("change",function(r){return T(i),S(o.onFileSelected(r))}),d()}e&2&&(l(6),m("placeholder",o.placeholder()),Ve("ngModel",o.content),m("disabled",o.readonly()))},dependencies:[ge,ue,Ce,fe,pe,me],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label browsebtn" "input input";grid-template-columns:8fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .browse-btn[_ngcontent-%COMP%]{grid-area:browsebtn}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%]{grid-area:input;width:100%;border:none;font:var(--code-20)}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{width:100%;color:var(--base-8);background-color:var(--base-1);border:1px solid var(--base-4);border-radius:var(--shape-3);padding:.5rem;resize:vertical;box-shadow:var(--box-shadow-10)}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%] .dark[_ngcontent-%COMP%]{background-color:var(--base-2)}[_nghost-%COMP%] .hidden[_ngcontent-%COMP%]{display:none}'],changeDetection:0})};var ct=(n,t,e,o)=>({index:n,fieldGroup:"custom",formView:t,destinationType:e,oauthField:o}),Ie=n=>({$implicit:n}),pt=(n,t,e,o)=>({index:n,fieldGroup:"dynamic",formView:t,destinationType:e,oauthField:o}),mt=()=>({updateOn:"blur"}),ut=(n,t,e,o)=>({index:n,formView:t,fieldGroup:"advanced",destinationType:e,oauthField:o});function Ct(n,t){n&1&&le(0)}function ft(n,t){if(n&1&&b(0,Ct,1,0,"ng-container",13),n&2){let e=t.$implicit,o=t.$index;s();let i=B(15);s();let a=c(0),r=c(1);m("ngTemplateOutlet",i)("ngTemplateOutletContext",de(7,Ie,ce(2,ct,o,e,a,r.oauthField)))}}function gt(n,t){n&1&&le(0)}function Tt(n,t){if(n&1&&b(0,gt,1,0,"ng-container",13),n&2){let e=t.$implicit,o=t.$index;s();let i=B(15);s();let a=c(0),r=c(1);m("ngTemplateOutlet",i)("ngTemplateOutletContext",de(7,Ie,ce(2,pt,o,e,a,r.oauthField)))}}function St(n,t){if(n&1){let e=N();_(0,"button",14),E("click",function(){T(e);let i=s(2);return S(i.showTextArea.set(!1))}),Q(1,6),K(2,"spk-icon"),Z(),d()}}function xt(n,t){if(n&1){let e=N();_(0,"button",21,1),E("click",function(){let i=T(e).$implicit,a=s(3);return S(a.addAdvancedOption(i))}),p(2),d()}if(n&2){let e=t.$implicit;l(2),F(" ",e.name," ")}}function Et(n,t){if(n&1){let e=N();_(0,"div",11)(1,"spk-menu",15)(2,"button",16),Q(3,7),K(4,"spk-icon"),Z(),d(),re(5,17),j(6,xt,3,1,"button",18,H),W(),d(),_(8,"spk-menu")(9,"button",19)(10,"spk-icon"),p(11,"dots-three-vertical"),d()(),re(12,17),_(13,"button",20),E("click",function(){T(e);let i=s(2);return S(i.showTextArea.set(!0))}),_(14,"spk-icon"),p(15,"link"),d(),p(16," Edit contents as text "),d(),W(),d()()}if(n&2){s();let e=c(9);l(),m("searchable",!0),l(),m("disabled",e.length===0),l(4),q(e)}}function Nt(n,t){if(n&1){let e=N();_(0,"textarea",22),E("ngModelChange",function(i){T(e);let a=s(2);return S(a.updateSettingsFromText(i))}),d()}if(n&2){let e=s(2);m("ngModel",e.settingsAsText())("ngModelOptions",Le(2,mt))}}function ht(n,t){n&1&&le(0)}function It(n,t){if(n&1&&b(0,ht,1,0,"ng-container",13),n&2){let e=t.$implicit,o=t.$index;s(2);let i=B(15),a=s(),r=c(0),u=c(1),h=a.getFormView("advanced",e)??a.getDefaultFormView(e);m("ngTemplateOutlet",i)("ngTemplateOutletContext",de(7,Ie,ce(2,ut,o,h,r,u.oauthField)))}}function yt(n,t){if(n&1&&j(0,It,1,9,"ng-container",null,H),n&2){let e=s(2);q(e.advancedFormFieldNames())}}function Dt(n,t){n&1&&(_(0,"sup",31),p(1,"*"),d())}function wt(n,t){if(n&1&&(_(0,"spk-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("spkTooltip",e.formView.longDescription)}}function At(n,t){if(n&1){let e=N();_(0,"app-file-tree",24)(1,"label",30),f(2,Dt,2,0,"sup",31),p(3),f(4,wt,2,1,"spk-icon",32),d(),_(5,"input",33),E("ngModelChange",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),d()()}if(n&2){let e=s().$implicit,o=c(1),i=c(2),a=c(3),r=c(4),u=c(5);m("startingPath",a)("accepts",e.formView.accepts)("showFiles",!0)("hideShortcuts",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),m("for",u),l(),g(e.formView.isMandatory&&r?2:-1),l(),F(" ",o," "),l(),g(e.formView.longDescription?4:-1),l(),m("id",u)("ngModel",i)}}function Ft(n,t){n&1&&(_(0,"sup",34),p(1,"*"),d())}function Ot(n,t){if(n&1&&(_(0,"spk-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("spkTooltip",e.formView.longDescription)}}function kt(n,t){if(n&1){let e=N();_(0,"app-file-tree",25)(1,"label",30),f(2,Ft,2,0,"sup",34),p(3),f(4,Ot,2,1,"spk-icon",32),d(),_(5,"input",33),E("ngModelChange",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),d()()}if(n&2){let e=s().$implicit,o=c(1),i=c(2),a=c(3),r=c(4),u=c(5);m("hideShortcuts",!0)("enableCreateFolder",!0)("startingPath",a),l(),m("for",u),l(),g(e.formView.isMandatory&&r?2:-1),l(),F(" ",o," "),l(),g(e.formView.longDescription?4:-1),l(),m("id",u)("ngModel",i)}}function Vt(n,t){n&1&&(_(0,"sup",35),p(1,"*"),d())}function Mt(n,t){if(n&1&&(_(0,"spk-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("spkTooltip",e.formView.longDescription)}}function vt(n,t){n&1&&(_(0,"spk-icon",36),p(1," warning "),d())}function Pt(n,t){n&1&&(_(0,"spk-icon",37),p(1,"x-circle"),d())}function Lt(n,t){n&1&&(_(0,"spk-icon",38),p(1,"warning"),d())}function $t(n,t){if(n&1&&(_(0,"spk-icon",42),p(1," link "),d()),n&2){s();let e=c(9),o=c(10);se("error",e&&o==="error")("warn",e&&o==="warning"),m("spkTooltip",e)}}function bt(n,t){n&1&&(_(0,"spk-icon",41),p(1,"envelope"),d())}function Gt(n,t){n&1&&(_(0,"spk-icon",41),p(1,"hard-drives"),d())}function Rt(n,t){n&1&&(_(0,"spk-icon",41),p(1,"jar"),d())}function Bt(n,t){n&1&&(_(0,"spk-icon",41),p(1,"textbox"),d())}function Kt(n,t){if(n&1){let e=N();_(0,"spk-form-field")(1,"label",30),f(2,Vt,2,0,"sup",35),p(3),f(4,Mt,2,1,"spk-icon",32),f(5,vt,2,0,"spk-icon",36),f(6,Pt,2,0,"spk-icon",37),f(7,Lt,2,0,"spk-icon",38),d(),_(8,"input",39),E("keydown",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.onKeyDown(a.fieldGroup,a.formView.name,a.formView.type,i))})("ngModelChange",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),d(),v(9)(10),f(11,$t,2,5,"spk-icon",40)(12,bt,2,0,"spk-icon",41)(13,Gt,2,0,"spk-icon",41)(14,Rt,2,0,"spk-icon",41)(15,Bt,2,0,"spk-icon",41),d()}if(n&2){let e=s().$implicit,o=c(1),i=c(2),a=c(3),r=c(4),u=c(5),h=s(2);l(),m("for",u),l(),g(e.formView.isMandatory&&r?2:-1),l(),F(" ",o," "),l(),g(e.formView.longDescription?4:-1),l(),g(r&&e.formView.type==="Path"?5:-1),l(),g(e.formView.type=="Hostname"&&!r&&!h.isValidHostname(a)?6:-1),l(),g(e.formView.type=="Bucketname"&&!r&&!h.isValidBucketname(a)?7:-1),l(),m("type",e.formView.type==="Email"?"email":"text")("id",u)("ngModel",i);let V=a,w=h.hasLeadingSlash(V??"");l(),A(w&&(e.formView.doubleSlash==null?null:e.formView.doubleSlash.message)),l(),A(e.formView.doubleSlash==null?null:e.formView.doubleSlash.type),l(),g(e.formView.type==="Path"?11:e.formView.type==="Email"?12:e.formView.type==="Hostname"?13:e.formView.type==="Bucketname"?14:15)}}function zt(n,t){n&1&&(_(0,"sup",43),p(1,"*"),d())}function Xt(n,t){if(n&1&&(_(0,"spk-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("spkTooltip",e.formView.longDescription)}}function Ut(n,t){if(n&1){let e=N();_(0,"span",47),E("click",function(){T(e);let i=s(2).$implicit,a=s(2);return S(a.oauthStartTokenCreation(i.destinationType,i.fieldGroup,i.formView.name,i.formView.oauthVersion))}),p(1," AuthID "),d()}}function Ht(n,t){n&1&&(_(0,"spk-icon",41),p(1,"password"),d())}function jt(n,t){if(n&1){let e=N();_(0,"spk-icon",48),E("click",function(){T(e);let i=s(2).$implicit;return S(i.formView.showPassword=!i.formView.showPassword)}),p(1," eye "),d()}}function qt(n,t){if(n&1){let e=N();_(0,"spk-icon",48),E("click",function(){T(e);let i=s(2).$implicit;return S(i.formView.showPassword=!i.formView.showPassword)}),p(1," eye-slash "),d()}}function Wt(n,t){if(n&1){let e=N();_(0,"spk-form-field")(1,"label",30),f(2,zt,2,0,"sup",43),p(3),f(4,Xt,2,1,"spk-icon",32),d(),_(5,"input",44),E("ngModelChange",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),d(),f(6,Ut,2,0,"span",45)(7,Ht,2,0,"spk-icon",41),f(8,jt,2,0,"spk-icon",46)(9,qt,2,0,"spk-icon",46),d()}if(n&2){let e=s().$implicit,o=c(1),i=c(2),a=c(4),r=c(5);l(),m("for",r),l(),g(e.formView.isMandatory&&a?2:-1),l(),F(" ",o," "),l(),g(e.formView.longDescription?4:-1),l(),m("type",e.formView.showPassword?"text":"password")("id",r)("ngModel",i),l(),g(e.oauthField===e.formView.name?6:7),l(2),g(e.formView.showPassword?8:9)}}function Qt(n,t){n&1&&(_(0,"sup",50),p(1,"*"),d())}function Zt(n,t){if(n&1&&(_(0,"spk-icon",32),p(1,"question"),d()),n&2){let e=s(3).$implicit;m("spkTooltip",e.formView.longDescription)}}function Jt(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;_e(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function Yt(n,t){if(n&1){let e=N();_(0,"spk-select",49)(1,"label",30),f(2,Qt,2,0,"sup",50),p(3),f(4,Zt,2,1,"spk-icon",32),d(),_(5,"input",33),E("ngModelChange",function(i){T(e);let a=s(2).$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),d()(),b(6,Jt,1,2,"ng-template",null,2,J)}if(n&2){let e=B(7);s();let o=c(0),i=s().$implicit,a=c(1),r=c(2),u=c(4),h=c(5);m("options",o)("isClearable",!1)("optionTemplate",e),l(),m("for",h),l(),g(i.formView.isMandatory&&u?2:-1),l(),F(" ",a," "),l(),g(i.formView.longDescription?4:-1),l(),m("id",h)("ngModel",r)}}function en(n,t){if(n&1&&(v(0),f(1,Yt,8,9)),n&2){let e=s().$implicit,o=A(s(2).mapOptions(e.formView));l(),g(o?1:-1)}}function tn(n,t){n&1&&(_(0,"sup",53),p(1,"*"),d())}function nn(n,t){if(n&1&&(_(0,"spk-icon",32),p(1,"question"),d()),n&2){let e=s(3).$implicit;m("spkTooltip",e.formView.longDescription)}}function on(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;_e(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function an(n,t){if(n&1){let e=N();_(0,"spk-select",52)(1,"label",30),f(2,tn,2,0,"sup",53),p(3),f(4,nn,2,1,"spk-icon",32),d(),_(5,"input",33),E("ngModelChange",function(i){T(e);let a=s(2).$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),d()(),b(6,on,1,2,"ng-template",null,3,J)}if(n&2){let e=B(7);s();let o=c(0),i=s().$implicit,a=c(1),r=c(2),u=c(4),h=c(5);m("options",o)("asFreeText",!0)("inlineSearch",!0)("optionTemplate",e),l(),m("for",h),l(),g(i.formView.isMandatory&&u?2:-1),l(),F(" ",a," "),l(),g(i.formView.longDescription?4:-1),l(),m("id",h)("ngModel",r)}}function rn(n,t){n&1&&K(0,"spk-progress-bar",51)}function ln(n,t){if(n&1&&(v(0),f(1,an,8,10)(2,rn,1,0,"spk-progress-bar",51)),n&2){let e=s().$implicit,o=c(2),i=A(s(2).mapOptionsWithFreeText(e.formView,o));l(),g(i?1:2)}}function sn(n,t){n&1&&(_(0,"sup",55),p(1,"*"),d())}function _n(n,t){if(n&1&&(_(0,"spk-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("spkTooltip",e.formView.longDescription)}}function dn(n,t){if(n&1){let e=N();_(0,"app-size",54),E("ngModelChange",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),_(1,"label",30),f(2,sn,2,0,"sup",55),p(3),f(4,_n,2,1,"spk-icon",32),d()()}if(n&2){let e=s().$implicit,o=c(1),i=c(2),a=c(4),r=c(5);m("inputType",e.Name)("ngModel",i)("customId",r),l(),m("for",r),l(),g(e.formView.isMandatory&&a?2:-1),l(),F(" ",o," "),l(),g(e.formView.longDescription?4:-1)}}function cn(n,t){n&1&&(_(0,"sup",56),p(1,"*"),d())}function pn(n,t){if(n&1&&(_(0,"spk-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("spkTooltip",e.formView.longDescription)}}function mn(n,t){if(n&1){let e=N();_(0,"spk-form-field")(1,"label",30),f(2,cn,2,0,"sup",56),p(3),f(4,pn,2,1,"spk-icon",32),d(),_(5,"input",57),E("ngModelChange",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),d(),_(6,"spk-icon",41),p(7,"numpad"),d()()}if(n&2){let e=s().$implicit,o=c(1),i=c(2),a=c(4),r=c(5);l(),m("for",r),l(),g(e.formView.isMandatory&&a?2:-1),l(),F(" ",o," "),l(),g(e.formView.longDescription?4:-1),l(),m("id",r)("ngModel",i)}}function un(n,t){if(n&1&&(_(0,"spk-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("spkTooltip",e.formView.longDescription)}}function Cn(n,t){if(n&1){let e=N();_(0,"spk-toggle",58),E("click",function(){T(e);let i=s().$implicit,a=c(2),r=s(2);return S(r.updateFieldValue(i.fieldGroup,i.formView.name,r.isTrue(a)?"false":"true"))}),_(1,"label",30),p(2),f(3,un,2,1,"spk-icon",32),d()()}if(n&2){let e=s().$implicit,o=c(1),i=c(2),a=c(5),r=s(2);se("active",r.isTrue(i)),l(),m("for",a),l(),F(" ",o," "),l(),g(e.formView.longDescription?3:-1)}}function fn(n,t){n&1&&(_(0,"sup",60),p(1,"*"),d())}function gn(n,t){if(n&1&&(_(0,"spk-icon",32),p(1,"question"),d()),n&2){let e=s(3).$implicit;m("spkTooltip",e.formView.longDescription)}}function Tn(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;_e(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function Sn(n,t){if(n&1){let e=N();_(0,"spk-select",59)(1,"label",30),f(2,fn,2,0,"sup",60),p(3),f(4,gn,2,1,"spk-icon",32),d(),_(5,"input",61),E("ngModelChange",function(i){T(e);let a=s(2).$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),d()(),b(6,Tn,1,2,"ng-template",null,4,J)}if(n&2){let e=B(7);s();let o=c(0),i=s().$implicit,a=c(1),r=c(2),u=c(4),h=c(5);m("options",o)("selectMultiple",!0)("optionTemplate",e),l(),m("for",h),l(),g(i.formView.isMandatory&&u?2:-1),l(),F(" ",a," "),l(),g(i.formView.longDescription?4:-1),l(),m("ngModel",r)}}function xn(n,t){if(n&1&&(v(0),f(1,Sn,8,8)),n&2){let e=s().$implicit,o=A(s(2).mapOptions(e.formView));l(),g(o?1:-1)}}function En(n,t){n&1&&(_(0,"sup",62),p(1,"*"),d())}function Nn(n,t){if(n&1&&(_(0,"spk-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("spkTooltip",e.formView.longDescription)}}function hn(n,t){if(n&1){let e=N();_(0,"app-timespan",54),E("ngModelChange",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),_(1,"label",30),f(2,En,2,0,"sup",62),p(3),f(4,Nn,2,1,"spk-icon",32),d()()}if(n&2){let e=s().$implicit,o=c(1),i=c(2),a=c(4),r=c(5);m("inputType",e.formView.name)("ngModel",i)("customId",r),l(),m("for",r),l(),g(e.formView.isMandatory&&a?2:-1),l(),F(" ",o," "),l(),g(e.formView.longDescription?4:-1)}}function In(n,t){n&1&&(_(0,"sup",64),p(1,"*"),d())}function yn(n,t){if(n&1&&(_(0,"spk-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("spkTooltip",e.formView.longDescription)}}function Dn(n,t){if(n&1){let e=N();_(0,"app-file-drop-textarea",63),E("ngModelChange",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),_(1,"label"),f(2,In,2,0,"sup",64),p(3),f(4,yn,2,1,"spk-icon",32),d()()}if(n&2){let e=s().$implicit,o=c(2),i=c(4),a=c(5);m("ngModel",o)("customId",a)("placeholder",e.formView.longDescription),l(2),g(e.formView.isMandatory&&i?2:-1),l(),F(" ",e.formView.shortDescription??e.formView.name," "),l(),g(e.formView.longDescription?4:-1)}}function wn(n,t){if(n&1){let e=N();_(0,"button",65),E("click",function(){T(e);let i=s().$implicit,a=s(2);return S(a.removeAdvancedOption(i.formView.name))}),_(1,"spk-icon"),p(2,"x-circle"),d()()}}function An(n,t){if(n&1&&(_(0,"div",23),v(1)(2)(3)(4)(5),f(6,At,6,12,"app-file-tree",24)(7,kt,6,9,"app-file-tree",25)(8,Kt,16,13,"spk-form-field")(9,Wt,10,9,"spk-form-field")(10,en,2,2)(11,ln,3,2)(12,dn,5,7,"app-size",26)(13,mn,8,6,"spk-form-field")(14,Cn,4,5,"spk-toggle",27)(15,xn,2,2)(16,hn,5,7,"app-timespan",26)(17,Dn,5,6,"app-file-drop-textarea",28),f(18,wn,3,0,"button",29),d()),n&2){let e=t.$implicit;s();let o=c(0),i=s();se("single-field",e.fieldGroup!=="advanced"),l(),A(e.formView.shortDescription??e.formView.name),l(),A(i.getFieldGroup(o,e.fieldGroup)[e.formView.name]),l();let a=A(i.getFieldValue(e.fieldGroup,e.formView.name));l(),A((a??"").toString().trim()===""),l(),A("destination-"+e.fieldGroup+"-"+e.index+"-"+(e.asHttpOptions?"http":"other")),l(),g(e.formView.type==="FileTree"?6:e.formView.type==="FolderTree"?7:e.formView.type==="String"||e.formView.type==="Path"||e.formView.type==="Email"||e.formView.type==="Hostname"||e.formView.type==="Bucketname"?8:e.formView.type==="Password"?9:e.formView.type==="Enumeration"?10:e.formView.type==="NonValidatedSelectableString"?11:e.formView.type==="Size"?12:e.formView.type==="Integer"?13:e.formView.type==="Boolean"?14:e.formView.type==="Flags"?15:e.formView.type==="Timespan"||e.formView.type==="DateTime"?16:e.formView.type==="FreeText"?17:-1),l(12),g(e.fieldGroup==="advanced"?18:-1)}}function Fn(n,t){if(n&1&&(v(0),j(1,ft,1,9,"ng-container",null,H),j(3,Tt,1,9,"ng-container",null,H),_(5,"spk-toggle-card",8),re(6,9)(7),De(8,5),W(),v(9),f(10,St,3,0,"button",10)(11,Et,17,2,"div",11),W(),f(12,Nt,1,3,"textarea",12)(13,yt,2,0),d(),b(14,An,19,9,"ng-template",null,0,J)),n&2){let e=s(),o=c(1);A(e.destinationForm()),l(),q(o.custom),l(2),q(o.dynamic),l(2),m("disallowToggle",!0),l(4),A(e.nonSelectedAdvancedFormViews()),l(),g(e.showTextArea()?10:11),l(2),g(e.showTextArea()?12:13)}}var at=class n{#t=k(et);#e=k(z);#n=k(it);#a=k(Te);injector=k(ye);targetUrl=$e.required();useBackupState=ee(!1);#i=null;destinationType=P(()=>{let t=this.targetUrl();if(!t)return null;let e=X(t.split("://")[0]);return this.#i=e?.customKey??e?.key,this.#i});destinationForm=$({custom:{},dynamic:{},advanced:{}});advancedFormFieldNames=P(()=>Object.keys(this.destinationForm().advanced));destinationFormConfig=$(null);showTextArea=$(!1);nonSelectedAdvancedFormViews=P(()=>{let t=this.destinationFormConfig();if(!t)return[];let e=this.advancedFormFieldNames();return t.advanced.filter(o=>e.findIndex(i=>i===o.name)===-1)});destinationTypeEffect=Y(()=>{let t=this.destinationType()??"",e=X(t),o=e?.key,i=this.#a.backendModules().find(I=>I.Key===o)??{Key:t,DisplayName:t,Description:X(t).description,Options:[]};if(!i||!i.Options||!t)return;let a=e&&e.oauthField?e.oauthField:null,r=e&&e.customFields?e.customFields:{},u=e&&e.dynamicFields?e.dynamicFields:[],h=e&&e.advancedFields?e.advancedFields:[],V=e&&e.ignoredAdvancedFields?e.ignoredAdvancedFields:[],w={destinationType:t,oauthField:a,custom:[],dynamic:[],advanced:[]};r&&Object.entries(r).forEach(([I,C],y)=>{let D=C.order??y;w.custom.push(O({order:900+D},C))});for(let I=0;I<i.Options.length;I++){let C=i.Options[I];if(C.Deprecated)continue;let y=u.find(D=>D===C.Name||C.Aliases?.includes(D.name)||D.name===C.Name);if(y){let D=C.Aliases?.indexOf(y.name)??-1,L=C.Aliases&&D>-1?C.Aliases[D]:C.Name,x=y&&typeof y!="string",xe=x?y?.defaultValue??C.DefaultValue:C.DefaultValue,Ee=x&&y?.order!==void 0?y.order:I,U={name:L,type:C.Type,shortDescription:C.ShortDescription??void 0,longDescription:C.LongDescription??void 0,options:C.ValidValues,order:900+Ee},Ne=x?O(O({},U),y):U;w.dynamic.push(Ne)}else{let D=C.Name;if(V.find(te=>te===D))continue;let x=h.find(te=>te===D||te.name===D),xe=x&&typeof x!="string",Ee=xe&&x?.order!==void 0?x.order:I,U={name:D,type:C.Type,shortDescription:C.ShortDescription??void 0,longDescription:C.LongDescription??void 0,options:C.ValidValues,defaultValue:C.DefaultValue,order:900+Ee},Ne=xe?O(O({},U),x):U;w.advanced.push(Ne)}}w.custom.sort((I,C)=>I.order-C.order),w.dynamic.sort((I,C)=>I.order-C.order),w.advanced.sort((I,C)=>I.order-C.order),this.destinationFormConfig.set(w);let R=this.targetUrl();if(!R)return;let M=Je(R);M&&this.destinationForm.set({custom:M.custom,dynamic:M.dynamic,advanced:M.advanced})});destinationFormEffect=Y(()=>{let t=this.#i,e=this.destinationForm();if(!e||!t)return;let o=Ze({destinationType:t,custom:e.custom,dynamic:e.dynamic,advanced:e.advanced});o&&this.targetUrl.set(o)});getFieldValue(t,e){let i=this.destinationForm()[t][e];return i||null}getFormView(t,e){let i=this.destinationFormConfig()?.[t].find(a=>a.name===e);return i||null}getDefaultFormView(t){return{name:t,type:"String",shortDescription:t,longDescription:$localize`This is an undocumented option.`}}getFieldGroup(t,e){return t[e]}hasLeadingSlash(t){return t?.startsWith("/")??!1}addAdvancedOption(t){let e=this.destinationForm();e.advanced[t.name]=t.defaultValue,this.destinationForm.set(O({},e))}isValidBucketname(t){if(!t)return!1;let e=t.length;return!(e<3||e>63||!/^[a-z0-9.-]+$/.test(t)||!/^[a-z0-9]/.test(t)||!/[a-z0-9]$/.test(t)||/^\d{1,3}(\.\d{1,3}){3}$/.test(t)||/(\.\.)|(\.-)|(-\.)/.test(t))}isValidHostname(t){if(!t||t.length>253)return!1;let e=t.split(".");for(let o of e)if(!o||o.length>63||!/^[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?$/.test(o))return!1;return!0}isTrue(t){if(typeof t=="boolean")return t;if(typeof t=="string"){let e=t.toLowerCase();return e==="true"||e==="1"||e==="yes"||e==="on"}return!1}onKeyDown(t,e,o,i){if(o==="Hostname"||o==="Bucketname"){if(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Home","End"].includes(i.key))return;if(i.key=="/"||i.key=="\\"||i.key==":"){i.preventDefault();return}}}updateFieldValue(t,e,o){let i=this.destinationForm();i[t][e]=o,this.destinationForm.set(O({},i))}removeAdvancedOption(t){let e=this.destinationForm();delete e.advanced[t],this.destinationForm.set(O({},e))}mapOptions(t){let e=t.loadOptions;if(e)return e(this.injector)();let o=t.options;return o?o.map(i=>({key:i,value:i})):null}mapOptionsWithFreeText(t,e){let o=this.mapOptions(t);return o?(e&&e.length>0&&(o.find(a=>a.value===e)||o.push({key:e,value:e})),o):null}#o=$(!1);oauthStartTokenCreation(t,e,o,i){this.#o.set(!0);let a=(i??1)==2?this.#e.defaultOAuthUrlV2():this.#e.defaultOAuthUrl(),r=this.#n.serverSettings()?.["--oauth-url"];if(r&&r.length>0&&(a=r),this.useBackupState()){let C=this.#t.mapFormsToSettings().find(y=>y.Name==="--oauth-url")?.Value;C&&C.length>0&&(a=C)}let u=this.destinationForm().advanced["oauth-url"];u&&u.length>0&&(a=u);let h=`${a}?type=${t}`,V=450,w=600,R=screen.width/2-V/2,M=screen.height/2-w/2,I=window.open(h,"_blank","height="+w+",width="+V+",menubar=0,status=0,titlebar=0,toolbar=0,left="+R+",top="+M);return window.addEventListener("message",C=>{let y=C.data.startsWith("authid:"),D=y?C.data.replace("authid:",""):null;y&&(this.destinationForm.update(L=>(L[e][o]=D,L)),this.#o.set(!1),I?.close())}),!1}settingsAsText=P(()=>{let t=this.destinationForm().advanced;return Object.entries(t).map(([e,o])=>{let i=e??"",a="";return typeof o=="boolean"?a=this.isTrue(o)?"True":"False":(typeof o=="number"||o!=null)&&(a=o.toString()),`${i}=${a}`}).join(`
7
+ `)});updateSettingsFromText(t){if(typeof t!="string")return;let e=t.split(`
8
+ `).map(i=>i.trim()).filter(i=>i.length>0),o={};for(let i of e){let[a,r]=i.split("=").map(u=>u.trim());a&&a.trim().length>0&&r!==void 0&&(o[a]=r)}this.destinationForm.update(i=>ne(O({},i),{advanced:o}))}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=ae({type:n,selectors:[["app-single-destination"]],inputs:{targetUrl:[1,"targetUrl"],useBackupState:[1,"useBackupState"]},outputs:{targetUrl:"targetUrlChange"},decls:3,vars:3,consts:()=>{let t;t=$localize`Advanced options`;let e;e=$localize` Show editor ${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let o;o=$localize` Add advanced option ${"\uFFFD#4\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let i;i=$localize`This field is mandatory`;let a;a=$localize`This field is mandatory`;let r;r=$localize`This field is mandatory`;let u;u=$localize`An empty path means storing data in the initial or root folder, which is not recommended`;let h;h=$localize`Hostname is invalid`;let V;V=$localize`Bucket name is invalid`;let w;w=$localize`This field is mandatory`;let R;R=$localize`This field is mandatory`;let M;M=$localize`This field is mandatory`;let I;I=$localize`This field is mandatory`;let C;C=$localize`This field is mandatory`;let y;y=$localize`This field is mandatory`;let D;D=$localize`This field is mandatory`;let L;return L=$localize`This field is mandatory`,[["fieldTemplate",""],["option",""],["enumOptionTemplate",""],["nonValidatedOptionTemplate",""],["optionTemplate",""],t,e,o,[1,"advanced-options",3,"disallowToggle"],["title",""],["spk-button","","type","button",1,"outlined","small"],[1,"actions"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModel","ngModelOptions"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["spk-button","","type","button",1,"outlined","small",3,"click"],[3,"searchable"],["spk-button","","type","button",1,"outlined","small",3,"disabled"],["menu",""],["type","button"],["spk-button","","type","button",1,"small"],["spk-button","","type","button",1,"small",3,"click"],["type","button",3,"click"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModelChange","ngModel","ngModelOptions"],[1,"field-row"],[3,"startingPath","accepts","showFiles","hideShortcuts","showHiddenNodes","selectFiles"],[3,"hideShortcuts","enableCreateFolder","startingPath"],[3,"inputType","ngModel","customId"],[1,"primary","raised",3,"active"],[3,"ngModel","customId","placeholder"],["spk-button","","type","button",1,"outlined"],[3,"for"],["spkTooltip",i],[1,"primary",3,"spkTooltip"],["type","text",3,"ngModelChange","id","ngModel"],["spkTooltip",a],["spkTooltip",r],["spkTooltip",u,1,"warn"],["spkTooltip",h,1,"error"],["spkTooltip",V,1,"warn"],[3,"keydown","ngModelChange","type","id","ngModel"],["prefix","",3,"error","warn","spkTooltip"],["prefix",""],["prefix","",3,"spkTooltip"],["spkTooltip",w],["autocomplete","off",3,"ngModelChange","type","id","ngModel"],["prefix","",1,"link"],["suffix","",1,"clickable"],["prefix","",1,"link",3,"click"],["suffix","",1,"clickable",3,"click"],["label","key","value","value",3,"options","isClearable","optionTemplate"],["spkTooltip",R],[1,"indeterminate","primary"],["label","key","value","value",3,"options","asFreeText","inlineSearch","optionTemplate"],["spkTooltip",M],[3,"ngModelChange","inputType","ngModel","customId"],["spkTooltip",I],["spkTooltip",C],["type","number",3,"ngModelChange","id","ngModel"],[1,"primary","raised",3,"click"],["key","key","value","value",1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["spkTooltip",y],["type","text","id","text",3,"ngModelChange","ngModel"],["spkTooltip",D],[3,"ngModelChange","ngModel","customId","placeholder"],["spkTooltip",L],["spk-button","","type","button",1,"outlined",3,"click"]]},template:function(e,o){if(e&1&&(v(0)(1),f(2,Fn,16,5)),e&2){let i=A(o.destinationType());l();let a=A(o.destinationFormConfig());l(),g(i&&a?2:-1)}},dependencies:[Qe,ue,We,Ce,ge,fe,be,Ye,tt,nt,Se,Re,me,pe,Xe,Be,ze,He,Ue,Ke],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.advanced-options[_ngcontent-%COMP%]{position:relative;z-index:1}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}spk-select[_ngcontent-%COMP%]{--miw: p2r(120)}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-500)}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-500)}label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}label[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.raw-text-area[_ngcontent-%COMP%]{min-height:12rem;white-space:pre}"],changeDetection:0})};export{ot as a,Te as b,at as c};
@@ -1 +1 @@
1
- import{a as Le,b as Re}from"./chunk-HDDYOVZL.js";import{a as $e}from"./chunk-DG7SFNGT.js";import{a as x}from"./chunk-QRRKPBY6.js";import"./chunk-WZRDKVOR.js";import{a as fe}from"./chunk-ULLALJQ2.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import{a as Ie}from"./chunk-ELFZD53L.js";import{c as Pe,d as Oe,e as he,i as De,r as ke,s as Ne,t as Me}from"./chunk-NSIELNIY.js";import"./chunk-7QJG4IIT.js";import{b as de,d as Ee}from"./chunk-3ZVSHKLD.js";import{c as ce,e as pe,f as ue}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{C as Te,a as M,b as G,c as Se,e as ge,g as w,k as Fe,l as Ae,n as Ce,u as me}from"./chunk-Y5IRBMLB.js";import{h as H}from"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import{Ab as l,Eb as f,H as V,Hc as re,Ic as j,Kb as p,Lb as u,Mb as O,Mc as le,Oc as _e,Pb as R,Qa as r,Qb as g,Qc as Q,Rb as c,Z as A,Zb as ne,_b as oe,ab as N,bc as v,da as C,dc as $,ea as m,ec as F,fc as X,gc as K,jc as z,kc as W,lc as q,mc as ie,na as E,nc as se,oc as y,sb as d,sc as ae,tb as S,ub as Z,vb as ee,wb as te,xb as h,yb as s,zb as i}from"./chunk-BTMXQPBB.js";import{a as Y,b as B}from"./chunk-EUDKD2JW.js";var Ge=["scroller"];function we(n,o){n&1&&(s(0,"spk-icon"),F(1,"bell-ringing"),i())}function He(n,o){n&1&&(s(0,"spk-icon"),F(1,"bell"),i())}function xe(n,o){if(n&1&&l(0,"app-notification",8),n&2){c(2);let e=y(6);h("index",0)("notification",e.content)}}function Ue(n,o){if(n&1&&(s(0,"div",11),F(1),i()),n&2){c(3);let e=y(6);r(),K(" ",e.content.content," ")}}function Ye(n,o){if(n&1&&(s(0,"spk-alert")(1,"div",10),F(2),i(),d(3,Ue,2,1,"div",11),i()),n&2){c(2);let e=y(6);$(e.content.type||"error"),r(2),X(e.content.title),r(),S(e.content.content?3:-1)}}function Be(n,o){if(n&1&&(s(0,"div",6),d(1,xe,1,2,"app-notification",8)(2,Ye,4,4,"spk-alert",9),i()),n&2){c();let e=y(6);r(),S(e.type==="notification"?1:2)}}function Ve(n,o){if(n&1){let e=f();s(0,"div",7)(1,"div",12)(2,"h6",13),p(3,2),s(4,"button",5),g("click",function(){C(e);let a=c();return m(a.toggleNotifications())}),l(5,"spk-icon"),i(),u(),i(),s(6,"div",14,0)(8,"div",15),l(9,"app-notifications"),i()()()()}}function Xe(n,o){if(n&1&&(s(0,"div",20),F(1),i()),n&2){let e=c().$implicit;r(),K(" ",e.content," ")}}function Ke(n,o){if(n&1){let e=f();s(0,"spk-alert",18,1),g("click",function(){let a=C(e).$implicit,_=c(2);return m(_.deleteAlertByIndex(a.id))}),s(2,"div",19),F(3),i(),d(4,Xe,2,1,"div",20),i()}if(n&2){let e=o.$implicit;$(e.type),h("id",e.id),r(3),X(e.title),r(),S(e.content?4:-1)}}function ze(n,o){n&1&&(s(0,"p",17),O(1,4),i())}function We(n,o){if(n&1){let e=f();s(0,"div",7)(1,"div",12)(2,"h6",13),p(3,3),s(4,"button",5),g("click",function(){C(e);let a=c();return m(a.toggleAlerts())}),l(5,"spk-icon"),i(),u(),i(),s(6,"div",14,0)(8,"div",15),ee(9,Ke,5,5,"spk-alert",16,Z,!1,ze,2,0,"p",17),i()()()()}if(n&2){let e=c();r(9),te(e.alertHistory())}}var ye=new ke,b=class n{#e=A(Se);#t=A(x);isSubmitting=E(!1);messageSent=E(!1);form=ye.group({message:ye.control("",[Oe.required])});notifications=this.#t.notifications;shownMessage=E(null);shownMessageInterval=null;alertHistory=this.#e.alertHistory;alertHistoryIsOpen=this.#e.alertHistoryIsOpen;alertHistoryIsHidden=this.#e.alertHistoryIsHidden;numberOfOpenAlerts=re(()=>this.alertHistory().filter(o=>o.isOpen).length);scroller=_e("scroller");isAlertsOpen=Q(!1);isNotificationsOpen=Q(!1);previousHistoryCount=E(null);previousNotificationsCount=E(null);constructor(){j(()=>{let o=this.alertHistory(),e=this.notifications();if(e.length===0){this.shownMessage.set(null);return}e.length&&this.previousHistoryCount()!==o.length&&!this.isNotificationsOpen()?(this.shownMessage.set({content:e[0],countDown:3,type:"notification"}),this.previousHistoryCount.set(o.length),this.shownMessageInterval=setInterval(()=>{let t=this.shownMessage();if(t?.countDown===0){this.shownMessage.set(null),this.shownMessageInterval=null;return}t!==null&&this.shownMessage.update(a=>B(Y({},a),{countDown:a.countDown-1}))},1e3)):o.length&&this.previousHistoryCount()!==o.length&&!this.isAlertsOpen()&&(this.shownMessage.set({content:o[0],countDown:3,type:"alert"}),this.previousHistoryCount.set(o.length),this.shownMessageInterval=setInterval(()=>{let t=this.shownMessage();if(t?.countDown===0){this.shownMessage.set(null),this.shownMessageInterval=null;return}t!==null&&this.shownMessage.update(a=>B(Y({},a),{countDown:a.countDown-1}))},1e3))}),j(()=>{this.alertHistoryIsOpen(),this.scrollToBottom()})}resetPreviewMessage(){this.shownMessage.set(null),this.shownMessageInterval=null}toggleAlerts(){this.isAlertsOpen()?this.isAlertsOpen.set(!1):(this.isAlertsOpen.set(!0),this.isNotificationsOpen.set(!1),this.resetPreviewMessage())}toggleNotifications(){this.isNotificationsOpen.set(!this.isNotificationsOpen()),this.isAlertsOpen()&&this.isAlertsOpen.set(!1)}deleteAlertByIndex(o){this.#e.removeAlert(o)}scrollToBottom(){this.scroller()&&this.scroller()?.nativeElement&&this.scroller().nativeElement.scrollTo(0,this.scroller().nativeElement.scrollHeight)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=N({type:n,selectors:[["app-service-hub"]],viewQuery:function(e,t){e&1&&ne(t.scroller,Ge,5),e&2&&oe()},inputs:{isAlertsOpen:[1,"isAlertsOpen"],isNotificationsOpen:[1,"isNotificationsOpen"]},outputs:{isAlertsOpen:"isAlertsOpenChange",isNotificationsOpen:"isNotificationsOpenChange"},decls:10,vars:9,consts:()=>{let o;o=$localize` Notifications ${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"\uFFFD#5\uFFFD"}:START_TAG_SPK_ICON:x-circle${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_BUTTON:`;let e;e=$localize` Alerts ${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"\uFFFD#5\uFFFD"}:START_TAG_SPK_ICON:x-circle${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_BUTTON:`;let t;return t=$localize`No alerts yet`,[["scroller",""],["alerts",""],o,e,t,["spk-button","",3,"click"],[1,"preview-alert-wrap"],[1,"alert-stream-modal"],[3,"index","notification"],[3,"class"],["sparkle-alert-title",""],["sparkle-alert-content",""],[1,"alert-stream-modal-content"],[1,"paragraph-20"],[1,"alert-stream-modal-list-scroller"],[1,"alert-stream-modal-list"],[3,"class","id"],[1,"no-alerts"],[3,"click","id"],["title",""],["content",""]]},template:function(e,t){if(e&1){let a=f();s(0,"button",5),g("click",function(){return C(a),m(t.toggleAlerts())}),s(1,"spk-icon"),F(2,"info"),i()(),s(3,"button",5),g("click",function(){return C(a),m(t.toggleNotifications())}),d(4,we,2,0,"spk-icon")(5,He,2,0,"spk-icon"),i(),ie(6),d(7,Be,3,1,"div",6),d(8,Ve,10,0,"div",7),d(9,We,12,1,"div",7)}if(e&2){$(t.alertHistory().length?"error":""),r(3),$(t.notifications().length?"error":""),r(),S(t.notifications().length?4:5),r(2);let a=se(t.shownMessage());r(),S(a?7:-1),r(),S(t.isNotificationsOpen()?8:-1),r(),S(t.isAlertsOpen()?9:-1)}},dependencies:[Me,G,M,w,Re,Le],styles:["[_nghost-%COMP%]{display:flex;position:fixed;gap:.5rem;bottom:1.5rem;right:1.5rem;z-index:5000}@media only screen and (max-width: 768px){[_nghost-%COMP%]{bottom:1rem;right:1rem}}[_nghost-%COMP%] h6[_ngcontent-%COMP%]{margin:0}.preview-alert-wrap[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column;min-width:15.625rem}.helpdesk-modal[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column}@media only screen and (max-width: 768px){.helpdesk-modal[_ngcontent-%COMP%]{bottom:2.6875rem}}.helpdesk-modal-content[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;gap:1rem;min-width:20rem;border:1px solid var(--base-4);background-color:var(--base-1);border-radius:var(--shape-2)}.helpdesk-modal-content[_ngcontent-%COMP%] .message-sent[_ngcontent-%COMP%]{padding:0 1rem 1rem;text-wrap:pretty}.helpdesk-modal-content[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid var(--base-4);display:flex;align-items:center;justify-content:space-between}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{padding:0 1rem 1rem;display:flex;flex-direction:column;align-items:flex-end;gap:1rem}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{width:100%;text-wrap:pretty}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{width:100%}.alert-stream-modal[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column}@media only screen and (max-width: 768px){.alert-stream-modal[_ngcontent-%COMP%]{bottom:2.6875rem}}.alert-stream-modal-list-scroller[_ngcontent-%COMP%]{overflow-y:auto;max-height:18.75rem}.alert-stream-modal-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:1rem;border-radius:var(--shape-2)}.alert-stream-modal-content[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;min-width:20rem;border:1px solid var(--base-4);background-color:var(--base-1);border-radius:var(--shape-2)}.alert-stream-modal-content[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid var(--base-4);display:flex;align-items:center;justify-content:space-between}.no-alerts[_ngcontent-%COMP%]{padding:1rem;display:flex;flex-direction:column;gap:1rem;text-align:center}"],changeDetection:0})};function qe(n,o){n&1&&(s(0,"spk-icon",14),F(1,"check"),i())}function je(n,o){n&1&&(s(0,"spk-icon",15),F(1,"prohibit"),i())}function Qe(n,o){if(n&1){let e=f();s(0,"button",20),g("click",function(){C(e);let a=c();return m(a.updatePassphrase())}),O(1,5),i()}if(n&2){let e=c();v("loader",e.isUpdating())}}function Je(n,o){if(n&1){let e=f();s(0,"button",21),g("click",function(){C(e);let a=c();return m(a.updatePassphrase())}),O(1,6),i()}if(n&2){let e=c();v("loader",e.isUpdating()),h("disabled",!0)}}var U=class n{#e=A(H);closed=le();isUpdating=E(!1);passphrase=E("");repeatPassphrase=E("");updatePassphrase(){this.passphrase()===this.repeatPassphrase()&&(this.isUpdating.set(!0),this.#e.patchApiV1Serversettings({requestBody:{"server-passphrase":this.passphrase()}}).pipe(V(()=>this.isUpdating.set(!1))).subscribe({next:()=>this.closed.emit()}))}cancel(){this.isUpdating.set(!0),this.#e.patchApiV1Serversettings({requestBody:{"has-asked-for-password-change":"True"}}).pipe(V(()=>this.isUpdating.set(!1))).subscribe({next:()=>this.closed.emit()})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=N({type:n,selectors:[["app-change-passphrase-alert-dialog"]],outputs:{closed:"closed"},decls:23,vars:7,consts:()=>{let o;o=$localize`Enter new password`;let e;e=$localize`Repeat password`;let t;t=$localize`Password have to be filled and have to match`;let a;a=$localize`Change passphrase`;let _;_=$localize` Duplicati needs to be secured with a passphrase and a random passphrase has been generated for you. ${"[\uFFFD#6\uFFFD\uFFFD/#6\uFFFD|\uFFFD#7\uFFFD\uFFFD/#7\uFFFD]"}:LINE_BREAK:${"[\uFFFD#6\uFFFD\uFFFD/#6\uFFFD|\uFFFD#7\uFFFD\uFFFD/#7\uFFFD]"}:LINE_BREAK: If you open Duplicati from the tray icon, you do not need a passphrase, but if you plan to open it from another location you need to set a passphrase you know. Do you want to set a passphrase now? `,_=R(_);let D;D=$localize`Passphrase`;let k;k=$localize`Repeat passphrase`;let I;I=$localize`Not now thanks`;let L;L=$localize` Yes, update passphrase now `;let T;return T=$localize` Yes, update passphrase now `,[a,_,D,k,I,L,T,["header",""],["content",""],["type","warning"],["for","password"],["type","password","name","password","autocomplete","disabled","placeholder",o,"tabindex","1",3,"ngModelChange","ngModel"],["for","repeatPassword"],["type","password","name","repeatPassword","autocomplete","disabled","placeholder",e,"tabindex","2",3,"ngModelChange","disabled","ngModel"],["suffix","",1,"spk-success"],["suffix",""],["footer",""],["spk-button","",3,"click"],["spk-button","",1,"raised","primary",3,"loader"],["spk-button","","spkTooltip",t,1,"raised","primary",3,"loader","disabled"],["spk-button","",1,"raised","primary",3,"click"],["spk-button","","spkTooltip",t,1,"raised","primary",3,"click","disabled"]]},template:function(e,t){e&1&&(s(0,"header",7)(1,"h3"),O(2,0),i()(),s(3,"div",8)(4,"spk-alert",9),p(5,1),l(6,"br")(7,"br"),u(),i(),s(8,"spk-form-field")(9,"label",10),O(10,2),i(),s(11,"input",11),q("ngModelChange",function(_){return W(t.passphrase,_)||(t.passphrase=_),_}),i()(),s(12,"spk-form-field")(13,"label",12),O(14,3),i(),s(15,"input",13),q("ngModelChange",function(_){return W(t.repeatPassphrase,_)||(t.repeatPassphrase=_),_}),i(),d(16,qe,2,0,"spk-icon",14)(17,je,2,0,"spk-icon",15),i()(),s(18,"footer",16)(19,"button",17),g("click",function(){return t.cancel()}),O(20,4),i(),d(21,Qe,2,2,"button",18)(22,Je,2,3,"button",19),i()),e&2&&(r(11),z("ngModel",t.passphrase),r(4),h("disabled",t.passphrase().length===0),z("ngModel",t.repeatPassphrase),r(),S(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?16:17),r(3),v("loader",t.isUpdating()),r(2),S(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?21:22))},dependencies:[Ne,Pe,he,De,G,Ae,M,Te],styles:["[_nghost-%COMP%]{display:block;--dialog-p: 1.5rem}[content][_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}"],changeDetection:0})};var Ze=()=>({exact:!0});function et(n,o){n&1&&(s(0,"spk-icon"),F(1,"sun"),i())}function tt(n,o){n&1&&(s(0,"spk-icon"),F(1,"moon"),i())}function nt(n,o){if(n&1){let e=f();s(0,"button",22),g("click",function(){C(e);let a=c();return m(a.changeDefaultClientTo("ngax"))}),p(1,7),l(2,"spk-icon"),u(),i(),s(3,"button",22),g("click",function(){C(e);let a=c();return m(a.logout())}),p(4,8),l(5,"spk-icon"),u(),i()}}var J=class n{#e=A($e);#t=A(H);#n=A(fe);#o=A(de);#i=A(ge);#s=A(x);#a=A(Ee);relayIsEnabled=this.#o.relayIsEnabled;isDarkMode=this.#e.isDarkMode;ngOnInit(){return this.#s.init(),this.#n.getBackups(!0),this.#t.getApiV1Serversettings().subscribe({next:o=>{let e=o["autogenerated-passphrase"]==="True",t=o["has-asked-for-password-change"]==="True";e&&!t&&this.#i.open(U,{maxWidth:"500px"})}})}toggleBodyClass(){this.#e.toggleBodyClass()}changeDefaultClientTo(o){this.#r(o),window.location.replace(`/${o}`)}logout(){this.#a.logout()}#r(o){var e=new Date;e.setTime(e.getTime()+90*24*60*60*1e3),document.cookie="default-client="+o+"; expires="+e.toUTCString()+"; path=/"}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=N({type:n,selectors:[["app-layout"]],decls:37,vars:4,consts:()=>{let o;o=$localize`${"\uFFFD#10\uFFFD"}:START_TAG_SPK_ICON:house${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_SPK_ICON: Home `;let e;e=$localize`${"\uFFFD#13\uFFFD"}:START_TAG_SPK_ICON:database${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SPK_ICON: Add backup `;let t;t=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SPK_ICON:clock-counter-clockwise${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SPK_ICON: Restore `;let a;a=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SPK_ICON:gear${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SPK_ICON: Settings `;let _;_=$localize`${"\uFFFD#26\uFFFD"}:START_TAG_SPK_ICON:info${"\uFFFD/#26\uFFFD"}:CLOSE_TAG_SPK_ICON: About Duplicati `;let D;D=$localize`${"\uFFFD#29\uFFFD"}:START_TAG_SPK_ICON:files${"[\uFFFD/#29\uFFFD|\uFFFD/#30\uFFFD]"}:CLOSE_TAG_SPK_ICON: Documentation ${"\uFFFD#30\uFFFD"}:START_TAG_SPK_ICON_1:arrow-square-out${"[\uFFFD/#29\uFFFD|\uFFFD/#30\uFFFD]"}:CLOSE_TAG_SPK_ICON:`,D=R(D);let k;k=$localize`${"\uFFFD#33\uFFFD"}:START_TAG_SPK_ICON:chats-circle${"[\uFFFD/#33\uFFFD|\uFFFD/#34\uFFFD]"}:CLOSE_TAG_SPK_ICON: Visit forum ${"\uFFFD#34\uFFFD"}:START_TAG_SPK_ICON_1:arrow-square-out${"[\uFFFD/#33\uFFFD|\uFFFD/#34\uFFFD]"}:CLOSE_TAG_SPK_ICON:`,k=R(k);let I;I=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:skip-back${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: Use old UI `;let L;return L=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_ICON:sign-out${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_ICON: Log out `,[o,e,t,a,_,D,k,I,L,["sidenav",""],["spk-button","",1,"icon","small",3,"click"],[1,"base-1","primary"],["action","","routerLink","/","routerLinkActive","active",3,"routerLinkActiveOptions"],["action","","routerLink","/add-backup","routerLinkActive","active"],["action","","routerLink","/restore","routerLinkActive","active"],["action","","routerLink","/settings","routerLinkActive","active"],[1,"spacer"],[1,"base-1l","primary"],["action","","routerLink","/about","routerLinkActive","active"],["href","https://docs.duplicati.com","target","_blank","action",""],["suffix",""],["href","https://forum.duplicati.com","target","_blank","action",""],["action","",3,"click"]]},template:function(e,t){e&1&&(s(0,"spk-sidenav")(1,"div",9)(2,"header"),l(3,"app-logo"),s(4,"button",10),g("click",function(){return t.toggleBodyClass()}),d(5,et,2,0,"spk-icon")(6,tt,2,0,"spk-icon"),i()(),s(7,"spk-list",11)(8,"button",12),p(9,0),l(10,"spk-icon"),u(),i(),s(11,"button",13),p(12,1),l(13,"spk-icon"),u(),i(),s(14,"button",14),p(15,2),l(16,"spk-icon"),u(),i(),s(17,"button",15),p(18,3),l(19,"spk-icon"),u(),i()(),l(20,"div",16),s(21,"spk-list",17),d(22,nt,6,0),l(23,"spk-divider"),s(24,"button",18),p(25,4),l(26,"spk-icon"),u(),i(),s(27,"a",19),p(28,5),l(29,"spk-icon")(30,"spk-icon",20),u(),i(),s(31,"a",21),p(32,6),l(33,"spk-icon")(34,"spk-icon",20),u(),i()()(),l(35,"router-outlet")(36,"app-service-hub"),i()),e&2&&(r(5),S(t.isDarkMode()?5:6),r(3),h("routerLinkActiveOptions",ae(3,Ze)),r(14),S(t.relayIsEnabled()?-1:22))},dependencies:[ce,pe,ue,me,M,Ce,w,Fe,b,Ie],styles:["[_nghost-%COMP%]{height:100vh;width:100%;overflow:hidden}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1.25rem;gap:.75rem}h3[title][_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}div[sidenav][_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100vh}"],changeDetection:0})};export{J as default};
1
+ import{a as Le,b as Re}from"./chunk-JPMOGXHN.js";import{a as $e}from"./chunk-DG7SFNGT.js";import{a as x}from"./chunk-QRRKPBY6.js";import"./chunk-WZRDKVOR.js";import{a as fe}from"./chunk-ULLALJQ2.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import{a as Ie}from"./chunk-ELFZD53L.js";import{c as Pe,d as Oe,e as he,i as De,r as ke,s as Ne,t as Me}from"./chunk-NSIELNIY.js";import"./chunk-7QJG4IIT.js";import{b as de,d as Ee}from"./chunk-3ZVSHKLD.js";import{c as ce,e as pe,f as ue}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{C as Te,a as M,b as G,c as Se,e as ge,g as w,k as Fe,l as Ae,n as Ce,u as me}from"./chunk-Y5IRBMLB.js";import{h as H}from"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import{Ab as l,Eb as f,H as V,Hc as re,Ic as j,Kb as p,Lb as u,Mb as O,Mc as le,Oc as _e,Pb as R,Qa as r,Qb as g,Qc as Q,Rb as c,Z as A,Zb as ne,_b as oe,ab as N,bc as v,da as C,dc as $,ea as m,ec as F,fc as X,gc as K,jc as z,kc as W,lc as q,mc as ie,na as E,nc as se,oc as y,sb as d,sc as ae,tb as S,ub as Z,vb as ee,wb as te,xb as h,yb as s,zb as i}from"./chunk-BTMXQPBB.js";import{a as Y,b as B}from"./chunk-EUDKD2JW.js";var Ge=["scroller"];function we(n,o){n&1&&(s(0,"spk-icon"),F(1,"bell-ringing"),i())}function He(n,o){n&1&&(s(0,"spk-icon"),F(1,"bell"),i())}function xe(n,o){if(n&1&&l(0,"app-notification",8),n&2){c(2);let e=y(6);h("index",0)("notification",e.content)}}function Ue(n,o){if(n&1&&(s(0,"div",11),F(1),i()),n&2){c(3);let e=y(6);r(),K(" ",e.content.content," ")}}function Ye(n,o){if(n&1&&(s(0,"spk-alert")(1,"div",10),F(2),i(),d(3,Ue,2,1,"div",11),i()),n&2){c(2);let e=y(6);$(e.content.type||"error"),r(2),X(e.content.title),r(),S(e.content.content?3:-1)}}function Be(n,o){if(n&1&&(s(0,"div",6),d(1,xe,1,2,"app-notification",8)(2,Ye,4,4,"spk-alert",9),i()),n&2){c();let e=y(6);r(),S(e.type==="notification"?1:2)}}function Ve(n,o){if(n&1){let e=f();s(0,"div",7)(1,"div",12)(2,"h6",13),p(3,2),s(4,"button",5),g("click",function(){C(e);let a=c();return m(a.toggleNotifications())}),l(5,"spk-icon"),i(),u(),i(),s(6,"div",14,0)(8,"div",15),l(9,"app-notifications"),i()()()()}}function Xe(n,o){if(n&1&&(s(0,"div",20),F(1),i()),n&2){let e=c().$implicit;r(),K(" ",e.content," ")}}function Ke(n,o){if(n&1){let e=f();s(0,"spk-alert",18,1),g("click",function(){let a=C(e).$implicit,_=c(2);return m(_.deleteAlertByIndex(a.id))}),s(2,"div",19),F(3),i(),d(4,Xe,2,1,"div",20),i()}if(n&2){let e=o.$implicit;$(e.type),h("id",e.id),r(3),X(e.title),r(),S(e.content?4:-1)}}function ze(n,o){n&1&&(s(0,"p",17),O(1,4),i())}function We(n,o){if(n&1){let e=f();s(0,"div",7)(1,"div",12)(2,"h6",13),p(3,3),s(4,"button",5),g("click",function(){C(e);let a=c();return m(a.toggleAlerts())}),l(5,"spk-icon"),i(),u(),i(),s(6,"div",14,0)(8,"div",15),ee(9,Ke,5,5,"spk-alert",16,Z,!1,ze,2,0,"p",17),i()()()()}if(n&2){let e=c();r(9),te(e.alertHistory())}}var ye=new ke,b=class n{#e=A(Se);#t=A(x);isSubmitting=E(!1);messageSent=E(!1);form=ye.group({message:ye.control("",[Oe.required])});notifications=this.#t.notifications;shownMessage=E(null);shownMessageInterval=null;alertHistory=this.#e.alertHistory;alertHistoryIsOpen=this.#e.alertHistoryIsOpen;alertHistoryIsHidden=this.#e.alertHistoryIsHidden;numberOfOpenAlerts=re(()=>this.alertHistory().filter(o=>o.isOpen).length);scroller=_e("scroller");isAlertsOpen=Q(!1);isNotificationsOpen=Q(!1);previousHistoryCount=E(null);previousNotificationsCount=E(null);constructor(){j(()=>{let o=this.alertHistory(),e=this.notifications();if(e.length===0){this.shownMessage.set(null);return}e.length&&this.previousHistoryCount()!==o.length&&!this.isNotificationsOpen()?(this.shownMessage.set({content:e[0],countDown:3,type:"notification"}),this.previousHistoryCount.set(o.length),this.shownMessageInterval=setInterval(()=>{let t=this.shownMessage();if(t?.countDown===0){this.shownMessage.set(null),this.shownMessageInterval=null;return}t!==null&&this.shownMessage.update(a=>B(Y({},a),{countDown:a.countDown-1}))},1e3)):o.length&&this.previousHistoryCount()!==o.length&&!this.isAlertsOpen()&&(this.shownMessage.set({content:o[0],countDown:3,type:"alert"}),this.previousHistoryCount.set(o.length),this.shownMessageInterval=setInterval(()=>{let t=this.shownMessage();if(t?.countDown===0){this.shownMessage.set(null),this.shownMessageInterval=null;return}t!==null&&this.shownMessage.update(a=>B(Y({},a),{countDown:a.countDown-1}))},1e3))}),j(()=>{this.alertHistoryIsOpen(),this.scrollToBottom()})}resetPreviewMessage(){this.shownMessage.set(null),this.shownMessageInterval=null}toggleAlerts(){this.isAlertsOpen()?this.isAlertsOpen.set(!1):(this.isAlertsOpen.set(!0),this.isNotificationsOpen.set(!1),this.resetPreviewMessage())}toggleNotifications(){this.isNotificationsOpen.set(!this.isNotificationsOpen()),this.isAlertsOpen()&&this.isAlertsOpen.set(!1)}deleteAlertByIndex(o){this.#e.removeAlert(o)}scrollToBottom(){this.scroller()&&this.scroller()?.nativeElement&&this.scroller().nativeElement.scrollTo(0,this.scroller().nativeElement.scrollHeight)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=N({type:n,selectors:[["app-service-hub"]],viewQuery:function(e,t){e&1&&ne(t.scroller,Ge,5),e&2&&oe()},inputs:{isAlertsOpen:[1,"isAlertsOpen"],isNotificationsOpen:[1,"isNotificationsOpen"]},outputs:{isAlertsOpen:"isAlertsOpenChange",isNotificationsOpen:"isNotificationsOpenChange"},decls:10,vars:9,consts:()=>{let o;o=$localize` Notifications ${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"\uFFFD#5\uFFFD"}:START_TAG_SPK_ICON:x-circle${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_BUTTON:`;let e;e=$localize` Alerts ${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"\uFFFD#5\uFFFD"}:START_TAG_SPK_ICON:x-circle${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_BUTTON:`;let t;return t=$localize`No alerts yet`,[["scroller",""],["alerts",""],o,e,t,["spk-button","",3,"click"],[1,"preview-alert-wrap"],[1,"alert-stream-modal"],[3,"index","notification"],[3,"class"],["sparkle-alert-title",""],["sparkle-alert-content",""],[1,"alert-stream-modal-content"],[1,"paragraph-20"],[1,"alert-stream-modal-list-scroller"],[1,"alert-stream-modal-list"],[3,"class","id"],[1,"no-alerts"],[3,"click","id"],["title",""],["content",""]]},template:function(e,t){if(e&1){let a=f();s(0,"button",5),g("click",function(){return C(a),m(t.toggleAlerts())}),s(1,"spk-icon"),F(2,"info"),i()(),s(3,"button",5),g("click",function(){return C(a),m(t.toggleNotifications())}),d(4,we,2,0,"spk-icon")(5,He,2,0,"spk-icon"),i(),ie(6),d(7,Be,3,1,"div",6),d(8,Ve,10,0,"div",7),d(9,We,12,1,"div",7)}if(e&2){$(t.alertHistory().length?"error":""),r(3),$(t.notifications().length?"error":""),r(),S(t.notifications().length?4:5),r(2);let a=se(t.shownMessage());r(),S(a?7:-1),r(),S(t.isNotificationsOpen()?8:-1),r(),S(t.isAlertsOpen()?9:-1)}},dependencies:[Me,G,M,w,Re,Le],styles:["[_nghost-%COMP%]{display:flex;position:fixed;gap:.5rem;bottom:1.5rem;right:1.5rem;z-index:5000}@media only screen and (max-width: 768px){[_nghost-%COMP%]{bottom:1rem;right:1rem}}[_nghost-%COMP%] h6[_ngcontent-%COMP%]{margin:0}.preview-alert-wrap[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column;min-width:15.625rem}.helpdesk-modal[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column}@media only screen and (max-width: 768px){.helpdesk-modal[_ngcontent-%COMP%]{bottom:2.6875rem}}.helpdesk-modal-content[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;gap:1rem;min-width:20rem;border:1px solid var(--base-4);background-color:var(--base-1);border-radius:var(--shape-2)}.helpdesk-modal-content[_ngcontent-%COMP%] .message-sent[_ngcontent-%COMP%]{padding:0 1rem 1rem;text-wrap:pretty}.helpdesk-modal-content[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid var(--base-4);display:flex;align-items:center;justify-content:space-between}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{padding:0 1rem 1rem;display:flex;flex-direction:column;align-items:flex-end;gap:1rem}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{width:100%;text-wrap:pretty}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{width:100%}.alert-stream-modal[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column}@media only screen and (max-width: 768px){.alert-stream-modal[_ngcontent-%COMP%]{bottom:2.6875rem}}.alert-stream-modal-list-scroller[_ngcontent-%COMP%]{overflow-y:auto;max-height:18.75rem}.alert-stream-modal-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:1rem;border-radius:var(--shape-2)}.alert-stream-modal-content[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;min-width:20rem;border:1px solid var(--base-4);background-color:var(--base-1);border-radius:var(--shape-2)}.alert-stream-modal-content[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid var(--base-4);display:flex;align-items:center;justify-content:space-between}.no-alerts[_ngcontent-%COMP%]{padding:1rem;display:flex;flex-direction:column;gap:1rem;text-align:center}"],changeDetection:0})};function qe(n,o){n&1&&(s(0,"spk-icon",14),F(1,"check"),i())}function je(n,o){n&1&&(s(0,"spk-icon",15),F(1,"prohibit"),i())}function Qe(n,o){if(n&1){let e=f();s(0,"button",20),g("click",function(){C(e);let a=c();return m(a.updatePassphrase())}),O(1,5),i()}if(n&2){let e=c();v("loader",e.isUpdating())}}function Je(n,o){if(n&1){let e=f();s(0,"button",21),g("click",function(){C(e);let a=c();return m(a.updatePassphrase())}),O(1,6),i()}if(n&2){let e=c();v("loader",e.isUpdating()),h("disabled",!0)}}var U=class n{#e=A(H);closed=le();isUpdating=E(!1);passphrase=E("");repeatPassphrase=E("");updatePassphrase(){this.passphrase()===this.repeatPassphrase()&&(this.isUpdating.set(!0),this.#e.patchApiV1Serversettings({requestBody:{"server-passphrase":this.passphrase()}}).pipe(V(()=>this.isUpdating.set(!1))).subscribe({next:()=>this.closed.emit()}))}cancel(){this.isUpdating.set(!0),this.#e.patchApiV1Serversettings({requestBody:{"has-asked-for-password-change":"True"}}).pipe(V(()=>this.isUpdating.set(!1))).subscribe({next:()=>this.closed.emit()})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=N({type:n,selectors:[["app-change-passphrase-alert-dialog"]],outputs:{closed:"closed"},decls:23,vars:7,consts:()=>{let o;o=$localize`Enter new password`;let e;e=$localize`Repeat password`;let t;t=$localize`Password have to be filled and have to match`;let a;a=$localize`Change passphrase`;let _;_=$localize` Duplicati needs to be secured with a passphrase and a random passphrase has been generated for you. ${"[\uFFFD#6\uFFFD\uFFFD/#6\uFFFD|\uFFFD#7\uFFFD\uFFFD/#7\uFFFD]"}:LINE_BREAK:${"[\uFFFD#6\uFFFD\uFFFD/#6\uFFFD|\uFFFD#7\uFFFD\uFFFD/#7\uFFFD]"}:LINE_BREAK: If you open Duplicati from the tray icon, you do not need a passphrase, but if you plan to open it from another location you need to set a passphrase you know. Do you want to set a passphrase now? `,_=R(_);let D;D=$localize`Passphrase`;let k;k=$localize`Repeat passphrase`;let I;I=$localize`Not now thanks`;let L;L=$localize` Yes, update passphrase now `;let T;return T=$localize` Yes, update passphrase now `,[a,_,D,k,I,L,T,["header",""],["content",""],["type","warning"],["for","password"],["type","password","name","password","autocomplete","disabled","placeholder",o,"tabindex","1",3,"ngModelChange","ngModel"],["for","repeatPassword"],["type","password","name","repeatPassword","autocomplete","disabled","placeholder",e,"tabindex","2",3,"ngModelChange","disabled","ngModel"],["suffix","",1,"spk-success"],["suffix",""],["footer",""],["spk-button","",3,"click"],["spk-button","",1,"raised","primary",3,"loader"],["spk-button","","spkTooltip",t,1,"raised","primary",3,"loader","disabled"],["spk-button","",1,"raised","primary",3,"click"],["spk-button","","spkTooltip",t,1,"raised","primary",3,"click","disabled"]]},template:function(e,t){e&1&&(s(0,"header",7)(1,"h3"),O(2,0),i()(),s(3,"div",8)(4,"spk-alert",9),p(5,1),l(6,"br")(7,"br"),u(),i(),s(8,"spk-form-field")(9,"label",10),O(10,2),i(),s(11,"input",11),q("ngModelChange",function(_){return W(t.passphrase,_)||(t.passphrase=_),_}),i()(),s(12,"spk-form-field")(13,"label",12),O(14,3),i(),s(15,"input",13),q("ngModelChange",function(_){return W(t.repeatPassphrase,_)||(t.repeatPassphrase=_),_}),i(),d(16,qe,2,0,"spk-icon",14)(17,je,2,0,"spk-icon",15),i()(),s(18,"footer",16)(19,"button",17),g("click",function(){return t.cancel()}),O(20,4),i(),d(21,Qe,2,2,"button",18)(22,Je,2,3,"button",19),i()),e&2&&(r(11),z("ngModel",t.passphrase),r(4),h("disabled",t.passphrase().length===0),z("ngModel",t.repeatPassphrase),r(),S(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?16:17),r(3),v("loader",t.isUpdating()),r(2),S(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?21:22))},dependencies:[Ne,Pe,he,De,G,Ae,M,Te],styles:["[_nghost-%COMP%]{display:block;--dialog-p: 1.5rem}[content][_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}"],changeDetection:0})};var Ze=()=>({exact:!0});function et(n,o){n&1&&(s(0,"spk-icon"),F(1,"sun"),i())}function tt(n,o){n&1&&(s(0,"spk-icon"),F(1,"moon"),i())}function nt(n,o){if(n&1){let e=f();s(0,"button",22),g("click",function(){C(e);let a=c();return m(a.changeDefaultClientTo("ngax"))}),p(1,7),l(2,"spk-icon"),u(),i(),s(3,"button",22),g("click",function(){C(e);let a=c();return m(a.logout())}),p(4,8),l(5,"spk-icon"),u(),i()}}var J=class n{#e=A($e);#t=A(H);#n=A(fe);#o=A(de);#i=A(ge);#s=A(x);#a=A(Ee);relayIsEnabled=this.#o.relayIsEnabled;isDarkMode=this.#e.isDarkMode;ngOnInit(){return this.#s.init(),this.#n.getBackups(!0),this.#t.getApiV1Serversettings().subscribe({next:o=>{let e=o["autogenerated-passphrase"]==="True",t=o["has-asked-for-password-change"]==="True";e&&!t&&this.#i.open(U,{maxWidth:"500px"})}})}toggleBodyClass(){this.#e.toggleBodyClass()}changeDefaultClientTo(o){this.#r(o),window.location.replace(`/${o}`)}logout(){this.#a.logout()}#r(o){var e=new Date;e.setTime(e.getTime()+90*24*60*60*1e3),document.cookie="default-client="+o+"; expires="+e.toUTCString()+"; path=/"}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=N({type:n,selectors:[["app-layout"]],decls:37,vars:4,consts:()=>{let o;o=$localize`${"\uFFFD#10\uFFFD"}:START_TAG_SPK_ICON:house${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_SPK_ICON: Home `;let e;e=$localize`${"\uFFFD#13\uFFFD"}:START_TAG_SPK_ICON:database${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SPK_ICON: Add backup `;let t;t=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SPK_ICON:clock-counter-clockwise${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SPK_ICON: Restore `;let a;a=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SPK_ICON:gear${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SPK_ICON: Settings `;let _;_=$localize`${"\uFFFD#26\uFFFD"}:START_TAG_SPK_ICON:info${"\uFFFD/#26\uFFFD"}:CLOSE_TAG_SPK_ICON: About Duplicati `;let D;D=$localize`${"\uFFFD#29\uFFFD"}:START_TAG_SPK_ICON:files${"[\uFFFD/#29\uFFFD|\uFFFD/#30\uFFFD]"}:CLOSE_TAG_SPK_ICON: Documentation ${"\uFFFD#30\uFFFD"}:START_TAG_SPK_ICON_1:arrow-square-out${"[\uFFFD/#29\uFFFD|\uFFFD/#30\uFFFD]"}:CLOSE_TAG_SPK_ICON:`,D=R(D);let k;k=$localize`${"\uFFFD#33\uFFFD"}:START_TAG_SPK_ICON:chats-circle${"[\uFFFD/#33\uFFFD|\uFFFD/#34\uFFFD]"}:CLOSE_TAG_SPK_ICON: Visit forum ${"\uFFFD#34\uFFFD"}:START_TAG_SPK_ICON_1:arrow-square-out${"[\uFFFD/#33\uFFFD|\uFFFD/#34\uFFFD]"}:CLOSE_TAG_SPK_ICON:`,k=R(k);let I;I=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:skip-back${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: Use old UI `;let L;return L=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_ICON:sign-out${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_ICON: Log out `,[o,e,t,a,_,D,k,I,L,["sidenav",""],["spk-button","",1,"icon","small",3,"click"],[1,"base-1","primary"],["action","","routerLink","/","routerLinkActive","active",3,"routerLinkActiveOptions"],["action","","routerLink","/add-backup","routerLinkActive","active"],["action","","routerLink","/restore","routerLinkActive","active"],["action","","routerLink","/settings","routerLinkActive","active"],[1,"spacer"],[1,"base-1l","primary"],["action","","routerLink","/about","routerLinkActive","active"],["href","https://docs.duplicati.com","target","_blank","action",""],["suffix",""],["href","https://forum.duplicati.com","target","_blank","action",""],["action","",3,"click"]]},template:function(e,t){e&1&&(s(0,"spk-sidenav")(1,"div",9)(2,"header"),l(3,"app-logo"),s(4,"button",10),g("click",function(){return t.toggleBodyClass()}),d(5,et,2,0,"spk-icon")(6,tt,2,0,"spk-icon"),i()(),s(7,"spk-list",11)(8,"button",12),p(9,0),l(10,"spk-icon"),u(),i(),s(11,"button",13),p(12,1),l(13,"spk-icon"),u(),i(),s(14,"button",14),p(15,2),l(16,"spk-icon"),u(),i(),s(17,"button",15),p(18,3),l(19,"spk-icon"),u(),i()(),l(20,"div",16),s(21,"spk-list",17),d(22,nt,6,0),l(23,"spk-divider"),s(24,"button",18),p(25,4),l(26,"spk-icon"),u(),i(),s(27,"a",19),p(28,5),l(29,"spk-icon")(30,"spk-icon",20),u(),i(),s(31,"a",21),p(32,6),l(33,"spk-icon")(34,"spk-icon",20),u(),i()()(),l(35,"router-outlet")(36,"app-service-hub"),i()),e&2&&(r(5),S(t.isDarkMode()?5:6),r(3),h("routerLinkActiveOptions",ae(3,Ze)),r(14),S(t.relayIsEnabled()?-1:22))},dependencies:[ce,pe,ue,me,M,Ce,w,Fe,b,Ie],styles:["[_nghost-%COMP%]{height:100vh;width:100%;overflow:hidden}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1.25rem;gap:.75rem}h3[title][_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}div[sidenav][_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100vh}"],changeDetection:0})};export{J as default};
@@ -0,0 +1 @@
1
+ import"./chunk-EUDKD2JW.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-AC7QC7PU.js")},{path:"destination",loadComponent:()=>import("./chunk-FJ62TYXT.js")},{path:"source-data",loadComponent:()=>import("./chunk-52KRFMSD.js")},{path:"schedule",loadComponent:()=>import("./chunk-2ULYPLGO.js")},{path:"options",loadComponent:()=>import("./chunk-MQI6JU7H.js")}];export{o as default};
@@ -1 +1 @@
1
- import{a as mt,b as It,c as Nt}from"./chunk-H52UO57S.js";import"./chunk-X7SFNRJF.js";import"./chunk-2G6TVFPZ.js";import{a as St}from"./chunk-V6EWWEIG.js";import{h as Ct}from"./chunk-HRSZZWTB.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-B26UYXA3.js";import"./chunk-LDIZ5E5Z.js";import{a as E}from"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import{c as ct,e as ut,f as _t,g as Tt,i as pt,j as gt,r as Dt,s as dt}from"./chunk-NSIELNIY.js";import{b as nt,d as it}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{a as ot,b as at,d as st,e as Ft,l as rt,o as lt}from"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import{Ab as p,Bb as b,Cb as U,Eb as C,Hc as L,Kb as _,Lb as T,Mb as O,Nb as A,Ob as $,Oc as et,Pb as w,Qa as r,Qb as D,Rb as l,Z as m,Zb as Y,_b as q,ab as Q,bc as J,da as c,ea as u,ec as k,fc as G,gc as Z,ha as H,jc as P,kc as M,lc as y,na as I,sb as d,sc as tt,tb as S,ub as x,vb as B,wb as R,xb as N,yb as s,zb as F}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";var Et=["formRef"],ft=()=>({maxWidth:"700px",width:"100%"});function kt(i,o){if(i&1){let t=C();_(0,2,1),s(1,"button",30),D("click",function(){c(t);let e=l();return u(e.testDestination(0,!0))}),F(),T()}if(i&2){let t=l();r(),J("loader",t.testSignal()=="testing"),N("disabled",t.testSignal()=="testing")}}function Ot(i,o){if(i&1){let t=C();_(0,2,2),s(1,"button",20),D("click",function(){c(t);let e=l();return u(e.copyTargetUrl())}),p(2,"spk-icon"),F(),T()}}function At(i,o){i&1&&(s(0,"spk-alert"),_(1,5),p(2,"spk-icon",31),T(),F())}function $t(i,o){i&1&&(s(0,"spk-alert",21),_(1,6),p(2,"spk-icon",31),T(),F())}function Pt(i,o){if(i&1&&(s(0,"spk-alert",22),_(1,7),p(2,"spk-icon",31),T(),F()),i&2){let t=l();r(2),A(t.testErrorMessage()),$(1)}}function Mt(i,o){if(i&1&&(s(0,"spk-alert",23),_(1,8),p(2,"spk-icon",31),T(),F()),i&2){let t=l();r(2),A(t.testErrorMessage()),$(1)}}function yt(i,o){if(i&1){let t=C();s(0,"p",32),D("click",function(){c(t);let e=l();return u(e.removeDestination())}),_(1,9),p(2,"strong")(3,"br")(4,"span",33),T(),F()}if(i&2){let t,n=l();r(4),A((t=n.selectedDestinationType())==null?null:t.displayName),$(1)}}function ht(i,o){if(i&1){let t=C();s(0,"div",39),D("click",function(){let e=c(t).$implicit,a=l(2);return u(a.setDestination(e.key))}),s(1,"h3"),k(2),F(),s(3,"p"),k(4),F()()}if(i&2){let t=o.$implicit;r(2),G(t.displayName),r(2),G(t.description)}}function xt(i,o){if(i&1){let t=C();s(0,"button",40,1),D("click",function(){let e=c(t).$implicit,a=l(2);return u(a.setDestination(e.key))}),k(2),F()}if(i&2){let t=o.$implicit;r(2),Z(" ",t.displayName," ")}}function Bt(i,o){if(i&1&&(s(0,"div",34),B(1,ht,5,2,"div",35,x),F(),s(3,"spk-menu",36)(4,"button",37),O(5,10),F(),b(6,19),B(7,xt,3,1,"button",38,x),U(),F()),i&2){let t=l();r(),R(t.destinationTypeOptionsFocused()),r(2),N("searchable",!0),r(4),R(t.destinationTypeOptions())}}function Rt(i,o){if(i&1){let t=C();s(0,"app-single-destination",41),y("targetUrlChange",function(e){c(t);let a=l();return M(a.targetUrlModel,e)||(a.targetUrlModel=e),u(e)}),F()}if(i&2){let t=l();P("targetUrl",t.targetUrlModel),N("useBackupState",!0)}}function bt(i,o){i&1&&(_(0,4,1),p(1,"spk-icon",28),T())}function Ut(i,o){i&1&&(_(0,4,2),p(1,"spk-icon"),T())}function wt(i,o){if(i&1){let t=C();s(0,"spk-dialog",42),y("isOpenChange",function(e){c(t);let a=l();return M(a.targetUrlDialogOpen,e)||(a.targetUrlDialogOpen=e),u(e)}),s(1,"header",43)(2,"h2"),O(3,11),F(),s(4,"spk-alert",22),O(5,12),F()(),s(6,"div",44)(7,"spk-form-field")(8,"textarea",45),y("ngModelChange",function(e){c(t);let a=l();return M(a.targetUrlCtrl,e)||(a.targetUrlCtrl=e),u(e)}),F()()(),s(9,"footer",46)(10,"button",26),D("click",function(){c(t);let e=l();return u(e.closeTargetUrlDialog(!1))}),k(11,"Cancel"),F(),s(12,"button",47),D("click",function(){c(t);let e=l();return u(e.closeTargetUrlDialog(!0))}),_(13,13),p(14,"spk-icon"),T(),F()()()}if(i&2){let t=l();P("isOpen",t.targetUrlDialogOpen),N("options",tt(3,ft)),r(8),P("ngModel",t.targetUrlCtrl)}}var h=new Dt,ne=(i={destinations:[]})=>h.group({destinations:h.array(i.destinations)}),ie=({key:i,customGroup:o,dynamicGroup:t,advancedGroup:n})=>h.group({destinationType:h.control(i),custom:o,dynamic:t,advanced:n}),v=class i{#i=m(it);#o=m(nt);#t=m(Ct);#a=m(It);#e=m(Ft);#s=m(mt);injector=m(H);formRef=et.required("formRef");targetUrlModel=this.#t.targetUrlModel;targetUrlCtrl=I(null);targetUrlInitial=I(null);targetUrlDialogOpen=I(!1);toggleNewDestination=I(!0);destinationTypeOptionsInFocus=I(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#a.destinationTypeOptions;testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;destinationTypeOptionsFocused=L(()=>{let o=this.destinationTypeOptionsInFocus(),t=this.destinationTypeOptions();return o.map(n=>t.find(e=>e.key===n))});selectedDestinationType=L(()=>{let o=this.targetUrlModel();if(!o)return null;let t=o.split("://")[0];return St(t)??null});copyTargetUrl(){navigator.clipboard.writeText(this.targetUrlModel()??"")}openTargetUrlDialog(){let o=this.targetUrlModel();this.targetUrlCtrl.set(o),this.targetUrlInitial.set(o),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(o=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),n=this.targetUrlInitial();!o||t===n||!t||this.#t.setTargetUrl(t)}testDestination(o,t,n){let e=this.targetUrlModel();e&&(this.#t.setTestState("testing"),this.#s.testDestination(e,o,!0,!0).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),this.#t.isNew()&&(a.containsBackup===!0?(this.#t.setTestState("warning",$localize`The remote destination already contains a backup. Please use a different folder for each backup.`),t||this.#e.open(E,{data:{title:$localize`Folder contains backup`,message:$localize`The remote destination already contains a backup. You must use a different folder for each backup.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!0&&(this.#t.setTestState("warning",$localize`The remote destination contains unknown files.`),t||this.#e.open(E,{data:{title:$localize`Folder is not empty`,message:$localize`The remote destination is not empty. It is recommended to use an empty folder for the backup.`,confirmText:$localize`OK`,cancelText:void 0}}))),n?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){n?.();return}let f=e.includes("?");a.action==="trust-cert"&&this.#t.setTargetUrl(e+`${f?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.setTargetUrl(e+`${f?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):n?.()}}))}setDestination(o){this.#t.setTargetUrl(`${o}://`)}removeDestination(){this.#t.setTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let o=this.#t.isNew(),t=this.testSignal();if(!o){this.#n();return}if(t===""){this.#e.open(E,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:n=>{n?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open(E,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(t!=="success"){this.#e.open(E,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:n=>{n&&this.#n()}});return}this.#n()}#n(){this.#t.isNew()||this.#t.submit(!0),this.#i.navigate(["source-data"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=Q({type:i,selectors:[["app-destination"]],viewQuery:function(t,n){t&1&&Y(n.formRef,Et,5),t&2&&q()},decls:30,vars:9,consts:()=>{let o;o=$localize` Backup destination ${"\uFFFD#5\uFFFD"}:START_TAG_DIV:${"[\uFFFD*6:1\uFFFD|\uFFFD*13:2\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON: Test destination ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*6:1\uFFFD|\uFFFD/*13:2\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD#7\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SPK_ICON:dots-three-vertical${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#10\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD#11\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SPK_ICON:link${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD*6:1\uFFFD|\uFFFD*13:2\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:2\uFFFD"}:START_TAG_BUTTON_3:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SPK_ICON:copy${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copy url to clipboard ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*6:1\uFFFD|\uFFFD/*13:2\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SPK_MENU:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_DIV:`,o=w(o);let t;t=$localize`${"\uFFFD#24\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#24\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let n;n=$localize`${"\uFFFD*27:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SPK_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"\uFFFD/*27:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*28:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SPK_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"\uFFFD/*28:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,n=w(n);let e;e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: Testing connection... `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: Connection tested successfully. `;let f;f=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let K;K=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let V;V=$localize` Current destination type ${"\uFFFD#2\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:.${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#3\uFFFD\uFFFD/#3\uFFFD"}:LINE_BREAK: Want to select another? ${"\uFFFD#4\uFFFD"}:START_TAG_SPAN:Click here${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SPAN:`;let z;z=$localize`All destinations`;let X;X=$localize`Edit target URL`;let W;W=$localize`Be careful, this will overwrite everything you have in your destination.`;let j;return j=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SPK_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],["option",""],o,t,n,e,a,f,K,V,z,X,W,j,[3,"submit"],[1,"title-30"],[1,"actions"],["spk-button","","type","button",1,"small",3,"loader","disabled"],["spk-button","","type","button",1,"small"],["menu",""],["spk-button","","type","button",1,"small",3,"click"],[1,"success"],[1,"warn"],[1,"error"],[3,"targetUrl","useBackupState"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["spk-button","","type","button",1,"small",3,"click","disabled"],["icon",""],[3,"click"],[1,"spk-primary"],[1,"most-common-destinations"],[1,"tile"],[3,"searchable"],["spk-button","","type","button",1,"outlined"],["type","button"],[1,"tile",3,"click"],["type","button",3,"click"],[3,"targetUrlChange","targetUrl","useBackupState"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["spk-button","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,n){if(t&1){let e=C();s(0,"form",14,0),D("submit",function(){return c(e),u(n.next())}),s(2,"header")(3,"h3",15),_(4,2),s(5,"div",16),d(6,kt,2,3,"button",17),s(7,"spk-menu")(8,"button",18),p(9,"spk-icon"),F(),b(10,19),s(11,"button",20),D("click",function(){return c(e),u(n.openTargetUrlDialog())}),p(12,"spk-icon"),F(),d(13,Ot,3,0,"button",18),U(),F()(),T(),F(),d(14,At,3,0,"spk-alert")(15,$t,3,0,"spk-alert",21)(16,Pt,3,1,"spk-alert",22)(17,Mt,3,1,"spk-alert",23),d(18,yt,5,1,"p"),F(),d(19,Bt,9,1),d(20,Rt,1,2,"app-single-destination",24),s(21,"div",25)(22,"button",26),D("click",function(){return c(e),u(n.goBack())}),_(23,3),p(24,"spk-icon"),T(),F(),s(25,"button",27),_(26,4),d(27,bt,2,0,"spk-icon",28)(28,Ut,2,0,"spk-icon"),T(),F()()(),d(29,wt,15,4,"spk-dialog",29)}if(t&2){let e=!!n.targetUrlModel();r(6),S(e?6:-1),r(7),S(e?13:-1),r(),S(n.testSignal()=="testing"?14:n.testSignal()=="success"?15:n.testSignal()=="warning"?16:n.testSignal()=="error"?17:-1),r(4),S(e?18:-1),r(),S(e?-1:19),r(),S(e?20:-1),r(5),N("disabled",n.testSignal()=="testing"||!e),r(2),S(n.testSignal()=="testing"?27:28),r(2),S(n.targetUrlDialogOpen()?29:-1)}},dependencies:[Nt,dt,gt,ct,ut,_t,pt,Tt,rt,lt,ot,st,at],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] spk-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}"],changeDetection:0})};export{ne as createDestinationForm,ie as createDestinationFormGroup,v as default};
1
+ import{a as mt,b as It,c as Nt}from"./chunk-CDXBWYCI.js";import"./chunk-X7SFNRJF.js";import"./chunk-2G6TVFPZ.js";import{a as St}from"./chunk-AH5TLYN4.js";import{h as Ct}from"./chunk-ZAFFTZSE.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-B26UYXA3.js";import"./chunk-LDIZ5E5Z.js";import{a as E}from"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import{c as ct,e as ut,f as _t,g as Tt,i as pt,j as gt,r as Dt,s as dt}from"./chunk-NSIELNIY.js";import{b as nt,d as it}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{a as ot,b as at,d as st,e as Ft,l as rt,o as lt}from"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import{Ab as p,Bb as b,Cb as U,Eb as C,Hc as L,Kb as _,Lb as T,Mb as O,Nb as A,Ob as $,Oc as et,Pb as w,Qa as r,Qb as D,Rb as l,Z as m,Zb as Y,_b as q,ab as Q,bc as J,da as c,ea as u,ec as k,fc as G,gc as Z,ha as H,jc as P,kc as M,lc as y,na as I,sb as d,sc as tt,tb as S,ub as x,vb as B,wb as R,xb as N,yb as s,zb as F}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";var Et=["formRef"],ft=()=>({maxWidth:"700px",width:"100%"});function kt(i,o){if(i&1){let t=C();_(0,2,1),s(1,"button",30),D("click",function(){c(t);let e=l();return u(e.testDestination(0,!0))}),F(),T()}if(i&2){let t=l();r(),J("loader",t.testSignal()=="testing"),N("disabled",t.testSignal()=="testing")}}function Ot(i,o){if(i&1){let t=C();_(0,2,2),s(1,"button",20),D("click",function(){c(t);let e=l();return u(e.copyTargetUrl())}),p(2,"spk-icon"),F(),T()}}function At(i,o){i&1&&(s(0,"spk-alert"),_(1,5),p(2,"spk-icon",31),T(),F())}function $t(i,o){i&1&&(s(0,"spk-alert",21),_(1,6),p(2,"spk-icon",31),T(),F())}function Pt(i,o){if(i&1&&(s(0,"spk-alert",22),_(1,7),p(2,"spk-icon",31),T(),F()),i&2){let t=l();r(2),A(t.testErrorMessage()),$(1)}}function Mt(i,o){if(i&1&&(s(0,"spk-alert",23),_(1,8),p(2,"spk-icon",31),T(),F()),i&2){let t=l();r(2),A(t.testErrorMessage()),$(1)}}function yt(i,o){if(i&1){let t=C();s(0,"p",32),D("click",function(){c(t);let e=l();return u(e.removeDestination())}),_(1,9),p(2,"strong")(3,"br")(4,"span",33),T(),F()}if(i&2){let t,n=l();r(4),A((t=n.selectedDestinationType())==null?null:t.displayName),$(1)}}function ht(i,o){if(i&1){let t=C();s(0,"div",39),D("click",function(){let e=c(t).$implicit,a=l(2);return u(a.setDestination(e.key))}),s(1,"h3"),k(2),F(),s(3,"p"),k(4),F()()}if(i&2){let t=o.$implicit;r(2),G(t.displayName),r(2),G(t.description)}}function xt(i,o){if(i&1){let t=C();s(0,"button",40,1),D("click",function(){let e=c(t).$implicit,a=l(2);return u(a.setDestination(e.key))}),k(2),F()}if(i&2){let t=o.$implicit;r(2),Z(" ",t.displayName," ")}}function Bt(i,o){if(i&1&&(s(0,"div",34),B(1,ht,5,2,"div",35,x),F(),s(3,"spk-menu",36)(4,"button",37),O(5,10),F(),b(6,19),B(7,xt,3,1,"button",38,x),U(),F()),i&2){let t=l();r(),R(t.destinationTypeOptionsFocused()),r(2),N("searchable",!0),r(4),R(t.destinationTypeOptions())}}function Rt(i,o){if(i&1){let t=C();s(0,"app-single-destination",41),y("targetUrlChange",function(e){c(t);let a=l();return M(a.targetUrlModel,e)||(a.targetUrlModel=e),u(e)}),F()}if(i&2){let t=l();P("targetUrl",t.targetUrlModel),N("useBackupState",!0)}}function bt(i,o){i&1&&(_(0,4,1),p(1,"spk-icon",28),T())}function Ut(i,o){i&1&&(_(0,4,2),p(1,"spk-icon"),T())}function wt(i,o){if(i&1){let t=C();s(0,"spk-dialog",42),y("isOpenChange",function(e){c(t);let a=l();return M(a.targetUrlDialogOpen,e)||(a.targetUrlDialogOpen=e),u(e)}),s(1,"header",43)(2,"h2"),O(3,11),F(),s(4,"spk-alert",22),O(5,12),F()(),s(6,"div",44)(7,"spk-form-field")(8,"textarea",45),y("ngModelChange",function(e){c(t);let a=l();return M(a.targetUrlCtrl,e)||(a.targetUrlCtrl=e),u(e)}),F()()(),s(9,"footer",46)(10,"button",26),D("click",function(){c(t);let e=l();return u(e.closeTargetUrlDialog(!1))}),k(11,"Cancel"),F(),s(12,"button",47),D("click",function(){c(t);let e=l();return u(e.closeTargetUrlDialog(!0))}),_(13,13),p(14,"spk-icon"),T(),F()()()}if(i&2){let t=l();P("isOpen",t.targetUrlDialogOpen),N("options",tt(3,ft)),r(8),P("ngModel",t.targetUrlCtrl)}}var h=new Dt,ne=(i={destinations:[]})=>h.group({destinations:h.array(i.destinations)}),ie=({key:i,customGroup:o,dynamicGroup:t,advancedGroup:n})=>h.group({destinationType:h.control(i),custom:o,dynamic:t,advanced:n}),v=class i{#i=m(it);#o=m(nt);#t=m(Ct);#a=m(It);#e=m(Ft);#s=m(mt);injector=m(H);formRef=et.required("formRef");targetUrlModel=this.#t.targetUrlModel;targetUrlCtrl=I(null);targetUrlInitial=I(null);targetUrlDialogOpen=I(!1);toggleNewDestination=I(!0);destinationTypeOptionsInFocus=I(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#a.destinationTypeOptions;testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;destinationTypeOptionsFocused=L(()=>{let o=this.destinationTypeOptionsInFocus(),t=this.destinationTypeOptions();return o.map(n=>t.find(e=>e.key===n))});selectedDestinationType=L(()=>{let o=this.targetUrlModel();if(!o)return null;let t=o.split("://")[0];return St(t)??null});copyTargetUrl(){navigator.clipboard.writeText(this.targetUrlModel()??"")}openTargetUrlDialog(){let o=this.targetUrlModel();this.targetUrlCtrl.set(o),this.targetUrlInitial.set(o),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(o=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),n=this.targetUrlInitial();!o||t===n||!t||this.#t.setTargetUrl(t)}testDestination(o,t,n){let e=this.targetUrlModel();e&&(this.#t.setTestState("testing"),this.#s.testDestination(e,o,!0,!0).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),this.#t.isNew()&&(a.containsBackup===!0?(this.#t.setTestState("warning",$localize`The remote destination already contains a backup. Please use a different folder for each backup.`),t||this.#e.open(E,{data:{title:$localize`Folder contains backup`,message:$localize`The remote destination already contains a backup. You must use a different folder for each backup.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!0&&(this.#t.setTestState("warning",$localize`The remote destination contains unknown files.`),t||this.#e.open(E,{data:{title:$localize`Folder is not empty`,message:$localize`The remote destination is not empty. It is recommended to use an empty folder for the backup.`,confirmText:$localize`OK`,cancelText:void 0}}))),n?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){n?.();return}let f=e.includes("?");a.action==="trust-cert"&&this.#t.setTargetUrl(e+`${f?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.setTargetUrl(e+`${f?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):n?.()}}))}setDestination(o){this.#t.setTargetUrl(`${o}://`)}removeDestination(){this.#t.setTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let o=this.#t.isNew(),t=this.testSignal();if(!o){this.#n();return}if(t===""){this.#e.open(E,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:n=>{n?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open(E,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(t!=="success"){this.#e.open(E,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:n=>{n&&this.#n()}});return}this.#n()}#n(){this.#t.isNew()||this.#t.submit(!0),this.#i.navigate(["source-data"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=Q({type:i,selectors:[["app-destination"]],viewQuery:function(t,n){t&1&&Y(n.formRef,Et,5),t&2&&q()},decls:30,vars:9,consts:()=>{let o;o=$localize` Backup destination ${"\uFFFD#5\uFFFD"}:START_TAG_DIV:${"[\uFFFD*6:1\uFFFD|\uFFFD*13:2\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON: Test destination ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*6:1\uFFFD|\uFFFD/*13:2\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD#7\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SPK_ICON:dots-three-vertical${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#10\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD#11\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SPK_ICON:link${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD*6:1\uFFFD|\uFFFD*13:2\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:2\uFFFD"}:START_TAG_BUTTON_3:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SPK_ICON:copy${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copy url to clipboard ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*6:1\uFFFD|\uFFFD/*13:2\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SPK_MENU:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_DIV:`,o=w(o);let t;t=$localize`${"\uFFFD#24\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#24\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let n;n=$localize`${"\uFFFD*27:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SPK_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"\uFFFD/*27:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*28:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SPK_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"\uFFFD/*28:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,n=w(n);let e;e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: Testing connection... `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: Connection tested successfully. `;let f;f=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let K;K=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let V;V=$localize` Current destination type ${"\uFFFD#2\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:.${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#3\uFFFD\uFFFD/#3\uFFFD"}:LINE_BREAK: Want to select another? ${"\uFFFD#4\uFFFD"}:START_TAG_SPAN:Click here${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SPAN:`;let z;z=$localize`All destinations`;let X;X=$localize`Edit target URL`;let W;W=$localize`Be careful, this will overwrite everything you have in your destination.`;let j;return j=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SPK_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],["option",""],o,t,n,e,a,f,K,V,z,X,W,j,[3,"submit"],[1,"title-30"],[1,"actions"],["spk-button","","type","button",1,"small",3,"loader","disabled"],["spk-button","","type","button",1,"small"],["menu",""],["spk-button","","type","button",1,"small",3,"click"],[1,"success"],[1,"warn"],[1,"error"],[3,"targetUrl","useBackupState"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["spk-button","","type","button",1,"small",3,"click","disabled"],["icon",""],[3,"click"],[1,"spk-primary"],[1,"most-common-destinations"],[1,"tile"],[3,"searchable"],["spk-button","","type","button",1,"outlined"],["type","button"],[1,"tile",3,"click"],["type","button",3,"click"],[3,"targetUrlChange","targetUrl","useBackupState"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["spk-button","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,n){if(t&1){let e=C();s(0,"form",14,0),D("submit",function(){return c(e),u(n.next())}),s(2,"header")(3,"h3",15),_(4,2),s(5,"div",16),d(6,kt,2,3,"button",17),s(7,"spk-menu")(8,"button",18),p(9,"spk-icon"),F(),b(10,19),s(11,"button",20),D("click",function(){return c(e),u(n.openTargetUrlDialog())}),p(12,"spk-icon"),F(),d(13,Ot,3,0,"button",18),U(),F()(),T(),F(),d(14,At,3,0,"spk-alert")(15,$t,3,0,"spk-alert",21)(16,Pt,3,1,"spk-alert",22)(17,Mt,3,1,"spk-alert",23),d(18,yt,5,1,"p"),F(),d(19,Bt,9,1),d(20,Rt,1,2,"app-single-destination",24),s(21,"div",25)(22,"button",26),D("click",function(){return c(e),u(n.goBack())}),_(23,3),p(24,"spk-icon"),T(),F(),s(25,"button",27),_(26,4),d(27,bt,2,0,"spk-icon",28)(28,Ut,2,0,"spk-icon"),T(),F()()(),d(29,wt,15,4,"spk-dialog",29)}if(t&2){let e=!!n.targetUrlModel();r(6),S(e?6:-1),r(7),S(e?13:-1),r(),S(n.testSignal()=="testing"?14:n.testSignal()=="success"?15:n.testSignal()=="warning"?16:n.testSignal()=="error"?17:-1),r(4),S(e?18:-1),r(),S(e?-1:19),r(),S(e?20:-1),r(5),N("disabled",n.testSignal()=="testing"||!e),r(2),S(n.testSignal()=="testing"?27:28),r(2),S(n.targetUrlDialogOpen()?29:-1)}},dependencies:[Nt,dt,gt,ct,ut,_t,pt,Tt,rt,lt,ot,st,at],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] spk-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}"],changeDetection:0})};export{ne as createDestinationForm,ie as createDestinationFormGroup,v as default};
@@ -0,0 +1 @@
1
+ import{a as le}from"./chunk-XIOHRQ3X.js";import{a as re,b}from"./chunk-LDIZ5E5Z.js";import"./chunk-WZRDKVOR.js";import{a as ae}from"./chunk-ULLALJQ2.js";import"./chunk-J6BHRR34.js";import{a as E}from"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import{c as ie,e as ne,i as oe,s as se}from"./chunk-NSIELNIY.js";import"./chunk-7QJG4IIT.js";import"./chunk-3ZVSHKLD.js";import{b as j,e as J}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{C as ee,a as Q,e as Y,g as Z,l as x}from"./chunk-Y5IRBMLB.js";import{h as te}from"./chunk-DNJOKPEL.js";import"./chunk-UZK7ABRM.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-B6OIHB5W.js";import{Ab as p,D as G,F as g,G as K,H as A,Hc as C,Ic as k,Kb as d,Lb as u,Mb as F,Nb as U,Ob as X,Qa as r,Qb as S,Z as h,ab as L,bc as D,dc as z,ec as P,jc as H,kc as W,lc as q,na as s,r as v,sb as V,tb as w,xb as _,yb as n,zb as i}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";function ce(c,t){c&1&&(n(0,"spk-icon",19),P(1,"spinner"),i())}function pe(c,t){c&1&&(n(0,"spk-icon",20),P(1,"check"),i())}function _e(c,t){c&1&&(n(0,"spk-icon",21),P(1,"warning"),i()),c&2&&_("spkTooltip","File not found")}function de(c,t){let a=re(c).pipe(G(t),K());return b(a,{initialValue:c()})}var f=class c{#o=h(j);#s=h(ae);#e=h(te);#a=h(Y);#t=s("");backupId=b(this.#o.params.pipe(v(t=>t.id)));activeBackup=C(()=>this.#s.backups().find(t=>t.Backup?.ID===this.backupId()));backupFilePath=s("");lastValidatedPath=s("");isValidatedPath=C(()=>this.lastValidatedPath()===this.backupFilePath());pathHasChanged=C(()=>this.backupFilePath()!==this.#t());isValidatingPath=s(!1);#i=de(this.backupFilePath,500);#n=s(!1);isWaitingForValidation=C(()=>this.#i()!=this.backupFilePath()||this.isValidatingPath());backupFilePathEffect=k(()=>{let t=this.#i(),a=this.activeBackup(),e=this.#n();t!==""&&(this.isValidatingPath.set(!0),this.#e.postApiV1FilesystemValidate({requestBody:{path:t}}).pipe(g(1),A(()=>this.isValidatingPath.set(!1))).subscribe(()=>this.lastValidatedPath.set(t)))});isRestoring=s(!1);isRepairing=s(!1);isDeleting=s(!1);isSavingDbPath=s(!1);isSavingAndRepairing=s(!1);isMovingDb=s(!1);isCreatingBugReport=s(!1);createdReport=s(!1);activeBackupEffect=k(()=>{let t=this.activeBackup();if(!t)return;let a=t.Backup?.DBPath??"";this.backupFilePath.set(a),this.#t.set(a)});repairDatabase(){this.isRepairing.set(!0),this.#e.postApiV1BackupByIdRepair({id:this.backupId()}).pipe(g(1),A(()=>this.isRepairing.set(!1))).subscribe()}deleteDatabase(t=null){this.isValidatedPath()?this.#a.open(E,{data:{title:$localize`Confirm delete?`,message:$localize`Do you really want to delete the database for ${this.activeBackup()?.Backup?.Name}?`,confirmText:$localize`Delete database`,cancelText:$localize`Cancel`},closed:a=>{a&&this.doDeleteDatabase(t)}}):this.doDeleteDatabase(t)}doDeleteDatabase(t=null){this.isDeleting.set(!0),this.#e.postApiV1BackupByIdDeletedb({id:this.backupId()}).pipe(g(1),A(()=>this.isDeleting.set(!1))).subscribe(()=>{this.lastValidatedPath.set(""),t?.()})}restoreDatabase(){this.isValidatedPath()?this.deleteDatabase(()=>{this.doRepairDatabase()}):this.doRepairDatabase()}doRepairDatabase(){this.isRestoring.set(!0),this.#e.postApiV1BackupByIdRepair({id:this.backupId()}).pipe(g(1),A(()=>this.isRestoring.set(!1))).subscribe()}resetDatabasePath(){this.backupFilePath.set(this.#t())}saveDatabasePath(t=null){this.isValidatedPath()?this.#a.open(E,{data:{title:$localize`Confirm reassign?`,message:$localize`The target database path already exists and may belong to another backup. Are you sure you want to assign this backup to an existing database?`,confirmText:$localize`Assign existing database`,cancelText:$localize`Cancel`},closed:a=>{a&&this.doSaveDatabasePath(t)}}):this.doSaveDatabasePath(t)}doSaveDatabasePath(t=null){this.isSavingDbPath.set(!0);let a=this.backupFilePath();this.#e.postApiV1BackupByIdUpdatedb({id:this.backupId(),requestBody:{path:a}}).pipe(A(()=>this.isSavingDbPath.set(!1))).subscribe(()=>{this.#t.set(a),t?.()})}saveAndRepairDatabasePath(){this.saveDatabasePath(()=>(this.isSavingAndRepairing.set(!0),this.#e.postApiV1BackupByIdRepair({id:this.backupId()}).pipe(g(1),A(()=>this.isSavingAndRepairing.set(!1))).subscribe()))}moveDatabasePath(){this.isMovingDb.set(!0);let t=this.backupFilePath();this.#e.postApiV1BackupByIdMovedb({id:this.backupId(),requestBody:{path:t}}).pipe(A(()=>this.isMovingDb.set(!1))).subscribe(()=>{this.#n.update(a=>!a),this.#t.set(t)})}createErrorReport(){this.isCreatingBugReport.set(!0),this.#e.postApiV1BackupByIdCreatereport({id:this.backupId()}).pipe(A(()=>this.isCreatingBugReport.set(!1))).subscribe({next:()=>{this.createdReport.set(!0),window.setTimeout(()=>this.createdReport.set(!1),3e3)}})}static \u0275fac=function(a){return new(a||c)};static \u0275cmp=L({type:c,selectors:[["app-database"]],decls:50,vars:21,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_ICON: Back `;let a;a=$localize`Local database for ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let e;e=$localize` Each backup has a local database associated with it, which stores information about the remote backup on the local machine. This makes it faster to perform many operations, and reduces the amount of data that needs to be downloaded for each operation. `;let o;o=$localize`Maintenance`;let T;T=$localize` If the backup and the remote storage is out of sync, Duplicati will require that you perform a repair operation to synchronize the database. If the repair is unsuccessful, you can delete the local database and re-generate. The bug report button can be used to create a copy of the database with path information removed. This should only be used if a developer requests to investigate an issue with your database. `;let m;m=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SPK_ICON:wrench${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SPK_ICON: Repair `;let B;B=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:trash${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON: Delete `;let I;I=$localize`${"\uFFFD#25\uFFFD"}:START_TAG_SPK_ICON:clock-counter-clockwise${"\uFFFD/#25\uFFFD"}:CLOSE_TAG_SPK_ICON: Restore (delete and repair) `;let M;M=$localize`${"\uFFFD#28\uFFFD"}:START_TAG_SPK_ICON:file-plus${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SPK_ICON: Create bug report database `;let $;$=$localize`Placement`;let N;N=$localize`${"\uFFFD#40\uFFFD"}:START_TAG_SPK_ICON:backspace${"\uFFFD/#40\uFFFD"}:CLOSE_TAG_SPK_ICON: Reset `;let R;R=$localize`${"\uFFFD#43\uFFFD"}:START_TAG_SPK_ICON:floppy-disk${"\uFFFD/#43\uFFFD"}:CLOSE_TAG_SPK_ICON: Save `;let O;O=$localize`${"\uFFFD#46\uFFFD"}:START_TAG_SPK_ICON:wrench${"\uFFFD/#46\uFFFD"}:CLOSE_TAG_SPK_ICON: Save & Repair `;let y;return y=$localize`${"\uFFFD#49\uFFFD"}:START_TAG_SPK_ICON:flow-arrow${"\uFFFD/#49\uFFFD"}:CLOSE_TAG_SPK_ICON: Move existing database `,[t,a,e,o,T,m,B,I,M,$,N,R,O,y,[1,"back"],["type","button","spk-button","","routerLink","/",1,"small"],[1,"actions","maintenance"],["spk-button","",3,"click","disabled"],["type","text",3,"ngModelChange","ngModel"],["prefix","",1,"primary"],["prefix",""],["prefix","",3,"spkTooltip"],[1,"actions","placement"]]},template:function(a,e){if(a&1&&(p(0,"app-status-bar"),n(1,"section")(2,"div",14)(3,"button",15),d(4,0),p(5,"spk-icon"),u(),i()(),n(6,"article")(7,"h1"),F(8,1),i(),n(9,"p"),F(10,2),i()(),n(11,"article")(12,"h2"),F(13,3),i(),n(14,"p"),F(15,4),i(),n(16,"div",16)(17,"button",17),S("click",function(){return e.repairDatabase()}),d(18,5),p(19,"spk-icon"),u(),i(),n(20,"button",17),S("click",function(){return e.deleteDatabase()}),d(21,6),p(22,"spk-icon"),u(),i(),n(23,"button",17),S("click",function(){return e.restoreDatabase()}),d(24,7),p(25,"spk-icon"),u(),i(),n(26,"button",17),S("click",function(){return e.createErrorReport()}),d(27,8),p(28,"spk-icon"),u(),i()()(),n(29,"article")(30,"h2"),F(31,9),i(),n(32,"spk-form-field")(33,"input",18),q("ngModelChange",function(T){return W(e.backupFilePath,T)||(e.backupFilePath=T),T}),i(),V(34,ce,2,0,"spk-icon",19)(35,pe,2,0,"spk-icon",20)(36,_e,2,1,"spk-icon",21),i(),n(37,"div",22)(38,"button",17),S("click",function(){return e.resetDatabasePath()}),d(39,10),p(40,"spk-icon"),u(),i(),n(41,"button",17),S("click",function(){return e.saveDatabasePath()}),d(42,11),p(43,"spk-icon"),u(),i(),n(44,"button",17),S("click",function(){return e.saveAndRepairDatabasePath()}),d(45,12),p(46,"spk-icon"),u(),i(),n(47,"button",17),S("click",function(){return e.moveDatabasePath()}),d(48,13),p(49,"spk-icon"),u(),i()()()()),a&2){let o;r(8),U((o=e.activeBackup())==null||o.Backup==null?null:o.Backup.Name),X(8),r(9),D("loader",e.isRepairing()),_("disabled",!e.isValidatedPath()||e.pathHasChanged()),r(3),D("loader",e.isDeleting()),_("disabled",!e.isValidatedPath()||e.pathHasChanged()),r(3),D("loader",e.isRestoring()),_("disabled",e.pathHasChanged()),r(3),D("loader",e.isCreatingBugReport()),_("disabled",e.isCreatingBugReport()||!e.isValidatedPath()||e.pathHasChanged()),r(6),z(e.isValidatedPath()?"success":"error"),r(),H("ngModel",e.backupFilePath),r(),w(e.isWaitingForValidation()?34:e.isValidatedPath()?35:36),r(4),_("disabled",!e.pathHasChanged()),r(3),_("disabled",!e.pathHasChanged()||e.isWaitingForValidation()),r(3),_("disabled",!e.pathHasChanged()||e.isWaitingForValidation()),r(3),_("disabled",!e.pathHasChanged()||e.isValidatedPath()||e.isWaitingForValidation())}},dependencies:[se,ie,ne,oe,le,Z,x,Q,ee,J],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem}article[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}h1[_ngcontent-%COMP%]{font:var(--title-20)}h2[_ngcontent-%COMP%]{font:var(--title-30)}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{f as default};
@@ -1 +1 @@
1
- import"./chunk-EUDKD2JW.js";var o=[{path:"",loadComponent:()=>import("./chunk-JOUBVX7V.js"),children:[{path:"",redirectTo:"stored",pathMatch:"full"},{path:"stored",loadComponent:()=>import("./chunk-SLJD5T2G.js")},{path:"live",loadComponent:()=>import("./chunk-MQTQESMQ.js")}]}],t=o;export{t as default};
1
+ import"./chunk-EUDKD2JW.js";var o=[{path:"",loadComponent:()=>import("./chunk-JOUBVX7V.js"),children:[{path:"",redirectTo:"stored",pathMatch:"full"},{path:"stored",loadComponent:()=>import("./chunk-QU24HTBS.js")},{path:"live",loadComponent:()=>import("./chunk-3WCZIRMO.js")}]}],t=o;export{t as default};
@@ -1 +1 @@
1
- import{a as x}from"./chunk-QRRKPBY6.js";import{a as Z}from"./chunk-2BX65XJQ.js";import{b as H,d as K}from"./chunk-2W6BEUGU.js";import{b as j,c as W,e as q,g as Y,p as J}from"./chunk-Y5IRBMLB.js";import{h as Q}from"./chunk-DNJOKPEL.js";import{Ab as g,Bb as R,Cb as D,Eb as f,Hc as E,Kb as V,Lb as z,Mb as s,Na as h,Nc as S,Qa as r,Qb as u,Rb as _,Z as N,ab as A,da as C,dc as G,ea as I,ec as F,fc as P,gc as X,mc as B,na as y,nc as U,oc as O,sb as d,tb as p,vb as v,wb as L,xb as m,yb as a,zb as l}from"./chunk-BTMXQPBB.js";function nt(n,e){if(n&1&&F(0),n&2){_();let t=O(0);X(" ",t.Message," ")}}function ot(n,e){if(n&1&&(a(0,"div"),V(1,1),g(2,"a",15),z(),l()),n&2){let t=_();r(2),m("href",t.downloadLink(),h)}}function at(n,e){if(n&1){let t=f();a(0,"button",14),u("click",function(){C(t);let i=_(),c=O(0);return I(i.doRepair(c.BackupID))}),s(1,2),l()}}function rt(n,e){if(n&1){let t=f();a(0,"button",14),u("click",function(){C(t);let i=_(),c=O(0);return I(i.doDownloadBugreport(c))}),s(1,3),l()}}function lt(n,e){if(n&1&&g(0,"spk-progress-bar",17),n&2){let t,o=_(2);m("value",(t=o.serverState())==null?null:t.UpdateDownloadProgress)}}function ct(n,e){if(n&1){let t=f();a(0,"div",13),R(1),s(2,4),D(),a(3,"a",16),F(4),l(),d(5,lt,1,1,"spk-progress-bar",17),a(6,"button",14),u("click",function(){C(t);let i=_();return I(i.doShowUpdate())}),s(7,5),l()()}if(n&2){let t,o,i=_(),c=O(0);r(3),m("href",(t=i.serverState())==null?null:t.UpdateDownloadLink,h),r(),P(c.Message),r(),p(((o=i.serverState())==null?null:o.UpdaterState)==="Downloading"?5:-1)}}function st(n,e){if(n&1){let t=f();a(0,"button",14),u("click",function(){C(t);let i=_(),c=O(0);return I(i.doShowLog(c.BackupID))}),s(1,6),l()}}function _t(n,e){if(n&1){let t=f();a(0,"button",14),u("click",function(){C(t);let i=_();return I(i.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),s(1,7),l()}}function dt(n,e){if(n&1){let t=f();a(0,"button",14),u("click",function(){C(t);let i=_();return I(i.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),s(1,8),l()}}var pt={Error:"error",Warning:"warn",Information:"primary"},M=class n{#t=N(K);#a=N(H);#r=N(q);#e=N(W);#i=N(x);#n=N(Q);#o=y(null);serverState=this.#i.serverState;index=S.required();notification=S.required();downloadLink=E(()=>this.#o()||this.notification().DownloadLink||"");deleteNotificationByIndex(){this.#i.deleteNotification(this.index())}deleteAllNotifications(){this.#i.deleteAllNotifications()}getAlertType(e){return e&&pt[e]||"primary"}doShowLog(e){this.#n.getApiV1BackupByIdIsactive({id:e}).subscribe({next:t=>{this.#t.navigate(["/backup/"+e+"/log"])},error:t=>{if(t.status===404){let o={title:$localize`Error`,message:$localize`The backup is missing, has it been deleted?`,confirmText:$localize`OK`,cancelText:null};parseInt(e)+""!=e&&(o={title:$localize`Error`,message:$localize`The backup was temporary and does not exist anymore, so the log data is lost`,confirmText:$localize`OK`,cancelText:null}),this.#r.open(Z,{maxWidth:"550px",width:"100%",data:o})}else this.#e.error($localize`Failed to find backup: `+t.message)}})}doRepair(e){this.#n.postApiV1BackupByIdRepair({id:e}).subscribe({next:()=>{this.#e.success($localize`Backup repaired`),this.#t.navigate(["./"],{onSameUrlNavigation:"reload",relativeTo:this.#a})},error:t=>{this.#e.error($localize`Failed to repair backup: `+t.message)}})}doShowUpdate(){this.#t.navigate(["/about/changelog"])}doShowLink(e){window.open(e,"_blank")}doDownloadBugreport(e){let t=e.Action.slice(19);this.#n.postApiV1AuthIssuetokenByOperation({operation:"bugreport"}).subscribe({next:o=>{if(!o.Token){this.#e.error("Failed to get bug report URL: No token generated");return}let i=`api/v1/bugreport/${t}?token=${o.Token}`;e.DownloadLink=i,this.#o.set(i),this.triggerDownload(i)},error:o=>{this.#e.error(`Failed to get bug report URL: ${o.message}`)}})}triggerDownload(e){let t=document.createElement("a");t.href=e,t.download="",t.style.display="none",document.body.appendChild(t);try{t.click()}catch{}document.body.removeChild(t)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=A({type:n,selectors:[["app-notification"]],inputs:{index:[1,"index"],notification:[1,"notification"]},decls:16,vars:12,consts:()=>{let e;e=$localize`Dismiss`;let t;t=$localize` If the backup file was not downloaded automatically, ${"\uFFFD#2\uFFFD"}:START_LINK:right click and choose "Save as …"${"\uFFFD/#2\uFFFD"}:CLOSE_LINK:`;let o;o=$localize`Repair`;let i;i=$localize`Download`;let c;c=$localize`New update found:`;let k;k=$localize`Show Update`;let w;w=$localize`Show Log`;let $;$=$localize` Show Help `;let b;return b=$localize` Show Help `,[e,t,o,i,c,k,w,$,b,["sparkle-alert-title",""],["sparkle-alert-content","",1,"content"],[1,"actions"],["spk-button","",1,"small","outlined"],[1,"message"],["spk-button","",1,"small","outlined",3,"click"],["target","_blank",3,"href"],[3,"href"],[3,"value"]]},template:function(t,o){if(t&1){let i=f();B(0),a(1,"spk-alert")(2,"div",9),F(3),l(),a(4,"div",10),d(5,nt,1,1),d(6,ot,3,1,"div"),a(7,"div",11),d(8,at,2,0,"button",12),d(9,rt,2,0,"button",12),d(10,ct,8,3,"div",13),d(11,st,2,0,"button",12),d(12,_t,2,0,"button",12),d(13,dt,2,0,"button",12),a(14,"button",14),u("click",function(){return C(i),I(o.deleteNotificationByIndex())}),s(15,0),l()()()()}if(t&2){let i=U(o.notification());r(),G(o.getAlertType(i.Type)),r(2),P(i.Title),r(2),p(i.Action!=="update:new"&&i.Action!=="update:manual"?5:-1),r(),p(o.downloadLink()?6:-1),r(2),p(i.Message!=null&&i.Message.includes("please run repair")?8:-1),r(),p(i.Action!=null&&i.Action.startsWith("bug-report:created:")&&!o.downloadLink()?9:-1),r(),p(i.Action==="update:new"?10:-1),r(),p(i.Action==="backup:show-log"?11:-1),r(),p(i.Action==="config:issue:unencrypted-database"?12:-1),r(),p(i.Action==="config:issue:windows-folder-used"?13:-1)}},dependencies:[J,Y,j],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};var Nt=(n,e)=>e.ID;function Tt(n,e){if(n&1&&g(0,"app-notification",1),n&2){let t=e.$implicit,o=e.$index;m("index",o)("notification",t)}}function Ct(n,e){n&1&&(a(0,"div",2)(1,"p"),s(2,0),l()())}var tt=class n{#t=N(x);notificationFilterPredicate=S();notifications=E(()=>{let e=this.notificationFilterPredicate()?.predicate,t=this.#t.notifications();return typeof e!="function"?t:t.filter(e)});static \u0275fac=function(t){return new(t||n)};static \u0275cmp=A({type:n,selectors:[["app-notifications"]],inputs:{notificationFilterPredicate:[1,"notificationFilterPredicate"]},decls:3,vars:1,consts:()=>{let e;return e=$localize`No more notifications`,[e,[3,"index","notification"],[1,"notification-list"]]},template:function(t,o){t&1&&v(0,Tt,1,2,"app-notification",1,Nt,!1,Ct,3,0,"div",2),t&2&&L(o.notifications())},dependencies:[M],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;justify-content:flex-end}.notification-list[_ngcontent-%COMP%]{padding:1rem;display:flex;flex-direction:column;gap:1rem;text-align:center}"],changeDetection:0})};export{M as a,tt as b};
1
+ import{a as x}from"./chunk-QRRKPBY6.js";import{a as Z}from"./chunk-2BX65XJQ.js";import{b as H,d as K}from"./chunk-2W6BEUGU.js";import{b as j,c as W,e as q,g as Y,p as J}from"./chunk-Y5IRBMLB.js";import{h as Q}from"./chunk-DNJOKPEL.js";import{Ab as g,Bb as R,Cb as D,Eb as f,Hc as E,Kb as V,Lb as z,Mb as s,Na as h,Nc as S,Qa as r,Qb as u,Rb as _,Z as N,ab as A,da as C,dc as G,ea as I,ec as F,fc as P,gc as X,mc as B,na as y,nc as U,oc as O,sb as d,tb as p,vb as v,wb as L,xb as m,yb as a,zb as l}from"./chunk-BTMXQPBB.js";function nt(n,e){if(n&1&&F(0),n&2){_();let t=O(0);X(" ",t.Message," ")}}function ot(n,e){if(n&1&&(a(0,"div"),V(1,1),g(2,"a",15),z(),l()),n&2){let t=_();r(2),m("href",t.downloadLink(),h)}}function at(n,e){if(n&1){let t=f();a(0,"button",14),u("click",function(){C(t);let i=_(),c=O(0);return I(i.doRepair(c.BackupID))}),s(1,2),l()}}function rt(n,e){if(n&1){let t=f();a(0,"button",14),u("click",function(){C(t);let i=_(),c=O(0);return I(i.doDownloadBugreport(c))}),s(1,3),l()}}function lt(n,e){if(n&1&&g(0,"spk-progress-bar",17),n&2){let t,o=_(2);m("value",(t=o.serverState())==null?null:t.UpdateDownloadProgress)}}function ct(n,e){if(n&1){let t=f();a(0,"div",13),R(1),s(2,4),D(),a(3,"a",16),F(4),l(),d(5,lt,1,1,"spk-progress-bar",17),a(6,"button",14),u("click",function(){C(t);let i=_();return I(i.doShowUpdate())}),s(7,5),l()()}if(n&2){let t,o,i=_(),c=O(0);r(3),m("href",(t=i.serverState())==null?null:t.UpdateDownloadLink,h),r(),P(c.Message),r(),p(((o=i.serverState())==null?null:o.UpdaterState)==="Downloading"?5:-1)}}function st(n,e){if(n&1){let t=f();a(0,"button",14),u("click",function(){C(t);let i=_(),c=O(0);return I(i.doShowLog(c.BackupID))}),s(1,6),l()}}function _t(n,e){if(n&1){let t=f();a(0,"button",14),u("click",function(){C(t);let i=_();return I(i.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),s(1,7),l()}}function dt(n,e){if(n&1){let t=f();a(0,"button",14),u("click",function(){C(t);let i=_();return I(i.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),s(1,8),l()}}var pt={Error:"error",Warning:"warn",Information:"primary"},M=class n{#t=N(K);#a=N(H);#r=N(q);#e=N(W);#i=N(x);#n=N(Q);#o=y(null);serverState=this.#i.serverState;index=S.required();notification=S.required();downloadLink=E(()=>this.#o()||this.notification().DownloadLink||"");deleteNotificationByIndex(){this.#i.deleteNotification(this.index())}deleteAllNotifications(){this.#i.deleteAllNotifications()}getAlertType(e){return e&&pt[e]||"primary"}doShowLog(e){this.#n.getApiV1BackupByIdIsactive({id:e}).subscribe({next:t=>{this.#t.navigate(["/backup/"+e+"/log"])},error:t=>{if(t.status===404){let o={title:$localize`Error`,message:$localize`The backup is missing, has it been deleted?`,confirmText:$localize`OK`,cancelText:null};parseInt(e)+""!=e&&(o={title:$localize`Error`,message:$localize`The backup was temporary and does not exist anymore, so the log data is lost`,confirmText:$localize`OK`,cancelText:null}),this.#r.open(Z,{maxWidth:"550px",width:"100%",data:o})}else this.#e.error($localize`Failed to find backup: `+t.message)}})}doRepair(e){this.#n.postApiV1BackupByIdRepair({id:e}).subscribe({next:()=>{this.#e.success($localize`Backup repaired`),this.#t.navigate(["./"],{onSameUrlNavigation:"reload",relativeTo:this.#a})},error:t=>{this.#e.error($localize`Failed to repair backup: `+t.message)}})}doShowUpdate(){this.#t.navigate(["/about/changelog"])}doShowLink(e){window.open(e,"_blank")}doDownloadBugreport(e){let t=e.Action.slice(19);this.#n.postApiV1AuthIssuetokenByOperation({operation:"bugreport"}).subscribe({next:o=>{if(!o.Token){this.#e.error("Failed to get bug report URL: No token generated");return}let i=`${location.origin}/api/v1/bugreport/${t}?token=${o.Token}`;e.DownloadLink=i,this.#o.set(i),this.triggerDownload(i)},error:o=>{this.#e.error(`Failed to get bug report URL: ${o.message}`)}})}triggerDownload(e){let t=document.createElement("a");t.href=e,t.download="",t.style.display="none",document.body.appendChild(t);try{t.click()}catch{}document.body.removeChild(t)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=A({type:n,selectors:[["app-notification"]],inputs:{index:[1,"index"],notification:[1,"notification"]},decls:16,vars:12,consts:()=>{let e;e=$localize`Dismiss`;let t;t=$localize` If the backup file was not downloaded automatically, ${"\uFFFD#2\uFFFD"}:START_LINK:right click and choose "Save as …"${"\uFFFD/#2\uFFFD"}:CLOSE_LINK:`;let o;o=$localize`Repair`;let i;i=$localize`Download`;let c;c=$localize`New update found:`;let k;k=$localize`Show Update`;let w;w=$localize`Show Log`;let $;$=$localize` Show Help `;let b;return b=$localize` Show Help `,[e,t,o,i,c,k,w,$,b,["sparkle-alert-title",""],["sparkle-alert-content","",1,"content"],[1,"actions"],["spk-button","",1,"small","outlined"],[1,"message"],["spk-button","",1,"small","outlined",3,"click"],["target","_blank",3,"href"],[3,"href"],[3,"value"]]},template:function(t,o){if(t&1){let i=f();B(0),a(1,"spk-alert")(2,"div",9),F(3),l(),a(4,"div",10),d(5,nt,1,1),d(6,ot,3,1,"div"),a(7,"div",11),d(8,at,2,0,"button",12),d(9,rt,2,0,"button",12),d(10,ct,8,3,"div",13),d(11,st,2,0,"button",12),d(12,_t,2,0,"button",12),d(13,dt,2,0,"button",12),a(14,"button",14),u("click",function(){return C(i),I(o.deleteNotificationByIndex())}),s(15,0),l()()()()}if(t&2){let i=U(o.notification());r(),G(o.getAlertType(i.Type)),r(2),P(i.Title),r(2),p(i.Action!=="update:new"&&i.Action!=="update:manual"?5:-1),r(),p(o.downloadLink()?6:-1),r(2),p(i.Message!=null&&i.Message.includes("please run repair")?8:-1),r(),p(i.Action!=null&&i.Action.startsWith("bug-report:created:")&&!o.downloadLink()?9:-1),r(),p(i.Action==="update:new"?10:-1),r(),p(i.Action==="backup:show-log"?11:-1),r(),p(i.Action==="config:issue:unencrypted-database"?12:-1),r(),p(i.Action==="config:issue:windows-folder-used"?13:-1)}},dependencies:[J,Y,j],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};var Nt=(n,e)=>e.ID;function Tt(n,e){if(n&1&&g(0,"app-notification",1),n&2){let t=e.$implicit,o=e.$index;m("index",o)("notification",t)}}function Ct(n,e){n&1&&(a(0,"div",2)(1,"p"),s(2,0),l()())}var tt=class n{#t=N(x);notificationFilterPredicate=S();notifications=E(()=>{let e=this.notificationFilterPredicate()?.predicate,t=this.#t.notifications();return typeof e!="function"?t:t.filter(e)});static \u0275fac=function(t){return new(t||n)};static \u0275cmp=A({type:n,selectors:[["app-notifications"]],inputs:{notificationFilterPredicate:[1,"notificationFilterPredicate"]},decls:3,vars:1,consts:()=>{let e;return e=$localize`No more notifications`,[e,[3,"index","notification"],[1,"notification-list"]]},template:function(t,o){t&1&&v(0,Tt,1,2,"app-notification",1,Nt,!1,Ct,3,0,"div",2),t&2&&L(o.notifications())},dependencies:[M],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;justify-content:flex-end}.notification-list[_ngcontent-%COMP%]{padding:1rem;display:flex;flex-direction:column;gap:1rem;text-align:center}"],changeDetection:0})};export{M as a,tt as b};