@duplicati/ngclient 0.0.32 → 0.0.33

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.
Files changed (69) hide show
  1. package/{chunk-AXWWWNYP.js → chunk-2X2NVYPD.js} +1 -1
  2. package/{chunk-ATKSFHUF.js → chunk-4TN5W4QO.js} +1 -1
  3. package/{chunk-LXIJTRVM.js → chunk-4UJICSQB.js} +1 -1
  4. package/{chunk-2J2FXCU7.js → chunk-5ILDMHKR.js} +1 -1
  5. package/{chunk-CH4OZJBV.js → chunk-5XX7BU4I.js} +1 -1
  6. package/{chunk-R5JN4Q6V.js → chunk-5ZK3D2RS.js} +1 -1
  7. package/{chunk-HSUOVCAK.js → chunk-6M3MNJ52.js} +1 -1
  8. package/{chunk-CL3S2VV2.js → chunk-7SJHYZC5.js} +1 -1
  9. package/{chunk-LMBPK5DA.js → chunk-B3MIBKC5.js} +1 -1
  10. package/chunk-BEZGDXHL.js +1 -0
  11. package/{chunk-FFVSEGEV.js → chunk-C3DDBRLN.js} +1 -1
  12. package/chunk-CFQQ4QBV.js +1 -0
  13. package/{chunk-VTXQPBKS.js → chunk-DGBBEZNN.js} +1 -1
  14. package/{chunk-XVGRR5A7.js → chunk-EHV3OZDB.js} +1 -1
  15. package/{chunk-FHAZ4KGN.js → chunk-EWJCAT5A.js} +1 -1
  16. package/chunk-FTAJFNK5.js +1 -0
  17. package/chunk-GIZ3WMHA.js +1 -0
  18. package/{chunk-T2VQYIXT.js → chunk-HEBDWN5N.js} +1 -1
  19. package/chunk-IBQ7EDD3.js +1 -0
  20. package/chunk-IEODBWAI.js +1 -0
  21. package/chunk-J2ZPRK4G.js +1 -0
  22. package/{chunk-YI6L4R7Z.js → chunk-J3H4BCHI.js} +1 -1
  23. package/{chunk-FGOEPQE2.js → chunk-K7H3KYW7.js} +1 -1
  24. package/{chunk-2ORXOP6M.js → chunk-KFGIVU27.js} +1 -1
  25. package/chunk-KZMJGNOW.js +1 -0
  26. package/{chunk-A6SZHWMW.js → chunk-LVYTERRJ.js} +1 -1
  27. package/chunk-MR4RE3IB.js +7 -0
  28. package/{chunk-SJEKIUA5.js → chunk-N35HGIXN.js} +1 -1
  29. package/{chunk-DZ4NY6DH.js → chunk-NWRHNRPB.js} +1 -1
  30. package/chunk-OGOMCLP4.js +1 -0
  31. package/chunk-OHAFLXCH.js +1 -0
  32. package/{chunk-YR7K7QME.js → chunk-OVIL3KMN.js} +1 -1
  33. package/{chunk-P7G2XT2C.js → chunk-P6LV5I2K.js} +1 -1
  34. package/{chunk-GTFXUW4R.js → chunk-PIDBEXSZ.js} +1 -1
  35. package/chunk-PRXIWW64.js +1 -0
  36. package/{chunk-5S4GAK6A.js → chunk-QGSX2XOM.js} +1 -1
  37. package/{chunk-CXRDIX6X.js → chunk-QSMEC63O.js} +1 -1
  38. package/{chunk-TXYVWITT.js → chunk-QZCTOSPE.js} +1 -1
  39. package/chunk-RMO2MLB3.js +1 -0
  40. package/{chunk-RCJYQZCN.js → chunk-SSYD4I7W.js} +1 -1
  41. package/{chunk-XYW3WI3F.js → chunk-SW6FZ3TL.js} +1 -1
  42. package/{chunk-VKBAFWXR.js → chunk-UPHEPMGX.js} +1 -1
  43. package/{chunk-ZTDQQPKO.js → chunk-UUMKHH4F.js} +1 -1
  44. package/{chunk-OO5FPIA3.js → chunk-VOINBIWD.js} +1 -1
  45. package/chunk-W6WGCBBX.js +1 -0
  46. package/chunk-WCTCAT6N.js +1 -0
  47. package/chunk-WWDF3TQC.js +1 -0
  48. package/{chunk-SNVCSRVH.js → chunk-X25RPH22.js} +1 -1
  49. package/{chunk-IPFOWVKQ.js → chunk-ZI3FISVO.js} +1 -1
  50. package/index.html +1 -1
  51. package/{main-4BEVKJSI.js → main-KLER7HZN.js} +1 -1
  52. package/package.json +1 -1
  53. package/chunk-3KFDFKWE.js +0 -1
  54. package/chunk-5Y3QZ4EI.js +0 -1
  55. package/chunk-7AEXF3KX.js +0 -8
  56. package/chunk-ADFXT75O.js +0 -1
  57. package/chunk-B7ZQVD4U.js +0 -1
  58. package/chunk-EJYG5RAF.js +0 -1
  59. package/chunk-JDQIBNR4.js +0 -7
  60. package/chunk-LCQKPZDB.js +0 -1
  61. package/chunk-MTBPGXQX.js +0 -1
  62. package/chunk-PMUAVKEX.js +0 -1
  63. package/chunk-QSEDH5YS.js +0 -1
  64. package/chunk-R2O4OGXE.js +0 -1
  65. package/chunk-T7U2URJ4.js +0 -1
  66. package/chunk-TSRJXJX3.js +0 -1
  67. package/chunk-XA4PLKUY.js +0 -1
  68. package/chunk-YBT47FIB.js +0 -1
  69. package/chunk-YVWTNA2V.js +0 -1
