@duplicati/ngclient 0.0.225 → 0.0.226

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 (100) hide show
  1. package/assets/images/backup-from-config.png +0 -0
  2. package/assets/images/backup-from-remote.png +0 -0
  3. package/{chunk-KZYRTI62.js → chunk-3GE3OWQF.js} +1 -1
  4. package/{chunk-6DX35WDO.js → chunk-47XLDVIW.js} +1 -1
  5. package/chunk-4V3AE4ZE.js +1 -0
  6. package/chunk-5IK3XXXK.js +1 -0
  7. package/chunk-66KSIF26.js +1 -0
  8. package/chunk-6A42WZTO.js +1 -0
  9. package/{chunk-VTOEFKZG.js → chunk-6GUEHKCO.js} +1 -1
  10. package/chunk-6JZ257HD.js +1 -0
  11. package/{chunk-EXAZ4QZR.js → chunk-6LQMQH6Z.js} +1 -1
  12. package/{chunk-PDZNQW6F.js → chunk-6RZVYDJF.js} +1 -1
  13. package/chunk-75ULGSKP.js +1 -0
  14. package/chunk-A2BMFFEA.js +1 -0
  15. package/{chunk-OYU6OBKA.js → chunk-A6LVKRWD.js} +1 -1
  16. package/chunk-AOPTGCDG.js +2 -0
  17. package/chunk-AU25JBCN.js +11 -0
  18. package/chunk-DCBSWJWZ.js +1 -0
  19. package/{chunk-OSGHJCUU.js → chunk-DHJS5K3Y.js} +1 -1
  20. package/{chunk-PNRFCYAE.js → chunk-DPQTEDTG.js} +1 -1
  21. package/{chunk-NE255HQN.js → chunk-EY7DOUFA.js} +1 -1
  22. package/{chunk-4ISFDBI3.js → chunk-FUF6MJKB.js} +1 -1
  23. package/{chunk-JNZJE3GC.js → chunk-FXUIGUFS.js} +1 -1
  24. package/chunk-G4QGXDP5.js +1 -0
  25. package/{chunk-AR5SEBWX.js → chunk-GDKT3FJR.js} +1 -1
  26. package/{chunk-N5XYG3QW.js → chunk-GO52XH3L.js} +1 -1
  27. package/{chunk-P2EIEVFT.js → chunk-GULHHZTR.js} +1 -1
  28. package/{chunk-T7RMSUHE.js → chunk-HX3OONES.js} +1 -1
  29. package/{chunk-TXCVGOPN.js → chunk-I5OT6RKO.js} +1 -1
  30. package/{chunk-VQLI7RDY.js → chunk-JSPDZRZU.js} +1 -1
  31. package/{chunk-5UJN5SN4.js → chunk-JUESTFR6.js} +1 -1
  32. package/chunk-K3VYMXQM.js +1 -0
  33. package/chunk-KKD7OSBL.js +1 -0
  34. package/{chunk-OP7MDR2B.js → chunk-KKUFO6NZ.js} +1 -1
  35. package/{chunk-EBKOJDCT.js → chunk-KMESPAAQ.js} +1 -1
  36. package/{chunk-ZSAEIKEB.js → chunk-KYWUJWBQ.js} +1 -1
  37. package/{chunk-UIVZWXBK.js → chunk-LNE7WQZG.js} +1 -1
  38. package/{chunk-ZGQ2WCM2.js → chunk-LP2FIVE3.js} +1 -1
  39. package/{chunk-O2HQIEE4.js → chunk-LP3KCTXP.js} +1 -1
  40. package/chunk-LZIQCSZ3.js +1 -0
  41. package/chunk-M3QHK4UT.js +1 -0
  42. package/{chunk-JBX7YYME.js → chunk-MIJNCB2V.js} +1 -1
  43. package/{chunk-5QGFYH2A.js → chunk-MOOFSJSE.js} +1 -1
  44. package/chunk-MWQHWJOA.js +1 -0
  45. package/{chunk-7VQ67PEZ.js → chunk-MWY7XFWW.js} +1 -1
  46. package/{chunk-MSIH2OJ5.js → chunk-N2ZEWG3V.js} +1 -1
  47. package/{chunk-3PARK7B7.js → chunk-NDEZRDHS.js} +1 -1
  48. package/chunk-NNSH2MIZ.js +1 -0
  49. package/{chunk-POVWDK74.js → chunk-ONQFM5B7.js} +1 -1
  50. package/chunk-OVNIENWW.js +2 -0
  51. package/{chunk-NQAD2FBX.js → chunk-PKSSAQHV.js} +1 -1
  52. package/chunk-PSEMHKPR.js +1 -0
  53. package/{chunk-3V25RAVK.js → chunk-QAEOCCMO.js} +1 -1
  54. package/chunk-QMZVKUXI.js +1 -0
  55. package/{chunk-JCXT6U5P.js → chunk-QODXELJ3.js} +1 -1
  56. package/{chunk-XUCXLLB4.js → chunk-R2U3UIJI.js} +1 -1
  57. package/{chunk-TSVSMVY4.js → chunk-S5IJ4C5T.js} +1 -1
  58. package/{chunk-QW23XWNE.js → chunk-SCDXVGMX.js} +1 -1
  59. package/{chunk-3DHD6GQL.js → chunk-SCFUXVU4.js} +1 -1
  60. package/chunk-SY6UK74R.js +1 -0
  61. package/{chunk-35FMFK4I.js → chunk-TGVKMKNV.js} +1 -1
  62. package/chunk-U2QRNQWA.js +1 -0
  63. package/{chunk-YS4B2B5N.js → chunk-UHSRAJTA.js} +1 -1
  64. package/{chunk-KX3UP3HV.js → chunk-UK6C6RS4.js} +1 -1
  65. package/{chunk-PMF4FTBF.js → chunk-ULC7YKKF.js} +1 -1
  66. package/{chunk-3HYQMG65.js → chunk-UZ2BD6RF.js} +1 -1
  67. package/{chunk-G7TNRWOU.js → chunk-VCDNIRPY.js} +1 -1
  68. package/{chunk-VOXTAZLZ.js → chunk-VJ3733O4.js} +1 -1
  69. package/chunk-W7PQYY25.js +1 -0
  70. package/{chunk-A23UTI46.js → chunk-XAYQR66G.js} +1 -1
  71. package/{chunk-ZXBKGNJU.js → chunk-XCS545S6.js} +1 -1
  72. package/{chunk-TWWAK5M6.js → chunk-XJUQUKBN.js} +1 -1
  73. package/chunk-XKDNDQVK.js +1 -0
  74. package/chunk-YQ5IJ3RD.js +1 -0
  75. package/{chunk-E4CYVUYG.js → chunk-ZFV3MK5Y.js} +1 -1
  76. package/chunk-ZUMHFNEV.js +1 -0
  77. package/index.html +1 -1
  78. package/main-RCWMFMBQ.js +1 -0
  79. package/package.json +1 -1
  80. package/chunk-2EX5HS5X.js +0 -1
  81. package/chunk-5FQ7HESA.js +0 -1
  82. package/chunk-6WX2UOAN.js +0 -1
  83. package/chunk-EVEI25GQ.js +0 -2
  84. package/chunk-GKAMSAN5.js +0 -1
  85. package/chunk-HS3UDQIJ.js +0 -1
  86. package/chunk-IDJ52K34.js +0 -1
  87. package/chunk-ITN4L52Q.js +0 -1
  88. package/chunk-J7GH3G72.js +0 -1
  89. package/chunk-KGK4RY3J.js +0 -1
  90. package/chunk-KNSQLQC6.js +0 -1
  91. package/chunk-KUNX5APQ.js +0 -1
  92. package/chunk-LXTSZI4K.js +0 -1
  93. package/chunk-MKI54WTC.js +0 -1
  94. package/chunk-NUV5LHQV.js +0 -1
  95. package/chunk-O2L2FRYE.js +0 -11
  96. package/chunk-TV7OB7Y4.js +0 -1
  97. package/chunk-UNQKMTFM.js +0 -1
  98. package/chunk-VZNLMGYP.js +0 -2
  99. package/chunk-Y47NRSCA.js +0 -1
  100. package/main-S64CL44W.js +0 -1
