@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
package/chunk-O2L2FRYE.js DELETED
@@ -1,11 +0,0 @@
1
- import{a as $n,b as Ht,c as vn}from"./chunk-PNQ5BDQN.js";import{a as Ye,b as wt,c as Gt,d as Gn}from"./chunk-2EX5HS5X.js";import{a as On,b as Mn,c as Pe,d as Lt,e as xn,f as Rn,g as bt,i as Ln,j as bn,k as wn}from"./chunk-EVEI25GQ.js";import{b as Pn}from"./chunk-KZYRTI62.js";import{a as Rt}from"./chunk-TSVSMVY4.js";import{a as Wt,b as Ue,c as In}from"./chunk-2KD757N6.js";import{a as ne}from"./chunk-PEOYNJJM.js";import{a as ge}from"./chunk-NUV5LHQV.js";import{B as Y,C as Dn,E as At,F as yn,H as ue,K as Qe,L as It,O as Pt,P as $e,V as Ot,W as ve,Y as Mt,a as fn,b as En,c as ee,d as St,e as te,f as ft,h as hn,i as re,j as Et,k as ht,n as Fn,o as Nn,p as Ft,q as Nt,r as Dt,s as se,t as qe,v as Q,w as yt,z as Ge}from"./chunk-CJKZ27FM.js";import{c as An,d as xt}from"./chunk-KNSQLQC6.js";import{b as je,d as we,e as Sn}from"./chunk-CQJRBQ6I.js";import{aa as Tn}from"./chunk-YF6JHIN5.js";import{$ as O,$c as be,Ac as Cn,B as cn,Bb as fe,Bc as Ae,Cb as Ee,Cc as le,Db as u,Dc as me,Eb as l,Ec as Tt,F as dn,Fb as r,G as Be,Gb as P,Kb as pe,Kc as Je,Lb as ce,M as dt,Mb as ae,Nb as I,O as un,P as pn,Q as ut,Qa as pt,R as mn,Rc as R,Ta as c,Ub as M,Vb as x,W as Ne,Wb as y,Wc as Le,Xc as G,Ya as mt,Yc as Ie,Zb as Ke,_b as T,a as rn,ac as s,bc as He,cc as he,ea as S,f as ct,fa as f,hb as z,hc as De,ia as We,ic as ye,jc as Z,kc as Ct,l as Ve,lc as Fe,mb as H,oc as p,pb as gn,pc as zt,q as ot,qa as h,qc as V,rc as at,sa as q,tc as U,uc as $,vc as k,w as sn,wb as gt,wc as de,xb as g,xc as j,y as _n,yb as C,yc as E,zb as Se}from"./chunk-K5XGRFWJ.js";import{a as W,b as oe}from"./chunk-7CGTOI24.js";var $t=class i{fromString(t){if(!t)return null;let e=t.match(/(\d+)([smhDWMY])/);return e&&{value:parseInt(e[1]),unit:e[2]}}toString(t,e){return`${t}${e}`}static \u0275fac=function(e){return new(e||i)};static \u0275prov=Ne({token:i,factory:i.\u0275fac,providedIn:"root"})};function lt(i){if(gn(i))return i();if(Array.isArray(i))return i.map(t=>lt(t));if(typeof i=="object"&&i!==null){let t={};for(let e in i)i.hasOwnProperty(e)&&(t[e]=lt(i[e]));return t}return i}var Jn=i=>i;function Un(i,t){let e=pn(i,Jn,t?.equal),n=e[rn],o=e;return o.set=a=>{let _=e();return ut(n,a),()=>{ut(n,_)}},o.update=a=>{let _=e();return mn(n,a),()=>{ut(n,_)}},e}var Ze=class i{#e=O(An);isSaving=h(!1);resourceDestinations=In({stream:()=>this.#e.getApiV2ConnectionStrings()});destinations=Un(()=>{let t=this.resourceDestinations.value()?.Data;return t||[]});save(t,e){return this.isSaving.set(!0),e.Description="",(t==="new"?this.#e.postApiV2ConnectionStrings({requestBody:e}):this.#e.putApiV2ConnectionStringById({id:t.ID,requestBody:e})).pipe(Be(()=>{this.isSaving.set(!1)}))}getById(t){return this.#e.getApiV2ConnectionStringById({id:t})}delete(t){return this.#e.deleteApiV2ConnectionStringById({id:t})}reload(){this.resourceDestinations.reload()}updateBackups(t,e){return this.#e.postApiV2ConnectionStringByIdUpdateBackups({id:t,requestBody:{BackupIDs:e}})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=Ne({token:i,factory:i.\u0275fac,providedIn:"root"})};function Xn(i,t){if(i&1){let e=I();l(0,"div",26)(1,"sh-form-field")(2,"label",27),y(3,7),r(),l(4,"input",28,0),k("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.nextTime.time,o)||(a.scheduleFields.nextTime.time=o),f(o)}),r(),l(6,"sh-icon",29),p(7,"clock"),r()(),l(8,"sh-datepicker-input",30)(9,"label",31),p(10,"\xA0"),r(),l(11,"input",32,1),k("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.nextTime.date,o)||(a.scheduleFields.nextTime.date=o),f(o)}),r(),l(13,"sh-icon",29),p(14,"calendar"),r()()(),l(15,"div",26)(16,"sh-form-field")(17,"label",33),y(18,8),r(),l(19,"input",34),k("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.repeatValue,o)||(a.scheduleFields.runAgain.repeatValue=o),f(o)}),r()(),l(20,"sh-select",35)(21,"input",36),k("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.repeatUnit,o)||(a.scheduleFields.runAgain.repeatUnit=o),f(o)}),r()()(),l(22,"sh-toggle-card",37),pe(23,38),y(24,9),ce(),l(25,"div",39)(26,"sh-toggle",24),M(27,10),l(28,"input",25),k("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.allowedDays.mon,o)||(a.scheduleFields.runAgain.allowedDays.mon=o),f(o)}),r(),x(),r(),l(29,"sh-toggle",24),M(30,11),l(31,"input",25),k("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.allowedDays.tue,o)||(a.scheduleFields.runAgain.allowedDays.tue=o),f(o)}),r(),x(),r(),l(32,"sh-toggle",24),M(33,12),l(34,"input",25),k("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.allowedDays.wed,o)||(a.scheduleFields.runAgain.allowedDays.wed=o),f(o)}),r(),x(),r(),l(35,"sh-toggle",24),M(36,13),l(37,"input",25),k("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.allowedDays.thu,o)||(a.scheduleFields.runAgain.allowedDays.thu=o),f(o)}),r(),x(),r(),l(38,"sh-toggle",24),M(39,14),l(40,"input",25),k("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.allowedDays.fri,o)||(a.scheduleFields.runAgain.allowedDays.fri=o),f(o)}),r(),x(),r(),l(41,"sh-toggle",24),M(42,15),l(43,"input",25),k("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.allowedDays.sat,o)||(a.scheduleFields.runAgain.allowedDays.sat=o),f(o)}),r(),x(),r(),l(44,"sh-toggle",24),M(45,16),l(46,"input",25),k("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.allowedDays.sun,o)||(a.scheduleFields.runAgain.allowedDays.sun=o),f(o)}),r(),x(),r()()()}if(i&2){let e=s(2);c(4),U("ngModel",e.scheduleFields.nextTime.time),c(7),U("ngModel",e.scheduleFields.nextTime.date),c(8),U("ngModel",e.scheduleFields.runAgain.repeatValue),c(),u("options",e.unitOptions)("isClearable",!1),c(),U("ngModel",e.scheduleFields.runAgain.repeatUnit),c(),u("disableToggle",!0),c(6),U("ngModel",e.scheduleFields.runAgain.allowedDays.mon),c(3),U("ngModel",e.scheduleFields.runAgain.allowedDays.tue),c(3),U("ngModel",e.scheduleFields.runAgain.allowedDays.wed),c(3),U("ngModel",e.scheduleFields.runAgain.allowedDays.thu),c(3),U("ngModel",e.scheduleFields.runAgain.allowedDays.fri),c(3),U("ngModel",e.scheduleFields.runAgain.allowedDays.sat),c(3),U("ngModel",e.scheduleFields.runAgain.allowedDays.sun)}}function zn(i,t){if(i&1){let e=I();l(0,"div",23)(1,"sh-toggle",24),M(2,5),l(3,"input",25),k("ngModelChange",function(o){S(e);let a=s();return $(a.scheduleFields.autoRun,o)||(a.scheduleFields.autoRun=o),f(o)}),r(),x(),r(),l(4,"p"),y(5,6),r()(),g(6,Xn,47,14)}if(i&2){let e=s();c(3),U("ngModel",e.scheduleFields.autoRun),c(3),C(e.scheduleFields.autoRun()?6:-1)}}var Wn=[{key:"s",label:$localize`Seconds`},{key:"m",label:$localize`Minutes`},{key:"h",label:$localize`Hours`},{key:"D",label:$localize`Days`},{key:"W",label:$localize`Weeks`},{key:"M",label:$localize`Months`},{key:"Y",label:$localize`Years`}],vt=[{key:$localize`Daily 13:00`,value:"daily",data:{autoRun:!0,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!0,sun:!0}}}},{key:$localize`Weekdays 13:00`,value:"weekdays",data:{autoRun:!0,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!1,sun:!1}}}},{key:$localize`Weekly monday 13:00`,value:"weekly",data:{autoRun:!0,nextTime:{time:"13:00:00",date:Hn().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"W",allowedDays:{mon:!0,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}}},{key:$localize`Don't run automatically`,value:"disabled",data:{autoRun:!1,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!0,sun:!0}}}},{key:$localize`Custom`,value:"custom",data:{autoRun:!0,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!0,sun:!0}}}}];function kn(i){if(!i.autoRun)return null;let t=[i.runAgain.allowedDays.mon?"Monday":null,i.runAgain.allowedDays.tue?"Tuesday":null,i.runAgain.allowedDays.wed?"Wednesday":null,i.runAgain.allowedDays.thu?"Thursday":null,i.runAgain.allowedDays.fri?"Friday":null,i.runAgain.allowedDays.sat?"Saturday":null,i.runAgain.allowedDays.sun?"Sunday":null].filter(_=>_!==null),e=i.nextTime.time.split(":"),n=new Date(i.nextTime.date);n.setHours(parseInt(e[0])),n.setMinutes(parseInt(e[1]));let o=i.runAgain.repeatValue,a=i.runAgain.repeatUnit;return{Time:n.toISOString(),Repeat:`${o}${a}`,AllowedDays:t}}function Hn(){let i=new Date,t=i.getDay(),e=t===1?7:(8-t)%7;return i.setDate(i.getDate()+e),i.setHours(12,0,0,0),i}var qt=()=>({autoRun:h(!0),nextTime:{time:h("13:00"),date:h(new Date().toISOString().split("T")[0])},runAgain:{repeatValue:h(1),repeatUnit:h("D"),allowedDays:{mon:h(!0),tue:h(!0),wed:h(!0),thu:h(!0),fri:h(!0),sat:h(!0),sun:h(!0)}}}),jt=class i{#e=O(Oe);#t=O(we);#n=O(je);unitOptions=Wn;scheduleFields=this.#e.scheduleFields;scheduleType=this.#e.scheduleType;scheduleOptions=vt;updateScheduleType(t){let e=vt.find(n=>n.value===t);if(e&&e?.value!=="custom"){this.scheduleType.set(e.value);let n=e.data;this.scheduleFields.autoRun.set(n.autoRun??!1),this.scheduleFields.nextTime.time.set(n.nextTime?.time??"13:00"),this.scheduleFields.nextTime.date.set(n.nextTime?.date??new Date().toISOString().split("T")[0]),this.scheduleFields.runAgain.repeatValue.set(n.runAgain?.repeatValue??1),this.scheduleFields.runAgain.repeatUnit.set(n.runAgain?.repeatUnit??"D"),this.scheduleFields.runAgain.allowedDays.mon.set(n.runAgain?.allowedDays?.mon??!0),this.scheduleFields.runAgain.allowedDays.tue.set(n.runAgain?.allowedDays?.tue??!0),this.scheduleFields.runAgain.allowedDays.wed.set(n.runAgain?.allowedDays?.wed??!0),this.scheduleFields.runAgain.allowedDays.thu.set(n.runAgain?.allowedDays?.thu??!0),this.scheduleFields.runAgain.allowedDays.fri.set(n.runAgain?.allowedDays?.fri??!0),this.scheduleFields.runAgain.allowedDays.sat.set(n.runAgain?.allowedDays?.sat??!0),this.scheduleFields.runAgain.allowedDays.sun.set(n.runAgain?.allowedDays?.sun??!0)}else this.scheduleType.set("custom")}goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#n.parent})}next(){this.#e.shouldAutoSave()&&this.#e.submit(!0),this.#t.navigate(["options"],{relativeTo:this.#n.parent})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=z({type:i,selectors:[["app-schedule"]],decls:12,vars:4,consts:()=>{let t;t=$localize`Select an option...`;let e;e=$localize`Schedule`;let n;n=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let a;a=$localize` Automatically run backups ${"\uFFFD#3\uFFFD\uFFFD/#3\uFFFD"}:TAG_INPUT:`;let _;_=$localize`If a date was missed, the job will run as soon as possible.`;let d;d=$localize`Next time`;let m;m=$localize`Run again every`;let N;N=$localize`Allowed days`;let F;F=$localize` Monday ${"\uFFFD#28\uFFFD\uFFFD/#28\uFFFD"}:TAG_INPUT:`;let A;A=$localize` Tuesday ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let L;L=$localize` Wednesday ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let v;v=$localize` Thursday ${"\uFFFD#37\uFFFD\uFFFD/#37\uFFFD"}:TAG_INPUT:`;let D;D=$localize` Friday ${"\uFFFD#40\uFFFD\uFFFD/#40\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Saturday ${"\uFFFD#43\uFFFD\uFFFD/#43\uFFFD"}:TAG_INPUT:`;let J;return J=$localize` Sunday ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],e,n,o,a,_,d,m,N,F,A,L,v,D,K,J,[1,"title-30"],["label","key","value","value",3,"isClearable","options"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"row-inputs"],["for","time"],["type","time","id","time",3,"ngModelChange","ngModel"],["suffix",""],[1,"primary","sharp"],["for","date"],["type","text","id","date",3,"ngModelChange","ngModel"],["for","repeatValue"],["type","number","id","repeatValue",3,"ngModelChange","ngModel"],["value","key","label","label",3,"options","isClearable"],["type","text","id","repeatUnit",3,"ngModelChange","ngModel"],[3,"disableToggle"],["title",""],[1,"days-wrap"]]},template:function(e,n){e&1&&(l(0,"h3",17),y(1,2),r(),l(2,"sh-select",18)(3,"input",19),T("ngModelChange",function(a){return n.updateScheduleType(a)}),r()(),g(4,zn,7,2),l(5,"div",20)(6,"button",21),T("click",function(){return n.goBack()}),M(7,3),P(8,"sh-icon"),x(),r(),l(9,"button",22),T("click",function(){return n.next()}),M(10,4),P(11,"sh-icon"),x(),r()()),e&2&&(c(2),u("isClearable",!1)("options",n.scheduleOptions),c(),u("ngModel",n.scheduleType()),c(),C(n.scheduleType()==="custom"?4:-1))},dependencies:[se,ee,ht,En,te,re,ue,ve,Q,Y,$e,Ot,yn],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 1.5rem;display:flex;flex-direction:column;gap:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var jn=[[["","title",""]],[["","description",""]],[["","action",""]],"*"],qn=["[title]","[description]","[action]","*"];function Qn(i,t){i&1&&p(0,"Title")}function Yn(i,t){i&1&&(l(0,"sh-icon"),p(1,"caret-down"),r())}var Xe=class i{isActive=be(!1);disableToggle=G(!1);ngOnInit(){this.disableToggle()&&this.isActive.set(!0)}toggle(){this.isActive.set(!this.isActive())}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=z({type:i,selectors:[["app-toggle-card"]],hostVars:2,hostBindings:function(e,n){e&2&&Fe("active",n.isActive())},inputs:{isActive:[1,"isActive"],disableToggle:[1,"disableToggle"]},outputs:{isActive:"isActiveChange"},ngContentSelectors:qn,decls:11,vars:1,consts:[[1,"title"],[3,"click"],[1,"actions"],[1,"content"]],template:function(e,n){e&1&&(He(jn),l(0,"header")(1,"div",0)(2,"h3",1),T("click",function(){return n.disableToggle()||n.toggle()}),he(3,0,null,Qn,1,0),g(5,Yn,2,0,"sh-icon"),r(),he(6,1),r(),l(7,"div",2),he(8,2),r()(),l(9,"div",3),he(10,3),r()),e&2&&(c(5),C(n.disableToggle()?-1:5))},dependencies:[Q],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;border-radius:var(--shape-3);background-color:var(--base-2)}.active[_nghost-%COMP%] .content[_ngcontent-%COMP%]{max-height:1000px;transition:max-height 1s linear;padding:0 1rem 1rem}.active[_nghost-%COMP%] sh-icon[_ngcontent-%COMP%]{transform:rotate(180deg)}[_nghost-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.25rem;font:var(--paragraph-10);cursor:pointer;-webkit-user-select:none;user-select:none}[_nghost-%COMP%] sh-icon[_ngcontent-%COMP%]{transform:rotate(0);transform-origin:center;transition:transform .2s ease}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem}header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;flex:1 0}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]:empty{display:none}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0 1rem;overflow:hidden;max-height:0;transition:max-height .25s linear,padding .25s linear}.content[_ngcontent-%COMP%]:empty{display:none}"],changeDetection:0})};var Zn=["textInput"];function ei(i,t){if(i&1){let e=I();l(0,"sh-select",3)(1,"input",7),k("ngModelChange",function(o){S(e);let a=s();return $(a.internalPath,o)||(a.internalPath=o),f(o)}),T("ngModelChange",function(){S(e);let o=s();return f(o.updateFilter())}),r()()}if(i&2){let e=s();u("options",e.fileGroupOptions())("isClearable",!1)("selectMultiple",!0),c(),U("ngModel",e.internalPath)}}function ti(i,t){if(i&1&&(l(0,"div",8),p(1),r()),i&2){let e,n=s(2);c(),zt((e=n.currentExpressionOption())==null?null:e.startsWith)}}function ni(i,t){if(i&1&&(l(0,"div",9),p(1),r()),i&2){let e,n=s(2);c(),zt((e=n.currentExpressionOption())==null?null:e.endsWith)}}function ii(i,t){if(i&1){let e=I();l(0,"sh-form-field",4)(1,"input",7,0),k("ngModelChange",function(o){S(e);let a=s();return $(a.internalPath,o)||(a.internalPath=o),f(o)}),T("ngModelChange",function(){S(e);let o=s();return f(o.updateFilter())}),r(),g(3,ti,2,1,"div",8),g(4,ni,2,1,"div",9),r()}if(i&2){let e,n,o=s();c(),U("ngModel",o.internalPath),c(2),C(!((e=o.currentExpressionOption())==null||e.startsWith==null)&&e.startsWith.length?3:-1),c(),C(!((n=o.currentExpressionOption())==null||n.endsWith==null)&&n.endsWith.length?4:-1)}}var oi=[{key:"Applications",value:"Applications"},{key:"CacheFiles",value:"Cache Files"},{key:"TemporaryFiles",value:"Temporary Files"},{key:"OperatingSystem",value:"Operating System"},{key:"SystemFiles",value:"System Files"},{key:"DefaultExcludes",value:"Standard Excludes"}],ai=[{key:"Excludes folders where name contains",value:"-FolderName"},{key:"Includes folders where name contains",value:"+FolderName"},{key:"Excludes folder",value:"-Folder"},{key:"Includes folder",value:"+Folder"},{key:"Excludes files where name contains",value:"-FileName"},{key:"Includes files where name contains",value:"+FileName"},{key:"Excludes file extension",value:"-Extension"},{key:"Include file extension",value:"+Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Exclude file groups",value:"-FileGroup"},{key:"Include file groups",value:"+FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"},{key:"None",value:"-Unknown"}],Ut=class i{#e=O(We);path=G.required();osType=G();isNew=G(!1);pathChange=Le();remove=Le();internalPath=h("");pathType=h("-Expression");textInput=Ie("textInput");currentExpressionOption=R(()=>{let t=this.pathType();return this.expressionOptions().find(e=>e.value===t)});fileGroupOptions=h(oi);expressionOptions=R(()=>{let e=this.osType()==="Windows"?"\\":"/";return ai.map(n=>n.value==="-Folder"||n.value==="+Folder"?oe(W({},n),{startsWith:"",endsWith:""}):n.value==="-FolderName"||n.value==="+FolderName"?oe(W({},n),{startsWith:"*",endsWith:`*${e}`}):n.value==="-FileName"||n.value==="+FileName"?oe(W({},n),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):n.value==="-FileGroup"||n.value==="+FileGroup"?oe(W({},n),{startsWith:"{",endsWith:"}"}):n.value==="-Regex"||n.value==="+Regex"?oe(W({},n),{startsWith:"[",endsWith:"]"}):n.value==="-Extension"||n.value==="+Extension"?oe(W({},n),{startsWith:"*.",endsWith:""}):oe(W({},n),{startsWith:"",endsWith:""}))});pathEffect=q(()=>{let t=this.path(),e=t.slice(1),n=t.startsWith("-")?"-":"+",o=this.osType()==="Windows",a=o?"\\":"/";e.startsWith("%")&&e.endsWith(a)||o&&e.slice(2).startsWith(a)&&e.endsWith(a)||e.startsWith(a)&&e.endsWith(a)?(this.pathType.set(`${n}Folder`),this.internalPath.set(e)):e.startsWith("*")&&e.endsWith(`*${a}`)?(this.pathType.set(`${n}FolderName`),this.internalPath.set(e.slice(1,-2))):e.startsWith("[.*")&&e.endsWith(`[^\\${a}]*]`)?(this.pathType.set(`${n}FileName`),this.internalPath.set(e.slice(3,-7))):e.startsWith("{")&&e.endsWith("}")?(this.pathType.set(`${n}FileGroup`),this.internalPath.set(e.slice(1,-1))):e.startsWith("[")&&e.endsWith("]")?(this.pathType.set(`${n}Regex`),this.internalPath.set(e.slice(1,-1))):e.startsWith("*.")?(this.pathType.set(`${n}Extension`),this.internalPath.set(e.slice(2))):(this.pathType.set(`${n}Expression`),this.internalPath.set(e)),this.isNew()&&mt(()=>{this.focusInput()},{injector:this.#e})});focusInput(){let t=this.textInput()?.nativeElement;t&&(t.focus(),t.select())}updateFilter(){let t=this.internalPath(),e=this.currentExpressionOption();t!==""&&(t==="*"&&(t=""),this.pathChange.emit(`${e?.value.slice(0,1)}${e?.startsWith??""}${t}${e?.endsWith??""}`))}removeFilter(){this.remove.emit()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=z({type:i,selectors:[["app-new-filter"]],viewQuery:function(e,n){e&1&&De(n.textInput,Zn,5),e&2&&ye()},inputs:{path:[1,"path"],osType:[1,"osType"],isNew:[1,"isNew"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:7,vars:4,consts:()=>{let t;return t=$localize`Select an option...`,[["textInput",""],["value","value","label","key",3,"options","isClearable"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],["value","key","label","value",1,"expression-input",3,"options","isClearable","selectMultiple"],[1,"expression-input"],[1,"filter-removal",3,"click"],[1,"sh-primary"],["type","text",3,"ngModelChange","ngModel"],["boxPrefix",""],["boxSuffix",""]]},template:function(e,n){if(e&1&&(l(0,"sh-select",1)(1,"input",2),k("ngModelChange",function(a){return $(n.pathType,a)||(n.pathType=a),a}),T("ngModelChange",function(){return n.updateFilter()}),r()(),g(2,ei,2,4,"sh-select",3)(3,ii,5,3,"sh-form-field",4),l(4,"div",5),T("click",function(){return n.removeFilter()}),l(5,"sh-icon",6),p(6,"x-circle"),r()()),e&2){let o;u("options",n.expressionOptions())("isClearable",!1),c(),U("ngModel",n.pathType),c(),C(((o=n.currentExpressionOption())==null?null:o.value)=="-FileGroup"||((o=n.currentExpressionOption())==null?null:o.value)=="+FileGroup"?2:3)}},dependencies:[se,ee,te,re,$e,ue,Q],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}.expression-input[_ngcontent-%COMP%]{--ff-suffix-bg: var(--base-2)}.filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var li=["filtersContainer"],ri=()=>({updateOn:"blur",standalone:!0});function si(i,t){if(i&1){let e=I();l(0,"button",15),T("click",function(){S(e);let o=s();return f(o.addFilter())}),M(1,3),P(2,"sh-icon"),x(),r()}}function _i(i,t){i&1&&y(0,2,1)}function ci(i,t){i&1&&y(0,2,2)}function di(i,t){i&1&&(l(0,"p",13),y(1,4),r())}function ui(i,t){i&1&&(l(0,"p",13),y(1,5),r())}function pi(i,t){if(i&1){let e=I();l(0,"sh-form-field")(1,"textarea",16),k("ngModelChange",function(o){S(e);let a=s();return $(a.bulkFilters,o)||(a.bulkFilters=o),f(o)}),T("ngModelChange",function(){S(e);let o=s();return f(o.saveBulkFilterEdit())}),r()()}if(i&2){let e=s();c(),U("ngModel",e.bulkFilters),u("ngModelOptions",Ae(2,ri))}}function mi(i,t){if(i&1){let e=I();l(0,"app-new-filter",18),T("pathChange",function(o){let a=S(e).$index,_=s(2);return f(_.updateFilterAt(o,a))})("remove",function(){let o=S(e).$index,a=s(2);return f(a.removeFilterAt(o))}),r()}if(i&2){let e=t.$implicit,n=t.$index,o=s(2);u("path",e)("osType",o.osType())("isNew",o.lastAddedIndex()===n)}}function gi(i,t){if(i&1&&(l(0,"div",14,0),fe(2,mi,1,3,"app-new-filter",17,Se),r()),i&2){let e=s();c(2),Ee(e.filters())}}var kt=class i{#e=O(We);filters=be.required();osType=G("");disableToggle=G(!0);bulkFilterEditMode=h(!1);bulkFilters=h("");lastAddedIndex=h(null);filtersContainer=Ie.required("filtersContainer");hasFilters=R(()=>this.filters().length>0);toggleBulkFilterEdit(){this.bulkFilterEditMode()?this.bulkFilterEditMode.set(!1):(this.bulkFilters.set(this.filters().join(`
2
- `)),this.bulkFilterEditMode.set(!0))}saveBulkFilterEdit(){let t=this.bulkFilters().split(`
3
- `).map(n=>n.trim()).filter(n=>n!==""&&(n.startsWith("-")||n.startsWith("+"))),e=[...new Set(t)];this.filters.set(e),this.bulkFilterEditMode.set(!1)}addFilter(){let t=this.filters(),e=t.length;this.filters.set([...t,"-*"]),this.lastAddedIndex.set(e),mt(()=>{this.scrollToFilter(e)},{injector:this.#e})}scrollToFilter(t){let e=this.filtersContainer()?.nativeElement;if(!e)return;let n=e.querySelectorAll("app-new-filter");n[t]&&n[t].scrollIntoView({behavior:"smooth",block:"nearest"})}updateFilterAt(t,e){let o=[...this.filters()];o[e]=t,this.filters.set(o),this.lastAddedIndex.set(null)}removeFilterAt(t){let n=this.filters().filter((o,a)=>a!==t);this.filters.set(n),this.lastAddedIndex.set(null)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=z({type:i,selectors:[["app-filters"]],viewQuery:function(e,n){e&1&&De(n.filtersContainer,li,5),e&2&&ye()},inputs:{filters:[1,"filters"],osType:[1,"osType"],disableToggle:[1,"disableToggle"]},outputs:{filters:"filtersChange"},decls:20,vars:5,consts:()=>{let t;t=$localize`Filters`;let e;e=$localize`${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD*14:1\uFFFD"}:START_BLOCK_IF: Edit contents as list ${"\uFFFD/*14:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*15:2\uFFFD"}:START_BLOCK_ELSE: Edit contents as text ${"\uFFFD/*15:2\uFFFD"}:CLOSE_BLOCK_ELSE:`;let n;n=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Add filter `;let o;o=$localize`Customize your filters.`;let a;return a=$localize`Edit filters as text, one per line.`,[["filtersContainer",""],t,e,n,o,a,[3,"disableToggle"],["title",""],[1,"spacer"],["type","button","shButton","",1,"small"],["shButton","","type","button",1,"small"],["menu",""],["shButton","","type","button",1,"small",3,"click"],["description",""],[1,"filters"],["type","button","shButton","",1,"small",3,"click"],["wrap","off","rows","10",1,"bulk-textarea",3,"ngModelChange","ngModel","ngModelOptions"],[3,"path","osType","isNew"],[3,"pathChange","remove","path","osType","isNew"]]},template:function(e,n){e&1&&(l(0,"app-toggle-card",6),pe(1,7),l(2,"span"),y(3,1),r(),P(4,"div",8),g(5,si,3,0,"button",9),l(6,"sh-menu")(7,"button",10)(8,"sh-icon"),p(9,"dots-three-vertical"),r()(),pe(10,11),l(11,"button",12),T("click",function(){return n.toggleBulkFilterEdit()}),M(12,2),P(13,"sh-icon"),g(14,_i,1,0)(15,ci,1,0),x(),r(),ce(),r(),ce(),g(16,di,2,0,"p",13)(17,ui,2,0,"p",13),g(18,pi,2,3,"sh-form-field")(19,gi,4,0,"div",14),r()),e&2&&(u("disableToggle",n.disableToggle()),c(5),C(n.bulkFilterEditMode()?-1:5),c(9),C(n.bulkFilterEditMode()?14:15),c(2),C(n.bulkFilterEditMode()?17:16),c(2),C(n.bulkFilterEditMode()?18:19))},dependencies:[se,ee,te,re,Y,Q,Qe,ue,Xe,Ut],styles:["[_nghost-%COMP%]{display:block}.spacer[_ngcontent-%COMP%]{flex:1}.bulk-textarea[_ngcontent-%COMP%]{width:100%;font-family:monospace;min-height:12.5rem}.filters[_ngcontent-%COMP%]{max-height:200px;overflow-y:auto;display:flex;flex-direction:column;gap:.5rem}"],changeDetection:0})};var rt=class i{data=G();closed=Le();path=h("");isValid=R(()=>this.path().length>0);dataEffect=q(()=>{let t=this.data();t?.initialPath&&this.path.set(t.initialPath)});submit(){this.closed.emit(this.path()||null)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=z({type:i,selectors:[["app-target-disk-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:13,vars:3,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Local disk source`;let n;n=$localize`Folder path`;let o;o=$localize`Cancel`;let a;return a=$localize` Use this source `,[e,n,o,a,[1,"title-30"],["content",""],[3,"customRemoteMode"],["for","path"],["type","text","id","path","tabindex","4","placeholder",t,3,"ngModelChange","ngModel"],["footer","",1,"sticky"],["shButton","","type","button",3,"click"],["shButton","","type","button",1,"raised","primary",3,"click","disabled"]]},template:function(e,n){e&1&&(l(0,"header")(1,"h3",4),y(2,0),r()(),l(3,"section",5)(4,"app-file-tree",6)(5,"label",7),y(6,1),r(),l(7,"input",8),k("ngModelChange",function(a){return $(n.path,a)||(n.path=a),a}),r()()(),l(8,"footer",9)(9,"button",10),T("click",function(){return n.closed.emit(null)}),y(10,2),r(),l(11,"button",11),T("click",function(){return n.submit()}),y(12,3),r()()),e&2&&(c(4),u("customRemoteMode","diskimage"),c(3),U("ngModel",n.path),c(4),u("disabled",!n.isValid()))},dependencies:[Y,Ye,se,ee,te,re],styles:["[_nghost-%COMP%]{--dialog-p: 1.5rem;display:flex;flex-direction:column;gap:1rem}header[_ngcontent-%COMP%]{display:flex;padding:1.5rem 1.5rem 0}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}footer[_ngcontent-%COMP%]{z-index:1}"],changeDetection:0})};var Ci=[[["","displayName",""]],[["","description",""]],"*"],Ti=["[displayName]","[description]","*"];function Si(i,t){if(i&1&&p(0),i&2){s(2);let e=E(1);V(" ",e.Name," ")}}function fi(i,t){if(i&1&&p(0),i&2){s(2);let e=E(0);V(" ",e.displayName," ")}}function Ei(i,t){i&1&&(l(0,"sh-chip",6),p(1,"Untested"),r())}function hi(i,t){i&1&&(l(0,"sh-chip",6),p(1,"Special"),r())}function Fi(i,t){i&1&&(l(0,"sh-chip",7),p(1,"Deprecated"),r())}function Ni(i,t){if(i&1&&p(0),i&2){s();let e=E(16);V(" ",e," ")}}function Di(i,t){if(i&1&&p(0),i&2){s(2);let e=E(0);V(" ",e.description," ")}}function yi(i,t){if(i&1&&(l(0,"sh-card",0)(1,"div",1),P(2,"img",2),r(),l(3,"div",3)(4,"div",4),he(5),r(),l(6,"div",5),g(7,Si,1,1)(8,fi,1,1),g(9,Ei,2,0,"sh-chip",6)(10,hi,2,0,"sh-chip",6)(11,Fi,2,0,"sh-chip",7),r()(),l(12,"div",8)(13,"div",4),he(14,1),r(),l(15,"div",5),de(16),g(17,Ni,1,1)(18,Di,1,1),r()(),l(19,"div",9),he(20,2),r()()),i&2){let e=s(),n=E(0),o=E(1);u("variant",e.variant()),c(2),u("src",n.icon,pt),gt("alt",n.displayName),c(5),C(o&&o.Name?7:8),c(2),C((n.sortOrder??0)==-3?9:(n.sortOrder??0)==-2?10:(n.sortOrder??0)<0?11:-1),c(7);let a=j(e.getSimplePath(o==null?null:o.BaseUrl));c(),C(a&&a.length>0?17:18)}}var et=class i{destination=G();targetUrl=G();variant=G("type-b");connectionStringId=G();#e=O(Ze);connectionString=R(()=>{let t=this.connectionStringId();return t==null?null:this.#e.destinations().find(e=>e.ID===t)});selectedDestinationType=R(()=>{let t=this.targetUrl();return t?Pe(t)??null:null});destinationFromTargetUrl=R(()=>{let t=this.selectedDestinationType();return t?{key:t.customKey??t.key,customKey:t.customKey??null,displayName:t.displayName,description:t.description,icon:t.icon}:null});destinationItem=R(()=>{let t=this.destination(),e=this.destinationFromTargetUrl();return t||e||null});getSimplePath(t){return t?Mn(t):""}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=z({type:i,selectors:[["app-destination-list-item"]],inputs:{destination:[1,"destination"],targetUrl:[1,"targetUrl"],variant:[1,"variant"],connectionStringId:[1,"connectionStringId"]},ngContentSelectors:Ti,decls:3,vars:3,consts:[[3,"variant"],[1,"icon"],[3,"src"],[1,"name"],[1,"projected"],[1,"default"],[1,"small","simple","primary"],[1,"small","simple","warn"],[1,"description"],[1,"actions"]],template:function(e,n){if(e&1&&(He(Ci),de(0)(1),g(2,yi,21,7,"sh-card",0)),e&2){let o=j(n.destinationItem());c(),j(n.connectionString()),c(),C(o?2:-1)}},dependencies:[Dn,At],styles:['[_nghost-%COMP%]{display:block;border-radius:var(--shape-3)}[_nghost-%COMP%]:focus-visible{outline:2px solid var(--primary-8);outline-offset:2px}sh-card[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:3rem 1fr auto;grid-template-areas:"icon name actions" "icon description actions";gap:.25rem 1rem}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{grid-area:icon;display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:var(--shape-2)}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{object-fit:contain;width:100%;border-radius:var(--shape-2);overflow:hidden}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{grid-area:name;font:var(--paragraph-10)}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%] .projected[_ngcontent-%COMP%]:empty{display:none}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%] .projected[_ngcontent-%COMP%]:not(:empty) + .default[_ngcontent-%COMP%]{display:none}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{grid-area:description;color:var(--base-8)}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%] .projected[_ngcontent-%COMP%]:empty{display:none}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%] .projected[_ngcontent-%COMP%]:not(:empty) + .default[_ngcontent-%COMP%]{display:none}sh-card[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{grid-area:actions;display:flex;align-items:center;gap:.5rem}'],changeDetection:0})};var tt=class i{#e=O(ge);#t(t){return t.flatMap(e=>{if(!e?.Key)return null;let n=xn(e.Key);if(n.length<=1){let o=Lt(e.Key);return o.isDefaultEntry===!0?[oe(W({},o),{displayName:e.DisplayName||o.displayName||e.Key,description:e.Description||o.description||""})]:o}else return n}).filter(e=>e!==null)}#n(t){return t.map(e=>({key:e.customKey??e.key,customKey:e.customKey??null,displayName:e.displayName,description:e.description,icon:e.icon,searchTerms:[e.displayName,e.description,e.key,e.searchTerms??"",e.customKey??""].join(" "),sortOrder:e.sortOrder??0}))}backendDestinationOptions=R(()=>{let t=this.#e.backendModules(),e=this.#t(t);return this.#n(e)});sourceProviderOptions=R(()=>{let t=this.#e.sourceProviderModules(),e=this.#t(t.length?t:this.#e.backendModules());return this.#n(e)});restoreDestinationOptions=R(()=>{let t=this.#e.restoreDestinationProviderModules(),e=this.#t(t.length?t:this.#e.backendModules());return this.#n(e)});destinationTypeOptions=this.backendDestinationOptions;allModules=R(()=>[...this.#e.backendModules(),...this.#e.sourceProviderModules(),...this.#e.restoreDestinationProviderModules()].reduce((t,e)=>(t.find(n=>n.Key===e.Key)||t.push(e),t),[]));static \u0275fac=function(e){return new(e||i)};static \u0275prov=Ne({token:i,factory:i.\u0275fac,providedIn:"root"})};function Ai(i,t){if(i&1){let e=I();l(0,"app-destination-list-item",7),T("click",function(){let o=S(e).$implicit,a=s();return f(a.setDestination.emit(o.customKey??o.key))})("keydown.enter",function(o){return o.target.click()})("keydown.space",function(o){return o.target.click()}),l(1,"button",8),M(2,1),P(3,"sh-icon"),x(),r()()}if(i&2){let e=t.$implicit;u("destination",e)}}var Vt=class i{#e=O(tt);#t=O(ge);showAsSources=G(!1);moduleType=G("Backend");setDestination=Le();destinationSearchTerm=h("");showAllDestinations=h(!1);destinationTypeOptions=R(()=>{switch(this.moduleType()){case"SourceProvider":return this.#e.sourceProviderOptions();case"RestoreDestinationProvider":return this.#e.restoreDestinationOptions();default:return this.#e.backendDestinationOptions()}});destinationTypeOptionsFocused=R(()=>{let t=this.#t.backendModules(),e=this.destinationTypeOptions().map(_=>{let d=t.find(m=>m.Key==_.key);return d&&(_=oe(W({},_),{sortOrder:d.IsDeprecated?-1:d.IsUntested?-3:_.sortOrder})),_}),n=this.destinationSearchTerm().toLowerCase(),o=this.showAllDestinations(),a=[...e].sort((_,d)=>{let m=_.sortOrder??0,N=d.sortOrder??0;return m!==N?N-m:_.displayName.localeCompare(d.displayName)}).filter(_=>{if(o)return!0;let d=_.sortOrder??0;return d<0&&n?.length&&(_.key.toLocaleLowerCase()===n.toLocaleLowerCase()||_.customKey?.toLocaleLowerCase()===n.toLocaleLowerCase())?!0:d>=0});return n?a.filter(_=>_.searchTerms.toLowerCase().includes(n)):a});static \u0275fac=function(e){return new(e||i)};static \u0275cmp=z({type:i,selectors:[["app-destination-list"]],inputs:{showAsSources:[1,"showAsSources"],moduleType:[1,"moduleType"]},outputs:{setDestination:"setDestination"},decls:8,vars:2,consts:()=>{let t;t=$localize`Search for destination...`;let e;e=$localize`Show all`;let n;return n=$localize` Choose ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`,[e,n,[1,"search-area"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],[1,"raised","primary",3,"checkedChange","checked"],[1,"list"],["tabindex","0",3,"destination"],["tabindex","0",3,"click","keydown.enter","keydown.space","destination"],["shButton","","tabindex","-1","type","button"]]},template:function(e,n){e&1&&(l(0,"div",2)(1,"sh-form-field")(2,"input",3),k("ngModelChange",function(a){return $(n.destinationSearchTerm,a)||(n.destinationSearchTerm=a),a}),r()(),l(3,"sh-toggle",4),k("checkedChange",function(a){return $(n.showAllDestinations,a)||(n.showAllDestinations=a),a}),y(4,0),r()(),l(5,"div",5),fe(6,Ai,4,1,"app-destination-list-item",6,Se),r()),e&2&&(c(2),U("ngModel",n.destinationSearchTerm),c(),U("checked",n.showAllDestinations),c(3),Ee(n.destinationTypeOptionsFocused()))},dependencies:[et,se,ee,te,re,ue,Y,Q,ve],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:hidden;padding:.25rem;min-height:250px}.list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:auto;padding:.25rem .375rem 1rem;width:calc(100% + .5rem);margin-left:-.375rem;border-bottom:.0625rem solid var(--base-4)}.search-area[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:1rem}"],changeDetection:0})};var Ii=["fileInput"],Pi=[[["label"]]],Oi=["label"],Bt=class i{customId=G();content=h("");readonly=h(!1);placeholder=G($localize`Drop a file here or use the browse button`);fileInputRef=Ie("fileInput");onFileSelected(t){let e=t.target;e.files&&e.files.length>0&&this.readFile(e.files[0])}onFileDrop(t){t.preventDefault(),t.dataTransfer?.files&&t.dataTransfer.files.length>0&&this.readFile(t.dataTransfer.files[0])}onDragOver(t){t.preventDefault()}readFile(t){let e=new FileReader;e.onload=()=>{this.content.set(e.result)},e.readAsText(t)}triggerBrowse(){return this.fileInputRef()?.nativeElement.click(),!1}onChange=()=>{};onTouched=()=>{};onChangeEffect=q(()=>{this.onChange(this.content())});writeValue(t){this.content.set(t??"")}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.readonly.set(t)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=z({type:i,selectors:[["app-file-drop-textarea"]],viewQuery:function(e,n){e&1&&De(n.fileInputRef,Ii,5),e&2&&ye()},inputs:{customId:[1,"customId"],placeholder:[1,"placeholder"]},features:[Cn([{provide:fn,useExisting:i,multi:!0}])],ngContentSelectors:Oi,decls:9,vars:3,consts:[["fileInput",""],[1,"browse-btn"],["shButton","","type","button",1,"small","outlined",3,"click"],[1,"textarea-container","textarea-wrap",3,"drop","dragover"],["rows","10",3,"ngModelChange","placeholder","ngModel","disabled"],["type","file",1,"hidden",3,"change"]],template:function(e,n){if(e&1){let o=I();He(Pi),he(0,0,["ngProjectAs","label",5,["label"]]),l(1,"div",1)(2,"button",2),T("click",function(){return n.triggerBrowse()}),l(3,"sh-icon"),p(4,"upload"),r()()(),l(5,"div",3),T("drop",function(_){return n.onFileDrop(_)})("dragover",function(_){return n.onDragOver(_)}),l(6,"textarea",4),k("ngModelChange",function(_){return S(o),$(n.content,_)||(n.content=_),f(_)}),r()(),l(7,"input",5,0),T("change",function(_){return n.onFileSelected(_)}),r()}e&2&&(c(6),u("placeholder",n.placeholder()),U("ngModel",n.content),u("disabled",n.readonly()))},dependencies:[se,ee,te,re,Q,Y],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label browsebtn" "input input";grid-template-columns:8fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .browse-btn[_ngcontent-%COMP%]{grid-area:browsebtn}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%]{grid-area:input;width:100%;border:none;font:var(--code-20)}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{width:100%;color:var(--base-8);background-color:var(--base-1);border:1px solid var(--base-4);border-radius:var(--shape-3);padding:.5rem;resize:vertical;box-shadow:var(--box-shadow-10)}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%] .dark[_ngcontent-%COMP%]{background-color:var(--base-2)}[_nghost-%COMP%] .hidden[_ngcontent-%COMP%]{display:none}'],changeDetection:0})};var Mi=(i,t,e,n)=>({index:i,fieldGroup:"custom",formView:t,destinationType:e,oauthField:n}),_e=i=>({$implicit:i}),xi=(i,t,e,n)=>({index:i,fieldGroup:"dynamic",formView:t,destinationType:e,oauthField:n}),Ri=()=>({updateOn:"blur"}),Li=(i,t,e,n)=>({index:i,formView:t,fieldGroup:"advanced",destinationType:e,oauthField:n}),Te=(i,t)=>({fieldGroup:i,formView:t}),bi=()=>["/connect/logon"];function wi(i,t){i&1&&ae(0)}function Gi(i,t){if(i&1&&H(0,wi,1,0,"ng-container",25),i&2){let e=t.$implicit,n=t.$index;s();let o=Z(15);s();let a=E(0),_=E(1);u("ngTemplateOutlet",o)("ngTemplateOutletContext",le(7,_e,Tt(2,Mi,n,e,a,_.oauthField)))}}function $i(i,t){i&1&&ae(0)}function vi(i,t){if(i&1&&H(0,$i,1,0,"ng-container",25),i&2){let e=t.$implicit,n=t.$index;s();let o=Z(15);s();let a=E(0),_=E(1);u("ngTemplateOutlet",o)("ngTemplateOutletContext",le(7,_e,Tt(2,xi,n,e,a,_.oauthField)))}}function Ui(i,t){if(i&1){let e=I();l(0,"button",26),T("click",function(){S(e);let o=s(2);return f(o.showTextArea.set(!1))}),M(1,8),P(2,"sh-icon"),x(),r()}}function ki(i,t){if(i&1){let e=I();l(0,"button",33,2),T("click",function(){let o=S(e).$implicit,a=s(3);return f(a.addAdvancedOption(o))}),p(2),r()}if(i&2){let e=t.$implicit;c(2),V(" ",e.name," ")}}function Vi(i,t){if(i&1){let e=I();l(0,"div",23)(1,"sh-menu",27)(2,"button",28),M(3,9),P(4,"sh-icon"),x(),r(),pe(5,29),fe(6,ki,3,1,"button",30,Se),ce(),r(),l(8,"sh-menu")(9,"button",31)(10,"sh-icon"),p(11,"dots-three-vertical"),r()(),pe(12,29),l(13,"button",32),T("click",function(){S(e);let o=s(2);return f(o.showTextArea.set(!0))}),l(14,"sh-icon"),p(15,"link"),r(),p(16," Edit contents as text "),r(),ce(),r()()}if(i&2){s();let e=E(9);c(),u("searchable",!0),c(),u("disabled",e.length===0),c(4),Ee(e)}}function Bi(i,t){if(i&1){let e=I();l(0,"textarea",34),T("ngModelChange",function(o){S(e);let a=s(2);return f(a.updateSettingsFromText(o))}),r()}if(i&2){let e=s(2);u("ngModel",e.settingsAsText())("ngModelOptions",Ae(2,Ri))}}function Ki(i,t){i&1&&ae(0)}function Ji(i,t){if(i&1&&H(0,Ki,1,0,"ng-container",25),i&2){let e=t.$implicit,n=t.$index;s(2);let o=Z(15),a=s(),_=E(0),d=E(1),m=a.getFormView("advanced",e)??a.getDefaultFormView(e);u("ngTemplateOutlet",o)("ngTemplateOutletContext",le(7,_e,Tt(2,Li,n,m,_,d.oauthField)))}}function Xi(i,t){if(i&1&&fe(0,Ji,1,9,"ng-container",null,Se),i&2){let e=s(2);Ee(e.advancedFormFieldNames())}}function zi(i,t){i&1&&(l(0,"sup",43),p(1,"*"),r())}function Wi(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function Hi(i,t){if(i&1){let e=I();l(0,"app-file-tree",36)(1,"label",42),g(2,zi,2,0,"sup",43),p(3),g(4,Wi,2,1,"sh-icon",44),r(),l(5,"input",45),T("ngModelChange",function(o){S(e);let a=s().$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()()}if(i&2){let e=s().$implicit,n=E(1),o=E(2),a=E(3),_=E(4),d=E(5);u("startingPath",a)("accepts",e.formView.accepts)("showFiles",!0)("hideShortcuts",!0)("showHiddenNodes",!0)("selectFiles",!0)("resolvePaths",!0),c(),u("for",d),c(),C(e.formView.isMandatory&&_?2:-1),c(),V(" ",n," "),c(),C(e.formView.longDescription?4:-1),c(),u("id",d)("ngModel",o)}}function ji(i,t){i&1&&(l(0,"sup",46),p(1,"*"),r())}function qi(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function Qi(i,t){if(i&1){let e=I();l(0,"app-file-tree",37)(1,"label",42),g(2,ji,2,0,"sup",46),p(3),g(4,qi,2,1,"sh-icon",44),r(),l(5,"input",45),T("ngModelChange",function(o){S(e);let a=s().$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()()}if(i&2){let e=s().$implicit,n=E(1),o=E(2),a=E(3),_=E(4),d=E(5);u("hideShortcuts",!0)("enableCreateFolder",!0)("startingPath",a)("resolvePaths",!0),c(),u("for",d),c(),C(e.formView.isMandatory&&_?2:-1),c(),V(" ",n," "),c(),C(e.formView.longDescription?4:-1),c(),u("id",d)("ngModel",o)}}function Yi(i,t){i&1&&(l(0,"sup",47),p(1,"*"),r())}function Zi(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function eo(i,t){i&1&&(l(0,"sh-icon",48),p(1," warning "),r())}function to(i,t){i&1&&ae(0)}function no(i,t){if(i&1&&(l(0,"sh-icon",52),p(1," link "),r()),i&2){s();let e=E(8),n=E(9);Fe("error",e&&n==="error")("warn",e&&n==="warning"),u("shTooltip",e)}}function io(i,t){i&1&&(l(0,"sh-icon",51),p(1,"envelope"),r())}function oo(i,t){i&1&&(l(0,"sh-icon",51),p(1,"hard-drives"),r())}function ao(i,t){i&1&&(l(0,"sh-icon",51),p(1,"jar"),r())}function lo(i,t){i&1&&(l(0,"sh-icon",51),p(1,"textbox"),r())}function ro(i,t){if(i&1){let e=I();l(0,"sh-form-field")(1,"label",42),g(2,Yi,2,0,"sup",47),p(3),g(4,Zi,2,1,"sh-icon",44),g(5,eo,2,0,"sh-icon",48),H(6,to,1,0,"ng-container",25),r(),l(7,"input",49),T("keydown",function(o){S(e);let a=s().$implicit,_=s(2);return f(_.onKeyDown(a.fieldGroup,a.formView.name,a.formView.type,o))})("ngModelChange",function(o){S(e);let a=s().$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),de(8)(9),g(10,no,2,5,"sh-icon",50)(11,io,2,0,"sh-icon",51)(12,oo,2,0,"sh-icon",51)(13,ao,2,0,"sh-icon",51)(14,lo,2,0,"sh-icon",51),r()}if(i&2){let e=s().$implicit,n=E(1),o=E(2),a=E(3),_=E(4),d=E(5);s();let m=Z(17);c(),u("for",d),c(),C(e.formView.isMandatory&&_?2:-1),c(),V(" ",n," "),c(),C(e.formView.longDescription?4:-1),c(),C(_&&e.formView.type==="Path"?5:-1),c(),u("ngTemplateOutlet",m)("ngTemplateOutletContext",le(16,_e,me(13,Te,e.fieldGroup,e.formView))),c(),u("type",e.formView.type==="Email"?"email":"text")("id",d)("ngModel",o);let N=a,F=s().hasLeadingSlash(N??"");c(),j(F&&(e.formView.doubleSlash==null?null:e.formView.doubleSlash.message)),c(),j(e.formView.doubleSlash==null?null:e.formView.doubleSlash.type),c(),C(e.formView.type==="Path"?10:e.formView.type==="Email"?11:e.formView.type==="Hostname"?12:e.formView.type==="Bucketname"||e.formView.type==="BucketnameB2"?13:14)}}function so(i,t){i&1&&(l(0,"sup",53),p(1,"*"),r())}function _o(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function co(i,t){i&1&&ae(0)}function uo(i,t){if(i&1){let e=I();l(0,"span",57),T("click",function(){S(e);let o=s(2).$implicit,a=s(2);return f(a.oauthStartTokenCreation(o.destinationType,o.fieldGroup,o.formView.name,o.formView.oauthVersion))}),p(1," AuthID "),r()}}function po(i,t){i&1&&(l(0,"sh-icon",51),p(1,"password"),r())}function mo(i,t){if(i&1){let e=I();l(0,"sh-icon",58),T("click",function(){S(e);let o=s(2).$implicit;return f(o.formView.showPassword=!o.formView.showPassword)}),p(1," eye "),r()}}function go(i,t){if(i&1){let e=I();l(0,"sh-icon",58),T("click",function(){S(e);let o=s(2).$implicit;return f(o.formView.showPassword=!o.formView.showPassword)}),p(1," eye-slash "),r()}}function Co(i,t){if(i&1){let e=I();l(0,"sh-form-field")(1,"label",42),g(2,so,2,0,"sup",53),p(3),g(4,_o,2,1,"sh-icon",44),H(5,co,1,0,"ng-container",25),r(),l(6,"input",54),T("ngModelChange",function(o){S(e);let a=s().$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),g(7,uo,2,0,"span",55)(8,po,2,0,"sh-icon",51),g(9,mo,2,0,"sh-icon",56)(10,go,2,0,"sh-icon",56),r()}if(i&2){let e=s().$implicit,n=E(1),o=E(2),a=E(4),_=E(5);s();let d=Z(17);c(),u("for",_),c(),C(e.formView.isMandatory&&a?2:-1),c(),V(" ",n," "),c(),C(e.formView.longDescription?4:-1),c(),u("ngTemplateOutlet",d)("ngTemplateOutletContext",le(14,_e,me(11,Te,e.fieldGroup,e.formView))),c(),u("type",e.formView.showPassword?"text":"password")("id",_)("ngModel",o),c(),C(e.oauthField===e.formView.name?7:8),c(2),C(e.formView.showPassword?9:10)}}function To(i,t){i&1&&(l(0,"sup",60),p(1,"*"),r())}function So(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(3).$implicit;u("shTooltip",e.formView.longDescription)}}function fo(i,t){i&1&&ae(0)}function Eo(i,t){if(i&1&&p(0),i&2){let e=t.$implicit;at(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function ho(i,t){if(i&1){let e=I();l(0,"sh-select",59)(1,"label",42),g(2,To,2,0,"sup",60),p(3),g(4,So,2,1,"sh-icon",44),H(5,fo,1,0,"ng-container",25),r(),l(6,"input",45),T("ngModelChange",function(o){S(e);let a=s(2).$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()(),H(7,Eo,1,2,"ng-template",null,3,Je)}if(i&2){let e=Z(8);s();let n=E(0),o=s().$implicit,a=E(1),_=E(2),d=E(4),m=E(5);s();let N=Z(17);u("options",n)("isClearable",!1)("optionTemplate",e),c(),u("for",m),c(),C(o.formView.isMandatory&&d?2:-1),c(),V(" ",a," "),c(),C(o.formView.longDescription?4:-1),c(),u("ngTemplateOutlet",N)("ngTemplateOutletContext",le(14,_e,me(11,Te,o.fieldGroup,o.formView))),c(),u("id",m)("ngModel",_)}}function Fo(i,t){if(i&1&&(de(0),g(1,ho,9,16)),i&2){let e=s().$implicit,n=j(s(2).mapOptions(e.formView));c(),C(n?1:-1)}}function No(i,t){i&1&&(l(0,"sup",63),p(1,"*"),r())}function Do(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(3).$implicit;u("shTooltip",e.formView.longDescription)}}function yo(i,t){i&1&&ae(0)}function Ao(i,t){if(i&1&&p(0),i&2){let e=t.$implicit;at(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function Io(i,t){if(i&1){let e=I();l(0,"sh-select",62)(1,"label",42),g(2,No,2,0,"sup",63),p(3),g(4,Do,2,1,"sh-icon",44),H(5,yo,1,0,"ng-container",25),r(),l(6,"input",45),T("ngModelChange",function(o){S(e);let a=s(2).$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()(),H(7,Ao,1,2,"ng-template",null,4,Je)}if(i&2){let e=Z(8);s();let n=E(0),o=s().$implicit,a=E(1),_=E(2),d=E(4),m=E(5);s();let N=Z(17);u("options",n)("asFreeText",!0)("inlineSearch",!0)("optionTemplate",e),c(),u("for",m),c(),C(o.formView.isMandatory&&d?2:-1),c(),V(" ",a," "),c(),C(o.formView.longDescription?4:-1),c(),u("ngTemplateOutlet",N)("ngTemplateOutletContext",le(15,_e,me(12,Te,o.fieldGroup,o.formView))),c(),u("id",m)("ngModel",_)}}function Po(i,t){i&1&&P(0,"sh-progress-bar",61)}function Oo(i,t){if(i&1&&(de(0),g(1,Io,9,17)(2,Po,1,0,"sh-progress-bar",61)),i&2){let e=s().$implicit,n=E(2),o=j(s(2).mapOptionsWithFreeText(e.formView,n));c(),C(o?1:2)}}function Mo(i,t){i&1&&(l(0,"sup",65),p(1,"*"),r())}function xo(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function Ro(i,t){i&1&&ae(0)}function Lo(i,t){if(i&1){let e=I();l(0,"app-size",64),T("ngModelChange",function(o){S(e);let a=s().$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),l(1,"label",42),g(2,Mo,2,0,"sup",65),p(3),g(4,xo,2,1,"sh-icon",44),H(5,Ro,1,0,"ng-container",25),r()()}if(i&2){let e=s().$implicit,n=E(1),o=E(2),a=E(4),_=E(5);s();let d=Z(17);u("inputType",e.Name)("ngModel",o)("customId",_),c(),u("for",_),c(),C(e.formView.isMandatory&&a?2:-1),c(),V(" ",n," "),c(),C(e.formView.longDescription?4:-1),c(),u("ngTemplateOutlet",d)("ngTemplateOutletContext",le(12,_e,me(9,Te,e.fieldGroup,e.formView)))}}function bo(i,t){i&1&&(l(0,"sup",66),p(1,"*"),r())}function wo(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function Go(i,t){i&1&&ae(0)}function $o(i,t){if(i&1){let e=I();l(0,"sh-form-field")(1,"label",42),g(2,bo,2,0,"sup",66),p(3),g(4,wo,2,1,"sh-icon",44),H(5,Go,1,0,"ng-container",25),r(),l(6,"input",67),T("ngModelChange",function(o){S(e);let a=s().$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),l(7,"sh-icon",51),p(8,"numpad"),r()()}if(i&2){let e=s().$implicit,n=E(1),o=E(2),a=E(4),_=E(5);s();let d=Z(17);c(),u("for",_),c(),C(e.formView.isMandatory&&a?2:-1),c(),V(" ",n," "),c(),C(e.formView.longDescription?4:-1),c(),u("ngTemplateOutlet",d)("ngTemplateOutletContext",le(11,_e,me(8,Te,e.fieldGroup,e.formView))),c(),u("id",_)("ngModel",o)}}function vo(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function Uo(i,t){i&1&&ae(0)}function ko(i,t){if(i&1){let e=I();l(0,"sh-toggle",39)(1,"label",42),p(2),g(3,vo,2,1,"sh-icon",44),H(4,Uo,1,0,"ng-container",25),r(),l(5,"input",68),T("change",function(o){S(e);let a=s().$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o.target.checked?"true":"false"))}),r()()}if(i&2){let e=s().$implicit,n=E(1),o=E(2),a=E(5);s();let _=Z(17),d=s();c(),u("for",a),c(),V(" ",n," "),c(),C(e.formView.longDescription?3:-1),c(),u("ngTemplateOutlet",_)("ngTemplateOutletContext",le(9,_e,me(6,Te,e.fieldGroup,e.formView))),c(),u("checked",d.isTrue(o))}}function Vo(i,t){i&1&&(l(0,"sup",70),p(1,"*"),r())}function Bo(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(3).$implicit;u("shTooltip",e.formView.longDescription)}}function Ko(i,t){i&1&&ae(0)}function Jo(i,t){if(i&1&&p(0),i&2){let e=t.$implicit;at(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function Xo(i,t){if(i&1){let e=I();l(0,"sh-select",69)(1,"label",42),g(2,Vo,2,0,"sup",70),p(3),g(4,Bo,2,1,"sh-icon",44),H(5,Ko,1,0,"ng-container",25),r(),l(6,"input",71),T("ngModelChange",function(o){S(e);let a=s(2).$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()(),H(7,Jo,1,2,"ng-template",null,5,Je)}if(i&2){let e=Z(8);s();let n=E(0),o=s().$implicit,a=E(1),_=E(2),d=E(4),m=E(5);s();let N=Z(17);u("options",n)("selectMultiple",!0)("optionTemplate",e),c(),u("for",m),c(),C(o.formView.isMandatory&&d?2:-1),c(),V(" ",a," "),c(),C(o.formView.longDescription?4:-1),c(),u("ngTemplateOutlet",N)("ngTemplateOutletContext",le(13,_e,me(10,Te,o.fieldGroup,o.formView))),c(),u("ngModel",_)}}function zo(i,t){if(i&1&&(de(0),g(1,Xo,9,15)),i&2){let e=s().$implicit,n=j(s(2).mapOptions(e.formView));c(),C(n?1:-1)}}function Wo(i,t){i&1&&(l(0,"sup",72),p(1,"*"),r())}function Ho(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function jo(i,t){i&1&&ae(0)}function qo(i,t){if(i&1){let e=I();l(0,"app-timespan",64),T("ngModelChange",function(o){S(e);let a=s().$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),l(1,"label",42),g(2,Wo,2,0,"sup",72),p(3),g(4,Ho,2,1,"sh-icon",44),H(5,jo,1,0,"ng-container",25),r()()}if(i&2){let e=s().$implicit,n=E(1),o=E(2),a=E(4),_=E(5);s();let d=Z(17);u("inputType",e.formView.name)("ngModel",o)("customId",_),c(),u("for",_),c(),C(e.formView.isMandatory&&a?2:-1),c(),V(" ",n," "),c(),C(e.formView.longDescription?4:-1),c(),u("ngTemplateOutlet",d)("ngTemplateOutletContext",le(12,_e,me(9,Te,e.fieldGroup,e.formView)))}}function Qo(i,t){i&1&&(l(0,"sup",74),p(1,"*"),r())}function Yo(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function Zo(i,t){i&1&&ae(0)}function ea(i,t){if(i&1){let e=I();l(0,"app-file-drop-textarea",73),T("ngModelChange",function(o){S(e);let a=s().$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),l(1,"label"),g(2,Qo,2,0,"sup",74),p(3),g(4,Yo,2,1,"sh-icon",44),H(5,Zo,1,0,"ng-container",25),r()()}if(i&2){let e=s().$implicit,n=E(2),o=E(4),a=E(5);s();let _=Z(17);u("ngModel",n)("customId",a)("placeholder",e.formView.longDescription),c(2),C(e.formView.isMandatory&&o?2:-1),c(),V(" ",e.formView.shortDescription??e.formView.name," "),c(),C(e.formView.longDescription?4:-1),c(),u("ngTemplateOutlet",_)("ngTemplateOutletContext",le(11,_e,me(8,Te,e.fieldGroup,e.formView)))}}function ta(i,t){i&1&&(P(0,"sh-spinner"),l(1,"span"),y(2,10),r()),i&2&&Ct("--spinner-size","16px")("--spinner-thickness","2px")}function na(i,t){if(i&1){let e=I();l(0,"div",77)(1,"span"),y(2,11),r(),l(3,"button",32),T("click",function(){S(e);let o=s(6);return f(o.reloadTrigger.set(!o.reloadTrigger()))}),y(4,12),r()()}}function ia(i,t){if(i&1&&p(0),i&2){let e=t.$implicit;at(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function oa(i,t){if(i&1){let e=I();l(0,"sh-select",78)(1,"label",42)(2,"sup",79),p(3,"*"),r(),l(4,"span"),y(5,13),r()(),l(6,"input",45),T("ngModelChange",function(o){S(e);let a=s(4).$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()(),H(7,ia,1,2,"ng-template",null,6,Je)}if(i&2){s(4);let e=E(2),n=E(5),o=s(2);u("options",o.restoreBackupIdOptions())("isClearable",!1),c(),u("for",n),c(5),u("id",n)("ngModel",e)}}function aa(i,t){if(i&1&&g(0,ta,3,4)(1,na,5,0,"div",77)(2,oa,9,5),i&2){let e=s(5);C(e.isLoadingRestoreBackupIdOptions()?0:e.restoreBackupIdOptions().length==0?1:2)}}function la(i,t){i&1&&(l(0,"sup",80),p(1,"*"),r())}function ra(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(4).$implicit;u("shTooltip",e.formView.longDescription)}}function sa(i,t){i&1&&ae(0)}function _a(i,t){if(i&1){let e=I();l(0,"button",82),T("click",function(){S(e),s(4);let o=E(5),a=s(2);return f(a.toggleDisabled(o))}),M(1,14),P(2,"sh-icon"),x(),r()}}function ca(i,t){if(i&1){let e=I();l(0,"sh-form-field")(1,"label",42),g(2,la,2,0,"sup",80),p(3),g(4,ra,2,1,"sh-icon",44),H(5,sa,1,0,"ng-container",25),r(),l(6,"input",81),T("ngModelChange",function(o){S(e);let a=s(3).$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),l(7,"sh-icon",51),p(8,"textbox"),r()(),g(9,_a,3,0,"button",41)}if(i&2){let e=s(3).$implicit,n=E(1),o=E(2),a=E(4),_=E(5);s();let d=Z(17),m=s();c(),u("for",_),c(),C(e.formView.isMandatory&&a?2:-1),c(),V(" ",n," "),c(),C(e.formView.longDescription?4:-1),c(),u("ngTemplateOutlet",d)("ngTemplateOutletContext",le(15,_e,me(12,Te,e.fieldGroup,e.formView))),c(),u("type","text")("id",_)("ngModel",o)("placeholder",e.formView.longDescription)("disabled",!0),c(3),C(m.getIsDisabled(_)?9:-1)}}function da(i,t){if(i&1&&(l(0,"div",75),g(1,aa,3,1)(2,ca,10,17),r()),i&2){let e=s(4);c(),C(e.isRestoreFlow()?1:2)}}function ua(i,t){if(i&1){let e=I();l(0,"div",83),M(1,15),P(2,"div")(3,"div"),x(),r(),l(4,"button",82),T("click",function(){S(e);let o=s(5);return f(o.openConsole())}),M(5,16),P(6,"sh-icon"),x(),r()}}function pa(i,t){i&1&&(l(0,"div",83),y(1,17),r(),l(2,"button",84),M(3,18),P(4,"sh-icon"),x(),r()),i&2&&(c(2),u("routerLink",Ae(1,bi)))}function ma(i,t){if(i&1&&(l(0,"div",76),g(1,ua,7,0)(2,pa,5,2),r()),i&2){let e=s(4);c(),C(e.isConnectedToConsole()?1:2)}}function ga(i,t){if(i&1&&g(0,da,3,1,"div",75)(1,ma,3,1,"div",76),i&2){let e=s(3);C(e.isConnectedToConsole()&&e.hasStorageApiKey()?0:1)}}function Ca(i,t){i&1&&(l(0,"sup",86),p(1,"*"),r())}function Ta(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(3).$implicit;u("shTooltip",e.formView.longDescription)}}function Sa(i,t){i&1&&ae(0)}function fa(i,t){if(i&1){let e=I();l(0,"div",85)(1,"sh-form-field")(2,"label",42),g(3,Ca,2,0,"sup",86),p(4),g(5,Ta,2,1,"sh-icon",44),H(6,Sa,1,0,"ng-container",25),r(),l(7,"input",87),T("ngModelChange",function(o){S(e);let a=s(2).$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),l(8,"sh-icon",51),p(9,"textbox"),r()(),l(10,"button",88),T("click",function(){S(e);let o=s(4);return f(o.authenticateFilen())}),M(11,19),P(12,"sh-icon"),x(),r()()}if(i&2){let e=s(2).$implicit,n=E(1),o=E(2),a=E(4),_=E(5);s();let d=Z(17),m=s();c(2),u("for",_),c(),C(e.formView.isMandatory&&a?3:-1),c(),V(" ",n," "),c(),C(e.formView.longDescription?5:-1),c(),u("ngTemplateOutlet",d)("ngTemplateOutletContext",le(12,_e,me(9,Te,e.fieldGroup,e.formView))),c(),u("id",_)("ngModel",o),c(3),u("disabled",m.isAuthenticatingFilen())}}function Ea(i,t){if(i&1&&g(0,fa,13,14,"div",85),i&2){let e=s(3);C(e.hasFilenApiKey()?-1:0)}}function ha(i,t){if(i&1){let e=I();l(0,"button",82),T("click",function(){S(e);let o=s().$implicit,a=s(2);return f(a.removeAdvancedOption(o.formView.name))}),l(1,"sh-icon"),p(2,"x-circle"),r()()}}function Fa(i,t){if(i&1&&(l(0,"div",35),de(1)(2)(3)(4)(5),g(6,Hi,6,13,"app-file-tree",36)(7,Qi,6,10,"app-file-tree",37)(8,ro,15,18,"sh-form-field")(9,Co,11,16,"sh-form-field")(10,Fo,2,2)(11,Oo,3,2)(12,Lo,6,14,"app-size",38)(13,$o,9,13,"sh-form-field")(14,ko,6,11,"sh-toggle",39)(15,zo,2,2)(16,qo,6,14,"app-timespan",38)(17,ea,6,13,"app-file-drop-textarea",40)(18,ga,2,1)(19,Ea,1,1),g(20,ha,3,0,"button",41),r()),i&2){let e=t.$implicit;s();let n=E(0),o=s();Fe("single-field",e.fieldGroup!=="advanced"),c(),j(e.formView.shortDescription??e.formView.name),c(),j(o.getFieldGroup(n,e.fieldGroup)[e.formView.name]),c();let a=j(o.getFieldValue(e.fieldGroup,e.formView.name));c(),j((a??"").toString().trim()===""),c(),j("destination-"+e.fieldGroup+"-"+e.index+"-"+(e.asHttpOptions?"http":"other")),c(),C(e.formView.type==="FileTree"?6:e.formView.type==="FolderTree"?7:e.formView.type==="String"||e.formView.type==="Path"||e.formView.type==="Email"||e.formView.type==="Hostname"||e.formView.type==="Bucketname"||e.formView.type==="BucketnameB2"?8:e.formView.type==="Password"?9:e.formView.type==="Enumeration"?10:e.formView.type==="NonValidatedSelectableString"?11:e.formView.type==="Size"?12:e.formView.type==="Integer"?13:e.formView.type==="Boolean"?14:e.formView.type==="Flags"?15:e.formView.type==="Timespan"||e.formView.type==="DateTime"?16:e.formView.type==="FreeText"?17:e.formView.type==="DuplicatiBackupId"?18:e.formView.type==="Filen2FACode"?19:-1),c(14),C(e.fieldGroup==="advanced"?20:-1)}}function Na(i,t){if(i&1&&(l(0,"sh-icon",89),p(1,"x-circle"),r()),i&2){s();let e=E(0);u("shTooltip",(e==null?null:e.message)??"Invalid value")}}function Da(i,t){if(i&1&&(l(0,"sh-icon",90),p(1,"warning"),r()),i&2){s();let e=E(0);u("shTooltip",(e==null?null:e.message)??"Invalid value")}}function ya(i,t){if(i&1&&(de(0),g(1,Na,2,1,"sh-icon",89)(2,Da,2,1,"sh-icon",90)),i&2){let e=s().$implicit,n=E(0),o=j(e.formView.validate(n));c(),C((o==null?null:o.type)==="error"?1:(o==null?null:o.type)==="warning"?2:-1)}}function Aa(i,t){if(i&1&&(de(0),g(1,ya,3,2)),i&2){let e=t.$implicit,o=(j(s(2).getFieldValue(e.fieldGroup,e.formView.name))??"").toString().trim()==="";c(),C(!o&&e.formView.validate?1:-1)}}function Ia(i,t){if(i&1&&(de(0),fe(1,Gi,1,9,"ng-container",null,Se),fe(3,vi,1,9,"ng-container",null,Se),l(5,"sh-toggle-card",20),pe(6,21)(7),y(8,7),ce(),de(9),g(10,Ui,3,0,"button",22)(11,Vi,17,2,"div",23),ce(),g(12,Bi,1,3,"textarea",24)(13,Xi,2,0),r(),H(14,Fa,21,9,"ng-template",null,0,Je)(16,Aa,2,2,"ng-template",null,1,Je)),i&2){let e=s(),n=E(1);j(e.destinationForm()),c(),Ee(n.custom),c(2),Ee(n.dynamic),c(2),u("disableToggle",!0),c(4),j(e.nonSelectedAdvancedFormViews()),c(),C(e.showTextArea()?10:11),c(2),C(e.showTextArea()?12:13)}}var Kt=class i{#e=O(Oe);#t=O(ge);#n=O(Rt);#i=O(tt);#o=O(Pn);#s=O(On);#a=O(Ge);injector=O(We);targetUrl=be.required();useBackupState=G(!1);#l=null;destinationType=R(()=>{let t=this.targetUrl();if(!t)return null;let e=Pe(t);return this.#l=e?.customKey??e?.key,this.#l});refreshView=h(!1);destinationForm=h({custom:{},dynamic:{},advanced:{}});advancedFormFieldNames=R(()=>Object.keys(this.destinationForm().advanced??{}));destinationFormConfig=h(null);showTextArea=h(!1);isLoadingRestoreBackupIdOptions=h(!1);isRestoreFlow=R(()=>!this.useBackupState());reloadTrigger=h(!1);hasLoadedBackupIdOptions=h(!1);restoreBackupIdOptions=Ue(_n(Wt(this.targetUrl).pipe(dn(),ot(t=>({url:t,isReload:!1}))),Wt(this.reloadTrigger).pipe(ot(()=>({url:this.targetUrl(),isReload:!0})))).pipe(dt(({url:t,isReload:e})=>t&&t.startsWith("duplicati://")&&this.hasStorageApiKey()&&this.isRestoreFlow()&&(e||!this.hasLoadedBackupIdOptions())?(this.hasLoadedBackupIdOptions.set(!0),this.isLoadingRestoreBackupIdOptions.set(!0),this.#s.getDuplicatiStorageBackups(t).pipe(cn(a=>(console.error("Error loading Duplicati storage backups",a),Ve([]))),Be(()=>this.isLoadingRestoreBackupIdOptions.set(!1)))):Ve([]))),{initialValue:[]});isConnectedToConsole=R(()=>this.#o.state()==="connected");hasStorageApiKey=R(()=>{let t=this.destinationForm();return(this.#n.serverSettings()?.["remote-control-storage-api-id"]??"").length>0||t.advanced["duplicati-auth-apiid"]});isAuthenticatingFilen=h(!1);hasFilenApiKey=R(()=>{let e=this.destinationForm().advanced["api-key"];return e&&e.length>0});nonSelectedAdvancedFormViews=R(()=>{let t=this.destinationFormConfig();if(!t)return[];let e=this.advancedFormFieldNames();return t.advanced.filter(n=>e.findIndex(o=>o===n.name)===-1)});destinationTypeEffect=q(()=>{let t=this.targetUrl(),e=Pe(t??""),n=e.key,o=e.customKey??n,a=this.#i.allModules().find(v=>v.Key===n)??{Key:n,DisplayName:e.displayName,Description:e.description,Options:[]};if(!a||!a.Options||!n)return;let _=e&&e.oauthField?e.oauthField:null,d=e&&e.customFields?e.customFields:{},m=e&&e.dynamicFields?e.dynamicFields:[],N=e&&e.advancedFields?e.advancedFields:[],F=e&&e.ignoredAdvancedFields?e.ignoredAdvancedFields:[],A={destinationType:o,oauthField:_,custom:[],dynamic:[],advanced:[]};d&&Object.entries(d).forEach(([v,D],K)=>{let J=D.order??K,b=D.validate;!b&&D.type==="Bucketname"&&(b=w=>bn(w)?null:{type:"error",message:$localize`Invalid bucket name.`}),b&&D.type==="Hostname"&&(b=w=>wn(w)?null:{type:"error",message:$localize`Invalid hostname.`}),A.custom.push(W({order:900+J,validate:b},D))});for(let v=0;v<a.Options.length;v++){let D=a.Options[v];if(D.Deprecated)continue;let K=m.find(J=>J===D.Name||D.Aliases?.includes(J.name)||J.name===D.Name);if(K){let J=D.Aliases?.indexOf(K.name)??-1,b=D.Aliases&&J>-1?D.Aliases[J]:D.Name,w=K&&typeof K!="string",Me=w?K?.defaultValue??D.DefaultValue:D.DefaultValue,xe=w&&K?.order!==void 0?K.order:v,B={name:b,type:D.Type,shortDescription:D.ShortDescription??void 0,longDescription:D.LongDescription??void 0,options:D.ValidValues,order:900+xe},ze=w?W(W({},B),K):B;A.dynamic.push(ze)}else{let J=D.Name;if(F.find(Re=>Re===J))continue;let w=N.find(Re=>Re===J||Re.name===J),Me=w&&typeof w!="string",xe=Me&&w?.order!==void 0?w.order:v,B={name:J,type:D.Type,shortDescription:D.ShortDescription??void 0,longDescription:D.LongDescription??void 0,options:D.ValidValues,defaultValue:D.DefaultValue,order:900+xe},ze=Me?W(W({},B),w):B;A.advanced.push(ze)}}if(A.custom.sort((v,D)=>v.order-D.order),A.dynamic.sort((v,D)=>v.order-D.order),A.advanced.sort((v,D)=>v.order-D.order),this.destinationFormConfig.set(A),!t)return;let L=bt(t);L&&this.destinationForm.set({custom:L.custom,dynamic:L.dynamic,advanced:L.advanced})});destinationFormEffect=q(()=>{let t=this.#l,e=this.destinationForm(),n=this.refreshView();if(!e||!t)return;let o=Rn({destinationType:t,custom:e.custom,dynamic:e.dynamic,advanced:e.advanced});o&&this.targetUrl.set(o)});getFieldValue(t,e){let o=this.destinationForm()[t][e];return o||null}getFormView(t,e){let o=this.destinationFormConfig()?.[t].find(a=>a.name===e);return o||null}getDefaultFormView(t){return{name:t,type:"String",shortDescription:t,longDescription:$localize`This is an undocumented option.`}}getFieldGroup(t,e){return t[e]}hasLeadingSlash(t){return t?.startsWith("/")??!1}addAdvancedOption(t){let e=this.destinationForm();e.advanced[t.name]=t.defaultValue,this.destinationForm.set(W({},e))}isTrue(t){if(typeof t=="boolean")return t;if(typeof t=="string"){let e=t.toLowerCase();return e==="true"||e==="1"||e==="yes"||e==="on"}return!1}onKeyDown(t,e,n,o){if(n==="Hostname"||n==="Bucketname"){if(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Home","End"].includes(o.key))return;if(o.key=="/"||o.key=="\\"||o.key==":"){o.preventDefault();return}}}updateFieldValue(t,e,n){let o=this.destinationForm();o[t][e]=n,this.destinationForm.set(W({},o))}removeAdvancedOption(t){let e=this.destinationForm();delete e.advanced[t],this.destinationForm.set(W({},e))}mapOptions(t){let e=t.loadOptions;if(e)return e(this.injector)();let n=t.options;return n?n.map(o=>({key:o,value:o})):null}mapOptionsWithFreeText(t,e){let n=this.mapOptions(t);return n?(e&&e.length>0&&(n.find(a=>a.value===e)||n.push({key:e,value:e})),n):null}#r=h(!1);oauthStartTokenCreation(t,e,n,o){this.#r.set(!0);let a=(o??1)==2?this.#t.defaultOAuthUrlV2():this.#t.defaultOAuthUrl(),_=this.#n.serverSettings()?.["--oauth-url"];if(_&&_.length>0&&(a=_),this.useBackupState()){let D=this.#e.mapFormsToSettings().find(K=>K.Name==="--oauth-url")?.Value;D&&D.length>0&&(a=D)}let d=this.destinationForm().advanced["oauth-url"];d&&d.length>0&&(a=d);let m=`${a}?type=${t}`,N=450,F=600,A=screen.width/2-N/2,L=screen.height/2-F/2,v=window.open(m,"_blank","height="+F+",width="+N+",menubar=0,status=0,titlebar=0,toolbar=0,left="+A+",top="+L);return window.addEventListener("message",D=>{let K=D.data.startsWith("authid:"),J=K?D.data.replace("authid:",""):null;K&&(this.destinationForm.update(b=>(b[e][n]=J,b)),this.#r.set(!1),this.refreshView.set(!this.refreshView()),v?.close())}),!1}settingsAsText=R(()=>{let t=this.destinationForm().advanced;return Object.entries(t).map(([e,n])=>{let o=e??"",a="";return typeof n=="boolean"?a=this.isTrue(n)?"True":"False":(typeof n=="number"||n!=null)&&(a=n.toString()),`${o}=${a}`}).join(`
4
- `)});updateSettingsFromText(t){if(typeof t!="string")return;let e=Ln(t);this.destinationForm.update(n=>oe(W({},n),{advanced:e}))}getIsDisabled(t){return document.getElementById(t)?.disabled??!0}toggleDisabled(t){let e=document.getElementById(t);e&&(e.disabled=!e.disabled)}openConsole(){this.#o.openConsole()}#_(t){var e=this.useBackupState()?this.#e.backupId():null;this.isAuthenticatingFilen.set(!0),this.#s.getFilenApiKey(t,e).pipe(Be(()=>this.isAuthenticatingFilen.set(!1))).subscribe({next:n=>{if(n.length===0){this.#a.open(ne,{data:{title:$localize`Authentication failed`,message:$localize`No API key was returned from the Filen server.`,confirmText:$localize`OK`}});return}this.destinationForm.update(o=>(o.advanced["api-key"]=n,o.dynamic["two-factor-code"]=null,o)),this.refreshView.set(!this.refreshView())},error:n=>{console.error("Error authenticating Filen",n),this.#a.open(ne,{data:{title:$localize`Authentication failed`,message:$localize`An error occurred while requesting the Filen API key: ${n.message}`,confirmText:$localize`OK`}})}})}authenticateFilen(){let t=this.targetUrl();if(!t)return;let n=this.destinationForm().advanced["api-key"];if(n&&n.length>0){this.#a.open(ne,{data:{title:$localize`Confirm re-authenticate?`,message:$localize`You already have an API key. Are you sure you want to re-authenticate?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:o=>{if(o){var a=new URL(t);a.searchParams.delete("api-key"),this.#_(a.toString())}}});return}this.#_(t)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=z({type:i,selectors:[["app-single-destination"]],inputs:{targetUrl:[1,"targetUrl"],useBackupState:[1,"useBackupState"]},outputs:{targetUrl:"targetUrlChange"},decls:3,vars:3,consts:()=>{let t;t=$localize`Advanced options`;let e;e=$localize` Show editor ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let n;n=$localize` Add advanced option ${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let o;o=$localize`This field is mandatory`;let a;a=$localize`This field is mandatory`;let _;_=$localize`This field is mandatory`;let d;d=$localize`An empty path means storing data in the initial or root folder, which is not recommended`;let m;m=$localize`This field is mandatory`;let N;N=$localize`This field is mandatory`;let F;F=$localize`This field is mandatory`;let A;A=$localize`This field is mandatory`;let L;L=$localize`This field is mandatory`;let v;v=$localize`This field is mandatory`;let D;D=$localize`This field is mandatory`;let K;K=$localize`This field is mandatory`;let J;J=$localize`Loading available backups...`;let b;b=$localize`No backups found from this machine, contact support`;let w;w=$localize` Try again `;let Me;Me=$localize`This field is mandatory`;let xe;xe=$localize`Pick the backup to restore from`;let B;B=$localize`This field is mandatory`;let ze;ze=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:pencil${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let Re;Re=$localize`${"[\uFFFD#2\uFFFD|\uFFFD#3\uFFFD]"}:START_TAG_DIV:An API key with storage access is required to use Duplicati storage.${"[\uFFFD/#2\uFFFD|\uFFFD/#3\uFFFD]"}:CLOSE_TAG_DIV:${"[\uFFFD#2\uFFFD|\uFFFD#3\uFFFD]"}:START_TAG_DIV:Visit the console and assign an API key to this machine.${"[\uFFFD/#2\uFFFD|\uFFFD/#3\uFFFD]"}:CLOSE_TAG_DIV:`,Re=Ke(Re);let tn;tn=$localize` Visit console ${"\uFFFD#6\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_ICON:`;let nn;nn=$localize`Connect to the console to use Duplicati storage.`;let on;on=$localize` Connect now ${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let an;an=$localize`This field is mandatory`;let ln;return ln=$localize` Authenticate now ${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["fieldTemplate",""],["validateTemplate",""],["option",""],["enumOptionTemplate",""],["nonValidatedOptionTemplate",""],["optionTemplate",""],["backupIdOptionTemplate",""],t,e,n,J,b,w,xe,ze,Re,tn,nn,on,ln,[1,"advanced-options",3,"disableToggle"],["title",""],["shButton","","type","button",1,"outlined","small"],[1,"actions"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModel","ngModelOptions"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["shButton","","type","button",1,"outlined","small",3,"click"],[3,"searchable"],["shButton","","type","button",1,"outlined","small",3,"disabled"],["menu",""],["type","button"],["shButton","","type","button",1,"small"],["shButton","","type","button",1,"small",3,"click"],["type","button",3,"click"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModelChange","ngModel","ngModelOptions"],[1,"field-row"],[3,"startingPath","accepts","showFiles","hideShortcuts","showHiddenNodes","selectFiles","resolvePaths"],[3,"hideShortcuts","enableCreateFolder","startingPath","resolvePaths"],[3,"inputType","ngModel","customId"],[1,"primary","raised"],[3,"ngModel","customId","placeholder"],["shButton","","type","button",1,"outlined"],[3,"for"],["shTooltip",o],[1,"primary",3,"shTooltip"],["type","text",3,"ngModelChange","id","ngModel"],["shTooltip",a],["shTooltip",_],["shTooltip",d,1,"warn"],["autocomplete","off",3,"keydown","ngModelChange","type","id","ngModel"],["prefix","",3,"error","warn","shTooltip"],["prefix",""],["prefix","",3,"shTooltip"],["shTooltip",m],["autocomplete","new-password",3,"ngModelChange","type","id","ngModel"],["prefix","",1,"link"],["suffix","",1,"clickable"],["prefix","",1,"link",3,"click"],["suffix","",1,"clickable",3,"click"],["label","key","value","value",3,"options","isClearable","optionTemplate"],["shTooltip",N],[1,"indeterminate","primary"],["label","key","value","value",3,"options","asFreeText","inlineSearch","optionTemplate"],["shTooltip",F],[3,"ngModelChange","inputType","ngModel","customId"],["shTooltip",A],["shTooltip",L],["type","number",3,"ngModelChange","id","ngModel"],["type","checkbox",3,"change","checked"],["key","key","value","value",1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["shTooltip",v],["type","text","id","text",3,"ngModelChange","ngModel"],["shTooltip",D],[3,"ngModelChange","ngModel","customId","placeholder"],["shTooltip",K],[1,"duplicati-backup-id"],[1,"duplicati-backup-id-console"],[1,"no-backups-found"],[3,"options","isClearable"],["shTooltip",Me],["shTooltip",B],["autocomplete","off",3,"ngModelChange","type","id","ngModel","placeholder","disabled"],["shButton","","type","button",1,"outlined",3,"click"],[1,"info"],["shButton","","type","button",1,"outlined",3,"routerLink"],[1,"filen-2fa-setup"],["shTooltip",an],["type","text","autocomplete","off",3,"ngModelChange","id","ngModel"],["shButton","","type","button",1,"outlined",3,"click","disabled"],[1,"error",3,"shTooltip"],[1,"warn",3,"shTooltip"]]},template:function(e,n){if(e&1&&(de(0)(1),g(2,Ia,18,5)),e&2){let o=j(n.destinationType());c();let a=j(n.destinationFormConfig());c(),C(o&&a?2:-1)}},dependencies:[qe,ee,ht,te,se,re,Tn,Sn,Ye,Gt,Gn,Bt,ue,Y,Q,Ot,Qe,$e,Mt,ve,It,Pt],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.advanced-options[_ngcontent-%COMP%]{position:relative;z-index:1}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}label[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1rem}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.raw-text-area[_ngcontent-%COMP%]{min-height:12rem;white-space:pre}.filen-2fa-setup[_ngcontent-%COMP%], .duplicati-backup-id[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:8px;align-items:flex-end}.duplicati-backup-id[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{width:100%}.duplicati-backup-id-console[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:8px;align-items:center}.duplicati-backup-id-console[_ngcontent-%COMP%] .info[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:4px}.no-backups-found[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-left:4px;margin-right:4px}"],changeDetection:0})};var Jt=class i{#e=O(xt);#t=O(Ge);#n=O(ge);testDestination(t,e,n,o,a,_,d,m,N){return this.#n.hasV2TestOperations()?this.testDestinationv2(t,e,n,o,a,_,d,m,N):this.testDestinationv1(t,e,n,o,a,_,d,m,N)}testDestinationv2(t,e,n,o,a,_,d,m,N){return new ct(F=>{this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:t,ConnectionStringId:n??null,BackupId:e=="new"?null:e,AutoCreate:m==="create",ReadOnlyTest:N,Options:null,DestinationType:_,SourcePrefix:e=="new"?null:o}}).subscribe({next:A=>{if(A.Success){this.emitSuccessV2(F,t,a,A);return}this.handleGenericError(F,t,a,A.Error??"Unknown error",d)},error:A=>{let L=A?.error?.body??A?.error?.requestBody;if(L?.Data?.FolderExists===!1||L?.StatusCode==="missing-folder"){this.handleMissingFolder(F,t,e,n,a,d,m,N);return}if(L?.Data?.HostCertificate){this.handleMissingCertificate(F,t,a,L.Data?.HostCertificate,d);return}if(L?.Data?.ReportedHostKey){this.handleIncorrectKey(F,t,a,L.Data.ReportedHostKey,L.Data.AcceptedHostKey??null,d);return}this.handleGenericError(F,t,a,A?.message??"Unknown error",d)}})})}testDestinationv1(t,e,n,o,a,_,d,m,N){return new ct(F=>{this.#e.postApiV1RemoteoperationTest({requestBody:{path:t,backupId:e=="new"?null:e,connectionStringId:n??null,sourcePrefix:e=="new"?null:o},type:_}).subscribe({next:A=>{F.next({action:"success",targetUrl:t,testAgain:!1,destinationIndex:a}),F.complete()},error:A=>{this.handleDestinationErrorv1(A.message,t,e,n,a,d,m,N).subscribe(L=>{F.next(L)})}})})}handleMissingFolder(t,e,n,o,a,_,d,m){function N(){t.next({action:"missing-folder",targetUrl:e,testAgain:!1,destinationIndex:a,errorMessage:$localize`The remote destination folder does not exist.`}),t.complete()}if(_||d==="error"){N();return}this.#t.open(ne,{data:{title:$localize`Create folder`,message:$localize`The remote destination folder does not exist, do you want to create it?`,confirmText:$localize`Create folder`,cancelText:$localize`Cancel`},closed:F=>{if(!F){this.reportNoAction(t,e,a,$localize`The remote folder does not exist.`);return}this.#n.hasV2TestOperations()?this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:e,ConnectionStringId:o,AutoCreate:!0,ReadOnlyTest:m,Options:null,BackupId:n=="new"?null:n}}).subscribe({next:A=>{if(A.Success){this.emitSuccessV2(t,e,a,A);return}else this.handleFolderCreateFailure(t,e,a,A.Error??$localize`Unknown error`)},error:A=>{this.handleFolderCreateFailure(t,e,a,A.message??$localize`Unknown error`)}}):this.#e.postApiV1RemoteoperationCreate({requestBody:{path:e,backupId:n=="new"?null:n}}).subscribe({next:()=>{this.handleFolderCreated(t,e,a)},error:A=>{this.handleFolderCreateFailure(t,e,a,A.message??$localize`Unknown error`)}})}})}handleFolderCreateFailure(t,e,n,o){this.#t.open(ne,{data:{title:$localize`Error creating folder`,message:$localize`The remote destination folder could not be created. ${o}`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:n}),t.complete()}})}emitSuccessV2(t,e,n,o){t.next({action:"success",targetUrl:e,testAgain:!1,destinationIndex:n,anyFilesFound:!o.Data?.FolderIsEmpty,containsBackup:o.Data?.FolderContainsBackupFiles??void 0,containsEncryptedBackupFiles:o.Data?.FolderContainsEncryptedBackupFiles??void 0}),t.complete()}handleFolderCreated(t,e,n){this.#t.open(ne,{data:{title:$localize`Folder created`,message:$localize`The remote destination folder was created successfully.`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"test-again",targetUrl:e,testAgain:!0,destinationIndex:n}),t.complete()}})}reportNoAction(t,e,n,o){t.next({action:"generic-error",targetUrl:e,errorMessage:o,testAgain:!1,destinationIndex:n}),t.complete()}handleMissingCertificate(t,e,n,o,a){let _=$localize`The server is using a certificate that is not trusted.
5
- If this is a self-signed certificate, you can choose to trust this certificate.
6
- The server reported the certificate hash: ${o}`,d=e.includes("?");function m(){t.next({action:"trust-cert",targetUrl:e,suggestedUrl:e+`${d?"&":"?"}accept-specified-ssl-hash=${o}`,testAgain:!0,certData:o,errorMessage:_,destinationIndex:n}),t.complete()}if(a){m();return}this.#t.open(ne,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:_,confirmText:$localize`Trust the certificate`,cancelText:$localize`Cancel`},closed:N=>{if(!N){this.reportNoAction(t,e,n,$localize`The server certificate is not trusted.`);return}m()}})}handleIncorrectKey(t,e,n,o,a,_){if(a){let F=function(){t.next({action:"approve-host-key",targetUrl:e,suggestedUrl:N,testAgain:!0,reportedHostKey:o,errorMessage:m,destinationIndex:n}),t.complete()};var d=F;let m=$localize`The host key has changed, please check with the server administrator if this is correct,
7
- otherwise you could be the victim of a MAN-IN-THE-MIDDLE attack.
8
- Do you want to REPLACE your CURRENT host key ${a}
9
- with the REPORTED host key: ${o}?`,N=e;try{let L=new URL(e);L.searchParams.set("ssh-fingerprint",o),N=L.toString()}catch{let L=e.replace(/([?&])ssh-fingerprint=[^&]*/,""),v=L.includes("?");N=L+`${v?"&":"?"}ssh-fingerprint=${o}`}if(_){F();return}this.#t.open(ne,{maxWidth:"500px",data:{title:$localize`The host key has changed`,message:m,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:L=>{if(!L){this.reportNoAction(t,e,n,$localize`The host key was not approved.`);return}F()}})}else{let F=function(){t.next({action:"approve-host-key",targetUrl:e,suggestedUrl:e+`${N?"&":"?"}ssh-fingerprint=${o}`,testAgain:!0,reportedHostKey:o,errorMessage:m,destinationIndex:n}),t.complete()};var d=F;let m=$localize`No certificate was specified, please verify that the reported host key is correct: ${o}`,N=e.includes("?");if(_){F();return}this.#t.open(ne,{maxWidth:"500px",data:{title:$localize`Approve host key?`,message:m,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:A=>{if(!A){this.reportNoAction(t,e,n,$localize`The host key was not approved.`);return}F()}})}}handleGenericError(t,e,n,o,a){function _(){t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:n,errorMessage:o}),t.complete()}if(a){_();return}this.#t.open(ne,{maxWidth:"500px",data:{title:$localize`Test connection failed`,message:o,cancelText:$localize`OK`},closed:d=>_()})}handleDestinationErrorv1(t,e,n,o,a,_,d,m){return new ct(N=>{if(t==="missing-folder"){this.handleMissingFolder(N,e,n,o,a,_,d,m);return}if(t.startsWith("incorrect-cert:")){let F=t.split("incorrect-cert:")[1];this.handleMissingCertificate(N,e,a,F,_);return}if(t.startsWith("incorrect-host-key:")){let F=t.split('incorrect-host-key:"')[1].split('",')[0],A=t.split('accepted-host-key:"')[1].split('",')[0];this.handleIncorrectKey(N,e,a,F,A,_);return}this.handleGenericError(N,e,a,t,_)})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=Ne({token:i,factory:i.\u0275fac,providedIn:"root"})};function Pa(i,t){if(i&1){let e=I();l(0,"sh-alert",13),M(1,0),l(2,"button",14),T("click",function(){S(e);let o=s(2);return f(o.testDestinationClick())}),r(),x(),r()}}function Oa(i,t){i&1&&(l(0,"sh-alert",13),M(1,1),P(2,"sh-icon"),l(3,"div",15),P(4,"sh-spinner"),r(),x(),r()),i&2&&(c(4),Ct("--spinner-size","16px")("--spinner-thickness","2px"))}function Ma(i,t){i&1&&(l(0,"sh-alert",17),y(1,2),r())}function xa(i,t){i&1&&(l(0,"sh-alert",16),y(1,3),r())}function Ra(i,t){if(i&1&&g(0,Ma,2,0,"sh-alert",17)(1,xa,2,0,"sh-alert",16),i&2){let e,n=s(4);C((e=n.testResponse())!=null&&e.containsBackup?0:1)}}function La(i,t){i&1&&(l(0,"sh-alert",18),y(1,4),r())}function ba(i,t){i&1&&(l(0,"sh-alert",16),y(1,5),r())}function wa(i,t){i&1&&(l(0,"sh-alert",17),y(1,6),r())}function Ga(i,t){if(i&1&&g(0,La,2,0,"sh-alert",18)(1,ba,2,0,"sh-alert",16)(2,wa,2,0,"sh-alert",17),i&2){let e,n=s(4);C((e=n.testResponse())!=null&&e.containsBackup?0:(e=n.testResponse())!=null&&e.anyFilesFound?1:2)}}function $a(i,t){i&1&&(l(0,"sh-alert",17),y(1,7),r())}function va(i,t){i&1&&(l(0,"sh-alert",16),y(1,8),r())}function Ua(i,t){if(i&1&&g(0,$a,2,0,"sh-alert",17)(1,va,2,0,"sh-alert",16),i&2){let e,n=s(4);C((e=n.testResponse())!=null&&e.anyFilesFound?0:1)}}function ka(i,t){i&1&&(l(0,"sh-alert",17),y(1,9),r())}function Va(i,t){i&1&&(l(0,"sh-alert",17),y(1,10),r())}function Ba(i,t){i&1&&(l(0,"sh-alert",17),y(1,11),r())}function Ka(i,t){if(i&1&&g(0,ka,2,0,"sh-alert",17)(1,Va,2,0,"sh-alert",17)(2,Ba,2,0,"sh-alert",17),i&2){let e,n=s(4);C((e=n.testResponse())!=null&&e.containsBackup?0:(e=n.testResponse())!=null&&e.anyFilesFound?1:2)}}function Ja(i,t){if(i&1&&g(0,Ra,2,1)(1,Ga,3,1)(2,Ua,2,1)(3,Ka,3,1),i&2){let e=s(3);C(e.testExpectation()==="containsBackup"?0:e.testExpectation()==="destinationEmpty"?1:e.testExpectation()==="destinationNotEmpty"?2:3)}}function Xa(i,t){if(i&1){let e=I();M(0,12,1),l(1,"button",14),T("click",function(){S(e);let o=s(4);return f(o.createFolder())}),r(),x()}}function za(i,t){if(i&1&&(l(0,"sh-alert",16),M(1,12),g(2,Xa,2,0,"button",19),x(),r()),i&2){let e=s(3);c(2),C(e.askToCreate()?2:-1)}}function Wa(i,t){if(i&1){let e=I();l(0,"sh-alert",16),p(1),l(2,"button",14),T("click",function(){S(e);let o=s(3);return f(o.useSuggestedUrl())}),p(3,"Approve"),r()()}if(i&2){let e,n=s(3);c(),V(" ",(e=n.testResponse())==null?null:e.errorMessage," ")}}function Ha(i,t){if(i&1){let e=I();l(0,"sh-alert",16),p(1),l(2,"button",14),T("click",function(){S(e);let o=s(3);return f(o.useSuggestedUrl())}),p(3,"Approve"),r()()}if(i&2){let e,n=s(3);c(),V(" ",(e=n.testResponse())==null?null:e.errorMessage," ")}}function ja(i,t){if(i&1){let e=I();l(0,"sh-alert",16),p(1),l(2,"button",14),T("click",function(){S(e);let o=s(3);return f(o.testDestinationClick())}),p(3,"Test again"),r()()}if(i&2){let e,n=s(3);c(),V(" ",(e=n.testResponse())==null?null:e.errorMessage," ")}}function qa(i,t){if(i&1&&g(0,Ja,4,1)(1,za,3,1,"sh-alert",16)(2,Wa,4,1,"sh-alert",16)(3,Ha,4,1,"sh-alert",16)(4,ja,4,1,"sh-alert",16),i&2){let e,n=s(2);C(((e=n.testResponse())==null?null:e.action)==="success"?0:((e=n.testResponse())==null?null:e.action)==="missing-folder"?1:((e=n.testResponse())==null?null:e.action)==="trust-cert"?2:((e=n.testResponse())==null?null:e.action)==="approve-host-key"?3:((e=n.testResponse())==null?null:e.action)==="generic-error"?4:-1)}}function Qa(i,t){if(i&1&&g(0,Pa,3,0,"sh-alert",13)(1,Oa,5,4,"sh-alert",13)(2,qa,5,1),i&2){let e=s();C(e.testSignal()===null?0:e.testSignal()==="testing"?1:2)}}var Xt=class i{#e=O(Jt);targetUrl=be.required();testSignal=be.required();connectionStringId=G(null);backupId=G.required();sourcePrefix=G.required();suppressErrorDialogs=G.required();askToCreate=G.required();readOnlyTest=G.required();testExpectation=G.required();moduleType=G.required();testResponse=R(()=>{let t=this.testSignal();return t&&typeof t!="string"?t:null});isExpectedValidTargetUrl=R(()=>{let t=this.targetUrl();return!(!t||!bt(t))});prevTargetUrl=null;targetUrlEffect=q(()=>{let t=this.targetUrl(),e=this.prevTargetUrl;t!==e&&(this.prevTargetUrl=t,this.testSignal()!=="testing"&&e!==null&&this.testSignal.set(null))});useSuggestedUrl(){let t=this.targetUrl(),e=this.testSignal(),n=e&&typeof e!="string"?e?.targetUrl:null,o=e&&typeof e!="string"?e?.suggestedUrl:null;return!t||!o||n!==t||(this.targetUrl.set(o),this.testDestinationClick()),!1}createFolder(){return this.testDestination(!0),!1}testDestinationClick(){return this.testDestination(!1),!1}testDestination(t){let e=this.targetUrl();if(!e)return;this.testSignal.set("testing");let n=t?"create":this.askToCreate()?"prompt":"error";return new Promise(o=>{this.#e.testDestination(e,this.backupId(),this.connectionStringId(),this.sourcePrefix(),0,this.moduleType(),this.suppressErrorDialogs(),n,this.readOnlyTest())?.subscribe({next:a=>{if(!this.suppressErrorDialogs()&&a.testAgain){let _=a.suggestedUrl;_&&this.targetUrl.set(_),this.testSignal.set("testing"),this.#e.testDestination(_??e,this.backupId(),this.connectionStringId(),this.sourcePrefix(),0,this.moduleType(),this.suppressErrorDialogs(),n,this.readOnlyTest())?.subscribe({next:d=>{this.testSignal.set(d),o(d)}})}else this.testSignal.set(a),o(a)}})})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=z({type:i,selectors:[["app-test-url"]],inputs:{targetUrl:[1,"targetUrl"],testSignal:[1,"testSignal"],connectionStringId:[1,"connectionStringId"],backupId:[1,"backupId"],sourcePrefix:[1,"sourcePrefix"],suppressErrorDialogs:[1,"suppressErrorDialogs"],askToCreate:[1,"askToCreate"],readOnlyTest:[1,"readOnlyTest"],testExpectation:[1,"testExpectation"],moduleType:[1,"moduleType"]},outputs:{targetUrl:"targetUrlChange",testSignal:"testSignalChange"},decls:1,vars:1,consts:()=>{let t;t=$localize` Make sure to test the configuration ${"\uFFFD#2\uFFFD"}:START_TAG_BUTTON:Test now${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_BUTTON:`;let e;e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD#3\uFFFD"}:START_TAG_DIV: Testing connection... ${"\uFFFD#4\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_SPINNER:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_DIV:`;let n;n=$localize`Success! Test completed, backup found.`;let o;o=$localize`No backup found at the specified destination.`;let a;a=$localize` The remote destination already contains a backup. Please use a different folder for each backup. `;let _;_=$localize` The remote destination is not empty. It is recommended to use an empty folder for the backup. `;let d;d=$localize`Success! Test completed, destination is empty.`;let m;m=$localize`Success! Test completed, destination contains files.`;let N;N=$localize`The remote destination is empty.`;let F;F=$localize`Success! Test completed, backup found.`;let A;A=$localize`Success! Test completed, destination contains files.`;let L;L=$localize`Success! Test completed, destination is empty.`;let v;return v=$localize` The specified folder does not exist. ${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON:Create now${"\uFFFD/#1:1\uFFFD"}:CLOSE_TAG_BUTTON:${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:`,[t,e,n,o,a,_,d,m,N,F,A,L,v,[1,"simple","primary"],["shButton","",1,"primary","small",3,"click"],[1,"testing"],[1,"simple","warn"],[1,"simple","success"],[1,"simple","error"],["shButton","",1,"primary","small"]]},template:function(e,n){e&1&&g(0,Qa,3,1),e&2&&C(n.isExpectedValidTargetUrl()?0:-1)},dependencies:[yt,Y,Q,Pt],styles:["[_nghost-%COMP%]{display:block}.testing[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:8px;justify-content:space-between}"],changeDetection:0})};function Ya(i,t){if(i&1){let e=I();l(0,"app-destination-list",10),T("setDestination",function(o){S(e);let a=s();return f(a.setDestination(o))}),r()}if(i&2){let e=s();u("showAsSources",!0)("moduleType",e.moduleType())}}function Za(i,t){if(i&1){let e=I();l(0,"app-destination-list-item",11)(1,"button",8),T("click",function(){S(e);let o=s();return f(o.removeDestination())}),y(2,3),r()(),l(3,"app-test-url",12),k("targetUrlChange",function(o){S(e);let a=s();return $(a.targetUrlModel,o)||(a.targetUrlModel=o),f(o)})("testSignalChange",function(o){S(e);let a=s();return $(a.testSignal,o)||(a.testSignal=o),f(o)}),r(),l(4,"app-single-destination",13),k("targetUrlChange",function(o){S(e);let a=s();return $(a.targetUrlModel,o)||(a.targetUrlModel=o),f(o)}),r()}if(i&2){let e=s();u("targetUrl",e.targetUrlModel()),c(3),U("targetUrl",e.targetUrlModel)("testSignal",e.testSignal),u("backupId",e.backupId())("sourcePrefix",e.sourcePrefix())("suppressErrorDialogs",e.suppressErrorDialogs())("askToCreate",e.askToCreate())("testExpectation",e.expectedResult())("readOnlyTest",!0)("moduleType",e.moduleType()),c(),U("targetUrl",e.targetUrlModel)}}function el(i,t){i&1&&y(0,2,1)}function tl(i,t){i&1&&y(0,2,2)}function nl(i,t){i&1&&y(0,2,3)}function il(i,t){i&1&&y(0,2,4)}var st=class i{data=G();closed=Le();targetUrlModel=h(null);moduleType=h("Backend");askToCreate=h(!1);expectedResult=h("any");suppressErrorDialogs=h(!1);backupId=h(null);sourcePrefix=h(null);dataEffect=q(()=>{let t=this.data();t?.targetUrlModel&&this.targetUrlModel.set(t.targetUrlModel),t?.moduleType&&this.moduleType.set(t.moduleType),t?.askToCreate!==null&&t?.askToCreate!==void 0&&this.askToCreate.set(t.askToCreate),t?.expectedResult&&this.expectedResult.set(t.expectedResult),t?.suppressErrorDialogs!==null&&t?.suppressErrorDialogs!==void 0&&this.suppressErrorDialogs.set(t.suppressErrorDialogs),t?.backupId&&this.backupId.set(t.backupId),t?.sourcePrefix&&this.sourcePrefix.set(t.sourcePrefix)});testSignal=h(null);setTargetUrl(t,e=!1){this.targetUrlModel.set(t)}setDestination(t){let e=Lt(t??"");if(e){if(e.mapper.default){let n=e.mapper.default("");this.setTargetUrl(n,!0);return}this.setTargetUrl(`${t}://`,!0)}}submit(){this.closed.emit(this.targetUrlModel())}removeDestination(){this.setTargetUrl(null,!0)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=z({type:i,selectors:[["app-target-url-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:15,vars:6,consts:()=>{let t;t=$localize`Remote source`;let e;e=$localize`Cancel`;let n;n=$localize`${"\uFFFD*11:1\uFFFD"}:START_BLOCK_IF: Use storage destination ${"\uFFFD/*11:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*12:2\uFFFD"}:START_BLOCK_ELSE_IF: Use remote source ${"[\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD]"}:CLOSE_BLOCK_ELSE_IF:${"\uFFFD*13:3\uFFFD"}:START_BLOCK_ELSE_IF_1: Use remote destination ${"[\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD]"}:CLOSE_BLOCK_ELSE_IF:${"\uFFFD*14:4\uFFFD"}:START_BLOCK_ELSE: Use remote URL ${"\uFFFD/*14:4\uFFFD"}:CLOSE_BLOCK_ELSE:`,n=Ke(n);let o;return o=$localize`Change`,[t,e,n,o,[1,"title-30"],["content",""],[3,"showAsSources","moduleType"],["footer","",1,"sticky"],["shButton","","type","button",3,"click"],["shButton","","type","button",1,"raised","primary",3,"click","disabled"],[3,"setDestination","showAsSources","moduleType"],[1,"current-destination",3,"targetUrl"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal","backupId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","readOnlyTest","moduleType"],[3,"targetUrlChange","targetUrl"]]},template:function(e,n){if(e&1&&(l(0,"header")(1,"h3",4),y(2,0),r()(),l(3,"section",5),g(4,Ya,1,2,"app-destination-list",6),g(5,Za,5,11),r(),l(6,"footer",7)(7,"button",8),T("click",function(){return n.closed.emit(null)}),y(8,1),r(),l(9,"button",9),T("click",function(){return n.submit()}),M(10,2),g(11,el,1,0)(12,tl,1,0)(13,nl,1,0)(14,il,1,0),x(),r()()),e&2){let o=!!n.targetUrlModel();c(4),C(o?-1:4),c(),C(o?5:-1),c(4),Fe("loading",n.testSignal()==="testing"),u("disabled",!o||n.testSignal()===null||n.testSignal()==="testing"),c(2),C(n.moduleType()==="Backend"?11:n.moduleType()==="SourceProvider"?12:n.moduleType()==="RestoreDestinationProvider"?13:14)}},dependencies:[Kt,Vt,et,Y,Xt],styles:["[_nghost-%COMP%]{--dialog-p: 1.5rem;display:flex;flex-direction:column;gap:1rem}header[_ngcontent-%COMP%]{display:flex;padding:1.5rem 1.5rem 0}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}footer[_ngcontent-%COMP%]{z-index:1}"],changeDetection:0})};var ol=["formRef"],al=()=>({updateOn:"blur",standalone:!0}),Yt=()=>({standalone:!0});function ll(i,t){if(i&1){let e=I();l(0,"button",41),T("click",function(){S(e);let o=s(2);return f(o.openLocalDiskDialog())}),M(1,12),P(2,"sh-icon"),x(),r()}}function rl(i,t){if(i&1){let e=I();g(0,ll,3,0,"button",40),l(1,"button",41),T("click",function(){S(e);let o=s();return f(o.openRemoteDestinationDialog())}),M(2,11),P(3,"sh-icon"),x(),r()}if(i&2){let e=s();C(e.isLocalDiskSupported()?0:-1)}}function sl(i,t){i&1&&y(0,7,1)}function _l(i,t){i&1&&y(0,7,2)}function cl(i,t){i&1&&(l(0,"p",34),y(1,13),r())}function dl(i,t){i&1&&(l(0,"p",34),y(1,14),r())}function ul(i,t){if(i&1){let e=I();l(0,"sh-form-field")(1,"textarea",42),k("ngModelChange",function(o){S(e);let a=s();return $(a.bulkPaths,o)||(a.bulkPaths=o),f(o)}),T("ngModelChange",function(){S(e);let o=s();return f(o.savePathBulkEdit())}),r()()}if(i&2){let e=s();c(),U("ngModel",e.bulkPaths),u("ngModelOptions",Ae(2,al))}}function pl(i,t){if(i&1){let e=I();l(0,"sh-form-field",46)(1,"input",47),k("ngModelChange",function(o){S(e);let a=s(3);return $(a.editingPath,o)||(a.editingPath=o),f(o)}),r()(),l(2,"button",24),T("click",function(){S(e);let o=s(3);return f(o.updatePath())}),l(3,"sh-icon"),p(4,"floppy-disk"),r()(),l(5,"button",24),T("click",function(){S(e);let o=s(3);return f(o.cancelEditPath())}),l(6,"sh-icon"),p(7,"x-bold"),r()()}if(i&2){let e=s(3);c(),U("ngModel",e.editingPath),u("ngModelOptions",Ae(2,Yt))}}function ml(i,t){if(i&1&&(l(0,"sh-chip"),P(1,"img",48),p(2),r()),i&2){let e=s(2).$implicit,n=s(2);c(),u("src",n.getBackendIcon(e),pt),c(),V(" ",n.getRemotePathDisplayName(e)," ")}}function gl(i,t){if(i&1&&(l(0,"sh-form-field",46),P(1,"input",49),r()),i&2){let e=s(2).$implicit;gt("readonly",!0),c(),u("ngModel",e)("ngModelOptions",Ae(3,Yt))}}function Cl(i,t){if(i&1){let e=I();g(0,ml,3,2,"sh-chip")(1,gl,2,4,"sh-form-field",46),l(2,"button",24),T("click",function(){S(e);let o=s().$implicit,a=s(2);return f(a.editPath(o))}),l(3,"sh-icon"),p(4,"pen"),r()(),l(5,"button",24),T("click",function(){S(e);let o=s().$implicit,a=s(2);return f(a.removePath(o))}),l(6,"sh-icon"),p(7,"trash-simple"),r()()}if(i&2){let e=s().$implicit;C(e.startsWith("@")?0:1)}}function Tl(i,t){if(i&1&&(l(0,"div",43),g(1,pl,8,3)(2,Cl,8,1),r()),i&2){let e=t.$implicit,n=s(2);c(),C(n.oldPath()===e?1:2)}}function Sl(i,t){if(i&1){let e=I();fe(0,Tl,3,1,"div",43,Se),l(2,"div",39)(3,"sh-form-field"),P(4,"input",44),r(),l(5,"button",45),T("click",function(){S(e);let o=s();return f(o.addNewPath())}),l(6,"sh-icon"),p(7,"plus"),r()()()}if(i&2){let e=s();Ee(e.nonFilterPaths()),c(4),u("formControl",e.newPathCtrl)}}function fl(i,t){if(i&1){let e=I();l(0,"div",39)(1,"app-size",50),T("ngModelChange",function(o){S(e);let a=s();return f(a.updateFilesLargerThan(o))}),r()()}if(i&2){let e=s();c(),u("ngModel",e.filesLargerThan())("ngModelOptions",Ae(2,Yt))}}var nt=new Dt,Vn=(i={path:"",filters:[],excludes:{filesLargerThan:null}})=>nt.group({path:nt.control(i.path),excludes:nt.group({filesLargerThan:nt.group({size:nt.control(null),unit:nt.control(null)})})}),Qt=class i{#e=O(Oe);#t=O(Ge);#n=O(we);#i=O(je);#o=O(ge);formRef=Ie.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new hn("");filesLargerThan=R(()=>{let t=this.sourceDataFormSignal()?.excludes?.filesLargerThan??{};return t.size!==null&&t.unit!==null?`${t.size}${t.unit}`:null});osType=this.#e.osType;pathSignal=Ue(this.sourceDataForm.controls.path.valueChanges);pathArray=R(()=>this.pathSignal()?.split("\0").filter(t=>t.startsWith("-")||t.startsWith("+")||t==="___none___")??[]);nonFilterPaths=R(()=>this.pathSignal()?.split("\0").filter(t=>!t.startsWith("-")&&!t.startsWith("+")&&t!==""));oldPath=h(null);editingPath=h(null);addingNewPath=h(!1);bulkPathEditMode=h(!1);bulkPaths=h("");mobileMenuOpen=h(!1);isLocalDiskSupported=R(()=>this.#o.systemInfo()?.SourceProviderModules?.find(t=>t.Key=="diskimage"));filters=h([]);#s=q(()=>{let e=this.pathSignal()?.split("\0").filter(n=>n!=="___none___"&&(n.startsWith("-")||n.startsWith("+")))??[];this.filters.set(e)});openRemoteDestinationDialog(){this.#t.open(st,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{targetUrlModel:null,moduleType:"SourceProvider",askToCreate:!1,expectedResult:"destinationNotEmpty",suppressErrorDialogs:!0,backupId:null,sourcePrefix:null}}).component.closed.subscribe(e=>{if(!e)return;let n=Math.random().toString(36).substring(2,10),o=e.split("://")[0],_=`@${this.#o.systemInfo()?.DirectorySeparator==="\\"?"X:\\":"/"}dupl-${o}-${n}|${e}`;this.addPath(_)})}openLocalDiskDialog(){this.#t.open(rt,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{initialPath:null}}).closed.subscribe(e=>{if(!e)return;let n=Math.random().toString(36).substring(2,10),a=`@${this.#o.systemInfo()?.DirectorySeparator==="\\"?"X:\\":"/"}dupl-disk-${n}|diskimage://${e}`;this.addPath(a)})}togglePathBulkEdit(){if(this.bulkPathEditMode())this.bulkPathEditMode.set(!1);else{let t=this.nonFilterPaths()?.join(`
10
- `)??"";this.bulkPaths.set(t),this.bulkPathEditMode.set(!0)}}savePathBulkEdit(){let t=this.bulkPaths().split(`
11
- `).filter(a=>a.trim()!=="")??[],e=this.pathArray(),n=[...t,...e],o=[...new Set(n)].join("\0");this.sourceDataForm.controls.path.setValue(o)}editPath(t){if(t&&t.startsWith("@")){let e=t.split("|");if(e.length!==2)return;e[1].startsWith("diskimage://")?this.editLocalDiskSource(t,e[0],e[1].substring(12)):this.editTargetUrlPath(t,e[0],e[1]);return}this.oldPath.set(t),this.editingPath.set(t)}editLocalDiskSource(t,e,n){this.#t.open(rt,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{initialPath:n}}).closed.subscribe(a=>{if(!a)return;let _=`${e}|diskimage://${a}`,d=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(d?.replace(t,_)??"")})}editTargetUrlPath(t,e,n){this.#t.open(st,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{targetUrlModel:n,moduleType:"SourceProvider",askToCreate:!1,expectedResult:"destinationNotEmpty",suppressErrorDialogs:!0,backupId:this.#e.backupId(),sourcePrefix:e}}).closed.subscribe(a=>{if(!a)return;let _=`${e}|${a}`,d=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(d?.replace(t,_)??"")})}updateFilesLargerThan(t){let{size:e,unit:n}=wt(t);this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:e,unit:n})}updatePath(){let t=this.oldPath(),e=this.editingPath();if(!t||!e||e===t){this.oldPath.set(null),this.editingPath.set(null);return}let n=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(n?.replace(t,e)??""),this.oldPath.set(null),this.editingPath.set(null)}cancelEditPath(){this.oldPath.set(null),this.editingPath.set(null)}removePath(t){let n=(this.sourceDataForm.controls.path.value??"").split("\0"),o=n.indexOf(t);if(o===-1)return;n.splice(o,1);let a=n.filter(_=>_&&_!=="").join("\0");this.sourceDataForm.controls.path.setValue(a)}addPath(t){let n=[this.sourceDataForm.controls.path.value,t].filter(o=>o&&o!=="").join("\0");this.sourceDataForm.controls.path.setValue(n)}updateFilters(t){let n=[...this.nonFilterPaths()??[],...t].filter(o=>o&&o!=="").join("\0");this.sourceDataForm.controls.path.setValue(n)}getPath(){return this.sourceDataForm.value.path??null}getBackendIcon(t){if(!t)return"";let e=t.split("|")[1];return e.startsWith("diskimage:")?"assets/dest-icons/external-harddrive.png":Pe(e).icon??"database"}getRemotePathDisplayName(t){if(!t)return"";let e=t.split("|")[1];if(e.startsWith("diskimage:"))return $localize`Local disk`;let n=Pe(e);return n?n.displayName:"Unknown"}toggleFilesLargerThan(t){t?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let t=this.sourceDataForm.controls.path.value,e=this.newPathCtrl.value,n=t?.split("\0")||[];e&&!n.includes(e)&&n.push(e);let o=n.filter(a=>a&&a!=="").join("\0");this.sourceDataForm.controls.path.setValue(o),this.newPathCtrl.setValue("")}goBack(){this.#n.navigate(["destination"],{relativeTo:this.#i.parent})}next(){this.#e.shouldAutoSave()&&this.#e.submit(!0),this.#n.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=z({type:i,selectors:[["app-source-data"]],viewQuery:function(e,n){e&1&&De(n.formRef,ol,5),e&2&&ye()},decls:57,vars:16,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Source Data`;let n;n=$localize`Folder path`;let o;o=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let a;a=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let _;_=$localize`Options`;let d;d=$localize`Paths`;let m;m=$localize`${"\uFFFD#40\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#40\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD*41:1\uFFFD"}:START_BLOCK_IF: Edit contents as list ${"\uFFFD/*41:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*42:2\uFFFD"}:START_BLOCK_ELSE: Edit contents as text ${"\uFFFD/*42:2\uFFFD"}:CLOSE_BLOCK_ELSE:`;let N;N=$localize`Exclude`;let F;F=$localize`Choose if there’s any files you want to exclude.`;let A;A=$localize` Files larger than `;let L;L=$localize`${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:cloud-arrow-down${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON: Add remote path `;let v;v=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:hard-drive${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Add local disk `;let D;D=$localize`Manually add a path.`;let K;K=$localize`Edit paths as text, one per line.`;let J;J=$localize`Add a direct path`;let b;return b=$localize`Edit path`,[["formRef",""],e,n,o,a,_,d,m,N,F,A,L,v,D,K,[3,"submit","formGroup"],[1,"left"],[1,"header-row"],[1,"title-30"],["shButton","","type","button",1,"small","ghost","mobile-menu-toggle",3,"click"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",t,"formControlName","path"],[1,"form-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","submit",1,"raised","primary","small"],[1,"right"],[1,"mobile-header"],["shButton","","type","button",1,"small","ghost",3,"click"],[3,"disableToggle"],["title",""],[1,"spacer"],["shButton","","type","button",1,"small"],["menu",""],["description",""],[1,"paths"],[3,"filtersChange","filters","osType"],["formGroupName","excludes",3,"disableToggle"],[1,"raised","primary",3,"checkedChange","checked"],[1,"row-inputs"],["shButton","","type","button",1,"small","rowbutton"],["shButton","","type","button",1,"small","rowbutton",3,"click"],["wrap","off","rows","10",1,"bulk-textarea",3,"ngModelChange","ngModel","ngModelOptions"],[1,"path"],["type","text","placeholder",J,3,"formControl"],["shButton","","type","button",1,"raised","primary",3,"click"],[1,"small"],["type","text","placeholder",b,3,"ngModelChange","ngModel","ngModelOptions"],["alt","",1,"provider-icon",3,"src"],["type","text",3,"ngModel","ngModelOptions"],[3,"ngModelChange","ngModel","ngModelOptions"]]},template:function(e,n){if(e&1){let o=I();l(0,"form",15,0),T("submit",function(){return n.next()}),l(2,"div",16)(3,"div",17)(4,"h3",18),y(5,1),r(),l(6,"button",19),T("click",function(){return n.mobileMenuOpen.set(!0)}),l(7,"sh-icon"),p(8,"sliders"),r()()(),l(9,"app-file-tree",20)(10,"label",21),y(11,2),r(),P(12,"input",22),r(),l(13,"div",23)(14,"button",24),T("click",function(){return n.goBack()}),M(15,3),P(16,"sh-icon"),x(),r(),l(17,"button",25),M(18,4),P(19,"sh-icon"),x(),r()()(),l(20,"div",26)(21,"div",27)(22,"span",18),y(23,5),r(),l(24,"button",28),T("click",function(){return n.mobileMenuOpen.set(!1)}),l(25,"sh-icon"),p(26,"x-bold"),r()()(),l(27,"app-toggle-card",29),pe(28,30),l(29,"span"),y(30,6),r(),P(31,"div",31),g(32,rl,4,1),l(33,"sh-menu")(34,"button",32)(35,"sh-icon"),p(36,"dots-three-vertical"),r()(),pe(37,33),l(38,"button",24),T("click",function(){return n.togglePathBulkEdit()}),M(39,7),P(40,"sh-icon"),g(41,sl,1,0)(42,_l,1,0),x(),r(),ce(),r(),ce(),g(43,cl,2,0,"p",34)(44,dl,2,0,"p",34),l(45,"div",35),g(46,ul,2,3,"sh-form-field")(47,Sl,8,1),r()(),l(48,"app-filters",36),k("filtersChange",function(_){return S(o),$(n.filters,_)||(n.filters=_),f(_)}),T("filtersChange",function(_){return n.updateFilters(_)}),r(),l(49,"app-toggle-card",37),pe(50,30),y(51,8),ce(),l(52,"p",34),y(53,9),r(),l(54,"sh-toggle",38),T("checkedChange",function(_){return n.toggleFilesLargerThan(_)}),y(55,10),r(),g(56,fl,2,3,"div",39),r()()()}e&2&&(u("formGroup",n.sourceDataForm),c(9),u("multiSelect",!0)("startingPath",n.getPath())("showFiles",!0),c(11),Fe("open",n.mobileMenuOpen()),c(7),u("disableToggle",!0),c(5),C(n.bulkPathEditMode()?-1:32),c(9),C(n.bulkPathEditMode()?41:42),c(2),C(n.bulkPathEditMode()?44:43),c(3),C(n.bulkPathEditMode()?46:47),c(2),U("filters",n.filters),u("osType",n.osType()??""),c(),u("disableToggle",!0),c(5),u("checked",n.filesLargerThan()!==null),c(2),C(n.filesLargerThan()?56:-1))},dependencies:[se,Et,ee,te,ft,re,qe,Fn,Nt,Ft,Nn,ue,Q,Y,ve,Qe,kt,Ye,Xe,Gt,At],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}@media only screen and (max-width:768px){form[_ngcontent-%COMP%]{display:block;position:relative}}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.header-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.mobile-header[_ngcontent-%COMP%]{display:none}@media only screen and (max-width:768px){.mobile-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem}}.mobile-menu-toggle[_ngcontent-%COMP%]{display:none}@media only screen and (max-width:768px){.mobile-menu-toggle[_ngcontent-%COMP%]{display:inline-flex}}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-4)}@media only screen and (max-width:768px){.left[_ngcontent-%COMP%]{border-right:none;padding:1.5rem 1.5rem 4.5rem;height:100%;width:100%}}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}@media only screen and (max-width:768px){.right[_ngcontent-%COMP%]{position:absolute;inset:0;z-index:10;background:var(--base-1);padding:1.5rem;transform:translate(100%);transition:transform .3s cubic-bezier(.4,0,.2,1)}.right.open[_ngcontent-%COMP%]{transform:translate(0)}}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}sh-divider[_ngcontent-%COMP%]{margin:.75rem 0}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.25rem}.path[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content min-content;gap:.25rem;align-items:center}.path[_ngcontent-%COMP%] sh-chip[_ngcontent-%COMP%]{width:100%}.path[_ngcontent-%COMP%] .provider-icon[_ngcontent-%COMP%]{width:1rem;height:1rem;margin-right:.5rem}.bulk-textarea[_ngcontent-%COMP%]{width:100%;font-family:monospace;min-height:12.5rem}.paths[_ngcontent-%COMP%]{max-height:200px;overflow-y:auto;display:flex;flex-direction:column;gap:.5rem}"],changeDetection:0})};var Bn="1W:1D,4W:1W,12M:1M",Zt=!1,Oe=class i{#e=O(we);#t=O(ge);#n=O(Ge);#i=O(xt);#o=O(Rt);#s=O($t);#a=O(Ze);generalForm=Kn();sourceDataForm=Vn();scheduleFields=qt();scheduleType=h("daily");settings=h([]);optionsFields={backupRetention:h("all"),backupRetentionTime:h(""),backupRetentionVersions:h(0),backupRetentionCustom:h("")};targetUrls=h([]);targetUrlModel=R(()=>this.targetUrls()[0]?.url??null);connectionStringId=R(()=>this.targetUrls()[0]?.connectionStringId??null);targetUrlTestSignal=h(null);backupMetadata=h(null);isDraft=h(!1);backupId=h(null);backupName=R(()=>this.generalFormSignal()?.name??"");isSubmitting=h(!1);finishedLoading=h(!1);backupDefaults=h(null);applicationOptions=h(null);isNew=R(()=>this.backupId()==="new");shouldAutoSave=R(()=>!this.isDraft()&&!this.isNew());osType=R(()=>this.#t.systemInfo()?.OSType);isConnectionStringSaved=R(()=>{let t=this.targetUrlModel();return t?this.#a.destinations().some(e=>e.BaseUrl===t):!1});selectedOptions=h([]);sourceDataFormSignal=Ue(this.sourceDataForm.valueChanges);generalFormSignal=Ue(this.generalForm.valueChanges);encryptionFieldSignal=Ue(this.generalForm.controls.encryption.valueChanges);advancedOptions=R(()=>this.#t.systemInfo()?.Options?.map(this.#u)??[]);#l=h(null);#r=null;testSignal=this.#l.asReadonly();#_=q(()=>{let t=this.targetUrlModel(),e=this.#l(),n=this.#r;this.#r=t,!(e==="testing"||n===null||n===t)&&this.#l.set(null)});#g=q(()=>{let t=this.targetUrlModel(),e=this.connectionStringId();if(e){let n=this.#a.destinations();if(n.length===0)return;let o=n.find(a=>a.ID===e);!o||o.BaseUrl}});setTestState(t){this.#l.set(t)}#u(t){return{name:t.Name,type:t.Type,shortDescription:t.ShortDescription??void 0,longDescription:t.LongDescription??void 0,options:t.ValidValues}}encryptionOptions=R(()=>{let t=this.#t.systemInfo()?.EncryptionModules??[];return[_t,...t]});nonSelectedOptions=R(()=>this.advancedOptions().sort((t,e)=>t?.name&&e?.name?t?.name.localeCompare(e?.name):0).filter(t=>this.selectedOptions()?.findIndex(e=>e.name===t.name)===-1));submit(t=!1){this.isSubmitting.set(!0),this.#p().pipe(dt(e=>{let n=this.#c(),o=this.backupId(),a=n;if(a.Backup){e.length>0&&e[0]!==null?n.Backup.ConnectionStringID=e[0]:e.length>0&&e[0]===null&&(n.Backup.ConnectionStringID=void 0);let d=this.targetUrls().slice(1).map((m,N)=>{let F=e[N+1];return{TargetUrl:m.url,ConnectionStringID:F??void 0,UrlKey:m.urlKey}});d.length>0&&(a.Backup.AdditionalTargetURLs=d)}return this.isDraft()&&n.Backup&&(n.Backup.Metadata=this.backupMetadata()),o==="new"||!o||this.isDraft()?this.#i.postApiV1Backups({requestBody:n}):this.#i.putApiV1BackupById({id:o,requestBody:n})}),Be(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}})}validateBeforeSubmit(){this.generalForm.markAllAsTouched(),this.sourceDataForm.markAllAsTouched();let t=this.#c(),e=(t.Backup.Name??"").trim()!=="",o=(this.generalForm.controls.encryption.value!==""&&this.generalForm.controls.encryption.value!=="-")===!1||this.generalForm.controls.password.value===this.generalForm.controls.repeatPassword.value&&this.generalForm.controls.password.value!=="";if(!e||!o)return this.#n.open(ne,{data:{title:$localize`Validation Error`,message:this.isNew()?$localize`Please fix the errors indicated before creating the backup.`:$localize`Please fix the errors indicated before saving.`,confirmText:$localize`OK`}}),"general";let a=this.targetUrls();if(!(a.length>0&&a.some(m=>m.url.trim()!=="")))return this.#n.open(ne,{data:{title:$localize`Destination required`,message:this.isNew()?$localize`You must setup a destination before creating the backup.`:$localize`Please setup a destination before saving.`,confirmText:$localize`OK`}}),"destination";var d=(t.Backup.Sources??[]).filter(m=>m.trim()!=="").length>0;return!d||!this.sourceDataForm.valid?(this.#n.open(ne,{data:{title:$localize`Source data required`,message:this.isNew()?$localize`You must setup source data before creating the backup.`:$localize`Please add at least one source path before saving.`,confirmText:$localize`OK`}}),"source"):""}exit(t){if(!t){this.#d(),this.#e.navigate(["/"]);return}this.#n.open(ne,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#d(),this.#e.navigate(["/"]))}})}mapSourceDataToForm(t){let e=t.Sources??"",n=t.Filters?.map(_=>`${_.Include?"+":"-"}${_.Expression}`)??[],o=t.Settings?.find(_=>_.Name==="--skip-files-larger-than")?.Value?.toUpperCase()??null,a={path:[...e,...n].join("\0"),excludes:{filesLargerThan:o===null?void 0:wt(o)}};this.sourceDataForm.patchValue(a)}mapDestinationToForm(t){let e=t,n=t.TargetURL??"",o=(t.ConnectionStringID===-1?null:t.ConnectionStringID)??null,a=n?[{url:n,connectionStringId:o,urlKey:null,save:!!o}]:[],_=e.AdditionalTargetURLs?.map(d=>({url:d.TargetUrl,urlKey:d.UrlKey,connectionStringId:d.ConnectionStringID??null,save:!!d.ConnectionStringID}))??[];this.targetUrls.set([...a,..._])}mapGeneralToForm(t){let e=t.Name??"",n=t.Description??"",o=t.Settings?.find(m=>m.Name==="encryption-module"),a=t.Settings?.find(m=>m.Name==="passphrase")?.Value??"",_=o?.Value&&o.Value.length?o.Value:"",d={name:t.Name??"",description:t.Description??""};e&&e!==""&&(d.name=e),n&&n!==""&&(d.description=n),_&&_!==""&&(d.encryption=_),a&&a!==""&&(d.password=a,d.repeatPassword=a),this.generalForm.patchValue(d)}mapScheduleToForm(t){if(!t){this.scheduleType.set("disabled"),this.scheduleFields.autoRun.set(!1);return}let e=this.#s.fromString(t.Repeat)??null,n=this.#m(t.Time);this.scheduleFields.autoRun.set(!0),n.date&&this.scheduleFields.nextTime.date.set(n.date),this.scheduleFields.nextTime.time.set(n.time),this.scheduleFields.runAgain.repeatUnit.set(e?.unit??"D"),this.scheduleFields.runAgain.repeatValue.set(e?.value??1),this.scheduleFields.runAgain.allowedDays.mon.set(t.AllowedDays?.includes("mon")??!1),this.scheduleFields.runAgain.allowedDays.tue.set(t.AllowedDays?.includes("tue")??!1),this.scheduleFields.runAgain.allowedDays.wed.set(t.AllowedDays?.includes("wed")??!1),this.scheduleFields.runAgain.allowedDays.thu.set(t.AllowedDays?.includes("thu")??!1),this.scheduleFields.runAgain.allowedDays.fri.set(t.AllowedDays?.includes("fri")??!1),this.scheduleFields.runAgain.allowedDays.sat.set(t.AllowedDays?.includes("sat")??!1),this.scheduleFields.runAgain.allowedDays.sun.set(t.AllowedDays?.includes("sun")??!1);let o=lt(this.scheduleFields),a=vt.find(_=>JSON.stringify(_.data)===JSON.stringify(o));a?this.scheduleType.set(a.value):this.scheduleType.set("custom")}mapOptionsToForms(t,e=!1){let n=["--no-encryption","--skip-files-larger-than","passphrase","keep-time","keep-versions","retention-policy"],o=(t.Settings??[]).map(m=>m);if(e){let m=this.#o.serverSettings()??{};Object.keys(m).filter(N=>N.startsWith("--")).forEach(N=>{o.find(A=>A.Name===N)||o.push({Name:N,Value:m[N],Filter:null})})}let a=o.filter(m=>!n.includes(m.Name)),_=o.filter(m=>n.includes(m.Name));this.settings.set(a??[]),a?.forEach(m=>{if(m.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(m.Value??"")});var d="all";_?.forEach(m=>{if(m.Name==="keep-time"&&(m.Value??"")!=="")return d="time",this.optionsFields.backupRetentionTime.set(m.Value??"");if(m.Name==="keep-versions"&&(m.Value??"")!=="")return d="versions",this.optionsFields.backupRetentionVersions.set(m.Value?parseInt(m.Value):null);if(m.Name==="retention-policy"&&(m.Value??"")!=="")if(m.Value===Bn)d="smart";else return d="custom",this.optionsFields.backupRetentionCustom.set(m.Value??"")}),this.optionsFields.backupRetention.set(d)}storeMetadata(t,e){this.backupMetadata.set(e?t.Metadata??null:null)}getScheduleFormValue(){let t=lt(this.scheduleFields);return kn(t)}#c(){let t=this.generalForm.value,e=this.getScheduleFormValue(),n=this.sourceDataForm.value,a=this.targetUrls()[0],_=a?.url??null,d=n.path?.split("\0")??[],m=this.mapFormsToSettings(),N=n.excludes?.filesLargerThan;return N&&N.size!==null&&N.unit!==null&&m.push({Name:"--skip-files-larger-than",Value:`${N.size}${N.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:_??null,ConnectionStringID:a?.connectionStringId??null,Sources:d.filter(F=>!(F.startsWith("-")||F.startsWith("+"))),Settings:m,Filters:d.filter(F=>F.startsWith("-")||F.startsWith("+")).map((F,A)=>({Order:A,Include:F.startsWith("+"),Expression:F.slice(1)}))},Schedule:e}}mapFormsToSettings(t=[]){let e=this.generalForm.value,n=["dblock-size","compression-module"],o=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","encryption-module","passphrase","keep-time","keep-versions","retention-policy",...n,...n.map(F=>`--${F}`)],a=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&e.encryption!==_t.Key&&(a=[{Name:"encryption-module",Value:e.encryption??null},{Name:"passphrase",Value:e.password??null}]);let _=n.map(F=>{let A=this.settings().find(L=>L.Name===F||L.Name==="--"+F);return A?{Name:F,Value:A.Value}:null}).filter(F=>F!==null),d=[];switch(this.optionsFields.backupRetention()){case"time":d.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":d.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":d.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":d.push({Name:"retention-policy",Value:Bn});break}let m=[...t,...o],N=this.settings().filter(F=>!m.includes(F.Name)).map(F=>{let A=F.Value;return typeof F.Value=="number"&&(A=F.Value.toString()),typeof F.Value=="boolean"&&(A=F.Value?"True":"False"),{Name:F.Name?.startsWith("--")?F.Name:`--${F.Name}`,Value:A}});return[...a,..._,...d,...N]}#p(){let t=this.targetUrls();if(t.length===0)return Ve([]);let e=t.map(n=>{if(n.connectionStringId)return Ve(n.connectionStringId);if(!n.save)return Ve(null);let o=n.url,_=Pe(o)?.displayName??"Destination",m=this.#a.destinations().filter(A=>A.Name?.startsWith(_)).length,F={Name:`${_} ${new Date().toISOString()}`,Description:null,BaseUrl:o};return this.#a.save("new",F).pipe(ot(A=>A.Data?.ID??null))});return sn(e).pipe(un(n=>{let o=this.targetUrls();n.forEach((a,_)=>{if(a&&_<o.length&&(this.#a.reload(),o[_].connectionStringId!==a)){let d=o[_].urlKey;this.updateTargetUrl(_,o[_].url,a,d)}})}))}#m(t){if(!t||t?.indexOf("T")===-1)return{time:t??"13:00"};let e=new Date(t);return{time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`,date:`${(""+e.getFullYear()).padStart(4,"0")}-${(""+(e.getMonth()+1)).padStart(2,"0")}-${(""+e.getDate()).padStart(2,"0")}`}}setTargetUrl(t,e=!1,n=null,o=null){if(e&&(this.#r=null),t===null){this.targetUrls.set([]);return}this.targetUrls.update(a=>{let _=[...a];return _.length===0?_.push({url:t,urlKey:o,connectionStringId:n,save:n?!0:Zt}):_[0]={url:t,urlKey:o,connectionStringId:n,save:n?!0:Zt},_})}addTargetUrl(t,e,n){this.targetUrls.update(o=>[...o,{url:t,connectionStringId:e,urlKey:n,save:e?!0:Zt}])}updateTargetUrl(t,e,n,o){this.targetUrls.update(a=>{if(t<0||t>=a.length)return a;let _=[...a],d=_[t].save;return _[t]={url:e,connectionStringId:n,urlKey:o,save:n?!0:d},_})}toggleSaveConnectionString(t){this.targetUrls.update(e=>{if(t<0||t>=e.length)return e;let n=[...e];return n[t]=oe(W({},n[t]),{save:!n[t].save}),n})}removeTargetUrl(t){this.targetUrls.update(e=>e.filter((n,o)=>o!==t))}#d(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleFields=qt(),this.optionsFields.backupRetention.set("all"),this.settings.set([]),this.targetUrls.set([])}static \u0275fac=function(e){return new(e||i)};static \u0275prov=Ne({token:i,factory:i.\u0275fac,providedIn:"root"})};var El=["formRef"];function hl(i,t){i&1&&(l(0,"sh-alert",17),M(1,5),P(2,"sh-icon",26),x(),r())}function Fl(i,t){if(i&1&&p(0),i&2){let e=t.$implicit;V(" ",e.DisplayName," ")}}function Nl(i,t){if(i&1&&P(0,"sh-progress-bar",40),i&2){let e=s(3);Fe("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),u("value",e.calculatePasswordStrength()*(100/5))}}function Dl(i,t){i&1&&(l(0,"span",35),y(1,10),r())}function yl(i,t){i&1&&(M(0,8,1),P(1,"sh-icon"),x())}function Al(i,t){i&1&&(M(0,8,2),P(1,"sh-icon"),x())}function Il(i,t){i&1&&(M(0,11,1),P(1,"sh-icon",42),x())}function Pl(i,t){i&1&&(M(0,11,2),P(1,"sh-icon"),x())}function Ol(i,t){if(i&1){let e=I();l(0,"button",41),T("click",function(){S(e);let o=s(3);return f(o.copyPassword())}),M(1,11),g(2,Il,2,0)(3,Pl,2,0),x(),r()}if(i&2){let e=s(3);c(2),C(e.copiedPassword()?2:3)}}function Ml(i,t){i&1&&(l(0,"sh-alert",39),y(1,12),r())}function xl(i,t){if(i&1){let e=I();l(0,"div",30)(1,"sh-form-field")(2,"label",31),M(3,7),P(4,"sup"),x(),r(),P(5,"input",32),r(),g(6,Nl,1,9,"sh-progress-bar",33),l(7,"sh-form-field"),P(8,"input",34),g(9,Dl,2,0,"span",35),r(),l(10,"div",36)(11,"button",37),T("click",function(){S(e);let o=s(2);return f(o.showPassword.set(!o.showPassword()))}),M(12,8),g(13,yl,2,0)(14,Al,2,0),x(),r(),l(15,"button",37),T("click",function(){S(e);let o=s(2);return f(o.generatePassword())}),M(16,9),P(17,"sh-icon"),x(),r(),g(18,Ol,4,1,"button",38),r(),g(19,Ml,2,0,"sh-alert",39),r()}if(i&2){let e=s(2);c(5),u("type",e.showPassword()?"text":"password"),c(),C(e.generalForm.value.password?6:-1),c(2),u("type",e.showPassword()?"text":"password"),c(),C(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),c(4),C(e.showPassword()?13:14),c(5),C(e.showCopyPassword()?18:-1),c(),C(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function Rl(i,t){if(i&1&&(l(0,"sh-select",27)(1,"label",28),y(2,6),r(),P(3,"input",29),H(4,Fl,1,1,"ng-template"),r(),g(5,xl,20,7,"div",30)),i&2){let e=s();u("options",e.encryptionOptions())("isClearable",!1),c(5),C(e.encryptionFieldSignal()!==e.noneOptionKey?5:-1)}}function Ll(i,t){if(i&1&&(l(0,"button",24),M(1,13),P(2,"sh-icon"),x(),r()),i&2){let e=s();u("disabled",e.nameAndDescriptionValid()===!1)}}function bl(i,t){if(i&1&&(l(0,"button",25),M(1,14),P(2,"sh-icon"),x(),r()),i&2){let e=s();u("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var it=new Dt,Kn=(i={name:"",description:"",encryption:"",password:"",repeatPassword:"",compression:""})=>it.group({name:it.control(i.name,[St.required]),description:it.control(i.description),encryption:it.control(i.encryption,[vn()]),password:it.control(i.password,[Ht(t=>t?.value.encryption!=="-",[St.required])]),repeatPassword:it.control(i.repeatPassword,[Ht(t=>t?.value.encryption!=="-",[St.required])])}),_t={Key:"-",DisplayName:"None"},en=class i{#e=O(we);#t=O(je);#n=O($n);#i=O(Oe);formRef=Ie.required("formRef");generalForm=this.#i.generalForm;generalFormSignal=this.#i.generalFormSignal;encryptionFieldSignal=this.#i.encryptionFieldSignal;encryptionOptions=this.#i.encryptionOptions;isNew=this.#i.isNew;showPassword=h(!1);copiedPassword=h(!1);showCopyPassword=h(!1);noneOptionKey=_t.Key;encryptionEffect=q(()=>{this.encryptionFieldSignal()===_t.Key&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=R(()=>{let t=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=R(()=>{let e=this.generalFormSignal()?.password??"";return this.#n.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#i.exit(!0)}async copyPassword(){let t=this.generalForm.controls.password.value;await this.#o(t??""),this.copiedPassword.set(!0)}async#o(t){try{await navigator.clipboard.writeText(t)}catch{try{let n=document.createElement("textarea");n.value=t,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}catch(n){console.error("Failed to copy text: ",n)}}}generatePassword(){this.copiedPassword.set(!1);let t=this.#n.generate(41);this.generalForm.controls.password.setValue(t),this.generalForm.controls.repeatPassword.setValue(t),this.showCopyPassword.set(!0)}next(){this.#i.shouldAutoSave()&&this.#i.submit(!0),this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=z({type:i,selectors:[["app-general"]],viewQuery:function(e,n){e&1&&De(n.formRef,El,5),e&2&&ye()},decls:21,vars:4,consts:()=>{let t;t=$localize`Your backup name`;let e;e=$localize`Your backup description`;let n;n=$localize`Remember to copy the password`;let o;o=$localize`General backup settings`;let a;a=$localize` Backup name ${"\uFFFD#8\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#8\uFFFD"}:CLOSE_SUPERSCRIPT:`;let _;_=$localize`Backup description`;let d;d=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Exit `;let m;m=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Encrypted backup `;let N;N=$localize`Encryption`;let F;F=$localize`Encryption`;let A;A=$localize`Password`;let L;L=$localize`Repeat password`;let v;v=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let D;D=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,D=Ke(D);let K;K=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let J;J=$localize`Passwords do not match`;let b;b=$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:`,b=Ke(b);let w;w=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let Me;Me=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let xe;return xe=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],o,a,_,d,m,F,v,D,K,J,b,w,Me,xe,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],[1,"primary"],["for","backupName"],["type","text","tabindex","1","placeholder",t,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","shButton","",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],["shButton","","type","submit","shTooltip",n,1,"raised","primary",3,"disabled"],["icon",""],["value","Key","label","DisplayName",3,"options","isClearable"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",N,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",A,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",L,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["shButton","","type","button",1,"small","copy",3,"click"],[1,"sh-success"]]},template:function(e,n){if(e&1&&(l(0,"form",15,0),T("submit",function(){return n.next()}),l(2,"h3",16),y(3,1),r(),g(4,hl,3,0,"sh-alert",17),l(5,"sh-form-field")(6,"label",18),M(7,2),P(8,"sup"),x(),r(),P(9,"input",19),r(),l(10,"sh-form-field")(11,"label",20),y(12,3),r(),P(13,"textarea",21),r(),g(14,Rl,6,3),l(15,"div",22)(16,"button",23),T("click",function(){return n.exit()}),M(17,4),P(18,"sh-icon"),x(),r(),g(19,Ll,3,1,"button",24)(20,bl,3,1,"button",25),r()()),e&2){let o;u("formGroup",n.generalForm),c(4),C(!n.isNew()&&((o=n.generalFormSignal())==null?null:o.encryption)!==""?4:-1),c(10),C(n.isNew()?14:-1),c(5),C(n.encryptionFieldSignal()===n.noneOptionKey||!n.isNew()?19:20)}},dependencies:[qe,Et,ee,te,ft,Nt,Ft,ue,$e,Y,Q,It,yt,Mt],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--error-8)}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.copy[_ngcontent-%COMP%] sh-icon.sh-success[_ngcontent-%COMP%]{color:var(--success-8)}"],changeDetection:0})};export{Ze as a,et as b,Vt as c,Kn as d,_t as e,en as f,vt as g,kn as h,qt as i,jt as j,Xe as k,kt as l,Xt as m,st as n,Vn as o,Qt as p,Oe as q,Kt as r};
package/chunk-TV7OB7Y4.js DELETED
@@ -1 +0,0 @@
1
- import{a as Sn}from"./chunk-EXAZ4QZR.js";import{a as gn}from"./chunk-TWWAK5M6.js";import"./chunk-6DX35WDO.js";import"./chunk-35FMFK4I.js";import{c as re,l as pn}from"./chunk-EVEI25GQ.js";import{b as dn}from"./chunk-UIVZWXBK.js";import{a as Tn}from"./chunk-E4CYVUYG.js";import"./chunk-BPHX6VXP.js";import"./chunk-XWML36YQ.js";import"./chunk-6Q6SSTBK.js";import"./chunk-COEGVUM3.js";import{a as Cn}from"./chunk-YS4B2B5N.js";import{b as En}from"./chunk-KZYRTI62.js";import"./chunk-TSVSMVY4.js";import"./chunk-2KD757N6.js";import{b as Fn}from"./chunk-OP7MDR2B.js";import"./chunk-PEOYNJJM.js";import"./chunk-NUV5LHQV.js";import"./chunk-PDZNQW6F.js";import{A as tn,B as le,C as on,E as _n,G as an,K as ln,L as rn,S as cn,T as sn,v as ae,z as nn}from"./chunk-CJKZ27FM.js";import{d as un}from"./chunk-KNSQLQC6.js";import{e as _e}from"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as L,Bb as V,Bc as j,Cb as U,Cc as R,Db as E,Eb as o,Fb as i,G as Q,Gb as C,Gc as D,Hc as b,Ic as x,Kb as N,Kc as oe,Lb as M,Mb as $,Nb as h,Qa as J,Rc as q,Ta as a,Ub as u,Vb as F,Wb as d,Xb as k,Yb as H,Zb as K,_b as I,ac as l,ea as m,fa as O,hb as Qe,jc as W,lc as A,mb as P,nb as Ye,oc as T,qa as G,qc as S,sa as qe,tc as Y,ub as Ze,uc as Z,vb as en,vc as ee,wc as ne,xb as p,xc as te,yb as g,yc as ie,zb as z}from"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";var On=()=>[_e,import("./chunk-V2M5YF4E.js").then(e=>e.NgTemplateOutlet),le,ae,_n,sn,cn,import("./chunk-5FQ7HESA.js").then(e=>e.BackupProgressComponent),import("./chunk-HPXIWKIK.js").then(e=>e.DurationFormatPipe),import("./chunk-HLHUPBCV.js").then(e=>e.BytesPipe),import("./chunk-HWOUAWOE.js").then(e=>e.RelativeTimePipe)],Nn=()=>["/add-backup"],Mn=()=>["/restore"],mn=e=>({$implicit:e}),In=()=>["/backup/new"],Pn=e=>["/backup",e],Dn=e=>["/restore",e],fn=e=>["/backup",e,"export"],$n=e=>["/backup",e,"delete"],Rn=e=>["/backup",e,"database"],hn=e=>["/backup",e,"commandline"],An=e=>["/backup",e,"log"];function Ln(e,t){e&1&&d(0,11,1)}function xn(e,t){e&1&&d(0,11,2)}function yn(e,t){if(e&1&&d(0,11,3),e&2){let n=l(2);k(n.timeType()),H(0)}}function kn(e,t){if(e&1){let n=h();o(0,"button",64),I("click",function(){let c=m(n).$implicit,s=l(3);return O(s.sortByColumn.set(c.value))}),d(1,15),i()}if(e&2){let n=t.$implicit,_=l(3);A("active",_.orderBy()===n.value),a(),k(n.label),H(1)}}function Hn(e,t){if(e&1&&(o(0,"sh-menu",61)(1,"button",62),u(2,14),C(3,"strong")(4,"sh-icon"),F(),i(),N(5,63),V(6,kn,2,3,"button",65,z),M(),i()),e&2){let n=l(2);a(4),k(n.orderBy()),H(2),a(2),U(n.sortOrderOptions())}}function Gn(e,t){if(e&1){let n=h();o(0,"div",57)(1,"sh-button-group",58),ee("valueChange",function(c){m(n);let s=l();return Z(s.viewMode,c)||(s.viewMode=c),O(c)}),o(2,"button",59),u(3,9),C(4,"sh-icon"),F(),i(),o(5,"button",60),u(6,10),C(7,"sh-icon"),F(),i()(),o(8,"sh-menu",61)(9,"button",62),u(10,11),o(11,"strong"),p(12,Ln,1,0)(13,xn,1,0)(14,yn,1,1),i(),C(15,"sh-icon"),F(),i(),N(16,63),o(17,"button",64),I("click",function(){m(n);let c=l();return O(c.setTimeType("relative"))}),d(18,12),i(),o(19,"button",64),I("click",function(){m(n);let c=l();return O(c.setTimeType("actual"))}),d(20,13),i(),M(),i(),p(21,Hn,8,1,"sh-menu",61),i()}if(e&2){let n=l();a(),Y("value",n.viewMode),a(11),g(n.timeType()=="relative"?12:n.timeType()=="actual"?13:14),a(9),g(n.viewMode()==="list"?21:-1)}}function bn(e,t){if(e&1){let n=h();o(0,"div",70)(1,"div",53)(2,"h3"),T(3),o(4,"sh-chip"),C(5,"img",72),T(6),i()()(),o(7,"div",73)(8,"sh-chip",74),d(9,16),i()(),o(10,"div",57)(11,"button",75),I("click",function(){m(n);let c=l().$implicit,s=l(4);return O(s.openInConsole(c))}),u(12,17),C(13,"sh-icon"),F(),i()(),C(14,"app-backup-progress",76),i()}if(e&2){let n=l().$implicit,_=l(4);a(3),S(" ",n.Backup.Name??_.MISSING_BACKUP_NAME," "),a(2),E("src",_.getBackendIcon(n.Backup.TargetURL),J),a(),S(" ",_.getBackendType(n.Backup.TargetURL)," "),a(8),E("backupId",n.Backup.ID)}}function Bn(e,t){if(e&1&&(o(0,"p")(1,"span"),d(2,23),i(),T(3),D(4,"relativeTime"),i()),e&2){l();let n=ie(5),_=l(6);a(3),S(" ",x(4,1,n,_.timeType()==="actual")," ")}}function vn(e,t){if(e&1&&(T(0),D(1,"durationFormat")),e&2){let n=l(3).$implicit,_=l(4);S(" ",x(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDuration,_.timeType()==="actual")," ")}}function wn(e,t){e&1&&(N(0),T(1,"-"),M())}function Xn(e,t){if(e&1&&(T(0),D(1,"bytes")),e&2){let n=l(3).$implicit;S(" ",b(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.SourceFilesSize)," ")}}function Jn(e,t){e&1&&(N(0),T(1,"-"),M())}function zn(e,t){if(e&1&&(T(0),D(1,"bytes")),e&2){let n=l(3).$implicit;S(" ",b(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.TargetFilesSize)," ")}}function Vn(e,t){e&1&&(N(0),T(1,"-"),M())}function Un(e,t){if(e&1&&(o(0,"p")(1,"span"),d(2,19),i(),T(3),D(4,"relativeTime"),i(),ne(5),p(6,Bn,5,4,"p"),o(7,"p")(8,"span"),d(9,20),i(),p(10,vn,2,4)(11,wn,2,0,"ng-container"),i(),o(12,"p")(13,"span"),d(14,21),i(),p(15,Xn,2,3)(16,Jn,2,0,"ng-container"),i(),o(17,"p")(18,"span"),d(19,22),i(),p(20,zn,2,3)(21,Vn,2,0,"ng-container"),i()),e&2){let n=l(2).$implicit,_=l(4);a(3),S(" ",x(4,5,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupFinished,_.timeType()==="actual")," "),a(2);let c=te(_.scheduledTimes()[n.Backup.ID??""]);a(),g(c?6:-1),a(4),g(n.Backup.Metadata!=null&&n.Backup.Metadata.LastBackupDuration?10:11),a(5),g(n.Backup.Metadata!=null&&n.Backup.Metadata.SourceFilesSize?15:16),a(5),g(n.Backup.Metadata!=null&&n.Backup.Metadata.TargetFilesSize?20:21)}}function Kn(e,t){if(e&1&&C(0,"app-backup-progress",76),e&2){let n=l(2).$implicit;E("backupId",n.Backup.ID)}}function Wn(e,t){e&1&&(o(0,"sh-chip",74),d(1,24),i())}function jn(e,t){e&1&&$(0)}function qn(e,t){if(e&1&&(o(0,"div",71)(1,"div",53)(2,"h3"),T(3),o(4,"sh-chip"),C(5,"img",72),T(6),i()(),p(7,Un,22,9)(8,Kn,1,1,"app-backup-progress",76),i(),o(9,"div",73)(10,"sh-chip",77),d(11,18),i(),p(12,Wn,2,0,"sh-chip",74),i(),o(13,"div",57),P(14,jn,1,0,"ng-container",78),i()()),e&2){let n=l().$implicit,_=l(4),c=W(33);a(3),S(" ",n.Backup.Name??_.MISSING_BACKUP_NAME," "),a(2),E("src",_.getBackendIcon(n.Backup.TargetURL),J),a(),S(" ",_.getBackendType(n.Backup.TargetURL)," "),a(),g(_.runningBackupId()!==n.Backup.ID?7:8);let s=_.getBackupVersionCount(n);a(4),k(s)(s),H(11),a(),g(n.Backup.ExternalID?12:-1),a(2),E("ngTemplateOutlet",c)("ngTemplateOutletContext",R(9,mn,n))}}function Qn(e,t){if(e&1&&p(0,bn,15,4,"div",70)(1,qn,15,11,"div",71),e&2){let n=t.$implicit;g(n.Backup.ExternalID?0:1)}}function Yn(e,t){if(e&1&&V(0,Qn,2,1,null,null,z),e&2){let n=l(3);U(n.backups())}}function Zn(e,t){e&1&&(o(0,"div",69),u(1,25),o(2,"button",79),C(3,"sh-icon"),i(),F(),i()),e&2&&(a(2),E("routerLink",j(1,In)))}function et(e,t){if(e&1&&(o(0,"div",68),p(1,Yn,2,0)(2,Zn,4,2,"div",69),i()),e&2){let n=l(2);A("fallback",n.backups().length===0),a(),g(n.backups().length?1:2)}}function nt(e,t){e&1&&(u(0,26,1),$(1),F())}function tt(e,t){e&1&&(u(0,27,1),$(1),F())}function it(e,t){e&1&&(u(0,28,1),$(1),F())}function ot(e,t){e&1&&(u(0,29,1),$(1),F())}function _t(e,t){e&1&&(u(0,30,1),$(1),F())}function at(e,t){e&1&&(u(0,31,1),$(1),F())}function lt(e,t){e&1&&(u(0,32,1),$(1),F())}function rt(e,t){if(e&1&&(T(0),D(1,"relativeTime")),e&2){let n=l().$implicit,_=l(3);S(" ",x(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupFinished,_.timeType()==="actual")," ")}}function ct(e,t){e&1&&(N(0),T(1,"-"),M())}function st(e,t){if(e&1&&(T(0),D(1,"relativeTime")),e&2){l();let n=ie(11),_=l(3);S(" ",x(1,1,n,_.timeType()==="actual")," ")}}function ut(e,t){e&1&&(N(0),T(1,"-"),M())}function Ft(e,t){if(e&1&&(T(0),D(1,"durationFormat")),e&2){let n=l().$implicit,_=l(3);S(" ",x(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDuration,_.timeType()==="actual")," ")}}function Ct(e,t){e&1&&(N(0),T(1,"-"),M())}function Tt(e,t){if(e&1&&(T(0),D(1,"bytes")),e&2){let n=l().$implicit;S(" ",b(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.SourceFilesSize)," ")}}function dt(e,t){e&1&&(N(0),T(1,"-"),M())}function Et(e,t){if(e&1&&(T(0),D(1,"bytes")),e&2){let n=l().$implicit;S(" ",b(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.TargetFilesSize)," ")}}function pt(e,t){e&1&&(N(0),T(1,"-"),M())}function gt(e,t){e&1&&$(0)}function St(e,t){if(e&1&&(o(0,"tr")(1,"td"),T(2),i(),o(3,"td")(4,"sh-chip",90),C(5,"img",72),T(6),i()(),o(7,"td"),p(8,rt,2,4)(9,ct,2,0,"ng-container"),i(),o(10,"td"),ne(11),p(12,st,2,4)(13,ut,2,0,"ng-container"),i(),o(14,"td"),p(15,Ft,2,4)(16,Ct,2,0,"ng-container"),i(),o(17,"td"),p(18,Tt,2,3)(19,dt,2,0,"ng-container"),i(),o(20,"td"),p(21,Et,2,3)(22,pt,2,0,"ng-container"),i(),o(23,"td")(24,"span"),d(25,35),i()(),o(26,"td"),P(27,gt,1,0,"ng-container",78),i()()),e&2){let n=t.$implicit,_=l(3),c=W(33);a(2),S(" ",n.Backup.Name??_.MISSING_BACKUP_NAME," "),a(3),E("src",_.getBackendIcon(n.Backup.TargetURL),J),a(),S(" ",_.getBackendType(n.Backup.TargetURL)," "),a(2),g(n.Backup.Metadata!=null&&n.Backup.Metadata.LastBackupFinished?8:9),a(3);let s=te(_.scheduledTimes()[n.Backup.ID??""]);a(),g(s?12:13),a(3),g(n.Backup.Metadata!=null&&n.Backup.Metadata.LastBackupDuration?15:16),a(3),g(n.Backup.Metadata!=null&&n.Backup.Metadata.SourceFilesSize?18:19),a(3),g(n.Backup.Metadata!=null&&n.Backup.Metadata.TargetFilesSize?21:22);let f=_.getBackupVersionCount(n);a(4),k(f)(f),H(25),a(2),E("ngTemplateOutlet",c)("ngTemplateOutletContext",R(13,mn,n))}}function mt(e,t){if(e&1){let n=h();o(0,"sh-table",80),ee("sortByColumnChange",function(c){m(n);let s=l(2);return Z(s.sortByColumn,c)||(s.sortByColumn=c),O(c)}),o(1,"tr",81)(2,"th",82),u(3,26),P(4,nt,2,0,"ng-container",83),F(),i(),o(5,"th",84),u(6,27),P(7,tt,2,0,"ng-container",83),F(),i(),o(8,"th",85),u(9,28),P(10,it,2,0,"ng-container",83),F(),i(),o(11,"th",86),u(12,29),P(13,ot,2,0,"ng-container",83),F(),i(),o(14,"th",87),u(15,30),P(16,_t,2,0,"ng-container",83),F(),i(),o(17,"th",88),u(18,31),P(19,at,2,0,"ng-container",83),F(),i(),o(20,"th",89),u(21,32),P(22,lt,2,0,"ng-container",83),F(),i(),o(23,"th"),d(24,33),i(),o(25,"th"),d(26,34),i()(),V(27,St,28,15,"tr",null,z),i()}if(e&2){let n=l(2),_=W(35);E("data",n.backups())("loading",n.backupsLoading()),Y("sortByColumn",n.sortByColumn),a(4),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(5),U(n.backups())}}function Ot(e,t){if(e&1&&p(0,et,3,3,"div",66)(1,mt,29,10,"sh-table",67),e&2){let n=l();g(n.viewMode()==="list"?0:n.viewMode()==="details"?1:-1)}}function Nt(e,t){e&1&&(o(0,"div",91),C(1,"sh-progress-bar",92),o(2,"div",53)(3,"h3"),d(4,36),i()()())}function Mt(e,t){if(e&1){let n=h();o(0,"button",94),I("click",function(){m(n);let c=l(3);return O(c.abort())}),u(1,38),C(2,"sh-icon"),F(),i()}if(e&2){let n=l(3);A("small",n.viewMode()==="details")}}function It(e,t){if(e&1){let n=h();o(0,"button",94),I("click",function(){m(n);let c=l(3);return O(c.stop())}),u(1,39),C(2,"sh-icon"),F(),i()}if(e&2){let n=l(3);A("small",n.viewMode()==="details")}}function Pt(e,t){e&1&&(u(0,37,1),C(1,"sh-icon"),F())}function Dt(e,t){e&1&&(u(0,37,2),C(1,"sh-icon"),F())}function ft(e,t){if(e&1){let n=h();p(0,Mt,3,2,"button",93)(1,It,3,2,"button",93),o(2,"button",94),I("click",function(){m(n);let c=l(2);return O(c.pauseResume())}),u(3,37),p(4,Pt,2,0)(5,Dt,2,0),F(),i()}if(e&2){let n=l(2);g(n.isStopping()?0:1),a(2),A("small",n.viewMode()==="details")("loading",n.isResuming()),a(2),g(n.clientIsRunning()?4:5)}}function $t(e,t){e&1&&d(0,40,1)}function Rt(e,t){e&1&&(o(0,"sh-icon"),T(1,"check"),i())}function ht(e,t){e&1&&(o(0,"sh-icon"),T(1,"dots-three-vertical"),i())}function At(e,t){if(e&1){let n=h();o(0,"button",94),I("click",function(){m(n);let c=l().$implicit,s=l();return O(s.startBackup(c.Backup.ID))}),u(1,40),C(2,"sh-icon"),p(3,$t,1,0),F(),i(),o(4,"button",95)(5,"sh-icon"),T(6,"pencil-simple"),i()(),o(7,"sh-menu")(8,"button",96),p(9,Rt,2,0,"sh-icon")(10,ht,2,0,"sh-icon"),i(),N(11,63),o(12,"h3",97),T(13,"Operations"),i(),o(14,"button",98),u(15,41),C(16,"sh-icon"),F(),i(),o(17,"button",98),u(18,42),C(19,"sh-icon"),F(),i(),o(20,"button",98),u(21,43),C(22,"sh-icon"),F(),i(),C(23,"sh-divider"),o(24,"h3",97),d(25,44),i(),o(26,"button",98),u(27,45),C(28,"sh-icon"),F(),i(),o(29,"button",64),I("click",function(){m(n);let c=l().$implicit,s=l();return O(s.verifyFiles(c.Backup.ID))}),u(30,46),C(31,"sh-icon"),F(),i(),o(32,"button",64),I("click",function(){m(n);let c=l().$implicit,s=l();return O(s.compressBackup(c.Backup.ID))}),u(33,47),C(34,"sh-icon"),F(),i(),o(35,"button",98),u(36,48),C(37,"sh-icon"),F(),i(),C(38,"sh-divider"),o(39,"h3",97),d(40,49),i(),o(41,"button",98),u(42,50),C(43,"sh-icon"),F(),i(),M(),i()}if(e&2){let n=l().$implicit,_=l();A("loading",_.startingBackup()===n.Backup.ID),a(3),g(_.viewMode()==="list"?3:-1),a(),E("routerLink",R(15,Pn,n.Backup.ID)),a(4),A("loading",_.loadingId()===n.Backup.ID)("success",_.successId()===n.Backup.ID),a(),g(_.successId()===n.Backup.ID?9:10),a(5),E("routerLink",R(17,Dn,n.Backup.ID)),a(3),E("routerLink",R(19,fn,n.Backup.ID)),a(3),E("routerLink",R(21,$n,n.Backup.ID)),a(6),E("routerLink",R(23,Rn,n.Backup.ID)),a(9),E("routerLink",R(25,hn,n.Backup.ID)),a(6),E("routerLink",R(27,An,n.Backup.ID))}}function Lt(e,t){if(e&1&&p(0,ft,6,6)(1,At,44,29),e&2){let n=t.$implicit,_=l();g(_.runningBackupId()===n.Backup.ID?0:1)}}function xt(e,t){e&1&&(o(0,"sh-icon",99),T(1,"funnel-simple"),i(),o(2,"sh-icon",100),T(3,"sort-ascending"),i(),o(4,"sh-icon",101),T(5,"sort-descending"),i())}var yt={file:{Display:$localize`Local`,Icon:null}},ce=class e{#t=L(un);#n=L(dn);#e=L(Tn);#o=L(En);#_=L(Fn);#a=L(nn);MISSING_BACKUP_NAME=$localize`Backup name missing`;sortOrderOptions=this.#e.orderByOptions;orderBy=this.#e.orderBy;backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;startingBackup=this.#e.startingBackup;deletingBackup=this.#e.deletingBackup;runningBackupId=this.#n.runningBackupId;timeType=this.#e.timeType;clientIsRunning=this.#n.clientIsRunning;isResuming=this.#n.isResuming;runningTask=q(()=>this.#n.serverState()?.ActiveTask?.Item1);isStopping=q(()=>this.runningTask()==this.#i());scheduledTimes=q(()=>{let t=this.#_.serverState()?.ProposedSchedule??[],n=this.#e.backups(),_={};return n.forEach(c=>{let s=c.Backup?.ID;if(s){var f=t.find(y=>y.Item1==s);f?.Item2?_[s]=f.Item2:c.Schedule?.Time&&(_[s]=c.Schedule.Time)}}),_});#i=G(-1);viewMode=Cn("viewMode","list");sortByColumn=G(this.#e.orderBy());loadingId=G(null);successId=G(null);sortEffect=qe(()=>this.#e.setOrderBy(this.sortByColumn()));ngOnInit(){this.#e.getBackups(!0)}openInConsole(t){let n=t.Backup.ExternalID?.split(":")[1];if(!n){console.error("Backup does not have an external ID");return}this.#o.openConsole("/app/machines/configurations/"+n)}setOrderBy(t){this.#e.setOrderBy(t)}setTimeType(t){this.#e.setTimeType(t)}startBackup(t){this.#n.resumeDialogCheck(()=>this.#e.startBackup(t))}openPauseDialog(){this.#a.open(gn,{maxWidth:"550px",width:"100%"})}pauseResume(){if(this.clientIsRunning()){this.openPauseDialog();return}this.#n.pauseResume().subscribe()}stop(){let t=this.runningTask();t&&(this.#i.set(t),this.#t.postApiV1TaskByTaskidStop({taskid:t}).subscribe())}abort(){let t=this.runningTask();t&&this.#t.postApiV1TaskByTaskidAbort({taskid:t}).subscribe()}getBackendIcon(t){return t?re(t).icon??"database":""}getBackendType(t){if(!t)return"";let n=re(t);if(!n)return"";let _=yt[n.key];if(_?.Display)return _.Display;if(n.key==="s3"){let c="http://null?"+t.split("?")[1],f=new URL(c).searchParams.get("s3-server-name")?.toLowerCase()??"";for(let[y,B]of Object.entries(pn))if(f.endsWith(y))return B}return n.displayName}getBackupVersionCount(t){return parseInt(t?.Backup?.Metadata?.BackupListCount??"",10)||0}verifyFiles(t){this.loadingId.set(t),this.#t.postApiV1BackupByIdVerify({id:t}).pipe(Q(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(t),setTimeout(()=>this.successId.set(null),2e3)}})}compressBackup(t){this.loadingId.set(t),this.#t.postApiV1BackupByIdCompact({id:t}).pipe(Q(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(t),setTimeout(()=>this.successId.set(null),2e3)}})}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=Qe({type:e,selectors:[["app-home"]],decls:36,vars:6,consts:()=>{let t;t=$localize`Backups`;let n;n=$localize`Keep your data safe at your chosen destination.`;let _;_=$localize` Create ${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON:`;let c;c=$localize`Restores`;let s;s=$localize`Recover your files from any backup set.`;let f;f=$localize` Start ${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON:`;let y;y=$localize`My backups`;let B;B=$localize`${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:rows${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON: List `;let se;se=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:list${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Details `;let ue;ue=$localize` Time: ${"\uFFFD#11\uFFFD"}:START_TAG_STRONG:${"\uFFFD*12:1\uFFFD"}:START_BLOCK_IF: Relative ${"\uFFFD/*12:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*13:2\uFFFD"}:START_BLOCK_ELSE_IF: Actual ${"\uFFFD/*13:2\uFFFD"}:CLOSE_BLOCK_ELSE_IF:${"\uFFFD*14:3\uFFFD"}:START_BLOCK_ELSE: ${"\uFFFD0:3\uFFFD"}:INTERPOLATION: ${"\uFFFD/*14:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:clock${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`;let Fe;Fe=$localize`Relative time`;let Ce;Ce=$localize`Actual time`;let Te;Te=$localize` Order by: ${"\uFFFD#3\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:arrows-down-up${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let de;de=$localize` ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let Ee;Ee=$localize`Externally managed`;let pe;pe=$localize` Edit in console ${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:arrow-up-right${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON:`;let v;v=$localize`{VAR_PLURAL, plural, =0 {No version yet} =1 {1 Version} other {{INTERPOLATION} Versions}}`,v=K(v,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let ge;ge=$localize` ${v}:ICU@@6502601490918455200: `;let Se;Se=$localize`Last successful backup:`;let me;me=$localize`Duration:`;let Oe;Oe=$localize`Source:`;let Ne;Ne=$localize`Destination:`;let Me;Me=$localize`Next scheduled run:`;let Ie;Ie=$localize`Externally managed`;let Pe;Pe=$localize` No backups found ${"\uFFFD#2\uFFFD"}:START_TAG_BUTTON: Click to create one now ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_BUTTON:`;let De;De=$localize` Backup ${"\uFFFD*4:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*4:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let fe;fe=$localize` Type ${"\uFFFD*7:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*7:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let $e;$e=$localize` Last backup ${"\uFFFD*10:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*10:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Re;Re=$localize` Next run ${"\uFFFD*13:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*13:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let he;he=$localize` Duration ${"\uFFFD*16:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*16:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Ae;Ae=$localize` Source ${"\uFFFD*19:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*19:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Le;Le=$localize` Destination ${"\uFFFD*22:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*22:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let xe;xe=$localize`Version`;let ye;ye=$localize`Actions`;let w;w=$localize`{VAR_PLURAL, plural, =0 {No versions} =1 {1 Version} other {{INTERPOLATION} Versions}}`,w=K(w,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let ke;ke=$localize` ${w}:ICU@@3521773141017690117: `;let He;He=$localize`Loading backups...`;let X;X=$localize`${"\uFFFD*4: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/*4:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*5: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/*5:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,X=K(X);let Ge;Ge=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:skull${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Abort `;let be;be=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:stop${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Stop `;let Be;Be=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:play-circle${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD*3:1\uFFFD"}:START_BLOCK_IF: Start ${"\uFFFD/*3:1\uFFFD"}:CLOSE_BLOCK_IF:`;let ve;ve=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:clock-counter-clockwise${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: Restore `;let we;we=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:export${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Export `;let Xe;Xe=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON: Delete `;let Je;Je=$localize`Advanced`;let ze;ze=$localize`${"\uFFFD#28\uFFFD"}:START_TAG_SH_ICON:database${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SH_ICON: Database `;let Ve;Ve=$localize`${"\uFFFD#31\uFFFD"}:START_TAG_SH_ICON:check-square-offset${"\uFFFD/#31\uFFFD"}:CLOSE_TAG_SH_ICON: Verify files `;let Ue;Ue=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SH_ICON:file-archive${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SH_ICON: Compress now `;let Ke;Ke=$localize`${"\uFFFD#37\uFFFD"}:START_TAG_SH_ICON:terminal-window${"\uFFFD/#37\uFFFD"}:CLOSE_TAG_SH_ICON: Commandline `;let We;We=$localize`Reporting`;let je;return je=$localize`${"\uFFFD#43\uFFFD"}:START_TAG_SH_ICON:notepad${"\uFFFD/#43\uFFFD"}:CLOSE_TAG_SH_ICON: Log `,[["actions",""],["sortIcons",""],t,n,_,c,s,f,y,B,se,ue,Fe,Ce,Te,de,Ee,pe,ge,Se,me,Oe,Ne,Me,Ie,Pe,De,fe,$e,Re,he,Ae,Le,xe,ye,ke,He,X,Ge,be,Be,ve,we,Xe,Je,ze,Ve,Ue,Ke,We,je,[1,"type-a","actionable",3,"keydown.enter","keydown.space","routerLink"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["type","button","tabindex","-1","shButton",""],["src","assets/images/restore.png","alt","","width","48px"],[1,"content"],[1,"actions"],[1,"small","type-b",3,"valueChange","value"],["value","list"],["value","details"],[1,"table-overview"],["type","button","shButton","",1,"small"],["menu",""],["type","button",3,"click"],["type","button",3,"active"],[1,"backups",3,"fallback"],[1,"type-b",3,"data","loading","sortByColumn"],[1,"backups"],[1,"no-backups"],[1,"backup","externaly-managed"],[1,"backup"],["alt","",1,"provider-icon",3,"src"],[1,"tags"],[1,"simple","primary"],["type","button","shButton","",3,"click"],[3,"backupId"],[1,"simple","success"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["shButton","",1,"primary","raised",3,"routerLink"],[1,"type-b",3,"sortByColumnChange","data","loading","sortByColumn"],["thead",""],["shSort","name"],[4,"ngTemplateOutlet"],["shSort","type"],["shSort","lastrun"],["shSort","nextrun"],["shSort","duration"],["shSort","sourcesize"],["shSort","destinationsize"],[1,"small"],[1,"loading-list"],[1,"indeterminate","primary"],["shButton","",3,"small"],["shButton","",3,"click"],["type","button","shButton","",3,"routerLink"],["type","button","shButton",""],["title",""],["type","button",3,"routerLink"],[1,"filter"],[1,"asc"],[1,"desc"]]},template:function(n,_){n&1&&(C(0,"app-status-bar"),o(1,"section")(2,"header")(3,"sh-card",51),I("keydown.enter",function(s){return s.target.click()})("keydown.space",function(s){return s.target.click()}),C(4,"img",52),o(5,"div",53)(6,"h3"),d(7,2),i(),o(8,"p"),d(9,3),i()(),o(10,"button",54),u(11,4),C(12,"sh-icon"),F(),i()(),o(13,"sh-card",51),I("keydown.enter",function(s){return s.target.click()})("keydown.space",function(s){return s.target.click()}),C(14,"img",55),o(15,"div",53)(16,"h3"),d(17,5),i(),o(18,"p"),d(19,6),i()(),o(20,"button",54),u(21,7),C(22,"sh-icon"),F(),i()()(),o(23,"div",56)(24,"h2"),N(25),d(26,8),M(),p(27,Gn,22,3,"div",57),i(),Ye(28,Ot,2,1)(29,Nt,5,0),Ze(30,28,On,null,29),i()(),P(32,Lt,2,1,"ng-template",null,0,oe)(34,xt,6,0,"ng-template",null,1,oe)),n&2&&(a(3),E("routerLink",j(4,Nn)),a(10),E("routerLink",j(5,Mn)),a(14),g(_.backups().length>0?27:-1),a(3),en(!_.backupsLoading()))},dependencies:[_e,Sn,on,le,ae,an,ln,rn,tn],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem 0}header[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;padding:0 2rem;gap:1rem}@media only screen and (max-width:768px){header[_ngcontent-%COMP%]{grid-template-columns:1fr}}sh-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}sh-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.content[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{padding:0 2rem}@media only screen and (max-width:768px){.content[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:.5rem}}sh-menu[_ngcontent-%COMP%]{color:red}.backups[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem;gap:.5rem}.backups.fallback[_ngcontent-%COMP%]{justify-content:center;align-items:center;padding:4rem;border:1px solid var(--base-4);background:var(--base-2);border-radius:var(--shape-2);width:calc(100% - 4rem);margin:0 auto}.no-backups[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;align-items:center}.backup[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem;gap:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10)}@media only screen and (max-width:768px){.backup[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start}}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;max-width:40%}@media only screen and (max-width:768px){.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{max-width:initial}}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font:var(--paragraph-30);color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--base-12)}.backup[_ngcontent-%COMP%] .tags[_ngcontent-%COMP%]{display:flex;align-items:center;flex-direction:column;gap:.5rem}.provider-icon[_ngcontent-%COMP%]{width:1.25rem;height:1.25rem}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.sortable[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none}.sortable[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{margin-left:.5rem;font-size:1rem;justify-self:flex-end;display:none}.sortable[_ngcontent-%COMP%]:not(.sort-asc):not(.sort-desc) sh-icon.filter[_ngcontent-%COMP%]{display:block}.sortable.sort-asc[_ngcontent-%COMP%] sh-icon.asc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}.sortable.sort-desc[_ngcontent-%COMP%] sh-icon.desc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}.actionable[_ngcontent-%COMP%]{cursor:pointer}.actionable[_ngcontent-%COMP%]:after{transition:inset .1s linear}.actionable[_ngcontent-%COMP%]:hover{--card-shp: 0}"],changeDetection:0})};export{ce as default};
package/chunk-UNQKMTFM.js DELETED
@@ -1 +0,0 @@
1
- import"./chunk-7CGTOI24.js";var o=[{path:"",loadComponent:()=>import("./chunk-P2EIEVFT.js"),children:[{path:"",redirectTo:"stored",pathMatch:"full"},{path:"stored",loadComponent:()=>import("./chunk-4ISFDBI3.js")},{path:"live",loadComponent:()=>import("./chunk-G7TNRWOU.js")}]}],t=o;export{t as default};
package/chunk-VZNLMGYP.js DELETED
@@ -1,2 +0,0 @@
1
- import{a as ge,c as Te,d as fe}from"./chunk-2EX5HS5X.js";import{h as Ce}from"./chunk-EVEI25GQ.js";import{a as ue}from"./chunk-NUV5LHQV.js";import{B as le,H as _e,K as se,P as pe,V as me,W as ce,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 c,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),c(3),l(4,"p"),c(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),c(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"),c(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"),c(10,"link"),s(),c(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),c(1,"Add a setting above to get started."),s())}function be(t,i){t&1&&(l(0,"sh-icon",32),c(1," warning-octagon "),s())}function Me(t,i){if(t&1&&(l(0,"span",33),c(1),s()),t&2){let e=r(2).$implicit;_(),N("--",e.FormView.name)}}function Pe(t,i){if(t&1&&c(0),t&2){let e=r(2).$implicit;N(" ",e.FormView.shortDescription," ")}}function Ee(t,i){if(t&1&&(l(0,"sh-icon",34),c(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),c(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,m=r(2);return u(m.updateFreeTextSettingName(a,n))}),s(),l(6,"sh-icon",38),c(7,"rectangle-dashed"),s()()(),l(8,"div")(9,"sh-form-field")(10,"input",37),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.updateSettingValue(a,n))}),s(),l(11,"sh-icon",38),c(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,m=r(2);return u(m.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)("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,m=r(2);return u(m.updateSettingValue(a,n))}),s()()}if(t&2){let e=r().$implicit,o=O(0);p("startingPath",e.Value())("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),c(1,"link"),s())}function Ke(t,i){t&1&&(l(0,"sh-icon",38),c(1,"hard-drives"),s())}function He(t,i){t&1&&(l(0,"sh-icon",38),c(1,"jar"),s())}function Je(t,i){t&1&&(l(0,"sh-icon",38),c(1,"envelope"),s())}function Xe(t,i){t&1&&(l(0,"sh-icon",38),c(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,m=r(2);return u(m.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)}),c(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)}),c(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,m=r(2);return u(m.updateSettingValue(a,n))}),s(),l(5,"sh-icon",38),c(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&&c(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,m=r(2);return u(m.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 m=g(10);p("options",o.FormView.options)("isClearable",!1)("optionTemplate",e),_(),p("for",a),_(),p("ngTemplateOutlet",n),_(),p("ngTemplateOutlet",m)("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,m=r(2);return u(m.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,m=r(2);return u(m.updateSettingValue(a,n))}),s(),l(5,"sh-icon",38),c(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 mt(t,i){t&1&&T(0)}function ct(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,mt,1,0,"ng-container",41),s(),l(4,"input",49),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.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&&c(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,m=r(2);return u(m.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 m=g(10);p("options",o.FormView.options)("selectMultiple",!0)("optionTemplate",e),_(),p("for",a),_(),p("ngTemplateOutlet",n),_(),p("ngTemplateOutlet",m)("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,m=r(2);return u(m.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,10,"app-file-tree",27)(7,ke,3,5,"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,ct,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"),c(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),c(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),c(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("--","")),m=n.Value??"";if(a&&i.includes(a.name))return null;if(a){if(a.type==="Boolean"&&(m=this.isTrue(m)),a.type==="Integer"&&(m=parseInt(m)||0),a.type==="Enumeration"&&a.options){let b=m?.trim().toLowerCase(),X=a.options.find(Oe=>(Oe??"").trim().toLocaleLowerCase()===b);X&&(m=X)}let y=xe.find(b=>b.name===a?.name);return y&&(a=I(I({},a),y)),D(I({},n),{Value:M(m),FormView:a})}else if(this.hasFreeTextSettings())return D(I({},n),{Value:M(m),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(m=>m.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 m=e?.trim().toLowerCase()??"",y=i.FormView.options.find(b=>(b??"").trim().toLocaleLowerCase()===m);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(m=>m.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 m;return m=$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","resolvePaths"],[3,"startingPath","resolvePaths"],[3,"inputType","ngModel","customId"],[1,"primary","raised"],["shButton","","type","button",1,"outlined","small","remove-btn",3,"click"],["shTooltip",m,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,me,_e,le,se,de,re,pe,ce],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};
package/chunk-Y47NRSCA.js DELETED
@@ -1 +0,0 @@
1
- import{o as a,p as b}from"./chunk-O2L2FRYE.js";import"./chunk-PNQ5BDQN.js";import"./chunk-2EX5HS5X.js";import"./chunk-EVEI25GQ.js";import"./chunk-6Q6SSTBK.js";import"./chunk-COEGVUM3.js";import"./chunk-KZYRTI62.js";import"./chunk-TSVSMVY4.js";import"./chunk-2KD757N6.js";import"./chunk-OP7MDR2B.js";import"./chunk-PEOYNJJM.js";import"./chunk-NUV5LHQV.js";import"./chunk-PDZNQW6F.js";import"./chunk-CJKZ27FM.js";import"./chunk-KNSQLQC6.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 createSourceDataForm,b as default};
package/main-S64CL44W.js DELETED
@@ -1 +0,0 @@
1
- import{b as Ie,c as ke}from"./chunk-GA3CAVSK.js";import{a as we}from"./chunk-NE255HQN.js";import{a as Ee}from"./chunk-B4QFOJXL.js";import{b as I}from"./chunk-UIVZWXBK.js";import"./chunk-E4CYVUYG.js";import{a as Me}from"./chunk-BPHX6VXP.js";import{b as Te}from"./chunk-XWML36YQ.js";import{a as V}from"./chunk-6Q6SSTBK.js";import{a as Se}from"./chunk-COEGVUM3.js";import"./chunk-YS4B2B5N.js";import"./chunk-OP7MDR2B.js";import"./chunk-PEOYNJJM.js";import{a as H}from"./chunk-NUV5LHQV.js";import{a as h,b as ye,c as v,d as Re,e as E}from"./chunk-PDZNQW6F.js";import{u as be,x as Ce}from"./chunk-CJKZ27FM.js";import{a as ge,e as ve}from"./chunk-KNSQLQC6.js";import{c as le,d as me,g as de,h as ue,i as he,j as fe}from"./chunk-CQJRBQ6I.js";import{a as ne}from"./chunk-V2UO7ES2.js";import{a as re,b as se,c as ie,e as ae,f as pe,g as ce}from"./chunk-HDDAGHHE.js";import{ha as te,ma as oe}from"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as s,A as P,B,G as J,Gb as Y,M as T,Mc as Z,Nc as ee,O as K,W as C,Z as _,f as F,g as W,hb as Q,ia as q,ja as z,l as $,m as G,q as w,qa as d,sa as X}from"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";var k=class e{#e=s(h);#d=s(v);ngOnInit(){ye(),this.#d.fetchConfig(),this.#e.clearAllNotCurrentVersion()}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=Q({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(t,n){t&1&&Y(0,"router-outlet")},dependencies:[le],encapsulation:2})};var Ae={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var f=new _("ENVIRONMENT");var A=class e{#e=s(ve);isLoaded=d(!1);webmodules=d(null);preload(o=!1){let t=this.#e.getApiV1Webmodules().pipe(K(n=>this.webmodules.set(n)),J(()=>this.isLoaded.set(!0)));if(o)return t;t.subscribe()}static \u0275fac=function(t){return new(t||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ue=()=>{let e=s(E);return e.token()?!0:e.checkProxyAuthed().pipe(T(o=>o?$(!0):e.refreshToken().pipe(w(()=>!0))))},je=()=>{let e=s(v),o=s(I),t=s(q),n=e.relayIsEnabled()?"longpoll":"websocket",i=[t.get(H).preload(!0),t.get(H).preloadFilterGroups(!0),t.get(A).preload(!0)];return e.configLoaded===null?P(i).pipe(w(()=>n)):e.configLoaded?.pipe(T(()=>P(i)))},Fe=()=>!0,Ne={path:"connect/:typeParam",loadComponent:()=>import("./chunk-MSIH2OJ5.js")},We=()=>{let e=s(h);return!e.getItem("locale")&&navigator.language&&e.setItem("locale",navigator.language),!0},Oe=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-PMF4FTBF.js")},{path:"logout",loadComponent:()=>import("./chunk-ZGQ2WCM2.js")},{path:"",canActivate:[Ue],children:[{path:"",canActivate:[je,Fe,We],children:[{path:"welcome",loadComponent:()=>import("./chunk-GNKCBZMS.js"),children:[{path:"",redirectTo:"select",pathMatch:"full"},{path:"select",loadComponent:()=>import("./chunk-AR5SEBWX.js")},Ne]},{path:"",loadComponent:()=>import("./chunk-ZXBKGNJU.js"),children:[{path:"",loadComponent:()=>import("./chunk-TV7OB7Y4.js")},Ne,{path:"destinations",loadComponent:()=>import("./chunk-T7RMSUHE.js")},{path:"add-backup",loadComponent:()=>import("./chunk-J7GH3G72.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-VTOEFKZG.js")},{path:"backup/import",loadComponent:()=>import("./chunk-A23UTI46.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-3V25RAVK.js"),loadChildren:()=>import("./chunk-MKI54WTC.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-3V25RAVK.js"),loadChildren:()=>import("./chunk-MKI54WTC.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-EBKOJDCT.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-JCXT6U5P.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-5QGFYH2A.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-KX3UP3HV.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-POVWDK74.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-XUCXLLB4.js")},{path:"from-config",loadComponent:()=>import("./chunk-3DHD6GQL.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-QW23XWNE.js"),loadChildren:()=>import("./chunk-HS3UDQIJ.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-QW23XWNE.js"),loadChildren:()=>import("./chunk-HS3UDQIJ.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-QW23XWNE.js"),loadChildren:()=>import("./chunk-HS3UDQIJ.js")},{path:"status",loadComponent:()=>import("./chunk-N5XYG3QW.js")},{path:"settings",loadComponent:()=>import("./chunk-5UJN5SN4.js")},{path:"about",loadComponent:()=>import("./chunk-NQAD2FBX.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-VOXTAZLZ.js")},{path:"changelog",loadComponent:()=>import("./chunk-VQLI7RDY.js")},{path:"libraries",loadComponent:()=>import("./chunk-PNRFCYAE.js")},{path:"system-info",loadComponent:()=>import("./chunk-7VQ67PEZ.js")},{path:"server-settings",loadComponent:()=>import("./chunk-JNZJE3GC.js")},{path:"logs",loadChildren:()=>import("./chunk-UNQKMTFM.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-TXCVGOPN.js")}]}]}]}]}]}];var xe=(e,o)=>{let t=s(E),n=s(me),i=s(h),p=s(f),m=i.getItem("locale"),a=s(Ce),g=Ie(m),r=ge.BASE||"",c=e.url===`${r}/api/v1/auth/login`,u=e.url===`${r}/api/v1/auth/logout`,S=e.url===`${r}/api/v1/auth/refresh`,y=e.url===`${r}/api/v1/progressstate`,x=e.url===`${r}/api/v1/remoteoperation/test`,M=e.url===`${r}/api/v1/filesystem/validate`,De=e.url.startsWith(`${r}/api/v2/`),L=t.token(),U=e,j=e.headers.has("custom-proxy-check")||L===Re;if(L&&e.url.startsWith(r+p.baseUrl)&&!j){let l=e.headers.set("Authorization",`Bearer ${L}`);m&&m!=="en-US"&&(l=l.set("X-Ui-Language",g)),U=e.clone({headers:l})}return o(U).pipe(w(l=>{if(l.type===4&&l.status===200&&De){let b=l.body;if(b?.Success===!1)throw{status:200,message:b?.Error??"Unknown error",error:{Error:b?.Error??"Unknown error"},requestBody:b}}return l}),B(l=>{let b=l.error?.Error||`Error Code: ${l.status}, Message: ${l.message}`;if(!j){let R=!0;if((y&&l.status===404||x||M)&&(R=!1),S&&l.status===401&&(R=!1,t.logout(),n.navigate(["/logout"])),!c&&!S&&!u&&l.status===401)return R=!1,t.refreshToken().pipe(T(()=>o(e.clone({headers:e.headers.set("Authorization",`Bearer ${t.token()}`)}))));R&&a.error(b)}return G(()=>({error:l,message:b}))}))};var N=class e{#e=s(z);showError(o){let t=this.#e.querySelector("body > .loading");if(!t)return;t.classList.add("has-error"),t.innerHTML="";let n=this.#e.createElement("div");n.classList.add("loading-title"),n.textContent="Unable to connect";let i=this.#e.createElement("div");i.classList.add("loading-error"),i.textContent=o||"Unknown error";let p=this.#e.createElement("button");p.type="button",p.classList.add("retry-button"),p.textContent="Retry",p.addEventListener("click",()=>{this.#e.defaultView?.location.reload()}),t.append(n,i,p)}static \u0275fac=function(t){return new(t||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};var $e="1.0.0",Le=`portal-proxy-client-${V()}`,Ge=1,O=class e{#e=1e3;#d=s(f);#u=s(N);#o=d("disconnected");#h=d(this.#e);#a=d(!1);#n=d(!1);#p=d(null);#c=d(null);#s=!1;isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#o.asReadonly();#l=[];#r={};#t=null;#f=new TextDecoder("utf-8");#m=null;#y=X(()=>{let o=this.#a(),t=this.#h(),n=this.#p(),i=this.#c();if(!n||!i||!o||!t||t<this.#e){this.#m&&window.clearInterval(this.#m);return}this.#m=window.setInterval(()=>{this.connectToMachineServer(n,i)},t)});#i(o){this.#s||(this.#s=!0,this.#u.showError(o||"Unable to connect to the server."))}#g(){this.#s||(this.#s=!0)}utf8Atob(o){let t=Uint8Array.from(atob(o),i=>i.charCodeAt(0)),n=this.#f.decode(t);return n?JSON.parse(n):null}connectToMachineServer(o,t,n){let i=n?.reconnect??!1,p=this.wsState();(p==="disconnected"||p==="error"||i)&&(this.#t?.close(),this.#t=null),!this.#t&&(this.#s=!1,this.#t=new WebSocket(t),this.#o.set("connecting"),this.#t.onopen=()=>{this.#o.set("connect"),this.#n.set(!0),this.#a.set(!1),this.#p.set(null),this.#c.set(null)},this.#t.onclose=()=>{this.#o.set("disconnected"),this.#n.set(!1),this.#p.set(o),this.#c.set(t),this.#a.set(!0)},this.#t.onerror=()=>{this.#o.set("error")},this.#t.onmessage=m=>{let a=JSON.parse(m.data);if(this.wsState()==="connect"){if(a.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${a.type}'`);return}let r={token:o,publicKey:"",clientVersion:$e,protocolVersion:Ge},c=this.createResponse(a,"authportal",r);this.#o.set("welcome"),this.#t?.send(c)}else if(this.wsState()==="welcome"){if(a.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${a.type}'`);return}var g=JSON.parse(a.payload??"");if(g.accepted===!1){this.#i("Authentication failed"),this.disconnectFromMachineServer("Authentication failed");return}for(this.#o.set("authenticated"),this.#n.set(!0);this.#l.length>0;){let r=this.#l.pop();r&&this.#r[r.messageId]&&this.activateCommand(r)}}else if(this.wsState()==="authenticated"){if(a.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${a.type}'`);return}let r=this.#r[a.messageId];if(r){if(a.errorMessage)this.#i(a.errorMessage),r.reject(a.errorMessage);else{let c=JSON.parse(a.payload??"");c.statusCode>=400?this.#i(c.body||`Initial request failed with status code ${c.statusCode}`):this.#g(),c.body=c?.body==null?null:this.utf8Atob(c.body),r.resolve(c)}delete this.#r[a.messageId],window.clearTimeout(r.timer)}}})}disconnectFromMachineServer(o=null){o&&console.error(o),this.#t?.close(),this.#t=null,this.#o.set("disconnected"),this.#n.set(!1)}createResponse(o,t,n){let i={from:Le,to:o.from,type:t,messageId:o.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(o,t,n,i,p,m,a,g=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(o,n),new Promise((r,c)=>{let u=V(),y={from:Le,to:t,type:"command",messageId:u,payload:JSON.stringify({method:i,path:p,body:m,headers:a})},x={resolve:r,reject:c,timer:window.setTimeout(()=>{let M=this.#r[u];M&&(delete this.#r[u],this.#i("The request timed out before receiving a response."),M.reject("Timeout"))},g)};this.#r[u]=x,this.#n()?this.activateCommand(y):this.#l.push(y)})}activateCommand(o){this.#t?.send(JSON.stringify(o))}static \u0275fac=function(t){return new(t||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};function Be(e){if(typeof e!="string")return null;let t=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...t))}function Pe(e,o,t){let n=e.relayconfigState.config();if(n===null)return t(o);let i=Be(o.body),p={};o.headers.keys().forEach(r=>{p[r]=o.headers.get(r)??""});let m=o.headers.get("timeout"),a=m!==null?parseInt(m):e.defaultTimeout;o.url.startsWith("/api/v1/serverstate")&&o.url.includes("longpoll=true")&&(a=1e3*99);let g=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,n.machineServerUrl,o.method,o.url,i,p,a);return new F(r=>{g.then(c=>{let u=new re;p!=null&&Object.keys(p).forEach(y=>{u.set(y,p[y])});let S=new se({body:c.body,status:c.statusCode,statusText:"OK",headers:u});r.next(S),r.complete()}).catch(c=>{r.error(new ie({error:c??"Unknown error",status:0,statusText:c??"Unknown error"}))})})}var He=(e,o)=>{let t={relayconfigState:s(v),defaultTimeout:s(f).defaultTimeout,relayWebsocket:s(O)},n=t.relayconfigState.config();if(t.relayconfigState.configLoaded!==null&&n===null){let i=new W;return t.relayconfigState.configLoaded.subscribe(p=>{p&&Pe(t,e,o).subscribe(i)}),i}return Pe(t,e,o)};var Ve={providers:[Z(),ue(Oe,fe(),he(de)),ae(ce(),pe([He,xe])),h,{provide:f,useValue:Ae},{provide:ee,useValue:ke()},{provide:be,useValue:{alertVariant:"simple"}},we,I,Te,oe,Se,te,Me,Ee]};ne(k,Ve);