@@ -1 +1 @@
1
- import{$ as aa,A as B,Aa as Ba,B as C,Ba as Ca,C as D,Ca as Da,D as E,Da as Ea,E as F,Ea as Fa,F as G,Fa as Ga,G as H,Ga as Ha,H as I,Ha as Ia,I as J,Ia as Ja,J as K,Ja as Ka,K as L,Ka as La,L as M,La as Ma,M as N,Ma as Na,N as O,Na as Oa,O as P,Oa as Pa,P as Q,Q as R,R as S,S as T,T as U,U as V,V as W,W as X,X as Y,Y as Z,Z as _,_ as $,a as b,aa as ba,b as c,ba as ca,c as d,ca as da,d as e,da as ea,e as f,ea as fa,f as g,fa as ga,g as h,ga as ha,h as i,ha as ia,i as j,ia as ja,j as k,ja as ka,k as l,ka as la,l as m,la as ma,m as n,ma as na,n as o,na as oa,o as p,oa as pa,p as q,pa as qa,q as r,qa as ra,r as s,ra as sa,s as t,sa as ta,t as u,ta as ua,u as v,ua as va,v as w,va as wa,w as x,wa as xa,x as y,xa as ya,y as z,ya as za,z as A,za as Aa}from"./chunk-R5JN4Q6V.js";import{za as a}from"./chunk-JDQIBNR4.js";import"./chunk-C6Q5SG76.js";export{l as APP_BASE_HREF,ka as AsyncPipe,i as BrowserPlatformLocation,za as CommonModule,xa as CurrencyPipe,pa as DATE_PIPE_DEFAULT_OPTIONS,oa as DATE_PIPE_DEFAULT_TIMEZONE,f as DOCUMENT,qa as DatePipe,va as DecimalPipe,r as FormStyle,t as FormatWidth,n as HashLocationStrategy,ra as I18nPluralPipe,sa as I18nSelectPipe,a as IMAGE_CONFIG,Ia as IMAGE_LOADER,ta as JsonPipe,ua as KeyValuePipe,h as LOCATION_INITIALIZED,o as Location,k as LocationStrategy,la as LowerCasePipe,Z as NgClass,_ as NgComponentOutlet,aa as NgFor,aa as NgForOf,$ as NgForOfContext,ba as NgIf,ca as NgIfContext,W as NgLocaleLocalization,V as NgLocalization,Pa as NgOptimizedImage,ga as NgPlural,ha as NgPluralCase,ia as NgStyle,da as NgSwitch,ea as NgSwitchCase,fa as NgSwitchDefault,ja as NgTemplateOutlet,p as NumberFormatStyle,u as NumberSymbol,Oa as PRECONNECT_CHECK_BLOCKLIST,m as PathLocationStrategy,wa as PercentPipe,g as PlatformLocation,q as Plural,ya as SlicePipe,ma as TitleCasePipe,s as TranslationWidth,na as UpperCasePipe,Ea as VERSION,Fa as ViewportScroller,v as WeekDay,Ha as XhrFactory,S as formatCurrency,R as formatDate,U as formatNumber,T as formatPercent,P as getCurrencySymbol,K as getLocaleCurrencyCode,J as getLocaleCurrencyName,I as getLocaleCurrencySymbol,D as getLocaleDateFormat,F as getLocaleDateTimeFormat,y as getLocaleDayNames,x as getLocaleDayPeriods,O as getLocaleDirection,A as getLocaleEraNames,M as getLocaleExtraDayPeriodRules,N as getLocaleExtraDayPeriods,B as getLocaleFirstDayOfWeek,w as getLocaleId,z as getLocaleMonthNames,H as getLocaleNumberFormat,G as getLocaleNumberSymbol,L as getLocalePluralCase,E as getLocaleTimeFormat,C as getLocaleWeekEndRange,Q as getNumberOfCurrencyDigits,Ca as isPlatformBrowser,Da as isPlatformServer,Ja as provideCloudflareLoader,Ka as provideCloudinaryLoader,La as provideImageKitLoader,Ma as provideImgixLoader,Na as provideNetlifyLoader,X as registerLocaleData,d as \u0275DomAdapter,Ga as \u0275NullViewportScroller,Aa as \u0275PLATFORM_BROWSER_ID,Ba as \u0275PLATFORM_SERVER_ID,e as \u0275PlatformNavigation,b as \u0275getDOM,j as \u0275normalizeQueryParams,Y as \u0275parseCookieValue,c as \u0275setRootDomAdapter};
1
+ import{$ as aa,A as B,Aa as Ba,B as C,Ba as Ca,C as D,Ca as Da,D as E,Da as Ea,E as F,Ea as Fa,F as G,Fa as Ga,G as H,Ga as Ha,H as I,Ha as Ia,I as J,Ia as Ja,J as K,Ja as Ka,K as L,Ka as La,L as M,La as Ma,M as N,Ma as Na,N as O,Na as Oa,O as P,Oa as Pa,P as Q,Q as R,R as S,S as T,T as U,U as V,V as W,W as X,X as Y,Y as Z,Z as _,_ as $,a as b,aa as ba,b as c,ba as ca,c as d,ca as da,d as e,da as ea,e as f,ea as fa,f as g,fa as ga,g as h,ga as ha,h as i,ha as ia,i as j,ia as ja,j as k,ja as ka,k as l,ka as la,l as m,la as ma,m as n,ma as na,n as o,na as oa,o as p,oa as pa,p as q,pa as qa,q as r,qa as ra,r as s,ra as sa,s as t,sa as ta,t as u,ta as ua,u as v,ua as va,v as w,va as wa,w as x,wa as xa,x as y,xa as ya,y as z,ya as za,z as A,za as Aa}from"./chunk-5ZK3D2RS.js";import{za as a}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";export{l as APP_BASE_HREF,ka as AsyncPipe,i as BrowserPlatformLocation,za as CommonModule,xa as CurrencyPipe,pa as DATE_PIPE_DEFAULT_OPTIONS,oa as DATE_PIPE_DEFAULT_TIMEZONE,f as DOCUMENT,qa as DatePipe,va as DecimalPipe,r as FormStyle,t as FormatWidth,n as HashLocationStrategy,ra as I18nPluralPipe,sa as I18nSelectPipe,a as IMAGE_CONFIG,Ia as IMAGE_LOADER,ta as JsonPipe,ua as KeyValuePipe,h as LOCATION_INITIALIZED,o as Location,k as LocationStrategy,la as LowerCasePipe,Z as NgClass,_ as NgComponentOutlet,aa as NgFor,aa as NgForOf,$ as NgForOfContext,ba as NgIf,ca as NgIfContext,W as NgLocaleLocalization,V as NgLocalization,Pa as NgOptimizedImage,ga as NgPlural,ha as NgPluralCase,ia as NgStyle,da as NgSwitch,ea as NgSwitchCase,fa as NgSwitchDefault,ja as NgTemplateOutlet,p as NumberFormatStyle,u as NumberSymbol,Oa as PRECONNECT_CHECK_BLOCKLIST,m as PathLocationStrategy,wa as PercentPipe,g as PlatformLocation,q as Plural,ya as SlicePipe,ma as TitleCasePipe,s as TranslationWidth,na as UpperCasePipe,Ea as VERSION,Fa as ViewportScroller,v as WeekDay,Ha as XhrFactory,S as formatCurrency,R as formatDate,U as formatNumber,T as formatPercent,P as getCurrencySymbol,K as getLocaleCurrencyCode,J as getLocaleCurrencyName,I as getLocaleCurrencySymbol,D as getLocaleDateFormat,F as getLocaleDateTimeFormat,y as getLocaleDayNames,x as getLocaleDayPeriods,O as getLocaleDirection,A as getLocaleEraNames,M as getLocaleExtraDayPeriodRules,N as getLocaleExtraDayPeriods,B as getLocaleFirstDayOfWeek,w as getLocaleId,z as getLocaleMonthNames,H as getLocaleNumberFormat,G as getLocaleNumberSymbol,L as getLocalePluralCase,E as getLocaleTimeFormat,C as getLocaleWeekEndRange,Q as getNumberOfCurrencyDigits,Ca as isPlatformBrowser,Da as isPlatformServer,Ja as provideCloudflareLoader,Ka as provideCloudinaryLoader,La as provideImageKitLoader,Ma as provideImgixLoader,Na as provideNetlifyLoader,X as registerLocaleData,d as \u0275DomAdapter,Ga as \u0275NullViewportScroller,Aa as \u0275PLATFORM_BROWSER_ID,Ba as \u0275PLATFORM_SERVER_ID,e as \u0275PlatformNavigation,b as \u0275getDOM,j as \u0275normalizeQueryParams,Y as \u0275parseCookieValue,c as \u0275setRootDomAdapter};
@@ -1,4 +1,4 @@
1
- import{a as Xe,b as ve}from"./chunk-CXRDIX6X.js";import{a as At,b as Ht}from"./chunk-DNHLTHLR.js";import{a as pt}from"./chunk-ZTDQQPKO.js";import{b as W}from"./chunk-2ORXOP6M.js";import{a as Ie,b as ne,c as ye,d as ie,e as fe,f as ct,g as Ut,h as Se,i as $e,k as _t,l as Te,m as Me,n as Bt,o as Ee,p as oe,q as re,r as ee,s as mt,t as De}from"./chunk-CL3S2VV2.js";import{a as Be}from"./chunk-GTFXUW4R.js";import{a as ae,b as ut,d as Kt,e as Xt,g as we,i as dt,k as le,m as Ft,n as zt,p as gt,q as se,v as Re,w as Ke}from"./chunk-XVGRR5A7.js";import{H as Ce,X as te}from"./chunk-YI6L4R7Z.js";import{c as Lt}from"./chunk-CH4OZJBV.js";import{ia as st}from"./chunk-R5JN4Q6V.js";import{$b as X,Ab as g,Bb as w,Cb as R,Db as v,E as Ye,Eb as a,Fb as r,Gb as m,Hb as I,Ib as $,Jb as be,Kb as P,Lc as H,Nc as lt,Qb as E,R as xe,Ra as l,Rb as D,Sb as A,Tb as Je,Ub as et,Vb as Oe,Wb as C,X as y,Xb as p,Za as x,_a as ue,_b as U,ac as V,ea as S,fa as T,fb as J,fc as de,gc as Fe,hc as ge,ic as c,ja as Mt,jc as L,kc as b,lb as F,lc as wt,nc as Rt,oc as vt,p as Qe,pc as Gt,qa as Ze,ra as rt,sc as bt,tc as Ve,uc as Vt,vb as _,vc as tt,xb as he,zc as at}from"./chunk-JDQIBNR4.js";import{a as Z,c as $t}from"./chunk-C6Q5SG76.js";function nn(n,i){if(n&1&&(a(0,"p"),c(1),r()),n&2){let e=p();l(),L(e._data().message)}}var on={title:$localize`Are you sure?`,confirmText:$localize`Confirm`,cancelText:$localize`Cancel`},Le=class n{data=rt();_data=H(()=>Z(Z({},on),this.data()));closed=Ze();close(i="confirm"){this.closed.emit(i==="confirm")}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=J({type:n,selectors:[["app-confirm-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:10,vars:4,consts:[["header",""],["content",""],["footer",""],["spk-button","",1,"",3,"click"],["spk-button","",1,"raised","primary",3,"click"]],template:function(e,t){e&1&&(a(0,"header",0)(1,"h3"),c(2),r()(),a(3,"div",1),F(4,nn,2,1,"p"),r(),a(5,"footer",2)(6,"button",3),C("click",function(){return t.close("cancel")}),c(7),r(),a(8,"button",4),C("click",function(){return t.close("confirm")}),c(9),r()()),e&2&&(l(2),L(t._data().title),l(2),g(t._data().message?4:-1),l(3),L(t._data().cancelText),l(2),L(t._data().confirmText))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};var Ct=class n{fromString(i){if(!i)return null;let e=i.match(/(\d+)([smhDWMY])/);return e&&{value:parseInt(e[1]),unit:e[2]}}toString(i,e){return`${i}${e}`}static \u0275fac=function(e){return new(e||n)};static \u0275prov=xe({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ue=class n{#e=y(Be);s3Providers=W(this.getS3Config("Providers"));s3Regions=W(this.getS3Config("Regions"));s3RegionHosts=W(this.getS3Config("RegionHosts"));s3StorageClasses=W(this.getS3Config("StorageClasses"));storjSatellites=W(this.getStorjConfig("Satellites"));storjAuthenticationMethods=W(this.getStorjConfig("AuthenticationMethods"));openstackProviders=W(this.getOpenstackConfig("Providers"));openstackVersions=W(this.getOpenstackConfig("Versions"));gcsLocations=W(this.getGcsConfig("Locations"));gcsStorageClasses=W(this.getGcsConfig("StorageClasses"));getS3Config(i){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-getconfig",requestBody:{"s3-config":i}}).pipe(Qe(e=>this.#n(e)))}createS3IamUser(i,e){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"CanCreateUser","s3-username":i,"s3-password":e}})}createS3PolicyIAM(i){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"GetPolicyDoc",path:i}})}getStorjConfig(i){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"storj-getconfig",requestBody:{"storj-config":i}}).pipe(Qe(e=>this.#n(e)))}getOpenstackConfig(i){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"openstack-getconfig",requestBody:{"openstack-config":i}}).pipe(Qe(e=>this.#n(e)))}getGcsConfig(i){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"gcs-getconfig",requestBody:{"gcs-config":i}}).pipe(Qe(e=>this.#n(e)))}#n(i){return(i.Result&&typeof i.Result=="object"&&Object.entries(i.Result).map(([e,t])=>({key:e,value:t})))??[]}static \u0275fac=function(e){return new(e||n)};static \u0275prov=xe({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ge=new ee,nt={file:{customFields:{path:{type:"FolderTree",name:"path",shortDescription:"File path",longDescription:"The path to store the backup",formElement:n=>Ge.control(n??"")}}},ssh:{customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"The server to connect to",formElement:n=>Ge.control(n??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"The port to connect to",formElement:n=>Ge.control(n??"",[ye.required,ye.max(65535)])},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:n=>Ge.control(n??"")}},dynamicFields:["auth-username"],advancedFields:[{type:"FileTree",name:"ssh-keyfile",accepts:".key,",shortDescription:"This is a path to a private key file locally on the machine",longDescription:"This is a path to a private key file locally on the machine"}]},s3:{customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:n=>Ge.control(n??"")},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:n=>Ge.control(n??"")}},dynamicFields:[{name:"s3-server-name",shortDescription:"Server",type:"NonValidatedSelectableString",loadOptions:n=>n.get(Ue).s3Providers},"use-ssl","auth-username","auth-password"],advancedFields:[{name:"s3-client",type:"Enumeration",options:["aws","minio"]},{name:"s3-storage-class",type:"NonValidatedSelectableString",loadOptions:n=>n.get(Ue).s3StorageClasses}]},gcs:{oauthField:"authid",customFields:{path:{type:"Path",name:"path",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:n=>Ge.control(n??"")}},dynamicFields:[{name:"gcs-location",type:"NonValidatedSelectableString",loadOptions:n=>n.get(Ue).gcsLocations},{name:"gcs-storage-class",type:"NonValidatedSelectableString",loadOptions:n=>n.get(Ue).gcsStorageClasses},"authid"]},googledrive:{oauthField:"authid",customFields:{path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:n=>Ge.control(n??"")}},dynamicFields:["authid"]}};function He(n,i){let e={},t={};return i.searchParams.forEach((o,s)=>{nt[n].dynamicFields?.includes(s)?t[s]=decodeURIComponent(o):e[s]=decodeURIComponent(o)}),{advanced:e,dynamic:t}}function it(n){let i=n.map(([e,t])=>`${e}=${t?encodeURIComponent(t.toString()):""}`).join("&");return i?"?"+i:""}var We={file:{to:n=>{let i=it([...Object.entries(n.advanced),...Object.entries(n.dynamic)]);return`${n.destinationType}://${n.custom.path}${i}`},from:(n,i,e)=>{let t=e.indexOf("file:///")===0,o=e.split(t?"///":"//")[1].substring(0,1)+i.hostname.substring(1);return Z({destinationType:n,custom:{path:`${t?"/":""}${o}${i.pathname}`}},He(n,i))}},ssh:{to:n=>{let i=it([...Object.entries(n.advanced),...Object.entries(n.dynamic)]);return`${n.destinationType}://${n.custom.server}${n.custom.port?":"+n.custom.port:""}${n.custom.path.startsWith("/")?n.custom.path:"/"+n.custom.path}${i}`},from:(n,i,e)=>Z({destinationType:n,custom:{server:i.hostname,port:i.port,path:i.pathname}},He(n,i))},s3:{to:n=>{let i=it([...Object.entries(n.advanced),...Object.entries(n.dynamic)]);return`${n.destinationType}://${n.custom.bucket}${n.custom.path.startsWith("/")?n.custom.path:"/"+n.custom.path}${i}`},from:(n,i,e)=>Z({destinationType:n,custom:{path:i.pathname,bucket:i.hostname}},He(n,i))},gcs:{to:n=>{let i=it([...Object.entries(n.advanced),...Object.entries(n.dynamic)]);return`${n.destinationType}://${n.custom.path}${i}`},from:(n,i,e)=>{let{advanced:t,dynamic:o}=He(n,i);return{destinationType:n,custom:{path:i.hostname+i.pathname},dynamic:o,advanced:t}}},googledrive:{to:n=>{let i=n.custom.path,e=it([...Object.entries(n.advanced),...Object.entries(n.dynamic)]);return`${n.destinationType}://${i}${e}`},from:(n,i,e)=>{let{advanced:t,dynamic:o}=He(n,i);return{destinationType:n,custom:{path:i.hostname+i.pathname},dynamic:o,advanced:t}}},fallbackMapper:{to:n=>"",from:(n,i,e)=>Z({destinationType:n},He(n,i))}};function ft(n){let i=n.destinationType;return!i||!We.hasOwnProperty(i)?We.fallbackMapper.to(n)??"":We[i].to(n)??""}function ht(n){let i=URL.canParse(n),e=n.split("://")[0],t="http://"+n.split("://")[1],o=new URL(t);if(!We.hasOwnProperty(e))return We.fallbackMapper.from(e,o);if(!i)throw new Error("Invalid target path");return We[e].from(e,o,n)}var Wt=/[a-zA-Z0-9_\-\+\.!@#$%^&*?_~()-]/,St=class n{generate(i,e=Wt){let t;do t=this.generatePassword(i,e);while(this.calculatePasswordStrength(t)<5);return t}generatePassword(i,e=Wt){let t=this;return Array.apply(null,{length:i}).map(()=>{let o;for(;;)if(o=String.fromCharCode(t.#e()),e.test(o))return o},this).join("")}calculatePasswordStrength(i){let e=1;return i.length>=8&&e++,i.match(/[a-z]/)&&i.match(/[A-Z]/)&&e++,i.match(/\d+/)&&e++,i.match(/.[!,@,#,$,%,^,&,*,?,_,~,(,),-]/)&&e++,Math.min(e,5)}#e(){if(window.crypto&&window.crypto.getRandomValues){let i=new Uint8Array(1);return window.crypto.getRandomValues(i),i[0]}else if(window.msCrypto&&window.msCrypto.getRandomValues){let i=new Uint8Array(1);return window.msCrypto.getRandomValues(i),i[0]}else return Math.floor(Math.random()*256)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=xe({token:n,factory:n.\u0275fac,providedIn:"root"})};var rn=["formRef"];function an(n,i){if(n&1&&(a(0,"option",27),c(1),r()),n&2){let e=i.$implicit;_("value",e.Key),l(),L(e.DisplayName)}}function ln(n,i){if(n&1&&m(0,"spk-progress-bar",38),n&2){let e=p(3);he("warn",e.calculatePasswordStrength()===1)("tertiary",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),_("value",e.calculatePasswordStrength()*(100/5))}}function sn(n,i){n&1&&(a(0,"span",33),A(1,9),r())}function pn(n,i){n&1&&(E(0,7,1),m(1,"spk-icon"),D())}function cn(n,i){n&1&&(E(0,7,2),m(1,"spk-icon"),D())}function _n(n,i){n&1&&(E(0,10,1),m(1,"spk-icon",40),D())}function mn(n,i){n&1&&(E(0,10,2),m(1,"spk-icon"),D())}function un(n,i){if(n&1){let e=P();a(0,"button",39),C("click",function(){S(e);let o=p(3);return T(o.copyPassword())}),E(1,10),F(2,_n,2,0)(3,mn,2,0),D(),r()}if(n&2){let e=p(3);l(2),g(e.copiedPassword()?2:3)}}function dn(n,i){n&1&&(a(0,"spk-alert",37),A(1,11),r())}function Fn(n,i){if(n&1){let e=P();a(0,"div",28)(1,"spk-form-field")(2,"label",29),E(3,6),m(4,"sup"),D(),r(),m(5,"input",30),r(),F(6,ln,1,9,"spk-progress-bar",31),a(7,"spk-form-field"),m(8,"input",32),F(9,sn,2,0,"span",33),r(),a(10,"div",34)(11,"button",35),C("click",function(){S(e);let o=p(2);return T(o.showPassword.set(!o.showPassword()))}),E(12,7),F(13,pn,2,0)(14,cn,2,0),D(),r(),a(15,"button",35),C("click",function(){S(e);let o=p(2);return T(o.generatePassword())}),E(16,8),m(17,"spk-icon"),D(),r(),F(18,un,4,1,"button",36),r(),F(19,dn,2,0,"spk-alert",37),r()}if(n&2){let e=p(2);l(5),_("type",e.showPassword()?"text":"password"),l(),g(e.generalForm.value.password?6:-1),l(2),_("type",e.showPassword()?"text":"password"),l(),g(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),l(4),g(e.showPassword()?13:14),l(5),g(e.showCopyPassword()?18:-1),l(),g(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function gn(n,i){if(n&1&&(a(0,"spk-select",24)(1,"label",25),A(2,5),r(),m(3,"input",26),R(4,an,2,2,"option",27,w),r(),F(6,Fn,20,7,"div",28)),n&2){let e=p();_("displayFn",e.displayFn()),l(4),v(e.encryptionOptions()),l(2),g(e.encryptionFieldSignal()!==""?6:-1)}}function Cn(n,i){if(n&1&&(a(0,"button",22),E(1,12),m(2,"spk-icon"),D(),r()),n&2){let e=p();_("disabled",e.generalForm.invalid)}}function fn(n,i){if(n&1&&(a(0,"spk-tooltip",23)(1,"button",22),E(2,13),m(3,"spk-icon"),D(),r()()),n&2){let e=p();_("disabled",!(e.showCopyPassword()&&!e.copiedPassword())),l(),_("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var je=new ee,jt=(n={name:"",description:"",encryption:"",password:"",repeatPassword:""})=>je.group({name:je.control(n.name,[ye.required]),description:je.control(n.description),encryption:je.control(n.encryption,[Ht()]),password:je.control(n.password,[At(i=>i?.value.encryption!=="",[ye.required])]),repeatPassword:je.control(n.repeatPassword,[At(i=>i?.value.encryption!=="",[ye.required])])}),yt={Key:"",DisplayName:"None"},Ot=class n{#e=y(te);#n=y(Ce);#i=y(St);#o=y(pe);#t=y(pt);formRef=ue.required("formRef");generalForm=this.#o.generalForm;generalFormSignal=this.#o.generalFormSignal;encryptionFieldSignal=this.#o.encryptionFieldSignal;encryptionOptions=this.#o.encryptionOptions;isNew=this.#o.isNew;showPassword=x(!1);copiedPassword=x(!1);showCopyPassword=x(!1);encryptionEffect=lt(()=>{this.encryptionFieldSignal()===""&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});calculatePasswordStrength=H(()=>{let e=this.generalFormSignal()?.password??"";return this.#i.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#o.exit()}async copyPassword(){let i=this.generalForm.controls.password.value;await this.#r(i??""),this.copiedPassword.set(!0)}async#r(i){try{await navigator.clipboard.writeText(i)}catch{try{let t=document.createElement("textarea");t.value=i,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}catch(t){console.error("Failed to copy text: ",t)}}}displayFn(){let i=this.#t.systemInfo()?.EncryptionModules??[];return e=>{let t=[yt,...i].find(o=>o.Key===e);return t?`${t.DisplayName}`:""}}generatePassword(){this.copiedPassword.set(!1);let i=this.#i.generate(16);this.generalForm.controls.password.setValue(i),this.generalForm.controls.repeatPassword.setValue(i),this.showCopyPassword.set(!0)}next(){this.#e.navigate(["destination"],{relativeTo:this.#n.parent})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=J({type:n,selectors:[["app-general"]],viewQuery:function(e,t){e&1&&de(t.formRef,rn,5),e&2&&Fe()},decls:20,vars:3,consts:()=>{let i;i=$localize`Your backup name`;let e;e=$localize`Your backup description`;let t;t=$localize`General backup settings`;let o;o=$localize` Backup name ${"\uFFFD#7\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#7\uFFFD"}:CLOSE_SUPERSCRIPT:`;let s;s=$localize`Backup description`;let d;d=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Exit `;let k;k=$localize`Encryption`;let M;M=$localize`Encryption`;let h;h=$localize`Password`;let Q;Q=$localize`Repeat password`;let Y;Y=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let B;B=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,B=Oe(B);let K;K=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Generate password `;let j;j=$localize`Passwords do not match`;let N;N=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SPK_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,N=Oe(N);let u;u=$localize` Tip: Be sure to save your password. If you loose it you will lose access to your backups. `;let f;f=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let z;return z=$localize` Continue ${"\uFFFD#3\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],t,o,s,d,M,Y,B,K,j,N,u,f,z,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],["for","backupName"],["type","text","tabindex","1","placeholder",i,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","spk-button","",3,"click"],["spk-button","","type","submit",1,"raised","primary",3,"disabled"],["message","Remember to copy the password",1,"primary",3,"disabled"],[3,"displayFn"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",k,"formControlName","encryption"],[3,"value"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",h,"formControlName","password",3,"type"],[1,"raised",3,"warn","tertiary","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",Q,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["spk-button","","type","button",1,"small",3,"click"],["spk-button","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["spk-button","","type","button",1,"small","copy",3,"click"],[1,"spk-success"]]},template:function(e,t){if(e&1){let o=P();a(0,"form",14,0),C("submit",function(){return S(o),T(t.next())}),a(2,"h3",15),A(3,1),r(),a(4,"spk-form-field")(5,"label",16),E(6,2),m(7,"sup"),D(),r(),m(8,"input",17),r(),a(9,"spk-form-field")(10,"label",18),A(11,3),r(),m(12,"textarea",19),r(),F(13,gn,7,2),a(14,"div",20)(15,"button",21),C("click",function(){return S(o),T(t.exit())}),E(16,4),m(17,"spk-icon"),D(),r(),F(18,Cn,3,1,"button",22)(19,fn,4,2,"spk-tooltip",23),r()()}e&2&&(_("formGroup",t.generalForm),l(13),g(t.isNew()?13:-1),l(5),g(t.encryptionFieldSignal()===""?18:19))},dependencies:[De,Se,oe,re,ne,ie,fe,Te,Ee,le,se,we,ae,zt,ut,Ke],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--warn-500)}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.copy[_ngcontent-%COMP%] spk-icon.spk-success[_ngcontent-%COMP%]{color:var(--success-500)}"],changeDetection:0})};var Sn=["formRef"],Tn=(n,i)=>({index:n,formView:i,formGroupName:"advancedOptions",destinationType:null,oauthField:null}),En=n=>({$implicit:n});function Dn(n,i){if(n&1&&(a(0,"option",18),c(1),r()),n&2){let e=i.$implicit;_("value",e),l(),L(e)}}function Nn(n,i){if(n&1&&(a(0,"option",18),c(1),r()),n&2){let e=i.$implicit;_("value",e.value),l(),L(e.name)}}function An(n,i){if(n&1){let e=P();E(0,7,1),a(1,"button",30,2),C("click",function(){let o=S(e).$implicit,s=p();return T(s.addNewOption(o))}),r(),D()}if(n&2){let e=i.$implicit;l(),Je(e.name),et(0)}}function hn(n,i){n&1&&be(0)}function On(n,i){if(n&1&&F(0,hn,1,0,"ng-container",31),n&2){let e=i.$implicit,t=i.$index;p();let o=ge(36);_("ngTemplateOutlet",o)("ngTemplateOutletContext",Ve(5,En,Vt(2,Tn,t,e)))}}function yn(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Pn(n,i){if(n&1&&(a(0,"app-file-tree",34)(1,"label",40),c(2),F(3,yn,3,1,"spk-tooltip",41),r(),m(4,"input",42),r()),n&2){let e,t=p().$implicit,o=p();_("startingPath",o.getFormFieldValue(0,t.formGroupName,t.formView.name))("accepts",t.formView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name)}}function kn(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function xn(n,i){if(n&1&&(a(0,"app-file-tree",35)(1,"label",40),c(2),F(3,kn,3,1,"spk-tooltip",41),r(),m(4,"input",42),r()),n&2){let e,t=p().$implicit,o=p();_("startingPath",o.getFormFieldValue(0,t.formGroupName,t.formView.name)),l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name)}}function In(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function $n(n,i){n&1&&(a(0,"spk-icon",43),c(1,"link"),r())}function Mn(n,i){n&1&&(a(0,"spk-icon",43),c(1,"textbox"),r())}function wn(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",40),c(2),F(3,In,3,1,"spk-tooltip",41),r(),m(4,"input",42),F(5,$n,2,0,"spk-icon",43)(6,Mn,2,0,"spk-icon",43),r()),n&2){let e,t=p().$implicit;l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name),l(),g(t.formView.type==="Path"?5:6)}}function Rn(n,i){if(n&1){let e=P();a(0,"span",47),C("click",function(){S(e);let o=p(2).$implicit,s=p();return T(s.oauthStartTokenCreation(o.formViewType))}),c(1,"AuthID"),r()}}function vn(n,i){n&1&&(a(0,"spk-icon",43),c(1,"password"),r())}function Gn(n,i){if(n&1){let e=P();a(0,"spk-icon",48),C("click",function(){S(e);let o=p(2).$implicit;return T(o.formView.showPassword=!o.formView.showPassword)}),c(1," eye "),r()}}function bn(n,i){if(n&1){let e=P();a(0,"spk-icon",48),C("click",function(){S(e);let o=p(2).$implicit;return T(o.formView.showPassword=!o.formView.showPassword)}),c(1," eye-slash "),r()}}function Vn(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",40),c(2),r(),m(3,"input",44),F(4,Rn,2,0,"span",45)(5,vn,2,0,"spk-icon",43)(6,Gn,2,0,"spk-icon",46)(7,bn,2,0,"spk-icon",46),r()),n&2){let e,t=p().$implicit;l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name),_("type",t.formView.showPassword?"text":"password"),l(),g(t.oauthField===t.formView.name?4:5),l(2),g(t.formView.showPassword?6:7)}}function Ln(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Un(n,i){if(n&1&&(a(0,"option",18),c(1),r()),n&2){let e=i.$implicit;_("value",e),l(),L(e)}}function Bn(n,i){if(n&1&&(a(0,"spk-select")(1,"label",40),c(2),F(3,Ln,3,1,"spk-tooltip",41),r(),m(4,"input",49),I(5,17),R(6,Un,2,2,"option",18,w),$(),r()),n&2){let e,t=p().$implicit;l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name),l(2),v(t.formView.options)}}function Kn(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Xn(n,i){if(n&1&&(a(0,"option",18),c(1),r()),n&2){let e=i.$implicit;_("value",e),l(),L(e)}}function zn(n,i){if(n&1&&(a(0,"div",36)(1,"label",40),c(2),F(3,Kn,3,1,"spk-tooltip",41),r(),a(4,"div",50)(5,"spk-form-field"),m(6,"input",51),a(7,"spk-icon",43),c(8,"resize"),r()(),a(9,"spk-select"),m(10,"label")(11,"input",52),I(12,17),R(13,Xn,2,2,"option",18,w),$(),r()()()),n&2){let e,t=p().$implicit,o=p();_("formGroupName",t.formView.name),l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(3),X("id","destination-",t.formGroupName,"-",t.index,""),l(7),v(o.sizeOptions())}}function Hn(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Wn(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",40),c(2),F(3,Hn,3,1,"spk-tooltip",41),r(),m(4,"input",53),a(5,"spk-icon",43),c(6,"numpad"),r()()),n&2){let e,t=p().$implicit;l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name)}}function jn(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function qn(n,i){if(n&1&&(a(0,"spk-toggle",37)(1,"label",40),c(2),F(3,jn,3,1,"spk-tooltip",41),r(),m(4,"input",54),r()),n&2){let e,t=p().$implicit;l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name)}}function Qn(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Yn(n,i){n&1&&(a(0,"spk-option",56),c(1,"None"),r()),n&2&&_("value","None")}function Zn(n,i){if(n&1&&(a(0,"spk-option",18),c(1),m(2,"spk-checkbox",57),r()),n&2){let e=p().$implicit;_("value",e),l(),b(" ",e," ")}}function Jn(n,i){if(n&1&&F(0,Yn,2,1,"spk-option",56)(1,Zn,3,2,"spk-option",18),n&2){let e=i.$implicit;g(e==="None"?0:1)}}function ei(n,i){if(n&1&&(a(0,"spk-select",38)(1,"label",40),c(2),F(3,Qn,3,1,"spk-tooltip",41),r(),m(4,"input",55),I(5,17),R(6,Jn,2,1,null,null,w),$(),r()),n&2){let e,t=p().$implicit;_("selectMultiple",!0),l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),U("formControlName",t.formView.name),l(2),v(t.formView.options)}}function ti(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function ni(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",40),c(2),F(3,ti,3,1,"spk-tooltip",41),r(),m(4,"input",42),r()),n&2){let e,t=p().$implicit;l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name)}}function ii(n,i){if(n&1){let e=P();a(0,"div",32),I(1,33),F(2,Pn,5,14,"app-file-tree",34)(3,xn,5,10,"app-file-tree",35)(4,wn,7,10,"spk-form-field")(5,Vn,8,11,"spk-form-field")(6,Bn,8,9,"spk-select")(7,zn,15,9,"div",36)(8,Wn,7,9,"spk-form-field")(9,qn,5,9,"spk-toggle",37)(10,ei,8,7,"spk-select",38)(11,ni,5,9,"spk-form-field"),$(),a(12,"button",39),C("click",function(){let o=S(e).$implicit,s=p();return T(s.removeFormView(o.formView,0))}),a(13,"spk-icon"),c(14,"x-circle"),r()()()}if(n&2){let e=i.$implicit;l(),_("formGroupName",e.formGroupName),l(),g(e.formView.type==="FileTree"?2:e.formView.type==="FolderTree"?3:e.formView.type==="String"||e.formView.type==="Path"?4:e.formView.type==="Password"?5:e.formView.type==="Enumeration"?6:e.formView.type==="Size"?7:e.formView.type==="Integer"?8:e.formView.type==="Boolean"?9:e.formView.type==="Flags"?10:e.formView.type==="Timespan"?11:-1)}}var Pe=new ee,oi=["Bytes","KB","MB","GB","TB","PB"],ri=[{value:"",name:"Keep all backups"},{value:"time",name:"Delete backups that are older than"},{value:"versions",name:"Keep a specific number of backups"},{value:"smart",name:"Smart backup retention"},{value:"custom",name:"Custom backup retention"}],qt=(n={remoteVolumeSize:50,size:"MB",backupRetention:"",advancedOptions:[]})=>Pe.group({remoteVolumeSize:Pe.group({size:Pe.control(n.remoteVolumeSize),unit:Pe.control(n.size)}),backupRetention:Pe.control(n.backupRetention),advancedOptions:Pe.group({})}),gr=(n,i)=>Pe.group({name:Pe.control(n),value:Pe.control(i)}),Pt=class n{#e=y(pe);#n=y(te);#i=y(Ce);formRef=ue.required("formRef");optionsForm=this.#e.optionsForm;selectedOptions=this.#e.selectedOptions;nonSelectedOptions=this.#e.nonSelectedOptions;isSubmitting=this.#e.isSubmitting;sizeOptions=x(oi);rentationOptions=x(ri);oauthStartTokenCreation(i){}getFormFieldValue(i,e,t){return this.optionsForm.controls.advancedOptions.controls[t].value}removeFormView(i,e){this.#e.removeOptionFromFormGroup(i)}addNewOption(i){this.#e.addOptionToFormGroup(i)}retentionOptionDisplayFn(){let i=this.rentationOptions();return e=>{let t=i.find(o=>o.value===e);return t?t.name:""}}displayFn(){let i=this.#e.advancedOptions();return e=>{let t=i.find(o=>o.name===e);return t?`${t.name}`:""}}goBack(){this.#n.navigate(["schedule"],{relativeTo:this.#i.parent})}submit(){this.#e.submit()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=J({type:n,selectors:[["app-options"]],viewQuery:function(e,t){e&1&&de(t.formRef,Sn,5),e&2&&Fe()},decls:44,vars:5,consts:()=>{let i;i=$localize`Select an option...`;let e;e=$localize`Options`;let t;t=$localize`Remote volume size`;let o;o=$localize` The backups will be split up into multiple files called volumes. Here you can set the maximum size of the individual volume files. ${"\uFFFD#17\uFFFD"}:START_LINK:Read more${"\uFFFD/#17\uFFFD"}:CLOSE_LINK:`;let s;s=$localize`Backup retention`;let d;d=$localize` Advanced options ${"\uFFFD#27\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#28\uFFFD"}:START_TAG_BUTTON: Add advanced option ${"\uFFFD#29\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#29\uFFFD"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#28\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#30\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD*32:1\uFFFD"}:START_BLOCK_FOR:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON_1:${"\uFFFD0:1\uFFFD"}:INTERPOLATION:${"[\uFFFD/#28\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/*32:1\uFFFD"}:CLOSE_BLOCK_FOR:${"\uFFFD/#30\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#27\uFFFD"}:CLOSE_TAG_SPK_MENU:`,d=Oe(d);let k;k=$localize`${"\uFFFD#40\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#40\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let M;return M=$localize`${"\uFFFD#43\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#43\uFFFD"}:CLOSE_TAG_SPK_ICON: Submit `,[["formRef",""],["fieldTemplate",""],["option",""],e,t,o,s,d,k,M,[3,"submit","formGroup"],[1,"title-30"],[1,"remote-volume-wrap"],["formGroupName","remoteVolumeSize",1,"row-inputs"],["for","size"],["type","number","id","size","formControlName","size"],["type","text","placeholder",i,"formControlName","unit"],["options",""],[3,"value"],["href","#",1,"spk-primary"],[3,"displayFn"],["type","text","formControlName","backupRetention"],[3,"disallowToggle"],["title",""],["spk-button","","type","button",1,"outlined","small"],["menu",""],["type","button"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["type","button",3,"click"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"field-row"],[3,"formGroupName"],[3,"startingPath","accepts","showFiles","showHiddenNodes","selectFiles"],[3,"startingPath"],[1,"form-column",3,"formGroupName"],[1,"primary","raised"],[1,"primary",3,"selectMultiple"],["spk-button","","type","button",1,"outlined",3,"click"],[3,"for"],[1,"primary",3,"message"],["type","text",3,"id","formControlName"],["prefix",""],["autocomplete","off",3,"type","id","formControlName"],["prefix","",1,"link"],["suffix","",1,"clickable"],["prefix","",1,"link",3,"click"],["suffix","",1,"clickable",3,"click"],["type","search",3,"id","formControlName"],[1,"form-row"],["type","number","formControlName","size",3,"id"],["type","search","formControlName","unit"],["type","number",3,"id","formControlName"],["type","checkbox",3,"id","formControlName"],["type","text","id","text",3,"formControlName"],["deselect","",3,"value"],[1,"raised","primary"]]},template:function(e,t){if(e&1){let o=P();a(0,"form",10,0),C("submit",function(){return S(o),T(t.submit())}),a(2,"h3",11),A(3,3),r(),a(4,"div",12)(5,"div",13)(6,"spk-form-field")(7,"label",14),A(8,4),r(),m(9,"input",15),r(),a(10,"spk-select"),m(11,"input",16),I(12,17),R(13,Dn,2,2,"option",18,w),$(),r()(),a(15,"p"),E(16,5),m(17,"a",19),D(),r()(),a(18,"spk-select",20)(19,"label",14),A(20,6),r(),m(21,"input",21),R(22,Nn,2,2,"option",18,w),r(),a(24,"app-toggle-card",22),I(25,23),E(26,7),a(27,"spk-menu")(28,"button",24),m(29,"spk-icon"),r(),I(30,25),R(31,An,3,1,"button",26,w),$(),r(),D(),$(),R(33,On,1,7,"ng-container",null,w),r(),F(35,ii,15,2,"ng-template",null,1,at),a(37,"div",27)(38,"button",28),C("click",function(){return S(o),T(t.goBack())}),E(39,8),m(40,"spk-icon"),D(),r(),a(41,"button",29),E(42,9),m(43,"spk-icon"),D(),r()()()}e&2&&(_("formGroup",t.optionsForm),l(13),v(t.sizeOptions()),l(5),_("displayFn",t.retentionOptionDisplayFn()),l(4),v(t.rentationOptions()),l(2),_("disallowToggle",!0),l(7),v(t.nonSelectedOptions()),l(2),v(t.selectedOptions()),l(8),he("loader",t.isSubmitting()))},dependencies:[De,Se,oe,re,ne,$e,Ie,ie,fe,Te,Ee,Me,st,Ft,se,we,ae,le,Re,dt,gt,Ke,Xe,ve],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.form-column[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.form-column[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 40px;align-items:flex-end}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var ai=["formRef"];function li(n,i){if(n&1&&(a(0,"option",39),c(1),r()),n&2){let e=i.$implicit;_("value",e.key),l(),L(e.label)}}function si(n,i){if(n&1){let e=P();a(0,"div",26)(1,"spk-form-field")(2,"label",27),A(3,8),r(),a(4,"input",28,1),C("focus",function(){S(e);let o=ge(5);return T(o.showPicker())}),r(),a(6,"spk-icon",29),c(7,"clock"),r()(),a(8,"spk-form-field"),m(9,"label",30),a(10,"input",31,2),C("focus",function(){S(e);let o=ge(11);return T(o.showPicker())}),r(),a(12,"spk-icon",29),c(13,"calendar"),r()()(),I(14,32),a(15,"div",33)(16,"spk-form-field")(17,"label",34),A(18,9),r(),m(19,"input",35),r(),a(20,"spk-select",36),m(21,"input",37),I(22,38),R(23,li,2,2,"option",39,w),$(),r()(),a(25,"app-toggle-card",40),I(26,41),A(27,10),$(),a(28,"div",42)(29,"spk-toggle",21),E(30,11),m(31,"input",43),D(),r(),a(32,"spk-toggle",21),E(33,12),m(34,"input",44),D(),r(),a(35,"spk-toggle",21),E(36,13),m(37,"input",45),D(),r(),a(38,"spk-toggle",21),E(39,14),m(40,"input",46),D(),r(),a(41,"spk-toggle",21),E(42,15),m(43,"input",47),D(),r(),a(44,"spk-toggle",21),E(45,16),m(46,"input",48),D(),r(),a(47,"spk-toggle",21),E(48,17),m(49,"input",49),D(),r()()(),$()}if(n&2){let e=p();l(20),_("displayFn",e.displayFn),l(3),v(e.unitOptions),l(2),_("disallowToggle",!0)}}var q=new ee,Qt=[{key:"s",label:$localize`Seconds`},{key:"m",label:$localize`Minutes`},{key:"h",label:$localize`Hours`},{key:"D",label:$localize`Days`},{key:"W",label:$localize`Weeks`},{key:"M",label:$localize`Months`},{key:"Y",label:$localize`Years`}],Yt=(n={autoRun:!1,nextTime:{time:"13:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!1,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}})=>q.group({autoRun:q.control(n.autoRun),nextTime:q.group({time:q.control(n.nextTime.time),date:q.control(n.nextTime.date)}),runAgain:q.group({repeatValue:q.control(n.runAgain.repeatValue),repeatUnit:q.control(n.runAgain.repeatUnit),allowedDays:q.group({mon:q.control(n.runAgain.allowedDays.mon),tue:q.control(n.runAgain.allowedDays.tue),wed:q.control(n.runAgain.allowedDays.wed),thu:q.control(n.runAgain.allowedDays.thu),fri:q.control(n.runAgain.allowedDays.fri),sat:q.control(n.runAgain.allowedDays.sat),sun:q.control(n.runAgain.allowedDays.sun)})})}),kt=class n{#e=y(pe);#n=y(te);#i=y(Ce);formRef=ue.required("formRef");scheduleForm=this.#e.scheduleForm;scheduleFormSignal=this.#e.scheduleFormSignal;unitOptions=Qt;displayFn(i){let e=Qt.find(t=>t.key===i);return e?`${e.label}`:""}goBack(){this.#n.navigate(["source-data"],{relativeTo:this.#i.parent})}next(){this.#n.navigate(["options"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=J({type:n,selectors:[["app-schedule"]],viewQuery:function(e,t){e&1&&de(t.formRef,ai,5),e&2&&Fe()},decls:18,vars:2,consts:()=>{let i;i=$localize`Schedule`;let e;e=$localize` Automatically run backups ${"\uFFFD#7\uFFFD\uFFFD/#7\uFFFD"}:TAG_INPUT:`;let t;t=$localize`If a date was missed, the job will run as soon as possible.`;let o;o=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let s;s=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let d;d=$localize`Next time`;let k;k=$localize`Run again every`;let M;M=$localize`Allowed days`;let h;h=$localize` Monday ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let Q;Q=$localize` Tuesday ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let Y;Y=$localize` Wednesday ${"\uFFFD#37\uFFFD\uFFFD/#37\uFFFD"}:TAG_INPUT:`;let B;B=$localize` Thursday ${"\uFFFD#40\uFFFD\uFFFD/#40\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Friday ${"\uFFFD#43\uFFFD\uFFFD/#43\uFFFD"}:TAG_INPUT:`;let j;j=$localize` Saturday ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let N;return N=$localize` Sunday ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`,[["formRef",""],["timeRef",""],["dateRef",""],i,e,t,o,s,d,k,M,h,Q,Y,B,K,j,N,[3,"submit","formGroup"],[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox","formControlName","autoRun"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["formGroupName","nextTime",1,"row-inputs"],["for","time"],["type","time","id","time","formControlName","time",3,"focus"],["suffix",""],["for","date"],["type","date","id","date","formControlName","date",3,"focus"],["formGroupName","runAgain"],[1,"row-inputs"],["for","repeatValue"],["type","number","id","repeatValue","formControlName","repeatValue"],[3,"displayFn"],["type","text","id","repeatUnit","formControlName","repeatUnit"],["options",""],[3,"value"],["formGroupName","allowedDays",3,"disallowToggle"],["title",""],[1,"days-wrap"],["type","checkbox","formControlName","mon"],["type","checkbox","formControlName","tue"],["type","checkbox","formControlName","wed"],["type","checkbox","formControlName","thu"],["type","checkbox","formControlName","fri"],["type","checkbox","formControlName","sat"],["type","checkbox","formControlName","sun"]]},template:function(e,t){if(e&1){let o=P();a(0,"form",18,0),C("submit",function(){return S(o),T(t.next())}),a(2,"h3",19),A(3,3),r(),a(4,"div",20)(5,"spk-toggle",21),E(6,4),m(7,"input",22),D(),r(),a(8,"p"),A(9,5),r()(),F(10,si,50,2),a(11,"div",23)(12,"button",24),C("click",function(){return S(o),T(t.goBack())}),E(13,6),m(14,"spk-icon"),D(),r(),a(15,"button",25),E(16,7),m(17,"spk-icon"),D(),r()()()}if(e&2){let o;_("formGroup",t.scheduleForm),l(10),g((o=t.scheduleFormSignal())!=null&&o.autoRun?10:-1)}},dependencies:[De,Se,oe,re,ne,$e,Ie,ie,fe,Te,Ee,Me,le,se,Re,ae,we,ve],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};function pi(n,i){if(n&1&&(a(0,"option",3),c(1),r()),n&2){let e=i.$implicit;_("value",e.value),l(),L(e.key)}}function ci(n,i){if(n&1&&(a(0,"option",3),c(1),r()),n&2){let e=i.$implicit;_("value",e.value),l(),L(e.key)}}function _i(n,i){if(n&1){let e=P();a(0,"spk-select",0)(1,"input",6),C("ngModelChange",function(o){S(e);let s=p(2);return T(s.updateStateExpression(o))}),r(),R(2,ci,2,2,"option",3,w),r()}if(n&2){let e,t=p(2);_("hideClearButton",!0)("displayFn",t.displayFn),l(),_("ngModel",(e=t.pathState())==null?null:e.expression),l(),v(t.fileGroupOptions())}}function mi(n,i){if(n&1){let e=P();a(0,"spk-form-field")(1,"input",6),C("ngModelChange",function(o){S(e);let s=p(2);return T(s.updateStateExpression(o))}),r()()}if(n&2){let e,t=p(2);l(),_("ngModel",(e=t.pathState())==null?null:e.expression)}}function ui(n,i){if(n&1){let e=P();a(0,"spk-select",0)(1,"input",1),C("ngModelChange",function(o){S(e);let s=p();return T(s.updateStateType(o))}),r(),I(2,2),R(3,pi,2,2,"option",3,w),$(),r(),F(5,_i,4,3,"spk-select",0)(6,mi,2,1,"spk-form-field"),a(7,"div",4),C("click",function(){S(e);let o=p();return T(o.removeFilter())}),a(8,"spk-icon",5),c(9,"x-circle"),r()()}if(n&2){let e,t,o=p();_("hideClearButton",!0)("displayFn",o.displayFn),l(),_("ngModel",(e=o.pathState())==null?null:e.type),l(2),v(o.expressionOptions()),l(2),g(((t=o.pathState())==null?null:t.type)==="-FileGroup"||((t=o.pathState())==null?null:t.type)==="+FileGroup"?5:6)}}var Zt=[{key:"Excludes folders where name contains",value:"-FolderNameIncludes"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileNameIncludes"},{key:"Excludes file extension",value:"-Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Excludes file group",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"}],di=[{key:"Applications",value:"Applications"},{key:"CacheFiles",value:"Cache Files"},{key:"TemporaryFiles",value:"Temporary Files"},{key:"OperatingSystem",value:"Operating System"},{key:"SystemFiles",value:"System Files"},{key:"DefaultExcludes",value:"Standard Excludes"}],Tt=class n{path=rt.required();pathChange=Ze();remove=Ze();expressionOptions=x(Zt);fileGroupOptions=x(di);pathState=x(null);pathEffect=lt(()=>{let i=this.path(),e=i.slice(1),t=i.startsWith("-")?"-":"+";return e.startsWith("/")&&e.endsWith("/")?this.pathState.set({type:`${t}Folder`,path:e,expression:e}):e.startsWith("*")&&e.endsWith("*/")?this.pathState.set({type:`${t}FolderNameIncludes`,path:e,expression:e.slice(1,-2)}):e.startsWith("[.*")&&e.endsWith("[^\\/]*]")?this.pathState.set({type:`${t}FileNameIncludes`,path:e,expression:e.slice(3,-7)}):e.startsWith("{")&&e.endsWith("}")?this.pathState.set({type:`${t}FileGroup`,path:e,expression:e.slice(1,-1)}):e.startsWith("[")&&e.endsWith("]")?this.pathState.set({type:`${t}Regex`,path:e,expression:e.slice(1,-1)}):e.startsWith("*.")?this.pathState.set({type:`${t}Extension`,path:e,expression:e.slice(2)}):this.pathState.set({type:`${t}Expression`,path:e,expression:e})});updateStateType(i){this.pathState.update(e=>(e.type=i,e.path=this.#e(e),e)),this.pathChange.emit(this.pathState().path)}updateStateExpression(i){this.pathState.update(e=>(e.expression=i,e.path=this.#e(e),e)),this.pathChange.emit(this.pathState().path)}#e(i){let e=i.type.slice(0,1),t=i.type.slice(1);if(t==="Folder"){let o=i.expression.endsWith("/"),s=i.expression.startsWith("/");return o&&s?`${e}${i.expression}`:o?`${e}${i.expression}/`:s?`${e}/${i.expression}`:`${e}/${i.expression}/`}return t==="FolderNameIncludes"?`${e}*${i.expression}*/`:t==="FileNameIncludes"?`${e}[.*${i.expression}[^\\/]*]`:t==="FileGroup"?`${e}{${i.expression}}`:t==="Regex"?`${e}[${i.expression}]`:t==="Extension"?`${e}*.${i.expression}`:`${e}${i.expression}`}removeFilter(){this.remove.emit()}displayFn(i){let e=Zt.find(t=>t.value===i);return e?e.key:""}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=J({type:n,selectors:[["app-filter"]],inputs:{path:[1,"path"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:1,vars:1,consts:()=>{let i;return i=$localize`Select an option...`,[[3,"hideClearButton","displayFn"],["type","text","placeholder",i,3,"ngModelChange","ngModel"],["options",""],[3,"value"],[1,"filter-removal",3,"click"],[1,"spk-primary"],["type","text",3,"ngModelChange","ngModel"]]},template:function(e,t){e&1&&F(0,ui,10,4),e&2&&g(t.pathState()?0:-1)},dependencies:[mt,oe,re,ne,ie,Ut,se,ae,le],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] spk-select[_ngcontent-%COMP%]{--miw: initial}[_nghost-%COMP%] .filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var Fi=["formRef"];function gi(n,i){if(n&1){let e=P();a(0,"app-filter",41),C("pathChange",function(o){let s=S(e).$index,d=p();return T(d.patchPathAt(o,s))})("remove",function(){let o=S(e).$index,s=p();return T(s.removePathAt(o))}),r()}if(n&2){let e=i.$implicit;_("path",e)}}function Ci(n,i){if(n&1&&(a(0,"option",45),c(1),r()),n&2){let e=i.$implicit;_("value",e),l(),L(e)}}function fi(n,i){if(n&1&&(a(0,"div",40)(1,"spk-form-field"),m(2,"input",42),r(),a(3,"spk-select"),m(4,"input",43),I(5,44),R(6,Ci,2,2,"option",45,w),$(),r()()),n&2){let e=p();l(6),v(e.sizeOptions())}}var ke=new ee,Si=["Bytes","KB","MB","GB","TB","PB"],Jt=(n={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>ke.group({path:ke.control(n.path),excludes:ke.group({hidden:ke.control(n.excludes.hidden),system:ke.control(n.excludes.system),temporary:ke.control(n.excludes.temporary),filesLargerThan:ke.group({size:ke.control(null),unit:ke.control(null)})})}),xt=class n{#e=y(pe);#n=y(te);#i=y(Ce);formRef=ue.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new ct("");filesLargerThan=H(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);sizeOptions=x(Si);pathSignal=W(this.sourceDataForm.controls.path.valueChanges);pathArray=H(()=>this.pathSignal()?.split("\0").filter(i=>i.startsWith("-")||i.startsWith("+"))??[]);addFilter(i="-*"){let e=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(`${e}\0${i}`)}patchPathAt(i,e){let o=this.sourceDataForm.controls.path.value.split("\0").filter(d=>!d.startsWith("-")&&!d.startsWith("+")).join("\0"),s=this.pathArray().map((d,k)=>k===e?`${i}`:`${d}`).join("\0");this.sourceDataForm.controls.path.setValue(`${o}\0${s}`)}removePathAt(i){let t=this.sourceDataForm.controls.path.value.split("\0").filter(s=>!s.startsWith("-")&&!s.startsWith("+")).join("\0"),o=this.pathArray().filter((s,d)=>d!==i).join("\0");this.sourceDataForm.controls.path.setValue(`${t}\0${o}`)}getPath(){return this.sourceDataForm.value.path??null}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let i=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(`${i}\0${this.newPathCtrl.value}`),this.newPathCtrl.setValue("")}goBack(){this.#n.navigate(["destination"],{relativeTo:this.#i.parent})}next(){this.#n.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=J({type:n,selectors:[["app-source-data"]],viewQuery:function(e,t){e&1&&de(t.formRef,Fi,5),e&2&&Fe()},decls:56,vars:11,consts:()=>{let i;i=$localize`Path`;let e;e=$localize`Add a direct path`;let t;t=$localize`Hidden files`;let o;o=$localize`System files`;let s;s=$localize`Temporary files`;let d;d=$localize`Source Data`;let k;k=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let M;M=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let h;h=$localize`Source Data`;let Q;Q=$localize`Add Path`;let Y;Y=$localize`Add a path directly from your machine.`;let B;B=$localize`Filters`;let K;K=$localize`Customize your filters.`;let j;j=$localize`Add filter`;let N;N=$localize`Exclude`;let u;u=$localize`Choose if there’s any files you want to exclude.`;let f;f=$localize` Hidden files ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let z;z=$localize` System files ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`;let O;O=$localize` Temporary files ${"\uFFFD#52\uFFFD\uFFFD/#52\uFFFD"}:TAG_INPUT:`;let _e;_e=$localize` Files larger than `;let Ae;return Ae=$localize`Select an option...`,[["formRef",""],d,k,M,h,Q,Y,B,K,j,N,u,f,z,O,_e,[3,"submit","formGroup"],[1,"left"],[1,"title-30"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",i,"formControlName","path"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],["description",""],[1,"row-inputs"],["type","text","placeholder",e,3,"formControl"],["spk-button","","type","button",1,"raised","primary",3,"click"],["type","button","spk-button","","action","",3,"click"],[3,"path"],["formGroupName","excludes",3,"disallowToggle"],[1,"raised","primary"],["type","checkbox","placeholder",t,"formControlName","hidden"],["type","checkbox","placeholder",o,"formControlName","system"],["type","checkbox","placeholder",s,"formControlName","temporary"],[1,"raised","primary",3,"click"],["formGroupName","filesLargerThan",1,"row-inputs"],[3,"pathChange","remove","path"],["type","number","formControlName","size"],["type","text","formControlName","unit","placeholder",Ae],["options",""],[3,"value"]]},template:function(e,t){if(e&1){let o=P();a(0,"form",16,0),C("submit",function(){return S(o),T(t.next())}),a(2,"div",17)(3,"h3",18),A(4,1),r(),a(5,"app-file-tree",19)(6,"label",20),c(7,"Folder path"),r(),m(8,"input",21),r(),a(9,"div",22)(10,"button",23),C("click",function(){return S(o),T(t.goBack())}),E(11,2),m(12,"spk-icon"),D(),r(),a(13,"button",24),E(14,3),m(15,"spk-icon"),D(),r()()(),a(16,"div",25)(17,"h3",18),A(18,4),r(),a(19,"app-toggle-card",26),I(20,27),A(21,5),$(),a(22,"p",28),A(23,6),r(),a(24,"div",29)(25,"spk-form-field"),m(26,"input",30),r(),a(27,"button",31),C("click",function(){return S(o),T(t.addNewPath())}),a(28,"spk-icon"),c(29,"plus"),r()()()(),a(30,"app-toggle-card",26),I(31,27),A(32,7),$(),a(33,"p",28),A(34,8),r(),a(35,"button",32),C("click",function(){return S(o),T(t.addFilter())}),A(36,9),r(),R(37,gi,1,1,"app-filter",33,w),r(),a(39,"app-toggle-card",34),I(40,27),A(41,10),$(),a(42,"p",28),A(43,11),r(),a(44,"spk-toggle",35),E(45,12),m(46,"input",36),D(),r(),a(47,"spk-toggle",35),E(48,13),m(49,"input",37),D(),r(),a(50,"spk-toggle",35),E(51,14),m(52,"input",38),D(),r(),a(53,"spk-toggle",39),C("click",function(){return S(o),T(t.toggleFilesLargerThan())}),A(54,15),r(),F(55,fi,8,0,"div",40),r()()()}e&2&&(_("formGroup",t.sourceDataForm),l(5),_("multiSelect",!0)("startingPath",t.getPath())("showFiles",!0),l(14),_("disallowToggle",!0),l(7),_("formControl",t.newPathCtrl),l(4),_("disallowToggle",!0),l(7),v(t.pathArray()),l(2),_("disallowToggle",!0),l(14),he("active",t.filesLargerThan()),l(2),g(t.filesLargerThan()?55:-1))},dependencies:[mt,Se,oe,re,ne,$e,Ie,ie,fe,De,_t,Te,Ee,Me,le,ae,we,se,Re,Xe,ve,Tt],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-level-40)}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.5rem}"],changeDetection:0})};var ce=new ee,pe=class n{#e=y(te);#n=y(pt);#i=y(Be);#o=y(Ct);generalForm=jt();sourceDataForm=Jt();scheduleForm=Yt();destinationForm=en();optionsForm=qt();isDraft=x(!1);backupId=x(null);isSubmitting=x(!1);finishedLoading=x(!1);backupDefaults=x(null);isNew=H(()=>this.backupId()==="new");selectedOptions=x([]);selectedAdvancedFormPair=x([]);destinationFormPair=x({oauthField:null,custom:[],dynamic:[],advanced:[]});notSelectedAdvancedFormPair=H(()=>{let i=this.destinationFormPair()?.advanced??[],e=this.selectedAdvancedFormPair()??[];return i.filter(t=>e.findIndex(o=>o.name===t.name)===-1)});selectedHttpOptions=x([]);notSelectedHttpOptions=H(()=>{let i=this.httpOptions(),e=this.selectedHttpOptions()??[];return i.filter(t=>e.findIndex(o=>o.name===t.name)===-1)});sourceDataFormSignal=W(this.sourceDataForm.valueChanges);destinationFormSignal=W(this.destinationForm.valueChanges);generalFormSignal=W(this.generalForm.valueChanges);encryptionFieldSignal=W(this.generalForm.controls.encryption.valueChanges);scheduleFormSignal=W(this.scheduleForm.valueChanges);destinationOptions=H(()=>this.#n.backendModules()??[]);httpOptions=H(()=>this.#n.systemInfo()?.GenericModules?.find(i=>i.Key==="http-options")?.Options?.map(this.#t)??[]);advancedOptions=H(()=>this.#n.systemInfo()?.Options?.map(this.#t)??[]);#t(i){return{name:i.Name,type:i.Type,shortDescription:i.ShortDescription??void 0,longDescription:i.LongDescription??void 0,options:i.ValidValues}}encryptionOptions=H(()=>{let i=this.#n.systemInfo()?.EncryptionModules??[];return[yt,...i]});nonSelectedOptions=H(()=>this.advancedOptions().sort((i,e)=>i?.name&&e?.name?i?.name.localeCompare(e?.name):0).filter(i=>this.selectedOptions()?.findIndex(e=>e.name===i.name)===-1));addAdvancedFormPairByName(i,e,t){let o=this.notSelectedAdvancedFormPair().find(s=>s.name===i);o&&this.addAdvancedFormPair(o,e,t)}addHttpOptionByName(i,e,t){let o=this.notSelectedHttpOptions().find(s=>s.name===i);o&&this.addHttpOption(o,e,t)}addAdvancedFormPair(i,e,t){let o=this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced,s=t??i.defaultValue;this.createFormField(o,i,s),this.selectedAdvancedFormPair.set([...this.selectedAdvancedFormPair(),i])}addHttpOption(i,e,t){let o=this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced,s=t??i.defaultValue;this.createFormField(o,i,s),this.selectedHttpOptions.set([...this.selectedHttpOptions(),i])}removeAdvancedFormPair(i,e){this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced.removeControl(i.name),this.selectedAdvancedFormPair().findIndex(o=>o.name===i.name)!==-1?this.selectedAdvancedFormPair.update(o=>(o=o.filter(s=>s.name!==i.name),o)):this.selectedHttpOptions.update(o=>(o=o.filter(s=>s.name!==i.name),o))}removeHttpOption(i,e){this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced.removeControl(i.name),this.selectedHttpOptions.update(t=>(t=t.filter(o=>o.name!==i.name),t))}submit(){this.isSubmitting.set(!0);let i=this.#s(),e=this.backupId();e==="new"||!e||this.isDraft()?this.#i.postApiV1Backups({requestBody:i}).pipe(Ye(()=>this.isSubmitting.set(!1))).subscribe({next:t=>{console.log("submitted res",t),this.exit()},error:t=>{console.error("submitted error",t)}}):this.#i.putApiV1BackupById({id:e,requestBody:i}).pipe(Ye(()=>this.isSubmitting.set(!1))).subscribe({next:t=>{console.log("submitted res",t),this.exit()},error:t=>{console.error("submitted error",t)}})}exit(){this.#c(),this.#e.navigate(["/"])}updateFieldsFromTargetUrl(i){this.#r(),setTimeout(()=>{this.#l(i)})}#r(){this.destinationFormPair.set({oauthField:null,custom:[],dynamic:[],advanced:[]}),this.selectedAdvancedFormPair.set([]),this.selectedHttpOptions.set([]),this.destinationForm.controls.destinations.clear(),this.destinationForm.reset()}mapSourceDataToForm(i){let e=i.Sources??"",t=i.Filters?.map(h=>`${h.Include?"":"-"}${h.Expression}`)??[],o=i.Settings?.find(h=>h.Name==="--exclude-files-attributes")?.Value??"",s=i.Settings?.find(h=>h.Name==="--skip-files-larger-than")??null,d=s?.Value.replace(/[0-9]/g,"")??null,k=s?.Value.replace(/[^0-9]/g,"")??null,M={path:[...e,...t].join("\0"),excludes:{hiddenFiles:o.includes("hidden"),systemFiles:o.includes("system"),tempFiles:o.includes("temporary"),filesLargerThan:d&&k?{size:parseInt(k),unit:d.toUpperCase()}:null}};this.sourceDataForm.patchValue(M)}mapDestinationToForm(i){let e=i.TargetURL?ht(i.TargetURL):null;e&&this.addDestinationFormGroup(e.destinationType,{custom:e.custom,dynamic:e.dynamic,advanced:e.advanced},!0)}#l(i){let e=ht(i);e&&this.addDestinationFormGroup(e.destinationType,{custom:e.custom,dynamic:e.dynamic,advanced:e.advanced},!0)}mapGeneralToForm(i){let e=i.Settings?.find(s=>s.Name==="encryption-module"),t=e?.Value&&e.Value.length?e.Value:"",o={name:i.Name??"",description:i.Description??""};t&&t!==""&&(o.encryption=t),this.generalForm.patchValue(o)}mapScheduleToForm(i){if(!i){this.scheduleForm.patchValue({autoRun:!0});return}let e=this.#o.fromString(i.Repeat)??null,o={nextTime:this.#p(i.Time),runAgain:{repeatValue:e?.value??1,repeatUnit:e?.unit??"D",allowedDays:{mon:i.AllowedDays?.includes("mon")??!1,tue:i.AllowedDays?.includes("tue")??!1,wed:i.AllowedDays?.includes("wed")??!1,thu:i.AllowedDays?.includes("thu")??!1,fri:i.AllowedDays?.includes("fri")??!1,sat:i.AllowedDays?.includes("sat")??!1,sun:i.AllowedDays?.includes("sun")??!1}}};this.scheduleForm.patchValue(o)}mapOptionsToForms(i){let e=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than"],t=this.advancedOptions();i.Settings?.forEach(o=>{if(o.Name==="encryption-module")return this.generalForm.controls.encryption.setValue(o.Value??"");if(!(o.Name&&e.includes(o.Name))){if(o.Name==="dblock-size"){let s=o.Value?.replace(/[^0-9]/g,""),d=o.Value?.replace(/[0-9]/g,"");return this.optionsForm.controls.remoteVolumeSize.setValue({size:s?parseInt(s):null,unit:d?d.toUpperCase():null})}if(o.Name&&o.Value){let s=t.find(d=>d.name===o.Name);if(!s)return;this.addOptionToFormGroup(s,o.Value)}}})}getCurrentTargetUrl(){return this.#a(this.destinationForm.controls.destinations)}#s(){let i=this.generalForm.value,e=this.optionsForm.value,t=this.scheduleForm.value,o=this.sourceDataForm.value,d=this.destinationForm.value.destinations?.length?this.#a(this.destinationForm.controls.destinations):[],k=null;t.runAgain?.repeatUnit&&t.runAgain?.repeatValue&&(k=this.#o.toString(t.runAgain.repeatValue,t.runAgain.repeatUnit));let M=t.runAgain?.allowedDays?Object.entries(t.runAgain?.allowedDays).filter(([u,f])=>f).map(([u,f])=>u):[],h=o.path?.split("\0")??[],Q=i.encryption===""?{Name:"--no-encryption",Value:"True"}:{Name:"encryption-module",Value:i.encryption??null},Y=this.advancedOptions(),B=Object.entries(e.advancedOptions??{}).filter(([u,f])=>u&&f).map(([u,f])=>{let z=Y.find(O=>O.name===u);return z?.type==="Size"?{Name:u,Value:`${f.size}${f.unit.toLowerCase()}`}:z?.type==="Integer"?{Name:u,Value:f.toString()}:z?.type==="Boolean"?{Name:u,Value:f.toString()}:{Name:u,Value:f}}),K=[Q,...B],j=Object.entries(o.excludes??{}).filter(([u,f])=>f&&u!=="filesLargerThan").map(([u])=>u),N=o.excludes?.filesLargerThan;return j.length&&K.push({Name:"--exclude-files-attributes",Value:j.join(",")}),N&&N.size!==null&&N.unit!==null&&K.push({Name:"--skip-files-larger-than",Value:`${N.size}${N.unit}`}),{Backup:{Name:i.name,Description:i.description,TargetURL:d[0]??null,Sources:h.filter(u=>!u.startsWith("-")),Settings:K,Filters:h.filter(u=>u.startsWith("-")).map((u,f)=>({Order:f,Include:!1,Expression:u.slice(1)}))},Schedule:t.autoRun?{Repeat:k,Time:t.nextTime?.date?new Date(`${t.nextTime.date}T${t.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:M}:null}}#a(i){return i.controls.map(e=>ft(e.value))}#p(i){if(!i||i?.indexOf("T")===-1)return{time:i??"13:00"};let e=new Date(i),t={time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`};return i.indexOf("T")!==-1&&(t.date=e.toISOString().split("T")[0]),t}removeOptionFromFormGroup(i){let e=i.name;e&&(this.optionsForm.controls.advancedOptions.removeControl(e),this.selectedOptions.update(t=>(t=t.filter(o=>o.name!==e),t)))}addOptionToFormGroup(i,e){let t=this.optionsForm.controls.advancedOptions;this.createFormField(t,i,e??i.defaultValue),this.selectedOptions.update(o=>(o.push(i),o))}createFormField(i,e,t){if(e.type==="String"||e.type==="FileTree"||e.type==="FolderTree"||e.type==="Password"||e.type==="Enumeration"||e.type==="NonValidatedSelectableString"||e.type==="Path"){i.addControl(e.name,ce.control(t));return}if(e.type==="Size"){let o=t.replace(/[0-9]/g,""),s=t.replace(/[^0-9]/g,"");i.addControl(e.name,ce.group({size:ce.control(s?parseInt(s):50),unit:ce.control(o?o.toUpperCase():"MB")}));return}if(e.type==="Integer"){i.addControl(e.name,ce.control(t?parseInt(t):0));return}if(e.type==="Boolean"){i.addControl(e.name,ce.control(t==="true"));return}if(e.type==="Flags"){i.addControl(e.name,ce.control(t??""));return}if(e.type==="Timespan"){i.addControl(e.name,ce.control(t,[ye.pattern(/([-+]?\d{1,3}[smhDWMY])+/)]));return}}addDestinationFormGroup(i,e,t=!1){let o=this.destinationOptions().find(N=>N.Key===i),s=this.httpOptions();if(!o||!o.Options)return;let d=nt.hasOwnProperty(i)&&nt[i],k=d&&d.oauthField?d.oauthField:null,M=d&&d.customFields?d.customFields:{},h=d&&d.dynamicFields?d.dynamicFields:[],Q=d&&d.advancedFields?d.advancedFields:[],Y=d&&d.ignoredAdvancedFields?d.ignoredAdvancedFields:[];this.destinationFormPair.set({oauthField:k,custom:[],dynamic:[],advanced:[]});let B=ce.group({}),K=ce.group({}),j=ce.group({});M&&Object.entries(M).forEach(([N,u],f)=>{let _e=u,{formElement:z}=_e,O=$t(_e,["formElement"]);B.addControl(N,z(e?.custom[N])),this.destinationFormPair.update(Ae=>(Ae.custom.push(Z({order:900+f},O)),Ae))});for(let N=0;N<o.Options.length;N++){let u=o.Options[N];if(u.Deprecated)continue;let f=h.find(z=>z===u.Name||z.name===u.Name);if(f){let z=f&&typeof f!="string",O={name:u.Name,type:u.Type,shortDescription:u.ShortDescription??void 0,longDescription:u.LongDescription??void 0,options:u.ValidValues,order:900+N},_e=z?Z(Z({},O),f):O,G=e?.dynamic[u.Name]??u.DefaultValue;this.createFormField(K,_e,G),this.destinationFormPair.update(qe=>(qe.dynamic.push(_e),qe))}else{if(Y.find(me=>me===u.Name))continue;let O=Q.find(me=>me===u.Name||me.name===u.Name),_e=O&&typeof O!="string",Ae=e?.advanced[u.Name],G=Ae??u.DefaultValue,qe={name:u.Name,type:u.Type,shortDescription:u.ShortDescription??void 0,longDescription:u.LongDescription??void 0,options:u.ValidValues,defaultValue:G,order:900+N},Nt=_e?Z(Z({},qe),O):qe;t&&Ae&&(this.createFormField(j,Nt,G),this.selectedAdvancedFormPair.update(me=>(me.push(Nt),me))),this.destinationFormPair.update(me=>(me.advanced.push(Nt),me))}}for(let N=0;N<s.length;N++){let u=s[N],f=e?.advanced[u.name],z=f??u.defaultValue;t&&f&&(this.createFormField(j,u,z),this.selectedHttpOptions.update(O=>(O.push(u),O)))}this.destinationFormPair.update(N=>({oauthField:N.oauthField,custom:N.custom.sort((u,f)=>u.order-f.order),dynamic:N.dynamic.sort((u,f)=>u.order-f.order),advanced:N.advanced.sort((u,f)=>u.order-f.order)})),this.destinationForm.controls.destinations.push(tn({key:o.Key,customGroup:B,dynamicGroup:K,advancedGroup:j}))}#c(){this.generalForm.reset(),this.destinationForm.controls.destinations.clear(),this.destinationForm.reset(),this.sourceDataForm.reset(),this.scheduleForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||n)};static \u0275prov=xe({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ti=["formRef"],Ei=(n,i,e,t)=>({index:n,formView:i,formGroupName:"custom",destinationType:e,oauthField:t}),Dt=n=>({$implicit:n}),Di=(n,i,e,t)=>({index:n,formView:i,formGroupName:"dynamic",destinationType:e,oauthField:t}),Ni=(n,i,e,t)=>({index:n,formView:i,formGroupName:"advanced",destinationType:e,oauthField:t}),Ai=(n,i,e,t)=>({index:n,formView:i,formGroupName:"advanced",asHttpOptions:!0,destinationType:e,oauthField:t}),hi=()=>({maxWidth:"700px",width:"100%"});function Oi(n,i){n&1&&(E(0,2,2),m(1,"spk-icon"),D())}function yi(n,i){n&1&&A(0,2,3)}function Pi(n,i){if(n&1){let e=P();E(0,2,1),a(1,"button",24),C("click",function(){S(e);let o=p();return T(o.testDestination())}),F(2,Oi,2,0)(3,yi,1,0),r(),D()}if(n&2){let e=p();l(),he("success",e.successfulTest()),l(),g(e.successfulTest()?2:3)}}function ki(n,i){if(n&1){let e=P();a(0,"p",30),C("click",function(){S(e);let o=p();return T(o.removeDestinationFormGroup(o.destinationCount()-1))}),E(1,5),m(2,"span",31),D(),r()}}function xi(n,i){if(n&1){let e=P();a(0,"div",32)(1,"div",33),C("click",function(){S(e);let o=p();return T(o.addDestinationFormGroup("file"))}),a(2,"h3"),A(3,6),r(),a(4,"p"),A(5,7),r()(),a(6,"div",33),C("click",function(){S(e);let o=p();return T(o.addDestinationFormGroup("gcs"))}),a(7,"h3"),c(8,"Google Cloud Storage"),r(),a(9,"p"),A(10,8),r()(),a(11,"div",33),C("click",function(){S(e);let o=p();return T(o.addDestinationFormGroup("s3"))}),a(12,"h3"),c(13,"S3 compatible bucket"),r(),a(14,"p"),A(15,9),r()(),a(16,"div",33),C("click",function(){S(e);let o=p();return T(o.addDestinationFormGroup("ssh"))}),a(17,"h3"),c(18,"SSH"),r(),a(19,"p"),A(20,10),r()(),a(21,"div",33),C("click",function(){S(e);let o=p();return T(o.addDestinationFormGroup("googledrive"))}),a(22,"h3"),c(23,"Google Drive"),r(),a(24,"p"),A(25,11),r()()(),a(26,"p"),A(27,12),r()}}function Ii(n,i){n&1&&be(0)}function $i(n,i){if(n&1&&F(0,Ii,1,0,"ng-container",39),n&2){let e,t=i.$implicit,o=i.$index;p();let s=ge(29),d=p();_("ngTemplateOutlet",s)("ngTemplateOutletContext",Ve(7,Dt,tt(2,Ei,o,t,(e=d.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,d.destinationFormPair().oauthField)))}}function Mi(n,i){n&1&&be(0)}function wi(n,i){if(n&1&&F(0,Mi,1,0,"ng-container",39),n&2){let e,t=i.$implicit,o=i.$index;p();let s=ge(29),d=p();_("ngTemplateOutlet",s)("ngTemplateOutletContext",Ve(7,Dt,tt(2,Di,o,t,(e=d.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,d.destinationFormPair().oauthField)))}}function Ri(n,i){if(n&1){let e=P();E(0,13,1),a(1,"button",40),C("click",function(){let o=S(e).$implicit,s=p(2);return T(s.addAdvancedFormPair(o,0))}),r(),D()}if(n&2){let e=i.$implicit;l(),Je(e.name),et(0)}}function vi(n,i){n&1&&be(0)}function Gi(n,i){if(n&1&&F(0,vi,1,0,"ng-container",39),n&2){let e,t=i.$implicit,o=i.$index;p();let s=ge(29),d=p();_("ngTemplateOutlet",s)("ngTemplateOutletContext",Ve(7,Dt,tt(2,Ni,o,t,(e=d.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,d.destinationFormPair().oauthField)))}}function bi(n,i){if(n&1){let e=P();E(0,14,1),a(1,"button",40),C("click",function(){let o=S(e).$implicit,s=p(2);return T(s.addHttpOption(o,0))}),r(),D()}if(n&2){let e=i.$implicit;l(),Je(e.name),et(0)}}function Vi(n,i){n&1&&be(0)}function Li(n,i){if(n&1&&F(0,Vi,1,0,"ng-container",39),n&2){let e,t=i.$implicit,o=i.$index;p();let s=ge(29),d=p();_("ngTemplateOutlet",s)("ngTemplateOutletContext",Ve(7,Dt,tt(2,Ai,o,t,(e=d.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,d.destinationFormPair().oauthField)))}}function Ui(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Bi(n,i){if(n&1&&(a(0,"app-file-tree",43)(1,"label",50),c(2),F(3,Ui,3,1,"spk-tooltip",51),r(),m(4,"input",52),r()),n&2){let e,t=p().$implicit,o=p(2);_("startingPath",o.getFormFieldValue(0,t.formGroupName,t.formView.name))("accepts",t.formView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name)}}function Ki(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Xi(n,i){if(n&1&&(a(0,"app-file-tree",44)(1,"label",50),c(2),F(3,Ki,3,1,"spk-tooltip",51),r(),m(4,"input",52),r()),n&2){let e,t=p().$implicit,o=p(2);_("startingPath",o.getFormFieldValue(0,t.formGroupName,t.formView.name)),l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name)}}function zi(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Hi(n,i){n&1&&(a(0,"spk-icon",53),c(1,"link"),r())}function Wi(n,i){n&1&&(a(0,"spk-icon",53),c(1,"textbox"),r())}function ji(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",50),c(2),F(3,zi,3,1,"spk-tooltip",51),r(),m(4,"input",52),F(5,Hi,2,0,"spk-icon",53)(6,Wi,2,0,"spk-icon",53),r()),n&2){let e,t=p().$implicit;l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name),l(),g(t.formView.type==="Path"?5:6)}}function qi(n,i){if(n&1){let e=P();a(0,"span",57),C("click",function(){S(e);let o=p(2).$implicit,s=p(2);return T(s.oauthStartTokenCreation(o.destinationType))}),c(1,"AuthID"),r()}}function Qi(n,i){n&1&&(a(0,"spk-icon",53),c(1,"password"),r())}function Yi(n,i){if(n&1){let e=P();a(0,"spk-icon",58),C("click",function(){S(e);let o=p(2).$implicit;return T(o.formView.showPassword=!o.formView.showPassword)}),c(1," eye "),r()}}function Zi(n,i){if(n&1){let e=P();a(0,"spk-icon",58),C("click",function(){S(e);let o=p(2).$implicit;return T(o.formView.showPassword=!o.formView.showPassword)}),c(1," eye-slash "),r()}}function Ji(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",50),c(2),r(),m(3,"input",54),F(4,qi,2,0,"span",55)(5,Qi,2,0,"spk-icon",53)(6,Yi,2,0,"spk-icon",56)(7,Zi,2,0,"spk-icon",56),r()),n&2){let e,t=p().$implicit;l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name),_("type",t.formView.showPassword?"text":"password"),l(),g(t.oauthField===t.formView.name?4:5),l(2),g(t.formView.showPassword?6:7)}}function eo(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function to(n,i){if(n&1&&(a(0,"option",61),c(1),r()),n&2){let e=i.$implicit;_("value",e),l(),L(e)}}function no(n,i){if(n&1&&(a(0,"spk-select")(1,"label",50),c(2),F(3,eo,3,1,"spk-tooltip",51),r(),m(4,"input",59),I(5,60),R(6,to,2,2,"option",61,w),$(),r()),n&2){let e,t=p().$implicit;l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name),l(2),v(t.formView.options)}}function io(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function oo(n,i){if(n&1&&(a(0,"option",61),c(1),r()),n&2){let e=i.$implicit;_("value",e.value),l(),wt(" ",e.key," ",e.value?"("+e.value+")":""," ")}}function ro(n,i){if(n&1&&(a(0,"spk-select",45)(1,"label",50),c(2),F(3,io,3,1,"spk-tooltip",51),r(),m(4,"input",59),I(5,60),R(6,oo,2,3,"option",61,w),$(),r()),n&2){let e,t=p().$implicit,o=p(2);_("isFreeText",!0),l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name),l(2),v(t.formView.loadOptions(o.injector)())}}function ao(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function lo(n,i){if(n&1&&(a(0,"option",61),c(1),r()),n&2){let e=i.$implicit;_("value",e),l(),L(e)}}function so(n,i){if(n&1&&(a(0,"div",46)(1,"label",50),c(2),F(3,ao,3,1,"spk-tooltip",51),r(),a(4,"div",62)(5,"spk-form-field"),m(6,"input",63),a(7,"spk-icon",53),c(8,"resize"),r()(),a(9,"spk-select"),m(10,"label")(11,"input",64),I(12,60),R(13,lo,2,2,"option",61,w),$(),r()()()),n&2){let e,t=p().$implicit,o=p(2);_("formGroupName",t.formView.name),l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(3),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(7),v(o.sizeOptions())}}function po(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function co(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",50),c(2),F(3,po,3,1,"spk-tooltip",51),r(),m(4,"input",65),a(5,"spk-icon",53),c(6,"numpad"),r()()),n&2){let e,t=p().$implicit;l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name)}}function _o(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function mo(n,i){if(n&1&&(a(0,"spk-toggle",47)(1,"label",50),c(2),F(3,_o,3,1,"spk-tooltip",51),r(),m(4,"input",66),r()),n&2){let e,t=p().$implicit;l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name)}}function uo(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Fo(n,i){n&1&&(a(0,"spk-option",68),c(1,"None"),r()),n&2&&_("value","None")}function go(n,i){if(n&1&&(a(0,"spk-option",61),c(1),m(2,"spk-checkbox",69),r()),n&2){let e=p().$implicit;_("value",e),l(),b(" ",e," ")}}function Co(n,i){if(n&1&&F(0,Fo,2,1,"spk-option",68)(1,go,3,2,"spk-option",61),n&2){let e=i.$implicit;g(e==="None"?0:1)}}function fo(n,i){if(n&1&&(a(0,"spk-select",48)(1,"label",50),c(2),F(3,uo,3,1,"spk-tooltip",51),r(),m(4,"input",67),I(5,60),R(6,Co,2,1,null,null,w),$(),r()),n&2){let e,t=p().$implicit;_("selectMultiple",!0),l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),U("formControlName",t.formView.name),l(2),v(t.formView.options)}}function So(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function To(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",50),c(2),F(3,So,3,1,"spk-tooltip",51),r(),m(4,"input",52),r()),n&2){let e,t=p().$implicit;l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name)}}function Eo(n,i){if(n&1){let e=P();a(0,"button",70),C("click",function(){S(e);let o=p().$implicit,s=p(2);return T(s.removeFormView(o.formView,0))}),a(1,"spk-icon"),c(2,"x-circle"),r()()}}function Do(n,i){if(n&1&&(a(0,"div",41),I(1,42),F(2,Bi,5,16,"app-file-tree",43)(3,Xi,5,12,"app-file-tree",44)(4,ji,7,12,"spk-form-field")(5,Ji,8,13,"spk-form-field")(6,no,8,11,"spk-select")(7,ro,8,12,"spk-select",45)(8,so,15,11,"div",46)(9,co,7,11,"spk-form-field")(10,mo,5,11,"spk-toggle",47)(11,fo,8,8,"spk-select",48)(12,To,5,11,"spk-form-field"),$(),F(13,Eo,3,0,"button",49),r()),n&2){let e=i.$implicit;he("single-field",e.formGroupName!=="advanced"),l(),_("formGroupName",e.formGroupName),l(),g(e.formView.type==="FileTree"?2:e.formView.type==="FolderTree"?3:e.formView.type==="String"||e.formView.type==="Path"?4:e.formView.type==="Password"?5:e.formView.type==="Enumeration"?6:e.formView.type==="NonValidatedSelectableString"?7:e.formView.type==="Size"?8:e.formView.type==="Integer"?9:e.formView.type==="Boolean"?10:e.formView.type==="Flags"?11:e.formView.type==="Timespan"?12:-1),l(11),g(e.formGroupName==="advanced"?13:-1)}}function No(n,i){if(n&1&&(I(0,25)(1,34),R(2,$i,1,9,"ng-container",null,w),R(4,wi,1,9,"ng-container",null,w),a(6,"app-toggle-card",35),I(7,36),E(8,13),a(9,"spk-menu")(10,"button",37),m(11,"spk-icon"),r(),I(12,23),R(13,Ri,2,1,"button",38,w),$(),r(),D(),$(),R(15,Gi,1,9,"ng-container",null,w),r(),a(17,"app-toggle-card",35),I(18,36),E(19,14),a(20,"spk-menu")(21,"button",37),m(22,"spk-icon"),r(),I(23,23),R(24,bi,2,1,"button",38,w),$(),r(),D(),$(),R(26,Li,1,9,"ng-container",null,w),r(),F(28,Do,14,5,"ng-template",null,1,at),$()()),n&2){let e=p();l(2),v(e.destinationFormPair().custom),l(2),v(e.destinationFormPair().dynamic),l(2),_("disallowToggle",!0),l(4),_("disabled",e.notSelectedAdvancedFormPair().length===0),l(3),v(e.notSelectedAdvancedFormPair()),l(2),v(e.selectedAdvancedFormPair()),l(2),_("disallowToggle",!0),l(4),_("disabled",e.notSelectedHttpOptions().length===0),l(3),v(e.notSelectedHttpOptions()),l(2),v(e.selectedHttpOptions())}}function Ao(n,i){if(n&1){let e=P();a(0,"spk-dialog",71),Gt("isOpenChange",function(o){S(e);let s=p();return vt(s.targetUrlDialogOpen,o)||(s.targetUrlDialogOpen=o),T(o)}),a(1,"header",72)(2,"h2"),A(3,15),r(),a(4,"spk-alert",73),A(5,16),r()(),a(6,"div",74)(7,"spk-form-field"),m(8,"textarea",75),r()(),a(9,"footer",76)(10,"button",27),C("click",function(){S(e);let o=p();return T(o.closeTargetUrlDialog(!1))}),c(11,"Cancel"),r(),a(12,"button",77),C("click",function(){S(e);let o=p();return T(o.closeTargetUrlDialog(!0))}),E(13,17),m(14,"spk-icon"),D(),r()()()}if(n&2){let e=p();Rt("isOpen",e.targetUrlDialogOpen),_("options",bt(3,hi)),l(8),_("formControl",e.targetUrlCtrl)}}var ho=["Bytes","KB","MB","GB","TB","PB"],Et=new ee,en=(n={destinations:[]})=>Et.group({destinations:Et.array(n.destinations)}),tn=({key:n,customGroup:i,dynamicGroup:e,advancedGroup:t})=>Et.group({destinationType:Et.control(n),custom:i,dynamic:e,advanced:t}),It=class n{#e=y(te);#n=y(Ce);#i=y(Lt);#o=y(Be);#t=y(pe);#r=y(Xt);injector=y(Mt);formRef=ue.required("formRef");destinationForm=this.#t.destinationForm;destinationFormPair=this.#t.destinationFormPair;selectedAdvancedFormPair=this.#t.selectedAdvancedFormPair;notSelectedAdvancedFormPair=this.#t.notSelectedAdvancedFormPair;selectedHttpOptions=this.#t.selectedHttpOptions;notSelectedHttpOptions=this.#t.notSelectedHttpOptions;destinationOptions=this.#t.destinationOptions;destinationFormSignal=this.#t.destinationFormSignal;destinationCount=H(()=>this.destinationFormSignal()?.destinations?.length??0);sizeOptions=x(ho);successfulTest=x(!1);getFormFieldValue(i,e,t){return((this.destinationForm.controls.destinations.controls?.[i]).controls?.[e]).controls[t].value}addDestinationFormGroup(i){this.#t.addDestinationFormGroup(i)}addAdvancedFormPair(i,e){this.#t.addAdvancedFormPair(i,e)}removeFormView(i,e){this.#t.removeAdvancedFormPair(i,e)}addHttpOption(i,e){this.#t.addHttpOption(i,e)}targetUrl=H(()=>this.#t.getCurrentTargetUrl()[0]);targetUrlCtrl=new ct;targetUrlInitial=x(null);targetUrlDialogOpen=x(!1);openTargetUrlDialog(){let e=this.#t.getCurrentTargetUrl()[0];this.targetUrlCtrl.setValue(e),this.targetUrlInitial.set(e),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(i=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl.value,t=this.targetUrlInitial();!i||e===t||this.#t.updateFieldsFromTargetUrl(this.targetUrlCtrl.value)}testDestination(i=0){let t=this.#t.getCurrentTargetUrl()[i];t&&this.#o.postApiV1RemoteoperationTest({requestBody:{path:t}}).subscribe({next:()=>{this.successfulTest.set(!0),setTimeout(()=>{this.successfulTest.set(!1)},3e3)},error:o=>{let s=o.error.error.Error;if(s==="missing-folder"&&this.#r.open(Le,{data:{title:"Create folder",message:"The remote destination folder does not exist, do you want to create it?"},closed:d=>{d&&this.#o.postApiV1RemoteoperationCreate({requestBody:{path:t}}).subscribe()}}),s.startsWith("incorrect-cert:")){let d=s.split("incorrect-cert:")[1];this.#r.open(Le,{maxWidth:"500px",data:{title:"Trust the certificate",message:`The server is using a certificate that is not trusted.
1
+ import{a as Xe,b as ve}from"./chunk-QSMEC63O.js";import{a as At,b as Ht}from"./chunk-DNHLTHLR.js";import{a as pt}from"./chunk-UUMKHH4F.js";import{b as W}from"./chunk-KFGIVU27.js";import{a as Ie,b as ne,c as ye,d as ie,e as fe,f as ct,g as Ut,h as Se,i as $e,k as _t,l as Te,m as Me,n as Bt,o as Ee,p as oe,q as re,r as ee,s as mt,t as De}from"./chunk-7SJHYZC5.js";import{a as Be}from"./chunk-PIDBEXSZ.js";import{a as ae,b as ut,d as Kt,e as Xt,g as we,i as dt,k as le,m as Ft,n as zt,p as gt,q as se,v as Re,w as Ke}from"./chunk-EHV3OZDB.js";import{H as Ce,X as te}from"./chunk-J3H4BCHI.js";import{c as Lt}from"./chunk-5XX7BU4I.js";import{ia as st}from"./chunk-5ZK3D2RS.js";import{$b as X,Ab as g,Bb as w,Cb as R,Db as v,E as Ye,Eb as a,Fb as r,Gb as m,Hb as I,Ib as $,Jb as be,Kb as P,Kc as H,Mc as lt,Qb as E,R as xe,Ra as l,Rb as D,Sb as A,Tb as Je,Ub as et,Vb as Oe,Wb as C,X as y,Xb as p,Za as x,_a as ue,_b as U,ac as V,ea as S,fa as T,fb as J,fc as de,gc as Fe,hc as ge,ic as c,ja as Mt,jc as L,kc as b,lb as F,lc as wt,mc as Rt,nc as vt,oc as Gt,p as Qe,qa as Ze,ra as rt,rc as bt,sc as Ve,tc as Vt,uc as tt,vb as _,xb as he,yc as at}from"./chunk-MR4RE3IB.js";import{a as Z,c as $t}from"./chunk-C6Q5SG76.js";function nn(n,i){if(n&1&&(a(0,"p"),c(1),r()),n&2){let e=p();l(),L(e._data().message)}}var on={title:$localize`Are you sure?`,confirmText:$localize`Confirm`,cancelText:$localize`Cancel`},Le=class n{data=rt();_data=H(()=>Z(Z({},on),this.data()));closed=Ze();close(i="confirm"){this.closed.emit(i==="confirm")}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=J({type:n,selectors:[["app-confirm-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:10,vars:4,consts:[["header",""],["content",""],["footer",""],["spk-button","",1,"",3,"click"],["spk-button","",1,"raised","primary",3,"click"]],template:function(e,t){e&1&&(a(0,"header",0)(1,"h3"),c(2),r()(),a(3,"div",1),F(4,nn,2,1,"p"),r(),a(5,"footer",2)(6,"button",3),C("click",function(){return t.close("cancel")}),c(7),r(),a(8,"button",4),C("click",function(){return t.close("confirm")}),c(9),r()()),e&2&&(l(2),L(t._data().title),l(2),g(t._data().message?4:-1),l(3),L(t._data().cancelText),l(2),L(t._data().confirmText))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};var Ct=class n{fromString(i){if(!i)return null;let e=i.match(/(\d+)([smhDWMY])/);return e&&{value:parseInt(e[1]),unit:e[2]}}toString(i,e){return`${i}${e}`}static \u0275fac=function(e){return new(e||n)};static \u0275prov=xe({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ue=class n{#e=y(Be);s3Providers=W(this.getS3Config("Providers"));s3Regions=W(this.getS3Config("Regions"));s3RegionHosts=W(this.getS3Config("RegionHosts"));s3StorageClasses=W(this.getS3Config("StorageClasses"));storjSatellites=W(this.getStorjConfig("Satellites"));storjAuthenticationMethods=W(this.getStorjConfig("AuthenticationMethods"));openstackProviders=W(this.getOpenstackConfig("Providers"));openstackVersions=W(this.getOpenstackConfig("Versions"));gcsLocations=W(this.getGcsConfig("Locations"));gcsStorageClasses=W(this.getGcsConfig("StorageClasses"));getS3Config(i){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-getconfig",requestBody:{"s3-config":i}}).pipe(Qe(e=>this.#n(e)))}createS3IamUser(i,e){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"CanCreateUser","s3-username":i,"s3-password":e}})}createS3PolicyIAM(i){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"GetPolicyDoc",path:i}})}getStorjConfig(i){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"storj-getconfig",requestBody:{"storj-config":i}}).pipe(Qe(e=>this.#n(e)))}getOpenstackConfig(i){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"openstack-getconfig",requestBody:{"openstack-config":i}}).pipe(Qe(e=>this.#n(e)))}getGcsConfig(i){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"gcs-getconfig",requestBody:{"gcs-config":i}}).pipe(Qe(e=>this.#n(e)))}#n(i){return(i.Result&&typeof i.Result=="object"&&Object.entries(i.Result).map(([e,t])=>({key:e,value:t})))??[]}static \u0275fac=function(e){return new(e||n)};static \u0275prov=xe({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ge=new ee,nt={file:{customFields:{path:{type:"FolderTree",name:"path",shortDescription:"File path",longDescription:"The path to store the backup",formElement:n=>Ge.control(n??"")}}},ssh:{customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"The server to connect to",formElement:n=>Ge.control(n??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"The port to connect to",formElement:n=>Ge.control(n??"",[ye.required,ye.max(65535)])},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:n=>Ge.control(n??"")}},dynamicFields:["auth-username"],advancedFields:[{type:"FileTree",name:"ssh-keyfile",accepts:".key,",shortDescription:"This is a path to a private key file locally on the machine",longDescription:"This is a path to a private key file locally on the machine"}]},s3:{customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:n=>Ge.control(n??"")},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:n=>Ge.control(n??"")}},dynamicFields:[{name:"s3-server-name",shortDescription:"Server",type:"NonValidatedSelectableString",loadOptions:n=>n.get(Ue).s3Providers},"use-ssl","auth-username","auth-password"],advancedFields:[{name:"s3-client",type:"Enumeration",options:["aws","minio"]},{name:"s3-storage-class",type:"NonValidatedSelectableString",loadOptions:n=>n.get(Ue).s3StorageClasses}]},gcs:{oauthField:"authid",customFields:{path:{type:"Path",name:"path",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:n=>Ge.control(n??"")}},dynamicFields:[{name:"gcs-location",type:"NonValidatedSelectableString",loadOptions:n=>n.get(Ue).gcsLocations},{name:"gcs-storage-class",type:"NonValidatedSelectableString",loadOptions:n=>n.get(Ue).gcsStorageClasses},"authid"]},googledrive:{oauthField:"authid",customFields:{path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:n=>Ge.control(n??"")}},dynamicFields:["authid"]}};function He(n,i){let e={},t={};return i.searchParams.forEach((o,s)=>{nt[n].dynamicFields?.includes(s)?t[s]=decodeURIComponent(o):e[s]=decodeURIComponent(o)}),{advanced:e,dynamic:t}}function it(n){let i=n.map(([e,t])=>`${e}=${t?encodeURIComponent(t.toString()):""}`).join("&");return i?"?"+i:""}var We={file:{to:n=>{let i=it([...Object.entries(n.advanced),...Object.entries(n.dynamic)]);return`${n.destinationType}://${n.custom.path}${i}`},from:(n,i,e)=>{let t=e.indexOf("file:///")===0,o=e.split(t?"///":"//")[1].substring(0,1)+i.hostname.substring(1);return Z({destinationType:n,custom:{path:`${t?"/":""}${o}${i.pathname}`}},He(n,i))}},ssh:{to:n=>{let i=it([...Object.entries(n.advanced),...Object.entries(n.dynamic)]);return`${n.destinationType}://${n.custom.server}${n.custom.port?":"+n.custom.port:""}${n.custom.path.startsWith("/")?n.custom.path:"/"+n.custom.path}${i}`},from:(n,i,e)=>Z({destinationType:n,custom:{server:i.hostname,port:i.port,path:i.pathname}},He(n,i))},s3:{to:n=>{let i=it([...Object.entries(n.advanced),...Object.entries(n.dynamic)]);return`${n.destinationType}://${n.custom.bucket}${n.custom.path.startsWith("/")?n.custom.path:"/"+n.custom.path}${i}`},from:(n,i,e)=>Z({destinationType:n,custom:{path:i.pathname,bucket:i.hostname}},He(n,i))},gcs:{to:n=>{let i=it([...Object.entries(n.advanced),...Object.entries(n.dynamic)]);return`${n.destinationType}://${n.custom.path}${i}`},from:(n,i,e)=>{let{advanced:t,dynamic:o}=He(n,i);return{destinationType:n,custom:{path:i.hostname+i.pathname},dynamic:o,advanced:t}}},googledrive:{to:n=>{let i=n.custom.path,e=it([...Object.entries(n.advanced),...Object.entries(n.dynamic)]);return`${n.destinationType}://${i}${e}`},from:(n,i,e)=>{let{advanced:t,dynamic:o}=He(n,i);return{destinationType:n,custom:{path:i.hostname+i.pathname},dynamic:o,advanced:t}}},fallbackMapper:{to:n=>"",from:(n,i,e)=>Z({destinationType:n},He(n,i))}};function ft(n){let i=n.destinationType;return!i||!We.hasOwnProperty(i)?We.fallbackMapper.to(n)??"":We[i].to(n)??""}function ht(n){let i=URL.canParse(n),e=n.split("://")[0],t="http://"+n.split("://")[1],o=new URL(t);if(!We.hasOwnProperty(e))return We.fallbackMapper.from(e,o);if(!i)throw new Error("Invalid target path");return We[e].from(e,o,n)}var Wt=/[a-zA-Z0-9_\-\+\.!@#$%^&*?_~()-]/,St=class n{generate(i,e=Wt){let t;do t=this.generatePassword(i,e);while(this.calculatePasswordStrength(t)<5);return t}generatePassword(i,e=Wt){let t=this;return Array.apply(null,{length:i}).map(()=>{let o;for(;;)if(o=String.fromCharCode(t.#e()),e.test(o))return o},this).join("")}calculatePasswordStrength(i){let e=1;return i.length>=8&&e++,i.match(/[a-z]/)&&i.match(/[A-Z]/)&&e++,i.match(/\d+/)&&e++,i.match(/.[!,@,#,$,%,^,&,*,?,_,~,(,),-]/)&&e++,Math.min(e,5)}#e(){if(window.crypto&&window.crypto.getRandomValues){let i=new Uint8Array(1);return window.crypto.getRandomValues(i),i[0]}else if(window.msCrypto&&window.msCrypto.getRandomValues){let i=new Uint8Array(1);return window.msCrypto.getRandomValues(i),i[0]}else return Math.floor(Math.random()*256)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=xe({token:n,factory:n.\u0275fac,providedIn:"root"})};var rn=["formRef"];function an(n,i){if(n&1&&(a(0,"option",27),c(1),r()),n&2){let e=i.$implicit;_("value",e.Key),l(),L(e.DisplayName)}}function ln(n,i){if(n&1&&m(0,"spk-progress-bar",38),n&2){let e=p(3);he("warn",e.calculatePasswordStrength()===1)("tertiary",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),_("value",e.calculatePasswordStrength()*(100/5))}}function sn(n,i){n&1&&(a(0,"span",33),A(1,9),r())}function pn(n,i){n&1&&(E(0,7,1),m(1,"spk-icon"),D())}function cn(n,i){n&1&&(E(0,7,2),m(1,"spk-icon"),D())}function _n(n,i){n&1&&(E(0,10,1),m(1,"spk-icon",40),D())}function mn(n,i){n&1&&(E(0,10,2),m(1,"spk-icon"),D())}function un(n,i){if(n&1){let e=P();a(0,"button",39),C("click",function(){S(e);let o=p(3);return T(o.copyPassword())}),E(1,10),F(2,_n,2,0)(3,mn,2,0),D(),r()}if(n&2){let e=p(3);l(2),g(e.copiedPassword()?2:3)}}function dn(n,i){n&1&&(a(0,"spk-alert",37),A(1,11),r())}function Fn(n,i){if(n&1){let e=P();a(0,"div",28)(1,"spk-form-field")(2,"label",29),E(3,6),m(4,"sup"),D(),r(),m(5,"input",30),r(),F(6,ln,1,9,"spk-progress-bar",31),a(7,"spk-form-field"),m(8,"input",32),F(9,sn,2,0,"span",33),r(),a(10,"div",34)(11,"button",35),C("click",function(){S(e);let o=p(2);return T(o.showPassword.set(!o.showPassword()))}),E(12,7),F(13,pn,2,0)(14,cn,2,0),D(),r(),a(15,"button",35),C("click",function(){S(e);let o=p(2);return T(o.generatePassword())}),E(16,8),m(17,"spk-icon"),D(),r(),F(18,un,4,1,"button",36),r(),F(19,dn,2,0,"spk-alert",37),r()}if(n&2){let e=p(2);l(5),_("type",e.showPassword()?"text":"password"),l(),g(e.generalForm.value.password?6:-1),l(2),_("type",e.showPassword()?"text":"password"),l(),g(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),l(4),g(e.showPassword()?13:14),l(5),g(e.showCopyPassword()?18:-1),l(),g(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function gn(n,i){if(n&1&&(a(0,"spk-select",24)(1,"label",25),A(2,5),r(),m(3,"input",26),R(4,an,2,2,"option",27,w),r(),F(6,Fn,20,7,"div",28)),n&2){let e=p();_("displayFn",e.displayFn()),l(4),v(e.encryptionOptions()),l(2),g(e.encryptionFieldSignal()!==""?6:-1)}}function Cn(n,i){if(n&1&&(a(0,"button",22),E(1,12),m(2,"spk-icon"),D(),r()),n&2){let e=p();_("disabled",e.generalForm.invalid)}}function fn(n,i){if(n&1&&(a(0,"spk-tooltip",23)(1,"button",22),E(2,13),m(3,"spk-icon"),D(),r()()),n&2){let e=p();_("disabled",!(e.showCopyPassword()&&!e.copiedPassword())),l(),_("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var je=new ee,jt=(n={name:"",description:"",encryption:"",password:"",repeatPassword:""})=>je.group({name:je.control(n.name,[ye.required]),description:je.control(n.description),encryption:je.control(n.encryption,[Ht()]),password:je.control(n.password,[At(i=>i?.value.encryption!=="",[ye.required])]),repeatPassword:je.control(n.repeatPassword,[At(i=>i?.value.encryption!=="",[ye.required])])}),yt={Key:"",DisplayName:"None"},Ot=class n{#e=y(te);#n=y(Ce);#i=y(St);#o=y(pe);#t=y(pt);formRef=ue.required("formRef");generalForm=this.#o.generalForm;generalFormSignal=this.#o.generalFormSignal;encryptionFieldSignal=this.#o.encryptionFieldSignal;encryptionOptions=this.#o.encryptionOptions;isNew=this.#o.isNew;showPassword=x(!1);copiedPassword=x(!1);showCopyPassword=x(!1);encryptionEffect=lt(()=>{this.encryptionFieldSignal()===""&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});calculatePasswordStrength=H(()=>{let e=this.generalFormSignal()?.password??"";return this.#i.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#o.exit()}async copyPassword(){let i=this.generalForm.controls.password.value;await this.#r(i??""),this.copiedPassword.set(!0)}async#r(i){try{await navigator.clipboard.writeText(i)}catch{try{let t=document.createElement("textarea");t.value=i,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}catch(t){console.error("Failed to copy text: ",t)}}}displayFn(){let i=this.#t.systemInfo()?.EncryptionModules??[];return e=>{let t=[yt,...i].find(o=>o.Key===e);return t?`${t.DisplayName}`:""}}generatePassword(){this.copiedPassword.set(!1);let i=this.#i.generate(16);this.generalForm.controls.password.setValue(i),this.generalForm.controls.repeatPassword.setValue(i),this.showCopyPassword.set(!0)}next(){this.#e.navigate(["destination"],{relativeTo:this.#n.parent})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=J({type:n,selectors:[["app-general"]],viewQuery:function(e,t){e&1&&de(t.formRef,rn,5),e&2&&Fe()},decls:20,vars:3,consts:()=>{let i;i=$localize`Your backup name`;let e;e=$localize`Your backup description`;let t;t=$localize`General backup settings`;let o;o=$localize` Backup name ${"\uFFFD#7\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#7\uFFFD"}:CLOSE_SUPERSCRIPT:`;let s;s=$localize`Backup description`;let d;d=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Exit `;let k;k=$localize`Encryption`;let M;M=$localize`Encryption`;let h;h=$localize`Password`;let Q;Q=$localize`Repeat password`;let Y;Y=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let B;B=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,B=Oe(B);let K;K=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Generate password `;let j;j=$localize`Passwords do not match`;let N;N=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SPK_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,N=Oe(N);let u;u=$localize` Tip: Be sure to save your password. If you loose it you will lose access to your backups. `;let f;f=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let z;return z=$localize` Continue ${"\uFFFD#3\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],t,o,s,d,M,Y,B,K,j,N,u,f,z,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],["for","backupName"],["type","text","tabindex","1","placeholder",i,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","spk-button","",3,"click"],["spk-button","","type","submit",1,"raised","primary",3,"disabled"],["message","Remember to copy the password",1,"primary",3,"disabled"],[3,"displayFn"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",k,"formControlName","encryption"],[3,"value"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",h,"formControlName","password",3,"type"],[1,"raised",3,"warn","tertiary","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",Q,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["spk-button","","type","button",1,"small",3,"click"],["spk-button","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["spk-button","","type","button",1,"small","copy",3,"click"],[1,"spk-success"]]},template:function(e,t){if(e&1){let o=P();a(0,"form",14,0),C("submit",function(){return S(o),T(t.next())}),a(2,"h3",15),A(3,1),r(),a(4,"spk-form-field")(5,"label",16),E(6,2),m(7,"sup"),D(),r(),m(8,"input",17),r(),a(9,"spk-form-field")(10,"label",18),A(11,3),r(),m(12,"textarea",19),r(),F(13,gn,7,2),a(14,"div",20)(15,"button",21),C("click",function(){return S(o),T(t.exit())}),E(16,4),m(17,"spk-icon"),D(),r(),F(18,Cn,3,1,"button",22)(19,fn,4,2,"spk-tooltip",23),r()()}e&2&&(_("formGroup",t.generalForm),l(13),g(t.isNew()?13:-1),l(5),g(t.encryptionFieldSignal()===""?18:19))},dependencies:[De,Se,oe,re,ne,ie,fe,Te,Ee,le,se,we,ae,zt,ut,Ke],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--warn-500)}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.copy[_ngcontent-%COMP%] spk-icon.spk-success[_ngcontent-%COMP%]{color:var(--success-500)}"],changeDetection:0})};var Sn=["formRef"],Tn=(n,i)=>({index:n,formView:i,formGroupName:"advancedOptions",destinationType:null,oauthField:null}),En=n=>({$implicit:n});function Dn(n,i){if(n&1&&(a(0,"option",18),c(1),r()),n&2){let e=i.$implicit;_("value",e),l(),L(e)}}function Nn(n,i){if(n&1&&(a(0,"option",18),c(1),r()),n&2){let e=i.$implicit;_("value",e.value),l(),L(e.name)}}function An(n,i){if(n&1){let e=P();E(0,7,1),a(1,"button",30,2),C("click",function(){let o=S(e).$implicit,s=p();return T(s.addNewOption(o))}),r(),D()}if(n&2){let e=i.$implicit;l(),Je(e.name),et(0)}}function hn(n,i){n&1&&be(0)}function On(n,i){if(n&1&&F(0,hn,1,0,"ng-container",31),n&2){let e=i.$implicit,t=i.$index;p();let o=ge(36);_("ngTemplateOutlet",o)("ngTemplateOutletContext",Ve(5,En,Vt(2,Tn,t,e)))}}function yn(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Pn(n,i){if(n&1&&(a(0,"app-file-tree",34)(1,"label",40),c(2),F(3,yn,3,1,"spk-tooltip",41),r(),m(4,"input",42),r()),n&2){let e,t=p().$implicit,o=p();_("startingPath",o.getFormFieldValue(0,t.formGroupName,t.formView.name))("accepts",t.formView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name)}}function kn(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function xn(n,i){if(n&1&&(a(0,"app-file-tree",35)(1,"label",40),c(2),F(3,kn,3,1,"spk-tooltip",41),r(),m(4,"input",42),r()),n&2){let e,t=p().$implicit,o=p();_("startingPath",o.getFormFieldValue(0,t.formGroupName,t.formView.name)),l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name)}}function In(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function $n(n,i){n&1&&(a(0,"spk-icon",43),c(1,"link"),r())}function Mn(n,i){n&1&&(a(0,"spk-icon",43),c(1,"textbox"),r())}function wn(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",40),c(2),F(3,In,3,1,"spk-tooltip",41),r(),m(4,"input",42),F(5,$n,2,0,"spk-icon",43)(6,Mn,2,0,"spk-icon",43),r()),n&2){let e,t=p().$implicit;l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name),l(),g(t.formView.type==="Path"?5:6)}}function Rn(n,i){if(n&1){let e=P();a(0,"span",47),C("click",function(){S(e);let o=p(2).$implicit,s=p();return T(s.oauthStartTokenCreation(o.formViewType))}),c(1,"AuthID"),r()}}function vn(n,i){n&1&&(a(0,"spk-icon",43),c(1,"password"),r())}function Gn(n,i){if(n&1){let e=P();a(0,"spk-icon",48),C("click",function(){S(e);let o=p(2).$implicit;return T(o.formView.showPassword=!o.formView.showPassword)}),c(1," eye "),r()}}function bn(n,i){if(n&1){let e=P();a(0,"spk-icon",48),C("click",function(){S(e);let o=p(2).$implicit;return T(o.formView.showPassword=!o.formView.showPassword)}),c(1," eye-slash "),r()}}function Vn(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",40),c(2),r(),m(3,"input",44),F(4,Rn,2,0,"span",45)(5,vn,2,0,"spk-icon",43)(6,Gn,2,0,"spk-icon",46)(7,bn,2,0,"spk-icon",46),r()),n&2){let e,t=p().$implicit;l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name),_("type",t.formView.showPassword?"text":"password"),l(),g(t.oauthField===t.formView.name?4:5),l(2),g(t.formView.showPassword?6:7)}}function Ln(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Un(n,i){if(n&1&&(a(0,"option",18),c(1),r()),n&2){let e=i.$implicit;_("value",e),l(),L(e)}}function Bn(n,i){if(n&1&&(a(0,"spk-select")(1,"label",40),c(2),F(3,Ln,3,1,"spk-tooltip",41),r(),m(4,"input",49),I(5,17),R(6,Un,2,2,"option",18,w),$(),r()),n&2){let e,t=p().$implicit;l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name),l(2),v(t.formView.options)}}function Kn(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Xn(n,i){if(n&1&&(a(0,"option",18),c(1),r()),n&2){let e=i.$implicit;_("value",e),l(),L(e)}}function zn(n,i){if(n&1&&(a(0,"div",36)(1,"label",40),c(2),F(3,Kn,3,1,"spk-tooltip",41),r(),a(4,"div",50)(5,"spk-form-field"),m(6,"input",51),a(7,"spk-icon",43),c(8,"resize"),r()(),a(9,"spk-select"),m(10,"label")(11,"input",52),I(12,17),R(13,Xn,2,2,"option",18,w),$(),r()()()),n&2){let e,t=p().$implicit,o=p();_("formGroupName",t.formView.name),l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(3),X("id","destination-",t.formGroupName,"-",t.index,""),l(7),v(o.sizeOptions())}}function Hn(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Wn(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",40),c(2),F(3,Hn,3,1,"spk-tooltip",41),r(),m(4,"input",53),a(5,"spk-icon",43),c(6,"numpad"),r()()),n&2){let e,t=p().$implicit;l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name)}}function jn(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function qn(n,i){if(n&1&&(a(0,"spk-toggle",37)(1,"label",40),c(2),F(3,jn,3,1,"spk-tooltip",41),r(),m(4,"input",54),r()),n&2){let e,t=p().$implicit;l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name)}}function Qn(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Yn(n,i){n&1&&(a(0,"spk-option",56),c(1,"None"),r()),n&2&&_("value","None")}function Zn(n,i){if(n&1&&(a(0,"spk-option",18),c(1),m(2,"spk-checkbox",57),r()),n&2){let e=p().$implicit;_("value",e),l(),b(" ",e," ")}}function Jn(n,i){if(n&1&&F(0,Yn,2,1,"spk-option",56)(1,Zn,3,2,"spk-option",18),n&2){let e=i.$implicit;g(e==="None"?0:1)}}function ei(n,i){if(n&1&&(a(0,"spk-select",38)(1,"label",40),c(2),F(3,Qn,3,1,"spk-tooltip",41),r(),m(4,"input",55),I(5,17),R(6,Jn,2,1,null,null,w),$(),r()),n&2){let e,t=p().$implicit;_("selectMultiple",!0),l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),U("formControlName",t.formView.name),l(2),v(t.formView.options)}}function ti(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function ni(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",40),c(2),F(3,ti,3,1,"spk-tooltip",41),r(),m(4,"input",42),r()),n&2){let e,t=p().$implicit;l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name)}}function ii(n,i){if(n&1){let e=P();a(0,"div",32),I(1,33),F(2,Pn,5,14,"app-file-tree",34)(3,xn,5,10,"app-file-tree",35)(4,wn,7,10,"spk-form-field")(5,Vn,8,11,"spk-form-field")(6,Bn,8,9,"spk-select")(7,zn,15,9,"div",36)(8,Wn,7,9,"spk-form-field")(9,qn,5,9,"spk-toggle",37)(10,ei,8,7,"spk-select",38)(11,ni,5,9,"spk-form-field"),$(),a(12,"button",39),C("click",function(){let o=S(e).$implicit,s=p();return T(s.removeFormView(o.formView,0))}),a(13,"spk-icon"),c(14,"x-circle"),r()()()}if(n&2){let e=i.$implicit;l(),_("formGroupName",e.formGroupName),l(),g(e.formView.type==="FileTree"?2:e.formView.type==="FolderTree"?3:e.formView.type==="String"||e.formView.type==="Path"?4:e.formView.type==="Password"?5:e.formView.type==="Enumeration"?6:e.formView.type==="Size"?7:e.formView.type==="Integer"?8:e.formView.type==="Boolean"?9:e.formView.type==="Flags"?10:e.formView.type==="Timespan"?11:-1)}}var Pe=new ee,oi=["Bytes","KB","MB","GB","TB","PB"],ri=[{value:"",name:"Keep all backups"},{value:"time",name:"Delete backups that are older than"},{value:"versions",name:"Keep a specific number of backups"},{value:"smart",name:"Smart backup retention"},{value:"custom",name:"Custom backup retention"}],qt=(n={remoteVolumeSize:50,size:"MB",backupRetention:"",advancedOptions:[]})=>Pe.group({remoteVolumeSize:Pe.group({size:Pe.control(n.remoteVolumeSize),unit:Pe.control(n.size)}),backupRetention:Pe.control(n.backupRetention),advancedOptions:Pe.group({})}),gr=(n,i)=>Pe.group({name:Pe.control(n),value:Pe.control(i)}),Pt=class n{#e=y(pe);#n=y(te);#i=y(Ce);formRef=ue.required("formRef");optionsForm=this.#e.optionsForm;selectedOptions=this.#e.selectedOptions;nonSelectedOptions=this.#e.nonSelectedOptions;isSubmitting=this.#e.isSubmitting;sizeOptions=x(oi);rentationOptions=x(ri);oauthStartTokenCreation(i){}getFormFieldValue(i,e,t){return this.optionsForm.controls.advancedOptions.controls[t].value}removeFormView(i,e){this.#e.removeOptionFromFormGroup(i)}addNewOption(i){this.#e.addOptionToFormGroup(i)}retentionOptionDisplayFn(){let i=this.rentationOptions();return e=>{let t=i.find(o=>o.value===e);return t?t.name:""}}displayFn(){let i=this.#e.advancedOptions();return e=>{let t=i.find(o=>o.name===e);return t?`${t.name}`:""}}goBack(){this.#n.navigate(["schedule"],{relativeTo:this.#i.parent})}submit(){this.#e.submit()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=J({type:n,selectors:[["app-options"]],viewQuery:function(e,t){e&1&&de(t.formRef,Sn,5),e&2&&Fe()},decls:44,vars:5,consts:()=>{let i;i=$localize`Select an option...`;let e;e=$localize`Options`;let t;t=$localize`Remote volume size`;let o;o=$localize` The backups will be split up into multiple files called volumes. Here you can set the maximum size of the individual volume files. ${"\uFFFD#17\uFFFD"}:START_LINK:Read more${"\uFFFD/#17\uFFFD"}:CLOSE_LINK:`;let s;s=$localize`Backup retention`;let d;d=$localize` Advanced options ${"\uFFFD#27\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#28\uFFFD"}:START_TAG_BUTTON: Add advanced option ${"\uFFFD#29\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#29\uFFFD"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#28\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#30\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD*32:1\uFFFD"}:START_BLOCK_FOR:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON_1:${"\uFFFD0:1\uFFFD"}:INTERPOLATION:${"[\uFFFD/#28\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/*32:1\uFFFD"}:CLOSE_BLOCK_FOR:${"\uFFFD/#30\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#27\uFFFD"}:CLOSE_TAG_SPK_MENU:`,d=Oe(d);let k;k=$localize`${"\uFFFD#40\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#40\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let M;return M=$localize`${"\uFFFD#43\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#43\uFFFD"}:CLOSE_TAG_SPK_ICON: Submit `,[["formRef",""],["fieldTemplate",""],["option",""],e,t,o,s,d,k,M,[3,"submit","formGroup"],[1,"title-30"],[1,"remote-volume-wrap"],["formGroupName","remoteVolumeSize",1,"row-inputs"],["for","size"],["type","number","id","size","formControlName","size"],["type","text","placeholder",i,"formControlName","unit"],["options",""],[3,"value"],["href","#",1,"spk-primary"],[3,"displayFn"],["type","text","formControlName","backupRetention"],[3,"disallowToggle"],["title",""],["spk-button","","type","button",1,"outlined","small"],["menu",""],["type","button"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["type","button",3,"click"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"field-row"],[3,"formGroupName"],[3,"startingPath","accepts","showFiles","showHiddenNodes","selectFiles"],[3,"startingPath"],[1,"form-column",3,"formGroupName"],[1,"primary","raised"],[1,"primary",3,"selectMultiple"],["spk-button","","type","button",1,"outlined",3,"click"],[3,"for"],[1,"primary",3,"message"],["type","text",3,"id","formControlName"],["prefix",""],["autocomplete","off",3,"type","id","formControlName"],["prefix","",1,"link"],["suffix","",1,"clickable"],["prefix","",1,"link",3,"click"],["suffix","",1,"clickable",3,"click"],["type","search",3,"id","formControlName"],[1,"form-row"],["type","number","formControlName","size",3,"id"],["type","search","formControlName","unit"],["type","number",3,"id","formControlName"],["type","checkbox",3,"id","formControlName"],["type","text","id","text",3,"formControlName"],["deselect","",3,"value"],[1,"raised","primary"]]},template:function(e,t){if(e&1){let o=P();a(0,"form",10,0),C("submit",function(){return S(o),T(t.submit())}),a(2,"h3",11),A(3,3),r(),a(4,"div",12)(5,"div",13)(6,"spk-form-field")(7,"label",14),A(8,4),r(),m(9,"input",15),r(),a(10,"spk-select"),m(11,"input",16),I(12,17),R(13,Dn,2,2,"option",18,w),$(),r()(),a(15,"p"),E(16,5),m(17,"a",19),D(),r()(),a(18,"spk-select",20)(19,"label",14),A(20,6),r(),m(21,"input",21),R(22,Nn,2,2,"option",18,w),r(),a(24,"app-toggle-card",22),I(25,23),E(26,7),a(27,"spk-menu")(28,"button",24),m(29,"spk-icon"),r(),I(30,25),R(31,An,3,1,"button",26,w),$(),r(),D(),$(),R(33,On,1,7,"ng-container",null,w),r(),F(35,ii,15,2,"ng-template",null,1,at),a(37,"div",27)(38,"button",28),C("click",function(){return S(o),T(t.goBack())}),E(39,8),m(40,"spk-icon"),D(),r(),a(41,"button",29),E(42,9),m(43,"spk-icon"),D(),r()()()}e&2&&(_("formGroup",t.optionsForm),l(13),v(t.sizeOptions()),l(5),_("displayFn",t.retentionOptionDisplayFn()),l(4),v(t.rentationOptions()),l(2),_("disallowToggle",!0),l(7),v(t.nonSelectedOptions()),l(2),v(t.selectedOptions()),l(8),he("loader",t.isSubmitting()))},dependencies:[De,Se,oe,re,ne,$e,Ie,ie,fe,Te,Ee,Me,st,Ft,se,we,ae,le,Re,dt,gt,Ke,Xe,ve],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.form-column[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.form-column[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 40px;align-items:flex-end}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var ai=["formRef"];function li(n,i){if(n&1&&(a(0,"option",39),c(1),r()),n&2){let e=i.$implicit;_("value",e.key),l(),L(e.label)}}function si(n,i){if(n&1){let e=P();a(0,"div",26)(1,"spk-form-field")(2,"label",27),A(3,8),r(),a(4,"input",28,1),C("focus",function(){S(e);let o=ge(5);return T(o.showPicker())}),r(),a(6,"spk-icon",29),c(7,"clock"),r()(),a(8,"spk-form-field"),m(9,"label",30),a(10,"input",31,2),C("focus",function(){S(e);let o=ge(11);return T(o.showPicker())}),r(),a(12,"spk-icon",29),c(13,"calendar"),r()()(),I(14,32),a(15,"div",33)(16,"spk-form-field")(17,"label",34),A(18,9),r(),m(19,"input",35),r(),a(20,"spk-select",36),m(21,"input",37),I(22,38),R(23,li,2,2,"option",39,w),$(),r()(),a(25,"app-toggle-card",40),I(26,41),A(27,10),$(),a(28,"div",42)(29,"spk-toggle",21),E(30,11),m(31,"input",43),D(),r(),a(32,"spk-toggle",21),E(33,12),m(34,"input",44),D(),r(),a(35,"spk-toggle",21),E(36,13),m(37,"input",45),D(),r(),a(38,"spk-toggle",21),E(39,14),m(40,"input",46),D(),r(),a(41,"spk-toggle",21),E(42,15),m(43,"input",47),D(),r(),a(44,"spk-toggle",21),E(45,16),m(46,"input",48),D(),r(),a(47,"spk-toggle",21),E(48,17),m(49,"input",49),D(),r()()(),$()}if(n&2){let e=p();l(20),_("displayFn",e.displayFn),l(3),v(e.unitOptions),l(2),_("disallowToggle",!0)}}var q=new ee,Qt=[{key:"s",label:$localize`Seconds`},{key:"m",label:$localize`Minutes`},{key:"h",label:$localize`Hours`},{key:"D",label:$localize`Days`},{key:"W",label:$localize`Weeks`},{key:"M",label:$localize`Months`},{key:"Y",label:$localize`Years`}],Yt=(n={autoRun:!1,nextTime:{time:"13:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!1,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}})=>q.group({autoRun:q.control(n.autoRun),nextTime:q.group({time:q.control(n.nextTime.time),date:q.control(n.nextTime.date)}),runAgain:q.group({repeatValue:q.control(n.runAgain.repeatValue),repeatUnit:q.control(n.runAgain.repeatUnit),allowedDays:q.group({mon:q.control(n.runAgain.allowedDays.mon),tue:q.control(n.runAgain.allowedDays.tue),wed:q.control(n.runAgain.allowedDays.wed),thu:q.control(n.runAgain.allowedDays.thu),fri:q.control(n.runAgain.allowedDays.fri),sat:q.control(n.runAgain.allowedDays.sat),sun:q.control(n.runAgain.allowedDays.sun)})})}),kt=class n{#e=y(pe);#n=y(te);#i=y(Ce);formRef=ue.required("formRef");scheduleForm=this.#e.scheduleForm;scheduleFormSignal=this.#e.scheduleFormSignal;unitOptions=Qt;displayFn(i){let e=Qt.find(t=>t.key===i);return e?`${e.label}`:""}goBack(){this.#n.navigate(["source-data"],{relativeTo:this.#i.parent})}next(){this.#n.navigate(["options"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=J({type:n,selectors:[["app-schedule"]],viewQuery:function(e,t){e&1&&de(t.formRef,ai,5),e&2&&Fe()},decls:18,vars:2,consts:()=>{let i;i=$localize`Schedule`;let e;e=$localize` Automatically run backups ${"\uFFFD#7\uFFFD\uFFFD/#7\uFFFD"}:TAG_INPUT:`;let t;t=$localize`If a date was missed, the job will run as soon as possible.`;let o;o=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let s;s=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let d;d=$localize`Next time`;let k;k=$localize`Run again every`;let M;M=$localize`Allowed days`;let h;h=$localize` Monday ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let Q;Q=$localize` Tuesday ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let Y;Y=$localize` Wednesday ${"\uFFFD#37\uFFFD\uFFFD/#37\uFFFD"}:TAG_INPUT:`;let B;B=$localize` Thursday ${"\uFFFD#40\uFFFD\uFFFD/#40\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Friday ${"\uFFFD#43\uFFFD\uFFFD/#43\uFFFD"}:TAG_INPUT:`;let j;j=$localize` Saturday ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let N;return N=$localize` Sunday ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`,[["formRef",""],["timeRef",""],["dateRef",""],i,e,t,o,s,d,k,M,h,Q,Y,B,K,j,N,[3,"submit","formGroup"],[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox","formControlName","autoRun"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["formGroupName","nextTime",1,"row-inputs"],["for","time"],["type","time","id","time","formControlName","time",3,"focus"],["suffix",""],["for","date"],["type","date","id","date","formControlName","date",3,"focus"],["formGroupName","runAgain"],[1,"row-inputs"],["for","repeatValue"],["type","number","id","repeatValue","formControlName","repeatValue"],[3,"displayFn"],["type","text","id","repeatUnit","formControlName","repeatUnit"],["options",""],[3,"value"],["formGroupName","allowedDays",3,"disallowToggle"],["title",""],[1,"days-wrap"],["type","checkbox","formControlName","mon"],["type","checkbox","formControlName","tue"],["type","checkbox","formControlName","wed"],["type","checkbox","formControlName","thu"],["type","checkbox","formControlName","fri"],["type","checkbox","formControlName","sat"],["type","checkbox","formControlName","sun"]]},template:function(e,t){if(e&1){let o=P();a(0,"form",18,0),C("submit",function(){return S(o),T(t.next())}),a(2,"h3",19),A(3,3),r(),a(4,"div",20)(5,"spk-toggle",21),E(6,4),m(7,"input",22),D(),r(),a(8,"p"),A(9,5),r()(),F(10,si,50,2),a(11,"div",23)(12,"button",24),C("click",function(){return S(o),T(t.goBack())}),E(13,6),m(14,"spk-icon"),D(),r(),a(15,"button",25),E(16,7),m(17,"spk-icon"),D(),r()()()}if(e&2){let o;_("formGroup",t.scheduleForm),l(10),g((o=t.scheduleFormSignal())!=null&&o.autoRun?10:-1)}},dependencies:[De,Se,oe,re,ne,$e,Ie,ie,fe,Te,Ee,Me,le,se,Re,ae,we,ve],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};function pi(n,i){if(n&1&&(a(0,"option",3),c(1),r()),n&2){let e=i.$implicit;_("value",e.value),l(),L(e.key)}}function ci(n,i){if(n&1&&(a(0,"option",3),c(1),r()),n&2){let e=i.$implicit;_("value",e.value),l(),L(e.key)}}function _i(n,i){if(n&1){let e=P();a(0,"spk-select",0)(1,"input",6),C("ngModelChange",function(o){S(e);let s=p(2);return T(s.updateStateExpression(o))}),r(),R(2,ci,2,2,"option",3,w),r()}if(n&2){let e,t=p(2);_("hideClearButton",!0)("displayFn",t.displayFn),l(),_("ngModel",(e=t.pathState())==null?null:e.expression),l(),v(t.fileGroupOptions())}}function mi(n,i){if(n&1){let e=P();a(0,"spk-form-field")(1,"input",6),C("ngModelChange",function(o){S(e);let s=p(2);return T(s.updateStateExpression(o))}),r()()}if(n&2){let e,t=p(2);l(),_("ngModel",(e=t.pathState())==null?null:e.expression)}}function ui(n,i){if(n&1){let e=P();a(0,"spk-select",0)(1,"input",1),C("ngModelChange",function(o){S(e);let s=p();return T(s.updateStateType(o))}),r(),I(2,2),R(3,pi,2,2,"option",3,w),$(),r(),F(5,_i,4,3,"spk-select",0)(6,mi,2,1,"spk-form-field"),a(7,"div",4),C("click",function(){S(e);let o=p();return T(o.removeFilter())}),a(8,"spk-icon",5),c(9,"x-circle"),r()()}if(n&2){let e,t,o=p();_("hideClearButton",!0)("displayFn",o.displayFn),l(),_("ngModel",(e=o.pathState())==null?null:e.type),l(2),v(o.expressionOptions()),l(2),g(((t=o.pathState())==null?null:t.type)==="-FileGroup"||((t=o.pathState())==null?null:t.type)==="+FileGroup"?5:6)}}var Zt=[{key:"Excludes folders where name contains",value:"-FolderNameIncludes"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileNameIncludes"},{key:"Excludes file extension",value:"-Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Excludes file group",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"}],di=[{key:"Applications",value:"Applications"},{key:"CacheFiles",value:"Cache Files"},{key:"TemporaryFiles",value:"Temporary Files"},{key:"OperatingSystem",value:"Operating System"},{key:"SystemFiles",value:"System Files"},{key:"DefaultExcludes",value:"Standard Excludes"}],Tt=class n{path=rt.required();pathChange=Ze();remove=Ze();expressionOptions=x(Zt);fileGroupOptions=x(di);pathState=x(null);pathEffect=lt(()=>{let i=this.path(),e=i.slice(1),t=i.startsWith("-")?"-":"+";return e.startsWith("/")&&e.endsWith("/")?this.pathState.set({type:`${t}Folder`,path:e,expression:e}):e.startsWith("*")&&e.endsWith("*/")?this.pathState.set({type:`${t}FolderNameIncludes`,path:e,expression:e.slice(1,-2)}):e.startsWith("[.*")&&e.endsWith("[^\\/]*]")?this.pathState.set({type:`${t}FileNameIncludes`,path:e,expression:e.slice(3,-7)}):e.startsWith("{")&&e.endsWith("}")?this.pathState.set({type:`${t}FileGroup`,path:e,expression:e.slice(1,-1)}):e.startsWith("[")&&e.endsWith("]")?this.pathState.set({type:`${t}Regex`,path:e,expression:e.slice(1,-1)}):e.startsWith("*.")?this.pathState.set({type:`${t}Extension`,path:e,expression:e.slice(2)}):this.pathState.set({type:`${t}Expression`,path:e,expression:e})});updateStateType(i){this.pathState.update(e=>(e.type=i,e.path=this.#e(e),e)),this.pathChange.emit(this.pathState().path)}updateStateExpression(i){this.pathState.update(e=>(e.expression=i,e.path=this.#e(e),e)),this.pathChange.emit(this.pathState().path)}#e(i){let e=i.type.slice(0,1),t=i.type.slice(1);if(t==="Folder"){let o=i.expression.endsWith("/"),s=i.expression.startsWith("/");return o&&s?`${e}${i.expression}`:o?`${e}${i.expression}/`:s?`${e}/${i.expression}`:`${e}/${i.expression}/`}return t==="FolderNameIncludes"?`${e}*${i.expression}*/`:t==="FileNameIncludes"?`${e}[.*${i.expression}[^\\/]*]`:t==="FileGroup"?`${e}{${i.expression}}`:t==="Regex"?`${e}[${i.expression}]`:t==="Extension"?`${e}*.${i.expression}`:`${e}${i.expression}`}removeFilter(){this.remove.emit()}displayFn(i){let e=Zt.find(t=>t.value===i);return e?e.key:""}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=J({type:n,selectors:[["app-filter"]],inputs:{path:[1,"path"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:1,vars:1,consts:()=>{let i;return i=$localize`Select an option...`,[[3,"hideClearButton","displayFn"],["type","text","placeholder",i,3,"ngModelChange","ngModel"],["options",""],[3,"value"],[1,"filter-removal",3,"click"],[1,"spk-primary"],["type","text",3,"ngModelChange","ngModel"]]},template:function(e,t){e&1&&F(0,ui,10,4),e&2&&g(t.pathState()?0:-1)},dependencies:[mt,oe,re,ne,ie,Ut,se,ae,le],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] spk-select[_ngcontent-%COMP%]{--miw: initial}[_nghost-%COMP%] .filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var Fi=["formRef"];function gi(n,i){if(n&1){let e=P();a(0,"app-filter",41),C("pathChange",function(o){let s=S(e).$index,d=p();return T(d.patchPathAt(o,s))})("remove",function(){let o=S(e).$index,s=p();return T(s.removePathAt(o))}),r()}if(n&2){let e=i.$implicit;_("path",e)}}function Ci(n,i){if(n&1&&(a(0,"option",45),c(1),r()),n&2){let e=i.$implicit;_("value",e),l(),L(e)}}function fi(n,i){if(n&1&&(a(0,"div",40)(1,"spk-form-field"),m(2,"input",42),r(),a(3,"spk-select"),m(4,"input",43),I(5,44),R(6,Ci,2,2,"option",45,w),$(),r()()),n&2){let e=p();l(6),v(e.sizeOptions())}}var ke=new ee,Si=["Bytes","KB","MB","GB","TB","PB"],Jt=(n={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>ke.group({path:ke.control(n.path),excludes:ke.group({hidden:ke.control(n.excludes.hidden),system:ke.control(n.excludes.system),temporary:ke.control(n.excludes.temporary),filesLargerThan:ke.group({size:ke.control(null),unit:ke.control(null)})})}),xt=class n{#e=y(pe);#n=y(te);#i=y(Ce);formRef=ue.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new ct("");filesLargerThan=H(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);sizeOptions=x(Si);pathSignal=W(this.sourceDataForm.controls.path.valueChanges);pathArray=H(()=>this.pathSignal()?.split("\0").filter(i=>i.startsWith("-")||i.startsWith("+"))??[]);addFilter(i="-*"){let e=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(`${e}\0${i}`)}patchPathAt(i,e){let o=this.sourceDataForm.controls.path.value.split("\0").filter(d=>!d.startsWith("-")&&!d.startsWith("+")).join("\0"),s=this.pathArray().map((d,k)=>k===e?`${i}`:`${d}`).join("\0");this.sourceDataForm.controls.path.setValue(`${o}\0${s}`)}removePathAt(i){let t=this.sourceDataForm.controls.path.value.split("\0").filter(s=>!s.startsWith("-")&&!s.startsWith("+")).join("\0"),o=this.pathArray().filter((s,d)=>d!==i).join("\0");this.sourceDataForm.controls.path.setValue(`${t}\0${o}`)}getPath(){return this.sourceDataForm.value.path??null}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let i=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(`${i}\0${this.newPathCtrl.value}`),this.newPathCtrl.setValue("")}goBack(){this.#n.navigate(["destination"],{relativeTo:this.#i.parent})}next(){this.#n.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=J({type:n,selectors:[["app-source-data"]],viewQuery:function(e,t){e&1&&de(t.formRef,Fi,5),e&2&&Fe()},decls:56,vars:11,consts:()=>{let i;i=$localize`Path`;let e;e=$localize`Add a direct path`;let t;t=$localize`Hidden files`;let o;o=$localize`System files`;let s;s=$localize`Temporary files`;let d;d=$localize`Source Data`;let k;k=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let M;M=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let h;h=$localize`Source Data`;let Q;Q=$localize`Add Path`;let Y;Y=$localize`Add a path directly from your machine.`;let B;B=$localize`Filters`;let K;K=$localize`Customize your filters.`;let j;j=$localize`Add filter`;let N;N=$localize`Exclude`;let u;u=$localize`Choose if there’s any files you want to exclude.`;let f;f=$localize` Hidden files ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let z;z=$localize` System files ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`;let O;O=$localize` Temporary files ${"\uFFFD#52\uFFFD\uFFFD/#52\uFFFD"}:TAG_INPUT:`;let _e;_e=$localize` Files larger than `;let Ae;return Ae=$localize`Select an option...`,[["formRef",""],d,k,M,h,Q,Y,B,K,j,N,u,f,z,O,_e,[3,"submit","formGroup"],[1,"left"],[1,"title-30"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",i,"formControlName","path"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],["description",""],[1,"row-inputs"],["type","text","placeholder",e,3,"formControl"],["spk-button","","type","button",1,"raised","primary",3,"click"],["type","button","spk-button","","action","",3,"click"],[3,"path"],["formGroupName","excludes",3,"disallowToggle"],[1,"raised","primary"],["type","checkbox","placeholder",t,"formControlName","hidden"],["type","checkbox","placeholder",o,"formControlName","system"],["type","checkbox","placeholder",s,"formControlName","temporary"],[1,"raised","primary",3,"click"],["formGroupName","filesLargerThan",1,"row-inputs"],[3,"pathChange","remove","path"],["type","number","formControlName","size"],["type","text","formControlName","unit","placeholder",Ae],["options",""],[3,"value"]]},template:function(e,t){if(e&1){let o=P();a(0,"form",16,0),C("submit",function(){return S(o),T(t.next())}),a(2,"div",17)(3,"h3",18),A(4,1),r(),a(5,"app-file-tree",19)(6,"label",20),c(7,"Folder path"),r(),m(8,"input",21),r(),a(9,"div",22)(10,"button",23),C("click",function(){return S(o),T(t.goBack())}),E(11,2),m(12,"spk-icon"),D(),r(),a(13,"button",24),E(14,3),m(15,"spk-icon"),D(),r()()(),a(16,"div",25)(17,"h3",18),A(18,4),r(),a(19,"app-toggle-card",26),I(20,27),A(21,5),$(),a(22,"p",28),A(23,6),r(),a(24,"div",29)(25,"spk-form-field"),m(26,"input",30),r(),a(27,"button",31),C("click",function(){return S(o),T(t.addNewPath())}),a(28,"spk-icon"),c(29,"plus"),r()()()(),a(30,"app-toggle-card",26),I(31,27),A(32,7),$(),a(33,"p",28),A(34,8),r(),a(35,"button",32),C("click",function(){return S(o),T(t.addFilter())}),A(36,9),r(),R(37,gi,1,1,"app-filter",33,w),r(),a(39,"app-toggle-card",34),I(40,27),A(41,10),$(),a(42,"p",28),A(43,11),r(),a(44,"spk-toggle",35),E(45,12),m(46,"input",36),D(),r(),a(47,"spk-toggle",35),E(48,13),m(49,"input",37),D(),r(),a(50,"spk-toggle",35),E(51,14),m(52,"input",38),D(),r(),a(53,"spk-toggle",39),C("click",function(){return S(o),T(t.toggleFilesLargerThan())}),A(54,15),r(),F(55,fi,8,0,"div",40),r()()()}e&2&&(_("formGroup",t.sourceDataForm),l(5),_("multiSelect",!0)("startingPath",t.getPath())("showFiles",!0),l(14),_("disallowToggle",!0),l(7),_("formControl",t.newPathCtrl),l(4),_("disallowToggle",!0),l(7),v(t.pathArray()),l(2),_("disallowToggle",!0),l(14),he("active",t.filesLargerThan()),l(2),g(t.filesLargerThan()?55:-1))},dependencies:[mt,Se,oe,re,ne,$e,Ie,ie,fe,De,_t,Te,Ee,Me,le,ae,we,se,Re,Xe,ve,Tt],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-level-40)}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.5rem}"],changeDetection:0})};var ce=new ee,pe=class n{#e=y(te);#n=y(pt);#i=y(Be);#o=y(Ct);generalForm=jt();sourceDataForm=Jt();scheduleForm=Yt();destinationForm=en();optionsForm=qt();isDraft=x(!1);backupId=x(null);isSubmitting=x(!1);finishedLoading=x(!1);backupDefaults=x(null);isNew=H(()=>this.backupId()==="new");selectedOptions=x([]);selectedAdvancedFormPair=x([]);destinationFormPair=x({oauthField:null,custom:[],dynamic:[],advanced:[]});notSelectedAdvancedFormPair=H(()=>{let i=this.destinationFormPair()?.advanced??[],e=this.selectedAdvancedFormPair()??[];return i.filter(t=>e.findIndex(o=>o.name===t.name)===-1)});selectedHttpOptions=x([]);notSelectedHttpOptions=H(()=>{let i=this.httpOptions(),e=this.selectedHttpOptions()??[];return i.filter(t=>e.findIndex(o=>o.name===t.name)===-1)});sourceDataFormSignal=W(this.sourceDataForm.valueChanges);destinationFormSignal=W(this.destinationForm.valueChanges);generalFormSignal=W(this.generalForm.valueChanges);encryptionFieldSignal=W(this.generalForm.controls.encryption.valueChanges);scheduleFormSignal=W(this.scheduleForm.valueChanges);destinationOptions=H(()=>this.#n.backendModules()??[]);httpOptions=H(()=>this.#n.systemInfo()?.GenericModules?.find(i=>i.Key==="http-options")?.Options?.map(this.#t)??[]);advancedOptions=H(()=>this.#n.systemInfo()?.Options?.map(this.#t)??[]);#t(i){return{name:i.Name,type:i.Type,shortDescription:i.ShortDescription??void 0,longDescription:i.LongDescription??void 0,options:i.ValidValues}}encryptionOptions=H(()=>{let i=this.#n.systemInfo()?.EncryptionModules??[];return[yt,...i]});nonSelectedOptions=H(()=>this.advancedOptions().sort((i,e)=>i?.name&&e?.name?i?.name.localeCompare(e?.name):0).filter(i=>this.selectedOptions()?.findIndex(e=>e.name===i.name)===-1));addAdvancedFormPairByName(i,e,t){let o=this.notSelectedAdvancedFormPair().find(s=>s.name===i);o&&this.addAdvancedFormPair(o,e,t)}addHttpOptionByName(i,e,t){let o=this.notSelectedHttpOptions().find(s=>s.name===i);o&&this.addHttpOption(o,e,t)}addAdvancedFormPair(i,e,t){let o=this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced,s=t??i.defaultValue;this.createFormField(o,i,s),this.selectedAdvancedFormPair.set([...this.selectedAdvancedFormPair(),i])}addHttpOption(i,e,t){let o=this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced,s=t??i.defaultValue;this.createFormField(o,i,s),this.selectedHttpOptions.set([...this.selectedHttpOptions(),i])}removeAdvancedFormPair(i,e){this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced.removeControl(i.name),this.selectedAdvancedFormPair().findIndex(o=>o.name===i.name)!==-1?this.selectedAdvancedFormPair.update(o=>(o=o.filter(s=>s.name!==i.name),o)):this.selectedHttpOptions.update(o=>(o=o.filter(s=>s.name!==i.name),o))}removeHttpOption(i,e){this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced.removeControl(i.name),this.selectedHttpOptions.update(t=>(t=t.filter(o=>o.name!==i.name),t))}submit(){this.isSubmitting.set(!0);let i=this.#s(),e=this.backupId();e==="new"||!e||this.isDraft()?this.#i.postApiV1Backups({requestBody:i}).pipe(Ye(()=>this.isSubmitting.set(!1))).subscribe({next:t=>{console.log("submitted res",t),this.exit()},error:t=>{console.error("submitted error",t)}}):this.#i.putApiV1BackupById({id:e,requestBody:i}).pipe(Ye(()=>this.isSubmitting.set(!1))).subscribe({next:t=>{console.log("submitted res",t),this.exit()},error:t=>{console.error("submitted error",t)}})}exit(){this.#c(),this.#e.navigate(["/"])}updateFieldsFromTargetUrl(i){this.#r(),setTimeout(()=>{this.#l(i)})}#r(){this.destinationFormPair.set({oauthField:null,custom:[],dynamic:[],advanced:[]}),this.selectedAdvancedFormPair.set([]),this.selectedHttpOptions.set([]),this.destinationForm.controls.destinations.clear(),this.destinationForm.reset()}mapSourceDataToForm(i){let e=i.Sources??"",t=i.Filters?.map(h=>`${h.Include?"":"-"}${h.Expression}`)??[],o=i.Settings?.find(h=>h.Name==="--exclude-files-attributes")?.Value??"",s=i.Settings?.find(h=>h.Name==="--skip-files-larger-than")??null,d=s?.Value.replace(/[0-9]/g,"")??null,k=s?.Value.replace(/[^0-9]/g,"")??null,M={path:[...e,...t].join("\0"),excludes:{hiddenFiles:o.includes("hidden"),systemFiles:o.includes("system"),tempFiles:o.includes("temporary"),filesLargerThan:d&&k?{size:parseInt(k),unit:d.toUpperCase()}:null}};this.sourceDataForm.patchValue(M)}mapDestinationToForm(i){let e=i.TargetURL?ht(i.TargetURL):null;e&&this.addDestinationFormGroup(e.destinationType,{custom:e.custom,dynamic:e.dynamic,advanced:e.advanced},!0)}#l(i){let e=ht(i);e&&this.addDestinationFormGroup(e.destinationType,{custom:e.custom,dynamic:e.dynamic,advanced:e.advanced},!0)}mapGeneralToForm(i){let e=i.Settings?.find(s=>s.Name==="encryption-module"),t=e?.Value&&e.Value.length?e.Value:"",o={name:i.Name??"",description:i.Description??""};t&&t!==""&&(o.encryption=t),this.generalForm.patchValue(o)}mapScheduleToForm(i){if(!i){this.scheduleForm.patchValue({autoRun:!0});return}let e=this.#o.fromString(i.Repeat)??null,o={nextTime:this.#p(i.Time),runAgain:{repeatValue:e?.value??1,repeatUnit:e?.unit??"D",allowedDays:{mon:i.AllowedDays?.includes("mon")??!1,tue:i.AllowedDays?.includes("tue")??!1,wed:i.AllowedDays?.includes("wed")??!1,thu:i.AllowedDays?.includes("thu")??!1,fri:i.AllowedDays?.includes("fri")??!1,sat:i.AllowedDays?.includes("sat")??!1,sun:i.AllowedDays?.includes("sun")??!1}}};this.scheduleForm.patchValue(o)}mapOptionsToForms(i){let e=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than"],t=this.advancedOptions();i.Settings?.forEach(o=>{if(o.Name==="encryption-module")return this.generalForm.controls.encryption.setValue(o.Value??"");if(!(o.Name&&e.includes(o.Name))){if(o.Name==="dblock-size"){let s=o.Value?.replace(/[^0-9]/g,""),d=o.Value?.replace(/[0-9]/g,"");return this.optionsForm.controls.remoteVolumeSize.setValue({size:s?parseInt(s):null,unit:d?d.toUpperCase():null})}if(o.Name&&o.Value){let s=t.find(d=>d.name===o.Name);if(!s)return;this.addOptionToFormGroup(s,o.Value)}}})}getCurrentTargetUrl(){return this.#a(this.destinationForm.controls.destinations)}#s(){let i=this.generalForm.value,e=this.optionsForm.value,t=this.scheduleForm.value,o=this.sourceDataForm.value,d=this.destinationForm.value.destinations?.length?this.#a(this.destinationForm.controls.destinations):[],k=null;t.runAgain?.repeatUnit&&t.runAgain?.repeatValue&&(k=this.#o.toString(t.runAgain.repeatValue,t.runAgain.repeatUnit));let M=t.runAgain?.allowedDays?Object.entries(t.runAgain?.allowedDays).filter(([u,f])=>f).map(([u,f])=>u):[],h=o.path?.split("\0")??[],Q=i.encryption===""?{Name:"--no-encryption",Value:"True"}:{Name:"encryption-module",Value:i.encryption??null},Y=this.advancedOptions(),B=Object.entries(e.advancedOptions??{}).filter(([u,f])=>u&&f).map(([u,f])=>{let z=Y.find(O=>O.name===u);return z?.type==="Size"?{Name:u,Value:`${f.size}${f.unit.toLowerCase()}`}:z?.type==="Integer"?{Name:u,Value:f.toString()}:z?.type==="Boolean"?{Name:u,Value:f.toString()}:{Name:u,Value:f}}),K=[Q,...B],j=Object.entries(o.excludes??{}).filter(([u,f])=>f&&u!=="filesLargerThan").map(([u])=>u),N=o.excludes?.filesLargerThan;return j.length&&K.push({Name:"--exclude-files-attributes",Value:j.join(",")}),N&&N.size!==null&&N.unit!==null&&K.push({Name:"--skip-files-larger-than",Value:`${N.size}${N.unit}`}),{Backup:{Name:i.name,Description:i.description,TargetURL:d[0]??null,Sources:h.filter(u=>!u.startsWith("-")),Settings:K,Filters:h.filter(u=>u.startsWith("-")).map((u,f)=>({Order:f,Include:!1,Expression:u.slice(1)}))},Schedule:t.autoRun?{Repeat:k,Time:t.nextTime?.date?new Date(`${t.nextTime.date}T${t.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:M}:null}}#a(i){return i.controls.map(e=>ft(e.value))}#p(i){if(!i||i?.indexOf("T")===-1)return{time:i??"13:00"};let e=new Date(i),t={time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`};return i.indexOf("T")!==-1&&(t.date=e.toISOString().split("T")[0]),t}removeOptionFromFormGroup(i){let e=i.name;e&&(this.optionsForm.controls.advancedOptions.removeControl(e),this.selectedOptions.update(t=>(t=t.filter(o=>o.name!==e),t)))}addOptionToFormGroup(i,e){let t=this.optionsForm.controls.advancedOptions;this.createFormField(t,i,e??i.defaultValue),this.selectedOptions.update(o=>(o.push(i),o))}createFormField(i,e,t){if(e.type==="String"||e.type==="FileTree"||e.type==="FolderTree"||e.type==="Password"||e.type==="Enumeration"||e.type==="NonValidatedSelectableString"||e.type==="Path"){i.addControl(e.name,ce.control(t));return}if(e.type==="Size"){let o=t.replace(/[0-9]/g,""),s=t.replace(/[^0-9]/g,"");i.addControl(e.name,ce.group({size:ce.control(s?parseInt(s):50),unit:ce.control(o?o.toUpperCase():"MB")}));return}if(e.type==="Integer"){i.addControl(e.name,ce.control(t?parseInt(t):0));return}if(e.type==="Boolean"){i.addControl(e.name,ce.control(t==="true"));return}if(e.type==="Flags"){i.addControl(e.name,ce.control(t??""));return}if(e.type==="Timespan"){i.addControl(e.name,ce.control(t,[ye.pattern(/([-+]?\d{1,3}[smhDWMY])+/)]));return}}addDestinationFormGroup(i,e,t=!1){let o=this.destinationOptions().find(N=>N.Key===i),s=this.httpOptions();if(!o||!o.Options)return;let d=nt.hasOwnProperty(i)&&nt[i],k=d&&d.oauthField?d.oauthField:null,M=d&&d.customFields?d.customFields:{},h=d&&d.dynamicFields?d.dynamicFields:[],Q=d&&d.advancedFields?d.advancedFields:[],Y=d&&d.ignoredAdvancedFields?d.ignoredAdvancedFields:[];this.destinationFormPair.set({oauthField:k,custom:[],dynamic:[],advanced:[]});let B=ce.group({}),K=ce.group({}),j=ce.group({});M&&Object.entries(M).forEach(([N,u],f)=>{let _e=u,{formElement:z}=_e,O=$t(_e,["formElement"]);B.addControl(N,z(e?.custom[N])),this.destinationFormPair.update(Ae=>(Ae.custom.push(Z({order:900+f},O)),Ae))});for(let N=0;N<o.Options.length;N++){let u=o.Options[N];if(u.Deprecated)continue;let f=h.find(z=>z===u.Name||z.name===u.Name);if(f){let z=f&&typeof f!="string",O={name:u.Name,type:u.Type,shortDescription:u.ShortDescription??void 0,longDescription:u.LongDescription??void 0,options:u.ValidValues,order:900+N},_e=z?Z(Z({},O),f):O,G=e?.dynamic[u.Name]??u.DefaultValue;this.createFormField(K,_e,G),this.destinationFormPair.update(qe=>(qe.dynamic.push(_e),qe))}else{if(Y.find(me=>me===u.Name))continue;let O=Q.find(me=>me===u.Name||me.name===u.Name),_e=O&&typeof O!="string",Ae=e?.advanced[u.Name],G=Ae??u.DefaultValue,qe={name:u.Name,type:u.Type,shortDescription:u.ShortDescription??void 0,longDescription:u.LongDescription??void 0,options:u.ValidValues,defaultValue:G,order:900+N},Nt=_e?Z(Z({},qe),O):qe;t&&Ae&&(this.createFormField(j,Nt,G),this.selectedAdvancedFormPair.update(me=>(me.push(Nt),me))),this.destinationFormPair.update(me=>(me.advanced.push(Nt),me))}}for(let N=0;N<s.length;N++){let u=s[N],f=e?.advanced[u.name],z=f??u.defaultValue;t&&f&&(this.createFormField(j,u,z),this.selectedHttpOptions.update(O=>(O.push(u),O)))}this.destinationFormPair.update(N=>({oauthField:N.oauthField,custom:N.custom.sort((u,f)=>u.order-f.order),dynamic:N.dynamic.sort((u,f)=>u.order-f.order),advanced:N.advanced.sort((u,f)=>u.order-f.order)})),this.destinationForm.controls.destinations.push(tn({key:o.Key,customGroup:B,dynamicGroup:K,advancedGroup:j}))}#c(){this.generalForm.reset(),this.destinationForm.controls.destinations.clear(),this.destinationForm.reset(),this.sourceDataForm.reset(),this.scheduleForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||n)};static \u0275prov=xe({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ti=["formRef"],Ei=(n,i,e,t)=>({index:n,formView:i,formGroupName:"custom",destinationType:e,oauthField:t}),Dt=n=>({$implicit:n}),Di=(n,i,e,t)=>({index:n,formView:i,formGroupName:"dynamic",destinationType:e,oauthField:t}),Ni=(n,i,e,t)=>({index:n,formView:i,formGroupName:"advanced",destinationType:e,oauthField:t}),Ai=(n,i,e,t)=>({index:n,formView:i,formGroupName:"advanced",asHttpOptions:!0,destinationType:e,oauthField:t}),hi=()=>({maxWidth:"700px",width:"100%"});function Oi(n,i){n&1&&(E(0,2,2),m(1,"spk-icon"),D())}function yi(n,i){n&1&&A(0,2,3)}function Pi(n,i){if(n&1){let e=P();E(0,2,1),a(1,"button",24),C("click",function(){S(e);let o=p();return T(o.testDestination())}),F(2,Oi,2,0)(3,yi,1,0),r(),D()}if(n&2){let e=p();l(),he("success",e.successfulTest()),l(),g(e.successfulTest()?2:3)}}function ki(n,i){if(n&1){let e=P();a(0,"p",30),C("click",function(){S(e);let o=p();return T(o.removeDestinationFormGroup(o.destinationCount()-1))}),E(1,5),m(2,"span",31),D(),r()}}function xi(n,i){if(n&1){let e=P();a(0,"div",32)(1,"div",33),C("click",function(){S(e);let o=p();return T(o.addDestinationFormGroup("file"))}),a(2,"h3"),A(3,6),r(),a(4,"p"),A(5,7),r()(),a(6,"div",33),C("click",function(){S(e);let o=p();return T(o.addDestinationFormGroup("gcs"))}),a(7,"h3"),c(8,"Google Cloud Storage"),r(),a(9,"p"),A(10,8),r()(),a(11,"div",33),C("click",function(){S(e);let o=p();return T(o.addDestinationFormGroup("s3"))}),a(12,"h3"),c(13,"S3 compatible bucket"),r(),a(14,"p"),A(15,9),r()(),a(16,"div",33),C("click",function(){S(e);let o=p();return T(o.addDestinationFormGroup("ssh"))}),a(17,"h3"),c(18,"SSH"),r(),a(19,"p"),A(20,10),r()(),a(21,"div",33),C("click",function(){S(e);let o=p();return T(o.addDestinationFormGroup("googledrive"))}),a(22,"h3"),c(23,"Google Drive"),r(),a(24,"p"),A(25,11),r()()(),a(26,"p"),A(27,12),r()}}function Ii(n,i){n&1&&be(0)}function $i(n,i){if(n&1&&F(0,Ii,1,0,"ng-container",39),n&2){let e,t=i.$implicit,o=i.$index;p();let s=ge(29),d=p();_("ngTemplateOutlet",s)("ngTemplateOutletContext",Ve(7,Dt,tt(2,Ei,o,t,(e=d.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,d.destinationFormPair().oauthField)))}}function Mi(n,i){n&1&&be(0)}function wi(n,i){if(n&1&&F(0,Mi,1,0,"ng-container",39),n&2){let e,t=i.$implicit,o=i.$index;p();let s=ge(29),d=p();_("ngTemplateOutlet",s)("ngTemplateOutletContext",Ve(7,Dt,tt(2,Di,o,t,(e=d.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,d.destinationFormPair().oauthField)))}}function Ri(n,i){if(n&1){let e=P();E(0,13,1),a(1,"button",40),C("click",function(){let o=S(e).$implicit,s=p(2);return T(s.addAdvancedFormPair(o,0))}),r(),D()}if(n&2){let e=i.$implicit;l(),Je(e.name),et(0)}}function vi(n,i){n&1&&be(0)}function Gi(n,i){if(n&1&&F(0,vi,1,0,"ng-container",39),n&2){let e,t=i.$implicit,o=i.$index;p();let s=ge(29),d=p();_("ngTemplateOutlet",s)("ngTemplateOutletContext",Ve(7,Dt,tt(2,Ni,o,t,(e=d.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,d.destinationFormPair().oauthField)))}}function bi(n,i){if(n&1){let e=P();E(0,14,1),a(1,"button",40),C("click",function(){let o=S(e).$implicit,s=p(2);return T(s.addHttpOption(o,0))}),r(),D()}if(n&2){let e=i.$implicit;l(),Je(e.name),et(0)}}function Vi(n,i){n&1&&be(0)}function Li(n,i){if(n&1&&F(0,Vi,1,0,"ng-container",39),n&2){let e,t=i.$implicit,o=i.$index;p();let s=ge(29),d=p();_("ngTemplateOutlet",s)("ngTemplateOutletContext",Ve(7,Dt,tt(2,Ai,o,t,(e=d.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,d.destinationFormPair().oauthField)))}}function Ui(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Bi(n,i){if(n&1&&(a(0,"app-file-tree",43)(1,"label",50),c(2),F(3,Ui,3,1,"spk-tooltip",51),r(),m(4,"input",52),r()),n&2){let e,t=p().$implicit,o=p(2);_("startingPath",o.getFormFieldValue(0,t.formGroupName,t.formView.name))("accepts",t.formView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name)}}function Ki(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Xi(n,i){if(n&1&&(a(0,"app-file-tree",44)(1,"label",50),c(2),F(3,Ki,3,1,"spk-tooltip",51),r(),m(4,"input",52),r()),n&2){let e,t=p().$implicit,o=p(2);_("startingPath",o.getFormFieldValue(0,t.formGroupName,t.formView.name)),l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name)}}function zi(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Hi(n,i){n&1&&(a(0,"spk-icon",53),c(1,"link"),r())}function Wi(n,i){n&1&&(a(0,"spk-icon",53),c(1,"textbox"),r())}function ji(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",50),c(2),F(3,zi,3,1,"spk-tooltip",51),r(),m(4,"input",52),F(5,Hi,2,0,"spk-icon",53)(6,Wi,2,0,"spk-icon",53),r()),n&2){let e,t=p().$implicit;l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name),l(),g(t.formView.type==="Path"?5:6)}}function qi(n,i){if(n&1){let e=P();a(0,"span",57),C("click",function(){S(e);let o=p(2).$implicit,s=p(2);return T(s.oauthStartTokenCreation(o.destinationType))}),c(1,"AuthID"),r()}}function Qi(n,i){n&1&&(a(0,"spk-icon",53),c(1,"password"),r())}function Yi(n,i){if(n&1){let e=P();a(0,"spk-icon",58),C("click",function(){S(e);let o=p(2).$implicit;return T(o.formView.showPassword=!o.formView.showPassword)}),c(1," eye "),r()}}function Zi(n,i){if(n&1){let e=P();a(0,"spk-icon",58),C("click",function(){S(e);let o=p(2).$implicit;return T(o.formView.showPassword=!o.formView.showPassword)}),c(1," eye-slash "),r()}}function Ji(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",50),c(2),r(),m(3,"input",54),F(4,qi,2,0,"span",55)(5,Qi,2,0,"spk-icon",53)(6,Yi,2,0,"spk-icon",56)(7,Zi,2,0,"spk-icon",56),r()),n&2){let e,t=p().$implicit;l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name),_("type",t.formView.showPassword?"text":"password"),l(),g(t.oauthField===t.formView.name?4:5),l(2),g(t.formView.showPassword?6:7)}}function eo(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function to(n,i){if(n&1&&(a(0,"option",61),c(1),r()),n&2){let e=i.$implicit;_("value",e),l(),L(e)}}function no(n,i){if(n&1&&(a(0,"spk-select")(1,"label",50),c(2),F(3,eo,3,1,"spk-tooltip",51),r(),m(4,"input",59),I(5,60),R(6,to,2,2,"option",61,w),$(),r()),n&2){let e,t=p().$implicit;l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name),l(2),v(t.formView.options)}}function io(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function oo(n,i){if(n&1&&(a(0,"option",61),c(1),r()),n&2){let e=i.$implicit;_("value",e.value),l(),wt(" ",e.key," ",e.value?"("+e.value+")":""," ")}}function ro(n,i){if(n&1&&(a(0,"spk-select",45)(1,"label",50),c(2),F(3,io,3,1,"spk-tooltip",51),r(),m(4,"input",59),I(5,60),R(6,oo,2,3,"option",61,w),$(),r()),n&2){let e,t=p().$implicit,o=p(2);_("isFreeText",!0),l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name),l(2),v(t.formView.loadOptions(o.injector)())}}function ao(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function lo(n,i){if(n&1&&(a(0,"option",61),c(1),r()),n&2){let e=i.$implicit;_("value",e),l(),L(e)}}function so(n,i){if(n&1&&(a(0,"div",46)(1,"label",50),c(2),F(3,ao,3,1,"spk-tooltip",51),r(),a(4,"div",62)(5,"spk-form-field"),m(6,"input",63),a(7,"spk-icon",53),c(8,"resize"),r()(),a(9,"spk-select"),m(10,"label")(11,"input",64),I(12,60),R(13,lo,2,2,"option",61,w),$(),r()()()),n&2){let e,t=p().$implicit,o=p(2);_("formGroupName",t.formView.name),l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(3),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(7),v(o.sizeOptions())}}function po(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function co(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",50),c(2),F(3,po,3,1,"spk-tooltip",51),r(),m(4,"input",65),a(5,"spk-icon",53),c(6,"numpad"),r()()),n&2){let e,t=p().$implicit;l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name)}}function _o(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function mo(n,i){if(n&1&&(a(0,"spk-toggle",47)(1,"label",50),c(2),F(3,_o,3,1,"spk-tooltip",51),r(),m(4,"input",66),r()),n&2){let e,t=p().$implicit;l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name)}}function uo(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Fo(n,i){n&1&&(a(0,"spk-option",68),c(1,"None"),r()),n&2&&_("value","None")}function go(n,i){if(n&1&&(a(0,"spk-option",61),c(1),m(2,"spk-checkbox",69),r()),n&2){let e=p().$implicit;_("value",e),l(),b(" ",e," ")}}function Co(n,i){if(n&1&&F(0,Fo,2,1,"spk-option",68)(1,go,3,2,"spk-option",61),n&2){let e=i.$implicit;g(e==="None"?0:1)}}function fo(n,i){if(n&1&&(a(0,"spk-select",48)(1,"label",50),c(2),F(3,uo,3,1,"spk-tooltip",51),r(),m(4,"input",67),I(5,60),R(6,Co,2,1,null,null,w),$(),r()),n&2){let e,t=p().$implicit;_("selectMultiple",!0),l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),U("formControlName",t.formView.name),l(2),v(t.formView.options)}}function So(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function To(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",50),c(2),F(3,So,3,1,"spk-tooltip",51),r(),m(4,"input",52),r()),n&2){let e,t=p().$implicit;l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name)}}function Eo(n,i){if(n&1){let e=P();a(0,"button",70),C("click",function(){S(e);let o=p().$implicit,s=p(2);return T(s.removeFormView(o.formView,0))}),a(1,"spk-icon"),c(2,"x-circle"),r()()}}function Do(n,i){if(n&1&&(a(0,"div",41),I(1,42),F(2,Bi,5,16,"app-file-tree",43)(3,Xi,5,12,"app-file-tree",44)(4,ji,7,12,"spk-form-field")(5,Ji,8,13,"spk-form-field")(6,no,8,11,"spk-select")(7,ro,8,12,"spk-select",45)(8,so,15,11,"div",46)(9,co,7,11,"spk-form-field")(10,mo,5,11,"spk-toggle",47)(11,fo,8,8,"spk-select",48)(12,To,5,11,"spk-form-field"),$(),F(13,Eo,3,0,"button",49),r()),n&2){let e=i.$implicit;he("single-field",e.formGroupName!=="advanced"),l(),_("formGroupName",e.formGroupName),l(),g(e.formView.type==="FileTree"?2:e.formView.type==="FolderTree"?3:e.formView.type==="String"||e.formView.type==="Path"?4:e.formView.type==="Password"?5:e.formView.type==="Enumeration"?6:e.formView.type==="NonValidatedSelectableString"?7:e.formView.type==="Size"?8:e.formView.type==="Integer"?9:e.formView.type==="Boolean"?10:e.formView.type==="Flags"?11:e.formView.type==="Timespan"?12:-1),l(11),g(e.formGroupName==="advanced"?13:-1)}}function No(n,i){if(n&1&&(I(0,25)(1,34),R(2,$i,1,9,"ng-container",null,w),R(4,wi,1,9,"ng-container",null,w),a(6,"app-toggle-card",35),I(7,36),E(8,13),a(9,"spk-menu")(10,"button",37),m(11,"spk-icon"),r(),I(12,23),R(13,Ri,2,1,"button",38,w),$(),r(),D(),$(),R(15,Gi,1,9,"ng-container",null,w),r(),a(17,"app-toggle-card",35),I(18,36),E(19,14),a(20,"spk-menu")(21,"button",37),m(22,"spk-icon"),r(),I(23,23),R(24,bi,2,1,"button",38,w),$(),r(),D(),$(),R(26,Li,1,9,"ng-container",null,w),r(),F(28,Do,14,5,"ng-template",null,1,at),$()()),n&2){let e=p();l(2),v(e.destinationFormPair().custom),l(2),v(e.destinationFormPair().dynamic),l(2),_("disallowToggle",!0),l(4),_("disabled",e.notSelectedAdvancedFormPair().length===0),l(3),v(e.notSelectedAdvancedFormPair()),l(2),v(e.selectedAdvancedFormPair()),l(2),_("disallowToggle",!0),l(4),_("disabled",e.notSelectedHttpOptions().length===0),l(3),v(e.notSelectedHttpOptions()),l(2),v(e.selectedHttpOptions())}}function Ao(n,i){if(n&1){let e=P();a(0,"spk-dialog",71),Gt("isOpenChange",function(o){S(e);let s=p();return vt(s.targetUrlDialogOpen,o)||(s.targetUrlDialogOpen=o),T(o)}),a(1,"header",72)(2,"h2"),A(3,15),r(),a(4,"spk-alert",73),A(5,16),r()(),a(6,"div",74)(7,"spk-form-field"),m(8,"textarea",75),r()(),a(9,"footer",76)(10,"button",27),C("click",function(){S(e);let o=p();return T(o.closeTargetUrlDialog(!1))}),c(11,"Cancel"),r(),a(12,"button",77),C("click",function(){S(e);let o=p();return T(o.closeTargetUrlDialog(!0))}),E(13,17),m(14,"spk-icon"),D(),r()()()}if(n&2){let e=p();Rt("isOpen",e.targetUrlDialogOpen),_("options",bt(3,hi)),l(8),_("formControl",e.targetUrlCtrl)}}var ho=["Bytes","KB","MB","GB","TB","PB"],Et=new ee,en=(n={destinations:[]})=>Et.group({destinations:Et.array(n.destinations)}),tn=({key:n,customGroup:i,dynamicGroup:e,advancedGroup:t})=>Et.group({destinationType:Et.control(n),custom:i,dynamic:e,advanced:t}),It=class n{#e=y(te);#n=y(Ce);#i=y(Lt);#o=y(Be);#t=y(pe);#r=y(Xt);injector=y(Mt);formRef=ue.required("formRef");destinationForm=this.#t.destinationForm;destinationFormPair=this.#t.destinationFormPair;selectedAdvancedFormPair=this.#t.selectedAdvancedFormPair;notSelectedAdvancedFormPair=this.#t.notSelectedAdvancedFormPair;selectedHttpOptions=this.#t.selectedHttpOptions;notSelectedHttpOptions=this.#t.notSelectedHttpOptions;destinationOptions=this.#t.destinationOptions;destinationFormSignal=this.#t.destinationFormSignal;destinationCount=H(()=>this.destinationFormSignal()?.destinations?.length??0);sizeOptions=x(ho);successfulTest=x(!1);getFormFieldValue(i,e,t){return((this.destinationForm.controls.destinations.controls?.[i]).controls?.[e]).controls[t].value}addDestinationFormGroup(i){this.#t.addDestinationFormGroup(i)}addAdvancedFormPair(i,e){this.#t.addAdvancedFormPair(i,e)}removeFormView(i,e){this.#t.removeAdvancedFormPair(i,e)}addHttpOption(i,e){this.#t.addHttpOption(i,e)}targetUrl=H(()=>this.#t.getCurrentTargetUrl()[0]);targetUrlCtrl=new ct;targetUrlInitial=x(null);targetUrlDialogOpen=x(!1);openTargetUrlDialog(){let e=this.#t.getCurrentTargetUrl()[0];this.targetUrlCtrl.setValue(e),this.targetUrlInitial.set(e),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(i=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl.value,t=this.targetUrlInitial();!i||e===t||this.#t.updateFieldsFromTargetUrl(this.targetUrlCtrl.value)}testDestination(i=0){let t=this.#t.getCurrentTargetUrl()[i];t&&this.#o.postApiV1RemoteoperationTest({requestBody:{path:t}}).subscribe({next:()=>{this.successfulTest.set(!0),setTimeout(()=>{this.successfulTest.set(!1)},3e3)},error:o=>{let s=o.error.error.Error;if(s==="missing-folder"&&this.#r.open(Le,{data:{title:"Create folder",message:"The remote destination folder does not exist, do you want to create it?"},closed:d=>{d&&this.#o.postApiV1RemoteoperationCreate({requestBody:{path:t}}).subscribe()}}),s.startsWith("incorrect-cert:")){let d=s.split("incorrect-cert:")[1];this.#r.open(Le,{maxWidth:"500px",data:{title:"Trust the certificate",message:`The server is using a certificate that is not trusted.
2
2
  If this is a self-signed certificate, you can choose to trust this certificate.
3
3
  The server reported the certificate hash: ${d}`,confirmText:"Trust the certificate",cancelText:"Cancel"},closed:k=>{k&&this.#t.addHttpOptionByName("accept-specified-ssl-hash",d)}})}if(s.startsWith("incorrect-host-key:")){let d=s.split('incorrect-host-key:"')[1].split('",')[0],k=s.split('accepted-host-key:"')[1].split('",')[0];k?this.#r.open(Le,{maxWidth:"500px",data:{title:"The host key has changed",message:`The host key has changed, please check with the server administrator if this is correct,
4
4
  otherwise you could be the victim of a MAN-IN-THE-MIDDLE attack.
@@ -1 +1 @@
1
- import{a as y}from"./chunk-ZTDQQPKO.js";import"./chunk-2ORXOP6M.js";import"./chunk-GTFXUW4R.js";import"./chunk-CH4OZJBV.js";import{sa as S}from"./chunk-R5JN4Q6V.js";import{Eb as n,Fb as o,Ra as f,Sb as a,X as m,fb as p,ic as r,jc as _,wc as l,xc as c}from"./chunk-JDQIBNR4.js";import"./chunk-C6Q5SG76.js";var i=class s{#e=m(y);systemInfo=this.#e.systemInfo;static \u0275fac=function(e){return new(e||s)};static \u0275cmp=p({type:s,selectors:[["app-system-info"]],decls:5,vars:3,consts:()=>{let t;return t=$localize`System info`,[t]},template:function(e,d){e&1&&(n(0,"h3"),a(1,0),o(),n(2,"pre"),r(3),l(4,"json"),o()),e&2&&(f(3),_(c(4,1,d.systemInfo())))},dependencies:[S],styles:["[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30);margin:p2r(0 0 20)}"],changeDetection:0})};export{i as default};
1
+ import{a as y}from"./chunk-UUMKHH4F.js";import"./chunk-KFGIVU27.js";import"./chunk-PIDBEXSZ.js";import"./chunk-5XX7BU4I.js";import{sa as S}from"./chunk-5ZK3D2RS.js";import{Eb as n,Fb as o,Ra as f,Sb as a,X as m,fb as p,ic as r,jc as _,vc as l,wc as c}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var i=class s{#e=m(y);systemInfo=this.#e.systemInfo;static \u0275fac=function(e){return new(e||s)};static \u0275cmp=p({type:s,selectors:[["app-system-info"]],decls:5,vars:3,consts:()=>{let t;return t=$localize`System info`,[t]},template:function(e,d){e&1&&(n(0,"h3"),a(1,0),o(),n(2,"pre"),r(3),l(4,"json"),o()),e&2&&(f(3),_(c(4,1,d.systemInfo())))},dependencies:[S],styles:["[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30);margin:p2r(0 0 20)}"],changeDetection:0})};export{i as default};
@@ -1,2 +1,2 @@
1
- import{Ga as ue,X as he,e as de}from"./chunk-R5JN4Q6V.js";import{E as ne,L as re,O as te,R as O,U as N,W as w,X as m,_ as se,aa as oe,ba as ie,d as S,k as Q,l as X,la as ae,na as ce,p as x,w as H,wa as le,z as ee}from"./chunk-JDQIBNR4.js";import{a as Z}from"./chunk-C6Q5SG76.js";var F=class{},L=class{},g=class r{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(e){e?typeof e=="string"?this.lazyInit=()=>{this.headers=new Map,e.split(`
1
+ import{Ga as ue,X as he,e as de}from"./chunk-5ZK3D2RS.js";import{E as ne,L as re,O as te,R as O,U as N,W as w,X as m,_ as se,aa as oe,ba as ie,d as S,k as Q,l as X,la as ae,na as ce,p as x,w as H,wa as le,z as ee}from"./chunk-MR4RE3IB.js";import{a as Z}from"./chunk-C6Q5SG76.js";var F=class{},L=class{},g=class r{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(e){e?typeof e=="string"?this.lazyInit=()=>{this.headers=new Map,e.split(`
2
2
  `).forEach(n=>{let t=n.indexOf(":");if(t>0){let s=n.slice(0,t),i=n.slice(t+1).trim();this.addHeaderEntry(s,i)}})}:typeof Headers<"u"&&e instanceof Headers?(this.headers=new Map,e.forEach((n,t)=>{this.addHeaderEntry(t,n)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(e).forEach(([n,t])=>{this.setHeaderEntries(n,t)})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();let n=this.headers.get(e.toLowerCase());return n&&n.length>0?n[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,n){return this.clone({name:e,value:n,op:"a"})}set(e,n){return this.clone({name:e,value:n,op:"s"})}delete(e,n){return this.clone({name:e,value:n,op:"d"})}maybeSetNormalizedName(e,n){this.normalizedNames.has(n)||this.normalizedNames.set(n,e)}init(){this.lazyInit&&(this.lazyInit instanceof r?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(n=>{this.headers.set(n,e.headers.get(n)),this.normalizedNames.set(n,e.normalizedNames.get(n))})}clone(e){let n=new r;return n.lazyInit=this.lazyInit&&this.lazyInit instanceof r?this.lazyInit:this,n.lazyUpdate=(this.lazyUpdate||[]).concat([e]),n}applyUpdate(e){let n=e.name.toLowerCase();switch(e.op){case"a":case"s":let t=e.value;if(typeof t=="string"&&(t=[t]),t.length===0)return;this.maybeSetNormalizedName(e.name,n);let s=(e.op==="a"?this.headers.get(n):void 0)||[];s.push(...t),this.headers.set(n,s);break;case"d":let i=e.value;if(!i)this.headers.delete(n),this.normalizedNames.delete(n);else{let o=this.headers.get(n);if(!o)return;o=o.filter(d=>i.indexOf(d)===-1),o.length===0?(this.headers.delete(n),this.normalizedNames.delete(n)):this.headers.set(n,o)}break}}addHeaderEntry(e,n){let t=e.toLowerCase();this.maybeSetNormalizedName(e,t),this.headers.has(t)?this.headers.get(t).push(n):this.headers.set(t,[n])}setHeaderEntries(e,n){let t=(Array.isArray(n)?n:[n]).map(i=>i.toString()),s=e.toLowerCase();this.headers.set(s,t),this.maybeSetNormalizedName(e,s)}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(n=>e(this.normalizedNames.get(n),this.headers.get(n)))}};var C=class{encodeKey(e){return fe(e)}encodeValue(e){return fe(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}};function Re(r,e){let n=new Map;return r.length>0&&r.replace(/^\?/,"").split("&").forEach(s=>{let i=s.indexOf("="),[o,d]=i==-1?[e.decodeKey(s),""]:[e.decodeKey(s.slice(0,i)),e.decodeValue(s.slice(i+1))],a=n.get(o)||[];a.push(d),n.set(o,a)}),n}var Pe=/%(\d[a-f0-9])/gi,Ne={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function fe(r){return encodeURIComponent(r).replace(Pe,(e,n)=>Ne[n]??e)}function _(r){return`${r}`}var v=class r{map;encoder;updates=null;cloneFrom=null;constructor(e={}){if(this.encoder=e.encoder||new C,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=Re(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(n=>{let t=e.fromObject[n],s=Array.isArray(t)?t.map(_):[_(t)];this.map.set(n,s)})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();let n=this.map.get(e);return n?n[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,n){return this.clone({param:e,value:n,op:"a"})}appendAll(e){let n=[];return Object.keys(e).forEach(t=>{let s=e[t];Array.isArray(s)?s.forEach(i=>{n.push({param:t,value:i,op:"a"})}):n.push({param:t,value:s,op:"a"})}),this.clone(n)}set(e,n){return this.clone({param:e,value:n,op:"s"})}delete(e,n){return this.clone({param:e,value:n,op:"d"})}toString(){return this.init(),this.keys().map(e=>{let n=this.encoder.encodeKey(e);return this.map.get(e).map(t=>n+"="+this.encoder.encodeValue(t)).join("&")}).filter(e=>e!=="").join("&")}clone(e){let n=new r({encoder:this.encoder});return n.cloneFrom=this.cloneFrom||this,n.updates=(this.updates||[]).concat(e),n}init(){this.map===null&&(this.map=new Map),this.cloneFrom!==null&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":let n=(e.op==="a"?this.map.get(e.param):void 0)||[];n.push(_(e.value)),this.map.set(e.param,n);break;case"d":if(e.value!==void 0){let t=this.map.get(e.param)||[],s=t.indexOf(_(e.value));s!==-1&&t.splice(s,1),t.length>0?this.map.set(e.param,t):this.map.delete(e.param)}else{this.map.delete(e.param);break}}}),this.cloneFrom=this.updates=null)}};var V=class{map=new Map;set(e,n){return this.map.set(e,n),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}has(e){return this.map.has(e)}keys(){return this.map.keys()}};function Ae(r){switch(r){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}function pe(r){return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer}function ye(r){return typeof Blob<"u"&&r instanceof Blob}function me(r){return typeof FormData<"u"&&r instanceof FormData}function Oe(r){return typeof URLSearchParams<"u"&&r instanceof URLSearchParams}var k=class r{url;body=null;headers;context;reportProgress=!1;withCredentials=!1;responseType="json";method;params;urlWithParams;transferCache;constructor(e,n,t,s){this.url=n,this.method=e.toUpperCase();let i;if(Ae(this.method)||s?(this.body=t!==void 0?t:null,i=s):i=t,i&&(this.reportProgress=!!i.reportProgress,this.withCredentials=!!i.withCredentials,i.responseType&&(this.responseType=i.responseType),i.headers&&(this.headers=i.headers),i.context&&(this.context=i.context),i.params&&(this.params=i.params),this.transferCache=i.transferCache),this.headers??=new g,this.context??=new V,!this.params)this.params=new v,this.urlWithParams=n;else{let o=this.params.toString();if(o.length===0)this.urlWithParams=n;else{let d=n.indexOf("?"),a=d===-1?"?":d<n.length-1?"&":"";this.urlWithParams=n+a+o}}}serializeBody(){return this.body===null?null:typeof this.body=="string"||pe(this.body)||ye(this.body)||me(this.body)||Oe(this.body)?this.body:this.body instanceof v?this.body.toString():typeof this.body=="object"||typeof this.body=="boolean"||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return this.body===null||me(this.body)?null:ye(this.body)?this.body.type||null:pe(this.body)?null:typeof this.body=="string"?"text/plain":this.body instanceof v?"application/x-www-form-urlencoded;charset=UTF-8":typeof this.body=="object"||typeof this.body=="number"||typeof this.body=="boolean"?"application/json":null}clone(e={}){let n=e.method||this.method,t=e.url||this.url,s=e.responseType||this.responseType,i=e.transferCache??this.transferCache,o=e.body!==void 0?e.body:this.body,d=e.withCredentials??this.withCredentials,a=e.reportProgress??this.reportProgress,f=e.headers||this.headers,p=e.params||this.params,y=e.context??this.context;return e.setHeaders!==void 0&&(f=Object.keys(e.setHeaders).reduce((R,h)=>R.set(h,e.setHeaders[h]),f)),e.setParams&&(p=Object.keys(e.setParams).reduce((R,h)=>R.set(h,e.setParams[h]),p)),new r(n,t,o,{params:p,headers:f,context:y,reportProgress:a,responseType:s,withCredentials:d,transferCache:i})}},b=function(r){return r[r.Sent=0]="Sent",r[r.UploadProgress=1]="UploadProgress",r[r.ResponseHeader=2]="ResponseHeader",r[r.DownloadProgress=3]="DownloadProgress",r[r.Response=4]="Response",r[r.User=5]="User",r}(b||{}),j=class{headers;status;statusText;url;ok;type;constructor(e,n=200,t="OK"){this.headers=e.headers||new g,this.status=e.status!==void 0?e.status:n,this.statusText=e.statusText||t,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}},B=class r extends j{constructor(e={}){super(e)}type=b.ResponseHeader;clone(e={}){return new r({headers:e.headers||this.headers,status:e.status!==void 0?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}},U=class r extends j{body;constructor(e={}){super(e),this.body=e.body!==void 0?e.body:null}type=b.Response;clone(e={}){return new r({body:e.body!==void 0?e.body:this.body,headers:e.headers||this.headers,status:e.status!==void 0?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}},E=class extends j{name="HttpErrorResponse";message;error;ok=!1;constructor(e){super(e,0,"Unknown Error"),this.status>=200&&this.status<300?this.message=`Http failure during parsing for ${e.url||"(unknown url)"}`:this.message=`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}},Ee=200,Ie=204;function J(r,e){return{body:e,headers:r.headers,context:r.context,observe:r.observe,params:r.params,reportProgress:r.reportProgress,responseType:r.responseType,withCredentials:r.withCredentials,transferCache:r.transferCache}}var Me=(()=>{class r{handler;constructor(n){this.handler=n}request(n,t,s={}){let i;if(n instanceof k)i=n;else{let a;s.headers instanceof g?a=s.headers:a=new g(s.headers);let f;s.params&&(s.params instanceof v?f=s.params:f=new v({fromObject:s.params})),i=new k(n,t,s.body!==void 0?s.body:null,{headers:a,context:s.context,params:f,reportProgress:s.reportProgress,responseType:s.responseType||"json",withCredentials:s.withCredentials,transferCache:s.transferCache})}let o=X(i).pipe(ee(a=>this.handler.handle(a)));if(n instanceof k||s.observe==="events")return o;let d=o.pipe(H(a=>a instanceof U));switch(s.observe||"body"){case"body":switch(i.responseType){case"arraybuffer":return d.pipe(x(a=>{if(a.body!==null&&!(a.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return a.body}));case"blob":return d.pipe(x(a=>{if(a.body!==null&&!(a.body instanceof Blob))throw new Error("Response is not a Blob.");return a.body}));case"text":return d.pipe(x(a=>{if(a.body!==null&&typeof a.body!="string")throw new Error("Response is not a string.");return a.body}));case"json":default:return d.pipe(x(a=>a.body))}case"response":return d;default:throw new Error(`Unreachable: unhandled observe type ${s.observe}}`)}}delete(n,t={}){return this.request("DELETE",n,t)}get(n,t={}){return this.request("GET",n,t)}head(n,t={}){return this.request("HEAD",n,t)}jsonp(n,t){return this.request("JSONP",n,{params:new v().append(t,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(n,t={}){return this.request("OPTIONS",n,t)}patch(n,t,s={}){return this.request("PATCH",n,J(s,t))}post(n,t,s={}){return this.request("POST",n,J(s,t))}put(n,t,s={}){return this.request("PUT",n,J(s,t))}static \u0275fac=function(t){return new(t||r)(w(F))};static \u0275prov=O({token:r,factory:r.\u0275fac})}return r})(),De=/^\)\]\}',?\n/,xe="X-Request-URL";function ge(r){if(r.url)return r.url;let e=xe.toLocaleLowerCase();return r.headers.get(e)}var $=(()=>{class r{fetchImpl=m(G,{optional:!0})?.fetch??((...n)=>globalThis.fetch(...n));ngZone=m(ce);handle(n){return new S(t=>{let s=new AbortController;return this.doRequest(n,s.signal,t).then(W,i=>t.error(new E({error:i}))),()=>s.abort()})}async doRequest(n,t,s){let i=this.createRequestInit(n),o;try{let h=this.ngZone.runOutsideAngular(()=>this.fetchImpl(n.urlWithParams,Z({signal:t},i)));ke(h),s.next({type:b.Sent}),o=await h}catch(h){s.error(new E({error:h,status:h.status??0,statusText:h.statusText,url:n.urlWithParams,headers:h.headers}));return}let d=new g(o.headers),a=o.statusText,f=ge(o)??n.urlWithParams,p=o.status,y=null;if(n.reportProgress&&s.next(new B({headers:d,status:p,statusText:a,url:f})),o.body){let h=o.headers.get("content-length"),I=[],c=o.body.getReader(),l=0,T,A,u=typeof Zone<"u"&&Zone.current;await this.ngZone.runOutsideAngular(async()=>{for(;;){let{done:P,value:D}=await c.read();if(P)break;if(I.push(D),l+=D.length,n.reportProgress){A=n.responseType==="text"?(A??"")+(T??=new TextDecoder).decode(D,{stream:!0}):void 0;let Y=()=>s.next({type:b.DownloadProgress,total:h?+h:void 0,loaded:l,partialText:A});u?u.run(Y):Y()}}});let M=this.concatChunks(I,l);try{let P=o.headers.get("Content-Type")??"";y=this.parseBody(n,M,P)}catch(P){s.error(new E({error:P,headers:new g(o.headers),status:o.status,statusText:o.statusText,url:ge(o)??n.urlWithParams}));return}}p===0&&(p=y?Ee:0),p>=200&&p<300?(s.next(new U({body:y,headers:d,status:p,statusText:a,url:f})),s.complete()):s.error(new E({error:y,headers:d,status:p,statusText:a,url:f}))}parseBody(n,t,s){switch(n.responseType){case"json":let i=new TextDecoder().decode(t).replace(De,"");return i===""?null:JSON.parse(i);case"text":return new TextDecoder().decode(t);case"blob":return new Blob([t],{type:s});case"arraybuffer":return t.buffer}}createRequestInit(n){let t={},s=n.withCredentials?"include":void 0;if(n.headers.forEach((i,o)=>t[i]=o.join(",")),n.headers.has("Accept")||(t.Accept="application/json, text/plain, */*"),!n.headers.has("Content-Type")){let i=n.detectContentTypeHeader();i!==null&&(t["Content-Type"]=i)}return{body:n.serializeBody(),method:n.method,headers:t,credentials:s}}concatChunks(n,t){let s=new Uint8Array(t),i=0;for(let o of n)s.set(o,i),i+=o.length;return s}static \u0275fac=function(t){return new(t||r)};static \u0275prov=O({token:r,factory:r.\u0275fac})}return r})(),G=class{};function W(){}function ke(r){r.then(W,W)}function Fe(r,e){return e(r)}function Le(r,e,n){return(t,s)=>ie(n,()=>e(t,i=>r(i,s)))}var K=new N(""),je=new N(""),Ue=new N("",{providedIn:"root",factory:()=>!0});var Te=(()=>{class r extends F{backend;injector;chain=null;pendingTasks=m(ae);contributeToStability=m(Ue);constructor(n,t){super(),this.backend=n,this.injector=t}handle(n){if(this.chain===null){let t=Array.from(new Set([...this.injector.get(K),...this.injector.get(je,[])]));this.chain=t.reduceRight((s,i)=>Le(s,i,this.injector),Fe)}if(this.contributeToStability){let t=this.pendingTasks.add();return this.chain(n,s=>this.backend.handle(s)).pipe(ne(()=>this.pendingTasks.remove(t)))}else return this.chain(n,t=>this.backend.handle(t))}static \u0275fac=function(t){return new(t||r)(w(L),w(oe))};static \u0275prov=O({token:r,factory:r.\u0275fac})}return r})();var _e=/^\)\]\}',?\n/;function Be(r){return"responseURL"in r&&r.responseURL?r.responseURL:/^X-Request-URL:/m.test(r.getAllResponseHeaders())?r.getResponseHeader("X-Request-URL"):null}var we=(()=>{class r{xhrFactory;constructor(n){this.xhrFactory=n}handle(n){if(n.method==="JSONP")throw new te(-2800,!1);let t=this.xhrFactory;return(t.\u0275loadImpl?Q(t.\u0275loadImpl()):X(null)).pipe(re(()=>new S(i=>{let o=t.build();if(o.open(n.method,n.urlWithParams),n.withCredentials&&(o.withCredentials=!0),n.headers.forEach((c,l)=>o.setRequestHeader(c,l.join(","))),n.headers.has("Accept")||o.setRequestHeader("Accept","application/json, text/plain, */*"),!n.headers.has("Content-Type")){let c=n.detectContentTypeHeader();c!==null&&o.setRequestHeader("Content-Type",c)}if(n.responseType){let c=n.responseType.toLowerCase();o.responseType=c!=="json"?c:"text"}let d=n.serializeBody(),a=null,f=()=>{if(a!==null)return a;let c=o.statusText||"OK",l=new g(o.getAllResponseHeaders()),T=Be(o)||n.url;return a=new B({headers:l,status:o.status,statusText:c,url:T}),a},p=()=>{let{headers:c,status:l,statusText:T,url:A}=f(),u=null;l!==Ie&&(u=typeof o.response>"u"?o.responseText:o.response),l===0&&(l=u?Ee:0);let M=l>=200&&l<300;if(n.responseType==="json"&&typeof u=="string"){let P=u;u=u.replace(_e,"");try{u=u!==""?JSON.parse(u):null}catch(D){u=P,M&&(M=!1,u={error:D,text:u})}}M?(i.next(new U({body:u,headers:c,status:l,statusText:T,url:A||void 0})),i.complete()):i.error(new E({error:u,headers:c,status:l,statusText:T,url:A||void 0}))},y=c=>{let{url:l}=f(),T=new E({error:c,status:o.status||0,statusText:o.statusText||"Unknown Error",url:l||void 0});i.error(T)},R=!1,h=c=>{R||(i.next(f()),R=!0);let l={type:b.DownloadProgress,loaded:c.loaded};c.lengthComputable&&(l.total=c.total),n.responseType==="text"&&o.responseText&&(l.partialText=o.responseText),i.next(l)},I=c=>{let l={type:b.UploadProgress,loaded:c.loaded};c.lengthComputable&&(l.total=c.total),i.next(l)};return o.addEventListener("load",p),o.addEventListener("error",y),o.addEventListener("timeout",y),o.addEventListener("abort",y),n.reportProgress&&(o.addEventListener("progress",h),d!==null&&o.upload&&o.upload.addEventListener("progress",I)),o.send(d),i.next({type:b.Sent}),()=>{o.removeEventListener("error",y),o.removeEventListener("abort",y),o.removeEventListener("load",p),o.removeEventListener("timeout",y),n.reportProgress&&(o.removeEventListener("progress",h),d!==null&&o.upload&&o.upload.removeEventListener("progress",I)),o.readyState!==o.DONE&&o.abort()}})))}static \u0275fac=function(t){return new(t||r)(w(ue))};static \u0275prov=O({token:r,factory:r.\u0275fac})}return r})(),ve=new N(""),ze="XSRF-TOKEN",Se=new N("",{providedIn:"root",factory:()=>ze}),Xe="X-XSRF-TOKEN",Je=new N("",{providedIn:"root",factory:()=>Xe}),z=class{},Ce=(()=>{class r{doc;platform;cookieName;lastCookieString="";lastToken=null;parseCount=0;constructor(n,t,s){this.doc=n,this.platform=t,this.cookieName=s}getToken(){if(this.platform==="server")return null;let n=this.doc.cookie||"";return n!==this.lastCookieString&&(this.parseCount++,this.lastToken=he(n,this.cookieName),this.lastCookieString=n),this.lastToken}static \u0275fac=function(t){return new(t||r)(w(de),w(le),w(Se))};static \u0275prov=O({token:r,factory:r.\u0275fac})}return r})();function Ve(r,e){let n=r.url.toLowerCase();if(!m(ve)||r.method==="GET"||r.method==="HEAD"||n.startsWith("http://")||n.startsWith("https://"))return e(r);let t=m(z).getToken(),s=m(Je);return t!=null&&!r.headers.has(s)&&(r=r.clone({headers:r.headers.set(s,t)})),e(r)}var q=function(r){return r[r.Interceptors=0]="Interceptors",r[r.LegacyInterceptors=1]="LegacyInterceptors",r[r.CustomXsrfConfiguration=2]="CustomXsrfConfiguration",r[r.NoXsrfProtection=3]="NoXsrfProtection",r[r.JsonpSupport=4]="JsonpSupport",r[r.RequestsMadeViaParent=5]="RequestsMadeViaParent",r[r.Fetch=6]="Fetch",r}(q||{});function be(r,e){return{\u0275kind:r,\u0275providers:e}}function pn(...r){let e=[Me,we,Te,{provide:F,useExisting:Te},{provide:L,useFactory:()=>m($,{optional:!0})??m(we)},{provide:K,useValue:Ve,multi:!0},{provide:ve,useValue:!0},{provide:z,useClass:Ce}];for(let n of r)e.push(...n.\u0275providers);return se(e)}function yn(r){return be(q.Interceptors,r.map(e=>({provide:K,useValue:e,multi:!0})))}function mn(){return be(q.Fetch,[$,{provide:L,useExisting:$}])}export{g as a,U as b,Me as c,pn as d,yn as e,mn as f};