@@ -1 +1 @@
1
- import{a as b}from"./chunk-TSVSMVY4.js";import{a as d,b as p}from"./chunk-OP7MDR2B.js";import{a as R}from"./chunk-PEOYNJJM.js";import{a as f}from"./chunk-NUV5LHQV.js";import{z as h}from"./chunk-CJKZ27FM.js";import{d as m}from"./chunk-KNSQLQC6.js";import{$ as s,Rc as a,W as g,Z as u,qa as o,sa as n}from"./chunk-K5XGRFWJ.js";var S=new u("WindowToken",{providedIn:"root",factory:()=>typeof window<"u"?window:{}});var C=class l{#c=s(S);#g=s(h);#t=s(m);#o=s(f);#l=s(d);#n=s(p);#u=s(b);constructor(){this.#l.subscribe("remotecontrol")}repeatRegisterTimer=null;#s=null;#r=0;#h=5;#m=2e3;pendingRefresh=!1;state=o("unknown");claimUrl=o(null);registerUrl=o("");customRegisterUrl=o("");statusMessage=a(()=>{let e=this.state();return e==="connecting"?$localize`Console connection is enabled but not connected`:e==="connected"?$localize`Connected to console`:e==="registering"?$localize`Registering machine...`:e==="registeringfaulted"?$localize`Registration failed`:e==="registered"?$localize`Registered, waiting for accept`:e==="disabled"?$localize`Console connection is configured but not enabled`:e==="unknown"?$localize`...loading...`:$localize`Console connection is not set up`});sysInfoEffect=n(()=>{let e=this.#o.systemInfo();e&&this.registerUrl.set(e.RemoteControlRegistrationUrl??"")});remoteEffect=n(()=>{let e=this.#l.remoteControlState();e&&this.#e(e)});pendingRefreshEffect=n(()=>{this.#n.isConnectionMethodSet()&&this.pendingRefresh&&(this.pendingRefresh=!1,this.refreshRemoteControlStatus())});#a=a(()=>{let e=this.#n.getConnectionMethod()==="websocket",i=this.#o.hasWsRemoteControl();return e&&i});#f(e){e.RegistrationUrl&&this.claimUrl.set(e.RegistrationUrl),e.IsConnected?this.state.set("connected"):e.IsEnabled?this.state.set("connecting"):e.CanEnable?this.state.set("disabled"):e.IsRegisteringFaulted?this.state.set("registeringfaulted"):e.IsRegistering?e.RegistrationUrl!=null&&e.RegistrationUrl.trim().length>0?this.state.set("registered"):this.state.set("registering"):this.state.set("inactive")}#e(e){if(this.#r=0,this.#f(e),this.#a())return;let i=this.state();this.repeatRegisterTimer!==null&&(clearTimeout(this.repeatRegisterTimer),this.repeatRegisterTimer=null),i==="registering"&&(this.repeatRegisterTimer=setTimeout(()=>{this.#t.postApiV1RemotecontrolRegisterWait().subscribe({next:t=>this.#e(t),error:t=>this.#i(t)})},5e3)),(i==="connecting"||i==="registered")&&(this.repeatRegisterTimer=setTimeout(()=>{this.#t.getApiV1RemotecontrolStatus().subscribe({next:t=>this.#e(t),error:t=>this.#i(t)})},5e3)),e.IsRegistering&&e.CanEnable&&this.#t.deleteApiV1RemotecontrolRegister().subscribe({next:t=>this.#e(t)})}#i(e){if(this.#s!==null&&(clearTimeout(this.#s),this.#s=null),this.#r>=this.#h){this.state.set("registeringfaulted"),this.#r=0;return}let i=this.#m*Math.pow(2,this.#r);this.#r++,this.#s=setTimeout(()=>{this.#s=null,this.#t.getApiV1RemotecontrolStatus().subscribe({next:t=>this.#e(t),error:t=>this.#i(t)})},i)}refreshRemoteControlStatus(){if(!this.#a()){if(!this.#n.isConnectionMethodSet()){this.pendingRefresh=!0;return}this.#t.getApiV1RemotecontrolStatus().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)})}}beginRemoteRegistration(e=!1){this.state.set("registering"),this.#t.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:e?this.customRegisterUrl():this.registerUrl()}}).subscribe({next:i=>this.#e(i),error:i=>this.#i(i)})}cancelRemoteRegistration(){this.#t.deleteApiV1RemotecontrolRegister().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)})}enableRemoteControl(){this.#t.postApiV1RemotecontrolEnable().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)})}disableRemoteControl(){this.#t.postApiV1RemotecontrolDisable().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)})}deleteRemoteControl(){let e=this;this.#g.open(R,{data:{title:$localize`Confirm delete`,message:$localize`Are you sure you want to delete the console registration?`,confirmText:$localize`Delete registration`,cancelText:$localize`Cancel`},closed:i=>{i&&e.#t.deleteApiV1RemotecontrolRegistration().subscribe({next:t=>e.#e(t),error:t=>e.#i(t)})}})}openConsole(e="/app/machines",i){let t=this.#u.serverSettings(),y=this.#o.systemInfo(),r="https://app.duplicati.com",c=y?.RemoteControlDashboardUrl??"";if(c.length>0&&(r=c),t&&t["remote-control-dashboard-url"]&&(r=t["remote-control-dashboard-url"]),r=new URL(r).origin+e,i){let v=new URLSearchParams(i);r+=`?${v.toString()}`}this.#c.open(r,"_blank")}static \u0275fac=function(i){return new(i||l)};static \u0275prov=g({token:l,factory:l.\u0275fac,providedIn:"root"})};export{S as a,C as b};
1
+ import{a as b}from"./chunk-S5IJ4C5T.js";import{a as d,b as p}from"./chunk-KKUFO6NZ.js";import{a as R}from"./chunk-PEOYNJJM.js";import{a as f}from"./chunk-MWQHWJOA.js";import{z as h}from"./chunk-CJKZ27FM.js";import{d as m}from"./chunk-4V3AE4ZE.js";import{$ as s,Rc as a,W as g,Z as u,qa as o,sa as n}from"./chunk-K5XGRFWJ.js";var S=new u("WindowToken",{providedIn:"root",factory:()=>typeof window<"u"?window:{}});var C=class l{#c=s(S);#g=s(h);#t=s(m);#o=s(f);#l=s(d);#n=s(p);#u=s(b);constructor(){this.#l.subscribe("remotecontrol")}repeatRegisterTimer=null;#s=null;#r=0;#h=5;#m=2e3;pendingRefresh=!1;state=o("unknown");claimUrl=o(null);registerUrl=o("");customRegisterUrl=o("");statusMessage=a(()=>{let e=this.state();return e==="connecting"?$localize`Console connection is enabled but not connected`:e==="connected"?$localize`Connected to console`:e==="registering"?$localize`Registering machine...`:e==="registeringfaulted"?$localize`Registration failed`:e==="registered"?$localize`Registered, waiting for accept`:e==="disabled"?$localize`Console connection is configured but not enabled`:e==="unknown"?$localize`...loading...`:$localize`Console connection is not set up`});sysInfoEffect=n(()=>{let e=this.#o.systemInfo();e&&this.registerUrl.set(e.RemoteControlRegistrationUrl??"")});remoteEffect=n(()=>{let e=this.#l.remoteControlState();e&&this.#e(e)});pendingRefreshEffect=n(()=>{this.#n.isConnectionMethodSet()&&this.pendingRefresh&&(this.pendingRefresh=!1,this.refreshRemoteControlStatus())});#a=a(()=>{let e=this.#n.getConnectionMethod()==="websocket",i=this.#o.hasWsRemoteControl();return e&&i});#f(e){e.RegistrationUrl&&this.claimUrl.set(e.RegistrationUrl),e.IsConnected?this.state.set("connected"):e.IsEnabled?this.state.set("connecting"):e.CanEnable?this.state.set("disabled"):e.IsRegisteringFaulted?this.state.set("registeringfaulted"):e.IsRegistering?e.RegistrationUrl!=null&&e.RegistrationUrl.trim().length>0?this.state.set("registered"):this.state.set("registering"):this.state.set("inactive")}#e(e){if(this.#r=0,this.#f(e),this.#a())return;let i=this.state();this.repeatRegisterTimer!==null&&(clearTimeout(this.repeatRegisterTimer),this.repeatRegisterTimer=null),i==="registering"&&(this.repeatRegisterTimer=setTimeout(()=>{this.#t.postApiV1RemotecontrolRegisterWait().subscribe({next:t=>this.#e(t),error:t=>this.#i(t)})},5e3)),(i==="connecting"||i==="registered")&&(this.repeatRegisterTimer=setTimeout(()=>{this.#t.getApiV1RemotecontrolStatus().subscribe({next:t=>this.#e(t),error:t=>this.#i(t)})},5e3)),e.IsRegistering&&e.CanEnable&&this.#t.deleteApiV1RemotecontrolRegister().subscribe({next:t=>this.#e(t)})}#i(e){if(this.#s!==null&&(clearTimeout(this.#s),this.#s=null),this.#r>=this.#h){this.state.set("registeringfaulted"),this.#r=0;return}let i=this.#m*Math.pow(2,this.#r);this.#r++,this.#s=setTimeout(()=>{this.#s=null,this.#t.getApiV1RemotecontrolStatus().subscribe({next:t=>this.#e(t),error:t=>this.#i(t)})},i)}refreshRemoteControlStatus(){if(!this.#a()){if(!this.#n.isConnectionMethodSet()){this.pendingRefresh=!0;return}this.#t.getApiV1RemotecontrolStatus().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)})}}beginRemoteRegistration(e=!1){this.state.set("registering"),this.#t.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:e?this.customRegisterUrl():this.registerUrl()}}).subscribe({next:i=>this.#e(i),error:i=>this.#i(i)})}cancelRemoteRegistration(){this.#t.deleteApiV1RemotecontrolRegister().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)})}enableRemoteControl(){this.#t.postApiV1RemotecontrolEnable().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)})}disableRemoteControl(){this.#t.postApiV1RemotecontrolDisable().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)})}deleteRemoteControl(){let e=this;this.#g.open(R,{data:{title:$localize`Confirm delete`,message:$localize`Are you sure you want to delete the console registration?`,confirmText:$localize`Delete registration`,cancelText:$localize`Cancel`},closed:i=>{i&&e.#t.deleteApiV1RemotecontrolRegistration().subscribe({next:t=>e.#e(t),error:t=>e.#i(t)})}})}openConsole(e="/app/machines",i){let t=this.#u.serverSettings(),y=this.#o.systemInfo(),r="https://app.duplicati.com",c=y?.RemoteControlDashboardUrl??"";if(c.length>0&&(r=c),t&&t["remote-control-dashboard-url"]&&(r=t["remote-control-dashboard-url"]),r=new URL(r).origin+e,i){let v=new URLSearchParams(i);r+=`?${v.toString()}`}this.#c.open(r,"_blank")}static \u0275fac=function(i){return new(i||l)};static \u0275prov=g({token:l,factory:l.\u0275fac,providedIn:"root"})};export{S as a,C as b};
@@ -1 +1 @@
1
- import{a as l}from"./chunk-YS4B2B5N.js";import{a as c}from"./chunk-KZYRTI62.js";import{xa as r}from"./chunk-YF6JHIN5.js";import{$ as e,Aa as n,Rc as d,W as o,ja as a,qa as t,sa as s}from"./chunk-K5XGRFWJ.js";var m=class i{#i=e(c);#t=e(a);#o=e(n);#e=l("darkTheme",null,!0);#s=t(this.#i.innerWidth);isMobile=d(()=>this.#s()<1024);sidenavType=t(this.isMobile()?"overlay":"");isNavOpen=t(!1);isDarkMode=this.#e.asReadonly();darkModeEffect=s(()=>{this.#e()?(this.#t.documentElement.classList.add("dark"),this.#t.documentElement.classList.remove("light")):(this.#t.documentElement.classList.remove("dark"),this.#t.documentElement.classList.add("light"))});isMobileEffect=s(()=>{this.isNavOpen.set(!this.isMobile()),this.sidenavType.set(this.isMobile()?"overlay":"")});constructor(){r(this.#o)&&this.#i?.addEventListener("resize",()=>{this.#s.set(this.#i.innerWidth)})}toggleNav(){this.isNavOpen.set(!this.isNavOpen())}toggleBodyClass(){this.#e.set(!this.isDarkMode())}setDarkMode(){this.#e.set(!0)}setLightMode(){this.#e.set(!1)}static \u0275fac=function(h){return new(h||i)};static \u0275prov=o({token:i,factory:i.\u0275fac,providedIn:"root"})};export{m as a};
1
+ import{a as l}from"./chunk-UHSRAJTA.js";import{a as c}from"./chunk-3GE3OWQF.js";import{xa as r}from"./chunk-YF6JHIN5.js";import{$ as e,Aa as n,Rc as d,W as o,ja as a,qa as t,sa as s}from"./chunk-K5XGRFWJ.js";var m=class i{#i=e(c);#t=e(a);#o=e(n);#e=l("darkTheme",null,!0);#s=t(this.#i.innerWidth);isMobile=d(()=>this.#s()<1024);sidenavType=t(this.isMobile()?"overlay":"");isNavOpen=t(!1);isDarkMode=this.#e.asReadonly();darkModeEffect=s(()=>{this.#e()?(this.#t.documentElement.classList.add("dark"),this.#t.documentElement.classList.remove("light")):(this.#t.documentElement.classList.remove("dark"),this.#t.documentElement.classList.add("light"))});isMobileEffect=s(()=>{this.isNavOpen.set(!this.isMobile()),this.sidenavType.set(this.isMobile()?"overlay":"")});constructor(){r(this.#o)&&this.#i?.addEventListener("resize",()=>{this.#s.set(this.#i.innerWidth)})}toggleNav(){this.isNavOpen.set(!this.isNavOpen())}toggleBodyClass(){this.#e.set(!this.isDarkMode())}setDarkMode(){this.#e.set(!0)}setLightMode(){this.#e.set(!1)}static \u0275fac=function(h){return new(h||i)};static \u0275prov=o({token:i,factory:i.\u0275fac,providedIn:"root"})};export{m as a};
@@ -0,0 +1 @@
1
+ import{a as O,d as y}from"./chunk-HDDAGHHE.js";import{B as k,M as P,W as c,_ as A,l as f,m,q as R,w as D}from"./chunk-K5XGRFWJ.js";import{a as l,b as I}from"./chunk-7CGTOI24.js";var g=class{_fns;constructor(){this._fns=[]}eject(e){let p=this._fns.indexOf(e);p!==-1&&(this._fns=[...this._fns.slice(0,p),...this._fns.slice(p+1)])}use(e){this._fns=[...this._fns,e]}},t={BASE:"",CREDENTIALS:"include",ENCODE_PATH:void 0,HEADERS:void 0,PASSWORD:void 0,TOKEN:void 0,USERNAME:void 0,VERSION:"1",WITH_CREDENTIALS:!1,interceptors:{response:new g}};var d=class extends Error{url;status;statusText;body;request;constructor(e,p,r){super(r),this.name="ApiError",this.url=p.url,this.status=p.status,this.statusText=p.statusText,this.body=p.body,this.request=e}};var h=i=>typeof i=="string",v=i=>h(i)&&i!=="",T=i=>i instanceof Blob,S=i=>i instanceof FormData,F=i=>{try{return btoa(i)}catch{return Buffer.from(i).toString("base64")}},L=i=>{let e=[],p=(a,n)=>{e.push(`${encodeURIComponent(a)}=${encodeURIComponent(String(n))}`)},r=(a,n)=>{n!=null&&(n instanceof Date?p(a,n.toISOString()):Array.isArray(n)?n.forEach(o=>r(a,o)):typeof n=="object"?Object.entries(n).forEach(([o,u])=>r(`${a}[${o}]`,u)):p(a,n))};return Object.entries(i).forEach(([a,n])=>r(a,n)),e.length?`?${e.join("&")}`:""},j=(i,e)=>{let p=i.ENCODE_PATH||encodeURI,r=e.url.replace("{api-version}",i.VERSION).replace(/{(.*?)}/g,(n,o)=>e.path?.hasOwnProperty(o)?p(String(e.path[o])):n),a=i.BASE+r;return e.query?a+L(e.query):a},w=i=>{if(i.formData){let e=new FormData,p=(r,a)=>{h(a)||T(a)?e.append(r,a):e.append(r,JSON.stringify(a))};return Object.entries(i.formData).filter(([,r])=>r!=null).forEach(([r,a])=>{Array.isArray(a)?a.forEach(n=>p(r,n)):p(r,a)}),e}},V=async(i,e)=>typeof e=="function"?e(i):e,U=(i,e)=>D({token:V(e,i.TOKEN),username:V(e,i.USERNAME),password:V(e,i.PASSWORD),additionalHeaders:V(e,i.HEADERS)}).pipe(R(({token:p,username:r,password:a,additionalHeaders:n})=>{let o=Object.entries(l(l({Accept:"application/json"},n),e.headers)).filter(([,u])=>u!=null).reduce((u,[B,b])=>I(l({},u),{[B]:String(b)}),{});if(v(p)&&(o.Authorization=`Bearer ${p}`),v(r)&&v(a)){let u=F(`${r}:${a}`);o.Authorization=`Basic ${u}`}return e.body!==void 0&&(e.mediaType?o["Content-Type"]=e.mediaType:T(e.body)?o["Content-Type"]=e.body.type||"application/octet-stream":h(e.body)?o["Content-Type"]="text/plain":S(e.body)||(o["Content-Type"]="application/json")),new O(o)})),H=i=>{if(i.body)return i.mediaType?.includes("application/json")||i.mediaType?.includes("+json")?JSON.stringify(i.body):h(i.body)||T(i.body)||S(i.body)?i.body:JSON.stringify(i.body)},N=(i,e,p,r,a,n,o)=>p.request(e.method,r,{headers:o,body:a??n,withCredentials:i.WITH_CREDENTIALS,observe:"response"}),M=(i,e)=>{if(e){let p=i.headers.get(e);if(h(p))return p}},z=i=>{if(i.status!==204&&i.body!==null)return i.body},W=(i,e)=>{let r=l({400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"Im a teapot",421:"Misdirected Request",422:"Unprocessable Content",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"},i.errors)[e.status];if(r)throw new d(i,e,r);if(!e.ok){let a=e.status??"unknown",n=e.statusText??"unknown",o=(()=>{try{return JSON.stringify(e.body,null,2)}catch{return}})();throw new d(i,e,`Generic Error: status: ${a}; status text: ${n}; body: ${o}`)}},s=(i,e,p)=>{let r=j(i,p),a=w(p),n=H(p);return U(i,p).pipe(P(o=>N(i,p,e,r,n,a,o)),P(async o=>{for(let x of i.interceptors.response._fns)o=await x(o);let u=z(o),B=M(o,p.responseHeader),b=u;return p.responseTransformer&&o.ok&&(b=await p.responseTransformer(u)),{url:r,ok:o.ok,status:o.status,statusText:o.statusText,body:B??b}}),k(o=>o.status?f({url:r,ok:o.ok,status:o.status,statusText:o.statusText,body:o.error??o.statusText}):m(()=>o)),R(o=>(W(p,o),o.body)),k(o=>m(()=>o)))};var G=class i{constructor(e){this.http=e}getApiV1Commandline(){return s(t,this.http,{method:"GET",url:"/api/v1/commandline"})}static \u0275fac=function(p){return new(p||i)(A(y))};static \u0275prov=c({token:i,factory:i.\u0275fac,providedIn:"root"})},E=class i{constructor(e){this.http=e}getApiV2ConnectionStrings(){return s(t,this.http,{method:"GET",url:"/api/v2/connection-strings"})}postApiV2ConnectionStrings(e){return s(t,this.http,{method:"POST",url:"/api/v2/connection-strings",body:e.requestBody,mediaType:"application/json"})}getApiV2ConnectionStringById(e){return s(t,this.http,{method:"GET",url:"/api/v2/connection-string/{id}",path:{id:e.id}})}putApiV2ConnectionStringById(e){return s(t,this.http,{method:"PUT",url:"/api/v2/connection-string/{id}",path:{id:e.id},body:e.requestBody,mediaType:"application/json"})}deleteApiV2ConnectionStringById(e){return s(t,this.http,{method:"DELETE",url:"/api/v2/connection-string/{id}",path:{id:e.id}})}postApiV2ConnectionStringByIdUpdateBackups(e){return s(t,this.http,{method:"POST",url:"/api/v2/connection-string/{id}/update-backups",path:{id:e.id},body:e.requestBody,mediaType:"application/json"})}static \u0275fac=function(p){return new(p||i)(A(y))};static \u0275prov=c({token:i,factory:i.\u0275fac,providedIn:"root"})},C=class i{constructor(e){this.http=e}postApiV1Commandline(e){return s(t,this.http,{method:"POST",url:"/api/v1/commandline",body:e.requestBody,mediaType:"application/json"})}getApiV1Acknowledgements(){return s(t,this.http,{method:"GET",url:"/api/v1/acknowledgements"})}postApiV1AuthRefresh(e={}){return s(t,this.http,{method:"POST",url:"/api/v1/auth/refresh",body:e.requestBody,mediaType:"application/json"})}postApiV1AuthSignin(e){return s(t,this.http,{method:"POST",url:"/api/v1/auth/signin",body:e.requestBody,mediaType:"application/json"})}postApiV1AuthLogin(e){return s(t,this.http,{method:"POST",url:"/api/v1/auth/login",body:e.requestBody,mediaType:"application/json"})}postApiV1AuthIssuesignintoken(e){return s(t,this.http,{method:"POST",url:"/api/v1/auth/issuesignintoken",body:e.requestBody,mediaType:"application/json"})}postApiV1AuthRefreshLogout(e={}){return s(t,this.http,{method:"POST",url:"/api/v1/auth/refresh/logout",body:e.requestBody,mediaType:"application/json"})}postApiV1AuthIssuetokenByOperation(e){return s(t,this.http,{method:"POST",url:"/api/v1/auth/issuetoken/{operation}",path:{operation:e.operation}})}postApiV1AuthIssueForeverToken(){return s(t,this.http,{method:"POST",url:"/api/v1/auth/issue-forever-token"})}postApiV1AuthStatus(){return s(t,this.http,{method:"POST",url:"/api/v1/auth/status"})}getApiV1Backupdefaults(){return s(t,this.http,{method:"GET",url:"/api/v1/backupdefaults"})}getApiV1Backups(e={}){return s(t,this.http,{method:"GET",url:"/api/v1/backups",query:{orderBy:e.orderBy}})}postApiV1Backups(e){return s(t,this.http,{method:"POST",url:"/api/v1/backups",query:{temporary:e.temporary,existingdb:e.existingdb},body:e.requestBody,mediaType:"application/json"})}postApiV1BackupsImport(e){return s(t,this.http,{method:"POST",url:"/api/v1/backups/import",body:e.requestBody,mediaType:"application/json"})}getApiV1BugreportByReportid(e){return s(t,this.http,{method:"GET",url:"/api/v1/bugreport/{reportid}",path:{reportid:e.reportid},query:{token:e.token}})}getApiV1Changelog(e={}){return s(t,this.http,{method:"GET",url:"/api/v1/changelog",query:{"from-update":e.fromUpdate}})}getApiV1CommandlineByRunid(e){return s(t,this.http,{method:"GET",url:"/api/v1/commandline/{runid}",path:{runid:e.runid},query:{offset:e.offset,pagesize:e.pagesize}})}postApiV1CommandlineByRunidAbort(e){return s(t,this.http,{method:"POST",url:"/api/v1/commandline/{runid}/abort",path:{runid:e.runid}})}postApiV1Filesystem(e){return s(t,this.http,{method:"POST",url:"/api/v1/filesystem",query:{onlyFolders:e.onlyFolders,showHidden:e.showHidden},body:e.requestBody,mediaType:"application/json"})}postApiV1FilesystemValidate(e){return s(t,this.http,{method:"POST",url:"/api/v1/filesystem/validate",body:e.requestBody,mediaType:"application/json"})}getApiV1Folderstatus(){return s(t,this.http,{method:"GET",url:"/api/v1/folderstatus"})}getApiV1FolderstatusByPath(e){return s(t,this.http,{method:"GET",url:"/api/v1/folderstatus/{path}",path:{path:e.path}})}getApiV1Licenses(){return s(t,this.http,{method:"GET",url:"/api/v1/licenses"})}getApiV1LogdataPoll(e){return s(t,this.http,{method:"GET",url:"/api/v1/logdata/poll",query:{level:e.level,id:e.id,pagesize:e.pagesize}})}getApiV1LogdataLog(e={}){return s(t,this.http,{method:"GET",url:"/api/v1/logdata/log",query:{offset:e.offset,pagesize:e.pagesize}})}getApiV1LogdataCrashlog(){return s(t,this.http,{method:"GET",url:"/api/v1/logdata/crashlog"})}getApiV1NotificationById(e){return s(t,this.http,{method:"GET",url:"/api/v1/notification/{id}",path:{id:e.id}})}deleteApiV1NotificationById(e){return s(t,this.http,{method:"DELETE",url:"/api/v1/notification/{id}",path:{id:e.id}})}getApiV1Notifications(){return s(t,this.http,{method:"GET",url:"/api/v1/notifications"})}getApiV1Progressstate(){return s(t,this.http,{method:"GET",url:"/api/v1/progressstate"})}getApiV1RemotecontrolStatus(){return s(t,this.http,{method:"GET",url:"/api/v1/remotecontrol/status"})}postApiV1RemoteoperationDbpath(e){return s(t,this.http,{method:"POST",url:"/api/v1/remoteoperation/dbpath",body:e.requestBody,mediaType:"application/json"})}postApiV1RemoteoperationTest(e){return s(t,this.http,{method:"POST",url:"/api/v1/remoteoperation/test",query:{autocreate:e.autocreate,readOnlyTest:e.readOnlyTest,type:e.type},body:e.requestBody,mediaType:"application/json"})}postApiV1RemoteoperationCreate(e){return s(t,this.http,{method:"POST",url:"/api/v1/remoteoperation/create",body:e.requestBody,mediaType:"application/json"})}getApiV1Serversettings(){return s(t,this.http,{method:"GET",url:"/api/v1/serversettings"})}patchApiV1Serversettings(e){return s(t,this.http,{method:"PATCH",url:"/api/v1/serversettings",body:e.requestBody,mediaType:"application/json"})}getApiV1ServersettingByKey(e){return s(t,this.http,{method:"GET",url:"/api/v1/serversetting/{key}",path:{key:e.key}})}putApiV1ServersettingByKey(e){return s(t,this.http,{method:"PUT",url:"/api/v1/serversetting/{key}",path:{key:e.key},body:e.requestBody,mediaType:"application/json"})}getApiV1Serverstate(e={}){return s(t,this.http,{method:"GET",url:"/api/v1/serverstate",query:{lastEventId:e.lastEventId,longpoll:e.longpoll,duration:e.duration}})}postApiV1ServerstatePause(e={}){return s(t,this.http,{method:"POST",url:"/api/v1/serverstate/pause",query:{duration:e.duration,pauseTransfers:e.pauseTransfers}})}postApiV1ServerstateResume(){return s(t,this.http,{method:"POST",url:"/api/v1/serverstate/resume"})}getApiV1Systeminfo(){return s(t,this.http,{method:"GET",url:"/api/v1/systeminfo"})}getApiV1SysteminfoFiltergroups(){return s(t,this.http,{method:"GET",url:"/api/v1/systeminfo/filtergroups"})}getApiV1Tasks(){return s(t,this.http,{method:"GET",url:"/api/v1/tasks"})}getApiV1TaskByTaskid(e){return s(t,this.http,{method:"GET",url:"/api/v1/task/{taskid}",path:{taskid:e.taskid}})}postApiV1TaskByTaskidStop(e){return s(t,this.http,{method:"POST",url:"/api/v1/task/{taskid}/stop",path:{taskid:e.taskid}})}postApiV1TaskByTaskidAbort(e){return s(t,this.http,{method:"POST",url:"/api/v1/task/{taskid}/abort",path:{taskid:e.taskid}})}getApiV1Uisettings(){return s(t,this.http,{method:"GET",url:"/api/v1/uisettings"})}postApiV1Uisettings(e){return s(t,this.http,{method:"POST",url:"/api/v1/uisettings",body:e.requestBody,mediaType:"application/json"})}getApiV1UisettingsByScheme(e){return s(t,this.http,{method:"GET",url:"/api/v1/uisettings/{scheme}",path:{scheme:e.scheme}})}patchApiV1UisettingsByScheme(e){return s(t,this.http,{method:"PATCH",url:"/api/v1/uisettings/{scheme}",path:{scheme:e.scheme},body:e.requestBody,mediaType:"application/json"})}postApiV1UpdatesCheck(){return s(t,this.http,{method:"POST",url:"/api/v1/updates/check"})}postApiV1WebmoduleByModulekey(e){return s(t,this.http,{method:"POST",url:"/api/v1/webmodule/{modulekey}",path:{modulekey:e.modulekey},body:e.requestBody,mediaType:"application/json"})}getApiV1BackupById(e){return s(t,this.http,{method:"GET",url:"/api/v1/backup/{id}",path:{id:e.id}})}putApiV1BackupById(e){return s(t,this.http,{method:"PUT",url:"/api/v1/backup/{id}",path:{id:e.id},body:e.requestBody,mediaType:"application/json"})}deleteApiV1BackupById(e){return s(t,this.http,{method:"DELETE",url:"/api/v1/backup/{id}",path:{id:e.id},query:{"delete-remote-files":e.deleteRemoteFiles,"delete-local-db":e.deleteLocalDb,force:e.force}})}getApiV1BackupByIdFiles(e){return s(t,this.http,{method:"GET",url:"/api/v1/backup/{id}/files",path:{id:e.id},query:{filter:e.filter,time:e.time,"all-versions":e.allVersions,"prefix-only":e.prefixOnly,"folder-contents":e.folderContents}})}getApiV1BackupByIdLog(e){return s(t,this.http,{method:"GET",url:"/api/v1/backup/{id}/log",path:{id:e.id},query:{offset:e.offset,pagesize:e.pagesize}})}getApiV1BackupByIdRemotelog(e){return s(t,this.http,{method:"GET",url:"/api/v1/backup/{id}/remotelog",path:{id:e.id},query:{offset:e.offset,pagesize:e.pagesize}})}getApiV1BackupByIdFilesets(e){return s(t,this.http,{method:"GET",url:"/api/v1/backup/{id}/filesets",path:{id:e.id},query:{"include-metadata":e.includeMetadata,"from-remote-only":e.fromRemoteOnly}})}getApiV1BackupByIdExportArgsonly(e){return s(t,this.http,{method:"GET",url:"/api/v1/backup/{id}/export-argsonly",path:{id:e.id},query:{"export-passwords":e.exportPasswords,passphrase:e.passphrase}})}getApiV1BackupByIdExportCmdline(e){return s(t,this.http,{method:"GET",url:"/api/v1/backup/{id}/export-cmdline",path:{id:e.id},query:{"export-passwords":e.exportPasswords,passphrase:e.passphrase}})}getApiV1BackupByIdExport(e){return s(t,this.http,{method:"GET",url:"/api/v1/backup/{id}/export",path:{id:e.id},query:{"export-passwords":e.exportPasswords,passphrase:e.passphrase,token:e.token}})}getApiV1BackupByIdIsdbusedelsewhere(e){return s(t,this.http,{method:"GET",url:"/api/v1/backup/{id}/isdbusedelsewhere",path:{id:e.id}})}getApiV1BackupByIdIsactive(e){return s(t,this.http,{method:"GET",url:"/api/v1/backup/{id}/isactive",path:{id:e.id}})}postApiV1BackupByIdDeletedb(e){return s(t,this.http,{method:"POST",url:"/api/v1/backup/{id}/deletedb",path:{id:e.id}})}postApiV1BackupByIdMovedb(e){return s(t,this.http,{method:"POST",url:"/api/v1/backup/{id}/movedb",path:{id:e.id},body:e.requestBody,mediaType:"application/json"})}postApiV1BackupByIdUpdatedb(e){return s(t,this.http,{method:"POST",url:"/api/v1/backup/{id}/updatedb",path:{id:e.id},body:e.requestBody,mediaType:"application/json"})}postApiV1BackupByIdRestore(e){return s(t,this.http,{method:"POST",url:"/api/v1/backup/{id}/restore",path:{id:e.id},body:e.requestBody,mediaType:"application/json"})}postApiV1BackupByIdCreatereport(e){return s(t,this.http,{method:"POST",url:"/api/v1/backup/{id}/createreport",path:{id:e.id}})}postApiV1BackupByIdRepair(e){return s(t,this.http,{method:"POST",url:"/api/v1/backup/{id}/repair",path:{id:e.id},body:e.requestBody,mediaType:"application/json"})}postApiV1BackupByIdRepairupdate(e){return s(t,this.http,{method:"POST",url:"/api/v1/backup/{id}/repairupdate",path:{id:e.id},body:e.requestBody,mediaType:"application/json"})}postApiV1BackupByIdVacuum(e){return s(t,this.http,{method:"POST",url:"/api/v1/backup/{id}/vacuum",path:{id:e.id}})}postApiV1BackupByIdVerify(e){return s(t,this.http,{method:"POST",url:"/api/v1/backup/{id}/verify",path:{id:e.id}})}postApiV1BackupByIdCompact(e){return s(t,this.http,{method:"POST",url:"/api/v1/backup/{id}/compact",path:{id:e.id}})}postApiV1BackupByIdStart(e){return s(t,this.http,{method:"POST",url:"/api/v1/backup/{id}/start",path:{id:e.id},query:{skipQueue:e.skipQueue}})}postApiV1BackupByIdRun(e){return s(t,this.http,{method:"POST",url:"/api/v1/backup/{id}/run",path:{id:e.id},query:{skipQueue:e.skipQueue}})}postApiV1BackupByIdReportRemoteSize(e){return s(t,this.http,{method:"POST",url:"/api/v1/backup/{id}/report-remote-size",path:{id:e.id}})}postApiV1BackupByIdCopytotemp(e){return s(t,this.http,{method:"POST",url:"/api/v1/backup/{id}/copytotemp",path:{id:e.id}})}postApiV1BackupByIdRestoreTaskConfig(e){return s(t,this.http,{method:"POST",url:"/api/v1/backup/{id}/restore-task-config",path:{id:e.id}})}postApiV1BackupByIdImportfromtemp(e){return s(t,this.http,{method:"POST",url:"/api/v1/backup/{id}/importfromtemp",body:e.requestBody,mediaType:"application/json"})}postApiV1RemotecontrolEnable(){return s(t,this.http,{method:"POST",url:"/api/v1/remotecontrol/enable"})}postApiV1RemotecontrolDisable(){return s(t,this.http,{method:"POST",url:"/api/v1/remotecontrol/disable"})}deleteApiV1RemotecontrolRegistration(){return s(t,this.http,{method:"DELETE",url:"/api/v1/remotecontrol/registration"})}postApiV1RemotecontrolRegister(e){return s(t,this.http,{method:"POST",url:"/api/v1/remotecontrol/register",body:e.requestBody,mediaType:"application/json"})}deleteApiV1RemotecontrolRegister(){return s(t,this.http,{method:"DELETE",url:"/api/v1/remotecontrol/register"})}postApiV1RemotecontrolRegisterWait(){return s(t,this.http,{method:"POST",url:"/api/v1/remotecontrol/register/wait"})}postApiV2DestinationList(e){return s(t,this.http,{method:"POST",url:"/api/v2/destination/list",body:e.requestBody,mediaType:"application/json"})}postApiV2SystemTempDiskSpace(e){return s(t,this.http,{method:"POST",url:"/api/v2/system/temp-disk-space",body:e.requestBody,mediaType:"application/json"})}postApiV2FilesystemTestFilter(e){return s(t,this.http,{method:"POST",url:"/api/v2/filesystem/test-filter",body:e.requestBody,mediaType:"application/json"})}postApiV2BackupListFilesets(e){return s(t,this.http,{method:"POST",url:"/api/v2/backup/list-filesets",body:e.requestBody,mediaType:"application/json"})}postApiV2BackupListFolder(e){return s(t,this.http,{method:"POST",url:"/api/v2/backup/list-folder",body:e.requestBody,mediaType:"application/json"})}postApiV2BackupListVersions(e){return s(t,this.http,{method:"POST",url:"/api/v2/backup/list-versions",body:e.requestBody,mediaType:"application/json"})}postApiV2BackupSearch(e){return s(t,this.http,{method:"POST",url:"/api/v2/backup/search",body:e.requestBody,mediaType:"application/json"})}postApiV2DestinationTest(e){return s(t,this.http,{method:"POST",url:"/api/v2/destination/test",body:e.requestBody,mediaType:"application/json"})}static \u0275fac=function(p){return new(p||i)(A(y))};static \u0275prov=c({token:i,factory:i.\u0275fac,providedIn:"root"})},q=class i{constructor(e){this.http=e}getApiV1Webmodules(){return s(t,this.http,{method:"GET",url:"/api/v1/webmodules"})}static \u0275fac=function(p){return new(p||i)(A(y))};static \u0275prov=c({token:i,factory:i.\u0275fac,providedIn:"root"})};export{t as a,G as b,E as c,C as d,q as e};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-AOPTGCDG.js";import"./chunk-DCBSWJWZ.js";import"./chunk-OVNIENWW.js";import"./chunk-COEGVUM3.js";import"./chunk-2KD757N6.js";import"./chunk-PEOYNJJM.js";import"./chunk-MWQHWJOA.js";import"./chunk-CJKZ27FM.js";import"./chunk-4V3AE4ZE.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";export{a as OptionsListComponent};
@@ -0,0 +1 @@
1
+ import{c as a,d as b}from"./chunk-NNSH2MIZ.js";import"./chunk-AOPTGCDG.js";import"./chunk-AU25JBCN.js";import"./chunk-PNQ5BDQN.js";import"./chunk-DCBSWJWZ.js";import"./chunk-OVNIENWW.js";import"./chunk-6Q6SSTBK.js";import"./chunk-COEGVUM3.js";import"./chunk-3GE3OWQF.js";import"./chunk-S5IJ4C5T.js";import"./chunk-2KD757N6.js";import"./chunk-KKUFO6NZ.js";import"./chunk-PEOYNJJM.js";import"./chunk-MWQHWJOA.js";import"./chunk-6RZVYDJF.js";import"./chunk-CJKZ27FM.js";import"./chunk-4V3AE4ZE.js";import"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";export{a as createEncryptionForm,b as default};
@@ -0,0 +1 @@
1
+ import{e as a,f as b}from"./chunk-NNSH2MIZ.js";import"./chunk-AOPTGCDG.js";import"./chunk-AU25JBCN.js";import"./chunk-PNQ5BDQN.js";import"./chunk-DCBSWJWZ.js";import"./chunk-OVNIENWW.js";import"./chunk-6Q6SSTBK.js";import"./chunk-COEGVUM3.js";import"./chunk-3GE3OWQF.js";import"./chunk-S5IJ4C5T.js";import"./chunk-2KD757N6.js";import"./chunk-KKUFO6NZ.js";import"./chunk-PEOYNJJM.js";import"./chunk-MWQHWJOA.js";import"./chunk-6RZVYDJF.js";import"./chunk-CJKZ27FM.js";import"./chunk-4V3AE4ZE.js";import"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";export{a as createRestoreSelectFilesForm,b as default};
@@ -1 +1 @@
1
- import{a as $e,c as ye,d as v}from"./chunk-PNQ5BDQN.js";import{a as xe}from"./chunk-E4CYVUYG.js";import"./chunk-6Q6SSTBK.js";import"./chunk-YS4B2B5N.js";import{b as Ae}from"./chunk-2KD757N6.js";import"./chunk-OP7MDR2B.js";import{a as De}from"./chunk-PEOYNJJM.js";import"./chunk-NUV5LHQV.js";import"./chunk-PDZNQW6F.js";import{A as Oe,B as he,H as Ne,L as fe,W as Re,Y as we,b as ce,c as pe,d as g,e as Fe,f as de,j as ue,p as Te,q as Ce,r as Ee,t as Pe,v as Se,w as me,z as ge}from"./chunk-CJKZ27FM.js";import{a as B,d as Ie}from"./chunk-KNSQLQC6.js";import{b as ae,d as le,e as _e}from"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import{a as re,d as se}from"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as C,Bc as ie,Db as S,Eb as s,Fb as r,G as $,Gb as _,M as Q,Nb as M,Rc as A,Ta as a,Ub as c,Vb as p,Wb as m,Xb as L,Yb as X,Zb as b,_b as N,ac as u,ea as I,fa as x,hb as Y,lc as G,oc as D,pc as Z,qa as P,rc as ee,sa as y,tc as oe,uc as te,vc as ne,xb as F,yb as d}from"./chunk-K5XGRFWJ.js";import{a as W}from"./chunk-7CGTOI24.js";var Me=()=>["/"];function Le(t,o){t&1&&(s(0,"sh-toggle",25),c(1,5),_(2,"input",28),p(),r())}function Xe(t,o){t&1&&(s(0,"span",31),m(1,9),r())}function be(t,o){if(t&1&&(s(0,"span",31),m(1,10),r()),t&2){let e=u(2);a(),L(e.exportForm.controls.password.errors==null?null:e.exportForm.controls.password.errors.minlength.requiredLength),X(1)}}function Ge(t,o){if(t&1&&_(0,"sh-progress-bar",38),t&2){let e=u(2);G("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),S("value",e.calculatePasswordStrength()*(100/5))}}function Be(t,o){t&1&&(s(0,"span",31),m(1,11),r())}function ve(t,o){t&1&&(s(0,"span",31),m(1,12),r())}function ke(t,o){if(t&1&&(s(0,"span",31),m(1,13),r()),t&2){let e=u(2);a(),L(e.exportForm.controls.repeatPassword.errors==null?null:e.exportForm.controls.repeatPassword.errors.minlength.requiredLength),X(1)}}function Ue(t,o){t&1&&(c(0,7,1),_(1,"sh-icon"),p())}function Ke(t,o){t&1&&(c(0,7,2),_(1,"sh-icon"),p())}function Je(t,o){t&1&&(c(0,14,1),_(1,"sh-icon",40),p())}function He(t,o){t&1&&(c(0,14,2),_(1,"sh-icon"),p())}function ze(t,o){if(t&1){let e=M();s(0,"button",39),N("click",function(){I(e);let i=u(2);return x(i.copyPassword())}),c(1,14),F(2,Je,2,0)(3,He,2,0),p(),r()}if(t&2){let e=u(2);a(2),d(e.copiedPassword()?2:3)}}function Ve(t,o){t&1&&(s(0,"sh-alert",37),m(1,15),r())}function qe(t,o){if(t&1){let e=M();s(0,"div",26)(1,"sh-form-field")(2,"label",29),c(3,6),_(4,"sup"),p(),r(),_(5,"input",30),F(6,Xe,2,0,"span",31)(7,be,2,1,"span",31),r(),F(8,Ge,1,9,"sh-progress-bar",32),s(9,"sh-form-field"),_(10,"input",33),F(11,Be,2,0,"span",31)(12,ve,2,0,"span",31)(13,ke,2,1,"span",31),r(),s(14,"div",34)(15,"button",35),N("click",function(){I(e);let i=u();return x(i.showPassword.set(!i.showPassword()))}),c(16,7),F(17,Ue,2,0)(18,Ke,2,0),p(),r(),s(19,"button",35),N("click",function(){I(e);let i=u();return x(i.generatePassword())}),c(20,8),_(21,"sh-icon"),p(),r(),F(22,ze,4,1,"button",36),r(),F(23,Ve,2,0,"sh-alert",37),r()}if(t&2){let e=u();a(5),S("type",e.showPassword()?"text":"password"),a(),d(e.exportForm.controls.password.errors!=null&&e.exportForm.controls.password.errors.required?6:e.exportForm.controls.password.errors!=null&&e.exportForm.controls.password.errors.minlength?7:-1),a(2),d(e.exportForm.value.password?8:-1),a(2),S("type",e.showPassword()?"text":"password"),a(),d(e.exportForm.value.repeatPassword&&e.exportForm.value.repeatPassword!==e.exportForm.value.password?11:e.exportForm.controls.repeatPassword.errors!=null&&e.exportForm.controls.repeatPassword.errors.required?12:e.exportForm.controls.repeatPassword.errors!=null&&e.exportForm.controls.repeatPassword.errors.minlength?13:-1),a(6),d(e.showPassword()?17:18),a(5),d(e.showCopyPassword()?22:-1),a(),d(e.exportForm.value.password&&e.exportForm.value.password===e.exportForm.value.repeatPassword?23:-1)}}function je(t,o){if(t&1&&(s(0,"div",27)(1,"code"),D(2),r()()),t&2){let e=u();a(2),Z(e.exportedCmd())}}var f=new Ee,k=class t{#o=C($e);#n=C(ge);#t=C(Ie);#e=C(ae);#i=C(le);#r=C(se);#s=C(xe);isExporting=P(!1);exportType=P("file");exportedCmd=P(null);exportForm=f.group({exportPasswords:f.control(!0),encryption:f.control(!1,[g.required,ye()]),password:f.control("",[v("encryption",!0,[g.required,g.minLength(3)])]),repeatPassword:f.control("",[v("encryption",!0,[g.required,g.minLength(3)])])});exportFormSignal=Ae(this.exportForm.valueChanges);encryptionFieldSignal=A(()=>(this.exportFormSignal()?.encryption??!1)&&this.exportType()==="file");activeBackup=A(()=>this.#s.backups().find(o=>o.Backup?.ID===this.#e.snapshot.params.id));showPassword=P(!1);copiedPassword=P(!1);showCopyPassword=P(!1);calculatePasswordStrength=A(()=>{let e=this.exportFormSignal()?.password??"";return this.#o.calculatePasswordStrength(e)});showPasswordEffect=y(()=>{this.showPassword()&&this.exportForm.updateValueAndValidity()});disablePasswordForCommandLine=y(()=>{this.exportType()==="cmd"&&this.exportForm.controls.encryption.setValue(!1)});submit(){if(this.exportType()==="file"&&this.exportFormSignal()?.exportPasswords===!0&&!this.exportFormSignal()?.encryption){this.#n.open(De,{data:{title:$localize`Export without encryption?`,message:$localize`Are you sure you want to export your backup without encryption?`,confirmText:$localize`Yes, write plain-text passwords`,cancelText:$localize`Cancel`},closed:o=>{o&&this.submitApproved()}});return}this.submitApproved()}submitApproved(){this.isExporting.set(!0),this.exportType()==="file"?this.#t.postApiV1AuthIssuetokenByOperation({operation:"export"}).pipe(Q(o=>{let e=T=>{let O=Object.entries(T);return O?"?"+O.filter(([h,E])=>E!=null).map(([h,E])=>`${encodeURIComponent(h)}=${encodeURIComponent(E)}`).join("&"):""},n=this.exportFormSignal()?.password?.length?this.exportFormSignal()?.password:void 0,i=B.BASE||"";return this.#r.get(`${i}/api/v1/backup/${this.#e.snapshot.params.id}/export${e({"export-passwords":this.exportFormSignal()?.exportPasswords??void 0,passphrase:n,token:o.Token})}`,{responseType:"blob",headers:new re(W({},B.HEADERS??{}))})}),$(()=>this.isExporting.set(!1))).subscribe({next:o=>{let n=this.activeBackup()?.Backup?.Name??"Backup",i=this.exportFormSignal()?.encryption?"aes":"json";this.downloadFile(o,`${n}-duplicati-config.${i}`),this.#i.navigate(["/"])},error:o=>{}}):this.#t.getApiV1BackupByIdExportCmdline({id:this.#e.snapshot.params.id,exportPasswords:this.exportFormSignal()?.exportPasswords??void 0,passphrase:this.exportFormSignal()?.password??void 0}).pipe($(()=>this.isExporting.set(!1))).subscribe({next:o=>{this.exportedCmd.set(o.Command??null)},error:o=>{}})}downloadFile(o,e){let n=window.URL.createObjectURL(o),i=document.createElement("a");i.href=n,i.download=e,i.click(),window.URL.revokeObjectURL(n)}async copyPassword(){let o=this.exportForm.controls.password.value;await this.#a(o??""),this.copiedPassword.set(!0)}async#a(o){try{await navigator.clipboard.writeText(o)}catch{try{let n=document.createElement("textarea");n.value=o,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}catch(n){console.error("Failed to copy text: ",n)}}}generatePassword(){this.copiedPassword.set(!1);let o=this.#o.generate(16);this.exportForm.controls.password.setValue(o),this.exportForm.controls.repeatPassword.setValue(o),this.showCopyPassword.set(!0)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=Y({type:t,selectors:[["app-export"]],decls:26,vars:13,consts:()=>{let o;o=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:export${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: Export `;let n;n=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:terminal-window${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: As command line `;let i;i=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:file${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: To file `;let T;T=$localize` Export passwords ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let O;O=$localize` Encrypt file ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let h;h=$localize`Password`;let E;E=$localize`Repeat password`;let U;U=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let R;R=$localize`${"\uFFFD*17:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Hide ${"\uFFFD/*17:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*18:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Show ${"\uFFFD/*18:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,R=b(R);let K;K=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let J;J=$localize`Passwords are required`;let H;H=$localize` Passwords must be at least ${"\uFFFD0\uFFFD"}:INTERPOLATION: characters long `;let z;z=$localize`Passwords do not match`;let V;V=$localize`Passwords are required`;let q;q=$localize` Passwords must be at least ${"\uFFFD0\uFFFD"}:INTERPOLATION: characters long `;let w;w=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,w=b(w);let j;return j=$localize` Tip: Be sure to save your password. If you lose it, you will not be able to import the configuration. `,[o,e,n,i,T,O,U,R,K,J,H,z,V,q,w,j,[1,"actions"],["shButton","",1,"outlined",3,"routerLink"],["shButton","",1,"raised","primary",3,"click","shTooltip","disabled"],["autocomplete","off",3,"formGroup"],[1,"type-b",3,"valueChange","value"],["value","cmd"],["value","file"],[1,"raised","primary"],["type","checkbox","formControlName","exportPasswords"],[1,"primary","raised"],[1,"passwords"],[1,"cmd-output"],["type","checkbox","formControlName","encryption"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",h,"formControlName","password",3,"type"],["error",""],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",E,"formControlName","repeatPassword",3,"type"],[1,"password-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","button",1,"small","copy"],[1,"primary"],[1,"raised",3,"value"],["shButton","","type","button",1,"small","copy",3,"click"],[1,"sh-success"]]},template:function(e,n){if(e&1&&(s(0,"header")(1,"h3"),D(2," Export backup configuration "),s(3,"div",16)(4,"button",17),c(5,0),_(6,"sh-icon"),p(),r(),s(7,"button",18),N("click",function(){return n.submit()}),c(8,1),_(9,"sh-icon"),p(),r()()(),s(10,"p"),D(11),r()(),s(12,"form",19)(13,"sh-button-group",20),ne("valueChange",function(T){return te(n.exportType,T)||(n.exportType=T),T}),s(14,"button",21),c(15,2),_(16,"sh-icon"),p(),r(),s(17,"button",22),c(18,3),_(19,"sh-icon"),p(),r()(),s(20,"sh-toggle",23),c(21,4),_(22,"input",24),p(),r(),F(23,Le,3,0,"sh-toggle",25),F(24,qe,24,8,"div",26),F(25,je,3,1,"div",27),r()),e&2){let i;a(4),S("routerLink",ie(12,Me)),a(3),G("loading",n.isExporting()),S("shTooltip",n.encryptionFieldSignal()?"Remember to copy the password":"")("disabled",n.exportForm.invalid||n.showCopyPassword()&&!n.copiedPassword()||n.encryptionFieldSignal()&&n.exportForm.value.repeatPassword!==n.exportForm.value.password),a(4),ee("#",(i=n.activeBackup())==null||i.Backup==null?null:i.Backup.ID,": ",(i=n.activeBackup())==null||i.Backup==null?null:i.Backup.Name),a(),S("formGroup",n.exportForm),a(),oe("value",n.exportType),a(10),d(n.exportType()==="file"?23:-1),a(),d(n.encryptionFieldSignal()?24:-1),a(),d(n.exportedCmd()?25:-1)}},dependencies:[Pe,ue,pe,ce,Fe,de,Ce,Te,_e,Oe,Re,Se,Ne,he,me,fe,we],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:3rem}h3[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;justify-content:space-between}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;max-width:31.25rem}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.copy[_ngcontent-%COMP%] sh-icon.sh-success[_ngcontent-%COMP%]{color:var(--success-8)}.hide[_ngcontent-%COMP%]{display:none}"],changeDetection:0})};export{k as default};
1
+ import{a as $e,c as ye,d as v}from"./chunk-PNQ5BDQN.js";import{a as xe}from"./chunk-ZFV3MK5Y.js";import"./chunk-6Q6SSTBK.js";import"./chunk-UHSRAJTA.js";import{b as Ae}from"./chunk-2KD757N6.js";import"./chunk-KKUFO6NZ.js";import{a as De}from"./chunk-PEOYNJJM.js";import"./chunk-MWQHWJOA.js";import"./chunk-6RZVYDJF.js";import{A as Oe,B as he,H as Ne,L as fe,W as Re,Y as we,b as ce,c as pe,d as g,e as Fe,f as de,j as ue,p as Te,q as Ce,r as Ee,t as Pe,v as Se,w as me,z as ge}from"./chunk-CJKZ27FM.js";import{a as B,d as Ie}from"./chunk-4V3AE4ZE.js";import{b as ae,d as le,e as _e}from"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import{a as re,d as se}from"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as C,Bc as ie,Db as S,Eb as s,Fb as r,G as $,Gb as _,M as Q,Nb as M,Rc as A,Ta as a,Ub as c,Vb as p,Wb as m,Xb as L,Yb as X,Zb as b,_b as N,ac as u,ea as I,fa as x,hb as Y,lc as G,oc as D,pc as Z,qa as P,rc as ee,sa as y,tc as oe,uc as te,vc as ne,xb as F,yb as d}from"./chunk-K5XGRFWJ.js";import{a as W}from"./chunk-7CGTOI24.js";var Me=()=>["/"];function Le(t,o){t&1&&(s(0,"sh-toggle",25),c(1,5),_(2,"input",28),p(),r())}function Xe(t,o){t&1&&(s(0,"span",31),m(1,9),r())}function be(t,o){if(t&1&&(s(0,"span",31),m(1,10),r()),t&2){let e=u(2);a(),L(e.exportForm.controls.password.errors==null?null:e.exportForm.controls.password.errors.minlength.requiredLength),X(1)}}function Ge(t,o){if(t&1&&_(0,"sh-progress-bar",38),t&2){let e=u(2);G("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),S("value",e.calculatePasswordStrength()*(100/5))}}function Be(t,o){t&1&&(s(0,"span",31),m(1,11),r())}function ve(t,o){t&1&&(s(0,"span",31),m(1,12),r())}function ke(t,o){if(t&1&&(s(0,"span",31),m(1,13),r()),t&2){let e=u(2);a(),L(e.exportForm.controls.repeatPassword.errors==null?null:e.exportForm.controls.repeatPassword.errors.minlength.requiredLength),X(1)}}function Ue(t,o){t&1&&(c(0,7,1),_(1,"sh-icon"),p())}function Ke(t,o){t&1&&(c(0,7,2),_(1,"sh-icon"),p())}function Je(t,o){t&1&&(c(0,14,1),_(1,"sh-icon",40),p())}function He(t,o){t&1&&(c(0,14,2),_(1,"sh-icon"),p())}function ze(t,o){if(t&1){let e=M();s(0,"button",39),N("click",function(){I(e);let i=u(2);return x(i.copyPassword())}),c(1,14),F(2,Je,2,0)(3,He,2,0),p(),r()}if(t&2){let e=u(2);a(2),d(e.copiedPassword()?2:3)}}function Ve(t,o){t&1&&(s(0,"sh-alert",37),m(1,15),r())}function qe(t,o){if(t&1){let e=M();s(0,"div",26)(1,"sh-form-field")(2,"label",29),c(3,6),_(4,"sup"),p(),r(),_(5,"input",30),F(6,Xe,2,0,"span",31)(7,be,2,1,"span",31),r(),F(8,Ge,1,9,"sh-progress-bar",32),s(9,"sh-form-field"),_(10,"input",33),F(11,Be,2,0,"span",31)(12,ve,2,0,"span",31)(13,ke,2,1,"span",31),r(),s(14,"div",34)(15,"button",35),N("click",function(){I(e);let i=u();return x(i.showPassword.set(!i.showPassword()))}),c(16,7),F(17,Ue,2,0)(18,Ke,2,0),p(),r(),s(19,"button",35),N("click",function(){I(e);let i=u();return x(i.generatePassword())}),c(20,8),_(21,"sh-icon"),p(),r(),F(22,ze,4,1,"button",36),r(),F(23,Ve,2,0,"sh-alert",37),r()}if(t&2){let e=u();a(5),S("type",e.showPassword()?"text":"password"),a(),d(e.exportForm.controls.password.errors!=null&&e.exportForm.controls.password.errors.required?6:e.exportForm.controls.password.errors!=null&&e.exportForm.controls.password.errors.minlength?7:-1),a(2),d(e.exportForm.value.password?8:-1),a(2),S("type",e.showPassword()?"text":"password"),a(),d(e.exportForm.value.repeatPassword&&e.exportForm.value.repeatPassword!==e.exportForm.value.password?11:e.exportForm.controls.repeatPassword.errors!=null&&e.exportForm.controls.repeatPassword.errors.required?12:e.exportForm.controls.repeatPassword.errors!=null&&e.exportForm.controls.repeatPassword.errors.minlength?13:-1),a(6),d(e.showPassword()?17:18),a(5),d(e.showCopyPassword()?22:-1),a(),d(e.exportForm.value.password&&e.exportForm.value.password===e.exportForm.value.repeatPassword?23:-1)}}function je(t,o){if(t&1&&(s(0,"div",27)(1,"code"),D(2),r()()),t&2){let e=u();a(2),Z(e.exportedCmd())}}var f=new Ee,k=class t{#o=C($e);#n=C(ge);#t=C(Ie);#e=C(ae);#i=C(le);#r=C(se);#s=C(xe);isExporting=P(!1);exportType=P("file");exportedCmd=P(null);exportForm=f.group({exportPasswords:f.control(!0),encryption:f.control(!1,[g.required,ye()]),password:f.control("",[v("encryption",!0,[g.required,g.minLength(3)])]),repeatPassword:f.control("",[v("encryption",!0,[g.required,g.minLength(3)])])});exportFormSignal=Ae(this.exportForm.valueChanges);encryptionFieldSignal=A(()=>(this.exportFormSignal()?.encryption??!1)&&this.exportType()==="file");activeBackup=A(()=>this.#s.backups().find(o=>o.Backup?.ID===this.#e.snapshot.params.id));showPassword=P(!1);copiedPassword=P(!1);showCopyPassword=P(!1);calculatePasswordStrength=A(()=>{let e=this.exportFormSignal()?.password??"";return this.#o.calculatePasswordStrength(e)});showPasswordEffect=y(()=>{this.showPassword()&&this.exportForm.updateValueAndValidity()});disablePasswordForCommandLine=y(()=>{this.exportType()==="cmd"&&this.exportForm.controls.encryption.setValue(!1)});submit(){if(this.exportType()==="file"&&this.exportFormSignal()?.exportPasswords===!0&&!this.exportFormSignal()?.encryption){this.#n.open(De,{data:{title:$localize`Export without encryption?`,message:$localize`Are you sure you want to export your backup without encryption?`,confirmText:$localize`Yes, write plain-text passwords`,cancelText:$localize`Cancel`},closed:o=>{o&&this.submitApproved()}});return}this.submitApproved()}submitApproved(){this.isExporting.set(!0),this.exportType()==="file"?this.#t.postApiV1AuthIssuetokenByOperation({operation:"export"}).pipe(Q(o=>{let e=T=>{let O=Object.entries(T);return O?"?"+O.filter(([h,E])=>E!=null).map(([h,E])=>`${encodeURIComponent(h)}=${encodeURIComponent(E)}`).join("&"):""},n=this.exportFormSignal()?.password?.length?this.exportFormSignal()?.password:void 0,i=B.BASE||"";return this.#r.get(`${i}/api/v1/backup/${this.#e.snapshot.params.id}/export${e({"export-passwords":this.exportFormSignal()?.exportPasswords??void 0,passphrase:n,token:o.Token})}`,{responseType:"blob",headers:new re(W({},B.HEADERS??{}))})}),$(()=>this.isExporting.set(!1))).subscribe({next:o=>{let n=this.activeBackup()?.Backup?.Name??"Backup",i=this.exportFormSignal()?.encryption?"aes":"json";this.downloadFile(o,`${n}-duplicati-config.${i}`),this.#i.navigate(["/"])},error:o=>{}}):this.#t.getApiV1BackupByIdExportCmdline({id:this.#e.snapshot.params.id,exportPasswords:this.exportFormSignal()?.exportPasswords??void 0,passphrase:this.exportFormSignal()?.password??void 0}).pipe($(()=>this.isExporting.set(!1))).subscribe({next:o=>{this.exportedCmd.set(o.Command??null)},error:o=>{}})}downloadFile(o,e){let n=window.URL.createObjectURL(o),i=document.createElement("a");i.href=n,i.download=e,i.click(),window.URL.revokeObjectURL(n)}async copyPassword(){let o=this.exportForm.controls.password.value;await this.#a(o??""),this.copiedPassword.set(!0)}async#a(o){try{await navigator.clipboard.writeText(o)}catch{try{let n=document.createElement("textarea");n.value=o,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}catch(n){console.error("Failed to copy text: ",n)}}}generatePassword(){this.copiedPassword.set(!1);let o=this.#o.generate(16);this.exportForm.controls.password.setValue(o),this.exportForm.controls.repeatPassword.setValue(o),this.showCopyPassword.set(!0)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=Y({type:t,selectors:[["app-export"]],decls:26,vars:13,consts:()=>{let o;o=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:export${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: Export `;let n;n=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:terminal-window${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: As command line `;let i;i=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:file${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: To file `;let T;T=$localize` Export passwords ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let O;O=$localize` Encrypt file ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let h;h=$localize`Password`;let E;E=$localize`Repeat password`;let U;U=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let R;R=$localize`${"\uFFFD*17:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Hide ${"\uFFFD/*17:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*18:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Show ${"\uFFFD/*18:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,R=b(R);let K;K=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let J;J=$localize`Passwords are required`;let H;H=$localize` Passwords must be at least ${"\uFFFD0\uFFFD"}:INTERPOLATION: characters long `;let z;z=$localize`Passwords do not match`;let V;V=$localize`Passwords are required`;let q;q=$localize` Passwords must be at least ${"\uFFFD0\uFFFD"}:INTERPOLATION: characters long `;let w;w=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,w=b(w);let j;return j=$localize` Tip: Be sure to save your password. If you lose it, you will not be able to import the configuration. `,[o,e,n,i,T,O,U,R,K,J,H,z,V,q,w,j,[1,"actions"],["shButton","",1,"outlined",3,"routerLink"],["shButton","",1,"raised","primary",3,"click","shTooltip","disabled"],["autocomplete","off",3,"formGroup"],[1,"type-b",3,"valueChange","value"],["value","cmd"],["value","file"],[1,"raised","primary"],["type","checkbox","formControlName","exportPasswords"],[1,"primary","raised"],[1,"passwords"],[1,"cmd-output"],["type","checkbox","formControlName","encryption"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",h,"formControlName","password",3,"type"],["error",""],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",E,"formControlName","repeatPassword",3,"type"],[1,"password-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","button",1,"small","copy"],[1,"primary"],[1,"raised",3,"value"],["shButton","","type","button",1,"small","copy",3,"click"],[1,"sh-success"]]},template:function(e,n){if(e&1&&(s(0,"header")(1,"h3"),D(2," Export backup configuration "),s(3,"div",16)(4,"button",17),c(5,0),_(6,"sh-icon"),p(),r(),s(7,"button",18),N("click",function(){return n.submit()}),c(8,1),_(9,"sh-icon"),p(),r()()(),s(10,"p"),D(11),r()(),s(12,"form",19)(13,"sh-button-group",20),ne("valueChange",function(T){return te(n.exportType,T)||(n.exportType=T),T}),s(14,"button",21),c(15,2),_(16,"sh-icon"),p(),r(),s(17,"button",22),c(18,3),_(19,"sh-icon"),p(),r()(),s(20,"sh-toggle",23),c(21,4),_(22,"input",24),p(),r(),F(23,Le,3,0,"sh-toggle",25),F(24,qe,24,8,"div",26),F(25,je,3,1,"div",27),r()),e&2){let i;a(4),S("routerLink",ie(12,Me)),a(3),G("loading",n.isExporting()),S("shTooltip",n.encryptionFieldSignal()?"Remember to copy the password":"")("disabled",n.exportForm.invalid||n.showCopyPassword()&&!n.copiedPassword()||n.encryptionFieldSignal()&&n.exportForm.value.repeatPassword!==n.exportForm.value.password),a(4),ee("#",(i=n.activeBackup())==null||i.Backup==null?null:i.Backup.ID,": ",(i=n.activeBackup())==null||i.Backup==null?null:i.Backup.Name),a(),S("formGroup",n.exportForm),a(),oe("value",n.exportType),a(10),d(n.exportType()==="file"?23:-1),a(),d(n.encryptionFieldSignal()?24:-1),a(),d(n.exportedCmd()?25:-1)}},dependencies:[Pe,ue,pe,ce,Fe,de,Ce,Te,_e,Oe,Re,Se,Ne,he,me,fe,we],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:3rem}h3[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;justify-content:space-between}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;max-width:31.25rem}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.copy[_ngcontent-%COMP%] sh-icon.sh-success[_ngcontent-%COMP%]{color:var(--success-8)}.hide[_ngcontent-%COMP%]{display:none}"],changeDetection:0})};export{k as default};
@@ -0,0 +1 @@
1
+ import"./chunk-7CGTOI24.js";var o=[{path:"",loadComponent:()=>import("./chunk-GULHHZTR.js"),children:[{path:"",redirectTo:"stored",pathMatch:"full"},{path:"stored",loadComponent:()=>import("./chunk-FUF6MJKB.js")},{path:"live",loadComponent:()=>import("./chunk-VCDNIRPY.js")}]}],t=o;export{t as default};
@@ -1 +1 @@
1
- import{a as fe}from"./chunk-TWWAK5M6.js";import{a as Oe}from"./chunk-6DX35WDO.js";import{a as De}from"./chunk-35FMFK4I.js";import{b as Ce}from"./chunk-UIVZWXBK.js";import{b as Ee}from"./chunk-KZYRTI62.js";import{a as Fe}from"./chunk-TSVSMVY4.js";import{b as me}from"./chunk-OP7MDR2B.js";import{a as pe}from"./chunk-NUV5LHQV.js";import{c as se}from"./chunk-PDZNQW6F.js";import{B as A,H as ue,K as Se,P as de,Y as ge,c as ae,e as le,i as re,k as _e,s as ce,v as P,z as Te}from"./chunk-CJKZ27FM.js";import{d as x}from"./chunk-KNSQLQC6.js";import{e as oe}from"./chunk-CQJRBQ6I.js";import{$ as d,Bc as H,Db as R,Eb as a,Fb as l,G as Q,Gb as T,Kb as te,Lb as ne,Nb as D,Rc as Y,Ta as _,Ub as m,Vb as C,Wb as I,Wc as ie,Zb as b,_b as c,ac as S,ea as E,fa as O,hb as N,lc as G,oc as F,pc as w,qa as f,qc as V,sa as ee,tc as y,uc as v,vc as B,xb as g,yb as p}from"./chunk-K5XGRFWJ.js";function Pe(o,t){o&1&&(a(0,"sh-icon",2),F(1,"x-bold"),l())}function Ae(o,t){o&1&&(a(0,"sh-icon",3),F(1,"list-bold"),l())}function he(o,t){if(o&1){let n=D();a(0,"button",1),c("click",function(){E(n);let i=S();return O(i.toggleNav())}),g(1,Pe,2,0,"sh-icon",2)(2,Ae,2,0,"sh-icon",3),l()}if(o&2){let n=S();_(),p(n.isNavOpen()?1:2)}}var $=class o{#e=d(Oe);isNavOpen=this.#e.isNavOpen;isMobile=this.#e.isMobile;toggleNav(){this.#e.toggleNav()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=N({type:o,selectors:[["app-mobile-menu-toggle"]],decls:1,vars:1,consts:[["shButton","",1,"small","toggle-sidebar","ghost"],["shButton","",1,"small","toggle-sidebar","ghost",3,"click"],[1,"cross"],[1,"burger"]],template:function(n,e){n&1&&g(0,he,3,1,"button",0),n&2&&p(e.isMobile()?0:-1)},dependencies:[A,P],styles:["[_nghost-%COMP%]{display:contents}.toggle-sidebar[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;justify-content:center}.toggle-sidebar[_ngcontent-%COMP%] .cross[_ngcontent-%COMP%], .toggle-sidebar[_ngcontent-%COMP%] .burger[_ngcontent-%COMP%]{opacity:1;transition:opacity 124ms linear;margin:0}.toggle-sidebar[_ngcontent-%COMP%] .cross.hidden[_ngcontent-%COMP%], .toggle-sidebar[_ngcontent-%COMP%] .burger.hidden[_ngcontent-%COMP%]{opacity:0}"],changeDetection:0})};var Ne=()=>["/connect/logon"];function be(o,t){o&1&&(m(0,0,1),T(1,"div",9),C())}function ye(o,t){o&1&&(m(0,0,2),T(1,"div",10),C())}function ve(o,t){if(o&1){let n=D();a(0,"div",8),c("click",function(){E(n);let i=S();return O(i.resetAndRetry())}),m(1,0),g(2,be,2,0)(3,ye,2,0),C(),l()}if(o&2){let n=S();_(2),p(n.resetting()?2:3)}}function Be(o,t){o&1&&(a(0,"div",6),m(1,1),T(2,"div",11),C(),l()),o&2&&R("routerLink",H(1,Ne))}function ke(o,t){o&1&&(a(0,"div",6),m(1,2),T(2,"div",10),C(),l()),o&2&&R("routerLink",H(1,Ne))}function Le(o,t){if(o&1){let n=D();a(0,"div",7),m(1,3),a(2,"sh-icon",12),c("click",function(){E(n);let i=S();return O(i.cancel())}),l(),a(3,"div",13),c("click",function(){E(n);let i=S();return O(i.claim())}),l(),T(4,"div",14),C(),l()}}function Ge(o,t){if(o&1){let n=D();a(0,"div",8),c("click",function(){E(n);let i=S();return O(i.openConsole())}),m(1,4),T(2,"div",15),C(),l()}}var k=class o{#e=d(Ee);state=this.#e.state;resetting=f(!1);stateEffect=ee(()=>{let t=this.#e.state(),n=this.resetting();t==="registered"&&n&&(this.resetting.set(!1),this.#e.beginRemoteRegistration())});ngOnInit(){this.#e.refreshRemoteControlStatus()}claim(){let t=this.#e.claimUrl();t&&window.open(t,"_blank")}cancel(){this.#e.cancelRemoteRegistration()}resetAndRetry(){this.resetting.set(!0),this.#e.cancelRemoteRegistration()}openConsole(){this.#e.openConsole()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=N({type:o,selectors:[["app-remote-connectivity-status"]],decls:5,vars:1,consts:()=>{let t;t=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF: Resetting ${"\uFFFD#1:1\uFFFD"}:START_TAG_DIV:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_DIV:${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE: Click to connect ${"\uFFFD#1:2\uFFFD"}:START_TAG_DIV_1:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_DIV:${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,t=b(t);let n;n=$localize` Connecting ${"\uFFFD#2\uFFFD"}:START_TAG_DIV:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_DIV:`;let e;e=$localize` Click to register ${"\uFFFD#2\uFFFD"}:START_TAG_DIV:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_DIV:`;let i;i=$localize`Cancel registration`;let s;s=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD#3\uFFFD"}:START_TAG_DIV:Click to claim${"[\uFFFD/#3\uFFFD|\uFFFD/#4\uFFFD]"}:CLOSE_TAG_DIV:${"\uFFFD#4\uFFFD"}:START_TAG_DIV_1:${"[\uFFFD/#3\uFFFD|\uFFFD/#4\uFFFD]"}:CLOSE_TAG_DIV:`,s=b(s);let u;return u=$localize` Connected ${"\uFFFD#2\uFFFD"}:START_TAG_DIV:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_DIV:`,[t,n,e,s,u,[1,"connectivity-status"],[1,"connectivity-status",3,"routerLink"],[1,"connectivity-status","claim"],[1,"connectivity-status",3,"click"],[1,"status","blinking"],[1,"status"],[1,"status","warning","blinking"],["shTooltip",i,3,"click"],[1,"claim",3,"click"],[1,"status","success","blinking"],[1,"status","success"]]},template:function(n,e){if(n&1&&g(0,ve,4,1,"div",5)(1,Be,3,2,"div",6)(2,ke,3,2,"div",6)(3,Le,5,0,"div",7)(4,Ge,3,0,"div",5),n&2){let i=e.state()==="unknown"||e.state()==="inactive"||e.state()==="registeringfaulted",s=e.state()==="registeringfaulted",u=e.state()==="registering",r=e.state()==="registered",M=e.state()==="connected"||e.state()==="disabled"||e.state()==="connecting";p(s?0:u?1:i?2:r?3:M?4:-1)}},dependencies:[oe,P,ge],styles:["[_nghost-%COMP%]{display:flex;align-items:center;padding:0 .75rem}@media only screen and (max-width:768px){[_nghost-%COMP%]{padding:0}}.hide-text[_nghost-%COMP%]{font-size:0}.in-menu[_nghost-%COMP%]{padding:.75rem;border-bottom:1px solid var(--base-4)}.connectivity-status[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer}.connectivity-status[_ngcontent-%COMP%]:hover{color:var(--primary-8)}.connectivity-status.claim[_ngcontent-%COMP%]{display:flex;gap:.5rem;cursor:pointer}.connectivity-status.claim[_ngcontent-%COMP%]:hover{color:inherit}.connectivity-status.claim[_ngcontent-%COMP%] .claim[_ngcontent-%COMP%]:hover{color:var(--primary-8)}.connectivity-status.claim[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]:hover{color:var(--error-8)}.status[_ngcontent-%COMP%]{width:.625rem;height:.625rem;border-radius:50%;background-color:var(--base-4)}.status.success[_ngcontent-%COMP%]{background-color:var(--success-8)}.status.warning[_ngcontent-%COMP%]{background-color:var(--warn-8)}.status.blinking[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_blinking 1s infinite}@keyframes _ngcontent-%COMP%_blinking{0%{opacity:.2}50%{opacity:1}to{opacity:.2}}"],changeDetection:0})};var Me={Byte:"B",KByte:"KB",MByte:"MB",GByte:"GB",TByte:"TB",PByte:"PB"},xe=["mbps","gbps"],Ie=8,W=1024,U=W*1024,j=U*1024,Z=j*1024,Re=Z*1024,$e={B:1,KB:W,MB:U,GB:j,TB:Z,PB:Re},Ue=1e3,K=Ue*1e3,X=K*1e3,we=[{threshold:Re,unitPrefix:"PByte"},{threshold:Z,unitPrefix:"TByte"},{threshold:j,unitPrefix:"GByte"},{threshold:U,unitPrefix:"MByte"},{threshold:W,unitPrefix:"KByte"},{threshold:1,unitPrefix:"Byte"}],L=class o{#e=d(x);closed=ie();isSubmitting=f(!1);sizeOptions=f([...xe]);maxUpload=f(0);maxDownload=f(0);maxUploadUnit=f("mbps");maxDownloadUnit=f("mbps");ngOnInit(){this.init()}convertToBitsPerSecondUnits(t,n){let i=t*($e[n.toUpperCase()]||U)*Ie;return i===0?{value:0,unit:"mbps"}:i>=X?{value:parseFloat((i/X).toFixed(2)),unit:"gbps"}:{value:parseFloat((i/K).toFixed(2)),unit:"mbps"}}convertFromBitsPerSecondUnits(t,n){let e=0;switch(n){case"gbps":e=t*X;break;case"mbps":e=t*K;break}let i=e/Ie;if(i===0)return{valueForApi:0,unitPrefixForApi:"Byte"};for(let{threshold:s,unitPrefix:u}of we)if(i>=s)return{valueForApi:Math.round(i/s),unitPrefixForApi:u};return{valueForApi:Math.round(i),unitPrefixForApi:"Byte"}}init(){this.#e.getApiV1Serversettings().subscribe({next:t=>{let n=t?.["max-upload-speed"],e=t?.["max-download-speed"];if(n&&n!==""){let i=n.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(i){let s=parseFloat(i[1]),u=i[2],r=this.convertToBitsPerSecondUnits(s,u);this.maxUpload.set(r.value),this.maxUploadUnit.set(r.unit)}else console.warn("Unexpected max-upload-speed format from API:",n),this.resetUpload()}else this.resetUpload();if(e&&e!==""){let i=e.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(i){let s=parseFloat(i[1]),u=i[2],r=this.convertToBitsPerSecondUnits(s,u);this.maxDownload.set(r.value),this.maxDownloadUnit.set(r.unit)}else console.warn("Unexpected max-download-speed format from API:",e),this.resetDownload()}else this.resetDownload()},error:t=>{console.error("Failed to get server settings:",t),this.resetDownload(),this.resetUpload()}})}resetDownload(){this.maxDownload.set(0),this.maxDownloadUnit.set("mbps")}resetUpload(){this.maxUpload.set(0),this.maxUploadUnit.set("mbps")}blockDecimalKeys(t){if([".",","].includes(t.key))return t.preventDefault()}cleanupInputAfterPasting(t){t.preventDefault();let n=t.clipboardData?.getData("text/plain");if(!n)return;let e=n.replaceAll(/[\.,]/g,"");t.target.value=e}submit(){this.isSubmitting.set(!0);let t="",n="",e=this.maxUpload()??0,i=this.maxUploadUnit(),s=this.maxDownload()??0,u=this.maxDownloadUnit();if(e>0){let{valueForApi:r,unitPrefixForApi:M}=this.convertFromBitsPerSecondUnits(e,i),h=Me[M];h?t=`${r}${h}`:console.error(`Invalid unit prefix for API submission (upload): ${M}. Defaulting to empty string.`)}if(s){let{valueForApi:r,unitPrefixForApi:M}=this.convertFromBitsPerSecondUnits(s,u),h=Me[M];h?n=`${r}${h}`:console.error(`Invalid unit prefix for API submission (download): ${M}. Defaulting to empty string.`)}this.#e.patchApiV1Serversettings({requestBody:{"max-upload-speed":t,"max-download-speed":n}}).pipe(Q(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.closed.emit(!0)},error:r=>{console.error("Failed to submit throttle settings:",r)}})}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=N({type:o,selectors:[["app-throttle-settings-dialog"]],outputs:{closed:"closed"},decls:26,vars:10,consts:()=>{let t;t=$localize`Throttle network speed`;let n;n=$localize`We will round bits to the nearest byte value.`;let e;e=$localize`Max upload speed`;let i;i=$localize`Max download speed`;let s;s=$localize`Cancel`;let u;return u=$localize` Update settings `,[t,n,e,i,s,u,["content",""],[1,"column"],[1,"field-row"],["type","number",3,"paste","keydown","ngModelChange","ngModel"],[3,"isClearable","options"],["type","text",3,"ngModelChange","ngModel"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(n,e){n&1&&(a(0,"header")(1,"h3"),I(2,0),l(),a(3,"p"),I(4,1),l()(),a(5,"div",6)(6,"div",7)(7,"div",8)(8,"label"),I(9,2),l(),a(10,"sh-form-field")(11,"input",9),c("paste",function(s){return e.cleanupInputAfterPasting(s)})("keydown",function(s){return e.blockDecimalKeys(s)}),B("ngModelChange",function(s){return v(e.maxUpload,s)||(e.maxUpload=s),s}),l()(),a(12,"sh-select",10)(13,"input",11),B("ngModelChange",function(s){return v(e.maxUploadUnit,s)||(e.maxUploadUnit=s),s}),l()()(),a(14,"div",8)(15,"label"),I(16,3),l(),a(17,"sh-form-field")(18,"input",9),c("paste",function(s){return e.cleanupInputAfterPasting(s)})("keydown",function(s){return e.blockDecimalKeys(s)}),B("ngModelChange",function(s){return v(e.maxDownload,s)||(e.maxDownload=s),s}),l()(),a(19,"sh-select",10)(20,"input",11),B("ngModelChange",function(s){return v(e.maxDownloadUnit,s)||(e.maxDownloadUnit=s),s}),l()()()()(),a(21,"footer",12)(22,"button",13),c("click",function(){return e.closed.emit(!1)}),I(23,4),l(),a(24,"button",14),c("click",function(){return e.submit()}),I(25,5),l()()),n&2&&(_(11),y("ngModel",e.maxUpload),_(),R("isClearable",!1)("options",e.sizeOptions()),_(),y("ngModel",e.maxUploadUnit),_(5),y("ngModel",e.maxDownload),_(),R("isClearable",!1)("options",e.sizeOptions()),_(),y("ngModel",e.maxDownloadUnit),_(4),G("loading",e.isSubmitting()))},dependencies:[ce,ae,_e,le,re,ue,de,A],styles:['[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:1rem;gap:.5rem;margin-bottom:1rem}.column[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.field-row[_ngcontent-%COMP%]{display:grid;grid-template-areas:"label label" "input select";grid-template-columns:1fr auto;align-items:center;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}.field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:select}'],changeDetection:0})};function Ve(o,t){o&1&&T(0,"app-remote-connectivity-status")}function He(o,t){if(o&1){let n=D();a(0,"button",7),c("click",function(){E(n);let i=S(2);return O(i.abort())}),m(1,1),T(2,"sh-icon"),C(),l()}}function Ye(o,t){if(o&1){let n=D();a(0,"button",7),c("click",function(){E(n);let i=S(2);return O(i.stop())}),m(1,2),T(2,"sh-icon"),C(),l()}}function ze(o,t){if(o&1&&g(0,He,3,0,"button",14)(1,Ye,3,0,"button",14),o&2){let n=S();p(n.isStopping()?0:1)}}function Je(o,t){o&1&&(m(0,0,1),T(1,"sh-icon"),C())}function Xe(o,t){o&1&&(m(0,0,2),T(1,"sh-icon"),C())}function Ke(o,t){o&1&&T(0,"app-remote-connectivity-status",10)}function We(o,t){o&1&&T(0,"app-remote-connectivity-status",12)}function je(o,t){if(o&1){let n=D();a(0,"button",13),c("click",function(){E(n);let i=S();return O(i.isStopping()?i.abort():i.stop())}),a(1,"sh-icon"),F(2),l(),F(3),l()}if(o&2){let n=S();_(2),w(n.isStopping()?"skull":"stop"),_(),V(" ",n.isStopping()?"Abort":"Stop"," ")}}var q=class o{#e=d(x);#t=d(Ce);#n=d(Te);#s=d(me);#i=d(se);#a=d(pe);#l=d(Fe);clientIsRunning=this.#t.clientIsRunning;isResuming=this.#t.isResuming;runningTask=Y(()=>this.#s.serverState()?.ActiveTask?.Item1);isStopping=Y(()=>this.runningTask()==this.#o());#o=f(-1);isUsingRelay=this.#i.relayIsEnabled;hideConsoleConnectionStatus=this.#l.isConsoleConnectionStatusHidden;openThrottleSettingsDialog(){this.#n.open(L,{maxWidth:"550px",width:"100%"})}openPauseDialog(){this.#n.open(fe,{maxWidth:"550px",width:"100%"})}pauseResume(){if(this.clientIsRunning()){this.openPauseDialog();return}this.#t.pauseResume().subscribe()}stop(){let t=this.runningTask();t&&(this.#o.set(t),this.#e.postApiV1TaskByTaskidStop({taskid:t}).subscribe())}abort(){let t=this.runningTask();t&&this.#e.postApiV1TaskByTaskidAbort({taskid:t}).subscribe()}ngAfterViewInit(){let t=this.#i.relayIsEnabled()||!this.#a.hasWebSocket()?"longpoll":"websocket";this.#t.setConnectionMethod(t)}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=N({type:o,selectors:[["app-status-bar"]],decls:31,vars:10,consts:()=>{let t;t=$localize`${"\uFFFD*9:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:pause${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Pause ${"\uFFFD/*9:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*10:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:play${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Resume ${"\uFFFD/*10:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,t=b(t);let n;n=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:skull${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Abort `;let e;return e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:stop${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Stop `,[t,n,e,[1,"current-backup"],[1,"global-progress"],[1,"current-backup-actions"],[1,"desktop-actions"],["shButton","",3,"click"],[1,"mobile-actions"],["shButton","",1,"small","menu-mobile-toggle"],[1,"hide-text"],["menu",""],[1,"in-menu"],[3,"click"],["shButton",""]]},template:function(n,e){n&1&&(a(0,"div",3),T(1,"app-mobile-menu-toggle")(2,"app-backup-progress",4),a(3,"div",5)(4,"div",6),g(5,Ve,1,0,"app-remote-connectivity-status"),g(6,ze,2,1),a(7,"button",7),c("click",function(){return e.pauseResume()}),m(8,0),g(9,Je,2,0)(10,Xe,2,0),C(),l(),a(11,"button",7),c("click",function(){return e.openThrottleSettingsDialog()}),a(12,"sh-icon"),F(13,"speedometer"),l()()(),a(14,"div",8)(15,"sh-menu")(16,"button",9),g(17,Ke,1,0,"app-remote-connectivity-status",10),a(18,"sh-icon"),F(19,"dots-three-vertical-bold"),l()(),te(20,11),g(21,We,1,0,"app-remote-connectivity-status",12),g(22,je,4,2,"button"),a(23,"button",13),c("click",function(){return e.pauseResume()}),a(24,"sh-icon"),F(25),l(),F(26),l(),a(27,"button",13),c("click",function(){return e.openThrottleSettingsDialog()}),a(28,"sh-icon"),F(29,"speedometer"),l(),F(30," Throttle Settings "),l(),ne(),l()()()()),n&2&&(_(5),p(!e.isUsingRelay()&&!e.hideConsoleConnectionStatus()?5:-1),_(),p(e.runningTask()?6:-1),_(),G("loading",e.isResuming()),_(2),p(e.clientIsRunning()?9:10),_(8),p(!e.isUsingRelay()&&!e.hideConsoleConnectionStatus()?17:-1),_(4),p(!e.isUsingRelay()&&!e.hideConsoleConnectionStatus()?21:-1),_(),p(e.runningTask()?22:-1),_(3),w(e.clientIsRunning()?"pause":"play"),_(),V(" ",e.clientIsRunning()?"Pause":"Resume"," "))},dependencies:[k,P,A,Se,$,De],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;min-height:3.875rem;border-bottom:1px solid var(--base-4);position:sticky;top:0;z-index:2000;background:var(--base-1)}[_nghost-%COMP%]:has(sh-progress-bar){padding:1rem 1rem 1.5rem}.current-backup[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%;gap:.5rem}.global-progress[_ngcontent-%COMP%]{flex:1 0;min-width:18.75rem}.current-backup-actions[_ngcontent-%COMP%], .current-backup-actions[_ngcontent-%COMP%] .desktop-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}@media only screen and (max-width:768px){.current-backup-actions[_ngcontent-%COMP%] .desktop-actions[_ngcontent-%COMP%]{display:none}}.current-backup-actions[_ngcontent-%COMP%] .mobile-actions[_ngcontent-%COMP%]{display:none}@media only screen and (max-width:768px){.current-backup-actions[_ngcontent-%COMP%] .mobile-actions[_ngcontent-%COMP%]{display:flex}}.current-backup-actions[_ngcontent-%COMP%] .menu-mobile-toggle[_ngcontent-%COMP%]{position:relative}.current-backup-actions[_ngcontent-%COMP%] .menu-mobile-toggle[_ngcontent-%COMP%] app-remote-connectivity-status[_ngcontent-%COMP%]{position:absolute;top:-.25rem;right:-.25rem}.menu-status-item[_ngcontent-%COMP%]{padding:.5rem 1rem;display:flex;flex-direction:column;gap:.25rem;border-bottom:1px solid var(--base-4);margin-bottom:.25rem}.menu-status-item[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem;font-size:.875rem}"],changeDetection:0})};export{q as a};
1
+ import{a as fe}from"./chunk-XJUQUKBN.js";import{a as Oe}from"./chunk-47XLDVIW.js";import{a as De}from"./chunk-TGVKMKNV.js";import{b as Ce}from"./chunk-LNE7WQZG.js";import{b as Ee}from"./chunk-3GE3OWQF.js";import{a as Fe}from"./chunk-S5IJ4C5T.js";import{b as me}from"./chunk-KKUFO6NZ.js";import{a as pe}from"./chunk-MWQHWJOA.js";import{c as se}from"./chunk-6RZVYDJF.js";import{B as A,H as ue,K as Se,P as de,Y as ge,c as ae,e as le,i as re,k as _e,s as ce,v as P,z as Te}from"./chunk-CJKZ27FM.js";import{d as x}from"./chunk-4V3AE4ZE.js";import{e as oe}from"./chunk-CQJRBQ6I.js";import{$ as d,Bc as H,Db as R,Eb as a,Fb as l,G as Q,Gb as T,Kb as te,Lb as ne,Nb as D,Rc as Y,Ta as _,Ub as m,Vb as C,Wb as I,Wc as ie,Zb as b,_b as c,ac as S,ea as E,fa as O,hb as N,lc as G,oc as F,pc as w,qa as f,qc as V,sa as ee,tc as y,uc as v,vc as B,xb as g,yb as p}from"./chunk-K5XGRFWJ.js";function Pe(o,t){o&1&&(a(0,"sh-icon",2),F(1,"x-bold"),l())}function Ae(o,t){o&1&&(a(0,"sh-icon",3),F(1,"list-bold"),l())}function he(o,t){if(o&1){let n=D();a(0,"button",1),c("click",function(){E(n);let i=S();return O(i.toggleNav())}),g(1,Pe,2,0,"sh-icon",2)(2,Ae,2,0,"sh-icon",3),l()}if(o&2){let n=S();_(),p(n.isNavOpen()?1:2)}}var $=class o{#e=d(Oe);isNavOpen=this.#e.isNavOpen;isMobile=this.#e.isMobile;toggleNav(){this.#e.toggleNav()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=N({type:o,selectors:[["app-mobile-menu-toggle"]],decls:1,vars:1,consts:[["shButton","",1,"small","toggle-sidebar","ghost"],["shButton","",1,"small","toggle-sidebar","ghost",3,"click"],[1,"cross"],[1,"burger"]],template:function(n,e){n&1&&g(0,he,3,1,"button",0),n&2&&p(e.isMobile()?0:-1)},dependencies:[A,P],styles:["[_nghost-%COMP%]{display:contents}.toggle-sidebar[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;justify-content:center}.toggle-sidebar[_ngcontent-%COMP%] .cross[_ngcontent-%COMP%], .toggle-sidebar[_ngcontent-%COMP%] .burger[_ngcontent-%COMP%]{opacity:1;transition:opacity 124ms linear;margin:0}.toggle-sidebar[_ngcontent-%COMP%] .cross.hidden[_ngcontent-%COMP%], .toggle-sidebar[_ngcontent-%COMP%] .burger.hidden[_ngcontent-%COMP%]{opacity:0}"],changeDetection:0})};var Ne=()=>["/connect/logon"];function be(o,t){o&1&&(m(0,0,1),T(1,"div",9),C())}function ye(o,t){o&1&&(m(0,0,2),T(1,"div",10),C())}function ve(o,t){if(o&1){let n=D();a(0,"div",8),c("click",function(){E(n);let i=S();return O(i.resetAndRetry())}),m(1,0),g(2,be,2,0)(3,ye,2,0),C(),l()}if(o&2){let n=S();_(2),p(n.resetting()?2:3)}}function Be(o,t){o&1&&(a(0,"div",6),m(1,1),T(2,"div",11),C(),l()),o&2&&R("routerLink",H(1,Ne))}function ke(o,t){o&1&&(a(0,"div",6),m(1,2),T(2,"div",10),C(),l()),o&2&&R("routerLink",H(1,Ne))}function Le(o,t){if(o&1){let n=D();a(0,"div",7),m(1,3),a(2,"sh-icon",12),c("click",function(){E(n);let i=S();return O(i.cancel())}),l(),a(3,"div",13),c("click",function(){E(n);let i=S();return O(i.claim())}),l(),T(4,"div",14),C(),l()}}function Ge(o,t){if(o&1){let n=D();a(0,"div",8),c("click",function(){E(n);let i=S();return O(i.openConsole())}),m(1,4),T(2,"div",15),C(),l()}}var k=class o{#e=d(Ee);state=this.#e.state;resetting=f(!1);stateEffect=ee(()=>{let t=this.#e.state(),n=this.resetting();t==="registered"&&n&&(this.resetting.set(!1),this.#e.beginRemoteRegistration())});ngOnInit(){this.#e.refreshRemoteControlStatus()}claim(){let t=this.#e.claimUrl();t&&window.open(t,"_blank")}cancel(){this.#e.cancelRemoteRegistration()}resetAndRetry(){this.resetting.set(!0),this.#e.cancelRemoteRegistration()}openConsole(){this.#e.openConsole()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=N({type:o,selectors:[["app-remote-connectivity-status"]],decls:5,vars:1,consts:()=>{let t;t=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF: Resetting ${"\uFFFD#1:1\uFFFD"}:START_TAG_DIV:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_DIV:${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE: Click to connect ${"\uFFFD#1:2\uFFFD"}:START_TAG_DIV_1:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_DIV:${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,t=b(t);let n;n=$localize` Connecting ${"\uFFFD#2\uFFFD"}:START_TAG_DIV:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_DIV:`;let e;e=$localize` Click to register ${"\uFFFD#2\uFFFD"}:START_TAG_DIV:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_DIV:`;let i;i=$localize`Cancel registration`;let s;s=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD#3\uFFFD"}:START_TAG_DIV:Click to claim${"[\uFFFD/#3\uFFFD|\uFFFD/#4\uFFFD]"}:CLOSE_TAG_DIV:${"\uFFFD#4\uFFFD"}:START_TAG_DIV_1:${"[\uFFFD/#3\uFFFD|\uFFFD/#4\uFFFD]"}:CLOSE_TAG_DIV:`,s=b(s);let u;return u=$localize` Connected ${"\uFFFD#2\uFFFD"}:START_TAG_DIV:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_DIV:`,[t,n,e,s,u,[1,"connectivity-status"],[1,"connectivity-status",3,"routerLink"],[1,"connectivity-status","claim"],[1,"connectivity-status",3,"click"],[1,"status","blinking"],[1,"status"],[1,"status","warning","blinking"],["shTooltip",i,3,"click"],[1,"claim",3,"click"],[1,"status","success","blinking"],[1,"status","success"]]},template:function(n,e){if(n&1&&g(0,ve,4,1,"div",5)(1,Be,3,2,"div",6)(2,ke,3,2,"div",6)(3,Le,5,0,"div",7)(4,Ge,3,0,"div",5),n&2){let i=e.state()==="unknown"||e.state()==="inactive"||e.state()==="registeringfaulted",s=e.state()==="registeringfaulted",u=e.state()==="registering",r=e.state()==="registered",M=e.state()==="connected"||e.state()==="disabled"||e.state()==="connecting";p(s?0:u?1:i?2:r?3:M?4:-1)}},dependencies:[oe,P,ge],styles:["[_nghost-%COMP%]{display:flex;align-items:center;padding:0 .75rem}@media only screen and (max-width:768px){[_nghost-%COMP%]{padding:0}}.hide-text[_nghost-%COMP%]{font-size:0}.in-menu[_nghost-%COMP%]{padding:.75rem;border-bottom:1px solid var(--base-4)}.connectivity-status[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer}.connectivity-status[_ngcontent-%COMP%]:hover{color:var(--primary-8)}.connectivity-status.claim[_ngcontent-%COMP%]{display:flex;gap:.5rem;cursor:pointer}.connectivity-status.claim[_ngcontent-%COMP%]:hover{color:inherit}.connectivity-status.claim[_ngcontent-%COMP%] .claim[_ngcontent-%COMP%]:hover{color:var(--primary-8)}.connectivity-status.claim[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]:hover{color:var(--error-8)}.status[_ngcontent-%COMP%]{width:.625rem;height:.625rem;border-radius:50%;background-color:var(--base-4)}.status.success[_ngcontent-%COMP%]{background-color:var(--success-8)}.status.warning[_ngcontent-%COMP%]{background-color:var(--warn-8)}.status.blinking[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_blinking 1s infinite}@keyframes _ngcontent-%COMP%_blinking{0%{opacity:.2}50%{opacity:1}to{opacity:.2}}"],changeDetection:0})};var Me={Byte:"B",KByte:"KB",MByte:"MB",GByte:"GB",TByte:"TB",PByte:"PB"},xe=["mbps","gbps"],Ie=8,W=1024,U=W*1024,j=U*1024,Z=j*1024,Re=Z*1024,$e={B:1,KB:W,MB:U,GB:j,TB:Z,PB:Re},Ue=1e3,K=Ue*1e3,X=K*1e3,we=[{threshold:Re,unitPrefix:"PByte"},{threshold:Z,unitPrefix:"TByte"},{threshold:j,unitPrefix:"GByte"},{threshold:U,unitPrefix:"MByte"},{threshold:W,unitPrefix:"KByte"},{threshold:1,unitPrefix:"Byte"}],L=class o{#e=d(x);closed=ie();isSubmitting=f(!1);sizeOptions=f([...xe]);maxUpload=f(0);maxDownload=f(0);maxUploadUnit=f("mbps");maxDownloadUnit=f("mbps");ngOnInit(){this.init()}convertToBitsPerSecondUnits(t,n){let i=t*($e[n.toUpperCase()]||U)*Ie;return i===0?{value:0,unit:"mbps"}:i>=X?{value:parseFloat((i/X).toFixed(2)),unit:"gbps"}:{value:parseFloat((i/K).toFixed(2)),unit:"mbps"}}convertFromBitsPerSecondUnits(t,n){let e=0;switch(n){case"gbps":e=t*X;break;case"mbps":e=t*K;break}let i=e/Ie;if(i===0)return{valueForApi:0,unitPrefixForApi:"Byte"};for(let{threshold:s,unitPrefix:u}of we)if(i>=s)return{valueForApi:Math.round(i/s),unitPrefixForApi:u};return{valueForApi:Math.round(i),unitPrefixForApi:"Byte"}}init(){this.#e.getApiV1Serversettings().subscribe({next:t=>{let n=t?.["max-upload-speed"],e=t?.["max-download-speed"];if(n&&n!==""){let i=n.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(i){let s=parseFloat(i[1]),u=i[2],r=this.convertToBitsPerSecondUnits(s,u);this.maxUpload.set(r.value),this.maxUploadUnit.set(r.unit)}else console.warn("Unexpected max-upload-speed format from API:",n),this.resetUpload()}else this.resetUpload();if(e&&e!==""){let i=e.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(i){let s=parseFloat(i[1]),u=i[2],r=this.convertToBitsPerSecondUnits(s,u);this.maxDownload.set(r.value),this.maxDownloadUnit.set(r.unit)}else console.warn("Unexpected max-download-speed format from API:",e),this.resetDownload()}else this.resetDownload()},error:t=>{console.error("Failed to get server settings:",t),this.resetDownload(),this.resetUpload()}})}resetDownload(){this.maxDownload.set(0),this.maxDownloadUnit.set("mbps")}resetUpload(){this.maxUpload.set(0),this.maxUploadUnit.set("mbps")}blockDecimalKeys(t){if([".",","].includes(t.key))return t.preventDefault()}cleanupInputAfterPasting(t){t.preventDefault();let n=t.clipboardData?.getData("text/plain");if(!n)return;let e=n.replaceAll(/[\.,]/g,"");t.target.value=e}submit(){this.isSubmitting.set(!0);let t="",n="",e=this.maxUpload()??0,i=this.maxUploadUnit(),s=this.maxDownload()??0,u=this.maxDownloadUnit();if(e>0){let{valueForApi:r,unitPrefixForApi:M}=this.convertFromBitsPerSecondUnits(e,i),h=Me[M];h?t=`${r}${h}`:console.error(`Invalid unit prefix for API submission (upload): ${M}. Defaulting to empty string.`)}if(s){let{valueForApi:r,unitPrefixForApi:M}=this.convertFromBitsPerSecondUnits(s,u),h=Me[M];h?n=`${r}${h}`:console.error(`Invalid unit prefix for API submission (download): ${M}. Defaulting to empty string.`)}this.#e.patchApiV1Serversettings({requestBody:{"max-upload-speed":t,"max-download-speed":n}}).pipe(Q(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.closed.emit(!0)},error:r=>{console.error("Failed to submit throttle settings:",r)}})}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=N({type:o,selectors:[["app-throttle-settings-dialog"]],outputs:{closed:"closed"},decls:26,vars:10,consts:()=>{let t;t=$localize`Throttle network speed`;let n;n=$localize`We will round bits to the nearest byte value.`;let e;e=$localize`Max upload speed`;let i;i=$localize`Max download speed`;let s;s=$localize`Cancel`;let u;return u=$localize` Update settings `,[t,n,e,i,s,u,["content",""],[1,"column"],[1,"field-row"],["type","number",3,"paste","keydown","ngModelChange","ngModel"],[3,"isClearable","options"],["type","text",3,"ngModelChange","ngModel"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(n,e){n&1&&(a(0,"header")(1,"h3"),I(2,0),l(),a(3,"p"),I(4,1),l()(),a(5,"div",6)(6,"div",7)(7,"div",8)(8,"label"),I(9,2),l(),a(10,"sh-form-field")(11,"input",9),c("paste",function(s){return e.cleanupInputAfterPasting(s)})("keydown",function(s){return e.blockDecimalKeys(s)}),B("ngModelChange",function(s){return v(e.maxUpload,s)||(e.maxUpload=s),s}),l()(),a(12,"sh-select",10)(13,"input",11),B("ngModelChange",function(s){return v(e.maxUploadUnit,s)||(e.maxUploadUnit=s),s}),l()()(),a(14,"div",8)(15,"label"),I(16,3),l(),a(17,"sh-form-field")(18,"input",9),c("paste",function(s){return e.cleanupInputAfterPasting(s)})("keydown",function(s){return e.blockDecimalKeys(s)}),B("ngModelChange",function(s){return v(e.maxDownload,s)||(e.maxDownload=s),s}),l()(),a(19,"sh-select",10)(20,"input",11),B("ngModelChange",function(s){return v(e.maxDownloadUnit,s)||(e.maxDownloadUnit=s),s}),l()()()()(),a(21,"footer",12)(22,"button",13),c("click",function(){return e.closed.emit(!1)}),I(23,4),l(),a(24,"button",14),c("click",function(){return e.submit()}),I(25,5),l()()),n&2&&(_(11),y("ngModel",e.maxUpload),_(),R("isClearable",!1)("options",e.sizeOptions()),_(),y("ngModel",e.maxUploadUnit),_(5),y("ngModel",e.maxDownload),_(),R("isClearable",!1)("options",e.sizeOptions()),_(),y("ngModel",e.maxDownloadUnit),_(4),G("loading",e.isSubmitting()))},dependencies:[ce,ae,_e,le,re,ue,de,A],styles:['[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:1rem;gap:.5rem;margin-bottom:1rem}.column[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.field-row[_ngcontent-%COMP%]{display:grid;grid-template-areas:"label label" "input select";grid-template-columns:1fr auto;align-items:center;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}.field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:select}'],changeDetection:0})};function Ve(o,t){o&1&&T(0,"app-remote-connectivity-status")}function He(o,t){if(o&1){let n=D();a(0,"button",7),c("click",function(){E(n);let i=S(2);return O(i.abort())}),m(1,1),T(2,"sh-icon"),C(),l()}}function Ye(o,t){if(o&1){let n=D();a(0,"button",7),c("click",function(){E(n);let i=S(2);return O(i.stop())}),m(1,2),T(2,"sh-icon"),C(),l()}}function ze(o,t){if(o&1&&g(0,He,3,0,"button",14)(1,Ye,3,0,"button",14),o&2){let n=S();p(n.isStopping()?0:1)}}function Je(o,t){o&1&&(m(0,0,1),T(1,"sh-icon"),C())}function Xe(o,t){o&1&&(m(0,0,2),T(1,"sh-icon"),C())}function Ke(o,t){o&1&&T(0,"app-remote-connectivity-status",10)}function We(o,t){o&1&&T(0,"app-remote-connectivity-status",12)}function je(o,t){if(o&1){let n=D();a(0,"button",13),c("click",function(){E(n);let i=S();return O(i.isStopping()?i.abort():i.stop())}),a(1,"sh-icon"),F(2),l(),F(3),l()}if(o&2){let n=S();_(2),w(n.isStopping()?"skull":"stop"),_(),V(" ",n.isStopping()?"Abort":"Stop"," ")}}var q=class o{#e=d(x);#t=d(Ce);#n=d(Te);#s=d(me);#i=d(se);#a=d(pe);#l=d(Fe);clientIsRunning=this.#t.clientIsRunning;isResuming=this.#t.isResuming;runningTask=Y(()=>this.#s.serverState()?.ActiveTask?.Item1);isStopping=Y(()=>this.runningTask()==this.#o());#o=f(-1);isUsingRelay=this.#i.relayIsEnabled;hideConsoleConnectionStatus=this.#l.isConsoleConnectionStatusHidden;openThrottleSettingsDialog(){this.#n.open(L,{maxWidth:"550px",width:"100%"})}openPauseDialog(){this.#n.open(fe,{maxWidth:"550px",width:"100%"})}pauseResume(){if(this.clientIsRunning()){this.openPauseDialog();return}this.#t.pauseResume().subscribe()}stop(){let t=this.runningTask();t&&(this.#o.set(t),this.#e.postApiV1TaskByTaskidStop({taskid:t}).subscribe())}abort(){let t=this.runningTask();t&&this.#e.postApiV1TaskByTaskidAbort({taskid:t}).subscribe()}ngAfterViewInit(){let t=this.#i.relayIsEnabled()||!this.#a.hasWebSocket()?"longpoll":"websocket";this.#t.setConnectionMethod(t)}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=N({type:o,selectors:[["app-status-bar"]],decls:31,vars:10,consts:()=>{let t;t=$localize`${"\uFFFD*9:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:pause${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Pause ${"\uFFFD/*9:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*10:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:play${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Resume ${"\uFFFD/*10:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,t=b(t);let n;n=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:skull${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Abort `;let e;return e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:stop${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Stop `,[t,n,e,[1,"current-backup"],[1,"global-progress"],[1,"current-backup-actions"],[1,"desktop-actions"],["shButton","",3,"click"],[1,"mobile-actions"],["shButton","",1,"small","menu-mobile-toggle"],[1,"hide-text"],["menu",""],[1,"in-menu"],[3,"click"],["shButton",""]]},template:function(n,e){n&1&&(a(0,"div",3),T(1,"app-mobile-menu-toggle")(2,"app-backup-progress",4),a(3,"div",5)(4,"div",6),g(5,Ve,1,0,"app-remote-connectivity-status"),g(6,ze,2,1),a(7,"button",7),c("click",function(){return e.pauseResume()}),m(8,0),g(9,Je,2,0)(10,Xe,2,0),C(),l(),a(11,"button",7),c("click",function(){return e.openThrottleSettingsDialog()}),a(12,"sh-icon"),F(13,"speedometer"),l()()(),a(14,"div",8)(15,"sh-menu")(16,"button",9),g(17,Ke,1,0,"app-remote-connectivity-status",10),a(18,"sh-icon"),F(19,"dots-three-vertical-bold"),l()(),te(20,11),g(21,We,1,0,"app-remote-connectivity-status",12),g(22,je,4,2,"button"),a(23,"button",13),c("click",function(){return e.pauseResume()}),a(24,"sh-icon"),F(25),l(),F(26),l(),a(27,"button",13),c("click",function(){return e.openThrottleSettingsDialog()}),a(28,"sh-icon"),F(29,"speedometer"),l(),F(30," Throttle Settings "),l(),ne(),l()()()()),n&2&&(_(5),p(!e.isUsingRelay()&&!e.hideConsoleConnectionStatus()?5:-1),_(),p(e.runningTask()?6:-1),_(),G("loading",e.isResuming()),_(2),p(e.clientIsRunning()?9:10),_(8),p(!e.isUsingRelay()&&!e.hideConsoleConnectionStatus()?17:-1),_(4),p(!e.isUsingRelay()&&!e.hideConsoleConnectionStatus()?21:-1),_(),p(e.runningTask()?22:-1),_(3),w(e.clientIsRunning()?"pause":"play"),_(),V(" ",e.clientIsRunning()?"Pause":"Resume"," "))},dependencies:[k,P,A,Se,$,De],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;min-height:3.875rem;border-bottom:1px solid var(--base-4);position:sticky;top:0;z-index:2000;background:var(--base-1)}[_nghost-%COMP%]:has(sh-progress-bar){padding:1rem 1rem 1.5rem}.current-backup[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%;gap:.5rem}.global-progress[_ngcontent-%COMP%]{flex:1 0;min-width:18.75rem}.current-backup-actions[_ngcontent-%COMP%], .current-backup-actions[_ngcontent-%COMP%] .desktop-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}@media only screen and (max-width:768px){.current-backup-actions[_ngcontent-%COMP%] .desktop-actions[_ngcontent-%COMP%]{display:none}}.current-backup-actions[_ngcontent-%COMP%] .mobile-actions[_ngcontent-%COMP%]{display:none}@media only screen and (max-width:768px){.current-backup-actions[_ngcontent-%COMP%] .mobile-actions[_ngcontent-%COMP%]{display:flex}}.current-backup-actions[_ngcontent-%COMP%] .menu-mobile-toggle[_ngcontent-%COMP%]{position:relative}.current-backup-actions[_ngcontent-%COMP%] .menu-mobile-toggle[_ngcontent-%COMP%] app-remote-connectivity-status[_ngcontent-%COMP%]{position:absolute;top:-.25rem;right:-.25rem}.menu-status-item[_ngcontent-%COMP%]{padding:.5rem 1rem;display:flex;flex-direction:column;gap:.25rem;border-bottom:1px solid var(--base-4);margin-bottom:.25rem}.menu-status-item[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem;font-size:.875rem}"],changeDetection:0})};export{q as a};
@@ -1 +1 @@
1
- import{a as l,d as w}from"./chunk-KNSQLQC6.js";import{d as k}from"./chunk-CQJRBQ6I.js";import{a as b,d as O}from"./chunk-HDDAGHHE.js";import{xa as T,ya as s}from"./chunk-YF6JHIN5.js";import{$ as i,Aa as v,B as N,E as u,G as p,K as P,O as f,W as c,f as R,i as y,l as E,q as m,qa as a}from"./chunk-K5XGRFWJ.js";import{a as A}from"./chunk-7CGTOI24.js";var h=class r{platformId=i(v);STORAGE_VERSION="v1";APP_NAME="duplicati";PERSISTED_PREFIX="persist:";getItemParsed(e,t=!1){return s(this.platformId)?null:JSON.parse(localStorage.getItem(`${this.STORAGE_VERSION}:${t?this.PERSISTED_PREFIX:""}${this.APP_NAME}:${e}`)??"null")}setItemParsed(e,t,o=!1){if(!s(this.platformId))return localStorage.setItem(`${this.STORAGE_VERSION}:${o?this.PERSISTED_PREFIX:""}${this.APP_NAME}:${e}`,JSON.stringify(t))}get length(){return T(this.platformId)?localStorage.length:0}getItem(e){return s(this.platformId)?null:localStorage.getItem(`${this.STORAGE_VERSION}:${this.APP_NAME}:${e}`)??null}setItem(e,t){if(!s(this.platformId))return localStorage.setItem(`${this.STORAGE_VERSION}:${this.APP_NAME}:${e}`,t)}removeItem(e){s(this.platformId)||(localStorage.removeItem(`${this.STORAGE_VERSION}:${this.APP_NAME}:${e}`),localStorage.removeItem(`${this.STORAGE_VERSION}:${this.PERSISTED_PREFIX}${this.APP_NAME}:${e}`))}clearAllNotCurrentVersion(){if(!s(this.platformId))for(var e in localStorage)!e.startsWith(this.STORAGE_VERSION)&&e.includes(this.APP_NAME)&&localStorage.removeItem(e)}clearAll(){s(this.platformId)||localStorage.clear()}clear(){if(!s(this.platformId))for(var e in localStorage)e.includes(this.APP_NAME)&&!e.includes(this.PERSISTED_PREFIX)&&localStorage.removeItem(e)}key(e){return s(this.platformId)?null:localStorage.key(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=c({token:r,factory:r.\u0275fac})};function V(){try{let r=document.querySelector('meta[name="duplicati-proxy-config"]');if(r){let e=(r.getAttribute("content")||"").trim();if(e&&e.startsWith("/"))return e}}catch(r){console.warn("Failed to read proxy configuration from meta tag:",r)}return null}function L(){try{let r=document.querySelector('meta[name="duplicati-enable-iframe-hosting"]');if(r){let e=(r.getAttribute("content")||"").trim();if(e&&e.length>0)return e.toLowerCase()!=="true"}}catch(r){console.warn("Failed to read disable relay support configuration from meta tag:",r)}return!0}function $(){try{let r=document.querySelector('meta[name="duplicati-xsrf-config"]');if(r){let e=(r.getAttribute("data-header-name")||"").trim(),t=(r.getAttribute("data-query-name")||"").trim();if(e&&t&&e.length>0&&t.length>0){let n=new URLSearchParams(window.location.search).get(t);if(n)return{headerName:e,queryName:t,headerValue:n}}}}catch(r){console.warn("Failed to read XSRF configuration from meta tags:",r)}return null}function x(){let r=$();return r?`${r.queryName}=${encodeURIComponent(r.headerValue)}`:null}function X(){let r=V();if(r&&r.length>0){let t=r;t.startsWith("/")||(t=`/${t}`),t.endsWith("/")&&(t=t.slice(0,-1)),l.BASE=t}else l.BASE="";let e=$();e&&(l.HEADERS={[e.headerName]:e.headerValue})}var g=class r{#i=i(h);#o=a(null);#t=window.self!==window.top&&L();#r=a(this.#t);relayIsEnabled=this.#r.asReadonly();config=this.#o.asReadonly();configLoaded=this.#t?new y:null;isLoading=a(this.#t);parentIframeListner=null;parentOrigin="*";fetchConfig(){this.#s(),this.#t&&(this.#r.set(!0),this.parentIframeListner=new AbortController,this.#e("connected"),window.addEventListener("message",e=>{if(e.data.startsWith("access:")){let t=e.data.replace("access:",""),o=JSON.parse(t);if(!o?.accessToken||!o?.clientId||!o?.machineServerUrl){this.#e("error:invalid-config"),this.#r.set(!1);return}if(typeof o.clientId!="string"){this.#e("error:invalid-config"),this.#r.set(!1);return}if(typeof o.accessToken!="string"){this.#e("error:invalid-config"),this.#r.set(!1);return}if(typeof o.machineServerUrl!="string"){this.#e("error:invalid-config"),this.#r.set(!1);return}let n=this.#i.getItem("locale")??"en-US",I=o.locale??"en-US";n!==I&&(this.#i.setItem("locale",I),window.location.reload()),this.#o.set(o),this.configLoaded?.next(!0),this.isLoading.set(!1),this.#e("handshake-complete")}},{signal:this.parentIframeListner.signal}))}#e(e){window.parent.postMessage(e,"*")}#s(){this.parentIframeListner&&(this.parentIframeListner.abort(),this.parentIframeListner=null)}setConfig(e){this.#o.set(e)}clearConfig(){this.#o.set(null)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})};var D="PROXY_AUTHED_FAKE_TOKEN",d="refreshNonce",S="v1:persist:duplicati:refreshNonce",M=class r{#i=i(k);#o=i(O);#t=i(w);#r=i(g);#e=a(null);#s=a(!1);#a=a(!1);#l=a(x());xsrfQueryParam=this.#l.asReadonly();token=this.#e.asReadonly();isLoggingOut=this.#s.asReadonly();setRefreshNonce(e,t){if(!e){sessionStorage.removeItem(d);return}t?localStorage.setItem(S,e||""):sessionStorage.setItem(d,e||"")}getRefreshNonceBody(){let e=sessionStorage.getItem(d),t=localStorage.getItem(S),o=e||t;return{requestBody:o?{requestBody:{Nonce:o}}:void 0,local:o===t}}login(e,t){return this.#t.postApiV1AuthLogin({requestBody:{Password:e,RememberMe:t}}).pipe(u(1),f(o=>{o.AccessToken?(this.#e.set(o.AccessToken),this.setRefreshNonce(o.RefreshNonce,t)):this.#e.set(null)}))}#n=null;refreshToken(){if(this.#r.relayIsEnabled())return this.#e.set(D),new R(o=>{o.next({AccessToken:D}),o.complete()});if(this.#a())return this.#t.postApiV1AuthIssuetokenByOperation({operation:"websocket"}).pipe(u(1),f(o=>{o.Token&&this.#e.set(o.Token)}),m(o=>({AccessToken:o.Token})));if(this.#n)return this.#n;let{requestBody:e,local:t}=this.getRefreshNonceBody();return this.#n=this.#t.postApiV1AuthRefresh(e).pipe(u(1),f(o=>{o.AccessToken&&(this.#e.set(o.AccessToken),this.setRefreshNonce(o.RefreshNonce,t))}),p(()=>{this.#n=null}),P(1)),this.#n}checkProxyAuthed(){let e=new b(A({"custom-proxy-check":"true"},l.HEADERS??{})),t=l.BASE||"";return this.#o.post(`${t}/api/v1/auth/status`,null,{headers:e}).pipe(m(o=>{let n=o;return n?.authorized&&n?.socketToken?(this.#e.set(n.socketToken),this.#a.set(!0),!0):!1}),N(()=>E(!1)))}logout(){this.#s.set(!0);let{requestBody:e,local:t}=this.getRefreshNonceBody();sessionStorage.removeItem(d),t&&localStorage.removeItem(S),this.#t.postApiV1AuthRefreshLogout(e).pipe(u(1),p(()=>{this.#s.set(!1),this.#e.set(null),this.#i.navigate(["/login"])})).subscribe()}static \u0275fac=function(t){return new(t||r)};static \u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})};export{h as a,X as b,g as c,D as d,M as e};
1
+ import{a as l,d as w}from"./chunk-4V3AE4ZE.js";import{d as k}from"./chunk-CQJRBQ6I.js";import{a as b,d as O}from"./chunk-HDDAGHHE.js";import{xa as T,ya as s}from"./chunk-YF6JHIN5.js";import{$ as i,Aa as v,B as N,E as u,G as p,K as P,O as f,W as c,f as R,i as y,l as E,q as m,qa as a}from"./chunk-K5XGRFWJ.js";import{a as A}from"./chunk-7CGTOI24.js";var h=class r{platformId=i(v);STORAGE_VERSION="v1";APP_NAME="duplicati";PERSISTED_PREFIX="persist:";getItemParsed(e,t=!1){return s(this.platformId)?null:JSON.parse(localStorage.getItem(`${this.STORAGE_VERSION}:${t?this.PERSISTED_PREFIX:""}${this.APP_NAME}:${e}`)??"null")}setItemParsed(e,t,o=!1){if(!s(this.platformId))return localStorage.setItem(`${this.STORAGE_VERSION}:${o?this.PERSISTED_PREFIX:""}${this.APP_NAME}:${e}`,JSON.stringify(t))}get length(){return T(this.platformId)?localStorage.length:0}getItem(e){return s(this.platformId)?null:localStorage.getItem(`${this.STORAGE_VERSION}:${this.APP_NAME}:${e}`)??null}setItem(e,t){if(!s(this.platformId))return localStorage.setItem(`${this.STORAGE_VERSION}:${this.APP_NAME}:${e}`,t)}removeItem(e){s(this.platformId)||(localStorage.removeItem(`${this.STORAGE_VERSION}:${this.APP_NAME}:${e}`),localStorage.removeItem(`${this.STORAGE_VERSION}:${this.PERSISTED_PREFIX}${this.APP_NAME}:${e}`))}clearAllNotCurrentVersion(){if(!s(this.platformId))for(var e in localStorage)!e.startsWith(this.STORAGE_VERSION)&&e.includes(this.APP_NAME)&&localStorage.removeItem(e)}clearAll(){s(this.platformId)||localStorage.clear()}clear(){if(!s(this.platformId))for(var e in localStorage)e.includes(this.APP_NAME)&&!e.includes(this.PERSISTED_PREFIX)&&localStorage.removeItem(e)}key(e){return s(this.platformId)?null:localStorage.key(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=c({token:r,factory:r.\u0275fac})};function V(){try{let r=document.querySelector('meta[name="duplicati-proxy-config"]');if(r){let e=(r.getAttribute("content")||"").trim();if(e&&e.startsWith("/"))return e}}catch(r){console.warn("Failed to read proxy configuration from meta tag:",r)}return null}function L(){try{let r=document.querySelector('meta[name="duplicati-enable-iframe-hosting"]');if(r){let e=(r.getAttribute("content")||"").trim();if(e&&e.length>0)return e.toLowerCase()!=="true"}}catch(r){console.warn("Failed to read disable relay support configuration from meta tag:",r)}return!0}function $(){try{let r=document.querySelector('meta[name="duplicati-xsrf-config"]');if(r){let e=(r.getAttribute("data-header-name")||"").trim(),t=(r.getAttribute("data-query-name")||"").trim();if(e&&t&&e.length>0&&t.length>0){let n=new URLSearchParams(window.location.search).get(t);if(n)return{headerName:e,queryName:t,headerValue:n}}}}catch(r){console.warn("Failed to read XSRF configuration from meta tags:",r)}return null}function x(){let r=$();return r?`${r.queryName}=${encodeURIComponent(r.headerValue)}`:null}function X(){let r=V();if(r&&r.length>0){let t=r;t.startsWith("/")||(t=`/${t}`),t.endsWith("/")&&(t=t.slice(0,-1)),l.BASE=t}else l.BASE="";let e=$();e&&(l.HEADERS={[e.headerName]:e.headerValue})}var g=class r{#i=i(h);#o=a(null);#t=window.self!==window.top&&L();#r=a(this.#t);relayIsEnabled=this.#r.asReadonly();config=this.#o.asReadonly();configLoaded=this.#t?new y:null;isLoading=a(this.#t);parentIframeListner=null;parentOrigin="*";fetchConfig(){this.#s(),this.#t&&(this.#r.set(!0),this.parentIframeListner=new AbortController,this.#e("connected"),window.addEventListener("message",e=>{if(e.data.startsWith("access:")){let t=e.data.replace("access:",""),o=JSON.parse(t);if(!o?.accessToken||!o?.clientId||!o?.machineServerUrl){this.#e("error:invalid-config"),this.#r.set(!1);return}if(typeof o.clientId!="string"){this.#e("error:invalid-config"),this.#r.set(!1);return}if(typeof o.accessToken!="string"){this.#e("error:invalid-config"),this.#r.set(!1);return}if(typeof o.machineServerUrl!="string"){this.#e("error:invalid-config"),this.#r.set(!1);return}let n=this.#i.getItem("locale")??"en-US",I=o.locale??"en-US";n!==I&&(this.#i.setItem("locale",I),window.location.reload()),this.#o.set(o),this.configLoaded?.next(!0),this.isLoading.set(!1),this.#e("handshake-complete")}},{signal:this.parentIframeListner.signal}))}#e(e){window.parent.postMessage(e,"*")}#s(){this.parentIframeListner&&(this.parentIframeListner.abort(),this.parentIframeListner=null)}setConfig(e){this.#o.set(e)}clearConfig(){this.#o.set(null)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})};var D="PROXY_AUTHED_FAKE_TOKEN",d="refreshNonce",S="v1:persist:duplicati:refreshNonce",M=class r{#i=i(k);#o=i(O);#t=i(w);#r=i(g);#e=a(null);#s=a(!1);#a=a(!1);#l=a(x());xsrfQueryParam=this.#l.asReadonly();token=this.#e.asReadonly();isLoggingOut=this.#s.asReadonly();setRefreshNonce(e,t){if(!e){sessionStorage.removeItem(d);return}t?localStorage.setItem(S,e||""):sessionStorage.setItem(d,e||"")}getRefreshNonceBody(){let e=sessionStorage.getItem(d),t=localStorage.getItem(S),o=e||t;return{requestBody:o?{requestBody:{Nonce:o}}:void 0,local:o===t}}login(e,t){return this.#t.postApiV1AuthLogin({requestBody:{Password:e,RememberMe:t}}).pipe(u(1),f(o=>{o.AccessToken?(this.#e.set(o.AccessToken),this.setRefreshNonce(o.RefreshNonce,t)):this.#e.set(null)}))}#n=null;refreshToken(){if(this.#r.relayIsEnabled())return this.#e.set(D),new R(o=>{o.next({AccessToken:D}),o.complete()});if(this.#a())return this.#t.postApiV1AuthIssuetokenByOperation({operation:"websocket"}).pipe(u(1),f(o=>{o.Token&&this.#e.set(o.Token)}),m(o=>({AccessToken:o.Token})));if(this.#n)return this.#n;let{requestBody:e,local:t}=this.getRefreshNonceBody();return this.#n=this.#t.postApiV1AuthRefresh(e).pipe(u(1),f(o=>{o.AccessToken&&(this.#e.set(o.AccessToken),this.setRefreshNonce(o.RefreshNonce,t))}),p(()=>{this.#n=null}),P(1)),this.#n}checkProxyAuthed(){let e=new b(A({"custom-proxy-check":"true"},l.HEADERS??{})),t=l.BASE||"";return this.#o.post(`${t}/api/v1/auth/status`,null,{headers:e}).pipe(m(o=>{let n=o;return n?.authorized&&n?.socketToken?(this.#e.set(n.socketToken),this.#a.set(!0),!0):!1}),N(()=>E(!1)))}logout(){this.#s.set(!0);let{requestBody:e,local:t}=this.getRefreshNonceBody();sessionStorage.removeItem(d),t&&localStorage.removeItem(S),this.#t.postApiV1AuthRefreshLogout(e).pipe(u(1),p(()=>{this.#s.set(!1),this.#e.set(null),this.#i.navigate(["/login"])})).subscribe()}static \u0275fac=function(t){return new(t||r)};static \u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})};export{h as a,X as b,g as c,D as d,M as e};
@@ -0,0 +1 @@
1
+ import{d as a,e as b,f as c}from"./chunk-AU25JBCN.js";import"./chunk-PNQ5BDQN.js";import"./chunk-DCBSWJWZ.js";import"./chunk-OVNIENWW.js";import"./chunk-6Q6SSTBK.js";import"./chunk-COEGVUM3.js";import"./chunk-3GE3OWQF.js";import"./chunk-S5IJ4C5T.js";import"./chunk-2KD757N6.js";import"./chunk-KKUFO6NZ.js";import"./chunk-PEOYNJJM.js";import"./chunk-MWQHWJOA.js";import"./chunk-6RZVYDJF.js";import"./chunk-CJKZ27FM.js";import"./chunk-4V3AE4ZE.js";import"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";export{b as NONE_OPTION,a as createGeneralForm,c as default};
@@ -0,0 +1 @@
1
+ import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-75ULGSKP.js")},{path:"destination",loadComponent:()=>import("./chunk-MIJNCB2V.js")},{path:"source-data",loadComponent:()=>import("./chunk-SY6UK74R.js")},{path:"schedule",loadComponent:()=>import("./chunk-PSEMHKPR.js")},{path:"options",loadComponent:()=>import("./chunk-DHJS5K3Y.js")}];export{o as default};
@@ -1 +1 @@
1
- import{g as q}from"./chunk-6WX2UOAN.js";import{a as K}from"./chunk-3HYQMG65.js";import"./chunk-O2HQIEE4.js";import"./chunk-VZNLMGYP.js";import{b as Z}from"./chunk-3PARK7B7.js";import"./chunk-O2L2FRYE.js";import"./chunk-PNQ5BDQN.js";import"./chunk-2EX5HS5X.js";import"./chunk-EVEI25GQ.js";import"./chunk-NE255HQN.js";import{b as V}from"./chunk-UIVZWXBK.js";import"./chunk-E4CYVUYG.js";import"./chunk-6Q6SSTBK.js";import{a as j}from"./chunk-COEGVUM3.js";import"./chunk-YS4B2B5N.js";import"./chunk-KZYRTI62.js";import"./chunk-TSVSMVY4.js";import"./chunk-2KD757N6.js";import{b as H}from"./chunk-OP7MDR2B.js";import"./chunk-PEOYNJJM.js";import"./chunk-NUV5LHQV.js";import"./chunk-PDZNQW6F.js";import{C as W,L as X,O as z,v as J}from"./chunk-CJKZ27FM.js";import{d as B}from"./chunk-KNSQLQC6.js";import{b as w}from"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import{ma as k}from"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as S,Db as C,Eb as i,Fb as s,Gb as c,Gc as T,Hc as d,Kb as P,Lb as m,Rc as x,Ta as a,Ub as A,Vb as D,Wb as r,Xb as b,Yb as v,ac as g,ga as u,ha as f,hb as I,oc as M,qa as y,rc as N,xb as O,yb as p}from"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";function Q(n,t){n&1&&(i(0,"div",17),u(),i(1,"svg",19),c(2,"circle",20),s(),f(),i(3,"sh-icon",21),r(4,3),s()())}function U(n,t){n&1&&(i(0,"div",18),u(),i(1,"svg",19),c(2,"circle",20),s(),f(),i(3,"sh-icon",22),r(4,4),s()())}function Y(n,t){if(n&1&&(i(0,"sh-card",10),P(1,16),r(2,2),m(),O(3,Q,5,0,"div",17)(4,U,5,0,"div",18),s()),n&2){let e=g();a(3),p(e.restoreResult()=="success"?3:4)}}function ee(n,t){if(n&1&&(M(0),T(1,"number"),T(2,"number")),n&2){let e,o=g(2);N(" ",d(1,2,(e=o.statusData())==null?null:e.ProcessedFileCount)," of ",d(2,4,(e=o.statusData())==null?null:e.TotalFileCount)," ")}}function te(n,t){n&1&&(P(0),r(1,8),m())}function ne(n,t){if(n&1&&(M(0),T(1,"bytes"),T(2,"bytes")),n&2){let e,o=g(2);N(" ",d(1,2,(e=o.statusData())==null?null:e.ProcessedFileSize)," of ",d(2,4,(e=o.statusData())==null?null:e.TotalFileSize)," ")}}function oe(n,t){n&1&&(P(0),r(1,9),m())}function ie(n,t){if(n&1&&(i(0,"sh-card",10)(1,"h3"),A(2,5),c(3,"sh-spinner",23),D(),s(),i(4,"div",24),c(5,"sh-progress-bar",25),i(6,"p")(7,"span"),r(8,6),s(),O(9,ee,3,6)(10,te,2,0,"ng-container"),s(),i(11,"p")(12,"span"),r(13,7),s(),O(14,ne,3,6)(15,oe,2,0,"ng-container"),s()()()),n&2){let e,o,l,E,R=g();a(3),b((e=R.statusData())==null?null:e.statusText),v(2),a(2),C("value",(o=R.statusData())==null?null:o.OverallProgress),a(4),p((l=R.statusData())!=null&&l.ProcessedFileCount?9:10),a(5),p((E=R.statusData())!=null&&E.ProcessedFileSize?14:15)}}var G=class n{#i=S(B);#s=S(H);#t=S(V);#n=S(q);#r=S(w);statusData=this.#t.statusData;backupId=this.#n.backupId;restoreResult=y("");#e=null;lastRestoreStarted=x(()=>{if(this.#e)return this.#e;let t=this.#t.statusData()?.backup?.Backup?.Metadata?.LastRestoreStarted??null;if(!t)return null;let e=this.fixDate(t);return this.#e=e,e});notificationFilterPredicate=()=>{let t=this.lastRestoreStarted();return{predicate:e=>(e.BackupID===this.#n.backupId()&&t&&t.getTime()<=new Date(e.Timestamp).getTime())??!1}};ngOnInit(){let t=this.#r.snapshot.params.taskid?.toString()??"";this.#i.getApiV1TaskByTaskid({taskid:t}).subscribe({next:e=>{if(e.TaskStarted&&(this.#e=new Date(e.TaskStarted)),!e.TaskFinished&&e.ID){this.#_(e.ID);return}this.#o(e)},error:e=>{console.error("Error fetching task:",e),this.restoreResult.set("error"),alert("Failed to fetch task details. Please try again later.")}})}#_(t){this.#s.waitForTaskToComplete(t).subscribe(e=>{this.#o(e)})}#o(t){t.TaskFinished!=null&&this.restoreResult.set(t.Status==="Completed"&&t.ErrorMessage==null?"success":"error")}fixDate(t){return new Date(`${t.slice(0,4)}-${t.slice(4,6)}-${t.slice(6,8)}T${t.slice(9,11)}:${t.slice(11,13)}:${t.slice(13,15)}Z`)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=I({type:n,selectors:[["app-restore-progress"]],decls:12,vars:5,consts:()=>{let t;t=$localize`Notifications`;let e;e=$localize`Logs`;let o;o=$localize`Restore completed`;let l;l=$localize`check-bold`;let E;E=$localize`warning-octagon`;let R;R=$localize` Restore progress: ${"\uFFFD0\uFFFD"}:INTERPOLATION: ${"\uFFFD#3\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let h;h=$localize`Files processed:`;let F;F=$localize`Size processed:`;let L;L=$localize`N/A`;let $;return $=$localize`N/A`,[t,e,o,l,E,R,h,F,L,$,[1,"progress","type-a"],[1,"notifications","type-a"],[1,"notification-list"],[3,"notificationFilterPredicate"],[1,"logs","type-a"],[3,"polling","whenFilter","backupIdFilter"],["title",""],[1,"complete-success"],[1,"complete-failure"],[1,"border-svg"],["cx","50","cy","50","r","45",1,"border-circle"],[1,"success"],[1,"error"],[1,"primary"],[1,"progress-content"],[3,"value"]]},template:function(e,o){if(e&1&&(i(0,"section"),O(1,Y,5,1,"sh-card",10)(2,ie,16,4,"sh-card",10),i(3,"sh-card",11)(4,"h3"),r(5,0),s(),i(6,"div",12),c(7,"app-notifications",13),s()(),i(8,"sh-card",14)(9,"h3"),r(10,1),s(),c(11,"app-logs-live",15),s()()),e&2){let l;a(),p(o.restoreResult()!=""?1:2),a(6),C("notificationFilterPredicate",o.notificationFilterPredicate()),a(4),C("polling",o.restoreResult()=="")("whenFilter",(l=o.lastRestoreStarted())==null?null:l.getTime())("backupIdFilter",o.backupId())}},dependencies:[K,X,z,J,W,Z,j,k],styles:['[_nghost-%COMP%]{display:block;padding:0 1.25rem;margin-top:32px}section[_ngcontent-%COMP%]{display:grid;gap:1.25rem;grid-template-columns:2fr 1fr;grid-template-areas:"progress notifications" "logs logs"}section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-bottom:1rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]{grid-area:progress}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]:has(.complete-check){display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1.25rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] sh-spinner[_ngcontent-%COMP%]{--spinner-size: 1.25rem;--spinner-thickness: .1875rem}section[_ngcontent-%COMP%] .notifications[_ngcontent-%COMP%]{grid-area:notifications}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%]{grid-area:logs}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%] app-logs-live[_ngcontent-%COMP%]{max-height:50rem;overflow:auto}.notification-list[_ngcontent-%COMP%]{max-height:15rem;overflow:auto}.complete-success[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--success-8)}.complete-success[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-success[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--success-8)}.complete-failure[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--error-8)}.complete-failure[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-failure[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--error-8)}.border-svg[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}.border-circle[_ngcontent-%COMP%]{fill:none;stroke-width:.3125rem;stroke-dasharray:282.74;stroke-dashoffset:282.74;animation:_ngcontent-%COMP%_draw-border 1.2s linear forwards}@keyframes _ngcontent-%COMP%_draw-border{to{stroke-dashoffset:0}}@keyframes _ngcontent-%COMP%_reveal-icon{to{opacity:1}}.progress-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.progress-content[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{margin-bottom:.75rem}.progress-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-right:.25rem}'],changeDetection:0})};export{G as default};
1
+ import{a as K}from"./chunk-UZ2BD6RF.js";import"./chunk-LP3KCTXP.js";import{g as q}from"./chunk-NNSH2MIZ.js";import"./chunk-AOPTGCDG.js";import{b as Z}from"./chunk-NDEZRDHS.js";import"./chunk-AU25JBCN.js";import"./chunk-PNQ5BDQN.js";import"./chunk-DCBSWJWZ.js";import"./chunk-OVNIENWW.js";import"./chunk-EY7DOUFA.js";import{b as V}from"./chunk-LNE7WQZG.js";import"./chunk-ZFV3MK5Y.js";import"./chunk-6Q6SSTBK.js";import{a as j}from"./chunk-COEGVUM3.js";import"./chunk-UHSRAJTA.js";import"./chunk-3GE3OWQF.js";import"./chunk-S5IJ4C5T.js";import"./chunk-2KD757N6.js";import{b as H}from"./chunk-KKUFO6NZ.js";import"./chunk-PEOYNJJM.js";import"./chunk-MWQHWJOA.js";import"./chunk-6RZVYDJF.js";import{C as W,L as X,O as z,v as J}from"./chunk-CJKZ27FM.js";import{d as B}from"./chunk-4V3AE4ZE.js";import{b as w}from"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import{ma as k}from"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as S,Db as C,Eb as i,Fb as s,Gb as c,Gc as T,Hc as d,Kb as P,Lb as m,Rc as x,Ta as a,Ub as A,Vb as D,Wb as r,Xb as b,Yb as v,ac as g,ga as u,ha as f,hb as I,oc as M,qa as y,rc as N,xb as O,yb as p}from"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";function Q(n,t){n&1&&(i(0,"div",17),u(),i(1,"svg",19),c(2,"circle",20),s(),f(),i(3,"sh-icon",21),r(4,3),s()())}function U(n,t){n&1&&(i(0,"div",18),u(),i(1,"svg",19),c(2,"circle",20),s(),f(),i(3,"sh-icon",22),r(4,4),s()())}function Y(n,t){if(n&1&&(i(0,"sh-card",10),P(1,16),r(2,2),m(),O(3,Q,5,0,"div",17)(4,U,5,0,"div",18),s()),n&2){let e=g();a(3),p(e.restoreResult()=="success"?3:4)}}function ee(n,t){if(n&1&&(M(0),T(1,"number"),T(2,"number")),n&2){let e,o=g(2);N(" ",d(1,2,(e=o.statusData())==null?null:e.ProcessedFileCount)," of ",d(2,4,(e=o.statusData())==null?null:e.TotalFileCount)," ")}}function te(n,t){n&1&&(P(0),r(1,8),m())}function ne(n,t){if(n&1&&(M(0),T(1,"bytes"),T(2,"bytes")),n&2){let e,o=g(2);N(" ",d(1,2,(e=o.statusData())==null?null:e.ProcessedFileSize)," of ",d(2,4,(e=o.statusData())==null?null:e.TotalFileSize)," ")}}function oe(n,t){n&1&&(P(0),r(1,9),m())}function ie(n,t){if(n&1&&(i(0,"sh-card",10)(1,"h3"),A(2,5),c(3,"sh-spinner",23),D(),s(),i(4,"div",24),c(5,"sh-progress-bar",25),i(6,"p")(7,"span"),r(8,6),s(),O(9,ee,3,6)(10,te,2,0,"ng-container"),s(),i(11,"p")(12,"span"),r(13,7),s(),O(14,ne,3,6)(15,oe,2,0,"ng-container"),s()()()),n&2){let e,o,l,E,R=g();a(3),b((e=R.statusData())==null?null:e.statusText),v(2),a(2),C("value",(o=R.statusData())==null?null:o.OverallProgress),a(4),p((l=R.statusData())!=null&&l.ProcessedFileCount?9:10),a(5),p((E=R.statusData())!=null&&E.ProcessedFileSize?14:15)}}var G=class n{#i=S(B);#s=S(H);#t=S(V);#n=S(q);#r=S(w);statusData=this.#t.statusData;backupId=this.#n.backupId;restoreResult=y("");#e=null;lastRestoreStarted=x(()=>{if(this.#e)return this.#e;let t=this.#t.statusData()?.backup?.Backup?.Metadata?.LastRestoreStarted??null;if(!t)return null;let e=this.fixDate(t);return this.#e=e,e});notificationFilterPredicate=()=>{let t=this.lastRestoreStarted();return{predicate:e=>(e.BackupID===this.#n.backupId()&&t&&t.getTime()<=new Date(e.Timestamp).getTime())??!1}};ngOnInit(){let t=this.#r.snapshot.params.taskid?.toString()??"";this.#i.getApiV1TaskByTaskid({taskid:t}).subscribe({next:e=>{if(e.TaskStarted&&(this.#e=new Date(e.TaskStarted)),!e.TaskFinished&&e.ID){this.#_(e.ID);return}this.#o(e)},error:e=>{console.error("Error fetching task:",e),this.restoreResult.set("error"),alert("Failed to fetch task details. Please try again later.")}})}#_(t){this.#s.waitForTaskToComplete(t).subscribe(e=>{this.#o(e)})}#o(t){t.TaskFinished!=null&&this.restoreResult.set(t.Status==="Completed"&&t.ErrorMessage==null?"success":"error")}fixDate(t){return new Date(`${t.slice(0,4)}-${t.slice(4,6)}-${t.slice(6,8)}T${t.slice(9,11)}:${t.slice(11,13)}:${t.slice(13,15)}Z`)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=I({type:n,selectors:[["app-restore-progress"]],decls:12,vars:5,consts:()=>{let t;t=$localize`Notifications`;let e;e=$localize`Logs`;let o;o=$localize`Restore completed`;let l;l=$localize`check-bold`;let E;E=$localize`warning-octagon`;let R;R=$localize` Restore progress: ${"\uFFFD0\uFFFD"}:INTERPOLATION: ${"\uFFFD#3\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let h;h=$localize`Files processed:`;let F;F=$localize`Size processed:`;let L;L=$localize`N/A`;let $;return $=$localize`N/A`,[t,e,o,l,E,R,h,F,L,$,[1,"progress","type-a"],[1,"notifications","type-a"],[1,"notification-list"],[3,"notificationFilterPredicate"],[1,"logs","type-a"],[3,"polling","whenFilter","backupIdFilter"],["title",""],[1,"complete-success"],[1,"complete-failure"],[1,"border-svg"],["cx","50","cy","50","r","45",1,"border-circle"],[1,"success"],[1,"error"],[1,"primary"],[1,"progress-content"],[3,"value"]]},template:function(e,o){if(e&1&&(i(0,"section"),O(1,Y,5,1,"sh-card",10)(2,ie,16,4,"sh-card",10),i(3,"sh-card",11)(4,"h3"),r(5,0),s(),i(6,"div",12),c(7,"app-notifications",13),s()(),i(8,"sh-card",14)(9,"h3"),r(10,1),s(),c(11,"app-logs-live",15),s()()),e&2){let l;a(),p(o.restoreResult()!=""?1:2),a(6),C("notificationFilterPredicate",o.notificationFilterPredicate()),a(4),C("polling",o.restoreResult()=="")("whenFilter",(l=o.lastRestoreStarted())==null?null:l.getTime())("backupIdFilter",o.backupId())}},dependencies:[K,X,z,J,W,Z,j,k],styles:['[_nghost-%COMP%]{display:block;padding:0 1.25rem;margin-top:32px}section[_ngcontent-%COMP%]{display:grid;gap:1.25rem;grid-template-columns:2fr 1fr;grid-template-areas:"progress notifications" "logs logs"}section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-bottom:1rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]{grid-area:progress}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]:has(.complete-check){display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1.25rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] sh-spinner[_ngcontent-%COMP%]{--spinner-size: 1.25rem;--spinner-thickness: .1875rem}section[_ngcontent-%COMP%] .notifications[_ngcontent-%COMP%]{grid-area:notifications}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%]{grid-area:logs}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%] app-logs-live[_ngcontent-%COMP%]{max-height:50rem;overflow:auto}.notification-list[_ngcontent-%COMP%]{max-height:15rem;overflow:auto}.complete-success[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--success-8)}.complete-success[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-success[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--success-8)}.complete-failure[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--error-8)}.complete-failure[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-failure[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--error-8)}.border-svg[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}.border-circle[_ngcontent-%COMP%]{fill:none;stroke-width:.3125rem;stroke-dasharray:282.74;stroke-dashoffset:282.74;animation:_ngcontent-%COMP%_draw-border 1.2s linear forwards}@keyframes _ngcontent-%COMP%_draw-border{to{stroke-dashoffset:0}}@keyframes _ngcontent-%COMP%_reveal-icon{to{opacity:1}}.progress-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.progress-content[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{margin-bottom:.75rem}.progress-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-right:.25rem}'],changeDetection:0})};export{G as default};
@@ -0,0 +1,2 @@
1
+ import{a as ge,c as Te,d as fe}from"./chunk-DCBSWJWZ.js";import{k as Ce}from"./chunk-OVNIENWW.js";import{a as ue}from"./chunk-MWQHWJOA.js";import{B as le,H as _e,K as se,P as pe,V as ce,W as me,Y as de,b as ee,c as te,e as ne,i as ie,k as oe,s as ae,v as re}from"./chunk-CJKZ27FM.js";import{aa as Z}from"./chunk-YF6JHIN5.js";import{$ as j,$c as Y,Bb as G,Bc as W,Cb as k,Cc as x,Db as p,Eb as l,Fb as s,Gb as V,Kb as B,Kc as A,Lb as P,Mb as T,Nb as f,Rc as K,Ta as _,Ub as E,Vb as v,Wb as Q,Xc as H,_b as C,ac as r,ea as d,fa as u,hb as q,jc as g,lc as z,mb as S,oc as m,pc as J,qa as M,qc as N,wc as U,xb as F,xc as $,yb as h,yc as O,zb as R}from"./chunk-K5XGRFWJ.js";import{a as I,b as D}from"./chunk-7CGTOI24.js";var xe=[{name:"send-mail-to",type:"Email"},{name:"send-mail-from",type:"Email"},{name:"log-file",type:"FileTree"},{name:"compression-extension-file",type:"FileTree"},{name:"dbpath",type:"FileTree"},{name:"restore-path",type:"FileTree"},{name:"gpg-program-path",type:"FileTree"}];var Fe=()=>({updateOn:"blur"}),w=t=>({formView:t}),L=t=>({$implicit:t});function he(t,i){if(t&1){let e=f();l(0,"button",15),C("click",function(){d(e);let n=r();return u(n.showTextArea.set(!1))}),E(1,6),V(2,"sh-icon"),v(),s()}}function ye(t,i){if(t&1){let e=f();l(0,"button",19,1),C("click",function(){let n=d(e).$implicit,a=r(3);return u(a.addSetting(n))}),l(2,"div",20),m(3),l(4,"p"),m(5),s()()()}if(t&2){let e=i.$implicit;z("deprecated",e.deprecatedDescription),_(3),N(" ",e.shortDescription," "),_(2),J(e.name)}}function we(t,i){if(t&1&&(l(0,"h3",11),m(1),s(),G(2,ye,6,4,"button",18,R)),t&2){let e=i.$implicit;_(),J(e.displayName),_(),k(e.options)}}function Le(t,i){if(t&1){let e=f();l(0,"sh-menu")(1,"button",21)(2,"sh-icon"),m(3,"dots-three-vertical"),s()(),B(4,17),l(5,"button",15),C("click",function(){d(e);let n=r(2);return u(n.addFreeTextSetting())}),E(6,8),V(7,"sh-icon"),v(),s(),l(8,"button",22),C("click",function(){d(e);let n=r(2);return u(n.showTextArea.set(!0))}),l(9,"sh-icon"),m(10,"link"),s(),m(11," Edit contents as text "),s(),l(12,"button",15),C("click",function(){d(e);let n=r(2);return u(n.showOptionNames.set(!n.showOptionNames()))}),E(13,9),V(14,"sh-icon"),v(),s(),P(),s()}}function Ie(t,i){if(t&1&&(l(0,"sh-menu",16)(1,"button",13),E(2,7),V(3,"sh-icon"),v(),s(),B(4,17),G(5,we,4,1,null,null,R),P(),s(),F(7,Le,15,0,"sh-menu")),t&2){let e=r();p("searchable",!0),_(5),k(e.nonSelectedOptionsGrouped()),_(2),h(e.hasFreeTextSettings()?7:-1)}}function Ve(t,i){if(t&1){let e=f();l(0,"textarea",23),C("ngModelChange",function(n){d(e);let a=r();return u(a.updateSettingsFromText(n))}),s()}if(t&2){let e=r();p("ngModel",e.settingsAsText())("ngModelOptions",W(2,Fe))}}function Ne(t,i){t&1&&(l(0,"div",24),m(1,"Add a setting above to get started."),s())}function be(t,i){t&1&&(l(0,"sh-icon",32),m(1," warning-octagon "),s())}function Me(t,i){if(t&1&&(l(0,"span",33),m(1),s()),t&2){let e=r(2).$implicit;_(),N("--",e.FormView.name)}}function Pe(t,i){if(t&1&&m(0),t&2){let e=r(2).$implicit;N(" ",e.FormView.shortDescription," ")}}function Ee(t,i){if(t&1&&(l(0,"sh-icon",34),m(1,"archive"),s()),t&2){let e=r(2).$implicit;p("shTooltip",e.FormView.deprecatedDescription)}}function ve(t,i){if(t&1&&(l(0,"sh-icon",35),m(1,"question"),s()),t&2){let e=r(2).$implicit;p("shTooltip",e.FormView.longDescription)}}function $e(t,i){if(t&1&&(F(0,be,2,0,"sh-icon",32),l(1,"span"),F(2,Me,2,1,"span",33)(3,Pe,1,1),s(),F(4,Ee,2,1,"sh-icon",34)(5,ve,2,1,"sh-icon",35)),t&2){let e=r().$implicit,o=O(1),n=r(2);h(o?0:-1),_(),z("deprecated",e.FormView.deprecatedDescription),_(),h(n.showOptionNames()?2:3),_(2),h(e.FormView.deprecatedDescription?4:e.FormView.longDescription?5:-1)}}function Ae(t,i){t&1&&T(0)}function De(t,i){if(t&1){let e=f();l(0,"div",26)(1,"label"),S(2,Ae,1,0,"ng-container",36),s(),l(3,"div")(4,"sh-form-field")(5,"input",37),C("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return u(c.updateFreeTextSettingName(a,n))}),s(),l(6,"sh-icon",38),m(7,"rectangle-dashed"),s()()(),l(8,"div")(9,"sh-form-field")(10,"input",37),C("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return u(c.updateSettingValue(a,n))}),s(),l(11,"sh-icon",38),m(12,"textbox"),s()()()()}if(t&2){let e=r().$implicit,o=g(3);_(2),p("ngTemplateOutlet",o),_(3),p("ngModel",e.Name),_(5),p("ngModel",e.Value())}}function Re(t,i){t&1&&T(0)}function Ge(t,i){if(t&1){let e=f();l(0,"app-file-tree",27)(1,"label",39),S(2,Re,1,0,"ng-container",36),s(),l(3,"input",40),C("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return u(c.updateSettingValue(a,n))}),s()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);p("startingPath",e.Value())("accepts",e.FormView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0)("hideShortcuts",!1)("resolvePaths",!0),_(),p("for",n),_(),p("ngTemplateOutlet",o),_(),p("id",n)("ngModel",e.Value())}}function ke(t,i){if(t&1){let e=f();l(0,"app-file-tree",28),V(1,"label",39),l(2,"input",40),C("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return u(c.updateSettingValue(a,n))}),s()()}if(t&2){let e=r().$implicit,o=O(0);p("startingPath",e.Value())("hideShortcuts",!1)("resolvePaths",!0),_(),p("for",o),_(),p("id",o)("ngModel",e.Value())}}function Be(t,i){t&1&&T(0)}function ze(t,i){t&1&&T(0)}function Ue(t,i){t&1&&(l(0,"sh-icon",38),m(1,"link"),s())}function Ke(t,i){t&1&&(l(0,"sh-icon",38),m(1,"hard-drives"),s())}function He(t,i){t&1&&(l(0,"sh-icon",38),m(1,"jar"),s())}function Je(t,i){t&1&&(l(0,"sh-icon",38),m(1,"envelope"),s())}function Xe(t,i){t&1&&(l(0,"sh-icon",38),m(1,"textbox"),s())}function je(t,i){if(t&1){let e=f();l(0,"sh-form-field")(1,"label",39),S(2,Be,1,0,"ng-container",36)(3,ze,1,0,"ng-container",41),s(),l(4,"input",42),C("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return u(c.updateSettingValue(a,n))}),s(),F(5,Ue,2,0,"sh-icon",38)(6,Ke,2,0,"sh-icon",38)(7,He,2,0,"sh-icon",38)(8,Je,2,0,"sh-icon",38)(9,Xe,2,0,"sh-icon",38),s()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);_(),p("for",n),_(),p("ngTemplateOutlet",o),_(),p("ngTemplateOutlet",a)("ngTemplateOutletContext",x(10,L,x(8,w,e.FormView))),_(),p("type",e.FormView.type==="Email"?"email":"text")("id",n)("ngModel",e.Value()),_(),h(e.FormView.type==="Path"?5:e.FormView.type==="Hostname"?6:e.FormView.type==="Bucketname"?7:e.FormView.type==="Email"?8:9)}}function qe(t,i){t&1&&T(0)}function Qe(t,i){t&1&&T(0)}function We(t,i){if(t&1){let e=f();l(0,"sh-icon",45),C("click",function(){d(e);let n=r(2).$implicit;return u(n.showPassword=!n.showPassword)}),m(1," eye "),s()}}function Ye(t,i){if(t&1){let e=f();l(0,"sh-icon",45),C("click",function(){d(e);let n=r(2).$implicit;return u(n.showPassword=!n.showPassword)}),m(1," eye-slash "),s()}}function Ze(t,i){if(t&1){let e=f();l(0,"sh-form-field")(1,"label",39),S(2,qe,1,0,"ng-container",36)(3,Qe,1,0,"ng-container",41),s(),l(4,"input",43),C("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return u(c.updateSettingValue(a,n))}),s(),l(5,"sh-icon",38),m(6,"password"),s(),F(7,We,2,0,"sh-icon",44)(8,Ye,2,0,"sh-icon",44),s()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);_(),p("for",n),_(),p("ngTemplateOutlet",o),_(),p("ngTemplateOutlet",a)("ngTemplateOutletContext",x(10,L,x(8,w,e.FormView))),_(),p("type",e.showPassword?"text":"password")("id",n)("ngModel",e.Value()),_(3),h(e.showPassword?7:8)}}function et(t,i){t&1&&T(0)}function tt(t,i){t&1&&T(0)}function nt(t,i){if(t&1&&m(0),t&2){let e=i.$implicit;N(" ",e," ")}}function it(t,i){if(t&1){let e=f();l(0,"sh-select",46)(1,"label",39),S(2,et,1,0,"ng-container",36)(3,tt,1,0,"ng-container",41),s(),l(4,"input",40),C("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return u(c.updateSettingValue(a,n))}),s()(),S(5,nt,1,1,"ng-template",null,3,A)}if(t&2){let e=g(6),o=r().$implicit,n=g(3),a=O(0);r(2);let c=g(10);p("options",o.FormView.options)("isClearable",!1)("optionTemplate",e),_(),p("for",a),_(),p("ngTemplateOutlet",n),_(),p("ngTemplateOutlet",c)("ngTemplateOutletContext",x(11,L,x(9,w,o.FormView))),_(),p("id",a)("ngModel",o.Value())}}function ot(t,i){t&1&&T(0)}function at(t,i){t&1&&T(0)}function rt(t,i){if(t&1){let e=f();l(0,"app-size",47),C("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return u(c.updateSettingValue(a,n))}),l(1,"label",39),S(2,ot,1,0,"ng-container",36)(3,at,1,0,"ng-container",41),s()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);p("inputType",e.Name)("ngModel",e.Value())("customId",n),_(),p("for",n),_(),p("ngTemplateOutlet",o),_(),p("ngTemplateOutlet",a)("ngTemplateOutletContext",x(9,L,x(7,w,e.FormView)))}}function lt(t,i){t&1&&T(0)}function _t(t,i){t&1&&T(0)}function st(t,i){if(t&1){let e=f();l(0,"sh-form-field")(1,"label",39),S(2,lt,1,0,"ng-container",36)(3,_t,1,0,"ng-container",41),s(),l(4,"input",48),C("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return u(c.updateSettingValue(a,n))}),s(),l(5,"sh-icon",38),m(6,"numpad"),s()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);_(),p("for",n),_(),p("ngTemplateOutlet",o),_(),p("ngTemplateOutlet",a)("ngTemplateOutletContext",x(8,L,x(6,w,e.FormView))),_(),p("id",n)("ngModel",e.Value())}}function pt(t,i){t&1&&T(0)}function ct(t,i){t&1&&T(0)}function mt(t,i){if(t&1){let e=f();l(0,"sh-toggle",30)(1,"label",39),S(2,pt,1,0,"ng-container",36)(3,ct,1,0,"ng-container",41),s(),l(4,"input",49),C("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return u(c.updateSettingValue(a,n))}),s()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);_(),p("for",n),_(),p("ngTemplateOutlet",o),_(),p("ngTemplateOutlet",a)("ngTemplateOutletContext",x(8,L,x(6,w,e.FormView))),_(),p("id",n)("ngModel",e.Value())}}function dt(t,i){t&1&&T(0)}function ut(t,i){t&1&&T(0)}function Ct(t,i){if(t&1&&m(0),t&2){let e=i.$implicit;N(" ",e," ")}}function gt(t,i){if(t&1){let e=f();l(0,"sh-select",50)(1,"label",39),S(2,dt,1,0,"ng-container",36)(3,ut,1,0,"ng-container",41),s(),l(4,"input",51),C("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return u(c.updateSettingValue(a,n))}),s()(),S(5,Ct,1,1,"ng-template",null,4,A)}if(t&2){let e=g(6),o=r().$implicit,n=g(3),a=O(0);r(2);let c=g(10);p("options",o.FormView.options)("selectMultiple",!0)("optionTemplate",e),_(),p("for",a),_(),p("ngTemplateOutlet",n),_(),p("ngTemplateOutlet",c)("ngTemplateOutletContext",x(10,L,x(8,w,o.FormView))),_(),p("ngModel",o.Value())}}function Tt(t,i){t&1&&T(0)}function ft(t,i){t&1&&T(0)}function xt(t,i){if(t&1){let e=f();l(0,"app-timespan",47),C("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return u(c.updateSettingValue(a,n))}),l(1,"label",39),S(2,Tt,1,0,"ng-container",36)(3,ft,1,0,"ng-container",41),s()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);p("inputType",e.Name)("ngModel",e.Value())("customId",n),_(),p("for",n),_(),p("ngTemplateOutlet",o),_(),p("ngTemplateOutlet",a)("ngTemplateOutletContext",x(9,L,x(7,w,e.FormView)))}}function St(t,i){if(t&1){let e=f();U(0)(1),S(2,$e,6,5,"ng-template",null,2,A),l(4,"div",25),F(5,De,13,3,"div",26)(6,Ge,4,11,"app-file-tree",27)(7,ke,3,6,"app-file-tree",28)(8,je,10,12,"sh-form-field")(9,Ze,9,12,"sh-form-field")(10,it,7,13)(11,rt,4,11,"app-size",29)(12,st,7,10,"sh-form-field")(13,mt,5,10,"sh-toggle",30)(14,gt,7,12)(15,xt,4,11,"app-timespan",29),l(16,"button",31),C("click",function(){let n=d(e).$implicit,a=r(2);return u(a.removeSetting(n))}),l(17,"sh-icon"),m(18,"x-bold"),s()()()}if(t&2){let e=i.$implicit,o=i.$index,n=r(2);$("destination-"+e.Name+o),_(),$(n.inAppOptions(e.Name)),_(3),z("align-remove-start",e.FormView.type==="FolderTree"||e.FormView.type==="FileTree"||e.FormView.type==="Boolean"),_(),h(e.FormView.type==="FreeText"?5:e.FormView.type==="FileTree"?6:e.FormView.type==="FolderTree"?7:e.FormView.type==="String"||e.FormView.type==="Path"||e.FormView.type==="Decimal"||e.FormView.type==="Email"||e.FormView.type==="Hostname"||e.FormView.type==="Bucketname"?8:e.FormView.type==="Password"?9:e.FormView.type==="Enumeration"?10:e.FormView.type==="Size"?11:e.FormView.type==="Integer"?12:e.FormView.type==="Boolean"?13:e.FormView.type==="Flags"?14:e.FormView.type==="Timespan"||e.FormView.type==="DateTime"?15:-1)}}function Ot(t,i){if(t&1&&(F(0,Ne,2,0,"div",24),G(1,St,19,5,null,null,R)),t&2){let e=r();h(e.selectedSettings().length===0?0:-1),_(),k(e.selectedSettings())}}function Ft(t,i){if(t&1&&(l(0,"sh-icon",52),m(1,"x-circle"),s()),t&2){r();let e=O(0);p("shTooltip",(e==null?null:e.message)??"Invalid value")}}function ht(t,i){if(t&1&&(l(0,"sh-icon",34),m(1,"warning"),s()),t&2){r();let e=O(0);p("shTooltip",(e==null?null:e.message)??"Invalid value")}}function yt(t,i){if(t&1&&(U(0),F(1,Ft,2,1,"sh-icon",52)(2,ht,2,1,"sh-icon",34)),t&2){r();let e=O(0),o=r().$implicit,n=$(o.formView.validate(e));_(),h((n==null?null:n.type)==="error"?1:(n==null?null:n.type)==="warning"?2:-1)}}function wt(t,i){if(t&1&&(U(0),F(1,yt,3,2)),t&2){let e=r().$implicit,n=($(e.Value())??"").toString().trim()==="";_(),h(!n&&e.formView.validate?1:-1)}}function Lt(t,i){if(t&1&&F(0,wt,2,2),t&2){let e=i.$implicit;h(e.Value?0:-1)}}var Se=class t{#e=j(ue);options=Y.required();hiddenOptions=H([]);hasFreeTextSettings=H(!1);applicationOptions=H();showTextArea=M(!1);showOptionNames=M(!1);allOptionsGrouped=this.#e.allOptionsGrouped;allOptions=this.#e.allOptions;selectedSettings=K(()=>{let i=this.hiddenOptions();return this.options().map(n=>{let a=this.allOptions().find(y=>y.name===n.Name?.replace("--","")),c=n.Value??"";if(a&&i.includes(a.name))return null;if(a){if(a.type==="Boolean"&&(c=this.isTrue(c)),a.type==="Integer"&&(c=parseInt(c)||0),a.type==="Enumeration"&&a.options){let b=c?.trim().toLowerCase(),X=a.options.find(Oe=>(Oe??"").trim().toLocaleLowerCase()===b);X&&(c=X)}let y=xe.find(b=>b.name===a?.name);return y&&(a=I(I({},a),y)),D(I({},n),{Value:M(c),FormView:a})}else if(this.hasFreeTextSettings())return D(I({},n),{Value:M(c),FormView:{name:n.Name,type:"FreeText",shortDescription:"Custom settings argument",longDescription:"Custom settings argument"}});return null}).filter(n=>n!==null)});nonSelectedOptionsGrouped=K(()=>{let i=this.options().map(o=>o.Name?.replace("--","")),e=this.hiddenOptions();return this.allOptionsGrouped().map(o=>D(I({},o),{options:o.options.filter(n=>!i.includes(n.name)&&!e.includes(n.name))})).filter(o=>o.options.length>0)});settingsAsText=K(()=>this.selectedSettings().map(i=>{let e=i.Value(),o="";return typeof e=="boolean"?o=this.isTrue(e)?"True":"False":(typeof e=="number"||e!=null)&&(o=e.toString()),`${i.Name??""}=${o}`}).join(`
2
+ `));updateSettingsFromText(i){if(typeof i!="string")return;let e=Ce(i);this.options.update(()=>e)}isTrue(i){if(typeof i=="boolean")return i;if(typeof i=="string"){let e=i.toLowerCase();return e==="true"||e==="1"||e==="yes"||e==="on"}return!1}inAppOptions(i){let e=this.applicationOptions()?.findIndex(o=>o.Name?.replace("--","")===i);return e===void 0?!1:e>-1}addFreeTextSetting(){this.hasFreeTextSettings()&&this.options.update(i=>[...i,{Filter:null,Name:"",Value:""}])}addSetting(i){this.options.update(e=>{let o=i.defaultValue??"";return i.type==="Boolean"&&(o=this.isTrue(o)),i.type==="Integer"&&(o=parseInt(o)||0),[...e,{Name:i.name,Value:o}]})}updateSettingValue(i,e){this.options.update(o=>{let n=[...o],a=n.findIndex(c=>c.Name===i.Name);if(i.FormView.type==="Boolean")return n[a].Value=this.isTrue(e)?"True":"False",n;if(i.FormView.type==="Integer")return n[a].Value=e.toString(),n;if(i.FormView.type==="Enumeration"&&i.FormView.options){let c=e?.trim().toLowerCase()??"",y=i.FormView.options.find(b=>(b??"").trim().toLocaleLowerCase()===c);if(y)return n[a].Value=y,n}return n[a].Value=e,n})}updateFreeTextSettingName(i,e){this.options.update(o=>{let n=[...o],a=n.findIndex(c=>c.Name===i.Name);return n[a].Name=e,n})}removeSetting(i){this.options.update(e=>e.filter(o=>o.Name!==i.Name))}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=q({type:t,selectors:[["app-options-list"]],inputs:{options:[1,"options"],hiddenOptions:[1,"hiddenOptions"],hasFreeTextSettings:[1,"hasFreeTextSettings"],applicationOptions:[1,"applicationOptions"]},outputs:{options:"optionsChange"},decls:11,vars:4,consts:()=>{let i;i=$localize`Advanced options`;let e;e=$localize` Show editor ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let o;o=$localize` Add advanced option ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`;let n;n=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:pen${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: New custom option `;let a;a=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:wrench${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON: Toggle option names `;let c;return c=$localize`By adding this option it will override the matching global option`,[["validateTemplate",""],["option",""],["defaultLabel",""],["enumOptionTemplate",""],["optionTemplate",""],i,e,o,n,a,[3,"disableToggle","isActive"],["title",""],[1,"actions"],["shButton","","type","button",1,"outlined","small"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModel","ngModelOptions"],["shButton","","type","button",1,"outlined","small",3,"click"],[3,"searchable"],["menu",""],["type","button",3,"deprecated"],["type","button",3,"click"],[1,"option-col"],["shButton","","type","button",1,"small"],["shButton","","type","button",1,"small",3,"click"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModelChange","ngModel","ngModelOptions"],[1,"placeholder"],[1,"field-row"],[1,"form-column"],[3,"startingPath","accepts","showFiles","showHiddenNodes","selectFiles","hideShortcuts","resolvePaths"],[3,"startingPath","hideShortcuts","resolvePaths"],[3,"inputType","ngModel","customId"],[1,"primary","raised"],["shButton","","type","button",1,"outlined","small","remove-btn",3,"click"],["shTooltip",c,1,"error"],[1,"optionname"],[1,"warn",3,"shTooltip"],[1,"primary",3,"shTooltip"],[4,"ngTemplateOutlet"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],[3,"for"],["type","text",3,"ngModelChange","id","ngModel"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"ngModelChange","type","id","ngModel"],["autocomplete","new-password",3,"ngModelChange","type","id","ngModel"],["suffix","",1,"clickable"],["suffix","",1,"clickable",3,"click"],[3,"options","isClearable","optionTemplate"],[3,"ngModelChange","inputType","ngModel","customId"],["type","number",3,"ngModelChange","id","ngModel"],["type","checkbox",3,"ngModelChange","id","ngModel"],[1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["type","text","id","text",3,"ngModelChange","ngModel"],[1,"error",3,"shTooltip"]]},template:function(e,o){e&1&&(l(0,"sh-toggle-card",10),B(1,11)(2),Q(3,5),P(),l(4,"div",12),F(5,he,3,0,"button",13)(6,Ie,8,2),s(),P(),F(7,Ve,1,3,"textarea",14)(8,Ot,3,1),s(),S(9,Lt,1,1,"ng-template",null,0,A)),e&2&&(p("disableToggle",!0)("isActive",!0),_(5),h(o.showTextArea()?5:6),_(2),h(o.showTextArea()?7:8))},dependencies:[ae,te,oe,ee,ne,ie,ge,Te,fe,Z,ce,_e,le,se,de,re,pe,me],styles:["[_nghost-%COMP%]{display:block}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}sh-toggle[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1rem}.placeholder[_ngcontent-%COMP%]{color:var(--base-9);text-align:center;padding:2rem 1rem}.field-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;position:relative;z-index:1;max-width:32.5rem;width:100%}.field-row[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{align-self:flex-end}.field-row[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:first-child{max-width:28rem;width:100%}.field-row.align-remove-start[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{align-self:flex-start}.option-col[_ngcontent-%COMP%]{display:flex;flex-direction:column}.option-col[_ngcontent-%COMP%] .fill[_ngcontent-%COMP%]{color:var(--base-12)}.form-column[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-direction:column}label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}sh-icon[_ngcontent-%COMP%]{font-size:1rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:flex-end}.deprecated[_ngcontent-%COMP%]{text-decoration:line-through}.optionname[_ngcontent-%COMP%]{font-family:monospace}.raw-text-area[_ngcontent-%COMP%]{min-height:12rem;white-space:pre}"],changeDetection:0})};export{Se as a};